On 05/12/11 14:10 +0100, Albert Cervera i Areny wrote:
> A Dilluns, 5 de desembre de 2011 10:54:02, Cédric Krier va escriure:
> > On 05/12/11 07:47 +0100, Albert Cervera i Areny wrote:
> > > A Dilluns, 5 de desembre de 2011 00:00:34, Cédric Krier va escriure:
> > > > On 04/12/11 21:47 +0100, Albert Cervera i Areny wrote:
> > > > > As $subject says, think we should convert the relationship between
> > > > > account.invoice and account.move from a Many2One to a One2One because
> > > > > that better represents their relationship. I think we should also
> > > > > make it browsable from account moves to invoices because that's a
> > > > > very usual need when implementing new accounting modules. We should
> > > > > simply add the 'invoice' field as a One2One in account.move.
> > > > 
> > > > I don't see any advantage. I will prefer to try to prevent bloating the
> > > > account.move table with field that are not always needed or meaningful.
> > > 
> > > Well, there are two questions here: One is to make the relationship a
> > > One2One and the other one to add the field to account.move. For the
> > > former I think that it is better because that's simply the relationship
> > > that exists between Invoices and Moves. You cannot have an invoice with
> > > several moves
> > 
> > This is to be proven.
> 
> Well, if the field is a Many2One as it currently is, you cannot have an 
> invoice 
> with several moves. How would you do that?

I don't know but it will depend of the requirements.

> > > nor a move
> > > with several invoices, so that makes sense to me.
> > 
> > Yes but this can be done with a uniq constraint on the move field of
> > invoice.
> 
> Isn't it exactly why you created a One2One field type?

No, One2One has a different representation at the database level.
I think it is really right to have a Many2One on the invoice because it
is the invoice who create the move.
It will never be the move that creates the invoice but with a One2One
field it is what it "allow".

-- 
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/

Attachment: pgpob8JgOAkL3.pgp
Description: PGP signature

Reply via email to