Commit Graph
162505 Commits
Author SHA1 Message Date
Kartik Chavda 8a7bf14fbb [FIX] web: fix new line in confirmation and alert dialog
Steps:
- Install studio.
- Open studio.
- Click on reset default view.

Issue:
- Confirmation dialog body display in single line instead in
multiple lines same thing happens in pos confirmation dialog
also in new friendly message task we need to display error
message in multiple line.

Cause:
- There is a style missing on body of that dialog to preserve
white spaces also need to use other tag then <t> to apply
proper style

Fix:
- Use <p> tag instead <t> tag and add a `text-prewrap` class
in bootstrap utility class and use this class in `<p>` to
preserve space.

task-3356114

closes odoo/odoo#125300

X-original-commit: 700d41d2f007124390b7cafca0a2e58a467e2b43
Related: odoo/enterprise#42842
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-06-26 18:24:49 +02:00
Chintan Panchal (can) d538995ebf [IMP] website: make configurator card title smaller
Website configurator 'website/configurator/4', Pages and Features description
takes up more than one line owing to the larger 'font-size' of the h4 class.

With this PR, use heading size `small` instead of `h4` so that description
remains in a single line.

task-3326543

closes odoo/odoo#121743

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-06-26 16:41:37 +02:00
dasz d7df1856fa [IMP] cli: add scaffold for payroll localization
Added few basic rules and folders that are usually common to most localizations.
The template will also serve as documentation on naming conventions (not strict atm).

closes odoo/odoo#121446

Usage: ./odoo_bin scaffold -t l10n_payroll name-code (e.g. estonia-ee) [destination]
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-26 16:41:35 +02:00
Saurabh Choraria c3ffbd338b [FIX] partner_autocomplete: update log when sending partner to sync fails
In the start_sync method, the logger is updated to use the 'warning' level
instead of the 'error' level. This change reflects a less severe logging level
for cases where sending a partner to sync fails.

The changes have been made to reduce the noise level in the sentry.

sentry-3955309841

closes odoo/odoo#126111

X-original-commit: c1b608c2d28962ed0ccbf15e9eeb2ecf5281b758
Signed-off-by: Louis Baudoux (lba) <lba@odoo.com>
2023-06-26 15:12:03 +02:00
Pierre Pulinckx (pipu) 28e1e61e5c [REF] web, pos, website_slides: Remove totally underscoreJS
After this commit, underscore library is totally removed.
Library calls has been removed from manifests.
Library files has been deleted.
This commit closed the task below.

task-3246238

closes odoo/odoo#125889

Related: odoo/design-themes#662
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-06-26 15:11:55 +02:00
Dossogne Bertrand 827cd6218e [FIX] l10n_fr_hr_holidays: adapt checks to avoid errors
Before this commit, some specific cases
in the leave creation would lead to an error due to an assert.
This commit replaces that assert with a 'if' statement returning the initial
date_to if the requirements are not met. A more thorough description of the
conditions is set as commentary of the `_get_fr_date_to` method.

task-3344770

closes odoo/odoo#126304

X-original-commit: d5642b088b37614e733b717989c12f9930b6e4ee
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-26 13:21:03 +02:00
roen-odoo 27a583082c [FIX] point_of_sale: use pos_order partner when not connected
Current behavior:
When using the QRCode on ticket to create an invoice, it was always
creating a new partner, even if a partner was already set on the order.

Steps to reproduce:
- Activate the QRCode on receipt feature
- Create a PoS order and create a new customer for it
- Pay the order and print the receipt
- Scan the QRCode on the receipt to create an invoice
- On the new window enter the customer informations and see the invoice
- Now go check the customers list in the backend, you will see 2
  customers have been created.

opw-3275938

closes odoo/odoo#126303

X-original-commit: 0a867a4e53d97da707b14062e0abafc18a1c827c
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2023-06-26 13:21:00 +02:00
roen-odoo 03bb883d2c [FIX] point_of_sale: prevent adding not saleable product with scan
Current behavior:
When scanning the barcode of a product that is not saleable, the product
was added to the order.

Steps to reproduce:
- Create a product that is not saleable and not available in PoS
- Set a barcode for this product
- Open the PoS, and scan the barcode of the product
- The product is added to the order even if it is not saleable

opw-3325238

closes odoo/odoo#126293

X-original-commit: 3a3997e22b6a21c66455718a117c7c424526745e
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2023-06-26 13:20:57 +02:00
chrysanthe(chgo) 4833bc84fb [IMP] web: improve property fields modal design
The purpose of this commit is to improve the design of the Property field
modal as it was done to release something fast.

