diff --git a/mrp_industrial_design_bom/__init__.py b/mrp_industrial_design_bom/__init__.py new file mode 100644 index 000000000..55ce5467c --- /dev/null +++ b/mrp_industrial_design_bom/__init__.py @@ -0,0 +1,24 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2013 Savoir-faire Linux (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU 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 General Public License +# along with this program. If not, see . +# +############################################################################## + +import industrial_design +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/mrp_industrial_design_bom/__openerp__.py b/mrp_industrial_design_bom/__openerp__.py new file mode 100644 index 000000000..03a8dced8 --- /dev/null +++ b/mrp_industrial_design_bom/__openerp__.py @@ -0,0 +1,39 @@ +# -*- encoding: utf-8 -*- + +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2013 Savoir-faire Linux (). +# +# 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 . +# +############################################################################## + +{ + 'name' : 'Industrial design specification in BoM', + 'version' : '1.0', + "author" : "Savoir-faire Linux", + "website" : "http://www.savoirfairelinux.com", + 'license': 'AGPL-3', + 'category' : 'Specific Industry Applications', + 'depends' : ['mrp'], + "data" : ['mrp_industrial_design.xml'], + 'description': """ +Add the fields 'Bubble Number' and 'RefDes' (reference description) to a component in BoM view. +""", + 'auto_install': False, + 'installable': True +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/mrp_industrial_design_bom/i18n/fr.po b/mrp_industrial_design_bom/i18n/fr.po new file mode 100644 index 000000000..38d5b4bd1 --- /dev/null +++ b/mrp_industrial_design_bom/i18n/fr.po @@ -0,0 +1,32 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * mrp_industrial_design_bom +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-03-26 16:23+0000\n" +"PO-Revision-Date: 2013-03-26 14:00-0500\n" +"Last-Translator: Marc Cassuto \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" + +#. module: mrp_industrial_design_bom +#: model:ir.model,name:mrp_industrial_design_bom.model_mrp_bom +msgid "Bill of Material" +msgstr "Nomenclature" + +#. module: mrp_industrial_design_bom +#: field:mrp.bom,refdes:0 +msgid "Notes" +msgstr "notes" + +#. module: mrp_industrial_design_bom +#: field:mrp.bom,bubble_number:0 +msgid "No" +msgstr "N°" + diff --git a/mrp_industrial_design_bom/i18n/mrp_industrial_design_bom.pot b/mrp_industrial_design_bom/i18n/mrp_industrial_design_bom.pot new file mode 100644 index 000000000..b5ac69017 --- /dev/null +++ b/mrp_industrial_design_bom/i18n/mrp_industrial_design_bom.pot @@ -0,0 +1,32 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * mrp_industrial_design_bom +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-03-26 16:23+0000\n" +"PO-Revision-Date: 2013-03-26 16:23+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_industrial_design_bom +#: model:ir.model,name:mrp_industrial_design_bom.model_mrp_bom +msgid "Bill of Material" +msgstr "" + +#. module: mrp_industrial_design_bom +#: field:mrp.bom,refdes:0 +msgid "Notes" +msgstr "" + +#. module: mrp_industrial_design_bom +#: field:mrp.bom,bubble_number:0 +msgid "No" +msgstr "" + diff --git a/mrp_industrial_design_bom/industrial_design.py b/mrp_industrial_design_bom/industrial_design.py new file mode 100644 index 000000000..43fad49c4 --- /dev/null +++ b/mrp_industrial_design_bom/industrial_design.py @@ -0,0 +1,32 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2010 Savoir-faire Linux (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU 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 General Public License +# along with this program. If not, see . +# +############################################################################## + +from openerp.osv import fields, orm + +class mrp_bom(orm.Model): + _inherit = 'mrp.bom' + _columns = { + 'bubble_number': fields.integer('No'), + 'refdes': fields.text('Notes'), + } + + _order = "bubble_number" +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/mrp_industrial_design_bom/mrp_industrial_design.xml b/mrp_industrial_design_bom/mrp_industrial_design.xml new file mode 100644 index 000000000..54c8c74fe --- /dev/null +++ b/mrp_industrial_design_bom/mrp_industrial_design.xml @@ -0,0 +1,29 @@ + + + + + + + + mrp.bom.form.inherit + mrp.bom + + + + + + + + + + + + + + diff --git a/mrp_industrial_design_bom/report/__init__.py b/mrp_industrial_design_bom/report/__init__.py new file mode 100644 index 000000000..0be3c550d --- /dev/null +++ b/mrp_industrial_design_bom/report/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- + +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2013 Savoir-faire Linux (). +# +# 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 . +# +############################################################################## + +import bom_structure_industrial_design diff --git a/mrp_industrial_design_bom/report/bom_structure_industrial_design.odt b/mrp_industrial_design_bom/report/bom_structure_industrial_design.odt new file mode 100644 index 000000000..1734d3c48 Binary files /dev/null and b/mrp_industrial_design_bom/report/bom_structure_industrial_design.odt differ diff --git a/mrp_industrial_design_bom/report/bom_structure_industrial_design.py b/mrp_industrial_design_bom/report/bom_structure_industrial_design.py new file mode 100644 index 000000000..cba61bee7 --- /dev/null +++ b/mrp_industrial_design_bom/report/bom_structure_industrial_design.py @@ -0,0 +1,69 @@ +## -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# 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 . +# +############################################################################## + +import time +from openerp.report import report_sxw +from openerp.osv import osv +from openerp import pooler + +class bom_structure(report_sxw.rml_parse): + def __init__(self, cr, uid, name, context): + super(bom_structure, self).__init__(cr, uid, name, context=context) + self.localcontext.update({ + 'time': time, + 'get_children':self.get_children, + }) + + def get_children(self, object, level=0): + result = [] + + def _get_rec(object, level): + for l in object: + res = {} + res['name'] = l.name + res['pname'] = l.product_id.name + res['pcode'] = l.product_id.default_code + res['pqty'] = l.product_qty + res['uname'] = l.product_uom.name + res['code'] = l.code + res['level'] = level + res['bnumber'] = l.bubble_number + result.append(res) + if l.child_complete_ids: + if level<6: + level += 1 + _get_rec(l.child_complete_ids,level) + if level>0 and level<6: + level -= 1 + return result + + children = _get_rec(object,level) + + return children + +report_sxw.report_sxw('report.industrialdesign.bom.structure', + 'mrp.bom', + 'mrp_industrial_design_bom/report/bom_structure_industrial_design.rml', + parser=bom_structure, + header='internal') + + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/mrp_industrial_design_bom/report/bom_structure_industrial_design.rml b/mrp_industrial_design_bom/report/bom_structure_industrial_design.rml new file mode 100644 index 000000000..26716096c --- /dev/null +++ b/mrp_industrial_design_bom/report/bom_structure_industrial_design.rml @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BOM Structure + + + + BOM Name + + + + Bubble Number + + + + Product Name + + + Quantity + + + BOM Ref + + + +
+ [[ repeatIn(objects, 'o') ]] + + + + [[ o.name ]] + + + + [[ o.bubble_number ]] + + + + [ [[ (o.product_id.default_code) or removeParentNode('font') ]] ] [[ o.product_id.name ]] + + + [[ o.product_qty ]] [[ o.product_uom.name ]] + + + [[ o.code ]] + + + +
+ [[ repeatIn(get_children(o.bom_lines), 'l') ]] + + + + [[ '... '*(l['level']) ]] - [[ l['name'] ]] + + + + [[ l['bnumber'] ]] + + + + [ [[ (l['pcode']) or removeParentNode('font') ]] ] [[ l['pname'] ]] + + + [[ l['pqty'] ]] [[ l['uname'] ]] + + + [[ l['code'] ]] + + + + + + +
+
+
+
+