Commit Graph
119929 Commits
Author SHA1 Message Date
Christophe Simonis 5adbaf827e [FIX] hr_expense: use defined variables
Oversight of previous forward-port.
2019-05-28 16:24:15 +02:00
Christophe Simonis cffd147cfd [MERGE] forward port branch 11.0 up to a20a31486c 2019-05-28 15:52:00 +02:00
Christophe Simonis a20a31486c [MERGE] forward port branch saas-15 up to cad0be27e7 2019-05-28 15:04:40 +02:00
Christophe Simonis cad0be27e7 [MERGE] forward port branch saas-14 up to 6b6d2c8455 2019-05-28 14:36:59 +02:00
Christophe Simonis 6b6d2c8455 [MERGE] forward port branch 10.0 up to 01020e18e9 2019-05-28 14:07:09 +02:00
Romain Derie e9350993ca [FIX] web: restore /apps/<app> controller
Since JS refactoring of ActionManager at 32b8cec536, the /apps/<app> controller
was not working anymore as the refactoring dropped the support of `sa` as URL
state.

closes odoo/odoo#33679

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-05-27 11:44:08 +00:00
Benoit Aimont 01020e18e9 [FIX] hr_expense: prepare method for move values
There was no way to inherit properly action_move_create method.

opw:1974069

closes odoo/odoo#33488

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-27 07:04:27 +00:00
Benoit Aimont c8b87f66f8 [CLA] Add Benoit Aimont in Acsone CCLA 2019-05-27 07:02:58 +00:00
Luis 0379c51be3 [FIX] web: refresh calendar if error
If an error is raised when saving a calendar event, the transaction is
correctly rolled back. However, the view is not refreshed and the
incorrect information is displayed.

We simply reload in all cases.

opw-2002186

closes odoo/odoo#33028

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-24 10:45:48 +00:00
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
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
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
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 37bca6ae50 [FIX] test_mail: bump again query count
Enterprise make more queries...
2019-05-17 11:48:43 +02:00
Christophe Simonis 8f6c7c20d6 [FIX] test_mail: bump query count
Oversight of previous forward-port.
2019-05-17 10:51:13 +02:00
Christophe Simonis 5f17daae40 [MERGE] forward report branch 11.0 up to daf9763e6e 2019-05-17 10:00:11 +02:00
Christophe Simonis daf9763e6e [MERGE] forward port branch saas-15 up to 68b7f2a8ef 2019-05-16 21:08:52 +02:00
Christophe Simonis 68b7f2a8ef [MERGE] forward port branch saas-14 up to fe970ad5ae 2019-05-16 21:07:53 +02:00
Christophe Simonis fe970ad5ae [MERGE] forward port branch 10.0 up to 4039fc5201 2019-05-16 21:07:21 +02:00
Christophe Simonis 4039fc5201 [FIX] website_customer: no error-prone xpath expr
closes odoo/odoo#33450

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-05-16 16:56:34 +00:00