Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][FIX] account_invoice_view_payment: Validate & View payments button #1702

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 0 additions & 25 deletions account_invoice_view_payment/models/account_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,3 @@ def post_and_open_payment(self):
"type": "ir.actions.act_window",
}
return res


class AccountPaymentRegister(models.TransientModel):
_inherit = "account.payment.register"

def create_payment_and_open(self):
account_move_model = self.env["account.move"]
payment_model = self.env["account.payment"]
payments = payment_model
for _payment_vals in account_move_model.search(
[("id", "in", self.env.context.get("active_ids", False))]
):
vals = self._create_payment_vals_from_wizard()
payments += payment_model.create(vals)
payments.action_post()
res = {
"domain": [("id", "in", payments.ids), ("state", "=", "posted")],
"name": _("Payments"),
"view_mode": "tree,form",
"res_model": "account.payment",
"view_id": False,
"context": False,
"type": "ir.actions.act_window",
}
return res
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def test_view_account_payment_register_form(self):
}
)

res = wiz.create_payment_and_open()
res = wiz.action_create_payments()

expect = {"type": "ir.actions.act_window", "res_model": "account.payment"}
self.assertDictEqual(
Expand Down
17 changes: 0 additions & 17 deletions account_invoice_view_payment/views/account_payment_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,4 @@
</field>
</record>

<record id="view_account_payment_form_multi" model="ir.ui.view">
<field name="name">account.payment.form.multi</field>
<field name="model">account.payment.register</field>
<field name="inherit_id" ref="account.view_account_payment_register_form" />
<field name="arch" type="xml">
<button name="action_create_payments" position="after">
<button
name="create_payment_and_open"
string="Validate &amp; View Payment"
type="object"
class="oe_highlight"
groups="account.group_account_invoice"
/>
</button>
</field>
</record>

</odoo>