We also introduce a modification of the JS test related to the property
header. Before this commit, the structure of the modal was composed
of a header and a body.

Since we refactored the component in one single block with the class
`.o_modal_container`, we apply the `.o_field_property_definition_header`
class directly on the input rather than targeting an input inside the
header.

task-3084756

closes odoo/odoo#126274

X-original-commit: 12a25449d9f26aec5f14482952ca0db40bf612b9
Related: odoo/enterprise#43091
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-06-26 13:20:51 +02:00
Guillaume (gdi) 8eb8e08258 [FIX] website_links: support foreign language for links graphs
When a user creates a link that is tracked, an interface with graphs is
presented to him so that he can track the performance of his tracked
link. Unfortunately, these graphs did not work when the site was in a
foreign language. This was due to the fact that the code had not been
designed to handle this. This commit fixes the code so that it works in
all languages.

Note that the data is received via RPC and the python code format the
dates for the current language of the website. So we had to do a little
hack to make it work properly.

Steps to reproduce the issue:
- Install website_links module
- Go to the website app
- Click on Promote > Link Tracker
- Create a tracked link
- Visit the link
- Install Arabic (Syria) for your website
- Check the stats of your link in Arabic

=> There is a traceback and the data is not displayed.

task-3289167

closes odoo/odoo#126273

X-original-commit: e690da6ed1493e1def47cca6ef61e01ca8fa885f
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
2023-06-26 13:20:49 +02:00
Alexis de Lattre b008b16122 [IMP] point_of_sale: add date on cash receipt
Add local date and time at the end of the printed in/out cash ticket

closes odoo/odoo#126247

X-original-commit: bf56255b1b334047a12f7469f7a1fafeb2787b66
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-06-26 13:20:46 +02:00
Yash Vaishnav aab08eaa4e [FIX] hr_timesheet: fix uom of allocated time field in project task view
Issue:
1) Install the timesheet module.
2) Update the encoding method in the timesheet settings to use 'days' instead.
3) Navigate to the project task section and observe that the allocated days
field incorrectly displays the unit of measure as hours instead of days.

Cause:
The planned_hours field in the project task form view contains a float_time
widget that does not convert the UOM when switching to the Days encoding method.

Fix:
Using the timesheet_uom_no_toggle widget resolves the issue by changing the
updated value. To minimize the extra space generated by using the
timesheet_uom_no_toggle widget, the o_field_float_time class is employed.

task-3318851

closes odoo/odoo#126211

X-original-commit: 93d6f475d4cca35e4d4c41e9dedce3001d50f72d
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-26 13:20:43 +02:00
pash-odoo f72037948c [FIX] project: fix overlapping issue of archive ribbon and state button in task
Before this commit if we archive project's task then 'archive' ribbon and state
button were getting overlapped.
steps:
-> go to the project and open any project and then open any task
-> click on archive and see that archive ribbon and state button get overlapped

Fix:
-> checked condition if record is archived or not
-> if record is archived then first apply the justify content start of div which
   contains state button and then changed width of state for different screen
   sizes.
-> if record is not archive then leave the state button as it is.

task-3374980

closes odoo/odoo#126208

X-original-commit: 8400dc4bbc40b157736972fedd28d48907396611
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-26 13:20:40 +02:00
Saurabh Mishra 0a4404ebcf [FIX] account: prevent account_move_line singleton error
When '_seek_for_lines' returns multiple suspense_line for
transaction_amount calculation, then the user will face this
issue 'Expected singleton: account.move.line(516, 517)'.

Steps to reproduce:
- Create a new transaction in Journal (Bank) by Accounting Journal
> Bank Reconcilation > Add a Transaction.
-  While creating a transaction add a partner, amount (amount > 0),
Foreign Currency, Amount in currency and then save it.
- Go to Journal Entries by Accounting > Journal Entries
and then open your  recently created journal entry.
- Click on reset to draft and then in 'Journal Items'
add a line with some credit amount such that total credit and debit should be
equal. (Under Account it should be Bank Suspense Account).
- Now click on 'Bank Transaction' button in the form view.

By following above steps you will be able to reproduce the error.

Applying the changes will resolve the issue.

sentry-4217912848

closes odoo/odoo#126284

X-original-commit: 12a75a8521f8150c382645215c440d39af4b50aa
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-06-25 23:37:07 +02:00
Denis Ledoux 2f19dc6095 [FIX] base_import_module: restore <field file="..."> feature
Revision odoo/odoo@cabb9e7e57 introduced a
regression: This is no longer possible to import a data module
using `<field file="..."/>` in their data file.

This revision targets to restore the feature as expected.
The unit tests added covers the feature, so that regression
no longer happens in the future.

It introduces a new concept of temporary directory `file_open`
can read from.
e.g.
```py
with odoo.tools.file_open_temporary_directory(self.env) as module_dir:
   with zipfile.ZipFile('foo.zip', "r") as z:
      z.extract('foo/__manifest__.py', module_dir)
   with odoo.tools.file_open('foo/__manifest__.py', env=self.env) as f:
      manifest = f.read()
```

Note that `file_open` will be allowed to read from that temporary
directory only if `env` is passed to `file_open`,
and if the `env` is part of the same transaction/request than the `env`
passed to `file_open_temporary_directory`.

This is to avoid having users, whether from other databases,
or even the same database,
trying to access these directories not belonging to them.
e.g. If an admin uploads sensitive data in this temporary directory,
no one than him must be allowed to read from these files, not even
another user from his database.

closes odoo/odoo#126326

X-original-commit: ea5cfe2e9493e4ef5a9b81851af452c8c51e407e
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2023-06-24 14:01:40 +02:00
Yolann Sabaux 9fed5ebe8f [FIX] account_edi_ubl_cii: exclude note-section
Steps to reproduce:
- Install the lux localization
- Configure Peppol for a customer: Select a customer > tab accounting > under "electronic invoicing":
format: Peppol BIS Billing 3.0
Peppol e-address: 0130 - Directorates of the European Commission
Peppol Endpont: testendpoint

- Create an invoice for the peppol customer
- Add a section or a note in the Invoice
- Confirm the Invoice

Issue:
Raise user error:  Odoo requires a tax for EACH LINE, instead of each product

Solution:
Exclude the section/note line

opw-3354757

closes odoo/odoo#126312

X-original-commit: fb716296dbdb4921d26ebe1c3a420965f07d61e4
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-06-24 05:50:44 +02:00
Matheus Leal Viana (malv) 7f0bb20294 [FIX] l10n_ua: fixing Ukrainian account template translations
Some account terms are mistranslated, this PR aims to fix these translations. The customer provided a table with the mistakes and suggestions. The customer’s suggestions are available in the ticket.

How to reproduce:
1. Ukrainian translation > chart of accounts > some terms are mistranslated

closes odoo/odoo#126294

Opw: 3247005
X-original-commit: 95ae2afd3bd5b2a2df62e6e33eeb03066d1d8276
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Matheus Leal Viana (malv) <malv@odoo.com>
2023-06-24 03:35:44 +02:00
Loan (LSE) ea0ca18b81 [FIX] account: fix inconsistencies in _sync_dynamic_line
To reproduce (V16):
 0. Install Accounting (can also be reproduced with just Invoicing, but
 there is no "journal item" menu that will ease the process to show the
 issue)
 1. (In debug), change the dollar currency rounding to 0.0001
 (instead of 0.01)
 2. Go to Accounting > Customers > Invoices
 3. Create a first invoice with:
  - a partner P1
  - set an invoice date
  - make sure that there is a payment term set (for example "30 days")
  - at least one invoiced line (the product does not matter) with the
  tax 15 % and the price to 12.36
 DO NOT confirm the invoice
 4. Create another invoice with
  - ANOTHER partner P2
  - set an invoice date
  - make sure that there is a payment term set (for example "30 days")
  - at least one invoiced line (the product and the price does not
  matter)
 5. Go back to the Invoices list view and select the 2 new (unposted)
 invoices then Action > Post entries.
 6. Check Force and "Post Journal Entries"
 7. Go to Accounting > Reporting > Journal Items
 8. Group by "Journal Entry" and unfold the 2 last invoices (that should
 be the one validated in 6.)
=> The "Partner" set on the Debit Line is the one of the other invoice
(and vice versa)

