Commit Graph
117975 Commits
Author SHA1 Message Date
Géry Debongnie 611c836a46 [IMP] web: add fail fast feature to qunit test suite
With this commit, we introduce a new 'fail fast' feature to our qunit
test suite: when it is activated, the qunit test suite will immediately
stop after the first failed test.

It is accessible as a flag in the url (failfast), or by clicking the
checkbox in the UI. It is currently not activated by default.

Note that this commit also change the url for the runbot phantomjs test
in order to activate this feature.  This allows us to increase the global
timeout for the js test suite without fear!
2018-04-12 16:58:40 +02:00
dbh e6e42a1a8c [IMP] website: add new snippet option to control # of cols
Note: original work of @dbh-odoo was to have + and - buttons on the
editor overlay but specs changed to use a standard dropdown (the work
of @dbh-odoo was thus adapted for this).

See task-46094
Closes https://github.com/odoo/odoo/pull/22197
2018-04-12 16:55:36 +02:00
Martin Geubelle 96f82f65e2 [FIX] web: define XL size in config.device
In Less, the size_class XL is now defined and can be used in media-queries.
It is also added in JS for the sake of consistency.

This new size is needed for a fix in enterprise.
2018-04-12 16:41:13 +02:00
Mohammed Shekha e968c17848 [IMP] web: disable checkbox in listview if new record
It doesn't have res_id then there is no meaning to select that record and
perform operation on it.

Related to issue #1776814
2018-04-12 16:19:40 +02:00
Ivan Yelizariev cdf13bf703 [IMP] support grouping by hour 2018-04-12 16:19:40 +02:00
Martin Trigaux ad180f69c8 [REM] account: remove non-stored field from demo data
Had no effect as no inverse method is set

Reported at #24152
2018-04-12 16:13:22 +02:00
Yenthe V.G 5a853ebc51 [IMP] account_bank_statement_import: use an IBAN number for Agrolait
As Agrolait is in Belgium, use a valid IBAN to be usable in iban validation

Closes #24152
2018-04-12 15:39:54 +02:00
Jeremy Kersten 3ac4b1ab51 [FIX] website_sale[_event]: add timout for tour.
Seems like this tour crash randomly due to default 10000 ms.

This button, in some case, seems to take more than 10000ms (slow server? slow
connection ?) to validate the order (cretae invoice, generate PDF, send mail, ...)

It is a test to see if increase the timeout could decrease the risk of false
positive on the runbot.
2018-04-12 12:48:21 +02:00
Géry Debongnie 1440c8be03 [FIX] web: prevent destroyed widget from calling start
Whenever a widget is destroyed, it should be as inactive as possible.
Before this commit, it could happen that a widget was destroyed after
the willstart method, but before the start method. In that case, bad
things could happen.

For example, the discuss client action tries to look up some information
into the session, with the getSession method. This causes a crash
whenever the widget is destroyed.
2018-04-12 12:11:55 +02:00
Géry Debongnie 5dbb2fc834 [IMP] web: add fail fast feature to qunit test suite
With this commit, we introduce a new 'fail fast' feature to our qunit
test suite: when it is activated, the qunit test suite will immediately
stop after the first failed test.

It is accessible as a flag in the url (failfast), or by clicking the
checkbox in the UI. It is currently not activated by default.

Note that this commit also change the url for the runbot phantomjs test
in order to activate this feature.  This allows us to increase the global
timeout for the js test suite without fear!
2018-04-12 12:11:55 +02:00
Géry Debongnie 52f0f21ada [FIX] web: prevent race condition with client actions
Here is the issue that initiated this work: the bank reconciliation tour
sometimes failed in community.  The reason was that the discuss client
action seemed to be loaded after the tour started, and interfered with
the second step of the tour.

What happened exactly was the following:
- web client is loaded
- initial action is starting (but not complete) (this is discuss)
- tour manager is loaded and starts the reconciliation tour
- the reconciliation tour changes the url to trigger an hash change
- the web client calls loadState on the action manager
- the action manager perform a doAction with the tour url
- the discuss client action is now ready, and replace the reconciliation
  action
- the tour is broken.

The underlying cause is really a generic problem: the action manager
does not add the client action starting process in its 'dropprevious'
concurrency primitive.  This is probably not really an issue for the
act_window actions, since they have custom loading code that make sure
the loading process is put in the drop previous, but it is definitely a
problem for all client actions.

The solution is quite simple, and should also protect the act window
renderers: put the action controller in the drop previous
2018-04-12 12:11:55 +02:00
Goffin Simon 9bf1f97d9b [FIX] sale: Translation issue on T&C on Invoices
The sale_note field is translated according to the language of the customer in a SO.
This fix applies the same behavior on the customer invoice.
Inspired from this commit: 978b8f64ec

opw:1830838
2018-04-12 11:57:29 +02:00
Géry Debongnie 2f16d6bfe3 [FIX] web: prevent destroyed widget from calling start
Whenever a widget is destroyed, it should be as inactive as possible.
Before this commit, it could happen that a widget was destroyed after
the willstart method, but before the start method. In that case, bad
things could happen.

For example, the discuss client action tries to look up some information
into the session, with the getSession method. This causes a crash
whenever the widget is destroyed.
2018-04-12 11:27:20 +02:00
Géry Debongnie 473edda86e [IMP] web: add fail fast feature to qunit test suite
With this commit, we introduce a new 'fail fast' feature to our qunit
test suite: when it is activated, the qunit test suite will immediately
stop after the first failed test.

It is accessible as a flag in the url (failfast), or by clicking the
checkbox in the UI. It is currently not activated by default.

Note that this commit also change the url for the runbot phantomjs test
in order to activate this feature.  This allows us to increase the global
timeout for the js test suite without fear!
2018-04-12 11:27:15 +02:00
Géry Debongnie d5f6d1eb4a [FIX] web: prevent race condition with client actions
Here is the issue that initiated this work: the bank reconciliation tour
sometimes failed in community.  The reason was that the discuss client
action seemed to be loaded after the tour started, and interfered with
the second step of the tour.

What happened exactly was the following:
- web client is loaded
- initial action is starting (but not complete) (this is discuss)
- tour manager is loaded and starts the reconciliation tour
- the reconciliation tour changes the url to trigger an hash change
- the web client calls loadState on the action manager
- the action manager perform a doAction with the tour url
- the discuss client action is now ready, and replace the reconciliation
  action
- the tour is broken.

The underlying cause is really a generic problem: the action manager
does not add the client action starting process in its 'dropprevious'
concurrency primitive.  This is probably not really an issue for the
act_window actions, since they have custom loading code that make sure
the loading process is put in the drop previous, but it is definitely a
problem for all client actions.

The solution is quite simple, and should also protect the act window
renderers: put the action controller in the drop previous
2018-04-12 11:25:31 +02:00
Florent de Labarre 771e44e5f9 [FIX] base_iban : iban is never pretty formatted
Was PR #24172. Courtesy of Florent de Labarre
2018-04-12 11:25:23 +02:00
Adrien Dieudonne 8c0b23c239 [FIX] mrp: quick create bom on new mo
Before this commit, an error was raised when you tried to create a
new bill of material on a new manufacturing order.
In fact, the name_create RPC returned 'false' and slow_create()
wasn't executed.

By adding _rec_name (as in 10.0) on the corresponding model, the RPC
call will raise an error that will be caught by quick_create and
forces slow_create().

Closes #9761
2018-04-12 11:24:54 +02:00
Vincent Schippefilt d5f1157220 [FIX] web: keyboard navigation in kanban skips empty columns
Before this fix, when navigating with LEFT and RIGHT keys on a grouped
kanban view, if there were empty columns in the direction of the
navigation, the focus did not change to the next column.
After this fix, the navigation left and right ignore empty columns and
jump to the first non-empty column.
2018-04-12 11:08:54 +02:00
Vincent Schippefilt bf7dfa45c8 [FIX] web: fix scroll on list and kanban when using keyboard navigation
Before this fix, list view and kanban views are scrolling every time
the user uses the up and down keys.
After this fix the list and kanban views will only scroll when the user
arrives at the boder of the window
2018-04-12 11:08:54 +02:00
Nicolas Lempereur 2b380e4e39 [FIX] web_editor: indent just a line inside table
Inside the cell of a table, indenting had several behaviors:

- if the selection is contained in several nodes elements: indent the
  element child nodes of common ancestor

- if the selection is contained in one or more list items: indent these
  list items

- if the selection is contained in one 'content block': indent the whole
  cell content

The two first behaviors are expected, but the third one is a little odd
and unexpected next to other existing editors behaviors.

With this commit, the third behavior becomes:

- if the selection is contained in one `content block`: indent this
  content block

note: 'content block' is defined as p, pre, h1, h2, ..., blockquote, td

