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

Change sale module view, treestrings, names, button names

By
kristian
on 12/4/13, 4:23 PM 1,606 views

I need to change for instance in the treeview of openerp's sale module, just the tree strings of quotation and sale order

To accomplish this, i'm making a brand new module (init _openerp_ and view.xml files)

I will inherit the view and then override name with xpath problem is, i still can't accomplish it, it is giving me an

Traceback (most recent call last):
File "C:\Program Files\OpenERP 7.0-20130726-231403\Server\server\openerp\addons\base\ir\ir_ui_view.py", line 126, in _check_render_view
File "C:\Program Files\OpenERP 7.0-20130726-231403\Server\server\.\openerp\osv\orm.py", line 2235, in fields_view_get
File "C:\Program Files\OpenERP 7.0-20130726-231403\Server\server\.\openerp\osv\orm.py", line 2193, in apply_view_inheritance
File "C:\Program Files\OpenERP 7.0-20130726-231403\Server\server\.\openerp\osv\orm.py", line 2177, in apply_inheritance_specs
File "C:\Program Files\OpenERP 7.0-20130726-231403\Server\server\.\openerp\osv\orm.py", line 2070, in raise_view_error
AttributeError: View definition error for inherited view '' on model 'sale.order': Element '<xpath expr="//tree[@string='Quotation']">' not found in parent view 'sale.view_quotation_tree'
2013-12-04 17:37:00,220 6912 ERROR test openerp.tools.convert: Parse error in    file:///C:/Program%20Files/OpenERP%207.0-20130726-231403/Server/server/openerp/addons/cambio_nombre_ventas/servicios_view.xml:4: 
<record model="ir.ui.view" id="view_quotation_tree_inherited">
<field name="name">sale.order.tree.inherit</field>
<field name="model">sale.order</field>
<field name="type">tree</field>
<field name="inherit_id" ref="sale.view_quotation_tree"/>
<field name="arch" type="xml">
 <xpath expr="//tree[@string='Quotation']" position="attributes">
    <attribute name="string">Servicios</attribute>
 </xpath>
</field>
</record>
Traceback (most recent call last):
File "C:\Program Files\OpenERP 7.0-20130726-231403\Server\server\.\openerp\tools\convert.py", line 847, in parse
File "C:\Program Files\OpenERP 7.0-20130726-231403\Server\server\.\openerp\tools\convert.py", line 814, in _tag_record
File "C:\Program Files\OpenERP 7.0-20130726-231403\Server\server\openerp\addons\base\ir\ir_model.py", line 963, in _update
File "C:\Program Files\OpenERP 7.0-20130726-231403\Server\server\openerp\addons\base\ir\ir_ui_view.py", line 103, in create
File "C:\Program Files\OpenERP 7.0-20130726-231403\Server\server\.\openerp\osv\orm.py", line 4470, in create
File "C:\Program Files\OpenERP 7.0-20130726-231403\Server\server\.\openerp\osv\orm.py", line 1544, in _validate
except_orm: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')

My code is:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="view_quotation_tree_inherited" >
<field name="name">sale.order.tree.inherit</field>
<field name="model">sale.order</field>
<field name="type">tree</field>
<field name="inherit_id" ref="sale.view_quotation_tree"/>
<field name="arch" type="xml">
 <xpath expr="//tree[@string='Quotation']" position="attributes">
    <attribute name="string">Servicios</attribute>
 </xpath>
</field>
</record>

<record id="view_order_form_inherited" model="ir.ui.view" >
<field name="name">sale.order.form.inherit</field>
<field name="model">sale.order</field>
<field name="type">form</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
 <xpath expr='//button[@string="Confirm Sale"]' position='attributes'>
 <attribute name="string">Función Verde</attribute>
 </xpath>
</field>
</record>
</data>

</openerp>

Any ideas about this? I think the error comes from the xpath sintax, but i'm not sure

Thanks in advance

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

0 follower(s)

Stats

Asked: 12/4/13, 4:23 PM
Seen: 1606 times
Last updated: 3/16/15, 8:10 AM