Commit Graph
116948 Commits
Author SHA1 Message Date
Romain Derie 3a496f18fa [FIX] web: forward-port 10.0->11.0 (CORS error handle)
CORS error was firsly fixed with 4bd8e3e2ed in 11.0
Then it was cherry-pick'd and improved in 10.0 with 9f1438d5f1.
But the improvement was lost during forward port from 10.0 to 11.0.

This commit adds the lost fix.

Closes #26812
2018-09-08 12:58:53 +02:00
Jeremy Kersten e1b142bd9f [FIX] website_sale, website_sale_stock: fix deps
Commit d25719cd use in website_sale the field sale_delay defined in stock and
so only available with the module bridge website_sale_stock only.

After this commit, website_sale without stock works again.

This commit closes #26855, closes #24671
2018-09-07 23:05:30 +02:00
rocketgithub a5d28e0e95 [FIX] base: correct currency code for Guatemala
The correct code is GTQ, QTQ does not exists
https://www.xe.com/currency/gtq-guatemalan-quetzal
2018-09-07 14:24:06 +02:00
rocketgithub 9647faa825 [CLA] signature for rocketgithub
Done at #26781
2018-09-07 14:23:50 +02:00
jcoux c5dce48fbe [CLA] Signature for jcoux
Closes #26841
2018-09-07 14:21:05 +02:00
len-odoo 9b602ae648 [FIX] base: allow to use Python builtins in views
Py.js does support Python builtins, e.g. abs, len, str, which can
be used in views if the view validation accepts it.

opw 1879160
2018-09-07 11:38:22 +02:00
Nicolas Martinelli 7e83ea8d57 [FIX] point_of_sale: restrict price control
- Activate the Price Control option in the POS
- Connect as Admin => you are allowed to modify the price
- Switch the user to Demo => you are still allowed to modify the price
- Switch back to Admin => you are not allowed to modify the prices

The two last steps are clearly incorrect.

The reason is the following.
The function `applyAccessRights` is bound to `'change:cashier'` event of
the `pos` at:

https://github.com/odoo/odoo/blob/d25719cdf2b8a863c1a855f2e42e9c3a43580f66/addons/point_of_sale/static/src/js/screens.js#L389

When switching the user, 2 steps are performed:
1. Set the cashier on the `pos`
2. Set the cashier on the `pos.db`

https://github.com/odoo/odoo/blob/d25719cdf2b8a863c1a855f2e42e9c3a43580f66/addons/point_of_sale/static/src/js/models.js#L646-L647

Step 1 will trigger the function `applyAccessRights`, which calls
`pos.get_cashier`. However, the latter retrieves the user on `pos.db`
first, and falls back on `pos`.

https://github.com/odoo/odoo/blob/d25719cdf2b8a863c1a855f2e42e9c3a43580f66/addons/point_of_sale/static/src/js/models.js#L642

This means that we retrieve the cashier in the `pos.db` before it is
actually set (in step 2).

To avoid this, we explicitly retrieve the cashier on the `pos`, then
fall back on the usual `pos.get_cashier` function.

Closes #26814
opw-1871189
opw-1881172
2018-09-07 09:29:38 +02:00
Aaron Bohy a51a5b70d3 [FIX] web: FieldDomain: reset field with a new domain
Before this rev., there was a crash when a FieldDomain was reset
with a new domain (e.g. coming from an onchange). For instance, it
crashed in Email Marketing > create new Mass Mailing > select
mailing lists. Introduced by 68332a01.

opw-1882850
2018-09-07 08:37:45 +02:00
Christophe Simonis 737ca0eb42 [FIX] web: adapt newly added test (2) 2018-09-06 17:27:50 +02:00
Christophe Simonis 63f95760ef [FIX] web: adapt newly added test
Oversight of previous forward-port
2018-09-06 17:23:27 +02:00
Christophe Simonis 505e42b78b [MERGE] forward port branch saas-15 up to 5a5d6d1e8e 2018-09-06 17:00:26 +02:00
Xavier Morel a3cd0ac2ce [FIX] project: add access token to task attachment display
Following CDN expansion (d98b262398)
portal attachment links now go through the CDN, which is an issue for
restricted-access attachments e.g. attachments bound to specific objects
(such as support tickets).

