Commit Graph
114825 Commits
Author SHA1 Message Date
Nicolas Lempereur 1c5bb8564b [FIX] web_editor: regression less editor 5af122387
In 5af12238 a change was made to have the correct hierarchy levels, but
this can cause an issue when editing less files.

This is because we now had "undefined + 1" which gives NaN which breaks
Array constructor.

opw-814579
opw-815397
opw-814322
opw-815265
opw-814021
closes #23006
2018-02-12 11:57:39 +01:00
Aaron Bohy 11dff2b05c [FIX] web: ListView: format footer values
Before this rev., the aggregates values displayed in the footer of
list views were formatted according to the field type, and the
field's widget was ignored, whereas it should be used by default.
For instance, if the 'float_time' widget is set on a float field,
the sum should be formatted as FloatTime as well.

Closes #22724.
2018-02-12 11:11:43 +01:00
Aaron Bohy 0982ceaa37 [FIX] web: ListView: reset selection when reloading
Before this rev., the list of selected records wasn't correctly
reset when the list was reloaded (e.g. when coming back using the
breadcrumbs). In the UI, the records weren't selected anymore, but
in javascript, the list of selected records wasn't empty. As a
consequence, the aggregates were wrongly computed, and always
displayed 0.

Closes #22725.
2018-02-12 11:11:43 +01:00
Lucas Perais (lpe) b6d156ad7a [FIX] web_planner: take 'view_type' of action into account
Before this commit, when a planner made a link from an action, the view_type was always 'list'
This prevented the view from being properly loaded, as an action of view_type form wouldn't be recognized

After this commit, such links are well formed, and form view_type actions are correctly loaded

OPW 806758
2018-02-12 11:05:30 +01:00
Géry Debongnie e0cb522bf2 [FIX] web: update form widgets when state has changed
Since the <widget> tag is not used anymore in any of our views, it was
not really properly supported. In particular, the form widget was not
notified when the state of the form view has changed, which makes it
very difficult to actually do any useful work.

With this commit, we make sure that the widget method 'updateState' (if
it exists) is called with the new state whenever it changed.

This should allow developers to do useful work without having to work
around the issue. Note that this is not really a perfect solution, since
the updateState methot may or may not have been implemented.

I think that we need some kind of ViewWidget abstraction, which could be
used to have a better and more complete API for widgets in a basic view.
And AbstractField could inherit from ViewWidget.
2018-02-12 10:35:54 +01:00
Raphael Collet 9e6bc391be [FIX] stock: workaround to make dp work in tests 2018-02-12 10:28:59 +01:00
Rémi Rahir 8b9bcf1b7e [FIX] crm_phone_validation: fix lead phone validation
Fixes country_id and company_id mismatch in 65832dc.

Removes the view added by said commit as it was not a true stable
fix since it required users to update the module.

This commit uses a workaround to get the missing company_id field
which is monkey-patching the fields_view_get of the model, as
suggested by rco.

This commit also removes the exception catches that were rendered
useless by the False value given to the raise_exception parameter
of phone_format, introduced in 65832dc as well.

This commits fixes the behaviour in the website form as the phone
numbers were sanitized but never saved as such on their record.

This commit also renames the Phone Validation config setting to
suit its true functionality.
2018-02-12 09:16:17 +01:00
Odoo Translation Bot 26468bfaba [I18N] Update translation terms from Transifex 2018-02-11 04:26:28 +01:00
qdp-odoo 2aabdc00c3 [FIX] account: allow XML-RPC call to action_validate_invoice_payment on account.payment.
The method was returning no value (~None) which then blown up when serialised back to XMLRPC. Fixes #22630
2018-02-09 17:29:56 +01:00
Aaron Bohy 20e4cd5bcd [FIX] web: field widget with readonly modifier
Rev. dbdd742 introduced the 'baseMode' parameter of field's nodes
in the BasicRenderer. Its purpose is to encode the generic mode
of the field, regardless of its readonly modifier (i.e. in form
views, the baseMode of all fields is the mode of the renderer and
in list views, the baseMode of all fields is 'readonly', except for
fields in the row being edited, whose baseMode is 'edit').

Unfortunately, when the value of the readonly modifier of a field
was 'readonly', its baseMode was changed from 'edit' to 'readonly',
which shouldn't, as the baseMode's value should not be affected by
the modifiers.

This produced a bug when a field had a readonly modifier, as once
its value became true, the field was rendered in 'readonly', and
whatever the value of the modifier afterwards, it always remained
in 'readonly'.

The rev. ensures that the baseMode is no longer impacted by the
value of the readonly modifier.

