Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


How to customize the checks journal process?(odoov8)

on 6/23/15, 6:50 AM 321 views

hello,I'm working on a custom module that allowed me to maintain the checks journals,so what i need is, when i click on the payments method (one2many) on the "Register payment" choose the option "checks journal", other fields , that i create will appears (checks journal options).Is there a way to do that?help please!

this is my code:

<record model="ir.ui.view" id="view_account_voucher_inherit_form">

<field name="name">Accounts.inherit</field>

<field name="model">account.voucher</field>

<field name="inherit_id" ref="account_voucher.view_vendor_receipt_dialog_form"/>

<field name="arch" type="xml">

<xpath expr="//group[@name='journal_id']" position="inside">

<field name="journal_id" domain="[('type','in',['bank', 'cash' , 'bank'])]"

invisible="context.get('line_type', False)" widget="selection"

on_change="onchange_journal1(journal_id, line_cr_ids, False, partner_id, date, amount, type, company_id, context)"

attrs="{'invisible': [('journal_id','!=','bank')]}"/>

<label for="Number_check" attrs="{'invisible': [('journal_id', 'not in', ('bank','cash'))]}"/>

/> </xpath> </field> </record>

and .py :

from openerp.osv import fields, osv

from bsddb.dbtables import _columns

class cheque_cheque(osv.osv):



_columns = {

'num_chk':fields.integer('Num Chèque'),

'bank':fields.char('Nom de Banque',size=100),




def onchange_journal1(self, cr, uid, ids, journal_id, line_ids, tax_id, partner_id, date, amount, ttype, company_id, context=None):

if journal_id == 'bank':

return {'value': {'num_chk':1, 'journal_id':False }}

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 6/23/15, 6:50 AM
Seen: 321 times
Last updated: 6/23/15, 6:56 AM