Browse Source

Merge pull request #23 from Antiun/fix-contract_payment_mode_domain

[8.0][FIX][contract_payment_mode] Filter payment modes for sales
pull/28/head
Pedro M. Baeza 9 years ago
parent
commit
23172c792d
  1. 5
      contract_payment_mode/models/contract.py

5
contract_payment_mode/models/contract.py

@ -8,7 +8,7 @@ class AccountAnalyticAccount(models.Model):
payment_mode_id = fields.Many2one(
'payment.mode',
string='Payment Mode',
domain="[('type', '=', 'sale')]")
domain="[('sale_ok', '=', True)]")
@api.multi
def on_change_partner_id(self, partner_id, name):
@ -23,8 +23,7 @@ class AccountAnalyticAccount(models.Model):
@api.model
def _prepare_invoice_data(self, contract):
invoice_vals = super(AccountAnalyticAccount, self).\
_prepare_invoice_data(
contract)
_prepare_invoice_data(contract)
if contract.payment_mode_id:
invoice_vals['payment_mode_id'] = contract.payment_mode_id.id
invoice_vals['partner_bank_id'] = \

Loading…
Cancel
Save