Commit Graph
159345 Commits
Author SHA1 Message Date
Habib (ayh) eb33fdf9d8 [FIX] account: bank statement balance default
Using the bank recon widget (enterprise), it is possible to create bank statements from the list view.
The default start and end balances were not computed.
This PR fixes that (computes the balances) and has a few additional improvements:
- A warning is added to the statement form view to indicate the problem with the statement
- Statement validity can be computed before the statement is saved, to guide the user when manually creating statements
- balance_start, balance_end_real are now computed fields
- default_get method is simplified and moved
- the action "Create Statement" is removed in favour of multi-edit
- tests and translation templates

related enterprise PR contains the necessary view changes.

closes odoo/odoo#115174

X-original-commit: dfae9e204195abc1b776b9797043ceb38318de08
Related: odoo/enterprise#38131
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Ayob Habib (ayh) <ayh@odoo.com>
Signed-off-by: Christophe Simonis <chs@odoo.com>
2023-03-14 18:09:04 +01:00
Mathieu (mano) 36c85200e9 [FIX] web: tooltip question mark using wrong class
This commit replaces the `btn-link` with `text-info` since it is not a
button and the `btn-link` class should be used in pair with the `btn`
class.

Moreover, the question mark button in form view supposed to trigger the
`tooltip` box is difficult to reach since the triggering area behaves
weirdly on chromium OSX.

This is fixed in a separate commit:
d44d5e8ddea5e7e548cfe8fd74fc8e964ff088c6

This commit has been rebased to target 16.0 in accordance to the other
commit fixing the behavior of the tooltip.

task-3099734

closes odoo/odoo#115217

X-original-commit: eb3d6cc056dae842b03016c3c5084ba37242e386
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-14 17:03:38 +01:00
Ivan Yelizariev 59edbb7894 [FIX] base_automation: avoid recomputing readonly field before write
`base_automation` module patches `write` method to detect changes that trigger
the automated actions. It's implemented by reading current values before making
the write operaion. It may lead to max recursion error if compute method updates
other records. Example: in `account_asset` Depreciation values are computed for
all Depreciation Lines at the same time [1].

Fix it by breaking recursion on computed not stored readonly fields: `write`
method for such fields might be called by compute method only and hence the old
value is always equal to new value.

STEPS:

- Create an Asset model of 240 Months, Straight Line, No pro rata
- Create Assets using this asset model and confirm it.
- Create an automated action for account.move and trigger on update (Action can
be anything)
- Now try to access the Assets

[1]: https://github.com/odoo/enterprise/blob/45dd0884c84d0e8a31c2c36a975f1b1f7cf6d01c/account_asset/models/account_move.py#L39-L46

opw-3147688

closes odoo/odoo#115216

X-original-commit: 0561ad2324905aed5afd5cc163e5e6aebee09d40
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2023-03-14 17:03:35 +01:00
Maximilien (malb) b944808bb3 [FIX] account_check_printing: res config modification
Before this PR, the res config for the accounting page needed some UI fixes (checkbox misplaced, missing attrs invisible). This PR fixes that.

closes odoo/odoo#115212

Task-id: 3226604
X-original-commit: 33107e37cc007924fbe04d04cc2e9bdc0d3a60c4
Related: odoo/enterprise#38156
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
Signed-off-by: Maximilien La Barre (malb) <malb@odoo.com>
2023-03-14 17:03:29 +01:00
maad-odoo afe8f31c68 [FIX] web_editor: traceback on arrow up and down in powerbox
Before this commit:

When we add a single / on editor and add any extra character immediately after
 the first / and press up/down arrow key it throws a traceback error.

After this commit

Now, if any new characters is added after the first / and press arrow key then
it does not throw any traceback error.

Task-3193362

closes odoo/odoo#115202

X-original-commit: 10fc8ecd67687f8bbdbb741664968b513063c824
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-03-14 17:03:26 +01:00
David Monjoie e65f7d7e30 [FIX] web_editor: remove pretty printing of ir.ui.view
The following basic case has been broken in website forever since [1] in Odoo 8:

```html
<p><span>a</span><span>b</span></p>
```

Saving the above html results in:

```html
<p>
    <span>a</span>
    <span>b</span>
</p>
```

