Merge branch 'version-11-hotfix' into version-11
This commit is contained in:
@@ -5,7 +5,7 @@ import frappe
|
|||||||
from erpnext.hooks import regional_overrides
|
from erpnext.hooks import regional_overrides
|
||||||
from frappe.utils import getdate
|
from frappe.utils import getdate
|
||||||
|
|
||||||
__version__ = '11.1.60'
|
__version__ = '11.1.61'
|
||||||
|
|
||||||
def get_default_company(user=None):
|
def get_default_company(user=None):
|
||||||
'''Get default company for user'''
|
'''Get default company for user'''
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
|||||||
cur_frm.meta._default_print_format = cur_frm.meta.default_print_format;
|
cur_frm.meta._default_print_format = cur_frm.meta.default_print_format;
|
||||||
cur_frm.meta.default_print_format = cur_frm.pos_print_format;
|
cur_frm.meta.default_print_format = cur_frm.pos_print_format;
|
||||||
}
|
}
|
||||||
} else if(cur_frm.doc.is_return) {
|
} else if(cur_frm.doc.is_return && !cur_frm.meta.default_print_format) {
|
||||||
if(cur_frm.return_print_format) {
|
if(cur_frm.return_print_format) {
|
||||||
cur_frm.meta._default_print_format = cur_frm.meta.default_print_format;
|
cur_frm.meta._default_print_format = cur_frm.meta.default_print_format;
|
||||||
cur_frm.meta.default_print_format = cur_frm.return_print_format;
|
cur_frm.meta.default_print_format = cur_frm.return_print_format;
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ def set_price_list(out, party, party_type, given_price_list, pos=None):
|
|||||||
# price list
|
# price list
|
||||||
price_list = get_permitted_documents('Price List')
|
price_list = get_permitted_documents('Price List')
|
||||||
|
|
||||||
if price_list:
|
if price_list and len(price_list) == 1:
|
||||||
price_list = price_list[0]
|
price_list = price_list[0]
|
||||||
elif pos and party_type == 'Customer':
|
elif pos and party_type == 'Customer':
|
||||||
customer_price_list = frappe.get_value('Customer', party.name, 'default_price_list')
|
customer_price_list = frappe.get_value('Customer', party.name, 'default_price_list')
|
||||||
|
|||||||
@@ -286,12 +286,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:
|
||||||
|
|||||||
@@ -337,7 +337,7 @@ class BuyingController(StockController):
|
|||||||
if self.doctype in ["Purchase Receipt", "Purchase Invoice"]:
|
if self.doctype in ["Purchase Receipt", "Purchase Invoice"]:
|
||||||
rm.consumed_qty = required_qty
|
rm.consumed_qty = required_qty
|
||||||
rm.description = bom_item.description
|
rm.description = bom_item.description
|
||||||
if item.batch_no and not rm.batch_no:
|
if item.batch_no and frappe.db.get_value("Item", rm.rm_item_code, "has_batch_no") and not rm.batch_no:
|
||||||
rm.batch_no = item.batch_no
|
rm.batch_no = item.batch_no
|
||||||
|
|
||||||
# get raw materials rate
|
# get raw materials rate
|
||||||
|
|||||||
@@ -70,8 +70,9 @@ $.extend(erpnext, {
|
|||||||
"get_query": function () {
|
"get_query": function () {
|
||||||
return {
|
return {
|
||||||
filters: {
|
filters: {
|
||||||
item_code:grid_row.doc.item_code,
|
item_code: grid_row.doc.item_code,
|
||||||
warehouse:cur_frm.doc.is_return ? null : grid_row.doc.warehouse
|
warehouse: cur_frm.doc.is_return ? null : grid_row.doc.warehouse,
|
||||||
|
batch_no: grid_row.doc.batch_no || null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,8 @@ frappe.ui.form.CustomerQuickEntryForm = frappe.ui.form.QuickEntryForm.extend({
|
|||||||
{
|
{
|
||||||
label: __("Address Line 1"),
|
label: __("Address Line 1"),
|
||||||
fieldname: "address_line1",
|
fieldname: "address_line1",
|
||||||
fieldtype: "Data"
|
fieldtype: "Data",
|
||||||
|
reqd: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: __("Address Line 2"),
|
label: __("Address Line 2"),
|
||||||
@@ -55,7 +56,8 @@ frappe.ui.form.CustomerQuickEntryForm = frappe.ui.form.QuickEntryForm.extend({
|
|||||||
{
|
{
|
||||||
label: __("City"),
|
label: __("City"),
|
||||||
fieldname: "city",
|
fieldname: "city",
|
||||||
fieldtype: "Data"
|
fieldtype: "Data",
|
||||||
|
reqd: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: __("State"),
|
label: __("State"),
|
||||||
@@ -66,7 +68,8 @@ frappe.ui.form.CustomerQuickEntryForm = frappe.ui.form.QuickEntryForm.extend({
|
|||||||
label: __("Country"),
|
label: __("Country"),
|
||||||
fieldname: "country",
|
fieldname: "country",
|
||||||
fieldtype: "Link",
|
fieldtype: "Link",
|
||||||
options: "Country"
|
options: "Country",
|
||||||
|
reqd: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: __("Customer POS Id"),
|
label: __("Customer POS Id"),
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -153,7 +153,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,
|
||||||
type="Actual",
|
type="Actual",
|
||||||
@@ -290,7 +291,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"
|
||||||
|
|||||||
@@ -32,10 +32,16 @@ class ItemPrice(Document):
|
|||||||
|
|
||||||
def update_price_list_details(self):
|
def update_price_list_details(self):
|
||||||
if self.price_list:
|
if self.price_list:
|
||||||
self.buying, self.selling, self.currency = \
|
price_list_details = frappe.db.get_value("Price List",
|
||||||
frappe.db.get_value("Price List",
|
{"name": self.price_list, "enabled": 1},
|
||||||
{"name": self.price_list, "enabled": 1},
|
["buying", "selling", "currency"])
|
||||||
["buying", "selling", "currency"])
|
|
||||||
|
if not price_list_details:
|
||||||
|
link = frappe.utils.get_link_to_form('Price List', self.price_list)
|
||||||
|
frappe.throw("The price list {0} does not exists or disabled".
|
||||||
|
format(link))
|
||||||
|
|
||||||
|
self.buying, self.selling, self.currency = price_list_details
|
||||||
|
|
||||||
def update_item_details(self):
|
def update_item_details(self):
|
||||||
if self.item_code:
|
if self.item_code:
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ cur_frm.fields_dict['delivery_note'].get_query = function(doc, cdt, cdn) {
|
|||||||
|
|
||||||
cur_frm.fields_dict['items'].grid.get_field('item_code').get_query = function(doc, cdt, cdn) {
|
cur_frm.fields_dict['items'].grid.get_field('item_code').get_query = function(doc, cdt, cdn) {
|
||||||
if(!doc.delivery_note) {
|
if(!doc.delivery_note) {
|
||||||
frappe.throw(__("Please Delivery Note first"))
|
frappe.throw(__("Please select a Delivery Note"));
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
query: "erpnext.stock.doctype.packing_slip.packing_slip.item_details",
|
query: "erpnext.stock.doctype.packing_slip.packing_slip.item_details",
|
||||||
|
|||||||
@@ -248,7 +248,7 @@
|
|||||||
"description": "Identification of the package for the delivery (for print)",
|
"description": "Identification of the package for the delivery (for print)",
|
||||||
"fetch_if_empty": 0,
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "from_case_no",
|
"fieldname": "from_case_no",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Int",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
@@ -313,7 +313,7 @@
|
|||||||
"description": "If more than one package of the same type (for print)",
|
"description": "If more than one package of the same type (for print)",
|
||||||
"fetch_if_empty": 0,
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "to_case_no",
|
"fieldname": "to_case_no",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Int",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
@@ -773,7 +773,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2019-05-30 21:50:38.260908",
|
"modified": "2019-09-09 12:40:22.497613",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Packing Slip",
|
"name": "Packing Slip",
|
||||||
|
|||||||
@@ -49,11 +49,10 @@ class PackingSlip(Document):
|
|||||||
frappe.msgprint(_("Please specify a valid 'From Case No.'"), raise_exception=1)
|
frappe.msgprint(_("Please specify a valid 'From Case No.'"), raise_exception=1)
|
||||||
elif not self.to_case_no:
|
elif not self.to_case_no:
|
||||||
self.to_case_no = self.from_case_no
|
self.to_case_no = self.from_case_no
|
||||||
elif self.from_case_no > self.to_case_no:
|
elif cint(self.from_case_no) > cint(self.to_case_no):
|
||||||
frappe.msgprint(_("'To Case No.' cannot be less than 'From Case No.'"),
|
frappe.msgprint(_("'To Case No.' cannot be less than 'From Case No.'"),
|
||||||
raise_exception=1)
|
raise_exception=1)
|
||||||
|
|
||||||
|
|
||||||
res = frappe.db.sql("""SELECT name FROM `tabPacking Slip`
|
res = frappe.db.sql("""SELECT name FROM `tabPacking Slip`
|
||||||
WHERE delivery_note = %(delivery_note)s AND docstatus = 1 AND
|
WHERE delivery_note = %(delivery_note)s AND docstatus = 1 AND
|
||||||
((from_case_no BETWEEN %(from_case_no)s AND %(to_case_no)s)
|
((from_case_no BETWEEN %(from_case_no)s AND %(to_case_no)s)
|
||||||
|
|||||||
Reference in New Issue
Block a user