Hi, I have a module that depends on sale module and i have used sale order in my views, i want to generate sequence for only the orders which have new field values according to the new module. How can i do that?? If i create sequence from openerp menu than it applies the new sequence field to all the previous orders too. urgent help required! Thanks in advance
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
By using ORM method create, you can provide conditional sequence to any field and also by using the condition, we can even select which sequence to load for a particular field, so for your case:
def create(self, cr, uid, vals, context=None):
if vals.get('chalan')=='Chalan':
if vals.get('chalan_number','/')=='/':
vals['chalan_number'] = self.pool.get('ir.sequence').get(cr, uid, 'your_sequence_name') or '/'
return super(your_class_name,self).create(cr, uid, vals, context=context)
i inherited sale order and added two new fields named chalan and chalan_number, i want the chalan_number generated if chalan's value is 'Chalan'. If i create a sequence then the chalan number is entered in all the previously made sale orders.
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
Views affect back on inherited views.
แก้ไขแล้ว
|
|
2
พ.ย. 20
|
5627 | |
|
4
ก.พ. 25
|
2921 | ||
|
1
ส.ค. 24
|
2312 | ||
|
2
พ.ย. 24
|
3509 | ||
|
3
ต.ค. 23
|
15008 |
i inherited sale order and added two new fields named chalan and chalan_number, i want the chalan_number generated if chalan's value is 'Chalan'. If i create a sequence then the chalan number is entered in all the previously made sale orders.
You need create custom python code with check your new field.
If i create sequence from Openerp settings menu than is it possible to generate that sequence with condition on clicking compute button in sale_order view?