Commit Graph
8378 Commits
Author SHA1 Message Date
Horacio Tellez (hote) 4c484a9822 [FW][FIX] sale: method call over self instead of precise record
Each order does necessarily have the same confirmation template.
And `_get_confirmation_template` is `ensure_one` so it raises when self holds multiple records.

closes odoo/odoo#128743

Forward-port-of: odoo/odoo#128551
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-07-17 18:13:45 +02:00
Maximilien (malb) a6414b9dde [IMP] sale: tooltip change
Change of tooltip for "expense_policy"

task-3342969

closes odoo/odoo#124683

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-07-14 20:34:47 +02:00
Gurupreet Singh 94d4205751 [IMP] sale: allow the customer to sign in the quotation
Previously, customers were not allowed to sign a draft quotation.
We consider that if the customer has access to the quote, he should be able to sign/pay it (instead of getting some strange feedback that the order is not in a state requiring signature/payment)

task-3340541

closes odoo/odoo#124486

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-07-14 15:34:46 +02:00
Maximilien (malb) ea8acc17b4 [FIX] account,sale: Sale person and team
When creating a Vendor Bill, the default Sales Team & Person of the company is
assigned to the Vendor Bill. The field isn't even displayed, it's hidden, you
can only display it with Studio and can't even change it.

The fact is : purchases and sales are two completely different roles and
business in companies. This has the indirect consequence that any user that
follows the default Sales Team will get notified of any new Vendor Bill created
in Accounting, which he very likely does not need/want to see.

This PR correct that by adding a condition on the filling of these fields. These
 fields will be filled when the move is a sale document.

closes odoo/odoo#120628

Task-id: 3279233
Related: odoo/enterprise#44034
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-07-13 16:52:46 +02:00
Dylan Kiss (dyki) 75c6917b4e [FIX] account,sale: split partner credit from sales and invoices
Since 7bd93cc64b, we add the amounts to
invoice from sales order to the credit limit warning. When looking at
the credit amount on a partner from an accounting perspective, it is
not correct though that sales orders to invoice are considered as well.

In this change we split the credit amount from invoices and from sales
orders to invoice. On the partner we only show the credit amount from
invoices. In other places we add both.

task-3375260

closes odoo/odoo#128158

X-original-commit: 94eae9b73995dbf2175ecee65548ace5a382f5f8
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Dylan Kiss (dyki) <dyki@odoo.com>
2023-07-13 02:21:50 +02:00
Soam (sold) e1295ee65f [FIX] sale: fix amount to invoice for credit notes
Issue:
The `_compute_amount_to_invoice` computation wasn't taking
into account the fact that invoices have a direction (i.e. either
going outbound(+) or coming inbound(-) (cf. `_compute_direction_sign`)).
This, in turn, makes the value of `amount_to_invoice` incorrect
for sales order with a credit note.

Solution:
In  `_compute_amount_to_invoice`, multiply the value of
`invoice_amount_currency` with the opposite of  the
`direction_sign` of the invoice, to account for the invoice direction.

opw-3360439

X-original-commit: 06ef17f2eefe89abfca64721185ac053fa8de820

[FIX] sale: fix amount to invoice for credit notes

Issue:
The `_compute_amount_to_invoice` computation wasn't taking
into account the fact that invoices have a direction (i.e. either
going outbound(+) or coming inbound(-) (cf. `_compute_direction_sign`)).
This, in turn, makes the value of `amount_to_invoice` incorrect
for sales order with a credit note.

Solution:
In  `_compute_amount_to_invoice`, multiply the value of
`invoice_amount_currency` with the opposite of  the
`direction_sign` of the invoice, to account for the invoice direction.

opw-3360439

closes odoo/odoo#127914

X-original-commit: d258774f120fb470d969e68c05cf0d8da0c4557a
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-07-10 16:59:45 +02:00
Xavier ALT 4b2106298d [FIX] sale, account_payment: fix saleman payment transactions access error
Since odoo/odoo@2b1e2abda3 user need at least 'Account / Billing'
access to read payment.transaction, that not the case for most salesman.

