Use case to reproduce
- Set a product to be expensed
- set the expense_policy to something else than no
- Do a delivery order with a picking
- Validate the picking
-> Delivered quantity to 0 and impossible to create an invoice
if the invoice_policy is delivered_quantity
It happens due to this commit 48ea59d46e
What does it do:
- The move could be generated by an expense.
- If the move has 'no' as expense policy thus we won't add it in the invoice
Problem we can't guess if the move come from an expense or not (limitation).
This commit increments the delivered quanity if the product can
not be expense anymore
opw-777139
Before this commit, creating a base_action_rule with model X from module
A and then uninstalling module A would make the database crash because
the algorithm would look for an uninstalled model during the Registry
reinitialization.
i.e. Install project and base_action_rule, create a base_action_rule
depending on model project.task, try to uninstall Project -> BOOM!
This is fixed by checking if the model obtained is None, in which case
we log a warning (for cleanup) and skip to the next iteration (continue)
opw-777301
When following these steps on Firefox:
- Select all text in a bold link (triple click)
- Type some text
The typed text did not replace the selected text but was instead put
at the front of it.
5afb5ecd04 rewrote the tax computation
in both account and point_of_sale to fix complex tax computations but
it no longer allowed negative prices in the point of sale.
opw-778013
Set the round_globally method on the company.
Have an invoice with several lines and some of them having two (or more) taxes.
See the OPW 775501 for exact numbers.
It is a practical example case where
round(0.003 + 0.004) = 0.007 ~ 0.01
BUT
round(0.003) + round(0.004) ~ 0.00 + 0.00 = 0.00
Before this commit there could be a difference between amount_residual and amount_total on invoices.
This was because the two amounts are based on something different:
AMOUNT RESIDUAL
It computed in function of account_move_lines of the invoice.
For such an invoice the structure of those lines would be 1 line per tax + 1 line in the receivable account
Here the amount tax of each line is rounded before the addition.
In summary, the total amount of each tax are rounded and then added to each other
AMOUNT TOTAL
It is computed in function of the on-the-fly computation of the taxes with two cases:
- round per line: obviously each invoice_line gets its taxes rounded before addition, which isn't problematic as regards to the previous paragraph
- round globally: Here lied the problem. the rounding of the tax_line_ids was made **after** each tax amount was added to each other, which contradicts the above argument
After this commit, we round tax_line_ids before their addition, it is rather logical and matches the expectation one can have reading the tooltip of the rounding method field
>> If you select 'Round per Line' : for each tax, the tax amount will first be computed and rounded for each PO/SO/invoice line and then these rounded amounts will be summed, leading to the total amount for that tax.
If you select 'Round Globally': for *****each tax*****, the tax amount will be computed for each PO/SO/invoice line, then these amounts will be summed and eventually ***this total tax amount*** will be rounded <<
OPW 775501
After this commit, it is expected that the behavior of sale.order and purchase.order won't be the same as the invoice in the same conditions.
See PR #20349 for an explanation
Here is what could (sometimes) happen in community:
- the point of sale tour is started by the runbot
- it loads the '/web' url
- this instantiate the mail client action (init)
- the tour sees that the POS link is in the dom and clicks on it
- the action manager destroys the discuss client action (before its
start method is called)
- the destroy method from the client action is called, this.$buttons
is not set, the destroy method causes a traceback
You start with an MO with a quantity of 2 with routing and we
produce just 1. At least one of the components is tracked by lots.
When we update the MO to a quantity of 1 again, the temporary
stock.move.lots continued to exist which led to processing a the consume
d move of e.g. 1 piece with 2 pieces of the quants processed when
posting inventory.
A test is added in order to avoid this case
opw-767526 and opw-772786
We try to avoid to take the inactive move lots. While they are normally
already filtered through the split, we had a case when you update the
quantity of the mo, that the split would not separate them.
Before this commit, a portal user would land on /web after login in with oauth.
He would then just see the "Website" app.
He should then click on it to land on website instead of landing directly on it
after login in, which is not convenient, especially since theses users doesn't
know Odoo (in case of sale customers manually created for instance).
Now, if users has no 'base.group_user' right, it will be redirected to the
website directly instead of /web.
- Create a tax included of 21 %
- Create a product sold 7.00, set the 21 % tax
- Add the product in a SO
Amount w/o tax: 5.79
Amount tax: 1.22
Total: 7.01
We defer the base rounding to the end of the method so that the rounding
doesn't impact the tax computation of included taxes.
Complement of 6e46ba7b46
opw-777221
- Create a product attribute, e.g. 'Recommanded Age'
- Create several values for this attribute
- Try to associate more than attribute value to the same variant =>
contraint which prevents to do it
We should allow this use case as long as the product attribute doesn't
create a variant.
opw-776344
- Activate multi-company, create companies A and B
- Set 2 companies on a user
When a message is sent (for example, thanks to the chatter), the
notification email always contains the logo of the same company,
whatever the company of the user or the company of the object.
This is a complement of commit 7a03f9ce93, applied to notifications.
Closes#20088
opw-772405
Before this commit, when on a mail.template form, click on the Preview smart button.
A wizard popped up with two buttons, as the default for form views.
First this made no sense since the wizard doesn't represent a model that can be modified
Second, the button discard was unable to close the wizard.
After this commit, only a discard button is present which does its job.
Before this commit, Sale order and invoice notification email templates broke when doing any action on them (duplicating, open preview etc...)
This is because the model is saved during those operation, and the css style gets converted to inline style.
The table tag present in those templates, was wrongly associated with the bootstrap rule for tables, collapsing their border, hence the break of the templates.
After this commit, we force the borders not to collapse, and the templates don't break
OPW 774323
This is a hotfix/hack for a conflict between website_sale and
website_quote, on the field website_description.
The conflict happens when both modules are installed.
Fixes#20118
Completes rev 333a236
When double-clicking on a link/button, the link dialog is opened. The
problem was that the "btn" class is sometimes used on non-link elements.
While this should not be, the editor can easily be adapted to this.
When a user clicks on an input or a select field
in Safari on IOS, Safari has a behavior of zooming-in
on the field when the keyboard opens.
Even after the user dismisses the keyboard, the screen
still stays zoomed-in. The user has to then zoom out manually.
Now, the user is not allow to zoom-in at all.
This is already the case with the Android application.
We now have the same behavior between the two apps.
As can be seen in https://github.com/scottjehl/Device-Bugs/issues/8 a
combination of "-webkit-overflow-scrolling:touch", "position:relative"
and "overflow:auto" can have unexpected behavior on iOS.
The issue solved here is that writing in a form view inside a modal in
iOS (at least version 10.3) would make the whole form body invisible
until edition is ended.
This commit fixes this by adding a CSS rule which avoid the iOS bug.
opw-774396
closes#20314
We have problems when trying to validate our EU VAT report because some vat number are wrongly encoded in Odoo.
There are 2 problems:
1) We use vatnumber library to check the validity of the VAT number entered by the user on website.
That library removes the following characters '.' and '-' in order to perform the check and
thus can return True for a number like 123.123.123.13 or -123-3454-34
And those VAT number are then saved in our database but are rejected by the state
as VAT number should only contains alphanumeric character
-> Solution: prevent entering vat number with other characters than alphanumeric for users that are located in EUROPE!
2) Usually VAT is prefixed by country code, however some people in europe managed to bypass the system
by prefixing their VAT number with CC instead of their country code, CC is consider valid in odoo
(it means Country Code) but is not a valid European country code in general, which means that those
people that should have pay some tax have not. Which is a huge problem.
-> Solution: prevent the use of CC as country code by the user when entering a vatnumber only if the user country is in EUROPE!
source: https://en.wikipedia.org/wiki/VAT_identification_number
opw:772621
A bug happens when you enter a number with more than 2 decimal
if you unfocus/focus the field it will truncate it.
This commit change the decimal precision and use the same digits
than other fields used in stock.
opw-775791
Fine tuning of 1108c150d9
When setting a pricelist to show the public price discount, it ignored
the pricelist item's base field (if not 'Other Pricelist') and set it
by default on the lst_price instead.
This did not work when you based your discount on the standard_price
(= cost price) with public price discount.
Now it does.
opw:775275
- Create a vendor bill with a line linked to an asset category
- Validate the bill => an asset is created
- Refund the bill
The refund is also linked to an asset category. Therefore, upon
validation, a negative asset will be created.
The refund should not be linked to the asset category in a first place.
The user should cancel/modify the asset manually.
opw-775933
Commit aab6bdd54a was incorrectly forward-ported to
10.0 at abb726d4df . Indeed share users could land
to a wrong backend or frontend page depending on the target app due to an
indentation issue.
After setting the image on a product variant, the controller for `/web/image`
incorrectly returns the code 304 - Not Modified. This bug occurs because
1. the response ETag is a hash of the **last modified date** of the record;
2. the record is actually **not** updated in that case, because
- the image field is a non-stored computed field, and
- its inverse method only modifies the variant's template.
Fix the issue by making the response ETag a hash of the **content**, which is
read by the controller anyway.
OPW 769302
Fine tuning of c477f0764e
When setting a pricelist to show the public price discount, it ignored
the pricelist item's base field (if not 'Other Pricelist') and set it
by default on the lst_price instead.
This did not work when you based your discount on the standard_price
(= cost price) with public price discount.
Now it does.
opw:775275
This is a hotfix/hack for a conflict between website_quote and
website_sale, on the field website_description.
The conflict happens when both modules are installed.
Fixes#20118
Steps to reproduce the bug:
- In Sales settings, set "Tax display" as "Show line subtotals without taxes"
- Create an article A with a customer tax set as price-inclusive.
- associate on an other article B the pricelist P with a discount_policy
set as "without_discount"
- Ensure that the pricelist P is used in the shop.
-Go to the shop
Bug: The article A is considered as discounted but the price is full.
The prices with included taxes were considered as discounted because
lst_price - webstie_price were always greater than 0. When the
"Show line subtotals without taxes" is checked for Tax display,
the field website_price never includes the taxes. That's why the
included taxes are substracted from the website_price.
opw:776526
opw-774286
*Before this commit:
On checkout, you can enable a step to force user to have the General Terms of
Sale checked to continue the checkout. Checking/Unchecking will correctly
disabled/enabled the button.
The checkbox is already checked at page load (on the template).
BUT, if the template has been modified to set the checkbox as unchecked at load
(eg the user removed 'checked="checked"' from the template), the button will
still be enabled even if the checkbox is unchecked.
*Now:
No matter if it is checked or not on the template, the button will
correctly be enabled/disabled regarding the checkbox state at load.