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:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project
- MRP
This question has been flagged
2
Replies
6857
Views
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
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up
Hope these tips will help you: https://old.reddit.com/r/learnodoo/