Which, when re-rendered back in the DOM renders equivalent to:
```html
<p><span>a</span> <span>b</span></p>
```

Note the space between "a" and "b". That is because etree will pretty print
nodes with indentations as long as they do not have text content, and that
indentation is collapsed into a single visible space by the browser when
inserted in the DOM. This is not limited to span nodes as the same applies to
any inline node. This is very easily reproduced in website on any version:

- Drop a Text snippet.
- Replace all the content of the snippet by "ab".
- Put "a" in bold and "b" in italic.
- Save.
- Notice that the saved version is now "a b" instead "ab".

The user has no way of removing this space easily because even if they manage to
do it by any mean, the server will pretty print the html again and the space
will reappear. The only way to circumvent this is to have some text content as
sibling of the inline nodes.

Consider this:

```
>>> etree.tostring(html.fromstring('<p><span>a</span><span>b</span></p>'), pretty_print=True)​
​b'<p>\n    <span>a</span>\n    <span>b</span>\n</p>\n'​
```

Which is incorrect, while this:

```
>>> etree.tostring(html.fromstring('<p><span>a</span><span>b</span>c</p>'), pretty_print=True)​
​b'<p><span>a</span><span>b</span>c</p>\n'​
```

Is correct.

We could fix it using a heavy hack that would leverage this behavior by
inserting one of the few unicode control characters that etree considers to be
actual content, and therefore preventing pretty printing for this node. The
server would then remove the control character to avoid polluting the actual
views. This would have the side-effect of forbidding this control character to
ever be used in a view however, and would obviously be an extremely ugly hack.

The alternative which was chosen in accordance with Antony (al) and Xavier (xmo)
is to disable pretty printing altogether, since the original commit [1] seem to
have introduced it as a fix for an old version of the editor rather than for the
intrinsic qualities of having pretty printed views.

If we ever want to re-enable pretty printing in the future, I suggest it be
implemented in JS because the browser is the only one able to assert whether a
node is going to be treated as a block or as an inline with respect to the
current CSS rules in application.

task-3142796
opw-3122373
opw-3186250

[1]: https://github.com/odoo/odoo/commit/6b857b6eeb59137a71385f98c82c440ac82cd45d

closes odoo/odoo#115159

X-original-commit: 3c6b9249482454a931f384ffc66ceec64dffbcfc
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-03-14 17:03:21 +01:00
Sébastien Theys e04cae82e2 [IMP] web: add disabled prop to Dropdown
With this commit, we can now customize the Dropdown component to
make it disabled.

closes odoo/odoo#115201

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-14 15:52:25 +01:00
Đặng Văn Lộc 45d9d6d324 [FIX] stock: Error if warehouse_id is given to the form view
If the developer wants to give warehouse_id form view, when create new
location, there will be an error in the compute function because it use
function split() with field parent_path has no value

closes odoo/odoo#115103

X-original-commit: 4d9b2ec6c85a178898bd81fe45bb0fcd3ba1a901
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-14 15:52:19 +01:00
Tiffany Chang (tic) b40c72da7e [FIX] product: print all product labels when multiple tracked products
Steps to reproduce:
- Create 2 SN tracked products
- Create a receipt of the 2 products, with a demand qty of 2+ of
  each product
- Create the SNs of the incoming products + validate picking
- Print Labels > 2x7 or 4x12 (with or without price) > confirm

Expected result:
2+ labels per product printed, 1 for each SN

Actual result:
Only 1st label of the 2nd product is printed, all of labels of the 1st
product are printed

Issue:
The "quantity" in:
https://github.com/odoo/odoo/blob/da30b41022c4f05b3abfdc3e64519d8438d25745/addons/product/report/product_product_templates.xml#L155-L156

is structured as:
  {product, [(barcode_to_print, qty_to_print), ...], ...}
or in this case:
  {product2: [(product2_sn1, 1), (product2_sn2, 1), ...], product1: [(product1_sn1, 1), (product1_sn2, 1), ...]}

So there was a miscounting where:
https://github.com/odoo/odoo/blob/da30b41022c4f05b3abfdc3e64519d8438d25745/addons/product/report/product_product_templates.xml#L162-L164

Would set the current_quantity to 0 (since only 1 per SN barcode)

