[IMP] account_financial_report:

* fix speed issue in VAT report
* rename Cost Center to Analytic Account in General Ledger
pull/939/head
Jordi Ballester Alomar 2020-06-12 16:17:08 +02:00 committed by David Ramia
parent 5e3e45bb56
commit f0abfb7cce
5 changed files with 13 additions and 8 deletions

View File

@ -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 += [

View File

@ -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-->

View File

@ -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(

View File

@ -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):

View File

@ -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">