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? > > 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? > And also there is many moves that are not linked to a invoice. Sure, but isn't it possible to create a One2One field as non-required? > > 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. -- Albert Cervera i Areny http://www.NaN-tic.com Tel: +34 93 553 18 03 http://twitter.com/albertnan http://www.nan-tic.com/blog -- [email protected] mailing list
