summaryrefslogtreecommitdiff
path: root/addons/crm_profiling/crm_profiling.py
diff options
context:
space:
mode:
authorRaphael Collet <rco@openerp.com>2014-07-06 16:44:26 +0200
committerAntony Lesuisse <al@openerp.com>2014-07-06 17:05:41 +0200
commitcbe2dbb672a6c55d86f2e515f9d1cdfee426ef80 (patch)
treed6ff62b719fce32392397783c961b734b1e4c50e /addons/crm_profiling/crm_profiling.py
parentd78192c489d3be66cd6487b39f5ce7ba4733a187 (diff)
[MERGE] new v8 api by rco
A squashed merge is required as the conversion of the apiculture branch from bzr to git was not correctly done. The git history contains irrelevant blobs and commits. This branch brings a lot of changes and fixes, too many to list exhaustively. - New orm api, objects are now used instead of ids - Environements to encapsulates cr uid context while maintaining backward compatibility - Field compute attribute is a new object oriented way to define function fields - Shared browse record cache - New onchange protocol - Optional copy flag on fields - Documentation update - Dead code cleanup - Lots of fixes
Diffstat (limited to 'addons/crm_profiling/crm_profiling.py')
-rw-r--r--addons/crm_profiling/crm_profiling.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/crm_profiling/crm_profiling.py b/addons/crm_profiling/crm_profiling.py
index 5b1af306b5f..a8866e7639f 100644
--- a/addons/crm_profiling/crm_profiling.py
+++ b/addons/crm_profiling/crm_profiling.py
@@ -147,7 +147,7 @@ class question(osv.osv):
_columns={
'name': fields.char("Question", required=True),
- 'answers_ids': fields.one2many("crm_profiling.answer","question_id","Avalaible Answers",),
+ 'answers_ids': fields.one2many("crm_profiling.answer", "question_id", "Available Answers", copy=True),
}
@@ -209,6 +209,7 @@ class partner(osv.osv):
if 'answers_ids' in vals:
vals['category_id']=[[6, 0, _recompute_categ(self, cr, uid, ids[0], vals['answers_ids'][0][2])]]
+
return super(partner, self).write(cr, uid, ids, vals, context=context)
@@ -248,6 +249,7 @@ class crm_segmentation(osv.osv):
if categ['exclusif']:
cr.execute('delete from res_partner_res_partner_category_rel where \
category_id=%s', (categ['categ_id'][0],))
+ partner_obj.invalidate_cache(cr, uid, ['category_id'])
id = categ['id']
@@ -281,6 +283,7 @@ class crm_segmentation(osv.osv):
category_ids = [categ_id.id for categ_id in partner.category_id]
if categ['categ_id'][0] not in category_ids:
cr.execute('insert into res_partner_res_partner_category_rel (category_id,partner_id) values (%s,%s)', (categ['categ_id'][0],partner.id))
+ partner_obj.invalidate_cache(cr, uid, ['category_id'], [partner.id])
self.write(cr, uid, [id], {'state':'not running', 'partner_id':0})
return True