Commit Graph
89 Commits
Author SHA1 Message Date
Xavier Morel 76852a2fad [#8530] fix uses of `reduce` builtin
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
2017-04-12 13:48:42 +02:00
Christophe Simonis fb2504b24c [MERGE] forward port branch saas-15 up to aebd043662 2017-03-28 18:38:49 +02:00
Christophe Simonis 2df5faa551 [MERGE] forward port branch saas-14 up to 2f68e9e93a 2017-03-28 18:05:31 +02:00
Goffin Simon 348535630b [FIX] product: get_names with empty record set
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
2017-03-20 14:41:52 +01:00
Yannick Tivisse 14c56188d1 [IMP] all: Remove error message translation in _sql_constraints
This is automatically taken into account by the translation mechanism. Thus it is useless to make it a translatable label with _('')
2017-03-16 15:26:41 +01:00
Christophe Simonis 65a5ced979 [MERGE] forward port branch saas-14 up to 777a87cde8 2017-03-13 17:37:20 +01:00
Cedric Snauwaert 787e1037cd [FIX] product: fix default pricelist creation
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
2017-03-09 13:16:56 +01:00
Christophe Simonis cb00be643a [MERGE] forward port branch saas-14 up to a4d5e64a4c 2017-03-06 15:46:24 +01:00
Christophe Simonis d08ecdc3b8 [MERGE] forward port branch 10.0 up to 1279f82e12 2017-03-06 13:52:06 +01:00
bluesoft83 3513151e57 [FIX] product: wrong default datetime
On model product.price.history the default value for datetime field was evaluated at server start

Closes #15707
2017-03-03 14:14:25 +01:00
Christophe Simonis 68176d80ad [MERGE] forward port branch saas-14 up to eddefc9948 2017-03-01 16:49:15 +01:00
Olivier Dony 087ce98928 [MERGE] Forward-port 10.0 up to 2cffcfd860 2017-02-25 02:32:17 +01:00
qdp-odoo 807751aece [FIX] base: fix mixing currency in company/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.
2017-02-24 17:57:36 +01:00
Christophe Simonis 85368d7f86 [MERGE] forward port branch 10.0 up to 387b2acfcb 2017-02-23 20:15:38 +01:00
Florent de Labarre 942d8a2c3f [FIX] product: complete name_search
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
2017-02-17 14:11:28 +01:00
Nicolas Martinelli 3b42773e83 [FIX] product: crash on product search
- 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
2017-02-13 13:22:02 +01:00
Christophe Simonis a282d4ae7f [MERGE] forward port branch saas-14 up to be9dfb331f 2017-02-10 18:41:06 +01:00
Christophe Simonis 6a942a9e96 [MERGE] forward port branch 10.0 up to 8a0151b4bc 2017-02-02 12:42:51 +01:00
Miku Laitinen 321cc715d8 [FIX] product: correct name_create method
name_create returns a tuple (id, name), not a recordset

Closes #15276
2017-01-30 16:56:17 +01:00
Christophe Simonis fded0065ae [MERGE] forward port branch saas-14 up to 6c4389df41 2017-01-23 14:51:11 +01:00
Christophe Simonis 6c4389df41 [MERGE] forward port branch 10.0 up to 6804085b8c 2017-01-23 14:33:53 +01:00
Fabien Pinckaers d1ee11ff4d [IMP] product: typo default_code is not an internal reference + bug at import because two times the same label 2017-01-18 13:18:34 -08:00
norlinhenrik 47c60db4a0 [FIX] product: set the correct company in property
`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
2017-01-16 11:55:07 +01:00
Yenthe V.G 2e18f35c4e [FIX] product: Rename invalid context variable
The context uses an invalid name, which means it'll never work correctly.

fixes #15028

Bug coming from the module migration
2017-01-12 10:38:33 +01:00
Pierre Masereel c4055299c3 [IMP] product: add field 'barcode' on packaging
We add a field allowing to set a barcode on the product packaging.
2017-01-03 17:53:36 +01:00
Pierre Masereel 796900feb7 [REF] product: move packaging_ids on product.product
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.
2017-01-03 17:53:36 +01:00
Raphael Collet 73de86c768 [IMP] base: tighten ir.model.fields access rights 2017-01-03 16:52:49 +01:00
qdp-odoo 4f29b77e3d [MERGE] foward port of 10.0 up to revision 84a650e33a 2016-12-30 17:21:25 +01:00
Kinjal Mehta b0185e15cc [FIX] all: fix some common typos
Sale Order --> Sales Order
Sale Report --> Sales Report
Sale Team -> Sales Team
Payment Term --> Payment Terms
2016-12-22 13:29:38 +01:00
Pierre Masereel a65dc660f1 [REF] product: remove unused setting field 'group_product_variant' 2016-12-21 16:23:40 +01:00
Denis Vermylen (dve) 0c1348345e [FIX] product: return id instead of recordset (bis)
correct 3068afd85a .
2016-12-20 16:30:59 +01:00
Denis Vermylen (dve) 3068afd85a [FIX] product: return id instead of recordset
_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.
2016-12-20 16:03:14 +01:00
Christophe Simonis 1a46fd4968 [MERGE] forward port branch saas-11 up to 995a58cc4b 2016-12-14 14:10:48 +01:00
Christophe Simonis 5f945a5fc5 Revert "[IMP] product,purchase: Make the vendor price configurable on the variants too."
This reverts commit d5c24abee5 which is
broken since e945b86d5a but hasn't been
noticed due to non-validation of views (fixed by fe02b79a65).
2016-12-12 14:34:35 +01:00
Christophe Simonis b33f919e3d [MERGE] forward port branch 10.0 up to aec8e25 2016-12-06 17:38:40 +01:00
Nicolas Martinelli a894fb33c1 [FIX] product: bigger ratio
- 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
2016-12-02 11:10:19 +01:00
Christophe Simonis 0b846861b6 [MERGE] forward port branch 10.0 up to 5dc1c57 2016-12-01 17:05:08 +01:00
mdi-odoo d5c24abee5 [IMP] product,purchase: Make the vendor price configurable on the variants too.
=======
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
2016-12-01 14:59:20 +01:00
Denis Ledoux 05010362d5 [FIX] product: remove currency rounding check against DP account
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
2016-11-30 13:24:03 +01:00
Christophe Simonis e2a8f7c61c [FIX] product: ensure at least 1 item when computing price from pricelist 2016-11-25 12:06:54 +01:00
Christophe Simonis e2fcace05e [MERGE] forward port branch 10.0 up to 13dc704 2016-11-17 15:27:29 +01:00
Denis Ledoux 483024d122 [FIX] product: _compute_currency_id multi-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
2016-11-16 18:38:46 +01:00
Kinjal Mehta b2eb54abe5 [IMP] product: order the attribute values by sequence then by id
=======
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.
2016-11-03 13:34:42 +01:00
Ankit Joshi a28b23f9d3 [ADD] product: add contraint on product internal category type
Constrain the 'internal category' (categ_id) type of a product.template, it
shouldn't be of type view.
2016-11-02 16:12:38 +01:00
Christophe Simonis 3bb022d57c [MERGE] forward port branch saas-12 up to 6f8e40c 2016-10-27 18:17:59 +02:00
Olivier Dony 715860ea29 [FIX] mail, product: remove deprecated m2m params
`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.
2016-10-27 10:20:17 +02:00
Jeremy Kersten 28103a5f2c [FIX] product: fix duplicated creation variants
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
2016-10-12 12:38:38 +02:00
David Beal 1d6df46aba [IMP] product: add _variant_name() in product.attribute.value
To be possible to override the name_get of the variants
Closes #13053
2016-10-12 08:52:54 +02:00
Christophe Simonis 341bea8f88 [MERGE] forward port branch saas-12 up to 43cb4ac 2016-10-10 13:00:05 +02:00
Jeremy Kersten 7d5751f2c5 [IMP] product: remove default property for sale_pricelist 2016-09-29 15:46:27 +02:00