Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Invalid XML for View Architecture

By
husam
on 8/9/14, 12:23 AM 2,273 views

Am trying to install a module and am getting error message "
"ValidationError

Error occurred while validating the field(s) arch: Invalid XML for View Architecture!"
I reviewed my view.xml file but i could not rectify the error any help please

_______XML FILE ___________________________________________________________

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
    <!--============================================================
                                Reservation
        ============================================================ -->
        
    <record model="ir.ui.view" id="view_hotel_reservation_form">
            <field name="name">hotel.reservation.form</field>
            <field name="model">hotel.reservation</field>
            <field name="arch" type="xml">
                <form string=" Reservation" version="7.0">
                <notebook>
                    <page string="Reservation">
                        <field name="reservation_no" colspan="1"/>
                        <field name="date_order" select="1"/>
                        <field name="shop_id" select="2"/>
                        <field name="pricelist_id"/>
                        <field name="partner_id" on_change="onchange_partner_id(partner_id)" select="1"/>
                        <field name="partner_order_id" domain="[('partner_id','=',partner_id)]"/>
                        <field name="partner_invoice_id" domain="[('partner_id','=',partner_id)]"/>
                        <field name="partner_shipping_id" domain="[('partner_id','=',partner_id)]"/>
                        <field name="checkin" colspan="1"/>
                        <field name="checkout" on_change="on_change_checkout(checkin,checkout)"/>
                        <field name="adults"/>
                        <field name="childs"/>
                        <field name="dummy" invisible="True"/>
                        <field name="reservation_line" colspan="4" nolabel="1">
                            <form string="Reservation Line" >
                                <separator string="Room Type"/>
                                <field name="categ_id" select="1" colspan="4" nolabel="1"/>
                                <newline/>
                                <separator string="Select Room "/>
                                <field name="reserve" colspan="4" nolabel="1"/>
                            </form>
                            <tree string="Reservation Line" version="7.0">
                                <field name="categ_id" select="1"/>
                                <field name="reserve" colspan="4" string="No Of Rooms"/>
                            </tree>
                        </field>
                        <group colspan="4">
                            <field name="state"/>
                            <button name="confirm" string="Confirm" states="draft" icon="gtk-ok"/>
                            <button name="done" string="Create Folio" states="confirm" icon="gtk-go-forward"/>
                        </group>
                    </page>
                </notebook>
                </form>
            </field>
        </record>
        <record model="ir.ui.view" id="view_hotel_reservation_tree">
            <field name="name">hotel.reservation.tree</field>
            <field name="model">hotel.reservation</field>
            <field name="arch" type="xml">
                <tree string="Reservation" colors="blue:state=='draft' and checkin==current_date;red:state=='confirm' and checkout==current_date">
                    <field name="reservation_no"/>
                    <field name="partner_id" select="1"/>
                    <field name="checkin"/>
                    <field name="checkout"/>
                    <field name="state"/>
                </tree>
            </field>
        </record>

        <record model="ir.ui.view" id="view_hotel_reservation_search">
            <field name="name">hotel.reservation.search</field>
            <field name="model">hotel.reservation</field>
            <field name="arch" type="xml">
                <search string="Reservation" version="7.0">
                    <group>
                        <filter icon="terp-document-new" domain="[('state','=','draft')]" string="Draft"/>
                        <filter icon="terp-camera_test" domain="[('state','=','confirm')]" string="Confirm"/>
                        <filter icon="terp-dialog-close" domain="[('state','=','cancel')]" string="Cancel"/>
                        <filter icon="terp-check" domain="[('state','=','done')]" string="Done"/>
                    </group>
                    <field name="reservation_no"/>
                    <field name="partner_id" select="1"/>
                    <field name="checkin"/>
                    <field name="checkout"/>
                    <field name="state"/>
                    <newline/>
                    <group expand="0" string="Group By...">
                        <filter name="partner_id" string="Guest Name" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
                    </group>
                </search>
            </field>
        </record>
        
        
        <record model="ir.ui.view" id="view_hotel_reservation_graph">
            <field name="name">hotel.reservation.graph</field>
            <field name="model">hotel.reservation</field>
            <field name="arch" type="xml">
                <graph string="Reservation" type="bar">        
                    <field name="state"/>
                    <field name="reservation_no"/>
                </graph>
            </field>
        </record>
        
        
        
        <record model="ir.actions.act_window" id="open_hotel_reservation_form_tree">
            <field name="name">Reservation</field>
            <field name="res_model">hotel.reservation</field>
            <field name="view_type">form</field>
            <field name="view_mode">form,tree</field>
        </record>
        
                  
        <record model="ir.actions.act_window" id="action_hotel_reservation_tree_all">
            <field name="name">All Reservation</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">hotel.reservation</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
        </record>
        <menuitem  id="menu_hotel_reservation" name="Reservations" parent="hotel.hotel_management_menu" sequence="1"/>
        
        <menuitem name="All Reservations"
                  id="menu_action_hotel_reservation_tree_all"
                  action="action_hotel_reservation_tree_all"
                  parent="menu_hotel_reservation"
                  sequence="3"/>
                  
        <menuitem name="New Reservation"
                  id="menu_open_hotel_reservation_form_tree"
                  action="open_hotel_reservation_form_tree"
                  sequence="20"
                  parent="menu_hotel_reservation"/>
        
        <record model="ir.ui.view" id="hotel_calendar_view">
            <field name="name">Room Reservation</field>
            <field name="model">hotel.reservation</field>
            <field name="priority" eval="2"/>
            <field name="arch" type="xml">
               <calendar string="Current Reservation" date_start="checkin" date_stop= "dummy" color="state" >
                    <field name="partner_id"/>
               </calendar>
            </field>
        </record>
        
                    
        
    </data>
