Skip to content
Extraits de code Groupes Projets
Valider 41c45bb7 rédigé par Benjamin - Le Filament's avatar Benjamin - Le Filament
Parcourir les fichiers

[fix] change le compte analytique associé lors du changement de nom du projet

parent cae70b06
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
# © 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
from odoo import models, fields, api
class ScopProjectTimesheet(models.Model):
......@@ -20,3 +20,11 @@ class ScopProjectTimesheet(models.Model):
index=True,
on_delete='restrict',
default=_default_ur)
@api.onchange('name')
def onchange_name(self):
analytic = self.analytic_account_id
if analytic and analytic.ensure_one():
self.analytic_account_id.sudo().write({
'name': self.name,
})
......@@ -34,6 +34,7 @@
</group>
<group>
<field name="cgscop_timesheet_code_id" required="1" placeholder="Code activité National" options="{'no_open': True, 'no_create': True}"/>
<field name="analytic_account_id" invisible="1"/>
<field name="privacy_visibility" invisible="1"/>
<field name="allow_timesheets" invisible="1"/>
</group>
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter