Display quantity when searching lot for stock move

Closes #13782
This commit is contained in:
Cédric Krier committed 2024-12-26 17:45:26 +01:00
1 parent efba57bf65
commit 9313409e82
5 files changed
+27 -2

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
* Display quantity when searching lot for move
Version 7.4.0 - 2024-11-04
--------------------------
+9 -1
View File
@@ -18,7 +18,7 @@ from trytond.model.exceptions import (
from trytond.modules.stock import StockMixin
from trytond.modules.stock.exceptions import ShipmentCheckQuantityWarning
from trytond.pool import Pool, PoolMeta
from trytond.pyson import Bool, Eval, Len
from trytond.pyson import Bool, Eval, If, Len
from trytond.tools import grouped_slice
from trytond.transaction import Transaction
from trytond.wizard import Button, StateTransition, StateView, Wizard
@@ -426,6 +426,14 @@ class Move(metaclass=PoolMeta):
],
states={
'readonly': Eval('state').in_(['cancelled', 'done']),
},
search_context={
'locations': If(Eval('from_location'),
[Eval('from_location', -1)], []),
'stock_date_end': (
If(Eval('effective_date'),
Eval('effective_date', None),
Eval('planned_date', None))),
})
@classmethod
+7
View File
@@ -15,6 +15,13 @@ this repository contains the full copyright notices and license terms. -->
<field name="name">lot_tree</field>
</record>
<record model="ir.ui.view" id="lot_view_list_stock_move">
<field name="model">stock.lot</field>
<field name="type">tree</field>
<field name="priority" eval="20"/>
<field name="name">lot_list_stock_move</field>
</record>
<record model="ir.action.act_window" id="act_lot_form">
<field name="name">Lots</field>
<field name="res_model">stock.lot</field>
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tree>
<field name="number" expand="1"/>
<field name="product" expand="1"/>
<field name="quantity" symbol="default_uom"/>
<field name="forecast_quantity" symbol="default_uom" optional="1"/>
</tree>
+1 -1
View File
@@ -4,7 +4,7 @@ this repository contains the full copyright notices and license terms. -->
<data>
<xpath expr="/form/field[@name='product']" position="after">
<label name="lot"/>
<field name="lot"/>
<field name="lot" view_ids="stock_lot.lot_view_list_stock_move"/>
</xpath>
<xpath expr="/form/group[@id='buttons']" position="inside">
<button name="add_lots_wizard" icon="tryton-add"/>