跳至内容
菜单
此问题已终结
1 回复
3303 查看

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



形象
丢弃
相关帖文 回复 查看 活动
3
1月 20
6797
0
1月 16
3681
1
3月 15
4941
2
10月 23
2593
0
3月 15
4927