Paul Stroobant 2283f1105b [FIX] project_purchase: split ids when calculating analytic contribution
Steps to reproduce issue:

1. Create a Project with an Analytic Account and ensure it is Billable
2. Create a Purchase Order and add a Product
3. Add an Analytic Distribution to the Product with, on one line, the Project Account and an Account from another Plan
4. Confirm the Purchase Order
5. Open the Project's Updates
6. You get the error :

>     analytic_contribution = pol_read['analytic_distribution'][str(self.analytic_account_id.id)] / 100.
>     KeyError: '[int]'

Explanation:

This issue is related to odoo@73fa88c44ae64b2fc93ef1233f1ab8f8dbe2b0cc: the IDs are now stored in a csv string instead of separate values to allow for cross-analytics. In this case, `self.analytic_account_id.id` is not a key but part of a key.
The line causing the issue was overlooked during the resolution of the previous one.

Suggested fix:

Similar lines have been fixed in the previous commit. Applying the same correction solves the issue.
https://github.com/odoo/odoo/commit/73fa88c44ae64b2fc93ef1233f1ab8f8dbe2b0cc#diff-7af98465d7e344b935b9f2327a30b2da17a4df73d64bfee5b9b7a497362083e7L48-R59
https://github.com/odoo/odoo/commit/73fa88c44ae64b2fc93ef1233f1ab8f8dbe2b0cc#diff-2f1670bdaecbb290806818cc80aff338e2f956d89f3a71f6c2ed1b9805795fd3L575-R600

opw-3773509

closes odoo/odoo#158325

Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
2024-03-22 14:47:54 +00:00
…
2024-03-22 09:44:37 +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%