And:
https://github.com/odoo/odoo/blob/da30b41022c4f05b3abfdc3e64519d8438d25745/addons/product/report/product_product_templates.xml#L155-L156

would register the not (current_quantity=0) as true and quantity={product1: (...),...}
as true => move onto the next product rather than checking if there
are any more (barcode, qty) tuples to print, i.e. never reach:

https://github.com/odoo/odoo/blob/da30b41022c4f05b3abfdc3e64519d8438d25745/addons/product/report/product_product_templates.xml#L166-L167

for product2 and therefore never reach its (sn,qty) labels beyond it's
first one.

Note that this issue does not occur for the dymo or zpl labels because
they follow different, less complicated templates

opw-3199095

closes odoo/odoo#114972

X-original-commit: 54e587b272a52972a0f615a29005dcb6fdb6992f
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-03-14 15:52:16 +01:00
Louis Wicket (wil) 9afe7c74c9 [IMP] *: remove "French spacing" 👺
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.

The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.

closes odoo/odoo#114533

Related: odoo/enterprise#37853
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-03-14 15:52:10 +01:00
Noe Antoine 2f7d95a75e [IMP] crm: underline datepicker field in PLS settings
Make the date field always underlined in the PLS modal in
the settings, to indicate that it is editable and not a
technical constraint.

Also rename confirm button to "update".

Task-3193113

closes odoo/odoo#114223

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-03-14 15:52:04 +01:00
Mohit Beniwal 66cac3a7ed [FIX] inventory: invalid literal for base 10:'false' in inventory
This issue was occurring while printing the count sheets in the 'update
quantity' section of products in 'Inventory' module.

Steps to Reproduce:
- Open Inventory module and go to any product.
- Click on update quantity button.
- Click create button, select the new record without saving it.
  Then click Print > Count Sheet

To fix this we check whether it is integer or not, if it is integer then
only it will print the report.

sentry-3880400776

closes odoo/odoo#115186

X-original-commit: 2600c17859363f5ec8c1f50a73e9d1990aa762ba
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2023-03-14 14:39:22 +01:00
Roy Le 0cf04fdd85 [FIX] hr: cannot create a new employee on the application
Steps:
1. Create Employee A that related with user A / partner A in Sales
department
2. Create a channel Sales, set Auto Subscribe Departments as Sales
department
3. Archive Employee A / user A / partner A
4. Create a application B in Sales department and click button Create
Employee
5. An error occurred: duplicate key value violates unique constraint
"mail_channel_partner_partner_unique"

closes odoo/odoo#115184

X-original-commit: e5e2cc8e00d4aec6f76283e8c5a7e485d6e9ab63
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-03-14 14:39:17 +01:00
Géry Debongnie c59650fc3f [IMP] web: some autocomplete improvements
This commit introduces two small improvements to the autocomplete
component:
- the ability to autofocus the input, once it is mounted
- the ability to set an additional class to its root element

closes odoo/odoo#115142

Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-03-14 14:39:11 +01:00
Xavier Morel e37109c8c3 [REM] core: support for werkzeug interactive debugger
With the special support for postmortem debugging removed, the
likelihood of needing / wanting the werkzeug remote debugger seems
even more remote (as it works in strictly less situations, only for
frontend non-json requests).

So remove that as well.

closes odoo/odoo#115176

X-original-commit: a2022783b652299155c460294c00dbced9b619ac
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-03-14 13:30:19 +01:00
Xavier Morel 09023b6f87 [REM] core: remnants of debugger support
It's done nothing since #78857 and it doesn't seem like anyone has
cared (found no issues or tickets).

Rather than restore the feature, just remove the leftover bits.

X-original-commit: 4a7cfc8844eb9b754f16f9d013452d5bde8770b5
Part-of: odoo/odoo#115176
2023-03-14 13:30:19 +01:00
Julien Van Roy a3748a2a6a [IMP] account_edi_ubl_cii: add Singapore Bis 3 format
Add a new edi_format "SG BIS Billing 3.0" available for SG companies.
This format is based on BIS Billing 3.0.

task-3180983

closes odoo/odoo#115147

