Re: [tryton-fr] Re: extend party.party et XMLSyntaxError

2011-02-15 Par sujet Cédric Krier
On 14/02/11 23:36 -0800, pobsteta wrote:
 Bonjour Cédric,
 
 J'ai corrigé de cette façon :
 
 ?xml version=1.0?
 !-- This file is part of Tryton.  The COPYRIGHT file at the top level
 of
 this repository contains the full copyright notices and license terms.
 --
 tryton
 data
 
 record model=ir.ui.view id=party_view_form
 field name=modelparty.party/field
 field name=inherit ref=party.party_view_form/
 field name=arch type=xml
 ![CDATA[
 data
 xpath
 expr=/form/notebook/

Je ne mettrais pas / final

 position=inside
 page string=Dispositifs colspan=4
 id=dispositifs/
 label name=dispositif/
 field name=dispositif/
 /page
 /xpath
 /data
 ]]
 /field
 /record
 
 /data
 /tryton
 
 et j'obtiens l'erreur :
 
 
   File /trytond/model/modelsql.py, line 2135, in _validate
 super(ModelSQL, self)._validate(ids)
   File /trytond/model/modelstorage.py, line 942, in _validate
 if not getattr(self, field[0])(ids):
   File /trytond/ir/ui/view.py, line 85, in check_xml
 tree = etree.fromstring(xml)
   File lxml.etree.pyx, line 2532, in lxml.etree.fromstring (src/lxml/
 lxml.etree.c:48270)
   File parser.pxi, line 1545, in lxml.etree._parseMemoryDocument
 (src/lxml/lxml.etree.c:71812)
   File parser.pxi, line 1417, in lxml.etree._parseDoc (src/lxml/
 lxml.etree.c:70608)
   File parser.pxi, line 898, in
 lxml.etree._BaseParser._parseUnicodeDoc (src/lxml/lxml.etree.c:67148)
   File parser.pxi, line 539, in
 lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:
 63824)
   File parser.pxi, line 625, in lxml.etree._handleParseResult (src/
 lxml/lxml.etree.c:64745)
   File parser.pxi, line 565, in lxml.etree._raiseParseError (src/
 lxml/lxml.etree.c:64088)
 XMLSyntaxError: Opening and ending tag mismatch: xpath line 2 and
 page, line 8, column 32
 
 
 Une idée ?
 @+
 
 On 14 fév, 23:02, Cédric Krier cedric.kr...@b2ck.com wrote:
  On 14/02/11 13:06 -0800, pobsteta wrote:
 
 
 
   Bonjour,
 
   J'essaie d'étendre le module party.py dans une autre classe par :
 
   class Party(ModelSQL, ModelView):
       _name = 'party.party'
 
       dispositif = fields.Many2One('dispositif.dispositif', 'dis_num',
   'Dispositifs')
 
   Party()
 
   et la classe party.xml par :
 
   ?xml version=1.0?
   !-- This file is part of Tryton.  The COPYRIGHT file at the top level
   of
   this repository contains the full copyright notices and license terms.
   --
   tryton
       data
 
           record model=ir.ui.view id=party_view_form
               field name=modelparty.party/field
               field name=inherit ref=party.party_view_form/
               field name=arch type=xml
                   ![CDATA[
                   data
                       xpath
                           expr=/form/notebook/
   page[@id=quot;dispositifsquot;]
 
  expr est une expression xpath [1] qui doit pointer sur un tag existant.
  Donc dans ce cas ci, je pense que le plus simple est:
 
      expr=/form/notebook position=inside
 
                           position=after
                           separator string=Dispositifs colspan=4
 
  page au lieu de separator
 
   id=dispositifs/
                               label name=dispositif/
                               field name=dispositif/
                           /page
                       /xpath
                   /data
                   ]]
               /field
           /record
 
       /data
   /tryton
 
  [1]http://www.w3.org/TR/xpath/
 
  --
  Cédric Krier
 
  B2CK SPRL
  Rue de Rotterdam, 4
  4000 Liège
  Belgium
  Tel: +32 472 54 46 59
  Email/Jabber: cedric.kr...@b2ck.com
  Website:http://www.b2ck.com/
 
   application_pgp-signature_part
   1 000AfficherTélécharger
 
 -- 
 tryton-fr@googlegroups.com mailing list
 

