Merge branch 'develop' into fix-depr-after-sale
This commit is contained in:
commit
8774862c8d
@ -133,6 +133,7 @@ def supplier_query(doctype, txt, searchfield, start, page_len, filters):
|
|||||||
where docstatus < 2
|
where docstatus < 2
|
||||||
and ({key} like %(txt)s
|
and ({key} like %(txt)s
|
||||||
or supplier_name like %(txt)s) and disabled=0
|
or supplier_name like %(txt)s) and disabled=0
|
||||||
|
and (on_hold = 0 or (on_hold = 1 and CURDATE() > release_date))
|
||||||
{mcond}
|
{mcond}
|
||||||
order by
|
order by
|
||||||
if(locate(%(_txt)s, name), locate(%(_txt)s, name), 99999),
|
if(locate(%(_txt)s, name), locate(%(_txt)s, name), 99999),
|
||||||
|
@ -182,6 +182,7 @@
|
|||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"default": "1.0",
|
||||||
"fieldname": "qty",
|
"fieldname": "qty",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"label": "Qty To Manufacture",
|
"label": "Qty To Manufacture",
|
||||||
@ -572,10 +573,11 @@
|
|||||||
"image_field": "image",
|
"image_field": "image",
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-08-24 15:14:03.844937",
|
"modified": "2021-10-27 19:21:35.139888",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Manufacturing",
|
"module": "Manufacturing",
|
||||||
"name": "Work Order",
|
"name": "Work Order",
|
||||||
|
"naming_rule": "By \"Naming Series\" field",
|
||||||
"nsm_parent_field": "parent_work_order",
|
"nsm_parent_field": "parent_work_order",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
|
@ -685,9 +685,7 @@ class WorkOrder(Document):
|
|||||||
if not d.operation:
|
if not d.operation:
|
||||||
d.operation = operation
|
d.operation = operation
|
||||||
else:
|
else:
|
||||||
# Attribute a big number (999) to idx for sorting putpose in case idx is NULL
|
for item in sorted(item_dict.values(), key=lambda d: d['idx'] or float('inf')):
|
||||||
# For instance in BOM Explosion Item child table, the items coming from sub assembly items
|
|
||||||
for item in sorted(item_dict.values(), key=lambda d: d['idx'] or 9999):
|
|
||||||
self.append('required_items', {
|
self.append('required_items', {
|
||||||
'rate': item.rate,
|
'rate': item.rate,
|
||||||
'amount': item.rate * item.qty,
|
'amount': item.rate * item.qty,
|
||||||
|
@ -113,15 +113,15 @@ function get_filters() {
|
|||||||
"fieldname":"period_start_date",
|
"fieldname":"period_start_date",
|
||||||
"label": __("Start Date"),
|
"label": __("Start Date"),
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 1,
|
"reqd": 1,
|
||||||
"reqd": 1
|
"depends_on": "eval:doc.filter_based_on == 'Date Range'"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname":"period_end_date",
|
"fieldname":"period_end_date",
|
||||||
"label": __("End Date"),
|
"label": __("End Date"),
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 1,
|
"reqd": 1,
|
||||||
"reqd": 1
|
"depends_on": "eval:doc.filter_based_on == 'Date Range'"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname":"from_fiscal_year",
|
"fieldname":"from_fiscal_year",
|
||||||
@ -129,7 +129,8 @@ function get_filters() {
|
|||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"options": "Fiscal Year",
|
"options": "Fiscal Year",
|
||||||
"default": frappe.defaults.get_user_default("fiscal_year"),
|
"default": frappe.defaults.get_user_default("fiscal_year"),
|
||||||
"reqd": 1
|
"reqd": 1,
|
||||||
|
"depends_on": "eval:doc.filter_based_on == 'Fiscal Year'"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname":"to_fiscal_year",
|
"fieldname":"to_fiscal_year",
|
||||||
@ -137,7 +138,8 @@ function get_filters() {
|
|||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"options": "Fiscal Year",
|
"options": "Fiscal Year",
|
||||||
"default": frappe.defaults.get_user_default("fiscal_year"),
|
"default": frappe.defaults.get_user_default("fiscal_year"),
|
||||||
"reqd": 1
|
"reqd": 1,
|
||||||
|
"depends_on": "eval:doc.filter_based_on == 'Fiscal Year'"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "periodicity",
|
"fieldname": "periodicity",
|
||||||
|
@ -25,19 +25,29 @@ class ItemAlternative(Document):
|
|||||||
frappe.throw(_("Alternative item must not be same as item code"))
|
frappe.throw(_("Alternative item must not be same as item code"))
|
||||||
|
|
||||||
item_meta = frappe.get_meta("Item")
|
item_meta = frappe.get_meta("Item")
|
||||||
fields = ["is_stock_item", "include_item_in_manufacturing","has_serial_no","has_batch_no"]
|
fields = ["is_stock_item", "include_item_in_manufacturing","has_serial_no", "has_batch_no", "allow_alternative_item"]
|
||||||
item_data = frappe.db.get_values("Item", self.item_code, fields, as_dict=1)
|
item_data = frappe.db.get_value("Item", self.item_code, fields, as_dict=1)
|
||||||
alternative_item_data = frappe.db.get_values("Item", self.alternative_item_code, fields, as_dict=1)
|
alternative_item_data = frappe.db.get_value("Item", self.alternative_item_code, fields, as_dict=1)
|
||||||
|
|
||||||
for field in fields:
|
for field in fields:
|
||||||
if item_data[0].get(field) != alternative_item_data[0].get(field):
|
if item_data.get(field) != alternative_item_data.get(field):
|
||||||
raise_exception, alert = [1, False] if field == "is_stock_item" else [0, True]
|
raise_exception, alert = [1, False] if field == "is_stock_item" else [0, True]
|
||||||
|
|
||||||
frappe.msgprint(_("The value of {0} differs between Items {1} and {2}") \
|
frappe.msgprint(_("The value of {0} differs between Items {1} and {2}") \
|
||||||
.format(frappe.bold(item_meta.get_label(field)),
|
.format(frappe.bold(item_meta.get_label(field)),
|
||||||
frappe.bold(self.alternative_item_code),
|
frappe.bold(self.alternative_item_code),
|
||||||
frappe.bold(self.item_code)),
|
frappe.bold(self.item_code)),
|
||||||
alert=alert, raise_exception=raise_exception)
|
alert=alert, raise_exception=raise_exception, indicator="Orange")
|
||||||
|
|
||||||
|
alternate_item_check_msg = _("Allow Alternative Item must be checked on Item {}")
|
||||||
|
|
||||||
|
if not item_data.allow_alternative_item:
|
||||||
|
frappe.throw(alternate_item_check_msg.format(self.item_code))
|
||||||
|
if self.two_way and not alternative_item_data.allow_alternative_item:
|
||||||
|
frappe.throw(alternate_item_check_msg.format(self.item_code))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def validate_duplicate(self):
|
def validate_duplicate(self):
|
||||||
if frappe.db.get_value("Item Alternative", {'item_code': self.item_code,
|
if frappe.db.get_value("Item Alternative", {'item_code': self.item_code,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user