Commit Graph

6147 Commits

Author SHA1 Message Date
Antonio Espinosa 6cdcdb8724 [FIX] web: datejs Spanish long format
From:  miércoles, 04' 4e 'noviembre' 4e '2015 10:48:19
To:    miércoles, 04 de noviembre de 2015 10:48:19

Closes #9910
2015-12-09 08:56:00 +01:00
Denis Ledoux 7f20b79188 [FIX] web: char_domain display translation
The `records selected` could not be translated.
2015-12-08 15:11:20 +01:00
Denis Ledoux 2939800ed4 [FIX] web: char_domain widget re-renders on model change
Before this revision, the `char_domain` re-rendered its display
only when its domain value was changed.

It must re-render as well when the model on which this domain
is applied is changed, as the number of records can
obviously be different.

e.g., in mass-mailing, when changing the recipients type
from partners to leads, the domain doesn't change, it
stays `['opt_out', '=', False]`, but the model on which
this domain is applied does change, as well as the number
of selected records.

opw-658391
2015-12-08 15:11:20 +01:00
Christophe Simonis 83a4a582fa [MERGE] forward port of branch saas-3 up to 513cea6 2015-12-08 12:28:41 +01:00
Christophe Simonis 47b2f7ea9e [MERGE] forward port of branch 7.0 up to 3a1c693 2015-12-08 12:16:00 +01:00
Christophe Matthieu 4d8ec5f931 [FIX] web: readonly fields not transferred from dialog to 2many field
'write_function' transfer the options to 'write' method from the popup form

Steps to reproduce:
1. Create custom model to add a product quantity on hand(readonly) field on stock.move
2. Show this field on Warehouse>All operations>Create a Transfer> Create: Internal Moves
3. Add a Internal Move, then open it again, the quantity on hand field's value show 0. But change the product, the value is correct.
2015-12-02 13:29:51 +01:00
Christophe Matthieu 1cd03ed7fe [FIX] web: one2many set_value must use dataset last_default_get as default values 2015-12-01 13:41:28 +01:00
Christophe Matthieu 0ba248aeda [FIX] web: prevent default value changes
Load record use values as dataset and change object value (for eg: add virtual id in the default value object).
2015-12-01 13:41:28 +01:00
Cedric Snauwaert d179a94da6 [FIX] web: list_view, context when doing name_get call in m2m was not compute correctly
this is a backport of commit fd56268c6ca4e8a6f94f16de9129bd12be87303f
2015-11-26 10:25:15 +01:00
Xavier Morel c6d6ae8aec [FIX] qweb: handle unicode tags and attributes
closes #8895
2015-11-19 14:59:44 +01:00
Thomas Groutars b665478fa7 [FIX] py.js: unhandled prefix `not`
closes #6129
2015-11-19 13:54:26 +01:00
Nicolas Lempereur 15b0596c31 [IMP] web: remove onchange on m2o one remove record
These onchanges were needless since it was already done by the
BufferedDataSet when we use alter_ids to add/remove ids/virtual ids from
the recordset.

The onchanges this commit remove were introduced with 6b907bb4d in
juliet 2012 whilst the onchange in the BufferedDataSet when using
dataset alter_ids was with dd747c096 in october 2012.

closes #8273
fixes #7595
opw-644706
2015-11-10 12:38:04 +01:00
Nicolas Lempereur 3e1d5a5cca [IMP] web: remove needless o2m onchange
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 #8273
fixes #7595
opw-644706
2015-11-10 12:36:06 +01:00
Nicolas Martinelli ea2c80cad0 [FIX] web: Python-like rounding method
Javascript and Python handle the rounding of -x.5 differently.

In JS, `Math.round(-0.5)` is equal to `-0`.
In Python, `round(-0.5)` is equal to `-1`.

This will lead to inconsistencies between Python and Javascript, but it
can also lead to inconsistencies in the Javascript itself. Indeed, in
the POS, a refund to the client is entered as a negative number. For
example, `4.245` will be rounded to `4.25`, but a refund of `-4.245`
will be rounded to `-4.24`. The payment and the refund are not
consistent.

