I added a fields.Selection 'company_origin' with 3 keys in the signup form ('/web/signup'), the value is correctly store on backend.
When user go to user profile '/my/account' I want to set 'country_id' readonly if 'company_origin' has key1 OR key2.
When i write the following code I see the field shown as if it's readonly (color changes), but it will not actually be readonly.
What do I miss to make this work on qweb? Or, if it has to be done in javascript, could you please provide some advice on how to do it ? (how to check selection fields values or keys on js framework?) - Edit: Forgot to say, im working on Odoo14
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="portal_data_extend" inherit_id="portal.portal_my_details"
name="Profile data extend">
<xpath expr="//form//select[@name='country_id']" position="attributes">
<attribute name="readonly">'readonly' if (partner.company_origin == 'key1' or partner.company_origin == 'key2') else None</attribute>
</xpath>
</template>
</odoo>