Commit Graph
7381 Commits
Author SHA1 Message Date
fwi-odoo 5bd0318594 [FIX] web: use the default library behaviour
The library reset the time set when the date is changed.
Then it was not possible to set the time then set the date
and expect the widget to close since the time will be reset
to the default value.
Instead we use the library behaviour and add a 'close' button
for the datetime widgets.
2017-02-08 12:53:34 +01:00
fwi-odoo 64a0ece649 [FIX] web: simplify the datepicker template
The library needs to have a 'relative' positioned parent to place
the datetimepicker correctly.
We don't do that in the template
anymore because it was not working in all the cases.
The template which instantiates the datepicker should define
a parent in position 'relative'.
2017-02-07 15:42:25 +01:00
qsm-odoo 495b5ef117 [IMP] web: add options to field selector to filter the fields
Before this commit, the field selector had an unique option to filter
the fields it displays: filters.searchable, which tells the widget to
only display the searchable fields (which is the default). Now there
are two more options:

- fields: an explicit list of the fields to use (if null, let the
    widget get the fields itself (this is the default))
- followRelations: a boolean which is true if the user can follow
    relation to build a field chain (default to true)

These options are needed by Web Studio in enterprise where domain
construction for form view attrs can only use fields which are in the
view and do not follow relations.
2017-01-31 11:38:52 +01:00
qsm-odoo 3c452a2ecd [FIX] web: document domain selector options correctly
The "ModelFieldSelector" widget has a "filters" option which can
customize the fields which are displayed.

The "DomainSelector" widget has of course the same option it can
transmit to its internal "ModelFieldSelector" instance... but it
was documented as "fs_filters" instead of "filters".

Also, let the "ModelFieldSelector" document its own options and
sets their defaults (instead of the "DomainSelector" widget).
2017-01-31 11:38:46 +01:00
fwi-odoo 89093a1695 [IMP] web: various imp for the datetimepicker widget
* toggle datetimepicker when field is clicked
* close datetimepicker when a date is chosen
* disable keyboard navigation in the widget to allow modification of input
2017-01-30 10:29:32 +01:00
fwi-odoo ad6fd5f838 [REF] web: update bootstrap-datetimepicker lib and adapt datepicker widget
from 3.0.3 to 4.17.42
2017-01-30 10:29:27 +01:00
fwi-odoo c5af1d215f [REF] web: update momentjs lib
From 2.8.1 to 2.9.0
2017-01-30 10:29:21 +01:00
Christophe Simonis fded0065ae [MERGE] forward port branch saas-14 up to 6c4389df41 2017-01-23 14:51:11 +01:00
Christophe Simonis 6c4389df41 [MERGE] forward port branch 10.0 up to 6804085b8c 2017-01-23 14:33:53 +01:00
Christophe Simonis 6804085b8c [MERGE] forward port branch saas-11 up to b9374d5c21 2017-01-23 13:56:18 +01:00
Christophe Simonis b9374d5c21 [MERGE] forward port branch 9.0 up to 0997a1cf6d 2017-01-23 13:39:09 +01:00
Nicolas Lempereur b9db65aa73 [FIX] web: display warning message for o2m modal
Be a little less strict when not showing o2m list view warning so if the
o2m is not editable (a modal is open instead of editing inline) we still
show warnings.

Also have warnings over modal overlays so they can be used for modals.

opw-702333
2017-01-19 16:46:33 +01:00
Nicolas Lempereur 734d9b56da [FIX] web: conserve /id for saved export list
With 003d85b instead of getting the name of the relation
field_relation we get field_relation/id.

But the data about the related fields are not gotten all at once when
opening the export modal. They are gotten by clicking on the arrow of
the related record.

So we need to have these /id information saved in the export list,
otherwise for example the related records can be missing when exporting
from an export list, whilst everything was OK without using the saved
export list.

With the previous change, an export list could contain an id and .id
fields for the same relational field, so a change must also be done in
fields_info method used when getting a saved list.

