Commit Graph
153442 Commits
Author SHA1 Message Date
Denis Ledoux 44be7a4ba6 [IMP] hr_contract: move group inside the view
The goal being to get rid of the `groups_id` feature for backend views

Part-of: odoo/odoo#98551
2022-08-29 22:42:53 +02:00
Denis Ledoux 87e968a45a [IMP] purchase: move group inside the view
The goal being to get rid of the `groups_id` feature for backend views

Part-of: odoo/odoo#98551
2022-08-29 22:42:53 +02:00
Denis Ledoux a64f5e33b8 [IMP] sale_project: move group inside the view
The goal being to get rid of the `groups_id` feature for backend views

Part-of: odoo/odoo#98551
2022-08-29 22:42:53 +02:00
Denis Ledoux 2e3f385753 [IMP] sale_project: move group inside the view
The goal being to get rid of the `groups_id` feature for backend views

Part-of: odoo/odoo#98551
2022-08-29 22:42:53 +02:00
Denis Ledoux 538bc40ca3 [IMP] website_sale: move group inside the view
Move the `website.group_website_designer` from the view groups_id
to the view architecture,
the goal being to get rid of the `groups_id` feature for backend views.

The use case here is really not clear:
- First, to access the settings, you must be admin,
meaning you always have the group `website.group_website_designer` when
you see the settings, hence it's not really useful to specify the group.
- Second, imagine you could access the settings without being admin,
it wouldn't make sense to let users not having the designer group to
update the terms without the website features, as they would
override the work of the designer who designed the terms using
the website features, with the rich HTML and everything

Part-of: odoo/odoo#98551
2022-08-29 22:42:52 +02:00
Denis Ledoux 9dd3ef98b7 [IMP] sale_project: remove base.group_user from back view groups
Having a back-end view with as group `base.group_user` in its `groups_id`
doesn't make sense since portal users use the frontend
to access their documents.

Part-of: odoo/odoo#98551
2022-08-29 22:42:52 +02:00
Denis Ledoux 0a617dc0cb [IMP] sale_project: merge milestone salesman attributes view in its base
Part-of: odoo/odoo#98551
2022-08-29 22:42:52 +02:00
Denis Ledoux 56a087284f [IMP] hr_attendance: do not allow employees to edit their attendances
Revision 7fd7422647
takes care to prevent employees to modify manually their attendances,
by removing the edit button from the attendance list.

This is only visual, this doesn't actually
prevent users to change their attendances,
for instance through XMLRPC.

Besides, with the group comment:
```xml
    <record id="group_hr_attendance" model="res.groups">
        <field name="name">User</field>
        <field name="category_id" ref="base.module_category_human_resources_attendances"/>
        <field name="comment">The user will gain access to the human resources attendance menu, enabling him to manage his own attendance.</field>
    </record>
```

To me:
- Employees should be able to sign in and sign out only
- Attendance users should be able to modify their own attendances only
- Attendance managers can modify attendances of anybody.

Hence, instead of removing the edit button on the view,
change the ACLs so employees do not have the rights to modify their
attendances at all.

Part-of: odoo/odoo#98551
2022-08-29 22:42:52 +02:00
Denis Ledoux 29168ebdcb [IMP] sale_expense: handle manager sale_order_id attribute in base view
Part-of: odoo/odoo#98551
2022-08-29 22:42:51 +02:00
Denis Ledoux fd1dfe57bf [IMP] stock: remove groups_id of product_template_form_view_procurement_button
Part-of: odoo/odoo#98551
2022-08-29 22:42:51 +02:00
Denis Ledoux 3f15903803 [IMP] stock: remove attributes inherit to set the same attribute
This xpath on `group_lots_and_weight` to change the `attrs` attributes
is useless as it's already the same exact value in the base view:
https://github.com/odoo/odoo/blob/d108db36ca2974179ded929370ea45a106f2e08c/addons/product/views/product_views.xml#L119

This oversight probably comes from the change in this commit:
https://github.com/odoo/odoo/commit/4a350ff8ccad554d38d977605b99d47ef8a3873e#diff-9afa40fdafcf103e7456e139c259f78469ea7e675c79f6d13dfe7db2d43c38d6L347

