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. > 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. And also there is many moves that are not linked to a invoice. > About adding the field from account.move, I think it's a good thing for the > API > to have, although that could be added in another module if it's not wanted in > account_invoice module, but we've found many times the need for browsing from > account.move or account.move.line to its invoice. For both programmers and > users. Shouldn't the user be able to move from an account move (and move > line) > to the corresponding invoice instead of having to move to the invoices menu > option and search there? It can be a function field but this mean that an invoice could only have 1 move. Also I think the account.* must be keep at low level. Perhaps a better solution is to use a relate action. -- Cédric Krier B2CK SPRL Rue de Rotterdam, 4 4000 Liège Belgium Tel: +32 472 54 46 59 Email/Jabber: cedric.kr...@b2ck.com Website: http://www.b2ck.com/
pgpcWXWsOh2Lz.pgp
Description: PGP signature