Add an access token to the attachment links in the /my/task template.

Cf OPW-1882014 (fixed ad-hoc by editing the relevant view on odoo.com)
2018-09-06 16:44:00 +02:00
Goffin Simon d3dc5048e4 [FIX] purchase_requistion: Duplicate purchase agreement with "Run sch…
…eduler"

Steps to reproduce the bug:

- Let's consider P a product with routes "buy" and "mto" and with
purchase_requistion = 'Propose a call for tenders'

- Let's consider a BOM B with P as component

- Create a MO for B

- Run the scheduler two times

Bug:

Two purchase agreements have been created for the the same MO.

opw:1882280
2018-09-06 16:05:13 +02:00
Christophe Simonis 5a5d6d1e8e [MERGE] forward port branch saas-14 up to c7de55dc3c 2018-09-06 15:30:59 +02:00
Christophe Simonis c7de55dc3c [MERGE] forward port branch 10.0 up to 72f76caa39 2018-09-06 15:29:08 +02:00
Nicolas Martinelli 79a7d58a1c [FIX] sale: prevent confirmation of SO
Prevent the confirmation of a SO in state 'cancel' or 'done'.

opw-1881333
2018-09-06 15:05:09 +02:00
Nicolas Martinelli 765a3bf23f [FIX] account: unreconcile cash basis
- Set up a tax as 'Based on Payment'
- Create an invoice at date D with this tax
- Pay the invoice at date D+1
- Unreconcile

A reversal entry is made at the current date, while it should be at the
payment date D+1.

We make sure to use the payment date only if the payment period has not
been locked.

Fixes #25738
opw-1870467
2018-09-06 14:45:40 +02:00
Pedro M. Baeza 89c1555096 [FIX] website: Unlink several website.page records
Avoid singleton error

This commit closes #26825

Partial backport of saas-15 - multiwebsite commit
2018-09-06 13:57:18 +02:00
Uku Lagle 900341bed8 [FIX] assetsbundle: prevent unlink old_attachments twice
When bundle contains both, sass and less, the unlink on old_attachments
will be called twice and thus results in MissingError.

This commit closes #26110
2018-09-06 13:56:39 +02:00
Jeremy Kersten 9512cdf308 [FIX] website_sale: remove useless widget on multiimage that generate log in js
remove warning:
Missing widget: checkbox for field group_website_multiimage of type boolean

This commit closes #25936
2018-09-06 13:56:39 +02:00
Nicolas Lempereur 72f76caa39 [FIX] web: relativedelta>11months work as expected
Since march 2015, using in a domain "relativedelta(months=X)" with
X being bigger than 11 or lower than -11 would result in an error.

This is because in the refactoring adding modules (e8a00bc50d) the two
functions divmod and utils.divmod with different implementation in
pyeval.js were replaced by one function divmod in web.utils module.

But there was still an usage of the removed implementation.

opw-1880766
closes #26816
2018-09-06 13:14:42 +02:00
Goffin Simon d25719cdf2 [FIX] website_sale: customer_lead in the shop
Let's consider a product P with a sale_delay = 10
When creating a SO for P in the backend, the customer_lead is correctly
set to 10. But when creating a SO in the shop for P, the customer_lead
was not correctly set.

opw:1880577
2018-09-06 10:29:20 +02:00
Goffin Simon 3504529fb5 [FIX] sale: Server Error when trying to process card
Due to this commit: b367625248
The function "_get_payment_type" was not defined in module "sale_payment" but defined in "website_quote"
The bridge module for "website_quote" and "sale_payment" is "sale" so the first definition of "_get_payment_type"
must be in "sale".

