Commit Graph
169147 Commits
Author SHA1 Message Date
Carlos Lopez 3df8ac359c [FIX] account: Use context_today instead of today
Before this commit, the date was being considered in UTC instead of the time zone of the current user. This is problematic in LATAM, where the time zone is negative.

closes odoo/odoo#150956

X-original-commit: 95acd53827ed128b301800dbabd5a8d9d7cbd12c
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2024-01-29 15:59:03 +00:00
svs-odoo 1cd54149de [FIX] stock: display demand on mobile
When creating a picking on mobile, the moves are displayed as kanban
boxes. But before this commit, only the mvoe's `quantity` is displayed,
that means when in draft, the quantity is usually at 0 and it's the
demand (`product_uom_qty`) who is relevant.

To fix that, display both fields.

Also, we display the UoM aswell if the UoM is enabled.

closes odoo/odoo#144282

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-01-29 15:59:01 +00:00
svs-odoo 12406c3449 [FIX] stock: update stock.move form view
The `stock.move` form view used for the detailed operation is also used
when using Odoo on a mobile device and is not usable in such case (for
example, the `product_id` is readonly.)
To fix this issue, the view is modified this way:
- The `product_id` is readonly only if the move has a id or already a
  move line (that way, the field is editable when creating a new move
  but is still readonly otherwise);
- The `move_line_ids` is readonly until the move's product is set;
- The demand qty. and the UoM are editable if the move is draft.

Also, some similar mofifications are done to the `stock.move.line` form
view too.

OPW-3577844

Part-of: odoo/odoo#144282
2024-01-29 15:59:01 +00:00
svs-odoo eb5a352a58 [FIX] stock: create picking on mobile
Before this commit, it was not possible to create a new picking on
mobile if this picking has multiple moves.

How to reproduce:
- Open Odoo on mobile (or on desktop but simulate mobile device with
  devtools);
- Inventory > Operations > Transfers;
- Create a new transfer (a receipt for example);
- In its operations (moves), add a new product, then add a second
  product.
- Try to save or validate the picking -> A warning prevent to do it,
  saying you're trying to write on the field `product_qty` instead of
  the field `product_uom_qty`.

What's happening:
For a unknown reason, the fields from the `stock.move` list view are
saved once a second move is created, even if we're using the kanban view
in the mobile version.
To avoid this issue, we force the `force_save` to be false for the field
`product_qty` in the kanban view. That's way, it prevents the issue.

OPW-3577844

X-original-commit: 818e7fcfd88fa9fe2927e327f4510b108a47c370
Part-of: odoo/odoo#144282
2024-01-29 15:59:01 +00:00
Claire Bretton (clbr) 4389f8255d [FIX] l10n_ch: add missing repartition line on vat_0_import
The tax with xmlid vat_0_import was missing its repartition
lines which caused validation errors.
This PR adds empty repartition lines to fix this problem.

closes odoo/odoo#151525

X-original-commit: 6ff955e1d7891d4848dc967b66d9d10310adf930
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
Signed-off-by: Claire Bretton (clbr) <clbr@odoo.com>
2024-01-29 13:44:38 +00:00
Florian Charlier 5429aa161f [FIX] website_forum: update flagged posts count
When flagging a post, moderators should see the flagged moderation queue
counter appear/increment.

We renamed the span in 21531bd9 and forgot to update this reference.

Task-3349373

closes odoo/odoo#151512

X-original-commit: 720d7b53e7d1a0944415a6c668f4eb3ba527dac8
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Florian Charlier (flch) <flch@odoo.com>
2024-01-29 13:44:36 +00:00
Djamel Touati 8517a66b14 [FIX] purchase_stock: allow updating the purchase qty
Steps to reproduce the bug:
- Create a storable product P1:
    - Create a BoM:
        - type: subcontracting
        - Add vendor
        - Add any component
- Create a purchase order with 3 units of P1
- Confirm the purchase order
- Go to the picking
- receive 2 units of P1 and validate it
- create a backorder
- Cancel the backorder
- Try to update the purchased qty in the PO line

Problem:
A user error is triggered:
“Nothing to check the availability for.”

When updating the quantity in the purchase order line, the
"_create_or_update_picking" function is called to search for a linked
picking and update its quantity. However, in our case, since no picking
can be updated, a new picking is created:
https://github.com/odoo/odoo/blob/783048616362702f/addons/purchase_stock/models/purchase.py#L271-L272

