mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
Add module mrp_lot_on_hand_first
This commit is contained in:
1
mrp_lot_on_hand_first/README.rst
Normal file
1
mrp_lot_on_hand_first/README.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
To be auto generated
|
||||||
1
mrp_lot_on_hand_first/__init__.py
Normal file
1
mrp_lot_on_hand_first/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from . import models
|
||||||
23
mrp_lot_on_hand_first/__manifest__.py
Normal file
23
mrp_lot_on_hand_first/__manifest__.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# Copyright 2022 Camptocamp SA
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
|
||||||
|
{
|
||||||
|
"name": "Mrp Lot On Hand First",
|
||||||
|
"summary": "Allows to display lots on hand first in M2o fields",
|
||||||
|
"version": "14.0.1.0.0",
|
||||||
|
"development_status": "Alpha",
|
||||||
|
"category": "Manufacturing/Manufacturing",
|
||||||
|
"website": "https://github.com/OCA/manufacture",
|
||||||
|
"author": "Camptocamp, Odoo Community Association (OCA)",
|
||||||
|
"maintainers": ["grindtildeath"],
|
||||||
|
"license": "AGPL-3",
|
||||||
|
"installable": True,
|
||||||
|
"auto_install": True,
|
||||||
|
"depends": [
|
||||||
|
"mrp",
|
||||||
|
"stock_lot_on_hand_first",
|
||||||
|
],
|
||||||
|
"data": [
|
||||||
|
"views/mrp_production.xml",
|
||||||
|
"views/stock_picking_type.xml",
|
||||||
|
],
|
||||||
|
}
|
||||||
1
mrp_lot_on_hand_first/models/__init__.py
Normal file
1
mrp_lot_on_hand_first/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from . import mrp_production
|
||||||
11
mrp_lot_on_hand_first/models/mrp_production.py
Normal file
11
mrp_lot_on_hand_first/models/mrp_production.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Copyright 2022 Camptocamp SA
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
|
||||||
|
from odoo import fields, models
|
||||||
|
|
||||||
|
|
||||||
|
class MrpProduction(models.Model):
|
||||||
|
_inherit = "mrp.production"
|
||||||
|
|
||||||
|
display_lots_on_hand_first = fields.Boolean(
|
||||||
|
related="picking_type_id.display_lots_on_hand_first"
|
||||||
|
)
|
||||||
2
mrp_lot_on_hand_first/readme/CONTRIBUTORS.rst
Normal file
2
mrp_lot_on_hand_first/readme/CONTRIBUTORS.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
* Akim Juillerat <akim.juillerat@camptocamp.com>
|
||||||
|
* Ricardo Almeida Soares <ricardo.almeidasoares@camptocamp.com>
|
||||||
3
mrp_lot_on_hand_first/readme/DESCRIPTION.rst
Normal file
3
mrp_lot_on_hand_first/readme/DESCRIPTION.rst
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
This module allows to display lots with a quantity on hand as first results
|
||||||
|
in the lots selection fields for of Mrp Productions in order to avoid displaying old
|
||||||
|
lots that are not in stock anymore.
|
||||||
22
mrp_lot_on_hand_first/views/mrp_production.xml
Normal file
22
mrp_lot_on_hand_first/views/mrp_production.xml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<odoo>
|
||||||
|
<record id="mrp_production_form_view_inherit" model="ir.ui.view">
|
||||||
|
<field name="name">mrp.production.form.inherit</field>
|
||||||
|
<field name="model">mrp.production</field>
|
||||||
|
<field name="inherit_id" ref="mrp.mrp_production_form_view" />
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="use_create_components_lots" position="after">
|
||||||
|
<field name="display_lots_on_hand_first" invisible="1" />
|
||||||
|
</field>
|
||||||
|
<xpath
|
||||||
|
expr="//field[@name='move_raw_ids']//field[@name='lot_ids']"
|
||||||
|
position="attributes"
|
||||||
|
>
|
||||||
|
<attribute name="context">{
|
||||||
|
'name_search_qty_on_hand_first': parent.display_lots_on_hand_first,
|
||||||
|
'default_company_id': company_id,
|
||||||
|
'default_product_id': product_id,}</attribute>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</odoo>
|
||||||
13
mrp_lot_on_hand_first/views/stock_picking_type.xml
Normal file
13
mrp_lot_on_hand_first/views/stock_picking_type.xml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<odoo>
|
||||||
|
<record id="view_picking_type_form_inherit_mrp_inherit" model="ir.ui.view">
|
||||||
|
<field name="name">Operation Types</field>
|
||||||
|
<field name="model">stock.picking.type</field>
|
||||||
|
<field name="inherit_id" ref="mrp.view_picking_type_form_inherit_mrp" />
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="use_create_components_lots" position="after">
|
||||||
|
<field name="display_lots_on_hand_first" />
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</odoo>
|
||||||
1
setup/mrp_lot_on_hand_first/odoo/addons/mrp_lot_on_hand_first
Symbolic link
1
setup/mrp_lot_on_hand_first/odoo/addons/mrp_lot_on_hand_first
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../../mrp_lot_on_hand_first
|
||||||
6
setup/mrp_lot_on_hand_first/setup.py
Normal file
6
setup/mrp_lot_on_hand_first/setup.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import setuptools
|
||||||
|
|
||||||
|
setuptools.setup(
|
||||||
|
setup_requires=['setuptools-odoo'],
|
||||||
|
odoo_addon=True,
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user