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
- Accounting
- Inventory
- PoS
- Project
- MRP
This question has been flagged
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
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