Commit Graph
8513 Commits
Author SHA1 Message Date
Louis (wil) 3f6f949fa5 [I18N] export sources
closes odoo/odoo#140002

Related: odoo/enterprise#49687
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-10-27 08:36:16 +00:00
jbw-odoo 61d7706d83 [IMP] account: accrual date fix
SO/PO accrued entries date should be the last day of the previous month since it necessarily concern

In the test, move the date as a user would input it in a form

closes odoo/odoo#111535

Signed-off-by: Laurent Smet <las@odoo.com>
2023-10-04 08:39:08 +00:00
Adrien Dieudonné e6c747b43b [REF] *: keyboard: replace deprecated charCode, keyCode and which properties
These properties are deprecated.

We should consider to use `KeyboardEvent.key` or `KeyboardEvent.code` for new code.
Note that we prefer to use the `key` property as multiple physical keys
can send the same value (e.g. Enter can also be sent by the numeric pad).
We should only use `code` when we explicitly want to target a single physical
key on the keyboard.

By doing this, we can now remove the dependency of `jQuery.ui.keyCode`
that was used as mapping of key code descriptions to their numeric values.

References:
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/charCode (deprecated)
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode (deprecated)
https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/which (deprecated)

https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key

https://api.jqueryui.com/1.12/jQuery.ui.keyCode/

Some links that helps:
https://w3c.github.io/uievents/tools/key-event-viewer.html
https://www.toptal.com/developers/keycode/table

closes odoo/odoo#139809

Related: odoo/enterprise#49591
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-10-26 08:46:00 +00:00
svs-odoo bc01c7bcec [IMP] product,purchase,sale,*: product catalog
This commit makes two major things:

1. Move the product catalog from `sale` to `product`.
It moves the product catalog's code from `sale` to `product` module in
order to be able to use it in other modules.
A mixin, `product.catalog.mixin`, was created for to make other models
catalog compatible.

2. It enables the product's catalog in `purchase`.
In `purchase`, the catalog differs a little bit from `sale`:
- If Unit of Measure is enable, the UoM for each product will appear in
  the catalog;
