[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)
This commit is contained in:
Alexis de Lattre
2015-01-14 15:25:50 +01:00
committed by Thomas Binsfeld
parent 34f005b4ed
commit 5d97d82d86
3 changed files with 10 additions and 42 deletions

View File

@@ -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 <alexis.delattre@akretion.com>
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
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

View File

@@ -28,7 +28,8 @@
<field name="arch" type="xml">
<field name="partner_bank_id" position="after">
<field name="payment_mode_id"
domain="[('sale_ok', '=', True)]"/>
domain="[('sale_ok', '=', True)]"
widget="selection"/>
</field>
</field>
</record>
@@ -41,7 +42,8 @@
<field name="arch" type="xml">
<field name="partner_bank_id" position="after">
<field name="payment_mode_id"
domain="[('purchase_ok', '=', True)]"/>
domain="[('purchase_ok', '=', True)]"
widget="selection"/>
</field>
</field>
</record>

View File

@@ -15,10 +15,14 @@
<field name="inherit_id" ref="account.view_partner_property_form" />
<field name="arch" type="xml">
<field name="property_payment_term" position="after">
<field name="customer_payment_mode"/>
<field name="customer_payment_mode"
domain="[('sale_ok', '=', True)]"
widget="selection"/>
</field>
<field name="property_supplier_payment_term" position="after">
<field name="supplier_payment_mode"/>
<field name="supplier_payment_mode"
domain="[('purchase_ok', '=', True)]"
widget="selection"/>
</field>
</field>
</record>