Skip to content
Snippets Groups Projects
project.py 1.05 KiB
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 api, fields, models
    
    Benjamin's avatar
    Benjamin committed
    
    
    class ScopProjectTimesheet(models.Model):
        _inherit = "project.project"
    
    
            return self.env["res.company"]._ur_default_get()
    
    Benjamin's avatar
    Benjamin committed
        cgscop_timesheet_code_id = fields.Many2one(
    
            comodel_name="cgscop.timesheet.code", string="Code Activité National"
        )
    
        privacy_visibility = fields.Selection(default="employees")
    
            "union.regionale",
            string="Union Régionale",
    
            ondelete="restrict",
            default=_default_ur,
        )
    
        creation_invoiced = fields.Boolean(
            string="Facturé au titre de la création",
        )
    
        def onchange_name(self):
            analytic = self.analytic_account_id
            if analytic and analytic.ensure_one():
    
                self.analytic_account_id.sudo().write(
                    {
                        "name": self.name,
                    }
                )