Commit Graph
119417 Commits
Author SHA1 Message Date
Christophe Simonis aeed32d4ff [MERGE] forward port branch 11.0 up to 1dbe4ea0d7 2019-01-30 17:10:34 +01:00
Christophe Simonis 5ad3d599ce [MERGE] forward port branch 11.0 up to 7eec6b3643 2019-01-30 13:25:36 +01:00
Nicolas Martinelli 1dbe4ea0d7 [FIX] web: current date
- Set the OS in a timezone such as the current day is different from the
  day in UTC (e.g. America/Nome before 10:00 AM or Australia/Melbourne
  after 3:00 PM)
- Open any datepicker
- The 'little triangle' indicating the current day is wrongly set (one
  day before or after)

Knowing that Odoo always creates momentjs date and datetime with the
`UTC` flag set to `true`, the `bootstrap-datetimepicker` does something
which seems inconsistent.

First, it retrieves the `viewDate`, and sets it to the beginning of the
month and week in:

https://github.com/odoo/odoo/blob/1c6c504215f3ef09e6336c92c9d350e87599eaa1/addons/web/static/lib/bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js#L725

In this part, it is important to note that each `startOf` functions
called sets the hours/minutes/seconds to zero. It means that the
reference time is changed.

Then, it iterates on this newly created date, and determines `today` by
comparing it to `getMoment()` in:

https://github.com/odoo/odoo/blob/1c6c504215f3ef09e6336c92c9d350e87599eaa1/addons/web/static/lib/bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js#L748

However, `getMoment()` returns the current date and time, but with the
`UTC` flag set to `false`.

Therefore, we compare a UTC datetime on which the reference time has
been changed to a non-UTC datetime, which fails to give the appropriate
current day.

There are two approaches to solve this. The first possibility is to
change the way Odoo defines momentjs dates and datetimes, maybe by
removing the `UTC` flag at creation. This sounds like a bad idea, since
other widgets or views (such as the calendar or the pivot view) make use
of them. This is likely to introduce a bunch of new issues with TZ in
these views. The second approach is patching the library to fit our use.
Although we usually don't do such a thing, this allows to specifically
solve this use case, and in particular placing the 'small triangle' at
the appropriate date without impacting any other part of the system or
the library. It can be easily performed by comparing the dates and the
months to make it work.

opw-1915251

closes odoo/odoo#30538
2019-01-29 13:26:22 +00:00
sbbaro 7e0603785b [FIX] base.ir_actions_report print ordered pdfs
When printing multiple reports with the "Reload from Attachment" option
selected, the order of the rendered pdfs was not respected. Using an
ordered dictionary instead of a randomized one solves the problem.

opw 1915685

closes odoo/odoo#30690
2019-01-30 09:42:20 +00:00
Christophe Simonis cd5c8a02f9 [MERGE] forward port branch 11.0 up to 36d96e0150 2019-01-29 13:17:12 +01:00
Christophe Simonis 36d96e0150 [MERGE] forward port branch saas-15 up to 788684a5dd 2019-01-29 11:57:06 +01:00
Christophe Monniez 7eec6b3643 [FIX] packaging: allow install on fedora29
Fedora 29 switched to python 3.7. It seems that there is no official
way to build a RPM package that could works with 3.6 and 3.7.
Building two different packages for each version could open the pandora
box of packaging.

With this commit an ugly hack is used: if python3.7 is found, the odoo
directory is symlinked into its site-packages dir.

fixes #30579

closes odoo/odoo#30618
2019-01-29 09:09:53 +00:00
Christophe Simonis 788684a5dd [MERGE] forward port branch saas-14 up to aaa2035bcf 2019-01-28 19:45:46 +01:00
Christophe Simonis aaa2035bcf [MERGE] forward port branch 10.0 up to 4a5862a492 2019-01-28 19:45:04 +01:00
Arnold Moyaux 428546bc02 [FIX] stock: scrap insufficient qty bypass UoM
Usecase to reproduce:
- Set 1 unit of product A in stock
- Scrap 1 dozen of product A

