Commit Graph

2093 Commits

Author SHA1 Message Date
Denis Ledoux 5035c76f42 [FIX] product: product prices can be company dependent
Some prices, as standard_price, being a property, are company dependent. Therefore, when browsing as superuser, force_company is mandatory to get the property of the user company
2014-11-04 11:54:03 +01:00
Mohammad Alhashash 43db7267c5 [FIX] stock: UoS quantity in stock.picking
Implements the UoS TODO items on stock.picking.do_partial() to fix #1432.
Add a new method _compute_uos_qty() on product.product to computes
product's invoicing quantity in UoS from quantity in UoM.

The created invoice will use the product_uos of the stock.move, meaning keeping
the quantity specified on the partial picking and the unit of measure of the
original stock.move (e.g. recieving 1 dozen from a 12 unit picking should either
get uos=dozen, uos_qty=1 or uos=unit, uos_qty=12, not a mix of both)

Fixes #1432, opw 611479
2014-10-29 10:10:50 +01:00
Martin Trigaux 8abd003ef0 [FIX] product: reference in test 2014-10-27 11:41:23 +01:00
Martin Trigaux 79ebe1060d [FIX] product: pricelist, uom and price_surcharge
The price_surcharge attribute must be computed based on the reference unit of measure (divided by the factor).
This is to make sure than 12 units and 1 dozen have the same price after pricelist computation (opw 599727).

Added test checking the correctness of pricelist computation based on unit of measures.
2014-10-24 17:21:42 +02:00
Martin Trigaux 3a0af6af7b [FIX] product.uom: safer handling of factor/factor_inv in UI
Add readonly attribute to avoid sending both factor and factor_inv value to the backend when saving.
This was possible if the user switched between uom_type to fill the two fields.
2014-10-22 14:28:35 +02:00
Cedric Snauwaert fa2f7b86bf [FIX] product: remove digits_precision from uom factor fields
Remove the hardcoded precision of 12 on factor and factor_inv,
to use the complete natural precision of NUMERIC types,
preserving all significant digits.

e.g. a UoM with a factor_inv of 6.0 used to be computed as:
factor_inv: 6.0 -> factor: 0.166666666667 (1.0/6.0, rounded to 12 digits) -> factor_inv: 5.999999999988 (1.0/factor)
which could lead to errors such 12*0.166666666667 = 2.000000000004 instead of 2.0

Slightly changed the way the ORM handles float fields to allow setting `digits=0`
as a way to explicitly require a NUMERIC value but without enforcing/rounding
the values at the ORM level, i.e. a truly full-precision field.

NUMERIC type has unlimited precision but is less efficient so should not be
used as the default behaviour, which is why we keep float8 as an alternative.

Modified the view to display the product UOM factor with a 5 digits value by default.
This value is for usability purpose only, the field still accepts bigger precision, by
setting the `digits` option on the field in the form view.

This change is safe in a stable series, the `digits=0` alternative is
treated the same as the default `digits=None` everywhere in the framework,
except when creating the database field.
2014-10-22 14:28:34 +02:00
Martin Trigaux 7705f883d2 [FIX] base: support float rounding with rounding_method=UP (ceiling)
Add rounding_method parameter on float_round method to offer
HALF-UP (default, usual round) or UP (ceiling) rounding method.
Use the second method instead of math.ceil() for product
reservations.

For UP, the python math.ceil() method uses "torwards infinity"
rounding method while we want "away from zero".
Therefore we use the absolute value of normalized_value to make
sure than -1.8 is rounded to -2.0 and not -1.

Fixes #1125 #2793

This is a cherry-pick of d4972ff which was reverted at 333852e due
to remaining issue with negative values.
2014-10-22 14:28:22 +02:00
Lionel Sausin (Numérigraphe) 04bc91cb4e [FIX] stock: groups mixup in views
Use group_production_lot for serial options, group_stock_packaging for packaging, use group_tracking_lot for pallet/parcel
Groups are removed completly from the view for stock.tracking as they render the view useless.

Always display weights on the product form
They really have nothing to do with the logistic units and we don't have another group to restrict them to.

Fixes #1443
2014-10-06 14:43:11 +02:00
Martin Trigaux 78144410a4 [IMP] product: name_get matching on commercial_partner_id for suppliers
The name_get of a product will use some information (e.g. default_code) based on the supplier.
The matching of the supplier should use the commercial_partner_id in case the supplier info are on the company and the partner_id in the context belongs to the company (e.g. creates quotation with a contact of the company).
Fixes #1219
2014-10-02 10:59:18 +02:00
Denis Ledoux 9cc54dcd2c [FIX] product: name_search handles negative operators 2014-10-01 12:39:59 +02:00
Denis Ledoux 333852e19d Revert "[FIX] product,float_utils: perform ceiling via float_round with new rounding_method UP"
This reverts commit d4972ffdb6.

