Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
2660 Tampilan

can i create new sequence type by override create method not by xml in odooV8 ?

Avatar
Buang
Jawaban Terbai

Yes, because they are just regular Odoo objects like any other (ir.sequence), but why would you? What would be the benefit of creating sequences on the spot? And why create new sequences that do not belong to a module per default?

If you create a sequence using the regular XML way, the sequence does not nesc. have to be used anyway.

Avatar
Buang
Penulis

because the sequence format that i want is defend on partner_id.id, whenever i choose different partner , the sequence changes as well

So, you will need a sequence per partner actually? What part should be the sequence in this case? Something like "partner_id-sequence_number"? If that is really the case AND the sequences for 2 partners may overlap (so partner X can have 0001 and partner y can have 0001 as well), then it might indeed be handy to create them on te spot. The only thing is, I don't think by default you can assign a sequence to a particular partner, so if you need that functionality you should build it yourself. An additional field should be enough I suppose.