[MIG] mrp_subcontracting_purchase_link: Migration from 12.0 to 14.0

This commit is contained in:
clementmbr
2021-02-19 09:38:16 -03:00
committed by Meritxell Abellan
parent ed2dc38a44
commit 51d919796b
3 changed files with 4 additions and 6 deletions

View File

@@ -2,7 +2,7 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{
"name": "Link Purchase Order to Subcontract Productions",
"version": "12.0.1.0.0",
"version": "14.0.1.0.0",
"category": "Manufacturing",
"license": "LGPL-3",
"author": "Quartile Limited, Odoo Community Association (OCA)",

View File

@@ -1,7 +1,7 @@
# Copyright 2020 Quartile Limited
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo import api, fields, models
from odoo import fields, models
class PurchaseOrder(models.Model):
@@ -17,7 +17,6 @@ class PurchaseOrder(models.Model):
compute="_compute_subcontract_production_count"
)
@api.multi
def action_view_mrp(self):
productions = self.subcontract_production_ids
action = self.env.ref("mrp.mrp_production_action").read()[0]
@@ -32,7 +31,6 @@ class PurchaseOrder(models.Model):
action = {"type": "ir.actions.act_window_close"}
return action
@api.multi
def _compute_subcontract_production_count(self):
for order in self:
order.subcontract_production_count = len(order.subcontract_production_ids)

View File

@@ -5,9 +5,9 @@
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_form_view" />
<field name="arch" type="xml">
<field name="availability" position="after">
<xpath expr="//field[@name='company_id']" position="after">
<field name="purchase_order_id" groups="purchase.group_purchase_user" />
</field>
</xpath>
</field>
</record>
</odoo>