Merge lp:~schampagne/openerp-manufacturing/mrp_bom_product_details into lp:openerp-manufacturing

Status: Merged
Merged at revision: 3
Proposed branch: lp:~schampagne/openerp-manufacturing/mrp_bom_product_details
Merge into: lp:openerp-manufacturing
Diff against target: 154 lines (+134/-0)
4 files modified
mrp_bom_product_details/__init__.py (+23/-0)
mrp_bom_product_details/__openerp__.py (+35/-0)
mrp_bom_product_details/mrp_bom_product_details.py (+34/-0)
mrp_bom_product_details/mrp_bom_product_details.xml (+42/-0)
To merge this branch: bzr merge lp:~schampagne/openerp-manufacturing/mrp_bom_product_details
Reviewer Review Type Date Requested Status
Alexandre Fayolle - camptocamp Approve
Guewen Baconnier @ Camptocamp no test, review Approve
Maxime Chambreuil (http://www.savoirfairelinux.com) Approve
Review via email: mp+143791@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) :
review: Approve
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

As this is for version 7.0, it would be better to:

Inherit from orm.Model instead of osv.osv, because osv.osv is deprecated
    from openerp.osv import fields, orm
    from openerp.tools.translate import _

    class mrp_bom(orm.Model):

And you no longer need to instantiate your model at line 107

The lines 103, 104 are very long...

So it would be great if you can change that.

Expect that, that looks good to me

review: Approve (no test, review)
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

LGTM

review: Approve
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

> LGTM

Sorry, the comment went out too soon.

Please change the base class to Model and remove the class instanciation, as pointed out by guewen

4. By root <root@prog01>

removed deprecated code, fixed typo, improved code readability

Revision history for this message
samuel champagne (schampagne) wrote :

Requestion modifications have been made.

Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

I tried to do the merge but the target branch is empty (no revisions) and I got:

bzr: ERROR: Merging into empty branches not currently supported, https://bugs.launchpad.net/bzr/+bug/308562

