Merge PR #1206 into 13.0

Signed-off-by rousseldenis
This commit is contained in:
OCA-git-bot
2021-07-29 08:31:54 +00:00
5 changed files with 34 additions and 2 deletions

View File

@@ -11,5 +11,5 @@
"license": "LGPL-3",
"installable": True,
"depends": ["stock_packaging_calculator", "stock"],
"data": ["views/stock_picking.xml"],
"data": ["views/stock_picking.xml", "views/stock_inventory_line.xml"],
}

View File

@@ -1,3 +1,4 @@
from . import stock_inventory_line
from . import stock_move
from . import stock_move_line
from . import stock_quant

View File

@@ -0,0 +1,12 @@
# Copyright 2021 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
from odoo import models
class StockInventoryLine(models.Model):
_name = "stock.inventory.line"
_inherit = ["stock.inventory.line", "product.qty_by_packaging.mixin"]
_qty_by_pkg__qty_field_name = "theoretical_qty"

View File

@@ -4,5 +4,9 @@ It adds product qty computed by packaging to:
* stock move
* stock move line
* stock quant
* stock inventory line
and displays it for move line on stock picking view.
Displays it:
* stock picking view for move line
* on inventory line tree view for stock_inventory_line

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2021 Camptocamp SA
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="stock_inventory_line_tree2" model="ir.ui.view">
<field name="name">stock.inventory.line.tree.inherit</field>
<field name="model">stock.inventory.line</field>
<field name="inherit_id" ref="stock.stock_inventory_line_tree2" />
<field name="arch" type="xml">
<field name="theoretical_qty" position="after">
<field name="product_qty_by_packaging_display" />
</field>
</field>
</record>
</odoo>