Analyse:
 This issue is a mix of different sub-issues. Solving any of this
 sub-issue would solve the issue but as other sub-issues may exists we
 will fix each of them individually.

 Sub-issue 1:
  The account.move.line (=AML) partner is set correctly before the post
  (6.), this is during the "mass posting" process that the issue happens.
  The partner is changed because of this line:
  https://github.com/odoo/odoo/blob/8006e7ce618f98bd26a82cf9b64eaa9b6e9c9d2a/addons/account/models/account_move.py#L2094-L2096
  The value written to AML of id `line_id` include `move_id` which
  overwrite the account.move that was originally set on the AML.
  As the `partner` is computed only in certain circumstances, if the
  `move_id` written differ from the one of the AML, most of the values
  will be updated with the write values, but the `partner_id` will keep
  its value (this is why the swap of partner happen).

  In other words, this issue happen as `line_id.move_id` order is
  different from `key["move_id"]`. So we write on the "wrong" AML.

 Sub-issue 2:
  In theory, this issue should not have happened in the first place.
  The line:
  https://github.com/odoo/odoo/blob/8006e7ce618f98bd26a82cf9b64eaa9b6e9c9d2a/addons/account/models/account_move.py#L2061
  should have prevent the re-edition of the AML (as actually no relevant
  datas are written). But the equality between the dictionaries fail due to some rounding errors.
  Here:
   - needed_after[<key Invoice 1>]["balance"] --> 14.214000000000002
   - needed_before[<key Invoice 1>]["balance"] -> 14.213999999999999
  N.B: if we don't set an "invoice date" on the invoice, a rewrite is
  done before which would prevent our issue to reproduce.

 Sub-issue 3:
  If we try to reproduce the issue without setting a "payment term", the
   issue would not reproduce.
  By setting a "payment term" the `to_delete` computation change at:
  https://github.com/odoo/odoo/blob/8006e7ce618f98bd26a82cf9b64eaa9b6e9c9d2a/addons/account/models/account_move.py#L2067
  This happens as the `existing_before` keys and `needed_after` keys are
   different:
  - existing_before[<key Invoice 1>]["discount_date"] -> False
  - needed_after[<key Invoice 1>]["discount_date"] ----> None
  As the values are different, Odoo all the AML to the `to_delete` which
   then trigger their overwrite.

  In other words, if no "payment terms" were set on the invoices, the
  issue would not happen either

opw-3270471,3292931,3333799

closes odoo/odoo#126272

X-original-commit: 074964b6c91d223da0b416855a92e9ed8a17ee55
Signed-off-by: William André (wan) <wan@odoo.com>
2023-06-23 22:39:00 +02:00
Mayurrajsinh Rathod c188293832 [FIX] website_slides: prevent copy of a attendee in course
Before this commit:

Duplicating the contact that is linked to an attendee of a course also
creates a copy of an attendee as well.

After this commit:

It does not create duplicate attendee in course.

Task-3253983

closes odoo/odoo#126244

X-original-commit: 4af091bd62243db243555d46b97cc7af49ceeeb1
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Mayur Raj Sinh Rathod (mrsr) <mrsr@odoo.com>
2023-06-23 19:06:39 +02:00
Ramazan Subaşı 00946556d0 [FIX] base: Update res.country.state.csv for Turkey cities
closes odoo/odoo#126286

X-original-commit: e80fa6282fe7f0018a21391966e14a2dfe3c48b1
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-06-23 18:00:31 +02:00
Ramazan Subaşı 5c952ddbcf [CLA] Sign for ramazansubasi
X-original-commit: 9d3d25fd913db25344dad7895be31bf2e5861a47
Part-of: odoo/odoo#126286
2023-06-23 18:00:30 +02:00
61a7328c2f [FIX] website_sale: block employees from updating their billing address
Reproduction:
1. Install Event, Sales, Webiste
2. Login as Admin, go to Website -> Go to website -> Events
3. Click the Open wood event, Register, buy one VIP ticket
4. In Address step, Edit the billing address, change the name to “Test
Name”, click next
5. The user name “Mitchell Admin” is changed to  “Test Name”, we
shouldn’t be able to change the info

Reason: In the fix to block name change here: https://github.com/odoo/odoo/commit/d823033ad67702b1b92d27a3f66c7a4ec304c644
we use the can_edit_vat to check if we have existing invoice(s) or
SO(s). However, we should block the route that an employee changes the
billing address when placing an order. If they are placing an order for
external people, it should be done from the back end.

Fix: add an extra error case when it's an employee trying to change the
name or email address when editing billing address. This is the case
when an employee tries to order for external people. They should do it
from the back end. They can still buy for themselves without changing
the billing address. Also added translation in pot. Edited the test for
editing address of log in user, added tests for portal user. Reformat
the invoice exsits check for name change to have better readability

The adding of can_edit_vat:
https://github.com/odoo/odoo/commit/f8b05f52f5ea7f31135f700b0e240ff563204085

