Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ImprentaConfirmarStart(ModelSQL, ModelView):
- 'Modelo Confirmar Venta'
- _name = 'sale_imprenta.confirmar.start'
- cantidad_confirmada = fields.Selection('obtener_cantidades'
- , 'Cantidad confirmada')
- def obtener_cantidades(self):
- import pdb; pdb.set_trace()
- # I would like to have active_ids so i can get the value of my sale to create the selection field. # not working ..
- ventas_obj = Pool().get('sale.sale').browse(Transaction().context.get('active_ids'))
- # EXAMPLE of return
- return [ ('100', '100'), ('200', '200') ]
- ImprentaConfirmarStart()
- class ImprentaConfirmarSale(Wizard):
- 'Wizard Confirmar Venta. Confirma la cantidad de venta'
- _name = 'sale_imprenta.confirmar'
- start = StateView('sale_imprenta.confirmar.start',
- 'sale_imprenta.cantidad_confirmar_form', [
- Button('Cancelar', 'end', 'tryton-cancel'),
- Button('Aceptar', 'aceptar', 'tryton-ok', True),
- ])
- aceptar = StateTransition()
- def transition_aceptar(self, session):
- print "Transition Acepto Confirmacion"
- ventas_obj = Pool().get('sale.sale').browse(Transaction().context.get('active_ids'))
- for venta in ventas_obj:
- venta.write(venta.id, {'state':'confirmed'})
- return 'end'
- ImprentaConfirmarSale()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement