콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
257 화면

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

아바타
취소
관련 게시물 답글 화면 활동
3
10월 24
1894
1
4월 25
225
2
3월 25
495
1
3월 25
360
0
1월 25
320