Commit Graph
156331 Commits
Author SHA1 Message Date
Denis Ledoux 9afb36b94e [FIX] base: res.currency, correct labels for company rate fields
As `_get_view` is cached,
and `_get_view` has been overrided to change the label of the fields
`company_rate` and `inverse_company_rate` according to the company
currency, the company currency must be added in the `_get_view` cache
key, so it returns the view with the correct labels
when you use two companies with distinct currencies,
and not the label using the currency of the other company.

closes odoo/odoo#105301

X-original-commit: b106361d60413940622b477f73cfdf1536f2ef38
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-11-21 11:49:59 +01:00
Dossogne Bertrand 5c4e180960 [FIX] hr_holidays: fix default leave display_name
Before this commit, creating a new leave as an officer
from the approval tab would have by default no time off type,
resulting in "Employee on False" in the display_name.
After this commit, the display_name will set "on Time Off"
instead of "on False" when there is no Time Off Type set.

task-3054318

closes odoo/odoo#104963

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-11-21 11:49:57 +01:00
Achraf 5350dbd631 [FIX] web: Correct checklist style in report editor
Steps:
        - Go to studio
        - Open report editor in any report
        - Use Text block
        - Insert /checklist

Normal bullets without boxes are used in the report, because the checklist are styled separately in web_editor/static/lib/odoo-editor/src/checklist.css

opw-2995045

closes odoo/odoo#102072

X-original-commit: 9b4a1d3a45d294797813d653090b3a3c541210f5
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Achraf <abz@odoo.com>
2022-11-21 11:49:54 +01:00
William Henrotin cefb805273 [FIX] mrp: change dependency of related field
Fields `product_qty_available` and `product_virtual_available` on
stock_move are related on quantities fields of move's product_id. On
large database, those two fields will slow down every transactions that
updates stock move state (confirmation, validation, ...).

`state` on stock.move is a dependent field of computed field `qty_available` on
product.product which is dependent field of related field
`product_virtual_available` on stock move. This relation tree implies
that updating the state on one particular stock move will mark its
product (qty_available) as 'to be recomputed' and thus **every** stock
moves (product_virtual_available) of this product as to be recomputed.
On database will 100k+ stock move per product. Fetching all stock move
of some products take 90% of a manufacturing order validation time. This
is problematic knowing those two quantity fields are only used in the
stock move tree form so computed anyway at the view rendering.

This commit change the `depends` of those two related field to mark them
as to be recomputed only if the product_id change.

closes odoo/odoo#106070

Opw: 3047017
X-original-commit: 189e825e567e4c633d721ce9f0fee906535edf06
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-11-21 09:51:19 +01:00
Pierre-Yves Dufays f6e1095c92 [FIX] mass_mailing: fix mobile preview
The preview of a mailing was displayed twice:
- after a save and when clicking on the preview button
- when double-clicking on the preview button
This solves those problems.

Technical notes: quick explanation of the fixes:
- double display after a save: the click event was registered twice (same for
the code preview button), the fix unregister the click before registering it
again.
- double display when double-clicking quickly on the button: the modal is not
displayed immediately and the button remains active a brief moment allowing a
second click. The fix disables the button when the button is clicked and
reenables it when the modal is closed.

Task-3047479

closes odoo/odoo#105974

X-original-commit: 0403938c3e0103d97ae828afdae06fcda06bd406
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-11-21 09:51:13 +01:00
Thomas Lefebvre (thle) 37dfb6d12e [FIX] web: placing the domain in the kwargs of an rpc call
Steps to reproduce:
    - go to Contacts app;
    - add a reporting view (Graph, Pivot or Dashboard) (with studio for example)
    - tape any character in the search bar;
    - on "search related company for" field either use the arrow keys to go down to this and then click the right arrow key or click on the triangle to the left of this field.

Issue:
    An error occurs.

Cause:
    There is a mismatch between the parameters that are sent by the rpc call and those processed by the logic part.
    Specifically, the domain must be part of the kwargs and not the args of the params key in the rpc call.
    The problem occurs with a filter that looks like: `<field name="parent_id" domain="[('is_company', '=', True)]" operator="child_of"/>`

Solution:
    Move domain in kwargs under key named args in the params of the rpc call.

