mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[MIG] mrp_subcontracting_inhibit: Migration to 16.0
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
{
|
||||
"name": "Inhibit subcontracting flow on demand",
|
||||
"version": "14.0.1.1.1",
|
||||
"version": "16.0.1.0.0",
|
||||
"category": "Manufacturing",
|
||||
"website": "https://github.com/OCA/manufacture",
|
||||
"author": "Tecnativa, Odoo Community Association (OCA)",
|
||||
|
||||
@@ -6,7 +6,7 @@ from odoo import models
|
||||
class ProductProduct(models.Model):
|
||||
_inherit = "product.product"
|
||||
|
||||
def _prepare_sellers(self, params=False):
|
||||
def _prepare_sellers(self, params):
|
||||
res = super()._prepare_sellers(params)
|
||||
return res.filtered(
|
||||
lambda x: x.subcontracting_inhibit
|
||||
|
||||
@@ -34,4 +34,6 @@ class PurchaseOrderLine(models.Model):
|
||||
def _onchange_quantity(self):
|
||||
"""We need to inject the context to set the right price"""
|
||||
_self = self.with_context(subcontracting_inhibit=self.subcontracting_inhibit)
|
||||
return super(PurchaseOrderLine, _self)._onchange_quantity()
|
||||
return super(
|
||||
PurchaseOrderLine, _self
|
||||
)._compute_price_unit_and_date_planned_and_name()
|
||||
|
||||
@@ -4,6 +4,6 @@ from odoo import fields, models
|
||||
|
||||
|
||||
class StockLocationRoute(models.Model):
|
||||
_inherit = "stock.location.route"
|
||||
_inherit = "stock.route"
|
||||
|
||||
subcontracting_inhibit = fields.Boolean(string="Inhibit subcontracting")
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
from odoo.tests import Form, common
|
||||
|
||||
|
||||
class TestMrpSubcontractingInhibit(common.SavepointCase):
|
||||
class TestMrpSubcontractingInhibit(common.TransactionCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
@@ -22,7 +22,7 @@ class TestMrpSubcontractingInhibit(common.SavepointCase):
|
||||
0,
|
||||
0,
|
||||
{
|
||||
"name": cls.supplier.id,
|
||||
"partner_id": cls.supplier.id,
|
||||
"min_qty": 1,
|
||||
"price": 10,
|
||||
},
|
||||
@@ -31,7 +31,7 @@ class TestMrpSubcontractingInhibit(common.SavepointCase):
|
||||
0,
|
||||
0,
|
||||
{
|
||||
"name": cls.supplier.id,
|
||||
"partner_id": cls.supplier.id,
|
||||
"min_qty": 1,
|
||||
"price": 5,
|
||||
"subcontracting_inhibit": True,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<odoo>
|
||||
<record id="stock_location_route_form_view" model="ir.ui.view">
|
||||
<field name="name">stock.location.route.form</field>
|
||||
<field name="model">stock.location.route</field>
|
||||
<field name="model">stock.route</field>
|
||||
<field name="inherit_id" ref="stock.stock_location_route_form_view" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="company_id" position="before">
|
||||
<field name="supplied_wh_id" position="after">
|
||||
<field name="subcontracting_inhibit" />
|
||||
</field>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user