I was trying to create a new company when a record is created in my module but using the create method
but I can't get it to work
@api.model
def create(self, vals):for n_record in self:company_info ={'company_type': 'company','name': n_record.new_company_name,'vat': n_record.company_trn}record = n_record.env['base.view_partner_form'].create(company_info)return record
I got this error and I can't understand the Error
Odoo Server Error Traceback (most recent call last): ........ ........
return result.id if isinstance(args[0], Mapping) else result.ids AttributeError: 'NoneType' object has no attribute 'id'
can please help
edit
@api.modeldef create(self, vals):company_info ={'company_type': 'company','name': self.new_company_name,'vat': self.company_vat}record = self.env['res.partner'].create(company_info)return record
Something went wrong !
Contacts require a name
Override odoo methods: https://goo.gl/4BkizH