opw-3031096

closes odoo/odoo#106074

X-original-commit: 8a9b418b27dcc9b904413f14cd0443f9a5b10d17
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2022-11-21 08:25:20 +01:00
Nurlan Farajov 7e35138b68 [ADD] base: add Azerbaijani language
closes odoo/odoo#106000

X-original-commit: 151e3b5944210a1e5e8beb11b943f23f55ec8f9f
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-11-20 10:37:11 +01:00
Nurlan Farajov e0e4686c1a [CLA] signature for nurlanf
X-original-commit: 6774ea066dc76fdd426e285455c2b52d980f5ef1
Part-of: odoo/odoo#106000
2022-11-20 10:37:11 +01:00
Xavier BOL (xbo) ddb5d70a24 [FIX] sale_timesheet: remove the emoji in the demo data
Before this commit, when the database is launched on an Apple computer,
the demo data in sale_timesheet module cannot be installed because of
the emoji is not correctly managed by a OS version of Apple.

This commit removes the emoji to be able to launch an odoo database on a
Apple computer.

closes odoo/odoo#106008

X-original-commit: 7004415e641b419a9adf35738b9bbb71864d17b3
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-11-19 12:02:19 +01:00
Thomas Lefebvre (thle) ef39701400 [FIX] account_edi: check fiscal period for an EDI cancellation
Steps to reproduce:
    - install a localization which uses the account_edi module;
    - define Lock date for the fiscal period;
    - choose an invoice which was sent before this date;
    - click on the "REQUEST EDI CANCELLATION" button.

Issue:
    We try to cancel the EDI document despite exceeding the fiscal period.

Cause:
	The verification of the fiscal period is done when clicking on the "RESET TO DRAFT" button which, in the flow, is after the request for cancellation of the EDI document.

Solution:
    Make a verification of the fiscal period when clicking on the "REQUEST EDI CANCELLATION" button.

opw-2990873

closes odoo/odoo#106096

X-original-commit: fda04e2153f541ddf88afc60be4662a0d78ea7ce
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-11-18 20:42:53 +01:00
Walid HANNICHE (waha) bcd8081cb4 [FIX] board: prevent add to dashboard with no actionID
Steps to reproduce:
- Go to Purchase -> Reporting -> Dashboard
- click on the "expand" arrows of the pivot view
- favorites - add to dashboard

Bug:
adding a view with no actionID causes the dashboard to crash on load
this [commit] prevents adding a view with no actionID

Fix:
added a default value of False to add_to_dashboard actionId
only display the option to add_to_dashboard for views that have actionId

opw-2965036

[commit]:https://github.com/odoo-dev/odoo/commit/7180d948f084d4f68d1660cb884c95aaf41288fa

closes odoo/odoo#106093

X-original-commit: ff926a5b4390b38db339440c18dd2d5380df7d61
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2022-11-18 19:42:14 +01:00
Hubert Van de Walle (huvw) 7562ff4915 [FIX] account,sale_management: Uom should not be displayed when disabled
Steps to reproduce
==================

- Use a mobile phone / mobile view in devtools
- Go to Accounting > Customer invoices
- Click on one item
-> A traceback occurs, the uom is missing

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

The field is declared as
  `<field name="product_uom" groups="uom.group_uom"/>`

The raw value is accessed with
  `<t t-esc="record.product_uom.value"/>`

Solution
========

Add the missing group

opw-3070671

closes odoo/odoo#106066

X-original-commit: 6563e7b077ade8da333b710578a23ee8ac23a025
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-11-18 17:03:59 +01:00
clesgow 08cc5f92f3 [IMP] stock_dropshipping: remove warehouse_id from dropship types
When a picking is a dropship type (i.e. having the vendors as source
location and the customers as destination locations), then the
warehouse_id is removed.
This will add consistency between automatically generated "Dropship"
type and the manually created ones.

Part of task-2985735

closes odoo/odoo#106039

X-original-commit: efe7cfb0b94f485908c4e8510bd0ba6ff154018b
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
2022-11-18 17:03:56 +01:00
clesgow cf1c432974 [FIX] stock: stock_picking_type create without WH
Avoid raising an error if `warehouse_id` isn't in the vals.

