How can I adapt the following code for odoo17
1) attrs="{'invisible': [('identification_id', 'in', [None,False])]}"/>
2) attrs="{'invisible': [('user_id', '=', False)]}"
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
How can I adapt the following code for odoo17
1) attrs="{'invisible': [('identification_id', 'in', [None,False])]}"/>
2) attrs="{'invisible': [('user_id', '=', False)]}"
Hi
Try the following
1 ) invisible ="identification_id in [None,False]"
2 ) invisible ="not user_id"
Regards
Hi Mily,
What might be the below one:
attrs="{'invisible': [('has_badges', '=', True)]}"
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'"
Hi,
What about states
states='draft
invisible="state != 'draft'", also check this https://github.com/OCA/server-tools/tree/17.0/views_migration_17
What might this one
attrs="{'invisible': [('sheet_ids', '=', [])]}"
invisible="not sheet_ids"
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"
Can anyone help me to solve the above codes?
I just only want the code for 1,2 and 3.
Can anyone help me on it.
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.
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up