How to Override "ir.sequence" field in csv import in Odoo? -
i'm trying import new customer data odoo using csv import. there 1 field customer_id_no
auto generated when record created(using "ir.sequence").
now each customer record in csv has unique customer_id_no
when try import it, existing customer_id_no
overridden standard sequence.
how can insert data csv in odoo?
also unable find answer import many2one fields. on greatful.
@czoellner right. have change method. :
@api.model def create(self, vals): vals['customer_id_no'] = mechanics_to_generate_sequence() return super(classname, self).create(vals)
it needs address case customer_id_no provided. this
@api.model def create(self, vals): if not vals.get('customer_id_no'): vals['customer_id_no'] = mechanics_to_generate_sequence() return super(classname, self).create(vals)
note afterward need make sequence next iteration value next highest in customer_id_no
.
Comments
Post a Comment