Merge branch 'develop' into employee-leave-balance-summary
This commit is contained in:
commit
d2f22b52a5
@ -292,12 +292,6 @@ class Asset(AccountsController):
|
|||||||
if self.status not in ("Submitted", "Partially Depreciated", "Fully Depreciated"):
|
if self.status not in ("Submitted", "Partially Depreciated", "Fully Depreciated"):
|
||||||
frappe.throw(_("Asset cannot be cancelled, as it is already {0}").format(self.status))
|
frappe.throw(_("Asset cannot be cancelled, as it is already {0}").format(self.status))
|
||||||
|
|
||||||
if self.purchase_invoice:
|
|
||||||
frappe.throw(_("Please cancel Purchase Invoice {0} first").format(self.purchase_invoice))
|
|
||||||
|
|
||||||
if self.purchase_receipt:
|
|
||||||
frappe.throw(_("Please cancel Purchase Receipt {0} first").format(self.purchase_receipt))
|
|
||||||
|
|
||||||
def delete_depreciation_entries(self):
|
def delete_depreciation_entries(self):
|
||||||
for d in self.get("schedules"):
|
for d in self.get("schedules"):
|
||||||
if d.journal_entry:
|
if d.journal_entry:
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
|
frappe.reload_doc('stock', 'doctype', 'item_variant_attribute')
|
||||||
frappe.db.sql('''
|
frappe.db.sql('''
|
||||||
UPDATE `tabItem Variant Attribute` t1
|
UPDATE `tabItem Variant Attribute` t1
|
||||||
INNER JOIN `tabItem` t2 ON t2.name = t1.parent
|
INNER JOIN `tabItem` t2 ON t2.name = t1.parent
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{%- macro format_float(value) -%}
|
{%- macro format_float(value, precision=2) -%}
|
||||||
{{ "%.2f" % value|abs }}
|
{{ value|round(frappe.utils.cint(precision)) }}
|
||||||
{%- endmacro -%}
|
{%- endmacro -%}
|
||||||
|
|
||||||
{%- macro render_address(address) %}
|
{%- macro render_address(address) %}
|
||||||
@ -182,10 +182,10 @@
|
|||||||
<Descrizione>{{ html2text(item.description or '') or item.item_name }}</Descrizione>
|
<Descrizione>{{ html2text(item.description or '') or item.item_name }}</Descrizione>
|
||||||
<Quantita>{{ format_float(item.qty) }}</Quantita>
|
<Quantita>{{ format_float(item.qty) }}</Quantita>
|
||||||
<UnitaMisura>{{ item.stock_uom }}</UnitaMisura>
|
<UnitaMisura>{{ item.stock_uom }}</UnitaMisura>
|
||||||
<PrezzoUnitario>{{ format_float(item.price_list_rate or item.rate) }}</PrezzoUnitario>
|
<PrezzoUnitario>{{ format_float(item.price_list_rate or item.rate, item_meta.get_field("rate").precision) }}</PrezzoUnitario>
|
||||||
{{ render_discount_or_margin(item) }}
|
{{ render_discount_or_margin(item) }}
|
||||||
<PrezzoTotale>{{ format_float(item.amount) }}</PrezzoTotale>
|
<PrezzoTotale>{{ format_float(item.amount, item_meta.get_field("amount").precision) }}</PrezzoTotale>
|
||||||
<AliquotaIVA>{{ format_float(item.tax_rate) }}</AliquotaIVA>
|
<AliquotaIVA>{{ format_float(item.tax_rate, item_meta.get_field("tax_rate").precision) }}</AliquotaIVA>
|
||||||
{%- if item.tax_exemption_reason %}
|
{%- if item.tax_exemption_reason %}
|
||||||
<Natura>{{ item.tax_exemption_reason.split("-")[0] }}</Natura>
|
<Natura>{{ item.tax_exemption_reason.split("-")[0] }}</Natura>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
@ -197,8 +197,8 @@
|
|||||||
{%- if data.tax_exemption_reason %}
|
{%- if data.tax_exemption_reason %}
|
||||||
<Natura>{{ data.tax_exemption_reason.split("-")[0] }}</Natura>
|
<Natura>{{ data.tax_exemption_reason.split("-")[0] }}</Natura>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
<ImponibileImporto>{{ format_float(data.taxable_amount) }}</ImponibileImporto>
|
<ImponibileImporto>{{ format_float(data.taxable_amount, item_meta.get_field("tax_amount").precision) }}</ImponibileImporto>
|
||||||
<Imposta>{{ format_float(data.tax_amount) }}</Imposta>
|
<Imposta>{{ format_float(data.tax_amount, item_meta.get_field("tax_amount").precision) }}</Imposta>
|
||||||
<EsigibilitaIVA>{{ doc.vat_collectability.split("-")[0] }}</EsigibilitaIVA>
|
<EsigibilitaIVA>{{ doc.vat_collectability.split("-")[0] }}</EsigibilitaIVA>
|
||||||
{%- if data.tax_exemption_law %}
|
{%- if data.tax_exemption_law %}
|
||||||
<RiferimentoNormativo>{{ data.tax_exemption_law }}</RiferimentoNormativo>
|
<RiferimentoNormativo>{{ data.tax_exemption_law }}</RiferimentoNormativo>
|
||||||
|
@ -151,7 +151,8 @@ def get_invoice_summary(items, taxes):
|
|||||||
tax_rate=tax.rate,
|
tax_rate=tax.rate,
|
||||||
tax_amount=(reference_row.tax_amount * tax.rate) / 100,
|
tax_amount=(reference_row.tax_amount * tax.rate) / 100,
|
||||||
net_amount=reference_row.tax_amount,
|
net_amount=reference_row.tax_amount,
|
||||||
taxable_amount=reference_row.tax_amount,
|
taxable_amount=(reference_row.tax_amount if tax.charge_type == 'On Previous Row Amount'
|
||||||
|
else reference_row.total),
|
||||||
item_tax_rate={tax.account_head: tax.rate},
|
item_tax_rate={tax.account_head: tax.rate},
|
||||||
charges=True
|
charges=True
|
||||||
)
|
)
|
||||||
@ -278,7 +279,11 @@ def prepare_and_attach_invoice(doc, replace=False):
|
|||||||
progressive_name, progressive_number = get_progressive_name_and_number(doc, replace)
|
progressive_name, progressive_number = get_progressive_name_and_number(doc, replace)
|
||||||
|
|
||||||
invoice = prepare_invoice(doc, progressive_number)
|
invoice = prepare_invoice(doc, progressive_number)
|
||||||
invoice_xml = frappe.render_template('erpnext/regional/italy/e-invoice.xml', context={"doc": invoice}, is_path=True)
|
item_meta = frappe.get_meta("Sales Invoice Item")
|
||||||
|
|
||||||
|
invoice_xml = frappe.render_template('erpnext/regional/italy/e-invoice.xml',
|
||||||
|
context={"doc": invoice, "item_meta": item_meta}, is_path=True)
|
||||||
|
|
||||||
invoice_xml = invoice_xml.replace("&", "&")
|
invoice_xml = invoice_xml.replace("&", "&")
|
||||||
|
|
||||||
xml_filename = progressive_name + ".xml"
|
xml_filename = progressive_name + ".xml"
|
||||||
|
@ -1,685 +1,203 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
"creation": "2013-02-22 01:28:00",
|
||||||
"allow_import": 0,
|
"doctype": "DocType",
|
||||||
"allow_rename": 0,
|
"editable_grid": 1,
|
||||||
"beta": 0,
|
"engine": "InnoDB",
|
||||||
"creation": "2013-02-22 01:28:00",
|
"field_order": [
|
||||||
"custom": 0,
|
"parent_item",
|
||||||
"docstatus": 0,
|
"item_code",
|
||||||
"doctype": "DocType",
|
"item_name",
|
||||||
"editable_grid": 1,
|
"column_break_5",
|
||||||
"engine": "InnoDB",
|
"description",
|
||||||
|
"section_break_6",
|
||||||
|
"warehouse",
|
||||||
|
"target_warehouse",
|
||||||
|
"column_break_9",
|
||||||
|
"qty",
|
||||||
|
"section_break_9",
|
||||||
|
"serial_no",
|
||||||
|
"column_break_11",
|
||||||
|
"batch_no",
|
||||||
|
"section_break_13",
|
||||||
|
"actual_qty",
|
||||||
|
"projected_qty",
|
||||||
|
"column_break_16",
|
||||||
|
"uom",
|
||||||
|
"page_break",
|
||||||
|
"prevdoc_doctype",
|
||||||
|
"parent_detail_docname"
|
||||||
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"fieldname": "parent_item",
|
||||||
"bold": 0,
|
"fieldtype": "Link",
|
||||||
"collapsible": 0,
|
"in_list_view": 1,
|
||||||
"columns": 0,
|
"label": "Parent Item",
|
||||||
"fieldname": "parent_item",
|
"oldfieldname": "parent_item",
|
||||||
"fieldtype": "Link",
|
"oldfieldtype": "Link",
|
||||||
"hidden": 0,
|
"options": "Item",
|
||||||
"ignore_user_permissions": 0,
|
"read_only": 1
|
||||||
"ignore_xss_filter": 0,
|
},
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Parent Item",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "parent_item",
|
|
||||||
"oldfieldtype": "Link",
|
|
||||||
"options": "Item",
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"fieldname": "item_code",
|
||||||
"bold": 0,
|
"fieldtype": "Link",
|
||||||
"collapsible": 0,
|
"in_global_search": 1,
|
||||||
"columns": 0,
|
"in_list_view": 1,
|
||||||
"fieldname": "item_code",
|
"label": "Item Code",
|
||||||
"fieldtype": "Link",
|
"oldfieldname": "item_code",
|
||||||
"hidden": 0,
|
"oldfieldtype": "Link",
|
||||||
"ignore_user_permissions": 0,
|
"options": "Item",
|
||||||
"ignore_xss_filter": 0,
|
"read_only": 1
|
||||||
"in_filter": 0,
|
},
|
||||||
"in_global_search": 1,
|
|
||||||
"in_list_view": 1,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Item Code",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "item_code",
|
|
||||||
"oldfieldtype": "Link",
|
|
||||||
"options": "Item",
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"fieldname": "item_name",
|
||||||
"bold": 0,
|
"fieldtype": "Data",
|
||||||
"collapsible": 0,
|
"label": "Item Name",
|
||||||
"columns": 0,
|
"oldfieldname": "item_name",
|
||||||
"fieldname": "item_name",
|
"oldfieldtype": "Data",
|
||||||
"fieldtype": "Data",
|
"read_only": 1
|
||||||
"hidden": 0,
|
},
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Item Name",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "item_name",
|
|
||||||
"oldfieldtype": "Data",
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"fieldname": "column_break_5",
|
||||||
"bold": 0,
|
"fieldtype": "Column Break"
|
||||||
"collapsible": 0,
|
},
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "column_break_5",
|
|
||||||
"fieldtype": "Column Break",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"fieldname": "description",
|
||||||
"bold": 0,
|
"fieldtype": "Text Editor",
|
||||||
"collapsible": 0,
|
"in_list_view": 1,
|
||||||
"columns": 0,
|
"label": "Description",
|
||||||
"fieldname": "description",
|
"oldfieldname": "description",
|
||||||
"fieldtype": "Text Editor",
|
"oldfieldtype": "Text",
|
||||||
"hidden": 0,
|
"print_width": "300px",
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Description",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "description",
|
|
||||||
"oldfieldtype": "Text",
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"print_width": "300px",
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0,
|
|
||||||
"width": "300px"
|
"width": "300px"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"fieldname": "section_break_6",
|
||||||
"bold": 0,
|
"fieldtype": "Section Break"
|
||||||
"collapsible": 0,
|
},
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "section_break_6",
|
|
||||||
"fieldtype": "Section Break",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"fieldname": "warehouse",
|
||||||
"bold": 0,
|
"fieldtype": "Link",
|
||||||
"collapsible": 0,
|
"label": "From Warehouse",
|
||||||
"columns": 0,
|
"oldfieldname": "warehouse",
|
||||||
"fieldname": "warehouse",
|
"oldfieldtype": "Link",
|
||||||
"fieldtype": "Link",
|
"options": "Warehouse"
|
||||||
"hidden": 0,
|
},
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "From Warehouse",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "warehouse",
|
|
||||||
"oldfieldtype": "Link",
|
|
||||||
"options": "Warehouse",
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"fieldname": "target_warehouse",
|
||||||
"bold": 0,
|
"fieldtype": "Link",
|
||||||
"collapsible": 0,
|
"label": "To Warehouse (Optional)",
|
||||||
"columns": 0,
|
"options": "Warehouse",
|
||||||
"fieldname": "target_warehouse",
|
"print_hide": 1
|
||||||
"fieldtype": "Link",
|
},
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "To Warehouse (Optional)",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Warehouse",
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 1,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"fieldname": "column_break_9",
|
||||||
"bold": 0,
|
"fieldtype": "Column Break"
|
||||||
"collapsible": 0,
|
},
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "column_break_9",
|
|
||||||
"fieldtype": "Column Break",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"fieldname": "qty",
|
||||||
"bold": 0,
|
"fieldtype": "Float",
|
||||||
"collapsible": 0,
|
"in_list_view": 1,
|
||||||
"columns": 0,
|
"label": "Qty",
|
||||||
"fieldname": "qty",
|
"oldfieldname": "qty",
|
||||||
"fieldtype": "Float",
|
"oldfieldtype": "Currency",
|
||||||
"hidden": 0,
|
"read_only": 1
|
||||||
"ignore_user_permissions": 0,
|
},
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Qty",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "qty",
|
|
||||||
"oldfieldtype": "Currency",
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"fieldname": "section_break_9",
|
||||||
"bold": 0,
|
"fieldtype": "Section Break"
|
||||||
"collapsible": 0,
|
},
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "section_break_9",
|
|
||||||
"fieldtype": "Section Break",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"fieldname": "serial_no",
|
||||||
"bold": 0,
|
"fieldtype": "Text",
|
||||||
"collapsible": 0,
|
"label": "Serial No"
|
||||||
"columns": 0,
|
},
|
||||||
"fieldname": "serial_no",
|
|
||||||
"fieldtype": "Text",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Serial No",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"fieldname": "column_break_11",
|
||||||
"bold": 0,
|
"fieldtype": "Column Break"
|
||||||
"collapsible": 0,
|
},
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "column_break_11",
|
|
||||||
"fieldtype": "Column Break",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"fieldname": "batch_no",
|
||||||
"bold": 0,
|
"fieldtype": "Link",
|
||||||
"collapsible": 0,
|
"label": "Batch No",
|
||||||
"columns": 0,
|
"options": "Batch"
|
||||||
"fieldname": "batch_no",
|
},
|
||||||
"fieldtype": "Link",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Batch No",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Batch",
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"fieldname": "section_break_13",
|
||||||
"bold": 0,
|
"fieldtype": "Section Break"
|
||||||
"collapsible": 0,
|
},
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "section_break_13",
|
|
||||||
"fieldtype": "Section Break",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 1,
|
"allow_on_submit": 1,
|
||||||
"bold": 0,
|
"fieldname": "actual_qty",
|
||||||
"collapsible": 0,
|
"fieldtype": "Float",
|
||||||
"columns": 0,
|
"label": "Actual Qty",
|
||||||
"fieldname": "actual_qty",
|
"no_copy": 1,
|
||||||
"fieldtype": "Float",
|
"oldfieldname": "actual_qty",
|
||||||
"hidden": 0,
|
"oldfieldtype": "Currency",
|
||||||
"ignore_user_permissions": 0,
|
"read_only": 1
|
||||||
"ignore_xss_filter": 0,
|
},
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Actual Qty",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 1,
|
|
||||||
"oldfieldname": "actual_qty",
|
|
||||||
"oldfieldtype": "Currency",
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 1,
|
"allow_on_submit": 1,
|
||||||
"bold": 0,
|
"fieldname": "projected_qty",
|
||||||
"collapsible": 0,
|
"fieldtype": "Float",
|
||||||
"columns": 0,
|
"label": "Projected Qty",
|
||||||
"fieldname": "projected_qty",
|
"no_copy": 1,
|
||||||
"fieldtype": "Float",
|
"oldfieldname": "projected_qty",
|
||||||
"hidden": 0,
|
"oldfieldtype": "Currency",
|
||||||
"ignore_user_permissions": 0,
|
"read_only": 1
|
||||||
"ignore_xss_filter": 0,
|
},
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Projected Qty",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 1,
|
|
||||||
"oldfieldname": "projected_qty",
|
|
||||||
"oldfieldtype": "Currency",
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"fieldname": "column_break_16",
|
||||||
"bold": 0,
|
"fieldtype": "Column Break"
|
||||||
"collapsible": 0,
|
},
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "column_break_16",
|
|
||||||
"fieldtype": "Column Break",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"fieldname": "uom",
|
||||||
"bold": 0,
|
"fieldtype": "Link",
|
||||||
"collapsible": 0,
|
"label": "UOM",
|
||||||
"columns": 0,
|
"oldfieldname": "uom",
|
||||||
"fieldname": "uom",
|
"oldfieldtype": "Link",
|
||||||
"fieldtype": "Link",
|
"options": "UOM",
|
||||||
"hidden": 0,
|
"read_only": 1
|
||||||
"ignore_user_permissions": 0,
|
},
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "UOM",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "uom",
|
|
||||||
"oldfieldtype": "Link",
|
|
||||||
"options": "UOM",
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 1,
|
"allow_on_submit": 1,
|
||||||
"bold": 0,
|
"default": "0",
|
||||||
"collapsible": 0,
|
"fieldname": "page_break",
|
||||||
"columns": 0,
|
"fieldtype": "Check",
|
||||||
"fieldname": "page_break",
|
"label": "Page Break",
|
||||||
"fieldtype": "Check",
|
"oldfieldname": "page_break",
|
||||||
"hidden": 0,
|
"oldfieldtype": "Check",
|
||||||
"ignore_user_permissions": 0,
|
"read_only": 1
|
||||||
"ignore_xss_filter": 0,
|
},
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Page Break",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "page_break",
|
|
||||||
"oldfieldtype": "Check",
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"fieldname": "prevdoc_doctype",
|
||||||
"bold": 0,
|
"fieldtype": "Data",
|
||||||
"collapsible": 0,
|
"hidden": 1,
|
||||||
"columns": 0,
|
"label": "Prevdoc DocType",
|
||||||
"fieldname": "prevdoc_doctype",
|
"oldfieldname": "prevdoc_doctype",
|
||||||
"fieldtype": "Data",
|
"oldfieldtype": "Data",
|
||||||
"hidden": 1,
|
"print_hide": 1,
|
||||||
"ignore_user_permissions": 0,
|
"read_only": 1
|
||||||
"ignore_xss_filter": 0,
|
},
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Prevdoc DocType",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "prevdoc_doctype",
|
|
||||||
"oldfieldtype": "Data",
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 1,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"fieldname": "parent_detail_docname",
|
||||||
"bold": 0,
|
"fieldtype": "Data",
|
||||||
"collapsible": 0,
|
"hidden": 1,
|
||||||
"columns": 0,
|
"label": "Parent Detail docname",
|
||||||
"fieldname": "parent_detail_docname",
|
"no_copy": 1,
|
||||||
"fieldtype": "Data",
|
"oldfieldname": "parent_detail_docname",
|
||||||
"hidden": 1,
|
"oldfieldtype": "Data",
|
||||||
"ignore_user_permissions": 0,
|
"print_hide": 1,
|
||||||
"ignore_xss_filter": 0,
|
"read_only": 1
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Parent Detail docname",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 1,
|
|
||||||
"oldfieldname": "parent_detail_docname",
|
|
||||||
"oldfieldtype": "Data",
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 1,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"hide_heading": 0,
|
"idx": 1,
|
||||||
"hide_toolbar": 0,
|
"istable": 1,
|
||||||
"idx": 1,
|
"modified": "2019-08-27 18:17:37.167512",
|
||||||
"image_view": 0,
|
"modified_by": "Administrator",
|
||||||
"in_create": 0,
|
"module": "Stock",
|
||||||
|
"name": "Packed Item",
|
||||||
"is_submittable": 0,
|
"owner": "Administrator",
|
||||||
"issingle": 0,
|
"permissions": [],
|
||||||
"istable": 1,
|
"track_changes": 1
|
||||||
"max_attachments": 0,
|
}
|
||||||
"modified": "2017-02-20 13:27:37.569945",
|
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "Stock",
|
|
||||||
"name": "Packed Item",
|
|
||||||
"owner": "Administrator",
|
|
||||||
"permissions": [],
|
|
||||||
"quick_entry": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"read_only_onload": 0,
|
|
||||||
"show_name_in_global_search": 0,
|
|
||||||
"track_changes": 1,
|
|
||||||
"track_seen": 0
|
|
||||||
}
|
|
||||||
|
@ -30,14 +30,14 @@ def get_bin_qty(item, warehouse):
|
|||||||
where item_code = %s and warehouse = %s""", (item, warehouse), as_dict = 1)
|
where item_code = %s and warehouse = %s""", (item, warehouse), as_dict = 1)
|
||||||
return det and det[0] or frappe._dict()
|
return det and det[0] or frappe._dict()
|
||||||
|
|
||||||
def update_packing_list_item(doc, packing_item_code, qty, main_item_row, description):
|
def update_packing_list_item(doc, packing_item_code, qty, main_item_row, description):
|
||||||
item = get_packing_item_details(packing_item_code, doc.company)
|
item = get_packing_item_details(packing_item_code, doc.company)
|
||||||
|
|
||||||
# check if exists
|
# check if exists
|
||||||
exists = 0
|
exists = 0
|
||||||
for d in doc.get("packed_items"):
|
for d in doc.get("packed_items"):
|
||||||
if d.parent_item == main_item_row.item_code and d.item_code == packing_item_code and\
|
if d.parent_item == main_item_row.item_code and d.item_code == packing_item_code and\
|
||||||
d.parent_detail_docname == main_item_row.name and d.description == description:
|
d.parent_detail_docname == main_item_row.name:
|
||||||
pi, exists = d, 1
|
pi, exists = d, 1
|
||||||
break
|
break
|
||||||
|
|
||||||
@ -48,10 +48,10 @@ def update_packing_list_item(doc, packing_item_code, qty, main_item_row, descrip
|
|||||||
pi.item_code = packing_item_code
|
pi.item_code = packing_item_code
|
||||||
pi.item_name = item.item_name
|
pi.item_name = item.item_name
|
||||||
pi.parent_detail_docname = main_item_row.name
|
pi.parent_detail_docname = main_item_row.name
|
||||||
pi.description = item.description
|
|
||||||
pi.uom = item.stock_uom
|
pi.uom = item.stock_uom
|
||||||
pi.qty = flt(qty)
|
pi.qty = flt(qty)
|
||||||
pi.description = description
|
if description and not pi.description:
|
||||||
|
pi.description = description
|
||||||
if not pi.warehouse:
|
if not pi.warehouse:
|
||||||
pi.warehouse = (main_item_row.warehouse if ((doc.get('is_pos')
|
pi.warehouse = (main_item_row.warehouse if ((doc.get('is_pos')
|
||||||
or not item.default_warehouse) and main_item_row.warehouse) else item.default_warehouse)
|
or not item.default_warehouse) and main_item_row.warehouse) else item.default_warehouse)
|
||||||
@ -112,4 +112,4 @@ def get_items_from_product_bundle(args):
|
|||||||
return items
|
return items
|
||||||
|
|
||||||
def on_doctype_update():
|
def on_doctype_update():
|
||||||
frappe.db.add_index("Packed Item", ["item_code", "warehouse"])
|
frappe.db.add_index("Packed Item", ["item_code", "warehouse"])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user