Signed-off-by: Laurent Smet <las@odoo.com>
2023-03-14 13:30:15 +01:00
Sébastien Theys e8a4f4dce8 [IMP] bus, mail: make test data more consistent
In preparation of discuss refactoring.

closes odoo/odoo#115047

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-14 13:30:13 +01:00
Sébastien Theys 54febeda68 [FIX] mail: allow attachment_box_tests to be ran in large screen
Part-of: odoo/odoo#115047
2023-03-14 13:30:12 +01:00
lathuat1997 d51f457df9 [FIX] stock_account: check new qty_done before creating a SVL
closes odoo/odoo#114962

X-original-commit: d26dc33dea43c51cb5a4d1f365a8ac4adf8c78a1
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-03-14 13:30:09 +01:00
FrancoisGe 8ca0528b5c [REF] l10n_eg_edi_eta: convert client action
The purpose of this commit is to convert the client actions
'action_get_drive_certificate' and 'action_post_sign_invoice' to the new
architecture.

closes odoo/odoo#111507

Taskid: 3164406
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-14 13:30:05 +01:00
mth-odoo eac4dca6dd [FIX] account: updated the alias for an ambiguous column
Before this commit
------------------
Before this commit, the db migration from the 15.0 to 16.0  test case is failing
while this is migrating analytic_account, in computing methods
trying to use a direct field without reference.

 Traceback (most recent call last):
   File "/tmp/tmpmjg7gno3/migrations/base/tests/test_mock_crawl.py", line 223, in crawl_menu
    self.mock_action(action_vals)
   File "/tmp/tmpmjg7gno3/migrations/base/tests/test_mock_crawl.py", line 377, in mock_action
    mock_method(model, view, fields_list, domain, group_by)
   File "/tmp/tmpmjg7gno3/migrations/base/tests/test_mock_crawl.py", line 405, in mock_view_form
    [data] = record.read(fields_list)
   File "/home/odoo/src/odoo/16.0/odoo/models.py", line 2977, in read
    return self._read_format(fnames=fields, load=load)
   File "/home/odoo/src/odoo/16.0/odoo/models.py", line 3126, in _read_format
    vals[name] = convert(record[name], record, use_name_get)
   File "/home/odoo/src/odoo/16.0/odoo/models.py", line 5847, in __getitem__
    return self._fields[key].__get__(self, type(self))
   File "/home/odoo/src/odoo/16.0/odoo/fields.py", line 1188, in __get__
    self.compute_value(recs)
   File "/home/odoo/src/odoo/16.0/odoo/fields.py", line 1347, in compute_value
    records._compute_field_value(self)
   File "/home/odoo/src/odoo/16.0/addons/mail/models/mail_thread.py", line 403, in _compute_field_value
    return super()._compute_field_value(field)
   File "/home/odoo/src/odoo/16.0/odoo/models.py", line 4186, in _compute_field_value
    getattr(self, field.compute)()
   File "/home/odoo/src/odoo/16.0/addons/account/models/account_analytic_account.py", line 38, in _compute_invoice_count
    self._cr.execute(query_string, query_param)
   File "/home/odoo/src/odoo/16.0/odoo/sql_db.py", line 516, in execute
    return self._cursor.execute(*args, **kwargs)
   File "/home/odoo/src/odoo/16.0/odoo/sql_db.py", line 313, in execute
    res = self._obj.execute(query, params)
 psycopg2.errors.AmbiguousColumn: column reference "move_id" is ambiguous
LINE 1: ...lytic_distribution) as account_id, COUNT(DISTINCT(move_id)) ...

After this commit
-----------------
In this commit added the reference to the move_id which is used without reference.

closes odoo/odoo#115160

Taskid: 3141476
X-original-commit: 6ae96c7f707cdd2beac241280957bd3b3661b94d
Signed-off-by: William André (wan) <wan@odoo.com>
2023-03-14 12:24:15 +01:00
pedrambiria 3faef68a58 [FIX] point_of_sale: send creation_date with its time offset
Before this commit: in the PoS restaurant paid orders' date will be shown
 wrong. The problem is that it will be sent based on the user's timezone,
and `init_from_json` in PoS restaurant converts it again to the local time.

The solution is to send the time with its offset. Converting the time to
string will keeo the time offset in the format.

opw-3195027

closes odoo/odoo#115128

