#1 Le 27/01/2015, à 17:41
- aissa bammoune
Openerp 7 Comment Ajouter un champ many2many référencé à autre table?
j'ai essayer d'ajouter deux onglets (dans chaqu'une un champ référencé à autre table) à la table de groupe (res.groups) par le code suivant :
le champ (action_ids) ------------------------- à la table ir.actions.act_window
le champ (report_ids) ------------------------- à la table ir.actions.report.xml
from openerp.osv import fields,osv
class ir_actions_act_window_group(osv.osv):
_inherit = 'res.groups'
_columns = {
'action_ids': fields.many2many('ir.actions.act_window', 'ir_actions_act_window_group_rel', 'act_id', 'gid',
string='Actionts', help='Users of this group automatically inherit those Actions'),
}
ir_actions_act_window_group()
class groups_report(osv.osv):
_inherit = 'res.groups'
_columns = {
'report_ids': fields.many2many('ir.actions.report.xml', 'res_groups_report_rel', 'uid', 'gid',
string='Rapports', help='Users of this group automatically inherit those Rapports'),
}
groups_report()
j'ai le message suivant :
Erreur d'intégrité
L'opération n'a pas pu être terminée, probablement à la suite d'une :
- suppression : vous avez essayer de supprimer un enregistrement auquel d'autres enregistrements font référence
- création/modification : un champ requis n'a pas été correctement rempli
[objet ayant pour référence : Access Groups - res.groups]
Hors ligne