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

Hello,

I want to know what is the orm model function to call if my model changed without the UI event ?

I'd like to use @api.onchange('state') to execute a method. But it does not work because @api.onchange only works if the UI change value. What is the function to call if backend/background changed without the UI event ??


Thanks

الصورة الرمزية
إهمال

Can you give some details like what you want to achieve using a function?

أفضل إجابة

create() and write() function anyway need to invoke whenever you need to add any updates in the corresponding model. So you can trace any changes through these ORM Functions.

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

@api.constrains('state') should the trick for you.

This is called whenever the state field is written to, whether it's saving from the UI, or from another call.

Cheers,

Jake Robinson 

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
write() vs update() تم الحل
4
سبتمبر 20
41861
1
أغسطس 25
357
2
يوليو 25
2806
3
يوليو 25
624
1
يونيو 25
2074