So for user that don't have 'Account / Billing', this commit do:

- compute the 'amount_paid' as superuser
  (fixing "Generate Payment Link" wizard access errors)

- hide "Payment Transaction" smart-button on invoice

closes odoo/odoo#127835

X-original-commit: ad2c3a873a926ac8c94d014af24ed400b493493e
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Xavier Alt (xal) <xal@odoo.com>
2023-07-10 08:56:27 +02:00
Demesmaeker 466ee8f5fe [FIX] sale: use partner language for terms and conditions
opw-3253362

closes odoo/odoo#127759

X-original-commit: 6ddd981734686a2ac8f5279b8f464738dec1f4ea
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2023-07-07 17:57:58 +02:00
Victor Feyens 40cc4a7b1a [FIX] sale: do not quick_create sales orders
closes odoo/odoo#127343

X-original-commit: 29c535069d1eee123b844aa89f8f3b43d3a7af71
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-07-06 16:23:59 +02:00
Odoo's Mergebot 566a93567b [MERGE] base,hr: Remove Private Addresses
- The private addresses have been removed from the "res.partner" model.
- The employees' private address information has been moved to the "hr.employee" model, preserving the old records but emptying the private information fields.
- The applicant's private address information has been moved to the "hr.applicant" model, following the same approach.
- More generally, some efforts have been done to ensure we only create and use the same partner from the application form, to the employee creation and also the user creation.
- The salary configurator offer mechanism has been improved to provide stability (no more arguments in URL), traceability (track changes and responsibles) and reporting.

closes odoo/odoo#120586

Taskid: 3101400
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-07-05 17:33:59 +02:00
Arthur Detroux (ard) 7b2bbb9c52 [FIX] account, sale: fix dependency on PortalHomeCounters
Prior to this commit, the patches done by `account_portal.js` and
`sale_portal.js` were done without any import.

This means that the widget it modifies (PortalHomeCounters) might not
already be loaded in the registry. This could lead to some issue later.

This commit uses an "import" statement on the module that defines
PortalHomeCounters to ensure that it is present in the registry.

task-3249625

closes odoo/odoo#127371

X-original-commit: 7937dbec9699e7d0f68450c469c9b742446303eb
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-07-05 14:34:04 +02:00
Yannick Tivisse b1f7e56f79 [IMP] base: Remove private res.partner type
- Improve performances, as the ir.rule restricting private partners
  visibility is also applied on res.users by inheritance, on each
  prefetch.
- Solve the issue of partners set as followers on records (eg: application
  form) and then made private, making them impossible to contact via the
  chatter.
- Solve the multiple access issues when trying to access the bank
  account, or the private address for non HR people like the accountants
  forcing the usage of sudo in the business code.

TaskID: 3101400
2023-07-05 14:21:28 +02:00
Géry Debongnie 4a5dc95fb3 [FIX] sale: sol_product_many2one should not crash
The `sol_product_many2one` field is a sub many2one field that should
open the proper configuration system, such as the product configurator.

Before this commit, when inputting some data, then clicking on another
notebook tab, we would often see a crash, because the field has been
destroyed (since it is no longer in the current tab) and it tries to
open the configurator, which requires rpcs.

It is usually a problem when a destroyed component tries to perform some
work. Note that it happens at creation and update. Also, the field
overrides some many2one methods that display confirmation dialog. To fix
this, this commit simplifies the field by only calling the configuration
methods when its value has changed. This is a different strategy that
does not interfere with the many2one basic features. Also, it does not
crash since it will only call the configuration methods on patched, so
it is guaranteed to be alive.

It is certainly not a complete solution, since we should probably move the
code somewhere else not in a field widget, but this would require a
redesign of the code, so it is not appropriate in a bug fix anyway.

Note that the tour had to be adapted, since now the methods
_onProductUpdate/_onProductTemplateUpdate are now called in an effect
(so after a render), which is slightly later than before. But the tour
would click on confirm even before the product update code was executed,
which means that the product was not properly configurated.

