Include the line in the warehouse required error message for sale and purchase

This commit is contained in:
Cédric Krier
2025-10-30 01:14:10 +01:00
parent 4ae463d725
commit d4c6400c26
4 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="text">You cannot erase party "%(party)s" while they have pending purchases with company "%(company)s".</field>
</record>
<record model="ir.message" id="msg_warehouse_required_for_quotation">
<field name="text">To get a quote for the purchase "%(purchase)s" you must enter a warehouse.</field>
<field name="text">To get a quote for the purchase "%(purchase)s" you must enter a warehouse for the line "%(line)s".</field>
</record>
<record model="ir.message" id="msg_purchase_delete_cancel">
<field name="text">To delete purchase "%(purchase)s" you must cancel it.</field>
+2 -1
View File
@@ -766,7 +766,8 @@ class Purchase(
if ((not location or not line.warehouse) and line.movable):
raise PurchaseQuotationError(
gettext('purchase.msg_warehouse_required_for_quotation',
purchase=self.rec_name))
purchase=self.rec_name,
line=line.rec_name))
@classmethod
def set_number(cls, purchases):
+1 -1
View File
@@ -22,7 +22,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="text">To get a quote for sale "%(sale)s" you must enter a shipment address.</field>
</record>
<record model="ir.message" id="msg_sale_warehouse_required_for_quotation">
<field name="text">To get a quote for sale "%(sale)s" you must enter a warehouse.</field>
<field name="text">To get a quote for sale "%(sale)s" you must enter a warehouse for the line "%(line)s".</field>
</record>
<record model="ir.message" id="msg_sale_delete_cancel">
<field name="text">To delete sale "%(sale)s" you must cancel it.</field>
+2 -1
View File
@@ -925,7 +925,8 @@ class Sale(
if (not location or not line.warehouse) and line.movable:
raise SaleQuotationError(
gettext('sale.msg_sale_warehouse_required_for_quotation',
sale=self.rec_name))
sale=self.rec_name,
line=line.rec_name))
@classmethod
def set_number(cls, sales):