Skip to Content
Menu
This question has been flagged

i have this code 

class clientc(models.Model):
_name="client_c"
_auto=False

_columns = {
'display_name' : fields.char('Nom'),
'function' : fields.char('Fonction'),
'phone' : fields.char('Num'),
'email' : fields.char('Email'),
'is_company' : fields.char('Entreprise'),
'id' : fields.char('ID'),
'country_id' : fields.char('Pays'),
'parent_id' : fields.char('ID parent'),

}

def init(self, cr):
tools.sql.drop_view_if_exists(cr, 'client_c')
cr.execute("""
CREATE view client_c as
(SELECT display_name,
function,
phone,
email,
is_company,
user_id as id,
country_id,
parent_id
FROM res_partner r
WHERE r.id IN(
SELECT c.partner_id FROM crm_phonecall c
GROUP BY c.partner_id)
GROUP BY display_name,
function,
phone,
email,
is_company,
user_id,
country_id,
parent_id)
""")

clientc()


and the view :

< record model="ir.ui.view" id="clients_vue_liste">
< field name="name">clients a relancer appels</field>
< field name="model">client_c </field>
< field name="arch" type="xml">
< tree string="clients">
< field name="display_name"/>
< field name="function" invisible="1"/>
< field name="phone"/>
< field name="email"/>
< field name="user_id" invisible="1"/>
< field name="is_company" invisible="1"/>
< field name="country_id" invisible="1"/>
< field name="parent_id" invisible="1"/>


but am getting errors with rights, it says that i cant display the partners because i dont have the right to read ... please help. and please if you find some mistakes in my code just tell me and thanks

Avatar
Discard

Group & Access Rights in Odoo: https://goo.gl/8DZYRT

Related Posts Replies Views Activity
0
Jun 19
2057
2
Jan 20
13438
16
Aug 19
8650
1
Jan 19
4314
5
Jun 18
9580