How to generate aut number for opportunity?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
3
Odpowiedzi
10065
Widoki
You mean like using a sequence to generate numbers also with a prefix:
class crm_lead(models.Model):
_inherit = 'crm.lead'
name = fields.Char(default='/')
@api.model
def create(self, vals):
if vals.get('name', False) == '/':
vals['name'] = self.env['ir.sequence'].next_by_code('crm.lead.seq')
return super(crm_lead, self).create(vals)
Depending on the Odoo version(ex: v8) you need to include the sequence type like:
<record id="sequence_crm_lead_type" model="ir.sequence.type">
<field name="name">CRM Lead Sequence Type</field>
<field name="code">crm.lead.seq</field>
</record>
And add the sequence record
<record id="sequence_crm_lead" model="ir.sequence">
<field name="name">CRM Lead Sequence</field>
<field name="code">crm.lead.seq</field>
<field name="prefix">OP</field>
<field eval="1" name="number_next"/>
<field eval="1" name="number_increment"/>
</record>
Hope this helps
Add the ID field to the views - it is already a unique number assigned automatically by Odoo to each document (the database id).
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
1
cze 23
|
1744 | ||
|
1
paź 24
|
1724 | ||
|
0
kwi 22
|
2349 | ||
|
0
paź 17
|
3205 | ||
How To Edit Order Numbers?
Rozwiązane
|
|
2
cze 24
|
4053 |