X-original-commit: 882dab5fdba32bb51ac4efbc3f0d4e684203a622
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-03-14 12:24:09 +01:00
Antoine (ande) 8d40bcf89a [FIX] purchase: PO stat button no groups
To reproduce the issue:
1. Create user with no access rights apart from user rights in Sales,
   Sign, Project and Timesheet
2. Create a project, add a task inside and link an analytic account
   to the project
3. Create an RFQ, add a product linked to the analytic account
4. Confirm order, receive product, validate, create bill
5. Log in with user
6. Try to access the analytic account through:
   Project->Task->project name->Settings->Analytic account
7. An error message pops-up "You are not allowed to access Purchase
   Order (purchase.order) records."

Error: You should be able to access the analytic account, but the
Purchase Order smart button should not be visible/present

The data access by the smart button was not stopped by rules or
groups, thus data was always trying to be loaded, even when the user
did not have the access rights

OPW-3180788

closes odoo/odoo#115058

X-original-commit: 9e8b2ba1ae05de72f492d833edd8da91ded6f5b0
Signed-off-by: Adrien Widart <awt@odoo.com>
Signed-off-by: Demany Antoine (ande) <ande@odoo.com>
2023-03-14 12:24:03 +01:00
roen-odoo 4df87cf10f [FIX] point_of_sale: correctly round total due in payment screen
Current behavior:
When you make a purchase that should be rounded down, for example 1.97
rounded down to 1.95. On the payment screen if you select a payment
method and pay with a greater amount than the base amount. The total due
would be rounded incorrectly to 2.00 instead of 1.95.

Steps to reproduce:
- Create a product with a price of 1.97
- Set a rouding down method of 0.05
- Open a pos session
- Add the product to the order
- Select a payment method, for example cash and enter an amount greater
  than the base amount, for example 5.00
- The total due will be 2.00 instead of 1.95

opw-3175726

closes odoo/odoo#114427

X-original-commit: 45994a5f8b3f87c46e39c260183663023d51e080
Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2023-03-14 12:24:00 +01:00
Joseph Caburnay b03cfce033 [IMP] web: line chart on top of stacked bar chart
When stacking a bar chart, you often want to see the resulting sum of the
different groups (esp. if there are negative values). For example, when
displaying a stacked chart of invoices vs credit notes, you usually also
want to know the net total.

This is done only on stacked bar charts that have single column per
x-axis label and with more than one level of groupby.

closes odoo/odoo#114132

Task-id: 3193260
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-03-14 12:23:57 +01:00
Odoo's Mergebot 404a083574 [MERGE][REF] delivery: extract stock logic in separate module
It's currently impossible to set fixed delivery costs in eCommerce without installing Inventory. This is a problem for one-app free instances on our SaaS, which would need to pay for a feature that should be part of the basic eCommerce features bundle.

Delivery is now split from inventory/stock module to allow for a soft free integration into website_sale. This PR makes it possible to define fixed-cost delivery methods in eCommerce without installing Inventory by adding a direct dependency of `website_sale` on `delivery`. The bridge between those two modules is therefore included in the former.

Steps are:
- extract the Inventory logic from the `delivery` module into a new `stock_delivery` module;
- move `website_sale_delivery` into `website_sale`;
- adapt dependencies to `delivery` and `website_sale_delivery`;
- remove bridge module with loyalty directly in `website_sale_loyalty`;
- move `website_sale_delivery_mondialrelay` to `website_sale_mondialrelay`.

task-3074497
task-3203210

See also:
- https://github.com/odoo/enterprise/pull/36609
- https://github.com/odoo/upgrade/pull/4362

closes odoo/odoo#110686

Related: odoo/upgrade#4362
Related: odoo/enterprise#36609
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-03-14 12:23:47 +01:00
Valentin Vallaeys (vava) 323bb4f03d [FIX] website_sale(_loyalty): merge main controller methods
Part-of: odoo/odoo#110686
2023-03-14 12:23:46 +01:00
Valentin Vallaeys (vava) d3cddbe89a [FIX] delivery, website_sale: fix UX issues in views
In ecommerce, the form vue of shipping methods should be improved to
easily set up fixed delivery costs. This commit improves the
user-experience and solves bugs on the fields displayed.

