In case of an user can edit account.journal and have no access of all account.move of this journal, the user can set to false this field : restrict_mode_hash_table.
closesodoo/odoo#112028
X-original-commit: c1bcf20a4c58516e484417885f47e32a8c192dc1
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
Steps to reproduce:
- Setup an accrual plan with yealy first of Jan granting 15 leaves and it will pospone maximum 7
leaves to the next year.
- Setup an allocation with date started 2 years ago on first of Jan.
- Run scheduled action "Accrual Time: Updates the number of time off" after current year first of
Jan.
Current behaviour:
Only granted 7 days leaves.
Expected behaviour:
It should grant 22 days leaves as it should combined the postpone 7 days leaves and the leaves
granted on first of Jan of the current year.
Explanation:
With this modifiation there are two changes:
1) The lastcall and nextcall in the _end_of_year_accrual method should not skipped the
_process_accrual_plans methods in the _update_accrual method for all the allocations that using
pospone action_with_unused_accruals. It should keep the lastcall as previous date of current
level or the lastcall of the allocation depending with one is latest. Also the nextcall should be
the upcoming nextcall. Therefore after the postpone_max_days caluclated. The _update_accrual
method can compute the leaves again for yearly first of Jan accrual plan.
2) The prorata amount accrual plan calculation should be date_to first_date_this_year. Otherwise
one day is missing in the prorata calculation and the leaves count will be incorrect.
closesodoo/odoo#112004
X-original-commit: ea53b57a890412714a3d6f5d6946705bf3391e90
Signed-off-by: Kevin Baptiste <kba@odoo.com>
When we paste content in the editor, we merge the first and/or the last
element(s) from the clipboard with the element(s) before/after the
selection (eg, pasting `<p>b</p>` at `<p>a[]c</p>` (where `[]` is the
selection) should result in `<p>ab[]c</p>` rather than
`<p>a</p><p>b</p><p>c</p>`). If the element we try to merge is a table
though, we may end up pasting a `<tbody>` without its parent table,
which leads to unexpected results. In any case we don't ever want to
merge a table with another element, so we prevent that.
Steps to reproduce the issue (in the `note` module):
* Type "a" then hit the ENTER key.
* Add a table (using the /table command) and write in each of its cells.
* Make a selection that starts before "a", and ends after the last
character of the last cell of the table.
* Copy the selection.
* Paste the selection in the paragraph after the table.
What you see before this commit is the text you copied, without the
table.
Everything above is also true of lists (just replace the table with a
list in the text above) and these cases are fixed here in the same way.
task-3165836
closesodoo/odoo#112042
X-original-commit: 07604f2505d9cc32ebb3cf3f09192472f0bf30c4
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
The `_disable_recursion` wasn't working properly because it didn't
disable recursive calls if they used the context of a recordset that is
not in the container. It is really easy to do if we use `self` for
instance.
In order to avoid this, we just temporarily change the context of all
environments while inside of the context manager.
opw-3016530
closesodoo/odoo#112049
X-original-commit: b3d60185aba865905d7d91c3e1edfae1123b03b9
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
Before it wasn't done for simplicity, but turns out it is actually quite
simple to do.
task-3167055
closesodoo/odoo#112043
X-original-commit: 21cb20a284a98a59bf5885ad56d231ae337105e1
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
Some html structures are not well mirrored in RTL directions.
Fix it by changing it to rtl frienldy structure.
STEPS:
* switch to any RTL language
* open list view for any model
* click Action -> Export
opw-3063763
closesodoo/odoo#112034
X-original-commit: f10a4886d2c2bfc0d4643e0e4597e62c2ba4f94e
Signed-off-by: Luca Vitali <luvi@odoo.com>
Before this commit: if a non-admin user captured a payment with
PoS Stripe, an error occurred in UI. The problem is that only the
"Administration / Settings" group can have access to the payment
provider.
The solution is to use super user mode.
opw-3120441
closesodoo/odoo#112006
X-original-commit: de096c08f5766f3fb2b2438730295195cdd9af16
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
before this commit, the action name was not translatable into user language and always displayed in english.
after this commit, the action name will be translatable and will be showing the value based on user language preference.
closesodoo/odoo#111991
X-original-commit: 6aa80ca670476494b10115f61805324811b73a58
Signed-off-by: John Laterre (jol) <jol@odoo.com>
before this commit, traceback is raised when trying to create accrued revenue entry without entering the order lines.
open a sale order, enter customer and save it, from the action button, click Accrued Revenue Entry and enter an amount in the amount field, exception will be raised.
after this commit, no exception will be raised.
closesodoo/odoo#111976
X-original-commit: d68eafd5c06fef77ba669df0e0ca6cd7217b08b5
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Withholding
-------------------------------
Italian invoices may have a special fiscal feature which is "Ritenuta"
It means "withholding" and we implement it as a tax. The Withholding's
main use case is for professional consultants who can ask their
services' buyer to pay their income taxes on their behalf. This way, the
invoice lines will have a negative tax, and the buyer will not all the
money that is billed. The withheld amount will be sent to the tax
collector by the buyer at a later time. Professionals have any threshold
of how much money can be withhold in an year.
We added two fields to account.tax, l10n_it_withholding_type and
l10n_it_withholding_reason, for EDI import/export purposes. New taxes
with those fields filled out and a tax group have been added. The view
has been updated, to see the fields, the tax amount must be negative.
In the EDI import, the new DatiRitenuta tag is now read and handled. The
correct l10n_it_withholding_type tax must be found, or a message is
logged to the invoice chatter.
Pension fund
-------------------------------
Under Italian fiscal rules, there are cases in which professionals may
ask the buyer of their services to pay income taxes on the invoice
itself, and that's managed withholding taxes. In addition to that, the
buyer may also be asked to pay for the seller's national pension fund,
as a percentage of the invoice's total. This information needs to be
imported/exported through the EDI
Ticket link: https://www.odoo.com/web#id=2936606&model=project.task
Task link: https://www.odoo.com/web#id=2903280&model=project.task
v14 Community PR: https://github.com/odoo/odoo/pull/96930
v14 Enterprise PR: https://github.com/odoo/enterprise/pull/33083
task-2903280
opw-2936606
closesodoo/odoo#111800
Forward-port-of: odoo/odoo#102527
X-original-commit: 2525103f200b8bb13ea78eaa28f2135ed5bba755
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
SO/PO accrued entries date should be the last day of the previous month since it necessarily concerns a bygone period.
closesodoo/odoo#111535
Task: 3045028
X-original-commit: 1dacb28a3f2a3f66572e693dfda81ceaf87696c9
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Group lines in a list view of sample date should not be clickable.
Before :
Create a new partner and make an invoice for him in 2020. Post it, and open the partner ledger for 2023. The partner appears. If you unfold his line, you'll see the initial balance amount. So far, so good. Now, click on the "journal items" button on the partner line. Since there is no aml in period for him, it shouldn't show any. Indeed, nothing is shown, and the mockup data are displayed ... However, the "group by partner" filter applied on the list view make is so that group lines are displayed for mockup data ... and they are not greyed and not-clickable as they should.
closesodoo/odoo#111467
Task: 3126138
X-original-commit: ca3c9988422dc29ec193af380177e19c8c4f69c1
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Refactoring of report_stock_forecasted to owl
Since it wasn't really a report (no print action),
it changed from a report to a client action.
Task: 2885757
See Upgrade : odoo/upgrade#3926
See Enterprise : odoo/enterprise#32116closesodoo/odoo#101247
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Steps to reproduce the bug:
- Create a product category “Fifo”:
- set the costing method to Fifo
- Create a storable product “P1”:
- category: All (costing method = standard)
- Update the qty to 10 units
- Go to inventory → Product variant → “P1”
- Change the category from “All” to “Fifo”
- Go to inventory → Reporting → stock valuation
- Add “reaming_qty” field in the list view
Problem:
The empty_stock layer (the layer created to empty the product) has `remaining_qty` of -10 instead of 0 whereas we change from standard to Fifo
The write method of `product.product` is triggered, leading to Product Variant having another category than Product Template when the write method of `product.template` is triggered
opw-3138061
closesodoo/odoo#111911
X-original-commit: f6f5d4a27af5bad42c3c6c11ce681be631f43248
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
This prevents the property field from calling repeteadly the server for
an information that (almost) never changes. Note that all checks should
probably go through this services for the rest of the codebase.
closesodoo/odoo#111571
Signed-off-by: Géry Debongnie <ged@odoo.com>
Before this commit, the web editor loaded the configuration for ice
servers each time it was created. It is useless to do it more than
once, so this commit simply keep the initial value around.
Part-of: odoo/odoo#111571
On SO confirmation:
- If all of the following conditions are met,
set the end_date of the Subscription
as the repeat_until date of the Task:
The Product is recurrent and creates a Task,
The Task Template is recurrent,
The end_date field is set on the Subscription.
- If all of the following conditions are met,
apply the Subscription's recurrence to the Task's:
The Product is recurrent and creates a Task,
There is no Task Template on the Product.
- If the Subscription is closed, set the recurring_task
field of the related Task to false.
task-2868306
closesodoo/odoo#92696
Related: odoo/enterprise#27953
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Before this commit, fields width didn't take all available space
on mobile.
Steps to reproduce:
- Go to website settings (for instance)
-> the width of the fields seems abnormally small
closesodoo/odoo#111934
X-original-commit: 49b3fed0ae9bbe43ea55ec5809f47a674a393e4d
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Before this commit, _onClipboardCut removed the selected text but did not
register it as a history step. Other than not storing history properly,
this caused unexpected behavior when followed by an action that leads to a
historyRollback on the current step, such as those in _onInput.
task-3142995
closesodoo/odoo#111927
X-original-commit: 451f1a2641b5b85ea75d9f1e8a8d1b528de031b6
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
After unlock a picking/MO, it's possible to change the qty_done of a
cancelled move. This change won't have any result on product's stock.
In this commit, we raise an error when user changing cancelled moves.
We advise user to create a new line instead.
Task-3116125
closesodoo/odoo#111910
X-original-commit: c6c3e5984c3fa0fc1810ae490bd4ce10390eebd8
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
Removing the async header from the setup() function because this function is not entirely async, and inserting it alongside an onWillStart hook to be awaited before rendering the component.
closesodoo/odoo#111831
Task: 3141281
X-original-commit: 295f04b3496763cfef5237ff4b1f40df232371a7
Signed-off-by: Arnaud Joset <arj@odoo.com>
Steps to reproduce:
- have a Swiss configuration for qr-code
1) make sure your customer company is in Switzerland and has all the address information
2) make sure the customer set an Invoicing address in Switzerland (address + Country)
3) have set for your bank account in in Accounting/Journals/Bank: the Iban AND the QR iban
- create an invoice for a Swiss client
* monthly
* confirm
- Preview the invoice
Issue:
error, we should able to see the invoice without qr code.
Solution:
the user will still see the error when trying to print the invoice
opw-3104890
closesodoo/odoo#111929
X-original-commit: 30a8e933b3cda9c3c663c4d05d1efdc023b17b1e
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
The class is a simple extension of dict, and adds an explicit attribute
for the content of the root node of a tree. It makes the code much more
readable with very small performance overhead.
closesodoo/odoo#111946
X-original-commit: 8a01d74e5f7d035cfd05bc02596f075270e0fcf8
Signed-off-by: Raphael Collet <rco@odoo.com>
This patch optimizes the way field trigger trees are computed. Overall,
the resulting trigger trees are mostly identical, but they can now be
determined one by one, which enables an on-demand approach and partial
cache.
Before this patch, getting the first trigger tree proceeded as follows:
- resolve the dependencies of all fields;
- compute the transitive closure of the dependencies of all fields;
- store the transitive closure above as field triggers for all fields
in a cache.
After this patch, getting the first trigger tree proceeded as follows:
- resolve the dependencies of all fields;
- cache them as direct triggers for all fields;
- compute one trigger tree as the transitive closure of the field's
triggers, and cache it.
This optimization is quite effective during the installation of modules,
and is even more effective when the number of fields is large. For
instance, a complete installation with all community modules is now 25%
faster. For a complete installation with all enterprise modules, the
installation time is even 30% less! A medium installation is about 16%
less time.
The optimization also speeds up the first request on a new Odoo worker,
since the minimum time for computing a handful of trigger trees is much
smaller than before. We have measured times for a first request going
from 1.6 seconds to 1 second for posting a message.
We have observed slight differences in trigger trees, but they occur in
places where the tree has redundant branches, in particular with fields
having recursive dependencies. It therefore makes no difference in what
is being triggered or invalidated.
X-original-commit: 68f786d494c3c73a085cd919b348c019f77794e7
Part-of: odoo/odoo#111946
Those APIs are aimed at hiding the implementation of trigger trees,
dependent fields and fields modifying relations. Explicit APIs simplify
the profiling of executions and comparison of implementations for
building trigger trees.
X-original-commit: d12b9270375634e738f5288d0c523ac0eec2fa18
Part-of: odoo/odoo#111946
The field ir.rule.global depends on ir.rule.groups, and its inverse
field res.group.rule_groups depends on ir.rule.global because of a
domain on the field. As the domain is only useful client-side, turn the
domain into a string, so that it is only valid client-side.
X-original-commit: ef55c87f6ca7c6bed99cd975ab7dbffb618d2584
Part-of: odoo/odoo#111946
The issue occurs when a computed field depends on a many2many field with
a corresponding inverse field on its comodel. Consider two models like
class User(models.Model):
_name = _description = 'test_new_api.user'
group_ids = fields.Many2many('test_new_api.group')
group_count = fields.Integer(compute='_compute_group_count', store=True)
@api.depends('group_ids')
def _compute_group_count(self):
for user in self:
user.group_count = len(user.group_ids)
class Group(models.Model):
_name = _description = 'test_new_api.group'
user_ids = fields.Many2many('test_new_api.user')
When a user is added to a group with
group.write({'user_ids': [Command.link(user.id)]})
we expect the field `group_count` to be recomputed on `user` only, but
it is actually triggered on *all* the records in `group.user_ids`. This
is a real performance issue when there are many records in the relation.
The explanation comes from the fact that
- the framework considers the field `user_ids` is modified on `group`;
- the field `group_count` implicitly depends on `group_ids.user_ids`,
which makes it triggered on the users `u` such that `u.group_ids`
intersects `group`.
The solution consists in handling the dependencies on inverse many2many
field in the field itself. The field no longer adds the implicit
dependency on its inverse field in the trigger tree, but instead
determines which records in the comodel are actually impacted by the
relation change in the method field.write().
closesodoo/odoo#111943
X-original-commit: bb3a6e378b5f6b2e14b74ce4efb6d749ad54cb1e
Signed-off-by: Raphael Collet <rco@odoo.com>
Steps to reproduce:
Realize the process checkout flow on ecommerce.
Taking care to have only one shipping method (example Mondial relay).
Issue:
When confirming the order,
it is not possible to choose another parcel point.
Solution:
Make it possible to click on the shipping method
to change the parcel point.
Remark:
It is only possible to confirm the relay point once.
We must reload the page if we want to modify it.
opw-3149294
closesodoo/odoo#111914
X-original-commit: cce78ebce1bd7b7f2ddbdbf1beec0d7bafccf6ae
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Purpose
=======
Allow to customize the Outlook endpoint to be able to use single
tenant apps.
Task-3053447
closesodoo/odoo#111821
X-original-commit: 4d62ac1838fc0bcebb779c90df9d80c2369e0d8a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
Commit [1] improved the url dependencies search behavior to include more
models to search in but also the multi record capability (needed for
multi delete in list view now that website is in the backend).
But a line of code was badly designed, making the perfs horrible.
That line code shouldn't have been part of the loop as it doesn't
depend of the loop.
This was drastically more impactful on the `/` page.
Benchmark: for the `/` page, searching in 1000 product template website
description will go from 29.74 seconds to 0.29 seconds.
See the speedscope result on the PR description.
For ~10.000 products, it will go from ~7 minutes to 1.35s.
[1]: https://github.com/odoo/odoo/commit/6ac17b93437868cbefbe13448a6fcbb29953f221
task-3169378
closesodoo/odoo#111933
X-original-commit: 9816b2ba6ee85dcba7b2f85e70c617994b7748c4
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
We need German states when formatting the 'SteurNummer'.
So we provide it so the user can select his, instead of having to
create them by hand.
task-3056694
opw-2974560
closesodoo/odoo#111932
X-original-commit: 6c8f3dc4fdffa167680f3a234a13b028c2f54a3b
Related: odoo/enterprise#36703
Signed-off-by: William André (wan) <wan@odoo.com>
When you create or update a partner from the POS, it will call the
server to get the new modifications on partners.
When you put a limit to 0 and so no background loading. You don't get
any partners and when you create or update one, it will try to load all
of your partners because the last write_date is unknown. Which is not
the intended behaviour.
If you have set a limit different than 0, you will not get all of them
(because you already have some records but it can take a larger batch
than the one defined.
So we are now trying to correctly handle the load of new partners.
closesodoo/odoo#111912
X-original-commit: a5af7b235c8a786e972698ab709fd74f4c1bf515
Signed-off-by: Masereel Pierre <pim@odoo.com>
In the view 'view_order_form_with_carrier' we have an xpath to
'picking_policy' which is not in the parent view 'sale.view_order_form'.
The field 'picking policy' is set on the sale order view in the override
of sale_stock in view 'sale_stock.view_order_form_inherit_sale_stock'
So we've adapted the inherit_id to match the correct view.
closesodoo/odoo#111897
X-original-commit: 1e805aa773926f4ad8c9705cffdc433f5ca23621
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Masereel Pierre <pim@odoo.com>
The UI elements related to table creation and edition are no longer
present in the toolbar, as the Wysiwyg and SnippetEditor instances
remove the `#table` div section from toolbar.
Furthermore, the OdooEditor instantiates a TablePicker instance to be
appended to the tablepicker dropdown menu under the (inexistant) #table div
in the toolbar.
This commit removes dead code related to table creation/edition via the
toolbar.
task-3074598
Part-of: odoo/odoo#111131
When auto-fill the duration of workorders in immediate production, the
workorder cost is not included in the price of the product.
It happens becuase we calculate the price in _post_inventory but we set
the duration after _post_inventory. To fix, we set the duration of the
workorders in before _post_inventory.
closesodoo/odoo#111898
X-original-commit: 707769478b9f63319689ff2347d300ce1800d1d0
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Yuchen Huang (yhu) <yhu@odoo.com>
before this commit, on closing/confirming a blanket order by a purchase user throws access right on product_supplierinfo model.
after this commit, access right error will not be shown on confirming and closing the blanket order.
closesodoo/odoo#111896
X-original-commit: 9d86621029a478b8e1cbae4f228fe454a184fba3
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
When count_limit is set and lower than the current number of fetched records, making an extra search_count is useless.
closesodoo/odoo#111895
X-original-commit: 6f90d6924e24e700694111732ee85465f802b22f
Signed-off-by: Rémy Voet <ryv@odoo.com>
`formatFloatTime` uses `Math.floor` to compute minutes out of float time value.
It doesn't work in edge case when the float value is already rounded (e.g. by
server). Example:
* 35 minutes is 0,58333...
* server rounds value to 0,58 hour
* 0,58*60 = 34,8 minutes, which is rounded to 34 minutes by `Math.floor`
STEPS:
1. Field Service > Any task > Timesheets tab
2. Add a line for 1:35
3. The total shows 1:34
4. Add another line for 0:45
5. The total shows 2:19
opw-3091805
closesodoo/odoo#111890
X-original-commit: e3417200913623c56d430f163f731d4424f7cc70
Related: odoo/enterprise#36687
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
This commit fixed the ExportDialog used when there are the same
field used multiple times in a list view. Since those duplicated
elements were given twice to the dialog, there was a bug causing
a crash due to a duplicated t-key in the template.
Since duplicated fields must not be displayed twice in the list
of available fields to export, the defaultExportList has been
filtered to only return unique elements.
A test has been added to verify that duplicated fields are not
given twice by the list controller, by only displaying once the
corresponding field.
ticket #3150866closesodoo/odoo#111884
X-original-commit: 74b09fbd346f5759fc3fa8ed28ec15d5f58a7a42
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
The payment values in the Qweb context of sale, sale_subscription and
website_sale were computed separately, although there is a large common
basis. This split made it hard to communicate between modules and
generated a lot of duplicates. The new function `_get_payment_values`
in sales is now used as a common basis method for all sale_* modules to
get the common payment values.
closesodoo/odoo#107788
Related: odoo/enterprise#34922
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
Before this commit conditions based on `_handle_visibility` and
`_get_cached_visibility` did work only by relying on the cache of the
`menu.page_id` being populated when accessing `is_visible` in sudo.
This does not work if the cache is cleared between the calls.
This commit makes sure all 3 conditions have access the record.
The actual issue has not been reproduced locally yet.
The various workers, crons, websocket work on distinct envs - even
through code they cannot impact the cache of another local env outside
the `check_signaling` system which is only used between requests.
For the problem to occur, some intra-request multithreading is needed
but it could not be located so far.
task-3149270
closesodoo/odoo#111882
X-original-commit: a864192ecd270848fede23d3eb053318d07ae8e8
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This commit adds cumulated optional attribute to the graph view rng
definition.
`cumulated` graph attribute is used, defined and tested in PR #97394.
closesodoo/odoo#111880
X-original-commit: 5be91c78c687cc2ac8fd3f9a94e4e8ef2b951efa
Signed-off-by: Dardenne Florent (dafl) <dafl@odoo.com>
When a odoo user already exists, the installation of the deb package
fails because the `/var/lib/odoo` directory does not exists.
The reason is that the postinst script is trying to change the
permissions of this directory which is only created if a odoo user does
not already exists.
With this commit, the permission changes only occurs when the directory
is created.
closesodoo/odoo#111877
X-original-commit: 8e1ebd8de01bc9d97e47572bc8b1d2eaafebf743
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>