Subsequently, the moves are confirmed:
https://github.com/odoo/odoo/blob/e38ed7c780d35fb9d5d799ac783048616362702f/addons/purchase_stock/models/purchase.py#L277

However, as the product is subcontracted, the "action_assign" function
is called: https://github.com/odoo/odoo/blob/4055293873132d56fe3787c77e499808b136f300/addons/mrp_subcontracting/models/stock_move.py#L105-L106

Since there is no move in the confirmed state, a user error is
triggered: https://github.com/odoo/odoo/blob/d45996c9155b9576c74aa8c6c6f718f8ab4d0af6/addons/stock/models/stock_picking.py#L450-L453

Solution:
When updating the quantity in the purchase order, if no picking requires
an update, it is better to avoid creating a new picking.

opw-3616381

closes odoo/odoo#151422

X-original-commit: 636fa777aabec77e3622560f7a80435a56d088da
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2024-01-29 13:44:34 +00:00
Lucas Perais c0ab464dc7 [FIX] base, web (qweb): image field in raw data mode handles options
Commit[1] implemented a way to output an image as its raw representation
`<img src="data:image/png;base64......." />`
It is useful for integrating an image of a record not accessible publicly.

However the original commit forgot to allow the img node to handle the options
passed to the field. Classes in particular were absent

After this commit, the options are handled correctly, and the image in raw mode
has the right classes.

opw-3517861

[1]: f8b901d04b

closes odoo/odoo#151410

X-original-commit: dbb22351921629aad845e29ebfa8b4083b4e745a
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2024-01-29 13:44:33 +00:00
Odoo 5b3ca879ba [FIX] web_editor: text Selection & Color
Before this commit:

When we have some text in selection and we move away from the selection the
the toolbar disappear.

After this commit:

The toolbar is still visible when we move far from the selected text.

task-3054229

closes odoo/odoo#151354

X-original-commit: cbcad3b85f78dd42f7e059471498009be27a9045
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
2024-01-29 13:44:33 +00:00
Leonardo Pavan Rocha bdf568f56d [FIX] calendar: start and end date not being computed
In 17.0 the calendar view was revamped and the boolean field `all_day` started
being rendered with the boolean_toggle widget. This widget, however, behaves
differently than the boolean widget without passing explicit props. This caused
the onchange call not to be made after this change. This commit fixes this by
passing the autosave option as False on the field.

task-3669879

closes odoo/odoo#148874

Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2024-01-29 13:44:32 +00:00
lejeune quentin d9500890fd [FIX] point_of_sale: Fix the version of the cryptography module for iot
Currently the version of the cryptography module installed with
the version of pyOpenssl 22.0.0 does not allow the execution
of the Odoo server on the iot for versions 15, 16 and 17.

With this change we explicitly give the version of
the cryptography module 36.0.2 which corrects this problem.

closes odoo/odoo#151504

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2024-01-29 12:05:19 +00:00
Harsh Modi aa12fa5311 [IMP] l10n_in: update gst treatment type on draft invoice
When changing the treatment on customers, update draft invoices

task-3339052

closes odoo/odoo#151503

Signed-off-by: Josse Colpaert <jco@odoo.com>
2024-01-29 12:05:17 +00:00
Dossogne Bertrand 2b017f2e16 [FIX] hr_holidays: display valid allocations on dashboard
Before this commit, the displayed allocation
on the dashboard were all the ones linked to allocations
regardless of their validity period. This resulted with
an overloaded dashboard with leave types that are not supposed
to be displayed.

closes odoo/odoo#151306

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-01-29 12:05:16 +00:00
ahmad(alah) 58ff184080 [FIX] Work Entries - Contract: updating contracts without employee.
When updating contracts, work entries are recomputed automatically for the employee linked to that contract.
However some contracts might not have an employee, which raises an error.

Added a check to recompute work entries only if the contract has an employee.

closes odoo/odoo#151190

Task: 3614495
X-original-commit: 3a4683ae8159bf405513a901b1fd3bba72a05fb7
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-01-29 12:05:15 +00:00
qsm-odoo 7931d1a14a [FIX] website, web_editor: review "small" font-size behavior
Before this commit, since [1], the "small" class behavior of Bootstrap
was changed to use a fixed value instead of being dependent on the
context (using `em` units).

This was a bad choice, given the fact that the "small" class could
be used in the past with its previous behavior in custo but also in
default Odoo layouts, where it could be use in more legit cases that the
one Odoo currently offers: instead of applying the class to a whole
paragraph, applying it to part of a title.
In that case, since [1], we can have a big title ... with a very small
text next to it, which may be strange. Of course, the proper way to
achieve a big title with a smaller text next to it would be to not use
"small" but another hx font-size, but the legit bootstrap behavior which
is to use their "small" class is thus broken.