opw-1824647
closes #24182
2018-04-12 10:10:05 +02:00
len-odoo 184f47443e [FIX] website_project: add website_url field to project.project
The website_url wasn't defined on the project.project model.
However the website pager expected this field to be defined on every model it
worked on.
Without it, the webite frontend would throw an error 500 while trying to access
this field.
Note that the website_rating_project_issue would add this field anyway to
project.project by making it inherit website.published.mixin. The bug would thus
only appear if this module was not installed.

opw 1832994
2018-04-12 09:04:50 +02:00
stefanorigano 6fb59b2337 [IMP] mail: followup of 2157540768
Properly change the color of the note using variables and avoid getting
50 shades of grey in the less variables.

Increase a bit the border bottom to mark the difference.

The note vs message rendering should still probably be improved as changign the
background is a bit confusing but in the meantime, the difference is visual
enough.
2018-04-12 01:25:00 +02:00
celm1990 2157540768 [FIX] point_of_sale: set the payment date based on TZ
If a user is in an early timezone (e.g. UTC-5), an order made on the
...-01 19:15:00 or, converted to UTC, as ...-02 00:15:00
fields.Date.today() returns the days ...-02 instead of ...-01
Use context_today to convert in the right timezone.

This slightly change the return format of _payment_fields to return a date
instead of a datetime.

Followup of 7272abe0e3 that was adding the timezone in the context

Closes #22651
2018-04-12 01:17:47 +02:00
Rémi Rahir fe7b9ab709 [FIX] sale: missing field in quotation report
Before this commit, the field validity_date was missing from the
default quotation report. Historically this field was added in
module website_quote but it was then moved to sale in
77bd5181f7

The modification on the quotation report related to validity_date
were missed at that time.

This commit adds validity_date to the default quotation report.
2018-04-12 15:04:47 +02:00
Nicolas Martinelli 7242544506 [FIX] base_import: activate advanced mode
The commit 1ba4fbe640 did not match the specs of the task, but
was merged anyway. Reverting the commit, and check by default so the
user is not confused with missing fields.

opw-1824074
2018-04-12 14:54:25 +02:00
Aaron Bohy 9c1c2c55c2 [FIX] web: one2many: add new record with 'Save & New'
Consider the following scenario involving a one2many list (non
editable) inside a form view:
 - click on 'Add an item', a model opens,
 - fill the fields and click on 'Save & Close',
 - reopen the freshly created record,
 - maybe make some changes (this is optional, but makes sense),
 - click on 'Save & New',
 - fill the fields and click on 'Save & Close',
 -> the second created record isn't added to the list.

The problem comes from the fact that when the dialog is opened for
the second time (in this case by clicking on a record), the 'save'
handler registers an 'UPDATE' command. While this is correct for
the 'Save & New' click (as we update an existing record), this
isn't for the second record which doesn't exist yet, and thus
requires an 'ADD' command.

This rev. ensures that the two cases are handled in the 'save'
handler given to the dialog.

OPW 1829723
2018-04-12 14:37:35 +02:00
Nicolas Martinelli 9353fa1ede [FIX] stock: trigger warning
Do not trigger warning if `qty_done` is not yet set, since it is
automatically set to 1.0 in `onchange_serial_number`.
2018-04-12 13:55:10 +02:00
Nicolas Martinelli dc5dfa0430 [FIX] stock: S/N in mobile view
In mobile view, it is impossible to add serial numbers on pickings,
because the button is not on the kanban view.