- If the product purchase's UoM or the purchase order line's UoM is
  different than the default product's UoM, the former one will be
  displayed (in bold so the user can know it's the UoM to refer);
- When opening the product's catalog from a purchase order, the products
  will be filtered by the PO's vendor;
- Some data from the vendor list will be used if appliant: the minimum
  quantity and the price;
- If there is at least one product's packaging, a button will be
  displayed to increase the qty by the packaging's one. If a packaging
  is set on the purchase order line, this one will be used.

task-3373589

Part-of: odoo/odoo#135502
2023-10-26 07:22:56 +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
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 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
Chrysanthe (chgo) df8535fbd4 [REF] portal, *: portal redesign
*: base, account, account_payment, auth_top_portal, hr_timesheet, loyalty,
   mrp_subcontracting, payment, project, purchase, sale, sale_stock,
   sale_timesheet, website_crm_partner_assign, website_sale,
   website_slides

Portal general redesign. Increase visual consistencies with the backend
[1] and adapt to the new default website design [2].

[1] https://github.com/odoo/odoo/pull/116641
[2] https://github.com/odoo/odoo/pull/120302

task-3046004

Part-of: odoo/odoo#138077
2023-10-25 15:50:36 +00:00
william-andre d8627c4e38 [REF] account,sale*: remove local cache for currency rates
Since it is cached by the ORM (see parent commit), there is no need to
manage the caching in the business code anymore.
In most cases in addition to making the code shorter, it also makes it
more readable by making the direction of the rate more obvious with the
use of the `to_currency` parameter.

closes odoo/odoo#137609

Signed-off-by: Raphael Collet <rco@odoo.com>
2023-10-25 15:50:33 +00:00
damr 3b7dd79e5f [IMP] sale: Invoicing flow improvements
This commit's purpose is to ease the the flow of invoicing from the
project app. The warning message when the user tries to invoice without
fulfilling the condition has been updated.
When the customer of an SOL is a person and belongs to a company, the
company is now also shown on the sol, in addition of the name of the
customer. The idea is that the user is more keen to recognize the
company than just the name of the person.

task-3251615

closes odoo/odoo#122611

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-25 15:50:28 +00:00
Martin Trigaux aae9c99f02 [IMP] *: convert to the new simpler syntax
closes odoo/odoo#139316

Related: odoo/enterprise#49379
Related: odoo/documentation#6189
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-10-24 21:09:58 +00:00
Achraf 0a21137baa [FIX] sale: prevent transaction confirmation with group_auto_done_setting
Steps:
	- Install `website_sale`
	- Enable `Lock Confirmed Sale`
	- Enable `On Site Payments & Picking`
	- Enable `Pay in-store` payment provider
	- Login with demo user and go to shop
	- Add a random product and go to checkout
	- Confirm and choose on-site payment/picking
	- In the backend with admin user confirm the newly created sale order
	- Go to Payment Transaction

The transaction is marked as confirmed without payment. Without `Lock Confirmed Sale` it works.

The solution is to mark transaction as confirmed only if it is `wire_transfer`

opw-3501140

closes odoo/odoo#139533

X-original-commit: 71db47cff99ce3b2090c3be5dfa3205654625d51
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
2023-10-24 15:23:25 +00:00
Xavier Morel 9ebbfdac73 [FIX] *: incorrect translations markings
Fixes a large number of cases where strings are translated then
formatted, instead of letting `_()` do the formatting internally,
which allows it to recover from incorrect translations (missing,
broken, or extra placeholders).

Also

- removes translation markers entirely when there's nothing to
  translate e.g. `_("%s - %s")` is not useful
- fixes a few messes which lead to only partial translatability
  (DRY is generally a bad idea when translations are involved, even
  more so when you don't make the variable part translatable)
- fixes a few nearby issues noticed at the same time
- replaces a few `"%s"` by `%r`, which should automatically quote
  strings relatively appropriately
- fixes translated strings which use `\` to escape a newline (in order
  to fill-paragraph): `\` escapes only the newline, if the
  continuation string is indented this results in a bunch of spaces
  ending in the string to translate, which is pretty garbage for the
  translator, using implicit concatenation works much better

Note: some of the updates revert f-string parameters to %, because
babel (2.9) apparently has trouble with f-strings and blows up trying
to extract them.

Not in scope:

Helping translators fix translatable strings e.g. any translation
string with more than one placeholder probably should use keyword
placeholders

- Provides more context / data to the translator to make sense of the
  sentence.
- Allows reordering the translated terms, which can be necessary
  depending on the sentence and language.

closes odoo/odoo#139314

Related: odoo/enterprise#49311
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-10-23 16:45:09 +00:00
damr 81a450c503 [FIX] sale: name align in product catalog
This commit's purpose is to fix the alignment between the priority
widget and the name of the product.

details of the implementation:
A 'style' was added instead of the bootstrap class mt-1 because the
bootstrap was not precise enough (step of 4px, while 2 were needed)

closes odoo/odoo#138750

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-23 14:21:42 +00:00
Victor Feyens bce00af708 [IMP] website_sale: address updates
* Avoid posting crappy forms when a redirection does the job
* use a dedicated route /shop/cart/update_address for address changes
* clean code from recent PR on invoicing address
* Public user shouldn't be able to create billing addresses
* Logged customer should always see his own partner as billing/shipping
address choices.

Part-of: odoo/odoo#138026
2023-10-20 20:52:42 +00:00
Victor Feyens 25177023a2 [REV] sale: forbid payment term change on confirmed SO
This reverts commit b1427153f8.

It seems that salesman likes to change payment terms on SO after the confirmation.

task-3562396

closes odoo/odoo#139258

X-original-commit: f83afeffeb30496ad55f901a529144db47942787
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-20 11:22:18 +00:00
Florian Damhaut ff917f5478 [IMP] sale,sale_management: Add invoicing journal to SO
Add the invoicing_journal field to SO and template.
If set, this journal will be used to when creating invoice
instead of the default journal.

closes odoo/odoo#133983

Related: odoo/enterprise#46621
Related: odoo/upgrade#5119
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2023-10-20 09:35:11 +00:00
Pierre-Yves Dufays 725e7ffae3 [IMP] various: improve custom activity views
The following summary view of the record in the activity views have been
improved:
- project_task: task state added
- project_project: project manager added
- event_event: responsible and the dates (date_begin_located and
date_end_located) added
- account_move: total amount, customer and state added
- sale_order: total amount and the state added
- purchase_order: total amount and the state added
- crm_lead: customer and stage added
- hr_applicant (hr_recruitment): recruiter added
- survey_survey: responsible added
- maintenance.request: added equipment and responsible
- stock.picking: added scheduled_date
- repair.order: responsible, schedule_date and product_id added
- mrp.production: added responsible
- hr_leave (hr_holidays): status is added and default deadline modified see
below

Ensures that "Schedule activity" is in one line by adding a colspan.

hr_leave activity: When a time off approval activity is created as a
consequence of the creation of a hr.leave, the deadline of the activity is set
to the date_from of the hr.leave minus activity type delay_count (default 15)
except if it leads to a date anterior to today. In that case it is set to
today. That way, in the activity view, the time off approval activities are
more or less sorted by related hr.leave date_from and the cell date is an
indication of when the time off is planned.

Technical note: on most activity view, the activity record was not occupying
all the horizontal space. To solve that problem the css has been modified and
the max-width (200) that was imposed on the sub div has been removed. And as
it was impossible to impose a max-width for a flex div (which is the common
case for the activity record), the max width is imposed on each text that might
be too long using the class o_text_block. That class has been modified to
impose a max-width. That's why that class has been added in most view.
Alternativly, we could have modified the activity compiler to add that class
when the attribute full was set (not done because not sure of the consequence).

Task-3300854

Part-of: odoo/odoo#138135
2023-10-19 19:08:12 +00:00
Adrien Dieudonné 1158c45e4a [REF] *: remove .oe_left and .oe_right
The first intention of this commit was to remove ´@extend´ but
it actually makes sense to remove ´.oe_left´ and ´.oe_right´ classes.

Since grid we can avoid "float" elements (see .oe_subtotal_footer)
and we only have to remove this class.
For the other case, we have to use ´.float-start' and ´float-end´
to replace ´oe_left´ and ´oe_right´.

closes odoo/odoo#139199

Related: odoo/enterprise#49211
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-10-19 18:02:21 +00:00
Xavier Bol (xbo) adb0476e5f [FIX] product,sale,point_of_sale: fix sales page visibility
Before this commit, the `Sales` page is always visible in product
form view when `point_of_sale` and/or `sale` modules are installed
even if the product cannot be sold.
The reason is because the initial condition contained in
`attrs="{'invisible': ...}"` for that page has been completely removed
since the recent changes to remove `attrs` attribute and allow having
python condition inside `invisible`, `readonly` and `required` attributes
(instead of having only True or False as value for those attributes).

This commit reviews the visibility condition for that page to completely
hide that page in product module as it is currently the case but it also
adds the condition we had in attrs. That is, in product module, the
invisible attribute for that page will be equal to `1 or not sale_ok`
(and so always invisible thanks to `1 or ...`) and when `sales` or
`point_of_sale` modules will be installed then `1 or ` will be removed
to just keep `not sale_ok` inside `invisible` attribute.

task-3506730

closes odoo/odoo#135840

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-19 14:47:20 +00:00
Maximilien (malb) 655d375af8 [IMP] account, purchase, sale, l10n_br_sales, l10n_{ar,cl}: Ui fix
In this pr: https://github.com/odoo/enterprise/pull/30853 we've merged two
settings into one to make Tax calculation & display more coherent. In the case
of a "Tax per line" computation, the column "Tax Included" is optional=hide in
the backend, but we've elected to put it in the PDF all the time.

This task we will only change the pdf and portal (preview):
1. Remove the "Tax Incl" column on all relevant templates (pdf/portal).
2. Rename the "Tax Excl" column to "Amount".

task-3552656

closes odoo/odoo#138624

Related: odoo/enterprise#48923
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-10-18 12:05:15 +00:00
Sven Fuehr b06da792da [IMP] account,*: refactor '_get_query_currency_table'
*: pos_sale,purchase,sale

The '_get_query_currency_table' function of the res.currency
model (added in 'account' module) was refactored in this commit.
After this commit the functions parameters are effectively "decoupled"
from the 'account_reports' module.

Previously the the function took an 'options' parameter.
The 'options' was a dictionary that was formatted to be compatible with
the report options from the 'account_reports' module (enterprise).
Due to a change to these report options (see enterprise PR)
the function had to be changed in some ways.

It was chosen to "decouple" it from the report options for the following reasons:
1. The 'account' module does not (really) depend on 'account_reports'
   or knows about it at all.
2. There was still a (soft) dependency on the 'account_reports' options though:
   Changes to the report options had to be reflected here too.
3. Every function that calls this function previously had to create some pseudo
   'account_reports' report options. This made it inconvenient to use the
   function outside of a report.

task-3484368

closes odoo/odoo#136173

Related: odoo/enterprise#47735
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-10-18 12:05:10 +00:00
Demesmaeker 211a5bb13b [IMP] sale(_management,_pdf_quote_builder),*: improve pdf quote builder
Following 116879e17e81657f48a7d11780d8d30715ecc68f a few improvements were needed to make it more
complete.

task-3484125

closes odoo/odoo#137522

Related: odoo/enterprise#48563
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-17 08:53:06 +00:00
Brieuc-brd 538fdab99b [IMP] *: fine-tune app icons
The aim of this commit is to improve the impact and rendering of app
icons in bright and dark mode. It also reduces the size of svg files.

To achieve that, this commit updates the colors to flat colors. This
change will make the icons stand out and improve their readability.

task-3072562

X-original-commit: 667a19162b74fb6554a2389ba9c6e69de4ff5113
Part-of: odoo/odoo#138279
2023-10-16 09:21:17 +00:00
“moda” 88ae41db5c [IMP] sale: adapt override of ProductAttributeCustomValue in sale
The problem is that a mandatory field from the sale module has been
added to the ProductAttributeCustomValue template, but in point of sale
we also use this model without necessarily filling this field.

Previously, the sale module was the only module to use the
ProductAttributeCustomValue model (product.attribute.custom.value).
In the override, a field set to mandatory has been added
"sale_order_line_id", a relationship between the sale.order.line model
and product.attribute.custom.value.

We now remove the mandatory parameter from this field so that we can
create new data without getting an error indicating that a mandatory
field is missing. This has no impact on the operation of the Sale module
as this field will be populated anyway, since the only way to create a
record of this type is via a sale_order_line or a pos_order_line.

Part-of: odoo/odoo#138013
2023-10-16 09:21:16 +00:00
Valeriya(vchu) 997aa444cb [IMP] payment: payment methods improvements
closes odoo/odoo#136525

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-10-13 21:11:53 +00:00
Roy Le bb323e3989 [FIX] account, sale: avoid error when internal user (no accounting
permissions) edit information at /my/account

Issue:
Internal user cannot edit their information (email, street,...) at
portal without permissions in the accounting

Analyze:
Because the method `can_edit_vat` has a search from the account.move
model, it causes an error

Fix:
Use sudo to avoid error when searching

closes odoo/odoo#138291

X-original-commit: eb9505375483d18cf21fbaf8e5a60398d5c041c5
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-10-13 11:46:18 +00:00
Antoine Vandevenne (anv) 3ef9310ec3 [FIX] (account_)payment, sale: check document access in payment routes
Commit 4d1a1f1c introduced a systematic check on the kwargs passed to
transaction routes of modules integrating with online payments, but
failed to check the access token of documents whose ID is passed to
payment routes. This allowed retrieving the access token of such
documents by visiting a route that did not check the document access
(e.g., /my/payment_method) and passing an arbitrary document ID
(e.g, sale_order_id=123). The route's controller would reroute the
payment flow to the document's portal page and render the landing route
of the flow on the payment form, with the access token included.

This commit makes sure that we always check the access token of a
document before reading rerouting a payment flow.

closes odoo/odoo#138238

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-10-12 13:16:46 +00:00
Bastien (bvdn) 94fbc58c1b [IMP] sale_stock: adapt product_catalog for stock module
When the stock module is installed some conditions changes in the sale orders
Here's the list and the implementation made to help this

Patched the kanban_record so that the asked_qty of a product cannot go below the delivered_qty

the delivered_qty is added in the productCatalogData of the record through the _get_catalog_info() hook in the following PR:
https://github.com/odoo/odoo/pull/132341/commits

Patched the sale_order_line xml to disabled removeProduct and decreaseProduct buttons when the quantity is equal to the
delivered quantity

if the user tries to remove an already delivered product it'll set to the delivered quantity instead of 0
if the user tries to set a quantity that is below the delivered quantity it'll set it to the delivered quantity

Added action action_product_forecast_report to the menuitem of the products

Task-3343547

closes odoo/odoo#127161

Related: odoo/enterprise#43469
Related: odoo/upgrade#4887
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-12 13:16:39 +00:00
vava-odoo 7202a632ca [FIX] sale: fix filter domain
Typo from commit: https://github.com/odoo/odoo/commit/216fa84fbe2c

closes odoo/odoo#138430

X-original-commit: 64ddd715af26efb2763bb255132f058036e0038e
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
2023-10-11 18:03:34 +00:00
Michael (mcm) 7ebd785764 [IMP] *: rename quick_add into quick_create
This commit renames calendar's attribute quick_add to quick_create
to be more consistent with other views.

closes odoo/odoo#138042

Related: odoo/enterprise#48677
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-11 17:02:07 +00:00
Aaron Bohy 4bf1384e8b [REF] web,sale,portal: adapt SignatureForm to owl
This commit converts the SignatureForm widget into a Component.
This allows to remove the last usage of the legacy NameAndSignature
widget, which we thus remove.

Part of task~3439226

Part-of: odoo/odoo#138054
2023-10-11 08:18:46 +00:00
Kartik ChavdaandKamlesh Pathekar e3bc974ea4 [IMP] base,** : make error message user friendly
Before this commit error messages in odoo are boring and
not much attractive to user. Those were like odoo is preventing
them from doing something user want to do.

In this commit, we have modified the message to be a more friendly
and humorous tone, making it less tedious and more enjoyable. It
aims to enhance the user experience and ensure that interactions
with any application are both pleasant and informative. As a result,
the messages have been clear, short, easy to understand and informative.

task-3356114

Part-of: odoo/odoo#124820
Co-authored-by: Kamlesh Pathekar <kpt@odoo.com>
2023-10-10 12:34:56 +00:00
Florian Damhaut a656a5a9a4 [FIX] sale: fix mail template
Fix mail template for better intergration in sale subscription.
Improve english too.

task-id : 3366756

closes odoo/odoo#137988

X-original-commit: 8c94250126876009e94590e0ae5e931185fdc8b1
Related: odoo/enterprise#48605
Signed-off-by: Florian Damhaut (flda) <flda@odoo.com>
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2023-10-09 20:31:48 +00:00
nikj-odoo 2719b2100d [IMP] sale: add improvements in fields & reporting in sale app
Improve following feature :

-  visible if someone signed the quotation and it should be readonly on the
    quotation.
-  make optional field "customer reference" in list view.
-  make optional field "Expiration" in list view.
-  add sub-menu under the reporting menu:
       1. "Sales" :- redirect to the current report.
       2. "Salespeople" :- redirect to the current report but grouped by
                           salesperson.
       3."products":- redirect to the current report with group by produts.
       4."Customer":- redirect to the report with group by customers.

task-3369999

closes odoo/odoo#133780

Related: odoo/enterprise#46641
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-06 18:18:26 +00:00
Martin Trigaux 22ab49e343 [IMP] *: use file_path and file_open
Replace all the calls to get_resource_path to the better file_path or
directly use file_open when not needed

Doing both a get_resource_path and file_open means checking twice that
the file exists.
Doing a simple path concatenation before a file_open is safe.
If given to another method (e.g. etree.parse), calling file_path is
the prefered method.

Note that get_resource_path used to return False when the file does
not exists while file_path/file_open raises a FileNotFoundException

closes odoo/odoo#135607

Related: odoo/upgrade#5187
Related: odoo/enterprise#47475
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-10-06 14:33:43 +00:00
Valeriya(vchu) ac18850621 [FIX] account, portal, sale, website_sale: fix name editing
Name can be edited more frequently than VAT, and we should
have a dedicated method to check whether it can be edited
or not.

closes odoo/odoo#118428

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-06 13:08:53 +00:00
shag-odooandVictor Feyens bf95b1f2ad [ADD] sale: new wizard to apply discounts on sale orders
Replace the magic js logic applying the discount of the first line to all
the lines by a dedicated wizard, providing three kind of discounts:

* Discount on each sale order lines
* Discount on the global order amount
* Fixed discount amount

task-3369680

closes odoo/odoo#129087

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: Victor Feyens <vfe@odoo.com>
2023-10-06 09:39:19 +00:00
nikj-odoo 093b2f56fb [FIX] web,sale: Add domain & show action helper when there is no data
In this commit, show action helper when we had not data show in graph view.
same as we have in pivot view.

- add domain for cancelled records to not showing in reporting.

task-3500508

closes odoo/odoo#137735

X-original-commit: a50e73a2ae04fac9fcfea77cbab27e0b5de66fcc
Related: odoo/enterprise#48473
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-06 06:14:13 +00:00
Anita (anko) 50af195669 [FIX] sale: report grouping fix
Group by "Product" was grouping by product
variant instead of product template.
Grouping by "Product Variant" is added.

closes odoo/odoo#137690

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-06 06:14:06 +00:00
Valentin Vallaeys (vava) 8e3ffe7800 [IMP] sales: add discount on SOL in kanban
Before this commit, the discount was not displayed on SOL in mobile
view.

This commit adds the discount when it exists.

task-3111127

closes odoo/odoo#137416

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-06 06:14:02 +00:00
Jorge Pinna Puissant ef424a9dc2 [REF] *: remove owl from linter's accepted global variables
Before this commit, owl was in the linter's accepted global variables.
This allowed  direct access to owl global object.

For instance, to use xml from owl, you could do :
`const { xml } = owl;`
or you could use it directly:
`owl.xml`

Now, owl is not accepted on linter's global variables anymore, so to
import xml, now you need to use a proper import:

`import { xml } from "@odoo/owl";`

task-id 3498859

closes odoo/odoo#137517

Related: odoo/enterprise#48364
Related: odoo/design-themes#709
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-10-05 10:21:53 +00:00
Victor FeyensandMorgane Demesmaeker 6d1a78286a [ADD] sale_pdf_quote_builder:
When enable, this new feature adds the possibility to set a PDF header, footer and some product
documents to the quotation report.

These PDF can contains forms that'll then be filled using Odoo database.

This replace the previous sale quotation builder feature.

task-3249142

closes odoo/odoo#133773

Related: odoo/upgrade#5168
Related: odoo/documentation#5863
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: Victor Feyens <vfe@odoo.com>
Co-authored-by: Morgane Demesmaeker <edm@odoo.com>
2023-10-03 19:19:57 +00:00
Triet Ngo d05372eb7b [IMP] purchase, sale, stock: add packaging in reports
Several reports don't include product packing info on them. This is
useful for customers to see that what they bought matches what they
expected and for pickers who need to know which product packaging they
should be selecting from stock. Reports this was added to are:
- Sales orders,
- purchase orders (including RFQs),
- picking operations,
- delivery slips.

Note that we purposely exclude backordered moves since they weren't
deemed to be necessary at the time this feature was created.

Also includes light refactoring to remove repeated code for conversion
of product qty to packaging qty and to make it easier to do this
conversion in the future (i.e. can pass product.packaging without
original record that it was assigned to)

Task id 2927379

closes odoo/odoo#96858

Signed-off-by: Steve Van Essche <svs@odoo.com>
2023-10-02 14:12:45 +00:00
Rémy Voet (ryv) a9dd388a11 [IMP] *: use private _read_group for efficiency/consistency.
Since https://github.com/odoo/odoo/pull/110737, it is better to use
`_read_group` instead of `read_group` in the backend. In fact, the
public method is less efficient (it computes display_name of relational
groupby, extra order, ...) and more verbose.

This commit replaces these new uses of `read_group` with `_read_group`.

closes odoo/odoo#136381

Related: odoo/enterprise#47826
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-09-29 14:48:13 +00:00
Valentin Vallaeys (vava) 3c236e00c0 [IMP] delivery, sale: use pricelist price in catalog
task-3076912

Part-of: odoo/odoo#135811
2023-09-28 18:20:19 +00:00
Audric Onockx (auon) b7491b5b94 [FIX] sale(_timesheet): take super's domain into account for aal.so_line
The model `account.analytic.line` has a field `so_line`.
In module `sale`, this field has a domain, which is defined in
`_default_sale_line_domain()`.

In module `sale_timesheet`, we override the method to add another
condition to super's.

The issue is that we also add the arg `dommain=...`, in the field
definition, which totally overrides both methods.

Moreover, it is impossible to just move that domain in the method,
because it has to depend on `self.commercial_partner_id`,
but the method is static.

The solution is to:
- Keep `_default_sale_line_domain()` in both modules,
but not call it directly from the field.
- Create a new compute field (`allowed_so_line_ids`),
to determine all allowed so_lines,
following the domain that is returned by those methods.
The compute method will call the domain method on instances, which
allows us to get their `commercial_partner_id`
- Replace the domain arg of `so_line` by `[('id', 'in', allowed_so_line_ids)]`.

task-3507195

closes odoo/odoo#135528

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-09-27 14:57:06 +00:00
Anita (anko) 4d1a1f1c99 [IMP] payment, *: verify and reroute payment flows
This commit changes the way transactions linked to a document (sales
order, invoice...) are created in a payment flow. Rather than receiving
and trusting the transaction values from the controller, they are now
read from the linked document, and the payment flow is rerouted to use
the document's module's controllers instead of that of `payment`.

This ensures that no unexpected value can be passed to the `create`
method of a transaction, and simplifies the implementation of the
payment flows of linked documents.

task-3136240

closes odoo/odoo#126425

Related: odoo/enterprise#43212
Related: odoo/upgrade#5124
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-09-23 21:08:01 +00:00
jbw-odoo b6b7af6e62 [FIX] sale: fix ventilate rounding error on downpayment
This previous commit : https://github.com/odoo/odoo/commit/d197efa60cf7c00168847ce7afcfa1741410aee1 aimed at ventilating rounding error corrections on multiple lines. But this would introduce errors or unbalanced moves if the rounding amount/lines quantity was smaller than the rounding of the currency. E.g. à 0.01€ error divided on 3 lines would add 0.00333 on each line, and when the amount is rounded, it would vanish.

closes odoo/odoo#136366

X-original-commit: 0627b4609e8b1b3d15651d6cde0ff4cfdc85c5d6
Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
2023-09-23 12:11:06 +00:00
jbw-odoo 282fbee342 [FIX] sale: ventilate downpayent rounding correction on multiple Lines
When a user creates a downpayent with a fixed amount, the amount is tax included. This can generate rounding issues as sometimes the amount is impossible to be reached by any base amount / tax combination. (fixed amount = 100€, tax is 21% -> 100/1.21 = 82.64 -> 82.64 * 1.21 = 99.99). This can lead to up to 1 rounding error per downpaylent line.
Until now the total amount delta was added/removed on one tax line, one receivable line and one product line. While the total amount was correctly corrected, the amount on the individual lines would be off.
On a SO with :
    base  |  tax      | tax incl
    1000€ | tax_21%_a | 1210€
    1000€ | tax_21%_b | 1210€
Generate 1 DP for fixed amount 200€
Invoice lines :
BEFORE:
    tax       | balance | price_total
    base lines ----------------------
    tax_21%_a | -82.64  | 100.01        <-- 0.02 correction
    tax_21%_b | -82.64  | 99.99
    tax lines -----------------------
              | -17.37  | 0.0           <-- 0.02 correction
              | -17.35  | 0.0
    receivable line -----------------
              | 200.0   | 0             <-- 0.02 correction

AFTER:
    tax       | balance | price_total
    base lines ----------------------
    tax_21%_a | -82.64  | 100.0         <-- 0.01 correction
    tax_21%_b | -82.64  | 100.0         <-- 0.01 correction
    tax lines -----------------------
              | -17.36  | 0.0           <-- 0.01 correction
              | -17.36  | 0.0           <-- 0.01 correction
    receivable line -----------------
              | 200.0   | 0             <-- 0.02 correction

closes odoo/odoo#135698

X-original-commit: d197efa60cf7c00168847ce7afcfa1741410aee1
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
2023-09-22 15:06:03 +00:00