This commit keeps the current possibilities (big title with very small
text next to it) but does it by using new custom Odoo classes instead of
changing the Bootstrap "small" one. That way, legit custo in previous
versions (or trying to use default Bootstrap in this version) will be
supported.

Note that this commit will impact existing 17.0 users though: if they
actually configured a big title with small inner text... those will
become big title with slightly smaller inner text (the default Bootstrap
behavior). Worse: a big title whose size was reduced using the font-size
selector and choosing "small" will now become a big title. We think this
is worth the risk (see PR description for more visual details).

However, notice that "legit" use case of the "small" font-size in 17.0
will be kept untouched: e.g. adding a small text on its own or next to
a paragraph: the "smaller" Bootstrap behavior is now computed based on
the ratio of the configured base and small font-sizes.

Note that some additional "bugs" were found investigating this:
- Form descriptions use the "small" class for no reason and should
  probably not be possible to customize ("font style"-wise) anyway.
- The use of the "small" *tag* should probably be reviewed in all Odoo
  layouts and/or its interaction with the editor be fixed.

[1]: https://github.com/odoo/odoo/commit/194f73a9bbad8c3c3fb5c378e7bdfa704aaacdc0

closes odoo/odoo#149590

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2024-01-29 12:05:12 +00:00
jepbarasgarov ac62af7e25 [FIX] l10n_ch: remove depricated account_report_external_value
In module `l10n_ch` after this commit https://github.com/odoo/odoo/commit/7a06ed07814ab8d9192d3a7ec15aba7f90f7294d
`account_report_expression` with name `account_tax_report_line_chtax_solde_formula` will be
depricated but it can't be deleted by upgrade because it has dependent external values.
On this commit I removed that depricated external values of that expression

closes odoo/odoo#151426

X-original-commit: b26f2e24f3e70e26bc98aafe0e87735a1256a9cd
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2024-01-29 10:20:10 +00:00
Jérémy Hennecart (jeh) 103a5968b4 [FIX] calendar: allow to notify author when needed
In some case, the author should be notified. For example, in the
case someone books or cancels an appointment. The current user should
be notified as it's a proof that the action worked correctly.
This commit prepare a method that can be overriden to allow this process.

task-3505819

closes odoo/odoo#151319

X-original-commit: 9dff32354b0b6534ad707160459a9cd2514965f5
Related: odoo/enterprise#55221
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Jérémy Hennecart (jeh) <jeh@odoo.com>
2024-01-29 10:20:08 +00:00
Walid 944f959e74 [FIX] stock: print non unit UoM products labels
Steps to reproduces:
- Create two products one with UoM units and the other grams
- Create and confirm an SO with these two products
- Set quantities and validate the transfer
- Click "Print labels"

Bug:
only products with UoM units are printed because "quantity_by_product"
is overwritten with only those products

opw-3658993

closes odoo/odoo#151236

X-original-commit: d3c3e2013bd3ef2fe78c8f27b15daeb633c4d9a0
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2024-01-29 10:20:05 +00:00
Adnan Saiyed d96298d62d [FIX] web_editor: selecting link makes editor dirty
Current behaviour before commit:

In a saved pad, putting cursor inside a link without
making any other changes makes editor dirty. As result
discard button appears on the top.

Desired behaviour after commit:

Now putting cursor inside a link without editing
doesn't make editor dirty and discard button doesn't
appear on top.

task-3607361

closes odoo/odoo#151094

X-original-commit: d7f89ca078ec21fe0db49ae5b01f21caecd6abfa
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
2024-01-29 10:20:04 +00:00
yaih-odoo f16b194eaa [FIX] hr_expense: allow user access if manager
To reproduce:
 - Create an employee record for the connected admin user
 - Switch the user's company to another one
 - Upgrade to 17.0

A user who has the correct rights can change his company anytime to see employees from other companies
So it doesn't make sense to have access right error during an upgrade.
In this line: https://github.com/odoo/odoo/blob/140e58c5a68db674fc1d240147e4d669b29f2cad/addons/hr_expense/models/hr_expense_sheet.py#L385
The call to parent_id.user_id fail upgrades to 17.0 if the parent and the user have different companies.

Since Administrator-level users are not restricted, we put the check on that at the top to avoid errors during upgrades to 17.0.