</openerp>

 

 

1- Restart the server 2- Look inside you openerp-server.log file for more details on the error

Med Said BARA
on 8/9/14, 5:27 AM
1

Med Said BARA

--Med Said BARA--
2664
| 5 5 7
Algeria
--Med Said BARA--
Med Said BARA
On 8/9/14, 2:04 PM

Confusion !

It seems that the error is related to hotel_reservation_wizard.xml and not to the first xml file posted.

Post the content of the hotel_reservation_wizard.xml file and the content of the python file where date_start and date_end are defined

 

SUMMARY (after comments):

According to your log, the error is related to hotel_reservation_wizard.xml file, and in this file there is at least two (2) fields " date_start and date_end", and those fields must be defined somewhere in a python file (maybe: hotel_reservation_wizard.py), before than you can use them in an .xml file

Under your folder module (hotel !!!) there is a first __init__.py file (beside the __openerp__.py file), in this one import the .py files of this folder (but not the __openerp__.py one) and also import the subfolders ( like: import wizard). After that in each subfolder if there is an other __init__.py file, in this one, just import the .py files of this subfolder.

0
husam
On 8/9/14, 11:36 AM

First thanks  Libu & Med for responding

__________________________Error  log fro IDE________________________

/usr/bin/python2.7 /home/husam/PycharmProjects/openerp/openerp-server
2014-08-09 15:32:03,774 23692 INFO ? openerp: OpenERP version 7.0-20131220-002431
2014-08-09 15:32:03,775 23692 INFO ? openerp: addons paths: /home/husam/PycharmProjects/openerp/openerp/addons
2014-08-09 15:32:03,775 23692 INFO ? openerp: database hostname: localhost
2014-08-09 15:32:03,775 23692 INFO ? openerp: database port: 5432
2014-08-09 15:32:03,775 23692 INFO ? openerp: database user: husam
2014-08-09 15:32:08,989 23692 INFO ? openerp.addons.google_docs.google_docs: GData lib version `%s GData-Python/2.0.17` detected
2014-08-09 15:32:15,009 23692 INFO ? openerp.service.wsgi_server: HTTP service (werkzeug) running on 0.0.0.0:8068
2014-08-09 15:32:15,010 23692 INFO ? openerp: OpenERP server is running, waiting for connections...
2014-08-09 15:32:15,914 23692 INFO demo1 openerp.modules.loading: loading 1 modules...
2014-08-09 15:32:16,287 23692 INFO demo1 openerp.modules.loading: loading 28 modules...
2014-08-09 15:32:16,912 23692 INFO demo1 openerp.modules.loading: Modules loaded.
2014-08-09 15:32:16,972 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:16] "GET / HTTP/1.1" 200 -
2014-08-09 15:32:17,437 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:17] "GET /web/static/src/css/full.css HTTP/1.1" 200 -
2014-08-09 15:32:18,364 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:18] "GET /web/webclient/css?db=demo1 HTTP/1.1" 200 -
2014-08-09 15:32:21,245 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:21] "GET /web/webclient/js?db=demo1 HTTP/1.1" 200 -
2014-08-09 15:32:22,931 23692 INFO demo1 openerp.service.web_services: successful login from 'admin' using database 'demo1'
2014-08-09 15:32:22,974 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:22] "POST /web/session/get_session_info HTTP/1.1" 200 -
2014-08-09 15:32:23,026 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:23] "POST /web/webclient/qweblist HTTP/1.1" 200 -
2014-08-09 15:32:23,614 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:23] "POST /web/proxy/load HTTP/1.1" 200 -
2014-08-09 15:32:23,792 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:23] "POST /web/session/modules HTTP/1.1" 200 -
2014-08-09 15:32:23,924 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:23] "POST /web/webclient/translations HTTP/1.1" 200 -
2014-08-09 15:32:23,940 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:23] "GET /web/static/lib/datejs/globalization/en-US.js HTTP/1.1" 200 -
2014-08-09 15:32:24,304 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:24] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:24,379 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:24] "GET /web/static/src/img/user_menu_avatar.png HTTP/1.1" 200 -
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 47345)
Traceback (most recent call last):
  File "/usr/lib/python2.7/SocketServer.py", line 593, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.7/SocketServer.py", line 651, in __init__
    self.finish()
  File "/usr/lib/python2.7/SocketServer.py", line 704, in finish
    self.wfile.flush()
  File "/usr/lib/python2.7/socket.py", line 303, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
