Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
1005 มุมมอง

Hey Odoo devs,

I'm working on a POS customization in Odoo 18, using the latest OWL 2-powered frontend. I needed to add a simple disabled prop to the ActionpadWidget — nothing fancy — just to conditionally block the payment button for certain users.

So I did what seems obvious:

  • Patched the component:


    patch(ActionpadWidget.prototype, { props: { ...ActionpadWidget.props, disabled: { type: Boolean, optional: true }, }, });

  • Extended the template:

    <xpath expr="//ActionpadWidget" position="attributes"> <attribute name="disabled">this.pos.user.pos_block_payment</attribute> </xpath>

And bam — Owl throws:

OwlError: Invalid props for component 'ActionpadWidget': unknown key 'disabled'

Apparently, the template gets validated before the patch is applied?
Is there a clean workaround I’m missing here?

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

sorry, my bad,
I got to patch ActionpadWidget not ActionpadWidget.prototype

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ต.ค. 24
3033
0
ส.ค. 25
114
1
เม.ย. 25
740
1
มิ.ย. 25
1523
fixed-amount discount แก้ไขแล้ว
1
มี.ค. 25
1044