closes odoo/odoo#150660

Note: in 17.1, it was made possible to have a manager from another company: https://github.com/odoo/odoo/pull/112768/commits/b841a24fc11cb83ca8e95fce7a83648d87cb90e3
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2024-01-29 10:20:03 +00:00
moerradi 586f75687d [ADD] l10n_it_edi_website_sale: Add 'Codice Fiscale' in checkout form
Implemented 'Codice Fiscale' field in checkout address form, addressing
a key need for our Italian customers.

This enhancement:

- Adds an optional 'Codice Fiscale' field, available for both
individuals and companies.
- Ensures compliance with Italian e-invoice requirements.

This update is a step towards better adapting our system to specific
localization requirements, enhancing user experience in italy.

task-3623622

closes odoo/odoo#151484

X-original-commit: 79157cdc9396b1a84f70d455f211febbc505c66c
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Mohamed Erradi (moer) <moer@odoo.com>
2024-01-29 02:16:51 +00:00
Odoo Translation Bot 625dac5a10 [I18N] Update translation terms from Transifex 2024-01-28 00:16:34 +01:00
Brice bib Bartolettiandmoerradi 4942a5f48e [FIX] account: duplicate bill warning in edit mode
The aim of this commit is to make the duplicate bill warning works in
edit mode.
This is a backport of some fixes that were done in the following
commit: cb694599583f5df1667984fee01bbcc4c8b2d409

Before the commit:
The warning couldn't be triggered in edit mode.

After the commit:
The warning is triggered as soon as the field is unfocused.

closes odoo/odoo#151451

Task-id: None
X-original-commit: 57c51b9c7b70cbc19071a8dfb67713a674caa0a0
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Co-authored-by: moerradi <moer@odoo.com>
2024-01-27 01:29:56 +00:00
Pedram (pebr) a48353d602 [FIX] pos_self_order: prevent error with online payment method
Prior to this commit, using an online payment method with an image in
self-ordering mode resulted in an issue preventing the opening of the
mobile menu. The specific error encountered was:
`TypeError: Object of type bytes is not JSON serializable`

This issue arose due to the image field being of type bytes. Since the
image field is not necessary for self-ordering, this commit addresses
the problem by preventing the loading of the image for a payment
method, resolving the serialization error.

opw-3624798

closes odoo/odoo#151388

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-01-27 01:29:54 +00:00
qsm-odoo e40cfe8495 [FIX] website: prevent toolbar flickering when entering edit mode
Steps to reproduce the bug (starting from saas-16.4 only!):
- Go to the website app
- Enter edit mode
=> Bug: the editor toolbar appears for a few ms, then disappears.

This bug occurs since [1], whose original commit was actually merged in
16.0 with [2]. The reason the bug only appears in saas-16.4 and not 16.0
is because of [3].

Commits [1] and [2] change the elements that are considered "tab-able"
and thus the elements that can be auto-focused by the `useActiveElement`
hook. That hook is actually used when we enter edit mode since [4], as a
way to declare the editor as the active element so that keyboard
shortcuts work (as indicated by the related commit).

What actually happens thanks to the hook is that once we enter edit mode
the "Block" button of the right panel is focused. This is because it is
considered to be the first "tab-able" element (with or without [1]/[2]).
Then keyboard shortcuts work as expected as the right panel is focused.

However, since [3], the `useActiveElement` hook is called "too soon".
Indeed the right panel is not actually inside the "auto-focused" editor
container yet**. The result is that what is now "auto-focused" is the
editor toolbar***. Before [1], the element in the toolbar that was
focused was an invisible one, so no bug appeared. Since [1], we only
auto-focus visible elements... so we now focus a visible element in the
editor toolbar, making it visible during editor instantiation.

This commit fixes the issue independently of [3] (which is why this
targets 16.0: to consolidate the codebases). Actually, the use of the
`useActiveElement` hook added by [4] is useless. It was fixing the
issue at the time, but the real solution was to do what was done since
at [5]. Indeed, the keyboard shortcuts were not working because the
backend navbar was still visible (even if outside of the viewport) so it
was its keyboard shortcuts that took precedence. Since [5], the use of
`useActiveElement` actually has not benefit anymore. The editor is part
of the backend UI, the backend UI is still focused after entering edit
mode, shortcuts targeting the editor panel are thus working naturally.
Removing the use of the `activeElement` hook only has one side effect:
the "Block" button of the right panel is not auto-focused anymore...
which is not needed.

Notes:

