Error:
raise ParseError(msg) from None # Restart with "--log-handler odoo.tools.convert:DEBUG" for complete traceback
odoo.tools.convert.ParseError: while parsing /opt/odoo17/odoo/addons/gb_hr_payroll_community/views/res_config_settings_views.xml:11
Since 17.0, the "attrs" and "states" attributes are no longer used.
View: res.config.settings.view.form.inherit.hr.payroll in gb_hr_payroll_community/views/res_config_settings_views.xml
View error context:
{'name': 'invalid view'}
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project
- MRP
This question has been flagged
Hi,
In odoo 17 there is technical changes on usage of attrs and states.
You can directly add condition for readonly, invisible,required in respected attribute.
For example in 16 one button was defined as :
For the same button when it comes to odoo 17, its modified in to:
Similarly you will see several code samples,
by comparing odoo 16 and 17 codes and you can modify based on your requirement
Refer this script also for easily converting:
https://github.com/pierrelocus/odoo-attrs-replace
Hope this will help you
Thanks
How will be this one then:
<h2 attrs="{'invisible': ['|', '|', ('module_l10n_fr_hr_payroll', '=', True), ('module_l10n_be_hr_payroll', '=', True), ('module_l10n_in_hr_payroll', '=', True)]}">Payroll</h2>
Update the attrs as this:
invisible="module_l10n_fr_hr_payroll or module_l10n_be_hr_payroll or module_l10n_in_hr_payroll"
Can you help me to find 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)]}"
Hi,
1/ answer to prev question
2/ seems like attrs are also not in use anymore in v17, you need to separate them into separate parameters in the object definition, so for example it will be
xml code:
< field name="name"
invisible="state not in ['done', 'cancel']"
readonly="state in ['ready', 'waiting']"/>
hope it helps
Cheers!
Yes, since 17.0 attrs is removed..If you check the XML you can see that it's replaced by something like this:
invisible="state != 'to remove'"
Hi Ananth,
I can't see anything after the sentence "something like this:" that you just sent.
Hi Ananth,
Now i was able to view it.
Then, how can i correct this one:
<h2 attrs="{'invisible': ['|', '|', ('module_l10n_fr_hr_payroll', '=', True), ('module_l10n_be_hr_payroll', '=', True), ('module_l10n_in_hr_payroll', '=', True)]}">Payroll</h2>
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up