partner_id = fields.Many2one ( 'res.partner' , string = 'Customer Name')above field give all customer name problem is how can i give default name to this field. thanks
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- 客户关系管理
- e-Commerce
- 会计
- 库存
- PoS
- Project
- MRP
此问题已终结
2
回复
6902
查看
Hi,
You can use the following code for selecting default value your field
def _default_partner(self):Otherwise you can set the default value from the odoo itself.You can refer the following blog for that purpose.
return self.env['res.partner'].search([('name', '=', 'NAME OF THE PARTNER')], limit=1).id
partner_id = fields.Many2one ( 'res.partner' , string = 'Customer Name',default=_default_partner)
https://www.cybrosys.com/blog/how-to-set-and-remove-user-defined-default-in-odoo
Regards
Hope these tips will help you: https://old.reddit.com/r/learnodoo/