Commit Graph
111414 Commits
Author SHA1 Message Date
Christophe Simonis 5ea0f55d65 [MERGE] forward port branch saas-15 up to bee0c11ef7 2017-10-20 17:57:21 +02:00
Christophe Simonis bee0c11ef7 [MERGE] forward port branch saas-14 up to f3ac68ed29 2017-10-20 17:24:15 +02:00
Géry Debongnie 635572b49d [FIX] web: properly handle failures in onchanges
With the new views, we mainly focused on making them work.  But we also
need to be able to handle unusual cases, such as some RPC failing.  An
example of such a problem was the following:

- a form view with a one2many with an onchange
- edit mode, change a field in the one2many, click elsewhere
- the onchange triggers, calls the server
- it may happen that the server fails with a ValidationError
- the onchange deferred fails, the line in the one2many is restored to
  the value known by the list renderer, which is the previous value (but
  the new value was applied to the model)
- we now have a 'corrupted' state: clicking on save will send the
  invalid value, even though the UI displays the previous one.

We solve this problem in this commit by making sure that the onchange
deferred returned by the _performOnchange always succeed (or stays
pending).  If the rpc fails, the deferred will succeed with an empty
dictionary.  This means that the list renderer will be updated with the
value from the model.

Note that it may not be intuitive that a failure in the onchange is not
seen as an error from the perspective of the _performOnChange, but I
think that it still makes sense:
- the validation/network errors are not really a concern of the UI. The
  UI just display the values entered by the user.
- if an onchange fails (for example, because of a coding error), we do
  not really want to prevent the user from working.

Also, when the onchange is performed, the initial change was already
applied to the local data.  Rollbacking them would be a more difficult
task.

Note that we also improve the mock server in this commit, to allow
mocking failures.
2017-10-20 17:14:10 +02:00
Géry Debongnie fd65dbaa1f [FIX] web: session.get_file should return a value
The session get_file method should return the value from the
ajax.get_file method, otherwise we lose information (this is necessary
to be able to react properly to the fact that the download was blocked)
2017-10-20 17:14:10 +02:00
Christophe Simonis f3ac68ed29 [MERGE] forward port branch 10.0 up to e2532f855f 2017-10-20 16:09:28 +02:00
Christophe Simonis e2532f855f [MERGE] forward port branch 9.0 up to 31c1be1fac 2017-10-20 16:02:12 +02:00
rde dd2a619ad5 [FIX] base, web, website: settings - prevent duplicate enterprise labels
Before this commit:
Multiple widgets for the same field on the same view (V11.0 settings) would not
retrieve the correct label but all of them.

Now:
We now retrieve the correct label instead of all of them
2017-10-20 15:58:24 +02:00
rde bdaa3b88e4 [FIX] website: settings-add enterprise label to website_version
Enterprise label was missing on website_version
2017-10-20 15:51:25 +02:00
rde 31c1be1fac [IMP] auth_oauth: prevent portal users to land on /web after login
Before this commit, a portal user would land on /web after login in with oauth.
He would then just see the "Website" app.
He should then click on it to land on website instead of landing directly on it
after login in, which is not convenient, especially since theses users doesn't
know Odoo (in case of sale customers manually created for instance).

Now, if users has no 'base.group_user' right, it will be redirected to the
website directly instead of /web.
2017-10-20 15:25:28 +02:00
Christophe Simonis 786b67ab49 [MERGE] forward port branch 9.0 up to c6a9bab074 2017-10-20 15:14:45 +02:00
Géry Debongnie 823cfd6ab1 [FIX] web: make sure m2m_checkbox works twice in a row
We had an interesting bug with the field many2many_checkbox: in some
cases, it could cause a crash, because it could not find an element in the
localdata.

To reproduce this, start with a non empty field many2many checkbox, then
uncheck them twice.

The reason is that the datapoint of type 'list' that represents the
current value is actually modified, and the replace_with operation
assumed that it could find the localID by looking into its data.  I have
the feeling that a more complete fix is to make sure that the datapoint
is not modified (in its 'data' key), but is modified in its '_changes'
key.  However, this would probably be a bigger change.
2017-10-20 14:56:37 +02:00
Nicolas Martinelli c6a9bab074 [FIX] account: tax included
- Create a tax included of 21 %
- Create a product sold 7.00, set the 21 % tax
- Add the product in a SO

