How do i create a configuration screen for a module in openerp 6.0, the configuration will have a few fields but there can be only one record in the database for the config.
How do i accomplish it in openerp-6
How do i create a configuration screen for a module in openerp 6.0, the configuration will have a few fields but there can be only one record in the database for the config.
How do i accomplish it in openerp-6
To accomplish only one record in the for the table is little bit tricky. but we can do it by over ridding the create method. here is my sudo code.
def create(self, cr, uid, vals, context=None):
records = self.search(cr, uid, [])
for id in records:
self.unlink(cr, uid, id, context)
return super("CLASS_NAME", self).create(cr, uid, vals, context=context)
Hope it will help.
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up| Related Posts | Replies | Views | Activity | |
|---|---|---|---|---|
|
2
Apr 24
|
6108 | |||
|
0
Mar 15
|
8622 | |||
|
1
Mar 15
|
8380 | |||
|
2
Mar 24
|
11680 | |||
|
2
May 23
|
14418 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.