Skip to content
Snippets Groups Projects
Commit c55dd32c authored by Rémi - Le Filament's avatar Rémi - Le Filament
Browse files

Fix for v10 as is_timesheet does not exist anymore, may not work for expenses though

parent 94464254
Branches
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ import time ...@@ -5,7 +5,7 @@ import time
from odoo import tools from odoo import tools
from odoo import models, fields, api, osv from odoo import models, fields, api, osv
class SapovalPartners(models.Model): class FilamentProjet(models.Model):
_name = 'project.project' _name = 'project.project'
_inherit = 'project.project' _inherit = 'project.project'
...@@ -30,7 +30,7 @@ class SapovalPartners(models.Model): ...@@ -30,7 +30,7 @@ class SapovalPartners(models.Model):
res = 0.0 res = 0.0
account = self.analytic_account_id.id account = self.analytic_account_id.id
############## Calcul couts annexes ################ ############## Calcul couts annexes ################
self.env.cr.execute("select sum(unit_amount) from account_analytic_line where is_timesheet=TRUE and account_id=%s;", (account, ) ) self.env.cr.execute("select sum(unit_amount) from account_analytic_line where account_id=%s;", (account, ) )
heures_passees = self.env.cr.fetchone()[0] heures_passees = self.env.cr.fetchone()[0]
if heures_passees: if heures_passees:
self.lf_heures_passees = heures_passees self.lf_heures_passees = heures_passees
...@@ -49,7 +49,8 @@ class SapovalPartners(models.Model): ...@@ -49,7 +49,8 @@ class SapovalPartners(models.Model):
def _couts_annexes(self): def _couts_annexes(self):
account = self.analytic_account_id.id account = self.analytic_account_id.id
############## Calcul couts annexes ################ ############## Calcul couts annexes ################
self.env.cr.execute("select sum(amount) from account_analytic_line where amount<0 and is_timesheet=FALSE and account_id=%s;", (account, ) ) ## self.env.cr.execute("select sum(amount) from account_analytic_line where amount<0 and is_timesheet=FALSE and account_id=%s;", (account, ) )
self.env.cr.execute("select sum(amount) from account_analytic_line where amount<0 and account_id=%s;", (account, ) )
couts_annexes = self.env.cr.fetchone()[0] couts_annexes = self.env.cr.fetchone()[0]
if couts_annexes: if couts_annexes:
self.lf_couts_annexes = couts_annexes * (-1.0) self.lf_couts_annexes = couts_annexes * (-1.0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment