fixed translation syntax

This commit is contained in:
Rohit Waghchaure
2020-10-26 11:55:08 +05:30
parent 9caac6976c
commit 103ecec9d4
2 changed files with 13 additions and 12 deletions

View File

@@ -112,8 +112,8 @@ class BuyingController(StockController):
"docstatus": 1 "docstatus": 1
})] })]
if self.is_return and len(not_cancelled_asset): if self.is_return and len(not_cancelled_asset):
frappe.throw(_("{} has submitted assets linked to it. You need to cancel the assets to create purchase return.".format(self.return_against)), frappe.throw(_("{} has submitted assets linked to it. You need to cancel the assets to create purchase return.")
title=_("Not Allowed")) .format(self.return_against), title=_("Not Allowed"))
def get_asset_items(self): def get_asset_items(self):
if self.doctype not in ['Purchase Order', 'Purchase Invoice', 'Purchase Receipt']: if self.doctype not in ['Purchase Order', 'Purchase Invoice', 'Purchase Receipt']:
@@ -798,8 +798,8 @@ class BuyingController(StockController):
asset.set(field, None) asset.set(field, None)
asset.supplier = None asset.supplier = None
if asset.docstatus == 1 and delete_asset: if asset.docstatus == 1 and delete_asset:
frappe.throw(_('Cannot cancel this document as it is linked with submitted asset {0}.\ frappe.throw(_('Cannot cancel this document as it is linked with submitted asset {0}. Please cancel it to continue.')
Please cancel the it to continue.').format(frappe.utils.get_link_to_form('Asset', asset.name))) .format(frappe.utils.get_link_to_form('Asset', asset.name)))
asset.flags.ignore_validate_update_after_submit = True asset.flags.ignore_validate_update_after_submit = True
asset.flags.ignore_mandatory = True asset.flags.ignore_mandatory = True

View File

@@ -343,10 +343,11 @@ def validate_material_transfer_entry(sle_doc):
def validate_so_serial_no(sr, sales_order): def validate_so_serial_no(sr, sales_order):
if not sr.sales_order or sr.sales_order!= sales_order: if not sr.sales_order or sr.sales_order!= sales_order:
msg = _("Sales Order {0} has reservation for item {1}") msg = (_("Sales Order {0} has reservation for the item {1}, you can only deliver reserved {1} against {0}.")
msg += _(", you can only deliver reserved {1} against {0}.") .format(sales_order, sr.item_code))
msg += _(" Serial No {2} cannot be delivered")
frappe.throw(msg.format(sales_order, sr.item_code, sr.name)) frappe.throw(_("""{0} Serial No {1} cannot be delivered""")
.format(msg, sr.name))
def has_duplicate_serial_no(sn, sle): def has_duplicate_serial_no(sn, sle):
if (sn.warehouse and not sle.skip_serial_no_validaiton if (sn.warehouse and not sle.skip_serial_no_validaiton
@@ -575,8 +576,8 @@ def get_pos_reserved_serial_nos(filters):
pos_transacted_sr_nos = frappe.db.sql("""select item.serial_no as serial_no pos_transacted_sr_nos = frappe.db.sql("""select item.serial_no as serial_no
from `tabPOS Invoice` p, `tabPOS Invoice Item` item from `tabPOS Invoice` p, `tabPOS Invoice Item` item
where p.name = item.parent where p.name = item.parent
and p.consolidated_invoice is NULL and p.consolidated_invoice is NULL
and p.docstatus = 1 and p.docstatus = 1
and item.docstatus = 1 and item.docstatus = 1
and item.item_code = %(item_code)s and item.item_code = %(item_code)s
@@ -608,7 +609,7 @@ def fetch_serial_numbers(filters, qty, do_not_include=[]):
SELECT sr.name FROM `tabSerial No` sr {batch_join_selection} SELECT sr.name FROM `tabSerial No` sr {batch_join_selection}
WHERE WHERE
sr.name not in ({excluded_sr_nos}) AND sr.name not in ({excluded_sr_nos}) AND
sr.item_code = %(item_code)s AND sr.item_code = %(item_code)s AND
sr.warehouse = %(warehouse)s AND sr.warehouse = %(warehouse)s AND
ifnull(sr.sales_invoice,'') = '' AND ifnull(sr.sales_invoice,'') = '' AND
ifnull(sr.delivery_document_no, '') = '' ifnull(sr.delivery_document_no, '') = ''
@@ -623,5 +624,5 @@ def fetch_serial_numbers(filters, qty, do_not_include=[]):
batch_join_selection=batch_join_selection, batch_join_selection=batch_join_selection,
batch_no_condition=batch_no_condition batch_no_condition=batch_no_condition
), filters, as_dict=1) ), filters, as_dict=1)
return serial_numbers return serial_numbers