Seems to break some cases, at least in _product_reserve from stock/stock.py

Actual use case:

SELECT product_uom, sum(product_qty) AS product_qty FROM stock_move WHERE location_dest_id=%s AND location_id<>%s AND product_id=3645 AND state='done' GROUP BY product_uom;
returning 1 | 6

SELECT product_uom,-sum(product_qty) AS product_qty FROM stock_move WHERE location_id=%s AND location_dest_id<>%s AND product_id=%s AND state in ('done', 'assigned') GROUP BY product_uom;
returning 1 | -6

results += cr.dictfetchall()
    total = 0.0
    results2 = 0.0
    for r in results:
        amount = uom_obj._compute_qty(cr, uid, r['product_uom'], r['product_qty'], context.get('uom', False))
        results2 += amount
        total += amount
Total = 1, amount = -5

It should actually be
Total = 0, amount = -6
2014-09-26 21:21:06 +02:00
Cedric Snauwaert 311c77bb88 [FIX] product: _compute_qty: first round before ceiling, to avoid pathological cases
Fixes problem when we try to sell 12 units of a product and change it to 1 dozen,
the algorithm was then trying to recompute the original amount and was getting
12,0000048 as a result which was then passed to the ceiling method, getting 13.0!

See also previous commit and issue #1125, PR #1126
2014-09-24 17:11:26 +02:00
Cedric Snauwaert d4972ffdb6 [FIX] product,float_utils: perform ceiling via float_round with new rounding_method UP
Modified product ceiling() to use float_round() with special mode
for rounding UP (away from zero), avoiding pathological cases where
float representations errors were ceiling to the superior unit.

Also added correspding tests for rounding_method=UP

Fixes issue #1125, and replaces PR #1126.
2014-09-24 17:11:25 +02:00
Thomas Groutars 397e83554b [FIX] product: make sure unlinked product still exists
When uninstalling/updating a module, we may execute unlink method on product.template before product.product. In such cases, the product is already removed after removeing the template (_inherits) and the chained unlink of the product would fail (traceback when browsing).
2014-08-18 10:37:03 +02:00
Olivier Dony 96c36e895c [I18N] Update all 7.0 translation templates with latest terms and annotations
Total new terms: 168
Total deleted terms: 95
Total identical terms: 16329
(Some modules skipped, typically all l10n_* modules)
2014-08-14 02:24:24 +02:00
Olivier Dony 02035b27b8 [RESTORE] Restore *.sxw files, skipped during bzr-to-git conversion to discard older binary blobs 2014-05-22 14:07:15 +02:00
Launchpad Translations on behalf of openerp c2584c8cb0 Launchpad automatic translations update. 2014-05-18 05:53:48 +00:00
Launchpad Translations on behalf of openerp 6ab0f645bc Launchpad automatic translations update. 2014-05-17 07:10:37 +00:00
Martin Trigaux 8f43b749f4 [FIX] product: when duplicating a product, keep the language in the context
At the time of the context_wo_lang patch (7.0 revision 6577), the orm did not keep the language in copy_data, this patch intended to be more consistent.
Since server revision 5146 7.0, the new behaviour is to use the translated version in copy_data. Removign this change will be more consistent with the orm.

The expected behaviour is now the following:
In user lang: translated product name + translated '(copy)'
In other lang: same as original product

lp bug: https://launchpad.net/bugs/1159913 fixed

