← Back to team overview

clearcorp team mailing list archive

lp:~juan-munoz-clearcorp/openerp-ccorp-addons/958122-account_voucher_payment_method-6.1 into lp:openerp-ccorp-addons

 

Juan Felipe Muñoz Ramos has proposed merging lp:~juan-munoz-clearcorp/openerp-ccorp-addons/958122-account_voucher_payment_method-6.1 into lp:openerp-ccorp-addons.

Requested reviews:
  Carlos Vásquez (CLEARCORP) (cv.clearcorp)
Related bugs:
  Bug #958122 in OpenERP CLEARCORP Addons: "account_voucher_payment_method  migration to 6.1"
  https://bugs.launchpad.net/openerp-ccorp-addons/+bug/958122

For more details, see:
https://code.launchpad.net/~juan-munoz-clearcorp/openerp-ccorp-addons/958122-account_voucher_payment_method-6.1/+merge/98072

Migration of the module account_voucher_payment_method to OpenERP 6.1
Changed:
account_voucher_payment_method.xml: Updated the field journal_id.
                                    Changed the on_change method from the views.
                                    Add checkbox of Payment method for customers and suppliers.



-- 
https://code.launchpad.net/~juan-munoz-clearcorp/openerp-ccorp-addons/958122-account_voucher_payment_method-6.1/+merge/98072
Your team CLEARCORP development team is subscribed to branch lp:openerp-ccorp-addons.
=== renamed directory 'TODO-6.1/account_voucher_payment_method' => 'account_voucher_payment_method'
=== modified file 'account_voucher_payment_method/account_voucher_payment_method.py'
--- TODO-6.1/account_voucher_payment_method/account_voucher_payment_method.py	2011-12-27 21:11:28 +0000
+++ account_voucher_payment_method/account_voucher_payment_method.py	2012-03-17 22:11:21 +0000
@@ -19,19 +19,19 @@
 ##############################################################################
 
 from osv import osv, fields
-from tools import debug
+#from tools import debug
 
 class account_journal(osv.osv):
 	_name = "account.journal"
 	_inherit = "account.journal"
 	_columns = {
 		#'type': fields.selection([('sale', 'Sale'),
-		#						('sale_refund','Sale Refund'), 
-		#						('purchase', 'Purchase'), 
-		#						('purchase_refund','Purchase Refund'), 
-		#						('cash', 'Cash'), 
-		#						('bank', 'Bank and Cheques'), 
-		#						('general', 'General'), 
+		#						('sale_refund','Sale Refund'),
+		#						('purchase', 'Purchase'),
+		#						('purchase_refund','Purchase Refund'),
+		#						('cash', 'Cash'),
+		#						('bank', 'Bank and Cheques'),
+		#						('general', 'General'),
 		#						('situation', 'Opening/Closing Situation'),
 		#						('payment','Payment method')], 'Type', size=32, required=True,
 		#						help="Select 'Sale' for Sale journal to be used at the time of making invoice."\
@@ -39,7 +39,8 @@
 		#						" Select 'Cash' to be used at the time of making payment."\
 		#						" Select 'General' for miscellaneous operations."\
 		#						" Select 'Opening/Closing Situation' to be used at the time of new fiscal year creation or end of year entries generation."),
-		'payment_method'            : fields.boolean('Payment method'),
+		'payment_method_customer'   : fields.boolean('Payment Method Customer'),
+		'payment_method_supplier'   : fields.boolean('Payment Method Supplier'),
 		'payment_verification'      : fields.boolean('Payment Verification'),
 	}
 account_journal()
@@ -48,7 +49,7 @@
 	_name = 'account.voucher'
 	_inherit = 'account.voucher'
 	_description = 'Accounting Voucher'
-	
+
 	def _compute_writeoff_amount(self, cr, uid, line_dr_ids, line_cr_ids, amount):
 		debit = credit = 0.0
 		for l in line_dr_ids:
@@ -56,149 +57,149 @@
 		for l in line_cr_ids:
 			credit += l['amount']
 		return abs(amount - abs(credit - debit))
