I need the salesperson to always be the same when creating a new sales order.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Akuntansi
- Inventaris
- PoS
- Project
- MRP
Pertanyaan ini telah diberikan tanda
Hi,
* Enable debug mode
* Select the sales person in the field
* Click Debugger button
* Click Set Defaults
* In Pop up, select sales person = value in the field
* Save
See: How To Set Default Value For A Field in Odoo
Now the selected sales person will be defaulted always.
Thanks
Activate Developer Mode> Edit Sales Order Form> Enable Debugging> Customization> Locate Sales Order Model> Set Default Value > Save Changes.
Hello Maicon,
You can use following code to set default salesperson
from odoo import models, fields
class ResPartner(models.Model):
_inherit = 'res.partner'
def default_get(self, fields):
res = super(ResPartner, self).default_get(fields)
if 'user_id' in fields:
res['user_id'] = your_default_salesperson_id # Replace with appropriate ID
return res
I hope this code will help you
Thanks & Regards,
Ankit Vaghela
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
Daftar