[IMP] account_payment: code clean, rename files

bzr revid: mra@mra-laptop-20100611095414-vokeorwo36fb94ut
This commit is contained in:
Mustufa Rangwala 2010-06-11 15:24:14 +05:30
parent e0d32e87cb
commit de6da0de39
9 changed files with 19 additions and 33 deletions

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,7 +15,7 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -23,11 +23,10 @@
# Init Sales
#----------------------------------------------------------
import payment
import account_payment
import wizard
import account_move_line
import account_invoice
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -41,11 +41,11 @@
'wizard/account_payment_pay_view.xml',
'wizard/account_payment_populate_statement_view.xml',
'wizard/account_payment_create_order_view.xml',
'payment_view.xml',
'payment_workflow.xml',
'payment_sequence.xml',
'account_payment_view.xml',
'account_payment_workflow.xml',
'account_payment_sequence.xml',
'account_invoice_view.xml',
'payment_report.xml',
'account_payment_report.xml',
],
'demo_xml': [],
'test': ['test/account_payment.yml'],

View File

@ -18,29 +18,25 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields
from osv import osv
import time
import netsvc
import pooler
from osv import osv, fields
import netsvc
class payment_type(osv.osv):
_name= 'payment.type'
_description= 'Payment Type'
_columns= {
'name': fields.char('Name', size=64, required=True,help='Payment Type'),
'code': fields.char('Code', size=64, required=True,help='Specifies the Code for Payment Type'),
'name': fields.char('Name', size=64, required=True, help='Payment Type'),
'code': fields.char('Code', size=64, required=True, help='Specifies the Code for Payment Type'),
'suitable_bank_types': fields.many2many('res.partner.bank.type',
'bank_type_payment_type_rel',
'pay_type_id','bank_type_id',
'Suitable bank types')
}
}
payment_type()
class payment_mode(osv.osv):
_name= 'payment.mode'
_description= 'Payment Mode'
@ -66,16 +62,14 @@ class payment_mode(osv.osv):
where pm.id = %s """, [payment_code])
return [x[0] for x in cr.fetchall()]
payment_mode()
class payment_order(osv.osv):
_name = 'payment.order'
_description = 'Payment Order'
_rec_name = 'reference'
def get_wizard(self,type):
def get_wizard(self, type):
logger = netsvc.Logger()
logger.notifyChannel("warning", netsvc.LOG_WARNING,
"No wizard found for the payment type '%s'." % type)
@ -146,7 +140,6 @@ class payment_order(osv.osv):
payment_order()
class payment_line(osv.osv):
_name = 'payment.line'
_description = 'Payment Line'

View File

@ -110,8 +110,7 @@ class payment_order_create(osv.osv_memory):
context.update({'line_ids': line_ids})
model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_create_payment_order_lines')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
return {
'name': ('Entrie Lines'),
return {'name': ('Entrie Lines'),
'context': context,
'view_type': 'form',
'view_mode': 'form',

View File

@ -18,16 +18,13 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from osv import fields, osv
class account_payment_make_payment(osv.osv_memory):
_name = 'account.payment.make.payment'
_description = 'Account make payment'
_columns = {
}
def launch_wizard(self, cr, uid, ids, context):
def launch_wizard(self, cr, uid, ids, context=None):
"""
Search for a wizard to launch according to the type.
If type is manual. just confirm the order.
@ -35,8 +32,8 @@ class account_payment_make_payment(osv.osv_memory):
obj_payment_order = self.pool.get('payment.order')
obj_model = self.pool.get('ir.model.data')
obj_act = self.pool.get('ir.actions.act_window')
order= obj_payment_order.browse(cr,uid,context['active_id'],context)
t= order.mode and order.mode.type.code or 'manual'
order= obj_payment_order.browse(cr, uid, context['active_id'], context)
t = order.mode and order.mode.type.code or 'manual'
if t == 'manual' :
obj_payment_order.set_done(cr,uid,context['active_id'],context)
return {}
@ -49,12 +46,10 @@ class account_payment_make_payment(osv.osv_memory):
module, wizard= gw
result = mod_obj._get_id(cr, uid, module, wizard)
id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
result = act_obj.read(cr, uid, [id])[0]
return act_obj.read(cr, uid, [id])[0]
#result['context'] = str({'fiscalyear': data['form']['fiscalyear']})
return result
account_payment_make_payment()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: