fix: don't assign the advance payment entries if Allocate Advances Automatically is disabled

This commit is contained in:
Rohit Waghchaure 2019-04-10 16:16:30 +05:30
parent 4873875c1c
commit b286fc99b8
4 changed files with 323 additions and 4 deletions

File diff suppressed because it is too large Load Diff

View File

@ -379,7 +379,9 @@ def make_purchase_invoice(source_name, target_doc=None):
def postprocess(source, target):
set_missing_values(source, target)
#Get the advance paid Journal Entries in Purchase Invoice Advance
target.set_advances()
if target.get("allocate_advances_automatically"):
target.set_advances()
def update_item(obj, target, source_parent):
target.amount = flt(obj.amount) - flt(obj.billed_amt)

View File

@ -612,7 +612,8 @@ def make_sales_invoice(source_name, target_doc=None, ignore_permissions=False):
def postprocess(source, target):
set_missing_values(source, target)
#Get the advance paid Journal Entries in Sales Invoice Advance
target.set_advances()
if target.get("allocate_advances_automatically"):
target.set_advances()
def set_missing_values(source, target):
target.is_pos = 0