On 2015-11-17 11:59, Raimon Esteve wrote:
> Hie,
> 
> I have this code (is a wizard view)
> 
> class ShipmentOutPicking(ModelView):
>     __name__ = 'stock.shipment.out.picking'
>     shipment = fields.Many2One('stock.shipment.out', 'Shipment', 
> required=True)
>     moves = fields.One2Many('stock.move', None, 'Moves', readonly=True)
> 
>     def on_change_shipment(self, name=None):
>         res = {}
>         if self.shipment:
>             res['moves'] = [m.id for m in self.shipment.inventory_moves]
>         return res
> 
> 
> 1- Show moves
> 
> When select a shipment, add all shipment inventory moves in moves
> field. I show moves in this field.
> 
> - v3.4
> 
> This code work successfully. It's ok.
> 
> - v3.8
> 
> This code doesn't work successfully
> 
> When on_change, the client get record2.id a negative id and add in
> to_create list.
> In v3.4 I recibe a positive id and add in to_add. Is the reason v3.4
> work successfully and v3.8 not.
> 
> (1) to_add/to_create when record2.id > 0
> 
> Why am I missing in v3.8? or is a bugin v3.8?

No it is not a bug. on_change must update the record values and no more
return something. And if you had set the correct fields.depends
decorator it will have raise an error because you can no more return
something.

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: [email protected]
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/20151121133021.GP15014%40tetsuo.b2ck.com.

Reply via email to