Skip to content
Snippets Groups Projects
Commit 1ced9aaf authored by Xavier BOL (xbo)'s avatar Xavier BOL (xbo)
Browse files

[FIX] sale_project: get only sales order for sale_order_id in project


Before this commit, the user can select a sales order which is always a
quotation and he cannot select a sales order line because the state of
the sales order is not equal to 'sale' or 'done'.

This commit adds ('state', 'in' ['sale', 'done']) in the domain of the
sale_order_id field in project.project model.

closes odoo/odoo#66756

Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
parent 00b573c5
Branches
Tags
No related merge requests found
......@@ -16,7 +16,7 @@ class Project(models.Model):
help="Sales order item to which the project is linked. Link the timesheet entry to the sales order item defined on the project. "
"Only applies on tasks without sale order item defined, and if the employee is not in the 'Employee/Sales Order Item Mapping' of the project.")
sale_order_id = fields.Many2one('sale.order', 'Sales Order',
domain="[('order_line.product_id.type', '=', 'service'), ('partner_id', '=', partner_id)]",
domain="[('order_line.product_id.type', '=', 'service'), ('partner_id', '=', partner_id), ('state', 'in', ['sale', 'done'])]",
copy=False, help="Sales order to which the project is linked.")
_sql_constraints = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment