Partial backport of master (-> v9) commit 059230512.
for the issue when removing an invoice line from an account.invoice,
three onchange where triggered:
- ListView account.invoice.line unlink the line id from its dataset,
[[first onchange]]
-> the line id is removed from the dataset which trigger an onchange
after this is done (and the onchange is finished), the following
onchange happen:
-- remove each record of the Collection of the ListView
-> this remove the id of these record from the ListView List dataset
[[second onchange]]
-> this trigger an onchange albeit the dataset is not changed
(since it was already removed before the first onchange)
-> this trigger an onchange on the one2many_list of the ListView
which has the same dataset as the ListView
[[third onchange]]
-> so an onchange is called yet again.
this commit removes the second onchange in this case where we remove ids
already removed from the dataset.
closes#8273fixes#7595
opw-644706
To reproduce use a form view with a one2many editable list and create a lot of lines. Then click a few times quickly on the delete.
If the user click at least two times on delete of a same record, the dataset add the id in "to_delete" the virtual id because "to_create" doesn't contains the virtual id of the record deleted previously.
E.g.: create a "Customer Payments" and select a "Customer" and "Payment Method" who generate a lot of "Credits" lines.
Don't retrieve the binary contents just to display the size, but pass context
with bin_size=True instead
Always pass filename in download link
Combination of patches from the bug report from Enrico Ganzaroli, Cedric Le
Brouster and Holger Brunn
Fixes#4899, lp:1167429
In this awesome programming language called javascript, undefined is neither bigger nor smaller than a string. Previous code was then considering undefined values equal to any string.
This fix allows to sort in a column of a o2m field and group the undefined values together. opw 607704
Create a deserialize_sort method and add a set_sort method to
datasets. The set_sort method is useful to avoid duplicating code
in lists and kanban views (to set the initial default order)
This fix is related to revision 3985 revid:dle@openerp.com-20140326142040-pls0dk2kd03z55ro, which did not worked for buffered dataset (virtual one2many line in view form
search_read is used instead of read to not return records for which we lose the access rights
bzr revid: dle@openerp.com-20140327112456-iyceuf9dnn07hwke
BufferedDataSet.read_ids assumes the input and output orders are the same, and
returns wonky results when not the case, which in turns fucks up its cache as
it associates ids and records incorrectly.
bzr revid: xmo@openerp.com-20140225162813-8ofxpiy1012eehgk
The following fixes have intentionally been reverted,
as the code has significantly changed and the bugs cannot
be reproduced:
- web_calendar fix (revid:dle@openerp.com-20140214114258-0hcsfdwyl61gph0v)
- CSS fix for buttons (revid:mat@openerp.com-20140213145755-txvtwqbfc83vnw9o)
bzr revid: odo@openerp.com-20140217102806-qg6kwk2jomdvvmlj
Instead returns undefined which is handled below.
This does not solve the issue when records are not loaded properly but gives a better information on the reason.
bzr revid: mat@openerp.com-20140213085008-pnq4r0ebfl072u78
Turns out when code looks somewhat odd there may well be a good reason
for it, and changing it without wondering breaks the pager.
In this case, `/web/dataset/search_read` has a significant difference
with Model.search_read: it returns the records slice specified by
(``limit``, ``offset``) but it also returns the *total number of
records* for ``domain`` which is sort-of useful to generating the
pager.
lp bug: https://launchpad.net/bugs/1218266 fixed
bzr revid: xmo@openerp.com-20130906150101-2qb349fzaz6rye36
Following xmo@openerp.com-20130607120355-x3poxy2ar2bpqqvw:
* add_ids should not add ids which are already in the dataset, this
leads to duplicates which the web client does not overly like
* methods which add or remove records should not manipulate
dataset.ids as well as that's now automatic (on_write feature)
* record add should only insert the id in the dataset on non-false ids
(e.g. list edition uses "pending" record with false id during
creation, then sets the id it got from create() call)
bzr revid: xmo@openerp.com-20130607152326-2pja1kuwo0ropfuw