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
closesodoo/odoo#33841
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
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
closesodoo/odoo#32698
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
- 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
closesodoo/odoo#33798
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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
closesodoo/odoo#33692
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
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
closesodoo/odoo#33760
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
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.
closesodoo/odoo#33746
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
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
closesodoo/odoo#33706
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
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"]
closesodoo/odoo#33224
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
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>
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>