opw-665994
opw-693535

note: adapted forward-port of 8.0's 29be9ae80 which was lost when
merging web enterprise onto web community.
2017-01-19 16:24:53 +01:00
Nicolas Martinelli 4cb94c9019 [FIX] web: date < 01-01-1900
The Python method `strftime` raises an error when the date is older than
01-01-1900 ("The datetime strftime() methods require year >= 1900"). If
the user mistyped the date (or was expecting 01-01-16 to be converted
into 01-01-2016), this can lead errors since the ORM uses this method
frequently.

opw-702313
2017-01-19 10:13:51 +01:00
Nicolas Martinelli 94f7f6aa22 [FIX] web: date < 01-01-1900
The Python method `strftime` raises an error when the date is older than
01-01-1900 ("The datetime strftime() methods require year >= 1900"). If
the user mistyped the date (or was expecting 01-01-16 to be converted
into 01-01-2016), this can lead errors since the ORM uses this method
frequently.

opw-702313
2017-01-19 09:52:44 +01:00
Fabien Pinckaers cb90aeade6 [IMP] web: pie chart with a percentage label 2017-01-18 15:43:12 -08:00
Christophe Simonis f0a5618e61 [MERGE] forward port branch saas-11 up to 6169018c33 2017-01-18 16:21:55 +01:00
Nicolas Lempereur 2d753ab5ec [FIX] web: handle widget order and custom sequence
An editable list can be drag-and-drop sorted by:

- displaying a sequence field,
- displaying a field with the `handle` widget

At first it was only working if the list was not specifically ordered,
but with 26bf35260 it also worked if the list was ordered on `sequence`
or `sequence ASC`.

This commit changes this so it works:

- if the list is not ordered (same as the original intention),
- if the list is ordered by the sequence field (widget `handle` or sequence)

