Commit Graph
8533 Commits
Author SHA1 Message Date
Christophe Simonis 6df0bf2a67 [FIX] web: correct expectation in new test introduced by previous forward-port 2017-10-13 14:26:46 +02:00
Christophe Simonis 1da064a1d3 [MERGE] forward port branch saas-16 up to 8ee9024a4c 2017-10-13 13:13:11 +02:00
Géry Debongnie d4cf4374d1 [FIX] web: allow widget many2many_tags to display more than 40 records
Before this commit, the widget many2many_tags only loaded the first 40
records. This was difficult to see, because there were not so many views
with a lot of tags.
2017-10-12 16:15:06 +02:00
Géry Debongnie 66b692a5eb [FIX] web: fix display issue with fieldSelection
When displaying a many2one values, in edit mode, the option did not
properly display some characters.
2017-10-12 16:14:49 +02:00
Géry Debongnie 7d448d57e3 [FIX] web: fix issue with default_get/onchange and one2many
Before this commit, there was a bug when creating a new record which
contains a one2many with an onchange.  The commands sent to the onchange
did not contain the full information.

Here is how you could reproduce the issue: install expense, go to the
expense list view, select the 2 lines, then, in the 'action' menu in the
control panel, choose 'Expense: submit to manager'.  In the new expense
sheet, you could see that there were two lines in the one2many
expense_line_ids.  However, these lines are empty.  The reason is that
the commands sent in the onchange were 2 commands 0, with {} as data.

So, in short, the BasicModel did generate the proper commands, but with
empty data, in the specific case when we have a non empty one2many in a
default_get, then an onchange.

To solve this issue, I had to fix 2 things: the internal data struture
was wrongly updated, and the commands should be generated with all the
data, and not only the changes.
2017-10-12 16:14:47 +02:00
qsm-odoo 03ef19e40c [FIX] web, hr_timesheet_sheet: make m2o friendly-usable outside of views
Before this commit, m2o external button was always floating outside the
m2o main DOM element, on the right. This induced problems when using the
m2o outside of views (like in Odoo Studio). Now, the m2o design is made
so that this button is inside the m2o, except in form views where we
expect the button to overflow in the tables' right paddings.
2017-10-12 13:39:17 +02:00
rgarnau b8dac2ff32 [FIX] web: integer not properly parsed
The parsing of the integers does not escape the thousands separator.

issue: Integers are currently not properly parsed. For example, create
a database in Spanish language, install product_expiry and in settings
activate Lots & Serial Numbers. Go to Products and create a new product.
Choose to track by lots and specify the use_time, life_time, etc.
When saving, all integers are set to 0
2017-10-12 10:34:40 +02:00
Adrien Dieudonne aac4918096 [FIX] web: kanban mobile horizontal scroll issue
In mobile, the .o_kanban_card_content width wasn't defined.
In desktop, we don't have this issue because the .container bootstrap
element set the width.

Now, the kanban card content is correctly displayed in
the workcenter kanban view.
2017-10-11 13:21:45 +02:00
Richard Mathot 66f7d393d3 [FIX] web: debug mode tooltip
Display properly the content of context object instead of
[object Object].
2017-10-11 10:40:46 +02:00
Christophe Simonis 6c2ab192ea [MERGE] forward port branch saas-16 up to 88a9980b0c 2017-10-10 16:49:59 +02:00
Xavier Morel 7f6d32d5e0 Revert "[FIX] qwebjs: add tests to test suite" 2017-10-10 15:39:39 +02:00
Xavier Morel 6e646bc8bd [FIX] web: make qwebjs tests pass again
A bunch of features had been added to the qweb test files and qwebjs
did not pass them as features were either implemented differently or
not implemented at all:

* Fixed wonky and not cross-impl tests
  - added ``not`` word replacemenet to qwebjs as I wasn't sure how to
    handle that one cross-impl
* fixed t-esc/t-raw to render content *inside* the host node e.g.
  span@t-esc should render as <span>{contents of esc}</span>
* added fallback to body content if t-esc/t-raw yields an empty result
* process t-att in order with t-att-* and t-attf-* rather than before
  them both
