Commit Graph
158227 Commits
Author SHA1 Message Date
Chong Wang (cwg) 4e282f10fc [IMP] core: void model translation
Before this commit, there is no way to "void" model translations, i.e.,
discard a translation and let the value fall back on the 'en_US' value.
The API of methods write() and update_field_translations() can only
overwrite the translations for the specified languages.

After this commit, calling update_field_translations() with a falsy
value except the empty string discards the corresponding translation
value, and let the value of the field in the given language fall back on
the 'en_US' value of the field.

X-original-commit: 5434fb845c393327db377abf872c448f4860a7d3
Part-of: odoo/odoo#111869
2023-02-03 16:32:34 +01:00
Horacio Tellez 9e997c7f07 [FIX] payment: stop using the term "payment" when tokenizing
All the messages on the "Payment Status" page were using the term
"payment". This could cause confusion in users when saving payment
methods, as a "payment" related message will appear even that no
payment related transaction is ocurring.

After this commit messages will use the more generic term "operation",
aiding in consistency and as a bonus avoiding confusion in users.

Task - 3050181

closes odoo/odoo#111868

X-original-commit: 14b5bc63a27ead3df882e5f9ebe15c0387c90844
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Horacio Tellez Perez (hote) <hote@odoo.com>
2023-02-03 16:32:30 +01:00
Jeremy Kersten fb8765b494 [FIX] base: ir.binary - return valid filename in Stream
Before this commit, if you have some special char like a return line \n,
or \r the get_stream_from method will crash with exception:

```
File "/home/odoo/src/odoo/odoo/addons/web/controllers/binary.py", line 163, in content_image
  return stream.get_response(**send_file_kwargs)
File "/home/odoo/src/odoo/odoo/odoo/http.py", line 578, in get_response
  res = _send_file(self.path, **send_file_kwargs)
File "/home/odoo/src/odoo/odoo/odoo/tools/_vendor/send_file.py", line 156, in send_file
  headers.set("Content-Disposition", value, **names)
File "/usr/local/lib/python3.9/dist-packages/werkzeug/datastructures.py", line 1218, in set
  self._validate_value(_value)
File "/usr/local/lib/python3.9/dist-packages/werkzeug/datastructures.py", line 1182, in _validate_value
  raise ValueError(

ValueError: Detected newline in header value.  This is a potential security problem
```

Now we replace `\n` `\r` by `_` before to serve the stream to avoid this
security exception from a safe way.
We decided to not use secure_filename from werzkeug because we want to
continue the support of non ascii char.

closes odoo/odoo#111851

X-original-commit: 95584e71a898017a92112f89e8a94315dd9235ac
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2023-02-03 16:32:24 +01:00
Bruno BoiandKristjan Tehu 277ff4f469 [FIX] web: wrong UTC convert in constructDateRange
Before this commit:
- Let's say we are in January 2023
- User's TZ has an offset from UTC (say UTC+2)
- Purchase > Create an rfq
- Set order deadline to 1st of next month (February), at 0.05am
- Add some products
- Confirm order
- Go to Reporting > Purchase then pivot view
- Add a filter on Order Date for the current month (January)
- Collapse the row groupbys
- Group the rows by Order Data > Month
- You can see the record of February and it should not be seeable.

After this commit
- the date range is now properly computed

closes odoo/odoo#111847

X-original-commit: 20c9e473419b92bbed01617c494b75847c60eea9
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Co-authored-by: Kristjan Tehu <kristjan.tehu@estpos.ee>
2023-02-03 16:32:22 +01:00
Kristjan Tehu 1e2923edee [CLA] signature for KristjanTehu
X-original-commit: f1a82a15bcaca134d4e9c315ec68027de5ee1457
Part-of: odoo/odoo#111847
2023-02-03 16:32:21 +01:00
Touati Djamel (otd) c9f62d0b8b [FIX] purchase_stock: compare the quantities with float_compare
Steps to reproduce the bug:
- Create a storable product “P1”
- Create a PO with 7000 unit of P1
    - Receive for example “3,483.43”
    - Create a backorder
- Create a bill for received product
- Try to confirm the second picking

Problem:
Traceback is triggered, because the reaming quantity is 0 and we use it
in the division:

