Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
9273 Zobrazení

How can I adapt the following code for odoo17

1) attrs="{'invisible': [('identification_id', 'in', [None,False])]}"/>

2) attrs="{'invisible': [('user_id', '=', False)]}"

Avatar
Zrušit
Nejlepší odpověď

Hi 

Try the following 


1 ) invisible ="identification_id in [None,False]"

2 ) invisible ="not user_id" 



Regards


Avatar
Zrušit
Autor

Hi Mily,
What might be the below one:
attrs="{'invisible': [('has_badges', '=', True)]}"

Autor

Hi,
How should I change this one
attrs="{'readonly': ['|',('read_only','=',False),('state','=','approved')]}"

try this , invisible="has_badges", readonly="read_only == False or state == 'approved'"

Autor

Hi,
What about states
states='draft

Autor

What might this one
attrs="{'invisible': [('sheet_ids', '=', [])]}"

invisible="not sheet_ids"

Autor

Can you help me to find all of it.

1) attrs="{'invisible': ['|', ('attachment_number', '<=', 0), ('sheet_id', '!=', False)]}"
2) attrs="{'invisible': [('attachment_number', '>=', 1)]}"
3) attrs="{'invisible': [('same_currency', '=', True), ('product_has_cost', '=', False)]}"
4) attrs="{'invisible': ['|', ('accounting_date', '=', False), ('state', 'not in', ['approved', 'done'])]}"
5) attrs="{'invisible': ['|', ('payment_state', 'in', ('paid', 'in_payment')), ('state', 'not in', ('post', 'done'))]}"
6) attrs="{'invisible': ['|', ('can_reset', '=', False), ('state', 'not in', ['submit', 'cancel', 'approve'])]}"
7) attrs="{'invisible': ['|', ('state', 'not in', ['post', 'done']), ('account_move_id', '=', False)]}"
8) attrs="{'invisible': ['|', ('payment_mode', '=', 'own_account'), ('payment_state', 'not in', ['paid', 'in_payment', 'partial'])]}"
9) attrs="{'invisible': [('state', 'not in', ['approve', 'post', 'done'])], 'readonly': [('state', 'in', ['post', 'done'])]}"/>
10) attrs="{'invisible': [('state', 'not in', ('post', 'done'))]}"
11) states="submit,approve"

Autor

Can anyone help me to solve the above codes?

Autor

I just only want the code for 1,2 and 3.
Can anyone help me on it.

Nejlepší odpověď

For anyone stilll looking for answers use:

From:

1) attrs="{'invisible': [('identification_id', 'in', [None,False])]}"/>

To

invisible="[('identification_id', 'in', [None, False])]"

According to the Odoo 17 docs, the brackets syntax still works, but one needs to use the attribute name instead of declaring it as an object in attrs.

Tested it and it worked.

Avatar
Zrušit