Part-of: odoo/odoo#98551
2022-08-29 22:42:51 +02:00
Denis Ledoux 89f5a8b036 [IMP] crm: remove groups_id from view_partners_form_crm1
Part-of: odoo/odoo#98551
2022-08-29 22:42:51 +02:00
Denis Ledoux e510f0835f [IMP] crm, sales_team, base: add default in their origin module
In the `res.partner` form:
- the field `user_id` is set in base,
and is directly within the base res.partner.form form view,
within the `Sales & Purchase` notebook page
(which is in the base module despite what the tab name could make think)
https://github.com/odoo/odoo/blob/f294079a8946e88f0564dc96bf8a9531958697fe/odoo/addons/base/views/res_partner_views.xml#L343
- the field `team_id` is set in the module `sales_team`, and added
in the res.partner.form form view from this `sales_team` module
https://github.com/odoo/odoo/blob/f294079a8946e88f0564dc96bf8a9531958697fe/addons/sales_team/views/res_partner_views.xml#L9

Therefore, there isn't any obvious reason why the context `default_`
keys for `user_id` and `team_id` are set
only once the `crm` module installed,
neither why it only applies if you are a salesperson
(to the group `sales_team.group_sale_salesman`, sets in the view
`groups_id`).

If we have a look to the commit
f0b7600314
The goal described in the commit description is still achieved
by moving these default context keys in their respective module.
Besides, having a closer look in this commit,
`default_user_id` is directly added in the simplified partner form
within the base module, but is added through the crm module
for the regular form. Which doesn't make really sense.

Part-of: odoo/odoo#98551
2022-08-29 22:42:50 +02:00
Denis Ledoux 8b91cab67f [IMP] base: remove groups_id from ir.ui.view
The goal of this revision is to get rid of the `groups_id` field of the model `ir.ui.view`.

- This feature wasn't really known or used by most developers,
   and not straight-forward to understand.
   Removing it allows one less complicated thing to learn for developers.
   Besides, thanks to odoo/odoo#95729,
   changing the behavior of the `groups=` attribute,
   we can easily get rid of this `groups_id` feature
   by simply adding `groups=` in the elements of the views
   using the `groups_id` field, it will have the same effect:
   adding the elements in the view only for the users part of the specified group.

- By getting rid of the groups_id many2many field on ir.ui.view,
   it makes possible to cache the view architecture without
   requiring to use the groups in the cache key.
   Currently, if we want to cache the view architecture,
  it would be required to use the intersection of the user
  groups with the groups_id groups of the view,
  making it costly to compute the cache key,
  therefore altering the performance point to cache the view
  architectures.

Part-of: odoo/odoo#98551
2022-08-29 22:42:50 +02:00
Joren Van Onder aa17542267 [FIX] pos_mercury: correctly escape the request
in v14 `_render()` on `ir.ui.view` returned `str`. In v15 it returns
`Markup` instead. This inadvertently changed the behavior of
`_do_request()`. The rendered view stored in `xml_transaction` is
added to the request as the SOAP body and is supposed to be
escaped. This is done by `html_escape(xml_transaction)` but since
`xml_transaction` is already `Markup` it won't escape. On top of that
concatenating the `soap_header` and `soap_footer` `str`s causes them
to be escaped when they shouldn't be.

This commit changes `xml_transaction` to be a single `Markup()` that
inserts the escaped view and password inside of
`<mer:CreditTransaction>`. This has the added benefit of solving an
issue when the password includes a character with a special meaning,
although I'm not aware of a real case where this happened.

opw-2919085

closes odoo/odoo#98759

X-original-commit: 8e51b1df76f35a7c01e5f86920c84b2c1c976d9b
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-08-29 19:48:39 +02:00
Matthieu Stockbauer 39615e3bab [FIX] bus: fix display reconnect notif test
The bus test "display reconnect notification" sometimes fails because
the notification is removed before the assertion occurs. Let's block
the start method of the worker to block the reconnection until the
assertion is made.

