コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
9866 ビュー

<filter string="Resident" domain="[]" context="{'group_by':'resident'}" options='{"terminology": {

                                    "string_true": "Resident",

                                    "string_false": "Non Resident"

                                }}'/>


resident is boolean Fields. so when i group by it, there should be 2 field appear that is 
True and Undefined so i wanna change that TRUE and Undefined to Resident and Non Resident.

アバター
破棄

For customization of odoo modules read: https://learnopenerp.tumblr.com/

著作者 最善の回答

https://ibb.co/sb4mR8M ======> Link for the Photo

アバター
破棄
最善の回答

Hi, 
you can add a compute field that takes 'Resident' if boolean Is True and 'non resident' if False 
then in your pivot, you consider the new field, not the boolean. 

field1 = fields.Char(string='Resident', compute='compute_resident_char', store=True)
@api.multi @api.depends('resident') def compute_resident_char(self):     for rec in self:         if rec.resident:             rec.field1 = 'Resident'         else:             rec.field1 = 'Non resident'  

If you already have records in your DB, you would think to launch a xmlrpc call to recompute this new field for all records so it gets updated.

Upvote if this helps. If not, you can write back for further analysis. 

Regards.

アバター
破棄
著作者

it does'nt solve my problem

著作者

but thanks for answering

That's how i solved the same problem that i had.

you're welcome.

著作者

Well when i create that function i must change field name in Xml to Field1 right ?

関連投稿 返信 ビュー 活動
2
8月 21
38946
7
7月 18
13017
1
4月 19
5163
3
7月 16
5589
3
9月 15
17039