Related fix to block the name change:
https://github.com/odoo/odoo/commit/d823033ad67702b1b92d27a3f66c7a4ec304c644

A patch to not block the checkout process when name is not set:
https://github.com/odoo/odoo/commit/781dbeaccac76a6ec4f4b8cac1b607810697e394

opw-3126325

closes odoo/odoo#126261

X-original-commit: 972c55bf76f4c5f1b1bedec4a77ddaeac8be1483
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Jinjiu Liu (jili) <jili@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
Co-authored-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-06-23 18:00:27 +02:00
roen-odoo 55af8eb20d [FIX] pos_sale: downpayment refund correctly added to origin order
Current behavior:
When you refund a downpayment in the PoS, the downpayment is not added
to the original order.

Steps to reproduce:
- Create an order in the sales app
- Open the PoS and make a downpayment for the order
- Refund the downpayment you just made
- Go back to the original order in the sales app, the downpayment is
  correctly added, but the refund of the downpayment is not added.
- The order should contain : The original product, the downpayment and
  the refund of the downpayment.

opw-3275708

closes odoo/odoo#126250

X-original-commit: 95c770c8164ef3d11d27c8cb0fc85e0b0d0054c3
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2023-06-23 18:00:24 +02:00
Stanislas Gueniffey ac4272c990 [FIX] web_editor: keep style of copy-pasted tables
Previously, copy-pasted tables from other spreadsheet editors did not
keep their style once in our editor. This is simply because the way
style information is embedded in the HTML is not inter-compatible across
editors.

Google Sheets places all the cell's style on <td> tags, which can't be
styled in Odoo 15. This has been fixed by moving all possible style
attributes to a direct <span> children, which is created if necessary.
In Odoo 16 and forward, the styles are left on <td> tags.

Microsoft Excel defines the style in the standard <style> tag (in the
<head> of the HTML), using custom CSS classes on tags. We parse that
<style> and copy it to the style attribute of <td> tags with matching
classes. Those styled <td> tags are later handled as described above.

Libre Office makes use of deprecated <font> tags and its specific
attributes. Those attributes are mapped to equivalent values for the
standard style attribute. It also places eventual <s> and <u> tags as
parents of <font> tags, which means the strike or underline doesn't
inherit the style of the text. We invert those for nicer styling as is
the default in our editor.

Tests have been added for each of those aforementioned Spreadsheet
editors, ensuring we save exactly their style values that are compatible
with the Odoo editor, nothing less and nothing more.

Note that for v15.0, background color of cells is discarded as it is not
supported in our own editor. For v16.0 and on, it is supported and kept.

Task-3255167

closes odoo/odoo#126248

X-original-commit: 8b0f7e32ac73636cd3ce142dd44fe921fcc4c849
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-06-23 18:00:22 +02:00
Stanislas Gueniffey 0cce400c5a [FIX] web_editor: do not remove default styles
Previously, when copy-pasting HTML with styles on styleable tags, those
styles could still be removed by the editor if they had a default value.
This was supposed to be a way to keep the DOM clean and lighter.

However, styles with default values still serve a purpose when
overriding non-default values inherited by their parents. Therefore,
removing them was a conceptual mistake.

One example in the editor where this purpose can be served is in
tables where spans can override the style of the cell or parent span.

This commit ensures we no longer remove style attributes because of
their default value.

Task-3332955

X-original-commit: 39acbc23929f6004e6cb5fe1059ccabf87799e8c
Part-of: odoo/odoo#126248
2023-06-23 18:00:21 +02:00
Antoine (anso) 0a96f3b007 [FIX] web: notification button padding
Removing ps-0 class that was breaking the default button padding

To deal with the possible aligment issue when `btn-link` is used
alone (as this button style has no background), we are switching the
second possible type of buttons to `btn-secondary`. It also matches
with the `btn` combinations used in modals

closes odoo/odoo#126246

X-original-commit: 16237b7ee064a4a7047d0eb6d58a477b048daf67
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-06-23 18:00:15 +02:00
roen-odoo 075da19e4e [FIX] pos_loyalty: specific discountable take discount into account
Current behavior:
When computing the discountable values of an order, the discount of the
program where not taken into account if you used specific discountable
products.

Steps to reproduce:
- Create products A and B with a price of 20$
- Create a loyalty program
- Rule:
  - Minimum qty : 2
  - Apply on specific products : Product A and Product B
  - Reward : 5 points per order
