Commit Graph
8036 Commits
Author SHA1 Message Date
qsm-odoo 8c0b755841 [IMP] web: return file content for url attachments
URL attachments are now returned as data and not redirection.
If the url does not match with a module file, the 301 status
(redirection) is still returned.

This allows to use the /web/image/<xmlid>/<dimension> route
and get an image attachment with correct dimensions.
2015-12-03 13:26:36 +01:00
Géry Debongnie f58450dbe9 [FIX] web_kanban: properly removes nvd3 tooltips
with the recent update of nvd3 to the last version, we fixed a lot of
tooltip issues, but we introduced at least a new problem:  when a view
is detached from the dom with a visible tooltip, it no longer is cleaned
up.

In this commit, we simply remove all nvtooltips when we detach a kanban
view (necessary because dashboards inherits from kanban).  This is not
really an elegant way to solve the issue, but at least it works.  any
improvement is welcome.
2015-12-02 11:13:22 +01:00
Jeremy Kersten f814dd9908 [FIX] web, openerp: debug mode now works without referer
In some cases the Referer HTTP header may be missing or
stripped by a proxy, browser extension or anti-virus.
This breaks debug mode because it was solely relying
on the Referer header.

Introducing an explicit X-Debug-Mode header for RPC
calls allows for an alternative method that works
even when the Referer is missing.

This won't work in all cases, e.g. for direct $.ajax
calls, for example.

Closes #9824
2015-12-01 13:47:30 +01:00
Nicolas Lempereur 2790bb4492 [IMP] web: minor css fix SelectCreateDialog
related to opw-657349
2015-11-27 15:08:43 +01:00
qsm-odoo bbc67ec402 [FIX] web: export data according to domain
Some accounting model (i.e. account.tax) are redefining the ORM search
method, but with misordered arguments (placing count as fifth argument
instead of context).

For the export function, this lead to have the "context" variable
associated to the "count" function variable. As "count" is then
considered as True, the method returns the number of records instead
of the list of record ids. This then exported the last record (the
count'th one) instead of all the records that matched the domain.

The solution here is to explicitly give the context variable by name.
2015-11-26 15:57:17 +01:00
Cedric Snauwaert fd56268c6c [FIX] web: list_view, context when doing name_get call in m2m was not compute correctly 2015-11-26 09:43:21 +01:00
Damien Bouvy 0a6edac151 [FIX] web, openerp: make the webclient edition aware
- Differentiate between the Community and Enterprise editions
in the version number. By adding this attribute on the global
odoo JS object in the web client bootstrap controller /web,
we can differentiate between versions easily on the client
side without extra RPC calls.

- Remove a couple of version-related RPC calls in case
the global version info is present in the JS environment

- Update "About" panel to display the edition info

- This commit also reverts 07fe5afc87
which implemented the idea in a more limited way.

Closes #9625
2015-11-25 18:12:42 +01:00
Aaron Bohy 0413cc9641 [FIX] web: display pager in SelectCreateDialog 2015-11-25 16:23:44 +01:00
Christophe Simonis 56a442e205 [MERGE] forward port of branch saas-6 up to dade7e3 2015-11-25 13:26:02 +01:00
Nicolas Lempereur f5bd1cc922 [FIX] web: local var parent typo
fixes #8516

note: was already solved in enterprise with 7ab5075
2015-11-25 11:00:52 +01:00
Denis Ledoux 32fd520d97 [MERGE] forward port of branch 8.0 up to 6f29cbe 2015-11-23 17:40:15 +01:00
Raphael Collet e0081e4f4d [FIX] web: fix AbstractManyField.get_value with updated records
Linking to an updated record must use both `LINK_TO` and `UPDATE` commands,
because the `UPDATE` command does not implicitly `LINK_TO`...
2015-11-23 10:20:32 +01:00
Raphael Collet 2c571f1114 [FIX] web: method BufferedDataSet._update_cache must purge changes from useless changes 2015-11-23 10:20:32 +01:00
Odoo Translation Bot 3180f80bf9 [I18N] Update translation terms from Transifex 2015-11-22 01:30:36 +01:00
Aaron Bohy 3c0c354e19 [FIX] web: list_view: display nocontent helper after delete
if there are no more records to display
2015-11-20 09:43:58 +01:00
Nicolas Lempereur 068b81cfef [IMP] web: graph legend tweaks when many item
The legend of the graph when there was too much items in it could
prevent user to see a part or even the whole graph.

On non-mobile device, move the Pie Chart legend to the right, thus if it
overflows the char is still visible and we can toggle the seen top
legend item.

Otherway, the legend on top is hidden when :

- there is more than 25 legend items and the device has width < 768
- there is more than 50 legend items and the device has 768 <= width < 992
- there is more than 75 legend items and the device has 992 <= width < 1200
- there is more than 100 legend items and the device has 1200 <= width

Since this is based only on the number of legend items but legend items
could have variable name lengths, there will still be edge case where
the legend obstruct the graphical data display.

In this situation the current way to cope with this further filter the
displayed data.

opw-653445
2015-11-19 16:24:09 +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
qsm-odoo f137921d12 [FIX] web: formview autofocus when attached
Autofocus in formview did not work when landing on the form view in
edit/create mode. This was because autofocus was called before the
formview was in the DOM.

Solution here in community is to defer the call to autofocus.
2015-11-18 17:00:34 +01:00
Denis Ledoux d47ee18fef [MERGE] forward port of branch 8.0 up to c9fce1a 2015-11-17 13:19:14 +01:00
Odoo Translation Bot 396181648c [I18N] Update translation terms from Transifex 2015-11-15 03:03:19 +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
Odoo Translation Bot 7a0a649deb [I18N] Update translation terms from Transifex 2015-11-08 03:01:35 +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
Denis Ledoux 2b1b0e6d13 [FIX] web: editable list validation with several pages
This revision is related to a9d20d9fa0.

`dataset.cache` contains an item for each records, even
if the records hasn't been loaded in the cache. If a record
has not been loaded, only the record id is available, not
the other values. Thefore, this isn't possible to validate
the record values of records that have not been loaded
in the dataset cache.

opw-654013
2015-11-17 17:07:31 +01:00
Damien Bouvy d18441d348 [FIX] web: longer delay for module load warning
Warning messages are automatically displayed if a module takes more than 1000ms to load, but this delay is a bit short if you make multiple rpc calls (sorry for all the dead kittens)
2015-11-17 15:54:50 +01:00
Damien Bouvy 07fe5afc87 [IMP] web: distinction between community and enterprise version in the js framework
It was bound to happen: some functionnality need to be triggered depending on the current edition of Odoo. To do this, we add a property 'version' on the global odoo object.

This change is mirrored on the enterprise repo.
2015-11-17 13:01:09 +01:00
Adrien Dieudonné 22e94f5254 [IMP] web: better 'Odoo Enterprise' settings popup
The popup is now a bit more styled and needs less info to call our servers.
2015-11-17 13:01:09 +01:00
Nicolas Lempereur 3510ff3921 [FIX] web: update form view image after reload
6baf611d updated the image when showing the view form the first time,
but when reloading (e.g after a write) there was a difference which
would not cause the update.

second half of:
opw-654279

(follow-up of a8ae944)
2015-11-16 12:17:03 +01:00
Nicolas Martinelli 48942f1242 [FIX] web: display Warning if "Save & Close"
When a warning is triggered by an onchange, clicking on "Save & Close"
will cause the warning to be closed as soon as it is shown. This fix
prevents the saving and closing if a warning message is detected.

opw-653503
2015-11-16 08:53:04 +01:00
Odoo Translation Bot 3d7ae73305 [I18N] Update translation terms from Transifex 2015-11-15 01:35:06 +01:00
Odoo Translation Bot 14799a9006 [I18N] Update translation terms from Transifex 2015-11-08 01:32:40 +01:00
Nicolas Lempereur 157ce1b6e3 [FIX] web: IE Edge focus bug when delete in list
In the following situation :

 we click on an element inside a row (not the last row) which will:
 -> open an alert, confirm or prompt dialog
 -> remove the row containing the element

IE Edge would enter in a odd state where the focus is not given back to
the page, and clicking doesn't work anymore.

This fix solves this by detecting this situation and then focusing on an
input field which make IE Edge stop being crazy.

opw-653282

jsfiddle showing the issue: http://jsfiddle.net/ts8bsLLg/4/
jsfiddle showing a solution: http://jsfiddle.net/ts8bsLLg/6/

bug report on microsoft:
https://connect.microsoft.com/IE/feedbackdetail/view/1988284

note: applied in 9.0 community, 9.0 enterprise
2015-11-06 15:48:10 +01:00
Aaron Bohy b61c0d2499 [FIX] web: action manager: options of client actions
The options dictionnary given when performing a do_action is now transmitted
to the client action initialization.

This was required for the mail client action, to correctly redirect to a given
channel.
2015-11-03 16:19:35 +01:00
Géry Debongnie cd71fe6687 [FIX] web,survey: update graphs tooltip to new nvd3
with the update of nvd3/d3, the tooltip api was changed.  This commit
updates the 3 last places where we were using the tooltips.
2015-11-02 10:06:13 +01:00
Odoo Translation Bot 82cd86f181 [I18N] Update translation terms from Transifex 2015-11-01 03:03:27 +01:00
Odoo Translation Bot e3287faee6 [I18N] Update translation terms from Transifex 2015-11-01 01:32:05 +01:00
Christophe Matthieu a9d20d9fa0 [FIX] web: save fields in m2m (list_editable) with attributes and check all lines
Issue: steps to reproduce:

create a purchase order
choose a supplier
choose a product
change the quantity
don't click anywhere on the form, just click on "confirm order"
you get an error "invalid field: scheduled date"

Use dataset instead of record because record can have an other value (a short for a moment due to deferred).
Use silent option to avoid onchange.
2015-10-30 12:01:16 +01:00
Nicolas Lempereur fb872f84f1 [FIX] web: no accesskey for x2m pager
The fix in 665bc1c solved the issue for pager of some X2Many widget x2m
which would shadow the accesskey to go to previous/next page of the top
view's  current model.

But in the case a web.Pager (used in community for a X2Many kanban
widget) the fix had no effect.

opw-652888
2015-10-30 08:40:09 +01:00
Géry Debongnie 329552b78e [FIX] web,account,website_links: update nvd3 to last version
This commit was necessary to fix weird problems in 9.0-nightly.
Phantomjs and the old nvd3 implementations did not play well together.

* transitionDuration() replaced by duration()
* tooltips() & tooltipContent replaced by tooltip.enable and tooltip.contentGenerator
* remove useless less for tooltip

Thanks to mge for his help
2015-10-29 22:15:44 +01:00
Christophe Matthieu 8ebe4b2d56 [FIX] web: can remove record in many2many kanban view
Wrong underscore method called.

Issue: go on customer form view, remove a contacts in the many2many kanban view and save. The record is not unlink.
2015-10-29 15:31:42 +01:00
Nicolas Martinelli 1f43fa9dfe [FIX] web: do not write twice when updating value
The issue occurs for example in the Sale dashboard, when the user
changes the target amount. If the user changes the value, then directly
clicks outside of the field, the method on_change_input will be called
twice: the first time because of the event 'change input', the second
time because of the event 'blur input'. This makes an unnecessary write,
which can cause an error due to concurrent access.

This prevents the execution of the write related to the event 'change
input' in this case. If the user changes the value but clicks on
'Enter', the focus is still on the field so the update is done
correctly.

Courtesy of Quentin Smetz (qsm@odoo.com)

opw-653086
2015-10-29 12:44:07 +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
Nicolas Lempereur 665bc1c935 [FIX] web{,_kanban}: too much and too little shortcuts
When several accesskey with the same key,  are defined on elements, the
last one (even if not displayed) is the one which will be actioned and
the key sequence is pressed.

This caused an issue since the "Pager" template is shared between all
elements, even the x2many relational widgets.

Also there was shortcut for Create/Save/Discard on the form view, but
those shortcuts should also be enabled in the list and kanban view.

closes #9267
opw-652888
2015-10-28 15:32:31 +01:00
Denis Ledoux c8d6b36632 [MERGE] forward port of branch saas-6 up to a0c64bebe6 2015-10-28 12:01:30 +01:00
Nicolas Lempereur 4513092733 [FIX] web: restoring action from breadcrumb nav
When clicking on a breadcrumb taking us to a previous view, we should
restore that view action and not keep the current one.

closes #9075
opw-652039

note: no forward-port needed
2015-10-27 15:29:29 +01:00
Christophe Matthieu 07ce3cd4d1 [FIX] web: error on change value in o2m after an other field onchange if the o2m contains o2m
o2m editable list open a form view and can put command as default value (record[this.name] for o2m in a o2m) for the editable fields.
When the onchange is triggered, get_value create a wrong command of command.

step to reproduce issue:
* edit a quotation with at least on sale order line
* change the pricelist
* change the quantity of the sale order line

todo : remove _on_load_record in version > 9.0 and use new dataset implementation with to_delete attribute
2015-10-26 19:27:34 +01:00
Nicolas Martinelli 058db89876 [FIX] web: proper update of the dataset
The method evict_record calls _update_cache with an empty dictionary,
which will not replace any cached value. Therefore, the cache is never
cleaned.

opw-652393
2015-10-26 13:03:47 +01:00
Christophe Matthieu 6fc64aa468 [UPDATE] web: update font-awsome version 4.4.0 2015-10-26 11:43:36 +01:00