Community mailing list archives

Re: Sale and purchase workflow

Camptocamp France SAS, Alexandre Fayolle - Camptocamp
- 09/18/2015 09:15:12
On 16/09/2015 13:17, Fabien Pinckaers wrote:
> There are several approaches to hook in the code. Use the one that fits
> your use case:
> - extend on the action, not the event (easy if you want to change the
> behaviour of an action, just a method to overwrite)
> - extend on the recompute of the computed field (easy if you want to
> trigger something new on a change: e.g. if the invoice_status changed,
> just a method to overwrite)
> - extend on write/create (not super clean, but basically the same than
> what the workflow was doing)
> - extend the trigger of the change of the computed field (extend @depends)

Hello Fabien,

We can certainly make such approach work (even if I think this is not
moving in the best direction).

However, I'm begging you to consider porting at least the computed
fields of in v9 to the new API. The fact that the state of
stock.pickings is declared using the old API has very nasty consequences:

* overriding the field is harder than required, and cannot be done in
the new API afaik
* it is not possible to call other pieces of code from within the
overridden function and expect these calls to see the updated state of
the picking. It sure is possible to work around this but readability and
maintainability are badly harmed in the process

If we are to extend the recompute of computed fields, please pretty
please help us by having all these computed fields in v9 be declared
with the new API.

Thanks for your work on Odoo, and for considering this request.

Alexandre Fayolle
Chef de Projet
Tel : +33 4 58 48 20 30

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac Cedex