- The `useActiveElement` hook also has another purpose: allowing cycling
  using tab and shift-tab, it should work naturally as with the backend
  UI anyway but mainly: tab and shift-tab do not seem to be working with
  the editor UI anyway.

- Another hint that [4] was not right way to go is that this is the only
  use of the `useActiveElement` hook in the whole codebase, except for
  the framework use for dialogs.

- ** That should maybe be solved on its own, although maybe it is not
  important and risky at best.

- *** The editor toolbar should not even be instantiated that way in the
  first place since it will be attached to the right panel later... but
  that is another issue.

[1]: https://github.com/odoo/odoo/commit/c631bf09b927003edc4c2b85e8790e8e2e8c044a
[2]: https://github.com/odoo/odoo/commit/57452ee59c3e33eaa219d8d7b8d82239fd33b722
[3]: https://github.com/odoo/odoo/commit/76d4f9811b756f0e57b0a33dbba534c900c7fe15
[4]: https://github.com/odoo/odoo/commit/b0108e1876a27e83231e176cdca3e2d67d6a2a9c
[5]: https://github.com/odoo/odoo/commit/cdc8d4c889b316664323afad0d848403960150d5

task-3686730

closes odoo/odoo#151373

X-original-commit: aa168b5583b9b437fcf83c2f7b2d256ec66e4c79
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2024-01-27 01:29:53 +00:00
Victor Feyens 9ea17019f6 [FIX] core: default multi-company domain
of check_company=True fields.

Suppose two models

class A:

    company_id = fields.M2O() # not required

class B:
    _check_company_auto = True

    company_id = fields.M2O() # not required
    a_id = fields.M20(check_company=True)

and the following code:

a = A.create({'company_id': 1})
b = B.create({'a_id': a.id, 'company_id': False})

The creation of B will fail because of the multi-company
checks, which is expected.

Nevertheless, since 0d30cc2bc9, the domain
of the field a_id would be:

(company_id and ['|', ('company_id', '=', False), ('company_id', 'in', [company_id])] or []) + ([])

which means that through the interface, if you create a record b following
the example above (no company_id on b), the evaluated domain would be empty,
allowing to select records of class A, even if they belong to another company.
Of course, this would lead to a multi-company error when trying to save the
record.

This commit makes sure that the right domain is applied on
check_company=True fields, even if the current record has no value
in its `company_id` field.

opw-3629374

closes odoo/odoo#151341

X-original-commit: aaddedc3bab4f16747fb0f71ae626d94f3975ee3
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2024-01-27 00:01:24 +00:00
Anh Thao Pham (pta) 11358e95ba [FIX] website_sale: fix eshop prices on branch website
Steps to reproduce:
- Create a branch for a company (e.g. Branch X)
- Go to "Website / Configuration / Websites"
- Create or configure a website on Branch X (e.g. Website X)
- Go to "Website / Configuration / Settings"
- Select Website X
- Set "Display Product Prices" to "Tax Included"
- Create a product for a price of $100 and a tax from parent company (e.g. 15%)
- Go to eShop page of Website X

Issue:
On the eShop products list page, the price of the product should be "Tax Included" ($115),
but it is not. The displayed price is $100.
When accessing the product page, the price is correctly displayed with the tax ($115).

Cause:
When computing the prices, taxes from parent companies are not taken into account.

opw-3660156

closes odoo/odoo#151320

X-original-commit: cbea1dac9d5d30fb42912b4ec25061952cde67a8
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Anh Thao Pham (pta) <pta@odoo.com>
2024-01-26 21:08:03 +00:00
Julien Segers (juse)andLuca Vitali 7af78e6aa5 [PERF] web: avoid unnecessary sorting in select menus
Sorting is being computed on each mounted select menu during the useEffect() hook since this commit: 8a44857.
This can lead to long wait times or browser crashes when there are many select menus with many options.

Before this commit, all of the select menu were sorted when the user select a value in one of them.
This is not necessary as the sorting is already handled in beforeOpen.

After this commit, no sorting is being computed in useEffect() anymore to avoid unnecessary computation.

A test has been added to verify the sorting happens when needed.

opw-3616438

closes odoo/odoo#151318

X-original-commit: f58b88383ce6a7439c02dbe761dc9025ddfe3b0a
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
Co-authored-by: Luca Vitali (luvi) <luvi@odoo.com>
2024-01-26 21:08:02 +00:00
Lucas Perais d8993d61e6 [FIX] base: can delete manual models with base fields
Create an ir.model custom (state = "manual" -- for example via studio) that has a mix
of manual fields (named x_...) and of base fields (originating from some mixin).