-- 
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: cedric.kr...@b2ck.com
Website: http://www.b2ck.com/


pgpUJot6WngLk.pgp
Description: PGP signature


[tryton-fr] Re: extend party.party et XMLSyntaxError

2011-02-14 Par sujet pobsteta
Bonjour Cédric,

J'ai corrigé de cette façon :

?xml version=1.0?
!-- This file is part of Tryton.  The COPYRIGHT file at the top level
of
this repository contains the full copyright notices and license terms.
--
tryton
data

record model=ir.ui.view id=party_view_form
field name=modelparty.party/field
field name=inherit ref=party.party_view_form/
field name=arch type=xml
![CDATA[
data
xpath
expr=/form/notebook/
position=inside
page string=Dispositifs colspan=4
id=dispositifs/
label name=dispositif/
field name=dispositif/
/page
/xpath
/data
]]
/field
/record

/data
/tryton

et j'obtiens l'erreur :


  File /trytond/model/modelsql.py, line 2135, in _validate
super(ModelSQL, self)._validate(ids)
  File /trytond/model/modelstorage.py, line 942, in _validate
if not getattr(self, field[0])(ids):
  File /trytond/ir/ui/view.py, line 85, in check_xml
tree = etree.fromstring(xml)
  File lxml.etree.pyx, line 2532, in lxml.etree.fromstring (src/lxml/
lxml.etree.c:48270)
  File parser.pxi, line 1545, in lxml.etree._parseMemoryDocument
(src/lxml/lxml.etree.c:71812)
  File parser.pxi, line 1417, in lxml.etree._parseDoc (src/lxml/
lxml.etree.c:70608)
  File parser.pxi, line 898, in
lxml.etree._BaseParser._parseUnicodeDoc (src/lxml/lxml.etree.c:67148)
  File parser.pxi, line 539, in
lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:
63824)
  File parser.pxi, line 625, in lxml.etree._handleParseResult (src/
lxml/lxml.etree.c:64745)
  File parser.pxi, line 565, in lxml.etree._raiseParseError (src/
lxml/lxml.etree.c:64088)
XMLSyntaxError: Opening and ending tag mismatch: xpath line 2 and
page, line 8, column 32


Une idée ?
@+

On 14 fév, 23:02, Cédric Krier cedric.kr...@b2ck.com wrote:
 On 14/02/11 13:06 -0800, pobsteta wrote:



  Bonjour,

  J'essaie d'étendre le module party.py dans une autre classe par :

  class Party(ModelSQL, ModelView):
      _name = 'party.party'

      dispositif = fields.Many2One('dispositif.dispositif', 'dis_num',
  'Dispositifs')

  Party()

  et la classe party.xml par :

  ?xml version=1.0?
  !-- This file is part of Tryton.  The COPYRIGHT file at the top level
  of
  this repository contains the full copyright notices and license terms.
  --
  tryton
      data

          record model=ir.ui.view id=party_view_form
              field name=modelparty.party/field
              field name=inherit ref=party.party_view_form/
              field name=arch type=xml
                  ![CDATA[
                  data
                      xpath
                          expr=/form/notebook/
  page[@id=quot;dispositifsquot;]

 expr est une expression xpath [1] qui doit pointer sur un tag existant.
 Donc dans ce cas ci, je pense que le plus simple est:

     expr=/form/notebook position=inside

                          position=after
                          separator string=Dispositifs colspan=4

 page au lieu de separator

  id=dispositifs/
                              label name=dispositif/
                              field name=dispositif/
                          /page
                      /xpath
                  /data
                  ]]
              /field
          /record

      /data
  /tryton

 [1]http://www.w3.org/TR/xpath/

 --
 Cédric Krier

 B2CK SPRL
 Rue de Rotterdam, 4
 4000 Liège
 Belgium
 Tel: +32 472 54 46 59
 Email/Jabber: cedric.kr...@b2ck.com
 Website:http://www.b2ck.com/

  application_pgp-signature_part
  1 000AfficherTélécharger

-- 
tryton-fr@googlegroups.com mailing list