[NEW] hr_expense_analytic_account_preselect_with_project: new module
This commit is contained in:
@@ -0,0 +1 @@
|
||||
from . import hr_expense
|
@@ -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
|
||||
|
Reference in New Issue
Block a user