Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
120 additions
and
78 deletions.
There are no files selected for viewing
42 changes: 0 additions & 42 deletions
42
__unported__/mrp_bom_product_details/mrp_bom_product_details.xml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
25 changes: 11 additions & 14 deletions
25
...__/mrp_bom_product_details/__openerp__.py → mrp_bom_product_details/__openerp__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
} |
11 changes: 5 additions & 6 deletions
11
...ted__/mrp_bom_product_details/__init__.py → mrp_bom_product_details/models/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
26 changes: 10 additions & 16 deletions
26
...roduct_details/mrp_bom_product_details.py → ...details/models/mrp_bom_product_details.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |