Commit Graph
6477 Commits
Author SHA1 Message Date
Géry Debongnie 29427bdcb3 [FIX] web: reimplement autosize for fun (and some bugfixing)
autosize does not work correctly (it moves the screen in all directions
sometimes when the user press enter in the bottom of the screen in some
browser),

So, we decided to have our own version, because of course, we can do it better.  A
few horrible hacks later, I proudly present you "autoresize" (it was
almost named "odooresize" but common sense prevailed).

As added benefits, it plays better with our web client, so when you open
a dialog in a modal for example, the autosize fields should have the
correct height automagically (or should I say 'odoomagically')
2016-01-11 14:32:51 +01:00
Christophe Matthieu fa1e30394e [FIX] base: remove unnecessary code (td.oe-actions does not exist) 2016-01-11 10:12:05 +01:00
Mohammed Shekha edf565881c [FIX] web: refresh in form view when first view mode is calendar
When you are in form view and came from calendar, a screen refresh
throwed an error from fullcalendar lib. Also when going back to the
calendar view, it would not be loaded.

It is due to fullcalendar not being rendered if it is not visible, and
other part of the Odoo code are dependent on it having been rendered.

This commit hide the calendar after having been rendered.

closes #10253
opw-659314
2016-01-05 14:25:57 +01:00
qsm-odoo 63feb99875 [FIX] web: views in action dialog
Opening a view (kanban or list) in a dialog thanks to a target=new
action did not work anymore (only in community).

The cause was the 'search_view' action flag which was set to false
in case of a popup (preventing the view to search the records and so
to display them). This commit sets this flag to true if the popup
has to display a list/kanban view.

Backport of aab enterprise work.
2015-12-29 16:29:49 +01:00
Géry Debongnie 031a3f8a4f [FIX] web: only display last part of breadcrumbs in tab title 2015-12-29 16:06:18 +01:00
sha-odoo 34bc336d97 [FIX] web: tip position in form view
As .oe_form_sheetbg was not position:relative, tips position was
sometimes wrong as the statusbar is loaded after the tips positions
are computed.
2015-12-28 13:40:21 +01:00
qsm-odoo bcca4a44c7 [IMP] web(_planner),website: navbars & menus merge
Merge appswitcher navbar and app navbar.
Merge planner menu and user menu.
2015-12-24 17:11:55 +01:00
Christophe Matthieu c7337bf3b3 [FIX] web: Can't save a x2m in list editable if contains a m2m_tags with a color field
m2m_tags inlist editable view try to get color on validation, the field is invalid because the mutex is pending.
Fix: don't re-render the fields

Issue: steps to reproduce:
- Create a new instance, install "sale"
- Create a product "prepayment", service, invoice on ordered qties
- Create aproduct "project phase", service, invoice on delivered qties, manually track delivered qties
- Create a SO with once prepayment, and twice a line with "project phase". ( the name (description) of the lines should be "phase 1" and "phase 2" )
- Create invoice => The prepayment is invoiced
- Go back to the SO, try to change the delivered qties of the first phase to 1
- Save => error, odoo doesn't let you save.
2015-12-23 10:58:37 +01:00
Denis Ledoux e04ddeaa22 [FIX] web: client action change password
1. To change the page title, you now have to call
`set_title` from `require('web.web_client')`

2. Without the `type="button"`, the `Change Password`
button is regarded as a `type="submit"`, therefore
submitting the form, on `web` on click,
and `web` doesn't expect this POST request.
The POST request must be done on
`/web/session/change_password` only.

opw-660567
2015-12-22 11:23:31 +01:00
Nicolas Lempereur b9520e22e9 [IMP] web: m2m_tags support _rec_name != 'name'
Currently, the m2m tags widget would only display the name present in
the "name" field. This prevent them from being used with custom
fields/models and other niceties.

opw-658490
2015-12-16 12:03:43 +01:00
Olivier Dony b4949f757c Revert "[FIX] web: Can't save a x2m in list editable if contains a m2m_tags with a color field"
Reverted because it causes issue #10083 when serializing
nexted x2many values, and produces invalid x2many commands,
such as:

    `[[6, false, [[5, false, false], [6, false, [8]]]]]`

Pending a proper fix for the oririginal issue.

This reverts commit 7e2628aeb2.

Closes #10083
2015-12-15 17:55:35 +01:00
Géry Debongnie 79ab4c4c60 [FIX] web: make sure web client uses view_id if provided
when there is a view_id parameter in the url, the web client should
honor that request, instead of using default view
2015-12-11 12:34:38 +01:00
Christophe Matthieu 7e2628aeb2 [FIX] web: Can't save a x2m in list editable if contains a m2m_tags with a color field
m2m_tags in list editable view try to get color on validation, the field is invalid because the mutex is pending.
Fix: use internal_set_value (don't re-rendering)

Issue: steps to reproduce:
- Create a new instance, install "sale"
- Create a product "prepayment", service, invoice on ordered qties
- Create aproduct "project phase", service, invoice on delivered qties, manually track delivered qties
- Create a SO with once prepayment, and twice a line with "project phase". ( the name (description) of the lines should be "phase 1" and "phase 2" )
- Create invoice => The prepayment is invoiced
- Go back to the SO, try to change the delivered qties of the first phase to 1
- Save => error, odoo doesn't let you save.
2015-12-11 10:07:02 +01:00
Christophe Simonis 521b90a8da [MERGE] forward port of branch saas-6 up to 12d7996 2015-12-08 15:17:06 +01:00
Christophe Simonis 12d799623c [MERGE] forward port of branch 8.0 up to 83a4a58 2015-12-08 13:03:08 +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
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
Nicolas Lempereur bcd7273ba8 [FIX] web: pivot axis switch groupby field
In ee0caa246 we solved some issue when a field was used in a "group by"
filter, but was not considered "groupable" (which does not resolve
related field in their related model to see if they fit the bill).

This was fine, but this has to be also taken into account when these
group by are applied to columns, which is possible by switching x and y
axis.

opw-647401
2015-12-02 09:55:05 +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
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
Nicolas Lempereur 2790bb4492 [IMP] web: minor css fix SelectCreateDialog
related to opw-657349
2015-11-27 15:08:43 +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 fd56268c6c
2015-11-26 10:25:15 +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
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
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
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
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
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
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
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