Steps to reproduce :
Inventory -> Configuration -> Operation Types -> Create a new Operation
Type.
Then, either the warehouse field is empty because it doesn't appear due
to the multi-warehouse not being activated yet, or its saved when the
field is empty.

Changes the onchange into a compute to have a better consistency between
the frontend and the backend.

Part of task-2985735

X-original-commit: 2421619ecb0c2076f1d1694a30a724c92ff94c87
Part-of: odoo/odoo#106039
2022-11-18 17:03:56 +01:00
Rodopho Cammarosano de Lima (rcdl) 55fbb8d89a [FIX] web_editor: remove dot in powerbox commands
The dot (period) is removed from user-facing strings in powerbox
commands, and the corresponding msgid in .pot files are updated.

task-2901665

closes odoo/odoo#106032

Related: odoo/enterprise#34116
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-11-18 17:03:53 +01:00
Nasreddin Boulif (bon) 123136bed7 [FIX] hr_expense: display right error if no employee found
Steps to reproduce:

  - Install `Expenses` module
  - Go to Settings > Technical > Email > Aliases
  - Edit the `expense` alias
  - Ensure the model is `Expense`
  - Set `Alias Contact Security` to `Everyone`, then save

  - Send an e-mail to the expense alias, using an e-mail address not
    referenced on one of the employees.

Issue:

  Error in logs related to `currency` variable.

Cause:

  Trying to create an expense for a non-existing user, therefore,
  no currency is set.

Solution:

  If no user is found, no need to create the expense and let the orm
  raise the error that a required field is not set (field employee on
  expense).

opw-3027350

closes odoo/odoo#106057

X-original-commit: a339caa2faf8cde0ec1c85079b9d74f31b055f24
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2022-11-18 16:04:23 +01:00
CarmenMiranda fa9d207e67 [IMP] point_of_sale: Send Context Closing POS Session
Sending a context when you are closing a `pos.session` will allow you to
make some validations/actions only when the closing is being done from the UI.
For example, sending values for new fields or a message that includes
something from the pos, like the Cashier ID, name, etc.

Also, it will help more when it is necessary to inherit the function in a
simpler way, to avoid having to overwrite it.

closes odoo/odoo#106044

X-original-commit: 3f7d6833b8c85a0c3469eced160bd72884c18d22
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2022-11-18 15:01:08 +01:00
Nshimiyimana Séna 34aa021342 [FIX] web: set correct raw domain
Steps to reproduce:
- Activate debug mode
- Go to Sales and open a quotation (actually any form view from any
  module will do)
- Start Studio
- Select the "Confirm" button (or any of the top buttons)
- Check the "Set approval rules" box
- Edit the domain by clicking the 'filter' icon next to the 'trash' icon
- Add a condition. You can just keep the default one.
- Click save to save the domain.
- Again, click on the 'filter' icon.

You should see that the domain in the text editor is malformed.
Furthermore, should you change the domain in the text editor (let's say,
change 1 to 2) and hit save, an error message will pop saying the domain
is not properly formatted.

opw-3001622

closes odoo/odoo#106043

X-original-commit: 9535026e00ca07453863d13d68935732cac49bfe
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-11-18 15:01:05 +01:00
Victor Piryns (pivi) f800523e18 [FIX] web: correct calendar header weekday
Current behaviour:
When rendering a calendar view with "Year" option,
the weekday headers may be incorrect in some cases
when the timezone is set to a negative timezone GMT.
For ex. it renders "S S M T W T F" instead of "S M T W T F S",
if the first day of the week is Sunday.

Expected behaviour:
Formatting should be consistent with the first day of the week,
and be indepedent of the timezone.

Steps to reproduce:
- Change your system timezone to somewhere in Alaska
- Install TimeOff
- Open TimeOff and switch to the yearly view.
- Observe that the weekdays headers are incorrect.

Reason for the problem:
The custom calendar header formatter was trying to generate
the end result directly based on the date marker, which is
incorrectly set in that context. This patch doesn't fix the root
cause of why the `info.date.marker` starts at an incorrect date.

Fix:
A formatter shouldn't read state. Since we are using the luxon plugin,
we use the `"EEEEE"` format, which is equivalent to the `"narrow"` options
from JS's `Intl.DateTimeFormat()` available in all browsers.

