[FIX] crm: Field 'categ_id' does not exist on browse

bzr revid: rgaopenerp-20121003133320-pmkxe7i9iq4q71z8
This commit is contained in:
RGA(OpenERP) 2012-10-03 19:03:20 +05:30
parent 98e4bac082
commit 8e2e69976a
2 changed files with 4 additions and 5 deletions

View File

@ -397,9 +397,8 @@ the rule to mark CC(mail to any other person defined in actions)."),
obj.state = action.act_state
write['state'] = action.act_state
if hasattr(obj, 'categ_id') and action.act_categ_id:
obj.categ_id = action.act_categ_id
write['categ_id'] = action.act_categ_id.id
if hasattr(obj, 'categ_ids') and action.act_categ_id:
write['categ_ids'] = [4, 0, action.act_categ_id.id]
model_obj.write(cr, uid, [obj.id], write, context)

View File

@ -57,8 +57,8 @@ class base_action_rule(osv.osv):
if hasattr(obj, 'section_id'):
ok = ok and (not action.trg_section_id or action.trg_section_id.id == obj.section_id.id)
if hasattr(obj, 'categ_id'):
ok = ok and (not action.trg_categ_id or action.trg_categ_id.id == obj.categ_id.id)
if hasattr(obj, 'categ_ids'):
ok = ok and (not action.trg_categ_id or action.trg_categ_id.id in obj.categ_ids)
#Cheking for history
regex = action.regex_history