Sources:
- http://www.ecma-international.org/ecma-262/6.0/index.html#sec-math.round
- https://docs.python.org/2/library/functions.html#round
- https://en.wikipedia.org/wiki/Rounding#Round_half_up

Fixes #9249
opw-653034
2015-11-04 13:14:59 +01:00
Christophe Matthieu ee2b550f3c [FIX] web: radio button display empty value when change record
When a selection field with widget="radio" is False, the form view display the previews value for this field.

1 - Create a selection field (ex: [("1", "1"), ("2", "2")]), and display it on a form vue.
2 - Go to the form view (all the record have False value for this field).
3 - Change the value of this field for one record.
4 - In readonly mode, all other records now wrongly display this value (still False in DB or when "edit").

#opw-652002
2015-10-29 07:21:36 +01:00
Christophe Matthieu 2f842d1703 [FIX] web: assertion error when save after speed multi delete in one2many
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.
2015-10-12 17:15:28 +02:00
Olivier Dony 0f06e5f54f [FIX] tests: outdated resource paths in manual test files 2015-09-18 15:52:11 +02:00
Nicolas Lempereur 1fe932a7bc [FIX] web: css for popup search view float position
The widget SelectCreatePopup display the search view drawer directly
after the search view input field. But in current firefox version this
could lead to an issue with float positionning.

fixes #8462
opw-648999
2015-09-14 12:15:10 +02:00
Christophe Simonis d744923b63 [MERGE] forward port of branch saas-3 up to 1783a7d 2015-08-27 18:01:52 +02:00
Christophe Simonis 1783a7d005 [MERGE] forward port of branch 7.0 up to 411a07a 2015-08-27 18:01:14 +02:00
Nicolas Lempereur 411a07a64e [FIX] web: enable default_focus on html field
closes #8244
opw-647578
2015-08-27 13:20:41 +02:00
Nicolas Lempereur e2930e19a0 [FIX] web: glitch with scroll and list editable
On a first edition of a view list editable, scrolling before the first
edition might cause an issue: the editing fields are higher than they
should.

This commit solves this.

This issue stems from jQuery .offset({value}) function which is broken
if the element we want to position:

- is in absolute postionning,
- is inside a scrolled element in non static positionning,
- has not both top and left css property setted,
- has no ancestor element between itself and the scrolled not in static
  positionning.

This issue happens less (and probably not at all) in saas-6 since the
last condition is most often not met thanks to this change:
 https://github.com/odoo/odoo/commit/1ccd87a#diff-27c072074221456684bfc5f150ca0bc9R876

This issue of jquery is solved since jquery 3.0.0-alpha1:
 https://github.com/jquery/jquery/commit/2d71594