https://github.com/odoo/odoo/blob/16.0/addons/purchase_stock/models/stock_move.py#L57

In this use case we compare “3483.43” and ”3483.4300000003” but in fact
`”line.qty_invoiced == received_qyt”` so we should not go through this
part of the code:
https://github.com/odoo/odoo/blob/16.0/addons/purchase_stock/models/stock_move.py#L40

So as we used `float_round` in the calculation of `qty_invoiced`, we
have to use `float_compare` when comparing it with another value

https://github.com/odoo/odoo/blob/383947646f5652804bd6bbc764380a890e6f4a8d/addons/stock/models/stock_move.py#L1168

opw-3162603

closes odoo/odoo#111840

X-original-commit: 5899abdea4a622d11f0e7472b489616e08b74523
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-02-03 16:32:18 +01:00
Josse Colpaert 84302a21b3 [FIX] l10n_in/t_edi*: attachment_id on edi.document needs sudo now
Following odoo/odoo@44a4cdb, account.edi.document `attachment_id`
now is restricted, so force getting it's value as superuser.

closes odoo/odoo#111839

X-original-commit: 98ae03c2a2e677643484b1988e3fc80fb8d85fc1
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Xavier Alt (xal) <xal@odoo.com>
2023-02-03 16:32:12 +01:00
Xavier ALT 1217132bcd [FIX] account_edi: fix access to edi documents attachment
Following odoo/odoo@44a4cdb, account.edi.document `attachment_id`
now is restricted, so force getting it's value as superuser.

X-original-commit: b805e90457ef57868b9742b622465ea823b05af2
Part-of: odoo/odoo#111839
2023-02-03 16:32:12 +01:00
amdi-odoo 0bb95cb8d6 [IMP] mass_mailing: improve modal wording
Improve the wording of the sending confirmation
dialog and the sending test dialog for emails

Task-3098731

closes odoo/odoo#108410

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-02-03 16:32:09 +01:00
amdi-odoo 28746db41e [IMP] web: add dialog attributes
Purpose
=======
Extend the customization of the confirmation dialog
by creating 2 new optionnals attributes:
"confirm-title": To change the dialog title
"confirm-label": To change the dialog confirmation label

Task-3098731

Part-of: odoo/odoo#108410
2023-02-03 16:32:08 +01:00
Dossogne Bertrand cab62eb1e0 [FIX] l10n_ma : fix external id
Fixes the external id that was using the kzc prefix
instead of ma.

taskID 2930634

closes odoo/odoo#106969

Related: odoo/upgrade#4261
Related: odoo/enterprise#34562
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-02-03 16:32:05 +01:00
Jeremy Kersten 3c939ada28 [FIX] base: remove autofocus on help tab from action server
It is only useful the first time to see the help tab.
And the content is already as docstring of the action.

closes odoo/odoo#111838

X-original-commit: 89f92d46e15aed91c535f78d2ec5f32ce11142c5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2023-02-03 15:28:04 +01:00
Audric Onockx (auon) 3905feb62a [REF] hr_timesheet: make _timesheet_preprocess work in batch
With this commit, we allow _timesheet_preprocess to accept a list of
dict of values instead of dict of values.
This represents an important gain in performance.

With 6 projects, 17 tasks/project, 10 timsheet vals/task = 1020 'vals':
Queries : reduced from 110 to 7.
Time : divided by ≃2.5.

task-3030942

closes odoo/odoo#103458

Related: odoo/enterprise#32967
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-02-03 14:23:02 +01:00
hupo-odoo 44d4c9d090 [FIX] hr_expense: homepage tooltip
When opening the expense homepage without any demo data while the tooltip tour is activated, and the list view is shown, a visual bug occured (see task description for video). The issue occurs only in 16.0 and after.
The origin of the problem was that the tooltip tour placed the class o_tooltip_parent not at the right div and therefore added the attribute 'position:absolute ' which caused the css defect. Preventing the specific div to get the attribute o_tooltip_parent fixes the issue.

closes odoo/odoo#111824

