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

Hello,

I just added the domain attribute in the window action. When I tried to remove it of a ir.actions.act_window in its xml file and update the module, the domain is not removed actually. It works the other way round. How to remove it please ?

        <record id="expense_all" model="ir.actions.act_window">
            <field name="name">Expenses</field>
            <field name="res_model">hr.expense</field>
            <field name="view_type">form</field>
            <field name="search_view_id" ref="view_hr_expense_filter"/>
            <field name="view_id" ref="view_expenses_tree"/>
            <!--<field name="domain">[('user_id','=',uid)]</field>-->

</record>

아바타
취소
베스트 답변

Hi jean44

Better to have domain attribute as it is in xml and remove its value.

Ex:

<record id="expense_all" model="ir.actions.act_window">
<field name="name">Expenses</field>
<field name="res_model">hr.expense</field>
<field name="view_type">form</field>
<field name="search_view_id" ref="view_hr_expense_filter"/>
<field name="view_id" ref="view_expenses_tree"/>
<field name="domain">[]</field>
</record>

Now, when you will update the module, old value in domain field will be replaced with blank value.

Hope this will help you.


아바타
취소

Hello Sudhir, can we inherit action like view? can I use xpath with attributes for change value of domain in action?

This code is fully work sir !!!

Solanki: you have to override the action using its xml ID. Ex:

베스트 답변

Hello Lucio,

You can remove domain from action like this

Go To 

Settings > Technical > Actions > Window Actions >

Type your action name like Expenses

Remove the Domain Value which is inside the General Settings tab.

or

You can also try to @ Sudhir Arya answer's it's also fully work.

I think this is help full for you

Regards,

Ankit H Gandhi.

아바타
취소
작성자 베스트 답변

THANK YOU FOR YOUR REPLY, I THINK IT IS SOME SORT OF  A BUG IN OpenERP, I JUST CHANGED THE ID OF THE WINDOW ACTION, IT SOLVED THE PROBLEM

아바타
취소

This isn't right. It's not a bug. In the XML's you are always "adding" info. See my answer below

베스트 답변

What you're doing sounds correct. Double check that you are updating your module and restarting the openerp-server service. I notice you're trying to add uid in the domain (a very common request that still isn't supported, sadly). That will cause an error in your interface, so if you're trying to reload your module with the "upgrade" button in the interface, that may not work. A better way to reload a module is to do it when running the openerp-server command on the command line:

./openerp-server -c /some/path/openerp-server.conf -u my_custom_module

The paths will be different on your machine, but the "-u module_name" is the key. That will restart the service and cause the module to completely be reloaded.

아바타
취소
베스트 답변

Hi,

when doing changes in an XML, you cannot "remove" info this way. You are always adding or changing the information that is already there.

In  your case, you can just leave the domain tag, but changing the value to be empty or something that always evaluates to "True" (e.g. [('1','=','1')] )

<record id="expense_all" model="ir.actions.act_window">
<field name="name">Expenses</field>
<field name="res_model">hr.expense</field>
<field name="view_type">form</field>
<field name="search_view_id" ref="view_hr_expense_filter"/>
<field name="view_id" ref="view_expenses_tree"/>
<field name="domain">[('1','=','1')]</field>
</record>

Hope this helps someone.

아바타
취소