fix: internal transfer flow

This commit is contained in:
Rohit Waghchaure
2022-09-06 16:22:00 +05:30
parent 404668fcc9
commit 4bac0daf9b
13 changed files with 257 additions and 23 deletions

View File

@@ -373,7 +373,7 @@ class AccountsController(TransactionBase):
)
def validate_inter_company_reference(self):
if self.doctype not in ("Purchase Invoice", "Purchase Receipt", "Purchase Order"):
if self.doctype not in ("Purchase Invoice", "Purchase Receipt"):
return
if self.is_internal_transfer():

View File

@@ -307,6 +307,20 @@ class StatusUpdater(Document):
def limits_crossed_error(self, args, item, qty_or_amount):
"""Raise exception for limits crossed"""
if (
self.doctype in ["Sales Invoice", "Delivery Note"]
and qty_or_amount == "amount"
and self.is_internal_customer
):
return
elif (
self.doctype in ["Purchase Invoice", "Purchase Receipt"]
and qty_or_amount == "amount"
and self.is_internal_supplier
):
return
if qty_or_amount == "qty":
action_msg = _(
'To allow over receipt / delivery, update "Over Receipt/Delivery Allowance" in Stock Settings or the Item.'