Task: 3147125
X-original-commit: c84f2169f76921ed9226bb6c1a0b5500f9154c34
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-02-03 12:55:50 +01:00
Antoine Guenet ef7d547c3c [FIX] web_editor: properly convert nested lists
Nested lists should not have a bullet point in front of them, but the
current conversion of HTML for emails made them reappear.

opw-3136324
task-3166100

closes odoo/odoo#111822

X-original-commit: 11f44de490d7e9c59b76aaade1d31b3041c9fb3b
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-03 12:55:48 +01:00
Odoo's Mergebot 00b60d6c74 [MERGE] resource: Add lunch attendance type
Purpose
=======

Add a new type on the working schedule, adding "Lunch" to Morning and Afternoon. It's mandatory, because, if you don't do that, you can't assume the difference between a time that should be recorded as extra hours and a time that should not be counted because it's lunch time.

A company is not another, so to be clear, they will define what are the imposed lunch time where the employee is not paid during the week.

Specification
=============

Lunch between Morning and Afternoon

When a time period is under Lunch :
- There is no working entry generated for that period of time.
- If you work before the lunch time and after it, it's not considered as extra time.
- The employee is not paid for the Lunch time.

closes odoo/odoo#108061

Taskid: 3102363
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-02-03 12:55:39 +01:00
Alexandre Kühn 21d090bf04 [FIX] mail, im_livechat: open profile on click livechat correspondent
Before this commit, clicking on message author opens chat with
author, including in a livechat conversation.

This feature is not useful in livechat, as there's already a
way to communicate with the visitor. In earlier versions,
click on author opens profile, which is quite useful.

This commit puts back this feature of opening profile from
author click in livechat.

closes odoo/odoo#111799

X-original-commit: 2b43fb452c28554d5b3659e8531ad4de11686153
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-02-03 11:45:46 +01:00
Odoo's Mergebot d2a9ef8297 [MERGE][CLN] delivery: cleanup pass before incoming task(s)
- remove utf-8 encoding header in python scripts
- add missing odoo license and xml headers
- alphabetical order for imports
- rename files according to model names (+ split if needed)
- remove unused variables in tests

closes odoo/odoo#111748

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-02-03 11:45:44 +01:00
Valentin Vallaeys (vava) a7c0172727 [CLN] delivery: remove unused variables in tests
Part-of: odoo/odoo#111748
2023-02-03 11:45:43 +01:00
Valentin Vallaeys (vava) 45c210bb85 [FIX] delivery: add missing xml headers
Part-of: odoo/odoo#111748
2023-02-03 11:45:43 +01:00
Valentin Vallaeys (vava) f7c033eff7 [MOV] delivery: rename and split files by model names
Part-of: odoo/odoo#111748
2023-02-03 11:45:42 +01:00
Valentin Vallaeys (vava) ce35703ca3 [CLN] delivery: super(class, self) is not needed
Part-of: odoo/odoo#111748
2023-02-03 11:45:42 +01:00
Valentin Vallaeys (vava) 29060f3e06 [CLN] delivery: alphabetical order and guidelines for imports
Part-of: odoo/odoo#111748
2023-02-03 11:45:42 +01:00
Valentin Vallaeys (vava) c4d232668c [FIX] delivery: add missing odoo license header
Part-of: odoo/odoo#111748
2023-02-03 11:45:41 +01:00
Valentin Vallaeys (vava) fcfcc1b190 [CLN] delivery: remove utf-8 header in python scripts
Part-of: odoo/odoo#111748
2023-02-03 11:45:41 +01:00
Jorge Pinna Puissant 1aa9b41800 [FIX] web_editor: show status indicator buttons on editing html field
Before this commit, when editing a form view, when editing a html field,
the status indicator buttons (the save and discard buttons) didn't show
up until a click outside the html field was done (change event).

Now, the status indicator buttons shown as soon as the input field is
edited (input event).

This is was already done for the other fields in [1].

[1] : 0b2d82282d7f656a9177158fd6117cc2e7a1b4d4

task-id 3147130

closes odoo/odoo#111663

X-original-commit: f56e3bca2456f04616982a9a0e77b8d4c5a0abff
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-02-03 11:45:35 +01:00
tsm-odoo d74057344d [FIX] bus: last bus subscription when switching offline/online
Before this commit, the bus worker would not subscribe to any channel
if the `_start` method was called before the socket was closed after
calling `_stop`. This is due to the fact that the close handler is
supposed to clean the last subscription when the socket is closed.