-	
-	def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=None):
-		"""price
-		Returns a dict that contains new values and context
-
-		@param partner_id: latest value from user input for field partner_id
-		@param args: other arguments
-		@param context: context arguments, like lang, time zone
-
-		@return: Returns a dict which contains new values, and context
-		"""
-		if context is None:
-			context = {}
-		if not journal_id:
-			return {}
-		context_multi_currency = context.copy()
-		if date:
-			context_multi_currency.update({'date': date})
-
-		line_pool = self.pool.get('account.voucher.line')
-		line_ids = ids and line_pool.search(cr, uid, [('voucher_id', '=', ids[0])]) or False
-		if line_ids:
-			line_pool.unlink(cr, uid, line_ids)
-
-		currency_pool = self.pool.get('res.currency')
-		move_line_pool = self.pool.get('account.move.line')
-		partner_pool = self.pool.get('res.partner')
-		journal_pool = self.pool.get('account.journal')
-
-		vals = self.onchange_journal(cr, uid, ids, journal_id, [], False, partner_id, context)
-		vals = vals.get('value')
-		currency_id = vals.get('currency_id', currency_id)
-		default = {
-			'value':{'line_ids':[], 'line_dr_ids':[], 'line_cr_ids':[], 'pre_line': False, 'currency_id':currency_id},
-		}
-
-		if not partner_id:
-			debug("DEFAULT EN EL IF SIN PARTNER")
-			debug(default)
-			return default
-
-		if not partner_id and ids:
-			line_ids = line_pool.search(cr, uid, [('voucher_id', '=', ids[0])])
-			if line_ids:
-				line_pool.unlink(cr, uid, line_ids)
-			return default
-
-		journal = journal_pool.browse(cr, uid, journal_id, context=context)
-		partner = partner_pool.browse(cr, uid, partner_id, context=context)
-		account_id = False
-		if journal.type in ('sale','sale_refund'):
-			account_id = partner.property_account_receivable.id
-		elif journal.type in ('purchase', 'purchase_refund','expense'):
-			account_id = partner.property_account_payable.id
-		else:
-			account_id = journal.default_credit_account_id.id or journal.default_debit_account_id.id
-
-		default['value']['account_id'] = account_id
-
-		if journal.type not in ('cash', 'bank','payment'):
-			debug("DEFAULT EN EL IF journal no de dinero banco o pagos")
-			debug(default)
-			return default
-
-		total_credit = 0.0
-		total_debit = 0.0
-		account_type = 'receivable'
-		if ttype == 'payment':
-			account_type = 'payable'
-			total_debit = price or 0.0
-		else:
-			total_credit = price or 0.0
-			account_type = 'receivable'
-
-		if not context.get('move_line_ids', False):
-			domain = [('state','=','valid'), ('account_id.type', '=', account_type), ('reconcile_id', '=', False), ('partner_id', '=', partner_id), ('journal_id.payment_method','=',False)]
-			if context.get('invoice_id', False):
-				domain.append(('invoice', '=', context['invoice_id']))
-			ids = move_line_pool.search(cr, uid, domain, context=context)
-			debug("no encuentra movelines en el contexto")
-			debug(ids)
-		else:
-			ids = context['move_line_ids']
-			debug("SI encuentra movelines en el contexto")
-			debug(ids)
-		ids.reverse()
-		moves = move_line_pool.browse(cr, uid, ids, context=context)
-
-		company_currency = journal.company_id.currency_id.id
-		if company_currency != currency_id and ttype == 'payment':
-			total_debit = currency_pool.compute(cr, uid, currency_id, company_currency, total_debit, context=context_multi_currency)
-		elif company_currency != currency_id and ttype == 'receipt':
-			total_credit = currency_pool.compute(cr, uid, currency_id, company_currency, total_credit, context=context_multi_currency)
-
-		for line in moves:
-			if line.credit and line.reconcile_partial_id and ttype == 'receipt':
-				continue
-			if line.debit and line.reconcile_partial_id and ttype == 'payment':
-				continue
-			total_credit += line.credit or 0.0
-			total_debit += line.debit or 0.0
-		for line in moves:
-			if line.credit and line.reconcile_partial_id and ttype == 'receipt':
-				continue
-			if line.debit and line.reconcile_partial_id and ttype == 'payment':
-				continue
-			original_amount = line.credit or line.debit or 0.0
-			amount_unreconciled = currency_pool.compute(cr, uid, line.currency_id and line.currency_id.id or company_currency, currency_id, abs(line.amount_residual_currency), context=context_multi_currency)
-			rs = {
-				'name':line.move_id.name,
-				'type': line.credit and 'dr' or 'cr',
-				'move_line_id':line.id,
-				'account_id':line.account_id.id,
-				'amount_original': currency_pool.compute(cr, uid, line.currency_id and line.currency_id.id or company_currency, currency_id, line.currency_id and abs(line.amount_currency) or original_amount, context=context_multi_currency),
-				'date_original':line.date,
-				'date_due':line.date_maturity,
-				'amount_unreconciled': amount_unreconciled,
-			}
-
-			if line.credit:
-				amount = min(amount_unreconciled, currency_pool.compute(cr, uid, company_currency, currency_id, abs(total_debit), context=context_multi_currency))
-				rs['amount'] = amount
-				total_debit -= amount
-			else:
-				amount = min(amount_unreconciled, currency_pool.compute(cr, uid, company_currency, currency_id, abs(total_credit), context=context_multi_currency))
-				rs['amount'] = amount
-				total_credit -= amount
-
-			default['value']['line_ids'].append(rs)
-			if rs['type'] == 'cr':
-				default['value']['line_cr_ids'].append(rs)
-			else:
-				default['value']['line_dr_ids'].append(rs)
-
-			if ttype == 'payment' and len(default['value']['line_cr_ids']) > 0:
-				default['value']['pre_line'] = 1
-			elif ttype == 'receipt' and len(default['value']['line_dr_ids']) > 0:
-				default['value']['pre_line'] = 1
-			default['value']['writeoff_amount'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price)
-		debug(price)
-		debug(default)
-		return default
-	
+
+	#def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=None):
+		#"""price
+		#Returns a dict that contains new values and context
+
+		#@param partner_id: latest value from user input for field partner_id
+		#@param args: other arguments
+		#@param context: context arguments, like lang, time zone
+
+		#@return: Returns a dict which contains new values, and context
+		#"""
+		#if context is None:
+			#context = {}
+		#if not journal_id:
+			#return {}
+		#context_multi_currency = context.copy()
+		#if date:
+			#context_multi_currency.update({'date': date})
+
+		#line_pool = self.pool.get('account.voucher.line')
+		#line_ids = ids and line_pool.search(cr, uid, [('voucher_id', '=', ids[0])]) or False
+		#if line_ids:
+			#line_pool.unlink(cr, uid, line_ids)
+
+		#currency_pool = self.pool.get('res.currency')
+		#move_line_pool = self.pool.get('account.move.line')
+		#partner_pool = self.pool.get('res.partner')
+		#journal_pool = self.pool.get('account.journal')
+
+		#vals = self.onchange_journal(cr, uid, ids, journal_id, [], False, partner_id, False, False, False, False, context)
+		#vals = vals.get('value')
+		#currency_id = vals.get('currency_id', currency_id)
+		#default = {
+			#'value':{'line_ids':[], 'line_dr_ids':[], 'line_cr_ids':[], 'pre_line': False, 'currency_id':currency_id},
+		#}
+
+		#if not partner_id:
+			##debug("DEFAULT EN EL IF SIN PARTNER")
+			##debug(default)
+			#return default
+
+		#if not partner_id and ids:
+			#line_ids = line_pool.search(cr, uid, [('voucher_id', '=', ids[0])])
+			#if line_ids:
+				#line_pool.unlink(cr, uid, line_ids)
+			#return default
+
+		#journal = journal_pool.browse(cr, uid, journal_id, context=context)
+		#partner = partner_pool.browse(cr, uid, partner_id, context=context)
+		#account_id = False
+		#if journal.type in ('sale','sale_refund'):
+			#account_id = partner.property_account_receivable.id
+		#elif journal.type in ('purchase', 'purchase_refund','expense'):
+			#account_id = partner.property_account_payable.id
+		#else:
+			#account_id = journal.default_credit_account_id.id or journal.default_debit_account_id.id
+
+		#default['value']['account_id'] = account_id
+
+		#if journal.type not in ('cash', 'bank','payment'):
+			##debug("DEFAULT EN EL IF journal no de dinero banco o pagos")
+			##debug(default)
+			#return default
+
+		#total_credit = 0.0
+		#total_debit = 0.0
+		#account_type = 'receivable'
+		#if ttype == 'payment':
+			#account_type = 'payable'
+			#total_debit = price or 0.0
+		#else:
+			#total_credit = price or 0.0
+			#account_type = 'receivable'
+
+		#if not context.get('move_line_ids', False):
+			#domain = [('state','=','valid'), ('account_id.type', '=', account_type), ('reconcile_id', '=', False), ('partner_id', '=', partner_id), ('journal_id.payment_method','=',False)]
+			#if context.get('invoice_id', False):
+				#domain.append(('invoice', '=', context['invoice_id']))
+			#ids = move_line_pool.search(cr, uid, domain, context=context)
+			##debug("no encuentra movelines en el contexto")
+			##debug(ids)
+		#else:
+			#ids = context['move_line_ids']
+			##debug("SI encuentra movelines en el contexto")
+			##debug(ids)
+		#ids.reverse()
+		#moves = move_line_pool.browse(cr, uid, ids, context=context)
+
+		#company_currency = journal.company_id.currency_id.id
+		#if company_currency != currency_id and ttype == 'payment':
+			#total_debit = currency_pool.compute(cr, uid, currency_id, company_currency, total_debit, context=context_multi_currency)
+		#elif company_currency != currency_id and ttype == 'receipt':
+			#total_credit = currency_pool.compute(cr, uid, currency_id, company_currency, total_credit, context=context_multi_currency)
+
+		#for line in moves:
+			#if line.credit and line.reconcile_partial_id and ttype == 'receipt':
+				#continue
+			#if line.debit and line.reconcile_partial_id and ttype == 'payment':
+				#continue
+			#total_credit += line.credit or 0.0
+			#total_debit += line.debit or 0.0
+		#for line in moves:
+			#if line.credit and line.reconcile_partial_id and ttype == 'receipt':
+				#continue
+			#if line.debit and line.reconcile_partial_id and ttype == 'payment':
+				#continue
+			#original_amount = line.credit or line.debit or 0.0
+			#amount_unreconciled = currency_pool.compute(cr, uid, line.currency_id and line.currency_id.id or company_currency, currency_id, abs(line.amount_residual_currency), context=context_multi_currency)
+			#rs = {
+				#'name':line.move_id.name,
+				#'type': line.credit and 'dr' or 'cr',
+				#'move_line_id':line.id,
+				#'account_id':line.account_id.id,
+				#'amount_original': currency_pool.compute(cr, uid, line.currency_id and line.currency_id.id or company_currency, currency_id, line.currency_id and abs(line.amount_currency) or original_amount, context=context_multi_currency),
+				#'date_original':line.date,
+				#'date_due':line.date_maturity,
+				#'amount_unreconciled': amount_unreconciled,
+			#}
+
+			#if line.credit:
+				#amount = min(amount_unreconciled, currency_pool.compute(cr, uid, company_currency, currency_id, abs(total_debit), context=context_multi_currency))
+				#rs['amount'] = amount
+				#total_debit -= amount
+			#else:
+				#amount = min(amount_unreconciled, currency_pool.compute(cr, uid, company_currency, currency_id, abs(total_credit), context=context_multi_currency))
+				#rs['amount'] = amount
+				#total_credit -= amount
+
+			#default['value']['line_ids'].append(rs)
+			#if rs['type'] == 'cr':
+				#default['value']['line_cr_ids'].append(rs)
+			#else:
+				#default['value']['line_dr_ids'].append(rs)
+
+			#if ttype == 'payment' and len(default['value']['line_cr_ids']) > 0:
+				#default['value']['pre_line'] = 1
+			#elif ttype == 'receipt' and len(default['value']['line_dr_ids']) > 0:
+				#default['value']['pre_line'] = 1
+			#default['value']['writeoff_amount'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price)
+		##debug(price)
+		##debug(default)
+		#return default
+
 	def proforma_voucher_mirror(self, cr, uid, ids, context=None):
 		super(account_voucher_journal_payment, self).action_move_line_create(cr, uid, ids, context=context)
 		voucher = self.browse(cr,1,ids,context=context)[0]
@@ -208,9 +209,9 @@
 			targ_account = mirror_journal.targ_account
 			company_id = self.pool.get('res.company').browse(cr,1,1)
 			partner_id = company_id.partner_id
-			
+
 			period_id  = self.pool.get('account.period').search(cr,1,['|',('name','=',voucher.period_id.name), ('code','=',voucher.period_id.code),('company_id','=',company_id.id)])[0]
-			
+
 			period = self.pool.get('account.period').browse(cr,1,period_id)
 			args = {
 				'journal' : targ_journal,
@@ -219,8 +220,8 @@
 				'period'  : period,
 			}
 			self.action_move_line_create_mirror(cr,1,ids,args,context=context)
-		return True    
-	
+		return True
+
 	def action_move_line_create_mirror(self, cr, uid, ids,args, context=None):
 		def _get_payment_term_lines(term_id, amount):
 			term_pool = self.pool.get('account.payment.term')
@@ -235,19 +236,19 @@
 		currency_pool = self.pool.get('res.currency')
 		tax_obj = self.pool.get('account.tax')
 		seq_obj = self.pool.get('ir.sequence')
-		
+
 		for inv in self.browse(cr, uid, ids, context=context):
-			debug("DENTRO DEL FOR")
+			#debug("DENTRO DEL FOR")
 			mirror_journal_id = args.get('journal',False)
 			mirror_account_id = args.get('account',False)
 			period_id = args.get('period',False)
 			partner_id = args.get('partner',False)
