Commit Graph
127612 Commits
Author SHA1 Message Date
Julien Castiaux 042966ccae [IMP] web: better logging of errors
When an error is raised server-side, the complete traceback is displayed
in the JS console. This traceback can be very useful since it might
contain information not recorded anywhere else by default. For example,
access errors due to record rules or SQL constrains do not have their
traceback displayed in the UI or recorded in the log [1], but it is
logged in the JS console.

However, the information is logged in the JS console as a stringified
version of the `result.error` object. The final result is a long and
non-formatted string which is unreadable.

We replace by a new format more convenient for technical teams. The
error is now formatted as:

Error code
Error message
Error data message
Error data debug

This will hopefully give a better starting point for debugging purposes.

[1] SQL constrains tracebacks are only recorded in the log in debug
mode:

https://github.com/odoo/odoo/blob/ec792da72b92b22349b6f325e53fd37d953c7db3/odoo/service/model.py#L122

closes odoo/odoo#33650

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-27 06:41:56 +00:00
Nicolas Martinelli c868da4de6 [FIX] tools: export UTF-8 characters
- Install Babel 2.3.4 as specified in the `requirements.txt`
- In a Python file, do not add the line `# -*- coding: utf-8 -*-`
- Create a translatable string with a non-ASCII character, e.g.
`Amount in €`
- Export the translation

The exported term is incorrect: `Amount in â¬`.

Since the default encoding for Python 3 is UTF-8, it is logical for the
Babel extraction to use it as a default encoding.

The issue was solved in Babel 2.4.0 with commit:

https://github.com/python-babel/babel/commit/33a8fc40d417b401162e2d20021fcbebcc4ab7db

opw-1984480

closes odoo/odoo#33671

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-27 09:11:25 +00:00
Cas Vissers ccdaf9a085 [FIX] fleet: avoid singleton error
When doing a write on multiple records, message_post expects a single record
if self.ids:
self.ensure_one()

closes odoo/odoo#33645

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-27 09:00:41 +00:00
Raphael Collet f14ae73a98 [FIX] models: do less snapshots in onchange()
As snapshots are costly to compute, we now create exactly two snapshots:
one initial snapshot and one final snapshot.  All intermediate checks
are done with respect to the initial snapshot.

Note also that checks are costly for x2many fields.  Therefore, once a
field has changed, it will never be checked again.  This optimization is
correct since, by contract, the onchanges of a field are processed at
most once.  This guarantees the absence of cycles in onchange.

For instance, assume that field A modifies fields B and C, and that
field C modifies fields D, E and F:
- before: 7 snapshots (snapshot, process A, snapshot, process B,
snapshot, process C, snapshot, process D, snapshot, process E,
snapshot, process F, snapshot)
- after: 2 snapshots (snapshot, process A, process B, process C,
process D, process E, process F, snapshot)

closes odoo/odoo#31872

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-05-27 08:20:07 +00:00
Odoo Translation Bot ec792da72b [I18N] Update translation terms from Transifex 2019-05-26 03:07:48 +02:00
Carmen Miranda 28823cf837 [CLA] Update Vauxoo's CLA
Incorporate Carmen Miranda (CarmenMiranda) as Vauxoo's contributor
I confirm I have signed the CLA and read the PR guidelines at
www.odoo.com/submit-pr

closes odoo/odoo#33627

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-23 15:04:54 +00:00
Priyanka Kakadiya 9bcc0498c0 [FIX] web: add test for the fix update buttons in editable list
The test for the fix in 5adb6b62d2 can only be implemented in 12.1
because that is the version that contains the createActionManager helper

Task-1967278

closes odoo/odoo#32817

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-05-23 11:39:48 +00:00
Adrian Torres 73235ad6ae [FIX] purchase: truncate description for stock.move.line
Before this commit, when creating a PO line with a description that was long
enough (~2712 bytes long) and then confirming the PO, a traceback would
pop up with an error from postgres "index row size exceeds maximum".

This is because when confirming a PO, a stock.move is created with a
stock.move.line mirroring the purchase.order.line, however the "name"
field on stock.move.line is indexed (whereas the purchase.order.line is
not), thus triggering the aforementioned error.

