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

Overwrite ir.actions.act_window?

By
Luís
on 2/19/14, 5:04 PM 2,800 views

Hi,

I want overwrite the next act_window on my new module.

portal_sale/portal_sale_view.xml

<record id="portal_action_invoices" model="ir.actions.act_window">
        <field name="name">Invoices</field>
        <field name="res_model">account.invoice</field>
        <field name="view_mode">tree,form</field>
        <field name="domain">[('type','in',['out_invoice','out_refund'])]</field>
        <field name="context">{'type':['out_invoice','out_refund'], 'journal_type': 'sale'}</field>
        <field name="search_view_id" ref="account.view_account_invoice_filter"/>
        <field name="help">We haven't sent you any invoice.</field>
    </record>

I try do this:

<record id="portal_sale.portal_action_invoices" model="ir.actions.act_window">
        <field name="name">Invoices</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">account.invoice</field>
        <field name="view_mode">tree,form</field>
        <field name="domain">[('type','in',['out_invoice','out_refund']),('state','in',['open','paid'])]</field>
        <field name="context">{'type':['out_invoice','out_refund'], 'journal_type': 'sale'}</field>
        <field name="search_view_id" ref="account.view_account_invoice_filter"/>
        <field name="help">We haven't sent you any invoice.</field>
    </record>

But I have this error:

<record id="portal_action_invoices_inherit" model="ir.actions.act_window">
        <field name="name">Invoices</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">account.invoice</field>
        <field name="view_mode">tree,form</field>
        <field name="domain">[('type','in',['out_invoice','out_refund']),('state','in',['open','paid'])]</field>
        <field name="context">{'type':['out_invoice','out_refund'], 'journal_type': 'sale'}</field>
        <field name="search_view_id" ref="account.view_account_invoice_filter"/>
        <field name="help">We haven't sent you any invoice.</field>
    </record>
    Traceback (most recent call last):
     File "/opt/openerp/trunk/openerp/tools/convert.py", line 847, in parse
     self._tags[rec.tag](self.cr, rec, n)
     File "/opt/openerp/trunk/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 "/opt/openerp/trunk/openerp/addons/base/ir/ir_model.py", line 963, in _update
     res_id = model_obj.create(cr, uid, values, context=context)
     File "/opt/openerp/trunk/openerp/osv/orm.py", line 4470, in create
    self._validate(cr, user, [id_new], context)
    File "/opt/openerp/trunk/openerp/osv/orm.py", line 1544, in _validate
    raise except_orm('ValidateError', '\n'.join(error_msgs))
    except_orm: ('ValidateError', u'Ocorreu um erro ao validar o campo(s) res_model,src_model: Nome de modelo   inv\xe1lido na defini\xe7\xe3o da a\xe7\xe3o')

Anyone helps me please?

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: 2/19/14, 5:04 PM
Seen: 2800 times
Last updated: 3/16/15, 8:10 AM