تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
9643 أدوات العرض

<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
أغسطس 21
38580
7
يوليو 18
12800
1
أبريل 19
4944
3
يوليو 16
5301
3
سبتمبر 15
16850