This commit solves this issue by truncating the name field on the
stock.move.line to 2000 bytes (for simplicity's sake) upon creation.

Fixes #33549

closes odoo/odoo#33607

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-05-23 11:34:07 +00:00
Nicolas Martinelli 9f7c476a6f [FIX] stock: missing picking type
- Activate 'Lots & Serial Numbers'
- Create a stockable product A, enable tracking 'By Lots'
- From the menu Inventory > Operations > Transfers, create a picking:
Set a picking type
One line of A

It is not possible to set the lot number to validate the transfer.

When creating a picking from the menu, the context key
`default_picking_type_id` is not set. Therefore, the field
`picking_type_id` is empty on the `stock.move`.

We can fall back on the `picking_type_id` of the picking.

opw-1981958

closes odoo/odoo#33611

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-23 11:11:17 +00:00
RomainLibert b016c73c89 [FIX] hr_holidays: fix typo
closes odoo/odoo#33606

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-05-23 09:33:33 +00:00
Varun Raval bf70759e14 [FIX] website_links: fix url of the landing page in link tracker
The feature was broken by #28404 which made the JS make use of the
"animations" system.

Currently, on the website, we have an option 'Track this page' in promote
section, which will give us the URL of the landing page.

However, this option is not working and shows the default placeholder
provided on the input.

This commit will fix the issue. From now 'Track this page' option will get
the URL of the landing page and it will be shown on input rather than the
default placeholder value.

task-1998160
closes #33603

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-05-23 11:12:58 +00:00
Grzegorz Krukar 8869677669 [FIX] web: form: remove invisible fields spacing
Invisible fields in form view and group reserve space.
This looks bad with many invisible fields in a form.

Fixes: #29505 and #28370

closes odoo/odoo#33598

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-05-23 08:33:32 +00:00
Robot Odoo e7fc786a74 [MERGE] sms: apply various fixes
Purpose of this merge is to provide several small fixes related to
SMS module. Those are mainly corner cases incorrectly supported
by current code.

Related to task 1922163

closes odoo/odoo#33567

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-05-23 11:28:34 +02:00
Priyanka Kakadiya 5adb6b62d2 [FIX] web: update buttons in editable list
In an editable view when editing a row, then apply or remove any groupby or
filter the control panel buttons are not updated.

When record is in edit mode in editable listview and applying groupby then
control panel buttons 'Save' and 'Discard' buttons are always displaying, this
issue occurs because when applying or removing filters control panel buttons not
updated i.e. _updateButtons not called.

With this commit button are updated when _update of list controller is called,
_update of list controller is also called from search.

Task-1967278

closes odoo/odoo#33572

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-05-23 07:39:13 +00:00
Jérome Maes 937d929b74 [FIX] sale_timesheet: allow billing user in journal entries
Since a timesheet is an analytic line, access rights are mixed for
timesheet manager and billing user, when hr_timesheet is installed.
Group mecanism use logical 'OR' between none global rules, so timesheet
access restrict the one of billing user. The ir.rule of sale_timesheet
tries to restore the access of billing user (which can thus modified
timesheet. This point is unfixable, unfortunately). This commit
completely restore (even for 'read' access) the rule for billing user,
otherwise such user can not validate an invoice if they are timesheet user.

opw-2001421

closes odoo/odoo#33575

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-05-22 14:37:50 +00:00
Nicolas Seinlet 691b0e7e6f [FIX] lunch : row_number with order
row_number without order is not invariant depending on the readed
fields. The order by clause on the partition solve this.

closes odoo/odoo#33573

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-05-22 13:28:04 +00:00
Toufik Ben Jaa dac369453c [FIX] lunch: on mobile crashes when grouping by field
- On mobile grouping by a field crashes.
This is due to the code assuming a function parameter
is always passed where it is actually an optional parameter.

closes odoo/odoo#33891

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-06-05 07:50:56 +00:00
William Henrotin 5999d47d6b [FIX] mrp: use of 'self' inside a loop
Commit a5342daf9d use an iterable inside
a loop on itself. This break as soon as 'self' has more than one element

closes odoo/odoo#33856

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-06-04 07:34:50 +00:00
Pierre Paridans 8040f85b4f [FIX] web: form's title should take all width in edit mode
Form sheet's title (with class .oe_title) when in editable mode has a
maximum width. The goal according to FP is to make a clear
differentiation between the main title/name of a record and its other
fields.

An issue with the existing rule in the Project application is that the
"title" row (with class .oe_title) not only contains the name of the
task but also its priority and state.

The aforementioned rule should then be applied only on the "name" part
and not to the whole row to prevent the "state" from moving between
read_only and editable modes.

To do so the maximum width is "moved" from the row element to the task
name's element.

Sadly the current stylesheet in this project is still a regular CSS
file, preventing us from using the SCSS expression coming from
`addons/web/static/src/scss/form_view.scss`.

Task ID: 1946570

closes odoo/odoo#33845

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-06-03 14:13:40 +00:00
Jigar Patel 1fd9d1e908 [FIX] base: allow users to define fields and templates in any order for Gantt View
Before this commit, if you try to define some field tags before the
templates tag in a gantt view you will get a validation error.

closes odoo/odoo#33826

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-06-03 11:03:14 +00:00
Cedric Snauwaert d773715046 [FIX] account: fix to_check warning being thrown when opening reconciliation widget
In the reconciliation widget, we added a to_check functionality. However in some cases, the propositions don't have a default value for
to_check, which result in a warning being thrown when doing a comparison to ensure that all lines have the same to_check value.
This commit add a default value to to_check for all propositions (when loading the data and when performing a quick create).

closes odoo/odoo#33824

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2019-06-03 09:47:00 +00:00
Xavier Morel a0bd33e0e5 [FIX] web: properly update qweb view state in reload
closes odoo/odoo#33822

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-06-03 09:49:53 +00:00
qsm-odoo 1f600826af [FIX] survey: fix assets forward-port
For saas-12.2 a file was added in survey assets with
https://github.com/odoo/odoo/commit/445541989f9dc094bf81201a715abe0a68ed1c63
(even though the file itself was added in the repo with
https://github.com/odoo/odoo/commit/afb1abbb60e5cdc4f76ab7b5a1b54b5e8a9283d5)

As a saas-12.1 fix, this was made:
https://github.com/odoo/odoo/commit/92cb648882082cc8d84d3bbe75304def5196998c
That fix split the survey assets in two parts. After forward-port, the
file added in saas-12.2 ended up in the wrong part.

Bug found while working on task-1961045

closes odoo/odoo#33821

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-06-03 09:42:13 +00:00
David Monjoie 494a2b2675 [FIX] web: log missing view warning rather than error
The point of this warning is to help a view developer realize that
his view is not loaded at all. However, console 'error' and 'warn'
are observed by the runbot clickall tour as meaningful errors
regarding a build resulting status. It makes sense, but it is an
issue for community modules which have a gantt view that only
exists in Enterprise. We don't want to create a bridge module
for each and every module which uses a view that only exists in
Enterprise, so we need to live with this warning. Since its
purpose is for developers only, they can read the log and notice
the error even if we use console.log rather than console.error,
and that will not alter the result of the runbot clickall tour.

closes odoo/odoo#33814

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-06-03 08:01:45 +00:00
Toufik Ben Jaa a7649a3d86 [FIX] sale_timesheet: performance for project with a lot of tasks
closes odoo/odoo#33766

Signed-off-by: Nicolas Seinlet (nse) <nse@odoo.com>
2019-06-03 08:19:50 +00:00
Odoo Translation Bot 15187da85a [I18N] Update translation terms from Transifex 2019-06-02 06:06:25 +02:00
Toufik Ben Jaa 7576ae519f [FIX] base: avoid crash on empty record rule domain
- Since 12.2 when a record rule forbids you to access a record
an error message is displayed with the list of the record rules
that have forbid the access and an example of the forbidden records.

The issue here is that a specific message is displayed to warn the
user that the record rule may be a "Multi-company" record rule.

To do so, it checks if `company_id` is present in the record rules'
domain but if the domain is empty it crashes.

OPW-2004827

closes odoo/odoo#33801

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-05-31 14:54:28 +00:00
Gert Pellin d92e0cb1cf [FIX] point_of_sale: return products with serial numbers
* Do a product return of a product with serial number required.
* Open the dialogue to enter the serial numbers.

Current behaviour before PR:
* A modal without any input fields will be displayed.

Desired behaviour after PR is merged:
* The modal has as many input fields as there are products to be returned.

The modal is populated by the value of `lots_required`. To get the right
value this variable should have the absolute value of the amount of
products.

After closing the modal there will be a check on the amount of serial
numbers given. This will automatically update the amount of the product.
Because this value is always positive we have to do a check on the
product quantity first to know the sign of the new value.

closes odoo/odoo#33535

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-05-22 13:25:10 +00:00
Gert Pellin ec2ea9b08d [FIX] point_of_sale: quantity of lot return
* Do a product return of a product with a lotnumber required.
* pay the order.
* Close and finalise the PoS session.

Current behaviour before PR:
* A product move is generated with a negative value with destination stock.
* Odoo will ask if you want to make a backorder.

Desired behaviour after PR is merged:
* A product move is generated with a positive value and can be set done without any issues.

To fix this problem the quantity of the picking has to be set to the
absolute value of the orderline quantity.

closes #33512
2019-05-22 13:24:52 +00:00
Nicolas Martinelli d0cd05a670 [FIX] l10n_fr_fec: new line
Commit 5dfb6e39af added the new line
characters at the end of each line but the last one.

However, it does so by adding a new element in the row: therefore, 19
columns are created instead of the 18 required.

We add the new line character at the end of the last element of the row.

opw-2000429

closes odoo/odoo#33571

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-22 13:02:55 +00:00
Nicolas Martinelli a3519638a3 [FIX] l10n_fr_fec: EcritureLib
Make sure `EcritureLib` is always filled in if the AML name is an empty string.

opw-2000429
2019-05-22 13:02:55 +00:00
Jinal Patel 84e2c85b93 [FIX] stock: return wizard in multi location
In `_create_returns`, the code creates a picking using
`self.location_id` as destination location.

When the multi location group is not active, the user has no possibility
to change this field and it is correctly initialized. When the multi
location groups is active, the user has this possibility.

If the user empties out this field and tries to validate the return,
he's faced with an error. We make this field required in the view to
prevent any issues.

Task-1986294
Fixes 24207

closes odoo/odoo#33463

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-05-22 12:48:11 +00:00
Thibault Delavallée 8386e6620c [FIX] sms: use E164 formatting to avoid having to deal with spaces
Related to task 1922163
Linked to PR #33567
2019-05-22 12:30:32 +00:00
Thibault Delavallée 7b02b88645 [FIX] sms: correctly support not mail.thread / void model in composer
SMS composer would like to support sending message to not mail.thread models
or support direct recipients as default / create. However issues in the code
prevent to effectively support that.

Related to task 1922163
Linked to PR #33567
2019-05-22 12:30:21 +00:00
Yannick Tivisse b9e5b243ac [IMP] sms: Don't overwrite default recipients on default_get
If the recipients are passed by setting 'default_recipients' on the context,
then don't overwrite the content with the method '_get_default_sms_recipients'.

For example, as an employee is a mail.thread, then the method '_get_default_sms_recipients'
exists on it. Calling this method will erase the content of the field 'recipients' that comes
from the default_recipients key in the context.

If we want to use this wizard on something else than a partner, we should avoid this
kind of overwrite.

Manual backport of fix done in 12.1 3c91ac425f
2019-05-22 12:29:48 +00:00
Thibault Delavallée 269d832b0d [FIX] sms: correctly remove unwanted spaces in phone numbers
Formatting / parsing of numbers may add spaces.

Related to task 1922163
Linked to PR #33567
2019-05-22 12:29:45 +00:00
Thibault Delavallée 416569c74f [FIX] sms: correctly compute numbers based on partners
message_post_with_sms method allow to give either numbers, either partners
or to fall back on default computation. Giving explicit partners does not
work because of wrong indentation in code not fetching their numbers.

Related to task 1922163
Linked to PR #33567
2019-05-22 12:29:35 +00:00
Goffin Simon 3418f8c4c4 [FIX] sale: T&C issue when changing partner
Steps to reproduce:
1. Create an invoice with a customer and enter some text in Terms and Conditions (field: comment).
2. Save the invoice.
3. Edit the invoice and change the customer.

Bug:
The text in Terms and Conditions was empty.

Same behavior as on the SO, if the company doesn't change the T&C should be kept.

Fine tuning of this commit: 9bf1f97d9b
Closes #32309

opw:1830838

closes odoo/odoo#33383

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-05-22 09:10:30 +00:00
Francisco Fernández @PlanetaTIC 48e93a10a1 [FIX] stock: add mising depends on computed field
The field had no triggers on the compute method.
As the field is not stored, it works fine in most cases where the value is
computed in a different transaction that the modification but when it is the
case (e.g. OCA/connector-prestashop#101), the values were incorrect

Add the correct triggers to recompute the value when needed

closes odoo/odoo#30024

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-22 07:40:32 +00:00
Jorge Pinna Puissant c89da3a683 [FIX] delivery: description of the delivery method on SO line
Backport of 610b813c87.

In this way the description of the delivery method can be used on a SO
line. If the description wasn't set, the name of the delivery method
will be used.

opw 2000169

closes odoo/odoo#33551

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-05-22 06:49:10 +00:00
Denis Ledoux b1e1c78ffa [MERGE] forward port branch saas-14 up to 0601b21bb5 2019-05-21 15:27:22 +02:00
Raphael Collet 0c912354a9 [FIX] fields: recursive stored fields
The compute method of a recursive field must be invoked on single
records even when several records are marked to recompute.

closes odoo/odoo#33529

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-05-21 12:39:02 +00:00
Denis Ledoux 0601b21bb5 [MERGE] forward port branch 10.0 up to 0a1a950c25 2019-05-21 14:26:32 +02:00
Nans Lefebvre 95f8eb410e [FIX] mail: add all attachments at template onchange
Fine-tuning of 516f22c398.
This commit missed attachments that are linked to a mail.template,
which should be added to every mail sent using the template.

To make sure that we both fix the duplicates and the generation issue,
we add a test.

opw 2000515
opw 1998782

closes odoo/odoo#33528

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-05-21 12:20:07 +00:00
Nicolas Martinelli 6356a09041 [FIX] website_quote: pricelist and template
- Create a product, sale price of 100
- Create a quotation template
Product A: 10 Units
- Create a pricelist
Product A: 10% discount for a quantity of 10
- Create a SO
- Set the pricelist
- Set the quotation template

The unit price is 100 instead of 90.

This is because we retrieve the price based on a quantity of 1 instead
on the quantity specified in the template.

opw-1998642

closes odoo/odoo#33534

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-21 13:04:50 +00:00
Nicolas Martinelli 8c4a88a3f9 [FIX] account: auto-reconcile hidden lines
- Create 11 invoices with the same partner but different totals like:
1.0, 2.0, 3.0 ... 11.0
- Confirm them
- Create a bank statement with 11 lines having each of them the previous
invoice amount (1.0, 2.0, 3.0 .... 11.0) and the partner
- Click on the 'Reconcile' button
- In the reconcile form, do NOT push the 'Load More' button, but push
the 'Automatic Reconciliation' button

All lines are reconciled, but a JS traceback is raised.

This is because we try to destroy a widgets which were not rendered.

opw-1985580

closes odoo/odoo#33524

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-21 10:51:44 +00:00
Denis Ledoux c7274a48e3 [MERGE] forward port branch saas-15 up to b1e1c78ffa 2019-05-21 16:32:48 +02:00
jev-odoo 0a1a950c25 [FIX] payment_authorize: no customer profile don't crash transaction
When transaction is approved, if for any reason the `customerProfileId`
is missing from the response, the transaction is aborted.

It should succeed even if we cannot create a customer profile.

opw-1998505

closes odoo/odoo#33501

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-20 11:29:08 +00:00
Odoo Translation Bot 7237b8f2a2 [I18N] Update translation terms from Transifex 2019-05-19 03:08:16 +02:00
Christophe Simonis d785adba6c [MERGE] forward port branch 12.0 up to c545783b95 2019-05-17 15:50:59 +02:00