Unlink all linked views or object, and try to unlink that model eventually.

Before this commit, an error was raised because base fields couldn't be deleted, even though the table was empty.

After this commit, the deletion works.

Note that this commit is a fix of https://github.com/odoo/odoo/pull/130420/ , which added partial support for this
and a backport of 7550bcd61e which fixed the former PR in 17.0

opw-3558590

closes odoo/odoo#151282

X-original-commit: 3e84f3e9b0da397d82d5add0e37be58f0e30c7be
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2024-01-26 21:08:00 +00:00
Youssef Bashandy 55a4ac8dea [FIX] mrp: Fail to set workorder on calendar 'Planning by Workcenter'
Steps to reproduce:
1- Install Manufacturing module
2- Create 2 or more new WOs and make sure that their corresponding MOs is not planned
3- Go to Operations > Work orders
4- Mark all of those WOs and write a start date to apply on all of them
5- Check Planning > Planning by Workcenter 'you will not find the scheduled WOs'

Current behavior before PR:
When you try to mark more than one record in Work orders and set start date for all of them at the same time it will not be set therefore it will not be visible in Planning calendar. This is happening because if you are setting the start date for the first time it will call the function that sets the start date first before calculating the finish date so it will not pass the condition where it checks if both dates have values.

Desired behavior after PR is merged:
Now we are checking just the start date if it has value or not and to raise the same user error if the customer tries to delete the finish date we are checking this on change of the finish date from a value to null.

opw-3596100

closes odoo/odoo#151272

X-original-commit: 70394e616e5d75ee33ed048dbd7210c1926c63be
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Youssef Bashandy (yoba) <yoba@odoo.com>
2024-01-26 21:07:59 +00:00
nda e796f13d2a [FIX] base_import_module: set module dependencies
Dependencies and other manifest attributes are not set for data modules.

Note: it's easier to reproduce issue in 17 since we have data module available
on runbot.

steps to reproduce (in 17.0):
- install an industry (ex: bar_and_lounge)
- uninstall a dependency of that module (ex: mrp)

before this commit:
- bar_and_lounge is not uninstalled if you uninstall mrp

after this commit:
- data model dependencies are handled the same way as 'regular' modules

opw-3660052

closes odoo/odoo#151256

X-original-commit: 12256bbc5981b06d7b77c133cc8f282ac03afba9
Signed-off-by: Nicolas Danhier (nda) <nda@odoo.com>
Signed-off-by: Pierre Masereel (pim) <pim@odoo.com>
2024-01-26 21:07:58 +00:00
suresh badikala b91df47fb3 [FIX] project: fix project share kanban view in mobile
Steps:
- In mobile open project
- Project.project form view
- Share project
- Invite people, the 'email' is displayed twice in the kanban view

Issue:
- In mobile when project share invite people, the 'email' is displayed
  twice in the kanban view

Cause:
- This will be coming because of the context for show_email

Fix:
- By removing of context show_email it will be working fine.

task-3550702

closes odoo/odoo#150528

X-original-commit: b7fe981d0984bf265a970b0b132dec2172f42bf8
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-01-26 21:07:55 +00:00
Katherine Zaoral 47387b9d02 [ADD] l10n_ar: AFIP Concept Otros option
If partner to invoice is from "Zona Franca - IVA Liberado"
then the exportation invoice then the AFIP concept to
use should be code 4. "Others"

closes odoo/odoo#150051

X-original-commit: 8ef4b332d46d78daa5c8c91d8b1110468316d583
Signed-off-by: Josse Colpaert <jco@odoo.com>
2024-01-26 21:07:54 +00:00
Simon Genin (ges) bf65cb53d0 [FIX] web: datetime range with always range when empty and readonly
Recently, a new option 'always_range' has been added to the datetime
field (task 3628069, commit bc98aad). This option forces the display
of the arrow between the two dates from the start. Before that, you
would add a first date, click a button to add a second date and then
only would the arrow appear.

The oversight here is when the field is empty AND readonly. In that
case, you have an visible arrow next to the label but you can't do
anything with the field anyway. So better not to show it.

This commit makes sure to not display the arrow in this case.

task 3690523

closes odoo/odoo#149912

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-26 21:07:53 +00:00
Benoit Socias 6ab7a11e3a [FIX] web_editor: adjust "add URL" button for documents
Before this commit the button to add documents from an URL is labeled
"Add Document" which is confusing given it is displayed besides an
"Upload Document" button.