-			
+
 			#if inv.move_id:
 			#	continue
 			context_multi_currency = context.copy()
 			context_multi_currency.update({'date': inv.date})
-			
+
 			if inv.number:
 				name = inv.number
 			elif mirror_journal_id.sequence_id:
@@ -268,7 +269,7 @@
 				'period_id': period_id and period_id.id or (inv.period_id and inv.period_id.id or False)
 			}
 			move_id = move_pool.create(cr, uid, move)
-			
+
 			#create the first line manually
 			company_currency = mirror_journal_id and mirror_journal_id.company_id.currency_id.id or inv.journal_id.company_id.currency_id.id
 			current_currency = mirror_journal_id and mirror_journal_id.currency.id or inv.currency_id.id
@@ -287,7 +288,7 @@
 				debit = -credit
 				credit = 0.0
 			sign = debit - credit < 0 and -1 or 1
-			
+
 			#create the first line of the voucher
 			move_line = {
 				'name': inv.name or '/',
@@ -304,24 +305,24 @@
 				'date': inv.date,
 				'date_maturity': inv.date_due
 			}
-			debug(move_line)
+			#debug(move_line)
 			move_line_id = move_line_pool.create(cr, uid, move_line)
 			rec_list_ids = []
 			line_total = debit - credit
-			debug(line_total)
+			#debug(line_total)
 			if inv.type == 'sale':
 				line_total = line_total - currency_pool.compute(cr, uid, inv.currency_id.id, company_currency, inv.tax_amount, context=context_multi_currency)
 			elif inv.type == 'purchase':
 				line_total = line_total + currency_pool.compute(cr, uid, inv.currency_id.id, company_currency, inv.tax_amount, context=context_multi_currency)
 
