Browse Source

[FIX] account_financial_report: allow navigation on all fields

Pass res_id correctly to lines to allow navigation on the fields

In the open items ledger, the res_id attribute of the invoice
in the report was getting: (id, move_name)
The result was that, when clicking the line, it would redirect
to a new record, instead of the existing.
This passes only the id to the line, solving that issue.

Fix menu item name

TT29371
pull/777/head
João Marques 3 years ago
parent
commit
7d9d1cb006
  1. 1
      account_financial_report/report/open_items.py
  2. 28
      account_financial_report/report/templates/open_items.xml
  3. 2
      account_financial_report/wizard/open_items_wizard_view.xml

1
account_financial_report/report/open_items.py

@ -278,6 +278,7 @@ class OpenItemsReport(models.AbstractModel):
"ref_label": ref_label, "ref_label": ref_label,
"journal_id": move_line["journal_id"][0], "journal_id": move_line["journal_id"][0],
"move_name": move_line["move_id"][1], "move_name": move_line["move_id"][1],
"entry_id": move_line["move_id"][0],
"currency_id": move_line["currency_id"][0] "currency_id": move_line["currency_id"][0]
if move_line["currency_id"] if move_line["currency_id"]
else False, else False,

28
account_financial_report/report/templates/open_items.xml

@ -179,7 +179,7 @@
<!--## move--> <!--## move-->
<div class="act_as_cell left"> <div class="act_as_cell left">
<span <span
t-att-res-id="line['move_id']"
t-att-res-id="line['entry_id']"
res-model="account.move" res-model="account.move"
view-type="form" view-type="form"
> >
@ -188,16 +188,34 @@
</div> </div>
<!--## journal--> <!--## journal-->
<div class="act_as_cell left"> <div class="act_as_cell left">
<span t-esc="journals_data[line['journal_id']]['code']" />
<span
t-att-res-id="journals_data[line['journal_id']]['id']"
res-model="account.journal"
view-type="form"
>
<t t-esc="journals_data[line['journal_id']]['code']" />
</span>
</div> </div>
<!--## account code--> <!--## account code-->
<div class="act_as_cell left"> <div class="act_as_cell left">
<span t-esc="accounts_data[account_id]['code']" />
<span
t-att-res-id="accounts_data[account_id]['id']"
res-model="account.account"
view-type="form"
>
<t t-esc="accounts_data[account_id]['code']" />
</span>
</div> </div>
<!--## partner--> <!--## partner-->
<div class="act_as_cell left"> <div class="act_as_cell left">
<!-- <span t-if="line.get('partner_id', False)" t-esc="line['partner_id']"/>-->
<span t-esc="line['partner_name']" />
<span
t-if="line.get('partner_id', False)"
t-att-res-id="line['partner_id']"
res-model="res.partner"
view-type="form"
>
<t t-esc="line['partner_name']" />
</span>
</div> </div>
<!--## ref - label--> <!--## ref - label-->
<div class="act_as_cell left"> <div class="act_as_cell left">

2
account_financial_report/wizard/open_items_wizard_view.xml

@ -88,7 +88,7 @@
</field> </field>
</record> </record>
<record id="action_open_items_wizard" model="ir.actions.act_window"> <record id="action_open_items_wizard" model="ir.actions.act_window">
<field name="name">Open Itemsr</field>
<field name="name">Open Items</field>
<field name="res_model">open.items.report.wizard</field> <field name="res_model">open.items.report.wizard</field>
<field name="view_mode">form</field> <field name="view_mode">form</field>
<field name="view_id" ref="open_items_wizard" /> <field name="view_id" ref="open_items_wizard" />

Loading…
Cancel
Save