
Hi everybody,
I'm working with Thierry Bruyere @ SALUC (Chemical industry located in Belgium)
We planned to migrate our internal erp tools to Tryton so i'm learning Tryton and his code.
Can someone give explanations about the display of a function field in the "
stock.shipment.in" module. I'm wondering where are defined the displayed fields for the function field "incoming_moves" (in this case : product, quantity, uom,planned date, effective date, state
I'm analyzing the code, unsuccessfully ...
in the file shipment_in_form.xml
<notebook colspan="6">
<page string="Incoming Moves" id="incoming_moves">
<field name="incoming_moves" colspan="4"/>
</page>
<page string="Inventory Moves" id="inventory_moves">
<field name="inventory_moves" colspan="4"/>
</page>
</notebook>
in shipment.py
Class ShipmentIn
incoming_moves = fields.Function(fields.One2Many('stock.move', 'shipment',
'Incoming Moves',
add_remove=[
('shipment', '=', None),
('from_location', '=', Eval('supplier_location')),
('state', '=', 'draft'),
('to_location', '=', Eval('warehouse_input')),
],
domain=[
('from_location', '=', Eval('supplier_location')),
('to_location', '=', Eval('warehouse_input')),
('company', '=', Eval('company')),
],
states={
'readonly': (Eval('state').in_(['received', 'done', 'cancel'])
| ~Eval('warehouse') | ~Eval('supplier')),
},
depends=['state', 'warehouse', 'supplier_location',
'warehouse_input', 'company']),
'get_incoming_moves', setter='set_incoming_moves') def get_inventory_moves(self, name):
moves = []
for move in self.moves:
if (move.from_location.id ==
self.warehouse.input_location.id):
moves.append(move.id)
return moves
Thank you !