----------------------------------------
2014-08-09 15:32:24,415 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:24] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:24,419 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:24] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:24,441 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:24] "GET /web/binary/company_logo?session_id=696b11d8ce4748069ac75b31df438ac3 HTTP/1.1" 200 -
2014-08-09 15:32:24,485 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:24] "POST /web/action/load HTTP/1.1" 200 -
2014-08-09 15:32:24,507 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:24] "GET /web/binary/image?model=res.users&field=image_small&id=1&session_id=696b11d8ce4748069ac75b31df438ac3 HTTP/1.1" 200 -
2014-08-09 15:32:24,877 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:24] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:24,905 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:24] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:24,969 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:24] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:25,367 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:25] "GET /web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_ffffff_1x400.png HTTP/1.1" 200 -
2014-08-09 15:32:25,368 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:25] "GET /web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_222222_256x240.png HTTP/1.1" 200 -
2014-08-09 15:32:25,378 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:25] "GET /web/static/src/img/search_reset.gif HTTP/1.1" 200 -
2014-08-09 15:32:25,443 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:25] "POST /web/menu/load HTTP/1.1" 200 -
2014-08-09 15:32:25,463 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:25] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:25,491 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:25] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:25,502 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:25] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:26,152 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:26] "POST /web/dataset/search_read HTTP/1.1" 200 -
2014-08-09 15:32:26,280 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:26] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:26,298 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:26] "POST /web/menu/load_needaction HTTP/1.1" 200 -
2014-08-09 15:32:27,576 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:27] "GET /mail/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:27,633 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:27] "GET /base/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:27,635 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:27] "GET /account_voucher/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:27,636 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:27] "GET /sale/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:27,722 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:27] "GET /edi/static/src/img/knowledge.png HTTP/1.1" 200 -
2014-08-09 15:32:27,827 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:27] "GET /hotel/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:27,830 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:27] "GET /portal/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:27,941 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:27] "GET /web/static/src/img/form_sheetbg.png HTTP/1.1" 200 -
2014-08-09 15:32:28,278 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:28] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:28,798 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:28] "POST /web/dataset/search_read HTTP/1.1" 200 -
2014-08-09 15:32:28,871 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:28] "GET /usr/share/docutils/writers/html4css1/html4css1.css HTTP/1.1" 404 -
2014-08-09 15:32:28,879 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:28] "GET /web/static/src/img/throbber.gif HTTP/1.1" 200 -
2014-08-09 15:32:29,063 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:29] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:30,737 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:30] "GET /web/binary/image?model=ir.module.module&id=102&field=icon_image&t=1407598348391&session_id=696b11d8ce4748069ac75b31df438ac3 HTTP/1.1" 200 -
2014-08-09 15:32:38,994 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:38] "POST /web/action/load HTTP/1.1" 200 -
2014-08-09 15:32:39,507 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:39] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:39,534 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:39] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:39,632 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:39] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:39,639 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:39] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:39,671 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:39] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:40,079 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:40] "POST /web/dataset/search_read HTTP/1.1" 200 -
2014-08-09 15:32:43,110 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:43] "POST /web/dataset/search_read HTTP/1.1" 200 -
2014-08-09 15:32:43,942 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:43] "GET /project/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:43,957 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:43] "GET /project_issue/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:43,968 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:43] "GET /account_accountant/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:43,998 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:43] "GET /mrp/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:44,008 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:44] "GET /crm/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:44,030 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:44] "GET /purchase/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:44,042 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:44] "GET /openeducat_erp/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:44,064 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:44] "GET /hr/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:44,069 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:44] "GET /hr_timesheet_sheet/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:44,084 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:44] "GET /point_of_sale/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:44,118 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:44] "GET /hr_expense/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:44,130 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:44] "GET /note/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:44,165 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:44] "GET /account_asset/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:44,178 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:44] "GET /stock/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:44,194 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:44] "GET /hr_payroll/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:44,233 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:44] "GET /hr_holidays/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:44,247 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:44] "GET /hr_recruitment/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:44,261 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:44] "GET /hr_evaluation/static/src/img/icon.png HTTP/1.1" 200 -
2014-08-09 15:32:46,462 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:46] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:46,825 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:46] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:47,112 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:47] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:47,452 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:47] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:48,693 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:48] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:49,209 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:49] "POST /web/dataset/search_read HTTP/1.1" 200 -
2014-08-09 15:32:51,111 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:51] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:51,717 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:51] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:52,150 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:52] "POST /web/dataset/search_read HTTP/1.1" 200 -
2014-08-09 15:32:52,255 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:52] "GET /usr/share/docutils/writers/html4css1/html4css1.css HTTP/1.1" 404 -
2014-08-09 15:32:52,260 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:52] "GET /web/static/src/img/placeholder.png HTTP/1.1" 200 -
2014-08-09 15:32:52,535 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:52] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:52,979 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:52] "POST /web/dataset/call_button HTTP/1.1" 200 -
2014-08-09 15:32:53,223 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:53] "POST /web/menu/load_needaction HTTP/1.1" 200 -
2014-08-09 15:32:53,245 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:53] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:53,524 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:53] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2014-08-09 15:32:53,691 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:53] "POST /web/dataset/search_read HTTP/1.1" 200 -
2014-08-09 15:32:57,627 23692 INFO demo1 openerp.modules.loading: loading 1 modules...
2014-08-09 15:32:57,719 23692 INFO demo1 openerp.modules.loading: loading 28 modules...
2014-08-09 15:32:58,104 23692 INFO demo1 openerp.modules.loading: loading 29 modules...
2014-08-09 15:32:58,151 23692 INFO demo1 openerp.modules.module: module hotel_reservation: creating or updating database tables
2014-08-09 15:32:58,301 23692 INFO demo1 openerp.modules.loading: module hotel_reservation: loading hotel_reservation_view.xml
2014-08-09 15:32:58,770 23692 INFO demo1 openerp.modules.loading: module hotel_reservation: loading hotel_reservation_sequence.xml
2014-08-09 15:32:58,896 23692 INFO demo1 openerp.modules.loading: module hotel_reservation: loading hotel_reservation_workflow.xml
2014-08-09 15:32:58,976 23692 INFO demo1 openerp.modules.loading: module hotel_reservation: loading wizard/hotel_reservation_wizard.xml
2014-08-09 15:32:59,002 23692 WARNING demo1 openerp.addons.base.ir.ir_ui_view: Setting the `type` field is deprecated in the `ir.ui.view` model.
2014-08-09 15:32:59,012 23692 ERROR demo1 openerp.addons.base.ir.ir_ui_view: Can't render view  for model: hotel.reservation.wizard
Traceback (most recent call last):
  File "/home/husam/PycharmProjects/openerp/openerp/addons/base/ir/ir_ui_view.py", line 126, in _check_render_view
    fvg = self.pool.get(view.model).fields_view_get(cr, uid, view_id=view.id, view_type=view.type, context=context)
