help="Set to one if survey is answerable only once"),
'response_user': fields.integer('Maximum Answer per User',
help="Set to one if you require only one Answer per user"),
- 'state': fields.selection([('draft', 'Draft'), ('open', 'Open'), ('close', 'Closed'), ('cancel', 'Cancelled')], 'Status', readonly=True),
+ 'state': fields.selection([('open', 'Open'), ('close', 'Closed'), ('cancel', 'Cancelled')], 'Status', readonly=True),
'responsible_id': fields.many2one('res.users', 'Responsible', help="User responsible for survey"),
'tot_start_survey': fields.integer("Total Started Survey", readonly=1),
'tot_comp_survey': fields.integer("Total Completed Survey", readonly=1),
'invited_user_ids': fields.many2many('res.users', 'survey_invited_user_rel', 'sid', 'uid', 'Invited User'),
}
_defaults = {
- 'state': lambda * a: "draft",
+ 'state': lambda * a: "open",
'tot_start_survey': lambda * a: 0,
'tot_comp_survey': lambda * a: 0,
'send_response': lambda * a: 1,
'response_user': lambda * a:1,
}
- def survey_draft(self, cr, uid, ids, arg):
- self.write(cr, uid, ids, {'state': 'draft'})
- return True
-
def survey_open(self, cr, uid, ids, arg):
self.write(cr, uid, ids, {'state': 'open', 'date_open': strftime("%Y-%m-%d %H:%M:%S")})
return True
</form>
</field>
<group col="9" colspan="4">
- <field name="state"/>
+ <field name="state" widget="statusbar" statusbar_visible="open,close"/>
<button name="survey_cancel"
string="Cancel" states="open" type="object" icon="gtk-cancel"/>
- <button name="survey_draft"
- string="Set to draft" states="cancel,close" type="object"
- icon="gtk-new"/>
- <button name="survey_open" string="Open"
- states="draft" type="object" icon="gtk-go-forward"/>
+ <button name="survey_open"
+ string="Open" states="cancel,close" type="object"
+ icon="gtk-go-forward"/>
<button name="survey_close"
string="Close" states="open" type="object" icon="gtk-close"/>
</group>