From 7517bf46d4bd511b498be0c80203c7c842aa1b83 Mon Sep 17 00:00:00 2001 From: Kartik Chavda Date: Wed, 29 Jun 2022 05:28:22 +0000 Subject: [PATCH] [FIX] sale_,(project): set default analytic account and analytic tags in task Currently, the project's analytic account and analytic tags are not set by default in the task. Now it will be fixed. Steps to reproduce: 1. Install project 2. Activate the analytic account and analytic tags in the user setting 3. Create a project with analytic account and analytic tags 4. Create a task from the kanban view 5. Check the analytic account and analytic tags in the task Steps to reproduce: 1. Install sale_project 2. Activate the analytic account and analytic tags in the user setting 3. Create a project with analytic account and analytic tags 4. Create a product (Create on Order = task) 5. Create a sale order and confirm 6. Check the analytic account and analytic tags in the task task-2930761 closes odoo/odoo#97455 X-original-commit: 0a5bc153cf682b29b1c86ac966d8164bd41acbdb Signed-off-by: Laurent Stukkens (ltu) --- addons/sale_project/models/sale_order_line.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/sale_project/models/sale_order_line.py b/addons/sale_project/models/sale_order_line.py index 15f398f90fc..16510b96af4 100644 --- a/addons/sale_project/models/sale_order_line.py +++ b/addons/sale_project/models/sale_order_line.py @@ -197,6 +197,8 @@ class SaleOrderLine(models.Model): description = '
'.join(sale_line_name_parts[1:]) return { 'name': title if project.sale_line_id else '%s - %s' % (self.order_id.name or '', title), + 'analytic_account_id': project.analytic_account_id.id, + 'analytic_tag_ids': [Command.set(project.analytic_tag_ids.ids)], 'planned_hours': planned_hours, 'partner_id': self.order_id.partner_id.id, 'email_from': self.order_id.partner_id.email,