This commit sets the username's foreground color to match the one from
the body to avoid having a white text on a white background (cf. bg-view
for the background).
Note: the dark mode isn't affected
X-original-commit: 35072cab808ca0598cd16b7294d07abb42758c78
Part-of: odoo/odoo#108051
Steps to reproduce:
1. Create a new tax (TAX1) with a lower sequence than VAT(15%).
2. Check Affect Base of subsequent taxes.
3. Create an invoice, add a line with a product and both taxes.
4. Remove the invoice line.
5. Check Journal Items tab: a VAT line is still there with an amount
Bug:
When we create an invoice line with (affecting + affected) taxes,
4 Journal items are created, including the affecting tax line
having the affected tax as tax id.
When we remove the invoice line, the system sync the dynamic lines,
recomputing all the taxes to check what to create/write/delete
As one of the tax entries has a tax it will be left as a needed line
while it should be removed.
FIX:
avoid computing `_compute_all_tax` for tax lines
closesodoo/odoo#108048
X-original-commit: 4fbd639965107fc9363dddb553a70461cd596c0c
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
Before this commit:
There is not any message displayed when the search was performed on icons but
not received any results.
After this commit:
Now there is a no-content message so that users know that the search was
performed.
closesodoo/odoo#108029
Task: 2745855
X-original-commit: e7babea2b5ecaee550635adbaca435091f51a6cb
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit:
Use the top right arrow to navigate from a record that is in the draft stage
to the record that is in stage sent and use the arrow to come back to a record
that is in the stage draft. The theme selector is added to the sidebar.
After this commit:
Now theme selector will not be added to the sidebar.
Task-3016118
closesodoo/odoo#108026
X-original-commit: 44e388bbb2749b342985b11b71d50535bb5a5c1c
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit, following this flow:
- From the documents app, click on the "share" icon of a document,
- In the website builder, in edit mode, paste the link in the link
tools,
- Save and click on the link,
=> There is a traceback coming from cross-origins errors with the iframe.
These documents should be opened in the top window, as it does not make
sense to open the pdf viewer inside the iframe. This is defined in the
website module, to avoid creating a website_documents module just to
patch the WebsitePreview._isTopWindowURL method.
[1]: 44da4bf
task-2687506
closesodoo/odoo#107860
X-original-commit: 2e8fce06cbe4e2d24dd80eca1c59a9d44d181d30
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
Before this commit, following this flow on the website builder:
- Add a new .xml page,
- From the page manager, click on the record to open it,
=> There is a traceback as the website service parses the html document
as an editable one.
This commit fixes the test introduced in [1] to hide edit options on non
editable documents. The test is updated to check:
1/ If there is a dataset (the document of an XML file opened on Firefox
will not have a dataset),
2/ If the dataset has a websiteId key. It is the case only for website
pages, rendered using the 'website.layout' template, and not for other
files (js, css, scss, less, xml, csv).
[1]: https://github.com/odoo/odoo/commit/44da4bfcc30ca4fe78a1e0c5cb2f9f498ba6e72e
task-2687506
X-original-commit: bf2c6abdded1509ae22ed299abaa39fa066efb7d
Part-of: odoo/odoo#107860
Previously, it was only possible to upload a bill, so the partner_id was read
from the vendor in the imported file. Now, it is also possible to upload a
file to create an invoice, so we need to be able to decode the customer in
the imported file.
opw-3072989
closesodoo/odoo#106942
X-original-commit: c52cde5405dcc5f3e48fea9b380a93d4a56467b5
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Julien Van Roy <juvr@odoo.com>
Currently, when a db is loaded without demo data, or that a user has no
task assigned and no personnal stage, the view 'My tasks' is empty. The
purpose of this commit is to assign default personnal stage to a user in
these case to ease the understanding of new user of what the view can be
used for.
This commit :
- add default personnal stage to user the first time he clicks on the
'My tasks' menu if the user has no personnal stage and no task are assigned
to him.
task-3047496
closesodoo/odoo#105940
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Before this commit, the encoding unit used in the timesheet app was a
`Many2one` field and the user can select the UoM to use. However, only
2 units of measure are supported on the Timesheets app, the `Days` and
the `Hours` records created in the data. Also, when the encoding is in
`Days`, the user cannot directly know he can just set 0, a half-day or
a day for a timesheet in the different views of the Timesheets App.
This commit replaces the many2one field by a Selection one containing
2 choices, one for `Days / Half-Days` and another one
`Hours / Minutes`, to explicitly restrict the choice to the UoMs
supported in the Timesheets app. Also, the label of the both choices
is more detailed to explicitly notice the user will can select a
half-day or day is the encoding unit is `Days / Half-Days` and can
edit the hours and minutes on a timesheet when the encoding method
selected is `Hours / Minutes`.
task-3067111
closesodoo/odoo#105905
Related: odoo/enterprise#34043
Related: odoo/upgrade#4040
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Steps to reproduce:
- Install `HR` module
- Go to Employees
- Open the Employee ('' Ex: Abigail Peterson')
- Archive
- Check `Detailed Reason` in Employee Termination wizard
Issue:
Currently, the detailed reason appears in a small width.
In this commit, we will show the detailed reason in full width.
closesodoo/odoo#108030
X-original-commit: a697bb7234f270298e3f7e6516d635c395aa32d6
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Steps to reproduce:
- Set up a recaptcha on a DB
- Drop a form block on a website page
- Click on the submit button
- Toggle the Show ReCaptcha option
=> A traceback is displayed. The bug is quite obvious: we try to render
a XML template which has not been loaded.
A bit of history:
Before [1], the "google_recaptcha" app was a dependency of the
"website_form" and "website_mass_mailing" apps only. Both needed to
render this recaptcha XML inside a snippet option JS file. That XML
definition was lazy loaded by the related JS widget: it made sense for
the XML definition to be defined in the "google_recaptcha" app, as an
util to be lazy loaded.
After [1] and before [2], the "website_form" app was merged in the
"website" app directly. The "google_recaptcha" app thus became a
dependency of the "website" app directly. The same XML was still lazy
loaded by "website" and by "website_mass_mailing". Since the "website"
app is a dependency of the "website_mass_mailing" app, it could have
made sense already to move the XML definition from "google_recaptcha" to
"website". Although as it was still lazy loaded, it still made sense to
keep it as a "google_recaptcha" util.
After [2], however, the XML lazy loading was entirely removed. That
change is debatable (and being debated again for future versions). But
meanwhile, the XML definition still in "google_recaptcha" was put inside
the "web.assets_frontend" bundle. This is wrong at multiple levels:
- Website visitors never need that XML definition, it should never have
been added in there. We'll keep it however to respect stable policy.
- Since [3] (which occurred before [2]), the website editor UI is now in
the backend. Having the recaptcha template XML definition defined in
"web.assets_frontend" makes it inaccessible to editor options.
A fix could be to add the recaptcha XML definition in the
"website.assets_wysiwyg" bundle in the "website" manifest (as both JS
files which need that XML definition are defined in that bundle in
"website" and "website_mass_mailing"). It could be not really robust
though: if another custom app adds "google_recaptcha" as dependency and
put the XML definition in a different assets bundle, there could be
potential problems of having the same XML loaded twice (while the lazy
loading of before was smart enough to not load the same XML file twice).
As a fix, we put the definition in "web.assets_backend" directly. In
master, we may want to consider to reintroduce XML lazy loading and/or
move that XML file in "website" instead of "google_recaptcha".
[1]: https://github.com/odoo/odoo/commit/f8882698e8f4d1a3ad081522778344e2bd7aa0de
[2]: https://github.com/odoo/odoo/commit/39ea7a1fab257ab46a8faf97eea75cc37f8c43e5
[3]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
opw-3076185
opw-3096657
closesodoo/odoo#108005
X-original-commit: e76599d4b52f8c6a797907aeade5060dacd2987a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
Steps to reproduce the bug:
- log in as admin
- Go to users, edit Michel Admin
- Add “Manage Multiple stock Locations” permission
- Create a purchase order:
- Add any storable product
- confirm PO
- Receive product
Problem:
The "Deliver To" field is misaligned, and the following fields are off
by 1 column as well. Because the “reminder” field is made invisible when
`effective_date` is not false but its label is still visible, so an
empty place is still present in the view
Solution:
If the “reminder” field is invisible, its label should also be hidden
opw-3097481
closesodoo/odoo#107995
X-original-commit: d02d5f93619445f6f29536442378c9bd1f72454a
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
Steps to reproduce the bug:
- Install mrp
- Enable Allocation Report for Manufacturing Orders in settings
- Go to WH/MO/00003 from the demo data in runbot
- Click on the “Allocation” button
Problem:
Traceback is triggered, we try to format the info from the source
("Manufacturing order") and send it in an HTML request, but we access
the `partner_id` field, while this field does not exist in the
"mrp.production" model:
https://github.com/odoo/odoo/blob/f310d8f16b57c776ad92406bd52daa707ad45a88/addons/stock/report/report_stock_reception.py#L373-L374
The first element is always considered as a `stock.picking` but it
can be the `mrp.production`
opw-3063172
opw-3086714
closesodoo/odoo#107942
X-original-commit: 2008cb69dca14d0fe9fbd4484b52912fd4ea68b4
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
The product matrix was recently converted to OWL but the design was not
adapted to v16 style.
This commit revamps the table to better fits Odoo 16 design.
The previous table had issue with wrong color in dark mode and the
table head title were not aligned with the inputs.
task-3074063
closesodoo/odoo#107102
Related: odoo/enterprise#34743
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
*: base, account, crm, hr, hr_attendance, test_access_rights
The various public methods of the ORM can be override in other models,
those overrides sometime don't implement the exact same signature as the
original method in the ORM. In this work we sanitize all the overrides
to ensure a better compatibility. The background objective is to make it
possible to call any public method using kwarg: `search(domain=[...])`.
* `search`, the first parameter was renamed from `args` to `domain` in
0e9adf7 but the overrides were not updated.
* `invalidate_models` and `invalidate_recordset`, a new `flush=True`
parameter was introduced in 9c3b9a4 but the overrides were not
updated.
* `update`, there is a clash between the `update` method responsible for
writing on a record and `update` in bus responsible to update the user
presence. The bus method has been renamed so it doesn't clash with the
ORM.
This sanitization comes with a new linter that verifies that all
overrides of BaseModel public methods share a compatible signature. The
linter has been disabled for `create`, `write` and `default_get` as too
many overrides don't respect the signature of BaseModel.
closesodoo/odoo#106999
Related: odoo/enterprise#34991
Signed-off-by: Julien Castiaux <juc@odoo.com>
This PR is mainly meant for the support.
Note that the `stack_info` is purposefully accessible to add some stack trace in the logs.
Example of support tickets where it can be useful:
A certain field of a particular model change it's value with no particular pattern and way to reproduce.
With this commit, we can now create an automated actions on the model update trigger to dump the current stack that will lead us on the action that did trigger it.
closesodoo/odoo#75320
Signed-off-by: Julien Castiaux <juc@odoo.com>
- sync both versions of the doc
- spellcheck/unify the wording, capitalization, etc.
- "Odoo" is not a person, and using it in documentation sentences is
generally redundant and weird, unless there is a real ambigiuty.
By default, it's clear that everything we're talking about is
Odoo-related.
Part-of: odoo/odoo#75320
Before this commit, the text of a `CopyClipboardButtonField` could be
edited with a `label` option. But this label was never translated.
After this commit, the field `string` is used instead to rename the
button. This is automatically exported for translatation.
task-3054813
closesodoo/odoo#105560
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Payment fees appeared as float (and not monetary) in the Payment
provider form and were not converted into the chosen payment
currency.
Some tests check the `_compute_fees` function.
task-2854143
closesodoo/odoo#100156
Related: odoo/upgrade#4106
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Commit [1] introduced the shape system. This system was able to chain
shapes depending on the shape of the previous sibling element.
Unfortunately, if the shape selected on the sibling was the last shape
available, clicking on the toggle shape button would result in nothing
happening.
This commit fixes that by defaulting to the first shape if no possible
shapes are given by the sibling.
[1]: https://github.com/odoo/odoo/commit/b84e0af742c51b88b4c108ebec2d0c7fff4b7483
opw-3082292
closesodoo/odoo#108017
X-original-commit: 9bdd8faea9f0126305856a40b3215589e6b3e610
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Arthur Detroux (ard) <ard@odoo.com>
This commit fixes a test using a different uom in lines than the
one in the product, a new compute function added in the
`choose.delivery.carrier` model revealed this.
closesodoo/odoo#96660
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Previously, when adding shipment to sale order, the user did not know
the total weight of the order when getting rate of shipping method.
This commit shows the total order weight to the user with the ability to
set it to any value to get the rate with.
Taskid: 2797613
Part-of: odoo/odoo#96660
`sale` module uses custom field class to provide extra features. Particularly,
it makes product field clickable depending on SO status. However, this feature
doesn't work in Studio context. Specifically, parent record might be not
`Record` instance for `sale.order`, but `StaticList` instance for
`sale.order.line`, which doesn't have `isReadonly` method.
Fix it by that `isReadonly` is not `undefined`. We don't need to make product
field clickable in Studio anyway.
opw-3098768
opw-3099942
closesodoo/odoo#107902
X-original-commit: 06e7ccd2fab28b46eeec28029e51ae7312e66d71
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
Text content of table buttons (move left, insert right, etc) are missing
the _t() in order to become translatable strings.
task# 3054440
closesodoo/odoo#107430
X-original-commit: 8856a6b55f4c9a0d68576439a06f3a957dcfabeb
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
The condition to visualize the payment status on the dashboard of account moves has been improved (this dashboard can be accessed by clicking on the Vendor Bill Journal and removing the filter for example). The reason for this change is that for a lot of different entries the payment status is indicated as "Not paid" even though no payment is expected for those entries. Moreover, this status will not change even though a payment is registered, which is counter intuitive (for payment line PBNK for example). This commit therefore improves the condition to visualize The payment status.
task-3091141
PR number-107329
closesodoo/odoo#107329
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Currently _compute_bulk_weight and _compute_weight are
going through each picking in self and each stock_move_line
in picking.move_line_ids to compute the pickings' weight.
This can be slow when there are lots of move_lines by pickings
as the field cache will be filled by the move_lines records
and uom._compute_quantity will be called once by move_line.
This is especially true for pickings with SN-tracked products.
For SN tracked products there will be one move_line by product_qty
(so a picking with 1 SN tracked product with a qty of 100 will have
100 move_lines). In this case doing a read_group yields the highest
speedup.
Following the same reasoning a search_count is done in _compute_packages
before retrieving package.move_line_ids.
When package.move_line_ids.result_package_id is empty doing a count
is much faster as it avoids calling _in_cache_without for the package
move_line_ids. The search_count overhead is negligeable in the other
case so adding it leads to an overall speedup on average.
opw-3017013
closesodoo/odoo#107994
X-original-commit: c95abbe8fa09decca2f94a035934e8d6ae7903e1
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Van Delft Aurélien (avd) <avd@odoo.com>
Steps to reproduce:
- Go to Point of Sale app.
- Create a new order with many items in it (until you need to scroll).
- Go to Orders > Click on 'All active orders' and select 'Paid'.
- Scroll throught the items in the right.
Issue:
The total summary has a transparent background, so it will overlap with
the items inside the order and make less clear to visualize the total.
Solution:
Added the `background: inherit` to the `summary` class in the
pos.scss so we get the right background that we need for this view.
FW - port: master
opw-3093131
closesodoo/odoo#107993
X-original-commit: 3edd7f5cc425d991c512e278c22ee44043bc9d86
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Maruan Aguerdouh Mohtar (magm) <magm@odoo.com>
Before this commit, there were two kind of related issues with the
AutoComplete component, involving an "Enter" keydown.
1) Click in an empty Autocomplete input s.t. the (only) source has
no option, then press "Enter" -> crash
2) Enter something in an Autocomplete input s.t. there are results
in the dropdown, then update the input again s.t. the (only)
source has no option, then press "Enter" -> crash
This commit fixes those two issues by
1) Ensuring that we don't store in the state an option index that's
out of range with respect to the current available options
2) Reseting the options when reloading the sources.
Those issues were reproducible on the Company form view, by using
the company name field (which uses partner_autocomplete).
closesodoo/odoo#107982
X-original-commit: 390a9b589495e67235b15137ccc510b76350443f
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
currently in the kanban view of the apps, the install button is renamed to activate from https://github.com/odoo/odoo/commit/c70984f4031612d64872fcc12e89c35f03e7d2b2 , but still in the form and action(in tree), button is still labelled as Install, so unifying the label of button to Activate in tree, form and action.
closesodoo/odoo#107907
X-original-commit: 26935d67e62649c10ed907e4a730b8f5ab1f127f
Signed-off-by: Julien Castiaux <juc@odoo.com>
Start a server without a -d and with a --dbfilter that allows for
multiple database. Make sure one of the database has the
`base_import_module` addon installed. Create an empty module using
scaffold and deploy it to the server, make sure to provide the `--db`
argument to the deploy command.
It zips the file and attempt to upload it but it fails for a 404 page
not found error.
The problem is that the controllers of base_import_module are only
accessible when the client is connected to a database. It must first
connect to a database (to have a db in his session) and then access the
controller.
The /web/login route is an example of a rather cheap route to get that
is both accessible without being connected to a database and that takes
a `?db=` argument to connect to one. Using that route, we can ensure
that we are connected to a database prior to uploading a module.
Closes#104589closesodoo/odoo#107906
X-original-commit: 8feb5f366255c8cb7927842acea3ec76bbe11df2
Signed-off-by: Julien Castiaux <juc@odoo.com>
Steps to reproduce:
- Create a price list with different currency and discount with "show price and discount to the customer"
- On the website select this pricelist and try to select the booth
Issue:
The displayed price will not be the correct one
Note:
This is an issue discovered during the correction of https://github.com/odoo/odoo/pull/101375 (forward-port of https://github.com/odoo/odoo/pull/85640)
It allows to have the correct price depending of the currency of the pricelist applied.
Now the unlink of the rate makes the new rate directlt effective. There is no need of having a `new_company` anymore.
Summary:
- view modification in `website_event_booth_sale` -> price of selected booth, simplification of comparison for the `<del>`
- view modification in `website_event_sale` : simplification of comparison for the `<del>`
- backend test modification in `website_event_[booth_]sale` common: addapt the rate; take out useless `new_env`; simplified pricelists creation
- tour test addition: added the tour for essential use cases in event and event_booth; simplified the command so it is more readable
related ticket:
opw-2766997
closesodoo/odoo#106593closesodoo/odoo#107768
X-original-commit: 43c9d9892f593a41c7fe139dada0ce3f79f6f287
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
Steps to reproduce:
- Create a price list with different currency and discount with "show price and discount to the customer"
- On the website select this pricelist and register for the event.
Issue:
The price in the cart is shown in the main currency
Solution:
[website_event_sale] There is an initial issue which when it calls '_compute_price_reduce'. We compare, 'product.lst_price' (in product.currency) and 'product.price' (which has been converted to the pricelist.currency).
In order to compare apples with apples, a conversion is applied to have the 'product.lst_price' in the same currency.
After that, we have kind of a coherent behaviour in the sense that 'ticket.price_reduce' is in the same currency as 'ticket.price'.
Thereafter, a conversion is applied (if the pricelist.currency is different) to get the expected amount.
The same reasoning is applied to [website_event_booth_sale].
Note: 'list_price' has been changed to 'lst_price' in Booth to have the same logic between Event and Booth
opw-2766997
X-original-commit: ced49554dd7cca73a1da440607d545bad64e7af0
Part-of: odoo/odoo#107768
This commit aims at:
1. Fixing a bug where the invoice would be uploaded in the wrong journal
------------------------------------------------------------------------
To reproduce:
- Go to Customer invoices
- Upload an invoice (with an embedded FacturX)
- The journal is set to Vendor Bill
2. Letting the FacturX move type override the user-chosen move type
-------------------------------------------------------------------
Currently, if the user uploads a credit note in a customer invoice journal,
the document is not created and set to the OCR. This is due to a restrictive check
which has been removed. Therefore, when the move type is defined in the FacturX XML,
we will use it to override the user choice so that the document is always created
within the right journal.
3. Harmonizing the invoice upload between the Accounting and the Documents apps and avoid code duplication
----------------------------------------------------------------------------------------------------------
Currently, the flow of uploading an invoice from the Accounting app and the Documents app is different.
Indeed, if one uploads an invoice in the Document app and click on the "Create invoice",
the document is sent directly to the OCR. Now, instead, we will pass this document to the same upload method
of the Accounting (which will try to create the invoice from the FacturX XML if present).
Therefore, the flow will now be the same from the two apps for better harmonization.
4. Adding a 4th button in the Documents app to create a Vendor refund
---------------------------------------------------------------------
Currently, there are 3 buttons to create a customer invoice, a credit note, a vendor bill, but no vendor refund.
This is due to a duplicate xmlid which has now been fixed allowing the 4th button to be seen in the UI.
5. Adding a button "Switch into customer invoice/vendor bill" button in the account.move's form view
----------------------------------------------------------------------------------------------------
Currently, the user has access to a "Switch into credit note/refund" but not the reverse button to
go from a credit note/refund to an invoice/bill. This is now the case.
Task id 2961932
closesodoo/odoo#103427
Related: odoo/enterprise#32890
Signed-off-by: William André (wan) <wan@odoo.com>
Before this commit:
There is no debug icon in Discuss Public Page to show whether debug mode
is on or not.
After this commit:
Added a debug icon which will be visible when debug mode is on.
Task-2664824
closesodoo/odoo#97178
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit removes unnecessary spaces from the XML of the table of
content block.
Related to opw-3047375
Related to opw-3035502
task-2948895
closesodoo/odoo#107732
X-original-commit: 7ee4cc7d02158c63e6e2bd5eacc94371040872a8
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Since the Bootstrap 5 merge, when there were several TOCs on the same
page the scrollSpy only worked for one of them. This commit fixes that.
Steps to reproduce the bug:
- Drop two TOC blocks on the same page
- Save the page
=> The second TOC is not working properly, it does not highlight the
current section.
Related to opw-3047375
Related to opw-3035502
task-2948895
X-original-commit: c182691bbfd6be8cc9aed26162635f5fdb117991
Part-of: odoo/odoo#107732
The table of content (TOC) has two mechanisms that interest us here:
The first one is scrollSpy (from Bootstrap) which allows (among other
things) to bold the menu elements according to the scroll. The second
one is a mutation observer which is implemented to regenerate the menu
when the content of the TOC changes.
This being said, when we edit the TOC and scroll at the same time, there
is a race condition that makes scrollSpy want to add a class to a menu
element while this menu has just been regenerated by the observer. The
error is only visible since the migration from Bootstrap 4 to Bootstrap
5 because to add the class, Bootstrap 4 did it with the jQuery
`addClass()` function which does not cause an error if the element on
which it is called does not exist. Now, Bootstrap 5 does the same thing
in pure JS with `classList.add()` which causes an error if the element
on which it is called is not defined. This commit fixes this error by
disposing the scrollSpy when the menu is regenerated.
Steps to reproduce the error:
- drop a table of content block
- drag a snippet around and go over the drop zones
=> traceback. It can appear directly or after some tries.
opw-3047375
opw-3035502
task-2948895
X-original-commit: a05f782871c61b2d58ca2fd4277cb7aed65a301d
Part-of: odoo/odoo#107732
Since [this commit], when dropping several "table of content" blocks on
the same page, it was impossible to save. This commit solves this
problem.
Steps to reproduce the resolved bug:
- In edit mode, drop two TOC blocks
- Click on Save
=> the UI is blocked
[this commit]: https://github.com/odoo/odoo/commit/06b03ba5ef8375b1236f6ecb52ac468124e910ba
Related to opw-3047375
Related to opw-3035502
task-2948895
X-original-commit: a6de596017cdbd0da10b4050da132d46dc82a491
Part-of: odoo/odoo#107732
When clicking on a star from the (3|5)-stars widgets, the stars light up
in yellow to reflect a rating. We weren't making a history step when
this happened, meaning that an undo or a rollback of anything that
happened just after clicking, would undo that rating change as well.
task-3084709
closesodoo/odoo#107669
X-original-commit: d4d592350e0b887cc10cc540ab3e5e1b20600946
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Odoo sh needs the update channel event to always come first.
This PR ensures it will always be the case.
closesodoo/odoo#107971
X-original-commit: 1f29e7bec160c1fa6930b3ee8b7753150253a7e2
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
row
When it comes to closing POS sessions, both the frontend and the backend
currently have some way to prevent the same operations from executing
simultaneously because of repeated clicks. `closeSession` in the
frontend has a `closeSessionClicked` boolean that prevents the operation
from triggering multiple times at once. `close_session_from_ui`
in the backend checks if the session state isn't already `closed`.
A flaw in the current logic is that
`update_closing_control_state_session`, which is called by the frontend
before `close_session_from_ui`, doesn't check the session state before
writing it to be `closing_control`. This means that if you time things
in such a way that the `closeSession` logic in the frontend triggers
again right after it finishes, it will call
`update_closing_control_state_session` and `close_session_from_ui`
again, which will happily close the session again, duplicating stock
moves and account moves resulting from it.
This fix has `update_closing_control_state_session` check if the session
is already closed and raises a UserError if so. This prevents the
duplicate closings and records from happening.
There were two variants in the UI I observed when the issue occurred:
the first is when the repeated execution of
`update_closing_control_state_session` and `close_session_from_ui`
successfully finished. In that case the session would be closed with
duplicate stock moves and journal entries.
In the second variant, from the repeated calls only
`update_closing_control_state_session` executed but not
`close_session_from_ui`. This could happen if the timing of the
frontend was such that it redirected to the POS dashboard before it was
able to call `close_session_from_ui`. In that case, the session would
be in the `closing_control` state, which is visible in the POS dashboard
. If the user then closed the session, it would be closed twice and the
duplicate records would again be created.
opw-2988701
closesodoo/odoo#107961
X-original-commit: 6b12c64e09c92fba96532658f959daf7d234223c
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Before this commit:
Emoji data are all in English. Unable to use in other languages.
After this commit:
Emoji names and keywords are translatable for search and display purposes.
Emoji category names are translateable for display.
Task-3043336
closesodoo/odoo#107941
X-original-commit: ee5e0a201fb1980c1745692d366fd8539815773e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
With the previous commit fixing the forced purchase_price recomputation
on all lines caused by the dependencies added by sale_stock_margin,
we can now safely allow manual edition of the cost.
closesodoo/odoo#107909
X-original-commit: 9c51daaa58c403778861ec484e0493698bacbc92
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Steps to reproduce the bug:
- Create a storable product “P1”:
- change the cost to $20
- product category > costing method > standard price
- Create a SO:
- Add the product “P1”
- Change the cost from $20 to $10
- Save
- Sent the quotation by Email
Problem:
The `purchase_price` is recomputed and changes back to the original value.
When the quotation is sent, the state of the order lines change,
marking the field `qty_delivered_method` to be recomputed, but also
other computed fields depending on it, including the purchase_price
(because of the dependency added in sale_timesheet_margin).
To avoid this unexpected recomputation, we remove the useless
dependency on the `state` for the field `qty_delivered_method`.
There is no reference/check on the state in the method
_compute_qty_delivered_method or any of its overrides and
therefore the field should not be necessary in the compute
dependencies.
opw-2994136
Fw-port of 296ec254b8ba88022fd15cabb0e44956163835fb to 16.0+
X-original-commit: 6f2faf5ccfca41c4e3d8b85105dd5bca5d031106
Part-of: odoo/odoo#107909
The cost (purchase_price) of a sale order line is recomputed when the
sale order is confirmed, overwriting the potentially edited value
Steps to reproduce:
1. Install sale_stock_margin module
2. Create a quotation, add any customer and two lines: a service (e.g.
Deposit) and any other storable product (e.g. Large Cabinet)
3. Activate 'Cost (purchase_price)' column in the order lines view
4. Edit the cost of Deposit and confirm the quotation
5. The cost resets to the original product cost
Solution:
Modify the dependency of `_compute_purchase_price` to trigger it only
when the sale order line's related picking has changed state
Problem:
The dependency on order_id.picking_ids.state makes it that the purchase
price is recomputed for all sale order lines when any of the picking of
the related sale order has a modified state (but we want to recompute it
only for the sale order line that had its picking's state modified)
opw-2904500
FW-port of 9947b617a15a340a6d8127250918d8ea06a5354e to 16.0+
X-original-commit: 5287c0851cf7b3432427af17d3cc59c19306c417
Part-of: odoo/odoo#107909
An act_url action in target "self" redirects the current window/tab
to the given url. It always reloads the page, except when only the
hash or query string changes.
This commit blocks the ui when the page reloads, because there's a
lack of feedback and interacting with the ui is unnecessary anyway.
For instance, module operations (install, remove and update) end
with page reload. During the operation, the ui is already blocked
because the operation takes time. After the operation and before
the page is actually reloaded, the ui is unblocked. As the reload
also takes time because of asset rebuilding, it makes false feeling
for the user that operation completes and interface is ready for
interaction. With this commit ui is blocked until the page is
reloaded.
closesodoo/odoo#107830
Signed-off-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>