From 13091af3ba91ae0cc7b91415b3a1f706a4b64722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Thu, 11 Nov 2021 10:06:02 +0100 Subject: [PATCH] [MIG] stock_putaway_product_template: Migration to 14.0 TT31847 --- .../__manifest__.py | 2 +- stock_putaway_product_template/i18n/es.po | 57 +++++++++++++++++++ .../models/stock_putaway_rule.py | 7 +-- 3 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 stock_putaway_product_template/i18n/es.po diff --git a/stock_putaway_product_template/__manifest__.py b/stock_putaway_product_template/__manifest__.py index 6af72f212..56071dec4 100644 --- a/stock_putaway_product_template/__manifest__.py +++ b/stock_putaway_product_template/__manifest__.py @@ -2,7 +2,7 @@ { "name": "Product template in putaway strategies", "summary": "Add product template in putaway strategies from the product view", - "version": "13.0.1.0.0", + "version": "14.0.1.0.0", "category": "Inventory", "website": "https://github.com/OCA/stock-logistics-warehouse", "author": "Akretion, Odoo Community Association (OCA)", diff --git a/stock_putaway_product_template/i18n/es.po b/stock_putaway_product_template/i18n/es.po new file mode 100644 index 000000000..0ecc07298 --- /dev/null +++ b/stock_putaway_product_template/i18n/es.po @@ -0,0 +1,57 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_putaway_product_template +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-11-11 09:02+0000\n" +"PO-Revision-Date: 2021-11-11 09:02+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: stock_putaway_product_template +#: model:ir.model.fields,field_description:stock_putaway_product_template.field_product_template__display_name +#: model:ir.model.fields,field_description:stock_putaway_product_template.field_stock_location__display_name +#: model:ir.model.fields,field_description:stock_putaway_product_template.field_stock_putaway_rule__display_name +msgid "Display Name" +msgstr "Nombre mostrado" + +#. module: stock_putaway_product_template +#: model:ir.model.fields,field_description:stock_putaway_product_template.field_product_template__id +#: model:ir.model.fields,field_description:stock_putaway_product_template.field_stock_location__id +#: model:ir.model.fields,field_description:stock_putaway_product_template.field_stock_putaway_rule__id +msgid "ID" +msgstr "" + +#. module: stock_putaway_product_template +#: model:ir.model,name:stock_putaway_product_template.model_stock_location +msgid "Inventory Locations" +msgstr "Ubicaciones de inventario" + +#. module: stock_putaway_product_template +#: model:ir.model.fields,field_description:stock_putaway_product_template.field_product_template____last_update +#: model:ir.model.fields,field_description:stock_putaway_product_template.field_stock_location____last_update +#: model:ir.model.fields,field_description:stock_putaway_product_template.field_stock_putaway_rule____last_update +msgid "Last Modified on" +msgstr "Última modificación el" + +#. module: stock_putaway_product_template +#: model:ir.model,name:stock_putaway_product_template.model_product_template +msgid "Product Template" +msgstr "Plantilla de producto" + +#. module: stock_putaway_product_template +#: model:ir.model.fields,field_description:stock_putaway_product_template.field_stock_putaway_rule__product_tmpl_id +msgid "Product Tmpl" +msgstr "Plantilla de producto" + +#. module: stock_putaway_product_template +#: model:ir.model,name:stock_putaway_product_template.model_stock_putaway_rule +msgid "Putaway Rule" +msgstr "Regla de Estrategia de Traslado" diff --git a/stock_putaway_product_template/models/stock_putaway_rule.py b/stock_putaway_product_template/models/stock_putaway_rule.py index 02a401ac8..357cb7b0d 100644 --- a/stock_putaway_product_template/models/stock_putaway_rule.py +++ b/stock_putaway_product_template/models/stock_putaway_rule.py @@ -19,16 +19,15 @@ class StockPutawayRule(models.Model): @api.depends("product_id") def _compute_product_tmpl_id(self): for rec in self: - rec.product_tmpl_id = False if rec.product_id: rec.product_tmpl_id = rec.product_id.product_tmpl_id else: params = self.env.context.get("params", {}) - if params.get("model", "") == "product.template": - rec.product_tmpl_id = params.get("id", False) + if params.get("model", "") == "product.template" and params.get("id"): + rec.product_tmpl_id = params.get("id") def filtered(self, func): - res = super(StockPutawayRule, self).filtered(func) + res = super().filtered(func) if res or not self.env.context.get("filter_putaway_rule"): return res product = func.__closure__[0].cell_contents