Merge pull request #51014 from mihir-kandoi/gh42653-3

This commit is contained in:
Mihir Kandoi
2025-12-11 11:35:33 +05:30
committed by GitHub
2 changed files with 26 additions and 0 deletions

View File

@@ -81,6 +81,19 @@ class BuyingController(SubcontractingController):
),
)
if (
self.get("company")
and (
default_buying_terms := frappe.get_value(
"Company", self.get("company"), "default_buying_terms"
)
)
and not self.get("tc_name")
and not self.get("terms")
):
self.tc_name = default_buying_terms
self.terms = frappe.get_value("Terms and Conditions", self.get("tc_name"), "terms")
def validate_posting_date_with_po(self):
po_list = {x.purchase_order for x in self.items if x.purchase_order}

View File

@@ -43,6 +43,19 @@ class SellingController(StockController):
),
)
if (
self.get("company")
and (
default_selling_terms := frappe.get_value(
"Company", self.get("company"), "default_selling_terms"
)
)
and not self.get("tc_name")
and not self.get("terms")
):
self.tc_name = default_selling_terms
self.terms = frappe.get_value("Terms and Conditions", self.get("tc_name"), "terms")
def validate(self):
super().validate()
self.validate_items()