On 27/09/11 08:24 +0200, Albert Cervera i Areny wrote: > AFAIK properties currently only allow Many2One values
No, it also manage Numeric, Char and Selection. But it should be improved to
manage also other fields.
> and they use Reference
> fields to point to the records which are somewhat slower to process and most
> important do not use referential integrity features of the underlying DBMS.
The referential integrity is managed on reading as there was an "ON DELETE SET
NULL" and this is for all the Reference fields.
But we should probably add also the management of ondelete in ModelSQL as it
is done for the Many2One fields.
> I
> think properties could be changed to use a One2Many() field underneath and
> automatically create a new model to store their information.
>
> For example, the following code:
>
> customer_payment_term = fields.Property(fields.Many2One(
> 'account.invoice.payment_term', string='Customer Payment Term'))
>
> Could automatically create a new model equivalent to:
>
> class party.party.customer_payment_term(ModelSQL):
> party = fields.Many2One('party.party),
> payment_term = fields.Many2One('account.invoice.payment_term'),
>
> or could be expected the developer to create it manually.
>
> This would had the advantage of using referential integrity and support all
> field types out of the box. It may also mean improved performance as well as
> creating a more intuitive database structure for those who need to extract
> information from the database.
But how do you manage default values?
And also I don't see how the behavior of the Property fields could be changed
as it is now for multi-company.
--
Cédric Krier
B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: [email protected]
Website: http://www.b2ck.com/
pgp3l0k9ZVPps.pgp
Description: PGP signature
