How can I set in the customers, default tags?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- 客户关系管理
- e-Commerce
- 会计
- 库存
- PoS
- Project
- MRP
此问题已终结
In this code is helful for you, change it right now.
partner_id=fields.Many2one('res.partner', 'Partner',change_default=True)
category_id= fields.Many2many('res.partner.category', id1='partner_id', id2='category_id', string='Tags',default=lambda self: self.env['res.partner.category'].search([('name','=','Employee')]))
Hello wizardz,
For set-up default value of tags for customer you need to inherit res.partner and set default value.
Example :
class res_partner(osv.osv):
_inherit = 'res.partner'
def get_category(self,cr,uid,context=None):
res=self.pool.get('ir.model.data').get_object_reference(cr, uid, 'base', 'res_partner_category_17')
return [(6,0,[res[1]])]
_defaults={
'category_id':get_category,
}
Hope this helps.
相关帖文 | 回复 | 查看 | 活动 | |
---|---|---|---|---|
|
1
3月 15
|
4569 | ||
|
1
6月 22
|
2345 | ||
|
8
11月 20
|
17557 | ||
|
0
4月 16
|
3169 | ||
|
3
3月 16
|
17516 |