-			debug(inv.line_ids)
-			debug(line_total)
+			#debug(inv.line_ids)
+			#debug(line_total)
 			for line in inv.line_ids:
-				debug("for de los lines")
-				debug(line.amount)
-				debug(line.amount_unreconciled)
-				debug(line.untax_amount)
-				debug("for de los lines")
+				#debug("for de los lines")
+				#debug(line.amount)
+				#debug(line.amount_unreconciled)
+				#debug(line.untax_amount)
+				#debug("for de los lines")
 				#create one move line per voucher line where amount is not 0.0
 				if not line.amount:
 					continue
@@ -330,7 +331,7 @@
 					amount = line.amount #residual amount in company currency
 				else:
 					amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.amount or line.untax_amount, context=context_multi_currency)
-				
+
 				move_line = {
 					'journal_id': mirror_journal_id and mirror_journal_id.id or inv.journal_id.id,
 					'period_id': period_id and period_id.id or inv.period_id.id,
@@ -345,8 +346,8 @@
 					'debit': 0.0,
 					'date': inv.date
 				}
-				debug(line.amount)
-				debug(amount)
+				#debug(line.amount)
+				#debug(amount)
 				debug(line.move_line_id.amount_residual)
 				if amount < 0:
 					amount = -amount
@@ -356,16 +357,16 @@
 						line.type = 'dr'
 
 				if (line.type=='dr'):
-					debug("DEBITO")
-					debug(line_total)
-					debug(amount)
+					#debug("DEBITO")
+					#debug(line_total)
+					#debug(amount)
 					line_total += amount
 					move_line['debit'] = amount
 					move_line['account_id'] = mirror_journal_id.default_debit_account_id.id
 				else:
-					debug("CREDITO")
-					debug(line_total)
-					debug(amount)
+					#debug("CREDITO")
+					#debug(line_total)
+					#debug(amount)
 					line_total -= amount
 					move_line['credit'] = amount
 					move_line['account_id'] = mirror_account_id.id
@@ -379,8 +380,8 @@
 				#	if not (tax_data.base_code_id and tax_data.tax_code_id):
 				#		raise osv.except_osv(_('No Account Base Code and Account Tax Code!'),_("You have to configure account base code and account tax code on the '%s' tax!") % (tax_data.name))
 				#sign = (move_line['debit'] - move_line['credit']) < 0 and -1 or 1
