Browse Source

[IMP] contract_payment_mode: Onchange payment mode vals

pull/236/head
Carlos Dauden 7 years ago
committed by sbejaoui
parent
commit
392cddf8f9
  1. 1
      contract_payment_mode/README.rst
  2. 3
      contract_payment_mode/__manifest__.py
  3. 4
      contract_payment_mode/models/contract.py

1
contract_payment_mode/README.rst

@ -50,6 +50,7 @@ Contributors
* Antonio Espinosa <antonioea@antiun.com> * Antonio Espinosa <antonioea@antiun.com>
* Vicent Cubells <vicent.cubells@tecnativa.com> * Vicent Cubells <vicent.cubells@tecnativa.com>
* David Vidal <david.vidal@tecnativa.com> * David Vidal <david.vidal@tecnativa.com>
* Carlos Dauden <carlos.dauden@tecnativa.com>
Maintainer Maintainer

3
contract_payment_mode/__manifest__.py

@ -3,12 +3,13 @@
# Copyright 2016 Antiun Ingenieria S.L. - Antonio Espinosa # Copyright 2016 Antiun Ingenieria S.L. - Antonio Espinosa
# Copyright 2017 Tecnativa - Vicent Cubells # Copyright 2017 Tecnativa - Vicent Cubells
# Copyright 2017 Tecnativa - David Vidal # Copyright 2017 Tecnativa - David Vidal
# Copyright 2017 Tecnativa - Carlos Dauden <carlos.dauden@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{ {
'name': 'Contract Payment Mode', 'name': 'Contract Payment Mode',
'summary': 'Payment mode in contracts and their invoices', 'summary': 'Payment mode in contracts and their invoices',
'version': '10.0.1.0.0',
'version': '10.0.1.0.1',
'author': 'Domatix, ' 'author': 'Domatix, '
'Tecnativa, ' 'Tecnativa, '
'Odoo Community Association (OCA)', 'Odoo Community Association (OCA)',

4
contract_payment_mode/models/contract.py

@ -21,5 +21,7 @@ class AccountAnalyticAccount(models.Model):
invoice_vals = super(AccountAnalyticAccount, self)._prepare_invoice() invoice_vals = super(AccountAnalyticAccount, self)._prepare_invoice()
if self.payment_mode_id: if self.payment_mode_id:
invoice_vals['payment_mode_id'] = self.payment_mode_id.id invoice_vals['payment_mode_id'] = self.payment_mode_id.id
invoice_vals['partner_bank_id'] = self.partner_id.bank_ids[:1].id
invoice = self.env['account.invoice'].new(invoice_vals)
invoice.payment_mode_id_change()
invoice_vals = invoice._convert_to_write(invoice._cache)
return invoice_vals return invoice_vals
Loading…
Cancel
Save