bzr revid: mat@openerp.com-20140508134937-7cbja3vsv311z5j4
2014-05-08 15:49:37 +02:00
Denis Ledoux 12eb157397 [FIX] product: price computation failed when for pricelists based on Cost price for non-employee users
bzr revid: dle@openerp.com-20140425125507-njfyl1r6wn11vqwx
2014-04-25 14:55:07 +02:00
Launchpad Translations on behalf of openerp 89fd1bede4 Launchpad automatic translations update.
bzr revid: launchpad_translations_on_behalf_of_openerp-20140419063533-z6kswp5wkioh5jlv
bzr revid: launchpad_translations_on_behalf_of_openerp-20140420055842-traoy17xi60ufook
bzr revid: launchpad_translations_on_behalf_of_openerp-20140421050815-44ydlitvsaj3xdd9
bzr revid: launchpad_translations_on_behalf_of_openerp-20140422082459-bfjqgpt2bpgll64p
2014-04-22 08:24:59 +00:00
Launchpad Translations on behalf of openerp 001a034e58 Launchpad automatic translations update.
bzr revid: launchpad_translations_on_behalf_of_openerp-20140412094159-mhy3v2prb3ctx32k
bzr revid: launchpad_translations_on_behalf_of_openerp-20140412094217-3u3f03f0wjhbzyo4
bzr revid: launchpad_translations_on_behalf_of_openerp-20140413062047-z833pejjrtuhfygs
bzr revid: launchpad_translations_on_behalf_of_openerp-20140414055948-intynzk8l823ukei
2014-04-14 05:59:48 +00:00
Launchpad Translations on behalf of openerp fd98bf36aa Launchpad automatic translations update.
bzr revid: launchpad_translations_on_behalf_of_openerp-20140307072427-zkvqj45icrzupx0m
bzr revid: launchpad_translations_on_behalf_of_openerp-20140307072433-0lqpjt07j1s8k8cs
2014-03-07 07:24:33 +00:00
Olivier Dony c43c308c33 [FIX] product: typo in previous commit
"The only man who makes no mistakes is the man who never does anything. ~T.R." ;-)

bzr revid: odo@openerp.com-20140306190906-k8wjr9urekpoy7ch
2014-03-06 20:09:06 +01:00
Martin Trigaux dc46ffd589 [FIX] use float rounding for pricelist instead of ceiling
bzr revid: mat@openerp.com-20140306162953-iu7k53i5zsllokdp
2014-03-06 17:29:53 +01:00
Martin Trigaux 1e048736df [IMP] remove useless imports
bzr revid: mat@openerp.com-20140306153125-czwswqw1k3w5ungh
2014-03-06 16:31:25 +01:00
Martin Trigaux 378dbbfaae [IMP] product: add python tests
bzr revid: mat@openerp.com-20140306133456-cnqjcwmo73ioqxxf
2014-03-06 14:34:56 +01:00
Martin Trigaux 5db649549c [IMP] mrp: use also the ceiling method from product
bzr revid: mat@openerp.com-20140306094504-37r691hxcemp0ual
2014-03-06 10:45:04 +01:00
Martin Trigaux 1967b6ce19 [FIX] product: when converting unit of mesures, round above instead of mathematical rounding
bzr revid: mat@openerp.com-20140305171456-goo7on3ncfihu0wu
2014-03-05 18:14:56 +01:00
Launchpad Translations on behalf of openerp e231045095 Launchpad automatic translations update.
bzr revid: launchpad_translations_on_behalf_of_openerp-20140306061409-nvr56r44q6smklxz
bzr revid: launchpad_translations_on_behalf_of_openerp-20140305055718-w3c9kzsncncpu12w
bzr revid: launchpad_translations_on_behalf_of_openerp-20140306061519-n2qbjt3fe7l104aw
2014-03-06 06:15:19 +00:00
Olivier Dony a6e9d3edcc [FIX] product: avoid reading image_small field which is bandwidth intensive and un-necessary
bzr revid: odo@openerp.com-20140304182724-kplzfik56ebp2boe
2014-03-04 19:27:24 +01:00
Launchpad Translations on behalf of openerp b201dc79b7 Launchpad automatic translations update.
bzr revid: launchpad_translations_on_behalf_of_openerp-20140218054104-8egkh4jj7hiiwuih
bzr revid: launchpad_translations_on_behalf_of_openerp-20140219054048-688twg0fubtm2x2q
bzr revid: launchpad_translations_on_behalf_of_openerp-20140220054214-237ri67t9rw3l4fu
bzr revid: launchpad_translations_on_behalf_of_openerp-20140221063855-wniw42r27gyg3h6y
bzr revid: launchpad_translations_on_behalf_of_openerp-20140222073328-xpn7nwqz407yzumq
bzr revid: launchpad_translations_on_behalf_of_openerp-20140223074516-0r09cpmma58ylqji
bzr revid: launchpad_translations_on_behalf_of_openerp-20140224060319-535oheaq2w9u2ye3
bzr revid: launchpad_translations_on_behalf_of_openerp-20140225062420-zl7curej0e0warhz
bzr revid: launchpad_translations_on_behalf_of_openerp-20140226073146-3vzhw4hddr81olbs
bzr revid: launchpad_translations_on_behalf_of_openerp-20140227062959-24e2rn98rqb9afpr
bzr revid: launchpad_translations_on_behalf_of_openerp-20140228072152-f9gm4ud1wu19ge27
bzr revid: launchpad_translations_on_behalf_of_openerp-20140301055205-r0df0fqz9yf5z66i
bzr revid: launchpad_translations_on_behalf_of_openerp-20140302052638-bjf11oumy7w15oco
bzr revid: launchpad_translations_on_behalf_of_openerp-20140304082704-k1z2te1tfud43zy3
2014-03-04 08:27:04 +00:00
Martin Trigaux ebdb230699 [FIX] pricelist: correctly take into account uom when computing pricelists based on supplier price on product form (opw 595881)
The previous behaviour used the uom of product while it could be a different one selected (by default the purchase unit of measure for purchase orders).
This was an issue especially when having different uom with supplier info lines setting degressive prices. The price should be computed based on selected uom and not the product uom.

