Skip to content
Snippets Groups Projects
Commit 7517bf46 authored by Kartik Chavda's avatar Kartik Chavda
Browse files

[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: default avatarLaurent Stukkens (ltu) <ltu@odoo.com>
parent 4dc5d76c
No related branches found
No related tags found
No related merge requests found
......@@ -197,6 +197,8 @@ class SaleOrderLine(models.Model):
description = '<br/>'.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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment