[FIX] stock_secondary_unit: Incorrect secondary unit link in product variants view on common form. Create related template secondary unit field.

TT27057
This commit is contained in:
sergio-teruel
2020-12-01 21:17:15 +01:00
committed by Rocío Vega
parent dcd53cf116
commit 61c0303d7b
2 changed files with 7 additions and 1 deletions

View File

@@ -3,7 +3,7 @@
{ {
"name": "Stock Secondary Unit", "name": "Stock Secondary Unit",
"summary": "Get product quantities in a secondary unit", "summary": "Get product quantities in a secondary unit",
"version": "13.0.1.1.0", "version": "13.0.1.1.1",
"development_status": "Production/Stable", "development_status": "Production/Stable",
"category": "stock", "category": "stock",
"website": "https://github.com/OCA/stock-logistics-warehouse", "website": "https://github.com/OCA/stock-logistics-warehouse",

View File

@@ -40,3 +40,9 @@ class ProductTemplate(models.Model):
class ProductProduct(models.Model): class ProductProduct(models.Model):
_inherit = ["product.product", "stock.product.secondary.unit"] _inherit = ["product.product", "stock.product.secondary.unit"]
_name = "product.product" _name = "product.product"
stock_secondary_uom_id = fields.Many2one(
comodel_name="product.secondary.unit",
string="Second unit for inventory",
related="product_tmpl_id.stock_secondary_uom_id",
)