Skip to content
Snippets Groups Projects
hr_timesheet.py 982 B
Newer Older
  • Learn to ignore specific revisions
  • Benjamin's avatar
    Benjamin committed
    # © 2019 Le Filament (<http://www.le-filament.com>)
    # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
    
    from odoo import models, fields, api
    
    
    class ScopHrTimesheet(models.Model):
        _inherit = "account.analytic.line"
    
        name = fields.Char(required=False)
        cgscop_timesheet_code_id = fields.Many2one(
            related='project_id.cgscop_timesheet_code_id',
            string='Code Activité CG',
            store=True)
        ur_financial_system_id = fields.Many2one(
            comodel_name='ur.financial.system',
            string='Dispositif Financier')
    
        # ------------------------------------------------------
        # Compute Functions
        # ------------------------------------------------------
    
        # ------------------------------------------------------
        # OnChange Functions
        # ------------------------------------------------------
        @api.onchange('project_id')
        def onchange_project_id(self):
            self.partner_id = self.project_id.partner_id