Steps to reproduce:
- Activate "Analytic Accounting" in Accounting settings
- Go to Accounting / Configuration / Analytic Accounting / Analytic Accounts
- Create an Analytic Account with a very long name (i.e. +100 chars)
- Go to Expenses
- Create an Expense with the created Analytic Account in the Analytic field
The display of the labels in the form view should break because the badge is too
long and is taking all the available width.
Solution:
Limit the width of tag badges in "analytic_distribution" widget as it is done in "many2many_tags" widget.
https://github.com/odoo/odoo/blob/2f47df6663b65c4f6b6ec61f956c453e97563462/addons/web/static/src/views/fields/many2many_tags/many2many_tags_field.scss#L47-L49
opw-3322688
closesodoo/odoo#131136
X-original-commit: 32fc4d44446a15b215c3f61cb2b35fa6f4ecb95b
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Anh Thao Pham (pta) <pta@odoo.com>
This module no longer depends of account_edi.
Then, `_prepare_edi_tax_details` can't not be used.
We need to use `_prepare_invoice_aggregated_taxes` instead.
closesodoo/odoo#131109
X-original-commit: 89debfc12e2712a03896080a707cee6942b11581
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Bug to reproduce
----------------
- Log in as admin
- Go to the frontend page of a course
- Click on 'Add Section'
- Fill the form (name input)
- Press 'Enter' or click on save button x times
x sections with the same name will be created
Specifications
--------------
Prevent the 'Add section' form being submitted multiple times in a row.
task-3432418
closesodoo/odoo#131107
X-original-commit: a91a60b4be5b2f606d20fbe574625b85e43407f6
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Before this commit
Previously, there was a bug that caused an error when a zip code containing
any character was entered.
After this commit
This bug has been fixed now.
task id- 3441139closesodoo/odoo#130942
X-original-commit: 8deeabdbfbee20289d79151fa2821ce04585d0bd
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Signed-off-by: Zeel Patel (zepa) <zepa@odoo.com>
The sum of floating points in not correct when we add a number of lines in payment term. The sum comes up to be 99.999999993 or close to this depending upon the number of lines.
1. Create payment term with 15 lines having percent payment value of 0.166.
2. Keep the last line as calculated by the app.
3. Try to save the payment term.
Current Behavior:
A validation issue would arise stating the sum should be equal to 100.
Expected Behavior:
The payment term should be saved.
OPW-3450723
closesodoo/odoo#131126
X-original-commit: faebcd0fade95dcdbe1b70449ca46cb7e03f9926
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Before this commit, the fold state, seen message id and message unread counter
was never saved on the livechat session state. This is due to an incorrect check
on the session state. We wan't to ensure the session is not closed when writing
such information but the state was checked on the thread instead of the livechat
service.
closesodoo/odoo#131049
X-original-commit: a81208d980a2a30bcff6382729e2ed8369e6a65d
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
When applied, this commit will restore the edition of a block when
the content has a height > 10000px.
Steps to reproduce:
1) Go to a runbot
2) Go to a blog or on the homepage
3) Enter edit mode
4) Add some text in one bloc with a total height above 10000px
5) The text will be uneditable on the top
Current behavior:
If the text is too important in one block (more than 10000px),
the text will be uneditable
Expected behavior:
The text should be accessible and editable even if the block
has too much content
opw-3393570
closesodoo/odoo#130965
X-original-commit: 493d31a9b2f6508e1e48627ff510120f93870c4e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Steps to reproduce
==================
- Enter studio
- Create a new app
- Create a new model with "pipeline stages" enabled
- Close studio
- Switch to the kanban view
- Add a new stage
`ValueError: Invalid field 'name' on model 'x_test_stage'`
Cause of the issue
==================
A model _rec_name is not always name. This is the case for example with
studio stages. In that case, `_rec_name == 'x_name'`.
Since [commit], we do a create instead of a name_create.
Solution
========
First do a name_create to handle custom _rec_name. Then if there is
still some field to be written, do a simple write.
[commit]: 4e974e5
opw-3432017
closesodoo/odoo#130921
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Before this commit, access rule for group_hr_timesheet_user is define for
read and write permission for task which allow internal user to edit task if
link is provided even if user have no access.
In this commit, we have remove access rule for group_hr_timesheet_user because
it is not required anymore since read access is already given to internal user
which does not allow user to edit task if user have no access.
task-3354831
closesodoo/odoo#130807
Related: odoo/upgrade#5020
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Add a slide icon class field to prevent computing
the fa-class icon from the slide type in the template
everytime we need it.
Also, using a template wasn't suitable anymore as we
may need the icon outside of its own <i> tag
(see slide_sidebar_done_button).
Task-3378180
closesodoo/odoo#125859
Related: odoo/upgrade#4802
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
This commit fixes the bug of undefined filter display name.
A few weeks ago the property names of record when updating record selector have been modified. Previously it's `name` but now it's `display_name`. This is the root cause of the bug.
task 3453374
closesodoo/odoo#130724
Related: odoo/enterprise#45349
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Before this PR, RPC in the channel invitation form could resolve in the wrong
order and display outdated result.
This PR introduce the use of `useSequential` hook witch ensure that irrelevant
RPC are canceled.
closesodoo/odoo#131011
X-original-commit: 7d628b6a2785a4ac2a1081413e8a54c7ad695cb5
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Didier Debondt (did) <did@odoo.com>
We change account_edi to be auto_install=False to avoid installing it when
it is not nedeed and create noise data that will always be empty.
It was previously auto_installed when Invoicing was installed.
Note that auto_install=['parent_module'] will automatically install the module
when 'parent_module' is installed (in this case the localization) AND install
missing dependencies (in particular here 'account_edi').
task-3454076
closesodoo/odoo#130997
X-original-commit: 2d2faafb744abdb09f199ab85f11d317ee1d065e
Related: odoo/enterprise#45337
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Claire Bretton (clbr) <clbr@odoo.com>
In the taxonomy PR: odoo#114638, we changed the
name of the taxes but the description wasn't modified so the users have
difficulty understanding what the codes means. In this pr, we added a
description in english and in french so that people can have a better
understanding.
closesodoo/odoo#130996
Task: 3398682
X-original-commit: ea85cae2275fde939e63eebed73d3453c6b9dcd9
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Signed-off-by: Maximilien La Barre (malb) <malb@odoo.com>
Users are not able to reorder lines on order having more
than 40 lines as only 40 lines are shown by default.
In some advanced flows, new lines are automatically added to the
end of the lines and the user has no way to move them back in
the first ones (or in a specific section if it's not on the same
page).
opw-3437983
closesodoo/odoo#130956
X-original-commit: b316cd61bff1c05f8b07d036e9c0409998982a69
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
1) If the contract is running when the employee is archived, we move the contract in the
expired stage and we set the date of the archive wizard to the
contract's end date.
2) If the contract has expired when the employee is archived, do not change the date.
task-3373275
closesodoo/odoo#130714
X-original-commit: e84106cdc5ae8015ee0c15a6c842d91dc2da1343
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Kuldeep Singh (kusi) <kusi@odoo.com>
In the wishlist, if a product has no stock available, the customer can request to be notified when the product is "back in stock".
If a barcode is configured on the product, the request will fail with a "Missing record" error.
Indeed, the code relied on the tracking info (google analytics data) to find the product id. This is a mistake since the barcode is given as `item_id` in the tracking info if set (instead of the product id).
Since the product id information is already available as node data, use this mean to get the right product id directly.
Fixes#130471closesodoo/odoo#130949
Forward-port-of: odoo/odoo#130473
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit removes legacy patch/unpatch functions and adapts their use
by using the modern patch. There was also a custom patch function used
in tests which has been replaced too.
closesodoo/odoo#130867
Related: odoo/design-themes#685
Related: odoo/enterprise#45271
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
How to reproduce the bug:
------------------------
- Create a new user
- Log in as that user
- Go to a forum that don't require karma to ask a question.
- Create a new post
- On validation, you'll end up on a 404 page.
If we use the portal user instead, we see the post with a banner explaining
it has to be validated. This should be the result here too.
Specifications:
--------------
- When new users (karma = 0) create a post, redirect them to the page
relating to their question.
task-3372016
closesodoo/odoo#130857
X-original-commit: 9f624795c68d69ddf212657fe43cc45fc32747a0
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
During the bootstrap refactoring we forgot to add some classes to the
save button of the POS (`btn btn-light rounded-0 fw-bolder`) which are
used on the other buttons of the POS.
They are now added to the save button.
closesodoo/odoo#130718
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
This commit improves the way months are recognized in pivot functions.
It also removes the use of `moment.js` which will be removed in the future
(see task 3391739)
Currently, months in a pivot function must follow a very specific
format.
It must be mm/yyyy
`ODOO.PIVOT(1, "amount", "date:month", "01/2020")`
Among other things: "1/2020" does not work, it must be prefixed by a
leading zeros.
Now, any date-like value would work:
month: "1/2020"
first of the month: "1/1/2020"
any day in the month: "1/2/2020"
using the DATE function: DATE(2020, 12, 1)
using NOW()
Future work: `PIVOT.HEADER` should return a the date as a number
when the date is a month. But it's currenctly quite a mess.
because we use the same method for a million things (`getGroupByDisplayLabel`).
Task 3413243
closesodoo/odoo#129782
Related: odoo/enterprise#44684
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Denmark is comprised in the EAS list but is not currently supported in
Odoo. This commit makes UBL Bis 3 available for Danish companies.
The schemeId "0184" corresponds to the "DIGSTORG" and is mandatory for
Danish Suppliers (see: rule DK-R-014,
https://docs.peppol.eu/poacc/billing/3.0/rules/ubl-peppol/DK-R-014/).
issue-130519
closesodoo/odoo#130856
X-original-commit: 6e842dac3bd299a68f6358a9bd59c5a3a09665f4
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Julien Van Roy (juvr) <juvr@odoo.com>
Previously, when account moves were set to auto post, and the cron was triggered to post them, if a single invoice triggered a UserError, none of them were posted (User error might be for example missing required field to post, archived journal, inactive currency, ...). This commit enables to post all valid invoices. The invoices that could not be posted are now visible on the accounting dashboard on their respective journal card with the 'to check' attribute, and a note is written on the chatter of the problematic invoices, describing the reason why the move could not be posted.
For performance reasons, we lowered the number of moves that can be posted in a single batch. This way, if a move among a batch cannot be posted, all moves of this batch must be handled one by one. Doing batch of 100 is already the case in 16.0
task-3244310
closesodoo/odoo#130958
X-original-commit: 5c0ba84d20334f307834113fdea61f04391cbcbe
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Hugo Poncelet (hupo) <hupo@odoo.com>
Miscellaneous improvements:
1. In analytic tags, the percentage is now a prefix.
2. In the widget, 0% accounts are now hidden.
3. In the analytic items list/pivot views, it is now possible to search by:
- Financial Account.
- Cross by.
4. By default, the pivot view is now grouped by plans and then analytic accounts.
5. An "Analytic Reporting" menuitem that opens the pivot view is added in Reporting > Management.
task-3446504
closesodoo/odoo#130971
X-original-commit: adb8ec875c9b4e299147c46dc60a87fd26fff91f
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
Signed-off-by: John Laterre (jol) <jol@odoo.com>
`default_get` is bad m'kay?
Reproduce:
* Accounting > Configuration > Taxes > Create
* Just add a name, save.
There are no repartition lines, but there should be at least one line
for the base line.
This happens because `default_get` was only computing the main field
`repartition_line_ids` and it was allowed because the contraint was not
checking that same field.
closesodoo/odoo#129840
X-original-commit: f05457c82af63358c292350ef110f0b18c27f164
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Since #121376 a clear_cache was removed when unlinking an attachment
This clear_cache was not useful when restarting a server with new
sources, an other operation changing the content of an assets should
invalidate the cache manually. This is the case of ir.asset CUD
operations.
Unfortunately, a manual update was left missing in website, when
archiving ir.assets used for snippets.
This was discovered on runbot, with two workers, when the first workers
generates assets before the cron, and the second one after the cron.
The second worker unlinks attachments creating an inconsistency in the
cache of the first one.
This problem can be solved quickly by invalidating the assets cache in
the cron manually but this will be done in all cases. The proposed
solution will check the ir.asset that should change and only clear the
cache if the state changed.
Regarding performances, this should actually be a slight improvement in
query count since at the cost of one more select to prefetch the record
we can avoid multiple update, one per snippet. In most case no update at
all should be done, at most 2 can be done (one for archive, one for
unarchive).
Example with some assets to unarchive:
Before:
TOTAL ENTRIES: 277
SELECT: 158 (~0.16591858863830566s)
UNKWOW: 54 (~0.0202481746673584s)
UPDATE: 65 (~0.03202557563781738s)
After:
TOTAL ENTRIES: 214
SELECT: 159 (~0.1663439826965332s)
UNKWOW: 54 (~0.029229164123535156s)
UPDATE: 1 (~0.0002865791320800781s)
If the number of query is lowered, the python processing is slightly
higher. Locally the test time is similar, slightly longer since an
additional call to _disable_unused_snippets_assets was added to check
the cache invalidation
closesodoo/odoo#130973
X-original-commit: 3aeab51ff4379e6d76172614fd39f09d6c449ac6
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
...services
In the reporting of Timesheets, "timesheet revenues" represent
`sol.price_unit * sum(timesheets.unit_amount)`.
While this calculation is correct for SOLs with a service
invoiced on delivered quantities, it doesn't reflect the truth
when the product is prepaid/fixed price (ordered quantities).
With this commit, the "timesheet revenues" related to the latter
type of services will be equal to
`sol.price_total / sol.qty_delivered * sum(timesheets.unit_amount)`.
Where we determine the revenue per unit, and apply it to
the total duration of timesheets.
Example:
Say a SOL with a service of type "prepaid/fixed price",
an ordered quantity of 4, and a price per unit of 3.00€.
The total price is 12.00€ no matter how much has been delivered.
Say users A and B, having respectively timesheeted 2h and 1h,
so the delivered quantity of the SOL is 3.
We'll note "timesheet revenue of user X" "TR(X)".
Before this commit:
`TR(A) = 3.00€/h * 2h = 6.00€`
`TR(B) = 3.00€/h * 1h = 3.00€`
`TR(A) + TR(B) = 6.00€ + 3.00€ = 9.00€`
The total timesheet revenues is 9.00€ where it should be 12.00€.
Now:
`TR(A) = 12.00€ / 3h * 2h = 8.00€`
`TR(B) = 12.00€ / 3h * 1h = 4.00€`
`TR(A) + TR(B) = 8.00€ + 4.00€ = 12.00€`
The total timesheet revenues corresponds to the SOL's total price.
task-3368808
closesodoo/odoo#127875
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Before this commit, since we used to show custom label for project and assignees
as 'private' and 'unassigned' section in pivot view, if we want to display show
custom label for groupby with sub group type we might get confuse with passing
'groupby' attribute on _getEmptyGroupLabel pivot method.
In this commit, fixes groupby issue by passing 'fieldname' instead of 'groupby'
cause groupby contains 'groupname : subgroup' like 'deadline : year'.
closesodoo/odoo#130960
Task: 3186578
X-original-commit: cae3531deb032289f5f823df7ffa565ee89189ea
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Before this commit:
If the barcode nomenclature uses the or `|` symbol.
The part after it would be used as a "contains" instead of a
"start with".
e.g: `123|456`
would be transformed in the JS code to `^123|456` instead of:
`^123|^456`
As such, you would have error "can't find product with barcode" if
you set such a rule and a product barcode contains the second part.
For e.g: the barcode `44445666` would match, but should not!
After this commit:
Force the second (and following if any) part to start with.
Note: in practice it is pretty rare to have `|` in the pattern, but
it is the case for a default rule in version 16, see:
https://github.com/odoo/odoo/blob/5ac58ebf983c1c02019253c0430fde3502e13e7c/addons/pos_loyalty/data/default_barcode_patterns.xml#L10
In this case, if a regular product have `044` in its product barcode,
the PoS will tell that there is no corresponding coupon instead of
adding the product.
But the issue itself still apply in version 14 in case of custom rules
opw-3356951
closesodoo/odoo#130961
X-original-commit: 103566699d3492b682219efc3614f26d2ea972e5
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Loan Sens (lse) <lse@odoo.com>
Remove tax demo data:
- They have the same tax name which breaks a uniqueness constraint, and
cause error at migration.
- It doesn't make sense to have taxes demo data
Also remove assignation of those taxes on other aml demo data.
closesodoo/odoo#130934
X-original-commit: 9917aa208fbdacb5b06fd728f86abda2905cbbd0
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Claire Bretton (clbr) <clbr@odoo.com>
If the `_toRollback` property of the editor is assigned on its own line, it is
easier to identify which assignation caused/prevented a rollback when
debugging.
closesodoo/odoo#130894
X-original-commit: 263dcbaf9aa0c48bd61bf85b091c746d7850cfe1
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
As introduced here:
https://github.com/odoo/odoo/pull/112611/commits/dce4ec8380aad1a1d1b40c33a50ab5914838ba18,
PdfReadError should be imported conditionally as it is now possible to have dev
environments with different versions of PyPDF2.
We are employing the same strategy done in the mentioned commit to avoid import
error when the environment has python > 3.10 and PyPDF2 v2.12.1
closesodoo/odoo#130892
X-original-commit: 0163edfb16c849eac61fb33b400faedda33f667f
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
We now split the export of the FEC files per batch of move lines. This was necessary, as the fetchall() ran on the cursor to get the results could return a huge amount of data on big databases, saturating the RAM.
This fix is not exhaustive, and memory consumption could be lowered by removing the need to convert the whole file to base 64 and write it in attachment. Those changes are not doable in stable ; further improvements will come to master.
OPW 3442579
closesodoo/odoo#130884
X-original-commit: 86a221fa3773b5b23ae8f1ad653c1aaac607482e
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Since 69f911d994 it was no longer possible to post an HTML
message via a script. Allow to do it but log a warning to discourage
doing so. Markup object should still be the propoer way to do it.
closesodoo/odoo#130883
X-original-commit: a890db49935813d0794765492c057404592e5977
Related: odoo/documentation#5273
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
There's a single usecase left for this helper, which is in website.
This commit directly moves the function definition in the file
using it.
Part of task~3439226
closesodoo/odoo#130843
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Before this commit, when the first element of a template is a non
fulfilled condition :
'<t t-if="false"/>'
The function renderToElement returns an empty text. This occurs because
it returns the first child, which in this case is an empty text.
Now, the function returns the first element.
closesodoo/odoo#130858
X-original-commit: 8dabc4e1d5ebd94f6a315ce56b9bf60240dd7fdd
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
In 16.0 and up, when toggling full-screen mode on the mailing editor
the iframe content is not properly made scrollable.
This is due to the toggle method being triggered 4 times
which effectively cancels the effect.
The reason for it being triggered 4 times is that the check that would
prevent multiple event listeners from being set on the button compares
an existing jquery object to a new one on the same element.
As these are two different references to the same element
they are still different objects and thus the listener will be added
even if they reference the same iframe.
The fix is simply to compare the html elements directly, if they exist.
We also add the expected state of 'full screen' to the class toggle
as it may avoid other inconsistencies from blindly toggling.
task-3446768
closesodoo/odoo#130853
X-original-commit: 30f27563868af4b247c96c24135c1003aa191cef
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Since [1], marking the activity as done from the activity popover
was not automatically closing it.
Steps to reproduce:
- Open Contact kanban view
- Schedule an activity on a contact
- Click on activity widget on kanban card
- Edit activity and mark it as done
=> The activity popover was not automatically closed
Also fixes a bug where marking activity as done in activity view
was crashing.
[1] https://github.com/odoo/odoo/pull/114024closesodoo/odoo#130828
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
None of the main methods provided by this plugin were stil used; only
the internal method `enable()`.
This commit replaces these calls by toggling the `disabled` HTML
attribute.
closesodoo/odoo#130817
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Before this PR, RPC made by input inside the discuss sidebar could
resolve in the wrong order, witch display outdated results.
This PR ensure that only the most recent RPC is sent to the server,
cancelling irrelevant RPC.
Note: This PR also remove the support for Promise inside the
NavigableList component since it's not compatible with useSequential.
closesodoo/odoo#130767
X-original-commit: ba2d029d876f9acd7c869cc3d345cc4ed7cab00a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
When the cache is filled with binary field, it can fill the logs with
unreadable and (probably) non compressible data
closesodoo/odoo#130741
X-original-commit: 6afba8fafe79dcf9bc28710a7edbd33b6a5b459f
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>