opw:1881990
2018-09-06 08:36:04 +02:00
Christophe Simonis 213759b03e [MERGE] forward port branch saas-15 up to e1e27aa009 2018-09-05 18:17:03 +02:00
Christophe Simonis e1e27aa009 [MERGE] forward port branch saas-14 up to 6773d3644e 2018-09-05 17:27:46 +02:00
Christophe Simonis 6773d3644e [MERGE] forward port branch 10.0 up to 1d0940d96f 2018-09-05 17:27:13 +02:00
Goffin Simon 9e99e5e641 [FIX] base: Execute group config on modifications only
Fine tuning of a06747c03d
In some cases, it was not possible to change some settings

opw:1881081
2018-09-05 14:11:25 +02:00
Goffin Simon 568445a327 [FIX] pos_sale: group_by for POS in dashboard
Steps to reproduce the bug:

-Go to Sales > Dashboard > Point of Sale > Settings
-Set nothing as group_by value
-Go back to Dashboard

Bug:

A traceback was raised.

opw:1881444
2018-09-05 13:40:06 +02:00
len-odoo f4f1480a3e [FIX] web: lock handle when sorting on a different field
The resequence mechanism works if the sequence is sorted by its handle field.
Therefore sorting on another field should lock the handle, while sorting on the
handle field should unlock the handle.

opw 1867049
2018-09-05 13:09:36 +02:00
Nicolas Lempereur 1d0940d96f [FIX] base: allow get_template serialization retry
When two transactions conflicts (eg. deleting same data, see [1]) Odoo
will retry the whole transaction several times hoping for the best.

But when rendering template, the error handling would prevent this
feature. For example a recurring issue was:

- loading quickly two times the /web route
- for each recompute the assets

=> this could lead to 2 concurrents transactions that would delete
previous same attachment (ie. DELETE FROM ir_attachment where id=3).

With this changeset, when getting a template fails because of a
transaction rollback, we let the issue bubble up so our retry system is
used.

So instead of a "500 Internal Server Error" page and in log:

  bad query: b'DELETE FROM ir_attachment WHERE id IN (3)'
  ERROR: could not serialize access due to concurrent update
  "GET /web HTTP/1.1" 200 -
  "GET /web HTTP/1.1" 500 -
  ... big traceback ...
  load could not load template

we would get the requested page without error and:

  bad query: b'DELETE FROM ir_attachment WHERE id IN (3)'
  ERROR: could not serialize access due to concurrent update
  "GET /web HTTP/1.1" 200 -
  SERIALIZATION_FAILURE, retry 1/5 in 0.8920 sec..
  "GET /web HTTP/1.1" 200 -

As a side node, the issue was exacerbated in some instances:

- when running a database on another server: assets are recomputed
- when a module was installed/uninstalled: assets may are recomputed
- when updating the source code: assets may be recomputed
- when starting server: requests could be stacked waiting for readiness
- when using google chrome: the "Use a prediction service to load pages
  more quickly" option may load a page two times. for example:
    -> an URL is entered in address bar
    -> a prediction request to it is started URL
    -> go to this page (Enter) when that request is not already resolved
    -> the prediction request is cancelled and a new request is started

[1] https://www.postgresql.org/docs/9.6/static/transaction-iso.html#XACT-REPEATABLE-READ

note: 10.0 backport of 11.0 #26778

opw-1849167
closes #26785
2018-09-05 10:20:50 +02:00
Nicolas Lempereur c0c9049f2f [FIX] base: allow get_template serialization retry
When two transactions conflicts (eg. deleting same data, see [1]) Odoo
will retry the whole transaction several times hoping for the best.

But when rendering template, the error handling would prevent this
feature. For example a recurring issue was:

- loading quickly two times the /web route
- for each recompute the assets

=> this could lead to 2 concurrents transactions that would delete
previous same attachment (ie. DELETE FROM ir_attachment where id=3).

With this changeset, when getting a template fails because of a
transaction rollback, we let the issue bubble up so our retry system is
used.

