mirror of
https://gitlab.com/flectra-community/bank-payment.git
synced 2024-11-23 06:02:04 +00:00
Merge branch '1.0-fixed' into '1.0'
✨ New app to automatically set default bank if no payment mode is used See merge request flectra-community/bank-payment!5
This commit is contained in:
commit
bffb50c5fe
@ -18,8 +18,9 @@ class AccountInvoice(models.Model):
|
||||
company = self.env.user.company_id
|
||||
res = super(AccountInvoice, self)._onchange_partner_id()
|
||||
if self.type == 'out_invoice' and not self.partner_bank_id:
|
||||
if company.bank_ids:
|
||||
self.partner_bank_id = company.bank_ids[0]
|
||||
bank_id = self._get_partner_bank_id(company.id)
|
||||
if bank_id:
|
||||
self.partner_bank_id = bank_id
|
||||
|
||||
return res
|
||||
|
||||
@ -31,6 +32,7 @@ class AccountInvoice(models.Model):
|
||||
company = self.env.user.company_id
|
||||
res = super(AccountInvoice, self)._onchange_payment_mode_id()
|
||||
if self.type == 'out_invoice' and not self.partner_bank_id:
|
||||
if company.bank_ids:
|
||||
self.partner_bank_id = company.bank_ids[0]
|
||||
bank_id = self._get_partner_bank_id(company.id)
|
||||
if bank_id:
|
||||
self.partner_bank_id = bank_id
|
||||
return res
|
||||
|
Loading…
Reference in New Issue
Block a user