* suppress attribute generation entirely in case of falsy value
2017-10-10 14:25:19 +02:00
Xavier Morel 1e3c76f41d [IMP] web: add web tests to regular JS suite
Remove old tests page as it was obviously unmaintained and did not run
at all...
2017-10-10 14:25:19 +02:00
Christophe Simonis 446ff1baf8 [MERGE] forward port branch saas-15 up to b60a41ce14 2017-10-09 17:54:36 +02:00
Xavier Morel 03a2a57163 [FIX] unfuck JS docstrings 2017-10-09 16:50:47 +02:00
Christophe Simonis 6b0828b3bf [MERGE] forward port branch saas-14 up to 85c8000738 2017-10-09 13:24:17 +02:00
Christophe Simonis 85c8000738 [MERGE] forward port branch 10.0 up to cb1cfadda2 2017-10-09 12:44:22 +02:00
qsm-odoo 9241f7ea63 [FIX] web: allow strings as m2o values in domain selector
Since the new views, the field parsing for m2o returns an object with
id and display_name. If the given value to parse is a string, it is
supposed that this is an ID. This was breaking the domain selector
widget which should allow strings as name-strings of m2o values.
2017-10-09 12:22:38 +02:00
Christophe Simonis 7c68e4d040 [MERGE] forward port branch 9.0 up to c725745d14 2017-10-09 11:46:03 +02:00
Khoi Nguyen 1bbb7d6241 [FIX] web: clear input on clicking 'Create and Edit' from many2one fields
We clear the input field when clicking 'Create and Edit' to ensure that
the field is empty if the user chooses to cancel the record creation. If
a record is indeed created, then the field value will still be updated.
2017-10-09 09:00:19 +02:00
Nicolas Lempereur a0d63a0a05 [FIX] web: x2m quickcreate>no error but slowcreate
When the quickreate fail and a slow create is used instead, don't
display the error that happened as is done in kanban and calendar
(following 0f7f3fc2f) quick create.
2017-10-04 14:53:52 +02:00
qsm-odoo 44def2086b [FIX] web: allow kanban tags without color field 2017-10-04 11:40:12 +02:00
kujiu 2f07bbca8c [FIX] web: Ordering of inline tree views (#19856)
Allow to order from several columns in inline tree views (x2many fields
in form views).
2017-10-04 10:45:54 +02:00
Goffin Simon 791152a876 [FIX] web: The model "ir.values" has been renamed
The model "ir.values" has been renamed in "ir.default" by this commit:

60d9f6fef9
2017-10-03 12:48:13 +02:00
stefanorigano c12c34587d [FIX] web, project, stock: emphasize dashboard records' colors 2017-10-03 11:03:11 +02:00
qsm-odoo aba5402d5e [FIX] web: allow to group on more groupable fields with the searchview
Some fields are groupable even though they are not stored (e.g. an inherited
field, by example the 'date' field of 'fleet.vehicle.log.fuel').
2017-10-03 10:42:47 +02:00
Simon Lejeune cde5b232e8 [REF] stock: alert on show details if not saved
It's not possible to click on the show details button if the picking is
not saved. It's a limitation of the webclient. This commit introduces a
waring telling the user to save the form view first.
2017-10-02 20:01:58 +02:00
Khoi Nguyen 59b55e2221 [FIX] web: fix TAB key in editable list views
Before this commit, two variables were used to store the current
position in a list view: currentCol and currentRow. This made it
difficult to handle incremental moves (eg: tab, shift+tab) inside a
row, since we have to ignore all buttons. Previously, this was done by
converting 'currentCol' to 'currentFieldIndex', but the conversion
between the two variables was incorrect and does not appear to be
that easy to fix. As an example, it was not possible to TAB-navigate to
the last column of the components list when creating a BoM.

This commit removes all mentions of 'currentCol' and uses
'currentFieldIndex' instead, removing the need for conversions. The TAB
navigation code is simpler as a result, and should now be correct.
2017-10-02 17:34:07 +02:00
Christophe Simonis 5ce21c7355 [MERGE] forward port branch saas-16 up to b3d0897f2d 2017-10-02 13:05:17 +02:00
Martin Trigaux af297345c6 [FIX] crm: avoid clash on attribute name
The sum is already used in views for
   <field name="foo" sum="Total" />

Where "Total" is translatable and extracted in source terms export.

The progress bar kanban widget expect a field name (untranslatable).

Avoid to translate a field name by changing the attribute
2017-10-02 11:46:55 +02:00
Fabien Pinckaers ae190e8912 [IMP] web: kanban view, no hover on tags as not clickable 2017-10-02 09:04:59 +02:00
Géry Debongnie 962fa7325d [DOC] web: add some doc in control panel mixin
This should make it easier for developers to use the control panel mixin
properly.
2017-10-01 11:35:46 +02:00
qsm-odoo 1d34e269da [FIX] web: update column data when adding a record in a kanban
When a record was added in a kanban thanks to the quick create, column
tooltip and column progressbar were not updating the values they showed.
Now, adding/deleting records updates the whole column as the update
operations.

Thanks to @kig-odoo for the test.

Note: to backport (partially)
2017-09-30 18:39:13 +02:00
qsm-odoo a09462b7fc [FIX] web: allow updating a newly created kanban record
When using quick create to create a kanban record, if this record was
then updated thanks to a field widget, the view crashed. This was
because it tried to update the whole column but the newly created
record was not properly attached to it in the model.

Thanks to @sja-odoo for the test.

Note: to backport (partially)
2017-09-30 18:39:13 +02:00
Aaron Bohy 5164d30c92 [FIX] web: correctly redraw x2m list after onchange
When an onchange is set on an x2many field displayed as an editable
list in a form view, and the user updates one of the subrecords,
the updated subrecord is kept in the DOM and updated, and all other
subrecords in the relation are re-rendered and re-inserted at their
correct place in the list (because the onchange might have changed
them).

Before this rev., the order of the subrecords after the edited one
was reversed.
2017-09-30 17:33:20 +02:00
Nicolas Lempereur f2df388c38 [FIX] web: settings scroll w/o control panel
Have the settings scroll without the mock control panel.

courtesy of @qsm-odoo
2017-09-30 16:11:05 +02:00
Aaron Bohy c8f15742c3 [FIX] web: Kanban: open record when a tag is clicked
Kanban records with 'global click' feature activated should open
the record in a form view when the corresponding card is clicked.
Before this rev., it wasn't working if the user clicked on a tag
of the kanban record, because of an unused click handler defined
on the Many2ManyTags widget (preventing the global click feature
from actually performing the global click).

This rev. removes that handler in the KanbanFieldMany2ManyTags.
2017-09-30 16:02:23 +02:00
Aaron Bohy b53af081cb Revert "[IMP] web: filter when clicking on tags in Kanban"
This reverts commit b6ef149b as it seems that we don't want this
feature ultimately (was confusing for users trying to open the
record, but it filtered instead).

Note that opening the record by clicking on a tag still doesn't
work, but this is fixed by the next commit.
2017-09-30 15:59:24 +02:00
Aaron Bohy 776bac6a06 [FIX] web: don't discard x2many rows coming from default_get
Problem occured in the MRP Production wizard (with a consumed
product tracked by serial number). The opened record is a new
record, and its one2many has 2 default rows that are prefilled.
If the user edited one of the quantities in those rows, and set
an invalid value instead (e.g. a letter), the row was removed
without notice when it was focused out. This was because the
model wasn't aware that a change has been done on the record,
and as the record was flagged as new, it was simply abandonned.
2017-09-30 15:59:24 +02:00
David Monjoie 16eb262c60 [FIX] web: fix one2many default get
The one2many default get code used to meddle with basic_model's res_ids
manually, which ended up desynchronizing the data and res_ids fields
of the list representation of the one2many values.

This commit solves the issue by using the proper mechanisms of the
basic_model, that is creating a proper datapoint for those ids.

Steps to reproduce the original issue:
- Install sale_mamangement, mrp and purchase
- Create a product
- In the Inventory tab, in Routes, uncheck Buy
- Check and then uncheck back any other route than Buy
- Get a traceback because we are looking for a record with a given
  res_id in the list data but since they are desynchronized, data
  is empty at that point even though res_ids is not.
2017-09-30 15:59:24 +02:00
fwi-odoo d9ffd5204d [FIX] web: correctly apply onchange on boolean field
When an onchange sets a boolean field to 'true', if this boolean was set to 'false'
previously, the old value was used instead of 'false'.
2017-09-30 15:11:39 +02:00
Khoi Nguyen bdeb775219 [FIX] web: focus issues after onchange in x2many with buttons
https://github.com/odoo/odoo/commit/36b4d78a2678806b25aaa5650b64496f9da9d205
fixes most post-onchange focus issues for x2many fields, but does not
account for "button columns" properly. More precisely, the current
widget is computed via a position index taking buttons into account in
an array that ignores them. This caused the index to be out of bounds,
resulting in a traceback. This commit fixes this issue.
2017-09-30 14:25:43 +02:00
Aaron Bohy 511fd5995c [FIX] web: don't discard x2many rows coming from default_get
Problem occured in the MRP Production wizard (with a consumed
product tracked by serial number). The opened record is a new
record, and its one2many has 2 default rows that are prefilled.
If the user edited one of the quantities in those rows, and set
an invalid value instead (e.g. a letter), the row was removed
without notice when it was focused out. This was because the
model wasn't aware that a change has been done on the record,
and as the record was flagged as new, it was simply abandonned.
2017-09-30 13:23:53 +02:00
fwi-odoo 0f98d59064 [FIX] web: calendar avoid double event creation
Before this commit, pressing tab then enter was generating a traceback because
the event creation and modal deletion was done twice.
This commit adds a protection to be sure that we are doing only one event
creation.
2017-09-30 13:21:02 +02:00
rde 4bd8e3e2ed [IMP] website: Script injected in DOM: window.onerror empty params
Before this commit, error thrown by scripts injected in DOM won't return a
clean error on window.onerror.
It would open the crash_manager's show_error's dialog that wouldn't display
any informations except "Script Error." and "Traceback:".
This is because of browser's security reason: it will just give you a
'Script error.' as message and nothing else for security issue.

Now, this kind of error will show a clearer message informing that it is
probably originating from a Javascript file served from a different origin.
There is now also the possibility for developers to handle/override the
behavior when this kind of error is catch to prevent the dialog to open for
example.

Might be of use:
https://blog.sentry.io/2016/05/17/what-is-script-error.html
https://stackoverflow.com/a/7778424
https://danlimerick.wordpress.com/2014/01/18/how-to-catch-javascript-errors-with-window-onerror-even-on-chrome-and-firefox/ (Search for Script Error)
2017-09-30 12:21:27 +02:00
David Monjoie 8d1630a40a [FIX] web: fix one2many default get
The one2many default get code used to meddle with basic_model's res_ids
manually, which ended up desynchronizing the data and res_ids fields
of the list representation of the one2many values.

This commit solves the issue by using the proper mechanisms of the
basic_model, that is creating a proper datapoint for those ids.

Steps to reproduce the original issue:
- Install sale_mamangement, mrp and purchase
- Create a product
- In the Inventory tab, in Routes, uncheck Buy
- Check and then uncheck back any other route than Buy
- Get a traceback because we are looking for a record with a given
  res_id in the list data but since they are desynchronized, data
  is empty at that point even though res_ids is not.
2017-09-30 09:04:29 +02:00
Khoi Nguyen 33aa89ed05 [FIX] web: discarding a new record in a modal closes the modal
Discarding a new record triggers the 'history_back' action.  This makes
sense if the record was discarded from a normal form view, but not so
much when in a modal, where the expected behaviour is to close the
dialog.

This commit overrides the function in the action manager which handles
the switch to the previous view. It checks whether a dialog window is
open, in which case it simply closes it.
2017-09-29 18:01:16 +02:00
Nicolas Lempereur 31fdcb4931 [FIX] web: max one wiggle per readonly click
The wiggling effect of the edit button when clicking on the form
(hinting that to change the form you should edit it) could  happen
several times.

With 85d1e76 there was also a visual deffect on the Edit button when the
wiggle happened several times, because bounce are stacked but the CSS
class was removed after the first bounce was removed.
2017-09-29 17:12:09 +02:00
fwi-odoo da136d83bb [IMP] web: x2m list: conditionnaly hide a column
This commit introduces a new way to hide a column in a x2m list view.
The attribute 'tree_invisible' can be add in the field attrs in the x2m
view definition. This attribute can use the 'parent' key to make a reference
to the parent record (e.g. 'parent.id').
2017-09-29 16:49:20 +02:00
qsm-odoo da11387587 [FIX] web, mail: complete commit https://github.com/odoo/odoo/commit/87f1e360a89eb7617d5fd60cad58a143bea441df
Tests are overridding the `config` object directly but this was wrongly
done. Also, tests had to be adapted to set the `isMobile` value
correctly.
2017-09-29 16:39:06 +02:00