Florimond Husquinet (fhu) 0fe86d4b40 [FIX] mrp_bom_cost: compute price from bom ensure one fail
- Activate mrp bom cost.
- Create a BoM for a product
- The Compute "Price from BoM" button appear on the product template
below the Cost field.
- Click the button.

Before this commit:

Probably because dynamic variant creation is activated and there is
no variants, the ensure_one fails with 0 records actually passed to
the function.

Additionally, if all the BoM are for variants and there is no BoM for
the template, then there is a division by 0 exception.

After this commit:

A test is performed to avoid calling the function with 0 records.
A test is performed to avoid a division by 0 exception.

closes odoo/odoo#36761

Opw: 2064884
X-original-commit: 42264002070c8acbb781bd111d8a0c31e2ad9716
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-12 09:39:23 +00:00
…
…
…
…
…
…
…
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

Then follow the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%