Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Artificial Intelligence
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Custom made module / ir.cron inheritance

Subscribe

Get notified when there's activity on this post

This question has been flagged
xmlinheritanceir.cron
5 Replies
9921 Views
Avatar
Fabien REMY

Hi all,

I wish to add a custom field on the cron module (a description field, in order to describe the goal of the cron).

I can add the field on the table ir_cron, but when I try to add that field on the view, the error message is :

openerp.addons.base.ir.ir_ui_view: Can't render view for model: ir.cron

Here is the XML code :

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

<openerp>

    <data>

         <record id="view_ir_cron_extended" model="ir.ui.view">

             <field name="name">view.ir.cron.extended</field>

             <field name="model">ir.cron</field>

             <field name="inherit_id" ref="base.ir_cron_view"/>

             <field name="arch" type="xml">

                 <xpath expr="/form/sheet/page[@string='Information']/field@name='doall']" position="after">

                     <field name="description" />

                 </xpath>

             </field>

        </record>

     </data>    

</openerp>


Thank you for your help.

0
Avatar
Discard
Baiju KS

please give more details about error log for better understanding

Fabien REMY
Author

Hi, My custom module seems to be very simple: __init__.py (empty) __openerp__.py (depends on base) ir_cron.py (add the field description to the ir.cron entity) ir_cron_view.xml (add the field on the form view) Here is the full stack when I try to install it : 2015-10-27 08:16:44,038 2216 ERROR openerp_bdd openerp.osv.orm: Can't find field 'description' in the following view parts composing the view of object model 'ir.cron': * view.ir.cron.extended Either you wrongly customized this view, or some modules bringing those views are not compatible with your current data model 2015-10-27 08:16:44,039 2216 ERROR openerp_bdd openerp.addons.base.ir.ir_ui_view: Can't render view for model: ir.cron Traceback (most recent call last): File "D:\workspace_luna\openerp_server\openerp-7\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) File "D:\workspace_luna\openerp_server\openerp-7\openerp\osv\orm.py", line 2260, in fields_view_get xarch, xfields = self.__view_look_dom_arch(cr, user, result['arch'], view_id, context=ctx) File "D:\workspace_luna\openerp_server\openerp-7\openerp\osv\orm.py", line 1937, in __view_look_dom_arch raise except_orm('View error', msg) except_orm: ('View error', u"Can't find field 'description' in the following view parts composing the view of object model 'ir.cron':\n * view.ir.cron.extended\n\nEither you wrongly customized this view, or some modules bringing those views are not compatible with your current data model") 2015-10-27 08:16:44,055 2216 ERROR openerp_bdd openerp.tools.convert: Parse error in file:///D:/workspace_luna/git_repos/openerp_addons_spec/isg_ir_cron_extended/view/ir_cron_view.xml:5: view.ir.cron.extended ir.cron Traceback (most recent call last): File "D:\workspace_luna\openerp_server\openerp-7\openerp\tools\convert.py", line 847, in parse self._tags[rec.tag](self.cr, rec, n) File "D:\workspace_luna\openerp_server\openerp-7\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 "D:\workspace_luna\openerp_server\openerp-7\openerp\addons\base\ir\ir_model.py", line 963, in _update res_id = model_obj.create(cr, uid, values, context=context) File "D:\workspace_luna\openerp_server\openerp-7\openerp\addons\base\ir\ir_ui_view.py", line 103, in create return super(view, self).create(cr, uid, values, context) File "D:\workspace_luna\openerp_server\openerp-7\openerp\osv\orm.py", line 4470, in create self._validate(cr, user, [id_new], context) File "D:\workspace_luna\openerp_server\openerp-7\openerp\osv\orm.py", line 1544, in _validate raise except_orm('ValidateError', '\n'.join(error_msgs)) except_orm: ('ValidateError', u'Une erreur est apparue lors de la validation du/des champ(s) arch: Invalid XML for View Architecture!') 2015-10-27 08:16:44,058 2216 ERROR openerp_bdd openerp.netsvc: ValidateError Une erreur est apparue lors de la validation du/des champ(s) arch: Invalid XML for View Architecture! Traceback (most recent call last): File "D:\workspace_luna\openerp_server\openerp-7\openerp\netsvc.py", line 296, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "D:\workspace_luna\openerp_server\openerp-7\openerp\service\web_services.py", line 626, in dispatch res = fn(db, uid, *params) File "D:\workspace_luna\openerp_server\openerp-7\openerp\osv\osv.py", line 188, in execute_kw return self.execute(db, uid, obj, method, *args, **kw or {}) File "D:\workspace_luna\openerp_server\openerp-7\openerp\osv\osv.py", line 144, in wrapper raise except_osv(inst.name, inst.value) except_osv: ('ValidateError', u'Une erreur est apparue lors de la validation du/des champ(s) arch: Invalid XML for View Architecture!') > d:\workspace_luna\openerp_server\openerp-7\openerp\osv\osv.py(144)wrapper() -> raise except_osv(inst.name, inst.value) (Pdb) Cheers.

Fabien REMY
Author

Sorry for the text formating :-)

Avatar
Temur
Best Answer

per your description of module structure, __init__.py can NOT be empty, it should contain following line:

import  ir_cron

(add this line to __init__.py, also make sure you restart odoo after this change)

1
Avatar
Discard
Avatar
Fabien REMY
Author Best Answer

Hi Temur,

You're right ! I've tried to put from . import ir_cron in my __init__.py but the result was the same.

Thank you for your reactivity (again) ! :-)


0
Avatar
Discard
Dave Burkholder

For the "from . import ir_cron" syntax to work, I believe you need to enable absolute imports first, by "from __future__ import absolute_import" and then do your absolute import of "from . import ir_cron".

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
Editing Views with XML - Please Help
invoice xml inheritance
Avatar
0
Apr 22
4451
How to use varibales in <t t-foreach tag
xml inheritance qweb
Avatar
3
Aug 20
29431
Resolving Overide Conflicts on xml views
xml inheritance override
Avatar
Avatar
2
Feb 17
4484
how to show a field from parent view in openerp ??
xml view inheritance
Avatar
0
Mar 15
5559
Need Informations About OpenErp Technical ?
xml inheritance postgresql
Avatar
0
Mar 15
3704
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk Slovenščina Español (América Latina) Español Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now