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.
closesodoo/odoo#33679
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
There was no way to inherit properly action_move_create method.
opw:1974069
closesodoo/odoo#33488
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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
closesodoo/odoo#33028
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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#L122closesodoo/odoo#33650
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- 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
closesodoo/odoo#33671
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
When doing a write on multiple records, message_post expects a single record
if self.ids:
self.ensure_one()
closesodoo/odoo#33645
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
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)
closesodoo/odoo#31872
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
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
closesodoo/odoo#33627
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
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#33549closesodoo/odoo#33607
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
- 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
closesodoo/odoo#33611
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Invisible fields in form view and group reserve space.
This looks bad with many invisible fields in a form.
Fixes: #29505 and #28370closesodoo/odoo#33598
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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 1922163closesodoo/odoo#33567
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
closesodoo/odoo#33572
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
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
closesodoo/odoo#33575
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
* 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.
closesodoo/odoo#33535
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
* 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
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
closesodoo/odoo#33571
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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
closesodoo/odoo#33463
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
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
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
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
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: 9bf1f97d9bCloses#32309
opw:1830838
closesodoo/odoo#33383
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
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
closesodoo/odoo#30024
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
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
closesodoo/odoo#33551
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
The compute method of a recursive field must be invoked on single
records even when several records are marked to recompute.
closesodoo/odoo#33529
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
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
closesodoo/odoo#33528
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
- 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
closesodoo/odoo#33534
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- 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
closesodoo/odoo#33524
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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
closesodoo/odoo#33501
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>