This commit renames the "Add Document" button into "Add URL" to make its
purpose more obvious.

task-3493618

closes odoo/odoo#149406

X-original-commit: 860cbe0fcddc7b7a6f1ca383161ab439ba68fd72
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2024-01-26 21:07:52 +00:00
Mélanie 11f9195749 [FIX] hr_attendance : remove duplicate action on attendance
With this commit, the button "duplicate" when you selected some attendances is not shown anymore.

task : 3646395

closes odoo/odoo#147276

Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
2024-01-26 21:07:51 +00:00
Antoine Boonen acc6f10ed2 [IMP] base: Add Ugandian tax label
Uganda uses the label TIN on reports and invoices, which stands for
Taxpayer Identification Number. This commit adds this label to the base
module.

task-3340378

closes odoo/odoo#131877

Signed-off-by: Josse Colpaert <jco@odoo.com>
2024-01-26 21:07:50 +00:00
Antoine Boonen 637dbbd0a3 [ADD] l10n_ug: Base configuration for Uganda
Problem
---------
There is currently no localization for Uganda.

Objective
---------
Add the base localization for Uganda:
- Chart of accounts
- Taxes
- Fiscal positions
- Default settings
- Tax reports

Solution
---------
Create a new localization and set up all basic required information:
- tax and tax groups, CoA and fiscal positions are defined in CSVs.
Details have been obtained in documents (for details about those
documents, refer to the task).
- demo data is generated (it uses a random address)
- default accounts and value are set up for the company
- Profit and loss report and balance sheet use the generic template
- Tax report has been made following the template provided by the URA

task-3340378

Part-of: odoo/odoo#131877
2024-01-26 21:07:50 +00:00
Victor Feyens 330f427367 [FIX] website_sale: displayed discount on cart
Since 17.0 , calls to _get_combination_info on the
/shop/cart page were removed to avoid recomputing
values already stored on the cart, speeding up
the page loading.

See 824fc94bbc

Nevertheless, this highlighted the difference
in pricelist discount computation between sale
and website_sale.

In sale, the discount is computed while considering
the base price of the pricelist, whereas for
website_sale, the base price was always the sales price.

To make sure the crossed price displayed is the sales
price as before on /shop/cart, we override the default
sale behavior to force the sales price to be considered
as price before the pricelist discount.

closes odoo/odoo#151321

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2024-01-26 19:26:16 +00:00
Enric Tobella d5d563909f [IMP] point_of_sale: Add a hook to check if we can pay an order
With this change, we can set other conditions easily.

Also, it allows us to check if it can be payed without actually executing the pay function,
because sometimes we don't want to change the screen but we want to check if the order can
be processed for payment.

For example, we could disable the Pay Button from the Product Screen

closes odoo/odoo#150914

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-01-26 17:43:38 +00:00
maad-odoo a66161c1d6 [FIX] point_of_sale: traceback on backspace hit in tips
Before this commit:
When a user adds a tip and removes it by hitting multiple backspaces, a
traceback occurs. The value passed as the tip was supposed to be an
empty string if no tip is applied, but it received a null value, causing a
traceback.

After this commit:
The tip value is checked to be a truthy value. If it is not a truthy value,
then an empty string is passed, resolving the traceback.

task-3692849

closes odoo/odoo#150586

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-01-26 16:10:06 +00:00
Yannick Tivisse 39d3da451c [FIX] resource: Improve _leave_intervals_batch performances
On N elements resource.calendar.leave and M elements resource.resource recordsets,
the __get__ calls to 4 leave fields were done M time per loop, aka 4*N*M times.

This commit reduces the number of call to 4*N times, reducing the method executing
time for grid_unavailability from 9 seconds to +- 4.5 on odoo.com while displaying
all timesheets on Month view.

closes odoo/odoo#150408

Related: odoo/enterprise#54830
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-01-26 12:45:40 +00:00
Xavier Bol (xbo) dc64c1a768 [FIX] project_timesheet_holidays: ensure a task id is only once in the list
Before this commit, the `_search_is_timeoff_task` search method for the
`is_timeoff_task` field could return the same task id many times in the right
part of the leaf inside the domain returned by the method.

This commit makes sure the list of ids in the right part of the leaf in the
domain returned by the search method will be each time different task ids.

