Commit Graph
164725 Commits
Author SHA1 Message Date
lejeune quentin a1bf178ee0 [FIX] point_of_sale: Fix date on iot
With the build of the new iot image we need to fix the date synchronization

closes odoo/odoo#134138

X-original-commit: 41b0edf739f676723b9dab77066296565d6e135d
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2023-09-04 16:09:30 +00:00
Gaetan Vanden Bergh (gavb) bca14070a6 [FIX] mail: No author reply trigger error due to parent message
Steps:
No precise steps:
Send/Receive a email in discuss
Reply to it via email

Actual result: crash due to parentMessage
Expected result: no crash

opw-3480185

closes odoo/odoo#134123

X-original-commit: 743a298089620865d95f725cae8b3e5ffc9a822e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-04 16:09:30 +00:00
Louis Baudoux 76f6257b6e [IMP] crm_iap_enrich,iap_mail,snailmail: improve IAP notification system
The old implementation had some inconsistencies and didn't allow to have
general error notifications, it was only meant for credit error
notifications.

The notification/log messages of lead enrichment were also improved as
some of them were unclear.

closes odoo/odoo#132233

Related: odoo/enterprise#44488
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
2023-09-04 15:02:50 +00:00
divy-odoo cea1cab535 [FIX] *: resolve the last tour step warnings
When we haven't provided a custom action, the tour step runs the default
action. In the final step of the tour, when there is no `run` or
`isCheck` provided, It shows warnings of 'ignoring action (auto) of last
step' as it can lead to a race condition.

This commit resolves the warnings: `ignoring action (auto) of last step`

task-3429500

closes odoo/odoo#129239

Related: odoo/enterprise#46683
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-09-04 15:02:47 +00:00
divy-odoo 443c209ed0 [IMP] web_tour: remove default click trigger on final tour step
When we haven't provided a custom action, the tour step runs the default
action. In the final step of the tour, when there is no `run` or
`isCheck` provided, we don't want to execute the default action as it
can lead to a race condition.

With this commit [1], from saas-16.3 we have refactored the web_tour to
OWL. During the refactoring, it lost the condition initially introduced
by PR[2] that handles the final step of tours.

So this commit,
1. Restored the missing condition.
2. Replaced the simple `console.log()` with a warning, because it's easy
   to miss the log compared to a warning.

[1]: https://github.com/odoo/odoo/commit/3a798039d6f200f8e28448ddb6a2d3c46654a203
[2]: https://github.com/odoo/odoo/commit/9733f6e1ab31abf780a5ad671f700fac883b63ee

task-3429500

Part-of: odoo/odoo#129239
2023-09-04 15:02:47 +00:00
Leonardo Pavan Rocha 064213901b [IMP] calendar: rework recurrence in UI
This commit changes the way we define recurrences from the UI so it's simpler.
Instead of showing the user many options for recurrence like we currently do,
we add a selection field for each rrule (daily, weekly, monthly and yearly)
that sets some default values for the recurrence without the user having to
define each field manually. This change makes the definition of recurrence from
the UI closer to what is done in google calendar. In order to allow users to
define more advanced types of recurrence, we also add a custom option in the
new selection field that will show the old recurrence options to the user.

Additionally, the week days widget defined in web takes too much space, so it
was decided to create an overwrite of this widget for calendar only that looks
cleaner and takes less space. This commit introduces this new widget and
applies it to the calendar event form view.

task-3234677

closes odoo/odoo#116649

Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2023-09-04 15:02:46 +00:00
roen-odoo e28e1a079f [FIX] point_of_sale: Show price without discount in receipt
Current behavior:
When a discount is applied to a product, the receipt shows the price
with the discount applied as the base price.

Steps to reproduce:
- Open PoS
- Add a product to the order
- Apply a discount to the product with the numpad
- Validate the order
- Check the receipt, the base price of the product is the price with the
  discount applied.

