Commit Graph
1383 Commits
Author SHA1 Message Date
Aaron Bohy d9391409a2 [IMP] web: grouped Kanban: UX improvements in mobile
This commit refactors the JS and LESS of the new mobile version
of the grouped kanban views. It ensures that the touchSwipe
library is lazy-loaded (only in mobile, when entering a kanban
view).
2017-09-25 14:10:44 +02:00
Dharmang Soni a12cfa8260 [IMP] web: grouped Kanban: UX improvements in mobile
This commit aims to improve the UX of grouped Kanban views on
mobile devices. Only one column is now displayed, full width. The
columns' records are lazy-loaded. The user can swipe horizontally
to navigate through columns (thanks to the touchSwipe library).
2017-09-25 14:10:40 +02:00
rde b94939377a [IMP] web: improve renderCheckbox to be re-usable in front end
Before this commit, the label was into a display block that add a return line
between the cehckbox and the label.

It was not visible in backend, because label by defaut is displayed without
renderCheckbox. (no options.text provided)

Now renderCheckbox render correctly with the same code in frontend and backend
2017-09-25 10:53:28 +02:00
Christophe Simonis 5c51a0ad4d [MERGE] forward port branch saas-17 up to bf4ccb21f6 2017-09-21 18:14:55 +02:00
Christophe Simonis bf4ccb21f6 [MERGE] forward port branch saas-16 up to 88395bdb8e 2017-09-21 17:18:49 +02:00
qsm-odoo b51b0d66c2 [FIX] web: open domain selector's datepicker at the right position
Before this commit, and since the combination of new views + datepicker
library update, the datepicker opened at the top left of the window
when using it in a domain selector. It also could not be used at all.

This was because the current scenario occured:
1) Click on the datepicker
2) The datepicker triggers that it has changed on opening
3) The whole domain selector is rerendered
4) The datepicker computes where it should open... on basis of the
   old destroyed domain selector

As the main cause of the problem here was the (2), this commit changes
the datepicker odoo widget to only notifies that it has changed when it
has really changed.
2017-09-21 14:51:12 +02:00
Géry Debongnie bd113d0709 [FIX] web: properly destroy field widgets in some cases
Before this commit, the web client did not properly destroy field
widgets when updating a one2many after an onchange.  This is rarely an
issue, because in general, there are no other field widgets besides the
row currently in edition.  However, if we specify explicitely a widget,
or if we use a custom widget, it may be a problem.
2017-09-21 10:55:09 +02:00
Aaron Bohy a8bc2a8bf8 [FIX] web: several minor issues with editable list
- correctly update the pager when a record is added or removed
- destroy the widgets of the removed row when the user clicks on
  'Cancel' when creating a new record
