mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-07 23:31:20 +00:00
[fix] [minor] fixed conflict while merging with master
This commit is contained in:
@@ -30,6 +30,7 @@ class BuyingController(StockController):
|
||||
def set_missing_values(self, for_validate=False):
|
||||
super(BuyingController, self).set_missing_values(for_validate)
|
||||
|
||||
self.set_supplier_from_item_default()
|
||||
self.set_price_list_currency("Buying")
|
||||
|
||||
# set contact and address details for supplier, if they are not mentioned
|
||||
@@ -40,6 +41,14 @@ class BuyingController(StockController):
|
||||
|
||||
self.set_missing_item_details(get_item_details)
|
||||
|
||||
def set_supplier_from_item_default(self):
|
||||
if self.meta.get_field("supplier") and not self.doc.supplier:
|
||||
for d in self.doclist.get({"doctype": self.tname}):
|
||||
supplier = webnotes.conn.get_value("Item", d.item_code, "default_supplier")
|
||||
if supplier:
|
||||
self.doc.supplier = supplier
|
||||
break
|
||||
|
||||
def get_purchase_tax_details(self):
|
||||
self.doclist = self.doc.clear_table(self.doclist, "purchase_tax_details")
|
||||
self.set_taxes("purchase_tax_details", "purchase_other_charges")
|
||||
@@ -89,7 +98,7 @@ class BuyingController(StockController):
|
||||
|
||||
if item.discount_rate == 100.0:
|
||||
item.import_rate = 0.0
|
||||
elif item.import_ref_rate:
|
||||
elif not item.import_rate:
|
||||
item.import_rate = flt(item.import_ref_rate * (1.0 - (item.discount_rate / 100.0)),
|
||||
self.precision("import_rate", item))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user