mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
Move fields mandate_required and export_ascii from payment mode to payment method
Display chatter on payment orders Several small usability improvements
This commit is contained in:
committed by
Enric Tobella
parent
7c34e39123
commit
9f1347a517
@@ -20,7 +20,7 @@
|
||||
],
|
||||
'data': [
|
||||
'views/account_banking_mandate_view.xml',
|
||||
'views/account_payment_mode.xml',
|
||||
'views/account_payment_method.xml',
|
||||
'views/account_invoice_view.xml',
|
||||
'views/account_payment_line.xml',
|
||||
'views/res_partner_bank_view.xml',
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2014 Compassion CH - Cyril Sester <csester@compassion.ch>
|
||||
# © 2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from . import account_banking_mandate
|
||||
from . import account_payment_mode
|
||||
from . import account_payment_method
|
||||
from . import account_payment_order
|
||||
from . import account_invoice
|
||||
from . import res_partner_bank
|
||||
|
||||
@@ -47,7 +47,7 @@ class AccountInvoice(models.Model):
|
||||
if (
|
||||
self.type in ('out_invoice', 'out_refund') and
|
||||
self.payment_mode_id.payment_type == 'inbound' and
|
||||
self.payment_mode_id.mandate_required and
|
||||
self.payment_mode_id.payment_method_id.mandate_required and
|
||||
self.partner_id):
|
||||
mandates = self.env['account.banking.mandate'].search([
|
||||
('state', '=', 'valid'),
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
from openerp import models, fields
|
||||
|
||||
|
||||
class AccountPaymentMode(models.Model):
|
||||
_inherit = "account.payment.mode"
|
||||
class AccountPaymentMethod(models.Model):
|
||||
_inherit = "account.payment.method"
|
||||
|
||||
mandate_required = fields.Boolean(
|
||||
string='Mandate Required',
|
||||
help="Activate this option is this payment mode requires your "
|
||||
help="Activate this option is this payment method requires your "
|
||||
"customer to sign a direct debit mandate with your company.")
|
||||
@@ -12,7 +12,7 @@ class AccountPaymentOrder(models.Model):
|
||||
@api.multi
|
||||
def draft2open(self):
|
||||
for order in self:
|
||||
if order.payment_mode_id.mandate_required:
|
||||
if order.payment_mode_id.payment_method_id.mandate_required:
|
||||
for line in order.payment_line_ids:
|
||||
if not line.mandate_id:
|
||||
raise UserError(_(
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
<data>
|
||||
|
||||
|
||||
<record id="account_payment_mode_form" model="ir.ui.view">
|
||||
<field name="name">account_banking_mandate.account.payment.mode.form</field>
|
||||
<field name="model">account.payment.mode</field>
|
||||
<field name="inherit_id" ref="account_payment_order.account_payment_mode_form"/>
|
||||
<record id="account_payment_method_form" model="ir.ui.view">
|
||||
<field name="name">account_banking_mandate.account.payment.method.form</field>
|
||||
<field name="model">account.payment.method</field>
|
||||
<field name="inherit_id" ref="account_payment_mode.account_payment_method_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="payment_order_options" position="inside">
|
||||
<field name="payment_type" position="after">
|
||||
<field name="mandate_required"
|
||||
attrs="{'invisible': [('payment_type', '!=', 'inbound')]}"/>
|
||||
</group>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user