Affected versions:
- 16.0
- master

opw-3033464

closes odoo/odoo#106041

X-original-commit: e212f8752047222d1d81e1e9589934e70ecacf2a
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2022-11-18 15:01:02 +01:00
Thibault Delavallée 149808b82f [REF] rating: remove unnecessary rating_send_request parameters
Remove unused parameters, trying to keep a simple API. Those are not used,
probably coming from old usage of rating module. Subtype, composition mode
and email layout XMl ID are never set. Until further requirements better
fallback on default values.

We also also clean a context key usage while passing by, as it is not used
in standard codebase anymore.

Task-2710804 (Mail: Clean MailThread Posting API)

closes odoo/odoo#106024

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-11-18 15:00:56 +01:00
Raouf f9242db25f [IMP] project: change kanban_state to normal when changing task project_id
Before this commit:
When task project is changed in through the view the kanban_state remain the same
until the record is saved.

After this commit:
When changing project, kanban_state is changed to 'normal' direclty.

task-2849291

closes odoo/odoo#91174

Related: odoo/upgrade#3523
Related: odoo/enterprise#27287
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-11-18 15:00:53 +01:00
Raouf 5c555995ee [IMP] project: prevent sending of emails when duplicating project or task
After this commit:
- When duplicating project or task, assignment notifications and emails on stages are not sent

task-2849291

Part-of: odoo/odoo#91174
2022-11-18 15:00:52 +01:00
Raouf f15c9811c9 [IMP] project: create subtask with same followers than parent task
Before this commit:
- Task followers are not copied when creating subtasks

After this commit:
- Created subtasks have the same followers as their parent task with the same subtype_ids

task-2849291

Part-of: odoo/odoo#91174
2022-11-18 15:00:52 +01:00
Thibault Delavallée 709a65997d [LINT] mail, various: perform a quick code linting
Purpose is to try to have code easier to read and to update by having a
common way of sorting / writing code. Reorder some fields definitions and
dictionaries, update docstrings, ... in mail applications or when invoking
mail thread API.

Additional stuff worth noting here

  * add some tagged in tests helping debugging / choosing tests to execute;
  * in a test about mail generation with server action: correctly check
    body_html field, not body which comes from the mail.message inheritance
    (currently filled due to a side effect but actual field to check is the
    html one);
  * add same check on input for ``_render_template_qweb`` as done on other
    rendering methods (even if rendering on [False] should be supported);
  * move code translation update from specific tests into main test class
    (code update due to new translations, followup of odoo/odoo@f8c2b02abe);

Some test linting done here

  * reorder mail_render tests, remove some duplicated tests;
  * reorder mail_template tests, remove some duplicated tests;

Task-2710804 (Mail: Clean MailThread Posting API)

closes odoo/odoo#106025

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-11-18 14:00:30 +01:00
Thomas Lefebvre (thle) 9f193df0fa [FIX] hr_holidays: delete time off from calendar view
Steps to reproduce:
    - logged in as user with admin or officer permissions;
    - create time off request with config for sick time off request;
    - try to delete partially approved time off request from calendar view by pressing delete button.
    (The button is in the window that opens when you select a time off)

Issue:
    Partially approved time off request are not deleted when using delete button in calendar view.
    (It can only be deleted via the list view)

Cause:
	The function which deletes the element is not called.

opw-3061570

closes odoo/odoo#106023

X-original-commit: b9d01d30474303747f65376b0abf4cde3d2400e7
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2022-11-18 14:00:27 +01:00
Pierre Paridans ef172fee4c [FIX] web: kanban muted quick create column
In grouped kanban, when having groups but no record to display, the
group creation button (ie. "+ Stage" in Project) and its related column
are muted instead of being the regular colors (like for the groups'
titles).

This commit fixes it by applying a fix similar to the group's title one
(cf. odoo/odoo@cbefc9cd51)
for the quick create column element.

Steps to reproduce:
- Open Project
- Create a new project and open it in kanban view
- create a few stages
=> the quick create column is "muted"
- dismiss the quick create column (ESC or click outside it)
=> the "+ Stage" button is muted

closes odoo/odoo#106022