This is clearly a concurrency problem: the product configuration code
should be properly coordinated with the basic model, but doing so is a
significative change. Also, in practice, it is not worse than before
this commit.

opw 3178297

closes odoo/odoo#127048

X-original-commit: de7a6f5f3d83356eb02f8fc25b4a0b8aabb946b3
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-07-03 15:37:32 +02:00
Florian Charlier 77f9ff50db [REF] *: use onboarding module
* = account{_payment}, base, onboarding, payment{_stripe},
sale{_management}, web, website_sale

Use the dedicated onboarding module introduced in 16.0 instead of
the res.company model to store onboarding progress.

It allows
 * onboarding steps to be reused across panels
 * to support steps that should be completed per-database or per-company
 * to clean the res.company model from many fields and methods,
 * to remove many views, controllers, actions

Module-specific notes:
* account: We also clean the remaining two steps that are not
part of an accounting panel but make the most sense to be kept here.
* account_payment: Following 8e4e8eb8, the payment provider step is
added to the invoicing onboarding panel. We apply this change here too.
Also impacts the website_sale_dashboard panel (see related ENT PR).
(The "sale tax" one is currently used for to the website sale dashboard).
* payment: Note that the step was already not part of an onboarding
panel within this module.
* website_sale: We clean
  * a field not used (The website_sale dashboard onboarding panel used
  the payment_provider_onboarding_state field).
  * a method that was only called from website_sale_dashboard, so it is
  moved there. See related ENT PR.

Includes a few tests.

Moving views/templates/styling, as well as cleaning residual onboarding-related fields and methods in base, including populate.

This also includes restoring the "onboarding_complete" overlay panel
animating it to disappear after a few seconds so that it doesn't hide
text and block buttons to re-open steps.

Task-3025136

Part-of: odoo/odoo#104223
2023-06-30 23:37:50 +02:00
Joren Van Onder 5921343c2a [ADD] l10n_br_sales: localize customer-facing quotations for Brazil
Brazilians don't expect to see tax-related info on quotations. This
modifies the quotation PDF and online quotation views. Adding t-ifs
with position="attributes" was considered but doesn't play well with
other modules who would want to modify the same elements in some way.

Therefore a similar approach to account.report_invoice was
taken. Small functions on sale.order will determine what views will be
used. This allows l10n_br_sale to dynamically return its own
primary=True views when Brazilian records are shown.

task-3325740

closes odoo/odoo#122987

Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-06-30 00:20:45 +02:00
Rémy Voet (ryv) c5cb357d90 [IMP] *: add dependencies to display_name field
The previous commit introduced an optimization to reduce the number of
queries and fields fetched when we call `name_search`. But it works much
better when the dependencies of `display_name` contain field names used
in the calculation (on the same record/model).

Then, to improve the performance and the cache coherency, add `depends`
and `depends_context` depending on the custom `_compute_display_name`.
Add only the first level of dependencies (never traverse relational
field) because only these have a positive impact on the previous
optimization and the cost is very low (see `modified`).
About `depends_context`, we don't include `lang` because (when `_` is
used by example) it is unlikely to get the same display_name in the same
request with two different lang.

closes odoo/odoo#122085

Related: odoo/documentation#4639
Related: odoo/enterprise#42599
Related: odoo/upgrade#4780
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-06-28 17:41:19 +02:00
Rémy Voet (ryv) 3c62ca1eb9 [REM] core: remove name_get API
Rationale
=========

