[REF]: Removed _links_get and AVAILABLE_PRIORITY from all files and added import crm.

bzr revid: uco@tinyerp.co.in-20100113133409-ay3y74ys5n3qo5s0
This commit is contained in:
uco (OpenERP)
2010-01-13 19:04:09 +05:30
parent cc867794cb
commit baf8f06d9c
9 changed files with 34 additions and 137 deletions
+4 -17
View File
@@ -25,20 +25,7 @@ import os
import pooler
import netsvc
from tools.translate import _
AVAILABLE_PRIORITIES = [
('5','Lowest'),
('4','Low'),
('3','Normal'),
('2','High'),
('1','Highest')
]
def _links_get(self, cr, uid, context={}):
obj = self.pool.get('res.request.link')
ids = obj.search(cr, uid, [])
res = obj.read(cr, uid, ids, ['object', 'name'], context)
return [(r['object'], r['name']) for r in res]
import crm
class crm_claim_categ(osv.osv):
_name = "crm.claim.categ"
@@ -86,8 +73,8 @@ class crm_claim(osv.osv):
_inherit = 'crm.case'
_columns = {
'date_closed': fields.datetime('Closed', readonly=True),
'ref' : fields.reference('Reference', selection=_links_get, size=128),
'ref2' : fields.reference('Reference 2', selection=_links_get, size=128),
'ref' : fields.reference('Reference', selection=crm._links_get, size=128),
'ref2' : fields.reference('Reference 2', selection=crm._links_get, size=128),
'canal_id': fields.many2one('res.partner.canal', 'Channel',help="The channels represent the different communication modes available with the customer." \
" With each commercial opportunity, you can indicate the canall which is this opportunity source."),
'planned_revenue': fields.float('Planned Revenue'),
@@ -96,7 +83,7 @@ class crm_claim(osv.osv):
"the partner mentality in relation to our services.The scale has" \
"to be created with a factor for each level from 0 (Very dissatisfied) to 10 (Extremely satisfied)."),
'categ_id': fields.many2one('crm.claim.categ','Category', domain="[('section_id','=',section_id)]"),
'priority': fields.selection(AVAILABLE_PRIORITIES, 'Priority'),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
'type_id': fields.many2one('crm.claim.type', 'Claim Type', domain="[('section_id','=',section_id)]"),
'partner_name': fields.char("Employee's Name", size=64),
+4 -16
View File
@@ -32,19 +32,7 @@ import tools
from osv import fields,osv,orm
from osv.orm import except_orm
AVAILABLE_PRIORITIES = [
('5','Lowest'),
('4','Low'),
('3','Normal'),
('2','High'),
('1','Highest')
]
def _links_get(self, cr, uid, context={}):
obj = self.pool.get('res.request.link')
ids = obj.search(cr, uid, [])
res = obj.read(cr, uid, ids, ['object', 'name'], context)
return [(r['object'], r['name']) for r in res]
import crm
class crm_fundraising_categ(osv.osv):
_name = "crm.fundraising.categ"
@@ -93,7 +81,7 @@ class crm_fundraising(osv.osv):
_inherit ='crm.case'
_columns = {
'date_closed': fields.datetime('Closed', readonly=True),
'priority': fields.selection(AVAILABLE_PRIORITIES, 'Priority'),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
'categ_id': fields.many2one('crm.fundraising.categ','Category', domain="[('section_id','=',section_id)]"),
'planned_revenue': fields.float('Planned Revenue'),
'planned_cost': fields.float('Planned Costs'),
@@ -105,8 +93,8 @@ class crm_fundraising(osv.osv):
'stage_id': fields.many2one ('crm.fundraising.stage', 'Stage', domain="[('section_id','=',section_id)]"),
'type_id': fields.many2one('crm.fundraising.type', 'Fundraising Type', domain="[('section_id','=',section_id)]"),
'duration': fields.float('Duration'),
'ref' : fields.reference('Reference', selection=_links_get, size=128),
'ref2' : fields.reference('Reference 2', selection=_links_get, size=128),
'ref' : fields.reference('Reference', selection=crm._links_get, size=128),
'ref2' : fields.reference('Reference 2', selection=crm._links_get, size=128),
'canal_id': fields.many2one('res.partner.canal', 'Channel',help="The channels represent the different communication modes available with the customer." \
" With each commercial opportunity, you can indicate the canall which is this opportunity source."),
'som': fields.many2one('res.partner.som', 'State of Mind', help="The minds states allow to define a value scale which represents" \
+4 -16
View File
@@ -32,19 +32,7 @@ import tools
from osv import fields,osv,orm
from osv.orm import except_orm
AVAILABLE_PRIORITIES = [
('5','Lowest'),
('4','Low'),
('3','Normal'),
('2','High'),
('1','Highest')
]
def _links_get(self, cr, uid, context={}):
obj = self.pool.get('res.request.link')
ids = obj.search(cr, uid, [])
res = obj.read(cr, uid, ids, ['object', 'name'], context)
return [(r['object'], r['name']) for r in res]
import crm
class crm_helpdesk_categ(osv.osv):
_name = "crm.helpdesk.categ"
@@ -66,13 +54,13 @@ class crm_helpdesk(osv.osv):
_inherit = 'crm.case'
_columns = {
'date_closed': fields.datetime('Closed', readonly=True),
'ref' : fields.reference('Reference', selection=_links_get, size=128),
'ref2' : fields.reference('Reference 2', selection=_links_get, size=128),
'ref' : fields.reference('Reference', selection=crm._links_get, size=128),
'ref2' : fields.reference('Reference 2', selection=crm._links_get, size=128),
'canal_id': fields.many2one('res.partner.canal', 'Channel',help="The channels represent the different communication modes available with the customer." \
" With each commercial opportunity, you can indicate the canall which is this opportunity source."),
'planned_revenue': fields.float('Planned Revenue'),
'planned_cost': fields.float('Planned Costs'),
'priority': fields.selection(AVAILABLE_PRIORITIES, 'Priority'),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
'probability': fields.float('Probability (%)'),
'som': fields.many2one('res.partner.som', 'State of Mind', help="The minds states allow to define a value scale which represents" \
"the partner mentality in relation to our services.The scale has" \
+4 -16
View File
@@ -32,19 +32,7 @@ import tools
from osv import fields,osv,orm
from osv.orm import except_orm
AVAILABLE_PRIORITIES = [
('5','Lowest'),
('4','Low'),
('3','Normal'),
('2','High'),
('1','Highest')
]
def _links_get(self, cr, uid, context={}):
obj = self.pool.get('res.request.link')
ids = obj.search(cr, uid, [])
res = obj.read(cr, uid, ids, ['object', 'name'], context)
return [(r['object'], r['name']) for r in res]
import crm
class crm_lead_categ(osv.osv):
_name = "crm.lead.categ"
@@ -99,11 +87,11 @@ class crm_lead(osv.osv):
'partner_name2': fields.char('Employee Email', size=64),
'partner_phone': fields.char('Phone', size=32),
'partner_mobile': fields.char('Mobile', size=32),
'priority': fields.selection(AVAILABLE_PRIORITIES, 'Priority'),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
'probability': fields.float('Probability (%)'),
'date_closed': fields.datetime('Closed', readonly=True),
'ref' : fields.reference('Reference', selection=_links_get, size=128),
'ref2' : fields.reference('Reference 2', selection=_links_get, size=128),
'ref' : fields.reference('Reference', selection=crm._links_get, size=128),
'ref2' : fields.reference('Reference 2', selection=crm._links_get, size=128),
'canal_id': fields.many2one('res.partner.canal', 'Channel',help="The channels represent the different communication modes available with the customer." \
" With each commercial opportunity, you can indicate the canall which is this opportunity source."),
'planned_revenue': fields.float('Planned Revenue'),
+4 -16
View File
@@ -32,19 +32,7 @@ import tools
from osv import fields,osv,orm
from osv.orm import except_orm
AVAILABLE_PRIORITIES = [
('5','Lowest'),
('4','Low'),
('3','Normal'),
('2','High'),
('1','Highest')
]
def _links_get(self, cr, uid, context={}):
obj = self.pool.get('res.request.link')
ids = obj.search(cr, uid, [])
res = obj.read(cr, uid, ids, ['object', 'name'], context)
return [(r['object'], r['name']) for r in res]
import crm
class crm_opportunity_categ(osv.osv):
_name = "crm.opportunity.categ"
@@ -93,7 +81,7 @@ class crm_opportunity(osv.osv):
'stage_id': fields.many2one ('crm.opportunity.stage', 'Stage', domain="[('section_id','=',section_id)]"),
'categ_id': fields.many2one('crm.opportunity.categ', 'Category', domain="[('section_id','=',section_id)]"),
'type_id': fields.many2one('crm.opportunity.type', 'Opportunity Type', domain="[('section_id','=',section_id)]"),
'priority': fields.selection(AVAILABLE_PRIORITIES, 'Priority'),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
'probability': fields.float('Probability (%)'),
'planned_revenue': fields.float('Planned Revenue'),
'planned_cost': fields.float('Planned Costs'),
@@ -102,8 +90,8 @@ class crm_opportunity(osv.osv):
'som': fields.many2one('res.partner.som', 'State of Mind', help="The minds states allow to define a value scale which represents" \
"the partner mentality in relation to our services.The scale has" \
"to be created with a factor for each level from 0 (Very dissatisfied) to 10 (Extremely satisfied)."),
'ref' : fields.reference('Reference', selection=_links_get, size=128),
'ref2' : fields.reference('Reference 2', selection=_links_get, size=128),
'ref' : fields.reference('Reference', selection=crm._links_get, size=128),
'ref2' : fields.reference('Reference 2', selection=crm._links_get, size=128),
'date_closed': fields.datetime('Closed', readonly=True),
'phonecall_id':fields.many2one ('crm.phonecall', 'Phonecall'),
}
+2 -8
View File
@@ -30,13 +30,7 @@ import tools
from tools.translate import _
AVAILABLE_PRIORITIES = [
('5','Lowest'),
('4','Low'),
('3','Normal'),
('2','High'),
('1','Highest')
]
import crm
class crm_phonecall_categ(osv.osv):
_name = "crm.phonecall.categ"
@@ -79,7 +73,7 @@ class crm_phonecall(osv.osv):
'som': fields.many2one('res.partner.som', 'State of Mind', help="The minds states allow to define a value scale which represents" \
"the partner mentality in relation to our services.The scale has" \
"to be created with a factor for each level from 0 (Very dissatisfied) to 10 (Extremely satisfied)."),
'priority': fields.selection(AVAILABLE_PRIORITIES, 'Priority'),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
'canal_id': fields.many2one('res.partner.canal', 'Channel',help="The channels represent the different communication modes available with the customer." \
" With each commercial opportunity, you can indicate the canall which is this opportunity source."),
'probability': fields.float('Probability (%)'),
+4 -16
View File
@@ -32,19 +32,7 @@ import tools
from osv import fields,osv,orm
from osv.orm import except_orm
AVAILABLE_PRIORITIES = [
('5','Lowest'),
('4','Low'),
('3','Normal'),
('2','High'),
('1','Highest')
]
def _links_get(self, cr, uid, context={}):
obj = self.pool.get('res.request.link')
ids = obj.search(cr, uid, [])
res = obj.read(cr, uid, ids, ['object', 'name'], context)
return [(r['object'], r['name']) for r in res]
import crm
class crm_job_categ(osv.osv):
_name = "crm.job.categ"
@@ -91,7 +79,7 @@ class crm_job(osv.osv):
_inherit ='crm.case'
_columns = {
'date_closed': fields.datetime('Closed', readonly=True),
'priority': fields.selection(AVAILABLE_PRIORITIES, 'Priority'),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
'categ_id': fields.many2one('crm.job.categ', 'Category', domain="[('section_id','=',section_id)]"),
'planned_revenue': fields.float('Planned Revenue'),
'planned_cost': fields.float('Planned Costs'),
@@ -104,8 +92,8 @@ class crm_job(osv.osv):
'type_id': fields.many2one('crm.job.type', 'Type Name', domain="[('section_id','=',section_id)]"),
'duration': fields.float('Duration'),
'case_id': fields.many2one('crm.case', 'Related Case'),
'ref' : fields.reference('Reference', selection=_links_get, size=128),
'ref2' : fields.reference('Reference 2', selection=_links_get, size=128),
'ref' : fields.reference('Reference', selection=crm._links_get, size=128),
'ref2' : fields.reference('Reference 2', selection=crm._links_get, size=128),
'canal_id': fields.many2one('res.partner.canal', 'Channel',help="The channels represent the different communication modes available with the customer." \
" With each commercial opportunity, you can indicate the canall which is this opportunity source."),
'som': fields.many2one('res.partner.som', 'State of Mind', help="The minds states allow to define a value scale which represents" \
+4 -16
View File
@@ -32,19 +32,7 @@ import tools
from osv import fields,osv,orm
from osv.orm import except_orm
AVAILABLE_PRIORITIES = [
('5','Lowest'),
('4','Low'),
('3','Normal'),
('2','High'),
('1','Highest')
]
def _links_get(self, cr, uid, context={}):
obj = self.pool.get('res.request.link')
ids = obj.search(cr, uid, [])
res = obj.read(cr, uid, ids, ['object', 'name'], context)
return [(r['object'], r['name']) for r in res]
import crm
class crm_bug_categ(osv.osv):
_name = "crm.bug.categ"
@@ -92,8 +80,8 @@ class crm_project_bug(osv.osv):
_inherit = 'crm.case'
_columns = {
'date_closed': fields.datetime('Closed', readonly=True),
'ref' : fields.reference('Reference', selection=_links_get, size=128),
'ref2' : fields.reference('Reference 2', selection=_links_get, size=128),
'ref' : fields.reference('Reference', selection=crm._links_get, size=128),
'ref2' : fields.reference('Reference 2', selection=crm._links_get, size=128),
'canal_id': fields.many2one('res.partner.canal', 'Channel',help="The channels represent the different communication modes available with the customer." \
" With each commercial opportunity, you can indicate the canall which is this opportunity source."),
'planned_revenue': fields.float('Planned Revenue'),
@@ -102,7 +90,7 @@ class crm_project_bug(osv.osv):
"the partner mentality in relation to our services.The scale has" \
"to be created with a factor for each level from 0 (Very dissatisfied) to 10 (Extremely satisfied)."),
'categ_id': fields.many2one('crm.bug.categ','Category', domain="[('section_id','=',section_id)]"),
'priority': fields.selection(AVAILABLE_PRIORITIES, 'Priority'),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
'type_id': fields.many2one('crm.bug.type', 'Bug Type', domain="[('section_id','=',section_id)]"),
'partner_name': fields.char("Employee's Name", size=64),
+4 -16
View File
@@ -32,19 +32,7 @@ import tools
from osv import fields,osv,orm
from osv.orm import except_orm
AVAILABLE_PRIORITIES = [
('5','Lowest'),
('4','Low'),
('3','Normal'),
('2','High'),
('1','Highest')
]
def _links_get(self, cr, uid, context={}):
obj = self.pool.get('res.request.link')
ids = obj.search(cr, uid, [])
res = obj.read(cr, uid, ids, ['object', 'name'], context)
return [(r['object'], r['name']) for r in res]
import crm
class crm_project_future_request(osv.osv):
_name = "crm.project.future"
@@ -53,8 +41,8 @@ class crm_project_future_request(osv.osv):
_inherit = 'crm.case'
_columns = {
'date_closed': fields.datetime('Closed', readonly=True),
'ref' : fields.reference('Reference', selection=_links_get, size=128),
'ref2' : fields.reference('Reference 2', selection=_links_get, size=128),
'ref' : fields.reference('Reference', selection=crm._links_get, size=128),
'ref2' : fields.reference('Reference 2', selection=crm._links_get, size=128),
'canal_id': fields.many2one('res.partner.canal', 'Channel',help="The channels represent the different communication modes available with the customer." \
" With each commercial opportunity, you can indicate the canall which is this opportunity source."),
'planned_revenue': fields.float('Planned Revenue'),
@@ -63,7 +51,7 @@ class crm_project_future_request(osv.osv):
"the partner mentality in relation to our services.The scale has" \
"to be created with a factor for each level from 0 (Very dissatisfied) to 10 (Extremely satisfied)."),
'categ_id': fields.many2one('crm.bug.categ','Category', domain="[('section_id','=',section_id)]"),
'priority': fields.selection(AVAILABLE_PRIORITIES, 'Priority'),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
'type_id': fields.many2one('crm.bug.type', 'Bug Type', domain="[('section_id','=',section_id)]"),
'partner_name': fields.char("Employee's Name", size=64),