diff --git a/mrp_production_partner_note/README.rst b/mrp_production_partner_note/README.rst new file mode 100644 index 000000000..cfd676af7 --- /dev/null +++ b/mrp_production_partner_note/README.rst @@ -0,0 +1,43 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: License: AGPL-3 + +Partner production notes +======================== + +This module adds the possibility of defining a note for production in the +partner so when the MO is automatically created, this note will be written. + + +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 + +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. diff --git a/mrp_production_partner_note/__init__.py b/mrp_production_partner_note/__init__.py new file mode 100644 index 000000000..054c8853d --- /dev/null +++ b/mrp_production_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_production_partner_note/__openerp__.py b/mrp_production_partner_note/__openerp__.py new file mode 100644 index 000000000..daf35bd9b --- /dev/null +++ b/mrp_production_partner_note/__openerp__.py @@ -0,0 +1,41 @@ +# -*- 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 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/. +# +############################################################################## + +{ + "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_production_note", + ], + "data": [ + "views/res_partner_view.xml", + ], + "installable": True +} diff --git a/mrp_production_partner_note/i18n/es.po b/mrp_production_partner_note/i18n/es.po new file mode 100644 index 000000000..8fbeb40b1 --- /dev/null +++ b/mrp_production_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_production_partner_note/i18n/mrp_partner_note.pot b/mrp_production_partner_note/i18n/mrp_partner_note.pot new file mode 100644 index 000000000..360c4b38e --- /dev/null +++ b/mrp_production_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 "" + diff --git a/mrp_production_partner_note/models/__init__.py b/mrp_production_partner_note/models/__init__.py new file mode 100644 index 000000000..5c7957575 --- /dev/null +++ b/mrp_production_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_production_partner_note/models/procurement_order.py b/mrp_production_partner_note/models/procurement_order.py new file mode 100644 index 000000000..5229e13f0 --- /dev/null +++ b/mrp_production_partner_note/models/procurement_order.py @@ -0,0 +1,22 @@ +# -*- 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 + mrp_notes = sale_proc.sale_line_id.order_id.partner_id.mrp_notes + if mrp_notes: + old = ( + res.get('notes') and + ('{other}\n'.format(other=res.get('notes', ''))) or '') + res['notes'] = '{old}{mine}'.format(old=old, mine=mrp_notes) + return res diff --git a/mrp_production_partner_note/models/res_partner.py b/mrp_production_partner_note/models/res_partner.py new file mode 100644 index 000000000..8381b6cf7 --- /dev/null +++ b/mrp_production_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_production_partner_note/views/res_partner_view.xml b/mrp_production_partner_note/views/res_partner_view.xml new file mode 100644 index 000000000..d0eed2fef --- /dev/null +++ b/mrp_production_partner_note/views/res_partner_view.xml @@ -0,0 +1,17 @@ + + + + + res.partner.production_notes.form + res.partner + + + + + + + + +