Problem with pyson, domain, and xml

52 views
Skip to first unread message

Francisco Maria Moyano Casco

unread,
Sep 24, 2015, 6:50:06 PM9/24/15
to tryton
Greetings.
              Hello. I'm having a little issue with these sentences
            
                 <record model="ir.action.act_window.domain" id="act_maintenance_historical_request_state">
                       <field name="name">Today</field>
                      <field name="sequence" eval="10"/>
                      <field name="domain">[('state', '=','request'),('request_date',<=',DateTime(hour=0, minute=0, second=0, microsecond=0, delta_days=1))]</field>
                     <field name="act_window" ref="act_request"/>
                </record>

The server gives me this
             xml.sax._exceptions.SAXParseException: <unknown>:66:45: not well-formed (invalid token)

And the error is  on this operator (the one in bold)

<field name="domain">[('state', '=','request'),('request_date','<=',DateTime(hour=0, minute=0, second=0, microsecond=0, delta_days=1))]</field>

Thanks.
        Francisco

Cédric Krier

unread,
Sep 24, 2015, 7:20:04 PM9/24/15
to tryton
On 2015-09-24 15:33, Francisco Maria Moyano Casco wrote:
> Greetings.
> Hello. I'm having a little issue with these sentences
>
> <record model="ir.action.act_window.domain"
> id="act_maintenance_historical_request_state">
> <field name="name">Today</field>
> <field name="sequence" eval="10"/>
> <field name="domain">[('state',
> '=','request'),('request_date',<=',DateTime(hour=0, minute=0, second=0,
> microsecond=0, delta_days=1))]</field>
> <field name="act_window" ref="act_request"/>
> </record>
>
> The server gives me this
> xml.sax._exceptions.SAXParseException: <unknown>:66:45: not
> well-formed (invalid token)
>
> And the error is on this operator (the one in bold)
>
> <field name="domain">[('state', '=','request'),('request_date',*'<='*,DateTime(hour=0,
> minute=0, second=0, microsecond=0, delta_days=1))]</field>

You must escape some character when you write XML see:
https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML


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

Francisco Maria Moyano Casco

unread,
Sep 25, 2015, 4:35:07 AM9/25/15
to tryton
Thank you Cedric! It works great

Cheers
Reply all
Reply to author
Forward
0 new messages