X-original-commit: e95e2a23bc168815a27a9c64e4ff9394de468ada
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-11-18 14:00:25 +01:00
yhu-odoo df6d309a14 [IMP] mrp: make productivity show by default on workorder form
When manualy create a productivity log on the workorder form, you are
always asked to choose a time_id(productivity). But by default, the
field is hidden. Make this field shown by default for better use
exprience.

closes odoo/odoo#106007

X-original-commit: 84cde486c700420c8898847342f158393c02649c
Related: odoo/enterprise#34098
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Yuchen Huang (yhu) <yhu@odoo.com>
2022-11-18 14:00:11 +01:00
yhu-odoo 0961a54eca [IMP] mrp_account: adapt tests
Adapt tests for other moudules to use

ENT PR odoo/enterprise#33399

X-original-commit: 88cad50cac8130e1ff66a21ab63d53b41488a74a
Part-of: odoo/odoo#106007
2022-11-18 14:00:11 +01:00
Pierre RousseauandLucas Lefèvre 6da05b86d1 [IMP] spreadsheet_*: update o_spreadsheet to latest version
Contains the following commits

https://github.com/odoo/o-spreadsheet/commit/96166819 [REF] evaluation: decouple evaluation from core plugin
https://github.com/odoo/o-spreadsheet/commit/a5a67d88 [IMP] find & replace: displays 0 match
https://github.com/odoo/o-spreadsheet/commit/2e2d878f [FIX] overflowing cell with border rendering
https://github.com/odoo/o-spreadsheet/commit/40dfc80c [FIX] interactive merge: remove useless user confirmation
https://github.com/odoo/o-spreadsheet/commit/050e64f3 [IMP] format: support additional date formats

closes odoo/odoo#105997

Related: odoo/enterprise#34097
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Co-authored-by: Lucas Lefèvre <lul@odoo.com>
2022-11-18 14:00:05 +01:00
Odoo's Mergebot 477bcc8fdd [REF] various: cleanup alias usage and empty list help overrides
PURPOSE

Cleanup alias definitions and usage to have as few invalid or dummy
data as possible. Cleanup empty list helpers override.

SPECIFCIATIONS

hr_expense: cleanup alias management

  * globally avoid crashes if the alias data has been removed;
  * recreate Xml ID record if it has been removed as it is considered as
    being a master data;
  * avoid issues when trying to configure the expense alias in settings if
    alias has been manually removed. Setting a name now creates the alias
    and an XmlID if it has been removed;
  * rename a generic 'use_mail_gateway' field into 'expense_use_mail_gateway'
    in order to avoid conflicts with future changes in generic settings linked
    to email gateway and configuration
  * fix empty list helper: it is now translated and correctly encode parameters
    given to 'mailto';

hr_recruitment, maintenance: remove unused aliases

Those modules hold default aliases to respectively create applicants or
maintenance request. Issue with those generic aliases are

  * they are not bound to any context (container document). For example jobs
    is not linked to any job record. Applicants will not have any job_id set;
  * they are not displayed anywhere. Applicant kanban view displays a helper
    when having no content, with an email address to start populating the
    view. This emails is however based on job in context, aka alias record
    created through the alias mixin on the job.
  * maintenance does not even try to use aliases in any view or code and just
    defines a dummy alias;
  * as default data they can be wrong: taking ``jobs`` and ``helpdesk`` is
    not necessarily a good idea. Indeed it depends on mail server configuration
    (e.g. not always owning all possible emails of a domain when using its own
    address like gmail). This may also conflicts with existing email addresses
    or already-defined aliases without being really configurable;
  * they are not configurable. They are not displayed in any configuration flow
    (setting or container document). Only going into technical menus to find all
    aliases allows to find them;

mail: improve mail alias views to ease usage

mail, various: cleanup empty list help message overrides

Purpose is to cleanup code: stop using help parameter name (use help_message as
help is a keyword), try to call super(), ...

LINKS

Task-2710804 (Mail: Clean MailThread Posting API)
Prepares Task-36879 (Mail: Support MultiCompany Aliases)

closes odoo/odoo#105992

Related: odoo/upgrade#4046
Related: odoo/enterprise#34089
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-11-18 13:59:54 +01:00
Thibault Delavallée 202153fb1b [IMP] mail, various: cleanup empty list help message overrides
Purpose is to cleanup code: stop using help parameter name (use help_message as
help is a keyword), try to call super(), ...

