fix: Breaking cost center validation
This commit is contained in:
parent
8be414873b
commit
a60c3081cf
@ -368,6 +368,11 @@ class AccountsController(TransactionBase):
|
||||
if self.doctype in ["Purchase Invoice", "Sales Invoice"] and item.meta.get_field('is_fixed_asset'):
|
||||
item.set('is_fixed_asset', ret.get('is_fixed_asset', 0))
|
||||
|
||||
# Double check for cost center
|
||||
# Items add via promotional scheme may not have cost center set
|
||||
if hasattr(item, 'cost_center') and not item.get('cost_center'):
|
||||
item.set('cost_center', self.get('cost_center') or erpnext.get_default_cost_center(self.company))
|
||||
|
||||
if ret.get("pricing_rules"):
|
||||
self.apply_pricing_rule_on_items(item, ret)
|
||||
self.set_pricing_rule_details(item, ret)
|
||||
|
Loading…
x
Reference in New Issue
Block a user