|
|
@ -421,9 +421,9 @@ class DashBoard(models.Model): |
|
|
|
|
|
|
|
states_arg = "" |
|
|
|
if post != ('posted',): |
|
|
|
states_arg = """ state in ('posted', 'draft')""" |
|
|
|
states_arg = """ account_move.state in ('posted', 'draft')""" |
|
|
|
else: |
|
|
|
states_arg = """ state = 'posted'""" |
|
|
|
states_arg = """ account_move.state = 'posted'""" |
|
|
|
|
|
|
|
self._cr.execute((''' select res_partner.name as partner, res_partner.commercial_partner_id as res , |
|
|
|
account_move.commercial_partner_id as parent, sum(account_move.amount_total) as amount |
|
|
@ -470,9 +470,9 @@ class DashBoard(models.Model): |
|
|
|
|
|
|
|
states_arg = "" |
|
|
|
if post != ('posted',): |
|
|
|
states_arg = """ state in ('posted', 'draft')""" |
|
|
|
states_arg = """ account_move.state in ('posted', 'draft')""" |
|
|
|
else: |
|
|
|
states_arg = """ state = 'posted'""" |
|
|
|
states_arg = """ account_move.state = 'posted'""" |
|
|
|
|
|
|
|
self._cr.execute((''' select res_partner.name as partner, res_partner.commercial_partner_id as res, |
|
|
|
account_move.commercial_partner_id as parent, sum(account_move.amount_total) as amount |
|
|
@ -512,9 +512,9 @@ class DashBoard(models.Model): |
|
|
|
|
|
|
|
states_arg = "" |
|
|
|
if post[0] != 'posted': |
|
|
|
states_arg = """ state in ('posted', 'draft')""" |
|
|
|
states_arg = """ account_move.state in ('posted', 'draft')""" |
|
|
|
else: |
|
|
|
states_arg = """ state = 'posted'""" |
|
|
|
states_arg = """ account_move.state = 'posted'""" |
|
|
|
|
|
|
|
company_id = self.get_current_company_value() |
|
|
|
if post[1] == 'this_month': |
|
|
@ -572,9 +572,9 @@ class DashBoard(models.Model): |
|
|
|
|
|
|
|
states_arg = "" |
|
|
|
if post[0] != 'posted': |
|
|
|
states_arg = """ state in ('posted', 'draft')""" |
|
|
|
states_arg = """ account_move.state in ('posted', 'draft')""" |
|
|
|
else: |
|
|
|
states_arg = """ state = 'posted'""" |
|
|
|
states_arg = """ account_move.state = 'posted'""" |
|
|
|
|
|
|
|
if post[1] == 'this_month': |
|
|
|
self._cr.execute((''' |
|
|
@ -630,9 +630,9 @@ class DashBoard(models.Model): |
|
|
|
company_id = self.get_current_company_value() |
|
|
|
states_arg = "" |
|
|
|
if post[0] != 'posted': |
|
|
|
states_arg = """ state in ('posted', 'draft')""" |
|
|
|
states_arg = """ account_move.state in ('posted', 'draft')""" |
|
|
|
else: |
|
|
|
states_arg = """ state = 'posted'""" |
|
|
|
states_arg = """ account_move.state = 'posted'""" |
|
|
|
if post[1] == 'this_month': |
|
|
|
self._cr.execute((''' select res_partner.name as customers, account_move.commercial_partner_id as parent, |
|
|
|
sum(account_move.amount_total) as amount from account_move, res_partner |
|
|
@ -711,9 +711,9 @@ class DashBoard(models.Model): |
|
|
|
|
|
|
|
states_arg = "" |
|
|
|
if post != ('posted',): |
|
|
|
states_arg = """ state in ('posted', 'draft')""" |
|
|
|
states_arg = """ account_move.state in ('posted', 'draft')""" |
|
|
|
else: |
|
|
|
states_arg = """ state = 'posted'""" |
|
|
|
states_arg = """ account_move.state = 'posted'""" |
|
|
|
|
|
|
|
self._cr.execute(('''select sum(amount_total) as customer_invoice from account_move where move_type ='out_invoice' |
|
|
|
AND %s AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
@ -749,9 +749,9 @@ class DashBoard(models.Model): |
|
|
|
|
|
|
|
states_arg = "" |
|
|
|
if post != ('posted',): |
|
|
|
states_arg = """ state in ('posted', 'draft')""" |
|
|
|
states_arg = """ account_move.state in ('posted', 'draft')""" |
|
|
|
else: |
|
|
|
states_arg = """ state = 'posted'""" |
|
|
|
states_arg = """ account_move.state = 'posted'""" |
|
|
|
|
|
|
|
self._cr.execute(('''select sum(amount_total_signed) as customer_invoice from account_move where move_type ='out_invoice' |
|
|
|
AND %s |
|
|
@ -810,9 +810,9 @@ class DashBoard(models.Model): |
|
|
|
|
|
|
|
states_arg = "" |
|
|
|
if post != ('posted',): |
|
|
|
states_arg = """ state in ('posted', 'draft')""" |
|
|
|
states_arg = """ account_move.state in ('posted', 'draft')""" |
|
|
|
else: |
|
|
|
states_arg = """ state = 'posted'""" |
|
|
|
states_arg = """ account_move.state = 'posted'""" |
|
|
|
|
|
|
|
self._cr.execute(('''select sum(amount_total_signed) as customer_invoice from account_move where move_type ='out_invoice' |
|
|
|
AND %s |
|
|
@ -875,9 +875,9 @@ class DashBoard(models.Model): |
|
|
|
|
|
|
|
states_arg = "" |
|
|
|
if post != ('posted',): |
|
|
|
states_arg = """ state in ('posted', 'draft')""" |
|
|
|
states_arg = """ account_move.state in ('posted', 'draft')""" |
|
|
|
else: |
|
|
|
states_arg = """ state = 'posted'""" |
|
|
|
states_arg = """ account_move.state = 'posted'""" |
|
|
|
|
|
|
|
self._cr.execute(('''select sum(amount_total) from account_move where move_type = 'out_invoice' |
|
|
|
AND %s |
|
|
@ -1132,9 +1132,9 @@ class DashBoard(models.Model): |
|
|
|
company_id = self.get_current_company_value() |
|
|
|
states_arg = "" |
|
|
|
if post != ('posted',): |
|
|
|
states_arg = """ state in ('posted', 'draft')""" |
|
|
|
states_arg = """ account_move.state in ('posted', 'draft')""" |
|
|
|
else: |
|
|
|
states_arg = """ state = 'posted'""" |
|
|
|
states_arg = """ account_move.state = 'posted'""" |
|
|
|
self._cr.execute(('''select account_move.id from account_move where move_type ='in_invoice' |
|
|
|
AND %s |
|
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
@ -1148,9 +1148,9 @@ class DashBoard(models.Model): |
|
|
|
company_id = self.get_current_company_value() |
|
|
|
states_arg = "" |
|
|
|
if post != ('posted',): |
|
|
|
states_arg = """ state in ('posted', 'draft')""" |
|
|
|
states_arg = """ account_move.state in ('posted', 'draft')""" |
|
|
|
else: |
|
|
|
states_arg = """ state = 'posted'""" |
|
|
|
states_arg = """ account_move.state = 'posted'""" |
|
|
|
|
|
|
|
self._cr.execute(('''select account_move.id from account_move where move_type ='in_invoice' |
|
|
|
AND %s |
|
|
@ -1166,9 +1166,9 @@ class DashBoard(models.Model): |
|
|
|
company_id = self.get_current_company_value() |
|
|
|
states_arg = "" |
|
|
|
if post != ('posted',): |
|
|
|
states_arg = """ state in ('posted', 'draft')""" |
|
|
|
states_arg = """ account_move.state in ('posted', 'draft')""" |
|
|
|
else: |
|
|
|
states_arg = """ state = 'posted'""" |
|
|
|
states_arg = """ account_move.state = 'posted'""" |
|
|
|
self._cr.execute(('''select account_move.id from account_move where move_type ='out_invoice' |
|
|
|
AND %s |
|
|
|
AND payment_state = 'paid' |
|
|
@ -1183,9 +1183,9 @@ class DashBoard(models.Model): |
|
|
|
company_id = self.get_current_company_value() |
|
|
|
states_arg = "" |
|
|
|
if post != ('posted',): |
|
|
|
states_arg = """ state in ('posted', 'draft')""" |
|
|
|
states_arg = """ account_move.state in ('posted', 'draft')""" |
|
|
|
else: |
|
|
|
states_arg = """ state = 'posted'""" |
|
|
|
states_arg = """ account_move.state = 'posted'""" |
|
|
|
self._cr.execute(('''select account_move.id from account_move where move_type ='out_invoice' |
|
|
|
AND %s |
|
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
@ -1199,9 +1199,9 @@ class DashBoard(models.Model): |
|
|
|
company_id = self.get_current_company_value() |
|
|
|
states_arg = "" |
|
|
|
if post != ('posted',): |
|
|
|
states_arg = """ state in ('posted', 'draft')""" |
|
|
|
states_arg = """ account_move.state in ('posted', 'draft')""" |
|
|
|
else: |
|
|
|
states_arg = """ state = 'posted'""" |
|
|
|
states_arg = """ account_move.state = 'posted'""" |
|
|
|
self._cr.execute(('''select account_move.id from account_move where move_type ='in_invoice' |
|
|
|
AND %s |
|
|
|
AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) |
|
|
@ -1216,9 +1216,9 @@ class DashBoard(models.Model): |
|
|
|
company_id = self.get_current_company_value() |
|
|
|
states_arg = "" |
|
|
|
if post != ('posted',): |
|
|
|
states_arg = """ state in ('posted', 'draft')""" |
|
|
|
states_arg = """ account_move.state in ('posted', 'draft')""" |
|
|
|
else: |
|
|
|
states_arg = """ state = 'posted'""" |
|
|
|
states_arg = """ account_move.state = 'posted'""" |
|
|
|
self._cr.execute(('''select account_move.id from account_move where move_type ='in_invoice' |
|
|
|
AND %s |
|
|
|
AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) |
|
|
@ -1234,9 +1234,9 @@ class DashBoard(models.Model): |
|
|
|
company_id = self.get_current_company_value() |
|
|
|
states_arg = "" |
|
|
|
if post != ('posted',): |
|
|
|
states_arg = """ state in ('posted', 'draft')""" |
|
|
|
states_arg = """ account_move.state in ('posted', 'draft')""" |
|
|
|
else: |
|
|
|
states_arg = """ state = 'posted'""" |
|
|
|
states_arg = """ account_move.state = 'posted'""" |
|
|
|
self._cr.execute(('''select account_move.id from account_move where move_type ='out_invoice' |
|
|
|
AND %s |
|
|
|
AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) |
|
|
@ -1252,9 +1252,9 @@ class DashBoard(models.Model): |
|
|
|
company_id = self.get_current_company_value() |
|
|
|
states_arg = "" |
|
|
|
if post != ('posted',): |
|
|
|
states_arg = """ state in ('posted', 'draft')""" |
|
|
|
states_arg = """ account_move.state in ('posted', 'draft')""" |
|
|
|
else: |
|
|
|
states_arg = """ state = 'posted'""" |
|
|
|
states_arg = """ account_move.state = 'posted'""" |
|
|
|
self._cr.execute(('''select account_move.id from account_move where move_type ='out_invoice' |
|
|
|
AND %s |
|
|
|
AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) |
|
|
|