diff --git a/mrp_sale_info/README.rst b/mrp_sale_info/README.rst index 20a237040..248ced437 100644 --- a/mrp_sale_info/README.rst +++ b/mrp_sale_info/README.rst @@ -19,7 +19,7 @@ New fields are displayed in tree and in form views (Extra information tab). .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/129/9.0 + :target: https://runbot.odoo-community.org/runbot/129/11.0 Bug Tracker =========== @@ -31,7 +31,7 @@ help us smashing it by providing a detailed and welcomed `feedback `_. +11.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. Credits ======= @@ -47,9 +47,9 @@ Contributors * Rafael Blasco * Antonio Espinosa * Javier Iniesta -* Oihane Crucelaegui ", -* Pedro M. Baeza ", -* Ana Juaristi " +* Oihane Crucelaegui +* Pedro M. Baeza +* Ana Juaristi * Victor M. Martin Maintainer diff --git a/mrp_sale_info/__init__.py b/mrp_sale_info/__init__.py index 51736d4ae..8018c4c84 100644 --- a/mrp_sale_info/__init__.py +++ b/mrp_sale_info/__init__.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# © 2016 Antiun Ingenieria S.L. - Javier Iniesta +# Copyright 2016 Antiun Ingenieria S.L. - Javier Iniesta # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import models diff --git a/mrp_sale_info/__manifest__.py b/mrp_sale_info/__manifest__.py index 20539473b..67d2a6dfe 100644 --- a/mrp_sale_info/__manifest__.py +++ b/mrp_sale_info/__manifest__.py @@ -1,28 +1,26 @@ -# -*- coding: utf-8 -*- -# © 2016 Antiun Ingenieria S.L. - Javier Iniesta +# Copyright 2016 Antiun Ingenieria S.L. - Javier Iniesta # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "MRP Sale Info", "summary": "Adds sale information to Manufacturing models", - "version": "9.0.1.0.0", + "version": "11.0.1.0.0", "category": "Manufacturing", - "website": "http://www.antiun.com", - "author": "Antiun Ingeniería S.L., " - "OdooMRP team, " - "AvanzOSC, " - "Serv. Tecnol. Avanzados - Pedro M. Baeza, " + "website": "https://github.com/oca/manufacture", + "author": "AvanzOSC, " + "Tecnativa, " "Odoo Community Association (OCA)", "license": "AGPL-3", "application": False, - 'installable': False, + 'installable': True, "depends": [ - "mrp_operations", + "mrp", "sale_mrp", "sale_order_dates", - "stock" + "stock", + "sale_stock", ], "data": [ "views/mrp_production.xml", - "views/mrp_production_workcenter_line.xml" + "views/mrp_workorder.xml", ] } diff --git a/mrp_sale_info/models/__init__.py b/mrp_sale_info/models/__init__.py index cb18640f5..2618c7645 100644 --- a/mrp_sale_info/models/__init__.py +++ b/mrp_sale_info/models/__init__.py @@ -1,6 +1,5 @@ -# -*- coding: utf-8 -*- -# © 2016 Antiun Ingenieria S.L. - Javier Iniesta +# Copyright 2016 Antiun Ingenieria S.L. - Javier Iniesta # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import mrp_production -from . import mrp_production_workcenter_line +from . import mrp_workorder diff --git a/mrp_sale_info/models/mrp_production.py b/mrp_sale_info/models/mrp_production.py index 24ddb0aa2..cfb01ee80 100644 --- a/mrp_sale_info/models/mrp_production.py +++ b/mrp_sale_info/models/mrp_production.py @@ -1,17 +1,18 @@ -# -*- coding: utf-8 -*- -# © 2016 Antiun Ingenieria S.L. - Javier Iniesta +# Copyright 2016 Antiun Ingenieria S.L. - Javier Iniesta # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields +from odoo import fields, models class MrpProduction(models.Model): _inherit = "mrp.production" sale_id = fields.Many2one( - 'sale.order', string='Sale order', readonly=True, store=True, - related='move_prod_id.procurement_id.sale_line_id.order_id') - partner_id = fields.Many2one(related='sale_id.partner_id', - string='Customer', store=True) - commitment_date = fields.Datetime(related='sale_id.commitment_date', - string='Commitment Date', store=True) + comodel_name='sale.order', string='Sale order', readonly=True, + store=True, related='procurement_group_id.sale_id') + partner_id = fields.Many2one( + comodel_name='res.partner', related='sale_id.partner_id', + string='Customer', store=True) + commitment_date = fields.Datetime( + related='sale_id.commitment_date', string='Commitment Date', + store=True) diff --git a/mrp_sale_info/models/mrp_production_workcenter_line.py b/mrp_sale_info/models/mrp_workorder.py similarity index 73% rename from mrp_sale_info/models/mrp_production_workcenter_line.py rename to mrp_sale_info/models/mrp_workorder.py index 9991efe81..fa3a1490c 100644 --- a/mrp_sale_info/models/mrp_production_workcenter_line.py +++ b/mrp_sale_info/models/mrp_workorder.py @@ -1,12 +1,11 @@ -# -*- coding: utf-8 -*- -# © 2016 Antiun Ingenieria S.L. - Javier Iniesta +# Copyright 2016 Antiun Ingenieria S.L. - Javier Iniesta # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields +from odoo import fields, models -class MrpProductionWorkcenterLine(models.Model): - _inherit = "mrp.production.workcenter.line" +class MrpWorkorder(models.Model): + _inherit = "mrp.workorder" sale_id = fields.Many2one(related='production_id.sale_id', string='Sale order', readonly=True, store=True) diff --git a/mrp_sale_info/views/mrp_production.xml b/mrp_sale_info/views/mrp_production.xml index 4fee03f44..93d4357f6 100644 --- a/mrp_sale_info/views/mrp_production.xml +++ b/mrp_sale_info/views/mrp_production.xml @@ -1,13 +1,11 @@ - - - + MRP Production Form with Sale Order mrp.production - + - + @@ -20,7 +18,7 @@ mrp.production - + @@ -28,5 +26,4 @@ - - + diff --git a/mrp_sale_info/views/mrp_production_workcenter_line.xml b/mrp_sale_info/views/mrp_production_workcenter_line.xml deleted file mode 100644 index 1af6ac649..000000000 --- a/mrp_sale_info/views/mrp_production_workcenter_line.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - MRP Production Work Order Tree with Sale Order - mrp.production.workcenter.line - - - - - - - - - - - - MRP Production Work Order Form with Sale Order - mrp.production.workcenter.line - - - - - - - - - - - - - - - - diff --git a/mrp_sale_info/views/mrp_workorder.xml b/mrp_sale_info/views/mrp_workorder.xml new file mode 100644 index 000000000..c1e16b47d --- /dev/null +++ b/mrp_sale_info/views/mrp_workorder.xml @@ -0,0 +1,29 @@ + + + + MRP Work Order Tree with Sale Order + mrp.workorder + + + + + + + + + + + + MRP Work Order Form with Sale Order + mrp.workorder + + + + + + + + + + +