[sales/purchase] [minor] Set tax table on insert if tax master set, but table missing
This commit is contained in:
parent
e752e771e5
commit
e89c533eaa
@ -17,7 +17,6 @@ class BuyingController(StockController):
|
|||||||
def onload_post_render(self):
|
def onload_post_render(self):
|
||||||
# contact, address, item details
|
# contact, address, item details
|
||||||
self.set_missing_values()
|
self.set_missing_values()
|
||||||
self.set_taxes("purchase_tax_details", "purchase_other_charges")
|
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
super(BuyingController, self).validate()
|
super(BuyingController, self).validate()
|
||||||
@ -40,6 +39,8 @@ class BuyingController(StockController):
|
|||||||
self.doc.fields[fieldname] = val
|
self.doc.fields[fieldname] = val
|
||||||
|
|
||||||
self.set_missing_item_details(get_item_details)
|
self.set_missing_item_details(get_item_details)
|
||||||
|
if self.doc.fields.get("__islocal"):
|
||||||
|
self.set_taxes("purchase_tax_details", "purchase_other_charges")
|
||||||
|
|
||||||
def set_supplier_from_item_default(self):
|
def set_supplier_from_item_default(self):
|
||||||
if self.meta.get_field("supplier") and not self.doc.supplier:
|
if self.meta.get_field("supplier") and not self.doc.supplier:
|
||||||
|
@ -14,15 +14,15 @@ class SellingController(StockController):
|
|||||||
def onload_post_render(self):
|
def onload_post_render(self):
|
||||||
# contact, address, item details and pos details (if applicable)
|
# contact, address, item details and pos details (if applicable)
|
||||||
self.set_missing_values()
|
self.set_missing_values()
|
||||||
self.set_taxes("other_charges", "charge")
|
|
||||||
|
|
||||||
def set_missing_values(self, for_validate=False):
|
def set_missing_values(self, for_validate=False):
|
||||||
super(SellingController, self).set_missing_values(for_validate)
|
super(SellingController, self).set_missing_values(for_validate)
|
||||||
|
|
||||||
# set contact and address details for customer, if they are not mentioned
|
# set contact and address details for customer, if they are not mentioned
|
||||||
self.set_missing_lead_customer_details()
|
self.set_missing_lead_customer_details()
|
||||||
|
|
||||||
self.set_price_list_and_item_details()
|
self.set_price_list_and_item_details()
|
||||||
|
if self.doc.fields.get("__islocal"):
|
||||||
|
self.set_taxes("other_charges", "charge")
|
||||||
|
|
||||||
def set_missing_lead_customer_details(self):
|
def set_missing_lead_customer_details(self):
|
||||||
if self.doc.customer:
|
if self.doc.customer:
|
||||||
|
Loading…
Reference in New Issue
Block a user