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
closesodoo/odoo#111535
Signed-off-by: Laurent Smet <las@odoo.com>
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
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
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
closesodoo/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>
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
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.
closesodoo/odoo#137609
Signed-off-by: Raphael Collet <rco@odoo.com>
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
closesodoo/odoo#122611
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
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
closesodoo/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>
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.
closesodoo/odoo#139314
Related: odoo/enterprise#49311
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
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)
closesodoo/odoo#138750
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
* 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
This reverts commit b1427153f8.
It seems that salesman likes to change payment terms on SO after the confirmation.
task-3562396
closesodoo/odoo#139258
X-original-commit: f83afeffeb30496ad55f901a529144db47942787
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
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.
closesodoo/odoo#133983
Related: odoo/enterprise#46621
Related: odoo/upgrade#5119
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
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
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´.
closesodoo/odoo#139199
Related: odoo/enterprise#49211
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
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
closesodoo/odoo#135840
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
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
closesodoo/odoo#138624
Related: odoo/enterprise#48923
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
*: 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
closesodoo/odoo#136173
Related: odoo/enterprise#47735
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Following 116879e17e81657f48a7d11780d8d30715ecc68f a few improvements were needed to make it more
complete.
task-3484125
closesodoo/odoo#137522
Related: odoo/enterprise#48563
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
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
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
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
closesodoo/odoo#138291
X-original-commit: eb9505375483d18cf21fbaf8e5a60398d5c041c5
Signed-off-by: Laurent Smet (las) <las@odoo.com>
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.
closesodoo/odoo#138238
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
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
closesodoo/odoo#127161
Related: odoo/enterprise#43469
Related: odoo/upgrade#4887
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
This commit renames calendar's attribute quick_add to quick_create
to be more consistent with other views.
closesodoo/odoo#138042
Related: odoo/enterprise#48677
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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
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>
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
closesodoo/odoo#133780
Related: odoo/enterprise#46641
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
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
closesodoo/odoo#135607
Related: odoo/upgrade#5187
Related: odoo/enterprise#47475
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Name can be edited more frequently than VAT, and we should
have a dedicated method to check whether it can be edited
or not.
closesodoo/odoo#118428
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
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
closesodoo/odoo#129087
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: Victor Feyens <vfe@odoo.com>
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
closesodoo/odoo#137735
X-original-commit: a50e73a2ae04fac9fcfea77cbab27e0b5de66fcc
Related: odoo/enterprise#48473
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Group by "Product" was grouping by product
variant instead of product template.
Grouping by "Product Variant" is added.
closesodoo/odoo#137690
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Before this commit, the discount was not displayed on SOL in mobile
view.
This commit adds the discount when it exists.
task-3111127
closesodoo/odoo#137416
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
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
closesodoo/odoo#137517
Related: odoo/enterprise#48364
Related: odoo/design-themes#709
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
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
closesodoo/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>
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
closesodoo/odoo#96858
Signed-off-by: Steve Van Essche <svs@odoo.com>
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`.
closesodoo/odoo#136381
Related: odoo/enterprise#47826
Signed-off-by: Raphael Collet <rco@odoo.com>
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
closesodoo/odoo#135528
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
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
closesodoo/odoo#126425
Related: odoo/enterprise#43212
Related: odoo/upgrade#5124
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
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.
closesodoo/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>
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
closesodoo/odoo#135698
X-original-commit: d197efa60cf7c00168847ce7afcfa1741410aee1
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>