Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
221 Prikazi

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?

Avatar
Opusti
Avtor Best Answer

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

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
3
okt. 24
1855
1
apr. 25
209
2
mar. 25
458
1
mar. 25
346
0
jan. 25
307