mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[9.0][FIX] contract_payment_mode: Payment mode unknow. Improve tests
This commit is contained in:
@@ -16,12 +16,10 @@ class AccountAnalyticAccount(models.Model):
|
||||
if self.partner_id.customer_payment_mode_id:
|
||||
self.payment_mode_id = self.partner_id.customer_payment_mode_id.id
|
||||
|
||||
@api.model
|
||||
def _prepare_invoice_data(self, contract):
|
||||
@api.multi
|
||||
def _prepare_invoice(self):
|
||||
invoice_vals = super(AccountAnalyticAccount, self)._prepare_invoice()
|
||||
if contract.payment_mode_id:
|
||||
invoice_vals['payment_mode_id'] = contract.payment_mode_id.id
|
||||
invoice_vals['partner_bank_id'] = (
|
||||
contract.partner_id.bank_ids[:1].id
|
||||
)
|
||||
if self.payment_mode_id:
|
||||
invoice_vals['payment_mode_id'] = self.payment_mode_id.id
|
||||
invoice_vals['partner_bank_id'] = self.partner_id.bank_ids[:1].id
|
||||
return invoice_vals
|
||||
|
||||
Reference in New Issue
Block a user