Closes #22729
2018-02-09 15:36:14 +01:00
Christophe Simonis 4b43803dc6 [MERGE] forward port branch saas-16 up to e2ae51c4b0 2018-02-09 15:02:31 +01:00
Lucas Perais (lpe) e67d6f85c3 [FIX] account: event on onFilterChange
Before this commit, on the reconciliation widget in Firefox
filtering lines through the input triggered a Traceback
This was due to the use of the absence of a defined "event" parameter on the handler

After this commit, filtering does work as expected

opw 813791
2018-02-09 14:42:57 +01:00
Christophe Simonis e2ae51c4b0 [MERGE] forward port branch saas-15 up to 6d0f63ec4e 2018-02-09 12:41:15 +01:00
Christophe Simonis 6d0f63ec4e [MERGE] forward port branch saas-14 up to 9b2d3b19a6 2018-02-09 12:40:16 +01:00
Christophe Simonis 9b2d3b19a6 [MERGE] forward port branch 10.0 up to df3fb9f85a 2018-02-09 12:39:43 +01:00
Christophe Simonis 5cf12bfba4 [FIX] sale_timesheet: extract theoritical revenue values computation
This allow easier potential overwrite and ease migration.
2018-02-09 11:55:08 +01:00
Jeremy Kersten df3fb9f85a [FIX] calendar: fix partners_to_notify to have flat list of ids
Before this commit, user see a traceback:
(res_users.partner_id in (3,ARRA.. ...
operator does not exist: integer = integer[]

After update from initial commit
After append from commit 1bb74b7588
Now,  extend to allow [1].extend([2,3])

This commit closes #22944

Courtesy of @paulius-sladkevicius for reporting
2018-02-09 10:54:54 +01:00
William Henrotin 6718de5393 [FIX] i18n: correct two traduction in tax names 2018-02-09 10:00:18 +01:00
mreficent aac8f9730e [FIX] base: on_change_country() on res.company should return an ID
Previously, the return value was sometimes an int and sometimes a browse record.
Was PR #22810. Courtesy of Miquel Raïch (Eficent)
2018-02-09 09:53:57 +01:00
Christophe Simonis 047796817c [MERGE] forward port branch saas-14 up to 3a1df2cf22 2018-02-08 18:08:52 +01:00
Christophe Simonis 3a1df2cf22 [MERGE] forward port branch 10.0 up to 1b5ecbb047 2018-02-08 17:30:08 +01:00
Christophe Simonis 1b5ecbb047 [MERGE] forward port branch 9.0 up to ce51ad7e69 2018-02-08 16:43:44 +01:00
Christophe Matthieu d288b33648 [IMP] web: use patch for object in tests to avoid edge effects 2018-02-08 15:46:00 +01:00
Christophe Matthieu 1d49d52b3a [FIX] web: properly set parent when using mixins
The parentedMixin doesn't automatically set the parent, so when this mixin
is used, the parent must be set manually. This wasn't done at several places,
and thus those elements weren't destroyed with their actual parent.

In master, we should probably make the ParentedMixin set the parent itself.
2018-02-08 15:46:00 +01:00
Christophe Matthieu b28ceec009 [FIX] web: Views: always destroy BasicModel instances
Before this rev., it might happen that the parent of BasicModel instances
wasn't correctly set to the Controller instance. It was actually set to the
ActionManager instance, which is never destroyed. So when this happened,
the BasicModel instance wasn't destroyed when it's controller was.
2018-02-08 15:46:00 +01:00
Christophe Matthieu 4f5fc6ee55 [FIX] web: properly set parent when using mixins
The parentedMixin doesn't automatically set the parent, so when this mixin
is used, the parent must be set manually. This wasn't done at several places,
and thus those elements weren't destroyed with their actual parent.

In master, we should probably make the ParentedMixin set the parent itself.
2018-02-08 15:45:30 +01:00
Christophe Matthieu 83795d37f3 [FIX] web: Views: always destroy BasicModel instances
Before this rev., it might happen that the parent of BasicModel instances
wasn't correctly set to the Controller instance. It was actually set to the
ActionManager instance, which is never destroyed. So when this happened,
the BasicModel instance wasn't destroyed when it's controller was.
2018-02-08 15:45:30 +01:00
Simon Lejeune 625a648f22 [FIX] stock, mrp: untracked quants and unreservation
- create a product comp1 tracked by lot
- make an inventory adjustment for comp1 ; 1 quant with lot1 and 1 quant
  without lot
- create a bom for product finished1 composed by 1 comp1
- create a mo for 1 finished1, reserve it
- the mo reserved the quant with lot1
- produce finished 1
- unlock the mo
- change the component from lot1 to lot2 (that do not exist)
- the write on a move line will trigger a re-reservation that will
  fallback on the quant without a lot (that's how untracked quant for
  tracked products are handled)
- delete the move line, it'll unreserve with lot2 and fail

We fix the issue by applying the same logic of fallback on the untracked
quants in the unreserve of a move line.

We add a test for the unreserve of a move, as it simply unlink the move
lines.

opw-814914
2018-02-08 12:58:47 +01:00
Christophe Matthieu ae39a89a09 [FIX] web_editor: add thumbnail image to send attachment 2018-02-08 11:25:51 +01:00
Christophe Matthieu 6494f51171 [FIX] base/mail: Added an access_token on the attachments url
The access_token is automatically added by the media editor. It's added
on the website and by the html editor to send by email. The widget display
the attachments from 'ir.ui.view' (public attachment) and the attachment
from the current record.

Issue: can't load image in gmail or mobile because the client mail use a
proxy who avoid ours odoo access.
2018-02-08 11:25:51 +01:00
Christophe Matthieu 152e3f8686 [FIX] web_editor: encoding of the attachment name is missing in image src 2018-02-08 11:25:51 +01:00
qsm-odoo ce51ad7e69 [FIX] web_editor: allow deleting all images in table cells
Before this commit, it was impossible to delete an image which was a
direct child of a table cell using the trash-icon button in the
toolbar.

This commit fixes the behavior by changing the logic quite a lot, so
it is kinda tricky (see https://github.com/odoo/odoo/commit/25849e918651eba080dac3af4e4fcdc8f1280241
for more explaination).

Closes https://github.com/odoo/odoo/issues/22523
2018-02-08 10:48:14 +01:00
qsm-odoo 8dfd6a2507 [FIX] web_editor: fix image deletion and replacement
Deleting/replacing an image through summernote gave unexpected results.
As modifiying the related function may be tricky, this commit instead
wrap them to solve the specific erratic behavior: if the range is in/
matches an image, then simply remove the image and move the cursor to
its previous location.
2018-02-08 10:48:14 +01:00
Yenthe V.G 72a8b420d2 [IMP] doc: specify to go in developer mode to access a feature
Closes #22877
2018-02-08 15:10:23 +05:30
Lucas Perais (lpe) d2f9994e92 [FIX] sale, website_quote: right display of confirmation mode
Create a quotation in sign confirmation mode.
Send it by email
Follow the link

Go the quote's user's portal
Go to the quotes menu, and enter the right SO

Before this commit, although the confrmation mode of a SO
was rightly computed, it was badly retrieved and displayed.
The button on the email was 'accept and pay'
On the portal, the form view of the SO displayed 'pay now'

After this commit, in both cases it displays 'accept and sign' or the like

OPW 806554

related to #22390
2018-02-08 10:32:00 +01:00
Lucas Perais (lpe) 9645a64d0e [FIX] base_vat_autocomplete: address fields should not be conservered on change vat
Bafore this commit, fields that were not written during on change were kept
leading to having a wrong overall address when changing vat when the return of the API
did not contain the same fields as before.
Also, ZIP from Netherlands were not supported

After this commit, when changing the VAT number, fields that were not set by this operation
are reset to False
Also, NL zip codes compute fine

OPW 807666
2018-02-08 10:29:30 +01:00
Pedro M. Baeza 84b0ec4da3 [FIX] delivery: Get correct carrier price on picking created from SO
Steps to reproduce:

* Create a sales order (SO).
* Assign a carrier.
* Don't press on "Set price" button next to carrier.
* Validate SO.
* Validate picking.
* Delivery line is added to the SO with price 0.

This is because the delivery SO line is added with the value of
picking carrier_price field, but that field hasn't been set.
If you modify on view carrier field, there's an onchange that
fills correct price, so I use that onchange method for getting
same results.
2018-02-08 10:17:06 +01:00
Christophe Simonis da19a7701e [MERGE] forward port branch saas-16 up to 23752102a0 2018-02-07 17:47:26 +01:00
Robert Rübner 32a7a1ed09 [FIX] website: do_not_show option in translator dialog not working
Before this commit, it would do the opposite of what it should:
When 'Do not show this dialog later' is checked, it would remove the
localStorage item instead of creating it.
When unchecked, it would create the localStorage item to prevent the dialog to
shows up again.

Now, we perform the correct behavior.

This closes #10882, closes #11550
2018-02-07 16:34:38 +01:00
Martin Geubelle 36d07bfc0f [FIX] web: properly handles ESC in editable lists
This is a small correction of odoo/odoo@3aad756 ; a traceback occured when ESC
was pressed in a list view with modifiers.

The `confirmChange` was done on the parent datapoint (of type list) which has no
attribute `evalModifiers`.

`confirmChange` is now called on the record datapoint. Note that for x2m, it
means that all modifiers linked to the parent record won't be re-evaluated (but
this wasn't probably intended as this is a bit overkill).

Closes #22718
2018-02-07 15:25:54 +01:00
Martin Geubelle 4ae44b3bd9 [FIX] web: prevent crash when downloading pivot view
A traceback was occuring when downloading the pivot view without data.

The export function expects the attribute `main_row` set on data, which
is defined in `_prepareData`. The latter wasn't called because of the `return`.

Closes #22728
2018-02-07 15:25:54 +01:00
Christophe Simonis 23752102a0 [MERGE] forward port branch saas-15 up to 830327c66a 2018-02-07 15:18:07 +01:00
Christophe Simonis 830327c66a [MERGE] forward port branch saas-14 up to af8de1a3ed 2018-02-07 14:55:37 +01:00
Christophe Simonis af8de1a3ed [MERGE] forward port branch 10.0 up to 66e76d681d 2018-02-07 14:29:24 +01:00
Rémi Rahir 376415052c [FIX] phone_validation, crm_phone_validation: Phone number parsing
Before this commit, when filing a phone number field on a model form (typically on website_form),
the module phonenumbers would try to parse the number against the country of the model.

However, this call fails when the number starts with 00 instead of + and that the model
doesn't have a country_id field or if said field is not set.

For this specific case, we chose to skip the number parsing altogether as providing a default
country to the parser can lead to a wrong parsing. i.e, phonenumbers.parse(+32477111111, 'US') will
find the number as US-based when it is a belgian number.

solves issue #22513

Also corrected a faulty behaviour where the option to have a number parsed in its international format
field `phone_international_format` on `res.company` was never properly assessed when the field comany_id of a
model was not present in the model's form view. Added company_id field on opportunity's form view for a proper fix.

Also fixed a syntax error in a logger.
2018-02-07 14:22:46 +01:00
Romain Derie 66e76d681d [FIX] payment_stripe: integer currencies (portal payment)
Before this commit:
On portal (My Account > Invoices > Pay Now), a stripe payment in a normal
currency (eg: a non integer currency) would debit the amount *100.
This comes from b335ae0348 which added a workflow to handle integer
currencies but it also sent the *100 amount to /website_payment/transaction
that would create a TX with that amount instead of the normal amount.

Now, the normal amount is correctly sent to the backend, the multiplied amount
is just sent to StripeCheckout handler to correctly display the amount on the
popup after clicking on "Pay Now".

Note: the amount will be multiplied on the backend independently ecda057e11
2018-02-07 13:59:33 +01:00
Romain Derie b2b71efb36 [BACKPORT] website: translation if website default lang is not en_US
Before this commit:
When website default lang was not en_US, the translation of fields* in the
web_editor would not be saved correctly.
Let's illustrate with fr_BE set as main lang:

  The web_editor's RPC calls does not send language in the context when editing
  a page (6ebcc06), but it does in translation mode.
  Note that editing is always performed in the website main lang, fr_BE in this
  case.
  Therefore:
  1. When EDITING:
    The backend suppose the language is en_US as there is no lang in the
    context (hardcoded everywhere).
    It then write in the record itself instead of the ir.translation as it
    should since fr_BE is a translation. (In Odoo, every lang is a translation,
    en_US is  always the main lang)
  2. When TRANSLATING (in en_US):
    It would also write on model as the web_editor send the language to the
    backend when in translate mode. But since en_US is recognized as the main
    lang (which is correct), it also writes in the model, overriding the
    incorrect fr_BE writing which was also wrote on the model.

This has been fixed in 10.0 with these 2 commits:
036ccbe
2955bf2

With these fixes, the lang is correctly added (by the backend) if the website
module is installed.
By ensuring the lang is correctly set, the ORM _write() function will process
the edition and translation datas as it should:

  - If it receive en_US, it will write on the model
  - If it receive another lang, it will write on ir.translation

This closes #10883, closes #22403

*Not the HTML/XML fields which are handled differently by the ORM/translation
2018-02-07 13:35:03 +01:00
Christophe Simonis ae3643ba2a [MERGE] forward port branch 10.0 up to a93a9d43e6 2018-02-07 13:34:03 +01:00
Martin Trigaux 2c6bad6b75 [FIX] calendar: wrong label on field
Was not meaning anything, or implying a number while the fields is a boolean

Courtesy of e2f translators
2018-02-07 17:54:10 +05:30
qsm-odoo a93a9d43e6 [FIX] website: allow "Customize theme" when CDN option enabled
Traceback because the `_get_asset` function was called by the
`theme_customize` route without the `values` argument (which is not
necessary for the feature).

Closes https://github.com/odoo/odoo/issues/22516
2018-02-07 12:50:28 +01:00