Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
1011 Ansichten

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
Verwerfen
Autor Beste Antwort

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

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
3
Okt. 24
3036
0
Aug. 25
118
1
Apr. 25
741
1
Juni 25
1528
1
März 25
1046