- ensure that the list always contains 4 rows (before this rev.,
  in list views with less than 4 records,   if the user created a
  new record, then clicked on 'Discard', there were only 3 rows
  left
- properly destroy field widgets when removed from the DOM

Note that the change of parent.parentID to parent.static is not a
bug fix, but it's better to use the key that indicates the type of
list element, instead of implying it from other attributes.
2017-09-21 10:55:09 +02:00
Aaron Bohy 130c47bc0a [FIX] web: several minor issues with editable list
- correctly update the pager when a record is added or removed
- destroy the widgets of the removed row when the user clicks on
  'Cancel' when creating a new record
- ensure that the list always contains 4 rows (before this rev.,
  in list views with less than 4 records,   if the user created a
  new record, then clicked on 'Discard', there were only 3 rows
  left
- properly destroy field widgets when removed from the DOM

Note that the change of parent.parentID to parent.static is not a
bug fix, but it's better to use the key that indicates the type of
list element, instead of implying it from other attributes.
2017-09-20 17:07:04 +02:00
Deep Patel 9b9fcfe628 [FIX] web,base: document template widget in settings
Go to General Settings, click on 'Change Document Template', and
in the opened dialog, click on a template.

Before this rev., it automatically closed the dialog, which was
not really convenient.

This rev. introduces a new field widget (image_selection) for
this use case, and ensures that the dialog doesn't close when
a template is selected.

Test written by @mba-odoo
2017-09-20 10:56:57 +02:00
Géry Debongnie 48b8be29fa [FIX] web: update x2manys when onchange add new line
In this commit, we make sure that if an onchange in a x2many modifies
another line, then the new data is properly shown.  This is quite
tricky, because the field x2many ignores the full extent of the changes.
Also, we obviously want to preserve the editing state (focused field,
...)

So, what we actually do is to rerender the full x2many (minus the new
line) to make sure that we preserve the correct row order.

Note: thanks to MGE for the test and some preliminary work.
2017-09-20 10:05:13 +02:00
Martin Geubelle 3136fc1643 [FIX] web: reuse datapoint with onchange one one2many
Since the rev. https://github.com/odoo/odoo/commit/2728fe1ec1ac7e99819d0f30f29a1814b00c82a4 the onchange create
command (0) send the virtual id as second argument. This argument is sent
back from the server and can then be used by the client.

As the client knows the virtual id, it can easily reuse the datapoint created
for this record and thus avoid creating a new one.

Creating a new datapoint can potentially lead to problems if the record has
for example specialData, that won't be kept.
2017-09-20 10:05:13 +02:00
Deep Patel 9f8efb9d16 [FIX] web: editable list: don't sort rows in edition
This commit disables the sort feature when a row is being edited,
like it was in saas-15, because it didn't work correctly anyway.
2017-09-20 08:20:01 +02:00
Deep Patel 90a253bb72 [FIX] web: Form view: make 'Edit' button bounce in readonly
... when the form is clicked.

This commit restores the behavior of saas-15, before the new views.
2017-09-19 15:04:56 +02:00
Christophe Simonis d15a31ae6d [MERGE] forward port branch saas-17 up to 2a343d7c9c 2017-09-19 11:58:01 +02:00
Christophe Simonis 2a343d7c9c [MERGE] forward port branch saas-16 up to c3a48da767 2017-09-19 11:06:46 +02:00
Pratima Gupta de48daf53a [FIX] web: FieldDomain: don't open record from selection
The FieldDomain allows to open a list in a dialog to display the
records matching the current domain. In this dialog, clicking on
a record should do nothing (this was the behavior before the new
views).

Before this rev., it actually tried to open the record and it
produced a crash.
2017-09-19 10:14:24 +02:00
Darshan Kalola 8ba10a3b9a [FIX] web: FormView: invisible='True' on x2many fields
Before this rev., it crashed if an x2many field had the
attr invisible set to 'True' in a form view.
2017-09-19 10:14:24 +02:00
Géry Debongnie 8f02b16c27 [FIX] web: tests: mockserver should crash instead of log
When the mockserver handles an unimplemented route, it just log an
error.  This is annoying because it does not break the QUnit suite, so
if the developer does not look at the console, it will look like the
test suite pass.  However, the runbot will see that as an error.

With this commit, we throw an error to force the test suite to fail in
that case.
2017-09-18 13:48:51 +02:00
Géry Debongnie b3aa323919 [FIX] web: prevent crash sometimes when sorting one2many
Before this commit, there was a crash when sorting a one2many in a form view.
This is due to the fact that the event from the one2many bubbled up to
the main form view, which basically assumed that it was supposed to sort
some sub one2many.

It could be seen for example when editing a 'attribute' in a product
form view (need to activate variants), then sorting the 'attribute
values' sub one2many.

With this commit, we simply stop the event propagation at the correct
level.
2017-09-18 13:48:50 +02:00
Christophe Simonis 66ca687324 [MERGE] forward port branch saas-17 up to ed901bedcb 2017-09-15 18:09:39 +02:00
Christophe Simonis ed901bedcb [MERGE] forward port branch saas-16 up to 80f916e8e0 2017-09-15 17:20:01 +02:00
Martin Geubelle cb540c48eb [FIX] web: correctly display the enterprise label
The `upgrade_boolean` widget should display an `Enterprise` label next to it.

There is however an issue when a `label` is specified for this field. In this case,
the `Enterprise` label should be placed next to the field label (and not the field
itself).

The easiest solution would have been to instantiate the field widget with its label,
but this can't work because the field widget is instantiated before its label.

We thus re-render the widget after its label creation.
2017-09-15 16:36:40 +02:00
qsm-odoo ae7f4c0485 [FIX] web: always quickcreate in the first kanban column
KanbanColumn instances are saved in an array in the renderer. The quick
create widget is always put in the first column found in this array.
Unfortunately, the array elements' order was broken after some
operations where column(s) are rerendered (like moving records).
2017-09-15 14:32:26 +02:00
Martin Geubelle 74c27d81ed [FIX] web: deal with can_create and can_write option in M2O
The server postproccess the view to add attributes on many2one fields, i.e.
`can_create` and `can_write`, according to access rights.

These attributes are parsed by the client as string but should also be parsed by
the many2one when evaluating them.

The mock server has also been adapted to set these attributes.
2017-09-15 11:03:09 +02:00
qsm-odoo 33f9e90bd5 [IMP] web, *: add kanban column progress bars
* crm, project

Add a new feature which allows to put a progressbar in the kanban
columns. The progressbar shows with the same color the amount of
records whose value of a given field are the same in the column.
It also indicate the sum of another given field or simply the total
number of records. It also allows to subgroup the column content.

To define a progressbar, add this as a direct child of the kanban
arch:

<progressbar field="<name of the field to use for subgroups>"
             colors="{<one possible value for the above field>: <success, warning or danger>, ...}"
             sum="<name of the field to sum or nothing to use total number of records>"/>

Also:
- Properly update record model data's parentID when moving a record
- ...
2017-09-14 23:48:56 +02:00
qsm-odoo f1370dfa0a [REF] web: allow adding custom stuff in kanban header
Previous kanban header was a div with `flex-flow: row nowrap`. So if
someone tried to add some stuff in it, it will be forced to stay on
the same row as the title and config buttons. This commit wraps these
row elements in a new div to allow kanban header customization (this
prepares for the kanban progressbars).
2017-09-14 23:48:54 +02:00
Martin Geubelle 135a6fb45b [FIX] web: Kanban: move a record when grouped by selection
Move a record from one column to another in a kanban grouped by a selection field
leads to a traceback.

A selection field value is composed of a tuple ('value', 'String') and the write
command must send the `value` and not the `String` as it was done before this rev.
2017-09-14 15:03:29 +02:00
Martin Geubelle 7de94268fc [FIX] web: skip buttons when navigating in editable list
Clicking on a cell that contains a button (but not ON the button) leads to
a traceback (see "Scrap" button in Stock Operation for example).

This is due to the fact that a button is not registered as a widget so it can't
be activated.

This commit ensures that the next line is selected if the last column is a
buttton.
2017-09-14 15:03:29 +02:00
Christophe Simonis e390b0d640 [MERGE] forward port branch saas-17 up to 1e17035f71 2017-09-13 20:07:38 +02:00
Christophe Simonis 1e17035f71 [MERGE] forward port branch saas-16 up to 268cf9d04a 2017-09-13 19:32:35 +02:00
Géry Debongnie 93cf24f73a [FIX] web: reimplement custom widgets in basic views
With the new views, we lost a (almost unused and undocumented) feature:
the ability to instantiate custom widgets in a form view, not linked to
a particular field.  For example:

<widget type="weekly_timesheet" attrs="{'readonly': [['state', 'not in', ['new', 'draft']]]}"/>

We reintroduce this feature in this commit, with a nice twist: it also
works for the list view and the kanban view.
2017-09-13 14:04:34 +02:00
Martin Geubelle 917ba745ea [FIX] web, account: display partner in reconciliation
When selecting a partner in the reconciliation widget, using the SelectCreateDialog
(Search More), the partner wasn't correctly displayed.

This was due to a difference between the change format of the many2one ; when using
the dialog, only the `id` is sent (while the `id` and `display_name` are sent when
using the many2one dropdown).

These two behaviours are now standardized and both now send `id` and `display_name`.

It has the advantage of sparing some `name_get`s called by the model because the
`display_name` was missing.

This change implies some refactoring where the SelectCreateDialog was used.
2017-09-12 15:49:22 +02:00
Christophe Simonis c5f680200c [MERGE] forward port branch saas-17 up to d08b4407be 2017-09-12 12:09:11 +02:00
Christophe Simonis 73bb71b80c [MERGE] forward port branch saas-16 up to 295a377e5d 2017-09-11 18:56:15 +02:00
Martin Geubelle 7a87484856 [FIX] web: remove QUnit.only occurence 2017-09-11 16:54:09 +02:00
fwi-odoo 68d1e6d8b1 [FIX] web: evaluate the view context for the subviews not inline
Before this commit, the xml attributes defined with 'context.get(key)' in the
subviews not inline were not evaluated correctly. This was caused
by the loss of the one context in the '_loadSubviews' method.

This commit fixes this issue and modifies the mockserver in order to be able
to use the parameter 'viewOptions.context'.
2017-09-11 16:41:58 +02:00
fwi-odoo 268e6d9530 [FIX] web: calendar: set event without time as all day
Before this commit, when an event had only a date, the event
was set to midnight.
This commit sets the event as all day event if the field used as start date
is only a date and not a datetime.
2017-09-11 16:41:40 +02:00
Christophe Simonis bd08d4f052 [MERGE] forward port branch saas-16 up to 3ac2a1106c 2017-09-11 14:02:19 +02:00
Aaron Bohy a58fb415fc [FIX] web: click on many2many tag with no color
Before this rev., a traceback was raised when the user clicked on a
many2many tag in a kanban view without color field.

For instance, it was the case in the kanban view opened by clicking
on the Lead/Opportunity section of the activities icon in the
systray.
2017-09-11 11:44:24 +02:00
Martin Geubelle 3ae9a6b537 [FIX] web: Kanban: allow to resequence a record twice
Before this rev., it was not possible to move a record (in the same column)
at the top and then move another record above it.

There is special class `o_updating` added on record being edited to avoid
moving them. This class is normally removed afterwards when re-rendering the
record.

When resequencing, the record is re-rendered so the class won't be removed ;
this is why it shouldn't be added in the first place (same behaviour as saas-15).
2017-09-08 16:35:45 +02:00
Martin Geubelle 14cb9af0d6 [FIX] web: only send changed fields on one2many after onchange
The server response to an `onchange` on a one2many is a list of
commands. In case of one2many update (command 1), the server
returns all fields (and not only the modified ones).
When saving the record, this is the client responsability to
specify which fields really changed.

Before this commit, all fields were sent at `write` and not only
the changed ones. This was causing issues when the user couldn't
write on the field ; an error was triggered even though the user
didn't change anything.

To fix this, we only tag as changed (in the datapoint `_changes`
attribute) the fields that have a different value after the onchange.
2017-09-08 12:27:43 +02:00
Sanjay Jamod 35cdf9076f [IMP] web: improved date field usability
- datepicker doesn't default to current date by default
- date string in the input is now selected when clicking the field
- adapted the existing tests to the new changes
2017-09-07 13:43:01 +02:00
fwi-odoo ef6074beb6 [FIX] web: fix x2m tests
When a x2m field is modified, the 'save' rpc doesn't send 'False' as second
argument of the special command that manipulate the set of records.
From now on, the virtual id of the record is sent to the server as second
argument. This commit fixes the tests making the assumption that 'False'
was sent.
2017-09-07 11:25:30 +02:00
Christophe Simonis d5382abeaa [MERGE] forward port branch saas-17 up to b8dd34fcbb 2017-09-06 17:40:59 +02:00
Martin Geubelle bae4aacad8 [FIX] web: edit x2many editable list view after resequence
In an embedded editable list view with the widget `handle`, resequencing a
record and try to edit it afterwards won't work. The selected record isn't the
correct one, as if the resequencing had no impact.

To make this work, the list datapoint needs to be ordered by the field with the
widget `handle` ; if it isn't, resequencing the records won't change the x2many
data order but the list view expects the same order.
2017-09-06 16:34:18 +02:00
Martin Geubelle 3052a43494 [FIX] web: edit editable list view after resequence
In an editable list view with the widget `handle`, resequencing a record
and try to edit it afterwards won't work. The selected record isn't the
correct one, as if the resequencing had no impact.

A small refactoring has been done to fix this because the resequence logic
was placed in the ListController (but should logically be placed in the model).
Several views are using the resequencing ; the code is thus now placed in the
BasicModel.

The list renderer state is then updated after the resequence.

The resequencing and the line edition have been placed in a common mutex to
avoid problems when the user tries to edit a record while the resequence rpc
isn't finished yet.
2017-09-06 16:34:18 +02:00
fwi-odoo c0ceae2f93 [FIX] crm: module crm_voip doesn't exist anymore
Since the refactoring of VOIP, there is no more a module crm_voip but only
voip.
2017-09-06 15:18:19 +02:00
Christophe Simonis b8dd34fcbb [MERGE] forward port branch saas-16 up to 64d56995e0 2017-09-06 13:29:05 +02:00
Géry Debongnie 983c7ae22f [FIX] web: proper x2m edition with pagination
Before this commit, we did not really handle gracefully editing a
one2many with many records. The main issue is that if the user was not
on the last page, creating a new record added it to the last page, which
is confusing and actually a bad idea for records with required fields.

This fix requires a way to track the current changes (because we do not
display the current state of the form view: the new record is displayed
in the first page, but is actually added at the end of the dataset).

Note that this probably does not solve all issues with pagination. This
is a quite delicate problem. We will add tests and fixes as needed.
2017-09-05 15:41:28 +02:00