Odoo Help

Welcome!

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.

0

openerp checkbox onchange should effect remaining check box

By
omkar
on 1/28/14, 3:00 AM 2,860 views

Hi.

I want to inherit a class , that class should inherit a checkbox into another class and by default that checkbox was checked. and it should make remaining check boxes un check which are checked only. If the inherited checkbox was unchecked they it should again want to make the previous changes.

Can you please help me with this...

0
omkar
On 1/28/14, 5:51 AM

Hi shashank verma.

Thanks for your response.

I tried that I created a new module and Inherited my new code to the existing module.

Now I am facing one more issue XML error.

Below is the Error:

2014-01-28 08:49:32,732 7202 ERROR del openerp.osv.orm: Can't find field 'reconcile_id' in the following view parts composing the view of object model 'account.voucher': * account.voucher.receipt.form

Either you wrongly customized this view, or some modules bringing those views are not compatible with your current data model 2014-01-28 08:49:32,732 7202 ERROR del openerp.netsvc: View error Can't find field 'reconcile_id' in the following view parts composing the view of object model 'account.voucher': * account.voucher.receipt.form

Either you wrongly customized this view, or some modules bringing those views are not compatible with your current data model Traceback (most recent call last): File "/home/excedo/7/server/openerp/netsvc.py", line 292, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "/home/excedo/7/server/openerp/service/web_services.py", line 626, in dispatch res = fn(db, uid, params) File "/home/excedo/7/server/openerp/osv/osv.py", line 191, in execute_kw return self.execute(db, uid, obj, method, *args, *kw or {}) File "/home/excedo/7/server/openerp/osv/osv.py", line 132, in wrapper return f(self, dbname, args, *kwargs) File "/home/excedo/7/server/openerp/osv/osv.py", line 200, in execute res = self.execute_cr(cr, uid, obj, method, args, *kw) File "/home/excedo/7/server/openerp/osv/osv.py", line 187, in execute_cr return getattr(object, method)(cr, uid, args, *kw) File "/home/excedo/7/addons/account_voucher/account_voucher.py", line 223, in fields_view_get res = super(account_voucher, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu) File "/home/excedo/7/server/openerp/osv/orm.py", line 2277, in fields_view_get xarch, xfields = self.__view_look_dom_arch(cr, user, result['arch'], view_id, context=ctx) File "/home/excedo/7/server/openerp/osv/orm.py", line 1930, in __view_look_dom_arch fields_def = self.__view_look_dom(cr, user, node, view_id, False, fields, context=context) File "/home/excedo/7/server/openerp/osv/orm.py", line 1876, in __view_look_dom fields.update(self.__view_look_dom(cr, user, f, view_id, in_tree_view, model_fields, context)) File "/home/excedo/7/server/openerp/osv/orm.py", line 1876, in __view_look_dom fields.update(self.__view_look_dom(cr, user, f, view_id, in_tree_view, model_fields, context)) File "/home/excedo/7/server/openerp/osv/orm.py", line 1876, in __view_look_dom fields.update(self.__view_look_dom(cr, user, f, view_id, in_tree_view, model_fields, context)) File "/home/excedo/7/server/openerp/osv/orm.py", line 1876, in __view_look_dom fields.update(self.__view_look_dom(cr, user, f, view_id, in_tree_view, model_fields, context)) File "/home/excedo/7/server/openerp/osv/orm.py", line 1793, in __view_look_dom xarch, xfields = relation.__view_look_dom_arch(cr, user, f, view_id, ctx) File "/home/excedo/7/server/openerp/osv/orm.py", line 1954, in __view_look_dom_arch raise except_orm('View error', msg) except_osv: ('View error', u"Can't find field 'reconcile_id' in the following view parts composing the view of object model 'account.voucher':\n * account.voucher.receipt.form\n\nEither you wrongly customized this view, or some modules bringing those views are not compatible with your current data model")

What I did is described below.

1). Added a module.

2). Created a class and inherited the parent module.

3). on the Existing XML which belongs to parent class I added my line and try to inherit then by clicking the menu these error raises.

These are the steps I done.. Please help me in finding these...

did u specify parent module name in openerp.py file

and make sure u properly inheriting using xpath. your field is missing that's why it throws such error.

shashank verma
on 1/28/14, 8:26 AM

Hi Shanshank Verma. I don't know how to inherit this module to parent module. As you had written I had written the module to inherit the details , but I had written them in a module and I want to inherit this child module to parent module. Can you explain how I can do this . I am new to openERP.

omkar
on 1/28/14, 8:27 AM

I would suggest you o go through openerp inheritance document . this will give u better idea to use inheritance concepts. I hope this will help you.

https://doc.openerp.com/v6.0/developer/1_2_module_development/3_Inheritance/

https://doc.openerp.com/v6.0/developer/2_6_views_events/views/view_inheritence/

shashank verma
on 1/29/14, 5:27 AM
0
shashank verma
On 1/28/14, 4:10 AM

Hello Omkar

py file

class abc_abc(osv_osv):

columns={

mycheck1:field.boolean(check1)

mycheck2:field.boolean(check2)

} _defaults = { mycheck1:True }

class def_def(osv_osv):

_inherit='abc.abc'

def myonchange(self,cr,uid,ids,mycheck1,context=None):

   vals={}
   if mycheck1==True:

      vals.update({'mycheck2':false})
else:
       vals.update({'mycheck1':True})


   return {'value':vals}

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

0 follower(s)

Stats

Asked: 1/28/14, 3:00 AM
Seen: 2860 times
Last updated: 3/16/15, 8:10 AM