purchase_analytic_plans module won't work when grouping purchase orders
This blueprint originated from the following bug report that couldn't be fixed for v5:
https:/
Hi,
Take a fresh install, right on trunk, manufacturing profile for instance.
Install the addons/
Create 2 sale orders to the same supplier, each with one product line at least.
For those 2 product purchase order lines, enter an "analytic distribution" (create some)
No need to validate the purchase orders, just save them
Now go in the purchase order list view
Select the two purchase orders
Click on 'action' in the tool bar and chose "merge purchase orders"
The bug is that in the new created merged purchase order, the purchase
lines lost their analytic distribution (analytics_id field)!
The problem is that the purchase/
purchase order lines fields somewhat hardcoded. indeed, the following
code:
for order_line in porder.order_line:
line_key = make_key(
won't cope with any purchase.order.line extension like the
purchase_
something and add the missing keys either.
In the same way, the following code:
order_infos = new_order[0]
if not order_infos:
})
won't take new purchase order extension fields into accounts, while this
might be less important than for the purchase order lines.
Suggestion:
1) avoid to hardcode the purchase order line keys f possible
2) extract some overridable method so extension modules like purchase_
Finally, this will happen with other third party modules too.
Hope this helps,
Raphaël Valyi.
note from Raphaël Valyi:
-> Hello Harry, I promise to check this as soon as possible, this is great news indeed.
Blueprint information
- Status:
- Not started
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- New
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
Related branches
Related bugs
Sprints
Whiteboard
see patch for solution :
https:/