(https://github.com/odoo/odoo/assets/32939472/eb0998a7-70a1-432a-8909-868d9307c999)
The price in red should be 70$ (the price without the 5% discount)

opw-3463745

closes odoo/odoo#134045

X-original-commit: d6e4e7c566324de3ef9589b92cacd32d6c386465
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2023-09-04 10:56:09 +00:00
Alexandre Kühn 43882882eb [REF] mail: simplify record deletion in discuss store
Deletion of record requires removing the record entry
in `records`, and it was cumbersome to make a long expression
each time we want to remove the record from this object.
```js
// before
delete this.store.Model.records[record.localId];
// after
record.delete();
```

closes odoo/odoo#134008

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-09-04 10:56:08 +00:00
Alexandre Kühn d94f7e534a [REF] mail: simplify code of Record.insert() when new record
- automatically add `_store` on the record
- automatically register in `records` and return reactive when
  `records` is a obj (array => should keep doing it manually)

Part-of: odoo/odoo#134008
2023-09-04 10:56:08 +00:00
Alexandre Kühn a775b239ed [REF] mail: introduce id & get() on all discuss models
1. Introduce `static id` to all models, to uniquely identify
   a record in a model. This allows normalizing discuss store
   for all models, which helps as preparation for managing
   record deletion. Can also be combined

```js
class Message {
    static id = "id";
    id;
}
class Thread {
    static id = AND("model", "id");
}
```

2. Introduce `Model.get()` to easily get a record of model
   from data that can identify the record. This prevent leaking
   the way the record are stored in `records`, as now all records
   are indexed by localId, and localId is technical detail.

```js
Message.get(messageId);
Thread.get({ model: "discuss.channel", id: 1 });
```

Part-of: odoo/odoo#134008
2023-09-04 10:56:08 +00:00
Dylan Kiss (dyki) 09b8c32e9e [FIX] account: branch management fixes
After feedback on the new branch management feature, there were a few
bugs reported. This commit solves several of them:

- Display the company/branch name of a reconciled payment in the info
  popover when viewing customer invoices and vendor bills. This way you
  can see why you don't have access to the payment e.g.
- Make it possible to select the taxes of the parent company when
  creating moves in a branch.
- Allow users with only access to a branch to open the Accounting app.
  The dashboard would fail with a security error before.

task-3461421

closes odoo/odoo#134000

X-original-commit: 92d261d9a3f64fcbb01023e680d362b598061707
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Dylan Kiss (dyki) <dyki@odoo.com>
2023-09-04 10:56:06 +00:00
Atul Patel f740f590f4 [FIX] l10n_tr: remove deprecated chart template method ref
As rewrite the whole chart template mechanism,
From here: https://github.com/odoo/odoo/commit/512574861691f425ec6a17f20fe4b586bb88a299
we need to remove chart template reference from
localization module. some of them are remaining.
so removed from Turkey, Turkey localization in migration
script otherwise we got this error:

```
File "/home/odoo/src/odoo/saas-16.3/addons/l10n_tr/migrations/1.1/end-migrate_update_taxes.py", line 2, in <module>
from odoo.addons.account.models.chart_template import update_taxes_from_templates
ImportError: cannot import name 'update_taxes_from_templates' from 'odoo.addons.account.models.chart_template'
 (/home/odoo/src/odoo/saas-16.3/addons/account/models/chart_template.py)
```

closes odoo/odoo#133463

X-original-commit: 57a32afb534f18022d632b03a39a316bce2817ab
Signed-off-by: William André (wan) <wan@odoo.com>
2023-09-04 10:56:06 +00:00
Odoo's Mergebot c6fc061ca7 [IMP] web: add useSortableList hook to utils
Purpose:
-
The `useSortableList` hook introduced to replace the usage of the jquery library "nestedSortable" in knowledge's sidebar is moved to web so that it can be used in documents to allow the reordering of folders in the search panel (see the [related enterprise PR](https://github.com/odoo/enterprise/pull/45729))

Some tests have been added, as well as small fixes in the hook that were pointed out by adding these tests, notably:
- the moves are now triggered based on the position of the top of the dragged element instead of the position of the cursor (behavior was unclear when moving long elements)
- when nesting is allowed, moving an element under another one that does not have nested elements now inserts the placeholder after the element instead of nesting it inside of it.

Task-3422012

closes odoo/odoo#131769

Related: odoo/enterprise#45729
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-09-04 10:56:05 +00:00
Adrien Schoffeniels 484570e65b [IMP] web: add tests for useNestedSortable hook
Purpose:
--------
This commit adds QUnit tests for the `useNestedSortable` hook.

This commit also fixes a few issues in the hook that were pointed out by
adding these tests, notably:
- the moves are now triggered based on the position of the top of the
dragged element instead of the position of the cursor (behavior was
unclear when moving long elements)
- when nesting is allowed, moving an element under another one that does
not have nested elements now inserts the placeholder after the element
instead of nesting it inside of it.

It also renames the `listType` parameter to `listTagName` to make its
purpose clearer, and moves the placeholder styling to a custom class so
that it can be customized more easily.

Task-3422012

Part-of: odoo/odoo#131769
2023-09-04 10:56:05 +00:00
Adrien Schoffeniels 20cd86d464 [IMP] web: rename useSortableList hook to useNestedSortable
Purpose:
--------
Rename the hook to better reflect its main behavior.

Task-3422012

Part-of: odoo/odoo#131769
2023-09-04 10:56:05 +00:00
Adrien Schoffeniels 4db24cbedd [MOV] web: move useSortableList hook to web utils
Purpose:
--------
The `useSortableList` hook introduced to replace the usage of the jquery
library nestedSortable in knowledge sidebar is suitable for the sidebar
in documents, which currently does not allow to move a folder between
other folders.

The hook is moved to web so that it can be used in both modules

Task-3422012

Part-of: odoo/odoo#131769
2023-09-04 10:56:05 +00:00
Julien Alardot (jual) 3c216395b1 [IMP] product,hr_expense: product.product kanban view
- Updates the product.product kanban view so that it matches
the product.template one.
- Fixes the favorite button
- hr_expense also requires the cost to be shown

task-3457035

closes odoo/odoo#131208

Signed-off-by: William André (wan) <wan@odoo.com>
2023-09-04 10:56:02 +00:00
Preksha Chouhan 6d6ead7d99 [FIX] hr_expense: prevent traceback while user delete any 'hr expense' product
When user delete product in 'hr_expense' module that is present in the demo data
of 'sale_expense'. While installing 'sale_expense' module the user is getting
error as the product that is referenced from 'hr_expense' has been deleted.

Steps to produce:
- Install hr_expense module.
- Delete all expenses.
- Go to configuration and then Expense Categories.
- Delete any category between 'Meals', 'Mileage', 'Travel & Accommodation' and
   'Communication'.
- Install 'sale_expense' module.

Traceback will be generated.

Applying this changes will resolve this issue.

sentry-4113713209

closes odoo/odoo#121752

Signed-off-by: William André (wan) <wan@odoo.com>
2023-09-04 10:56:01 +00:00
Pedram (PEBR) bce80def3a [FIX] point_of_sale: improved GS1 Barcode Recognition for PoS
Before this commit, when a regular barcode, like '3700000000370', which
could be interpreted using GS1 rules, was scanned in PoS, it was
incorrectly identified as a GS1 barcode even though it didn't contain
a product reference. This commit addresses this issue by implementing
a validation check during barcode scanning. The system now verifies
whether a scanned barcode conforms to GS1 rules and contains a product
reference. This ensures accurate barcode recognition.

opw-3468158

closes odoo/odoo#134069

X-original-commit: a62a9ef5f3a0067ed5eb772f850f6ef0fefb6821
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-09-04 09:19:19 +00:00
Pedram (PEBR) f1c67e5be1 [FIX] point_of_sale: scanning barcode should not update available_in_pos
Prior to this commit, when limited product loading was enabled,
scanning a product that had not been loaded yet would trigger a search
for the product without taking into account the available_in_pos field,
and it would also set available_in_pos to true.

This commit ensures that when a product is loaded using its barcode,
the behavior aligns with the changes introduced in this
commit: https://github.com/odoo/odoo/pull/87329/commits/a83c7aea37b06e8b1f04f1f02982ff577d7058e9

opw-3463427

closes odoo/odoo#134038

X-original-commit: 4fee329af13d9335f743aae39ff1a4b6ad4ee0f5
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-09-04 09:19:16 +00:00
Mahdi Cheikh Rouhou (macr) b580444adc [FIX] web : save chatbot lines without error
Iusse:
======
When you update a chatbot a line and then save the chatbot form it will
throw an error.

Steps to reproduce the error:
=============================
1-Go to Live Chat/configuration/Chatbots and select one
2-update one line in the script (add some letters in one name)
3-save the chatbot form

Problem:
========
Some fieldName doesn't exist in the list of fields.

Solution:
=========
Swapped the values in the assign in duplicateDataPoint.

opw-3454514

closes odoo/odoo#134024

X-original-commit: 4ce57085b302957e2c260183f05f534160fa7ea4
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-09-04 09:19:15 +00:00
Bruno Boi fde29ed157 [IMP] web: bump luxon lib from 3.0.1 to 3.4.2
**Changelog**

**3.4.2 (2023-08-26)**

- Fixes regression from 3.4.1 (moment/luxon#1493)

**3.4.1 (2023-08-23)**

- Fixes for regressions from 3.4.0
  (moment/luxon#1482 and moment/luxon#1488)

**3.4.0 (2023-08-08)**

- Fix type checking on input zones
- Fix Islamic months listing
- Fix normalize() for negative inputs

**3.3.0 (2023-03-03)**

- Fix off-by-one in Interval#count (moment/luxon#1308)
- Support formatting for custom zones (moment/luxon#1377)
- Fix parsing for narrow spaces (moment/luxon#1369)
- Handle leap year issue with AD 100 (moment/luxon#1390)
- Allow parsing of just an offset

**3.2.1 (2023-01-04)**

- Fix for RFC-2822 regex vulnerability
- Better handling of BCP tags with -x- extensions

**3.2.0 (2022-12-29)**

- Allow timeZone to be specified as an intl option
- Fix for diff's handling of end-of-month when crossing leap years
  (moment/luxon#1340)
- Add Interval.toLocaleString() (moment/luxon#1320)

**3.1.1 (2022-11-28)**

- Add Settings.twoDigitCutoffYear

**3.1.0 (2022-10-31)**

- Add Duration.rescale

**3.0.4 (2022-09-24)**

- Fix quarters in diffs (moment/luxon#1279)
- Export package.json in package (moment/luxon#1239)

**3.0.2 (2022-08-28)**

- Lots of doc changes
- Added DateTime.expandFormat
- Added support for custom conversion matrices in Durations

closes odoo/odoo#133599

Related: odoo/enterprise#46556
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-09-04 09:19:11 +00:00
Gaetan Vanden Bergh (gavb) b959eb5525 [FIX] mail: No author reply trigger error due to avatar
Steps:
No precise steps:
Send/Receive a email in discuss
Reply to it via email

Actual result: crash
Expected result: no crash

opw-3480185

closes odoo/odoo#133370

X-original-commit: 298be6b3762d24883f5019e094425ab8fbdd95e0
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-04 09:19:09 +00:00
Samuel Degueldre 910897fc97 [REF] web, *: remove tempusdominus date(time) picker lib
As tempusdominus relies on jQuery, we have written our own date(time)
picker in owl. This commit converts the remaining uses of the
tempusdominus date(time) picker and replaces them by our own.

closes odoo/odoo#133349

Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2023-09-04 09:19:08 +00:00
Samuel Degueldre 6580a435a9 [IMP] web: improve datetime picker support for time
This commit improves the support for time in the datetime picker by
doing two things:
 - allow to pick seconds by giving a rounding value of 0
 - check minDate and maxDate by accounting for the time when the picker
is in datetime mode instead of only checking the date

Part-of: odoo/odoo#133349
2023-09-04 09:19:08 +00:00
Jorge Pinna Puissant ebd538a194 [IMP] web, *: optimize save record from webclient
This commit, adds a new python method (`web_save`) to save a record, and
optionally read-it again in one rpc call. This optimizes the current
behavior that is to save a record in one rpc, and read-it in a second
rpc.

web_save, will receive the list of IDs of the records to save (if this
list is empty it will create the records, if not, it will write on the
existing records), the list of changed fields, and the unity
specification as optional argument to read the created/modified records
(if the specification is not set, the function will return a list of IDs
of the created/modified records).

closes odoo/odoo#133021

Task-id: 3453184
Related: odoo/enterprise#46559
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-04 09:19:06 +00:00
Raphael Collet b28265dbb2 [FIX] core: _create() should not set non-stored field to None in cache
When _create() is invoked, it inserts rows into the database, and sets
the cache of the corresponding records to the values that are inserted.
If a field is not passed to _create(), we assume that its database value
will be NULL (or falsy, at least) and put None in cache, in order to
avoid fetching that value.  However, this only makes sense for stored
fields.

Part-of: odoo/odoo#133021
2023-09-04 09:19:06 +00:00
Arnold Moyaux a8e4838a6a [FIX] mrp: merge MO with different product for same BoM
Usecase:
- Create a BoM for a template
- Replenish 2 different variant

Expected result:

2 distinct production orders for each product

Current result:

A signle production order with the first product variant and twice the
quantity

closes odoo/odoo#134067

X-original-commit: 2a658fb4a509238cd1462e2ffb615ecec05bc2e2
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-09-04 08:03:47 +00:00
Benoit Socias b284293c18 [FIX] website_sale: automatically convert uploaded extra images to webp
Since [1] images uploaded through the website builder that are neither
GIF nor SVG are converted to the WEBP format by default.
The upload of product extra images does not follow this rule.
Adding the extra images is done through its own specific route instead
of putting the images inside the DOM before the save, it therefore does
not run though the general image tools code.

This commit converts the uploaded product extra images to WEBP before
saving them into the records.
It is achieved by following the same approach as when uploading a WEBP
in the backend [2], before calling the `/shop/product/extra-images` RPC.

The fix is not done by replacing the custom route by an update of the
DOM with the images because a full page rendering from the server is
needed when adding extra images.

Steps to reproduce:
- Edit a product through the website builder
- Add a JPG extra image
- Save the page to leave the website builder
- Check the image content

=> Image was a JPG instead of WEBP.

[1]: https://github.com/odoo/odoo/commit/0449fe85cb0e1d639a4e1aeba26e90906f79254d
[2]: https://github.com/odoo/odoo/commit/40955397658e4bf858e969668079d0c6a4cef43b

task-3460171

closes odoo/odoo#134037

X-original-commit: f970147a2113608d18b47c6f59de6c6338bb2f43
Signed-off-by: Robin Lejeune (role) <role@odoo.com>
2023-09-04 08:03:45 +00:00
Claire Bretton (clbr) 05978d603b [FIX] account: Reload chart_template button unexpected unlink
Reload button appeared when no chart_template was set which
could make Odoo delete important data if clicked.
We restrict appearance of the reload button to avoid this situation.
Also adds a short description on the button to notify user of the
irreversability of the action.

Steps to reproduce:
1. Create a company (do not use the default one that has Generic CoA set) with a country set.
2. Create accounts : income, receivable and payable.
3. Create a sale journal with the income account.
4. Go to a partner detail (e.g. Deco addict), tab Accounting and set its receivable/payable accounts to the ones created above.
5. Create an invoice for that partner.
6. Go in Accounting Settings and click the reload button.
=> The invoice is deleted.

Task-3488427
OPW-3448881

closes odoo/odoo#134028

X-original-commit: a636b9386f297f9f08a38689911ca111fe597ec3
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Claire Bretton (clbr) <clbr@odoo.com>
2023-09-04 08:03:43 +00:00
Nils Hamerlinck 68909e389e [IMP] point_of_sale: avoid barcode collision between demo and tests data
closes odoo/odoo#134001

X-original-commit: a4a197b30cbf5562999f92242b59e3056bf6d01f
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-09-04 08:03:41 +00:00
alsh-odoo 4c54dde9e0 [FIX] sale_timesheet: handle error of giving default value if no sale order line
This traceback raises when user changes the product type to 'consumable' in a
sale order and clicks the 'recorded' stat button.

To reproduce this issue:

1) Install 'sale_timesheet'
2) Create a new 'sale order'
3) Select any customer > Select a product with the 'service' type.
4) Click Confirm, then proceed to click the Create Project button.
5) Give any name to the project > Return to that sale order.
6) Now a 'recorded' stat button is visible > Click on that and create a record.
7) Return to that sale order > Go to the order lines, and for the previously
   selected product, change the product type to 'consumable'
8) Once again, go to that 'sale order' and click on the 'recorded' stat button.

Error: "StopIteration: null"

[1] On the 'action_view_timesheet' method 'default_sale_line' variable is
getting a record with a condition of 'sale.order.line' is_service must be true
and 'service_policy' in 'order_prepaid' or 'delivered_timesheet' .

[2] But 'is_service' is getting value through a compute method in which
product type is equal to 'service'.

Because the user changed the type to 'consumable', the iteration ends with no
records and there is no default value. So it leads to the above traceback.

[1]
https://github.com/odoo/odoo/blob/69fca30bb4fb66e6d979ce5ddc1bff4db963ca71/addons/sale_timesheet/models/sale_order.py#L105-L111

[2]
https://github.com/odoo/odoo/blob/69fca30bb4fb66e6d979ce5ddc1bff4db963ca71/addons/sale_service/models/sale_order_line.py#L18-L20

sentry-4396433586

closes odoo/odoo#133903

X-original-commit: 062cec2175e5b22126b5c3be5acef5039ca1e804
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-09-04 08:03:39 +00:00
Xavier Morel 46178afee0 [IMP] core: precompute (company_id parent_of $x)
There are cases where the result of `check_company_domain_parent_of`
is used in in a loop, leading to the parent_of relation being
recomputed once or even multiple times per iteration during SQL
evaluation.

Computing the parent relationship turns out to be fairly expensive in
worst case scenarios (e.g. lots of companies), so while precomputing
doesn't save much for a 1:1 situation (though it does make the job of
the expressions compiler a bit simpler), the ability to compute it
just once instead of say 140 times does make a huge difference in
e.g. some report renderings.

Nota: apparently `_check_company_domain` can be called with a string
because lol, so there's a special case for that.

closes odoo/odoo#133530

X-original-commit: 2f9ae135c9dd7cb09fa83fda7a9b304993cb3edc
Related: odoo/enterprise#46518
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-09-04 08:03:36 +00:00
Xavier Morel 08518bbad3 [FIX] account: index account codes
Account codes are very commonly searched by prefix. This field used to
be implicitly indexed thanks to a unique constraint on `(code,
company_id)`, however the constraint was removed in #125642 rather
than converted to an index.

For the issue at hand `code` has a much higher discrimination power
than `company_id`, however it might make sense to also index
`company_id`, or to add compound indexes for `code, company_id` and /
or `company_id, code` for other work loads.

X-original-commit: 45c579908d90f6275b7d255d59c6555e8a57b959
Part-of: odoo/odoo#133530
2023-09-04 08:03:36 +00:00
vlstandJoseph Caburnay 00dcc575b8 [IMP] point_of_sale,*: integrate combos in pos ui
*: pos_discount,pos_loyalty,pos_restaurant,pos_self_order

In a previous commit (669b9fcc2f) we added the
backend logic needed for creating combos in `pos`.

In this PR we add the combo functionality to the classic pos ui.

This means that products can now be grouped together and sold as a combo.

ex: Create a product called `Burger Menu` with type='combo'.This product will
have multiple combos associated with it, for ex:

- Drinks - will contain the list of drinks from which the customer can choose
- Main Course - will contain the list of main courses from which the customer
  can choose
- Dessert - will contain the list of desserts from which the customer can choose

In the event that one of the products inside one of the combos is to be more
expensive, this product will have a specific `combo_price` which will be added
to the main combo product's price.

We add the relational fields `combo_parent_id` and `combo_line_ids` in the
`pos.order.line` model. In the previous example, `combo_parent_id` will contain
the `id` of the `orderline` of the `Burger Menu` product.

In many cases `combo lines` have to be handled together. For example, deletion
of an orderline containing a product from a combo implies the deletion of all
other orderlines containing products from that combo. This means that multiple
methods from the codebase had to be changed for this reason. Places that needed
changes for this reason:

- `split_bill_screen.js`
- `addProductToCurrentOrder()`
- `remove_orderline()` and `add_orderline()` from the `Order` js model

In this PR we also:

- improve the demo data such that it contains a `pos combo`;
- refactor the `ProductItem` component such that it relies on a stateless
  component. This stateless component can now be used anywhere; ( it is now used
  in the popup which allows selecting the desired combo products )
- add a new method called `is_pos_groupable` on the `Orderline` js model. Before
  we relied on the product unit to see whether or not a product is groupable. We
  now needed a new mechanism, which could account for different reasons for
  which products are not groupable, such as belonging in a combo;

Note on price calculation:

- The idea is simple, imagine a rectangle divided into two parts. The whole
  rectangle is the total order, whereas the two partitions are the orderlines.
  - Now, imagine shrinking the rectangle by a certain factor. This shrinked
    rectangle represents an order containing a combo -- because normally, a
    combo results to smaller price. The two partitions are also shrinked by the
    same factor.
  - So the calculation will be:
    - Nominal total price is calculated. This is the sum of the orderlines'
      prices when they are added individually. This represents the whole
      rectangle.
    - Target price is derived from the combo product's price and selected
      components' combo prices. This represents the shrinked rectangle.
    - Reduction factor is computed as the ratio between the target price and the
      nominal price.
    - Each component's unit price is adjusted by multiplying the reduction
      factor.
    - When the unit prices of the components are computed, we now let the normal
      price computation take place.
- A spreadsheet is prepared to show a sample calculation:
  https://docs.google.com/spreadsheets/d/1iOdnaILnvKiaf2_z7jTijYiVfB_3mjKWjq6nOB70Un0/edit#gid=0

closes odoo/odoo#129483

Task: 3430636
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Co-authored-by: Joseph Caburnay <jcb@odoo.com>
2023-09-04 08:03:34 +00:00
bve-odoo 66dcfc9bcb [FIX] web_editor: better error message when missing filename field
closes #112101

Signed-off-by: Rémy Voet <ryv@odoo.com>
2023-06-09 12:58:02 +00:00
Arnaud Baes ec5403c63a [ADD] base: explicit rtlcss configuration
Changes in default can be bothersome, embed a full baseline
configuration for reliability.

closes odoo/odoo#27926

Signed-off-by: Pierre Masereel <pim@odoo.com>
2023-07-12 10:09:00 +00:00
Dhrumil Shah caa9a235a2 [FIX] project: fix group user access right
Before this commit when we login as a user having project rights and open the
form view then 'project status' stat button isn't clickable. So in this commit
we have fixed that issue by giving group project user groups to stat button .

task-3432384

closes odoo/odoo#133927

X-original-commit: 0672824fb21e0a15dc951c46e317cb8cfc162ef2
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Dhrumil Shah (dhrs) <dhrs@odoo.com>
2023-09-04 05:49:51 +00:00
niyasraphy 251e558ff2 [IMP] base: remove activate module server action
before this commit, from list view users can install
module using the button in list view and from the
action button.

initially the Install button was not available in the
list view and only option to install multiple apps was
from the action button.

but with the introduction of the button in list header
there is no need for an another server action to
perform the same.

after this commit, the activate modules server action
will be removed from the code and its related test
and also newly added Install button will be renamed
to "Activate" to align with the button in kanban and
form.

closes odoo/odoo#133544

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-09-04 05:49:50 +00:00
Arnold Moyaux e7de3de58c [IMP] mrp: Explicit UserError when workcenter is lock
closes odoo/odoo#134075

Related: odoo/enterprise#46701
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-09-03 15:03:53 +00:00
Pedram (PEBR) cded24889f [FIX] point_of_sale: cannot close POS session without accounting rights
The commit f5ce6c5979e5fba1ccb7e30c8125cd7b97534925 introduced a regression that prevents closing
a POS session if the user does not have accounting and inventory
access rights.

opw-3487462

closes odoo/odoo#134055

X-original-commit: 6f43bc1972ac60e9365b40f53ee8966270e78848
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-09-02 07:59:01 +00:00
Nshimiyimana Séna 06921973c0 [FIX] l10n_it_stock_ddt: account for pricelist in the DDT report
Bug:
When printing DDT documents for a delivery with a pricelist applied, the
total value shown comes from the product's original price and not the
modified pricelist price.

Setup:
- install `sale_management` and `l10n_it_stock_ddt`
- have a product P with a price A
- create a pricelist that where P has a price B

Steps to reproduce:
- activate DDT report printing
- create a quotation set the pricelist you created and the product P
- validate the quotation
- go to the associated delivery and validate it
- print the DDT report

You should see that the price mentioned on the DDT report does not
account for the pricelist. (price A is shown, instead of B)

opw-3171295

closes odoo/odoo#134017

X-original-commit: 9bdb0ed25dcef3f651a65abf0c4a8d9ce4e27851
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Séna Serge Nshimiyimana (sesn) <sesn@odoo.com>
2023-09-02 06:27:51 +00:00
mega-odoo 58f7cbc1ef [FIX] website_payment: handle an error for empty donation amount
When a user pays a donation with an empty amount value, the system
passes this value as an empty string, which is leading to a type-casting error
because an empty string cannot be directly converted to a numerical value like
a float.

Error: `ValueError: could not convert string to float: `

To handle this situation, we should use '_cast_as_int' and
'_cast_as_float' methods because these methods provide try-except blocks,
effectively handling these types of errors. This ensures that when an empty
amount value is encountered, the system manages the error.

sentry-4376573159

closes odoo/odoo#134026

X-original-commit: cae9f647b9e032aedfccc528d124acc639ecbf7f
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-09-01 17:53:48 +00:00
Khushi e38736df6e [FIX] web: de-duplicate icons in edit mode of binary field
In dashboard configuration, when you click on file of 'Data' section in
debug mode to edit, icons were duplicated.

This commit fixes the issue by getting rid of the same icons in
overridden template `web.ListBinaryField` from `binary_field.xml`
in order to remove icon duplicacy.

Additionaly, this commit removes unnecessary `<i>` tags and alters the
classes of `<button>` tags instead, to maintain the visual appearance
of icons (now they look the same as everywhere else).

Task ID : 3453198

closes odoo/odoo#134005

X-original-commit: 850e16cc415486507d1984ea08a04140ffba7c61
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-09-01 16:46:07 +00:00
Antoine Guenet cf61c63ddf [FIX] mass_mailing: preserve comments when testing a mailing
When sending a mailing we make sure to preserve comments (in particular
so that MSO comments can be read by Outlook). However this was not the
case when testing a mailing using the Test button in the form view.

task-3488162
opw-3290548
opw-3479234

closes odoo/odoo#133998

X-original-commit: 66b1dc38ced221d63f11827a217f9805827d5e65
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-09-01 16:46:06 +00:00
roen-odoo edb9914018 [FIX] pos_daily_sales_reports: use pos config currency when possible
Current behavior:
The currency used to create the report is the one of the company. But
if you use a different currency in the pos config, the report will still
be in the company currency.
To fix that we check if all report's config use the same currency and
use it if it's the case we use the pos config currency. And if it's not
possible we use the company currency.

Steps to reproduce:
- Create a second pos
- Change the sale journal and the pricelist to use a different currency
- Open a session and make a sale
- Close the session
- Generate the daily report for the second pos
- The currency is the one of the company

opw-3463280

closes odoo/odoo#133996

X-original-commit: 3af535d9008c4d839ede2b5117230fa4a19b538a
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2023-09-01 16:46:05 +00:00
Thomas Lefebvre (thle) b2b3613185 [FIX] hr: add a name for work permit file
Issue:
------
When adding a file to an employee's work permit ("Private Information tab"),
the file name is the "value" of the file.
This is not meaningful for the user who will download the file.

Solution:
---------
Use the `filename` attribute to determine the field of `hr.employee`
to be used to get the file name.
As the original file name doesn't exist in an existing field,
we can use a "generic" file name with a non-stored computed field.

opw-3458842

closes odoo/odoo#133981

X-original-commit: 2f49ec86fcd8191f92153069ae242c329a5cdf0c
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2023-09-01 16:46:04 +00:00
Xavier Morel 8d06889ec3 [FIX] base: encoding guessing of html module descriptions
I missed a critical issue in #133708: various users had discovered
they could already fix description issues by adding an XML declaration
to their document which is very cool (though technically not really
valid).

What is a lot less cool is that lxml gets *extremely* unhappy when
asked to parse *strings* with an encoding declaration, raising a
ValueError, so the purported fix breaks on any module which does that,
which seems to include a lot of OCA modules.

Gate the encoding guessing by bailing if the document has an XML
declaration, in which case we just assume the author knows what
they're doing and we leave them alone. For extra safety, check the
encoding declaration in ascii and utf16. Could also have checked for
BOMs, but lxml seems to not care about them overly much (in fact it
seems to prefer them decoded which is odd).

Also same as non-utf8 descriptions, mark XML declarations as
deprecated (because it's a hack to make UTF8 descriptions work which
is not necessary anymore).

closes odoo/odoo#133968

Reported-by: @rezak400
X-original-commit: fd353d7d0104431208b91603431e41ef4a6e54bb
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-09-01 16:46:03 +00:00
FrancoisGe 9170f71d96 [FIX] web: fieldDependencies are readonly by default
The purpose of this commit is to make fieldDependencies are readonly by default.
This avoids making fields unintentionally editable. If the field is editable,
it will be sent during create/write, which is what we want to avoid.

Use case:
Go to a form view with 2 fields "a" which is readonly and "b" which has
"a" as fieldDependencies.

Before this commit:
    Record Datapoint thinks that field "a" is editable

After this commit:
    Record Datapoint thinks that field "a" is readonly

closes odoo/odoo#132247

Related: odoo/enterprise#46691
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-01 16:45:59 +00:00
althaf shaik 0851a824c8 [FIX] account: send and print invoice without attachments
This traceback raises when user tries to send an invoice without attachments.

To reproduce this issue:

1) Install 'Accounting'
2) Open any existing 'Invoice'
   Note:- Invoice should not be in 'Draft'
3) Click 'Send & Print '  button an wizard will be opened.
4) Click on 'Send & Print' button of wizard.
5) Now repeat the step 3
6) This time delete the Invoice Attachment and click on 'Send & Print' button
   of wizard.

Error: 'A traceback appears': 'can only concatenate list (not "bool") to list'

On '_get_mail_params' method 'attachment_ids' is getting
values by concatenating  'mail_attachments_widget' and
'invoice_extra_attachments_data'.

See:-
https://github.com/odoo/odoo/blob/27c1384e1209339158f56c82bebf99a5b64811f4/addons/account/wizard/account_move_send.py#L434-L448

Because of user delete the 'Invoice attachments' in wizard, 'mail_attachments_widget'
will return false and it leads to above traceback.

Sentry-4305060652

closes odoo/odoo#133953

X-original-commit: f08da6fdfa881ec3e80d6fc14dddaa8df3c529ed
Signed-off-by: William André (wan) <wan@odoo.com>
2023-09-01 15:10:00 +00:00