Skip to content

Commit

Permalink
Merge pull request #36 from oihane/8.0-mrp_partner_note
Browse files Browse the repository at this point in the history
[ADD] Migrate < mrp_production_partner_note > from odoomrp-utils
  • Loading branch information
pedrobaeza committed Aug 5, 2015
2 parents e7a1f30 + c69b51b commit 7931cff
Show file tree
Hide file tree
Showing 9 changed files with 212 additions and 0 deletions.
43 changes: 43 additions & 0 deletions 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 <https://github.com/OCA/manufacture/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 <https://github.com/OCA/manufacture/issues/new?body=module:%20mrp_production_partner_note%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.


Credits
=======

Contributors
------------

* Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>
* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
* Ana Juaristi <anajuaristi@avanzosc.es>

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.
6 changes: 6 additions & 0 deletions 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
41 changes: 41 additions & 0 deletions 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 <oihanecrucelaegi@avanzosc.es>",
"Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>",
"Ana Juaristi <anajuaristi@avanzosc.es>",
],
"category": "Tools",
"depends": [
"sale",
"mrp_production_note",
],
"data": [
"views/res_partner_view.xml",
],
"installable": True
}
32 changes: 32 additions & 0 deletions 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"

32 changes: 32 additions & 0 deletions 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 ""

7 changes: 7 additions & 0 deletions 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
22 changes: 22 additions & 0 deletions 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
12 changes: 12 additions & 0 deletions 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')
17 changes: 17 additions & 0 deletions mrp_production_partner_note/views/res_partner_view.xml
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="res_partner_production_notes_form_view">
<field name="name">res.partner.production_notes.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<page name="internal_notes" position="inside">
<label for="mrp_notes" />
<field name="mrp_notes" />
</page>
</field>
</record>

</data>
</openerp>

0 comments on commit 7931cff

Please sign in to comment.