Merge lp:~peter-langenberg/openobject-addons/addons12_001-1134365 into lp:openobject-addons/7.0

Proposed by Peter Langenberg
Status: Merged
Approved by: Chris Biersbach (OpenERP)
Approved revision: no longer in the source branch.
Merged at revision: 8862
Proposed branch: lp:~peter-langenberg/openobject-addons/addons12_001-1134365
Merge into: lp:openobject-addons/7.0
Diff against target: 12 lines (+1/-1)
1 file modified
sale/sale.py (+1/-1)
To merge this branch: bzr merge lp:~peter-langenberg/openobject-addons/addons12_001-1134365
Reviewer Review Type Date Requested Status
Chris Biersbach (OpenERP) (community) Approve
Review via email: mp+152459@code.launchpad.net

Commit message

[7.0] sequence of sales order lines wrong after save

Description of the change

[7.0] sequence of sales order lines wrong after save

To post a comment you must log in.
Revision history for this message
Chris Biersbach (OpenERP) (cbi-openerp) wrote :

This fix seems ok. In fact, the order is random, because on one sale order, the order_id is the same for all the lines, and the sequence is initially 10 (it is only changed if you change the order manually afterwards), so the order could actually be anything.

Your fix works because we are in a case with editable=bottom, so a line that is added afterwards, which will get a higher id, will be at the bottom.

Revision history for this message
Chris Biersbach (OpenERP) (cbi-openerp) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sale/sale.py'
2--- sale/sale.py 2013-02-07 08:41:29 +0000
3+++ sale/sale.py 2013-03-08 17:10:26 +0000
4@@ -717,7 +717,7 @@
5 'salesman_id':fields.related('order_id', 'user_id', type='many2one', relation='res.users', store=True, string='Salesperson'),
6 'company_id': fields.related('order_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
7 }
8- _order = 'order_id desc, sequence'
9+ _order = 'order_id desc, sequence, id'
10 _defaults = {
11 'product_uom' : _get_uom_id,
12 'discount': 0.0,