task-3203210

Part-of: odoo/odoo#110686
2023-03-14 12:23:45 +01:00
Valentin Vallaeys (vava) 5ce8d955f5 [REF] website_sale_mondialrelay: rename module
Part-of: odoo/odoo#110686
2023-03-14 12:23:45 +01:00
Valentin Vallaeys (vava) f9e1b8bcfc [REF] website_sale_loyalty: remove bridge module with delivery
Part-of: odoo/odoo#110686
2023-03-14 12:23:45 +01:00
Valentin Vallaeys (vava) 8acd58d85c [REF] delivery_*, website_sale_**: dependency to delivery
*: mondialrelay, stock_picking_batch
**: delivery_mondialrelay, loyalty_delivery, picking

Adapt dependency to `website_sale` directly instead of
`website_sale_delivery`.

Part-of: odoo/odoo#110686
2023-03-14 12:23:45 +01:00
Valentin Vallaeys (vava) 74a17c1b26 [REF] website_sale(_delivery): website_sale includes delivery
It's currently impossible to set fixed delivery costs in eCommerce
without installing Inventory. This is a problem for one-app free
instances on our SaaS, which would need to pay for a feature that
should be part of the basic eCommerce features bundle.

This commit makes it possible to define fixed-cost delivery methods in
eCommerce without installing Inventory by adding a direct dependency of
`website_sale` on `delivery`. The bridge between those two modules is
therefore included in the former.

Part-of: odoo/odoo#110686
2023-03-14 12:23:44 +01:00
Valentin Vallaeys (vava) a54c304487 [REF] (stock_)delivery: split delivery from stock
Extract the Inventory logic from the `delivery` module into a new
`stock_delivery` module. This will allow to integrate the basic delivery
features into the website_sale app in a one-app free database.

task-3074497

Part-of: odoo/odoo#110686
2023-03-14 12:23:44 +01:00
det a6988b4d54 [FIX] hr_expense: missing dependency
Before this commit, it was not possible to install hr_expense alone.
This commit enable the installation of standalone hr_expense by adding
missing dependency.

closes odoo/odoo#115140

Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-03-14 11:08:19 +01:00
Abdelouahab (abla) 53eaf7d3a0 [FIX] web: break text when overflow
To reproduce
============
- on Time off, create a time off with a big description
- approve this time off
the form breaks

Problem
=======
the style of text overflow is not handled

Solution
========
add `text-break` class to the input part

opw-3118856

closes odoo/odoo#115120

X-original-commit: 10bdfc46f32458f9f8a8fe5f9d298bfc10591aea
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: abla001 <abla@odoo.com>
2023-03-14 11:08:13 +01:00
Stefan-Calin Crainiciuc (stcc) e1639c2c1e [FIX] web: move test
The test added in dea66e1df317ca8782a68ece6c1e5917f6e8f3ec depends on a `mail`
helper, even though it is in the `web` module.

opw-3133731

closes odoo/odoo#115104

X-original-commit: e0ac9c41c6852cc147a9dea236421193161d7abe
Signed-off-by: Georis François (fge) <fge@odoo.com>
Signed-off-by: Stefan-Calin Crainiciuc (stcc) <stcc@odoo.com>
2023-03-14 11:08:10 +01:00
Xavier Morel 18ebbce51b [FIX] core: ability to run tours in Chrome 111
Chrome 111 enabled checking of websocket origin: if the WS connection
sends an Origin head which is not whitelisted with the new
`--remote-allow-origins` switch it is rejected.

Turns out websocket-client (amongst others) *does* send an `Origin`,
which trips the check, and means tours immediately break when trying
to run them as Odoo's test harness is unable to connect to (and
control) the devtools.

Suppress sending `Origin` to fix the issue.

To make the watch mode work, set `--remote-allow-origins`: since we
specifically only bind the devtools to the loopback
address (127.0.0.1) whatever issues this plugs are unlikely to affect
us. We might eventually want to change the behaviour of the watch
feature for UX reasons and remove this in the future though, either by
working through the non-ws remote inspection (`chrome://inspect`) or
by having the `watch` mode run in a normal browser directly instead of
having a browser connect to a headless browser.