opw-1816837
2018-04-12 13:55:10 +02:00
Martin Trigaux 43e0518833 [FIX] mail: restore pre v11 note color
The gray-lighter was modified at 88881e9f to make it lighter (#F9F9 instead of
Restore the previous grey and increase contrast.

To quote "The Non-Designer's Design Book by Robin Williams":

> Contrast is created when two elements are different. If the two elements are
> sort of different, but not really, then you don't have contrast, you have
> conflict. That's the key–the principle of contrast states that if two items
> are not exactly the same, then make them different. Really different.

opw-1835722
2018-04-12 13:34:00 +02:00
Lucas Perais (lpe) 7b49f5836c [FIX] account: partner's fiscal position chosen within its company
Before this commit, a partner in a company could have a fiscal position belonging
to another company
Namely, the search view on the field property account position displayed every fiscal position

This could create problems afterwards, when managing an invoice from a restricted rights user
(with an access right error raising)

After this commit, we soflty constrain the choice of the fiscal position to the ones
belonging to the same company of the partner

OPW 1833848
OPW 1827831
closes #24056
2018-04-12 11:10:51 +02:00
Lucas Perais (lpe) 0b1b860d97 [FIX] stock_account: display to_refund on return picking as toggle
When clicking on a stock.picking form
a modal appeared,

Before this commit a checkbox on the lines was present to update the PO
Since one needed to click on span to put the line in edit mode and edit the boolean
It seemed that the boolean was not editable.

After this commit, we add the toggle_boolean widget to handle the field
It is interactive even if the line is not in edit mode.

OPW 1818700
closes #24138
2018-04-12 11:04:21 +02:00
Martin Geubelle 729ff2d35e [FIX] web: update column in grouped kanban
In a kanban grouped by many2one with a progressbar, after emptying a column
by moving all records, the column wasn't correctly updated. This was causing,
in the best case, a record duplication or, in the worst case, a traceback.

This issue comes from the fact that, with a progressbar, a read_group is
performed each time a record is moved. When the group (column) becomes empty,
the read_group won't return this group even though the group still appears in
the kankan. When moving back the record in this empty column, there is a
desynchronization between the kanban controller data and the model.

To fix this issue, an option `keepEmptyGroups` is passed when performing the
mentioned read_group ; this mimics the kanban display that keeps empty groups
displayed and there is no desync anymore.

Fixes #23982
2018-04-12 10:10:08 +02:00
Joren Van Onder eb84a30999 [FIX] pos_mercury: don't lose credit card info
Due to historical reasons the amount on a statement line is used to
find it again so the credit card information can be added to it.

Doing a search directly on 'amount' will fail in rare cases when
the currency rounding doesn't result in a float with the same amount
of decimals as the rounding specifies. E.g.:

>>> currency = env['res.currency'].browse(3)
>>> currency.rounding
0.01
>>> currency.round(74.85000000000001)
74.85000000000001

When that happens the credit card information is not saved in the
backend. To avoid this we do the float comparison properly with
float_compare afterwards.

PS. Ideally the logic in add_payment should be moved to an override of
_prepare_bank_statement_line_payment_values. This way we wouldn't have
to do these awkward things to find the statement line. But this
approach is not suited for a stable release.

opw-1832156
2018-04-11 14:30:08 -07:00
Jeremy Kersten 73425edfe9 [FIX] website_sale_wishlist: remove wait in tour
Don't wait 1 sec by step for pleasure, correct trigger/extra_trigger
make it useless.
2018-04-11 20:59:51 +02:00
Valentin Löfberg 80029cae36 [FIX] website_sale_wishlist: allow deletion of wishlist item when not connected
Add controller to remove (archive) an item from the wishlist.
Rpc cannot be used because user can be public

Adding tour test

task-1834888
This commit closes #24135
2018-04-11 20:54:55 +02:00
Martin Trigaux 8b8815f44c [FIX] http_routing: translate without website
web (tagged with `openerp-web`) translations are loaded in the backend, in
`odoo.addons.web.controllers.main.WebClient.translation(mods=None, lang=None)`
method (through `/web/webclient/translations` controller).

In website, the controller `/website/translations` is called used, fetching
the translations from modules with the (fragile) clause `name ilike 'website'`

This commit fixes two bugs:

1. Install `website_sale`, activate discussion on products
  -> the chatter is not translated as the portal translations not loaded in the
     `/website/translations` controller

2. Install `helpdesk` but not `website`, go to portal view of a ticket
   -> the heldesk chatter is not translated as the `/website/translations`
      controller is not called (only provided by the website module)

This patch implements a modular approach to translate the web resources of the
right modules only.

The controller /website/translation is moved to http_routing and each module
override the new _get_translation_frontend_modules_domain method to adds its
translatable module

Closes #23618
Fixes #23610
2018-04-11 16:55:14 +02:00
Christophe Monniez 6527b69ee0 [FIX] web: increase timeout of test suite
As the test suite increases, the timeout has to follow until a better
solution is found (like a fail fast in Qunit).
2018-04-11 16:51:43 +02:00
Martin Trigaux 7272abe0e3 [FIX] point_of_sale: create orders with the correct context
The timezone of the user was not passed and preventing the use of context_today
as showed at #22651
2018-04-11 16:31:34 +02:00
Martin Trigaux fcd81acaea [FIX] l10n_ch: remove hardcoded translations
These translations were for the first company only ('1_' part)
The process_translation part in l10n_multilang is enough to propagate the
translations of the templates to the accounts
2018-04-11 16:19:41 +02:00
Martin Trigaux ea747d23e4 [IMP] l10n_ch: translate CoA in de and de_CH
de_CH was not available before, people migrating will not get their CoA
translated.
Rename the translation file so it is loaded by any de_* language
Add multiple spoken_languages to be sure to load each one via the
process_translation mechanism.

Fixes #24037
2018-04-11 16:19:37 +02:00
jem-odoo c9098db40b [FIX] sale_timesheet: non billable task from plan project
We want to retrieve easily the non billable task from
project plan. This commit makes the "Non billable" label
clickable, in the "Hours" sections, and trigger the actions
to display non billable tasks of projects matching the search
of the overview.

Task #1834454
2018-04-11 16:19:13 +02:00
jem-odoo 99ce19c7f3 [FIX] sale_timesheet: multi UoM on plan project
You can sell services in days, and your timesheet will
be expressed in hours. But on project plan, UoM conversion
is not supported and in some calculation, we are mixing
appels and oranges.
This commit fixes this issue.
2018-04-11 16:19:06 +02:00
Martin Geubelle 0d46c0b91d [FIX] web: correctly position carret in list
In list view, the carret was not correctly positioned in empty cells (i.e.
handle widget in readonly).

This rev. ensures that the position rules are only applied if the cell is not
empty.

Fixes #23984
2018-04-11 15:54:06 +02:00
Jairo Llopis 30aa75329c [FIX] website_form: Disable form send on editable mode
Before this patch, when a user was editing a website page containing a form
and he clicked "Send", for some reason, the form tried to be sent.

Now, the button behavior is disabled when entering editable mode.

Closes #23852
2018-04-11 15:45:47 +02:00
stefanorigano b3ad32f45b [FIX] web: fixes some design alignements
- Use 'baseline' to ensure that the priority icon will align to the
  parent's baseline
- Align the favorite icon in dashboards
- Align the statusbar's caret in form views
2018-04-11 15:36:11 +02:00
Arnold Moyaux c04119fc4f [FIX] purchase : be able to use it with MPS
Since procurement group is passed by the optional values
in the procurement proccess it should be considered as optional

MPS do not use procurement group because they will add the
planification in an existing RFQ it will fail because purchase search
for the key 'group_id' in values

opw-1833060
2018-04-11 15:09:59 +02:00
qsm-odoo ad46adcfc7 [FIX] web: stop wrapping kanban counter over multiple lines
Note: this should normally not be the case by design as for most
values there is enough space for the numbers not to wrap. While
waiting for a better implementation, the white-space:nowrap CSS
rule will enforce the behavior.

Thank you to @Jerther for the original commit.

Closes https://github.com/odoo/odoo/pull/24100
2018-04-11 15:04:40 +02:00
Romain Derie c09b89596e [FIX] website: keep query strings when redirecting 'website.' page
Urls like `/page/website.XXX` are redirected to `/page/XXX`.

Before this commit, the redirection would not keep query strings:
`/page/website.XXX?rde=1` would redirect to `/page/XXX`.

Now, we keep the query strings:
`/page/website.XXX?rde=1` will redirect to `/page/XXX?rde=1`

Closes #24140

Courtesy of @MTantin
2018-04-11 15:04:24 +02:00
Romain Derie 474f6cfdd8 [FIX] web_editor: changes lost on forward port of 744af2db
Fix of 744af2db that got lost during forward port, this is just rewriting the
diff for the new widget syntax.
2018-04-11 15:02:11 +02:00
Alexandre Kühn ea25036c14 [FIX] web: graph rendering when in DOM
Backported fixes:

    1. [IMP] web: GraphView: remove hack to render in DOM

        - ref. 166319fa4a
        - fully backported.

This commit backports the fix that removes the hack for rendering graphs
(delay in a setTimeout), so that the graph is rendered when it is in the DOM.

    2. [IMP] web: restore scroll position

        - ref. 4e204ed223
        - partially backported: only keeps `on_attach_callback`
          and `on_detach_callback` in the abstract_controller
          and in the abstract_renderer.

This commit backports the use of the hooks methods `on_attach_callback` and
`on_detach_callback` in abstract controller and renderer, so that the
controller of any view warns the renderer when it has been attached in
(or detach from) the DOM.

Also, this commit adds `on_attach_callback` and `on_detach_callback` for the
dashboard app, so that the graph view is correctly rendered.

Fixes #24092
2018-04-11 14:52:56 +02:00