Improve mrp_subcontracting_usability: add fields in views, domain on subcontractor_ids M2M field on mrp.bom.
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
from . import models
|
||||||
|
|||||||
@@ -10,9 +10,10 @@
|
|||||||
'summary': 'Usability improvements on mrp_subcontracting',
|
'summary': 'Usability improvements on mrp_subcontracting',
|
||||||
'author': 'Akretion',
|
'author': 'Akretion',
|
||||||
'website': 'https://github.com/akretion/odoo-usability',
|
'website': 'https://github.com/akretion/odoo-usability',
|
||||||
'depends': ['mrp_subcontracting'],
|
'depends': ['mrp_subcontracting', 'stock_usability'],
|
||||||
'data': [
|
'data': [
|
||||||
'views/mrp_bom.xml',
|
'views/mrp_bom.xml',
|
||||||
|
'views/stock_warehouse.xml',
|
||||||
],
|
],
|
||||||
'installable': True,
|
'installable': True,
|
||||||
}
|
}
|
||||||
|
|||||||
1
mrp_subcontracting_usability/models/__init__.py
Normal file
1
mrp_subcontracting_usability/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from . import mrp_bom
|
||||||
11
mrp_subcontracting_usability/models/mrp_bom.py
Normal file
11
mrp_subcontracting_usability/models/mrp_bom.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Copyright 2024 Akretion France (https://www.akretion.com/)
|
||||||
|
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
from odoo import fields, models
|
||||||
|
|
||||||
|
|
||||||
|
class MrpBom(models.Model):
|
||||||
|
_inherit = 'mrp.bom'
|
||||||
|
|
||||||
|
subcontractor_ids = fields.Many2many(domain=[('parent_id', '=', False)])
|
||||||
24
mrp_subcontracting_usability/views/stock_warehouse.xml
Normal file
24
mrp_subcontracting_usability/views/stock_warehouse.xml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright 2024 Akretion France (https://www.akretion.com/)
|
||||||
|
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
-->
|
||||||
|
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
<record id="view_warehouse" model="ir.ui.view">
|
||||||
|
<field name="model">stock.warehouse</field>
|
||||||
|
<field name="inherit_id" ref="stock_usability.view_warehouse" />
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<group name="routes" position="inside">
|
||||||
|
<field name="subcontracting_route_id"/>
|
||||||
|
</group>
|
||||||
|
<field name="out_type_id" position="after">
|
||||||
|
<field name="subcontracting_type_id" readonly="1"/>
|
||||||
|
<field name="subcontracting_resupply_type_id" readonly="1"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</odoo>
|
||||||
Reference in New Issue
Block a user