Skip to content

Commit

Permalink
[FIX] payment_pro: varios fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jjscarafia committed Apr 17, 2024
1 parent 032c3df commit 83cbd20
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions account_payment_pro_receiptbook/models/account_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ def action_post(self):

@api.depends('company_id', 'partner_type', 'is_internal_transfer')
def _compute_receiptbook(self):
for rec in self.filtered(lambda x: not x.receiptbook_id or x.receiptbook_id.company_id != x.company_id):
if self.is_internal_transfer:
for rec in self:
if rec.is_internal_transfer:
rec.receiptbook_id = False
continue
partner_type = rec.partner_type or self._context.get(
'partner_type', self._context.get('default_partner_type', False))
receiptbook = self.env[
'account.payment.receiptbook'].search([
('partner_type', '=', partner_type),
('company_id', '=', rec.company_id.id),
], limit=1)
rec.receiptbook_id = receiptbook
elif not rec.receiptbook_id or rec.receiptbook_id.company_id != rec.company_id:
partner_type = rec.partner_type or self._context.get(
'partner_type', self._context.get('default_partner_type', False))
receiptbook = self.env[
'account.payment.receiptbook'].search([
('partner_type', '=', partner_type),
('company_id', '=', rec.company_id.id),
], limit=1)
rec.receiptbook_id = receiptbook

0 comments on commit 83cbd20

Please sign in to comment.