diff --git a/models/lefilament_tdb.py b/models/lefilament_tdb.py index 06547417fc23fdaa70193fc99a6fd440a9941428..f6b977277d50377353e0e1fc78a1a504d557f0f6 100644 --- a/models/lefilament_tdb.py +++ b/models/lefilament_tdb.py @@ -63,8 +63,8 @@ class LeFilamentTdb(models.Model): encaisse = self.env.cr.fetchone()[0] ############## CHARGES ################ - self.env.cr.execute("select charges_fixes from res_company" ) - charges_fixes = self.env.cr.fetchone()[0] + # self.env.cr.execute("select charges_fixes from res_company" ) + # charges_fixes = self.env.cr.fetchone()[0] if not encaisse: encaisse = 0 @@ -151,32 +151,3 @@ class LeFilamentTdb(models.Model): -class LeFilamentData(models.Model): - _name = "lefilament.dashboard.data" - _auto = False - _description = "Donnees Annuelles" - - facture = fields.Float("Facturé") - pipe = fields.Float("Pipe") - tresorerie = fields.Float("Trésorerie") - commandes = fields.Float("Commandes en cours") - entree = fields.Float("Entrées") - sortie = fields.Float("Sorties") - variation = fields.Float("Variation") - - def init(self, cr): - tools.drop_view_if_exists(cr, 'lefilament_dashboard_data') - cr.execute(""" - CREATE OR REPLACE VIEW lefilament_dashboard_data AS ( - select - (select count(*) from account_invoice) as id, - (select sum(amount_untaxed) from account_invoice where state!='draft' and type='out_invoice' and date >= date_trunc('year', current_date) ) as facture, - (select sum(planned_revenue*probability/100) from crm_lead where active=True) as pipe, - (select sum(amount) from account_bank_statement_line ) as tresorerie, - (select sum(amount) from account_bank_statement_line where amount > 0 and date >= date_trunc('year', current_date) ) as entree, - (select sum(amount) from account_bank_statement_line where amount < 0 and date >= date_trunc('year', current_date) ) as sortie, - (select sum(amount) from account_bank_statement_line where date >= date_trunc('year', current_date) ) as variation, - (select sum(price_subtotal-qty_invoiced*price_unit) from sale_order_line where invoice_status='to invoice') as commandes); """) - - - diff --git a/models/res_company.py b/models/res_company.py index e535daab588e9fc0a4699774094568598c001fee..58281848c353106f82089c7985c6316c61c94a09 100644 --- a/models/res_company.py +++ b/models/res_company.py @@ -7,3 +7,4 @@ class res_company(models.Model): ca_target = fields.Integer( "Objectif Chiffre d'Affaire" ) charges_fixes = fields.Integer( "Charges Fixes" ) +