I still haven’t been able to figure out why the Post button remains hidden. I tried comparing the XHR on the model.account.invoice.fields_view_get between the admin user and the limited user. I found that the account.invoice
form returned for the limited user does not return the button tag and instead it returns:
<label id="hidden post-0"/>
in the position where I would find the post button definition. The most strange thing is that I can see the Pay button tag present right after, which the limited user does not have access to. So anyone have any clue what is happening?
The complete buttons section is the following:
<group col="-1" colspan="3" id="buttons">
<button name="cancel" icon="tryton-cancel" string="Cancelar" help="Cancelar la factura" confirm="¿Está seguro que quiere cancelar la factura?" states="{"invisible": {"__class__": "Not", "v": {"__class__": "Eval", "v": "allow_cancel", "d": false}}, "depends": ["allow_cancel"], "readonly": true}" type="class"/>
<button name="draft" icon="tryton-back" string="Borrador" help="" confirm="" states="{"invisible": {"__class__": "Or", "s": [{"__class__": "Not", "v": {"__class__": "In", "k": {"__class__": "Eval", "v": "state", "d": ""}, "v": ["cancelled", "validated"]}}, {"__class__": "And", "s": [{"__class__": "Equal", "s1": {"__class__": "Eval", "v": "state", "d": ""}, "s2": "cancelled"}, {"__class__": "Bool", "v": {"__class__": "Eval", "v": "cancel_move", "d": -1}}]}]}, "icon": {"__class__": "If", "c": {"__class__": "Equal", "s1": {"__class__": "Eval", "v": "state", "d": ""}, "s2": "cancelled"}, "t": "tryton-undo", "e": "tryton-back"}, "depends": ["state"]}" type="class"/>
<button name="validate_invoice" icon="tryton-forward" string="Validar" help="También conocida como proforma" confirm="" states="{"pre_validate": ["OR", ["invoice_date", "!=", null], ["type", "!=", "in"]], "invisible": {"__class__": "Not", "v": {"__class__": "Equal", "s1": {"__class__": "Eval", "v": "state", "d": ""}, "s2": "draft"}}, "depends": ["state"]}" type="class"/>
<label id="hidden post-0"/>
<button name="pay" icon="tryton-forward" string="Pagar" help="" confirm="" states="{"invisible": {"__class__": "Not", "v": {"__class__": "Equal", "s1": {"__class__": "Eval", "v": "state", "d": ""}, "s2": "posted"}}, "depends": ["state"], "readonly": true}" type="class"/>
<button name="process" icon="tryton-refresh" string="Procesar" help="" confirm="" states="{"invisible": {"__class__": "Not", "v": {"__class__": "In", "k": {"__class__": "Eval", "v": "state", "d": ""}, "v": ["posted", "paid"]}}, "depends": ["state"], "readonly": true}" type="class"/>
</group>