[NEW] hr_expense_analytic_account_preselect_with_project: new module

This commit is contained in:
clementthomas
2023-06-22 14:28:18 +02:00
parent 81010e0145
commit 0e80defb81
7 changed files with 111 additions and 0 deletions

View File

@@ -0,0 +1 @@
from . import hr_expense

View File

@@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
from odoo import fields, models, api
class HrExpense(models.Model):
_inherit = "hr.expense"
project_id = fields.Many2one('project.project')
@api.onchange('project_id')
def set_analytic_account(self):
self.analytic_account_id = self.project_id.analytic_account_id