Is it intended that lp:openerp-manufacturing is empty?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'mrp_bom_product_details'
2=== added file 'mrp_bom_product_details/__init__.py'
3--- mrp_bom_product_details/__init__.py 1970-01-01 00:00:00 +0000
4+++ mrp_bom_product_details/__init__.py 2013-01-18 15:15:27 +0000
5@@ -0,0 +1,23 @@
6+# -*- coding: utf-8 -*-
7+
8+##############################################################################
9+#
10+# OpenERP, Open Source Management Solution
11+# Copyright (C) 2013 Solutions Libergia inc. (<http://www.libergia.com>).
12+#
13+# This program is free software: you can redistribute it and/or modify
14+# it under the terms of the GNU General Public License as
15+# published by the Free Software Foundation, either version 3 of the
16+# License, or (at your option) any later version.
17+#
18+# This program is distributed in the hope that it will be useful,
19+# but WITHOUT ANY WARRANTY; without even the implied warranty of
20+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+# GNU General Public License for more details.
22+#
23+# You should have received a copy of the GNU General Public License
24+# along with this program. If not, see <http://www.gnu.org/licenses/>.
25+#
26+##############################################################################
27+
28+import mrp_bom_product_details
29
30=== added file 'mrp_bom_product_details/__openerp__.py'
31--- mrp_bom_product_details/__openerp__.py 1970-01-01 00:00:00 +0000
32+++ mrp_bom_product_details/__openerp__.py 2013-01-18 15:15:27 +0000
33@@ -0,0 +1,35 @@
34+# -*- coding: utf-8 -*-
35+
36+##############################################################################
37+#
38+# OpenERP, Open Source Management Solution
39+# Copyright (C) 2013 Solutions Libergia inc. (<http://www.libergia.com>).
40+#
41+# This program is free software: you can redistribute it and/or modify
42+# it under the terms of the GNU General Public License as
43+# published by the Free Software Foundation, either version 3 of the
44+# License, or (at your option) any later version.
45+#
46+# This program is distributed in the hope that it will be useful,
47+# but WITHOUT ANY WARRANTY; without even the implied warranty of
48+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49+# GNU General Public License for more details.
50+#
51+# You should have received a copy of the GNU General Public License
52+# along with this program. If not, see <http://www.gnu.org/licenses/>.
53+#
54+##############################################################################
55+{
56+ 'name': 'Bom product details',
57+ 'version': '0.1',
58+ 'author': 'Solutions Libergia inc.',
59+ 'category': 'Manufacturing',
60+ 'description': """
61+ This module adds product price and stock to bom views
62+ """,
63+ 'depends': ["base","mrp"],
64+ 'demo': [],
65+ 'data': ['mrp_bom_product_details.xml'],
66+ 'auto_install': False,
67+ 'installable': True,
68+}
69
70=== added file 'mrp_bom_product_details/mrp_bom_product_details.py'
71--- mrp_bom_product_details/mrp_bom_product_details.py 1970-01-01 00:00:00 +0000
72+++ mrp_bom_product_details/mrp_bom_product_details.py 2013-01-18 15:15:27 +0000
73@@ -0,0 +1,34 @@
74+# -*- coding: utf-8 -*-
75+
76+##############################################################################
77+#
78+# OpenERP, Open Source Management Solution
79+# Copyright (C) 2013 Solutions Libergia inc. (<http://www.libergia.com>).
80+#
81+# This program is free software: you can redistribute it and/or modify
82+# it under the terms of the GNU General Public License as
83+# published by the Free Software Foundation, either version 3 of the
84+# License, or (at your option) any later version.
85+#
86+# This program is distributed in the hope that it will be useful,
87+# but WITHOUT ANY WARRANTY; without even the implied warranty of
88+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
89+# GNU General Public License for more details.
90+#
91+# You should have received a copy of the GNU General Public License
92+# along with this program. If not, see <http://www.gnu.org/licenses/>.
93+#
94+##############################################################################
95+
96+from openerp.osv import fields, orm
97+from openerp.tools.translate import _
98+
99+class mrp_bom(orm.Model):
100+ _inherit = 'mrp.bom'
101+
102+ _columns ={
103+ 'product_standard_price': fields.related('product_id', 'standard_price',
104+ type='float', string='Cost Price', readonly=True),
105+ 'product_qty_available': fields.related('product_id', 'qty_available',
106+ type='float', string='Quantity On Hand', readonly=True),
107+ }
108
109=== added file 'mrp_bom_product_details/mrp_bom_product_details.xml'
110--- mrp_bom_product_details/mrp_bom_product_details.xml 1970-01-01 00:00:00 +0000
111+++ mrp_bom_product_details/mrp_bom_product_details.xml 2013-01-18 15:15:27 +0000
112@@ -0,0 +1,42 @@
113+<?xml version="1.0"?>
114+<openerp>
115+ <data>
116+
117+ <record id="mrp_bom_tree_view" model="ir.ui.view">
118+ <field name="name">mrp.bom.tree</field>
119+ <field name="model">mrp.bom</field>
120+ <field name="inherit_id" ref="mrp.mrp_bom_tree_view"/>
121+ <field name="arch" type="xml">
122+ <field name="product_uom" position="after">
123+ <field name="product_standard_price" />
124+ <field name="product_qty_available" />
125+ </field>
126+ </field>
127+ </record>
128+
129+ <record id="mrp_bom_component_tree_view" model="ir.ui.view">
130+ <field name="name">mrp.bom.component.tree</field>
131+ <field name="model">mrp.bom</field>
132+ <field name="inherit_id" ref="mrp.mrp_bom_component_tree_view"/>
133+ <field name="arch" type="xml">
134+ <field name="product_uom" position="after">
135+ <field name="product_standard_price" />
136+ <field name="product_qty_available" />
137+ </field>
138+ </field>
139+ </record>
140+
141+ <record id="mrp_bom_form_view" model="ir.ui.view">
142+ <field name="name">mrp.bom.form</field>
143+ <field name="model">mrp.bom</field>
144+ <field name="inherit_id" ref="mrp.mrp_bom_form_view"/>
145+ <field name="arch" type="xml">
146+ <xpath expr="//field[@name='bom_lines']/tree" position="inside" >
147+ <field name="product_standard_price" />
148+ <field name="product_qty_available" />
149+ </xpath>
150+ </field>
151+ </record>
152+
153+ </data>
154+</openerp>

Subscribers

People subscribed via source and target branches