Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2857 Lượt xem

I used ir.actions.server model for add an option in action menu item.


Main purpose for using this is to run python code from here.Here i don't want to return a tree or form view here , so i used this method.


I need to add an option only in vendor bills form, but the option is set both invoice and supplier form.

     <record id="account_invoice_accrual_entries_vendor_bill_non_po_action"                          model="ir.actions.server">

           <field name="name">Accrual Entries</field>

           <field name="model_id" ref="model_account_invoice"/>

           <field name="domain">[('type','in',('in_invoice'))]</field>

            <field name="state">code</field>

            <field name="code">

                    if records:

                        records.action_accrual_entries_vendor_bill()

            </field>

      </record>


    <record id="account_invoice_accrual_entries_vendor_bill_non_po" model="ir.values">

        <field name="model_id" ref="account.model_account_invoice"/>

        <field name="name">Accrual Entries</field>

        <field name="key2">client_action_multi</field>

        <field name="key">action</field>

        <field name="model">account.invoice</field>

         <field name="value" eval="'ir.actions.server,' +                      str(ref('account_invoice_accrual_entries_vendor_bill_non_po_action'))" /> 

    </record>



This is the code i try to add domain only for vendor bills. But the option visible in both vendor bills and customer invoice.


anyone knows what is the mistake in my code .??


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 11 24
2174
0
thg 8 22
2326
1
thg 7 22
20010
0
thg 4 22
2975
3
thg 9 21
3165