콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
4 답글
76177 화면

I want to use a piece of code from launchpad that fix a bug in project view:

http://bazaar.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1103408-cha/revision/8536

I know how to inherit view but I don't find how to inherit action. Someone can tell me how can I do?

아바타
취소
베스트 답변

Id of record that inherits other action must be of the following format: module_name where record you are inheriting comes from + '.' + record_id you are inheriting. So it will looks like:

<record id="module_name.record_id" model="record_model">
    <field name="name">New record name</field>
</record>
아바타
취소
작성자

Thanks a lot. I edit your code and that's working well.

i think this one is not inherit, but replace

This is working well if you want to add a filter

<record id="module_name.action" model="ir.actions.act_window">

<field name="search_view_id" ref="search_view_record_id"></field>

<field name="context">{'search_default_field_you_want_to_filter': 1}</field>

</record>

This is replace. not inherit. be careful. If you put any new field inside act_window (for example, you put the new field inside domain field), you'll get error when you uninstall the new module because the field from new module is removed but the xml still refering to xml from new module and not from the original module (since they have same id)

베스트 답변
<record id="account.res_partner_action_supplier" model="ir.actions.act_window">
<field name="context">{}</field>
<field name="domain">[('supplier_rank', '>', 0)]</field>
</record>



Example of update domin action

아바타
취소
베스트 답변

to override old action ....

first add it's record in model="ir.actions.act_window.view"

second  add reference of your form name="view_id" ref="form record id"

<record id="action_all_customers_form" model="ir.actions.act_window.view">
<field name="act_window_id" ref="action_all_customers" />
<field name="view_id" ref="form_all_customers" />
<field name="view_mode">form</field>
<field name="sequence">10</field>
</record>

good luck

아바타
취소
베스트 답변


<record id="custom_invoice_paperformat_inherit" model="report.paperformat">
<field name="name">European A4 low margin</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">5</field>
<field name="margin_bottom">5</field>
<field name="margin_left">5</field>
<field name="margin_right">5</field>
<field name="header_line" eval="False"/>
<field name="header_spacing">0</field>
<field name="dpi">80</field>
</record>


아바타
취소
관련 게시물 답글 화면 활동
0
4월 16
3772
0
3월 15
4758
Why XML in odoo ? 해결 완료
3
3월 25
914
Odoo action error 해결 완료
1
10월 24
5170
45
4월 23
85022