2014-11-20 12:19 GMT+01:00 Cédric Krier <[email protected]>:

> On 20 Nov 12:03, Guillem Barba Domingo wrote:
> > Hi folks,
> >
> > I need to define an alternative menu to be used for some users who have
> to
> > access only to one wizard.
> >
> > I defined the next wizard, menu and act_window in our customer's module
> [1]
> >
> > I created a user belonging only to "Production Start Wizard" group and
> set
> > the "Menu Start/End Production" act_window as him Menu Action...
> > but it doesn't have the expected efecte because it has the main menu:
> > menuitems without parent [2] :-(
> >
> > I'm working with Tryton 3.2
> >
> > any clue?
>
> Your domain is wrong because it will evaluate to parent = None
> Use:
>
>     [('id', '=', Id('module.menu_exclusive_production'))]
>

It was my first intend, but it raises an error when update the module:

In tag record: model ir.action.act_window with id
act_menu_production_start_end_tree.
Traceback (most recent call last):
  File "./bin/trytond", line 113, in <module>
    trytond.server.TrytonServer(options).run()
  File
"/home/guillem/nan/projectes/tryton/customer/trytond/trytond/server.py",
line 123, in run
    Pool(db_name).init(update=update, lang=lang)
  File
"/home/guillem/nan/projectes/tryton/customer/trytond/trytond/pool.py", line
151, in init
    lang=lang)
  File
"/home/guillem/nan/projectes/tryton/customer/trytond/trytond/modules/__init__.py",
line 429, in load_modules
    _load_modules()
  File
"/home/guillem/nan/projectes/tryton/customer/trytond/trytond/modules/__init__.py",
line 397, in _load_modules
    load_module_graph(graph, pool, lang)
  File
"/home/guillem/nan/projectes/tryton/customer/trytond/trytond/modules/__init__.py",
line 251, in load_module_graph
    tryton_parser.parse_xmlstream(fp)
  File
"/home/guillem/nan/projectes/tryton/customer/trytond/trytond/convert.py",
line 441, in parse_xmlstream
    self.sax_parser.parse(source)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 210, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 307, in end_element
    self._cont_handler.endElement(name)
  File
"/home/guillem/nan/projectes/tryton/customer/trytond/trytond/convert.py",
line 503, in endElement
    self.taghandler = self.taghandler.endElement(name)
  File
"/home/guillem/nan/projectes/tryton/customer/trytond/trytond/convert.py",
line 280, in endElement
    self.model.__name__, self.values, self.xml_id)
  File
"/home/guillem/nan/projectes/tryton/customer/trytond/trytond/convert.py",
line 693, in import_record
    old_values, fs_id, mdata_id)
  File
"/home/guillem/nan/projectes/tryton/customer/trytond/trytond/convert.py",
line 748, in write_records
    Model.write(*to_update)
  File
"/home/guillem/nan/projectes/tryton/customer/trytond/trytond/ir/action.py",
line 338, in write
    super(ActionMixin, cls).write(records, values, *args)
  File
"/home/guillem/nan/projectes/tryton/customer/trytond/trytond/model/modelsql.py",
line 840, in write
    field_names=all_field_names)
  File
"/home/guillem/nan/projectes/tryton/customer/trytond/trytond/model/modelstorage.py",
line 1100, in _validate
    cls.validate(records)
  File
"/home/guillem/nan/projectes/tryton/customer/trytond/trytond/ir/action.py",
line 758, in validate
    cls.check_domain(actions)
  File
"/home/guillem/nan/projectes/tryton/customer/trytond/trytond/ir/action.py",
line 804, in check_domain
    'action': action.rec_name,
  File
"/home/guillem/nan/projectes/tryton/customer/trytond/trytond/error.py",
line 74, in raise_user_error
    raise UserError(error)
trytond.exceptions.UserError: ('UserError', (u'Invalid domain or search
criteria "[(\'id\', \'=\', Id(\'customer.menu_exclusive_production\'))]" on
action "Menu Start/End Production".', ''))



-- 
Guillem Barba
http://www.guillem.alcarrer.net

Reply via email to