تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
5 الردود
24718 أدوات العرض

Hello my friends;

Would anyone help me find how to open a wizard when i click on button create of sale.order model.

How to override this action to :

1-Open WIzard

2-After writing in Wizard, open the form view of sale_order model

Thanks a lot in advance.

Best regards.

الصورة الرمزية
إهمال
أفضل إجابة

Hi Vale,

There is a framework limitation to do that. You cannot return anything from create method except the recordset of the new record.

As an alternate way, you can create a new button that will call the wizard.

Hope this will help you.

الصورة الرمزية
إهمال
أفضل إجابة

Hey

Please follow the below step to redirect the wizard.

from odoo.exceptions import RedirectWarning

@api.model
def create(self, vals):
res = super().create(vals)
 wizrd_action_id = self.env.ref('stock_move_location.wiz_stock_quant_location_action')
msg = "Are You sure! "
raise RedirectWarning(msg, wizrd_action_id.id, _('Go to the wizard'),
{'active_id': self._origin.id,})
الصورة الرمزية
إهمال

This should be the alternative answer. The idea is when something is triggered it will be redirect user to the "real" action or wizard that we intended to show to user.

This is great

أفضل إجابة

You can do that!

1) Hide button Create and Import and make new a button. Ex: "Test"

Ex: ListView

github . com/odoo/odoo/blob/11.0/addons/web/static/src/xml/base.xml#L412-L426

2) Override button - renderButtons: function ($node) to open your "WIzard"

github . com/odoo/odoo/blob/11.0/addons/web/static/src/js/views/list/list_controller.js#L124-L131

3) In your form view "WIzard", at the footer you should 2 buttons : "Save" and "Close"
@api.multi

def save_action(self):

    ...................

    ...................

    #your_code

    self.env['your_model'].create({value})

    return {
                'view_type': 'form',
                'view_mode': 'form',
                'res_model': 'sale.order,
                'type': 'ir.actions.act_window',
                'target': 'new',
                'res_id': False,
            }

الصورة الرمزية
إهمال
أفضل إجابة

Hi, you can follow following link for this:

https://youtu.be/oMnHpHH54QU

Thanks

الصورة الرمزية
إهمال
أفضل إجابة

Hello 

in odoo 11 install the CRM module. 

go to menu CRM -> pipeline -> pipeline. click on create button.

might be possible this will helps you.

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
4
سبتمبر 19
7637
2
يوليو 24
14098
1
يوليو 21
8294
2
أغسطس 20
5402
0
أبريل 20
4779