- Reward:
  - 10$ per order
  - In exchange of 2 points
  - Apply on specific products : Product A and Product B
- Open PoS and add Product A and Product B to the order
- A reward should be added automatically with a value of -10$
- Click on the reward button, another reward should be added but it has
  the wrong value. It should be -10$ but it is not.

opw-3232565

closes odoo/odoo#126245

X-original-commit: f33d3b09ff49aae1fdaf3379915b7e7b5f03080c
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2023-06-23 18:00:13 +02:00
Pieter Claeys (clpi) ccb41edf2b [IMP] stock: better returns
Improve the returns process by adding the following improvements:
- Removal of the 'return' operations type. Returns of deliveries now
become receipts.
- Update of the `stock_picking_return` wizard by removing the onchange
on picking_id.
- Show returns in the sale portal, with a new 'return label' PDF report
- Enable returns for multi-step receipts on purchases

Community PR: https://github.com/odoo/odoo/pull/118568
Enterprise PR: https://github.com/odoo/enterprise/pull/39761

closes odoo/odoo#118568

Task: 3081370
Related: odoo/upgrade#4660
Related: odoo/enterprise#39761
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-06-23 18:00:05 +02:00
Pieter Claeys (clpi) f13d537a42 [IMP] mrp: New analytic for MRP
The (legacy) analytic account field on MOs, BOMs and workcenters has
been replaced by the new "analytic distribution" field.

The analytic line items are now created based on this distribution for
the raw materials, workcenter costs and employee costs.

A new analytic applicability (=domain) has been added for manufacturing
orders as well.

Community PR: https://github.com/odoo/odoo/pull/116477
Enterprise PR: https://github.com/odoo/enterprise/pull/38690

closes odoo/odoo#116477

Task: 3196563
Related: odoo/upgrade#4704
Related: odoo/enterprise#38690
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-06-23 17:59:57 +02:00
Hubert Van de Walle (huvw) f120977751 [FIX] analytic: missing currency field for aggregates
opw-3316448

closes odoo/odoo#126209

Related: odoo/enterprise#43067
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-06-23 16:35:46 +02:00
Cyrus Robins 7146975815 [FIX] stock_valuation_layer: add an index to stock_valuation_layer_id field to improve performance
The index is being added because when processing a large PoS session, the method consume_specific_qty is called a large number of times if the product categories are set to automatic valuations. This method has the line:
tmp_value += qty_taken_on_candidate * ((candidate.value + sum(candidate.stock_valuation_layer_ids.mapped('value'))) / candidate.quantity)

This line, when running upwards of 20,000 times, can cause large performance issues, due to the stock_valuation_layer_ids being a related field on stock_valuation_layer_id.
This causes a doubling of the number of sql queries which causes slowdowns in performance. Adding this index drastically improves the performance of the queries generated by this line of code.

opw-3295560

closes odoo/odoo#126207

X-original-commit: 6f491e34d9355d1e45599fd0c881d7d721ea7d73
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-06-23 16:35:43 +02:00
Paweł Fertyk 357c71b768 [FIX] mrp: assign lot_id to stock moves in mass produce
Currently we skip the lot_id assignment if move.quantity_done is set,
which causes issues when using "Mass Produce" option.

closes odoo/odoo#126191

Task: 3370869
X-original-commit: 72f316a4c0ad1d443aa84051858fa6d8885b464e
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-06-23 16:35:40 +02:00
Joseph Caburnay 667d056b63 [FIX] pos_*: properly check country from company
pos_*: l10n_ae_pos,l10n_co_pos,l10n_fr_pos_cert

In many pos l10n addons, we assume that country is present in the company, and
this is a wrong assumption. Thanks to the runbot error that we are able to
detect these mistakes in the code. In this commit, we fix the issue by checking
the presence of country first before actually accession the country code.

Runbot Error: 20917

closes odoo/odoo#126117

X-original-commit: 172a5bc8628f8b774d9738c05c2eb7b0ef4db5ae
Related: odoo/enterprise#43019
Signed-off-by: Robin Heinz (rhe) <rhe@odoo.com>
2023-06-23 16:35:35 +02:00
qsm-odoo 8618d34953 [FIX] web_editor: restore snippet button text colors
This reverts commit [1]. It broke all snippet button colors, making
them invisible. Besides that, the fix seems not obvious to make properly
and would thus require some more testing, thus the need of reverting
this urgently.