Warning message for Insufficient Quantity is not triggered.

It happens because there is no UoM conversion between scrap qty and
product quant quantity.

Fixes #30570

closes odoo/odoo#30589
2019-01-28 13:13:21 +00:00
Nicolas Martinelli ae88e50928 [FIX] stock: unreserve
- Create a SO with 2 stockable products: 1 is available, the other is
  not.
- Validate, go to the picking
- Set the 'Shipping Policy' to 'When all products are ready'

The 'Unreserve' button disappears, while some products were reserved.

When changing the shipping policy, the state of the picking is
recomputed and set as `confirmed` ('Waiting').

We make the button visible in this state also, when 'Shipping Policy'
is set to 'When all products are ready'.

opw-1932658

closes odoo/odoo#30635
2019-01-29 07:13:08 +00:00
Lucas Perais (lpe) 4a5862a492 [FIX] point_of_sale: offline invoicing => backend printing
In a pos session:
OFFLINE
make an order with invoicing , try to validate
    The order stays there because it needs to be validated by the server
make another non invoiced order, validate

ONLINE
make another order
    At validation, all orders will be pushed to the server

Before this commit, when trying to validate the invoiced order
the report download couldn't find the order id, and crashed
This was because the order in question was already pushed
but treated as a non invoiced order

After this commit, an "warning" message is displayed to the customer
saying he/she has to print the invoice from the backend.
In most cases it is enough and acceptable, since a customer would actually leave the premises
and come back later for the invoice
It is also safer in terms of data consistency to keep pushing all orders once the connection is back

OPW 1918044

closes odoo/odoo#30485
2019-01-28 12:14:30 +00:00
Géry Debongnie dc751f20a2 [FIX] web: add exponential backoff strategy for lost connection
Before this commit, the web client had a naive strategy to handle lost
connections: it tried to poll the server every 2 seconds until a rpc
succeeds.

This works quite well from the perspective of the user, but may be a problem
from the perspective of the server.  If a server is down for a longish period,
then each users active tabs will then perform a request every 2 seconds. This
means that the server will be progressively hammered by many requests, which
will clutter the logs, and make it more difficult to gracefully recover.

With this commit, we simply exponentially increase the delay each time, and add
a little jitter to give a better distribution.

Cherry-pick of 4a3f04bcc5

closes odoo/odoo#30136

closes odoo/odoo#30596
2019-01-28 10:55:53 +00:00
Lucas Perais (lpe) 7ab26999be [FIX] account: tax in right refund account
Have a tax that has a different account for refunds
make an invoice and its refund

Before this commit, the refund's tax is still in the old account

After this commit, the refund's tax is in the account for refund defined on the tax

OPW 1907950

closes odoo/odoo#30325
2019-01-28 10:53:01 +00:00
Nicolas Martinelli 93a767a678 [FIX] pos_discount: error if misconfigured product
In case the discount product is misconfigured and therefore not loaded
by the POS, a traceback appears when applying a discount.

Add a comprehensive error message instead.

Closes #30574
opw-817527

closes odoo/odoo#30582
2019-01-28 07:46:51 +00:00
Jose Suniaga [Vauxoo] 317884be6a [FIX] sale: Call the proper method in the test and not the partial one (continuation).
In complement to issue reported in:

https://github.com/odoo/odoo/pull/27316

closes odoo/odoo#29907
2019-01-26 18:03:51 +00:00
Nicolas Lempereur 6c6ef6588f [FIX] website: affix menu no close frontend mobile menu
On mobile the frontend menu navbar is an hamburger menu that open on
click.

If the option "Customize > Main layout | Affix Top Menu" is
enabled, there is two menu:

- one at the full top of the page
- one affixed to the top of the viewport (only shown if we are at least
  scrolling 300px away from the top of the page)

But there is a side effect: when scrolling if the menu at the top of the
page is opened, it will be automatically closed => this makes sense to
avoid having two menu shown on the same page but is an odd behavior.

With this commit, the behavior is changed and when the menu is opened in
the top, the affixed menu is not shown (it only works if the top page
menu has no opened dropdown).

