Browse Source

[IMP] account_financial_report:

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

6
account_financial_report/report/general_ledger_xlsx.py

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

6
account_financial_report/report/templates/general_ledger.xml

@ -160,8 +160,10 @@
Label</div>
<t t-if="show_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-if="show_analytic_tags">
<!--## analytic tags-->

2
account_financial_report/report/vat_report.py

@ -48,7 +48,6 @@ class VATReport(models.AbstractModel):
("company_id", "=", company_id),
("date", ">=", date_from),
("date", "<=", date_to),
("tax_ids", "!=", False),
("tax_exigible", "=", True),
]
if only_posted_moves:
@ -77,6 +76,7 @@ class VATReport(models.AbstractModel):
taxed_move_lines = self.env["account.move.line"].search_read(
domain=net_domain, fields=ml_fields,
)
taxed_move_lines = list(filter(lambda d: d["tax_ids"], taxed_move_lines))
vat_data = []
for tax_move_line in tax_move_lines:
vat_data.append(

3
account_financial_report/wizard/general_ledger_wizard.py

@ -86,8 +86,7 @@ class GeneralLedgerReportWizard(models.TransientModel):
help="Ending account in a range",
)
show_partner_details = fields.Boolean(string="Show Partner Details", default=True,)
show_cost_center = fields.Boolean(string="Show Cost Center", default=True,)
show_cost_center = fields.Boolean(string="Show Analytic Account", default=True,)
@api.onchange("account_code_from", "account_code_to")
def on_change_account_range(self):

4
account_financial_report/wizard/general_ledger_wizard_view.xml

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

Loading…
Cancel
Save