Part-of: odoo/odoo#150408
2024-01-26 12:45:40 +00:00
Gauthier Wala (gawa) 347ea9ee61 [FIX] l10n_in,account_audit_trail: access right issue
To reproduce:
- Go in admin user
- activate Audit Trail in the settings
- Log out
- Connect as demo
- Go to the audit trail report
- Activate the filter Update Only
=> Access right error

The demo user doesn't have the right access
for the domain of the filter.
We should hide this filter for these users

closes odoo/odoo#149783

Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2024-01-26 12:45:38 +00:00
Djamel Touati 5d64f5845b [FIX] repair: validate a repair with a product on package
Steps to reproduce the bug:
- Create a product “P1” tracked by SN
- Update the quantity with “SN1” and a package “Pack 1”
- Create a repair order to repair the product P1:
    - Select the “SN1”

- Try to confirm the repair

Problem:
A wizard with the following message is triggered:
Insufficient Quantity to repair “The product is not available in
sufficient quantity in WH/Stock

Because when the function “action_validate” is called, we check if
there is quant with the same SN but with strict=True so, the package
should be false to find the quant:

https://github.com/odoo/odoo/blob/61c9921596662a2cbc15a154a91dd2f52c9854fd/addons/mrp_repair/models/mrp_repair.py#L210-L211

https://github.com/odoo/odoo/blob/b3180c841101510081ee8ef9c52d205497efdd4f/addons/stock/models/stock_quant.py#L102

Opw-3648874

closes odoo/odoo#151234

X-original-commit: a470f7ed958f13a31e870e0abaf19736559f3398
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2024-01-26 10:35:07 +00:00
Yolann Sabaux eb340635b2 [FIX] mrp: enable displaying a 0 qty on bom line in overview
Steps to reproduce:
- open bom
- open product `Table`
- set the quantity of all subproduct to `0`
- Open overview

Issue:
the table top has 1 in qty

Cause:
For a bom subproduct, if there is no qty set (0/False), we automatically set the qty defined on the bom

opw-3677052

closes odoo/odoo#151141

X-original-commit: 4db4fe4466292ca2041bf04434ababfbc10cd9dd
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
2024-01-26 10:35:05 +00:00
clesgow 4275805d81 [FIX] mrp_product_expiry: Display wizard on production close
Steps to reproduce:
- Create a product and set it tracked by lot and expirable
- Create a lot for this product that is already expired
- Create a MO using this product as component and confirm it
- Go the Shop floor and force the use of the expired lot for this
component
- Click on 'Close Production', a traceback will appear

Issue:
Since the action is defined directly in the python code, we don't have
some extra fields that are usually computed on a `ir.actions.act_window`
record, such as the `views` field.
Yet, on the js side, the action service requires that field to properly
work, so we add it in the action definition.

closes odoo/odoo#151084

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-01-26 10:35:03 +00:00
william-andre dd2de1b6ac [FIX] account: manual import of matching numbers
The import feature of matching numbers was done manually in all imports,
but the generic import was missing.

For instance, with this file:
```csv
name,line_ids/account_id,line_ids/debit,line_ids/credit,line_ids/matching_number
test 2,400000,,121,1
,500000,121
test 1,400000,121,,1
,451000,,21
,700000,,100
```

The system wouldn't understand that this is an imported number.

closes odoo/odoo#150848

Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
2024-01-26 10:35:02 +00:00
Valeriya(vchu) c3b767104c [FIX] sale_product_configurator,product: show archived combination
Steps to reproduce:
1) Create SO with customizable product (example “Customizable Desk”)
2) Let default values in product configurator
3) Save SO
4) Go to product template, and in the Attribute remove all value
options, only leaving the custom value
5) Try to open the product in configurator in the saved SO

Reason:
archived combination is not loaded

After this commit:
When requested combination is archived, load it

opw-3513685

closes odoo/odoo#150653

X-original-commit: fc8fb4277c477161ab9e6538689a85591a440885
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Valeriya Chuprina (vchu) <vchu@odoo.com>
2024-01-26 10:35:01 +00:00
Valeriya(vchu) 23a79eeca8 [FIX] sale_product_configurator: set value for no_variant attribute
Steps to reproduce:
1) Create product with an attribute that has several values and with an
attribute with 'create_mode = 'no_variant' and one value.
2) Create SO with this product, save
3) Open product configurator again and see the traceback

Reason: selected_attribute_value_id is not set.

After this commit: the attribure value is defined in get_values of
product configurator.

opw-3513685

X-original-commit: 8cf7d706f86e830670fb3c8fd799e6cacefe122c
Part-of: odoo/odoo#150653
2024-01-26 10:35:01 +00:00