Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- ##############################################################################
- # gcoop
- ##############################################################################
- from osv import fields,osv
- from tools.translate import _
- class gcoop_example(osv.osv):
- def _sel_func6(self, cr, uid, context=None):
- return true
- _name = 'gcoop.example'
- _columns = {
- 'tipo': fields.selection([('view','View'), ('normal','Normal')], 'Category Type'),
- 'state': fields.selection([('new','New'),('assigned','Assigned'),
- ('negotiation','Negotiation'),
- ('won','Won'),
- ('lost','Lost')
- ], 'Stage', readonly=True),
- 'field_1': fields.char('Field_1', size=20),
- 'field_2': fields.char('Field_2', size=16),
- 'field_2': fields.text('Observaciones'),
- 'manuf_warranty': fields.boolean('Manufacturer warranty?'),
- }
- _defaults = {
- 'state': 'new',
- }
- def gcoop_new(self, cr, uid, ids):
- self.write(cr, uid, ids, { 'state' : 'new' })
- return True
- def gcoop_assigned(self, cr, uid, ids):
- self.write(cr, uid, ids, { 'state' : 'assigned' })
- return True
- def gcoop_negotiation(self, cr, uid, ids):
- self.write(cr, uid, ids, { 'state' : 'negotiation' })
- return True
- def gcoop_won(self, cr, uid, ids):
- self.write(cr, uid, ids, { 'state' : 'won' })
- return True
- def gcoop_lost(self, cr, uid, ids):
- self.write(cr, uid, ids, { 'state' : 'lost' })
- return True
- gcoop_example()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement