Commit Graph
10132 Commits
Author SHA1 Message Date
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
qsm-odoo 76405ba6d0 [FIX] web: restore hovering effects on folded kanban columns
There are two kind of hovering effects:

(1) When the user hovers the column with the mouse

It was broken with https://github.com/odoo/odoo/commit/f1370dfa0abac2b50315e47dccd0daf906336fc5
because the "o_kanban_header" class was renamed to
"o_kanban_header_title" and the effect still applied on the
"o_kanban_header" element.

(2) When the user is about to drop a kanban record

It was broken with https://github.com/odoo/odoo/commit/6e0234819e496d7deb352aea0d867c54104c6c20
because styling the "o_kanban_hover" class was removed by mistake.
2017-09-20 17:13:36 +02:00
qsm-odoo 93bf26abc1 [FIX] web, *: review kanban record sizes
* account, maintenance, mrp, payment, point_of_sale, sales_team

Previous system was:
- `flex: 1 1 300px;` on kanban records
- If a specific record needs a different size, add custom style to
  either change the `flex` rule or set a `min-width` for >=SM screens

Now:
- `flex: 1 1 auto;` and `width: 300px;` on kanban records
- If a specific record needs a different size, add custom style to
  change the `width` rule.

This allows some standardization of the way to customize the suited
width and also allow lesser LESS code (as the previous version required
either the use of the flex mixin or the use of a media query).

Note:
- Also remove useless app record rule
- Also fix MRP Work Centers record width

Note2:
This system should be improved for version 12.0.
2017-09-20 16:57:50 +02:00
Martin Trigaux 9d2e825340 [I18N] export saas-18 source terms
saas-18 will be the future version 11
2017-09-20 16:14:08 +02:00
qsm-odoo bada5a7300 [FIX] web: statusbar margins in in-dialog form views
Form views with a chatter in a dialog on a large screen are styled by
the side chatter feature. This is not a problem as it is made to be
automatically adapted whether a chatter is displayed or hidden, but
in-dialog only rules had to be adapted.
2017-09-20 15:03:56 +02:00
qsm-odoo 63425459b6 [FIX] web: better project kanban_status inactive color
- Use a lighter color so that the red and green ones are more visible
- Use the same color for the column progressbar's inactive state
2017-09-20 15:03:56 +02:00
qsm-odoo 7b965a9673 [FIX] mail, web: chat window and emojis
- Fix several contexts where the emoji popover was hidden by a webclient
  element (control panel / ...). To solve this bug, the design has been
  improved to not use popover but instead use custom design (better
  integrated with new chatter design)

- Chat window is now still usable when a modal is opened