Amount w/o tax: 5.79
Amount tax: 1.22
Total: 7.01

We defer the base rounding to the end of the method so that the rounding
doesn't impact the tax computation of included taxes.

Complement of 6e46ba7b46

opw-777221
2017-10-20 14:36:58 +02:00
Olivier Dony 78dcbdee6e [FIX] mail: correct typo in e5e549a4cf 2017-10-20 14:23:38 +02:00
Fabien Meghazi 3be3c6f532 [FIX] qweb2.js: fix erratic object type detection in foreach (Fixes #15655)
Could not add a test as the qweb js testsuite is broken and it's xml
test files have been modified in order to test qweb.py specific cases.
2017-10-20 14:04:46 +02:00
Martin Geubelle 2455350c40 [FIX] web: deal with date widget on datetime
This use case was not correctly managed as the function evaluating if the
value has changed compares datetime and date.

This triggered an issue if the widget `date` was set on the field `date_order`
on a purchase order for example ; it was not possible to create a record as
the datapoint was set `dirty`.

This rev. ensures that a `field_changed` is not triggered if the day is the same
on a date widget.

This rev. also adds support of `datetime` fields on date widget, which appears
to be a valid use case.

Fixes https://github.com/odoo/odoo/issues/20311
2017-10-20 11:25:32 +02:00
Martin Geubelle 1312ee72cf [FIX] web: correctly render the field image
Before this commit, the image was directly built without using the corresponding
template, which set some properties on the image (class, width, etc.).
2017-10-20 11:04:08 +02:00
Nicolas Martinelli 3e5189e628 [FIX] product: allow multiple values for same attribute
- Create a product attribute, e.g. 'Recommanded Age'
- Create several values for this attribute
- Try to associate more than attribute value to the same variant =>
  contraint which prevents to do it

We should allow this use case as long as the product attribute doesn't
create a variant.

opw-776344
2017-10-20 10:42:58 +02:00
Nicolas Martinelli e414bae770 [FIX] mail: company logo
- Activate multi-company, create companies A and B
- Set 2 companies on a user

When a message is sent (for example, thanks to the chatter), the
notification email always contains the logo of the same company,
whatever the company of the user or the company of the object.

This is a complement of commit 7a03f9ce93, applied to notifications.

Closes #20088
opw-772405
2017-10-20 10:41:24 +02:00
Martin Trigaux e180a03af8 [I18N] base: export source terms
Now that 8f1d889e50 has been forward ported to 10.0
Add missing enterprise module description
2017-10-20 09:20:00 +02:00
Lucas Perais (lpe) e3f05496b1 [FIX] mail: fix template preview wizard view
Before this commit, when on a mail.template form, click on the Preview smart button.
A wizard popped up with two buttons, as the default for form views.
First this made no sense since the wizard doesn't represent a model that can be modified
Second, the button discard was unable to close the wizard.

After this commit, only a discard button is present which does its job.
2017-10-20 09:09:34 +02:00
Lucas Perais (lpe) af6baac9c7 [FIX] account, sale: fix notification templates inline style
Before this commit, Sale order and invoice notification email templates broke when doing any action on them (duplicating, open preview etc...)
This is because the model is saved during those operation, and the css style gets converted to inline style.
The table tag present in those templates, was wrongly associated with the bootstrap rule for tables, collapsing their border, hence the break of the templates.

After this commit, we force the borders not to collapse, and the templates don't break

OPW 774323
2017-10-20 09:09:04 +02:00
Adrian Torres 023b195eef [FIX] website_sale: don't unlink website_description
This is a hotfix/hack for a conflict between website_sale and
website_quote, on the field website_description.
The conflict happens when both modules are installed.

Fixes #20118
Completes rev 333a236
2017-10-20 08:44:49 +02:00
Christophe Simonis beed2d2ed9 [IMP] sale{,_stock}: do not mix indentation with tabs & spaces 2017-10-19 23:35:00 +02:00
Christophe Simonis a3b3bb2228 [MERGE] forward port branch 10.0 up to 9b4447e9aa 2017-10-19 23:16:39 +02:00
Christophe Simonis 9b4447e9aa [IMP] test_pylint: check for mixed-indentation 2017-10-19 22:33:37 +02:00
Christophe Simonis 4af5e03d80 [ADD] hw_proxy: do not mix indentation with tab & spaces 2017-10-19 22:25:31 +02:00
Christophe Simonis 8ead5f9610 [FIX] sale_stock: do not mix indentation with tab & spaces 2017-10-19 21:03:00 +02:00
Olivier Dony 0fc6fe8653 [FIX] payment_stripe: fix multiple usability problems
- There was no feedback to the user when executing the Charge
  transaction in server-to-server mode, while it could take several
  seconds, with the normal UI/action buttons still available.

- Stripe integration was almost working along with `website_quote`
  payment, but entirely broken with `website_payment`, and partially
  broken with `website_sale`.
  Fixing it required:
  + More leniency in processing optional transaction parameters, which
    may or may not be present in the various payment flows.
  + It also required more precautions when locating the transaction for
    which the Stripe Charge was to be created, which passed in different
    manners in the session. The route now supports an explicit `tx_id`
    to allow forcing the transaction without risk of mixing different
    payment flows.
  + FIXME: There is still some amount of duplication and bad modularity
    in the handling of the various payment flows in relation with
    Stripe.

- We provided very little metadata to the Customer and Charge APIs of
  Stripe. We now pass more names and references to make Stripe payments
  easier to manage in the Stripe dashboard.

- In some cases, selecting Stripe as payment method caused a second
  inclusion of `stripe.js`, raising a JS error because of the
  duplication.

- Strip whitespace in emails: the Stripe API raises an error for
  transactions done with invalid emails, including with
  leading/trailing whitespace.
  Customers will have a hard time figuring out the problem
  by themselves, so we should at least strip whitespaces.
2017-10-19 18:14:15 +02:00
qsm-odoo d49983b23d [FIX] web_editor: open link dialog on dblclick on real links
When double-clicking on a link/button, the link dialog is opened. The
problem was that the "btn" class is sometimes used on non-link elements.
While this should not be, the editor can easily be adapted to this.
2017-10-19 17:53:59 +02:00
Dharmang Soni 2c829870f1 [FIX] web: prevent iOS from zooming in on input fields
When a user clicks on an input or a select field
in Safari on IOS, Safari has a behavior of zooming-in
on the field when the keyboard opens.
Even after the user dismisses the keyboard, the screen
still stays zoomed-in. The user has to then zoom out manually.

Now, the user is not allow to zoom-in at all.
This is already the case with the Android application.
We now have the same behavior between the two apps.
2017-10-19 15:09:36 +02:00
Cédric Pigeon (ACSONE) 59b010ac36 [FIX] sale_stock: refactor badly written method causing performances issues (#20193) 2017-10-19 15:00:52 +02:00
Christophe Simonis 03180ecb0c [MERGE] forward port branch 9.0 up to 2deb95b852 2017-10-19 14:42:37 +02:00
Nicolas Lempereur c57fb01a3e [FIX] web: iOS content in modal disappear
As can be seen in https://github.com/scottjehl/Device-Bugs/issues/8 a
combination of "-webkit-overflow-scrolling:touch", "position:relative"
and "overflow:auto" can have unexpected behavior on iOS.

The issue solved here is that writing in a form view inside a modal in
iOS (at least version 10.3) would make the whole form body invisible
until edition is ended.

This commit fixes this by adding a CSS rule which avoid the iOS bug.

opw-774396
closes #20314
2017-10-19 14:33:30 +02:00
Goffin Simon 2deb95b852 [FIX] base_vat, website_sale: Verification of vat number in EU country
We have problems when trying to validate our EU VAT report because some vat number are wrongly encoded in Odoo.
    There are 2 problems:

    1) We use vatnumber library to check the validity of the VAT number entered by the user on website.
       That library removes the following characters '.' and '-' in order to perform the check and
       thus can return True for a number like 123.123.123.13 or -123-3454-34
       And those VAT number are then saved in our database but are rejected by the state
       as VAT number should only contains alphanumeric character
    -> Solution: prevent entering vat number with other characters than alphanumeric for users that are located in EUROPE!

    2) Usually VAT is prefixed by country code, however some people in europe managed to bypass the system
       by prefixing their VAT number with CC instead of their country code, CC is consider valid in odoo
       (it means Country Code) but is not a valid European country code in general, which means that those
       people that should have pay some tax have not. Which is a huge problem.
    -> Solution: prevent the use of CC as country code by the user when entering a vatnumber only if the user country is in EUROPE!

    source: https://en.wikipedia.org/wiki/VAT_identification_number

