Skip to content

Commit

Permalink
[IMP]account_payment_group:Se forma el metodo pay_now_context fuera d…
Browse files Browse the repository at this point in the history
…el metodo pay_now

Ticket:52972

X-original-commit: f483bec
  • Loading branch information
Maximiliano Mezzavilla authored and zaoral committed Nov 26, 2022
1 parent b5de55e commit a6db028
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions account_payment_group/models/account_move.py
Expand Up @@ -89,6 +89,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 @@ -104,11 +112,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

0 comments on commit a6db028

Please sign in to comment.