- Simplify chatter LESS
2017-09-20 15:03:56 +02:00
Laurent Smet 85a0399d4f [FIX] web/report: fix header/footer css style in pdf reports (#19579)
After the refactoring of the wkhtmltopdf engine, the headers/footers are managed in a very different way to be able to call wkhtmltopdf only once. The subst JS function must select the right header/footer corresponding to the current page company. However, a <div> was suppressed during the process and then, some external customization might be ignored (see github issue for more details).

-issue: https://github.com/odoo/odoo/issues/19544
2017-09-20 14:38:35 +02:00
qsm-odoo c798f0f744 [FIX] web: style only one kanban hovered link at a time
Hovering a link in a kanban record was adding an hover effect on all the
links which were in the same <div/> parent.
2017-09-20 12:32:48 +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
Christophe Simonis d15a31ae6d [MERGE] forward port branch saas-17 up to 2a343d7c9c 2017-09-19 11:58:01 +02:00
Kirti Choudhary 63ebdd0869 [FIX] web: Display 'Favorites' filters list with a scrollbar when too long 2017-09-19 11:37:01 +02:00
Christophe Simonis 2a343d7c9c [MERGE] forward port branch saas-16 up to c3a48da767 2017-09-19 11:06:46 +02:00
Hardik Patel c3a48da767 [FIX] web: FormView button box: position of More dropdown
Before this rev., the dropdown was positioned in the bottom left
corner of the form view.
2017-09-19 10:14:24 +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
Hardik Patel 116aa22685 [FIX] web: reset offset to 0 when searching for records
Scenario: Go to any list or kanban view: go to next page and set a
filter that matches less that 'limit' record (e.g. less than 40),
but at least one. No record will be displayed, because the offset
is kept for the search_read.

This rev. ensures to reset the offset to 0 when a search is done
using the searchview.
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
qdp-odoo ec96c0b3c2 [IMP] base: add vat_label on res.country
That allows to display the 'vat' field under the right label in reports.
2017-09-18 21:57:48 +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
qsm-odoo af8936037f [FIX] web: fix several kanban design issues
- Load more was invisible; now also add a little bit of styling
- Small column records were not centered in their column
- Add a column padding bottom to allow seeing reaching the scrollend
- Column create was misaligned since some padding changes
2017-09-18 13:15:52 +02:00
Xavier Morel f1a85ba70a [FIX] *: fix a bunch of incorrectly documented docstring
Fix a bunch of ill-documented/incomplete/incorrect method docs
Without this, the automatic doc generation does not work.
2017-09-18 11:54:39 +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
Yannick Tivisse af2620a443 [IMP] web: reference field: add 'hide_model' option
It allows to see only records from a given model without allowing to
change the model. It gives a better experience to users that choose
records using a reference field when the model comes from some other
choice and should not be changed.
2017-09-15 15:56:23 +02:00
qsm-odoo a8e7d096b8 [REF] web: adjust kanban dashboards layout
Crop long texts avoiding issues with <a> tags.
Use flex to align cards' content in order to place the latest block
at the end of the card.
2017-09-15 15:04:52 +02:00
stefanorigano 2edcd1cdc0 [REF] web: remove kanban useless LESS rules 2017-09-15 15:04:52 +02:00
stefanorigano fafbc5ebe9 [REF] *: use new kanban record classes/layout 2017-09-15 14:34:18 +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
stefanorigano 3fb7842864 [REF] web, mail: minors UI fixes
- List view: sortable icon, do not force position to right
- Mail: do not vertically reposition systray's icons
- Form view: oe_subtotal_footer, minor design imp
2017-09-15 13:39:01 +02:00
stefanorigano da21b03661 [REF] base, web: adapt base settings to new design
- Use mixins and default LESS variables whenever possible
- Get rid of useless “!important” rules
2017-09-15 13:39:01 +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 031dc1d952 [REF] web: allow to perform a standalone read_group
Before this commit, asking the basic model for a 'read_group' operation
was automatically followed by other operations to read groups content
('search_read', 'read', ...). This commit introduces an option to only
perform a 'read_group'.
2017-09-14 23:48:55 +02:00
qsm-odoo 76ad4e71a5 [REF] web: do kanban group manual update before saving a record move
Before this commit, when a record was moved in a kanban view, the
model saved the record change then manually updated the related groups
(to avoid performing a read_group and reloading the whole view). This
manual update can in fact be performed before the record save. This
allows customizing the save operation in some cases where a real
read_group would be needed.
2017-09-14 23:48:55 +02:00
qsm-odoo 8b00628aa2 [REF] web: also use _confirmSave when a kanban record is 'manually' updated
Normal flow for one record's changes to be saved is:

0) (use `_setValue` for fields)
1) `trigger_up('field_changed')`
2) field manager mixin: `_onFieldChanged`
3) model: apply changes and save
4) controller: `_confirmSave`

Kanban records are using another system for an unknown reason. This
system was calling the right model functions but was not calling the
controller `_confirmSave` and was instead re-coding it. This commit
makes sure that `_confirmSave` is now called.
2017-09-14 23:48:55 +02:00
qsm-odoo 5c6a7c9ea9 [REF] web: do not update groups model ID on read_group update
Performing a 'read_group' was creating new model group data which were
saving some properties of the old model group data. As KanbanColumn
widgets may not be updated in each case where we might want to re-do
a (partial) 'read_group', this commit changes the system so that old
model group data are simply updated with the useful new group data
properties (instead of being entirely replaced).
2017-09-14 23:48:54 +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
qsm-odoo 8496a31421 [REF] web: move misplaced kanban quick create code 2017-09-14 23:48:53 +02:00
qsm-odoo 268b4a5a1d [FIX] web: fix kanban alignments
Previous implementation contained negative paddings which are not valid
values for browsers. This also prepares for the kanban progressbars.
2017-09-14 22:46:04 +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
Mitali Patel ad79fed261 [IMP] im_livechat: add copy to clipboard for the website live chat widget code
This commit adds 2 buttons to copy directly the code needed to add the livechat
in the website.
2017-09-14 10:54:00 +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
Christophe Simonis 268cf9d04a [MERGE] forward port branch saas-15 up to 127dea7f66 2017-09-13 18:45:07 +02:00