Let's assume a one2many field (editable list) in a form view with
a many2many (e.g. many2many_tags), and an onchange on the one2many
such that, when a row is added to the relation, the server returns
update commands for (a subset of) the records being already in the
relation. For thoses updated records, the many2many field needs to
be read (the onchange only returns the ids in the relation).
Before this rev., the many2many field was read independently for
each record in the one2many. This could cause a performance issue
on large relations. For instance, this was the case on
account.invoice records with a lot of lines.
Issue 2027356
closesodoo/odoo#34785
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Since commit 9fbb4fb, the `title` attribute is added
to list views `<td>`. The title value is given
by field utils formatting methods, according to the
field type. However, for boolean fields, the formatting
method does not return a string but a jquery element
(unless `forceString: true` is given as an option).
Hence, the displayed title is `[Object object]`.
After this commit, boolean fields do not have any title.
closesodoo/odoo#34657
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
When answering a quiz, the button "Check your answers"
is not displayed when not in fullscreen.
JS error: `def.resolve is not a function`
because an already instantiated Promise does not have a
resolve function.
A promise cannot be resolved from outside its callback scope.
closesodoo/odoo#34762
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Since https://github.com/odoo/odoo/pull/29442, "Animations" became
"Public Widgets" (even though the Animation class still exists as an
extension of standard PublicWidget).
Since that refactoring an error was introduced which made the code
modify the prototype of the 'events' key each time a public widget with
a 'read_events' or 'edit_events' was instantiated (while the goal was
to modify the widget's own 'events' key, not from the prototype). This
was the cause of very ununderstandable errors...
closesodoo/odoo#34600
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Steps to reproduce the bug:
- Log as admin user in company C
- Go to Leaves module and click on Managers > Allocations
- Create a leave.allocation with type = Compensatory Days, duration = 7 days
mode = By Company and Company = C
- Approve the allocation
- Create a leave request LR for all the company C and approve it
- Log as demo user (only user access right for Leaves)
- Go to Leaves > My Leaves and click on "Leaves requests"
Bug:
A traceback was raised
opw:2005813
closesodoo/odoo#33899
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
The rendering of field widgets is asynchronous (as it returns a
native Promise). However, the '_renderFieldWidget' method of basic
renderers is sync, and returns a fake div that will be replaced by
the widget'$el afterwards.
The form renderer sometimes needs to add classNames on the rendered
nodes (e.g. each child of an outer group as class 'o_group_col_x').
To handle this, once the field widget is ready, we copied all
attributes of the fake node to the widget's node. Unfortunately, we
were erasing the attr value (e.g. className) by the new one. As a
consequence, the className defined in the widget were lost. This
could be observed for the 'note' field in 'sale.order'.
As this was only necessary for classNames, this rev. only retrieves
the class attribute of the fake node, and adds it to the classNames
of the widget's $el.
closesodoo/odoo#34528
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Before this commit, sometimes it was difficult to delete many2many
tag because of X sign not being displayed due to long text of tag.
After this commit, if text is long then it will have ellipsis and
we will always have X icon to delete tag.
task-1986017
closesodoo/odoo#34316
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This fix is far from perfect as you still can break things if
you clicked on the menu and change company afterwards
But it should work the first time you click on it
closesodoo/odoo#34488
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Since changes made on Promises in rev: 5f3b5f0a9d
If a user scans his badge, it's pin code if he has any, is not asked,
and he's imediatly connected to it's employee.
To avoid this behavior, we are handeling correctly the Promise to avoid
this connection shortcut.
closesodoo/odoo#34449
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Let's consider a product P with a unit price = 100€
When a price list PL with a discount of 20% was applied, and
a coupon program CP with a discount of 10% was also applied,
system still calculated the rate based on unit price of the product
and not on the discounted price.
So in this example, the amount of the CP discount was 10€ instead of
8€ because the CP discount was computed on the unit price 100€
instead of the discounted price 80€ (with 20% discount of PL)
opw:2006829
X-port/Cherry-pick of odoo/enterprise@23739e8a71
In case of failure at token creation, raise a proper UserError instead
of a generic traceback.
opw-2025723
closesodoo/odoo#34420
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Avoid crash at currency conversion when no company is set on the SO
opw-2009044
closesodoo/odoo#34408
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
It's currently possible for binary downloads to be missing an
extension entirely. Generate an extension from the mimetype and use
that. Also ensure the existing extension (if any) matches the
mimetype.
Warning: this may require adding new mimetype/extensions pairs to the
local mimetype database similar to
f413d155df.
Also fix missing or incorrect filenames on records without a filename
field: in some Odoo versions the client would send a filename of
"null", resulting in a download of e.g. "null.pdf" instead of the
attachment or inferred name.
Task 2025716
closesodoo/odoo#34299
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
The error message is built from string pieces except one that is a list.
This commit cast this list into a proper string to be able to build the
error message.
closesodoo/odoo#34402
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
- Make a SO with a product that have a carriage return in its
description
- Export FEC report
The CSV contains new lines and is not correctly formatted.
opw-2026861
closesodoo/odoo#34385
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- Install stock module
- Activate multi-company and variants
- Create a second company
- Create a product with 2 variants
- Create a picking with the product for both companies
- Add an attribute on the product with 2 values
- Save
An AccessError is raised on `stock.move`.
It arises because the field `product_qty` on `stock.move` must be
recomputed but is on a record in a different company.
The `try` / `except` clause doesn't protect against the recomputation.
Indeed, what happens is:
- try to unlink in batch => AccessError due to recomputation
- try to unlink individually => AccessError due to recomputation
- try to write individually => the field couldn't be recomputed before
(flagged as dirty), so try again to recompute => AccessError
We perform the operation as sudo, and take care of checking the access
rights beforehand.
opw-2009450
closesodoo/odoo#34369
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
There is a conflict in saas-12.3.
Indeed, the optional popup on a product when adding to cart got encapsulated
into a new module with 55ed70f405.
But 9308180089 introduced a new test in 12.0 about free delivery.
The tour expects the popup to be shown, but it is not the case anymore.
The tour needed to be adapted. Standard runbot was green since the test would
luckily be executed after `website_sale_product_configurator` would be
installed. That was not the case on runbot theme.
The chance is also taken to ensure the test is executed on the correct
delivery.
closesodoo/odoo#34367
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
When creating a new tax, before saving, the default-computed repartition lines had no country_id associated. It only 'appeared' when saving the record.
closesodoo/odoo#34359
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Before this fix, the many2one text in the list view was not wrapping.
After this fix, the text will wrap according to the available space
(managed automatically by the browser).
closesodoo/odoo#34345
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
When registering a payment against multiple vendor bills and change the memo,
the memo must be populated to all the payments. This behavior has been introduced
with the following commit in stable 11.0: c04065abd8
opw:2024652
closesodoo/odoo#34322
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Backport from 12.0 to 11.0 (commit: 3cbdfe8807)
- Have two crm teams with the same team leader, and without team members
(team1, team2 as instance).
- Create a new lead, add as Salesperson the team leader, and as Sales
team the second previously created team (team2).
- Save the new lead.
Before this commit, when we save the lead, the sales team will change,
to set the default sales team for the chosen Salesperson, in this case
team1.
opw-2005924
closesodoo/odoo#33898closesodoo/odoo#34327
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
This commit improves the elearning onboarding on the quizzes
If the user is not logged in, a log in button will show up under
the quiz
If he is logged in but not a member of the course and the course is public,
a join button will appear under the quiz
If the course needs to be bought, a buy button will appear under the quiz.
If the course is on invite only, a message under the quiz will inform the
user about it
TaskID: 2003986
PR: #33861
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>