Skip to content

Commit

Permalink
chore: conflicts and removed unnecessary files
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitwaghchaure committed Aug 7, 2023
1 parent 2237930 commit f28db65
Show file tree
Hide file tree
Showing 10 changed files with 180 additions and 238 deletions.
18 changes: 16 additions & 2 deletions erpnext/manufacturing/doctype/bom/bom.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@
"web_long_description",
"reference_section",
"bom_creator",
"bom_creator_item",
"column_break_oxbz",
"amended_from",
"connections_tab"
],
Expand Down Expand Up @@ -610,19 +612,31 @@
{
"fieldname": "bom_creator",
"fieldtype": "Link",
"label": "BOM Configurator",
"label": "BOM Creator",
"no_copy": 1,
"options": "BOM Creator",
"print_hide": 1,
"read_only": 1
},
{
"fieldname": "bom_creator_item",
"fieldtype": "Data",
"label": "BOM Creator Item",
"no_copy": 1,
"print_hide": 1,
"read_only": 1
},
{
"fieldname": "column_break_oxbz",
"fieldtype": "Column Break"
}
],
"icon": "fa fa-sitemap",
"idx": 1,
"image_field": "image",
"is_submittable": 1,
"links": [],
"modified": "2023-08-04 14:27:32.961309",
"modified": "2023-08-07 11:38:08.152294",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "BOM",
Expand Down
18 changes: 18 additions & 0 deletions erpnext/manufacturing/doctype/bom/bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ def on_update(self):

def on_submit(self):
self.manage_default_bom()
self.update_bom_creator_status()

def on_cancel(self):
self.db_set("is_active", 0)
Expand All @@ -214,6 +215,23 @@ def on_cancel(self):
# check if used in any other bom
self.validate_bom_links()
self.manage_default_bom()
self.update_bom_creator_status()

def update_bom_creator_status(self):
if not self.bom_creator:
return

if self.bom_creator_item:
frappe.db.set_value(
"BOM Creator Item",
self.bom_creator_item,
"bom_created",
1 if self.docstatus == 1 else 0,
update_modified=False,
)

doc = frappe.get_doc("BOM Creator", self.bom_creator)
doc.set_status(save=True)

def on_update_after_submit(self):
self.validate_bom_links()
Expand Down
Empty file.

This file was deleted.

This file was deleted.

34 changes: 31 additions & 3 deletions erpnext/manufacturing/doctype/bom_creator/bom_creator.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,17 @@
"raw_material_cost",
"remarks_tab",
"remarks",
"section_break_yixm",
"status",
"column_break_irab",
"error_log",
"connections_tab",
"amended_from"
],
"fields": [
{
"fieldname": "company",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Company",
"options": "Company",
"remember_last_selected_value": 1,
Expand Down Expand Up @@ -106,7 +109,6 @@
{
"fieldname": "conversion_rate",
"fieldtype": "Float",
"in_list_view": 1,
"label": "Conversion Rate",
"precision": "9",
"reqd": 1
Expand All @@ -133,6 +135,7 @@
{
"fieldname": "raw_material_cost",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Total Cost",
"no_copy": 1,
"options": "currency",
Expand All @@ -156,6 +159,8 @@
{
"fieldname": "item_code",
"fieldtype": "Link",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Finished Good",
"options": "Item",
"reqd": 1
Expand Down Expand Up @@ -250,6 +255,29 @@
"fieldname": "set_rate_based_on_warehouse",
"fieldtype": "Check",
"label": "Set Valuation Rate Based on Source Warehouse"
},
{
"fieldname": "section_break_yixm",
"fieldtype": "Section Break"
},
{
"default": "Draft",
"fieldname": "status",
"fieldtype": "Select",
"label": "Status",
"no_copy": 1,
"options": "Draft\nSubmitted\nIn Progress\nCompleted\nFailed\nCancelled",
"read_only": 1
},
{
"fieldname": "column_break_irab",
"fieldtype": "Column Break"
},
{
"fieldname": "error_log",
"fieldtype": "Text",
"label": "Error Log",
"read_only": 1
}
],
"icon": "fa fa-sitemap",
Expand All @@ -260,7 +288,7 @@
"link_fieldname": "bom_creator"
}
],
"modified": "2023-08-04 14:29:51.375361",
"modified": "2023-08-07 13:42:20.270471",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "BOM Creator",
Expand Down
Loading

0 comments on commit f28db65

Please sign in to comment.