On 20 Jan 04:58, Fabyc wrote:
> On Tuesday, January 20, 2015 at 7:35:03 AM UTC-5, Cédric Krier wrote:
> >
> > On 19 Jan 16:12, Fabyc wrote: 
> > > Hi. 
> > > 
> > > I was looking for a way to hide a page in a view for example the page 
> > > "Accounting" of the Party. 
> > > 
> > > In a new module, extending view I can hide a label and a field but I 
> > don't 
> > > know how can I hide all the page. 
> > > 
> > > The tag I use for hiding a filed is "replace" [1] 
> > > 
> > > [1] 
> > http://doc.tryton.org/3.2/trytond/doc/topics/views/extension.html#xpath 
> >
> > Yes you can replace with empty a tag or you can put a states attribute 
> > on the page. 
> >
> 
> In the form view I extended Party, I tried this [1] but I got this error:
> 
> Traceback (most recent call last):
>   File "/trytond/protocols/jsonrpc.py", line 125, in _marshaled_dispatch
>     response['result'] = dispatch_method(method, params)
>   File "/trytond/protocols/jsonrpc.py", line 158, in _dispatch
>     res = dispatch(*args)
>   File "/trytond/protocols/dispatcher.py", line 159, in dispatch
>     result = rpc.result(meth(*c_args, **c_kwargs))
>   File "/trytond/model/modelview.py", line 201, in fields_view_get
>     result['arch'] = _inherit_apply(result['arch'], view.arch)
>   File "/trytond/model/modelview.py", line 34, in _inherit_apply
>     element = _find(tree_src, element2)
>   File "/trytond/model/modelview.py", line 21, in _find
>     res = tree.xpath(element.get('expr'))
>   File "lxml.etree.pyx", line 1498, in lxml.etree._Element.xpath 
> (src/lxml/lxml.etree.c:52268)
>   File "xpath.pxi", line 307, in lxml.etree.XPathElementEvaluator.__call__ 
> (src/lxml/lxml.etree.c:152309)
>   File "xpath.pxi", line 227, in 
> lxml.etree._XPathEvaluatorBase._handle_result (src/lxml/lxml.etree.c:151282)
>   File "xpath.pxi", line 213, in 
> lxml.etree._XPathEvaluatorBase._raise_eval_error 
> (src/lxml/lxml.etree.c:151135)
> XPathEvalError: Invalid expression
> 
> 
> [1] <xpath  expr="/form/notebook/page[@id='accounting']/" 
> position="replace">
> </xpath>

The expression is not valid, probably the trailing /


-- 
Cédric Krier - B2CK SPRL
Email/Jabber: [email protected]
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Reply via email to