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

[FW][IMP]account_payment_group:Se forma el metodo pay_now_context fuera del metodo pay_now #328

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
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 @@ -82,6 +82,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 @@ -97,11 +105,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