Commit Graph
158282 Commits
Author SHA1 Message Date
Florent de Labarre fdaae9f101 [FIX] account: prevent change restrict mode hash
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.

closes odoo/odoo#112028

X-original-commit: c1bcf20a4c58516e484417885f47e32a8c192dc1
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-02-07 08:40:49 +01:00
Tommy (tong) 30926d94e8 [FIX] hr_holidays: end of year accrual calculation issue for yearly accrual plan
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.

closes odoo/odoo#112004

X-original-commit: ea53b57a890412714a3d6f5d6946705bf3391e90
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-02-07 08:40:45 +01:00
Antoine Guenet 4ce0664f6a [FIX] web_editor: prevent merging table with other element on paste
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

closes odoo/odoo#112042

X-original-commit: 07604f2505d9cc32ebb3cf3f09192472f0bf30c4
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
2023-02-07 07:43:50 +01:00
william-andre 82be3c8441 [FIX] account: handle writing just tax_ids on an aml
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

closes odoo/odoo#112049

X-original-commit: b3d60185aba865905d7d91c3e1edfae1123b03b9
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-02-06 23:04:43 +01:00
william-andre 11ddbf3617 [FIX] account: update balance when changing amount in currency
Before it wasn't done for simplicity, but turns out it is actually quite
simple to do.

task-3167055

closes odoo/odoo#112043

X-original-commit: 21cb20a284a98a59bf5885ad56d231ae337105e1
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-02-06 22:11:02 +01:00
Ivan Yelizariev 4862bec68e [FIX] web: fix overlapping of Add, Expand buttons in export wizard
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

closes odoo/odoo#112034

X-original-commit: f10a4886d2c2bfc0d4643e0e4597e62c2ba4f94e
Signed-off-by: Luca Vitali <luvi@odoo.com>
2023-02-06 20:39:42 +01:00
Antoine Vandevenne (anv) 6457145837 [FIX] paypal_paypal: log processing errors in the chatter
opw-3097856

closes odoo/odoo#112012

X-original-commit: c45e6c670bfa7c9223854d8d7863377fab255b4d
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-02-06 18:35:30 +01:00
qsm-odoo 506d88ea48 [REM] website: delete data-oe-company-name
The `<html>` element of websites had a `data-oe-company-name` attribute
which was dead code since a long time. This commit removes it.

Some history:

- [1] introduced the SEO dialog which suggested the company name as
  keyword value. That value was retrieved through a `<meta>` which was
  added in the DOM at the time.

- [2] converted the `<meta>` tag into valid HTML code, by introducing
  `data-oe-company-name`.

- [3] suddenly stopped caring about the company name value... but left
  `data-oe-company-name` as dead code, alongside a JS method reading
  it (in the SEO dialog class).

- [4] removed the JS method dead code by refactoring the whole SEO
  dialog during the website-in-backend refactoring... but still left the
  `data-oe-company-name` dead code.

This commit finally cleans it. It was judged that not using the company
name value (as step [3] decided) is ok.

[1]: https://github.com/odoo/odoo/commit/f50b273ae12493e227806670d9a866b6be162551
[2]: https://github.com/odoo/odoo/commit/e28c8101232d527c2d3ea2e619013ca70602d957
[3]: https://github.com/odoo/odoo/commit/d52ec7fc42cbeecafea921ea30d1d0723a59078a
[4]: https://github.com/odoo/odoo/commit/ac55f2bb113ecf7c774fe6e96d28e716184a97d1

closes odoo/odoo#112007

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-02-06 16:28:50 +01:00
pedrambiria 5cec1fc94d [FIX] pos_stripe: capture payment with non-admin user
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

closes odoo/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>
2023-02-06 16:28:47 +01:00
Paolo Gatti 89f12d66b9 [FIX] l10n_it_edi: Fixing the template trimmings
Strings must be trimmed in the XML output because
the Tax Agency has requisites on the length.

Specs: https://www.fatturapa.gov.it/export/documenti/fatturapa/v1.2.2/RappresentazioneTabellareFattOrdinaria.pdf
Ticket link: https://www.odoo.com/web#id=3044072&model=project.task

opw-3044072

closes odoo/odoo#111944

X-original-commit: 3bd90997b7f06883d595c4c573a11b426efd8de6
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
2023-02-06 16:28:41 +01:00
niyasraphy d6f3fcfee7 [FIX] account: translatable action name
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.