In this case, the handler is never called and the subscription is
considered already doned which is not the case.

closes odoo/odoo#111405

X-original-commit: 9e32c900e922674b4423407089cee58848ecdea1
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-02-03 11:45:32 +01:00
Nikunj Ladava df09c5c20f [IMP] website_slides: update course visibility
before this commit,
the wording of the visibility options can be quite confusing.

after this commit,
- Visibility has been updated
	- Visible to all: I see those training to the public
	- Visible to logged users only: I am a B2B business, and I do not want the
          public to see what I offer + the pricing I have on those
	- Visible to members only: I am a school, I want to invite my students but
          external visitors should not be able to enroll
- Move the field above the "enroll policy"
- Enroll Policy has been set to invite when visibility is set as a Course
  attendee  and hide the enroll policy

task- 2862003

closes odoo/odoo#102085

Related: odoo/upgrade#3946
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-02-03 11:45:30 +01:00
Victor Feyens d9548b6681 [REV] sale: partial revert of 34f2d0c267c54cce53b654b4d1c4228f1cd32c20
* the referenced commit didn't remove the used config parameter
* it's quite dumb to stop considering the parameters of a db out of nowhere
and force the usage of a specific template when a lot of databases were potentially
using another one.

This commit makes sure the parameter is still used when defined.
It is set to the forced valued in the data by default anyway.

task-2880950

closes odoo/odoo#97565

Related: odoo/upgrade#3965
Related: odoo/enterprise#30168
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-02-03 11:45:19 +01:00
Victor Feyens 8c2450de7d [IMP] sale(_*): settings display of default SO values
This commit reworks the display of the default SO values
in the settings to make it clear to the users what those
settings impact and that they are overridden by the quotation
template when specified.

task-2880950

Part-of: odoo/odoo#97565
2023-02-03 11:45:19 +01:00
Victor Feyens 22e583d3fb [FIX] sale_management: company_dependent setting value
The default quotation template was company dependent but
wasn't show as such in the settings.

task-2880950

Part-of: odoo/odoo#97565
2023-02-03 11:45:19 +01:00
Victor Feyens 5a8538a62a [IMP] sale: specify down payment product by company
Allows a better follow up of down payment, reduce
multi-company problems, ...

task-2880950

Part-of: odoo/odoo#97565
2023-02-03 11:45:18 +01:00
Victor Feyens 681d817bc6 [IMP] sale: remove use_quotation_validity_days parameter
Allow the feature activation by company instead of database.
It wasn't logical to specify the days by company but enable/disable
the feature by database.

task-2880950

Part-of: odoo/odoo#97565
2023-02-03 11:45:18 +01:00
Victor Feyens 7d077c8579 [IMP] sale: split data file
task-2880950

Part-of: odoo/odoo#97565
2023-02-03 11:45:18 +01:00
Nicolas Bayet 071ca078b5 [FIX] web_editor: retry peer to peer connection with exponential backoff
When there is a problem in the peer to peer network where we try to
recover a connection, retry with exponential backoff instead of
potentially spamming the server indefinitely.

task-3164011

closes odoo/odoo#111802

X-original-commit: fd97295c9cf8b1b0c800f407bb5f538f78cc2665
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-03 10:36:01 +01:00
Antoine Guenet 5cb4175e9c [FIX] web_editor: properly convert image dimensions
Before this commit, the image dimensions were not properly converted
when converting HTML for e-mails.

opw-3144322

closes odoo/odoo#111793

X-original-commit: 1d5c8c9adf18aded19d945cd9b0f72eb9b8bbc72
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-03 10:35:58 +01:00
Antoine Guenet ded7bb0895 [FIX] web_editor: limit custom table selection to editable area bounds
The custom table selection was not limited to the editable area bounds,
which means we could end up styling a table as selected, which did not
belong to the editor's scope. This sometimes happened when Firefox
triggered a selectionchange event during the instantiation of the editor
and the selection happened to be in a table outside the editor.

opw-3150654
task-3166078

closes odoo/odoo#111779

