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
=== added directory 'mrp_bom_product_details'
=== added file 'mrp_bom_product_details/__init__.py'
--- mrp_bom_product_details/__init__.py 1970-01-01 00:00:00 +0000
+++ mrp_bom_product_details/__init__.py 2013-01-18 15:15:27 +0000
@@ -0,0 +1,23 @@
1# -*- coding: utf-8 -*-
2
3##############################################################################
4#
5# OpenERP, Open Source Management Solution
6# Copyright (C) 2013 Solutions Libergia inc. (<http://www.libergia.com>).
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23import mrp_bom_product_details
024
=== added file 'mrp_bom_product_details/__openerp__.py'
--- mrp_bom_product_details/__openerp__.py 1970-01-01 00:00:00 +0000
+++ mrp_bom_product_details/__openerp__.py 2013-01-18 15:15:27 +0000
@@ -0,0 +1,35 @@
1# -*- coding: utf-8 -*-
2
3##############################################################################
4#
5# OpenERP, Open Source Management Solution
6# Copyright (C) 2013 Solutions Libergia inc. (<http://www.libergia.com>).
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22{
23 'name': 'Bom product details',
24 'version': '0.1',
25 'author': 'Solutions Libergia inc.',
26 'category': 'Manufacturing',
27 'description': """
28 This module adds product price and stock to bom views
29 """,
30 'depends': ["base","mrp"],
31 'demo': [],
32 'data': ['mrp_bom_product_details.xml'],
33 'auto_install': False,
34 'installable': True,
35}
036
=== added file 'mrp_bom_product_details/mrp_bom_product_details.py'
--- mrp_bom_product_details/mrp_bom_product_details.py 1970-01-01 00:00:00 +0000
+++ mrp_bom_product_details/mrp_bom_product_details.py 2013-01-18 15:15:27 +0000
@@ -0,0 +1,34 @@
1# -*- coding: utf-8 -*-
2
3##############################################################################
4#
5# OpenERP, Open Source Management Solution
6# Copyright (C) 2013 Solutions Libergia inc. (<http://www.libergia.com>).
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23from openerp.osv import fields, orm
24from openerp.tools.translate import _
25
26class mrp_bom(orm.Model):
27 _inherit = 'mrp.bom'
28
29 _columns ={
30 'product_standard_price': fields.related('product_id', 'standard_price',
31 type='float', string='Cost Price', readonly=True),
32 'product_qty_available': fields.related('product_id', 'qty_available',
33 type='float', string='Quantity On Hand', readonly=True),
34 }
035
=== added file 'mrp_bom_product_details/mrp_bom_product_details.xml'
--- mrp_bom_product_details/mrp_bom_product_details.xml 1970-01-01 00:00:00 +0000
+++ mrp_bom_product_details/mrp_bom_product_details.xml 2013-01-18 15:15:27 +0000
@@ -0,0 +1,42 @@
1<?xml version="1.0"?>
2<openerp>
3 <data>
4
5 <record id="mrp_bom_tree_view" model="ir.ui.view">
6 <field name="name">mrp.bom.tree</field>
7 <field name="model">mrp.bom</field>
8 <field name="inherit_id" ref="mrp.mrp_bom_tree_view"/>
9 <field name="arch" type="xml">
10 <field name="product_uom" position="after">
11 <field name="product_standard_price" />
12 <field name="product_qty_available" />
13 </field>
14 </field>
15 </record>
16
17 <record id="mrp_bom_component_tree_view" model="ir.ui.view">
18 <field name="name">mrp.bom.component.tree</field>
19 <field name="model">mrp.bom</field>
20 <field name="inherit_id" ref="mrp.mrp_bom_component_tree_view"/>
21 <field name="arch" type="xml">
22 <field name="product_uom" position="after">
23 <field name="product_standard_price" />
24 <field name="product_qty_available" />
25 </field>
26 </field>
27 </record>
28
29 <record id="mrp_bom_form_view" model="ir.ui.view">
30 <field name="name">mrp.bom.form</field>
31 <field name="model">mrp.bom</field>
32 <field name="inherit_id" ref="mrp.mrp_bom_form_view"/>
33 <field name="arch" type="xml">
34 <xpath expr="//field[@name='bom_lines']/tree" position="inside" >
35 <field name="product_standard_price" />
36 <field name="product_qty_available" />
37 </xpath>
38 </field>
39 </record>
40
41 </data>
42</openerp>

Subscribers

People subscribed via source and target branches