Add return equipments
This commit is contained in:
parent
cadb113039
commit
7803f6402c
11
move.py
11
move.py
@ -12,13 +12,17 @@ class Move(metaclass=PoolMeta):
|
|||||||
"Stock Move"
|
"Stock Move"
|
||||||
__name__ = "stock.move"
|
__name__ = "stock.move"
|
||||||
|
|
||||||
|
|
||||||
|
return_equipment = fields.Boolean("Devolución")
|
||||||
equipment = fields.Many2One('optical_equipment.equipment', "Equipment",
|
equipment = fields.Many2One('optical_equipment.equipment', "Equipment",
|
||||||
domain=[('state', '=', 'registred'),
|
domain=[If(Eval('return_equipment', True),
|
||||||
|
('state', 'in', ['uncontrated','contrated']),
|
||||||
|
('state', '=', 'registred')),
|
||||||
('product','=', Eval('product'))
|
('product','=', Eval('product'))
|
||||||
],
|
],
|
||||||
states={'invisible': If(~Eval('product_equipment'), True),
|
states={'invisible': If(~Eval('product_equipment'), True),
|
||||||
'readonly': (Eval('state').in_(['cancelled', 'done'])),},
|
'readonly': (Eval('state').in_(['cancelled', 'done'])),},
|
||||||
depends=['product_equipment'])
|
depends=['product_equipment', 'move_type'])
|
||||||
equipment_serial = fields.Function(fields.Char('Serial',
|
equipment_serial = fields.Function(fields.Char('Serial',
|
||||||
states={'readonly': True,
|
states={'readonly': True,
|
||||||
'invisible': If(~Eval('product_equipment'), True)},
|
'invisible': If(~Eval('product_equipment'), True)},
|
||||||
@ -150,8 +154,7 @@ class ShipmentOut(metaclass=PoolMeta):
|
|||||||
serial = False
|
serial = False
|
||||||
|
|
||||||
if number_equipments < 1 or maintenance_required < 1:
|
if number_equipments < 1 or maintenance_required < 1:
|
||||||
raise UserError(str("No se generó un mantenimiento inicial dado que los equipos no requiren mantenimiento, ó no se encontró ningún
|
raise UserError(str("No se generó un mantenimiento inicial dado que los equipos no requiren mantenimiento, ó no se encontró ningún producto de tipo equipo en este envío."))
|
||||||
producto de tipo equipo en este envío."))
|
|
||||||
break
|
break
|
||||||
|
|
||||||
sale_origin = shipment.outgoing_moves[0].origin.sale
|
sale_origin = shipment.outgoing_moves[0].origin.sale
|
||||||
|
@ -3,6 +3,9 @@
|
|||||||
this repository contains the full copyright notices and license terms. -->
|
this repository contains the full copyright notices and license terms. -->
|
||||||
<data>
|
<data>
|
||||||
<xpath expr="/form/field[@name='product']" position="after">
|
<xpath expr="/form/field[@name='product']" position="after">
|
||||||
|
<newline/>
|
||||||
|
<label name="return_equipment"/>
|
||||||
|
<field name="return_equipment"/>
|
||||||
<newline/>
|
<newline/>
|
||||||
<label name="equipment"/>
|
<label name="equipment"/>
|
||||||
<field name="equipment"/>
|
<field name="equipment"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user