X-original-commit: d51aab54775ed541d7955cee032aceed143d3a08
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-03 10:35:56 +01:00
Antoine Guenet 40494b807d [FIX] mass_mailing: ensure design element changes are applied
When we change something in the DESIGN tab of mass_mailing, we edit a
stylesheet. This means we need to flush the rules cache so
convert_inline applies the new rules in its conversion.

opw-3114599

closes odoo/odoo#111778

X-original-commit: 4ebf106e65ae4901c03c76606a05d8cd2e0790d7
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-03 10:35:53 +01:00
Antoine Guenet 8a6337f15b [FIX] web_editor: move rules cache from document to wysiwyg instance
The CSS rules cache for convert_inline was stored on the edited
document, which is problematic since OWL destroys the document where we
used to just hide it (eg, when switching tabs in the form view).

X-original-commit: d432ebbddae7192eca7215a8489abb3ad91a45f2
Part-of: odoo/odoo#111778
2023-02-03 10:35:53 +01:00
Antoine Guenet 32a7c01a5c [FIX] web_editor: remove contenteditable attribute in converted email
When converting html for emails, contenteditable attributes should be
removed.

X-original-commit: 9b4cff9f6ab8e1738f3fc486875f9e4ab16cea9d
Part-of: odoo/odoo#111778
2023-02-03 10:35:52 +01:00
Antoine Guenet 70c1412bb2 [FIX] web_editor: properly convert background image on retina display
The fix applied by commit [1] for retina displays was not applied in
convert_inline so the bug persisted.

[1]: https://github.com/odoo/odoo/pull/98796/commits/2ea902941221599d4707f5291642b37875bec8c1

opw-3114599

X-original-commit: 1e840ae3619b9d3909e5f8af74b8c48f8d91063c
Part-of: odoo/odoo#111778
2023-02-03 10:35:52 +01:00
Antoine Guenet a8e326e3b6 [FIX] web_editor: properly forbid video command in sanitized fields
The video command is supposed to be forbidden in tag-sanitized fields. A
field gets tag-sanitized if sanitize_tags is true or by default if the
field is to be sanitized (and sanitize_tags is undefined). Before this
commit, the video command was not forbidden if sanitize was true,
regardless of the value of sanitize_tags.

closes odoo/odoo#111777

X-original-commit: 96b4edfd40a3c131a7709986fc3e1599c177f986
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-03 10:35:47 +01:00
Antoine Guenet 39a2002bf1 [FIX] web_editor: allow images command in html fields
The images command was disabled in html fields if the field's view
didn't define the `allowCommandImages` option. This allows that option
to be undefined so it can be overridden by its default value when such
is the case. Before this commit however, the option was always set to
`false` when undefined (the opposite of the expected default value).

opw-3134660

X-original-commit: bf0f17d2c9f19b88d4db2f4e15423ec0c831167f
Part-of: odoo/odoo#111777
2023-02-03 10:35:47 +01:00
Nishant Jain (niai) 68057e7161 [IMP] l10n_in: auto set GST Treatment only for Indian invoice/bill
After this commit GST treatment will be only assigned to Indian invoices/bills.

closes odoo/odoo#111738

X-original-commit: 6ede766eab05b621bfee6e6af259c7d2d0bfbd94
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-02-03 10:35:44 +01:00
Yannick Tivisse 3ee6b735fe [FIX] hr_work_entry_contract: Improve work entries generation perf 2023-02-03 10:25:00 +01:00
Yannick Tivisse 3bdfbe31c0 [IMP] hr_attendance: Take lunch time into account on work hours count 2023-02-03 10:25:00 +01:00
Yannick Tivisse 394014f679 [IMP] hr_work_entry_contract: Add method to retrieve lunch intervals 2023-02-03 10:25:00 +01:00
Yannick Tivisse 2e4f399e90 [IMP] hr_work_entry_contract: Add method to ease inheritance 2023-02-03 10:25:00 +01:00
Yannick Tivisse 5b6b1e0b18 [IMP] hr_work_entry: Add overtime work entry type 2023-02-03 10:25:00 +01:00
Yannick Tivisse 7bce5f3f95 [MOV] resource: Split files according to coding guidelines 2023-02-03 10:25:00 +01:00