AttributeError: 'NoneType' object has no attribute 'fields_view_get'
2014-08-09 15:32:59,060 23692 ERROR demo1 openerp.tools.convert: Parse error in /home/husam/PycharmProjects/openerp/openerp/addons/hotel_reservation/wizard/hotel_reservation_wizard.xml:5:
<record model="ir.ui.view" id="hotel_reservation_wizard_form_view">
            <field name="name">hotel.reservation.wizard.form</field>
            <field name="model">hotel.reservation.wizard</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Reservation List">
                 <group col="8">
                    <field name="date_start" colspan="4"/>
                    <field name="date_end" colspan="4"/>
                 </group>
                    <newline/>
                    <separator colspan="4"/>
                    <group col="8">
                        <button special="cancel" string="Cancel" icon="gtk-cancel"/>
                        <button name="report_reservation_detail" type="object" string="Reservation List" icon="gtk-justify-fill"/>
                        <button name="report_checkin_detail" string="CheckIn List" type="object" icon="gtk-jump-to"/>
                        <button name="report_checkout_detail" string="CheckOut List" type="object" icon="gtk-redo"/>
                        <button name="report_maxroom_detail" string="Room Used Maximum" type="object" icon="terp-stock_symbol-selection"/>
                    </group>
                </form>
            </field>
        </record>
