On 30/03/12 19:08 -0700, Bruno M. Villasanti (Thymbra) wrote: > El viernes 30 de marzo de 2012 21:11:35 UTC-3, Cédric Krier escribió: > > > > On 30/03/12 12:54 -0700, Bruno M. Villasanti (Thymbra) wrote: > > > Hi, > > > > > > I want to make editable lines of purchase orders with something like: > > > > > > <record model="ir.ui.view" id="purchase_view_form"> > > > <field name="model">purchase.purchase</field> > > > <field name="type">form</field> > > > <field name="inherit" ref="purchase.purchase_view_form"/> > > > <field name="arch" type="xml"> > > > <![CDATA[ > > > <data> > > > <xpath > > > > > > > > expr="/form/notebook/page[@id="purchase"]/field[@name="lines"]/tree" > > > position="replace_attributes"> > > > <tree string="Lines" sequence="sequence" > > fill="1" > > > editable="top"/> > > > </xpath> > > > </data> > > > ]]> > > > </field> > > > </record> > > > > > > But this returns Invalid XML view. > > > > > > I guess because the validator (etree.RelaxNG) takes form.rng when in > > fact > > > is a nested tree. So, instead assigning tree.rng by debugging, the > > process > > > completes successfully. > > > > This is strange because tree is define in form.rnc > > > I repeat the operation on a new database with the same result: > > [Fri Mar 30 22:44:06 2012] ERROR:ir:Invalid xml view: > <string>:5:0:ERROR:RELAXNGV:RELAXNG_ERR_NOELEM: Expecting an element , > got nothing > <data> > <xpath > > expr="/form/notebook/page[@id="purchase"]/field[@name="lines"]/tree" > position="replace_attributes"> > <tree string="Lines" sequence="sequence" > fill="1" editable="top"/> > </xpath> > </data> > [Fri Mar 30 22:44:06 2012] ERROR:convert:Error while parsing xml file: > In tag record: model ir.ui.view with id purchase_view_form. > > My cuestion is if the inheritance is correct.
I think. I find a difference between the definition of tree in tree.rnc and form.rnc. http://hg.tryton.org/2.2/trytond/file/2bcb763eebd7/trytond/ir/ui/form.rnc#l23 http://hg.tryton.org/2.2/trytond/file/2bcb763eebd7/trytond/ir/ui/tree.rnc#l3 In form.rnc, tree must have at least one field inside. It is an error, so could you fill an issue in http://bugs.tryton.org/ -- Cédric Krier B2CK SPRL Rue de Rotterdam, 4 4000 Liège Belgium Tel: +32 472 54 46 59 Email/Jabber: [email protected] Website: http://www.b2ck.com/
pgpQIqTAPFTCn.pgp
Description: PGP signature
