Demoted to library in Python 3, see if uses can be replaced by more
specific construct, just import functools.reduce otherwise.
Futurize fixers:
* lib2to3.fixes.fix_reduce
Steps to reproduce:
-Go to accounting dashboard
-Click on "More" in vendor bills dashboard
-Click on "bills analysis"
Bug: it opened the account.invoice.report view, which crashed.
Reason: The function get_names in addons/product/models/product.py got an empty record set
product.category(None,) and returned [False] so when joining " \ " with [False], it crashed.
The empty record set was returned when the categ_id of an account.invoice.report() was None.
opw:724783
Correct several issues with the automatic pricelist creation:
- multiple creation of same pricelists because company not set on new pricelist
- avoid creating pricelist if currency did not changed or if we already have a pricelist with the same currency
- improve name of new pricelist
A company should have at least a pricelist having the same currency, that's common sense.
This was causing problems in tests on 10.0-nightly, where the main pricelist was created
in EUR, then the localization module was setting the right currency on the company without
any reflection on the pricelist.
To avoid this problem, when we write the currency on a company, we reflect that change on
the main pricelist if it's the only company in the system. Otherwise as we can't decide
which pricelist modify, we just create a new one, which should be ok.
The name_search was not working properly if limit=None is specified (e.g.
searching for the search bar on a many2one field to product.template).
As `any int > None` is true, the condition is always validated as soon as the
search returns at least one result.
The product.product search has no limit parameter and use the default 100.
If the 100 first products have only a few templates (a lot of variants), the
result will be incomplete as stopping after the first iteration.
Closes#15477
- Go to Sales > Product Variants
- In the search field, type a letter (e.g. 'p'), then select a
corresponding pricelist ('Public Pricelist' in demo data)
=> Crash
This is because `name_search` returns a list of tuple, not a browse
record.
Fixes#15443
`set_multi` uses the company of the current user.
As the property is created in sudo, the company of the admin may be different
than the one of the current user.
Before this commit, setting a different pricelist on a partner when logged in a
different company than the admin, the change had no apparent effect (was
creating a property for the admin's company).
Set `force_company` in the context to always set the one on the current user.
set_multi ignores if the same as the global rule to avoid bloating the table.
Closes#14984
Currently, the packaging of products are set on product.template, which
will cause problem if we use vatiants and packaging.
So we move the packaging from product.product to have the possibility to
have different packaging on different product variant of the same
product template.
_get_partner_pricelist could return both a recordset or an ID.
While the ORM handles both where the method is called, a migration script
relies on an ID being returned.
( migrations/sale_contract/9.saas~13.1.1/pre-models.py", line 24 )
This commit ensures an ID is being returned every time.
- Create a new unit of measure with 'Bigger than the reference Unit of
Measure'
- Save
- Edit and change the ratio ==> the ratio is set back to its value
opw-695507
=======
Purpose
=======
There are some confusion about the use of the vendor price and the cost price.
Moreover, in the purchase app, the RFQ should take the variant vendor price, if one is set
==========
Specification
==========
Add a clear tooltip on the Cost field (standard_price) : "The cost price is used for valuate stocks or to asses the price of manufacturing a product. The purchase orders are fetching the vendor prices."
In the simplified view, add the vendor cost o2m : https://drive.google.com/a/openerp.com/file/d/0BxqHe5rtIxY0LVZHZXFWcWFHckk/view?usp=drivesdk
Variant vendor prices should be indenpendant from each other, and from the template ones.
In the purchase app, when creating an RFQ : the system fetches the variant cost price (from vendor o2m), if no price on variant, it takes the vendor price on template.
NB: fp request
The decimal precision `Account` no longer exist.
This check is therefore pointless, and prevent
to change the rounding of the currency of the main company
By default, the multi-company record rule on
`product.template` is disabled, meaning the products
are shared between the companies.
https://github.com/odoo/odoo/blob/10.0/addons/product/security/product_security.xml#L48
Nevertheless, the multi-company record rule on
`res.company` is well activated, and therefore
this might happen that you can see a `product.template`
for which you are not allowed to read the company.
If you attempt to read something from this company, you must
therefore do it as sudo :)
opw-693209
=======
purpose
=======
By default, the sequence is 0 for all new attributes and the result is messed up. The product attribute values are not ordered in the same way in a list view.
That's because the results are not returned from sql ordered by id if the sequence is the same. Just add this in the order definition will remove the non-deterministic behavior.
`id1`, `id2`, `rel` are deprecated now that we switched to the
new API, and are simply ignored.
Keeping them is confusing because the default names are being
used instead.
@rco-odoo: We should add a warning in the m2m constructor if these
unsupported parameters are still passed.
Move the code to manage the case of 'adding an attribute with only one value
should not recreate product' before to select the existing variants.
Before this commit,
When you create 1 new product.template, it create 1 variant.
When you add an attribute with only one value, it update the existing and
create a duplicate variant.
After this commit,
Only the existing variant is updated, and there are no more duplicated variant.
The fix:
We update the variant if only one value before to select the existing variant.
Thus, the updated variant is compared with the matrix and not duplicated.
This commit closes#13757