From a6ad8ad92d3dd8fc8cbe83675267cd32a8743723 Mon Sep 17 00:00:00 2001 From: oihane Date: Thu, 5 Mar 2015 12:18:18 +0100 Subject: [PATCH 1/9] [MOD] Added and renamed *notes modules to *note --- mrp_partner_note/README.rst | 15 ++++++++ mrp_partner_note/__init__.py | 6 +++ mrp_partner_note/__openerp__.py | 40 ++++++++++++++++++++ mrp_partner_note/models/__init__.py | 7 ++++ mrp_partner_note/models/procurement_order.py | 17 +++++++++ mrp_partner_note/models/res_partner.py | 12 ++++++ mrp_partner_note/views/res_partner_view.xml | 17 +++++++++ 7 files changed, 114 insertions(+) create mode 100644 mrp_partner_note/README.rst create mode 100644 mrp_partner_note/__init__.py create mode 100644 mrp_partner_note/__openerp__.py create mode 100644 mrp_partner_note/models/__init__.py create mode 100644 mrp_partner_note/models/procurement_order.py create mode 100644 mrp_partner_note/models/res_partner.py create mode 100644 mrp_partner_note/views/res_partner_view.xml diff --git a/mrp_partner_note/README.rst b/mrp_partner_note/README.rst new file mode 100644 index 000000000..8e26ea10a --- /dev/null +++ b/mrp_partner_note/README.rst @@ -0,0 +1,15 @@ +Partner production notes +======================== + +This module adds the possibility of defining a note for production in the +partner so when the MO is automatically created it will be written this note +in it. + +Credits +======= + +Contributors +------------ +* Oihane Crucelaegui +* Pedro M. Baeza +* Ana Juaristi \ No newline at end of file diff --git a/mrp_partner_note/__init__.py b/mrp_partner_note/__init__.py new file mode 100644 index 000000000..054c8853d --- /dev/null +++ b/mrp_partner_note/__init__.py @@ -0,0 +1,6 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## + +from . import models diff --git a/mrp_partner_note/__openerp__.py b/mrp_partner_note/__openerp__.py new file mode 100644 index 000000000..ef2503b26 --- /dev/null +++ b/mrp_partner_note/__openerp__.py @@ -0,0 +1,40 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +############################################################################## + +{ + "name": "MRP - Partner production notes", + "version": "1.0", + "depends": [ + "sale", + "mrp", + "mrp_production_note", + ], + "author": "OdooMRP team", + "website": "http://www.odoomrp.com", + "contributors": [ + "Oihane Crucelaegui ", + "Pedro M. Baeza ", + "Ana Juaristi " + ], + "category": "Manufacturing", + "summary": "", + "data": [ + "views/res_partner_view.xml", + ], + "installable": True, +} diff --git a/mrp_partner_note/models/__init__.py b/mrp_partner_note/models/__init__.py new file mode 100644 index 000000000..5c7957575 --- /dev/null +++ b/mrp_partner_note/models/__init__.py @@ -0,0 +1,7 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## + +from . import res_partner +from . import procurement_order diff --git a/mrp_partner_note/models/procurement_order.py b/mrp_partner_note/models/procurement_order.py new file mode 100644 index 000000000..27983f11e --- /dev/null +++ b/mrp_partner_note/models/procurement_order.py @@ -0,0 +1,17 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## + +from openerp import models, api + + +class ProcurementOrder(models.Model): + _inherit = 'procurement.order' + + @api.model + def _prepare_mo_vals(self, procurement): + res = super(ProcurementOrder, self)._prepare_mo_vals(procurement) + sale_proc = procurement.move_dest_id.procurement_id + res['notes'] = sale_proc.sale_line_id.order_id.partner_id.mrp_notes + return res diff --git a/mrp_partner_note/models/res_partner.py b/mrp_partner_note/models/res_partner.py new file mode 100644 index 000000000..8381b6cf7 --- /dev/null +++ b/mrp_partner_note/models/res_partner.py @@ -0,0 +1,12 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## + +from openerp import models, fields + + +class ResPartner(models.Model): + _inherit = 'res.partner' + + mrp_notes = fields.Html(string='Production Notes') diff --git a/mrp_partner_note/views/res_partner_view.xml b/mrp_partner_note/views/res_partner_view.xml new file mode 100644 index 000000000..d0eed2fef --- /dev/null +++ b/mrp_partner_note/views/res_partner_view.xml @@ -0,0 +1,17 @@ + + + + + res.partner.production_notes.form + res.partner + + + + + + + + + From 8111fe4a912ec1095cc0c82bcc03565b03199177 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 25 Mar 2015 21:35:06 +0100 Subject: [PATCH 2/9] [IMP] Expand AUTHORS --- mrp_partner_note/__openerp__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mrp_partner_note/__openerp__.py b/mrp_partner_note/__openerp__.py index ef2503b26..7b894d68c 100644 --- a/mrp_partner_note/__openerp__.py +++ b/mrp_partner_note/__openerp__.py @@ -24,7 +24,9 @@ "mrp", "mrp_production_note", ], - "author": "OdooMRP team", + "author": "OdooMRP team," + "AvanzOSC," + "Serv. Tecnol. Avanzados - Pedro M. Baeza", "website": "http://www.odoomrp.com", "contributors": [ "Oihane Crucelaegui ", From 8bf2f682e139f7d408938bcf0f343d9b03446002 Mon Sep 17 00:00:00 2001 From: oihane Date: Mon, 27 Apr 2015 09:33:10 +0200 Subject: [PATCH 3/9] [MOD] Changed email --- mrp_partner_note/README.rst | 2 +- mrp_partner_note/__openerp__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mrp_partner_note/README.rst b/mrp_partner_note/README.rst index 8e26ea10a..82bea5bcb 100644 --- a/mrp_partner_note/README.rst +++ b/mrp_partner_note/README.rst @@ -12,4 +12,4 @@ Contributors ------------ * Oihane Crucelaegui * Pedro M. Baeza -* Ana Juaristi \ No newline at end of file +* Ana Juaristi \ No newline at end of file diff --git a/mrp_partner_note/__openerp__.py b/mrp_partner_note/__openerp__.py index 7b894d68c..c20a6704d 100644 --- a/mrp_partner_note/__openerp__.py +++ b/mrp_partner_note/__openerp__.py @@ -31,7 +31,7 @@ "contributors": [ "Oihane Crucelaegui ", "Pedro M. Baeza ", - "Ana Juaristi " + "Ana Juaristi " ], "category": "Manufacturing", "summary": "", From 77f0bf9a4e7a79fa938f8d31dd29a9e13d9d6482 Mon Sep 17 00:00:00 2001 From: oihane Date: Wed, 5 Aug 2015 10:40:07 +0200 Subject: [PATCH 4/9] [ADD] Migrate from odoomrp-utils --- mrp_partner_note/README.rst | 31 ++++++++++++++++++++- mrp_partner_note/__openerp__.py | 32 +++++++++++----------- mrp_partner_note/i18n/es.po | 32 ++++++++++++++++++++++ mrp_partner_note/i18n/mrp_partner_note.pot | 32 ++++++++++++++++++++++ 4 files changed, 110 insertions(+), 17 deletions(-) create mode 100644 mrp_partner_note/i18n/es.po create mode 100644 mrp_partner_note/i18n/mrp_partner_note.pot diff --git a/mrp_partner_note/README.rst b/mrp_partner_note/README.rst index 82bea5bcb..33b99c35d 100644 --- a/mrp_partner_note/README.rst +++ b/mrp_partner_note/README.rst @@ -1,3 +1,6 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: License: AGPL-3 + Partner production notes ======================== @@ -5,11 +8,37 @@ This module adds the possibility of defining a note for production in the partner so when the MO is automatically created it will be written this note in it. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed feedback +`here `_. + + Credits ======= Contributors ------------ + * Oihane Crucelaegui * Pedro M. Baeza -* Ana Juaristi \ No newline at end of file +* Ana Juaristi + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. \ No newline at end of file diff --git a/mrp_partner_note/__openerp__.py b/mrp_partner_note/__openerp__.py index c20a6704d..8cf3d2789 100644 --- a/mrp_partner_note/__openerp__.py +++ b/mrp_partner_note/__openerp__.py @@ -2,14 +2,14 @@ ############################################################################## # # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see http://www.gnu.org/licenses/. @@ -19,24 +19,24 @@ { "name": "MRP - Partner production notes", "version": "1.0", + "author": "OdooMRP team," + "AvanzOSC," + "Serv. Tecnol. Avanzados - Pedro M. Baeza, " + "Odoo Community Association (OCA)", + "website": "http://www.odoomrp.com", + "contributors": [ + "Oihane Crucelaegui ", + "Pedro M. Baeza ", + "Ana Juaristi ", + ], + "category": "Tools", "depends": [ "sale", "mrp", "mrp_production_note", ], - "author": "OdooMRP team," - "AvanzOSC," - "Serv. Tecnol. Avanzados - Pedro M. Baeza", - "website": "http://www.odoomrp.com", - "contributors": [ - "Oihane Crucelaegui ", - "Pedro M. Baeza ", - "Ana Juaristi " - ], - "category": "Manufacturing", - "summary": "", "data": [ "views/res_partner_view.xml", ], - "installable": True, + "installable": True } diff --git a/mrp_partner_note/i18n/es.po b/mrp_partner_note/i18n/es.po new file mode 100644 index 000000000..8fbeb40b1 --- /dev/null +++ b/mrp_partner_note/i18n/es.po @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_partner_note +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-08-05 08:34+0000\n" +"PO-Revision-Date: 2015-08-05 08:34+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: mrp_partner_note +#: model:ir.model,name:mrp_partner_note.model_res_partner +msgid "Partner" +msgstr "Empresa" + +#. module: mrp_partner_note +#: model:ir.model,name:mrp_partner_note.model_procurement_order +msgid "Procurement" +msgstr "Abastecimiento" + +#. module: mrp_partner_note +#: field:res.partner,mrp_notes:0 +msgid "Production Notes" +msgstr "Notas de producción" + diff --git a/mrp_partner_note/i18n/mrp_partner_note.pot b/mrp_partner_note/i18n/mrp_partner_note.pot new file mode 100644 index 000000000..360c4b38e --- /dev/null +++ b/mrp_partner_note/i18n/mrp_partner_note.pot @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_partner_note +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-08-05 08:34+0000\n" +"PO-Revision-Date: 2015-08-05 08:34+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: mrp_partner_note +#: model:ir.model,name:mrp_partner_note.model_res_partner +msgid "Partner" +msgstr "" + +#. module: mrp_partner_note +#: model:ir.model,name:mrp_partner_note.model_procurement_order +msgid "Procurement" +msgstr "" + +#. module: mrp_partner_note +#: field:res.partner,mrp_notes:0 +msgid "Production Notes" +msgstr "" + From 17b27a9f06dd71393fdc5ba7fbaf2c6dbecbb331 Mon Sep 17 00:00:00 2001 From: oihane Date: Wed, 5 Aug 2015 11:19:05 +0200 Subject: [PATCH 5/9] [IMP] Renamed module to --- .../README.rst | 7 +++---- .../__init__.py | 0 .../__openerp__.py | 1 - .../i18n/es.po | 0 .../i18n/mrp_partner_note.pot | 0 .../models/__init__.py | 0 .../models/procurement_order.py | 5 ++++- .../models/res_partner.py | 0 .../views/res_partner_view.xml | 0 9 files changed, 7 insertions(+), 6 deletions(-) rename {mrp_partner_note => mrp_production_partner_note}/README.rst (83%) rename {mrp_partner_note => mrp_production_partner_note}/__init__.py (100%) rename {mrp_partner_note => mrp_production_partner_note}/__openerp__.py (99%) rename {mrp_partner_note => mrp_production_partner_note}/i18n/es.po (100%) rename {mrp_partner_note => mrp_production_partner_note}/i18n/mrp_partner_note.pot (100%) rename {mrp_partner_note => mrp_production_partner_note}/models/__init__.py (100%) rename {mrp_partner_note => mrp_production_partner_note}/models/procurement_order.py (77%) rename {mrp_partner_note => mrp_production_partner_note}/models/res_partner.py (100%) rename {mrp_partner_note => mrp_production_partner_note}/views/res_partner_view.xml (100%) diff --git a/mrp_partner_note/README.rst b/mrp_production_partner_note/README.rst similarity index 83% rename from mrp_partner_note/README.rst rename to mrp_production_partner_note/README.rst index 33b99c35d..cfd676af7 100644 --- a/mrp_partner_note/README.rst +++ b/mrp_production_partner_note/README.rst @@ -5,8 +5,7 @@ Partner production notes ======================== This module adds the possibility of defining a note for production in the -partner so when the MO is automatically created it will be written this note -in it. +partner so when the MO is automatically created, this note will be written. Bug Tracker @@ -15,7 +14,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback -`here `_. +`here `_. Credits @@ -41,4 +40,4 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit http://odoo-community.org. \ No newline at end of file +To contribute to this module, please visit http://odoo-community.org. diff --git a/mrp_partner_note/__init__.py b/mrp_production_partner_note/__init__.py similarity index 100% rename from mrp_partner_note/__init__.py rename to mrp_production_partner_note/__init__.py diff --git a/mrp_partner_note/__openerp__.py b/mrp_production_partner_note/__openerp__.py similarity index 99% rename from mrp_partner_note/__openerp__.py rename to mrp_production_partner_note/__openerp__.py index 8cf3d2789..daf35bd9b 100644 --- a/mrp_partner_note/__openerp__.py +++ b/mrp_production_partner_note/__openerp__.py @@ -32,7 +32,6 @@ "category": "Tools", "depends": [ "sale", - "mrp", "mrp_production_note", ], "data": [ diff --git a/mrp_partner_note/i18n/es.po b/mrp_production_partner_note/i18n/es.po similarity index 100% rename from mrp_partner_note/i18n/es.po rename to mrp_production_partner_note/i18n/es.po diff --git a/mrp_partner_note/i18n/mrp_partner_note.pot b/mrp_production_partner_note/i18n/mrp_partner_note.pot similarity index 100% rename from mrp_partner_note/i18n/mrp_partner_note.pot rename to mrp_production_partner_note/i18n/mrp_partner_note.pot diff --git a/mrp_partner_note/models/__init__.py b/mrp_production_partner_note/models/__init__.py similarity index 100% rename from mrp_partner_note/models/__init__.py rename to mrp_production_partner_note/models/__init__.py diff --git a/mrp_partner_note/models/procurement_order.py b/mrp_production_partner_note/models/procurement_order.py similarity index 77% rename from mrp_partner_note/models/procurement_order.py rename to mrp_production_partner_note/models/procurement_order.py index 27983f11e..5e1c27088 100644 --- a/mrp_partner_note/models/procurement_order.py +++ b/mrp_production_partner_note/models/procurement_order.py @@ -12,6 +12,9 @@ class ProcurementOrder(models.Model): @api.model def _prepare_mo_vals(self, procurement): res = super(ProcurementOrder, self)._prepare_mo_vals(procurement) + notes = res.get('notes', '') sale_proc = procurement.move_dest_id.procurement_id - res['notes'] = sale_proc.sale_line_id.order_id.partner_id.mrp_notes + notes += ('|n%s' % + (sale_proc.sale_line_id.order_id.partner_id.mrp_notes or '')) + res['notes'] = notes return res diff --git a/mrp_partner_note/models/res_partner.py b/mrp_production_partner_note/models/res_partner.py similarity index 100% rename from mrp_partner_note/models/res_partner.py rename to mrp_production_partner_note/models/res_partner.py diff --git a/mrp_partner_note/views/res_partner_view.xml b/mrp_production_partner_note/views/res_partner_view.xml similarity index 100% rename from mrp_partner_note/views/res_partner_view.xml rename to mrp_production_partner_note/views/res_partner_view.xml From 87b349f07f83313afa21ac891d514d1cfdd0fd96 Mon Sep 17 00:00:00 2001 From: oihane Date: Wed, 5 Aug 2015 11:43:40 +0200 Subject: [PATCH 6/9] [IMP] write only if there is some note --- mrp_production_partner_note/models/procurement_order.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mrp_production_partner_note/models/procurement_order.py b/mrp_production_partner_note/models/procurement_order.py index 5e1c27088..165faa9d6 100644 --- a/mrp_production_partner_note/models/procurement_order.py +++ b/mrp_production_partner_note/models/procurement_order.py @@ -12,9 +12,8 @@ class ProcurementOrder(models.Model): @api.model def _prepare_mo_vals(self, procurement): res = super(ProcurementOrder, self)._prepare_mo_vals(procurement) - notes = res.get('notes', '') sale_proc = procurement.move_dest_id.procurement_id - notes += ('|n%s' % - (sale_proc.sale_line_id.order_id.partner_id.mrp_notes or '')) - res['notes'] = notes + mrp_notes = sale_proc.sale_line_id.order_id.partner_id.mrp_notes + if mrp_notes: + res['notes'] = mrp_notes return res From c3e201b7080fc4382a27e5cbb3decd77a71c9911 Mon Sep 17 00:00:00 2001 From: oihane Date: Wed, 5 Aug 2015 12:29:15 +0200 Subject: [PATCH 7/9] [IMP] Do not erase previous notes --- mrp_production_partner_note/models/procurement_order.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mrp_production_partner_note/models/procurement_order.py b/mrp_production_partner_note/models/procurement_order.py index 165faa9d6..aa8c91c5d 100644 --- a/mrp_production_partner_note/models/procurement_order.py +++ b/mrp_production_partner_note/models/procurement_order.py @@ -15,5 +15,7 @@ class ProcurementOrder(models.Model): sale_proc = procurement.move_dest_id.procurement_id mrp_notes = sale_proc.sale_line_id.order_id.partner_id.mrp_notes if mrp_notes: - res['notes'] = mrp_notes + res['notes'] = ( + (res.get('notes', '') + "\n") if res.get('notes') else '') + res['notes'] += mrp_notes return res From 8ee2bc595ffb067c997d98d9df0cead99caedb6a Mon Sep 17 00:00:00 2001 From: oihane Date: Wed, 5 Aug 2015 13:12:10 +0200 Subject: [PATCH 8/9] [IMP] string formatting --- mrp_production_partner_note/models/procurement_order.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mrp_production_partner_note/models/procurement_order.py b/mrp_production_partner_note/models/procurement_order.py index aa8c91c5d..30bd362cd 100644 --- a/mrp_production_partner_note/models/procurement_order.py +++ b/mrp_production_partner_note/models/procurement_order.py @@ -16,6 +16,7 @@ class ProcurementOrder(models.Model): mrp_notes = sale_proc.sale_line_id.order_id.partner_id.mrp_notes if mrp_notes: res['notes'] = ( - (res.get('notes', '') + "\n") if res.get('notes') else '') - res['notes'] += mrp_notes + res.get('notes') and + ('{other}\n'.format(other=res.get('notes', ''))) or '') + res['notes'] += '{mine}'.format(mine=mrp_notes) return res From c69b51b8d65ee43f51e9067cdce51b01dcc61973 Mon Sep 17 00:00:00 2001 From: oihane Date: Wed, 5 Aug 2015 13:18:59 +0200 Subject: [PATCH 9/9] [IMP] more changes --- mrp_production_partner_note/models/procurement_order.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mrp_production_partner_note/models/procurement_order.py b/mrp_production_partner_note/models/procurement_order.py index 30bd362cd..5229e13f0 100644 --- a/mrp_production_partner_note/models/procurement_order.py +++ b/mrp_production_partner_note/models/procurement_order.py @@ -15,8 +15,8 @@ class ProcurementOrder(models.Model): sale_proc = procurement.move_dest_id.procurement_id mrp_notes = sale_proc.sale_line_id.order_id.partner_id.mrp_notes if mrp_notes: - res['notes'] = ( + old = ( res.get('notes') and ('{other}\n'.format(other=res.get('notes', ''))) or '') - res['notes'] += '{mine}'.format(mine=mrp_notes) + res['notes'] = '{old}{mine}'.format(old=old, mine=mrp_notes) return res