Nathan Marotte (nama) b4e11b7dc5 [FIX] sale_stock_margin: Traceback after reset to quotation avco kit SO
Issue: With margin enabled and avco for stock valuation, after
confirming a SO with a product variant which is a bom kit,
when we try to change the variant, there is a traceback

Steps to reproduce :
1) Install Stock, Accounting, MRP, Sale,
2) Enable Margins in settings

3) Configure a Product Category with costing method AVCO
4) Configure a Product with 2 variants and that product category
5) [Important: KIT] Create 2 BoM, one for each variant and set those
BoM to KIT
6) Create a SO for that product and one variant
7) Confirm the SO, cancel it, and set to quotation
8) Edit the SO and change the variant, save
-> Traceback

Side-Note:
 This issue is due to the fact that we iterate over the stock_moves to
 find the quantity of the BoM, but that stock_move correspond to
 confirming at step 7, when we change the variant at step 8, the stock
 move has not changed, so still contains the previous bom_line_id with
 the quantity, but this doesn't reflect with the new state of the SO
 which is for a different variant.

 For me since the stock move is canceled, it should be taken into
 consideration when computing the average price but I might be wrong,
 it's up to the reviewer to decide if it makes sense

opw-2639093

closes odoo/odoo#77606

X-original-commit: c0d4ed5ac641d339a6cd4e23db9667048d35360d
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-10-04 09:16:09 +00:00
2021-09-16 07:17:40 +00:00
…
…
…
2020-09-28 14:07:25 +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, ...

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.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with 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%