Skip to content

Commit

Permalink
[FIX] purchase: added missing i18n call for UserError
Browse files Browse the repository at this point in the history
closes odoo#52850

Related: odoo/enterprise#11098
Signed-off-by: oco-odoo <[email protected]>
  • Loading branch information
bfr-o committed Jun 11, 2020
1 parent da5f447 commit ba98024
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions addons/purchase/i18n/purchase.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2157,3 +2157,10 @@ msgid ""
"Your quotation contains products from company %s whereas your quotation belongs to company %s. \n"
" Please change the company of your quotation or remove the products from other companies (%s)."
msgstr ""


#. module: purchase
#: code:addons/purchase/models/purchase.py:0
#, python-format
msgid "You cannot change the type of a purchase order line. Instead you should delete the current line and create a new line of the proper type."
msgstr ""
2 changes: 1 addition & 1 deletion addons/purchase/models/purchase.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ def create(self, values):

def write(self, values):
if 'display_type' in values and self.filtered(lambda line: line.display_type != values.get('display_type')):
raise UserError("You cannot change the type of a purchase order line. Instead you should delete the current line and create a new line of the proper type.")
raise UserError(_("You cannot change the type of a purchase order line. Instead you should delete the current line and create a new line of the proper type."))

if 'product_qty' in values:
for line in self:
Expand Down

0 comments on commit ba98024

Please sign in to comment.