Commit Graph
165329 Commits
Author SHA1 Message Date
Chrysanthe (chgo) fe7dedfbc7 [FIX] account: upload button contrast
=== ISSUE ===

With Milk, our primary buttons received a fresh lifting in term
of design,with different designs according the state the button is in.

Before that, our buttons were green with a white text on it,
and the behavior was identical on `hover`. This allowed us to force
a `color: white` when it was needed, since the background always matched
WCAG contrast standards.

Since the 16.3, these buttons are on a dark background,
and that background becomes light when in `active` state. That means we
cannot use white on these buttons.

=== AFTER ===

We set the color of the link inside the button to `inherit` in order to
fix the active state behaviour.

Note that this should be improved when reworking the widget since having
a link inside a button is not really expected. Instead we should use a
link that allows different actions.

task-3354844
part of task-3326263

closes odoo/odoo#135996

X-original-commit: 572288ccf2244df23c031dd88c47d2807fd06c47
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
2023-09-21 18:27:49 +00:00
Victor Feyens 1d85516d8b [FIX] web: empty filename on binary file deletion
the filename field shouldn't be 'false' but an empty string when
the binary file is deleted.

closes odoo/odoo#135894

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-09-21 18:27:47 +00:00
Victor Feyens 087ff42e3a [IMP] product: stricter documents creation
Do not allow modifying documents types, correctly mark necessary fields
as required, ...

Part-of: odoo/odoo#135894
2023-09-21 18:27:47 +00:00
Victor Feyens 83ab6a87d2 [FIX] sale: new field help
Part-of: odoo/odoo#135894
2023-09-21 18:27:47 +00:00
Victor Feyens cec9dbc8ab [FIX] product: simplify documents list view
Part-of: odoo/odoo#135894
2023-09-21 18:27:47 +00:00
Victor Feyens 6af88b3b6a [FIX] product: documents creation & deletion
1) fix automatic creation of documents when attachments are added
to product templates/variants chatters

2) fix duplication of documents

3) fix deletion of documents

Delete child record before deleting parent record.
Before this commit, when trying to delete a product document,
we deleted the parent record first, before trying to delete
the child, which had been deleted (cascade) already.

Part-of: odoo/odoo#135894
2023-09-21 18:27:47 +00:00
FrancoisGe 895dd1aee2 [REF] mrp: add getGoogleSlideUrl utils
In DocumentViewer, we need to generate google slide urls.
In this commit, we're going to create the getGoogleSlideUrl utility that
generates a google slide url.

closes odoo/odoo#135851

Related: odoo/enterprise#47573
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-21 18:27:45 +00:00
FrancoisGe 0c7ab90b32 [REF] web: remove props in PdfViewerField
The purpose of this commit is to simplify PdfViewerField by removing its
unused props. No use of the "pdf_viewer" widget uses "filename" or "preview_image".

Part-of: odoo/odoo#135851
2023-09-21 18:27:45 +00:00
Florent Aide 0f8eca34fe [CLA] Corporate signature for XCG Consulting
closes odoo/odoo#135447

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-09-21 16:52:12 +00:00
Gorash ba1a5509fa [IMP] base: Remove context dependencies from get_views method
In this viewtiverse, the heroes remove the context dependencies for
`get_views`, from the views and python fields (such as domain). To reduce
inconsistencies and the number of rpc.

Current issues:
* There may be inconsistencies in views at the JavaScript level. Some
overrides modify the behavior of get_views or domains on fields via
context keys, therefore by changing the action, the rendering may be
different. However, these views are cached. However, the cache key
(Javascript) does not reflect the entire context, and requires additional
post-processing from the server.
* Multiple rpc for the same rendering. get_views being dependent on the
context, as soon as it changes, a new rpc is performed. In most cases,
when JavaScript needs the same view, there is no change depending on the
context, the rpc is useless.
* Inconsistency when rendering subviews, some views could be different
depending on the context, this context can be modified in the view itself
via the context attributes. However, the JavaScript client does not redo
an rpc for each change of these sub-contexts. Therefore the result may be
inconsistent.

Solution:
Limit as much as possible the number of context keys provided when calling
get_views, and use the context provided as a cache key. The authorized
keys are 'lang' and '*_view_ref'. For the cache key, options are added in
the get_views method.
Instead of using the context, it is inserted into python expressions.
This will be evaluated by JavaScript and thus avoids inconsistencies.

task-3414108
task-3414068

closes odoo/odoo#135145

Related: odoo/enterprise#47584
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-09-21 16:52:10 +00:00
Adrien Guilliams (adgu) b72b1950d5 [FIX] point_of_sale: demo last order preparation change
This PR resolves a bug in the self linked to the demo data.

Steps to reproduce:

Create a new Restaurant session
Open mobile menu for Restaurant
Make an order in the mobile menu for a table
Reload the page where the open restaurant session is.
[BUG] The ball telling if an order is sent to the kitchen or notbecame black.
[EXPECTATION] The ball telling if an order is sent to the kitchen or not is red.

closes odoo/odoo#134777

Signed-off-by: Robin Heinz (rhe) <rhe@odoo.com>
2023-09-21 16:52:09 +00:00
sofiagvaladze 3b3eb8f4db [IMP] hr_holidays: UX changes to increase usability
In this commit, next to UX changes, we make some changes in order to
increase time off dashboard usability.
In particular, - New Allocation Request - was moved to Time Off Card.
Now user can also ask for specific time off type allocation from
the time-off-card-popover.

Moreover, we fix the following issue:
Previously allocation name was not computed on create. We also fix the
computation of the name, in case time of type is not filled in yet.

With the later change, test_allocation_request test was failing as
first the name field was assigned, then holiday_status_id;
Which caused for the name field to be recomputed and assigned to False.
As the field is required, leave_form.save() was raising an error.

task - 3389144

closes odoo/odoo#132187

Related: odoo/enterprise#47651
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-09-21 16:52:07 +00:00
Anita (anko) a4fb297d32 [IMP] account_payment, sale: show the user's tokens on all portals
Before this commit, each module had its own logic regarding payment
flows in the portal. With this commit, we enforce that if the user is
logged in, they see their tokens, while logged out users see the tokens
of the customer (the contextual partner).

task-2836870

closes odoo/odoo#124631

Related: odoo/enterprise#42999
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-09-21 16:52:05 +00:00
Victor Feyens 0e38237c60 [IMP] sale: avoid 'extra line with down payment' messages
Use a clean message with the downpayment ref directly in the wizard.

closes odoo/odoo#124297

Related: odoo/upgrade#5133
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-09-21 16:52:03 +00:00
Horacio Tellez (hote)andVictor Feyens e08a279afb [IMP] sales: confirm on down payment
Some businesses requires customers to pay a down payment in order
to confirm the order. In the case of odoo today this implies to:
 - sending a payment link
 - waiting & checking if the payment has been done
 - confirming the order
 - creating the down payment invoice
A lot of time consuming manual operations with a high risk of errors.

This commit introduces the functionality for sales orders to be
confirmed on down payments and automatizes the flow to minimize the
errors due to human manipulation.

Task - 3087716

Part-of: odoo/odoo#124297
Co-authored-by: Victor Feyens <vfe@odoo.com>
2023-09-21 16:52:03 +00:00
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