bzr revid: mat@openerp.com-20140211145703-9uut4hw9aqh7326o
2014-02-11 15:57:03 +01:00
Launchpad Translations on behalf of openerp 8d85c23e4a Launchpad automatic translations update.
bzr revid: launchpad_translations_on_behalf_of_openerp-20140209065003-9soyulgvssk8n5ci
bzr revid: launchpad_translations_on_behalf_of_openerp-20140208071621-b018rnkhyxmmm5jk
bzr revid: launchpad_translations_on_behalf_of_openerp-20140209065224-kih7tx56elds0zok
bzr revid: launchpad_translations_on_behalf_of_openerp-20140210055324-raxopm5ej680oc73
2014-02-10 05:53:24 +00:00
Launchpad Translations on behalf of openerp ffabcd257c Launchpad automatic translations update.
bzr revid: launchpad_translations_on_behalf_of_openerp-20140206062321-j6cpns6xz3f81net
bzr revid: launchpad_translations_on_behalf_of_openerp-20140206062510-x502ahdwzezvea54
2014-02-06 06:25:10 +00:00
Launchpad Translations on behalf of openerp ff8f5104b1 Launchpad automatic translations update.
bzr revid: launchpad_translations_on_behalf_of_openerp-20140131062421-oq9ywafamdrwjbtj
2014-01-31 06:24:21 +00:00
Launchpad Translations on behalf of openerp 4d3a623af7 Launchpad automatic translations update.
bzr revid: launchpad_translations_on_behalf_of_openerp-20140128070310-721zmkmw0ocyz6im
bzr revid: launchpad_translations_on_behalf_of_openerp-20140129060326-647er2mw0mfn2j5s
2014-01-29 06:03:26 +00:00
Launchpad Translations on behalf of openerp d9cdc8564c Launchpad automatic translations update.
bzr revid: launchpad_translations_on_behalf_of_openerp-20140122061252-9jm03vlbr13ofqo9
bzr revid: launchpad_translations_on_behalf_of_openerp-20140123055652-0p71divui34v1c1q
bzr revid: launchpad_translations_on_behalf_of_openerp-20140124062440-hx0z2e4sd6nz7exc
bzr revid: launchpad_translations_on_behalf_of_openerp-20140126051449-rlunde7qysqsh1b1
bzr revid: launchpad_translations_on_behalf_of_openerp-20140125064003-v340hiykcngjg9ue
bzr revid: launchpad_translations_on_behalf_of_openerp-20140126051541-9fnyw12nex5poeth
bzr revid: launchpad_translations_on_behalf_of_openerp-20140127054606-1jb6usf6pj7gy1xl
2014-01-27 05:46:06 +00:00
Launchpad Translations on behalf of openerp 805d3757e9 Launchpad automatic translations update.
bzr revid: launchpad_translations_on_behalf_of_openerp-20140123055732-ggft6ftma1kfpaq6
2014-01-23 05:57:32 +00:00
Launchpad Translations on behalf of openerp d5bc07f898 Launchpad automatic translations update.
bzr revid: launchpad_translations_on_behalf_of_openerp-20140122061335-z6h1dn3yd94l8850
2014-01-22 06:13:35 +00:00
Launchpad Translations on behalf of openerp 28d79433c3 Launchpad automatic translations update.
bzr revid: launchpad_translations_on_behalf_of_openerp-20140118070457-rn2tgdxis2fi3nqo
bzr revid: launchpad_translations_on_behalf_of_openerp-20140119055822-ajy043mntc4jr407
bzr revid: launchpad_translations_on_behalf_of_openerp-20140120055854-z7wtyb24c5t8kcmj
bzr revid: launchpad_translations_on_behalf_of_openerp-20140118070538-2xm86ece1aate8u9
bzr revid: launchpad_translations_on_behalf_of_openerp-20140119055932-sa6vrp2g8ua3u88e
bzr revid: launchpad_translations_on_behalf_of_openerp-20140120055948-lwcyqcfutgamwac1
bzr revid: launchpad_translations_on_behalf_of_openerp-20140118070546-d89xqw56zou7e9p9
bzr revid: launchpad_translations_on_behalf_of_openerp-20140120055955-6wrdxqy1018mo7jq
2014-01-20 05:59:55 +00:00
Launchpad Translations on behalf of openerp 216824eae4 Launchpad automatic translations update.
bzr revid: launchpad_translations_on_behalf_of_openerp-20140117070359-ulb46tg4k5pv2xl7
2014-01-17 07:03:59 +00:00
Launchpad Translations on behalf of openerp f39b8bb436 Launchpad automatic translations update.
bzr revid: launchpad_translations_on_behalf_of_openerp-20140116060347-s1e2v9o33n1cxk2y
bzr revid: launchpad_translations_on_behalf_of_openerp-20140116060418-cw791djr2ebt2wuy
bzr revid: launchpad_translations_on_behalf_of_openerp-20140116060651-x8r0l0m27wcx0yav
2014-01-16 06:06:51 +00:00
Launchpad Translations on behalf of openerp 5334330d9d Launchpad automatic translations update.
bzr revid: launchpad_translations_on_behalf_of_openerp-20140115062126-ypg4xp33rspusnts
bzr revid: launchpad_translations_on_behalf_of_openerp-20140115062205-ov2axame3z00jkii
2014-01-15 06:22:05 +00:00
Launchpad Translations on behalf of openerp e6a46a855d Launchpad automatic translations update.
bzr revid: launchpad_translations_on_behalf_of_openerp-20131220053413-o3xa4nlpu9snoiq6
2013-12-20 05:34:13 +00:00
Launchpad Translations on behalf of openerp 379dc8bf98 Launchpad automatic translations update.
bzr revid: launchpad_translations_on_behalf_of_openerp-20131201054445-5fy8zd7lvnn9mjp2
bzr revid: launchpad_translations_on_behalf_of_openerp-20131202055138-hq05otjnuktjpa48
bzr revid: launchpad_translations_on_behalf_of_openerp-20131204055601-tbzqqhperzffjbjt
bzr revid: launchpad_translations_on_behalf_of_openerp-20131204055642-0rwynvhgvs0r14b3
2013-12-04 05:56:42 +00:00
Launchpad Translations on behalf of openerp 4fd98907ce Launchpad automatic translations update.
bzr revid: launchpad_translations_on_behalf_of_openerp-20131130053134-6u83vcd1133xs8yf
bzr revid: launchpad_translations_on_behalf_of_openerp-20131201054550-w0k8alfqs2bigurx
bzr revid: launchpad_translations_on_behalf_of_openerp-20131202055222-2u7o99e48254dceu
bzr revid: launchpad_translations_on_behalf_of_openerp-20131203061621-hyqqh11jt7g0ilqh
2013-12-03 06:16:21 +00:00
Launchpad Translations on behalf of openerp 1fedbc18f5 Launchpad automatic translations update.
bzr revid: launchpad_translations_on_behalf_of_openerp-20131126060718-7io3n16co82qp5pu
bzr revid: launchpad_translations_on_behalf_of_openerp-20131127053913-ypnlpggd4wt58pzx
bzr revid: launchpad_translations_on_behalf_of_openerp-20131128060603-kk12b8iu0uhhtist
bzr revid: launchpad_translations_on_behalf_of_openerp-20131129052938-u0wq863etr3sl1cm
bzr revid: launchpad_translations_on_behalf_of_openerp-20131129053023-zlbrprsiq9e7vs39
2013-11-29 05:30:23 +00:00
Launchpad Translations on behalf of openerp 6fd5575930 Launchpad automatic translations update.
bzr revid: launchpad_translations_on_behalf_of_openerp-20131127053957-ekc1bfm5ohug21aa
2013-11-27 05:39:57 +00:00
Launchpad Translations on behalf of openerp 5f21b4bff9 Launchpad automatic translations update.
bzr revid: launchpad_translations_on_behalf_of_openerp-20131123062620-6obt60lwob64hi98
bzr revid: launchpad_translations_on_behalf_of_openerp-20131124054757-4w9nik6wieeqf0yg
bzr revid: launchpad_translations_on_behalf_of_openerp-20131125060111-rf445xxiinvazinv
2013-11-25 06:01:11 +00:00