closes odoo/odoo#111991

X-original-commit: 6aa80ca670476494b10115f61805324811b73a58
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-02-06 15:27:07 +01:00
niyasraphy 0dad393206 [FIX] account: traceback on accrued revenue entry when no order line
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.

closes odoo/odoo#111976

X-original-commit: d68eafd5c06fef77ba669df0e0ca6cd7217b08b5
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-02-06 14:16:52 +01:00
Paolo Gatti (pgi) 1d3f4a73ac [IMP] l10n_it_edi_*: Withholding, pension fund
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

closes odoo/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>
2023-02-06 14:16:42 +01:00
jbw-odoo 25f26acc05 [FIX] account: accrual date fix
SO/PO accrued entries date should be the last day of the previous month since it necessarily concerns a bygone period.

closes odoo/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>
2023-02-06 14:16:39 +01:00
jbw-odoo 4c909c9715 [FIX] web: gray out sample data group lines in list view
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.

closes odoo/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>
2023-02-06 14:16:37 +01:00
Mathias Mathy (MAMA) 0a43740481 [REF] Stock: report_stock_forecasted to owl
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#32116

closes odoo/odoo#101247

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-02-06 14:16:26 +01:00
Touati Djamel (otd) a8398234cb [FIX] stock_account: fix remaining qty in svl
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

closes odoo/odoo#111911

X-original-commit: f6f5d4a27af5bad42c3c6c11ce681be631f43248
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-02-06 13:15:45 +01:00
Géry Debongnie a5036864b1 [IMP] web: add a memoized checkAccessRight method on user service
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.

closes odoo/odoo#111571

Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-02-06 12:09:51 +01:00
Géry Debongnie fd5b2e6a20 [IMP] web_editor: only load ice server configuration once
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
2023-02-06 12:09:51 +01:00
Audric Onockx (auon) da874e053e [IMP] project: make orders give them recurrence to the tasks they create
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

closes odoo/odoo#92696

