From 5d97d82d8665cc1fe03b4124f169555bb3b945ad Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 14 Jan 2015 15:25:50 +0100 Subject: [PATCH] [IMP] account_payment_partner: Several things: * move unused file + cleanup code * Add sale_ok and purchase_ok filters in partner/sale/purchase form views * Use widget=selection for payment_mode_id fields * Update demo data * Return res in inherit (even if res is empty in this case) --- .../models/payment_order_create.py | 38 ------------------- .../views/account_invoice_view.xml | 6 ++- .../views/res_partner_view.xml | 8 +++- 3 files changed, 10 insertions(+), 42 deletions(-) delete mode 100644 account_payment_partner/models/payment_order_create.py diff --git a/account_payment_partner/models/payment_order_create.py b/account_payment_partner/models/payment_order_create.py deleted file mode 100644 index 3b9b536a7..000000000 --- a/account_payment_partner/models/payment_order_create.py +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Account Payment Partner module for OpenERP -# Copyright (C) 2014 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from openerp.osv import orm - - -class PaymentOrderCreate(orm.TransientModel): - _inherit = 'payment.order.create' - - def extend_payment_order_domain( - self, cr, uid, payment_order, domain, context=None): - super(PaymentOrderCreate, self).extend_payment_order_domain( - cr, uid, payment_order, domain, context=context) - domain += [ - '|', '|', - ('invoice', '=', False), - ('invoice.payment_mode_id', '=', False), - ('invoice.payment_mode_id', '=', payment_order.mode.id)] - return True diff --git a/account_payment_partner/views/account_invoice_view.xml b/account_payment_partner/views/account_invoice_view.xml index 5655e3d25..72afbb2a5 100644 --- a/account_payment_partner/views/account_invoice_view.xml +++ b/account_payment_partner/views/account_invoice_view.xml @@ -28,7 +28,8 @@ + domain="[('sale_ok', '=', True)]" + widget="selection"/> @@ -41,7 +42,8 @@ + domain="[('purchase_ok', '=', True)]" + widget="selection"/> diff --git a/account_payment_partner/views/res_partner_view.xml b/account_payment_partner/views/res_partner_view.xml index 3c6d670aa..f52579b2c 100644 --- a/account_payment_partner/views/res_partner_view.xml +++ b/account_payment_partner/views/res_partner_view.xml @@ -15,10 +15,14 @@ - + - +