mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[14.0][IMP] mrp_subcontracting_inhibit: add posibility to skip subcontract flow on manual purchase order created
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
"data": [
|
"data": [
|
||||||
"views/product_supplierinfo_view.xml",
|
"views/product_supplierinfo_view.xml",
|
||||||
"views/stock_location_route_view.xml",
|
"views/stock_location_route_view.xml",
|
||||||
|
"views/purchase_order_view.xml",
|
||||||
],
|
],
|
||||||
"maintainers": ["victoralmau"],
|
"maintainers": ["victoralmau"],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ class PurchaseOrderLine(models.Model):
|
|||||||
res.update({"subcontracting_inhibit": subcontracting_inhibit_value})
|
res.update({"subcontracting_inhibit": subcontracting_inhibit_value})
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
@api.onchange("subcontracting_inhibit")
|
||||||
|
def _onchange_subcontracting_inhibit(self):
|
||||||
|
return self._onchange_quantity()
|
||||||
|
|
||||||
def _onchange_quantity(self):
|
def _onchange_quantity(self):
|
||||||
"""We need to inject the context to set the right price"""
|
"""We need to inject the context to set the right price"""
|
||||||
_self = self.with_context(subcontracting_inhibit=self.subcontracting_inhibit)
|
_self = self.with_context(subcontracting_inhibit=self.subcontracting_inhibit)
|
||||||
|
|||||||
@@ -2,3 +2,5 @@
|
|||||||
|
|
||||||
* Víctor Martínez
|
* Víctor Martínez
|
||||||
* Pedro M. Baeza
|
* Pedro M. Baeza
|
||||||
|
|
||||||
|
* Christopher Ormaza <chris.ormaza@forgeflow.com>
|
||||||
|
|||||||
19
mrp_subcontracting_inhibit/views/purchase_order_view.xml
Normal file
19
mrp_subcontracting_inhibit/views/purchase_order_view.xml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
<record id="view_order_form_inherit_purchase_order" model="ir.ui.view">
|
||||||
|
<field name="name">purchase.order.view.form.inherit</field>
|
||||||
|
<field name="model">purchase.order</field>
|
||||||
|
<field name="inherit_id" ref="purchase.purchase_order_form" />
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath
|
||||||
|
expr="//field[@name='order_line']/tree/field[@name='product_id']"
|
||||||
|
position="after"
|
||||||
|
>
|
||||||
|
<field name="subcontracting_inhibit" optional="show" />
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
</odoo>
|
||||||
Reference in New Issue
Block a user