summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier BOL (xbo) <xbo@odoo.com>2021-02-23 15:51:11 +0000
committerXavier BOL (xbo) <xbo@odoo.com>2021-02-24 13:04:59 +0000
commit1ced9aaf7a3d6d345fe5bd05269af978c8c86ee3 (patch)
treec60545dcda0437fdcd70a014ca8055d5c448f6d6
parent00b573c5b14dcf50ab5ed1612b1490bb75a6f6b1 (diff)
[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: Yannick Tivisse (yti) <yti@odoo.com>
-rw-r--r--addons/sale_project/models/project.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/sale_project/models/project.py b/addons/sale_project/models/project.py
index b86a8e72490..d7a6f8a3840 100644
--- a/addons/sale_project/models/project.py
+++ b/addons/sale_project/models/project.py
@@ -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 = [