-				debug(move_line)
-				debug(line.type)
+				#debug(move_line)
+				#debug(line.type)
 				move_line['amount_currency'] = company_currency <> current_currency and sign * line.amount or 0.0
 				if move_line['debit'] == 0 and move_line['credit'] == 0:
 					continue
@@ -411,11 +412,11 @@
 					#'amount_currency': company_currency <> current_currency and currency_pool.compute(cr, uid, company_currency, current_currency, diff * -1, context=context_multi_currency) or 0.0,
 					#'currency_id': company_currency <> current_currency and current_currency or False,
 				}
-				debug(move_line)
+				#debug(move_line)
 				move_line_pool.create(cr, uid, move_line)
-			debug("LLEGO AL POST")
+			#debug("LLEGO AL POST")
 			move_pool.post(cr, uid, [move_id], context={})
-		return True    
+		return True
 account_voucher_journal_payment()
 
 class account_voucher_line(osv.osv):

=== modified file 'account_voucher_payment_method/account_voucher_payment_method.xml'
--- TODO-6.1/account_voucher_payment_method/account_voucher_payment_method.xml	2011-12-19 17:25:45 +0000
+++ account_voucher_payment_method/account_voucher_payment_method.xml	2012-03-17 22:11:21 +0000
@@ -10,12 +10,13 @@
 			<field name="type">form</field>
 			<field name="arch" type="xml">
 				<data>
-					<field name="journal_id" position="replace">
+					<field name="journal_id" position="replace"> 
 						<field name="journal_id"
-								domain="[('payment_method','=','True')]"
-								widget="selection" select="1"
-								on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)"
-								string="Payment Method"/>
+                            domain="[('payment_method_customer','=','True')]"
+                            invisible="context.get('line_type', False)"
+                            widget="selection" select="1"
+                            on_change="onchange_journal(journal_id, line_cr_ids, False, partner_id, date, amount, type, company_id, context)"
+                            string="Payment Method"/>
 					</field>
 				</data>
 			</field>
@@ -28,12 +29,13 @@
 			<field name="type">form</field>
 			<field name="arch" type="xml">
 				<data>
-					<field name="journal_id" position="replace">
+					<field name="journal_id" position="replace"> 
 						<field name="journal_id"
-							domain="[('payment_method','=','True')]"
-							widget="selection" select="1"
-							on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)"
-							string="Payment Method"/>
+                            domain="[('payment_method_supplier','=','True')]"
+                            invisible="context.get('line_type', False)"
+                            widget="selection" select="1"
+                            on_change="onchange_journal(journal_id, line_cr_ids, False, partner_id, date, amount, type, company_id, context)"
+                            string="Payment Method"/>
 					</field>
 				</data>
 			</field>
@@ -43,7 +45,7 @@
 			<field name="name">Customer Payment</field>
 			<field name="res_model">account.voucher</field>
 			<field name="view_type">form</field>
-			<field name="domain">[('journal_id.payment_method', '=', 'True'), ('type','=','receipt')]</field>
+			<field name="domain">[('journal_id.payment_method_customer', '=', 'True'), ('type','=','receipt')]</field>
 			<field name="context">{'type' : 'receipt','payment_method':'True'}</field>
 			<field name="view_id" eval="False"/>
 			<field name="search_view_id" ref="account_voucher.view_voucher_filter_vendor_pay"/>
@@ -71,7 +73,7 @@
 			<field name="name">Supplier Payment</field>
 			<field name="res_model">account.voucher</field>
 			<field name="view_type">form</field>
-			<field name="domain">[('journal_id.payment_method', '=', 'True'), ('type','=','payment')]</field>
+			<field name="domain">[('journal_id.payment_method_supplier', '=', 'True'), ('type','=','payment')]</field>
 			<field name="context">{'type':'payment','payment_method':'True'}</field>
 			<field name="view_id" eval="False"/>
 			<field name="search_view_id" ref="account_voucher.view_voucher_filter_vendor_pay"/>
@@ -154,7 +156,9 @@
 					<field name = "type" position = "after">
 						<group colspan = "2" col = "4">
 							<separator string = "Payment Options"/>
-							<field name = "payment_method"/>
+                            <newline/>
+                            <field name = "payment_method_customer"/>
+							<field name = "payment_method_supplier"/>
 							<field name = "payment_verification"/>
 						</group>
 					</field>


Follow ups