hi all iam trying to add a button which will create vendors from emplyoees , but its not working can anyone check my function below ,
@api.model
def create_partner_ven(self, vals):
emp_obj = self.env['res.partner']
print(self.name,"NAME OF EMP --")
emp_obj.create({
'name': self.name,
'supplier_rank':1,
'customer_rank':1,
})
when i click the button i get a popup like :
Contacts require a name
log :
anyone ?
i tried like this too , same result :
@api.model
def create_partner_ven(self, vals):
emp_obj = self.env['res.partner'].browse(self._context.get('active_ids', []))
#active_id = self._context.get('current_id')
#active_id = self._context('active_ids')
print(self.name,"NAME OF EMP --")
emp_obj.create({
'name': self.name,
'supplier_rank':1,
'customer_rank':1,
})