Related: odoo/enterprise#27953
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-02-06 12:09:44 +01:00
Pierre Rousseau c904bd7c5e [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/b1f3dd55e [FIX] Cell/clipboard: Fix last cell deletion
https://github.com/odoo/o-spreadsheet/commit/7a183b176 [REF/IMP] figure: refactor figure container and handle scroll
https://github.com/odoo/o-spreadsheet/commit/64b9f825c [REF] sheetview: split getter "getActiveSheetScrollInfo"
https://github.com/odoo/o-spreadsheet/commit/be9540654 [IMP] top bar: add 'text wrapping' options
https://github.com/odoo/o-spreadsheet/commit/a7d59e34f [IMP] top bar: add 'vertical alignment' options
https://github.com/odoo/o-spreadsheet/commit/d4663158d [FIX] menu: use capture for events
https://github.com/odoo/o-spreadsheet/commit/29fa62c35 [FIX] figures: copy paste through context menu not working
https://github.com/odoo/o-spreadsheet/commit/8cdc7c193 [FIX] selection processor: expose only interface
https://github.com/odoo/o-spreadsheet/commit/ab6c4d86e [FIX] selection: avoid scroll when using ctrl+a loop
https://github.com/odoo/o-spreadsheet/commit/fd1140c72 [FIX] Renderer: Speed up rendering
https://github.com/odoo/o-spreadsheet/commit/0358a76d5 [FIX] components: Fix static colors for spreadsheet
https://github.com/odoo/o-spreadsheet/commit/8497bf562 [REF] tests: introduce click helper
https://github.com/odoo/o-spreadsheet/commit/662996755 [FIX] drag & drop: mouse outside the grid & freeze panes
https://github.com/odoo/o-spreadsheet/commit/472852266 [IMP] chart: format Y values
https://github.com/odoo/o-spreadsheet/commit/b561936fd [IMP] tests: Speed up composer tests

closes odoo/odoo#111953

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-02-06 10:19:02 +01:00
Adrien Dieudonné 237ab9f05a [FIX] web: form settings fields width on mobile
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

closes odoo/odoo#111934

X-original-commit: 49b3fed0ae9bbe43ea55ec5809f47a674a393e4d
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-02-06 10:18:59 +01:00
Rodopho Cammarosano de Lima (rcdl) 4e4ed9b098 [FIX] web_editor: save a historyStep upon cut
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

closes odoo/odoo#111927

X-original-commit: 451f1a2641b5b85ea75d9f1e8a8d1b528de031b6
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-06 10:18:56 +01:00
niyasraphy c7876371b1 [FIX] web: upgrade widget open in new tab
closes odoo/odoo#111921

X-original-commit: 91eafb359048dd654ffdfcca5e6016ec1b0fbaa0
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-02-06 10:18:53 +01:00
yhu-odoo 48fceb2253 [FIX] stock: prevent change cancelled move
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

closes odoo/odoo#111910

X-original-commit: c6c3e5984c3fa0fc1810ae490bd4ce10390eebd8
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-02-06 10:18:51 +01:00
Gabriel de Paula Felix (gdpf) 75c6eda262 [IMP] calendar: remove rpc from setup
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.

closes odoo/odoo#111831

Task: 3141281
X-original-commit: 295f04b3496763cfef5237ff4b1f40df232371a7
Signed-off-by: Arnaud Joset <arj@odoo.com>
2023-02-06 10:18:45 +01:00
Yolann Sabaux 7e6f7d943e [FIX] account: prevent qr-generation if errors in preview
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

closes odoo/odoo#111929

X-original-commit: 30a8e933b3cda9c3c663c4d05d1efdc023b17b1e
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
2023-02-06 09:20:56 +01:00
Raphael Collet 206525658b [IMP] core: add a class for trigger trees
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.

closes odoo/odoo#111946

X-original-commit: 8a01d74e5f7d035cfd05bc02596f075270e0fcf8
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-02-04 22:39:45 +01:00
Raphael Collet 65261cd7f0 [FIX] core: make trigger trees faster
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
2023-02-04 22:39:45 +01:00
Raphael Collet 161e5fad3b [REF] core: make APIs on registry for computation triggers
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
2023-02-04 22:39:45 +01:00
Raphael Collet 42b1faf328 [FIX] base: remove circular dependency between fields
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
2023-02-04 22:39:45 +01:00
Raphael Collet ed762a3cef [FIX] core: field recomputed on more records than expected
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().

closes odoo/odoo#111943

X-original-commit: bb3a6e378b5f6b2e14b74ce4efb6d749ad54cb1e
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-02-04 18:48:07 +01:00
Thomas Lefebvre (thle) 0b69bf0258 [FIX] website_sale_delivery: add the modification of a relay point
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

closes odoo/odoo#111914

X-original-commit: cce78ebce1bd7b7f2ddbdbf1beec0d7bafccf6ae
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-02-04 11:48:24 +01:00
std-odoo c17f34513e [FIX] microsoft_outlook: support single tenant apps
Purpose
=======
Allow to customize the Outlook endpoint to be able to use single
tenant apps.

Task-3053447

closes odoo/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>
2023-02-04 10:45:02 +01:00
Romain Derie 6f975d66b7 [FIX] website: improve perf of url dependencies search
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

closes odoo/odoo#111933

X-original-commit: 9816b2ba6ee85dcba7b2f85e70c617994b7748c4
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-02-04 00:39:14 +01:00
gawa-odoo 29a8d65013 [FIX] base: add German states
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

closes odoo/odoo#111932

X-original-commit: 6c8f3dc4fdffa167680f3a234a13b028c2f54a3b
Related: odoo/enterprise#36703
Signed-off-by: William André (wan) <wan@odoo.com>
2023-02-03 22:52:14 +01:00
Pierre Masereel 9d62888623 [FIX] point_of_sale: limited load new partners
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.

closes odoo/odoo#111912

X-original-commit: a5af7b235c8a786e972698ab709fd74f4c1bf515
Signed-off-by: Masereel Pierre <pim@odoo.com>
2023-02-03 21:49:43 +01:00
Pierre Masereel 44994bf419 [FIX] delivery: view references a field not in the parent
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.

closes odoo/odoo#111897

X-original-commit: 1e805aa773926f4ad8c9705cffdc433f5ca23621
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Masereel Pierre <pim@odoo.com>
2023-02-03 21:49:41 +01:00
Ivan Yelizariev 910cacd262 [FIX] board: use correct tree view id
`board` module allows adding current tree view to My Dashboard menu. It copies
some settings (context, domain, etc.), but not the list view id. Because of
that, default list view is used. However, the default list view might be
different from what user sees in original menu. For example, there are two tree
views for `purchase.order`:

`purchase_order_tree`
https://github.com/odoo/odoo/blob/6b101d5ff0ad78b9ae2ad312f362c2224e7af457/addons/purchase/views/purchase_views.xml#L535

`purchase_order_view_tree`
https://github.com/odoo/odoo/blob/6b101d5ff0ad78b9ae2ad312f362c2224e7af457/addons/purchase/views/purchase_views.xml#L599

But only one of them has field `receipt_status`
https://github.com/odoo/odoo/blob/6b101d5ff0ad78b9ae2ad312f362c2224e7af457/addons/purchase_stock/views/purchase_views.xml#L91

So, that field wasn't available in the Dashboard, which is quite annoying.

Fix it by forcing `viewId`.

STEPS:
- Click on Purchase App > Go to 'Purchase Orders'
- enable all the columns to show in listview (from that 2 arrows of listview on right side corner)
- Once you enable visibility of all columns in listview for Purchase orders list. Just Go to Favourites -> Save to Dashboard, give any name
- Reload the browser.
- Open Dashboard , go to My Dashboard
- Now see the customer dashboard which you create with certain columns is not visible in this Dashboard listview. and no way to make it visible even.

opw-3130088

closes odoo/odoo#111913

X-original-commit: 7e41555d86a9e91176dc024c6e95ec1e748a08f7
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-03 19:49:15 +01:00
Rodopho Cammarosano de Lima (rcdl) 841d9eaf40 [REM] web_editor: remove unused method _isSelectionOnlyZws
The forementioned method is not called anywhere in the code.

closes odoo/odoo#111131

Related: odoo/enterprise#36356
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-03 18:43:45 +01:00
Rodopho Cammarosano de Lima (rcdl) 82dfb82b21 [REM] web_editor: remove table-related code from toolbar
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
2023-02-03 18:43:44 +01:00
yhu-odoo 5e2b97b47f [FIX] mrp: workorder cost not included in price
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.

closes odoo/odoo#111898

X-original-commit: 707769478b9f63319689ff2347d300ce1800d1d0
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Yuchen Huang (yhu) <yhu@odoo.com>
2023-02-03 17:41:21 +01:00
niyasraphy 2f069b9ce8 [FIX] purchase_requisition: access right error on confirm/cancel bo
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.

closes odoo/odoo#111896

X-original-commit: 9d86621029a478b8e1cbae4f228fe454a184fba3
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-02-03 17:41:18 +01:00
Laurent Smet d724f69a1d [FIX] web: Fix useless search_count with count_limit
When count_limit is set and lower than the current number of fetched records, making an extra search_count is useless.

closes odoo/odoo#111895

X-original-commit: 6f90d6924e24e700694111732ee85465f802b22f
Signed-off-by: Rémy Voet <ryv@odoo.com>
2023-02-03 17:41:15 +01:00
Ivan Yelizariev d8ba0ad0c0 [FIX] web: fix rounding on rendering time fields
`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

closes odoo/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>
2023-02-03 17:41:10 +01:00
luvi 896d3dc7a8 [FIX] web: fix export list with duplicated fields
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 #3150866

closes odoo/odoo#111884

X-original-commit: 74b09fbd346f5759fc3fa8ed28ec15d5f58a7a42
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-03 17:41:05 +01:00
Valentin Vallaeys (vava) e534ab41e7 [REF] payment, (website_)sale: factorize payment values logic in controllers
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.

closes odoo/odoo#107788

Related: odoo/enterprise#34922
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
2023-02-03 17:40:58 +01:00
Romain Derie fa37c67014 [FIX] website: not rely on sudo cache magic for menu visibility
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

closes odoo/odoo#111882

X-original-commit: a864192ecd270848fede23d3eb053318d07ae8e8
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-02-03 16:32:51 +01:00
Thibault Libioulle c13735bde9 [FIX] base: add cumulated to rng graph file
This commit adds cumulated optional attribute to the graph view rng
definition.

`cumulated` graph attribute is used, defined and tested in PR #97394.

closes odoo/odoo#111880

X-original-commit: 5be91c78c687cc2ac8fd3f9a94e4e8ef2b951efa
Signed-off-by: Dardenne Florent (dafl) <dafl@odoo.com>
2023-02-03 16:32:48 +01:00
Christophe Monniez a5d878ab9b [FIX] packaging: fix installing deb package when user exists
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.

closes odoo/odoo#111877

X-original-commit: 8e1ebd8de01bc9d97e47572bc8b1d2eaafebf743
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-02-03 16:32:46 +01:00