Add return equipments
This commit is contained in:
		
							
								
								
									
										13
									
								
								move.py
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								move.py
									
									
									
									
									
								
							| @@ -11,14 +11,18 @@ from trytond.transaction import Transaction | ||||
| class Move(metaclass=PoolMeta): | ||||
|     "Stock Move" | ||||
|     __name__ = "stock.move" | ||||
|      | ||||
|  | ||||
|  | ||||
|     return_equipment = fields.Boolean("Devolución") | ||||
|     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')) | ||||
|                                         ], | ||||
|                                 states={'invisible': If(~Eval('product_equipment'), True), | ||||
|                                         'readonly': (Eval('state').in_(['cancelled', 'done'])),}, | ||||
|                                 depends=['product_equipment']) | ||||
|                                 depends=['product_equipment', 'move_type']) | ||||
|     equipment_serial = fields.Function(fields.Char('Serial', | ||||
|                                                    states={'readonly': True, | ||||
|                                                            'invisible': If(~Eval('product_equipment'), True)}, | ||||
| @@ -150,8 +154,7 @@ class ShipmentOut(metaclass=PoolMeta): | ||||
|                     serial = False | ||||
|                      | ||||
|             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 | ||||
|                 producto de tipo equipo en este envío.")) | ||||
|                 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.")) | ||||
|                 break | ||||
|              | ||||
|             sale_origin = shipment.outgoing_moves[0].origin.sale | ||||
|   | ||||
| @@ -3,6 +3,9 @@ | ||||
| this repository contains the full copyright notices and license terms. --> | ||||
| <data> | ||||
|     <xpath expr="/form/field[@name='product']" position="after"> | ||||
| 	<newline/> | ||||
| 	<label name="return_equipment"/> | ||||
| 	<field name="return_equipment"/> | ||||
| 	<newline/> | ||||
| 	<label name="equipment"/> | ||||
| 	<field name="equipment"/>	 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user