closes odoo/odoo#99160

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-29 18:40:11 +02:00
Nshimiyimana Séna 99f7d9e7f1 [IMP] account: add default filter to journal items when coming from an account
This PR adds the 'posted' filter by default on the journal items list
view, when coming from an account's form view.

opw-2896728

closes odoo/odoo#99012

X-original-commit: c976a0920dd8d7910c7635cc1e2bbff47edcafa9
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
Signed-off-by: Nshimiyimana Serge Séna (sesn) <sesn@odoo.com>
2022-08-29 16:30:21 +02:00
minhthuy145 84689fae4e [FIX] website_event_track_quiz: add group security to the button
closes odoo/odoo#98690

X-original-commit: 97884f65fb6f4bdeaf482002795a64b86f47f220
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-08-29 13:49:18 +02:00
Mathieu Duckerts-Antoine 6a5497c187 [REF] resource: convert section_one2many
This commit converts the old "section_one2many" field to the new
WOWL field API.

closes odoo/odoo#97984

Related: odoo/enterprise#30789
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-29 13:49:11 +02:00
Mathieu Duckerts-AntoineandLucas Perais baf1d5b6d0 [REF] website_slides: convert slide_category_one2many
This commit converts the old "slide_category_one2many" field to the new
WOWL field API.

Part-of: odoo/odoo#97984
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-08-29 13:49:10 +02:00
Mathieu Duckerts-Antoine 86e85ad5fd [REF] survey: convert survey_description_page
This commit converts the field "survey_description_page" field to the
new WOWL field API.

Part-of: odoo/odoo#97984
2022-08-29 13:49:10 +02:00
Lucas Perais eac5022455 [REF] survey: convert question_page_one2many
This commit converts the old one2many field to display survey questions
and sections to the new WOWL field API.

Part-of: odoo/odoo#97984
2022-08-29 13:49:10 +02:00
Mathieu Duckerts-Antoine 1870b49d31 [REF] *: manage columns record by record in list
Several modules need to display records data in a list table in a way
suitable to possibly different record types. Here we refactor the list
renderer to allows to specify columns (and their colspans) record by
record.

Part-of: odoo/odoo#97984
2022-08-29 13:49:09 +02:00
Mathieu Duckerts-Antoine 8b1d92c787 [REF] *: list: renderer templates called dynamically
Several modules need to modify some parts of the templates used by the
list renderer. Those being called recursively (and with parameters
sometimes), it is quite lengthy to do. Now the call to templates are done
dynamically so that it is easier to extend the templates by specifying
some static keys of the ListRenderer.

Part-of: odoo/odoo#97984
2022-08-29 13:49:09 +02:00
Mathieu Duckerts-AntoineandLucas Perais 9b1456a2ec [REF] web: x2manyField: edit/add records inline conditionally
The aim of this commit is to provide better API points to be able
to extend the behavior of the X2ManyField in conjunction with the
ListRenderer. More precisely, we make possible to specify record by
record if it should be edited/created inline or in a dialog.

Part-of: odoo/odoo#97984
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-08-29 13:49:09 +02:00
Lucas Perais 481acba93b [REF] *: x2m field: easier access to renderers for extensibility
Before this commit, X2Many renderers were not easily accessible from the outside,
making it difficult to override them in some extension.

After this commit, the renderers are accessible in the object `components` on the constructor.

Part-of: odoo/odoo#97984
2022-08-29 13:49:09 +02:00
Brice bib Bartoletti 12cf871f8e [REF] account: structure folder to component
closes odoo/odoo#96672

Related: odoo/enterprise#30076
Signed-off-by: William André (wan) <wan@odoo.com>
2022-08-27 19:01:14 +02:00
Brice bib Bartoletti d6ab621198 [FIX] account: resequence widget template
There should be several line in t-body but not several t-body

Part-of: odoo/odoo#96672
2022-08-27 19:01:14 +02:00
Habib (ayh) d36a4dd14e [FIX] account,l10n_ar,test_main_flows: tour
As the owl views gets activate, the tours gets broken.