opw-1920310
closes #30567
2019-01-25 16:58:19 +00:00
Christophe Simonis 387d5cff90 [MERGE] forward port branch 11.0 up to 8f47b028ed 2019-01-24 17:01:40 +01:00
Robot Odoo 8f47b028ed [IMP] l10n_be_hr_payroll_fleet, fleet: Adapt CO2 Tax up to 2019
Specification
=============

- Adapt the formula used in the code with the current legal value.
- Add the LPG fuel type in standard fleet module.
- Adapt the atn formula in the code with the current legal value.

Documentation:
https://finances.belgium.be/sites/default/files/downloads/121-faq-voitures-de-societe-2019-version17.pdf
https://www.socialsecurity.be/employer/instructions/dmfa/fr/latest/instructions/special_contributions/companycar.html

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#30484
2019-01-24 14:22:24 +01:00
sed-odoo dad59a62c3 [IMP] l10n_be_hr_payroll_fleet, fleet: Adapt CO2 Tax up to 2019
Specification
=============

- Adapt the formula used in the code with the current legal value.
- Add the LPG fuel type in standard fleet module.
- Adapt the atn formula in the code with the current legal value.

Documentation:
https://finances.belgium.be/sites/default/files/downloads/121-faq-voitures-de-societe-2019-version17.pdf
https://www.socialsecurity.be/employer/instructions/dmfa/fr/latest/instructions/special_contributions/companycar.html
2019-01-24 12:24:04 +01:00
Nans Lefebvre 8275b6eff8 [FIX] sale, sale_expense, sale_stock: make the False expense_policy selection behaves as 'no'
The sale.order model has an expense_policy selection field, with values in 'no',
'cost', 'sales_price'.
However that value can also be set to False.

The code that handles that field expected the value to always be set to a value.
We explicitly treat False as if it was 'no' (the default value for that field).

opw 1915508

closes odoo/odoo#30336
2019-01-24 07:12:33 +00:00
Nans Lefebvre cb9466cf9c [FIX] rating: add search method on non-stored rating attribute
Commit f727e9d9b6 made the rating field
of mail.message non-stored for performance reasons.
When the rating is activated on the website, it adds the possibility to filter
product reviews by rating (1 to 5 stars).
It does so by searching the messages that have a given rating value.
However the osv complains that you can't search on a non-stored field.
As a result, instead of displaying messages filtered by ratings,
it would always display all of them.

We add a search='_search_rating_value' on the field to allow that field to be
searched anyway.

opw 1931038

closes odoo/odoo#30499
2019-01-24 07:09:00 +00:00
Tejas ShahuandMohammed Shekha a63a953a2d [FIX] web: translation issue fixed
Before this commit:
Editing a translatable field -> clicking on a translation
warning ->
come back through breadcrumb do not preserve translation
warning.

After this commit:
Editing a translatable field -> clicking on a translation
warning ->
come back through breadcrumb preserves translation warning.
Technical note: alertFields is now an object and an attribute
of the form renderer
that stores translation alerts per record. The translation
alerts
created for a given record are maintained unless
they are closed manually or the renderer is destroyed.

Issue-ID: 1877480

Co-authored-by: Mohammed Shekha <msh@openerp.com>

closes odoo/odoo#29377
2019-01-24 11:14:55 +00:00
Christophe Simonis fab415acab [MERGE] forward port branch 11.0 up to 984a99611e 2019-01-23 18:15:18 +01:00
Christophe Simonis 984a99611e [FIX] l10n_be_intrastat_2019: Python3 compatibility
Oversight of previous forward-port
2019-01-23 16:40:41 +01:00
Christophe Simonis 51a76880f2 [MERGE] forward port branch saas-15 up to 3cba1862d4 2019-01-23 16:05:02 +01:00
Christophe Simonis 3cba1862d4 [MERGE] forward port branch saas-14 up to 81c9e28eab 2019-01-23 15:23:00 +01:00
Christophe Simonis 81c9e28eab [MERGE] forward port branch 10.0 up to f3de712d76 2019-01-23 15:21:30 +01:00
Christophe Simonis d870fd555e [MERGE] forward port branch 10.0 up to 90c1af1151 2019-01-23 14:08:50 +01:00
Nicolas Seinlet 3f4d1e1fbe [IMP] mrp,stock_account: faster computation
Use read_group is faster than the python equivalent,
and then don't push ids in ORM cache, which makes
the ORM faster later in the process.
Also unlink in batch.
2019-01-23 10:30:49 +01:00
Waleed Mohsen 4c5de1c37c [CLA] signature for MohsenWaleed
closes odoo/odoo#30441
2019-01-23 08:23:38 +00:00
Nicolas Lempereur 90c1af1151 [FIX] web: no chrome autocompete on many2one widget
For editing many2one fields (and partially many2many) most widget show
an autocompleting list of targeted records.