There is probably more things to consider when remaking that fix:
- mass_mailing scss code in web_editor should not be a thing. Even if
  the comment about variables not being accessible is true, there are
  definitely other ways to do it (make them accessible, add those rules
  generically with a custom selector and fill that custom selector when
  mass_mailing is installed, etc etc)
- More than scss code, we really do not want mass_mailing *CSS* rules
  in website pages, especially in that code that generates *many* CSS
  rules. Of course web_editor.common.scss contains many things that
  should not be there and mass_mailing has probably already a lot of
  useless code in the frontend assets... but the goal is to fix those
  inconsistencies in the future.
- The fix impacts buttons which are not hovered while the goal seemed to
  be to have their hover style disabled...
- The fix impacts buttons which are in o_ccX environments only (?) but
  seemed to be about disabling all hover styles.
- Much doubt on the need of an at-root instruction, especially since
  it creates a bug in frontend pages without o_mail_wrapper containers
  so it probably does not work as intended.
- The fix should probably not be about overriding/duplicating the CSS
  rules but rather post-processing the mass_mailing assets to remove all
  hover rules. I guess it is even possible to do in JS removing the
  :hover CSS rules, at worst by moving all CSS rules to inline <style>
  rules or something like that.

Note: the main bug about button text being invisible is apparently from
16.0 and up only. This still reverts the code at its root (15.2) for all
mentioned reasons above.

[1]: https://github.com/odoo/odoo/commit/55aff2dcdf5537e16bdaf01ee68d776510572171

task-3376724

closes odoo/odoo#126116

X-original-commit: a6e861b19002b02e369d6b7c1ed5fe1401e77028
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-06-23 16:35:30 +02:00
Joseph Caburnay 66165e81ac [FIX] point_of_sale: load fonts when mounting the pos app
The `waitfont.js` module depends on the presence of the `document.body` and it's
possible that during loading of the services, it is still `null`, which results
to indeterministic random error in the test. In this commit, we make sure to use
the module (calling `waitForWebfonts`) only when the pos app is about to be
mounted, such that `document.body` is already present.

Runbot Error: 22519 (and probably others)

closes odoo/odoo#126110

X-original-commit: a1b250f555e328b2d97ae347cef3d71773329d87
Signed-off-by: Robin Heinz (rhe) <rhe@odoo.com>
2023-06-23 16:35:27 +02:00
Brieuc-brd 0fba13ed0f [FIX] web: search panel: long filter on mobile
Prior to this commit, when a filter or a dropdown item had a long name,
the layout was broken on mobile, the item went out of the viewport and
wasn't readable.

This commit fixes this issue.

task-3378207
Part of task-3326263

closes odoo/odoo#126071

X-original-commit: 96d1edcdba78af3572c3395867e561c0eb3d5054
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-06-23 16:35:25 +02:00
William Henrotin 4ae28ba747 [FIX] stock: recompute move state for reservation
Creating a move line with some reserved quantity should make its stock
move recompute its state as this noew reservation quantity could make it
assigned.

closes odoo/odoo#126069

Task: 3371590
X-original-commit: ca4cf35b3450ad3246e57a34aa8f3fe7c4f187af
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-06-23 16:35:22 +02:00
William Henrotin 955a5fecc8 [FIX] stock: hide quants for consumable
do not create stock move line from quant for consumable products

Task: 3256447
X-original-commit: b327825de0b50de9cdb81fc9e8384c503351d6d7
Part-of: odoo/odoo#126069
2023-06-23 16:35:22 +02:00
William Henrotin aede5c595a [FIX] stock: always show the detailed operation button
We want be able to click on the button right at the stock move creation

Task: 3256447
X-original-commit: d8926ec8f4a2d8f7840ea4c0ddd8393a74e57d90
Part-of: odoo/odoo#126069
2023-06-23 16:35:21 +02:00
Géry Debongnie 9f6ed9f6d1 [IMP] web: display empty screen when switching app/menu
The goal is to provide a better feedback to the user, especially in
mobile mode. With this commit, when switching menus, we clear the screen
and display an empty control panel (only for act_window actions though)
so we have some initial content that get filled as soon as the
view/action is ready.

Task 2900847

closes odoo/odoo#124068

Related: odoo/enterprise#43038
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-06-23 16:35:15 +02:00
ravb-odoo 16ed8d3141 [IMP] hr: add default avatar of employee
Before this commit, when the user creates new resource and employee on
the fly in many2one field, the default avatar of Initial name should be
set instead of placeholder (grey icon). The reason why a grey icon is
displayed is because the `_compute_avatar` for employee set that icon
when avatar or image is not found.

