Skip to content

Commit

Permalink
[14.0][ADD]stock_inventory_line_product_cost: Added modue
Browse files Browse the repository at this point in the history
  • Loading branch information
vimalpatelserpentcs committed Jul 2, 2021
1 parent 776d0cc commit 899ae3b
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 0 deletions.
6 changes: 6 additions & 0 deletions setup/stock_inventory_line_product_cost/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
21 changes: 21 additions & 0 deletions stock_inventory_line_product_cost/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. 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

=====================
Stock Adjustment Cost
=====================

Adds product cost field to inventory adjustment line view.

Usage
=====

* Go to Inventory > Operations > Inventory Adjustments
* Create or open an existing inventory adjustment
* On the list view you should see the Product Cost field and it should show the cost of the product.

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

* Open Source Integrators <[email protected]>
4 changes: 4 additions & 0 deletions stock_inventory_line_product_cost/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (C) 2021 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
17 changes: 17 additions & 0 deletions stock_inventory_line_product_cost/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (C) 2021 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Stock Adjustment Cost",
"version": "14.0.1.0.0",
"license": "AGPL-3",
"author": "Open Source Integrators,Odoo Community Association (OCA)",
"maintainer": "Open Source Integrators",
"website": "https://github.com/OCA/stock-logistics-warehouse",
"category": "Stock",
"depends": ["stock"],
"data": [
"views/stock_inventory_line_view.xml",
],
"installable": True,
}
4 changes: 4 additions & 0 deletions stock_inventory_line_product_cost/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (C) 2021 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import stock_inventory_line
13 changes: 13 additions & 0 deletions stock_inventory_line_product_cost/models/stock_inventory_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (C) 2021 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class StockInventoryLine(models.Model):

_inherit = "stock.inventory.line"

product_cost = fields.Float(
related="product_id.standard_price", string="Product Cost"
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<odoo>
<record id="stock_inventory_line_cost_tree" model="ir.ui.view">
<field name="name">stock.inventory.line.cost.tree</field>
<field name="model">stock.inventory.line</field>
<field name="inherit_id" ref="stock.stock_inventory_line_tree" />
<field name="arch" type="xml">
<xpath expr="//field[@name='difference_qty']" position="after">
<field
name="product_cost"
optional="show"
groups="stock.group_stock_manager"
/>
</xpath>
</field>
</record>
</odoo>

0 comments on commit 899ae3b

Please sign in to comment.