[MIG] product_mrp_info: Migration to 14.0

This commit is contained in:
Héctor Villarreal Ortega
2022-07-05 13:21:40 +02:00
committed by Héctor Vi Or
parent cadc98f0d0
commit b16c3aa749
4 changed files with 18 additions and 5 deletions

View File

@@ -3,7 +3,7 @@
{
"name": "Product MRP Info",
"version": "13.0.1.0.0",
"version": "14.0.1.0.0",
"development_status": "Beta",
"license": "LGPL-3",
"author": "ForgeFlow, Odoo Community Association (OCA)",

View File

@@ -9,7 +9,8 @@ class ProductTemplate(models.Model):
_inherit = "product.template"
mo_count = fields.Integer(
string="# Manufacturing Orders", compute="_compute_mo_count",
string="# Manufacturing Orders",
compute="_compute_mo_count",
)
def _compute_mo_count(self):
@@ -29,7 +30,9 @@ class ProductTemplate(models.Model):
def action_view_mrp_productions(self):
product_ids = self.mapped("product_variant_ids").ids
action = self.env.ref("mrp.act_product_mrp_production").read()[0]
action = self.env["ir.actions.act_window"]._for_xml_id(
"mrp.act_product_mrp_production_workcenter"
)
action["domain"] = [("product_id", "in", product_ids)]
action["context"] = {}
return action
@@ -39,7 +42,8 @@ class ProductProduct(models.Model):
_inherit = "product.product"
mo_count = fields.Integer(
string="# Manufacturing Orders", compute="_compute_mo_count",
string="# Manufacturing Orders",
compute="_compute_mo_count",
)
def _compute_mo_count(self):
@@ -54,7 +58,9 @@ class ProductProduct(models.Model):
def action_view_mrp_productions(self):
product_ids = self.ids
action = self.env.ref("mrp.act_product_mrp_production").read()[0]
action = self.env["ir.actions.act_window"]._for_xml_id(
"mrp.act_product_mrp_production_workcenter"
)
action["domain"] = [("product_id", "in", product_ids)]
action["context"] = {}
return action

View File

@@ -0,0 +1 @@
../../../../product_mrp_info

View File

@@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)