Odoo Help

4

0
10 答案
2
头像

Ivan Elizaryev 俄罗斯联邦

--Ivan Elizaryev--
815
| 4 3 9
Ufa, 俄罗斯联邦
--Ivan Elizaryev--

I tried odoo at the end of 2013. I fell in love in it and have been working with odoo as a freelancer for almost two years. In September 2015 I began operate as a Company and have 5 developers for now.

Ivan, March 2016.

Ivan Elizaryev 俄罗斯联邦
2016/1/15 上午12:56

Try to specify active_test in context to ignore active field


 <field name="remote_ids" context="{'active_test':False}">...
1
Eduardo de Miguel 西班牙
2018/10/25 上午9:35

Option 1:

Put context on your field definition:

remote_ids = fields.One2many(comodel_name='model.remote', inverse_name='remote_inverse', string='Remote IDs', context={'active_test': False})

Note: This context is only applied when searching values.


Option 2:

You can add the context with {'active_test': False} on the action that opens directly the tree/form view, but if you enter on the register vía relational link (click on many2one or something that not implies Menús or Actions), you will not have the context because you are not using the action (and don't see the registers).


0
Andrias Yohanson 印度尼西亚
2015/11/23 上午1:45

I wrote some code here the example.. it works for me

'jo_ids' : fields.one2many('jo.jo', 'employee_id', domain=['|',('active','=',False),('active','=',True)], string='No Jo'),
0
Sathiyan 印度
2013/3/4 上午6:51
  • Adding a filter in the search view for model.form should do.
  • You must have a "active" field in the form view of model.form view to use this,
  • <filter icon="terp-personal+" domain="[('active','=',True)]" name="active" string="Active"/>

Hope it Helps..

5 注释
BREMSKERL REIBBELAGWERKE, Marco Dieckhoff 德国
2013/3/4 上午7:16

Sorry, I don't have a search view when the object is embedded as one2many field :)

Sathiyan 印度
2013/3/4 上午9:11

Then you must inherit one from the model.from

BREMSKERL REIBBELAGWERKE, Marco Dieckhoff 德国
2013/3/4 上午11:06

It's not about showing active lines from model.form, it's about the a subform view of the model related via remote_ids (in model.form), and the implicitly included subform defined by tree and form in field name="remote_ids".

(And yes, of course field name="active" is in the remote_ids block form, as invisible="1". I also tried to add it to tree.)

saad 摩洛哥
2013/3/15 上午8:22

Your one2many field object is 'res.users' ?

BREMSKERL REIBBELAGWERKE, Marco Dieckhoff 德国
2013/3/15 上午8:34

No, it's not res.users, it's an own module in development. But it shouldn't matter at all, which object is related. (As long as it has an "active" field.)

0
头像

saad 摩洛哥

--saad--

1028
| 5 4 10
Casablanca, 摩洛哥
--saad--
saad 摩洛哥
2013/3/4 上午6:29

I think you should override the search function of the one2many field object.

提问
Keep Informed
0 关注者(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now