mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[MOD] Added <mrp_partner_note> and renamed *notes modules to *note
This commit is contained in:
15
mrp_partner_note/README.rst
Normal file
15
mrp_partner_note/README.rst
Normal file
@@ -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 <oihanecrucelaegi@avanzosc.es>
|
||||
* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
|
||||
* Ana Juaristi <ajuaristio@gmail.com>
|
||||
6
mrp_partner_note/__init__.py
Normal file
6
mrp_partner_note/__init__.py
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
# For copyright and license notices, see __openerp__.py file in root directory
|
||||
##############################################################################
|
||||
|
||||
from . import models
|
||||
40
mrp_partner_note/__openerp__.py
Normal file
40
mrp_partner_note/__openerp__.py
Normal file
@@ -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 <oihanecrucelaegi@avanzosc.es>",
|
||||
"Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>",
|
||||
"Ana Juaristi <ajuaristio@gmail.com>"
|
||||
],
|
||||
"category": "Manufacturing",
|
||||
"summary": "",
|
||||
"data": [
|
||||
"views/res_partner_view.xml",
|
||||
],
|
||||
"installable": True,
|
||||
}
|
||||
7
mrp_partner_note/models/__init__.py
Normal file
7
mrp_partner_note/models/__init__.py
Normal file
@@ -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
|
||||
17
mrp_partner_note/models/procurement_order.py
Normal file
17
mrp_partner_note/models/procurement_order.py
Normal file
@@ -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
|
||||
12
mrp_partner_note/models/res_partner.py
Normal file
12
mrp_partner_note/models/res_partner.py
Normal file
@@ -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
mrp_partner_note/views/res_partner_view.xml
Normal file
17
mrp_partner_note/views/res_partner_view.xml
Normal file
@@ -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>
|
||||
Reference in New Issue
Block a user