Part-of: odoo/odoo#96672
2022-08-27 19:01:13 +02:00
Brice bib Bartoletti a3c7a06dc3 [REF] mail: remove account.move.line hack
While refactoring the move_line_list_views.js in owl, we provided the
account.move id and model + "generate" a thread in the front-end for
account.move.line instead of only providing account.move.line model and id.

This allows us to get rid of this hacky special case

Task-id: 2857743
Part-of: odoo/odoo#96672
2022-08-27 19:01:13 +02:00
Habib (ayh) 569ca1bd20 [REM] account: account_dashboard_setup_bar.js
Part-of: odoo/odoo#96672
2022-08-27 19:01:13 +02:00
Habib (ayh) b093ed5997 [FIX] account: tax_totals.js
Part-of: odoo/odoo#96672
2022-08-27 19:01:13 +02:00
Habib (ayh) 5d4a337a2b [IMP] account: account_move_form owl migrate
Part-of: odoo/odoo#96672
2022-08-27 19:01:12 +02:00
Habib (ayh) 4f4e31c623 [IMP] account: mail activity kanban widget - owl migration
Part-of: odoo/odoo#96672
2022-08-27 19:01:12 +02:00
Habib (ayh) c2e3f94bde [IMP] account: open_move_widget owl migration
Part-of: odoo/odoo#96672
2022-08-27 19:01:12 +02:00
Habib (ayh) 41b32b47c4 [IMP] account: account_type_selection widget owl migration
Part-of: odoo/odoo#96672
2022-08-27 19:01:12 +02:00
Habib (ayh) 3d08246818 [IMP] account: fixes for owl. underscore.js removed
Part-of: odoo/odoo#96672
2022-08-27 19:01:11 +02:00
Habib (ayh) 43f516e90d [IMP] web: file_uploader: callback after all files have been uploaded
Part-of: odoo/odoo#96672
2022-08-27 19:01:11 +02:00
Habib (ayh) db008ff03a [IMP] account: bills upload wowl migration
Part-of: odoo/odoo#96672
2022-08-27 19:01:11 +02:00
Habib (ayh) b0ee5be676 [IMP] account: account_payment_field wowl migration
Part-of: odoo/odoo#96672
2022-08-27 19:01:11 +02:00
Habib (ayh) 5a21823f43 [IMP] account: section_and_note_fields wowl migration
Part-of: odoo/odoo#96672
2022-08-27 19:01:10 +02:00
EmanAliYousef 305e2ffd78 [CLA] signature for EmanAliYousef
closes odoo/odoo#99052

X-original-commit: db0084f3753e67480a7a9ed81b28a78d6fb2161a
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-08-27 11:40:22 +02:00
tafaRU 3c5975e4d4 [CLA] Agile Business Group
closes odoo/odoo#99061

X-original-commit: 02b4e98ebb2c45d9a4af10fe1bc732f048708f85
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-08-27 09:24:55 +02:00
aliya 2de3e3cbe5 [FIX] account: constrain foreign currency in bank statements
On a bank statement line:
If a foreign currency is set and the amount in currency is not set, the line is reconciled automatically (because the amount is 0) and this should not be the case.

Add a constraint on `account.bank.statement.line`: raise an error if the foreign currency is added, but the amount in currency is not.

This conflicts with the tests that allow this behaviour, so the related tests are deleted as this should not be allowed anymore.

task-2956422

closes odoo/odoo#99028

X-original-commit: 1dfa3d074c7368abb51df56cb7fd1ee5115399b1
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
2022-08-27 07:06:48 +02:00
Alexandre Kühn b8f0ccf6ed [FIX] im_livechat: properly display operator avatar in posted message
Before this commit, avatar of operator was not displayed properly.
This is due to src of avatar being wrongly computed: the serverUrl
data is in `PublicLivechatGlobal`, not in `LivechatButtonView`.

Because of this, the src was prefixed with `undefined/` instead
of the server url, hence no displaying the avatar of operator.

This commit fixes issue by getting actual `serverUrl` in correct
model `PublicLivechatGlobal`.

closes odoo/odoo#99022

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-27 05:25:53 +02:00
Alexandre Kühn 0d06e5aae8 [FIX] im_livechat: make bubble background behind message content
Before this commit, bubble background was on top of message content.
This prevent user interaction on the message.
This commit fixes the issue by properly putting background behind text.

