Skip to content
Open
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
14 changes: 9 additions & 5 deletions account_payment_group/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ def action_post(self):
self.pay_now()
return res

def pay_now_context(self, partner_type):
self.ensure_one()
return {
'to_pay_move_line_ids': (self.open_move_line_ids.ids),
'default_company_id': self.company_id.id,
'default_partner_type': partner_type,
}

def pay_now(self):
# validate_payment = not self._context.get('validate_payment')
for rec in self:
Expand All @@ -103,11 +111,7 @@ def pay_now(self):
else:
partner_type = 'customer'

pay_context = {
'to_pay_move_line_ids': (rec.open_move_line_ids.ids),
'default_company_id': rec.company_id.id,
'default_partner_type': partner_type,
}
pay_context = rec.pay_now_context(partner_type)

payment_group = rec.env[
'account.payment.group'].with_context(
Expand Down