Browse Source

[IMP] account_financial_report:

* fix speed issue in VAT report
* rename Cost Center to Analytic Account in General Ledger
pull/660/head
Jordi Ballester Alomar 5 years ago
committed by Joan Sisquella
parent
commit
e1b62581d2
  1. 4
      account_financial_report/report/general_ledger_xlsx.py
  2. 4
      account_financial_report/report/templates/general_ledger.xml
  3. 3
      account_financial_report/report/vat_report.py
  4. 2
      account_financial_report/wizard/general_ledger_wizard.py
  5. 7
      account_financial_report/wizard/general_ledger_wizard_view.xml

4
account_financial_report/report/general_ledger_xlsx.py

@ -35,9 +35,9 @@ class GeneralLedgerXslx(models.AbstractModel):
] ]
if report.show_cost_center: if report.show_cost_center:
res += [ res += [
{'header': _('Cost center'),
{'header': _('Analytic Account'),
'field': 'analytic_account', 'field': 'analytic_account',
'width': 15},
'width': 20},
] ]
if report.show_analytic_tags: if report.show_analytic_tags:
res += [ res += [

4
account_financial_report/report/templates/general_ledger.xml

@ -141,8 +141,8 @@
Label</div> Label</div>
<t t-if="show_cost_center"> <t t-if="show_cost_center">
<!--## cost_center--> <!--## cost_center-->
<div class="act_as_cell" style="width: 8.03%;">Cost
center</div>
<div class="act_as_cell"
style="width: 8.03%;">Analytic Account</div>
</t> </t>
<t t-if="show_analytic_tags"> <t t-if="show_analytic_tags">
<!--## analytic tags--> <!--## analytic tags-->

3
account_financial_report/report/vat_report.py

@ -44,7 +44,6 @@ class VATReport(models.AbstractModel):
domain = [('company_id', '=', company_id), domain = [('company_id', '=', company_id),
('date', '>=', date_from), ('date', '>=', date_from),
('date', '<=', date_to), ('date', '<=', date_to),
('tax_ids', '!=', False),
('tax_exigible', '=', True)] ('tax_exigible', '=', True)]
if only_posted_moves: if only_posted_moves:
domain += [('move_id.state', '=', 'posted')] domain += [('move_id.state', '=', 'posted')]
@ -68,6 +67,8 @@ class VATReport(models.AbstractModel):
domain=net_domain, domain=net_domain,
fields=ml_fields, fields=ml_fields,
) )
taxed_move_lines = list(
filter(lambda d: d['tax_ids'], taxed_move_lines))
vat_data = [] vat_data = []
for tax_move_line in tax_move_lines: for tax_move_line in tax_move_lines:
vat_data.append({ vat_data.append({

2
account_financial_report/wizard/general_ledger_wizard.py

@ -100,7 +100,7 @@ class GeneralLedgerReportWizard(models.TransientModel):
default=True, default=True,
) )
show_cost_center = fields.Boolean( show_cost_center = fields.Boolean(
string='Show Cost Center',
string='Show Analytic Account',
default=True, default=True,
) )

7
account_financial_report/wizard/general_ledger_wizard_view.xml

@ -61,10 +61,11 @@
widget="many2many_tags" widget="many2many_tags"
options="{'no_create': True}"/> options="{'no_create': True}"/>
</page> </page>
<page string="Filter cost centers" groups="analytic.group_analytic_accounting">
<page string="Filter analytic accounts" groups="analytic.group_analytic_accounting">
<field name="cost_center_ids" nolabel="1" <field name="cost_center_ids" nolabel="1"
options="{'no_create': True}"
groups="analytic.group_analytic_accounting"/>
widget="many2many_tags"
options="{'no_create': True}"/>
</page> </page>
<page string="Filter analytic tags"> <page string="Filter analytic tags">
<field name="analytic_tag_ids" widget="many2many_tags" nolabel="1" options="{'no_create': True}"/> <field name="analytic_tag_ids" widget="many2many_tags" nolabel="1" options="{'no_create': True}"/>

Loading…
Cancel
Save