Traceback (most recent call last):
  File "/home/husam/PycharmProjects/openerp/openerp/tools/convert.py", line 847, in parse
    self._tags[rec.tag](self.cr, rec, n)
  File "/home/husam/PycharmProjects/openerp/openerp/tools/convert.py", line 814, in _tag_record
    id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
  File "/home/husam/PycharmProjects/openerp/openerp/addons/base/ir/ir_model.py", line 967, in _update
    res_id = model_obj.create(cr, uid, values, context=context)
  File "/home/husam/PycharmProjects/openerp/openerp/addons/base/ir/ir_ui_view.py", line 103, in create
    return super(view, self).create(cr, uid, values, context)
  File "/home/husam/PycharmProjects/openerp/openerp/osv/orm.py", line 4490, in create
    self._validate(cr, user, [id_new], context)
  File "/home/husam/PycharmProjects/openerp/openerp/osv/orm.py", line 1559, in _validate
    raise except_orm('ValidateError', '\n'.join(error_msgs))
except_orm: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')
2014-08-09 15:32:59,124 23692 ERROR demo1 openerp.netsvc: ValidateError
Error occurred while validating the field(s) arch: Invalid XML for View Architecture!
Traceback (most recent call last):
  File "/home/husam/PycharmProjects/openerp/openerp/netsvc.py", line 292, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/husam/PycharmProjects/openerp/openerp/service/web_services.py", line 626, in dispatch
    res = fn(db, uid, *params)
  File "/home/husam/PycharmProjects/openerp/openerp/osv/osv.py", line 188, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/home/husam/PycharmProjects/openerp/openerp/osv/osv.py", line 144, in wrapper
    raise except_osv(inst.name, inst.value)