This commit add default avatar of initial name when new resource and
employee is created.

task-3251689

closes odoo/odoo#123403

Related: odoo/enterprise#41823
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-23 16:35:07 +02:00
Laurent Smet b8f2579805 [IMP] test_main_flows: Add main flow to bank reco widget
Adapt the main flow tour to the refactoring of the bank reco widget
since the embedded form is now an owl component.

closes odoo/odoo#119185

Task: 3193121
Related: odoo/upgrade#4776
Related: odoo/enterprise#40068
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
2023-06-23 16:35:02 +02:00
Laurent Smet 592f0df7e2 [IMP] web: Add hook to provide options to the useModel function on kanban
Task: 3193121
Part-of: odoo/odoo#119185
2023-06-23 16:35:01 +02:00
Laurent Smet e7cbd26b08 [IMP] web: Add hook 'onWillStartAfterLoad' on useModel
Allow a custom onWillStart but after the loading of the model in useModel.

Task: 3193121
Part-of: odoo/odoo#119185
2023-06-23 16:35:01 +02:00
Laurent Smet c6b4f67238 [IMP] web: Add hook on monetary_field
Add an hook to add a custom behavior when parsing the monetary amount written by the user on the UI.

Task: 3193121
Part-of: odoo/odoo#119185
2023-06-23 16:35:01 +02:00
Nikunj Ladava 3cb6785d4b [IMP] survey: raise access error when user dont have access of survey
before this commit,
once users got an invitation to fill out any survey and if they log in with
another credential than the shared credentials, they will be redirected to the
home page instead of a survey.

after this commit,
if the user tries to fill out the survey with another credential, an error
will be raised that the user doesn't have access

Task-2960271

closes odoo/odoo#102612

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-06-23 16:34:46 +02:00
roen-odoo 84d9344e5d [FIX] point_of_sale: fix css for cash in/out popup
Current behavior:
When the text for the button in the cash in/out popup is too long, the
first number of the amount is hidden behind the currency symbol.

Steps to reproduce:
- Install l10n_bo and PoS
- Switch language to Spanish
- Create and open a PoS with a cash payment method
- Open the cash in/out popup, enter a value.
- The first number of the amount is hidden behind the currency symbol.

opw-3324406

closes odoo/odoo#126120

X-original-commit: decafb5b7d59967d64f5bb553e95fe32c7b0ccb8
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2023-06-23 15:11:31 +02:00
Yash Vaishnav 8e3c9b7656 [FIX] hr_timesheet: remove 'No records' from task_id when searching task
Steps to reproduce:
1) Install the timesheet application.
2) Open the grid view and select a project.
3) Search for a task that does not exist, for example, 'xyz'
4) Notice that both 'Create xyz' and 'No records' are displayed

Cause:
-The issue arises when using the timesheet grid view, as the default_project_id
is passed through the context. However, when a project is initially selected,
the props do not update, resulting in the 'canCreate' value being set to false.

Fix:
-This change will allow canCreate value to be set as true when the project
is selected.
-In the timesheet grid view 'no_create_edit=True' is passed, indicating that the
user should not create and edit new tasks. Modifying this value is not
appropriate as it goes against the functionality of preventing the user from
editing the tasks.

task-3318851

closes odoo/odoo#122485

Related: odoo/enterprise#41500
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-23 13:26:55 +02:00
Yash Vaishnav b75ef2e965 [FIX] project: fix groupby and sortby issue in portal view of the project
Before this commit,
When you use the 'group by' feature in the portal view of a project, selecting
any value will group the items by stages.

However, when you choose to 'sort by' any option other than 'Title' or 'Newest',
and then navigate back to the project table using the breadcrumb, it may result
in a traceback. The reason why this error occurs is that the query string
remains in the URL even when you switch back to the 'Project' view using the
breadcrumb.

In this commit, keep_query is keeping query in URL so removing it solve
the issue. By default, the 'Stage' is used as the groupby for each project.

task-3318851

Part-of: odoo/odoo#122485
2023-06-23 13:26:55 +02:00
Victor Feyens 67568f13a6 [FIX] website_sale: portal reordering with advanced attributes
If a cart has multiple lines with the same product (custom/no_variant attributes),
opening the reordering wizard on the portal would fail, because the key used in
foreach would be the same for multiple iterations.

closes odoo/odoo#126151

X-original-commit: 80bce88e73770debe64fb401003dac35cb4f6785
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-06-23 12:07:57 +02:00