( the issue is shown in https://jsfiddle.net/wpjrnggf/ and we can see it
is solved with jQuery 3.0.0-alpha1 https://jsfiddle.net/L6ykpjgy/ )

closes #8251
opw-647622
2015-08-27 13:17:00 +02:00
Nicolas Lempereur 97dbe0db5f [FIX] web_kanban, web: kanban title direction
In internet explorer, writing direction can lead to wrong text direction
when combined with rotate.

A fix was already in place for IE up to version 9 but the issue also
happens in next versions which are more difficult to differentiate
(especially the current spartan/edge version).

So this fix use the same css property value for all browser and it doesn't
seem to have an impact (other than correcting the issue in IE).

closes #7955
opw-646430
2015-08-10 10:54:23 +02:00
Nicolas Lempereur 0511b9af83 [FIX] web: m2m tags overflow when too much tags
If too many tags (or too long tags) where present in a many2many tags
widgets, it could go over the field and cover other thing in the UI.

Now the field size expands with the content (and in a way it is more
visually similar before and after 'Edit' so it is nice).

closes #7579
opw-644236
2015-07-13 10:37:31 +02:00
Holger Brunn f204c76f23 [FIX] web: keep the context we got in Many2ManyDataset
This bug causes binary fields in many2many lists being presented as a data url,
even though bin_size is passed.

Closes #6966
2015-07-08 13:42:59 +02:00
Nicolas Martinelli b4efb4eeb3 [FIX] web: on calendar with date and time, focus in the field only when hidden
The behavior of the datetime widget was to focus in the field every time a date
is chosen. This causes an issue if the datetime widget is called from an
editable list. Indeed, the list editable will consider that the value has been
set, and therefore the value will not be changed anymore if the user choses
another date.

The new behavior is to put the focus only when the date picker is hidden,
therefore the editable list will consider the value set only when the selection
is done.

opw-644062
Fixes #7463
2015-07-07 11:19:27 +02:00
Nicolas Lempereur b5d7e663b4 [FIX] web: readonly field and tab
When we go from one field to another via the tab key, in the form view what happens is:

{{we get a blur from the current field}}
-> if [[widget was not in state clicked (which can be gotten for example by clicking on a focused field)]]
     -> blur event is cancelled,
     -> the blur event is set to be triggered soon
-> the clicked state is set to false

{{we may get a focus for the next field}}
-> if [next field get an onfocus event]
     -> blur event is cancelled,

So if :
- the state is not clicked and,
- the next field don't get an focus event.

We get a blur event which will either save (if a field value has been changed) or cancel
the form view editing and will hide the current edition, hence losing the focus.

For example, it happens on a readonly fields with  field containing an `<a />` tag, on
some browser (for example google chrome), the focus event will not get triggered (it still
work if we were in a clicked state) so we can't cycle thought a list editable cells if there is a readonly field in it.

closes #7446
opw-643718
2015-07-06 11:55:01 +02:00
Holger Brunn 0cffd6f825 [IMP] web: make many2many tags inline block without wrapping
Better look when using long words in tags

Closes #6963
2015-07-02 14:33:11 +02:00
Christophe Simonis 31f2a1bc38 [MERGE] forward port of branch 7.0 up to 1c0bc7c 2015-06-30 12:47:27 +02:00
Stefan Rijnhart 33a65c2b8e [FIX] web: binary fields in one2many widgets
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
2015-06-25 11:45:47 +02:00
StefanRijnhart 727f9056a3 [FIX] web: wrong company logo in multi-company env
Don't preload company logo of the wrong company

When a user other than the admin signed in
and was in a company different than the admin
and this company had a different logo,
the company logo (in the upper left corner)
displayed the logo of the admin company,
instead of the logo of the company of this
user.

As soon as the user refreshed the page
in his browser, the issue was resolved,
but the logo should be the good one
from the beginning.

Closes #1453
2015-06-24 15:04:11 +02:00
Christophe Simonis b8bf1e0905 [MERGE] forward port of branch saas-3 up to ea659cb 2015-06-24 12:37:08 +02:00
Christophe Simonis ea659cbd87 [MERGE] forward port of branch 7.0 up to 16a545b 2015-06-24 12:34:03 +02:00
Nicolas Lempereur 1942522969 [FIX] base: update File Content for binary field
To distinguish two ir.attachment 'File Content', we base it on the file
size (this I imagine is for efficiency).

This is done by setting bin_size in the context. Doing this, the
returned db_datas field will be the file size of the converted to base64
content (if no filestore).

But this size is returned in string format, so "get_nice_size" (in
openerp/osv/fields.py) which gets this size calculates the length of the
string. e.g: if the size is '2142' get_nice_size will return 4.

This fix solves this by converting the string to an integer, thus
unifying it with the filestore case (where we use os.path.getsize which
return an integer).

Also, the field presenting the issue (FieldBinaryFile) has been changed
so it is always updated even if the size is the same (as it was already
done by 3632949 for FieldBinaryImage widget).

closes #7223
opw-643071
2015-06-23 15:20:33 +02:00
Nicolas Martinelli ac4849f9ca [ADD] web: prevent the propagation of context keys containing prefix show_
This decision comes from the following bug:
- Go to Sales -> Quotations, and open any existing quotation in form view (the
  partner must have an address defined)
- Click on the partner
- Click on the stat button "Claims"
- You notice that the address of the partner is included in the search

This is due to the context property show_address which is set to 1 when a
quotation is open. Therefore, it is necessary to filter out this keyword.

Since the prefix "show_" is used for only few context variables, it was decided
to define this pattern as a standard pattern to filter out.

opw-642893
2015-06-22 14:06:11 +02:00
Denis Ledoux 4fbecc35e1 [FIX] web: break tags containing very long words
Otherwise they overlap with the rest of the form.

opw-641567
2015-06-17 16:10:31 +02:00
Goffin Simon c7c2f5743b [FIX] base: export translation
In css, overflow-x and overflow-y must have the same value. If overflow-x is equal to
auto then overflow-y is equal to auto.
To solve the problem, the height of the input is removed because it is forced by the Jquery
auto-completion plugin according to the wrapper.
Without this patch, when you go to Settings > Import/Export > Export Translation and click on the arrow to
to show the list of modules you can export, the list is partially hidden.

opw:632607
2015-06-15 14:54:07 +02:00
Frédéric van der Essen 19eda68547 [IMP] web, point_of_sale: basic implementation of the cordova integration.
This time without a new js file
2015-05-29 15:33:13 +02:00
Martin Trigaux 916525fbf3 [FIX] web: Kabyle localization file
datejs is looking for the file named with a dash and not an underscore
Fixes #6165
2015-05-28 16:33:04 +02:00
Frédéric van der Essen da378722cc Revert "[IMP] web, point_of_sale: basic implementation of the cordova integration."
This reverts commit f7a1ac8b06.
The commit introduced a change that required a database update,
which should not be required in a stable version.
2015-05-27 13:46:26 +02:00
Frédéric van der Essen f7a1ac8b06 [IMP] web, point_of_sale: basic implementation of the cordova integration. 2015-05-27 11:59:13 +02:00
Denis Ledoux ac92551406 [FIX] ir_attachment: hide Attachments > Add/Delete if not write access
To be able to see record attachments, you need to have
read access to the record.

To be able to add or delete attachment, you need to
have write access to the record.

The button add/delete were displayed as soon
as you had the read access, but if you had not the
write access, both buttons failed.

This revision do not display the add/delete
buttons of Attachment dropdown menu if you do not
have the right to add / delete attachments to the record
(you do not have write access to the record)

opw-640242
2015-05-20 11:08:19 +02:00
Denis Ledoux a939a272ef [MERGE] forward port of branch saas-3 up to ae634e7 2015-05-05 17:55:25 +02:00
Denis Ledoux ae634e7a04 [MERGE] forward port of branch 7.0 up to 567ade5 2015-05-05 17:51:31 +02:00
Julien Legros 8e6f9be08f [CHG] web: odoo.com account fallback url
The default odoo.com account page is now located at
https://accounts.odoo.com/account.
2015-05-05 11:29:15 +02:00
belkacem77 72cc8b99a9 [ADD] web: Kabyle datejs file
Missing globalisation file for kab_DZ
2015-05-05 10:46:55 +02:00
Martin Trigaux 7dd2d201a0 [FIX] web: localisation for Lao and Bosnian
The datejs globalisation files are loaded based on the user's language.
If the file is not present, the loading crashed and the user could not access to
the web client.
Adding empty files for lo_LA and renaming bs-BS.js to bs-BA.js for bs_BA (see
65d92da) that were missing.

By the way, this is a 0 bit commit, beat that!
2015-05-05 10:28:17 +02:00
Denis Ledoux 41f4b11ef4 [MERGE] forward port of branch saas-3 up to e552e09 2015-04-30 15:45:03 +02:00
Denis Ledoux e552e09873 [MERGE] forward port of branch 7.0 up to e601a41 2015-04-30 14:38:17 +02:00
Denis Ledoux 1da5d89ba3 [FIX] web: advanced search on floats with ',' as decimal separator
When using another decimal separator than `.` (dot)
in the language settings,
it wasn't possible to build an advanced search specifying
the decimals.

e.g. with a language with decimal separator `,` and thousand
separator `.`,
if you want to search invoices with amount total 366,38
The advanced search "Total" "is equal to" obliged you
to enter your number with `.` as separator (366.38),
and then, when entering the search, the `.` was
regarded as the thousand separator, giving as domain
`('amount_total', '=', 36638)`, which is not what you asked.

opw-634201

PS: The `|| '.'` in the xml template are only for
retro-compatibility, so if the server sources are
updated, but the browser cache is not refreshed
(meaning the Javascript code isn't refreshed, and,
therefore, `widget.decimal_point is undefined)
it still works.
2015-04-30 13:39:30 +02:00