Community: Framework mailing list archives

expert-framework@mail.odoo.com

Re: raise a warning on create button

by
Daniel Reis
- 10/21/2016 04:03:53
Use a "raise Warning" inside an onchange.
This will produce a non blocking warning message. 

I've been using that through Automated Actions. Look for my Odoo Experience talk slides.

--dr 

No dia 21/10/2016, às 08:52, shabeer m <msg2shabeer@gmail.com> escreveu:

from openerp.exceptions import UserError




@api.model
    def create(self, vals):
        if condition :
            raise UserError('Error message')
        

On Thu, Oct 20, 2016 at 9:12 PM, Christian Valsecchi <christian.valsecchi@outlook.com> wrote:

Hi there,

   I’m trying to raise a warning (when a certain condition is not met) after the user press the button “Create” on sale order creation.

Any ideas? I tried the warning, but I keep getting errors.

 

Thanks a lot for any input

 

Kind Regards,

Christian Valsecchi
IT Manager & Consultant - Technology
Mobile +31.627565200

 

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-framework-62
Post to: mailto:expert-framework@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe




--
with regards
Shabeer M
Contact : 94 00 7 44 77 6

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-framework-62
Post to: mailto:expert-framework@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe