0

I have a editable list view with multiple records in a user defined sequence:

Order #       Date           Sequence
------------------------------------
order #10     03-10-2014            1
order #17     03-10-2014            2
order #13     03-10-2014            3
order #19     03-10-2014            4

If order #13 is changed to sequence 2, order #17 is automatically bumped to the next value (3 in this case), but it doesn't show up on screen.

In other words, I get this:

Order #       Date           Sequence
------------------------------------
order #10     03-10-2014            1
order #17     03-10-2014            2
order #13     03-10-2014            2
order #19     03-10-2014            4

But the data actually is this:

Order #       Date           Sequence
------------------------------------
order #10     03-10-2014            1
order #17     03-10-2014            3
order #13     03-10-2014            2
order #19     03-10-2014            4

How do I get the list view to update all changed records?

Ethan Furman
  • 63,992
  • 20
  • 159
  • 237

1 Answers1

1

when the field "sequence" is used on a model, you could drag&drop list entries. you have to call the field "sequence" as is descriped (very shortly) in the technical memento (https://www.openerp.com/files/memento/ look for "Special / Reserved field names").

you don't have to see the sequence in the list view as column. an example is the sale.order with its lines:

enter image description here

CZoellner
  • 13,553
  • 3
  • 25
  • 38
  • I didn't know about `sequence`, thank you. That doesn't solve my problem, though, as all the jobs will have `schedule_seq` values from `0` - `5` as they represent a schedule sequence on a particular day. – Ethan Furman Mar 03 '14 at 15:39
  • i know that the sequence values are bit bad, after drag&drop. what about an on_change event on the field "sequence", which will calculate the sequences for all entries to the range 0-5? – CZoellner Mar 03 '14 at 16:03
  • I already have the code to make the changes to the database. The issue is that the list view is not updated with the results. Are you saying that if I use `on_change` that the list view will be update for the other records? – Ethan Furman Mar 03 '14 at 16:26
  • no the on_change won't reload the record, and so the order won't change in your opened view but in background (and after save) – CZoellner Mar 03 '14 at 21:38