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

Hello,

I have a form (wizard) that contains default information.

I would like to execute this form automatically by clicking the Create button..

Need help, thanks for advance.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello Tansadio,


For this scenario, you override the create method.

Try this :-

@api.model

def create(self, vals):

    result = super(model_name, self).create(vals)

     return {            

            'name': _('Wizard String'),

            'type': 'ir.actions.act_window',

            'res_model': 'custom.wiz',

            'view_type': 'form',

            'view_mode': 'form',

            'target': 'new',

         }


Hope, it works for you.

Thanks,

Ảnh đại diện
Huỷ bỏ
Tác giả

Thnks Mehta, Your answer is very helpful

Câu trả lời hay nhất

Nice

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

This is the code i used.

<openerp>

<data noupdate="1">

<record id="ir_cron_scheduler_mass_allocation_action" model="ir.cron">

<field name="name">Masse allocation attribution scheduler</field>

<field name="user_id" ref="base.user_root"/>

<field name="interval_number">2</field>

<field name="interval_type">minutes</field>

<field name="numbercall">-1</field>

<field eval="False" name="doall"/>

<field eval="'hr.holidays.mass.allocation'" name="model"/>

<field eval="'create'" name="function"/>

</record>

</data>

</openerp>


So, When i performed this code, i see errors about arguments.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 3 24
1655
1
thg 5 17
8002
3
thg 6 25
2306
0
thg 5 24
1552
3
thg 5 25
9451