[MIG] mrp_usability to v16

This commit is contained in:
Alexis de Lattre
2022-10-27 22:23:25 +02:00
parent 71ebe2adea
commit bbb0cb17f7
6 changed files with 21 additions and 22 deletions

View File

@@ -1,10 +1,10 @@
# Copyright 2015-2020 Akretion (http://www.akretion.com) # Copyright 2015-2022 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com> # @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{ {
'name': 'MRP Usability', 'name': 'MRP Usability',
'version': '14.0.1.0.0', 'version': '16.0.1.0.0',
'category': 'Manufacturing', 'category': 'Manufacturing',
'license': 'AGPL-3', 'license': 'AGPL-3',
'summary': 'Usability improvements on manufacturing', 'summary': 'Usability improvements on manufacturing',
@@ -14,7 +14,8 @@
'data': [ 'data': [
'views/mrp_production.xml', 'views/mrp_production.xml',
'views/product_template.xml', 'views/product_template.xml',
'views/stock_move.xml',
# 'report/mrp_report.xml' # TODO # 'report/mrp_report.xml' # TODO
], ],
'installable': False, 'installable': True,
} }

View File

@@ -1,4 +1,4 @@
# Copyright 2021 Akretion (http://www.akretion.com) # Copyright 2021-2022 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com> # @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

View File

@@ -1,4 +1,4 @@
# Copyright 2015-2020 Akretion (http://www.akretion.com) # Copyright 2015-2022 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com> # @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
@@ -10,11 +10,11 @@ class MrpProduction(models.Model):
_inherit = 'mrp.production' _inherit = 'mrp.production'
# Method used by the report, inherited in this module # Method used by the report, inherited in this module
@api.model # @api.model
def get_stock_move_sold_out_report(self, move): # def get_stock_move_sold_out_report(self, move):
lines = move.active_move_line_ids # lines = move.active_move_line_ids
qty_in_lots = sum([x.product_uom_qty for x in lines]) # qty_in_lots = sum([x.product_uom_qty for x in lines])
diff = round(move.product_qty - qty_in_lots, 3) # diff = round(move.product_qty - qty_in_lots, 3)
if diff == 0.0: # if diff == 0.0:
return "" # return ""
return diff # return diff

View File

@@ -1,4 +1,4 @@
# Copyright (C) 2020 - Akretion # Copyright 2020-2022 Akretion France (http://www.akretion.com/)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import models from odoo import models

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
© 2016 Akretion (http://www.akretion.com/) Copyright 2016-2022 Akretion (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
@@ -13,12 +13,10 @@
<field name="model">mrp.production</field> <field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_form_view"/> <field name="inherit_id" ref="mrp.mrp_production_form_view"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//page[@name='miscellaneous']/group/group/field[@name='location_src_id']" position="replace"/> <label for="product_qty" position="before">
<xpath expr="//page[@name='miscellaneous']/group/group/field[@name='location_dest_id']" position="replace"/> <field name="location_src_id" groups="stock.group_stock_multi_locations" options="{'no_create': True}" attrs="{'readonly': [('state', '!=', 'draft')]}" position="move"/>
<field name="bom_id" position="after"> <field name="location_dest_id" groups="stock.group_stock_multi_locations" options="{'no_create': True}" attrs="{'readonly': [('state', '!=', 'draft')]}" position="move"/>
<field name="location_src_id" groups="stock.group_stock_multi_locations" options="{'no_create': True}" attrs="{'readonly': [('state', '!=', 'draft')]}"/> </label>
<field name="location_dest_id" groups="stock.group_stock_multi_locations" options="{'no_create': True}" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
</field>
<xpath expr="//page[@name='miscellaneous']/group/group/field[@name='date_deadline']" position="after"> <xpath expr="//page[@name='miscellaneous']/group/group/field[@name='date_deadline']" position="after">
<field name="date_start"/> <field name="date_start"/>
<field name="date_finished"/> <field name="date_finished"/>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2016-2020 Akretion (http://www.akretion.com/) Copyright 2016-2022 Akretion (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->