This allows to have a custom model (on which we can't define _order) to be
ordered on a custom field.

This also remove a far-fetched oddity such as having the view ordered by
sequence but having a custom sequence field before `sequence`.

opw-704612
2017-01-18 14:30:57 +01:00
qsm-odoo 1d3472b9d6 [FIX] web: better align domain selector elements
Mixing the use of btn-xs and btn-sm was not good for design.
This commit use btn-xs for "add a filter" and "edit domain"
buttons to improve elements alignment.
2017-01-12 13:37:10 +01:00
qsm-odoo 241f778e22 [FIX] web: allow empty domain value with the in_dialog option
The "in_dialog" option of the domain field was not working correctly
when the field value was falsy as it did not consider it to be
"[]" in that case (as it is done without the "in_dialog" option).

Same goes for the dialog which displays the matched records.
2017-01-12 13:37:10 +01:00
qsm-odoo d9c7c30856 [FIX] web: handle the case of a field domain without set model
Some domain fields are initialized with a model which depends of another
form field value. Sometimes, this value is False and the domain selector
cannot be used during that time (and was even performing useless RPC).

Now, in this case, the field domain is fully replaced by a message
which explains that a model have to be set. If you don't want this
message to be shown, you still have the possibility to not show the
field domain when there is no model thanks to the "invisible" attrs.
2017-01-12 13:37:10 +01:00
Fabien Meghazi 402379a48a [IMP] Remove arbitrary file upload limit (25Mb) and turn it to an option (Fixes #14824)
The hard coded limit dates back to a time where the browsers would crash
when using FileReader#readAsDataURL() on files of serveral dozens of Mb.
This limit is now obsolete and even IE Edge now supports the FileReader
api.

This commit removes the limit and turns it into an option so it's
possible to limit a particular binary field to a given amount from the
form views, eg:

    <field name="image" widget="image" options='{"max_file_size": "200k"}'/>

Note: this feature only works when the FileReader api is available.
      At time of writing, all major browsers supports this feature:
      http://caniuse.com/#search=FileReader
2017-01-12 10:50:14 +01:00
qsm-odoo 289b7cb41c [FIX] web: always create a new group on "..." domain button click
Before this commit, you had to avoid to click on the "..." icon inside
the button to have it have the right behavior.
2017-01-11 11:08:13 +01:00
Christophe Simonis a2c1df8b9c [MERGE] forward port branch saas-14 up to 557feb950c 2017-01-10 13:52:44 +01:00
Christophe Simonis 557feb950c [MERGE] forward port branch 10.0 up to 482fd04167 2017-01-10 13:50:48 +01:00
Christophe Simonis 482fd04167 [MERGE] forward port branch saas-11 up to f1583504ce 2017-01-10 13:46:17 +01:00
Christophe Simonis f1583504ce [MERGE] forward port branch 9.0 up to 3f7b1f6083 2017-01-10 12:07:44 +01:00
Yannick Tivisse 43fcbe3318 [IMP] web: allow to upload multiple files in many2many_binary widget 2017-01-09 16:37:16 +01:00
Nicolas Lempereur d40edd7052 [FIX] web: wraparound no create editable list
In e0c4ec54ca a change was done to improve the behavior in some
editable list instances, but this introduced a small issue for
list with line creation disabled.

With this change, doing tab or enter at last line should keep the
previous behavior of wrapping around and not creating a new line.

opw-703748
2017-01-09 15:03:29 +01:00
Aaron Bohy 5936356603 [FIX] web: Apply autofocus on form views opened in dialogs
Purpose:
========

When user opens a wizard , the cursor should be placed in the first field which saves a click for the user.
Right now , in odoo the cursor is not coming in the first field by default.
2017-01-09 13:21:52 +01:00
Christophe Simonis 98c71b23d3 [MERGE] forward port branch saas-11 up to 9073ecb6f5 2017-01-06 18:06:14 +01:00
Christophe Simonis de6aaeb546 [MERGE] forward port branch 9.0 up to e0d33ce07d 2017-01-06 17:37:33 +01:00
qsm-odoo 11a4e17c9c [IMP] web: add a dialog option to the FieldDomain
Now, the form FieldDomain has an option "dialog" which allows to force
the domain *edition* in a new dialog. This allows the field to be
positioned in smaller area of the form view in some contexts.
2017-01-06 16:03:09 +01:00
qsm-odoo f64c1c6b74 [IMP] web: FieldDomain panel at top right instead of below
The FieldDomain is composed of a DomainSelector widget and a button
which allows to see the records which match the domain (or an error
message if the domain is wrong).
The button was placed below the domain selector. Now, in edit mode,
it is placed at the top-right of the domain selector, saving some
vertical space.
2017-01-06 16:03:09 +01:00
qsm-odoo 20b109fac9 [IMP] web: add new DomainSelectorDialog dialog widget
The DomainSelectorDialog widget allows the use of a DomainSelector
widget inside a modal.
2017-01-06 16:03:09 +01:00
qsm-odoo b8eb821f13 [IMP] web: allow DomainSelector widget to be instanciated with a string
Before this commit, the DomainSelector had to be instanciated with an
array-typed value which forced the user to use (and import) the pyeval
module. Now, the conversion to array is done in the DomainSelector.

This commit introduces a web.domainUtils module allowing to do the
convertion array -> string and string -> array of a domain.
2017-01-06 16:03:09 +01:00
Nicolas Lempereur 4cec6fa77e [FIX] point_of_sale,web: stupid amend before merge
Introduced by 07bf7bf4f3.
2017-01-06 14:24:59 +01:00
Nicolas Lempereur 07bf7bf4f3 [FIX] odoo-bin: server UTC timezone on windows
On UNIX, the timezone modules conversions can be reset by using
`time.tzset()`. On windows this is not available and the timezone (TZ)
environment variable must be set before the first import of time module.

If not, all datetime gotten in python without specifying UTC (such as
datetime.datetime.now) could be wrong.

This was fixed with 4a77c6a0 in 2013, but has come back since 389c2ba97b
imported pkg_resources (which do  a `time` module import) before that.

closes #14926
opw-693764
2017-01-06 14:19:09 +01:00
Nicolas Lempereur 678c42aeb0 [FIX] web: FieldCharDomain wrong count if other lang
The number of records selected by a FieldCharDomain was only computed
with the base language.

But when selecting the domain with a modal window, or when sending a
mass mailing restricted to a domain, the current user language is used.

With this commit, the number of records is computed with the current
user language.

opw-693836
2017-01-05 19:18:06 +01:00
Nicolas Martinelli 35b79e30b2 [FIX] web: select completion no result
When a search is performed and the completion feature is used (search on
a many2one field), clicking on a '(no result)' item causes a crash.

opw-703557
2017-01-05 13:45:06 +01:00
Christophe Simonis ca475e08eb [MERGE] forward port branch 10.0 up to 799e7f7740 2017-01-04 19:43:24 +01:00
qsm-odoo e3f99885ca [IMP] web, *: add new Domain and Field selection widgets
* base_action_rule, gamification, mass_mailing

1) Create the independant DomainSelector widget

- Allow to build a prefix char domain

2) Replace old FieldCharDomain with a new FieldDomain which uses the
   new DomainSelector widget

