Merge pull request #8007 from rohitwaghchaure/pos_profile_issue
[fix] Value assignment issue for country field in pos profile
diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py
index cfbd1b2..471263f 100644
--- a/erpnext/accounts/doctype/sales_invoice/pos.py
+++ b/erpnext/accounts/doctype/sales_invoice/pos.py
@@ -63,8 +63,8 @@
def update_pos_profile_data(doc, pos_profile, company_data):
doc.campaign = pos_profile.get('campaign')
- if not pos_profile.get('country'):
- pos_profile["country"] = company_data.country
+ if pos_profile and not pos_profile.get('country'):
+ pos_profile.country = company_data.country
doc.write_off_account = pos_profile.get('write_off_account') or \
company_data.write_off_account