|
@ -38,7 +38,7 @@ class DashBoard(models.Model): |
|
|
internal_group from account_move_line ,account_account where |
|
|
internal_group from account_move_line ,account_account where |
|
|
account_move_line.account_id=account_account.id AND internal_group = 'income' |
|
|
account_move_line.account_id=account_account.id AND internal_group = 'income' |
|
|
AND to_char(DATE(NOW()), 'YY') = to_char(account_move_line.date, 'YY') |
|
|
AND to_char(DATE(NOW()), 'YY') = to_char(account_move_line.date, 'YY') |
|
|
AND account_move_line.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move_line.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
AND %s |
|
|
AND %s |
|
|
group by internal_group,month |
|
|
group by internal_group,month |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
@ -48,7 +48,7 @@ class DashBoard(models.Model): |
|
|
internal_group from account_move_line ,account_account where |
|
|
internal_group from account_move_line ,account_account where |
|
|
account_move_line.account_id=account_account.id AND internal_group = 'expense' |
|
|
account_move_line.account_id=account_account.id AND internal_group = 'expense' |
|
|
AND to_char(DATE(NOW()), 'YY') = to_char(account_move_line.date, 'YY') |
|
|
AND to_char(DATE(NOW()), 'YY') = to_char(account_move_line.date, 'YY') |
|
|
AND account_move_line.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move_line.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
AND %s |
|
|
AND %s |
|
|
group by internal_group,month |
|
|
group by internal_group,month |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
@ -135,7 +135,7 @@ class DashBoard(models.Model): |
|
|
internal_group from account_move_line ,account_account |
|
|
internal_group from account_move_line ,account_account |
|
|
where account_move_line.account_id=account_account.id AND internal_group = 'income' |
|
|
where account_move_line.account_id=account_account.id AND internal_group = 'income' |
|
|
AND Extract(year FROM account_move_line.date) = Extract(year FROM DATE(NOW())) -1 |
|
|
AND Extract(year FROM account_move_line.date) = Extract(year FROM DATE(NOW())) -1 |
|
|
AND account_move_line.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move_line.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
AND %s |
|
|
AND %s |
|
|
group by internal_group,month |
|
|
group by internal_group,month |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
@ -145,7 +145,7 @@ class DashBoard(models.Model): |
|
|
internal_group from account_move_line , account_account where |
|
|
internal_group from account_move_line , account_account where |
|
|
account_move_line.account_id=account_account.id AND internal_group = 'expense' |
|
|
account_move_line.account_id=account_account.id AND internal_group = 'expense' |
|
|
AND Extract(year FROM account_move_line.date) = Extract(year FROM DATE(NOW())) -1 |
|
|
AND Extract(year FROM account_move_line.date) = Extract(year FROM DATE(NOW())) -1 |
|
|
AND account_move_line.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move_line.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
AND %s |
|
|
AND %s |
|
|
group by internal_group,month |
|
|
group by internal_group,month |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
@ -235,9 +235,9 @@ class DashBoard(models.Model): |
|
|
|
|
|
|
|
|
self._cr.execute(('''select sum(debit)-sum(credit) as income ,cast(to_char(account_move_line.date, 'DD')as int) |
|
|
self._cr.execute(('''select sum(debit)-sum(credit) as income ,cast(to_char(account_move_line.date, 'DD')as int) |
|
|
as date , internal_group from account_move_line , account_account where |
|
|
as date , internal_group from account_move_line , account_account where |
|
|
Extract(month FROM account_move_line.date) = ''' + str(one_month_ago) + ''' |
|
|
Extract(month FROM account_move_line.date) in ''' + str(tuple(company_id)) + ''' |
|
|
AND %s |
|
|
AND %s |
|
|
AND account_move_line.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move_line.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
AND account_move_line.account_id=account_account.id AND internal_group='income' |
|
|
AND account_move_line.account_id=account_account.id AND internal_group='income' |
|
|
group by internal_group,date |
|
|
group by internal_group,date |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
@ -246,9 +246,9 @@ class DashBoard(models.Model): |
|
|
|
|
|
|
|
|
self._cr.execute(('''select sum(debit)-sum(credit) as expense ,cast(to_char(account_move_line.date, 'DD')as int) |
|
|
self._cr.execute(('''select sum(debit)-sum(credit) as expense ,cast(to_char(account_move_line.date, 'DD')as int) |
|
|
as date ,internal_group from account_move_line ,account_account where |
|
|
as date ,internal_group from account_move_line ,account_account where |
|
|
Extract(month FROM account_move_line.date) = ''' + str(one_month_ago) + ''' |
|
|
Extract(month FROM account_move_line.date) in ''' + str(tuple(company_id)) + ''' |
|
|
AND %s |
|
|
AND %s |
|
|
AND account_move_line.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move_line.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
AND account_move_line.account_id=account_account.id AND internal_group='expense' |
|
|
AND account_move_line.account_id=account_account.id AND internal_group='expense' |
|
|
group by internal_group,date |
|
|
group by internal_group,date |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
@ -336,7 +336,7 @@ class DashBoard(models.Model): |
|
|
where Extract(month FROM account_move_line.date) = Extract(month FROM DATE(NOW())) |
|
|
where Extract(month FROM account_move_line.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move_line.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move_line.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND %s |
|
|
AND %s |
|
|
AND account_move_line.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move_line.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
AND account_move_line.account_id=account_account.id AND internal_group='income' |
|
|
AND account_move_line.account_id=account_account.id AND internal_group='income' |
|
|
group by internal_group,date |
|
|
group by internal_group,date |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
@ -348,7 +348,7 @@ class DashBoard(models.Model): |
|
|
Extract(month FROM account_move_line.date) = Extract(month FROM DATE(NOW())) |
|
|
Extract(month FROM account_move_line.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move_line.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move_line.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND %s |
|
|
AND %s |
|
|
AND account_move_line.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move_line.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
AND account_move_line.account_id=account_account.id AND internal_group='expense' |
|
|
AND account_move_line.account_id=account_account.id AND internal_group='expense' |
|
|
group by internal_group,date |
|
|
group by internal_group,date |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
@ -430,7 +430,7 @@ class DashBoard(models.Model): |
|
|
from account_move,res_partner where |
|
|
from account_move,res_partner where |
|
|
account_move.partner_id=res_partner.id AND account_move.type = 'in_invoice' AND |
|
|
account_move.partner_id=res_partner.id AND account_move.type = 'in_invoice' AND |
|
|
invoice_payment_state = 'not_paid' AND |
|
|
invoice_payment_state = 'not_paid' AND |
|
|
account_move.company_id = ''' + str(company_id) + ''' AND |
|
|
account_move.company_id in ''' + str(tuple(company_id)) + ''' AND |
|
|
%s |
|
|
%s |
|
|
AND account_move.commercial_partner_id=res_partner.commercial_partner_id |
|
|
AND account_move.commercial_partner_id=res_partner.commercial_partner_id |
|
|
group by parent,partner,res |
|
|
group by parent,partner,res |
|
@ -480,7 +480,7 @@ class DashBoard(models.Model): |
|
|
account_move.partner_id=res_partner.id AND account_move.type = 'out_invoice' AND |
|
|
account_move.partner_id=res_partner.id AND account_move.type = 'out_invoice' AND |
|
|
invoice_payment_state = 'not_paid' AND |
|
|
invoice_payment_state = 'not_paid' AND |
|
|
%s |
|
|
%s |
|
|
AND account_move.company_id = ''' + str(company_id) + ''' AND |
|
|
AND account_move.company_id in ''' + str(tuple(company_id)) + ''' AND |
|
|
account_move_line.account_internal_type = 'payable' AND |
|
|
account_move_line.account_internal_type = 'payable' AND |
|
|
account_move.commercial_partner_id=res_partner.commercial_partner_id |
|
|
account_move.commercial_partner_id=res_partner.commercial_partner_id |
|
|
group by parent,partner,res |
|
|
group by parent,partner,res |
|
@ -528,7 +528,7 @@ class DashBoard(models.Model): |
|
|
AND Extract(month FROM account_move.invoice_date_due) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(month FROM account_move.invoice_date_due) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.invoice_date_due) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.invoice_date_due) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND account_move.partner_id = res_partner.commercial_partner_id |
|
|
AND account_move.partner_id = res_partner.commercial_partner_id |
|
|
AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
group by parent, due_partner, month |
|
|
group by parent, due_partner, month |
|
|
order by amount desc ''') % (states_arg)) |
|
|
order by amount desc ''') % (states_arg)) |
|
|
else: |
|
|
else: |
|
@ -539,7 +539,7 @@ class DashBoard(models.Model): |
|
|
AND %s |
|
|
AND %s |
|
|
AND Extract(YEAR FROM account_move.invoice_date_due) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.invoice_date_due) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND account_move.partner_id = res_partner.commercial_partner_id |
|
|
AND account_move.partner_id = res_partner.commercial_partner_id |
|
|
AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
|
|
|
|
|
|
group by parent, due_partner |
|
|
group by parent, due_partner |
|
|
order by amount desc ''') % (states_arg)) |
|
|
order by amount desc ''') % (states_arg)) |
|
@ -586,7 +586,7 @@ class DashBoard(models.Model): |
|
|
AND %s |
|
|
AND %s |
|
|
AND Extract(month FROM account_move.invoice_date_due) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(month FROM account_move.invoice_date_due) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.invoice_date_due) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.invoice_date_due) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
AND account_move.partner_id = res_partner.commercial_partner_id |
|
|
AND account_move.partner_id = res_partner.commercial_partner_id |
|
|
group by parent, bill_partner, month |
|
|
group by parent, bill_partner, month |
|
|
order by amount desc ''') % (states_arg)) |
|
|
order by amount desc ''') % (states_arg)) |
|
@ -598,7 +598,7 @@ class DashBoard(models.Model): |
|
|
AND %s |
|
|
AND %s |
|
|
AND Extract(YEAR FROM account_move.invoice_date_due) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.invoice_date_due) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND account_move.partner_id = res_partner.commercial_partner_id |
|
|
AND account_move.partner_id = res_partner.commercial_partner_id |
|
|
AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
group by parent, bill_partner |
|
|
group by parent, bill_partner |
|
|
order by amount desc ''') % (states_arg)) |
|
|
order by amount desc ''') % (states_arg)) |
|
|
|
|
|
|
|
@ -639,7 +639,7 @@ class DashBoard(models.Model): |
|
|
self._cr.execute((''' select res_partner.name as customers, account_move.commercial_partner_id as parent, |
|
|
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 |
|
|
sum(account_move.amount_total) as amount from account_move, res_partner |
|
|
where account_move.commercial_partner_id = res_partner.id |
|
|
where account_move.commercial_partner_id = res_partner.id |
|
|
AND account_move.company_id = %s |
|
|
AND account_move.company_id in %s |
|
|
AND account_move.type = 'out_invoice' |
|
|
AND account_move.type = 'out_invoice' |
|
|
AND %s |
|
|
AND %s |
|
|
AND Extract(month FROM account_move.invoice_date_due) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(month FROM account_move.invoice_date_due) = Extract(month FROM DATE(NOW())) |
|
@ -647,14 +647,14 @@ class DashBoard(models.Model): |
|
|
group by parent, customers |
|
|
group by parent, customers |
|
|
order by amount desc |
|
|
order by amount desc |
|
|
limit 10 |
|
|
limit 10 |
|
|
''') % (company_id, states_arg)) |
|
|
''') % (tuple(company_id), states_arg)) |
|
|
|
|
|
|
|
|
record_invoice = self._cr.dictfetchall() |
|
|
record_invoice = self._cr.dictfetchall() |
|
|
|
|
|
|
|
|
self._cr.execute((''' select res_partner.name as customers, account_move.commercial_partner_id as parent, |
|
|
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 |
|
|
sum(account_move.amount_total) as amount from account_move, res_partner |
|
|
where account_move.commercial_partner_id = res_partner.id |
|
|
where account_move.commercial_partner_id = res_partner.id |
|
|
AND account_move.company_id = %s |
|
|
AND account_move.company_id in %s |
|
|
AND account_move.type = 'out_refund' |
|
|
AND account_move.type = 'out_refund' |
|
|
AND %s |
|
|
AND %s |
|
|
AND Extract(month FROM account_move.invoice_date_due) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(month FROM account_move.invoice_date_due) = Extract(month FROM DATE(NOW())) |
|
@ -662,7 +662,7 @@ class DashBoard(models.Model): |
|
|
group by parent, customers |
|
|
group by parent, customers |
|
|
order by amount desc |
|
|
order by amount desc |
|
|
limit 10 |
|
|
limit 10 |
|
|
''') % (company_id, states_arg)) |
|
|
''') % (tuple(company_id), states_arg)) |
|
|
|
|
|
|
|
|
record_refund = self._cr.dictfetchall() |
|
|
record_refund = self._cr.dictfetchall() |
|
|
else: |
|
|
else: |
|
@ -670,7 +670,7 @@ class DashBoard(models.Model): |
|
|
self._cr.execute((''' select res_partner.name as customers, account_move.commercial_partner_id as parent, |
|
|
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 |
|
|
sum(account_move.amount_total) as amount from account_move, res_partner |
|
|
where account_move.commercial_partner_id = res_partner.id |
|
|
where account_move.commercial_partner_id = res_partner.id |
|
|
AND account_move.company_id = %s |
|
|
AND account_move.company_id in %s |
|
|
AND account_move.type = 'out_invoice' |
|
|
AND account_move.type = 'out_invoice' |
|
|
AND %s |
|
|
AND %s |
|
|
AND Extract(month FROM account_move.invoice_date_due) = ''' + str( |
|
|
AND Extract(month FROM account_move.invoice_date_due) = ''' + str( |
|
@ -678,14 +678,14 @@ class DashBoard(models.Model): |
|
|
group by parent, customers |
|
|
group by parent, customers |
|
|
order by amount desc |
|
|
order by amount desc |
|
|
limit 10 |
|
|
limit 10 |
|
|
''') % (company_id, states_arg)) |
|
|
''') % (tuple(company_id), states_arg)) |
|
|
|
|
|
|
|
|
record_invoice = self._cr.dictfetchall() |
|
|
record_invoice = self._cr.dictfetchall() |
|
|
|
|
|
|
|
|
self._cr.execute((''' select res_partner.name as customers, account_move.commercial_partner_id as parent, |
|
|
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 |
|
|
sum(account_move.amount_total) as amount from account_move, res_partner |
|
|
where account_move.commercial_partner_id = res_partner.id |
|
|
where account_move.commercial_partner_id = res_partner.id |
|
|
AND account_move.company_id = %s |
|
|
AND account_move.company_id in %s |
|
|
AND account_move.type = 'out_refund' |
|
|
AND account_move.type = 'out_refund' |
|
|
AND %s |
|
|
AND %s |
|
|
AND Extract(month FROM account_move.invoice_date_due) = ''' + str( |
|
|
AND Extract(month FROM account_move.invoice_date_due) = ''' + str( |
|
@ -693,7 +693,7 @@ class DashBoard(models.Model): |
|
|
group by parent, customers |
|
|
group by parent, customers |
|
|
order by amount desc |
|
|
order by amount desc |
|
|
limit 10 |
|
|
limit 10 |
|
|
''') % (company_id, states_arg)) |
|
|
''') % (tuple(company_id), states_arg)) |
|
|
|
|
|
|
|
|
record_refund = self._cr.dictfetchall() |
|
|
record_refund = self._cr.dictfetchall() |
|
|
|
|
|
|
|
@ -726,22 +726,22 @@ class DashBoard(models.Model): |
|
|
states_arg = """ state = 'posted'""" |
|
|
states_arg = """ state = 'posted'""" |
|
|
|
|
|
|
|
|
self._cr.execute(('''select sum(amount_total) as customer_invoice from account_move where type ='out_invoice' |
|
|
self._cr.execute(('''select sum(amount_total) as customer_invoice from account_move where type ='out_invoice' |
|
|
AND %s AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND %s AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
record_customer = self._cr.dictfetchall() |
|
|
record_customer = self._cr.dictfetchall() |
|
|
|
|
|
|
|
|
self._cr.execute(('''select sum(amount_total) as supplier_invoice from account_move where type ='in_invoice' |
|
|
self._cr.execute(('''select sum(amount_total) as supplier_invoice from account_move where type ='in_invoice' |
|
|
AND %s AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND %s AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
record_supplier = self._cr.dictfetchall() |
|
|
record_supplier = self._cr.dictfetchall() |
|
|
|
|
|
|
|
|
self._cr.execute(('''select sum(amount_total) as credit_note from account_move where type ='out_refund' |
|
|
self._cr.execute(('''select sum(amount_total) as credit_note from account_move where type ='out_refund' |
|
|
AND %s AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND %s AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
result_credit_note = self._cr.dictfetchall() |
|
|
result_credit_note = self._cr.dictfetchall() |
|
|
|
|
|
|
|
|
self._cr.execute(('''select sum(amount_total) as refund from account_move where type ='in_refund' |
|
|
self._cr.execute(('''select sum(amount_total) as refund from account_move where type ='in_refund' |
|
|
AND %s AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND %s AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
result_refund = self._cr.dictfetchall() |
|
|
result_refund = self._cr.dictfetchall() |
|
|
|
|
|
|
|
@ -766,28 +766,28 @@ class DashBoard(models.Model): |
|
|
self._cr.execute(('''select sum(amount_total_signed) as customer_invoice from account_move where type ='out_invoice' |
|
|
self._cr.execute(('''select sum(amount_total_signed) as customer_invoice from account_move where type ='out_invoice' |
|
|
AND %s |
|
|
AND %s |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
record_customer_current_year = self._cr.dictfetchall() |
|
|
record_customer_current_year = self._cr.dictfetchall() |
|
|
|
|
|
|
|
|
self._cr.execute(('''select sum(-(amount_total_signed)) as supplier_invoice from account_move where type ='in_invoice' |
|
|
self._cr.execute(('''select sum(-(amount_total_signed)) as supplier_invoice from account_move where type ='in_invoice' |
|
|
AND %s |
|
|
AND %s |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
record_supplier_current_year = self._cr.dictfetchall() |
|
|
record_supplier_current_year = self._cr.dictfetchall() |
|
|
|
|
|
|
|
|
self._cr.execute(('''select sum(-(amount_total_signed)) - sum(-(amount_residual_signed)) as credit_note from account_move where type ='out_refund' |
|
|
self._cr.execute(('''select sum(-(amount_total_signed)) - sum(-(amount_residual_signed)) as credit_note from account_move where type ='out_refund' |
|
|
AND %s |
|
|
AND %s |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
result_credit_note_current_year = self._cr.dictfetchall() |
|
|
result_credit_note_current_year = self._cr.dictfetchall() |
|
|
|
|
|
|
|
|
self._cr.execute(('''select sum(-(amount_total_signed)) as refund from account_move where type ='in_refund' |
|
|
self._cr.execute(('''select sum(-(amount_total_signed)) as refund from account_move where type ='in_refund' |
|
|
AND %s |
|
|
AND %s |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
result_refund_current_year = self._cr.dictfetchall() |
|
|
result_refund_current_year = self._cr.dictfetchall() |
|
|
|
|
|
|
|
@ -795,7 +795,7 @@ class DashBoard(models.Model): |
|
|
AND %s |
|
|
AND %s |
|
|
AND invoice_payment_state = 'paid' |
|
|
AND invoice_payment_state = 'paid' |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
record_paid_customer_invoice_current_year = self._cr.dictfetchall() |
|
|
record_paid_customer_invoice_current_year = self._cr.dictfetchall() |
|
|
|
|
|
|
|
@ -803,7 +803,7 @@ class DashBoard(models.Model): |
|
|
AND %s |
|
|
AND %s |
|
|
AND invoice_payment_state = 'paid' |
|
|
AND invoice_payment_state = 'paid' |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
result_paid_supplier_invoice_current_year = self._cr.dictfetchall() |
|
|
result_paid_supplier_invoice_current_year = self._cr.dictfetchall() |
|
|
|
|
|
|
|
@ -811,7 +811,7 @@ class DashBoard(models.Model): |
|
|
AND %s |
|
|
AND %s |
|
|
AND invoice_payment_state = 'paid' |
|
|
AND invoice_payment_state = 'paid' |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
record_paid_customer_credit_current_year = self._cr.dictfetchall() |
|
|
record_paid_customer_credit_current_year = self._cr.dictfetchall() |
|
|
|
|
|
|
|
@ -819,7 +819,7 @@ class DashBoard(models.Model): |
|
|
AND %s |
|
|
AND %s |
|
|
AND invoice_payment_state = 'paid' |
|
|
AND invoice_payment_state = 'paid' |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
result_paid_supplier_refund_current_year = self._cr.dictfetchall() |
|
|
result_paid_supplier_refund_current_year = self._cr.dictfetchall() |
|
|
|
|
|
|
|
@ -856,7 +856,7 @@ class DashBoard(models.Model): |
|
|
AND %s |
|
|
AND %s |
|
|
AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
record_customer_current_month = self._cr.dictfetchall() |
|
|
record_customer_current_month = self._cr.dictfetchall() |
|
|
|
|
|
|
|
@ -864,7 +864,7 @@ class DashBoard(models.Model): |
|
|
AND %s |
|
|
AND %s |
|
|
AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
record_supplier_current_month = self._cr.dictfetchall() |
|
|
record_supplier_current_month = self._cr.dictfetchall() |
|
|
|
|
|
|
|
@ -872,7 +872,7 @@ class DashBoard(models.Model): |
|
|
AND %s |
|
|
AND %s |
|
|
AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
result_credit_note_current_month = self._cr.dictfetchall() |
|
|
result_credit_note_current_month = self._cr.dictfetchall() |
|
|
|
|
|
|
|
@ -880,7 +880,7 @@ class DashBoard(models.Model): |
|
|
AND %s |
|
|
AND %s |
|
|
AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
result_refund_current_month = self._cr.dictfetchall() |
|
|
result_refund_current_month = self._cr.dictfetchall() |
|
|
|
|
|
|
|
@ -888,7 +888,7 @@ class DashBoard(models.Model): |
|
|
AND %s |
|
|
AND %s |
|
|
AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
record_paid_customer_invoice_current_month = self._cr.dictfetchall() |
|
|
record_paid_customer_invoice_current_month = self._cr.dictfetchall() |
|
|
|
|
|
|
|
@ -896,7 +896,7 @@ class DashBoard(models.Model): |
|
|
AND %s |
|
|
AND %s |
|
|
AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
result_paid_supplier_invoice_current_month = self._cr.dictfetchall() |
|
|
result_paid_supplier_invoice_current_month = self._cr.dictfetchall() |
|
|
|
|
|
|
|
@ -905,7 +905,7 @@ class DashBoard(models.Model): |
|
|
AND invoice_payment_state = 'paid' |
|
|
AND invoice_payment_state = 'paid' |
|
|
AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
record_paid_customer_credit_current_month = self._cr.dictfetchall() |
|
|
record_paid_customer_credit_current_month = self._cr.dictfetchall() |
|
|
|
|
|
|
|
@ -914,7 +914,7 @@ class DashBoard(models.Model): |
|
|
AND invoice_payment_state = 'paid' |
|
|
AND invoice_payment_state = 'paid' |
|
|
AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
result_paid_supplier_refund_current_month = self._cr.dictfetchall() |
|
|
result_paid_supplier_refund_current_month = self._cr.dictfetchall() |
|
|
|
|
|
|
|
@ -950,7 +950,7 @@ class DashBoard(models.Model): |
|
|
AND %s |
|
|
AND %s |
|
|
AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND account_move.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
record = self._cr.dictfetchall() |
|
|
record = self._cr.dictfetchall() |
|
|
return record |
|
|
return record |
|
@ -991,7 +991,7 @@ class DashBoard(models.Model): |
|
|
self._cr.execute(''' select sum(amount_total) from account_move where type = 'out_invoice' |
|
|
self._cr.execute(''' select sum(amount_total) from account_move where type = 'out_invoice' |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) AND |
|
|
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) AND |
|
|
account_move.state = 'posted' AND |
|
|
account_move.state = 'posted' AND |
|
|
account_move.company_id = ''' + str(company_id) + ''' |
|
|
account_move.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') |
|
|
''') |
|
|
record = self._cr.dictfetchall() |
|
|
record = self._cr.dictfetchall() |
|
|
return record |
|
|
return record |
|
@ -1026,7 +1026,7 @@ class DashBoard(models.Model): |
|
|
L.account_id=a.id AND l.full_reconcile_id IS NULL AND |
|
|
L.account_id=a.id AND l.full_reconcile_id IS NULL AND |
|
|
l.balance != 0 AND a.reconcile IS F |
|
|
l.balance != 0 AND a.reconcile IS F |
|
|
AND l.''' + states_arg + ''' |
|
|
AND l.''' + states_arg + ''' |
|
|
AND l.company_id = ''' + str(company_id) + ''' |
|
|
AND l.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''' |
|
|
''' |
|
|
|
|
|
|
|
|
self._cr.execute((''' select count(*) FROM account_move_line l,account_account a |
|
|
self._cr.execute((''' select count(*) FROM account_move_line l,account_account a |
|
@ -1035,7 +1035,7 @@ class DashBoard(models.Model): |
|
|
L.account_id=a.id AND l.full_reconcile_id IS NULL AND |
|
|
L.account_id=a.id AND l.full_reconcile_id IS NULL AND |
|
|
l.balance != 0 AND a.reconcile IS TRUE |
|
|
l.balance != 0 AND a.reconcile IS TRUE |
|
|
AND l.%s |
|
|
AND l.%s |
|
|
AND l.company_id = ''' + str(company_id) + ''' |
|
|
AND l.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
record = self._cr.dictfetchall() |
|
|
record = self._cr.dictfetchall() |
|
|
return record |
|
|
return record |
|
@ -1072,7 +1072,7 @@ class DashBoard(models.Model): |
|
|
L.account_id=a.id AND l.full_reconcile_id IS NULL AND |
|
|
L.account_id=a.id AND l.full_reconcile_id IS NULL AND |
|
|
l.balance != 0 AND a.reconcile IS TRUE |
|
|
l.balance != 0 AND a.reconcile IS TRUE |
|
|
AND l.%s |
|
|
AND l.%s |
|
|
AND l.company_id = ''' + str(company_id) + ''' |
|
|
AND l.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
record = self._cr.dictfetchall() |
|
|
record = self._cr.dictfetchall() |
|
|
return record |
|
|
return record |
|
@ -1121,7 +1121,7 @@ class DashBoard(models.Model): |
|
|
AND %s |
|
|
AND %s |
|
|
AND Extract(month FROM account_move_line.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(month FROM account_move_line.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(year FROM account_move_line.date) = Extract(year FROM DATE(NOW())) |
|
|
AND Extract(year FROM account_move_line.date) = Extract(year FROM DATE(NOW())) |
|
|
AND account_move_line.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move_line.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
|
|
|
|
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
record = self._cr.dictfetchall() |
|
|
record = self._cr.dictfetchall() |
|
@ -1146,7 +1146,7 @@ class DashBoard(models.Model): |
|
|
account_account.internal_group = 'expense' ) |
|
|
account_account.internal_group = 'expense' ) |
|
|
AND Extract(month FROM account_move_line.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(month FROM account_move_line.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(year FROM account_move_line.date) = Extract(year FROM DATE(NOW())) |
|
|
AND Extract(year FROM account_move_line.date) = Extract(year FROM DATE(NOW())) |
|
|
AND account_move_line.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move_line.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
group by internal_group |
|
|
group by internal_group |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
income = self._cr.dictfetchall() |
|
|
income = self._cr.dictfetchall() |
|
@ -1165,14 +1165,19 @@ class DashBoard(models.Model): |
|
|
return profit |
|
|
return profit |
|
|
|
|
|
|
|
|
def get_current_company_value(self): |
|
|
def get_current_company_value(self): |
|
|
current_company = request.httprequest.cookies.get('cids') |
|
|
|
|
|
if current_company: |
|
|
cookies_cids = [int(r) for r in request.httprequest.cookies.get('cids').split(",")] \ |
|
|
company_id = int(current_company[0]) |
|
|
if request.httprequest.cookies.get('cids') \ |
|
|
else: |
|
|
else [request.env.user.company_id.id] |
|
|
company_id = self.env.company.id |
|
|
|
|
|
if company_id not in self.env.user.company_ids.ids: |
|
|
for company_id in cookies_cids: |
|
|
company_id = self.env.company.id |
|
|
if company_id not in self.env.user.company_ids.ids: |
|
|
return company_id |
|
|
cookies_cids.remove(company_id) |
|
|
|
|
|
if not cookies_cids: |
|
|
|
|
|
cookies_cids = [self.env.company.id] |
|
|
|
|
|
if len(cookies_cids) == 1: |
|
|
|
|
|
cookies_cids.append(0) |
|
|
|
|
|
return cookies_cids |
|
|
|
|
|
|
|
|
@api.model |
|
|
@api.model |
|
|
def profit_income_this_year(self, *post): |
|
|
def profit_income_this_year(self, *post): |
|
@ -1190,7 +1195,7 @@ class DashBoard(models.Model): |
|
|
(account_account.internal_group = 'income' or |
|
|
(account_account.internal_group = 'income' or |
|
|
account_account.internal_group = 'expense' ) |
|
|
account_account.internal_group = 'expense' ) |
|
|
AND Extract(year FROM account_move_line.date) = Extract(year FROM DATE(NOW())) |
|
|
AND Extract(year FROM account_move_line.date) = Extract(year FROM DATE(NOW())) |
|
|
AND account_move_line.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move_line.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
group by internal_group |
|
|
group by internal_group |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
income = self._cr.dictfetchall() |
|
|
income = self._cr.dictfetchall() |
|
@ -1246,7 +1251,7 @@ class DashBoard(models.Model): |
|
|
account_move_line.account_id = account_account.id AND account_account.internal_group = 'income' |
|
|
account_move_line.account_id = account_account.id AND account_account.internal_group = 'income' |
|
|
AND %s |
|
|
AND %s |
|
|
AND Extract(YEAR FROM account_move_line.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move_line.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND account_move_line.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move_line.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|
record = self._cr.dictfetchall() |
|
|
record = self._cr.dictfetchall() |
|
|
return record |
|
|
return record |
|
@ -1268,7 +1273,11 @@ class DashBoard(models.Model): |
|
|
|
|
|
|
|
|
@api.model |
|
|
@api.model |
|
|
def get_currency(self): |
|
|
def get_currency(self): |
|
|
current_company = self.env['res.company'].browse(self.get_current_company_value()) |
|
|
company_ids = self.get_current_company_value() |
|
|
|
|
|
if 0 in company_ids: |
|
|
|
|
|
company_ids.remove(0) |
|
|
|
|
|
current_company_id = company_ids[0] |
|
|
|
|
|
current_company = self.env['res.company'].browse(current_company_id) |
|
|
default = current_company.currency_id or self.env.ref('base.main_company').currency_id |
|
|
default = current_company.currency_id or self.env.ref('base.main_company').currency_id |
|
|
lang = self.env.user.lang |
|
|
lang = self.env.user.lang |
|
|
if not lang: |
|
|
if not lang: |
|
@ -1309,7 +1318,7 @@ class DashBoard(models.Model): |
|
|
%s |
|
|
%s |
|
|
AND Extract(month FROM account_move_line.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(month FROM account_move_line.date) = Extract(month FROM DATE(NOW())) |
|
|
AND Extract(year FROM account_move_line.date) = Extract(year FROM DATE(NOW())) |
|
|
AND Extract(year FROM account_move_line.date) = Extract(year FROM DATE(NOW())) |
|
|
AND account_move_line.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move_line.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
@ -1334,7 +1343,7 @@ class DashBoard(models.Model): |
|
|
account_move_line.account_id = account_account.id AND account_account.internal_group = 'expense' AND |
|
|
account_move_line.account_id = account_account.id AND account_account.internal_group = 'expense' AND |
|
|
%s |
|
|
%s |
|
|
AND Extract(YEAR FROM account_move_line.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND Extract(YEAR FROM account_move_line.date) = Extract(YEAR FROM DATE(NOW())) |
|
|
AND account_move_line.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move_line.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1358,7 +1367,7 @@ class DashBoard(models.Model): |
|
|
account_account_type on account_account_type.id = account_account.user_type_id |
|
|
account_account_type on account_account_type.id = account_account.user_type_id |
|
|
where account_account_type.name = 'Bank and Cash' |
|
|
where account_account_type.name = 'Bank and Cash' |
|
|
AND %s |
|
|
AND %s |
|
|
AND account_move_line.company_id = ''' + str(company_id) + ''' |
|
|
AND account_move_line.company_id in ''' + str(tuple(company_id)) + ''' |
|
|
group by account_account.name |
|
|
group by account_account.name |
|
|
|
|
|
|
|
|
''') % (states_arg)) |
|
|
''') % (states_arg)) |
|
|