Merge branch 'develop' into rounded-salary-tax
This commit is contained in:
commit
acac41d62b
@ -20,13 +20,12 @@ class BOMUpdateTool(Document):
|
|||||||
for bom in bom_list:
|
for bom in bom_list:
|
||||||
try:
|
try:
|
||||||
bom_obj = frappe.get_doc("BOM", bom)
|
bom_obj = frappe.get_doc("BOM", bom)
|
||||||
bom_obj.get_doc_before_save()
|
bom_obj.load_doc_before_save()
|
||||||
updated_bom = bom_obj.update_cost_and_exploded_items(updated_bom)
|
updated_bom = bom_obj.update_cost_and_exploded_items(updated_bom)
|
||||||
bom_obj.calculate_cost()
|
bom_obj.calculate_cost()
|
||||||
bom_obj.update_parent_cost()
|
bom_obj.update_parent_cost()
|
||||||
bom_obj.db_update()
|
bom_obj.db_update()
|
||||||
if (getattr(bom_obj.meta, 'track_changes', False)
|
if (getattr(bom_obj.meta, 'track_changes', False) and not bom_obj.flags.ignore_version):
|
||||||
and bom_obj._doc_before_save and not bom_obj.flags.ignore_version):
|
|
||||||
bom_obj.save_version()
|
bom_obj.save_version()
|
||||||
|
|
||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
@ -37,7 +36,7 @@ class BOMUpdateTool(Document):
|
|||||||
def validate_bom(self):
|
def validate_bom(self):
|
||||||
if cstr(self.current_bom) == cstr(self.new_bom):
|
if cstr(self.current_bom) == cstr(self.new_bom):
|
||||||
frappe.throw(_("Current BOM and New BOM can not be same"))
|
frappe.throw(_("Current BOM and New BOM can not be same"))
|
||||||
|
|
||||||
if frappe.db.get_value("BOM", self.current_bom, "item") \
|
if frappe.db.get_value("BOM", self.current_bom, "item") \
|
||||||
!= frappe.db.get_value("BOM", self.new_bom, "item"):
|
!= frappe.db.get_value("BOM", self.new_bom, "item"):
|
||||||
frappe.throw(_("The selected BOMs are not for the same item"))
|
frappe.throw(_("The selected BOMs are not for the same item"))
|
||||||
|
@ -90,8 +90,6 @@ class Item(WebsiteGenerator):
|
|||||||
self.set_opening_stock()
|
self.set_opening_stock()
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.get_doc_before_save()
|
|
||||||
|
|
||||||
super(Item, self).validate()
|
super(Item, self).validate()
|
||||||
|
|
||||||
if not self.item_name:
|
if not self.item_name:
|
||||||
|
@ -154,10 +154,10 @@ def get_opening_balance(filters, columns):
|
|||||||
"posting_date": filters.from_date,
|
"posting_date": filters.from_date,
|
||||||
"posting_time": "00:00:00"
|
"posting_time": "00:00:00"
|
||||||
})
|
})
|
||||||
row = [""]*len(columns)
|
row = {}
|
||||||
row[1] = _("'Opening'")
|
row["item_code"] = _("'Opening'")
|
||||||
for i, v in ((9, 'qty_after_transaction'), (11, 'valuation_rate'), (12, 'stock_value')):
|
for dummy, v in ((9, 'qty_after_transaction'), (11, 'valuation_rate'), (12, 'stock_value')):
|
||||||
row[i] = last_entry.get(v, 0)
|
row[v] = last_entry.get(v, 0)
|
||||||
|
|
||||||
return row
|
return row
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user