previous implementation works slowly for products with many variants.
Performance Test
================
* ~5 K product.template
* ~14 K product.variants
* ~12 K mrp.bom
* ~414 K mrp.bom.line
Reading time for the field on a product with ~1000 variants
Measuring total request time:
* Before 9,5 sec
* After:
** without module upgrade 1,5 sec
** with module upgrade 0,3 sec
Measuring query execution in psql:
* Before 7,2 sec
* After:
** without module upgrade 0,7 sec
** with module upgrade 0,001 sec
---
opw-2494423
closesodoo/odoo#69293
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
Open a purchase order with several lines
Switch to Edit mode
Use the movement arrow on the left of a line to move it upward/downward
At the end of the operation a traceback will popup
opw-2508480
closesodoo/odoo#69724
X-original-commit: 0d7c9db6d17e3268ae01a5b2d79b513c5b24a34f
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
In the sign app, if a signature is saved in mobile resolution, when the user tries to sign a document in desktop, the size that is shown is the mobile size, which is strange for the user.
This PR is an odoo change and it modifies the library method that adds the image to the canvas, resizing the image to the canvas size.
task-2479787
closesodoo/odoo#68160
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
This fixes a bug in mass mailing, that made the toolbar still visible
while the selection was not in an editable area. It was due to a jquery
selector targetting the top document instead of the iframe's document.
closesodoo/odoo#69707
X-original-commit: 5e3cda847a42561ae709cb792d3e612f8a5e66dc
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
A colorpicker in an option positioned above the toolbar in a snippets
menu would be hidden by the toolbar because of the toolbar's z-index.
That z-index is only needed when the editor is in a modal.
The bug this commit fixes only arises when the toolbar is in a snippets
menu.
This applies the z-index only when there is a snippets menu in the page.
To accomplish that we need the "editor_has_snippets" class that the
website module applied to the body. For the sake of harmony within Odoo,
that class is now applied by snippets.editor so that no matter the
module, if there is a snippets bar, the class is on the body of its
document.
closesodoo/odoo#69680
X-original-commit: b1aa9c6093cea918337d5600ff9b16b7dd80de23
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Same reason that cdb7a8ad7647649ad8f595454aa9dc0464117568
The tour bubble animation might cause the page to flicker since the
scrollbar might appear disappear depending on size of modal / browser.
opw-2469248
closesodoo/odoo#69652
X-original-commit: 7405d2a38728d11a5a96c115d7c0c0320dd5ac8e
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Steps to reproduce the bug:
- Let's consider a journal J with inbound payment methods PM1 and PM2
- Create an inbound batch payment with Bank = J
- The default payment method will be PM2, change it to PM1
- Create a payment P in the batch content (payment_ids)
- Save
Bug:
A UserError was raised: The batch must have the same type as the payments it contains.
because when setting a partner on P the function _compute_payment_method_id defined in module account_check_printing
was triggered and the first available payment method was set.
opw:2495487
closesodoo/odoo#69683
X-original-commit: 683c3fd267162c93cb278fd903152ac387e6aba6
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
What are the steps to reproduce your issue ?
1. Add a coupon program with the following condition sale_ok == True & name == 'Large Desk'
2. Add 'Buy 1 get 2 free' 'Large Cabinet'
3. Create a quotation with 1 Large Desk and 2 Large Cabinet
4. Add the coupon code
What is currently happening ?
Promotion will only remove one * Large Cabinet price instead of 2
What are you expecting to happen ?
Promotion remove two * Large Cabinet price
Why is this happening ?
The products quantity was mixed with the reward products quantity
opw-2496940
closesodoo/odoo#69671
X-original-commit: 5c4785212fce2c97047d97e96ccbbe32e3681f59
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
Method `_onchange_workorder_ids` will create workorder_ids
for the the selected bom but it was not re-setting it on removing
BoM.
It was causing issue on `_action_confirm` as Bom for the selected
WO will not be found.
closes odoo/odoo#69662
Fixes: #68261
X-original-commit: 13832912daafad7c472d7414eaacede9e302e787
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
In mass mailing edition, in some configuration of:
- being in a modal or not
- size of window
- zoom level
we might get an error when getting the scrolling element.
For example when editing a mass mailing, if I set my viewport to 595
pixels height and have a 90% zoom, the editor is broken.
This is because in SnippetsMenu.starts `$().getScrollingElement()`
doesn't find an element that has the height of body. In my use case body
height is 329.111 pixels, and scroll height is 328 pixels.
Testing different zoom level and viewport height, the maximum difference
I was able to get was 1.25 so this commit increase to 1.5 the maxmimum
difference.
opw-2455727
opw-2469174
closesodoo/odoo#69664
X-original-commit: c7a4cca4a082af7c6b33a70d4b19e700e4d487e7
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Magic and inherited fields are not really useful on abstract models.
The _inherits specification is used anyway by models that inherit from
those abstract models.
The main goal of this change is to prepare a refactoring of models where
fields are no longer duplicated on the registry classes, but fields
defined on classes are used directly. But this new design cannot be
applied to all fields: a field being overridden simply cannot be used
directly. This branch improves the situation by avoiding unnecessary
field overridings.
closesodoo/odoo#69372
Related: odoo/upgrade#2409
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Usecase to reproduce:
- BOM PROD 1 -> No operation -> KIT COMP 1
- BOM KIT COMP 1 -> at lease one operation
Create a MO and confirm it -> Traceback.
It happens because workorders_by_bom[production.bom_id] will try to
find the bom related to production order. However they don't exist but
it will create the entry [BOM PROD 1] = mrp.workorder()
The [0] will be call on each values of the list afterward and raise
the traceback
opw-2477269
closesodoo/odoo#69651
X-original-commit: edabb86a306c4dda088b39f163de5668b5d90392
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Dropdown menus (eg.: font-size) had their contents cropped if space was
lacking underneath the toolbar. With this the user can scroll down to
see the rest of it if needed.
More info: https://github.com/twbs/bootstrap/issues/23378closesodoo/odoo#69644
X-original-commit: d360b751acfc1649673739b185b635732cf5b78f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Each time the calendar view of event.calendar is loaded,
the synchronization with google calendar was launched
and if a user open many tabs, it can lead to deadlock
Solution: Check for lock before launching the synchro,
if the transaction cannot acquire the lock, it's proably
because another synchro already started
closesodoo/odoo#69540
X-original-commit: 101598fae6fc32a49bb6d422a82b621a81201cb5
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Steps to reproduce the bug:
- Let's consider a consumable product P with a subcontracted BOM B
- Let's consider that B is subcontracted by a partner S and B has a storable component C
- C has the route Resupply Subcontractor on Order and has a partner SUP as supplier
- Create a purchase order PO with 1 P to S and confirm PO
- A delivery order DO1 is created with C to S
- Change the ordered quantity on PO and set 2 instead of 1
Bug:
DO1 was canceled and a new delivery order DO2 was created with only 1 C instead of 2
It happens due to merge move, when updating the PO line a new rule is
trigger and create the object in this order:
- Move Sub-Stock(finished) -> Subcontract Order -> Move Stock-Sub(comp)
Then the action_confirm is trigger and will run _merge_move
on object from left to right order. But when the move Sub-Stock is
merged, everything is write in the first move and the new move is
unlink. It result by canceling all the following object (so the new
subcontractor and the Move Stock-Sub). It was not an issue for the
subcontracting since the write of stock.move is overridden in order
to update the order quantity when the move quantity is updated.
However in this case the rule are not triggered in order to create
the moves that ressuply the subcontractor.
In order to avoid this mess, this PR prevent the merge in case of a
subcontracting move.
opw-2419222
closesodoo/odoo#69553
X-original-commit: c6447e724b9df3c25c5a5306fc902dfc5dcd6bb8
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Co-authored-by: simongoffin <sig@odoo.com>
- Create a product:
* Invoicing Policy: Delivered quantities
* Re-invoice Expenses: At cost
- Create a SO with the created product in Order Lines
- Make sure the subtotal of the SO line is equal to 0, by setting an Unit Price to 0
or by applying a 100% discount
- Confirm SO and create an invoice (Regular invoice)
- Post the invoice
A new line with the same product and the same delivered quantity is added to the SO.
It is not possible to invoice a SO line with a product having an expense policy and
a subtotal equal to 0, without having it reinvoiced to the SO.
This fix will prevent account move lines linked to a SO line from being reinvoiced.
opw-2479560
closesodoo/odoo#69623
X-original-commit: b41cf0077c9a6d1d74cc0c7987c0edcc58e368d1
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Generic chart of accounts such as Syscohada don't have any country_id set. When installing them on a company without any account_fiscal_country_id, no country could be assigned to the account.tax being created, hence crashing, as country_id is required on account.tax. We now prevent that by raising a more comprehensive error.
closesodoo/odoo#69593
X-original-commit: a253bf331b2448194106523b9c3d753fb6ddd04a
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Add a new parser in the ace for the qweb highlight. This makes it possible
to visualize the qweb tags and the part of code.
Used in the website and in xml fields.
closesodoo/odoo#69609
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
When trying to send&print a move without partner_id, which can be done
from the tree view of the account moves, a traceback will be raised when
the address is being validated.
This change will make sure to avoid that and also shows that the adress
is not complete in the wizard if needed.
closesodoo/odoo#69602
X-original-commit: 0ce5f8617fdcf3601f937c35660563cb3c79fbbe
Signed-off-by: William André (wan) <wan@odoo.com>
Before this commit,
It was always displaying `BoM Structure & Cost` for BoM Structure and
BoM Structure & Cost report.
With this commit, we are displaying correct report name based on report type.
closesodoo/odoo#69595
X-original-commit: e47f7db5ead8719d76f5fe1afd451f0ce113864b
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
This commit fixes few views related to mass mailing for ensuring their
proper behavior. The changes are listed as below:
- in the mass mailing form view (view_mail_mass_mailing_form), made the
mailing_type field readonly if the mailing is not in draft state to
prevent switching the type once mailing is launched.
- in the mass mailing sms form view (mailing_mailing_view_form_sms), made the
'body_plaintext' field readonly if the mailing is in sent/done state to
prevent sms content modification after the sms are already sent
Task ID-2390284
COM PR odoo/odoo#62740
ENT PR odoo/enterprise#15098closesodoo/odoo#69600
X-original-commit: 94f1994c08d3a54f6358c31634ff27532da2a569
Related: odoo/enterprise#17846
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Strings in python expression in 't-att-placeholder' are not translated
automatically.
opw-2467404
closesodoo/odoo#69559
X-original-commit: 8f8d55ee4e773884ab35e11bfd0573d7997f3ad3
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
What are the steps to reproduce your issue ?
Try to merge two mailing lists
What is currently happening ?
Traceback
opw-2504230
closesodoo/odoo#69601
X-original-commit: 66af485530cfc2f5e224b70850b011f0c05743d0
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
In a migrated db without this fix, you have twice "Grant portal access"
in partner form view, one will fill the partner in the wizard, the other
will launch the wizard without any pre-selected partner.
closesodoo/odoo#69586
X-original-commit: 6c321814dac1f17fa9a1f3f1b6d59c6d45a8cc0d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
Inline domain editor`s selector should be visible outside of modal (dialog
/ popup). This change has to work globally.
CURRENT
When inline domain editor is used in any modal (dialog) its details are
hidden inside model body. we have to scroll-down in model-body for accessing
domain-editor selection. Inline editor`s overflow is visible only
in coupon module, but this should be the default behavior.
SPECIFICATIONS
Changes overflow property of model-body if domain widget is used as
inline_model. The Inline domain editor`s selector (drop-down) will be
visible outside of modal-body.
TaskID ID-2480625
closesodoo/odoo#68586
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The domain field widget is now adapted to set visible overflow on modal if it
iss inline. With that changes, the custom controller for coupon generator is
not needed anymore.
With this commit, we remove the code related to custom controller
of coupon generator that used to set visible overflow on the modal.
Task ID-2480625
COM odoo/odoo#68586
When we have (inline) domain widget within a modal, user can not see
all the fields because overflow is hidden on the modals by default.
This is not ideal behavior.
With this commit, when the inline domain editor is opened with field
widget within a modal, we allow field selector to overflow by
manually setting visible overflow on the parent modal. The changes
are inspired by 'DomainSelectorDialog'.
Task ID-2480625
COM odoo/odoo#68586
Purpose
=======
Return the "is_company" field for the <res.partner>, so when the partner
has no image, we can display the appropriate placeholder image
(person for non-company and buildings image for company).
Task 2496443
closesodoo/odoo#69562
X-original-commit: 37766d3ef32816f332cd285cce8dbb1fa5e4b66a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
When a pricelist is set to display a discount, it also display the price
difference when the price is increased for a reason.
To avoid such an anoying behavior, that'll show that the price of a
product as been increased by aplying a discount, we only show the old
price when it has been decreased.
closesodoo/odoo#69572
X-original-commit: 45a2a36f3f0a94731d44de201f0cd3d88f50b2b3
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Report stock quantity defines a custom SQL View in init function,
inline the view CTE to improve performances of the
product.template/product.product forecasted quantity reports.
Remove product_tmpl_id related attribute and add product_tmpl_id
in SQL View's Select/Group_by to allow pushing down tmpl_id filters
in query plans.
closesodoo/odoo#69555
X-original-commit: 4c62765195a6410da1c4e74c0f1a0fcf57c38e97
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
The try/except is there to check that the string can be interpolated, so
it is catching a ValueError. But if there is a singleton error (when the
length of `self` is bigger than 1), it will raise a ValueError too.
The UserError raised in the except is then weird/wrong.
closesodoo/odoo#69551
X-original-commit: 36ebbb6f312d488b33bae098546ff71baf578a08
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Signed-off-by: William André (wan) <wan@odoo.com>
With this commit, it is now possible to group the records of a model by
a Many2many field of said model.
The result of a read_group grouped by a m2m will return as many entries
or "groups" as there are different records in the comodel that are
linked to the model through the m2m, plus a null/false group, for records
of the model that have no linked records of the comodel or for records
of the comodel for which the current user has no read access to due to
ir.rules.
For a more illustrated explanation, the tests should cover all cases in
detail.
Note that this commit only introduces this change at the ORM level, the
frontend does not yet handle grouping by m2m fields but it is planned
in the near future.
Task-2428971
closesodoo/odoo#68958
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
From having to work with it recently, it was not super clear what each
argument did (especially the link argument), and more documentation =
more betterer code
This commit simply improves the modules tree view by removing the tree
"decorators" and replacing it by a badge widget with associated decorators on
the 'state' field.
Indeed, the previous implementation could make the tree view look a bit "scary"
at first opening because it would color a lot of lines in red (modules were
not installed), giving it a feeling or "error" where there was none.
Now the color is directly shown on the state field, making it clear it's
related to that information.
Task-2507703
closesodoo/odoo#69374
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
`setCursor` routinely failed to actually select the target link on
destroy the link tools because the nodes passed to it were not in the
DOM. This fixes that problem, which in turns has the effect of keeping
the editor's toolbar in the sidebar on the website builder after link
insertion.
closesodoo/odoo#69525
X-original-commit: c8fa05813da82fd2b282721f3a86053b7b6661ba
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Prior to this fix, pressing CTRL+Z right after saving a link dialog
didn't do anything because the dialog prevents the focus from being in
the editable, even though the range is in the link. This waits for the
dialog to be removed from the dom so we can force the focus on the
editable.
X-original-commit: 769a22a579e4622861ca239084d7259820266b23
Prior to this fix, link tools didn't create a history step when they
were destroyed, meaning that you couldn't undo the creation of the link.
This ensures that the link tools are destroyed whenever a click is done
outside the toolbar, which ends the link edition and commits it to the
DOM. At that moment we can consider the link edition is over, equivalent
to saving the link dialog, and we can create a history step.
X-original-commit: 9b10c5923dadab3a49d474eb236c7c2617fb4be0
PURPOSE
Purpose is to have more tests when sending mail mailings, notably about
canceled or failed mails or sms as well as jinja and links rendering.
SPECIFICATIONS
In this commit we improve Email/SMS Marketing mailing tests. We notably
* add tests for void and invalid emails and numbers. It allows to check they
correctly update their trace status;
* add tests for unsubscribe and view links embedded in mass mailing emails
and sms;
* add tests to simulate a click on links sent through mass mailing and
ensure click statistics are effectively updated;
* add tests to simulate bounce emails coming back to the mail gateway;
Default content of mailings used in test is updated to ensure jinja is
correctly rendered, including links and some corner cases. This will also
helps ensuring behavior is kept when converting to QWeb. Both text- and
html-based jinja rendering for links is now tested.
Various docstrings are added to helpers and custom asserts. Various helpers
are improved or cleaned, with some old methods kept for backward compatibility.
LINKS
Task ID-2508643
Followup of #68874 (improve mail tests)
Prepares Task ID-27033 (support QWeb in templates)
Prepares Task ID-2377974 (clean trace and status management in mass mailing)
closesodoo/odoo#69518
Forward-port-of: odoo/odoo#69505
Forward-port-of: odoo/odoo#69461
Related: odoo/enterprise#17821
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
SPECIFICATIONS
Traces are sent to normalized emails. If email is invalid email set on traces
is void as we cannot normalize it. In this commit we set it to the original
value of email, allowing to debug or at least understand what was wrong. It
also makes behavior coherent with SMS Marketing.
LINKS
Task ID-2508643
Prepares Task ID-27033 (support QWeb in templates)
Prepares Task ID-2377974 (clean trace and status management in mass mailing)
COM PR odoo/odoo#69461
ENT PR odoo/enterprise#17780
X-original-commit: af841ccece14ffee0291f761d5363eceded65dfc
PURPOSE
Purpose is to have more tests when sending sms mailings, notably about
canceled or failed mails or sms as well as jinja and links rendering.
SPECIFICATIONS
In this commit we improve SMS Marketing mailing tests. We notably
* add tests for void and invalid email and numbers. It allows to check they
correctly update their trace status;
* add tests for unsubscribe and view links embedded in sms marketing;
* add tests to simulate a click on links sent through sms marketing and
ensure click statistics are effectively updated;
* ensure content of sent sms are checked;
Default content of mailings used in test is updated to ensure jinja is
correctly rendered, including links and some corner cases. This will also
helps ensuring behavior is kept when converting to QWeb.
In event we now correctly use sms gateway mock to ensure SMS finding.
In link_tracker a helper is added to check url tracking in plaintext content.
LINKS
Task ID-2508643
Followup of odoo/odoo#68874 (improve mail tests)
Prepares Task ID-27033 (support QWeb in templates)
Prepares Task ID-2377974 (clean trace and status management in mass mailing)
COM PR odoo/odoo#69461
ENT PR odoo/enterprise#17780
X-original-commit: f1182b9da9aca9e67518fc10c240f3b21895a7ab
Partial backport of odoo/odoo@3e6bbedb64 . Purpose is to have expected being all
traces generated at beginning of mailing. Ignored should not be removed from
that expected count.
LINKS
Task ID-2508643
Prepares Task ID-27033 (support QWeb in templates)
Prepares Task ID-2377974 (clean trace and status management in mass mailing)
COM PR odoo/odoo#69461
ENT PR odoo/enterprise#17780
X-original-commit: 0ea1b0099dcd31b3a9d7639feca6992c811a0b29
PURPOSE
Purpose is to have more tests when sending mail mailings, notably about
canceled or failed mails or sms as well as jinja and links rendering.
SPECIFICATIONS
In this commit we improve Email Marketing mailing tests. We notably
* add tests for void and invalid email and numbers. It allows to check they
correctly update their trace status;
* add tests for unsubscribe and view links embedded in mass mailing emails;
* add tests to simulate a click on links sent through mass mailing and
ensure click statistics are effectively updated;
* add tests to simulate bounce emails coming back to the mail gateway;
Default content of mailings used in test is updated to ensure jinja is
correctly rendered, including links and some corner cases. This will also
helps ensuring behavior is kept when converting to QWeb.
Various docstrings are added to helpers and custom asserts.
LINKS
Task ID-2508643
Followup of odoo/odoo#68874 (improve mail tests)
Prepares Task ID-27033 (support QWeb in templates)
Prepares Task ID-2377974 (clean trace and status management in mass mailing)
COM PR odoo/odoo#69461
ENT PR odoo/enterprise#17780
X-original-commit: 7b940ad46bde30f9bf16837f7bff5a70cd88c640