closes odoo/odoo#99020

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-27 05:25:50 +02:00
Romain Derie c5a10d2cd7 [FIX] web_editor: prevent sizing to trigger changes events on focus
Before this commit, when one was clicking/focusing an element which was
receiving the sizing option(s), it would directly trigger some onchanges
internal events, even if no changes were done yet.
One of those events was `change_column_size` directly called on the
steps snippets options.

That event was then listened by the steps options and was making the
connector to be reloaded.

While it was useless as there were no real changes yet (just focused),
it was also leading to a traceback if one was clicking on an outdated
steps snippet, for instance after a migration from v15.
In saas-15.1, the connectors were improved with [1] and became svg
elements instead of pseudo elements.
The internal method reloading the connector thus can't find those
selectors on an outdated snippet.

This commit now splits the code in 2, to extract the firing of the
onchange events when there is actually some changes.

This will allow to click on outdated steps snippet without having a
traceback as the code won't try to reload the connectors anymore.
That outdated block will then be marked as such in the right panel and
the user will be able to delete it to recreate it if needed.

Remember than without this commit, since there would be a traceback, the
whole current page edition / changes would simply be lost.

[1]: https://github.com/odoo/odoo/commit/aba31e9f2d8a44ce1586403f2a621a6caeed57b4

opw-2895569

closes odoo/odoo#99014

X-original-commit: 66213cfb33f4545d4c70af1a72c3db47ca687e92
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-08-27 03:34:12 +02:00
Romain Derie 7859df06cd [FIX] website: mark steps snippet as not working in sanitized fields
Since [1] the website builder is able to warn and prevent a user that a
snippet is not going to be able to be saved in a field if that field is
going to be sanitized.

Back then, we didn't mark the steps snippets as such as we were planning
to make it work in sanitized field by refactoring the JS code, as we did
for the s_map snippet at [2].
It was supposed to be done at [3] but was cancelled as it was making the
UX worst due to some flickering + we are also working on [4] to make the
sanitation conditional and able to be bypassed.

Note that the conflict with the sanitation for the steps snippet starts
in saas-15.2 with its connector improvement/ refactoring [5].
Those connectors are now svg elements targeted by the options, which
ultimately crash if those connectors are not found, which is the case
when the DOM is going through the sanitizer as it is removing SVGs.

[1]: https://github.com/odoo/odoo/commit/8920f7d09fe020c8f182b3ea1acbafcb955afdce
[2]: https://github.com/odoo/odoo/commit/c2e9bd0e60014b6a42931cf300e0f89f8cf7c225
[3]: https://github.com/odoo/odoo/pull/96734
[4]: https://github.com/odoo/odoo/pull/97398
[5]: https://github.com/odoo/odoo/commit/aba31e9f2d8a44ce1586403f2a621a6caeed57b4

X-original-commit: 515a7e1705bed48f10e844d0f183dddeda27277d
Part-of: odoo/odoo#99014
2022-08-27 03:34:12 +02:00
Ivan Yelizariev d05effb6b3 [FIX] account_edi{,_facturx}: properly retrieve product/description
Odoo attaches factur-x doc to every invoice pdf. That data can be used to upload
invoice to another Odoo instance.

On uploading such an invoice, Odoo tries to find product in its DB. But it
doesn't work if original product has Sales Description which is by default
copied to line's Description (field `name`).

Fix it by searching by first line in the name value of factur-x. Product name
doesn't contain \n symbol in most cases anyway.

This commit doesn't fix factur-x doc generation because of stable version
policy. In next Odoo release we should use separate factur-x attributes for
product name and invoice line description.

opw-2878530

closes odoo/odoo#99006

X-original-commit: c5e08b8dcb9041235721afb99a5d05a0f51789e4
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2022-08-27 03:34:07 +02:00
William Braeckman 3754600694 [FIX] website_sale: fix cart popover
The cart popover was broken since the bootstrap changes as data that was
previously set on the jquery element upon creating the popover was not
set anymore.

closes odoo/odoo#98991

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-27 03:34:01 +02:00