Commit Graph
118148 Commits
Author SHA1 Message Date
Nans Lefebvre ff4f3922a9 [FIX] purchase: fix reference update at onchange
Add two PO with references 'XY' and 'Z' to a vendor bill.
The reference is computed as 'XY, Z' (with ', ' as separator).
Add a PO with reference 'X', the reference becomes 'X' instead of 'XY, Z, X'.

There are two variables that may not be defined (vendor_ref and self.reference),
and specifically the case where a reference is the prefix of another one is not
correctly dealt with.

opw 2005825

closes odoo/odoo#33841

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-06-03 13:30:42 +00:00
Rim BEN DHAOU 58d414ec1c [FIX] calendar: fix required conditions for subfields of recurrent events
For recurrent events, many fields are set to define the recurrency;
these fields are invisible unless (recurrency', '=', True).
However there are fields that depend on fields to define the recurrency,
which are required in some cases.
However in case where recurrency is later set to False, no onchange cleans up
the intermediary values (this is taken care of in the create),
but the 'required' on the non-relevant fields might prevent from saving.

We fix these cases by adding the recurrency in the list of requirements.

opw 2002181

closes odoo/odoo#32698

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-06-03 11:15:08 +00:00
Nicolas Martinelli dea93a683b [FIX] purchase: orderpoint on existing PO
- Create product A:
Reordering rule of 5 units
Set a vendor V
- Create a SO with 1 unit of A
- Create a PO with 1 unit of A for vendor V
- Run the scheduler => the PO contains 6 units
- Run the scheduler => the PO contains 12 units

The PO should not be updated the second time the scheduler is run.

It occurs because the `orderpoint_id` is not set on the PO line, while
the `_quantity_in_progress` method searches for PO lines with the
orderpoint set.

opw-2000962

closes odoo/odoo#33798

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-31 13:19:15 +00:00
Priyanka Kakadiya 0799742d05 [FIX] web_editor: restoreRange on invalid node
In a web editor, add some text, select the text, add a link and
immediately discard the link modal. Traceback.

The traceback is a execute `setEnd` on `Range`, that error is thrown
because editable DIV doesn't save old range

Odoo wrap code does some text node split in order to attach the link
just on the selected text. If it correctly re-set the underlying
structure, it does not update the $(editable) structure used to restore
ranges.

After this commit, editable div will use newly created range for the element

for ex:
-> content: test
-> selected content "test"

when click on link dialog:
ec: test , eo: 4, sc: test, so: 0
selected content  ->  start 0, end 4 -> "test" like this

after clicking on discard:
ec: null text element, eo: 4, sc: null text element, so: 0
selected content  ->  ec and sc both are null, so it will throw an error
while setting cursor position

after applying fix when click on discard:
ec: test, eo: 4, sc: test, so: 0
selected content -> start 0,  end 4 -> "test"

task - 1955863

closes odoo/odoo#33692

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-06-03 05:36:08 +00:00
Jorge Pinna Puissant 37ab5a7009 [FIX] base: ir field - set dependence as required when creating a compute field
Before this commit:
- When you create a compute field, from the model view, dependence field
was not required when creating a compute field.
- When removing the compute code, the dependence field stays marked as
required.

fine-tuning : f01c195288

opw-2003784

closes odoo/odoo#33760

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-06-03 06:10:23 +00:00
Odoo Translation Bot 72a0963d2d [I18N] Update translation terms from Transifex 2019-06-02 03:08:27 +02:00
Gabriela Mogollon 910b98c8c3 [FIX] l10n_mx: add new changes on COA according with the SAT
New account tags were added to use with the incoming of the northern border
zone of Mexico

These changes were announced in the new Annex 24 RFM 2019 [1] and define
the new accounts for the northern border zone. This change affects a
part of the CoA because these accounts are added in the middle instead
of at the end of the group.

[1] https://www.sat.gob.mx/cs/Satellite?blobcol=urldata&blobkey=id&blobtable=MungoBlobs&blobwhere=1461173688346&ssbinary=true

Closes #33631

closes odoo/odoo#33734

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-29 06:10:37 +00:00
Andreas Perhab 8242ddbc10 [FIX] website: provide favicon for pdf tabs
When opening the pdf at the end of an order Chrome tries to load
/favicon.ico which returns 404 before this patch. We provide the
favicon from the current website.

closes odoo/odoo#33746

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-29 10:02:18 +00:00
Nans Lefebvre 3e12f2ff56 [FIX] mail: fix mail template onchange
The stable behaviour of the mail composer is the following:
- if a template adds new attachments, the composer only has this list
- if a template doesn't add attachments, the list is unchanged
- if no template is set, the list is cleared up
In the case of templates, we also check that both static and dynamic attachments
are added to the list.

We clean up after c6d718f211 and subsequently 516f22c398 which failed to take
into account the fact that the attachement list could be a blend of commands
and ids.
Transforming that is taken care of by _convert_to_write, which semantics was
changed by c6d718f211.
To keep the second behaviour, we thus need to add a (5,) command.

opw 2003197

closes odoo/odoo#33706

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-05-28 18:44:09 +00:00
Uku Lagle 69b18768f4 [FIX] website_sale_wishlist, js: add to cart qty
The selector used for finding the qty field is simply 'qty', which is useless
in most cases.

While there is actually no quantity input in a wishlist template, it could be
leveraged by extension modules.

Support for same markup as found in product page seems appropriate:
input[name="add_qty"]

closes odoo/odoo#33224

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-07 18:08:51 +00:00
Nicolas Lempereur e61639723d [FIX] web: resequence work w/ discardable lines
In 11.0 091c86c21 introduced the unselection of lines when line are
resequenced to solve some issue.

There seems to be a related issue in the following use case if:

- the one2many has a handle field
- the lines have same sequence (eg. adding 2 o2m lines on new record)
- there is an invalid o2m line (eg. empty line and required field)
- without blurring, a valid line is moved

then this happen:

- the sequence of lines are computed
- the invalid line is removed
- the computed sequence of lines are applied

=> this break next onchange, because we try to apply an onchange to data
that does not exist anymore (the invalid line).

With this changeset, the invalid lines are discarded before sequences
are computed so the computation is still correct before being applied.

Without the change, the added test fails with:

5. one onchange happens when lines are resequenced (expect: 3, res: 2)
7. one onchange happens when a line is added (expect: 4, res: 2)
8. onchange worked there is 2 lines (expect: 2, res: 1)

opw-1966589
closes #33591

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-05-28 13:25:05 +00: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
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