Odoo Help

0

How to replace the paper format "European A4" by inheritance ?

By
Theudric Enicar
on 6/18/15, 6:09 AM 908 views

Here my xml file:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
         <template id="replace_paper_format_euro" inherit_id="report.paperformat_euro">
             <xpath expr="//field[@name='margin_left']" position="replace">
                 <field name="margin_left">22</field>
             </xpath>

         </template>
    </data>
</openerp>

Error:

ParseError: "ValidateError

Field(s) `arch` failed against a constraint: Invalid view definition

Error details:

Element '<xpath expr="//field[@name='margin_left']">' cannot be located in parent view

Both, solution and comment below work perfectly ! Thanks to all

Theudric Enicar
on 6/19/15, 3:25 AM
1

Ray Carnes

--Ray Carnes--
16818
| 9 7 9
Atlanta, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0; Odoo 8.0, 9.0, 10.0.

Completed Odoo Functional and Technical Training.

Major Skills:

  • User Needs and GAP Analysis;

  • Functional and Technical Design;

  • Prototyping and Proof of Concepts;

  • Requirements Specifications;

  • Agile Implementation;

  • Data Migration;

  • Configuration & Customization (UI and code);

  • Integration - Odoo and non Odoo Applications and Services;

  • Training and Knowledge Transfer;

  • Go Live Support;

  • Helpdesk;

  • Version Upgrades and Migration.

  • Accounting Expert.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

I am a skilled Communicator and I only take the serious things seriously!

Ray Carnes
On 6/18/15, 9:09 PM

Take a look at the way Odoo is actually creating the record in the database for "European A4".

You will find it in the addons/report/data/report_format.xml file.

 <record id="paperformat_euro" model="report.paperformat"> 
<field name="name">European A4</field> <field name="default" eval="True" /> <field name="format">A4</field> <field name="page_height">0</field> <field name="page_width">0</field> <field name="orientation">Portrait</field> <field name="margin_top">40</field> <field name="margin_bottom">23</field> <field name="margin_left">7</field> <field name="margin_right">7</field> <field name="header_line" eval="False" /> <field name="header_spacing">35</field> <field name="dpi">90</field> </record>

How about an XML file like this instead of what you have:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>

<record id="paperformat_euro" model="report.paperformat">
<field name="margin_left">22</field>
</record>

</data>
</openerp>

Note that the id must be "report.paperformat_euro" because when inheriting like this, you need to give the full xml name.

Limitless Virtual Enterprise, Andre de Kock
on 6/19/15, 2:51 AM

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 6/18/15, 6:09 AM
Seen: 908 times
Last updated: 6/19/15, 3:29 AM