They thus have `autocomplete="off"` to prevent browser completion.

But chromium has an history of breaking `autocomplete="off"`, see:

- https://caniuse.com/#search=autocomplete
- https://crbug.com/468153
- https://crbug.com/587466
- https://crbug.com/914451
- https://crbug.com/923895

It seems that since chromium 71, the heuristic to ignore
`autocomplete="off"` has become more aggressive and for example if there
is at least 3 fields like an address in a page, chromium will ignore
`autocomplete="off"` for the fields like an address.

So for example the eidting the many2One field with placeholder "Country"
in a contact page now has a browser autocomplete menu that is:

- hidding the many2one autocomplete
- going to save empty country it appeared visually filled if the
  autocomplete result was selected.

With this changeset, the placeholder in the many2one instance is
interspersed with U+FEFF charcters (ZERO WIDTH NO-BREAK SPACE) so the
browser does enable the autocomplete feature by force.

This should thus remove the issue (until it is fixed by chromium) in the
case of field named "Country" or matching other regexes in this file:

https://github.com/chromium/chromium/blob/cdb1b2073f12/components/autofill/core/common/autofill_regex_constants.cc

U+FEFF has been chosen instead of more recommended characters because
other have been shown erroneous for printing in some windows
configuration (see cb2a3afa7).

10.0 version of #30439
opw-1930588
closes #30439
closes #30449
2019-01-23 01:09:22 +00:00
Florent de Labarre d3affc5798 [FIX] sale: don't send duplicate email
closes odoo/odoo#30455
2019-01-23 07:31:50 +00:00
Nicolas Martinelli b95affa3ee [FIX] sale: taxes and untaxed amount
- Create a SO, do not set a partner
- Add a product with a tax

The untaxes amount as well as the taxes remain 0.0.

This is because there is no pricelist, therefore no currency.

There is actually no need of rounding explicitly since these are
monetary fields which will be rounded automatically.

opw-1931796

closes odoo/odoo#30450
2019-01-22 16:34:31 +00:00
Aurélien Warnon 5a6c523cc7 [FIX] website_slides: prevent slide download for public users
Task #1930691

Purpose
=======

If the download security is set to 'Authenticated users', the route should prevent public users
from downloading the slides.

closes #30281

closes odoo/odoo#30399
2019-01-21 07:02:58 +00:00
Martin Trigaux f63569beef [I18N] base: export source terms
Fixes odoo/odoo#30483

closes odoo/odoo#30488
2019-01-23 16:37:22 +00:00
qsm-odoo caacd95a87 [FIX] web: allow to open community website menu on iOS
Before this commit, the menu to go into the backend from the website was
not possible to open on iOS without opening the right menu first. This
was because position: fixed is not able to counter overflow: hidden in
iOS. This is the fix for stable versions, the proper solution will be
done in master.

Closes https://github.com/odoo/odoo/issues/29390
task-1923151