Task-2710804 (Mail: Clean MailThread Posting API)
Prepares Task-36879 (Mail: Support MultiCompany Aliases)

Part-of: odoo/odoo#105992
2022-11-18 13:59:53 +01:00
Thibault Delavallée 529121247f [IMP] mail: improve mail alias views
Purpose is to improve understanding and modification of alias records in
backend by improving form view.

In this commit we add missing fields in tree view, notably about alias owner.
Add buttons allowing to open the updated thread or the alias owner directly
from tree view to ease daily management of aliases. Cleanup filters.

Prepares Task-36879 (Mail: Support MultiCompany Aliases)

Part-of: odoo/odoo#105992
2022-11-18 13:59:53 +01:00
Thibault Delavallée a502366525 [REM] hr_recruitment, maintenance: remove unused aliases
Those modules hold default aliases to respectively create applicants or
maintenance request. Issue with those generic aliases are

  * they are not bound to any context (container document). For example jobs
    is not linked to any job record. Applicants will not have any job_id set;
  * they are not displayed anywhere. Applicant kanban view displays a helper
    when having no content, with an email address to start populating the
    view. This emails is however based on job in context, aka alias record
    created through the alias mixin on the job.
  * maintenance does not even try to use aliases in any view or code and just
    defines a dummy alias;
  * as default data they can be wrong: taking ``jobs`` and ``helpdesk`` is
    not necessarily a good idea. Indeed it depends on mail server configuration
    (e.g. not always owning all possible emails of a domain when using its own
    address like gmail). This may also conflicts with existing email addresses
    or already-defined aliases without being really configurable;
  * they are not configurable. They are not displayed in any configuration flow
    (setting or container document). Only going into technical menus to find all
    aliases allows to find them;

Conclusion: cleanup and remove.

Task-2710804 (Mail: Clean MailThread Posting API)
Prepares Task-36879 (Mail: Support MultiCompany Aliases)

Part-of: odoo/odoo#105992
2022-11-18 13:59:53 +01:00
Thibault Delavallée 5eca7b7378 [REF] hr_expense: cleanup alias management
Purpose of this commit is to cleanup alias usage in hr_expense. Indeed it
is currently used as a master data without being cleanly supported.

In this commit we

  * globally avoid crashes if the alias data has been removed;
  * recreate Xml ID record if it has been removed as it is considered as
    being a master data;
  * avoid issues when trying to configure the expense alias in settings if
    alias has been manually removed. Setting a name now creates the alias
    and an XmlID if it has been removed;
  * rename a generic 'use_mail_gateway' field into 'expense_use_mail_gateway'
    in order to avoid conflicts with future changes in generic settings linked
    to email gateway and configuration
  * fix empty list helper: it is now translated and correctly encode parameters
    given to 'mailto';

Task-2710804 (Mail: Clean MailThread Posting API)
Prepares Task-36879 (Mail: Support MultiCompany Aliases)

Part-of: odoo/odoo#105992
2022-11-18 13:59:53 +01:00
maximilien(malb) 93c1bb37f7 [FIX] l10n_syscohada: Fix COA
The account 81 to 89 were misclassified, this PR fix the issue

closes odoo/odoo#105999

X-original-commit: 14783ca3260bd3146da6421dc91c28c03257d5ef
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Maximilien La Barre (malb) <malb@odoo.com>
2022-11-18 12:58:22 +01:00
niyasraphy 850bb0a9d9 [FIX] purchase_requisition: wrong seller in context to get supplier info
the context passed to the method _get_product_purchase_description for the seller_id is wrong. system is expecting to get product.supplierinfo record set in this context key and from this function res.partner record set is passed, which results in the below error:

Record does not exist or has been deleted.
(Record: product.supplierinfo(70,), User: 2)

closes odoo/odoo#105998

X-original-commit: 6e7f778e1d0dbe4795fa9446bfd3542ecec9815c
Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-11-18 12:58:16 +01:00
Touati Djamel (otd) ccd66d3e18 [FIX] mrp: clear component if the BoM change
Steps to reproduce the bug:
- Create a storable product ”P1” with 2 BoM:
    - BoM 1:
        Type: manufacture
        Component: C1
    - BoM 2:
        Type: manufacture
        Component: C2