Since v8, the `display_name` field is present on all models. By default,
`display_name` uses `name_get` which has pretty much the same purpose
(return record name used by the web client). Gradually, many (backend)
developers (and the ORM: https://github.com/odoo/odoo/commit/6da1c3ac4c036eac289597602976538e243cb939)
started using `display_name` (more convenient than
`record.name_get()[0][1]`) but it still had the `name_get` override.
It becomes more complex than necessary and poeple start to misunderstand
the two (and sometimes override both, leading to inconstiencies between
`display_name`/`name_get`).

To simplify the ORM and the API, we decided to keep only one of them,
the `display_name` field:
- It is much more convenient from a backend point of view
(`record.name_get()[0][1]` vs `record.display_name`)
- It is cached during the same transaction (and invalidated if
its dependencies change)
- It can be overridden like any other compute field (override
`_compute_display_name` with any extra dependencies)
- `name_get` is replaced by `read(['display_name'])`
(API perceptive), which can actually be more efficient
(if `display_name`'s depends are correct, the ORM will only fetch the
fields it needs instead of every prefetchable field)

Changes
=======

- Deprecates `name_get` for the v17 and based the method on
`display_name` (the opposite of before)
- Converts all usage of `name_get`
- Overrides of `name_get` are now overrides of `_compute_display_name`
- For `res.partner`, rename the field store `display_name` into
`complete_name` because `display_name` context-dependent and it makes
no sense to have a compute store that is context-dependent.
- Previously, it was possible to return multiple names for the same
record with `name_get`, but it was tricky and most of the usage of
this `name_get` didn't take this into account. The only example of
this is the `name_get` of `product.product`
(now use `", ".join(<names>)`).

Part-of: odoo/odoo#122085
2023-06-28 17:41:19 +02:00
Victor Feyens b1427153f8 [FIX] sale: forbid payment term change on confirmed SO
Same behavior as for pricelist.

closes odoo/odoo#115871

Related: odoo/enterprise#38427
Related: odoo/upgrade#4452
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-06-22 15:40:51 +02:00
Victor Feyens 17bece3e79 [REF] sale,*: remove locked (done) SO state
It's not a specific state, it should be considered separately,
as a boolean.

This allows to reduce code complexity (flows should not rely (much) on
the locked logic) and to have a clearer flow.

Task-3163931

Part-of: odoo/odoo#115871
2023-06-22 15:40:51 +02:00
hote 8447c93ba2 [FIX] sale: currency conversions and rates
Before this commit the reports in sales and associated app suffered from a confusion between
multiplicative and divisive rates for currency conversion. After this commit this will no longer be
the case.

There are several models with their own currencies that are involved in computing the amount of a
sale order:
- the order's company currency `order.company_id.currency_id`
- the order's pricelist currency `order.pricelist_id.currency_id`
- the product's currency for each product in the sale order `product.currency_id`

In the case of a report we need also to take into account the current user's company currency:
`self.env.company.currency_id`.

The `sale_order.currency_rate` is the **multiplicative <u>rate</u>** to convert from the company
currency into the SO currency.

Any product added to a sale order follow the next conversion. Let `conversion_rate` be the conversion
rate between the product's currency and the order's company currency, then:
```python
product_amount_converted = product.list_price / conversion_rate

order.amount_total +=  product_amount_converted * order.currency_rate
```

The rates returned by `_get_query_currency_table()`, on the other hand, are computed as the
**multiplicative <u>ratio</u>** to convert from each company currency into the current user's
company currency.

Any order that is to be analysed on a *report* follow the next conversion. Let `current_company_currency_rate`
be the conversion rate between the order's company currency and the current user's company, then:
```python
order_amount_in_cmp_currency = order.amount_total / order.currency_rate

report.order_id.price_total = order_amount_in_cmp_currency * current_company_currency_rate
```

What follow is a numerical example. Suppose you have the following multi-company and
multi-currency environment.

|order.id|order.company  |line.subtotal|order.currency|order.currency_rate|
| ------ | -----------   | ----------- | ------------ | ----------------- |
|1      |BE Company (EUR)|1000         |INR           |89.46              |
|2      |BE Company (EUR)|2000         |USD           |1.09               |
|3      |BE Company (EUR)|3000         |EUR           |1.0                |
|4      |US Company (USD)|4000         |USD           |1.0                |

If we try to convert all of this for reporting in the US company, the currency table returned by
`_get_query_currency_table()` will give this (company currencies vs USD):

|currency_table.company|currency_table.rate|
| -------------------- | ------------------ |
|BE Company (EUR)      |1.09                |
|US Company (USD)      |1.0                 |

Finally, in order to convert each amount into USD, applying the formulae listed above should give
the following result:

|order.id|order.company|display_price_usd           |
| ------ | ----------- | -------------------------- |
|1       |BE Company   |1000 / 89.46 * 1.09 = 12.18 |
|2       |BE Company   |2000 / 1.09 * 1.09 = 2000.00|
|3       |BE Company   |3000 / 1.0 * 1.09 = 3270.00 |
|4       |US Company   |4000 / 1.0 * 1.0 = 4000.00  |
|Total (USD): 9282.18|

Task - 3277006

closes odoo/odoo#125402

X-original-commit: e8f7a692eaf6b87ccf4a8d95b7a46146b1199bf2
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Horacio Tellez Perez (hote) <hote@odoo.com>
2023-06-22 08:34:58 +02:00
Victor Feyens b31a6aec1c [IMP] product,(event_*)sale: clarify (& deprecate) pricelist context
The whole contextual price of products relies on multiple context keys:
* uom
* pricelist
* quantity
* date

The related logic has already been partly removed/deprecated on products,
but the computation of discounts for events/event booths are still relying
on that logic, though imperfectly.

This commit makes sure this hacky logic (relying on those contextual keys)
is as clear and reliable as possible.
We factorize and harmonize the remaining use cases, with a dedicated constant
and specific methods, making sure:
* currency conversion
* price & discount computations
are coherent, while clearly explaining that it should not be used for
any new feature/logic/code.

We also restrict context updates as much as possible (there won't be
any discount when the pricelist is configured to hide the discount from the customer)

closes odoo/odoo#123848

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-06-20 15:58:03 +02:00
Valentin Vallaeys (vava) d41720648d [FIX] sale: format draft downpayment date
task-3299805

closes odoo/odoo#120972

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-06-20 09:10:56 +02:00
Valentin Vallaeys (vava) ba954604e5 [IMP] sale: add downpayment ref on SO line
When a SO has several downpayment, they all have the exact same
description "Down payment" which does not provide much information.

This commit adds the invoice reference and the date.

task-3299805

Part-of: odoo/odoo#120972
2023-06-20 09:10:55 +02:00
smna-odoo b3baa64adb [FIX] sale: prevent traceback while add new product in sale order line
An error occurs because to convert the amount in sale order line company is
required.

when user remove the company and tries to add a new product in sale order line
error occur.

applying these changes will resolve this issue.

sentry-4090085761

closes odoo/odoo#125575

X-original-commit: c04bc8026eae79c01fb9315d8063b12d3a1e2fa8
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Smit Nagar (smna) <smna@odoo.com>
2023-06-19 16:40:07 +02:00
Samuel Degueldre 81be42d8f9 [FIX] *: ensure tour tips are correctly translated
*: account, crm, crm_iap_mine, event, hr_expense, hr_holidays,
hr_recruitment, lunch, mail, mass_mailing, point_of_sale, project,
purchase, purchase_stock, sale, survey, web, website, website_blog,
website_event, website_forum, website_sale, website_slides,
test_main_flows

In odoo/odoo#111103 the tour system was rewritten. The previous tour
system used to depend on the `root.widget` js module, and this module
was an async module that indirectly depended on `session_bind` which
would load the translations, meaning that the js module definition code
of the tours would only run after the translations were loaded. This is
no longer the case with the new tour system, this means that the module
definition code is executed as soon as the dependencies of that module
are fulfilled, which is generally befoe the translations are loaded,
causing most tour tips to not be translated.

This commit adds a hacky workaround for this problem: it creates a new
module that has a default export which is a promise, and has a legacy
alias, this creates an async module that waits for the translations to
be loaded. This module is then imported for its side-effect in all
onboarding tours, causing them to be translated correctly once again.

This commit also needs to convert the steps key in the tours internal
registry to a getter. In previous versions, the steps were directly
added as is to the internal state of the tour service, but since
odoo/odoo#122834 the steps are now mapped, and without a getter, any
edits to the steps occurring after registration will not be taken into
account. This causes issues in some modules that change original
behaviour of other modules (eg accounting makes invoices into a menu in
the accounting app instead of a top-level app in the home menu) as they
need to edit the steps of existing tours to make them work.

In a separate PR, we will implement a more proper fix by changing the
API of the tour manager so that we no longer need this workaround.

closes odoo/odoo#125284

X-original-commit: d130699ba82dc9919c9116f4b64a5e461ebb6319
Related: odoo/enterprise#42655
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-06-19 13:35:28 +02:00
Victor Feyens 71e10bc650 [FIX] sale: multi-company conflict at reinvoicing
Since d88409e8e5ce77ff3ec3b24fcdc108d8df380994, taxes from different companies
are forbidden on sale.order.line records (which is the expected behavior).

Nonetheless, this highlighted some flows where the taxes were not properly
set/recomputed, especially re-invoicing, which is fixed by the current commit.

Fixes #123675

closes odoo/odoo#125434

X-original-commit: 6ce4019968bd0a1a11475910d35aa2ccfc2c6a9a
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-06-16 23:01:14 +02:00
Thomas Lefebvre (thle)andFeyensv f2975ccc34 [FIX] sale: prevent the sending of a zero price
Issue:
------
When a cart is created via ecommerce, an email is sent to the salesperson
(defined in Settings/Website/Assignment).
This email contains a subtitle with the amount of the sale order.
This price is always 0.00.

Cause:
------
The email is sent during the creation of the sale order
and not after it has been updated with the product information.

Solution:
---------
Use a key in the context to prevent sending the price of a sale order.

Remark:
The email sent in this case is an assignment email only.
Mentioning the price in this case would not be relevant
if the customer subsequently updates their cart.

opw-3329722

closes odoo/odoo#125378

X-original-commit: ea883e75343e50a1603b37c5f82f8e620418c883
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
Co-authored-by: Feyensv <vfe@odoo.com>
2023-06-16 13:41:15 +02:00
MerlinGuillaume 7bbec42f07 [IMP] pos,website(_sale): link sale.report to pos.order
It's currently not possible to know which `pos.order` is linked to a
`sale.report`

Solution:
Add a field `order_reference` on model `sale.report`. This field refers
to either a "sale.order" or a "pos.order" record.
The field `order_reference` is used to count the number of distinct
orders. We cannot simply use count_distinct on the `order_id` because
there can be multiple sale.report with the same `order_id` but related
to different models (sale or POS order).

Part-of: odoo/odoo#116830
2023-06-13 14:07:27 +02:00
Fabrice Henrion 3adf466c55 [IMP] sale: string consistency
closes odoo/odoo#124774

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-06-13 10:14:18 +02:00
Preksha Chouhan 918f096ecd [FIX] sale: prevent traceback when value of tax_totals is None
When user change the move_type of account_move to 'entry'. And when user try to
access 'partner_credit' field from the form view using debug mode.
The error will be generated.

Steps to Produce:-

1. Install 'account_accountant' and 'sales' module
2. Change move_type of account_move to 'entry'
3. Go to 'Edit View : Form' of Journal Entries in account_accountant using
debug mode
4. Add field 'partner_credit' to the form or tree view and click on save
5. Click on any Journal Entry

Trace-back will be generated.

Applying these changes will resolve this issue.

Sentry-4222621594

closes odoo/odoo#124515

X-original-commit: 94c1f20aaeb89cc07bb21cab2e19da67fd10f603
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Preksha Chouhan (prec) <prec@odoo.com>
2023-06-09 18:30:37 +02:00
Thibault Delavallée be398b428a [FIX] auth_*, sale: improve 'from' of templates by adding company fallback
Emails on Sale Order, Invoice, Recovery cart. When no sales on sale.order
use "COMPANY" <email of company> as fallback before the current user.
Reason is that odoobot is often used in automatized actions and having
it as email_from is not really user friendly.

Also add company fallback in auth modules email templates (if not already
using it) for the same reason.

Task-3346388

closes odoo/odoo#124472

X-original-commit: 597fc004148bf39e8f56e36e840aa6788872f237
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-06-09 18:30:31 +02:00
Victor Feyens 4e6db76aba [IMP] product,sale: extract computation of price before discount
So that we can in the future harmonize more easily the discount
computation between sale, point_of_sale, e-commerce, ...

closes odoo/odoo#123849

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-06-06 13:10:31 +02:00
Victor Feyens 28247043a6 [IMP] (pos_)sale: allow grouping statistics by customer state
closes odoo/odoo#123691

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-06-05 16:17:06 +02:00
Victor Feyens 51edac3364 [CLN] sale: sale report fields
Part-of: odoo/odoo#123691
2023-06-05 16:17:06 +02:00
Florian Damhaut 373321d062 [IMP] sale: flatten template
- Flatten the group list in sale's SO for cleaner UI.
- Modify wording to reflect changes in enterprise PR.

related to odoo/enterprise#36968

closes odoo/odoo#112433

Task-id: 2877341
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2023-06-05 13:31:04 +02:00
ferdymercury 4b8a3fe484 [IMP] sale: allow grouping report by customer zipcode
closes odoo/odoo#123146

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-06-02 14:30:11 +02:00
Demesmaeker 06c8a16114 [FIX] sale: missing translation on the report_saleorder_document
opw-3269804

closes odoo/odoo#123243

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-06-01 17:55:20 +02:00
Martin Trigaux 2afdda2576 [I18N] *: export saas-16.3 source terms
closes odoo/odoo#123046

X-original-commit: 137f5ca0cb703ee953cb01db525362f7a778e6bd
Related: odoo/enterprise#41703
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-06-01 11:43:51 +02:00
Yolann Sabaux 249064ff8b [REV] sale: refund of bill re-invoiced
This reverts commit 33d95edd4832c4bd68bb2da2c4585e7b26db8a3c.

Following of the next steps https://www.odoo.com/web#id=3338017&cids=1&model=project.task&view_type=form

Initial opw-2992106

closes odoo/odoo#122998

Forward-port-of: #122431
X-original-commit: 9b50f49edaf1bee5cab0f42f37f92f4752654789
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
2023-05-31 07:13:56 +02:00
sergio-teruel f9edfced9e [FIX] sale: Uom field readonly for new sale order lines
closes odoo/odoo#122683

X-original-commit: 2e5c8b4eb427e580ed22417ff49cf3cb994ba88d
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-05-26 17:29:30 +02:00
Demesmaeker 217e146022 [FIX] sale,stock: differentiate container names
Following 78ae3da902 names were added to improve the view inheritance.
But some names were duplicates. This commit will ensure every name is unique to facilitate
inheritance.

closes odoo/odoo#122270

Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2023-05-25 16:29:33 +02:00
Feyensv 9d6086186b [FIX] sale: show custom ptav in the right order
The value of custom ptavs is store on the sale order line.

Currently, they are ordered by ptav id but they are ordered by the ptav
sequence everywhere in Odoo.

Now, on the sale order line, custom ptav are ordered by ptav sequence.

opw-3234669

closes odoo/odoo#122206

X-original-commit: fa25206634e11ce1fd9030508772a1802ef86fa2
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
2023-05-24 13:10:46 +02:00
Damien Bouvy c1d55ba5f7 [IMP] sale: improve form layout
Having 2 groups one after the other like this caused the labels to have
different sizes.

closes odoo/odoo#122089

Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
2023-05-23 18:01:49 +02:00
Valeriya(vchu) b17ca2536a [IMP] sale: remove line decoration for orders
the color of the lines for quotation(sent) is too noisy and not informative as there is a colored status badge. 
Remove the decoration to clear the view and decorate total amount where invoice_status = 'to invoice'.

task-3290317

closes odoo/odoo#119986

Related: odoo/enterprise#40594
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-05-23 16:31:27 +02:00
Louis Wicket (wil) 04189318cc [I18N] *: update master translations
Currently, only stable releases see their translations updated. This has
resulted in master accumulating outdated stuff for years, which can be
confusing for users testing master on runbot.

This one-shot commit resynchronizes master translations based on the
content from 16.0 and removes empty PO files (i.e. no longer containing
translations).

closes odoo/odoo#121629

Related: odoo/enterprise#41171
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-22 17:52:07 +02:00
Florent de Labarre 4382e003fd [FIX] sale: paylink does'nt work
if partner_id is diff than partner_invoice_id on sale.order.

https://github.com/odoo/odoo/blob/16.0/addons/sale/controllers/portal.py#L346

- go to runbot
- create a sale.order
- set partner_invoice_id != partner_id
- create a link
go to the link --> error

closes odoo/odoo#121905

X-original-commit: 811ed2fb763155abbaba29e8c9193166a9cc34cc
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-05-22 13:54:13 +02:00
Brieuc-brd fa60bac197 [IMP] *: app icons : add viewBox attribute
Prior to this commit, the SVG's viewBox attribute was missing, which
prevented svgs from being scaled.

This commit fixes this issue.

task-3326633
Part of task-3326263

X-original-commit: 30300c373ad1c63a6cf8b035cae0785a09c6933f
Part-of: odoo/odoo#121886
2023-05-22 13:54:08 +02:00
Brieuc-brd ee75969979 [IMP] *: app icons: replace svg to png
The introduction of Milk has brought new app icons.
Using the svg format creates a lack of anti-aliasing on the edges of the
shapes, which makes the icons look bad.
Since the png size has been reduced, we can afford to use the png format
to have the best possible quality without having a lack of performance.

task-3326633
Part of task-3326263

X-original-commit: e07cb722f2b11407a3ad093bd688b7d37afd5a88
Part-of: odoo/odoo#121886
2023-05-22 13:54:07 +02:00
Denis Ledoux 58ea5e7b43 [IMP] http.py: do not inject context by default in JSON routes
Before this revision, when you pass `context` in the arguments
of a JSON routes, this one gets automatically injected
in the environment context.

This is not the case for regular HTTP routes.

It makes sense to propagate the context for the JSONRPC protocol,
JSON routes used by the backend, such as `call_kw`,
but it doesn't make sense to pass this context automatically
for any other kind of routes, such as front-end routes
or routes used by custom Javascript widgets.

This change brings a more unified behavior for routes
of types HTTP and JSON.
In addition, most developers were not aware of this "feautre",
that passing `context` in the arguments of a JSON route leaded
to the injection of this context in the environment context.
This is actually reflected by the diff size this changes required,
only a dozens of routes needed to be adapted, to manually
add the context in their route arguments and to inject it
in their environment context.

closes odoo/odoo#121726

X-original-commit: a7a5655631e6d5b05fd2ba3d0c80617aae6d9cfe
Related: odoo/enterprise#41229
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2023-05-22 11:43:04 +02:00
Sohail Jaidi (soja) 4d3ac4cbd8 [IMP] account,*: simplify add credit note wizard
Description of the issue/feature this PR addresses:
simplification of the credit note wizard

Current behavior before commit:
First users select reverse option (3 radio buttons):
1) refund
2) cancel
3) modify

The reverse action is triggered when the users clicks on the "reverse" button

After commit:
radio button are removed. There is now two buttons that trigger directly the reverse action with the desired option (refund or modify, cancel is not available anymore)
Also, for refund, posting the draft reverse move will also reconcile with reversed move.

task id: 3244377

closes odoo/odoo#117961

Related: odoo/enterprise#40919
Related: odoo/upgrade#4667
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-05-17 13:37:54 +02:00