Commit Graph
165814 Commits
Author SHA1 Message Date
Adrien Guilliams (adgu) f96ea753f3 [IMP] point_of_sale, pos_restaurant: add images on demo categories
In this commit, we add images on demo categories to make the demo more
realistic but also change a bit the design of the category selector.

closes odoo/odoo#134621

Signed-off-by: David Monnom (moda) <moda@odoo.com>
2023-09-21 14:15:42 +00:00
Sanket Brahmbhatt 192c970da7 [FIX] website: avoid 'NoneType' has no attribute 'context' at install
When loading a registry from the route with auth="none" and where module
'website' is set as 'to install', request.env will be None, and install will
crash as follows:

Error:-
AttributeError: 'NoneType' object has no attribute 'context'

reference of previous commit-
https://github.com/odoo/odoo/commit/0ebf849b8e0de33d3b6e7e06c66189591dc7a72c

sentry-42474563

closes odoo/odoo#136096

X-original-commit: ca43e03e6f510520e874b2a8bba092ac9a7f2453
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-09-21 12:25:13 +00:00
Xavier Morel 62d3e1a1a3 [FIX] crm: incorrect field name as expression source
PR #105873 added computed indexes on the `mobile` and `phone` commits
for the benefit of `phone_mobile_search`, however it created both
indexes to work on the `phone` field as source, rather than whichever
field they were named after and partial for. As a result, the index
has no effect when searching on `mobile`.

closes odoo/odoo#135878

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-09-21 08:59:47 +00:00
snd 1e6baf4909 [IMP] mrp: filter production orders on component availability
Added a search function on components_availability_state to enable a filter in the search_view of mrp.production.
task 3395161

closes odoo/odoo#129933

Related: odoo/upgrade#5066
Related: odoo/enterprise#44699
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-09-21 08:59:43 +00:00
snd 4ac541ba9b [FIX] repair: correctly select repair lines
With the removal of the repair.line model, we must now use the stock.move model instead.
The smart button on stock.lot should only show repair orders where the related product is used as a component however it shows all repair orders containing the product.
Now, it will correctly only select repair orders where the product is a component based on the repair_line_type of the stock.move.
Also renamed repair_order_ids and repair_order_count for easier differentiation with new fields.

Part-of: odoo/odoo#129933
2023-09-21 08:59:42 +00:00
snd abe429ca57 [IMP] mrp: planning with components availability
added a contextual action to call action_plan_with_components_availability()
if each component line of a production order has a forecast_expected_date,
the date_start of the production order will be the latest forecasted date
task 3395161

Part-of: odoo/odoo#129933
2023-09-21 08:59:42 +00:00
snd 7230d53964 [IMP] repair: smarter smart buttons
Added a todo count field on the button where the lot is the product being repaired.
Changed the texts to better fit the buttons.

Part-of: odoo/odoo#129933
2023-09-21 08:59:42 +00:00
Nicolas Seinlet 507cc6c017 [IMP] mail: improve blacklist search performance
When the blacklist table is filled with multiple thousands of records
searching the `is_blacklisted` field leads to a domain like
`[('id', 'in', [thousands_of_ids])]`. This can create a multiple megabytes
sql query.

Using inselect allows to avoid that issue.

Task-3328210

closes odoo/odoo#136089

X-original-commit: e00dce5edc1e4e0452a9add775ef46a1c993a17a
Related: odoo/enterprise#47677
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-21 07:40:08 +00:00
Shubham Thanki 6ca91cea77 [FIX] website_slides: update Vimeo description
Before this commit:
- Select a course from the website, and click 'Add Content'.
  From the 'Add Content' window, click 'Video'.
- The description with the title 'On Vimeo' is not up to date with
  Vimeo privacy management.

After this commit:
The description is now up to date.

task-3458724

closes odoo/odoo#136083

X-original-commit: 4a1d2a2726ce83edbf28dd478c60a3e6f67d4470
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-21 07:40:06 +00:00
dasz 45ac2970b0 [IMP] hr_skills_survey: add certifications report
This report allows an HR manager to quickly see the status of employee's certifications
red: expired, yellow: expiring in 3 months or less. There are also 2 filters for those
situations.

task 3384857

