Hi,
how can I create a new group in form tree on a related field ?
in a form tree, I have "filters", "group" and "favorites", how can I add a custom group on related field ?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi,
how can I create a new group in form tree on a related field ?
in a form tree, I have "filters", "group" and "favorites", how can I add a custom group on related field ?
To don't get the error when using store=True you need to add the relation argument to the field definition, using of course the same model name as the original category_ids field, for example:
##updated
asset_cat = fields.Many2many(related='asset_id.category_ids', store =True, relation='account.asset.category', column1='asset_id', column2='categ_id')
now I have this bug
Traceback (most recent call last):
File "C:\Program Files (x86)\Odoo 10.0\server\odoo\modules\registry.py", line 78, in new
File "C:\Program Files (x86)\Odoo 10.0\server\odoo\modules\loading.py", line 335, in load_modules
File "C:\Program Files (x86)\Odoo 10.0\server\odoo\modules\loading.py", line 237, in load_marked_modules
File "C:\Program Files (x86)\Odoo 10.0\server\odoo\modules\loading.py", line 136, in load_module_graph
File "C:\Program Files (x86)\Odoo 10.0\server\odoo\modules\registry.py", line 315, in init_models
File "C:\Program Files (x86)\Odoo 10.0\server\odoo\models.py", line 2361, in _auto_init
File "C:\Program Files (x86)\Odoo 10.0\server\odoo\fields.py", line 2308, in check_schema
File "C:\Program Files (x86)\Odoo 10.0\server\odoo\sql_db.py", line 141, in wrapper
File "C:\Program Files (x86)\Odoo 10.0\server\odoo\sql_db.py", line 218, in execute
ProgrammingError: ERREUR: la colonne ¶® None ¶¯ apparaÇ©t deux fois sur une contrainte unique
LINE 1: ..."None" INTEGER NOT NULL, "None" INTEGER NOT NULL, UNIQUE("No...
Sorry but I don't understand french yet, :), that seems to be that it will need more args for the column on the relation table, I will update the answer
haha sorry, it's mean
The None column appears twice on the unique constraint
try the update
Thank you, I try it, the error doesn't appear but now I have an error on the interface
"Uncaught TypeError: Cannot read property 'context' of undefined"
http://localhost:8069/web/content/299-4061cb3/web.assets_backend.js:1622
Retraçage :
TypeError: Cannot read property 'controller' of null
at Class.set_scrollTop (http://localhost:8069/web/content/299-4061cb3/web.assets_backend.js:1622:699)
at Class.set_on_reverse_breadcrumb (http://localhost:8069/web/content/299-4061cb3/web.assets_backend.js:1622:615)
at Class.prototype.(anonymous function) [as set_on_reverse_breadcrumb] (http://localhost:8069/web/content/251-5bab1d0/web.assets_common.js:3009:559)
at Class.push_action (http://localhost:8069/web/content/299-4061cb3/web.assets_backend.js:1625:43)
at Object.<anonymous> (http://localhost:8069/web/content/299-4061cb3/web.assets_backend.js:1662:170)
at Object.<anonymous> (http://localhost:8069/web/content/251-5bab1d0/web.assets_common.js:547:681)
at fire (http://localhost:8069/web/content/251-5bab1d0/web.assets_common.js:541:299)
at Object.add [as done] (http://localhost:8069/web/content/251-5bab1d0/web.assets_common.js:542:467)
at Array.<anonymous> (http://localhost:8069/web/content/251-5bab1d0/web.assets_common.js:547:649)
at Function.each (http://localhost:8069/web/content/251-5bab1d0/web.assets_common.js:370:767)
so I can see my tree view or my filter field
I used "store= True" but now I can't access to my database.
so, I delete "store= True" to reaccess database.
any other solution for filter with related field please ?
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
0
Mar 15
|
8980 | ||
[V10] custom Group by
Solved
|
|
2
May 17
|
7227 | |
|
0
May 15
|
4641 | ||
|
0
May 15
|
4817 | ||
|
0
Sep 23
|
1026 |
my field's definition is :
asset_cat = fields.Many2many(related='asset_id.category_ids', store =True)
what's wrong ?