Commit Graph
156727 Commits
Author SHA1 Message Date
Ivan Yelizariev 22efbe2cfc [FIX] l10n_pe: create related field directly to speed it up
Odoo ORM has special optimization for installing module with a stored related
fields, but it requires the final field be not computed [1] (I'm not sure why),
which is not the case for the `group_id` field. Since `account.move.line` table
may have millions of records, we have to optimize the installation and fill
`l10n_pe_group_id` via a single sql query.

[1]: https://github.com/odoo/odoo/blob/0aff8bb9484a23c0d875d3b12259dd4e0d51e716/odoo/fields.py#L818

opw-2762510

closes odoo/odoo#107157

X-original-commit: 63341b5856b4a5cbc6fda17a4cc1d40f84cf7476
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2022-12-06 17:11:56 +01:00
FrancoisGe 96e158a8b8 [REF] web: simplify customizations of static menu actions
There are several customizations of the list and form view that consist
in modifying the behavior of a static menu action (archive, unarchive,
export, delete, duplicate). We have seen that this one is very complex.
So we decided to simplify it.

Solution:
Add the getStaticActionMenuItems API point. This allows us to easily
modify the behaviour of static actions.

We also took advantage of this commit to simplify the ActionMenu api.
We have removed the other actions because it was not clear enough.
They are directly added in the action category.

closes odoo/odoo#107086

Taskid: 3089039
Related: odoo/enterprise#34598
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-12-06 17:11:53 +01:00
Thomas Lefebvre (thle) b755975372 [FIX] project: calculate recurring tasks with interval
Steps to reproduce:
    - activate "Recurring Tasks" option inside Project settings;
    - go to "Field Service" app;
    - create a task;
    - check recurrence box;
    - make the following configuration in the recurrence tab:
       * Repeat Every 6 Months
       * Repeat On Date of the Month 1
       * Until End Date [your choice]

Issue:
    The dates calculated for the recurrence are not correct.

Cause:
    When we select an interval other than 1 for a frequency in months, we do not divide the number of months between the start and end date.
    And therefore the loop that calculates the recurrence dates goes too far into the dates.

Solution:
    Divide the number of months between the start date and the end date by the interval.

opw-3078084

closes odoo/odoo#107320

X-original-commit: 5d44d7d595dab866695945e5a6d2091ddd9df342
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2022-12-06 15:32:58 +01:00
Julien Van Roy d23bece093 [FIX] l10n_fr_fec: make tests independent from tax template
Currently, changing the french default_tax_sale's name or account will make the
`test_generate_fec_sanitize_pieceref` fail (for instance: with task-3087037).
Make the l10n_fr_fec test independent from any account.tax.template change by creating a
new tax in the setup of this test.

closes odoo/odoo#107319

X-original-commit: 5128c8dfe75aa943a47e939776804dd878c0e378
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2022-12-06 15:32:55 +01:00
bve-odooandJulien Castiaux 48109c15d3 [FIX] mail: parse Content-Type binary/octet-stream
Some mail clients set a wrong content-type for PDF attachments, they
set `binary/octet-stream` which doesn't exist[^1]. Odoo would crash
with a traceback in case it tried to extract the content of such
malformed attachment because Python doesn't know how to decode such
content-types.

Looking at the actual content of the emails we received, we would had
expected the content-type to be `application/octet-stream` instead. It
is fair to assume that the mail client software is buggy or poorly
configured and that it assumes that `application/octet-stream` and
`binary/octet-stream` represent the same thing.

Following Postel's Law[^2], it is better to still handle those malformed
emails, assuming the content-type is `application/octet-stream`.

opw-3030113
opw-2716507

[^1]: https://www.rfc-editor.org/rfc/rfc2046#section-3
[^2]: https://en.wikipedia.org/wiki/Robustness_principle

closes odoo/odoo#107317

X-original-commit: e6169325b968711a0a28444818b34aa1932a6bae
Signed-off-by: Julien Castiaux <juc@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Julien Castiaux <juc@odoo.com>
2022-12-06 14:34:47 +01:00
Hubert Van de Walle (huvw) cc547da0f8 [FIX] website_slides: allow unsanitized html in the course description
Steps to reproduce
==================

- Install website_slides
- Go to eLearning > Basics of Gardening
- Enter edit mode
- Drop the tabs section from the right to the purple header
- Save
-> We can't switch tabs

Cause of the issue
==================

The `description` and `description_short` were converted from Text
field to Html fields in 6d914c005183aa5ae69650e3002a5a85ca83b4a6

Solution
========

Set the `sanitize_form` and `sanitize_attributes` to False

See odoo/odoo#47318

opw-2950825

closes odoo/odoo#107314

X-original-commit: e7f0f0a33bdee8520838a128e42cd4bdbd75267d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-12-06 14:34:45 +01:00
Benjamin Vray 4cd383175f [FIX] web_editor: prevent horizontal overflow caused by m2m widget
When a vertical overflow is triggered in the snippets menu, a vertical
scrollbar is added making the snippets menu slightly smaller. Most
widgets properly adapt their width, however the many2many dropdown
widget does not, causing a horizontal overflow and its associated
scrollbar.

Steps to reproduce the bug :

- Drag and drop the "text-image" snippet in a page.
- Click on the image in this snippet.
- Set the "visibility" option to "Conditionally".
- A horizontal scrollbar appears in the editor panel.

This commit adapts the CSS of the m2m widget to solve the issue.

task-2779530

closes odoo/odoo#107305

X-original-commit: de96c25a5ad94c524e129053ebbfcb10b020d069
Signed-off-by: Guillaume-gdi <gdi@odoo.com>
2022-12-06 14:34:42 +01:00
qsm-odoo dc140ef115 [FIX] web_editor, website: add cover/contain option for grid images
As a fix, this introduces a new option for images in grid mode. When an
image is alone in a column which later becomes a grid item, or when an
image is directly added as a grid item via the dedicated option, the
image used `object-fit: cover` so that when the image is resized as a
grid item, it fits the dimensions of the selected grid area.

This confused some users as the image did not appear the same depending
on the screen size. Indeed, if an image is set to take 5 columns as
width and 3 rows as height, it does not ensure the ratio in pixels to
stay the same depending on the screen size: the grid is always made of
12 columns (so the width of each column depends on the screen width),
while the rows are always 50px tall. We could enforce the ratio of grid
items to stay the same or limit the ratio loss by reducing the 50px
height on smaller breakpoints but that would actually increase another
problem: for colored text grid items, their text would more easily
overflow their fixed area.

In the end, using the grid mode is about compromises, even if it allows
to achieve nice things and to have more freedom. This commit although
adds a new option to mitigate the issue for images: users now have the
possibility to switch the default "cover" mode of grid images to
"contain": in that mode, the whole image will always be visible (and
thus keeps the same ratio) and is just "contained" in the grid area
which is selected as dimension.

opw-3069234

closes odoo/odoo#107172

X-original-commit: faf19ef7f87fc043fb9a814516e01b8eeafd9b61
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-12-06 13:34:59 +01:00
Soukéina Bojabza 7f8321aab0 [FIX] web_editor: display grid mode mobile view for higher screen sizes
When we are in grid mode, if we decrease the screen size small enough,
the display is back to `flex` and the columns are displayed one above
another (-> mobile view). However, the columns in normal mode do that
for screen sizes higher than the breakpoint set for the ones in grid
mode, which is inconsistent. Moreover, as the images have their
`object-fit` property set to `cover`, they become really deformed and
therefore do not look good.

This commit solves these issues by increasing the breakpoint at which
the grid mode switches to the mobile view, that is, from `md` to `lg`.

opw-3069234

X-original-commit: 1ec3c4726ea92452dfe091eac96bcc9f3fdfa589
Part-of: odoo/odoo#107172
2022-12-06 13:34:59 +01:00
Pratik Raval f3930f3e6f [FIX] survey: fix add missing field 'comment field as an answer'
The field that adds an option in the MCQ was wrongly removed from the views in
v15.3 in Task-2600241.

This commit fixes it by adding it back with the label 'Comment is an answer'.

taskID-3074257

closes odoo/odoo#107285

X-original-commit: 3de1e63d9411f88b397ad83109021574b1036b6e
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-12-06 12:00:48 +01:00
niyasraphy 9a976a8c9a [FIX] various: uniquify the the !
Just change double the by single. This fixes various typos in error and
code comments.

closes odoo/odoo#107266

X-original-commit: 09dfedfc19c2bc34c2bb394dcc4bc609c5ac0107
Related: odoo/enterprise#34681
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-12-06 10:52:50 +01:00
niyasraphy 397c7d7245 [FIX] point_of_sale: total field label alignment
Total field label in the point of sale order form view is not aligned well in the footer.

Point Of Sale -> Order -> Orders, open any existing records. label is not aligned properly in the form.

closes odoo/odoo#107240

X-original-commit: 69d78de90af451a5268020335c568ffef6b1c4a0
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2022-12-06 10:52:42 +01:00
Andrea Grazioso (agr-odoo) 7fbbd62cba [FIX] l10n_id_efaktur: payment terms blocking payment
Setup indonesian invoicing
Create a payment term with payment in 30 days and 10% if paid before 2
days
Create an invoice with said payment term
Confirm and register payment

Operation will be blocked by error
"Cannot mix VAT subject and Non-VAT subject items in the same invoice
with this kode transaksi"

This occurs when creating the payment move. All the lines have
display_type set to 'product' (defualt value), so the system checks
consistency of kode transaksi as in an invoice

opw-3063052

closes odoo/odoo#107239

X-original-commit: cbf9250c5879a70c6ef5b382e2ca0c6476fbb1be
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2022-12-06 10:52:39 +01:00
Victor FeyensandValentin Vallaeys 71737f4cb9 [IMP] sale: always give access to the product form
Users were not able to access the product (product/template) form view
when the product was readonly (cf product_updatable field logic).

This commit makes sure that a user can always access the product form
view through either the external button or clicking on the product
field itself (when readonly).

Task-3063622

closes odoo/odoo#107237

X-original-commit: 7bf45b022e73a83d9b04350b8899919714e59223
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: Valentin Vallaeys <vava@odoo.com>
2022-12-06 10:52:37 +01:00
Joren Van OnderandFabrice Henrion 6202c296d8 [IMP] hr_holidays: better transition_mode tooltip
The previous tooltip was a bit confusing, replace it with a better
one.

closes odoo/odoo#107170

Signed-off-by: Kevin Baptiste <kba@odoo.com>
Co-authored-by: Fabrice Henrion <fhe@odoo.com>
2022-12-06 10:52:34 +01:00
Julien Van Roy 014091fc02 [FIX] account_edi_ubl_cii: prepend encoding to xml
Prepend the encoding `<?xml version="1.0" encoding="utf-8"?>` to every xml
in the account_edi_ubl_cii module.

The absence of this tag was causing a 'Document format not supported.' error on myguichet.lu.

closes odoo/odoo#107151

X-original-commit: 6823ffcc7e0b27abdff670d53e4a5f885f218f79
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
Signed-off-by: Julien Van Roy <juvr@odoo.com>
2022-12-06 10:52:31 +01:00
niyasraphy 967ee433b8 [IMP] hr_work_entry_contract: add discard button in regenerate wizard
closes odoo/odoo#107050

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-12-06 10:52:29 +01:00
niyasraphy 0b96f47c3c [FIX] hr_gamification: open correct badge on clicking badge kanban
closes odoo/odoo#107018

X-original-commit: c7934a803bb66024a4ba9891f3edbb1523777d4c
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-12-06 10:52:26 +01:00
niyasraphy d077267693 [FIX] hr_applicant_view_form: stat_text of employee_name in smart button readonly
closes odoo/odoo#107017

X-original-commit: 1a948ecdfe0e4d9292619eae6f087685687c44b5
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-12-06 10:52:23 +01:00
niyasraphy 4a3683b912 [FIX] hr: warning in log on exporting translation of hr
closes odoo/odoo#107016

X-original-commit: 8484b6237154f2109f71d456415f6fe03917a983
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-12-06 10:52:21 +01:00
Kartik Chavda 3456a80fce [FIX] sale_project: fix percentage field width issue in milestone form
This commit make percentage field width 25% so field and percentage
symbol look nearer.

task-3018123

closes odoo/odoo#106956

X-original-commit: https://github.com/odoo/odoo/commit/f8f138f656d093e98f87a51fafb087d00ff7926d
Related: odoo/enterprise#34554
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-12-06 10:52:18 +01:00
Kartik Chavda 6e13a10519 [FIX] sale_{project,timesheet}: hide SOL field when task is not billable
This commit hide SOL field for project task form view and hide
it's value from tree view when task is not billable and give
correct xpath on SOL field attributes to display remaining hour
and price unit in name_search.

task-3018123

X-original-commit: https://github.com/odoo/odoo/commit/eeb53703c2603ec13a8e43cd68c79959d4b9fb57
Part-of: odoo/odoo#106956
2022-12-06 10:52:18 +01:00
Kartik Chavda f1257c8e1b [FIX] project: fix width of chatter in fontend
This commit make chatter width same as form sheet in project
sharing form view.

task-3018123

X-original-commit: https://github.com/odoo/odoo/commit/bb27fde366c41123057a6080e949e384b981d84c
Part-of: odoo/odoo#106956
2022-12-06 10:52:17 +01:00
Kartik Chavda cc11c04b17 [FIX] sale_project: hide create invoice button from project form
This commit hidess create invoice button for project form view.

task-3018123

X-original-commit: https://github.com/odoo/odoo/commit/ed6304afbe4bfb426e56abe1ed29e0e34b4b30b5
Part-of: odoo/odoo#106956
2022-12-06 10:52:17 +01:00
John Laterre (jol) 6851cbad30 [FIX] account: make hierarchy visible
Before this commit, the default value for `filter_hierarchy`
was set to `never`. So each report had to explicitly set the value
to `by_default` or `optional` in order to make it available.

Instead, we should use the `optional` value by default and let
reports that do not want it explicitly set it to `never`.

task-3041037

closes odoo/odoo#107263

X-original-commit: a1147d91729a5eb75565f04ec10b52ed28d93c42
Related: odoo/enterprise#34675
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2022-12-06 09:26:15 +01:00
Camille Spiritus 7509b27bde [FIX] account: fix invoice's pdf borders
Since BS5 integration in v16.0, the pdf of the invoices has changed. Borders would be present in the body of the invoice and the total detail.

Came back to v15 display by using the table-borderless class on those elements.

closes odoo/odoo#107257

X-original-commit: 1a46b6f9231c5d49d70bfa9eb8d434c1f092c1c7
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Camille Spiritus (casp) <casp@odoo.com>
2022-12-06 09:26:08 +01:00
Kevin Baptiste 1fbac01af3 [FIX] hr: fix failing signup test
The test `test_employee_create_from_signup` was failing when the module
`auth_signup` was installed because of the missing partner.

closes odoo/odoo#107243

X-original-commit: 2688f9bb00f9cb049ff11bbe4443adc66ee05941
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-12-06 09:26:03 +01:00
Dũng (Trần Đình) 028c12b53b [CLA] signature of dzungtran89
closes odoo/odoo#107238

X-original-commit: c9ea848282b3215d0353538e0a6dea5fc3a96814
Signed-off-by: Rémy Voet <ryv@odoo.com>
Signed-off-by: Raphael Collet <rco@odoo.com>
2022-12-06 09:26:00 +01:00
Dũng (Trần Đình) 5f90d5be3c [FIX] core: typo after deprecation of recompute() in 32bc28aa
X-original-commit: 32f9466098752671bfe69f20cece3b6b562649dd
Part-of: odoo/odoo#107238
2022-12-06 09:25:59 +01:00
std-odoo 6e7960314b [FIX] mail_plugin: do not enrich blacklisted domains
Bug
===
Currently, we try to enrich the domains even if they are in the
`_MAIL_DOMAIN_BLACKLIST`. IAP always return a "missing data" error
because it can't enrich "gmail.com", etc except for "odoo.com". In that
case the enrichment is successful, but because the domain is
blacklisted, we use the entire email to find the company (and so it
will create a company for each odoo.com email addresses).

The test that was removed was wrong. It works because we mocked the
enrichment response, but in practice it will always return a missing
data error.

Task-3050230

closes odoo/odoo#107235

X-original-commit: 37503108cd878412474b5486877a861dad2efc1d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-12-06 09:25:56 +01:00
Pierre-Yves Dufays c069cf75c7 [IMP] hr,{test_}mail{_group}: warn user when alias model creation fails
Warn user and alias responsible when model creation fails on incoming
message due to alias mis-configuration.

Alias custom default values that references archived or deleted records can
prevent the record to be created when receiving an email.
Unfortunately, correcting values on the fly has too many downsides:
- as the value cannot come from nowhere, we would probably end up with
corrupted record like a task without a project
- as errors are silent, lots of suboptimal record could be created before it
is corrected
- as the code would have to deal with different kind of updates, it would be
heavily depend on the framework meaning additional maintenance cost
- the attempt made had also a performance cost by using savepoint which we
want to avoid

For all those reasons, we have decided to warm the user rather than trying to
solve the problem automatically.
The users are warned:
- through a bounce email sent to the sender and alias responsible
- in the alias interface through an alias status present in the list and the
form view

Technical notes:
- They are multiple kind of errors: error in the message (ex.: user not
authorized to send to a specific alias), error in the alias (ex.: dangling
reference in alias_defaults), other error (ex: technical error like a
service unavailable when receiving the message). Here, we want only to detect
alias error and skip other errors. So rather than doing a big try except around
_message_route_process, we have selected the spot where we should detect alias
error:
-- in _alias_get_error_message where we distinct a message error from an alias
error
-- in inside _message_route_process where record are created using
alias_defaults (custom values with reference to record that might have been
deleted since the alias creation)
- In test, we call mail.thread message_process with sudo as it is the case in
real use case (processed when fetching mail). It is needed as in some test
alias status are modified.

Task-2675209

closes odoo/odoo#101019

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-12-06 09:25:50 +01:00
Lucas Perais adb194befb [FIX] web: remaining_days sends correct value to picker component
Before this commit, when a date field with the remaining_days widget did not have a value
typically on a new record form view, the props validation crashed because the datePicker widget
received the wrong type for its value.

After this commit, this is corrected and there is no crash.

closes odoo/odoo#107233

Related: odoo/enterprise#34668
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-12-06 07:01:41 +01:00
Lucas Perais b50fec6aa9 [FIX] web: x2many fields: set display name and correct supported types
Before this commit, the X2ManyField did not have a display name and its supported
types only mentioned one2many.

After this commit, those fields have a display name and the type many2many
is rightfully put has beng handled by the fields.

Part-of: odoo/odoo#107233
2022-12-06 07:01:41 +01:00
niyasraphy fb2132719c [IMP] sales_team: remove unused menu 'menu_sale_config'
'sales_team.menu_sale_config' is not used anymore and can be removed in
order to cleanup a bit unused records.

closes odoo/odoo#107206

Related: odoo/enterprise#34643
Related: odoo/upgrade#4102
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-12-05 22:02:44 +01:00
niyasraphy bde98499d0 [FIX] purchase_stock: missing documentation link for drop shipping
documentation link for drop shipping feature is missing as the documentation tag was added along with the field rather than the settings tag.

closes odoo/odoo#107192

Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-12-05 18:13:41 +01:00
Maruan Aguerdouh (magm) c911e63c6f [FIX] account_edi_ubl_cii: send and print working properly for invoices
with canary islands taxes

Steps to reproduce:

1. Go to Apps, and Install the module `l10n_es`
2. Go to Accounting App > Customer invoices
3. Create a new Invoice with fake comany, fake address with state set as
`Santa Cruz de Tenerife (ES)` and the ZIP set as 38400.
4. Add any line to the invoice and confirm.
5. Try to Send & Print the invoice, you may need to select the template
before.

Issue:

We won't be able to either print or send the Invoice getting a traceback
containing `KeyError: 'tax_details_per_record'`.

Solution:

Keys for `vals` have change so we need to adapt it to match new keys
naming and sorting for accesing the same values.

FW - port: master

opw-3067491

closes odoo/odoo#107176

X-original-commit: accb722d12e76d178ba70b884a020e162e73634f
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2022-12-05 17:06:59 +01:00
niyasraphy 3bb81be583 [IMP] pos_restaurant: table_id, customer_count fields readonly
currently the table_id, customer_count fields are editable from the pos order form in the backend and all the other fields are readonly

closes odoo/odoo#107135

Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2022-12-05 17:06:56 +01:00
Julien Castiaux 05a3ad3159 [FIX] core: skip useless controllers in routingmap
The routing-map is a mapping that maps HTTP verbs and paths to python
controller methods (endpoints), e.g. it maps `GET /web/health/` to
`/web:Home.health`. The `_generate_routing_map` function is the function
responsible to generating the werkzeug routing-map in regard to the
controller inheritance mechanism. The mechanism makes it possible to
override an endpoint is various odoo modules to enrich it with new
features, e.g. `/web/login` is overriden in website to change the visual
of the page.

Implementation-wise, the informations from each `@route` decorator must
be merged with the other `@route` info for each endpoint override. When
a method is not overriden in a controller, there is not new info and
that controller should be skipped for that method.

The previous implementation attempted to skip such method using the
following idiom:

    if not hasattr(controller, method_name):
        continue

That idiom doesn't work as `hasattr` will perform a lookup on the full
controller's MRO instead of a lookup only on controller's own methods
and attributes. The controller's own methods and attributes are
actually found in `controller.__dict__`.

closes odoo/odoo#107064

X-original-commit: 42f52d26b6a81a68f1fe28e28971f0e7f4c97d11
Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-12-05 16:06:49 +01:00
maximilien(malb) d151158637 [IMP] account, account_asset: account move views with assets
This PR add a new page "Accounting Documents" with the journal entry, the list view asset_id and the statement_line_id. This make the first page more concise and allow the related asset to be more visible and simple to work with.

closes odoo/odoo#107205

Task-id: 3075466
Related: odoo/enterprise#34642
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2022-12-05 14:04:08 +01:00
niyasraphy 5dd5dd2669 [IMP] point_of_sale, l10_nl: change openerp tag to odoo
change the openerp xml tag to odoo in point_of_sale and l10_nl module

closes odoo/odoo#107191

Related: odoo/enterprise#34636
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2022-12-05 14:04:02 +01:00
qsm-odoo c7c0a6679e [FIX] website_blog, *: allow more than 6 blog posts in dynamic snippet
*: website

Commit [1] introduced the possibility to configure "website filters"
used in the website to display some records dynamically via the "dynamic
snippet" and its variants. One of their field is `limit` which is a max
number of records the filter allows to show (so that the client side
cannot ask for thousands of records). Users can configure the limit used
by a snippet via the editor: they are allowed to choose up to 16, still
safe-guarded by the internal limit configured on the website filter on
the python side.

The problem here was that [2] introduced website filters for the blog
posts but set up a max limit of 6. Thus breaking the editor option if
the user choose a limit between 7 and 16. This commit fixes the issue,
for newly configured snippets (as a stable fix) or for users who would
-u their blog application. EDIT: as the master version of this fix, all
blocks will now use their set limit. We consider that is an acceptable
change after migration that the user can change by himself if he wants
to.

Steps to reproduce:
- Install blog application
- Add a "Blog Posts" snippet
- Set "Fetched Elements" to 10 (there are 7 records in demo data)
=> Only 6 are still shown

[1]: https://github.com/odoo/odoo/commit/0e7640b5f22d2bea04bbe22d3189cff7e03af545
[2]: https://github.com/odoo/odoo/commit/3c0d98bcd8adf9325ee3497eb8d25ec7f904d6a5

opw-2885948

closes odoo/odoo#107179

X-original-commit: 3a3dc8729aa2beec49602fe4c141043f60effdf1
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-12-05 14:04:00 +01:00
Julien Castiaux d9cb0671a6 [FIX] core: converse existing context in JSON-RPC
Define the following controller:

    @route('/get-context', auth='public', type='json', website=True):
        return request.env.context

Access that route via JSON-RPC providing a context:

    this._rpc({
        route: '/get-context',
        params: {
            context: {"a": 1}
        }
    })

Since httpocalypse, it replaces the context entirely instead of updating
it. i.e. before you would get along those lines:

    {"a": 1, "lang": "en_US", "tz": "Europe/Brussels", "uid": 2}

but since you get instead (and that's wrong):

    {"a": 1}

Note that after this commit, this merging-context behavior will be the
same whether or not website=True is defined (while it was only there for
website=True before).

Discovered via opw-2885948

X-original-commit: 7887cfc3f177d9e64f008aabb8bd710f54024dea
Part-of: odoo/odoo#107179
2022-12-05 14:04:00 +01:00
niyasraphy 928d584f20 [IMP] pos_restaurant: add sheet tag for restaurant.table form view
closes odoo/odoo#107133

Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2022-12-05 14:03:51 +01:00
Achraf (abz) a8d30764ae [FIX] web_editor: Fix MissingError traceback
A MissingError traceback that occurs in `_build_bus_channel_list` was
caught by Sentry. This error has been seen 1.3k times in the last 30
days from several customers.

The fix simply consists in checking if the document exists before
checking the rights on it.

Traceback:
```
MissingError: Record does not exist or has been deleted.
(Record: project.task(83,), User: 6)
  File "addons/bus/websocket.py", line 879, in _serve_forever
    req.serve_websocket_message(message)
  File "addons/bus/websocket.py", line 752, in serve_websocket_message
    service_model.retrying(
  File "odoo/service/model.py", line 134, in retrying
    result = func()
  File "addons/bus/websocket.py", line 767, in _serve_ir_websocket
    ir_websocket._subscribe(data)
  File "addons/bus/models/ir_websocket.py", line 38, in _subscribe
    channels = set(self._build_bus_channel_list(data['channels']))
  File "home/odoo/src/enterprise/16.0/spreadsheet_edition/models/ir_websocket.py", line 13, in _build_bus_channel_list
    return super()._build_bus_channel_list(channels)
  File "addons/web_editor/models/ir_websocket.py", line 33, in _build_bus_channel_list
    document.check_access_rule('read')
```

SAAS-K22 (sentry code)
opw-3086292

closes odoo/odoo#106982

X-original-commit: 9e4c5e427285b76000398476e9d923e7ea036a65
Signed-off-by: Achraf <abz@odoo.com>
2022-12-05 14:03:49 +01:00
Kishan Gajjar 871ff74d3d [FIX] website: restore narrow mega menu
Since [1], the narrow mega menu is broken because with BS5 the class
'dropdown-menu' is having a more specific CSS rule to set its left
property. This commit increases the specificity of Odoo related rule.

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

Closes https://github.com/odoo/odoo/pull/107074

closes odoo/odoo#107177

X-original-commit: 27e66ae4c9ccfbc3f309cac9729fe097226e0cae
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-12-05 13:02:29 +01:00
pedrambiria 5dabdcd5f8 [FIX] payment_sips: accept scoreInfo in payment response
After a payment is processed by SIPS, a data object is posted back
to Odoo. The data has a `ScoreInfo` element that has more than one
`=` characters (e.g. `scoreInfo=A3;N;N#SC;N;TRANS=3:2;CUMUL=4500:250000`)
This causes the method `_sips_data_to_object` to break, because there
will be too many values to unpack.

To fix this, we should limit the data split to 2 values. This is the
same method used by SIPS to process data as well.
(See: https://github.com/worldline/Sips-International-non-FR-PHPlibrary/blob/master/lib/Sips/PaymentResponse.php#L73)

opw-3071315

closes odoo/odoo#107143

X-original-commit: 3dce793ad00b1c0b9f06c705f40e31666db74a06
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2022-12-05 13:02:24 +01:00
maximilien(malb) 81a32cf3f9 [IMP] l10n_rs: translation and small modification
Ideally, we develop in English any localization (then translate to the domestic language, in this case Serbian) All the module has been translated in english and then a .po file has been create to translate back in Serbian

Added more info on the description of the module and activate storno by default.

closes odoo/odoo#107101

Task-id: 3086250
Related: odoo/enterprise#34608
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2022-12-05 13:02:18 +01:00
Denis Ledoux 51e12ca394 [FIX] base: continue stack post-processing after adding <t groups=
In a view, in the case of a field node combining
- a `groups` attribute on the field node in the view architecture
- a `groups` attribute on the field in the Python model

e.g.
```py
name = fields.Char(groups='base.group_system')
```
```xml
<field name="name" groups="base.group_multi_company"/>
```

The view post-processing adds a temporary `<t groups` block.
e.g.
```xml
<t groups="base.group_system">
    <field name="base.group_multi_company"/>
</t>
```
This is to make an `AND` connection with the two groups:
the user is required to have both groups in order to see the field.
Currently, there is no way to make that `AND` combination on the same
node. The below:
```xml
<field name="name" groups="base.group_system,base.group_multi_company"/>
```
would be an `OR` connection, not an `AND.`
Hence this temporary added `<t groups=""`.

Before this revision, in such a case,
the stack post-processing was interrupted by an unexpected side-effect:
The field node changes of parent (the parent becomes that `t` block),
and a condition attempting to check that the node wasn't deleted from
the view actually checked that the parent changed, to decide to
interrupt the rest of the stack post-processing, including the modifiers
post-processing for that node.

This revision changes this behavior,
to check the field node no longer has a parent,
instead of a change of parent,
to decide that the node is indeed no longer in the view,
and to interrupt the stack post-processing or not.

This allow the field modifiers (e.g. `attrs=""`) to be post-processed
as expected.

opw-3072910

closes odoo/odoo#107173

X-original-commit: c163cbb6a9b3679067606868e325d9842ea66aa8
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-12-05 10:08:01 +01:00
Florent de Labarre 4e98f9902c [FIX] stock_account: method doesn't wok with a recordset
If you try to get show_reset_to_draft_button for more than one account.move, it can raise.

closes odoo/odoo#107169

X-original-commit: a5b985e8449a1e858c3fb9a0a90a6d203e16f739
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-12-05 10:07:58 +01:00
arsi 8169f64001 [FIX] mrp_subcontracting: add subcontracting loc for archived company
The problem is that when you archive a company and then install
subcontracting, you get a traceback.

Step to reproduce (in a multi-company environment):
-install 'stock'
-archive a company
-install 'mrp_subcontracting'
-->traceback

Explanation:
When installing the 'mrp_subcontracting', there's a search on all
(active) companies in order to add a subcontracting location for each
of them (this is is triggered by
'/odoo/addons/mrp_subcontracting/data/mrp_subcontracting_data.xml').
But there is still a warehouse linked to the archived company.
So when adding routes to all warehouses and looking for the
subcontracting location of the archived company, it is set to
False.  Which is not intended and causes the traceback.

Solution:
Add '.with_context(active_test=False)' to the search for the companies
in '_create_missing_subcontracting_location(self)', so the missing
subcontracting location will be created for the archived companies too.

Discussion:
-The ability to archive companies is new to Odoo16 (implemented due to
the new pricing).
-Here I considered that we want to create a subcontracting location for
an archived company instead of taking action on the warehouse linked to
the archived company (like not considering it when creating routes).
I did this because a company can be unarchived and with this fix, it
will not cause issues.
-I think other problems similar to this one (in any app), should appear
in the future.

opw-3039495

closes odoo/odoo#107168

X-original-commit: 1dcdbe9e3cc21af50ed580c032b1927e21c3c24b
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-12-05 10:07:55 +01:00