proteus: is it possible to dynamically add/remove simple field to existing model

38 views
Skip to first unread message

Richard PALO

unread,
Sep 23, 2017, 12:16:16 PM9/23/17
to tryton
As the title indicates, I'm interested to know if one can add/remove a persistent
field (simple, non relational... like an integer) to an existing model with proteus.

Or is the only way by adding a custom module which then can be removed when done.

Any pointers are welcome.
--

Richard PALO

Cédric Krier

unread,
Sep 23, 2017, 12:45:09 PM9/23/17
to tryton
On 2017-09-23 18:16, Richard PALO wrote:
> As the title indicates, I'm interested to know if one can add/remove a persistent
> field (simple, non relational... like an integer) to an existing model with proteus.

Tryton enforce data integrity so a client can not modify the data model.

> Or is the only way by adding a custom module which then can be removed when done.

This sounds wrong and I do not even know if it is possible to do it
because module has only access to subclasses of the Model.

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

Richard PALO

unread,
Sep 23, 2017, 1:09:43 PM9/23/17
to try...@googlegroups.com
Le 23/09/2017 à 18:43, Cédric Krier a écrit :
> On 2017-09-23 18:16, Richard PALO wrote:
>> As the title indicates, I'm interested to know if one can add/remove a persistent
>> field (simple, non relational... like an integer) to an existing model with proteus.
>
> Tryton enforce data integrity so a client can not modify the data model.
>
>> Or is the only way by adding a custom module which then can be removed when done.
>
> This sounds wrong and I do not even know if it is possible to do it
> because module has only access to subclasses of the Model.
>
I figured as much for the integrity bit, though I thought the question should be asked to be sure.

Unfortunately I don't understand the second response, are you saying that subclassing an
existing class and adding a persistent field is not possible? (e.g. an additional integer
field on account.move.line) Activate to add, then deactivate to remove...

Or am I greatly misunderstanding something here?

--

Richard PALO

Cédric Krier

unread,
Sep 23, 2017, 4:45:09 PM9/23/17
to try...@googlegroups.com
No, I'm only answering to the removing a field, adding is possible and
the basis of Tryton modularity.

Richard PALO

unread,
Sep 25, 2017, 8:15:36 AM9/25/17
to try...@googlegroups.com
Le 23/09/2017 à 22:41, Cédric Krier a écrit :
> No, I'm only answering to the removing a field, adding is possible and
> the basis of Tryton modularity.
>
OK, noted.
Works fine to add/remove programatically a module with the field.
No problem then manually dropping the field afterwards with psql.

cheers,
--

Richard PALO
Reply all
Reply to author
Forward
0 new messages