except_osv: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')
2014-08-09 15:32:59,190 23692 INFO demo1 werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:59] "POST /web/dataset/call_button HTTP/1.1" 200 -
2014-08-09 15:32:59,536 23692 INFO ? werkzeug: 127.0.0.1 - - [09/Aug/2014 15:32:59] "GET /web/static/src/img/warning.png HTTP/1.1" 200 -

 

_____________python file ___________________________

 ##############################################################################

from osv import fields
from osv import osv
import time
from mx import DateTime
import datetime
import pooler
from tools import config


class hotel_reservation(osv.osv):
    _name = "hotel.reservation"
    _rec_name = "reservation_no"
    _description = "Reservation"
    _columns = {
                
                'reservation_no': fields.char('Reservation No', size=64, required=True, select=True),
                'date_order':fields.datetime('Date Ordered', required=True, readonly=True, states={'draft':[('readonly',False)]}),
                'shop_id':fields.many2one('sale.shop', 'Shop', required=True, readonly=True, states={'draft':[('readonly',False)]}),      
                'partner_id':fields.many2one('res.partner', 'Guest Name', required=True,readonly=True, states={'draft':[('readonly',False)]}),
                'pricelist_id':fields.many2one('product.pricelist', 'Pricelist', required=True,readonly=True, states={'draft':[('readonly',False)]}),
                'partner_invoice_id':fields.many2one('res.partner', 'Invoice Address', readonly=True, required=True, states={'draft':[('readonly',False)]}),
                'partner_order_id':fields.many2one('res.partner', 'Ordering Contact', readonly=True, required=True, states={'draft':[('readonly',False)]}, help="The name and address of the contact that requested the order or quotation."),
                'partner_shipping_id':fields.many2one('res.partner', 'Shipping Address', readonly=True, required=True, states={'draft':[('readonly',False)]}),
                'checkin': fields.datetime('Expected-Date-Arrival',required=True,readonly=True, states={'draft':[('readonly',False)]}),
                'checkout': fields.datetime('Expected-Date-Departure',required=True, readonly=True, states={'draft':[('readonly',False)]}),
                'adults':fields.integer('Adults',size=64,readonly=True, states={'draft':[('readonly',False)]}),
                'childs':fields.integer('Children',size=64,readonly=True, states={'draft':[('readonly',False)]}),             
                'reservation_line':fields.one2many('hotel_reservation.line','line_id','Reservation Line'),
                'state': fields.selection([('draft', 'Draft'),('confirm','Confirm'),('cancle','Cancle'),('done','Done')], 'State',readonly=True),
                'folio_id': fields.many2many('hotel.folio', 'hotel_folio_reservation_rel', 'order_id', 'invoice_id', 'Folio'),
                'dummy': fields.datetime('Dummy'),
               
        }
    _defaults = {
       
        'reservation_no': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid,'hotel.reservation'),
        'state': lambda *a: 'draft',
        'date_order': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
         
       }
    def on_change_checkout(self,cr, uid, ids, checkin_date=time.strftime('%Y-%m-%d %H:%M:%S'),checkout_date=time.strftime('%Y-%m-%d %H:%M:%S'),context=None):
        delta = datetime.timedelta(days=1)
        addDays = datetime.datetime(*time.strptime(checkout_date,'%Y-%m-%d %H:%M:%S')[:5]) + delta
        val = {'value':{'dummy':addDays.strftime('%Y-%m-%d %H:%M:%S')}}
        return val
        
    def onchange_partner_id(self, cr, uid, ids, part):
        if not part:
            return {'value':{'partner_invoice_id': False, 'partner_shipping_id':False, 'partner_order_id':False}}
        addr = self.pool.get('res.partner').address_get(cr, uid, [part], ['delivery','invoice','contact'])
        pricelist = self.pool.get('res.partner').browse(cr, uid, part).property_product_pricelist.id
        return {'value':{'partner_invoice_id': addr['invoice'], 'partner_order_id':addr['contact'], 'partner_shipping_id':addr['delivery'], 'pricelist_id': pricelist}}
    
     
    def confirmed_reservation(self,cr,uid,ids):
         
         for reservation in self.browse(cr, uid, ids):
             cr.execute("select count(*) from hotel_reservation as hr " \
                        "inner join hotel_reservation_line as hrl on hrl.line_id = hr.id " \
                        "inner join hotel_reservation_line_room_rel as hrlrr on hrlrr.room_id = hrl.id " \
                        "where (checkin,checkout) overlaps ( timestamp %s , timestamp %s ) " \
                        "and hr.id <> cast(%s as integer) " \
                        "and hr.state = 'confirm' " \
                        "and hrlrr.hotel_reservation_line_id in (" \
                        "select hrlrr.hotel_reservation_line_id from hotel_reservation as hr " \
                        "inner join hotel_reservation_line as hrl on hrl.line_id = hr.id " \
                        "inner join hotel_reservation_line_room_rel as hrlrr on hrlrr.room_id = hrl.id " \
                        "where hr.id = cast(%s as integer) )" \
                        ,(reservation.checkin,reservation.checkout,str(reservation.id),str(reservation.id))
                        )
             res = cr.fetchone()
             roomcount =  res and res[0] or 0.0
             if roomcount:
                 raise osv.except_osv('Warning', 'You tried to confirm reservation with room those already reserved in this reservation period')
             else:
                 
                 self.write(cr, uid, ids, {'state':'confirm'})
             return True
    
    def _create_folio(self,cr,uid,ids):
        for reservation in self.browse(cr,uid,ids):
            for line in reservation.reservation_line:
                 for r in line.reserve:
                    folio=self.pool.get('hotel.folio').create(cr,uid,{
                                                                      'date_order':reservation.date_order,
                                                                      'shop_id':reservation.shop_id.id,
                                                                      'partner_id':reservation.partner_id.id,
                                                                      'pricelist_id':reservation.pricelist_id.id,
                                                                      'partner_invoice_id':reservation.partner_invoice_id.id,
                                                                      'partner_order_id':reservation.partner_order_id.id,
                                                                      'partner_shipping_id':reservation.partner_shipping_id.id,
                                                                      'checkin_date': reservation.checkin,
                                                                      'checkout_date': reservation.checkout,
                                                                      'room_lines': [(0,0,{'folio_id':line['id'],
                                                                                           'checkin_date':reservation['checkin'],
                                                                                           'checkout_date':reservation['checkout'],
                                                                                           'product_id':r['id'],
                                                                                           'name':reservation['reservation_no'],
                                                                                           'product_uom':r['uom_id'].id,
                                                                                           'price_unit':r['lst_price'],
                                                                                           'product_uom_qty':(datetime.datetime(*time.strptime(reservation['checkout'],'%Y-%m-%d %H:%M:%S')[:5]) - datetime.datetime(*time.strptime(reservation['checkin'],'%Y-%m-%d %H:%M:%S')[:5])).days   
                                                                                           
                                                                                           })],
                                                                     'service_lines':reservation['folio_id']     
                                                                       })
            cr.execute('insert into hotel_folio_reservation_rel (order_id,invoice_id) values (%s,%s)', (reservation.id, folio))
            self.write(cr, uid, ids, {'state':'done'})
        return True
