Skip to content

Commit

Permalink
Merge 6a76f41 into a7d605f
Browse files Browse the repository at this point in the history
  • Loading branch information
mistotebe committed Sep 8, 2015
2 parents a7d605f + 6a76f41 commit 468d8a2
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 78 deletions.
42 changes: 0 additions & 42 deletions __unported__/mrp_bom_product_details/mrp_bom_product_details.xml

This file was deleted.

49 changes: 49 additions & 0 deletions mrp_bom_product_details/README.rst
@@ -0,0 +1,49 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

===================
BOM product details
===================

This module adds product price and stock to BOM view.

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/129/8.0

For further information, please visit:

* https://www.odoo.com/forum/help-1

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_bom_product_details%0Aversion:%200.0.1%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.


Credits
=======

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

* Ondřej Kuzník <ondrej.kuznik@credativ.co.uk>

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.
1 change: 1 addition & 0 deletions mrp_bom_product_details/__init__.py
@@ -0,0 +1 @@
from . import models
@@ -1,36 +1,33 @@
# -*- coding: utf-8 -*-

##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 Solutions Libergia inc. (<http://www.libergia.com>).
# 2015 credativ Ltd (<http://credativ.co.uk>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
# 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.
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# 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': 'Bom product details',
'version': '0.1',
'author': "Solutions Libergia inc.,Odoo Community Association (OCA)",
'version': '0.0.1',
'author': "Solutions Libergia inc.,"
"credativ ltd.,"
"Odoo Community Association (OCA)",
'license': 'GPL-3 or any later version',
'category': 'Manufacturing',
'description': """
This module adds product price and stock to bom view
""",
'depends': ["base", "mrp"],
'demo': [],
'data': ['mrp_bom_product_details.xml'],
'depends': ["mrp"],
'data': ['views/mrp_bom_product_details.xml'],
'auto_install': False,
'installable': False,
'installable': True,
}
@@ -1,23 +1,22 @@
# -*- coding: utf-8 -*-

##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 Solutions Libergia inc. (<http://www.libergia.com>).
# 2015 credativ Ltd (<http://credativ.co.uk>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
# 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.
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# 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/>.
#
##############################################################################

import mrp_bom_product_details
from . import mrp_bom_product_details
@@ -1,35 +1,29 @@
# -*- coding: utf-8 -*-

##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 Solutions Libergia inc. (<http://www.libergia.com>).
# 2015 credativ Ltd (<http://credativ.co.uk>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
# 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.
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# 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/>.
#
##############################################################################

from openerp.osv import fields, orm
from openerp import fields, models


class MrpBom(models.Model):
_inherit = 'mrp.bom.line'

class mrp_bom(orm.Model):
_inherit = 'mrp.bom'
_columns = {
'product_standard_price': fields.related(
'product_id', 'standard_price', type='float', string='Cost Price', readonly=True
),
'product_qty_available': fields.related(
'product_id', 'qty_available', type='float', string='Quantity On Hand', readonly=True
),
}
product_standard_price = fields.Float(related='product_id.standard_price')
product_qty_available = fields.Float(related='product_id.qty_available')
44 changes: 44 additions & 0 deletions mrp_bom_product_details/views/mrp_bom_product_details.xml
@@ -0,0 +1,44 @@
<?xml version="1.0"?>
<openerp>
<data>

<record id="mrp_bom_tree_view" model="ir.ui.view">
<field name="name">mrp.bom.tree</field>
<field name="model">mrp.bom.line</field>
<field name="inherit_id" ref="mrp.mrp_bom_tree_view"/>
<field name="arch" type="xml">
<field name="product_uom" position="after">
<field name="product_standard_price" />
<field name="product_qty_available" />
</field>
</field>
</record>

<record id="mrp_bom_component_tree_view" model="ir.ui.view">
<field name="name">mrp.bom.component.tree</field>
<field name="model">mrp.bom.line</field>
<field name="inherit_id" ref="mrp.mrp_bom_component_tree_view"/>
<field name="arch" type="xml">
<field name="product_qty" position="before">
<field name="product_standard_price" />
</field>
<field name="product_uom" position="after">
<field name="product_qty_available" />
</field>
</field>
</record>

<record id="mrp_bom_form_view" model="ir.ui.view">
<field name="name">mrp.bom.form</field>
<field name="model">mrp.bom</field>
<field name="inherit_id" ref="mrp.mrp_bom_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='bom_line_ids']/tree" position="inside" >
<field name="product_standard_price" />
<field name="product_qty_available" />
</xpath>
</field>
</record>

</data>
</openerp>

0 comments on commit 468d8a2

Please sign in to comment.