opw:772621
2017-10-19 14:18:14 +02:00
Christophe Matthieu 99e14b96b3 [IMP] account: reconciliation: improve search based on amount
FIX: amount_currency can allow negative searches
IMP: can search on positive or negative amount only if use '-' or '+'
IMP: search for move lines based on the amount by clicking on the balance
amount. Search in 2 currencies if possible.
2017-10-19 13:52:56 +02:00
Christophe Matthieu f495f68272 [FIX] account: reconciliation: balance amount in multi-currencies
Display the 'money' icon in the balance amount line when the user is in
multi-currencies and there is a currency different from the one used in
current line.
2017-10-19 13:52:56 +02:00
Christophe Matthieu ed79071293 [FIX] account: reconciliation: reset filter when validating a line
issue: in the 'match' part of a reconciliation line, if the user uses the
search without any line as result and validate the selected proposition,
the line is removed but the account or partner reconciliation is maybe
not finished.
2017-10-19 13:52:56 +02:00
amoyaux e72fc9a7f3 [FIX] stock: pack operation lots truncate decimal precision
A bug happens when you enter a number with more than 2 decimal
if you unfocus/focus the field it will truncate it.

This commit change the decimal precision and use the same digits
than other fields used in stock.

opw-775791
2017-10-19 13:44:31 +02:00
qsm-odoo 1e9adb8971 [FIX] web: domain field should never be considered unset
Backport of https://github.com/odoo/odoo/commit/841f41f95b7cf7d8f13ddce724d60d1d1149886d
Does not have to be forward-ported in saas-16.
2017-10-19 11:07:50 +02:00
Géry Debongnie d8f03e64fd [FIX] web: do not send id in update commands for m2m
When we generate commands for many2many, it could happen that the id was
in the list of changed fields (when we are in a new records, with a non
empty initial onchange).  When this happens, the server is not happy.