hotel_reservation()

class hotel_reservation_line(osv.osv):
     _name = "hotel_reservation.line"
   
     _description = "Reservation Line"
     _columns = {
                 
               'line_id':fields.many2one('hotel.reservation'),
               'reserve':fields.many2many('product.product','hotel_reservation_line_room_rel','room_id','hotel_reservation_line_id', domain="[('isroom','=',True),('categ_id','=',categ_id)]"),   
               'categ_id': fields.many2one('product.category','Room Type',domain="[('isroomtype','=',True)]"),
              
        }
hotel_reservation_line()

 

 

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

 

 

 

 

 

Dear Med i dont know what u mean about the content of the python file where date_start and date_end are defined

husam
on 8/10/14, 6:12 AM

hotel_reservation_wizard.xml_____________________________________ hotel.reservation.wizard.formhotel.reservation.wizardform Reservation Listhotel.reservation.wizardformformnewmake.folio.wizard.formwizard.make.folioform

husam
on 8/10/14, 6:12 AM

thanks ________________hotel_reservation_wizard.py____________________________________ from osv import fields from osv import osv import time from mx import DateTime import datetime import pooler from tools import config import wizard import netsvc class hotel_reservation_wizard(osv.osv_memory): _name = 'hotel.reservation.wizard' _columns = { 'date_start' :fields.datetime('Start Date',required=True), 'date_end': fields.datetime('End Date',required=True), } def report_reservation_detail(self,cr,uid,ids,context=None): datas = { 'ids': ids, 'model': 'hotel.reservation', 'form': self.read(cr, uid, ids)[0] } return { 'type': 'ir.actions.report.xml', 'report_name': 'reservation.detail', 'datas': datas, } def report_checkin_detail(self,cr,uid,ids,context=None): datas = { 'ids': ids, 'model': 'hotel.reservation', 'form': self.read(cr, uid, ids)[0] } return { 'type': 'ir.actions.report.xml', 'report_name': 'checkin.detail', 'datas': datas, } def report_checkout_detail(self,cr,uid,ids,context=None): datas = { 'ids': ids, 'model': 'hotel.reservation', 'form': self.read(cr, uid, ids)[0] } return { 'type': 'ir.actions.report.xml', 'report_name': 'checkout.detail', 'datas': datas, } def report_maxroom_detail(self,cr,uid,ids,context=None): datas = { 'ids': ids, 'model': 'hotel.reservation', 'form': self.read(cr, uid, ids)[0] } return { 'type': 'ir.actions.report.xml', 'report_name': 'maxroom.detail', 'datas': datas, } hotel_reservation_wizard() class make_folio_wizard(osv.osv_memory): _name = 'wizard.make.folio' _columns = { 'grouped':fields.boolean('Group the Folios'), } _defaults = { 'grouped': False, } def makeFolios(self, cr, uid, data, context): order_obj = self.pool.get('hotel.reservation') newinv = [] for o in order_obj.browse(cr, uid, context['active_ids'], context): for i in o.folio_id: newinv.append(i.id) return { 'domain': "[('id','in', ["+','.join(map(str,newinv))+"])]", 'name': 'Folios', 'view_type': 'form', 'view_mode': 'tree,form', 'res_model': 'hotel.folio', 'view_id': False, 'type': 'ir.actions.act_window' } make_folio_wizard()

