Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3362 มุมมอง

In France, we like to display the civility (title) in front of the customer's name like this: 

Mr. and Mrs. LASTNAME First name and First name

I want this to appear in address blocks on quotes and invoices in V14

How to ?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

For that you can override the name_get method in the 'res,partner' model to return the name plus the sur name if you have a field that contains the Mr. or Mrs. values. for example

class ResPartnerInherit(models.Model):     
    _inherit = 'res.partner'
    
    sur_name = fields.Selection([('mr','Mr.'),('mrs','Mrs.')])  

    def name_get(self):
        result = []   
            for rec in self:
                result.append((rec.id, '%s - %s' % (rec.sur_name,rec.name)))
        return result



Happy to help :) an upvote will be awesome



อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ม.ค. 20
6877
0
ม.ค. 16
3733
1
มี.ค. 15
4999
2
ต.ค. 23
2657
0
มี.ค. 15
4950