Steps to reproduce the bug:
- Create a blanket order:
- add any storable product
- Confirm
- Click on new quotation
- Create an alternative purchase order from the new PO
Problem:
A user error is triggered, because the “date_planned” is not set in the
`purchase.order.line`:
"The operation cannot be completed: Missing required fields on
accountable purchase order line."
The `default_requisition_id` is set in the context, so the alternative
purchase order is created with the `requisition_id` field set, and in
the compute override `_compute_price_unit_and_date_planned_and_name`:
https://github.com/odoo/odoo/blob/863c5090f09bfffc2867717ed8b3c99b05a5eb9c/addons/purchase_requisition/models/purchase.py#L119-L120
we don't set the `date_planned` and don't call the super compute with
this record, therefore the `date_planned` is not set:
https://github.com/odoo/odoo/blob/863c5090f09bfffc2867717ed8b3c99b05a5eb9c/addons/purchase_requisition/models/purchase.py#L132
https://github.com/odoo/odoo/blob/863c5090f09bfffc2867717ed8b3c99b05a5eb9c/addons/purchase/models/purchase.py#L1209-L1210
opw-3217377
closes odoo/odoo#115596
X-original-commit: 831ebe11c45e59c16a43051889512dc14fa75eb1
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>