husam
on 8/10/14, 10:38 AM

According to your log, the error is related to hotel_reservation_wizard.xml file, and in this file there is at least two (2) fields " date_start and date_end", and those fields must be defined somewhere in a python file (maybe: hotel_reservation_wizard.py)

husam
on 8/10/14, 10:38 AM

Try to review the content of the __init__.py files, it seems that your files are not loaded in the correct order. This means that (for example: hotel_reservation_wizard.py must be loaded first before hotel_reservation_wizard.xml)

Med Said BARA
on 8/10/14, 11:02 AM

Another thing, when importing from OpenERP modules (like OSV) use: from openerp.osv import osv, fields

Med Said BARA
on 8/10/14, 11:04 AM

Try to review the content of the __init__.py files, it seems that your files are not loaded in the correct order. This means that (for example: hotel_reservation_wizard.py must be loaded first before hotel_reservation_wizard.xml) ____________________________________________________ how can i organize the loaded ?

husam
on 8/10/14, 11:19 AM

Under your folder module (hotel !!!) there is a first __init__.py file (beside the __openerp__.py file), in this one import the.py filesof this folder (but not the __openerp__.py file) and also import the subfolders ( like: import wizard). After that in each subfolder if there is an other __init__.py file, in this one, just import the .py files of this subfolder.

Med Said BARA
on 8/10/14, 11:49 AM
0

Odoo

--Odoo --
1328
| 5 2 5
kerala, India
--Odoo --

Working as a Odoo Functional and Technical Expert

Odoo
On 8/9/14, 6:01 AM

Please add your error log file here and python file.......
 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 8/9/14, 12:23 AM
Seen: 2273 times
Last updated: 3/16/15, 8:10 AM