Commit Graph
13 Commits
Author SHA1 Message Date
Nicolas Martinelli 56749cf098 [FIX] product_extended: compute price
Remove the limitation introduced in 6feefe4d10, since the
`standard_price` field is now available on `product.product`.

opw-1814973
2018-03-15 13:35:54 +01:00
Christophe Simonis a2ea4ba095 [MERGE] forward port branch saas-15 up to 5701010d0d 2017-12-12 16:15:04 +01:00
Martin Trigaux ffbcf69af5 [FIX] product_extended: remove not working price computation
costs_hour field no longer exists
Some modules in a different repository (let say enterprise), may be still using
it but it is not its place here.
For stability reasons, we keep the computation if an external module adds the
missing field anyway

Fixes #16269
Closes #20899
2017-12-12 11:36:58 +01:00
Christophe Simonis 6f3eada2c3 [MERGE] forward port branch saas-15 up to f687a27b79 2017-06-06 19:23:03 +02:00
Nicolas Martinelli 46c85b4a82 [FIX] product_extended: time cycle
Use the field `time_cycle` for cost computation, which takes into
account the routing configuration (fixed time of computed based on
previous operations).
2017-06-02 12:20:08 +02:00
Nicolas Martinelli 7cc8420ea0 [FIX] product_extended: workcenter cost
- Create a work center with a capacity of 1, an efficiency factor of
  100% and a cost per hour of 40$
- Create a routing with two operations: one with a fixed duration of
  30:00 minutes (OP1) and another with a duration computed on real time
  but with a default of 30:00 minutes (OP2)
- Create a component with UOM "m" and a cost of 10$
- Create a finished product with an associated BoM
- The BoM has a first line with 0.8m of component in the OP1 and a
  second line with 0.4m of component in the OP2
- Activate the Compute from BoM option on the finished product
- The proposed cost is 32$

Expected cost: 52$
(30 minutes @40$/hour + 30 minutes @40$/hour + 1,2m @10$/m)

We divide the WC cost by the number of operations, which does not make
sense.

opw-741032
2017-06-02 12:20:08 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
Nicolas Martinelli 8fd6f85169 [FIX] product_extended: Compute from BoM
The price suggested thanks to the "Compute from BoM" button only takes
into account the price of the products listed in the BoM lines.

In v9, there was a "Recursive" option that provided the possibility to
compute the prices of all products implied in the BoM, recursively. This
option has been removed since it was leading to a "black box" behavior
that was unclear to the users.

However, limiting the price computation to the BoM lines only is too
restrictive since it doesn't even take into account the phantom BoMs.
By using the `explode` method, we have access to:
- all products not manufactured
- all products manufactured which are not kits (phantom BoM)

It means that the cost of manufactured products (not kits) should still
be computed before the product itself.

opw-697866
2017-01-13 13:25:00 +01:00
Nicolas Martinelli 11e99a0b53 [FIX] product_extended: compute from BoM
When a product template UoM is different from its BoM UoM, the price
suggested thanks to the "Compute from BoM" is incorrect, since it doesn't
apply the conversion rate between the product template UoM and the BoM UoM.

This is because we try to fetch the product UoM through the BoM. However,
if the BoM is not specific to a product.product, the field bom.product_id
is empty.
2017-01-13 13:25:00 +01:00
Christophe Matthieu 166a9d26e3 [IMP] website_sale: create a new compute field to use prefetching and increase performance 2016-08-29 15:31:44 +02:00
Thibault Delavallée f3d6a54e36 [REF] product_uom, *: clean price computation method
product_uom._compute_price() is now an ensure_one multi methods, taking
a browse record as second unit. This helps simplifying and unifying the
various calls and price computation methods.
2016-08-01 15:05:32 +02:00
fwi-odoo b4579339c8 [IMP] product_extended: replace openerp tags, rename class and add py coding 2016-07-27 15:56:27 +02:00
fwi-odoo 9ccb88beb5 [MOV] product_extended: reorganise files 2016-07-27 15:55:25 +02:00