mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[ADD][15.0] Add module of mrp_finished_products
This commit is contained in:
0
mrp_finished_backorder_product/README.rst
Normal file
0
mrp_finished_backorder_product/README.rst
Normal file
3
mrp_finished_backorder_product/__init__.py
Normal file
3
mrp_finished_backorder_product/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
|
||||
|
||||
from . import models
|
||||
16
mrp_finished_backorder_product/__manifest__.py
Normal file
16
mrp_finished_backorder_product/__manifest__.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# Copyright 2022 ForgeFlow S.L. (https://www.forgeflow.com)
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
|
||||
|
||||
{
|
||||
"name": "MRP Finished Backorder Product",
|
||||
"version": "15.0.1.0.0",
|
||||
"author": "ForgeFlow, Odoo Community Association (OCA)",
|
||||
"summary": "Be able to see the summary of the finished manufactured orders ",
|
||||
"website": "https://github.com/OCA/manufacture",
|
||||
"category": "Manufacturing",
|
||||
"depends": ["mrp"],
|
||||
"data": ["views/mrp_production_views.xml"],
|
||||
"license": "LGPL-3",
|
||||
"installable": True,
|
||||
"development_status": "Beta",
|
||||
}
|
||||
3
mrp_finished_backorder_product/models/__init__.py
Normal file
3
mrp_finished_backorder_product/models/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
|
||||
|
||||
from . import mrp_production
|
||||
25
mrp_finished_backorder_product/models/mrp_production.py
Normal file
25
mrp_finished_backorder_product/models/mrp_production.py
Normal file
@@ -0,0 +1,25 @@
|
||||
# Copyright 2022 ForgeFlow S.L.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class MrpProduction(models.Model):
|
||||
_inherit = "mrp.production"
|
||||
finished_move_from_backorder_ids = fields.One2many(
|
||||
"stock.move.line",
|
||||
compute="_compute_finished_backorders",
|
||||
string="Finished Backorders",
|
||||
)
|
||||
|
||||
@api.depends("move_finished_ids.move_line_ids")
|
||||
def _compute_finished_backorders(self):
|
||||
for production in self:
|
||||
production.finished_move_from_backorder_ids = self.env["stock.move.line"]
|
||||
backorders = production.procurement_group_id.mrp_production_ids
|
||||
for backorder in backorders:
|
||||
backorder.mapped("finished_move_line_ids").production_id = backorder
|
||||
production.finished_move_from_backorder_ids |= (
|
||||
backorder.finished_move_line_ids
|
||||
)
|
||||
2
mrp_finished_backorder_product/readme/CONTRIBUTORS.rst
Normal file
2
mrp_finished_backorder_product/readme/CONTRIBUTORS.rst
Normal file
@@ -0,0 +1,2 @@
|
||||
* Joan Mateu <joan.mateu@forgeflow.com>
|
||||
* Maria de Luna <maria.de.luna@forgeflow.com>
|
||||
1
mrp_finished_backorder_product/readme/DESCRIPTION.rst
Normal file
1
mrp_finished_backorder_product/readme/DESCRIPTION.rst
Normal file
@@ -0,0 +1 @@
|
||||
This module collects the functionality hat was in previous versions and adds a tab to see the finished manufacturing orders.
|
||||
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="mrp_production_form_view_finished_products" model="ir.ui.view">
|
||||
<field name="name">mrp.production.form.finished</field>
|
||||
<field name="model">mrp.production</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_production_form_view" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//page[@name='miscellaneous']" position='after'>
|
||||
<page
|
||||
string='Finished products'
|
||||
name="finished_products"
|
||||
attrs="{'invisible': [('finished_move_from_backorder_ids', '=', [])]}"
|
||||
>
|
||||
<field
|
||||
name="finished_move_from_backorder_ids"
|
||||
context="{'form_view_ref': 'mrp.view_finisehd_move_line'}"
|
||||
attrs="{'readonly': [('is_locked', '=', True)], 'invisible': [('finished_move_from_backorder_ids', '=', [])]}"
|
||||
>
|
||||
<tree>
|
||||
<field name="product_id" readonly="1" />
|
||||
<field name="qty_done" readonly="1" />
|
||||
<field name="production_id" readonly="1" />
|
||||
<field
|
||||
name="lot_id"
|
||||
groups="stock.group_production_lot"
|
||||
domain="[('product_id', '=', product_id)]"
|
||||
context="{'default_product_id': product_id}"
|
||||
/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -0,0 +1 @@
|
||||
../../../../mrp_finished_backorder_product
|
||||
6
setup/mrp_finished_backorder_product/setup.py
Normal file
6
setup/mrp_finished_backorder_product/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