diff --git a/partner_multi_relation/__manifest__.py b/partner_multi_relation/__manifest__.py
index 60203b9ae..491f31fb6 100644
--- a/partner_multi_relation/__manifest__.py
+++ b/partner_multi_relation/__manifest__.py
@@ -10,6 +10,7 @@
"license": "AGPL-3",
"depends": [
'base',
+ 'sales_team',
],
"demo": [
"data/demo.xml",
diff --git a/partner_multi_relation/models/res_partner_relation_all.py b/partner_multi_relation/models/res_partner_relation_all.py
index eeef17346..1b462a8e8 100644
--- a/partner_multi_relation/models/res_partner_relation_all.py
+++ b/partner_multi_relation/models/res_partner_relation_all.py
@@ -32,10 +32,10 @@ class ResPartnerRelationAll(models.AbstractModel):
You must use the same name as in res_partner_relation.
Don't overwrite this list in your declaration but append in _auto_init:
- def _auto_init(self, cr, context=None):
+ @api.model_cr_context
+ def _auto_init(self):
self._additional_view_fields.append('my_field')
- return super(ResPartnerRelationAll, self)._auto_init(
- cr, context=context)
+ return super(ResPartnerRelationAll, self)._auto_init()
my_field = fields...
"""
@@ -78,7 +78,9 @@ class ResPartnerRelationAll(models.AbstractModel):
search='_search_any_partner_id'
)
- def _auto_init(self, cr, context=None):
+ @api.model_cr_context
+ def _auto_init(self):
+ cr = self._cr
drop_view_if_exists(cr, self._table)
additional_view_fields = ','.join(self._additional_view_fields)
additional_view_fields = (',' + additional_view_fields)\
@@ -121,9 +123,7 @@ CREATE OR REPLACE VIEW %(table)s AS
'additional_view_fields': AsIs(additional_view_fields),
}
)
- return super(ResPartnerRelationAll, self)._auto_init(
- cr, context=context
- )
+ return super(ResPartnerRelationAll, self)._auto_init()
@api.model
def _search_any_partner_id(self, operator, value):
diff --git a/partner_multi_relation/models/res_partner_relation_type_selection.py b/partner_multi_relation/models/res_partner_relation_type_selection.py
index 43ea80f94..794d7d854 100644
--- a/partner_multi_relation/models/res_partner_relation_type_selection.py
+++ b/partner_multi_relation/models/res_partner_relation_type_selection.py
@@ -65,7 +65,9 @@ class ResPartnerRelationTypeSelection(models.Model):
string='Symmetric',
)
- def _auto_init(self, cr, context=None):
+ @api.model_cr_context
+ def _auto_init(self):
+ cr = self._cr
drop_view_if_exists(cr, self._table)
cr.execute(
"""CREATE OR REPLACE VIEW %(table)s AS
@@ -100,8 +102,7 @@ class ResPartnerRelationTypeSelection(models.Model):
'padding': PADDING,
'underlying_table': AsIs('res_partner_relation_type'),
})
- return super(ResPartnerRelationTypeSelection, self)._auto_init(
- cr, context=context)
+ return super(ResPartnerRelationTypeSelection, self)._auto_init()
@api.multi
def name_get(self):
diff --git a/partner_multi_relation/security/ir.model.access.csv b/partner_multi_relation/security/ir.model.access.csv
index 45744e5d8..3fd6af48f 100644
--- a/partner_multi_relation/security/ir.model.access.csv
+++ b/partner_multi_relation/security/ir.model.access.csv
@@ -5,4 +5,4 @@ read_res_partner_relation_type,access_res_partner_relation_type,model_res_partne
read_res_partner_relation_type_selection,access_res_partner_relation_type,model_res_partner_relation_type_selection,,1,0,0,0
crud_res_partner_relation,access_res_partner_relation,model_res_partner_relation,base.group_partner_manager,1,1,1,1
crud_res_partner_relation_all,access_res_partner_relation,model_res_partner_relation_all,base.group_partner_manager,1,1,1,1
-crud_res_partner_relation_type,access_res_partner_relation_type,model_res_partner_relation_type,base.group_sale_manager,1,1,1,1
+crud_res_partner_relation_type,access_res_partner_relation_type,model_res_partner_relation_type,sales_team.group_sale_manager,1,1,1,1
diff --git a/partner_multi_relation/views/menu.xml b/partner_multi_relation/views/menu.xml
index b60842f67..06f2f742a 100644
--- a/partner_multi_relation/views/menu.xml
+++ b/partner_multi_relation/views/menu.xml
@@ -4,7 +4,7 @@
@@ -17,7 +17,7 @@