How to set up sequence number in partners?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Comptabilitat
- Inventari
- PoS
- Project
- MRP
This question has been flagged
Hi,
Try this code.
In the xml
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="partner_sequence_id" model="ir.sequence">
<field name="name">Partner Sequence</field>
<field name="code">partner_sequence_
<field name="prefix">PAR/</field>
<field name="padding">0</field>
<field name="number_next">1</field>
</record>
In the py
@api.model
def create(self, vals):
vals['name'] = self.env['ir.sequence'].next_
return super(MyModel, self).create(vals)
Hope it helps
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Registrar-se