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
- Comptabilité
- Inventaire
- PoS
- Project
- MRP
Cette question a été signalée
2
Réponses
6917
Vues
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
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrire
Hope these tips will help you: https://old.reddit.com/r/learnodoo/