- Create a MO:
    - Add the product “P1”
    - The BoM 1 is automatically set and the component “C1” is added
    - Save the MO
- Edit The MO:
    - set the BoM 2 instead of BoM 1

Problem:
The component C2 is added, but the component “C1” linked to BoM 1 is
not deleted

To delete the existing lines, we check if the product has changed,
but we do not check if the BoM has changed:
https://github.com/odoo/odoo/blob/16.0/addons/mrp/models/mrp_production.py#L694

Solution:
clear “move_raws” if BoM change.
No need to check if the product has changed to clear component,because
if the product changes, the bom changes too

opw-3069283

closes odoo/odoo#105983

X-original-commit: 916449eb382715f341b05666cfec336e30c5db36
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-11-18 12:58:11 +01:00
Ivan Yelizariev 44ccc0dd83 [FIX] core: support export/import for json fields
New class `fields.Json` is introduced in v16. The feature lacks some converting
methods for export/import. This commit fills the gap.

Example: field `line_ids/analytic_distribution` in `account.move` (Invoices)

opw-3056669

closes odoo/odoo#105973

X-original-commit: abbe2e002c0125ecb83a1ab3ee80acf3f43e3cb6
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2022-11-18 12:58:09 +01:00
Ivan Yelizariev 50f8c63604 [FIX] base: skip _check_xml if arch_db is not yet set
On creating views manually via UI, the web client sends following parameters

arch_base: "<data></data>"
arch_db: false

(in previous v15 release is was only `arch_base` [1])

This triggers `_check_xml` method, which raise error because of empty value for
`arch_db`.

Fix it by removing empty `arch_db` attribute in `create` method.

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

opw-3038722
opw-3032865

closes odoo/odoo#105971

X-original-commit: 77f10460a6fd8d5de0853b3fb95c753e08060a5a
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2022-11-18 12:58:06 +01:00
vishal padhiyar e87a3b8d4f [FIX] web_editor: copy paste link keeps the old url
Before this commit:

When we try to copy paste link into another link then url of the old link does
not change and only lable change.

After this commit:

Now when we try to copy paste link into another link then the url of the link
changes with the label.

Task-2768541

closes odoo/odoo#105966

X-original-commit: ea1e410f4174d235609181bdba692a98e7381396
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-11-18 12:58:00 +01:00
niyasraphy 2774e276ac [FIX] website_payment_paypal: trace back accessing settings after deleting paypal
traceback is raised in settings page and on clicking activate stripe button after deleting the paypal payment provider from the database

closes odoo/odoo#105692

X-original-commit: 4d34606baf314c78d608904720778ff2ac6bf5b4
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-11-18 12:57:52 +01:00
niyasraphy 90ca48bf25 [FIX] sale, purchase: add place holder for product warning fields
closes odoo/odoo#105691

X-original-commit: 4e343409fe6a5752ee1b15197a6e092968830c8c
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-11-18 12:57:50 +01:00
std-odoo ec1e3b5f0d [FIX] web: show properties border when we hover the property label
Bug
===
If we hover the property label, we should see the bottom border of the
property value (like for standard fields).

The bug still exist for the tags and many2many, because it's based on
the AutoComplete component, and the same bug exist for standard
many2many tags.

Task-3039733

closes odoo/odoo#105969

X-original-commit: 3ced33f434e84361448062b4795108df6186ffed
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-11-18 12:01:04 +01:00
niyasraphy a57b79a309 [FIX] purchase_requisition: warning field visibility condition
activate warnings from purchase settings and open any purchase order and click the create alternatives button from alternatives page. in the next wizard, Warning Messages field is visible always, upon checking the view, it seems the visibility condition given is wrong and thus it get visible always.

closes odoo/odoo#105977

X-original-commit: 40ec1fe8fbaf97faccda7dcd87e308277275bae4
Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-11-18 09:57:48 +01:00
Manish Bohra c793fdebd8 [FIX] sale_project: allow invoicing downpayment from project
Steps to reproduce:
- Install `sale_timesheet`
- In Sale, create a so with a 'service' product with invoicing policy
  set on `Based on Timesheets` for customer A
