Add default next_ to change shipment state

This commit is contained in:
resteve 2015-03-18 10:06:17 +01:00
parent d91312f118
commit a9cddeca97
3 changed files with 48 additions and 0 deletions

View File

@ -21,3 +21,13 @@ Dispone de dos nuevos menús para las herramientas:
Acceso mediante grupo "Administrador herramienta stock".
- Defecto. Muestro todos los albaranes que se han gestionado según empleado actual (preferencias usuario).
Acceso mediante grupo "Herramienta stock".
Acciones por defecto (Nexts)
----------------------------
Se dispone de métodos "next" para proceder/continuar con el abarán para el siguiente estado:
- Borrador -> En espera
- En espera -> Asignado (assign_try)
- Asignado -> Empaquetado
- Empaquetado -> Realizado

View File

@ -18,3 +18,13 @@ There are two menus to manage Stock Tools:
- All. Show all shipments managed without employee. Access "Stock Tools Administrator" group.
- Default. Show all shipments managed with current employee (user preferences). Access "Stock Tools" group.
Default Nexts
-------------
There are default nexts methods to process/continue shipment to next state:
- Draft -> Waitint
- Waiting -> Assigned (assign_try)
- Assigned -> Packed
- Packed -> Done

View File

@ -111,3 +111,31 @@ class ShipmentOutTool(ModelSQL, ModelView):
if hasattr(cls, method_name):
getattr(cls, method_name)(tool)
return 'new'
def next_draft(self):
pool = Pool()
Shipment = Pool().get('stock.shipment.out')
# Change new state: waiting
Shipment.wait([self.shipment])
def next_waiting(self):
pool = Pool()
Shipment = Pool().get('stock.shipment.out')
# Change new state: assigned
Shipment.assign_try([self.shipment])
def next_assigned(self):
pool = Pool()
Shipment = Pool().get('stock.shipment.out')
# Change new state: assigned
Shipment.pack([self.shipment])
def next_packed(self):
pool = Pool()
Shipment = Pool().get('stock.shipment.out')
# Change new state: done
Shipment.done([self.shipment])