To reproduce this, open the uninstall wizard of a module in the 'App'
application.  This creates a new record with a non-empty many2many
field. Then click on 'Show technical modules', this will trigger an
onchange which should not send the id field.
2017-10-19 10:56:49 +02:00
Denis Vermylen f18f8e401b [FIX] sale: pricelist price base
Fine tuning of 1108c150d9

When setting a pricelist to show the public price discount, it ignored
the pricelist item's base field (if not 'Other Pricelist') and set it
by default on the lst_price instead.

This did not work when you based your discount on the standard_price
(= cost price) with public price discount.

Now it does.

opw:775275
2017-10-19 10:56:25 +02:00
Nicolas Martinelli 4f921d668a [FIX] account_asset: asset on refund
- Create a vendor bill with a line linked to an asset category
- Validate the bill => an asset is created
- Refund the bill

The refund is also linked to an asset category. Therefore, upon
validation, a negative asset will be created.

The refund should not be linked to the asset category in a first place.
The user should cancel/modify the asset manually.

opw-775933
2017-10-19 09:26:44 +02:00
Joao Alfredo Gama Batista 3f3e41e9f5 [CLA] Update Savoir-faire Linux CLA
Add new collaborators, remove old ones

Closes #20258
2017-10-19 09:24:53 +02:00
François Honoré (Acsone) 2295cffb70 [CLA] Add acsonefho into Acsone CCLA
Closes #20291
2017-10-19 09:12:30 +02:00
qsm-odoo 841f41f95b [FIX] web: domain field should never be considered unset
Indeed, false was already considered as "[]" in edit mode.
2017-10-18 18:14:33 +02:00
Christophe Simonis 25e65d2bcb [MERGE] forward port branch saas-15 up to 8096162bee 2017-10-18 16:57:35 +02:00
Christophe Simonis 8096162bee [MERGE] forward port branch saas-14 up to 73822d4eaf 2017-10-18 16:06:07 +02:00
Christophe Simonis 73822d4eaf [MERGE] forward port branch 10.0 up to 388bf45853 2017-10-18 15:30:54 +02:00
Thibault Delavallée 388bf45853 [FIX] mail: indentation issue when forward-porting
Commit aab6bdd54a was incorrectly forward-ported to
10.0 at abb726d4df . Indeed share users could land
to a wrong backend or frontend page depending on the target app due to an
indentation issue.
2017-10-18 15:21:44 +02:00
Christophe Simonis de70646bc5 [FIX] website_sale: correct js syntax
Oversight of forward-port a01e76efa7
2017-10-18 15:17:40 +02:00