- Confirm the SO
- Create a new project and check Billable and Timesheets
- Edit the Project and set customer to A
- Go in the `Invoicing` tab
- Enter the SO line you created before.
- Create employee mappings on the SO line you created before
- Click on the Save manually button
- Click on the Invoice button
- Chose Down payment (percentage)
- Set the percentage to 10%
- Click on `Create Invoice`

Issue:
A traceback is displayed when trying to create a downpayment on a project.

Cause:
Currently we filter the sol that are to invoice (`invoice_status` set to 'to_invoice')
prior to provide them to the wizard `sale.advance.payment.inv`.
As the result is an empty recordset, no sol ids are passed to the wizard.
Thus when trying to create a downpayment, no related sol is provided and
the error is thrown.

Fix:
As the `sale.advance.payment.inv` handles the fact that there are items to invoice
when choosing `regular invoice` there is no risk passing so line with an
`invoice_status` set to 'no' which will be used in this use case.

Closes odoo/odoo#104720

closes odoo/odoo#105987

X-original-commit: 8ec5aed363c8e714c109b2eb0fc7da966b6d31a3
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-11-18 08:43:51 +01:00
Simon Genin (ges) 72f7d52254 [IMP] dx: js tooling: imp to jsconfig file
remove checkJS: It made the ts server check for error, bypassing some
eslint rules (such as globals).
add ts files in the include: ts files need to be included in the project
as there are some .d.ts files defining types.

closes odoo/odoo#105984

Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2022-11-18 08:43:49 +01:00
MerlinGuillaume 10bb028540 [FIX] odoo,account: use field attribute exportable
Exporting a Binary field with a value of type dict from a record raises
an error

Steps to reproduce:
1. Install Accounting
2. Open Accounting and go to Vendors > Bills
3. Open any posted bill and register the payment
4. Go back to the list view and export the bill in payment
5. Add field Invoice Payments Widget to the exported fields and export
6. An error is thrown

Solution:
Make the field attribute `exportable` work (pass it in the field
description)
Make fields `invoice_outstanding_credits_debits_widget` and
`invoice_payments_widget` non-exportable as they contain computed
aggregated data for the client's benefit and it doesn't make sense to
export them

Problem:
xlsxwriter's `write` doesn't support type dict

opw-3054184

closes odoo/odoo#105972

X-original-commit: c925ecb2a22750524020f0d111888fd76eedb0cb
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-11-18 07:46:39 +01:00
damr 00892a3edb [FIX] 14.0 rating: submit rating feedback with 'get' method
In rating/controllers/main.py, the method action_submit_rating accepts
only post request. This creates a problem when you're trying to use the
web editor on the template as well as when you just paste the url in
your browser, for those are get request. The current behavior is a crash
with 'method not allowed'. This commit's purpose is to change the method
so it also accept get request. The use case of editing the feedback
rating page is arguable but it schould not crash.

The behavior after this commit is that the web editor is enable for the
page, and relaoding the page does not crash anymore.

task-3047893

closes odoo/odoo#105985

X-original-commit: 1b61faad8281d8b8d2fa1bf526f2ae2c4c8ba07b
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-11-17 21:58:53 +01:00
Valentin Vallaeys (vava) 4cf5476c18 [FIX] payment: warning display over full wizard screen
closes odoo/odoo#105892

X-original-commit: 521da3aa78371e33ced0de7f9da8d90a5a2d6498
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
2022-11-17 21:58:50 +01:00
Thomas Lefebvre (thle) e5298cf394 [FIX] website_sale: no possibility to go back on e-commerce
Steps to reproduce:
    - go to e-commerce app;
    - select a product;
    - try to return to the shop with the browser's back arrow.
    (if the URL contains `\@\`, is not necessary to click on a "action", otherwise we must)

Issue:
    It is not possible to go back.

Cause:
	Modifying the hash modifies the history of the browser.

Solution:
	Change hash without changing browser history.
	`window.location.replace` documentation: https://developer.mozilla.org/en-US/docs/Web/API/Location/replace

opw-3061027

closes odoo/odoo#105976

X-original-commit: b3f501db38e14b28cc6b63ffe91562e556a97c16
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-11-17 21:04:40 +01:00