Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions account_payment_order/models/account_payment_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,3 +451,16 @@ def action_move_journal_line(self):
ctx.update({"search_default_misc_filter": 0})
action["context"] = ctx
return action

def action_view_payments(self):
self.ensure_one()
action = self.env["ir.actions.actions"]._for_xml_id(
"account.action_account_payments"
)
action.update(
{
"domain": [("payment_order_id", "=", self.id)],
"context": {"default_payment_order_id": self.id},
}
)
return action
12 changes: 12 additions & 0 deletions account_payment_order/views/account_payment_order.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@
widget="statinfo"
/>
</button>
<button
class="oe_stat_button"
name="action_view_payments"
type="object"
icon="fa-bars"
>
<field
string="Payments"
name="payment_count"
widget="statinfo"
/>
</button>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only" />
Expand Down