← Back to team overview

openerp-community team mailing list archive

Re: reorderable lines on purchase.orders, account.invoice, stock.picking

 

On 09/24/2013 07:17 PM, antonio.sequeira@xxxxxxxxxxxx wrote:
We have developed the attached module to order Sales Order lines, by creating a
group of lines and give it a title and a sequence inside the group - the name
of the group is the title.
The ordered lines are shown in the print form also
the group is created when entering the product. (order line)

Comments are welcome.


Hi Antonio,

Thanks for sharing the module. It does not seem to be indexed on OpenERP Apps, any reason for that?

The idea we have for v8 is (very) roughly similar, but the implementation, scope and usability would be quite different. In order to avoid the pitfalls of the old *_layout modules, we do not want to add any "dummy" lines in the documents[1]. The groups would really be an extra dimension for the lines, on which the lines could be grouped, just like the "group by" features.

We'd also like to make these groups generic, thus usable on all lines (invoices, sales, purchases, ...), reusable (as you are likely to use the same groups frequently) and propagated. Storing state information in them like a m2o to a specific document or the subtotals (as your module seems to do) is therefore out of question.

As a side technical note, you might want to review your module source code in light of the OpenERP coding guidelines[2], particularly points 2.3 and 2.4 (hint ;-)).

Cheers,



[1] It breaks object encapsulation rules by changing the semantics of the original line model. Thus every part of the system that uses these lines for any purpose may be affected in unforeseen ways: current/future installed modules, customizations, reports, anything.
[2] https://doc.openerp.com/contribute/15_guidelines/coding_guidelines/


References