Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9133053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:25:15+00:00 2026-06-17T08:25:15+00:00

I am having a problem creating a new button to change the state of

  • 0

I am having a problem creating a new button to change the state of a new student.

First I created an XML file:

...
<record model="ir.ui.view" id="student_form">
<field name="name">sim.student.form</field>
<field name="model">sim.student</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Student">
<field name="name"/>
<field name="student_name"/>
<field name="father_name"/>
<field name="gender"/>
<field name="contact_no"/>
<button name="setuju" states="draft" string="Approve" type="object"/>
</form>
</field>
</record>
...

Next I created a Python file:

from osv import fields, osv
import time
import netsvc
import pooler

class sim_student(osv.osv):
    _name = "sim.student"
    _description = "Data Siswa"

    def setuju(self, cr, uid, ids, context=None):
        workflow = netsvc.LocalService('workflow')

        for name in ids:
            workflow.trg_create(uid, self._name, name, cr)

        return self.write(cr, uid, ids, {'state': 'confirmed'}, context=context)

    _columns = {
        'name': fields.char('Registration Number',size=256,required=True),
        'student_name': fields.char('Student Name',size=256,required=True),
        'father_name': fields.char('Father Name',size=256),
        'gender':fields.selection([('male','Male'),('female','Female')],'Gender'),
        'contact_no':fields.char('Contact Number',size=256),
        'state': fields.selection([('new', 'New'), \
                                    ('confirmed', 'Received'), \
                                    ('cancelled', 'Cancelled')], \
                                'Status', readonly=True, select=True)
    }

sim_student()

Then I createe an init.py file :

import sim

Finally I created an openerp.py file :

{
'name': 'Student Information Management',
'version': '0.1',
'category': 'Tools',
'description': """Data Siswa.""",
'author': 'Wasis Lukito',
'summary': 'Test, Test, dan Test',
'website': 'http://wasis.wordpress.com/',
'depends': ['base'],
#'init_xml': [],
#'update_xml': ['sim_view.xml'],
#'demo_xml': [],
#'installable': True,
'data': ['sim_view.xml',],
'css':['static/src/css/lunch.css'],
'demo': [],
'installable': True,
'application' : True,
'certificate' : '001292377792581874189',
'images': [],
}

When I executed the code, however, it produced this error message:

No handler found.

And this is the error from the console:

C:\Program Files\OpenERP 7.0alpha-20121206-000102\Server\server\.\pytz\tzinfo.py
:5: DeprecationWarning: the sets module is deprecated
ERROR: couldn't create the logfile directory. Logging to the standard output.
2013-01-15 15:21:39,977 2136 ←[1;32m←[1;49mINFO←[0m ? openerp: OpenERP version 7
.0alpha-20121206-000102
2013-01-15 15:21:39,994 2136 ←[1;32m←[1;49mINFO←[0m ? openerp: addons paths: C:\
Program Files\OpenERP 7.0alpha-20121206-000102\Server\server\openerp\addons
2013-01-15 15:21:40,023 2136 ←[1;32m←[1;49mINFO←[0m ? openerp: database hostname
: localhost
2013-01-15 15:21:40,039 2136 ←[1;32m←[1;49mINFO←[0m ? openerp: database port: 54
32
2013-01-15 15:21:40,055 2136 ←[1;32m←[1;49mINFO←[0m ? openerp: database user: op
enpg
ERROR: couldn't create the logfile directory. Logging to the standard output.
2013-01-15 15:21:40,799 2136 ←[1;33m←[1;49mWARNING←[0m ? openerp.addons.google_d
ocs.google_docs: Please install latest gdata-python-client from http://code.goog
le.com/p/gdata-python-client/downloads/list
2013-01-15 15:21:41,548 2136 ←[1;37m←[1;41mCRITICAL←[0m ? openerp.modules.module
: Couldn't load module web
2013-01-15 15:21:41,568 2136 ←[1;37m←[1;41mCRITICAL←[0m ? openerp.modules.module
: unexpected indent (sim.py, line 10)
2013-01-15 15:21:41,585 2136 ←[1;31m←[1;49mERROR←[0m ? openerp.service: Failed t
o load server-wide module `web`.
The `web` module is provided by the addons found in the `openerp-web` project.
Maybe you forgot to add those addons in your addons_path configuration.
Traceback (most recent call last):
  File "C:\Program Files\OpenERP 7.0alpha-20121206-000102\Server\server\.\opener
p\service\__init__.py", line 53, in load_server_wide_modules
  File "C:\Program Files\OpenERP 7.0alpha-20121206-000102\Server\server\.\opener
p\modules\module.py", line 414, in load_openerp_module
  File "C:\Program Files\OpenERP 7.0alpha-20121206-000102\Server\server\openerp\
addons\web\http.py", line 593, in wsgi_postload
  File "C:\Program Files\OpenERP 7.0alpha-20121206-000102\Server\server\openerp\
addons\web\http.py", line 482, in __init__
  File "C:\Program Files\OpenERP 7.0alpha-20121206-000102\Server\server\openerp\
addons\web\http.py", line 549, in _load_addons
  File "C:\Program Files\OpenERP 7.0alpha-20121206-000102\Server\server\.\opener
p\modules\module.py", line 133, in load_module
  File "C:\Program Files\OpenERP 7.0alpha-20121206-000102\Server\server\openerp\
addons\sim\__init__.py", line 1, in <module>
  File "C:\Program Files\OpenERP 7.0alpha-20121206-000102\Server\server\openerp\
addons\sim\sim.py", line 10
     def setuju(self, cr, uid, ids, context=None):
    ^
 IndentationError: unexpected indent
2013-01-15 15:21:41,849 2136 ←[1;32m←[1;49mINFO←[0m ? openerp.service.netrpc_ser
ver: starting NET-RPC service on 0.0.0.0:8070
2013-01-15 15:21:41,877 2136 ←[1;32m←[1;49mINFO←[0m ? openerp.netsvc: Starting 1
 services
2013-01-15 15:21:41,897 2136 ←[1;32m←[1;49mINFO←[0m ? openerp: OpenERP server is
 running, waiting for connections...
2013-01-15 15:21:41,913 2136 ←[1;32m←[1;49mINFO←[0m ? openerp.service.wsgi_serve
r: HTTP service (werkzeug) running on 0.0.0.0:8069

The error seems to come from “def setuju(…”. What is wrong with my script?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:25:16+00:00Added an answer on June 17, 2026 at 8:25 am

    Please remove the key ‘certificate’ from the openerp file If your module doens’t have a certificate. Also please remove the workflow from the setuju() function. I dont see a workflow defined for your class.

    From the log the error is because indentation error. Please check you have correct number of spaces before def setuju()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having a problem creating a new/edit user form in symfony 2 +
I'm having a problem when running my PHPUnit test of creating a new profile,
I am having a problem creating a WCF service instance with a parameter. The
I've been having a problem creating a checklist in the style of the TouchCells
i am having problem in creating a video player in flash via as3, the
I'm having a problem creating a trigger on a database for a project I've
I am having a problem with creating a navigation controller after on the other
Having a bit of a problem creating an instance of an object. Bear in
I am creating an menu and having problem to access the element to hide
I'm creating shopping cart and I'm having one problem: When someone orders an item

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.