Browse Source

[IMP] account_financial_report:

* fix speed issue in VAT report
* rename Cost Center to Analytic Account in General Ledger
pull/749/head
Jordi Ballester Alomar 5 years ago
committed by João Marques
parent
commit
4868d86948
  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: if report.show_cost_center:
res += [ res += [
{"header": _("Cost center"), "field": "analytic_account", "width": 15},
{
"header": _("Analytic Account"),
"field": "analytic_account",
"width": 20,
},
] ]
if report.show_analytic_tags: if report.show_analytic_tags:
res += [ res += [

6
account_financial_report/report/templates/general_ledger.xml

@ -160,8 +160,10 @@
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-->

2
account_financial_report/report/vat_report.py

@ -48,7 +48,6 @@ class VATReport(models.AbstractModel):
("company_id", "=", company_id), ("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:
@ -77,6 +76,7 @@ class VATReport(models.AbstractModel):
taxed_move_lines = self.env["account.move.line"].search_read( taxed_move_lines = self.env["account.move.line"].search_read(
domain=net_domain, fields=ml_fields, domain=net_domain, 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(

3
account_financial_report/wizard/general_ledger_wizard.py

@ -86,8 +86,7 @@ class GeneralLedgerReportWizard(models.TransientModel):
help="Ending account in a range", help="Ending account in a range",
) )
show_partner_details = fields.Boolean(string="Show Partner Details", default=True,) 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") @api.onchange("account_code_from", "account_code_to")
def on_change_account_range(self): def on_change_account_range(self):

4
account_financial_report/wizard/general_ledger_wizard_view.xml

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

Loading…
Cancel
Save