3) Create the independant ModelFieldSelector widget

- Allow to build a valid field chain for a specific model
  (e.g 'partner_id.name' for a 'res.users')
- Used by DomainSelector widget

---

The DomainSelector widget uses a tree-like representation with
user-friendly buttons (ALL/ANY/+/-/...). Any domain can be built,
except those containing the "!" (not) operator or some operators
like "like", "child_of" (@see DomainSelector). However, if the
user enters these in the debug input, the widget can handle them.

Note: these widgets had to do unusual stuff the widget API does not
allow to handle efficiently right now but it will be adapted to the
new widget/field API in a further update.

Note2: the widgets also have possibility of other improvements like
supporting m2o input instantiation in DomainLeaf, etc.

---

This work is an adaptation of the original code made by @pga-odoo.
2017-01-03 18:38:03 +01:00
Raphael Collet d0ca2d115e [REF] ir_config_parameter: remove group_ids and simplify
Add `sudo()` to call `get_param` where necessary, and make the web client use a
controller instead of directly accessing parameters.
2017-01-03 16:52:49 +01:00
hbh 8cfd857b82 [IMP] web: set right alignment for float values on grouped records 2017-01-03 13:53:30 +01:00
Nicolas Lempereur a988653157 [FIX] web: error if chart with only zero values
We could get an js error if the chart contained zero values.

opw-703245
2017-01-02 17:31:06 +01:00
Leonardo Rochael Almeida 47536a3f7d [IMP] web: allows styling of the pager counters
Before this commit, the pager counters and buttons were at the same
level, and could not be styled independently (with some rules such as
nowrap).

Close PR #14865
2017-01-02 09:06:57 +01:00
qdp-odoo 4f29b77e3d [MERGE] foward port of 10.0 up to revision 84a650e33a 2016-12-30 17:21:25 +01:00
qdp-odoo 4dd27bba34 [REF] base: enhance inheritability
split fields_view_get() and used an abstact mixin class in place of of FormatAddress

[IMP] base: added a m2o field (ir.ui.view) on res.country to decide the layout of the form view to input addresses.
2016-12-28 11:20:47 +01:00
kujiu (@angua.kujiu.org) d8afc7e833 [ADD] web: Add less classes to be used in the new settings form views 2016-12-27 17:09:20 +01:00
Nicolas Martinelli bb2a948216 [FIX] web: y-axis width in graph view
Simplifies the left margin calculation logic with a pre-defined width.
In practice, more use cases should be taken into account, and that could
just make the logic overkill.

opw-697626
2016-12-22 16:14:34 +01:00