Chrome 111 changeset: https://chromiumdash.appspot.com/commit/0154caeefc74530d5cb57ce71608beb1b77bca39

Chrome tracker issue: https://crbug.com/1422444

closes odoo/odoo#115067

X-original-commit: 47a02b3924c3e4d1690e336fdd764383393ee378
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-03-14 11:08:07 +01:00
niyasraphy e6a33ca33d [FIX] hr, hr_holidays: traceback field used in domain missing in view
before this commit, enabling the mass editing for the
various tree view using the studio throws exception
saying field used in domain is missing in the view

* install studio, hr, hr_holidays
* open department tree
* enable mass editing for the tree using studio app
* exception will be raised

similarly for the hr.job, hr.plan, hr.work.location and hr.leave tree views.

after this commit, on enabling mass editing on this tree view, exception will not be shown.

closes odoo/odoo#114935

X-original-commit: 70ece4c85c076962b8ebeed2a248d5228c5f8d0a
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-03-14 11:08:01 +01:00
JF Aubert d4ed9f8a50 [IMP] mrp*: Merge workorder and production scheduled/effective dates
Since starting a workorder and marking it as done replaces the
planned dates with the actual ones,
there is no need to keep dates which will always end up being the same.

task: 3108291

see odoo/enterprise#36102
see odoo/upgrade#4247

closes odoo/odoo#110550

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-03-14 11:07:56 +01:00
Hansun (hale) d9d47166de [FIX] l10n_din5008: fix document layout
1. Install DIN 5008

2.1. Settings
- [Companies] > [Document Layout] > Configure (..)
- Set [Layout] to DIN 5008 and paper format to one with DIN 5008
- write on [Company Tagline]
- [Download PDF Preview]

2.2. Accounting
- Customer Invoices
- click an invoice and [PREVIEW]

Before: Slogan not added
After: Added

versions: up to master
opw-3145751

closes odoo/odoo#115125

X-original-commit: 9d6876dbcb82b18d30fa8811456d26f67586344d
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
Signed-off-by: Lee, Hansun (hale) <hale@odoo.com>
2023-03-14 09:55:55 +01:00
Prakash Prajapati e5f462de16 [FIX] hr_work_entry_contract: fix the traceback when we edit multiple contract's Working Schedule
Reproduction steps:
 -Install payroll app
- Got to payroll > Contracts > Contracts > List view
- Select multiple record and modify the Working Schedule

- missing return in write

closes odoo/odoo#115105

X-original-commit: fcbff003ccc4cfda48b5b266929ee49f6ace3523
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-03-14 09:55:52 +01:00
Achraf 9154c2192d [FIX] product: Allow users to edit pricelist report
Steps:
- Open studio
- Go to 'Reports' tab
- Select 'Pricelist' report
- Error message

opw-3207593

closes odoo/odoo#115089

X-original-commit: abf3c725b17f16ec5b57ddbcf1639d60194b8bea
Signed-off-by: Achraf <abz@odoo.com>
2023-03-14 08:52:43 +01:00
Arthur Detroux (ard) 36ad52f00c [FIX] website: prevent default on clicks as early as possible
Prior to this commit, the event handlers that prevents the default
behaviors of a click was bound onto the $editable after the wysiwyg
editor had started.

This meant that during a very short period, the element could have the
"editor_enable" class but would not prevent clicks on the document
from triggering a default behavior.

This issue is not as important in versions prior to 16.0, because most
of the clicks on link would trigger navigation within the page,
canceling edit mode. If a traceback had appeared, it would be removed
quickly after, as the page was unloaded.

However, in 16.0, if the iframe leaves its current page, it can crash
the editor which now resides outside the page we are currently
editing.

Furthermore, the test introduced in [1] highlights the problem, as it
clicks on a link directly after checking if "editor_enable" is added to
the body within the iframe. This created a race condition, which means
the test crashed often.

This commit fixes the issue by using the click handler of the
website_preview to prevent the default behavior while in edit mode.

[1]: https://github.com/odoo/odoo/commit/050378dd8599b907ad429d4d1812602b557d0f73

runbot-18660

closes odoo/odoo#115119

