- generic CoA
- Sars VAT ready structure
Thanks to Paradigm Digital
separate pr for 12.3
opw-1893580
Closes#32685
Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
In the accounting dashboard, click on the hamburger menu of a purchase
or sales journal, then click on View Bills. Both vendor bills and
refunds are displayed.
This is because the `use_domain` key of the view is replaced in the
`open_action` method.
opw-2000904
closesodoo/odoo#33562
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
In order to force the user to select a new leave_type when requesting a
leave for someone else. We reset its value in the `_onchange_employee_id`
Task : 1984487
Closes#32697Fixes#29806
Courtesy of @sswapnesh
closesodoo/odoo#33178
Signed-off-by: Romain Libert (rli) <rli@odoo.com>
- Create 3 products, add 2 sales tax to each product
- Create a quotation template with the se 3 products
- Switch to mobile mode
- Create a SO, add the quotation template
- Modify the first line and change the quantity
The taxes of the two other lines are removed.
This is due to the missing `tax_id` field in the mobile kanban view.
opw-1998493
closesodoo/odoo#33527
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
When opening the weight screen in PoS it can take up to 10 seconds
until the weighting starts. This can be resolved by using a
Threading.Event instead to reset the 10 second sleep time.
Using exit_flag.wait(timeout=DELAY) will be more responsive, because
you'll break out of the while loop instantly when exit_flag is set. With
time.sleep(timeout=DELAY), even after the event is set, you're going to wait around in
the time.sleep call until you've slept for DELAY seconds.
closesodoo/odoo#32389
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
This commit fixes a js crash that occured when the user was trying to
edit a new record while the chatter was not completely loaded
(this.field.thread.$el was not in the dom yet)
Behavior before this fix:
Traceback js & impossible to edit the form afterward.
Behavior after this fix:
no traceback, still possible to edit the form normally.
The thread will display on next chatter re-render. Could be forced by
triggering an onchange.
opw-1986061
closesodoo/odoo#33381
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Since b5a12b4aac the website_id was not set anymore.
Indeed, before this commit website_id was the field from the inherits, thus
when writing on website_id from res.user, we would write on the partner field.
But with b5a12b4aac the website_id was explicitely overrided on res.users as a
related to res.partner (its inherits) with readonly=True.
Thus, writting website_id on res.users was not working anymore.
closesodoo/odoo#33521
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
* properly handle 3-args version of odoo.define(): just ignore the
second argument, pretty much the only use-case is dynamic
dependencies (otherwise it should be using static require() calls)
so there's little the extractor can do
* fix an issue with sys.path ordering meaning sphinx would pick up an
odoo installed into the current virtualenv (editable or not) over
the local copy it's part of
closesodoo/odoo#33538
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
- When validating payments on the payment process polling page
errors can occurs and the tracebacks aren't logged which doesn't help
when trying to understand the issues.
With this commit we display the traceback instead of shadowing them.
closesodoo/odoo#33537
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
This has several advantages:
- make the code easier to maintain by having the logic only on the python model
- prevent price flickering when changing from/to an impossible combination
- fix the UI for the issue mentioned in the previous commit/the opw
- make the code much faster when using many combinations, by not requiring to
browse and to return every existing and every archived variants
The opportunity is also taken to properly throttle the rpc and to use
"DropMisordered" on its result:
- fix all the other remaining flickering when changing quantity or combination
- fix the server being spammed of rpc when using the configurator modal, but
also in a lot of other cases such as incrementing the quantity, ...
- fix UI consistency by ensuring the result of the last rpc is always the one
displayed, obsolete rpc returns are ignored
By computing the possibility of the combination asynchronously, the two
drawbacks are:
- the UI is a bit less reactive than in the previously the best case scenario,
but this almost completely mitigated by debouncing with a leading call
- it is possible for a quick user to click on "add to cart" on an impossible
combination before the return of the rpc, but this is not really an issue
because when the product will be added to cart there will a check and the
closest possible combination will be selected automatically instead
Finally the event of the configurator mixin and the widgets using it have been
cleaned to avoid the duplication of the rpc in the first place.
opw-1959317
PR: #32691
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, if multiple variants exist for the same combination it would
consider the combination impossible if any of the variants was archived.
After this commit, it will consider the combination impossible only if all the
corresponding variants are archived.
opw-1959317
PR: #32691
When the configurator modal is shown on the shop page (when the add to cart
button customize show is enabled), changing the quantity would trigger an
infinite recursion before this commit, because the selector was not finding the
input on the page (because it is not there), but it was not restrictive enough
so it matched the input on the modal itself.
PR: #32691
Install CRM (we need the "Hide Private Message" record rule defined by
that module), create a meeting as of today, set a reminder of one day,
invite another user (Demo) as attendee, save. Edit, go to the options,
change the "Show time as" to "free", save => access error due to the
said record rule.
The reminder is handled by the `get_next_potential_limit_alarm` method
of the `calendar.alarm_manager` model. It uses a raw SQL query to
perform its search. It returns a dictionary of the different events with
data attached. Due to the "Hide Private Message" record rule, some
records are not accessible.
Original (reverted) 9c4b52000 fix was replacing the `browse` by a `search`
in order to filter out non-accessible records. That fix was later fine
tuned by (not-merged) 7dd93809c to exclude calendar's virtual ids. The
real fix is to filter out records in the original result dict.
opw-1974599
closesodoo/odoo#33209
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Co-authored-by: Raphël Collet <rco@odoo.com>
Before this rev., we searched for 'label' tagname into the DOM, but
the fields labels are not always inside <label> (sometimes <span>).
However, they always have className 'o_form_label', so we use this
instead.
task 1961427
closesodoo/odoo#33487
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
- Create a product P
Costing Method: FIFO
Inventory Valuation: Perpetual (automated)
Price Difference Account set
- Create a PO with P, set a price of 100 (no tax).
- Receive the product
2 journal items are generated:
| Account | Debit| Credit|
|-------------------------|--------|--------|
| Stock Valuation | 100.0| 0.0|
| Stock Interim (Received)| 0.0| 100.0|
- Create the corresponding invoice
- Change the:
Discount: 10
- Validate the invoice (for a total of 90.0)
2 journal items are generated:
| Account | Debit| Credit|
|-------------------------|--------|--------|
| Account Payable | 0.0| 90.0|
| Stock Interim (Received)| 90.0| 0.0|
This is not correct, it should be:
| Account | Debit| Credit|
|-------------------------|--------|--------|
| Account Payable | 0.0| 90.0|
| Difference Account | 0.0| 10.0|
| Stock Interim (Received)| 100.0| 0.0|
This comes from the fact that the valuation price is compared to the
price unit without the discount.
opw-1974002
closesodoo/odoo#33296
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- Create a product P
Costing Method: FIFO
Inventory Valuation: Perpetual (automated)
Price Difference Account set
- Create a PO with P, set a price of 110 (no tax).
- Receive the product
2 journal items are generated:
| Account | Debit| Credit|
|-------------------------|--------|--------|
| Stock Valuation | 110.0| 0.0|
| Stock Interim (Received)| 0.0| 110.0|
- Create the corresponding invoice
- Change the:
Unit Price: 100
Discount: 10
- Validate the invoice (for a total of 90.0)
3 journal items are generated:
| Account | Debit| Credit|
|-------------------------|--------|--------|
| Account Payable | 0.0| 100.0|
| Difference Account | 0.0| 20.0|
| Stock Interim (Received)| 120.0| 0.0|
This is not correct: the Stock Interim (Received) should have a debit of
110.0, and the Account Payable credit should be 90.0.
This comes from the fact that the difference is subtracted from
`line['price_unit']`, which doesn't contain the discount.
We can use `price_val_dif` to update the price. Moreover, the
`price_unit` seems ultimately useless, since it is not used in:
https://github.com/odoo/odoo/blob/e11bacfe512a3170f44d6d43646af914a9cf3b73/addons/account/models/product.py#L63
We still update it for consistency.
Fixes#32911Fixes#33201
opw-1974002
Basic Chart of Accounts and taxes for the Mongolian
accounting. Tags for a lot of reports in Enterprise.
A lot of different taxes are created to be able
to represent them in the vat report. Mongolians
are used to taxes included even for B2B.
Some fiscal positions are added e.g. to automatically
apply 0% for export.
We got a lot of input from our Mongolian partner
Baskhuu Lodoikhuu and colleagues from BumanIT LLC
opw-1946238
Separate pr for 12.3
Closes#32830
Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
If you create a partner with a e.g. the key show_vat, it will be stored on
the partner while we would like to have this information only in the name_get.
After this commit, we will stop to save partner in our production database
with the vat number stored in the name because we create the partner (with vat)
from the invoice, where partner_id have a context with show_vat.
closesodoo/odoo#33492
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
The ir_translation table has an index on the (name, lang, type and value)
key, however this index was not being used when generating field
translations because the column `type` was missing!
With this commit, we fully utilize the index when generating field
translations.
With the eCommerce with categories and 4k+ products, the time to charge
products per category would be around 4-5s; With this patch it is
reduced to 1-2s.
opw-1961665
closesodoo/odoo#33504
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
- When processing payments on the payments processing page,
`psycopg2.OperationalError` can be raised.
We do not want those exceptions to be displayed to the customers,
instead we want the polling page to try to process the payments again.
This commit hides the display of psycopg2 operational errors.
- This commit also fixes the "processing your payments" message being
hidden after the first polling, no matter if the processing has succeeded or not.
closesodoo/odoo#33462
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
Before this commit, the URL of the bootstraped homepage for a new website
could be '/-1' instead of '/'.
Indeed, creating a new website ends up calling `page.copy` which try to get an
unique URL for the website (to avoid duplicated URL after copy). Typically, the
copied page will have a suffix (-X).
But `get_unique_path` in charge of doing that is based on `get_current_website`
method which will/could return a wrong website (not the one we created).
For instance the one forced in session after using the website switcher or
creating a website or installing a theme.
As those website already have (most likely) a homepage '/', get_unique_path
will create the bootstraped homepage with '/-1' as URL.
Step to reproduce (among others):
- Create a new website in backend through res.settings screen
- Create another new website, it's homepage will be '/-1'.
- Repeat indefinitely, every two website created, the bug will appear.
(One out of two, the bug won't appear since it will try to get an unique URL
on the previously created website which only has '/-1' so '/' is assumed
unique)
closesodoo/odoo#33372
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
To calculate the product quantity and the average price, two UOM are
used: The UOM of the product, and the UOM of the invoice line.
The UOM of the product it's mandatory in the product, but the product
itself it's not mandatory in the invoice. The UOM of the invoice line
it's not mandatory.
When either of the UOM is not filled, it gives as value NULL, and gives
'empty' as result of the calculation.
Now, we use the psql function COALESCE to return '1' when one of the UOM
is not filled.
closesodoo/odoo#33465
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- Go to Accounting > Reports > Invoices
- Go to the pivot view
- Enable 'Total' and 'Untaxed Total' in the measures
The Total is wrong.
The sign of the total must be positive for the customer invoices and the
vendors refunds; and negative for the credit notes and the vendors bills.
Before this commit, the total of the credit notes and the vendors bills
weren't negative.
This occurs because the sign of the result of amount_total * invoice_type.sign
is different of the sign of amount_total_signed. Indeed amount_total is
the total amount without sign, and invoice_type.sign is used to change
the sign only for the vendors bills and the vendors refunds
(see https://github.com/odoo/odoo/blob/3cf9cfc985950c30c6b76480f77f5ffe53650b24/addons/account/report/account_invoice_report.py#L144).
Contrariwise amount_total_signed is the total amount signed : negative
for the credit notes and the vendors refunds.
Later on the calculation, the total amount is multiplied to
invoice_type.sign, to have the signs as expected
(see https://github.com/odoo/odoo/blob/3cf9cfc985950c30c6b76480f77f5ffe53650b24/addons/account/report/account_invoice_report.py#L118)
Fine tuning of this commit: 4218f3b
opw-1999175
When you import a variant or when you archive variants to only leave
one tied to the template, the image of the variant can't be changed.
If the variant has a picture and you archive all the other variants,
when you change the image on the variant, it's the template
image which is modified.
opw 1974727
- Create 5 vendor bills with a long reference (> 1000 characters), for
the same partner.
- Select the bills and register a payment
An error arise: 'psycopg2.OperationalError: index row size 3256 exceeds
maximum 2712 for index "account_move_line_partner_id_ref_idx"'.
As mentioned, the index row size limit is 2712 bytes, which is exceeded
in that use case. Indeed, the reference of the payment is computed based
on the vendor reference of all bills.
We limit the number of characters to 2000. This seems reasonable knowing
that UTF-8 characters use sequences of 1 to 4 bytes [1]. Characters with
a code less than 128 require 1 byte only, and it is expected that most
vendor references will only use these characters. It is indeed unlikely
that special characters (such as Chinese characters, taking up to 4
bytes) are used for such references.
[1] https://tools.ietf.org/html/rfc3629
opw-1998823
closesodoo/odoo#33457
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
added 5% tax rate for sale and purchase which was missing
was task# 1915454
closesodoo/odoo#33400
Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
1) In the settings of project, enable sub-tasks.
2) Create a new project with a sub-task.
3) Create a new product (type service).
4) In the "Sales" tab of the product check the "Create a new project
but no task" in the service tracking options and select the created
project as project template.
5) Create an invoice for that service and confirm it.
The sale order is set on the tasks of the duplicated project but not on
the sub-tasks.
The `write` mechanic is override in project.task to apply modifications
done on the parent task to its sub-tasks. The method
`_subtask_write_values` is used to gather `{field: value}` pairs and
update the sub-tasks. That method is override in `sale_timesheet` in
order to force the `sale_line_id` to `False` when the project is
duplicated because the duplicated project is not attached to the sale
order of the original model.
The fix has been re-write the `sale_line_id` value on sub-tasks.
opw-1985484
closesodoo/odoo#33416
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
The field website_published is not ensured when module portal
is installed because the module portal doesn't depend on module
website_mail.
PS:The module website_mail depends on the module portal because
website_mail depends on website and website depends on portal.
opw:1997478
closesodoo/odoo#33452
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
The rte_translator tour that test translation on the frontend could not
be started from the "[debug menu]" > "Start Tour" for two reasons:
- the start URL is not specified, so the test was started on current
backend page wich is wrong (in python the start url is "/")
- the backend original state (params after #) does not work with ?k=v
inside argument value, so `#return_url=/?debug=true`.
To solve this issue, we encode the return_url value and add a start url
when rte_translator is started manually.
opw-1998623
closes#33443
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
- Create a tour with only one step for Community
`edition: 'community'`
- Install a database in Enterprise
`tip.in_modal` in `_check_for_tooltip` cashes since `tip` is undefined.
opw-1998603
closesodoo/odoo#33430
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Include the Google Error message in the error message showed on screen.
Fine tuning of da13c70484 : missing transiflex translations, empty body,
wrong string format.
opw-1966309
closesodoo/odoo#33216
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
The snippets "Latest Posts - List" and "Latest Posts - Big Images" have
a "Number of columns" options but:
- these snippets are not taking the option into account and are
specifically size (in large "list" => 100% width, "big image" => 50%)
- the snippet content is dynamically generated, so the column sizing
set on preview when saving is lost when content is displayed
- the option "Number of posts" contradicts the option
"Number of columns" and can leads to have several lines that are not
taken into account in "Number of columns" (the column number is the
number of child)
Thus, this changeset disable the option for these snippets.
opw-1984899
closes#33393
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Fine tuning of 5ef86ef6c874ab4dc78402493d05b2460c69e7f6
Steps to reproduce:
Set a custom language settings for date by switching the %m and %d.
Create a sales order
Current behavior:
Invalid date error boxes was raised two times
fixes#33408
opw:1998971
closesodoo/odoo#33415
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
When a leave type is in hours, before this commit:
- in the leaves request list the request duration is shown in days.
- the name of the leave shown duration in days.
- the rounding after the conversion from hours to days, generates some
misunderstandings. If you have a day of 7.5 hours, and you take a leave
of 2 hours, it would be round it to 0.25 days, and not to 0.27 days as
it should be. This occurs because we round to the 1/16 of the day.
Now:
- in the leave request list, the request is shown either with days or
hours depending on the leave type.
- the name of the leave shown duration either with days or hours
depending on the leave type.
- the leaves are shown in the correct unit, there is not more
misunderstandings occurring because of the rounding.
related to commit : 5c33ebef5f and 2c366acbf0
opw-1974691
closes#29804closes#33290closesodoo/odoo#33369
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- Activate online payment of invoices
- Activate and configure Stripe
- Create an invoice, access it through the portal
- Pay it with Stripe
The user is redirected to `/my` instead of `/my/invoices/<id>`.
The root cause is because Stripe creates 2 transactions, the second
being created at:
https://github.com/odoo/odoo/blob/43295c2a3741fb98f9c5d1a506652442efed0a82/addons/payment_stripe/static/src/js/stripe.js#L108
This second transaction, which is used to record the payment, doesn't
contain the appropriate `success_url`.
The best fix would probably be to either:
- prevent the creation of the second transaction by refactoring
`stripe.js`
- pass the appropriate `success_url` to the `stripe_form` template
- reuse existing draft transactions instead of creating a new one
None of these solutions is really suitable for stable since it might
require some heavy modification. However, a simple workaround is to
change the fallback `success_url`since we have all the necessary information
to build it.
opw-1997283
closesodoo/odoo#33404
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- Go to the website settings and activate the option 'Tax-Included' for
the pricing in the website.
- Go to Sales > Configuration > Delivery methods and create a new method
based on rules. For example:
Price is 10.0 when the weight <= 100
Attach a product (with taxes) to it.
- Publish on website
- Buy a product on the eCommerce
- Checkout, go up to payment step and choose the delivery method created
The 'Delivery:' field on the left shows the delivery price with taxes
excluded although they are included. Funny thing: going back to the
'Address' step show the correct price.
This is because the `delivery_price` field does not take into account
the tax configuration.
We can use the `amount_delivery` field (hum hum) which does it
correctly.
opw-1981808
closesodoo/odoo#33394
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Install discuss, change the general setting in dev mode to disable the
"Show Effect" checkbox. Change the preferences of the user to let odoo
handle notifications. Ask another user to ping you on a chatter then go
to discuss and click the "Mark as Read" button. Traceback.
The `notification_manager` agent has been replaced by another agent in
07cd24b1ec, the code has been updated to use the new agent.
opw-1986844
closesodoo/odoo#33363
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
This reverts commit dbaef7de17 since it
causes issues (unbalanced moves). Temporary revert so we have time to
analyze the issue.
opw-1997794
closesodoo/odoo#33380
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Steps to reproduce the bug:
- Go to any field Date
- Enter wrong date
Bug:
A traceback was raised.
Now a warning is raised and the wrong value is removed.
opw:1974747
closesodoo/odoo#33362
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Before this commit and since 2f7c03d9ca, the admin user has not ID=1
anymore.
Thus, some old condition were not doing what they were expected to.
Firstly, the admin was not considered as such on the forum, and if its karma
points were not high enough, it would not be possible to do anything for the
admin. Note that it was fixed in saas-12.1 with 1dac413130
Secondly, some _search functions would not return a truthy value anymore.
closesodoo/odoo#33359
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Commit 98ee15977a made the Stock Interim accounts reconciliable,
and introduced auto-reconciliation of related entries. This has the
advantage to clean-up entries in these accounts. However, since these
accounts are reconciliable, the entries will show up in the manual
reconciliation widget (expected) and the bank reconciliation widget (not
expected).
There are 2 cases where it causes issues:
- after migration from v11, the entries were not reconciliced. Although
this will be fixed in the near future, it is too late for already
migrated databases
- using MRP. A list of components i costing Xi might be used to create a
finished product of cost Y != sum(Xi). Indeed, the routing cost has to
be taken into account. In this case, the entries are not fully
reconcilied.
The result is that the bank reconciliation widget ends up with an
growing number of unreconcilied lines, and in the end making it
impossible to use.
In order to work around the issue, we prevent any account used as a
stock interim account to be included in the bank reconciliation widget.
For performance reasons, we directly search the `ir.property` table for
the corresponding accounts instead of filtering AML thanks to
`excluded_ids`.
Closes#32611
opw-1963025
opw-1967462
closesodoo/odoo#32957
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
When using `sales_team.team_sales_department` as fall back default
team, last condition that checks if such team can be default was
incorrect, because `active` value check was mixed with lead type check.
In other words: True or False and False => True
But intention is: (True or False) and False => False
opw 1997715
closesodoo/odoo#33316
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>