closes odoo/odoo#30507
2019-01-24 10:55:18 +00:00
Christophe Simonis 4aa153e65c [MERGE] forward port branch 11.0 up to 19558129f0 2019-01-17 20:49:36 +01:00
Christophe Simonis 19558129f0 [MERGE] forward port branch saas-15 up to c0471dd857 2019-01-17 19:07:34 +01:00
Christophe Simonis c0471dd857 [MERGE] forward port branch saas-14 up to 17adccd95c 2019-01-17 18:07:26 +01:00
Christophe Simonis 17adccd95c [MERGE] forward port branch 10.0 up to 50bae1c0c5 2019-01-17 17:08:39 +01:00
Julien (juc) Castiaux 71c4c13996 [FIX] web_editor: save less file
Modifying less files and saving them using the web editor can raise
and error. The error is due to the way odoo save the modified file.

It extends the view containing the URL of the file by filtering views
related to the xml bundle id and keeping those that have the said URL
in their content.

This lookup fails to give just one result in case there are multiple
file containing the said URL. This fix change the filter from a
bare `if url in view.arch` to a correct xpath lookup.

The "/web/static/src/variables.less" less file was one of the
problematic files.

opw-1889794

closes odoo/odoo#30186
2019-01-17 15:19:54 +00:00
Nans Lefebvre ba41c3c1cc [FIX] base: disable prefetching during module uninstall #2
Create any module that inherit 'res.lang'.
Define any new field that is added with that inheritance.
Install that module. Then try to uninstall it. Traceback ensues.

When trying to write 'state': 'uninstalled' on the module,
the prefetching tries to read a column that has been deleted
by the _module_data_uninstall.

opw 1917369

closes odoo/odoo#30176
2019-01-17 15:08:31 +00:00
wan 50bae1c0c5 [FIX] account: journal dashboard graph wrong value
OPW 1918926

Current behavior:
  The sql query groups by date,id in a intermediary table instead of the result. This allows to get data in the wrong order if the statements were not produced sequentially. The fill values are computed in the wrong order and may override correct values.

Desired behavior:
  There is no override of the values correctly computed.

closes odoo/odoo#29936
2019-01-17 12:37:36 +00:00
Lucas Perais (lpe) 187c32c2c7 [FIX] web: pivot correct context after reload
Open a pivot view with default filters automatically activating
Disable those filters

Change the groupBys on the rows and cols of the pivot

Save your result as a favorite filter

Before this commit, the filter did not contain the context information for columns groupby
Also, the search view did not exploit the context of the new filter as it should be

After this commit, the flow works as expected

OPW 1913732

closes odoo/odoo#29415
2019-01-17 12:37:25 +00:00
Jorge Pinna Puissant 91fb15510f [FIX] hr_timesheet: task view in mobile
Before this commit, there were not specific view for the mobile devices.
The analytic account views were used.

Now, there are specifics views for the timesheet in the tasks.

opw-1913371

closes odoo/odoo#30309
2019-01-17 12:26:20 +00:00
Lucas Perais (lpe) ba39efdfc6 [FIX] base: merge contacts linked to by an o2m field with caps
Define a field on a model as:
- o2m to res.partner
- the field's column, hence its name, has capital letters in it
(studio does that)

create two objects of that class, each one linked to a different partner with the new o2m

merge the partners

Before this commit, the object linked to the second partner, was deleted
This was because merge partner sql requests did not quote the column name

After this commit, the second object still exists

This commit is tested in v12.0 with PR #30300 only. In v10.0 it is not testable as
the model concerned is in CRM, and that no new fields in business modules can be added in stable

OPW 1925060

closes odoo/odoo#30301
2019-01-17 09:59:23 +00:00
Christophe Matthieu 586dc9e025 [FIX] web: can reopen ModelField selector widget
Before this fix, in studio when the user select the field then focus out
then focus in and selected a child field, an exception is triggered because
the last page is visible but the data are removed.

backport of 12.0's 9eef25ae0a

opw-1928453
closes #30277
2019-01-16 16:18:59 +00:00
Christophe Simonis 83cc046e9a [MERGE] forward port branch 11.0 up to 4c93e4be0d 2019-01-16 14:26:14 +01:00
Christophe Simonis ff2efcd1a9 [FIX] base: force label of ir.actions.server field crud_model_name
Avoid warning due to duplicated field labels.
2019-01-16 14:06:37 +01:00