So instead of a "500 Internal Server Error" page and in log:

  bad query: b'DELETE FROM ir_attachment WHERE id IN (3)'
  ERROR: could not serialize access due to concurrent update
  "GET /web HTTP/1.1" 200 -
  "GET /web HTTP/1.1" 500 -
  ... big traceback ...
  load could not load template

we would get the requested page without error and:

  bad query: b'DELETE FROM ir_attachment WHERE id IN (3)'
  ERROR: could not serialize access due to concurrent update
  "GET /web HTTP/1.1" 200 -
  SERIALIZATION_FAILURE, retry 1/5 in 0.8920 sec..
  "GET /web HTTP/1.1" 200 -

As a side node, the issue was exacerbated in some instances:

- when running a database on another server: assets are recomputed
- when a module was installed/uninstalled: assets may are recomputed
- when updating the source code: assets may be recomputed
- when starting server: requests could be stacked waiting for readiness
- when using google chrome: the "Use a prediction service to load pages
  more quickly" option may load a page two times. for example:
    -> an URL is entered in address bar
    -> a prediction request to it is started URL
    -> go to this page (Enter) when that request is not already resolved
    -> the prediction request is cancelled and a new request is started

[1] https://www.postgresql.org/docs/9.6/static/transaction-iso.html#XACT-REPEATABLE-READ

opw-1849167
closes #26778
2018-09-05 09:43:53 +02:00
Nicolas Martinelli e673484b35 [FIX] web_editor: image name
Add the image name in the website for SEO purpose. This is a backport
of:
88a5d9a000
886c07dabb
152e3f8686

opw-1880472
2018-09-05 09:42:10 +02:00
Nicolas Martinelli 88a5d9a000 [FIX] web_editor: image name
Add the image name when the image is uploaded.

Complement of commits 886c07dabb and 152e3f8686

opw-1880472
2018-09-05 09:10:37 +02:00
Goffin Simon c3812c8e62 [FIX] account: Country in invoice analysis
Steps to reproduce the bug:

- Create a contact without a parent company and set a country on it
- Link this contact to a parent company that has no country defined
- Create an invoice for the contact
- Go to Accounting / Reporting / Management / Invoicing, switch to Pivot view and group by country
=> the invoice for the contact is classified under "Undefined" even though it actually has a
country set when you go see the invoice

opw:1878819
2018-09-05 09:06:52 +02:00
Nicolas Martinelli ea5912fedd [FIX] point_of_sale: pricelist
- Create 2 pricelists A and B. Pricelist B relies on A.
- Make B available in the POS, but not A
- Start a POS session

The user faces a black screen without any information on the error.

We add a simple alert so that the user knowns the source of the problem.

opw-1874397
2018-09-05 08:59:16 +02:00
Nicolas Martinelli 31981731ea [FIX] web: time display
The calendar should use the time format of the language parameters.

Partial backport of d4b5668c1a

opw-1881335
2018-09-05 08:53:35 +02:00
Jesús Alan Ramos Rodríguez 5b13a45fb8 [FIX] doc: Change name of method in documentation
invalidate_all no longer exists

Closes #26613
2018-09-04 17:04:33 +02:00
Christophe Simonis 2a13863f43 [MERGE] forward port branch saas-15 up to 653bbbc733 2018-09-04 17:02:36 +02:00
Christophe Simonis 653bbbc733 [MERGE] forward port branch saas-14 up to 14f8ef59b8 2018-09-04 16:48:31 +02:00
Christophe Monniez 229c119999 [FIX] hr_recruitment: limit new hired filter to group
In Employees views, selecting New Hired filters leads to an access error
with a simple user.

With this commit, this filter is limited to the corresponding users
group.