closes odoo/odoo#126438

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-09-21 07:40:04 +00:00
Florian(flg) 744f5791bb [FIX] account: Fix reload template from chart template
All account.tax weren't delete when we reload the chart template.
It was caused by the fact that we forgot to add the active_test=False
in the context to delete all the taxes (and not only the actives).
This thing caused an issue where an sql constrains was trigger.

This fix comes from another PR (https://github.com/odoo/odoo/pull/132360)
that doesn't solve properly the issue.

closes odoo/odoo#136081

X-original-commit: a92f347318415492357413c577e666785c2cb8a4
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-09-21 06:31:02 +00:00
abd-msyukyu-odoo 657314adb1 [IMP] web: draggable_hook_builder option to ignore selectively
The way the `ignore` property is implemented means that nested draggable
elements under a single element matching the `ignore` selector will all be
disabled.

In Knowledge, the sidebar allowing to move articles around has nested draggable
elements that the user should be able to move around, under other draggable
elements that should stay in place (depending on access rights).

Therefore, this commit introduces another way to disable dragging with the
`preventDrag` property which is a function that receives the dragging candidate
and returns a boolean to indicate whether the element can effectively be dragged
or not in its current situation.

task-3456741

closes odoo/odoo#135981

X-original-commit: eb302dbf48500b2eee61a0efb865868866fb454b
Related: odoo/enterprise#47640
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Damien Abeloos (abd) <abd@odoo.com>
2023-09-21 06:31:01 +00:00
Gaetan Vanden Bergh (gavb) eeebe32bd0 [FIX] *: assertAlmostEqual parameters identification
purchase_stock, point_of_sale

What are the steps to reproduce your issue?
When Odoo.sh runs unit tests on a development branch,
it tests the code in the MRP module for rounding errors.

What is the current behavior that you observe?
I had a customization that introduced a rounding error in the standard MRP module.
When the unit tests ran on the development branch, I got a traceback.

What would be your expected behavior in this case?
The rounding error should be reported as a failed test with a message. No traceback.

opw-3454998

closes odoo/odoo#136052

X-original-commit: c4b5148be0819eeef8ce7e12cdc7f1d45174fe65
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Gaetan Vanden Bergh (gavb) <gavb@odoo.com>
2023-09-21 05:23:26 +00:00
Alexandre Kühn c191f94b43 [IMP] website: enable livechat button in website preview
The livechat button was disabled in website preview because
its implementation could not properly handle being in an iframe
inside the backend [1].

With the public livechat code being refactored to use discuss code,
this is no longer a problem, so the livechat button can be present
again. This also makes previewing the website more correct: the
livechat button is actual present on the website, so hiding it was
a lie.

By re-enabling the livechat button, this also allow to remove the
test coverage by a tour, which was sometimes failing on runbot due
to tour being small and doing `im_livechat/init` rpc after the end
of the tour.

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

runbot-24631

closes odoo/odoo#135913

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-20 18:19:50 +00:00
Benjamin Hanquin (beha) e5a6a4f48a [IMP] website: filter out unpublished records for non internal users
Issue:
Search on website has a big performance issue because the database has
too many product_template.

Analyze :
The website search mechanism has hardcoded sql query. And the generic
query don't have any filtering. Which lead to make a expensive search
(similarity) on the whole product_template even if the products are
not published and then displayed to the user.

Fix :
Filter the is_published field in the generic website method when the
model has a 'is_published' field and the request is not done by a user
(thus for customers or portal users).

Note:
The internal user is still able to search on unpublished product.Thus
have no performance improvement.

Benchmark:
| SQL Query | # Input data | Before PR | After PR |
|:---------:|:------------:|:---------:|:--------:|
|General best_similarity |700000 products (161 published) | 12.65 s | 0.12 s |
|FROM ir_translation|2,796,000 ir_translation | 6.338 s (586k hit) | 0.091 s (185 hit) |

Related task:
task-3473786

Related ticket:
opw-3418457

closes odoo/odoo#136080

X-original-commit: fcb968836a2d0e49516fe3ecb23dde61f4597749
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-09-20 17:18:10 +00:00
Brice bib Bartoletti 342c88e5ef [ADD] {l10n_}account_edi_ubl_cii{_tests}: OIOUBL export
The aim of this commit is to support OIOUBL format export in order to comply
with the Danish accountancy act.

Before this commit:
OIOUBL isn't a supported format in Odoo

After this commit:
It is possible to generate oioubl document for invoice and credit-note

Current limitation:
- Payment Terms: will be left empty
- Payment Means: will always be 'unknown'

Documentation:
oioubl official website: https://oioubl.info/classes/en/index.html
List of documentation: https://oioubl.info/documents/en/documentoverview.html
OIOUBL Schematron validator: https://rep.erst.dk/git/openebusiness/common/-/tree/master/resources/Schematrons/OIOUBL
Downloadable ressources: https://rep.erst.dk/git/openebusiness/common/-/tree/master/resources
Validation:
https://www.oioubl.info/validator/default.aspx
https://ecosio.com/en/peppol-and-xml-document-validator/

closes odoo/odoo#136072

Task-id: 3326977
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-09-20 17:18:09 +00:00
Brice bib Bartoletti 04a30d8091 [IMP] {l10n_}account_edi_ubl_cii{_tests},l10n_{ro,sa}_edi: add standard fields on UBL 2.0
The aim of this commit is mainly to add optional standard node directly
on UBL 2.0.
This will allow national customization of ubl to be easier to implement.

List of modification:
- Add the following nodes:
    - AddressFormatCode
    - BuildingNumber
    - PlotIdentification
    - CitySubdivisionName
    - Name under TaxScheme
    - DocumentTypeCode
- reduce zatca customization
- add attrs to several place to ease customization of attributes
- add a hook from which customization can override all decimal places to
  enforce a maximum
- add a hook to ease the modification of the `legal_monetary_total_vals`
  sub dict
- add method to allow customization to provide attributes for
  DocumentTypeCode node.

Notes:
Regarding PlotIdentification and CitySubdivisionName, I decided to not
populate some of those field for now because I didn't think of a
reliable way to get their value while zatca benefits from fields created
in l10n_sa_edi.

Task-id: 3326977
Part-of: odoo/odoo#136072
2023-09-20 17:18:09 +00:00
Brice bib Bartoletti 7e8c0846a5 [REF] account: test common improve readability
The stupid aim of this commit is to remove one line.
The smarter goal of this commit is to add a "/" for the root node and
improve the code readability.

Context:
I made an initial modification to this function and created an `AccountTools`
class. Then Laurent was bothered and changed some stuff thus the initial
commit isn't required anymore.
As he isn't bothered anymore and has too much peace of mind at the moment, I
have the responsability to entertain him to keep his brain at its full
capacity for the sake of Odoo's future.

Before the commit:
The code is complicated and LAS is in peace.

After the commit:
The code is sexier and Laurent keeps his brain sharped and entertained.

Task-id: 3326977
Part-of: odoo/odoo#136072
2023-09-20 17:18:09 +00:00
Brice bib Bartoletti 936629a51f [REF] account_edi_ubl_cii: _check_required_fields
The aim of this commit is to make method `_check_required_fields`:
- works with dict
- make the docstring more explicit

Context:
Docstring states that it works with dict and record

Before the commit:
The method was crashing when used with dict if the key wasn't in the dict

After the commit:
The method works with dict without crashing

Task-id: 3326977
Part-of: odoo/odoo#136072
2023-09-20 17:18:09 +00:00
Brice bib Bartoletti c1df741b36 [REF] account_edi_ubl_cii: remove deprecated method
The aim of this commit is to remove a deprecated method that should have
been removed in master

Task-id: 3326977
Part-of: odoo/odoo#136072
2023-09-20 17:18:09 +00:00
Tiffany Chang (tic) 1db43edebb [FIX] mrp: correctly set consumption warning values
Previous fix odoo/odoo#121602 did not correctly handle the case when not
all of the qty to manufacture is manufactured (the qtys to change to
were miscalculated in this case).

Additionally, it missed fixing a few more use cases when setting the
qtys to match the wizard's lines/qtys:
- if the UoM of a MO's component line is changed => the correct qty was
  not correctly converted into the move.product_uom's qty (now it is)
- if a component's move is deleted before the MO is confirmed => the
  move (i.e. the missing component) was not correctly added back into
  the MO (now it is)
- if there are 2 MO component moves with the same product => both were
  set to the same "correct qty" value (now we only set the first move to
  that qty, others are set to 0 since we have no way of knowing how to
  distribute the qtys otherwise)

Also, since an UserError needed to be added in case of a missing comp
move for a tracked product, existing error logic has been updated to
list all applicable products and the message has been improved to be
more helpful.

Note that the fix for saas-16.4 and earlier is slightly different from
this fix due to the change in how stock move original demand qtys no
longer change like they used to (see: odoo/odoo#130342) and because a
backorder bug was also exposed by this change.

closes odoo/odoo#135796

Task: 3456604
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-09-20 14:36:56 +00:00
Valeriya(vchu) f0a3dc949f [REV][IMP] payment_{}: remove create from payment provider form
This reverts commit 5fd345e.
The duplicate option was removed but it should be available.

closes odoo/odoo#136014

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-09-20 13:03:15 +00:00
Géry Debongnie 08dec02ea0 [IMP] web: prevent jquery from throwing error at start
To test which browser is currently running, jquery performs some checks
when it starts, by doing invalid queryselectors. Depending on which
selectors crashes, it can determinate if it is running in an old browser
and need to activate some part of the code to support them.

This would not be a big deal, except that it makes the life of some
developers much more difficult: we can no longer easily reload a page
with a "Pause on exception" setting to debug odoo. Doing so works, but
the workflow is polluted by 3 errors initially.

It is so common that I propose to simply remove the checks. This should
be acceptable, since Odoo does not work on old browser versions anyway

We are talking about firefox 5, opera 11 or "Gecko", for a commit that
is at least 11 years old

closes odoo/odoo#136013

Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-09-20 13:03:14 +00:00
Benoit Socias 5de18b8cab [FIX] website_blog: prevent edition of blog social media links
Steps to reproduce:
- Go to `/blog`.
- Enable "Show Sidebar" in the "Customize" menu.
- Edit the page.
- Click on an icon of the "Follow Us" section of the sidebar.
- Click on the "Link" icon of the editor toolbar.

=> An error popup appears.

In further versions, the link parameters can be edited - but they are
lost upon save.

The social media links sections of the blog and blog post pages is
generated and is not supposed to be editable.

This commits makes these social media links sections non editable.

If a user needs to configure such a content specifically, it can be done
inside the "About Us" section of the sidebar above.
E.g.:
- Deactivate the "Follow Us" section from the "Customize" menu.
- You can use copy/paste to duplicate the existing style of the
"About Us" section if you want.
- Click on the "File / Image" icon of the editor toolbar (or type
"/image" to use the Power Box as of 15.0).
- Select a pictogram.
- Click on the "Shape: Circle" icon of the editor toolbar.
- Select the "Font Color" from the editor toolbar.
- Click on the "Link" icon of the editor toolbar to specify an URL.

opw-3450880

closes odoo/odoo#135980

X-original-commit: 27d8633c73106b7278eda7d07c9fce370d29784a
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-09-20 13:03:12 +00:00
Benoit Socias e2905c4cfd [FIX] website_blog: locate tweet and comment elements within iframe
Since the website page preview is within an iframe, the selector used to
neutralize some events during edition of blog pages were not targetting
the elements anymore.

This commit makes the elements looked up within the iframe.

opw-3450880

Part-of: odoo/odoo#135980
2023-09-20 13:03:12 +00:00
kasp-odoo d8931675f4 [IMP] l10n_in_edi: negative discount now allowed
Before this commit:
Negative discounts could be applied to products, which is not allowed
in Indian EDI.

After this commit:
Applied conditions to check for negative discounts and raise an error in case of
such discounts.

task_id: 3293247

closes odoo/odoo#135790

X-original-commit: fb1352bc1937d54183173c57094b5b176525d8d6
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-09-20 13:03:11 +00:00
Julien Van Roy cdd29dfe98 [IMP] l10n_mx: add l10n_mx_tax_type on tax
Add a selection field `l10n_mx_tax_type` on account.tax. This field is
used in the CFDI attachment. This allows to avoid relying on the name of
the repartition line tags to export and import a CFDI.

task-3388347

closes odoo/odoo#135215

Related: odoo/enterprise#47321
Related: odoo/upgrade#5136
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-09-20 13:03:07 +00:00
dise 95e31691a7 [IMP] project: add company specific stages
Adding a company_id field in project.project.stage will allow companies
to have their own individual stages, which was not possible before since
all the stages were shared between all companies.

task-3330285

closes odoo/odoo#122597

Signed-off-by: Vincent Larcin (vila) <vila@odoo.com>
2023-09-20 13:03:03 +00:00
vlst 2c3a88e40e [REF] point_of_sale: handle dblClick
In the ticket screen the user has the option to double click on an
order in order to continue editing it. This functionality is implemented
using custom code for handling the double click. This is cumbersome and
error prone.

In this PR we replace the custom double click logic with the default
`t-on-dblclick` from `owl`.

closes odoo/odoo#135856

Task: 3512282
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-09-20 11:34:08 +00:00
Romain Derie f8bba6b9bc [FIX] website, *: add missing _lt and missing .pot entries
This commit fixes this error:
- The IMP done at [3] added a lot of fields but all of those forgot the
   `_t()`/`_lt()` translation.

Note that:
1. A fix to replace `_t` by `_lt` was done at [4] but it was badly done
   as it was not targetting the correct version... and only fixed one of
   many occurences.
2. In this forward port, using `_t()` seems to be working again, using
   `_lt()` is not required anymore. This part of the PR has been removed
   here. For tracking purpose, here was the other bug:
   - The form registry fields added in [1] and [2] in Odoo 13 had a
     `string` attribute translated with `_t()` while now it should be
     translated with `_lt()`. It was surely working in Odoo 13 but not
     anymore. It's not worth investigating to be sure.
   - Not needed since a recent commit which removed `_lt()` (it's a
     deprecated alias to `_t()` which now handles the lazy translation
     directly too.

[1]: https://github.com/odoo/odoo/pull/32565
[2]: https://github.com/odoo/enterprise/pull/4063
[3]: https://github.com/odoo/odoo/commit/617eba941785aa680edb826e14b0009637d60dee
[4]: https://github.com/odoo/odoo/commit/2be83cae7bcda369ed5bc7806aef845c6c76e687

opw-3471873

closes odoo/odoo#134238

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-09-20 11:34:07 +00:00
Victor Piryns (pivi) 19e3123dc0 [FIX] project: handle limit=None on tags name_search
Issue:
After 213b6885312f3da3bf5bff995861758a1afcde76, some custom filters
on tags can throw a stacktrace.

Steps to reproduce:
- Install Project
- Project > Custom Filter > Tags contains 'Internal'
- Stacktrace

Cause:
When `limit=None`, which is explicitly set when creating custom
filters, the `name_search` crashes when comparing an `int` (the len
(ids)) with the limit which is `None`.

Fix:
Elaborate the condition to handle the case when `limit=None`.

Affected versions:
16.0 up to master

Reference:
opw-3510309

closes odoo/odoo#135982

X-original-commit: 5aefba4399f25e4e3cd3c205e0a6511173dffd11
Signed-off-by: Audric Onockx (auon) <auon@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2023-09-20 10:02:11 +00:00
Joseph Caburnay 570bc47964 [FIX] pos_loyalty: free product rewards for order type rules
The `_computeUnclaimedFreeProductQty` method was not properly computing
reward quantities for order type rules. This commit fixes the
computation to handle order type rules separately, allowing free
product rewards to be granted as expected.

The computation now also takes into account which rules were actually
used when calculating points. It will ignore any rules that were not
used in the points calculation when determining free product rewards.
This ensures the rewards match the rules that contributed to points
for the order.

opw-3492083

closes odoo/odoo#135972

X-original-commit: ff22b2cce65d324dc73295bc85a2469d42e3b82f
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-09-20 10:02:10 +00:00
Dylan Kiss (dyki) 3a5fc92c34 [IMP] l10n_dk: force lock of sales and purchase entries
Following new regulations in Denmark, we need to prevent users from
modifying posted entries in sales and purchase journals.

By using a forced hash on the journals we do just that.

task-3497062

closes odoo/odoo#135202

Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-09-20 10:02:09 +00:00
aliya eda26992b9 [IMP] l10n_co: Enhance names & translation on tax names
Before the change

- Tax Names were not intuitive or easily understandable for the users, it was hard to relate which tax was referenced with each name.
- The Name didn't include the spanish translation, regardless the name is encoded now, it should be encoded based on the spanish description.

After the change:

- Tax names(codes) both in English and Spanish are more intuitive and easier to understand for the users.
- Tax names have better matching with the description.

task-3475793

closes odoo/odoo#132837

Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-09-20 10:02:07 +00:00
William Henrotin 03e80c13d6 [IMP] stock: 'pick from' quants reservation
Choosing a quant to populate a new stock move line set the quantity done
and the reserve quantity to ensure it stay available to this particular
stock move and not empty by another picking

closes odoo/odoo#124409

Task: 3256447
Related: odoo/upgrade#5139
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-09-20 10:02:05 +00:00
William Henrotin fc326082c8 [FIX] stock: hide reset to draft button when no needed
Only immediate transfers should have the ability to reset the state to
draft. Also rewording it as "Plan" as the goal of this button is to left
the stock move to be done later and impact the forecast

Task: 3256447
Part-of: odoo/odoo#124409
2023-09-20 10:02:05 +00:00
William Henrotin fc716160d2 [FIX] stock: check availability in immediate transfer
Show "Check availability" in immediate transfer too to prefill the stock
move lines

Task: 3256447
Part-of: odoo/odoo#124409
2023-09-20 10:02:05 +00:00
William Henrotin 501274f0b3 [IMP] stock: generate serial popup
In order to reduce the amount of RPCs in the detailed operation view.
The two wizards to populate the stock move line one2many with lot/serial
number to create are replaced with twos Owl dialogs.
only one RPCs is done to generate the stock move lines values from
either a serial number + a count or a list of lots name

Task : 3256447

Part-of: odoo/odoo#124409
2023-09-20 10:02:05 +00:00
William Henrotin bcad62e049 [IMP] stock: remove compute move without packages
The move without package as computed field bring some issue with the "no
save detailed operation" feature. Creating a stock move and directly add
some move lines without saving do not call
`set_move_ids_without_package`

Task: 3256447
Part-of: odoo/odoo#124409
2023-09-20 10:02:05 +00:00
William Henrotin 4da8c6ebca [IMP] stock,mrp: detailed operation without RPCs
This commit replaces the opening of the stock moves detailed operation
wizard by the one2Many record preview. This means creating a move in a
picking is still done via a new line but the edition is done via the
`fa-list` button that open the record in the web client. The goal is to
reduce the RPCs call as much as possible. The stock move lines data are
stored in the stock move record until the picking save.

Additionally, this commit change a bit the immediate transfers flows.
The stock move show only initial demand (`product_uom_qty`) but the
column wording is still "Done". In the detailed operation view, the
stock move line `qty_done` is displayed as "Reserved".
At picking validation, the user is expected to enter the same quantity
in `product_uom_qty` and `quantity_done`. If `product_uom_qty` is equals
to 0, the done quantity is used as actual transfer quantity. If
`product_uom_qty` is different than 0 but small than the done quantity,
an error is raised.

Task: 3256447
Part-of: odoo/odoo#124409
2023-09-20 10:02:05 +00:00
Paolo Gatti (pgi) 3d9cef5ead [IMP] l10n_it: Unnecessary precaution about Fiscal Positions note
The condition for which the Fiscal Position's Note is shown only in Customer Invoices is removed because unnecessary.
A check has been added on the company's country to be 'IT'.

Task link: https://www.odoo.com/web#id=3420752&model=project.task
task-3420752

closes odoo/odoo#135966

X-original-commit: c32720dbd4df60fd9e8e10d3893501e006130d8d
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-09-20 08:36:42 +00:00
Romain Derieandstefanorigano (SRI) d0885afa62 [IMP] website: better vertical align and horizontal spacing in systray
---- Horizontal spacing issue ----

The horizontal spacing between systray items in the patched website
systray is too small. It was using the regular margin of the default
Odoo systray which is composed of almost only icons for which a small
spacing is what we need.
But the website patched systray contains a lot of text, where we want a
bigger spacing, exactly how we do for the app menus.

---- New class on systray ----

To target the website systray in scss, a new class was added on it.
There is no clean way in JS to add that class, as the website systray
patch is only altering the method in charge of returning the systray
items. The rest is left up to the base NavBar class component, including
rendering.
That NavBar component does not come with a built in way to add a class.

We could have targeted the DOM directly in the patch through
`this.root.el` and added the class in JS directly but that seems like an
owl anti pattern.

---- Vertical align issue ----

Before this commit, the btn in the systray didn't have the same line
height as other elements: both the "Edit" (in main lang) and "Translate"
(in alternate lang) buttons had a (1-2px) vertical alignment issue.

This was because, despite having the same font style and font size, they
had a different line-height making it glitch 1-2px vertically.

It's a bit less visible for the Edit button as there is a pencil icon
between this text and the text next to it.
For the translate button, it's quite visible directly.

For testing purpose, you can simply remove the icons and the left-right
margins of those systray items so the text are glued to each other and
you clearly see the misindentation.

---- Misc ----

For tracking purpose, there is multiple cases to be tested regarding
those buttons:
- Community vs Enterprise (where those are colored)
- Regular mode vs translate mode

closes odoo/odoo#135956

X-original-commit: 066e4a1ddd9faf7ba866c5428c943b5af8115191
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: "stefanorigano (SRI)" <sri@odoo.com>
2023-09-20 08:36:41 +00:00
abd-msyukyu-odoo ed0bf2baec [FIX] base: filled week groups should be dependent on the locale
How to reproduce:
- open CRM > Forecast
- group by Expected Closing > Week

Current behavior:
- some week numbers appear multiple times

Expected behavior:
- each week should only appear once

Technical explanation:
Since [1], week groups are dependent on the locale, but the
`_read_group_fill_temporal` method was not updated to also produce groups
dependent on the locale.

[1]: https://github.com/odoo/odoo/pull/93053

task-3478451

closes odoo/odoo#135952

X-original-commit: 980786e301bdf80a9a39260a95359431c5cb5e86
Signed-off-by: Damien Abeloos (abd) <abd@odoo.com>
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-09-20 08:36:40 +00:00
Touati Djamel (otd) 406102a329 [FIX] repair: clean default keys from context before creating stock.move
Steps to reproduce the bug:
- Create a storable product “P1”
- Create a Transfer:
    - Operation type: delivery order
    - Product: “P1”
    -  Validate the delivery
- Create a return of the delivery:
    - Confirm and validate the return
    - Create a repair order from the delivery
    - Set the product “P1”
    - Confirm, start and end the repair

Problem: A stock move is created when the repair is completed, but it's
linked to the return picking what is wrong. When a 'repair' order is
created, the 'default_picking_id' is passed into the context to be set
in the 'repair.order'. Consequently, when the repair is completed and
the stock move is created, the context isn't cleared, leading to the
utilization of the 'default_picking_id':
https://github.com/odoo/odoo/blob/5d25900cd88ebc1fd16b0bd6ebba4602a13e9d76/addons/stock/models/stock_move.py#L317

In the button, no context is passed as a parameter:

https://github.com/odoo/odoo/blob/86aa7b78aadee5747c93b4bd27046cfaed1e438d/addons/repair/views/repair_views.xml#L36

opw-3269813

closes odoo/odoo#135939

X-original-commit: 558c647d5c70f7729c663ec3d45fb0cae813db04
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-09-20 07:21:11 +00:00
Xavier Morel 4fec630081 [FIX] base: correctly check debug mode when formatting access errors
Intent of checking `group_no_one` was always to query the advanced
info / debug mode, however when the semantics of group_no_one got
changed in 31518bc09b this site was
missed, and now always displays "advanced" errors for internal
users. Which was not the intent.

Also since we're printing `display_name` and some of them annoyingly
hook onto context variables to show extended information, reset the
context to the user's default in order to avoid such
extended-formatting `display_name`.

Also fix "debug mode" in `TestIRRuleFeedback`, which has been broken
since time immemorial (likely as long as the group_no_one semantics
changed).

closes odoo/odoo#135940

X-original-commit: 9d3ffa6540c07e97b7160167756edd8e71f2308a
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-09-20 06:16:47 +00:00
Julien Carion (juca) 5046fd0ad0 [IMP] web: easier translation for many2one
This commit gathers the different parts of the content from the many2one
confirmation dialog into a single _t in order to facilitate the foreign
translations of the content

closes odoo/odoo#135495

X-original-commit: e97ec328e8c6ec2b083c854b19cefe5c19db3991
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Carion (juca) <juca@odoo.com>
2023-09-20 06:16:46 +00:00
Paolo Gatti (pgi) 67a7fe528e [FIX] l10n_it: VAT Tax groups 4%,5% had 2% name
Fixed copy-paste error from the referenced fw-port PR.

closes odoo/odoo#135933

Ref: odoo/odoo#111312
X-original-commit: f3b7842d59ed9a3f2ea422c38f7935e20fc5e250
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
2023-09-19 17:44:35 +00:00
William Henrotin 3186133064 [FIX] mrp: force readonly=False on compute
Commit 167c51b1f9 makes `use_create_lots`
and 'use_exisitng_lots` computed fields in MRP module but did not mark
them as `readonly=False`. Thus, they were readonly by default for any
picking types.

Also, make sure new reception picking type have their `use_create_lots`
set to True and delivery picking type their `use_existing_lots` set to
True.

closes odoo/odoo#135900

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-09-19 17:44:33 +00:00
odoo 98452d37cb [FIX] web: fix long username in header and milestone issue
Description of the issue/feature this PR addresses:

when logged in user name is too long then it take whole header to display it
name.
In project module, if milestone name is long then name is overflowing.
Current behavior before PR:

whole header is occupied when username is long.
milestone name is overflowing when name is too long.
Desired behavior after PR is merged:

when username is long it would show with '...' format.
when milestone name is long it would show with '...' format.
Fix:

some property is added in oe_topbar_name class to display the username in short
and '...' format.
add some bootstrap class so that long name should be formatted in '...' .
task-3217427

closes odoo/odoo#135899

X-original-commit: 38ac3f21843842937a89ce8c2e07f7b54039348f
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Ravi Bhingradiya (ravb) <ravb@odoo.com>
2023-09-19 17:44:31 +00:00
Adrien Widart (awt) fb20ec841a [FIX] mrp_subcontracting: avoid setting done qty on subcontracted SM
On the backorders, the consumed quantities are incorrect.

To reproduce the issue:
1. Create two products:
   - C01: consumable
   - P01: storable
2. Create a BoM
   - Product: P01
   - Type: Subcontracting
   - Subcontractor: S
   - Components: 1 x C01
3. Create and confirm a planned receipt:
   - From: S
   - 10 x P01
4. Set the done quantity (directly on the tree view) to 1
5. Validate + Backorder
6. On this first backorder, set the qty to 2
7. Validate + Backorder
8. Validate the second backorder
9. Inventory > Reporting > Moves History, filter on C01

Error: There are three SMs, and here are the done quantities: 1, 9
and 7. The second one is incorrect, it should be 2 (see step 6).

Since [1] the done quantity is always editable on the picking's
operations, but the feature is not implemented in subcontracting,
therefore the communication between the MO and the picking does not
work well. For instance, step 4: save the done quantity and open the
MO: nothing changed on it, its producing qty is still zero. Another
example: step 4, instead of setting the done quantity directly on
the picking, open the wizard (the MO), record 3 produced products and
close the wizard. The done quantity of the stock move is 3 but the
user can still edit it. However, if he tries to update the line,
nothing will change on MO side.

On top of these "little" bugs, it may lead to a more important one
as shown in the above use case. Step 5: at some point, we split the
MO to generate a backorder for 9 x P01:
https://github.com/odoo/odoo/blob/c47e4ac7cb5fdd690f40ab2e0f8d022ba565145e/addons/mrp_subcontracting/models/stock_picking.py#L72-L76
And, as shown, the flag `set_consumed_qty` is set to `True`. As
explained in the method description:
https://github.com/odoo/odoo/blob/a2574b45aef1ff6ff3a221b996d0bb0dda2a8c74/addons/mrp/models/mrp_production.py#L1602-L1603
So, because of this flag, the method will create a SML for C01 on
the backorder, with its done quantity set to the reserved one: 9.
However, back to the first block code: `move.move_line_ids` only
contains the SML created at step 4 (i.e., the SML of the inital
SM, with a done quantity equal to 1). As a result, in the for loop,
we only define the producing quantity of the initial MO.

This is a first issue: step 6, suppose the user rather opens the
detailed operations of the line: it displays the new MO, the
producing qty is 0 but the consumed quantity of the component is 9.
This is not perfect, but let's ignore this and continue with the
above steps. The user sets the done quantity to 2 and validates with
backorder. It runs the productions split again, we use the done
quantity as producing one on the MO, but we don't edit the consumed
quantities, hence the error.

For all these reasons, the safer solution is probably to prevent the
feature 'qty done always editable' in case of subcontracting.

[1] cacc677a08066bc23e1c89df36027599d05f2a08

OPW-3441197

closes odoo/odoo#135862

X-original-commit: 049f63fbc1ab09cf75824e5c22508ea091e5c4dd
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
2023-09-19 16:37:21 +00:00