X-original-commit: f9e51a8ab1cc469bd3dd4dba21856597d5e0f902
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-03-13 23:59:16 +01:00
Maruan Aguerdouh (magm) c7ff7f9bc2 [FIX] hr_timesheet: fix timesheet computation between hours and days
Steps to reproduce:

- Install Project, Timesheets.
- Create a new porject with allocated hours set to 40 hours (5 days).
- Taking into account that our company have a 8-hour/day work schedule
(40 hours/week).
- We go then to the timesheet app and we add a line for the project
created with 8 hours as hours spent.
- Now we got to the timesheet configuration and we change the uom to
days.
- We go back to the timesheet app and we see the result, we can also
try to add just 1 day.

Issue:

The days are not properly computed, only when we are in hours are being
computed properly. But when we change the uom to days, the computation
that we see in the list will still be wrong.

Solution:

We really take into account which uom are we working with so we
compute the time properly depending on the uom.

opw-3138053

closes odoo/odoo#115049

X-original-commit: a31a1b6aff4db0415dc9c44bae33901f4833aba1
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-03-13 19:42:45 +01:00
Walid HANNICHE (waha) 27d4a74724 [FIX] mail: set correct reply_to company
Steps to reproduce:
- select a different company from the main one
- under settings/discuss enable External Email Servers
- set up an alias domain
- create an SO and send it by email
(you can catch the sent email using mailhog)
- reply to that email
(you can use the support-tools[1] and set In-Reply-To: "previous message_id")

Bug:
the reply_to field of incoming message defaults to the first company

Fix:
set the reply_to field to the company asociated to the record
(there's already a fallback to self.env.company  in
"_notify_get_reply_to_formatted_email")

opw-3060214
[1]: https://github.com/odoo/support-tools/tree/master/scripts/mail

closes odoo/odoo#115090

X-original-commit: d86e57404d540762fa51afeabeddd3a0fc45d4d5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-03-13 18:45:11 +01:00
Victor Feyens 93e5a2bfaa [IMP] website_sale: hide column if feature is not enabled
Like everywhere else, do not show the website fields if the multi-website
feature is not enabled.

task-3213457

closes odoo/odoo#114221

Related: odoo/enterprise#37734
Related: odoo/upgrade#4402
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-03-13 17:45:33 +01:00
Victor Feyens bfb6dda897 [IMP] sale,*: factorize order & quotations tree views
task-3213457

Part-of: odoo/odoo#114221
2023-03-13 17:45:33 +01:00
Audric Onockx (auon) 85e9290711 [IMP] *: simplify recurrence
*=hr_timesheet,project,sale_project,sale_timesheet

Currently, the configuration of the recurrence is quite complete
and allows a lot of flexibility, but it is costly
in terms of implementation as it requires a lot of fields.
The goal of this task is thus to simplify this implementation.

In addition, a lot of people are complaining
that tasks are only generated when the recurrence date is reached,
as it doesn't allow to anticipate the planning of field service tasks.
In this task, we are thus going to immediately generate a new task
once the previous one is marked as done.

Concretely, we:
- describe a recurrence in terms of
"once every n day/week/month/year for ever/until a date"
and delete all fields that don't fit into it.

- remove the cron. The new occurrence is created when
marking the last task as done, and copied from the latter.
Deleting the last task deletes the recurrence.
The recurrence fields stay useful, as they form a delta t
that will be added to deadline/planned dates fields to get the new
values.

- use an boolean icon button to activate recurrence,
and place it at the end of deadline field's line.
The recurrence fields appear on the next line.

- delete in the form: the div explaining when the next tasks will be
created and the header to choose how to save the changes in the
recurrence.

task-3084945

closes odoo/odoo#112764

Related: odoo/upgrade#4343
Related: odoo/enterprise#37114
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-03-13 17:45:21 +01:00
Horacio Tellez f1a4aa75f7 [FIX] sale: bad error message when invoicing sales order
When trying to invoice undelivered quantities the error message
was somewhat misleading: it indicates as a possible solution a
Stock app feature even when Stock is not installed.

After this commit the message will be more appropriated.

opw - 3206001

closes odoo/odoo#115033

X-original-commit: a6ae8fae9f0db559880e04caa8446e57f7733c85
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Horacio Tellez Perez (hote) <hote@odoo.com>
2023-03-13 16:37:02 +01:00