Backport of 804b9b7c5e
2018-09-04 16:40:21 +02:00
Christophe Simonis 14f8ef59b8 [MERGE] forward port branch 10.0 up to 0f0e43ae55 2018-09-04 16:11:09 +02:00
Christophe Simonis 0f0e43ae55 [MERGE] forward port branch 9.0 up to 61b771256c 2018-09-04 15:23:54 +02:00
Goffin Simon 54ed832cdb [FIX] website_event: Not possible to edit badges
In 11.0, it's not possible to edit a badge, so the button "Edit Badges"
must be called "Preview Badges"

opw:1878949
2018-09-04 14:06:43 +02:00
len-odoo 80156aa919 [FIX] base: allow a user to attach documents to his profile, without administration access rights
The res.users class contains special fields that bypass access rights.
These are designed to allow a user that does not have the possibility to write
on res.users to modify their own fields, such as the mail signature.
Create and write are overriden to make it so, however the check_access_rights
isn't.
Since this method does not work at field level but at model level, there is no
easy way to resolve the incoherence.

Uploadding an image to a signature would add an attachment to the signature;
before being created, an attachment checks if the user has the rights to write
on the target model. The incoherence thus make it fail.

We add a special case when creating an attachment so that a user can write on
itself.

opw 1871243
2018-09-04 12:20:17 +02:00
Nicolas Martinelli eaff0a71bd [FIX] web: export field with '/'
- Activate lots and SN
- Go to Inventory > Inventory Adjustments
- Export a record
- Select the field 'Inventories > Lot/Serial Number'

The `name_get` of the field is exported, not its XMLID.

This is because the parsing made in order to limit the depth of export
is made on the label, not on the field name.

Actually, it is not clear WHY this limitation exists, but we keep it for
compatibility purpose.

opw-1877092
2018-09-04 11:40:19 +02:00
Nicolas Lempereur 4cb585ab4f [FIX] web: ignore default_* on group creation
When a column is created in the kanban view, the context of the window
action is fully given but it may contain default_{field_name} context
keys that are intended for the action model.

eg. on a product.product view we could have {default_type:'product'} in
the context, if we grouped by company_id and created a new company, we
would the context is propagated and we would try to set type='product'
on the company (which causes an error).

Without the change, the added test fails with:

  default_* should be removed from context, actual: "true", expected: "false"

opw-1879064
closes #26676
2018-09-04 11:03:15 +02:00
Goffin Simon 15c81d74a3 [FIX] mail: Timezone issue when creating a call
Steps to reproduce the bug:
- Let's consider the today date = D
- Set on your preference a timezone which has another today date = D+1
- Go to CRM > Configuration > Activiy types > Call
- Set 0 as # Days
- Go to CRM > Pipeline > Click on a lead
- Schedule an activity of type = Call

Bug:

The Due Date = D instead of D+1

opw:1877217
2018-09-04 09:20:24 +02:00
Lucas Perais (lpe) 06cd145a79 [FIX] sale_timesheet: fixup timesheet cost
fixup e65c8826ef
fixup da2140b

closes #26746
2018-09-04 09:09:30 +02:00
Nicolas MartinelliandGert Pellin 9999661cd0 [FIX] payment_authorize: add first name and last name
The `createCustomerProfileRequest` requires a first name and a last
name for several payment processors.

Reference:
https://developer.authorize.net/api/reference/#customer-profiles-create-customer-profile

opw-1878218

Co-authored-by: Gert Pellin <gpe@odoo.com>
2018-09-04 08:25:46 +02:00
Nicolas Lempereur 7a453b0b7a [FIX] web_editor: focus lost with inline editor
When an inline editor is eg. in a form view, the focus is always stolen
by it.

This is because we trigger a mouseup on the editor to update its
toolbars values and informations.

In 10.0 this was not necessary since the default values were sanely set
when the editor was inside the DOM. In 11.0 the editor is not in the DOM
when this is being done and the info was wrong (eg. NaN for text size).

With this commit, we don't steal the focus and get the default like it
was done in 10.0 instead.

fixes #26366
opw-1874880
closes #26582
2018-09-03 16:51:20 +02:00