mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
The title sounds like a simple task, but it requires many changes: - Store done pkg qtys in `stock.move.line` records. - The qtys are not computed. Instead, the user must write them by hand. This happens because many times the packaging just indicates an approximate content, but is not always exact until reaching this point of the process, where both the done qtys (both UoM and packagings) are measured and get real values. - Added compute and inverse on `stock.move` for simple scenarios where one move = one move line. - Add all this on all reports and views. This change also opens the door to be able to get a real inventory measured in product packagings. That's not implemented in this MVP, but the idea is recorded. @moduon MT-5531
75 lines
3.1 KiB
XML
75 lines
3.1 KiB
XML
<?xml version="1.0" encoding="utf-8" ?>
|
|
<!-- Copyright 2024 Moduon Team S.L.
|
|
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) -->
|
|
<data>
|
|
<record id="view_move_extra_tree" model="ir.ui.view">
|
|
<field name="name">view.move.extra.tree</field>
|
|
<field name="model">stock.move</field>
|
|
<field name="inherit_id" ref="stock.view_move_tree" />
|
|
<field name="arch" type="xml">
|
|
<field name="product_packaging_id" position="after">
|
|
<field name="is_initial_demand_editable" invisible="1" />
|
|
<field
|
|
name="product_packaging_qty"
|
|
groups="product.group_stock_packaging"
|
|
attrs="{
|
|
'readonly': [
|
|
'|',
|
|
('product_packaging_id', '=', False),
|
|
('is_initial_demand_editable', '=', False),
|
|
],
|
|
}"
|
|
/>
|
|
</field>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="view_stock_move_operations" model="ir.ui.view">
|
|
<field name="name">Add product packaging qty info</field>
|
|
<field name="model">stock.move</field>
|
|
<field name="inherit_id" ref="stock.view_stock_move_operations" />
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//group" position="inside">
|
|
<group
|
|
groups="product.group_stock_packaging"
|
|
name="packaging"
|
|
attrs="{'invisible': [('product_packaging_id', '=', False)]}"
|
|
>
|
|
<label for="product_packaging_qty" string="Packagings demanded" />
|
|
<div class="o_row">
|
|
<span><field
|
|
name="product_packaging_qty"
|
|
readonly="1"
|
|
nolabel="1"
|
|
/></span>
|
|
<span><field
|
|
name="product_packaging_id"
|
|
readonly="1"
|
|
nolabel="1"
|
|
/></span>
|
|
</div>
|
|
<label for="product_packaging_qty_done" string="Packagings done" />
|
|
<div class="o_row">
|
|
<span><field
|
|
name="product_packaging_qty_done"
|
|
readonly="1"
|
|
nolabel="1"
|
|
/></span>
|
|
<span> / </span>
|
|
<span><field
|
|
name="product_packaging_qty"
|
|
readonly="1"
|
|
nolabel="1"
|
|
/></span>
|
|
<span><field
|
|
name="product_packaging_id"
|
|
readonly="1"
|
|
nolabel="1"
|
|
/></span>
|
|
</div>
|
|
</group>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
</data>
|