Commit Graph
166854 Commits
Author SHA1 Message Date
svs-odoo aabcdd2bc6 [MOV] purchase(_stock): separate PO & PO line
Separates the file `model/purchase.py` into two files:
- `model/purchase_order.py`
- `model/purchase_order_line.py`

Since every model should have their own file, `purchase.order` and
`purchase.order.line` have it now.

Part-of: odoo/odoo#135502
2023-10-26 07:22:56 +00:00
svs-odoo 500c837f55 [FIX] stock: clean product's views indentation
Part-of: odoo/odoo#135502
2023-10-26 07:22:56 +00:00
Pierre Paridans 963842381e [IMP] web,*: replace ClipboardJS with Web API and homebrew polyfill
*: auth_totp_portal, mrp_subcontracting, project, survey, web_editor,
   website, website_links, website_sale_loyalty, website_slides, test_lint,
   spreadsheet

Implements missing `clipboard.write()` and `ClipboardItem` ; targets
only Firefox (which partially implements Clipboard API, features hidden
behind a preference flag).

Supported browsers: Chromium 76+, Safari 13.1+, Firefox 63+, Safari iOS
13.4+.

This allows to replace ClipboardJS by the native Clipboard Web API.

Reference:
https://caniuse.com/?search=clipboard
https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API
https://w3c.github.io/clipboard-apis/

task-3439226

closes odoo/odoo#134881

Related: odoo/enterprise#47154
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-10-26 07:22:54 +00:00
jorv 54dcdda950 [FIX] mail: Make flanker log message more general
The `flanker` python library can be installed to implement optional
email address validation.
Nevertheless, it is not fully supported in python 3 (see https://github.com/mailgun/flanker).

Recent issues point to the fact that the latest pip release version 0.9.11
does not work under python 3.10.
This can lead to features, using the email validation, creating blocking
behavior due to error tracebacks.

As this is more of an issue on flanker's side than Odoo's, we remove the
`pip install` instruction. It can be assumed that someone wanting to go
out of their way to install flanker, should be proficient enough to either
make sure the python <3.10 is running or install one of the Github repo tagged
versions.

After this change, we still inform the user of the optional feature, but do not directly
incite them to pip install it, which should prevent normal users from
inadvertently blocking parts of their Odoo database.

opw-3562596

closes odoo/odoo#139800

X-original-commit: 637e60cb9687e9859d081f7367717c84d29fb82a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-26 06:16:16 +00:00
Sanchit Gupta 22619de8b5 [FIX] tools: Wrong Translation in default language
[Here](https://github.com/odoo/odoo/blob/a277faa2ffab7559fcbad95fcc1e8fd6a26d756b/odoo/tools/translate.py#L1645) If 'en_US' is exist in new_values then as a default language 'en_US' translations are loading due to that translation of default language gone lost

OPW -3482255

original translation look like this
![translate](https://github.com/odoo/odoo/assets/127722128/5c788ace-fcec-4783-b036-c6b77bea3083)

 if default language is dutch for example then instead of dutch language english's translations are there
```
en_US : <t t-name="website.test">
  <t t-call="website.layout">
          <p class="o_default_snippet_text">I transalted to english</p>
  </t>
</t>
fr_BE : <t t-name="website.test">
  <t t-call="website.layout">
          <p class="o_default_snippet_text">this french</p>
  </t>
</t>
nl_NL : <t t-name="website.test">
  <t t-call="website.layout">
          <p class="o_default_snippet_text">I transalted to english</p>
  </t>
</t>
```
 arch_db look like this
```
en_US : <t t-name="website.test">
  <t t-call="website.layout">
          <p class="o_default_snippet_text">I transalted to english</p>
  </t>
</t>
fr_BE : <t t-name="website.test">
  <t t-call="website.layout">
          <p class="o_default_snippet_text">this french</p>
  </t>
</t>
nl_NL : <t t-name="website.test">
  <t t-call="website.layout">
          <p class="o_default_snippet_text">this dutch</p>
  </t>
</t>
```

closes odoo/odoo#139111

X-original-commit: 542851c50182f32327f9cd3607081515899ddb76
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: Sanchit Gupta (sagu) <sagu@odoo.com>
2023-10-26 06:16:14 +00:00
Martin Trigaux 1e06577306 [FIX] mass_mailing: don't show inactive mailing lists
Those are no longer used and should never be displayed

Source: feedback of users that were wondering why they are subscribed
to very old unrelated mailing lists while those are all inactive

closes odoo/odoo#139442

X-original-commit: 35203a93dbb002e2e8c6943073c14acdfc5f90f1
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-10-26 05:13:31 +00:00
Thomas Becquevort (thbe) f25ede851e [IMP] account: easier payment registration for bills
Description of the issue/feature this commit addresses:

Currently, the payment registration for vendor bills is kinda hard to figure.
Noticing which bills are overdue, which require a payment is not made so easy
by the interface and could be improved. Also there is no way to register a
payment for multiple lines at a time which could improve the UX.

Desired behavior after the commit is merged :

The buttons "Bills to Pay" and "Late Bills" redirect to a Journal Items view
called Payment Items with specific filters to show only the necessary lines.

The order of the columns in the Journal Items has been changed and their
visibility has been changed too.

The default filters of the Journal Items when coming from the dashboard buttons
has been changed. Payable has been replaced by Purchases.

Filters, Group by and Search by options have been added for the Due Date
and the Discount Date fields in the Journal Items.

task-3516496

closes odoo/odoo#138188

Related: odoo/enterprise#48679
Signed-off-by: William André (wan) <wan@odoo.com>
2023-10-25 22:14:51 +00:00
Florian Damhaut 060e13ad6d [IMP] sale: Allow override line editability in portal
Add function to allow line editability to be overriden.

task-id : 3186629

closes odoo/odoo#137563

Related: odoo/upgrade#5312
Related: odoo/enterprise#48394
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2023-10-25 22:14:48 +00:00
Florian Damhaut 730c6c3011 [IMP] sale: Portal View generic IMP
Refactor the "details" part of the portal view to unify with subscription
as well as add different id "hooks" for inheritance.

task-id : 3186629

Part-of: odoo/odoo#137563
2023-10-25 22:14:48 +00:00
Antoine (ande) a4600f2790 [FIX] account: cannot make branch with generic coa
Current behaviour:
When your current company is South Korean,
The chart of account is generic.
If you try to create a South Korean company
branch, you'll get an error message:
The Currency of a subsidiary must be the same as its root company.

Steps to reproduce:
1. Install account_accountant
2. Go to Settings
3. Go to Users & Companies > Companies
4. Create a new company
5. Country: South Korea
6. Currency: KRW
7. Switch into the new company (top right)
8. Go to Accounting
9. Go to Configuration > Settings
10. Fiscal Localization: Generic Chart Template
11. Save the changes
12. Fiscal Country: South Korea
13. Main currency: KRW
14. Save the changes
15. Go to Settings
16. Go to Users & Companies > Companies
17. Select the Korean company
18. Create a new branch
19. Country: South Korea
20. The Currency of a subsidiary must be the same as it's root company.

Cause of the issue:
The generic chart of account's currency is USD

opw-3537346

closes odoo/odoo#139796

X-original-commit: 303fde24a62269159def12760e438997f6c6f147
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-10-25 20:56:17 +00:00
roen-odoo 160b404fa9 [FIX] point_of_sale: correctly delete sequences when uninstalling PoS
Current behavior:
After uninstalling the PoS module, if you try to install it again, you
get a traceback because Odoo is trying to create a sequence that already
exists.

Steps to reproduce:
- install PoS
- uninstall PoS
- install PoS
- you get a traceback

opw-3515647

closes odoo/odoo#139767

X-original-commit: c57bb574721a3610f66320dacdc703abc490d5d4
Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2023-10-25 20:56:17 +00:00
Aman Patel a56dfd43a2 [FIX] fleet: change Co2 text to CO2
Steps:
- Install fleet.
- Create new. Select a car.
- Goto `Model` page.
- Below CO2 Emissions string there is Co2 Standard string.

Issue:
- In the Engine section, there is a `CO2 Emissions` and a `Co2 Standard` field.
If these are both referring to carbon dioxide, then they should be written
consistently in the same format (CO2). Currently, one has a lowercase `o` while
the other (correct) one has a capital `O`.

Fix:
We are adding the necessary string.

task-3498197

closes odoo/odoo#139761

X-original-commit: 8b4a22baa92f196361f1ef622b55312015cf8128
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-10-25 20:56:16 +00:00
Nicolas Viseur (vin) 451f4cea3e [IMP] l10n_id_efaktur: do not consume numbers if no taxes
At the moment, the efaktur system will consume a number even
for invoices not using any taxes.
This change will try to avoid that by not consuming numbers
for invoices when no lines has a tax_ids set.

task id #3130665

closes odoo/odoo#139757

X-original-commit: 59c434773c17f81d3a1c160407e8b4533f48e911
Signed-off-by: William André (wan) <wan@odoo.com>
2023-10-25 20:56:15 +00:00
Arnaud Baes c159385502 [IMP] pos_restaurant: Make Restaurant a standalone app.
People must be able to install `point_of_sale` without `pos_restaurant`
if they don't need it. But in order to let users know that they can
install `pos_restaurant` directly, we make it an app, that will also be
selectable from the Start Trial page.

closes odoo/odoo#139733

X-original-commit: 2d9d8ea78f71669486644bdb599d2b4a5cc7a5c8
Signed-off-by: Pierre Masereel (pim) <pim@odoo.com>
2023-10-25 20:56:13 +00:00
Yannick Tivisse 7ebafb1eb7 [IMP] base: Remove manager rights to user demo
closes odoo/odoo#139731

Related: odoo/enterprise#49562
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-10-25 20:56:11 +00:00
Yannick Tivisse 4396f05296 [FIX] base: Allow saving My Profile if not group on field
Purpose
=======

Cannot currently save My Profile due to those 2 fields
- attendance_manager_id (allowed for groups 'Attendances / Administrator')
- employee_cars_count (allowed for groups 'Fleet / Administrator')

They are in the SELF_READABLE_FIELDS property, but the method
check_field_access_rights is not taking that information into account.

Part-of: odoo/odoo#139731
2023-10-25 20:56:11 +00:00
Julien Carion (juca) 1693fee3db [REF] web: remove orm service nameGet
This commit removes all usages of the nameGet method of the orm service
following changes introduced by https://github.com/odoo/odoo/pull/122085

task-3377209

closes odoo/odoo#139727

Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-25 20:56:10 +00:00
Pierre Masereel 92565aae27 [IMP] base_import_module: add fields for industry modules
closes odoo/odoo#139726

Signed-off-by: Pierre Masereel (pim) <pim@odoo.com>
2023-10-25 20:56:09 +00:00
Gabriel de Paula Felix (gdpf) a2993fc85d [FIX] microsoft_calendar: limit events request range to calendar view
Before this commit, a time window of two years was being used for requesting events occurrences from Microsoft Graph API. This way, events that were not being visualized in the calendar view were being fetched from the API many times, wasting requests and decreasing the calendar app's performance.

After this commit, this time window is limited to the range being shown in the calendar view to avoid fetching events not being visualized and then increase performance.

closes odoo/odoo#139721

Task-id: 3525764
X-original-commit: ceab3ee21d3e6eb4cfcf0a0cd8df40873744beaa
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2023-10-25 20:56:08 +00:00
Gabriel de Paula Felix (gdpf) 30132c02ef [FIX] microsoft_calendar: performance issue with a lot of recurring events
Before this commit, crap sql query were performed with a lot of recurring events were searched:

```
bad query: SELECT "calendar_recurrence".id FROM "calendar_recurrence" WHERE (((((([...]
((((((("calendar_recurrence"."microsoft_id"::text like '%:XX0') OR (
"calendar_recurrence"."microsoft_id"::text like '%:XX1'))
OR ("calendar_recurrence"."microsoft_id"::text like '%:XX2')) OR ("calendar_recurr [...]
```

After this commit, the search method was replaced for a SQL query, thus not exceeding memory limit anymore when receiving many records from Outlook.

Task-id: 3525764
X-original-commit: 2b089ce43a6290865699c3b9167edc9eb9648a3d
Part-of: odoo/odoo#139721
2023-10-25 20:56:08 +00:00
aliya c2ef126948 [FIX] account_peppol: remove inactive canceled edi users
- If an edi user needs cancellation before they were registered on the SMP,
we should let them cancel and return to the very first step.
We don't need the edi user anymore in that case (no messages could've been
received or sent) so we can safely unlink.
Same is done on the proxy side.
- With that, reopening the registration is no longer needed,
as we currently don't let users reopen their application when they're rejected.

closes odoo/odoo#139718

Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
2023-10-25 20:56:05 +00:00
aliya d5a2a802c9 [FIX] account_peppol: hide peppol_move_state on vendor bills, refunds
- `peppol_move_state` is only useful when sending an invoice/credit note.
  Hide this field from the form view and the tree view for vendor bills and refunds
- when getting new documents from the IAP, ignore messages with peppol state
  `error` as these are not useful for the users.
  Also, if there is an error when creating an invoice from the attachment,
  the vendor bill should still have `peppol_move_state` set to `done`,
  because we have received the vendor bill after all.
  Users can fill out missing details if necessary, by looking at the attachment.

Part-of: odoo/odoo#139718
2023-10-25 20:56:05 +00:00
zel-odoo 8bea49fef6 [FIX] mail:Remove duplicate autofocus code
closes odoo/odoo#139717

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-25 20:56:04 +00:00
Valeriya(vchu) 85342d72ee [FIX] sale_product_configurator: fix function _addProduct
steps to reproduce:
- create product A with optional product B
- add product A as optional of product B
- create SO with product A and add optional product B in configurator
after this commit choosing optional product is fixed
opw-3388598

closes odoo/odoo#139709

X-original-commit: b416e0b684c3e371d70db3a9f6653f1371acf972
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Valeriya Chuprina (vchu) <vchu@odoo.com>
2023-10-25 20:56:02 +00:00
Adrien Schoffeniels 6fb1d19ecd [IMP] product: move properties from product.product to product.template
Purpose:
-------
Commit [1] added the properties field on the product.product template.
However, the product.template model is more suitable to hold these
properties as the product.product model already has attributes which
are quite similar to properties.

Task-3570286

[1]: https://github.com/odoo/odoo/commit/70043822103638f651a521bd2da36cfdfd86245e

closes odoo/odoo#139702

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-25 19:37:37 +00:00
flvr-odoo 7d25e7bf92 [IMP] website: add signature to form
This commits add a signature to the website_form.

The purpose of this modification is to allow the controllers to be
able to verify that the form was originally generated from the view.

This prevent the end user to submit arbitrary values to the website_form
controller.

In this commit, email_cc and email_bcc are treated as the same fied as
it holds the same function

This does not offer protection against submission replay. Previous versions
of the form are not invalidated by editing the view.

If one need to completely reset that protection and invalidate the
previously generated website_form, the only solution is currently to
change the database secret.

closes odoo/odoo#139701

Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
2023-10-25 19:37:36 +00:00
Maximilien (malb) c123b676da [FIX] l10n_ar: traceback filter
It seems that the invisible is not working on filter and so the fiscal
country_code cannot be evaluated which causes a Traceback when trying to access
the res_partner form view.

closes odoo/odoo#139698

Task: 3270458
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-10-25 19:37:35 +00:00
hupo-odoo 128054575c [FIX] account: move bank reco menuitem to Enterprise
Without the Accounting app and the Bank Reconciliation part, the menu item "Reconciliation Models" is irrelevant. We therefore move the menu item from account to account_accountant.

task-3540705

closes odoo/odoo#139689

X-original-commit: 17f3fc980bf65f3ca4a02da998afafdfd386e0de
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Hugo Poncelet (hupo) <hupo@odoo.com>
2023-10-25 19:37:34 +00:00
Xavier Morel 39be91b48e [IMP] core: clean up the ACL tracebacks some
Currently if a record is not in the cache it raises a `CacheMiss` the
handling of which leads to loading the record from the database (or
something).

If an issue occurs during that loading, because the loading is an
`except` scope the cache miss gets linked with the new one via

> During handling of the above exception, another exception occurred:

This is both noise (the cache miss is not actually relevant) and
misleading, because the wording makes it look like an unrelated error
occurred during handling.

- move the loading of the record out of the `except` to limit the
  scope of the `KeyError` and avoid "inheriting" it
- try to `from None` a few specific errors to remove implicit linkage,
  as the new error should have all relevant information, the key error
  / cache miss is just an implementation detail

closes odoo/odoo#139680

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-10-25 19:37:31 +00:00
Eteil Djoumatchoua(etdj) 893781c9a8 [FIX] sale_project: correct the domain of task's sale order
Steps:
- Create a contact with 2 sub contacts Sub1 and Sub2.
- Create a service product with project creation on order.
- Create a quotation for Sub1 and the created product and confirm.
- Go to the created project and create a task.
- Edit the task and change the customer to Sub2.
- Empty the sale order item.

Issue:
The sale order doesn't appear in the drop list.

Cause:
Wrong domain on ``ProjectTask.sale_line_id``.

opw-3441194

closes odoo/odoo#139670

X-original-commit: 8b6bd8c92402a92efed71f97de61eaeffb0caea7
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-25 19:37:28 +00:00
Jigar Vaghela 7389345696 [IMP] product*: create product and variant by xml file
before this commit:
===================
you can not create xml record for product.template and product.product and link them for same product
if you like to achieve it you need to do it like

```
<record id="product_template_1" model="product.template">
    <field name="name">Box</field>
    .
    .
    .
    <field name="list_price">8000.0</field>
</record>
<record id="product_template_attribute_line_1" model="product.template.attribute.line">
    <field name="product_tmpl_id" ref="product_template_1"/>
    <field name="attribute_id" ref="product_attribute_color"/>
    <field name="value_ids" eval="[(6, 0, [ref('product.product_attribute_value_1'), ref('product.product_attribute_value_2')])]"/>
</record>

<function model="ir.model.data" name="_update_xmlids">
    <value model="base" eval="[{
        'xml_id': 'product.product_template_attribute_value_1',
        'record': obj().env.ref('product.product_template_attribute_line_1').product_template_value_ids[0],
        'noupdate': True,
    }, {
        'xml_id': 'product.product_template_attribute_value_2',
        'record': obj().env.ref('product.product_template_attribute_line_1').product_template_value_ids[1],
        'noupdate': True,
    },]"/>
</function>

<function model="ir.model.data" name="_update_xmlids">
    <value model="base" eval="[{
        'xml_id': 'product.product_product_red',
        'record': obj().env.ref('product.product_template_1')._get_variant_for_combination( obj().env.ref('product.product_template_attribute_value_1')),
        'noupdate': True,
    }, {
        'xml_id': 'product.product_product_4b',
        'record': obj().env.ref('product.product_template_1')._get_variant_for_combination( obj().env.ref('product.product_template_attribute_value_2')),
        'noupdate': True,
    }]"/>
</function>
```

after this commit:
==================
you can create product.tempalte and product.product from xml file and link it manully by attribute value

like
```
<record id="product_template_1" model="product.template" context="{'create_product_product': False}">
    <field name="name">Box</field>
    .
    .
    .
    <field name="list_price">8000.0</field>
</record>

<record id="product_template_attribute_line_1" model="product.template.attribute.line" context="{'create_product_product': False}">
    <field name="product_tmpl_id" ref="product_template_1"/>
    <field name="attribute_id" ref="product_attribute_color"/>
    <field name="value_ids" eval="[(6, 0, [ref('product_attribute_value_blue'), ref('product_attribute_value_red')])]"/>
</record>

<record id="product_template_attribute_value_1" model="product.template.attribute.value">
    <field name="attribute_line_id" ref="product_template_attribute_line_1"/>
    <field name="product_tmpl_id" ref="product_template_1"/>
    <field name="attribute_id" ref="product_attribute_color"/>
    <field name="product_attribute_value_id" ref="product_attribute_value_blue"/>
</record>

<record id="product_product_blue" model="product.product">
    <field name="product_tmpl_id" ref="software_reseller.product_template_1"/>
    .
    .
    .
    <field name="product_template_variant_value_ids" eval="[(6, 0, [ref('product_template_attribute_value_1')])]"/>
</record>

<record id="product_template_attribute_value_2" model="product.template.attribute.value">
    <field name="attribute_line_id" ref="product_template_attribute_line_1"/>
    <field name="product_tmpl_id" ref="product_template_1"/>
    <field name="attribute_id" ref="product_attribute_color"/>
    <field name="product_attribute_value_id" ref="product_attribute_value_red"/>
</record>

<record id="product_product_red" model="product.product">
    <field name="product_tmpl_id" ref="software_reseller.product_template_1"/>
    .
    .
    .
    <field name="product_template_variant_value_ids" eval="[(6, 0, [ref('product_template_attribute_value_2')])]"/>
</record>
```

closes odoo/odoo#139669

Signed-off-by: Pierre Masereel (pim) <pim@odoo.com>
2023-10-25 19:37:26 +00:00
Florent de Labarre 96e3f27424 [FIX] mail: show correctly qweb error
Before this commit it is impossible to find the qweb error when you preview an email template.

closes odoo/odoo#139668

X-original-commit: 1f373de5f218a1f43015f4f80e60d1da0188d6b5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-25 19:37:25 +00:00
Sébastien Theys 67d32fff44 [FIX] snailmail: tests: fix "message_tests.js"
runbot-24463
runbot-24508

closes odoo/odoo#139646

X-original-commit: f6b658a5dbc227c30830d0c60a2d862892c3306f
Signed-off-by: Didier Debondt (did) <did@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-25 18:11:12 +00:00
aliya 556b05125b [IMP] account_peppol: improve move states and filters
Structure `peppol_move_state` according to the following logic:
1. Ready to Send / Invoices confirmed addressed to partners that are Peppol valid and not in one of the other statuses. Default behavior upon posting such an invoice.
2. Queued / In case of asynchronous sending only, the instruction to send has been given via the Send & Print but the cron wasn't run yet. It is still possible to cancel the sending.
3. Pending Reception / Too late to cancel, synchronous or asynchronous sending makes it now impossible to cancel the sending
4. Canceled / Once asked explicitly by the user. It's instant.
5. Done     / Upon confirmation or delivery received from the AP
6. Error / Upon confirmation of a notification of error received from the AP

Add an action on sale journals to open invoices that are ready to be sent via Peppol

- Peppol ready filter in Customer Invoices view
- Rename `PEPPOL state` to `Peppol status` for consistency
- Pre-fill valid phone numbers in `account_peppol_phone_number` field
- Fix async sending in demo mode

closes odoo/odoo#139615

Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-10-25 18:11:11 +00:00
Claire Bretton (clbr) 489faccb78 [FIX] account: Send & Print - prevent multi email if no mail template set
We don't want to allow to send multiple invoices by email if there is
no mail template set. It would lead to unwanted behaviors.

closes odoo/odoo#139612

Related: odoo/enterprise#49477
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-10-25 18:11:10 +00:00
Claire Bretton (clbr) c0f12dc031 [FIX] account: Send & Print values on move shouldn't be copied
We don't want to copy values to be sent when duplicating a move.

Part-of: odoo/odoo#139612
2023-10-25 18:11:10 +00:00
Claire Bretton (clbr) c5c1e6a4e2 [FIX] account,*: Send & Print - remove useless param
Remove useless parameter on the `_get_wizard_values` method, coming
from previous implementations.

Part-of: odoo/odoo#139612
2023-10-25 18:11:10 +00:00
Claire Bretton (clbr) 0d3d6c8e27 [REF] account,*: Send & Print - clean computes
- Clean computes to avoid unnecessary recomputations and improve
the readability.
- Various small fixes after this refactor PR https://github.com/odoo/odoo/pull/139311:
wrong usage of `self`, missing `api.model`

Task-id: 3415101
Part-of: odoo/odoo#139612
2023-10-25 18:11:10 +00:00
Claire Bretton (clbr) da165d53a3 [FIX] l10n_es_edi: Move Send & Print files under wizard files
The Send & Print files were in the wrong folder, they must be under
`wizard` folder.

Task-id: 3415101
Part-of: odoo/odoo#139612
2023-10-25 18:11:10 +00:00
“moda” 4db538611d [IMP] point_of_sale,pos_*: automaticaly paid order when amount is 0
*: pos_online_payment_self_order,pos_restaurant,pos_self_order

Previously, when self order was set to "pay after each" and a user
ordered an order with a total of $0.00, the order was not automatically
set to paid status, as is the case with point_of_sale.

Now, when the self order is set to "pay after each" and an order with a
total of $0.00 is placed, it will be automatically paid.

Minor fixes:
- A props has been removed from `ReceiptHeader` because it was causing
an error in debug mode.
- In point_of_sale, when an order was placed with a total of $0.00, an
error was raised during validation because no payment method was
selected. Now, before checking this payment method, we first check
whether it exists.

closes odoo/odoo#139555

Related: odoo/enterprise#49442
Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com>
2023-10-25 18:11:05 +00:00
vlst c12a87180e [REF] pos*: remove getSteps
pos*: l10n_es_pos, point_of_sale, pos_hr, pos_loyalty, pos_online_payment,
      pos_online_payment_self_order, pos_restaurant, pos_sale, pos_self_order

In this commit we refactor all the pos tours.

Changes:
 - Removed the `startSteps`, `getSteps` functions as they were
   no longer serving a purpose. We now simply put the tours steps
   in the array returned by the function given to `steps`. We
   apply `flat()` to this array in order to be able to provide both
   single steps and arrays containing multiple steps;
 - removed the classes from the tours. Now each helper function
   is simply exported from it's file and is consumed as `import * as myHelpers`;
 - removed the `do`, `check`, `exec` subpaths as they were not providing
   a clearer api. The functions themselves already have descriptive names.
   ( writing `ProductScreen.do.clickHomeCategory()` is not clearer than
   `ProductScreen.clickHomeCategory()` )
 - formatted all files.

closes odoo/odoo#139317

Task: 3565443
Related: odoo/enterprise#49313
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-10-25 18:11:01 +00:00
williamandh4818 dc696c8ed4 [IMP] analytic: allow cross analytics
Purpose
=======

Make it possible to compare analytic values between plans by inputting
up to one account per plan on each line.
For instance, if we have 2 plans: "Country" and "Product Type", with the
following accounts

| Country | Product Type |
| ------- | ------------ |
| BE      | Drinks       |
| LU      | Food         |

And the following invoices:
* 1000€ of drinks in Belgium
* 2000€ of food in Belgium
* 3000€ of food in Luxemburg

We want to be able to display the following pivot tables:

|     | Drinks | Food | Total |
| --- | ------ | ---- | ----- |
| BE  |   1000 | 2000 |  3000 |
| LU  |      0 | 3000 |  3000 |
| Tot |   1000 | 5000 |  6000 |

|        | Total |
| ------ | ----- |
| Food   |  5000 |
| * BE   |  2000 |
| * LU   |  3000 |
| Drinks |  1000 |
| * BE   |  1000 |
| Total  |  6000 |

Implementation
==============

* `ir.fields` are added/removed dynamically on `account.analytic.line`
* Each analytic plan corresponds to one field on `account.analytic.line`
* The fields are added dynamically in the views.
* `account.analytic.plan` doesn't have a `company_id` field anymore,
  meaning that all the companies have access to all the plans. This
  means that the applicability fields and lines are now company
  dependent, and those can be used to know which fields/plans to display
  for which company.
* There can no longer be one "Project" plan per company, even if the
  accounts of that project can still be owned by only one company.
* There is now only one method to get the default (or "Project" plan),
  which is `_get_plan_columns`

task-3497653

closes odoo/odoo#139225

Related: odoo/upgrade#5306
Related: odoo/enterprise#49226
Signed-off-by: William André (wan) <wan@odoo.com>
Co-authored-by: william <wan@odoo.com>
Co-authored-by: h4818 <ayh@odoo.com>
2023-10-25 18:10:57 +00:00
Valentin Chevalier 41440868c2 [IMP] website_sale: add shown_on_product_page on kanban view
closes odoo/odoo#137975

Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-10-25 18:10:55 +00:00
Valentin Chevalier e3fe2b01f1 [IMP] web,sale: allow selection widget in kanban view
Currently, users who want to change the visibility of product's
documents need to open their form view and edit it.

The selection widget now allows users to quickly edit the way a document
is displayed to their customers from the product's documents kanban view.

Part-of: odoo/odoo#137975
2023-10-25 18:10:55 +00:00
Arnold Moyaux 7dda6bb927 [REF] stock: quantity pocalypse
The rational is:
Currently we have 2 columns. One for reservation, the other
for quantity picked.

However in real time, either you follow the reservation and everything
goes well. Otherwise you pick something else. In the case where you
pick somewhere else than reserved, you would like to modify the
reservation to have something similar and free the quantity you
didn't pick and expect the system to not suggest the ones you took.

In other hand, we always want to have the reserve quantity similar to
the done.

On top, having two columns could be confusing for the end user.

The cons:
-The qty_done column could be use during the picking, to
remember if something has been pick or still to pick.
- For some flow (put in pack), it's easier to write a part of the quantity to pack
and still want to reserve the full amount of product.

We goes back and choose a ligther interface over complex feature.

Changes:
Qty done and reserved qty are merged into a single column.
A new checkbox on the move exists to mark it as picked or not
Since the reservation always follow the quantity, it's now possible
to have more reserved quantity than stock. However the system will
never propose it and the inventory showing reserved > quantity should
be a warning.
The system should never modify a move that has been picked. We don't
want to overide the user action.

Regression:
Not able to pick a single stock.move.line

closes odoo/odoo#137864

Related: odoo/enterprise#48709
Related: odoo/upgrade#5310
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-10-25 18:10:54 +00:00
Loukas Wets (lowe) c43297435c [IMP] pos_restaurant: default floor plan when new config
In this commit a new default floor plan is added along with one table when
creating a new restaurant pos_config. It ensures that the default floor
is removed for the demo data and for the tests.

closes odoo/odoo#139594

Signed-off-by: David Monnom (moda) <moda@odoo.com>
2023-10-25 17:03:23 +00:00
anhe-odoo 02c4f52a9a [FIX] spreadsheet_edition: fixes image export in .xlsx
Task Description

o-spreadsheet now allows to insert images in a spreadsheet, and
we also allow to export them inside .xlsx file. However, while this
works as intended in a standalone o-spreadsheet server, it doens't
work correctly in Odoo as the data of the image are not found while
we try ton convert the spreadsheet to an xlsx file. This PR aims to
simplify the request made to get the binary data of the image file.

Related task

closes odoo/odoo#139549

Task: 3524473
X-original-commit: 301a98c
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-10-25 17:03:21 +00:00
Bastien (bvdn) 78f551b2fc [FIX] project: allow state reset for stage batch modification
The onchange on the stage_id/project_id wasn't triggered when modifing tasks in batch
we are now putting the same conditions as the onchange but in the task write() method

closes odoo/odoo#139491

X-original-commit: 0accffc0eb65f40e44d31402a0a362abaaa9b9bd
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-25 17:03:20 +00:00
Mathieu Duckerts-Antoine 998ef1f63a [IMP] tools: ignore set in view expressions
Now that some field attributes like invisible are given by Python expressions
and that those can involve some set operations, we have to ensure that
the views can be validated if they use such operations. We do that and
add a test.

closes odoo/odoo#139451

Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-10-25 17:03:19 +00:00
Mathieu Duckerts-Antoine 39e5124170 [IMP] web: support set intersections in condition tree
Now that some field attributes like invisible are given by Python
expressions that can involve set operations, we want to be able to easily
edit those expressions in the expression editor. For this we have to
improve a bit the mapping expression <-> condition tree, in order to
have simple rewrittings like
"set(user_ids).intersection([1, 2])" <-> condition('user_ids', 'in', [1, 2]).

Part-of: odoo/odoo#139451
2023-10-25 17:03:19 +00:00