Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
8236 Lượt xem

Hi everyone,

   What would the right way to add odoo fields as prefix in sequence? I want to use Internal Reference field (ref; res_partner) as prefix to order number sequence code, so i know straight ahead who is the customer by looking at order number. 

Thanks in advance.

Ảnh đại diện
Huỷ bỏ

Is this possible in odoo 16 Saas without customization

Tác giả Câu trả lời hay nhất

Sorry, took me a while to come back to this. Which file should I be working on? Sorry, i'm new to odoo. Where does it keep sequence setting for sales orders?

ok, i found file ir_sequence.py, where i should add my field (by the way, field i want to show in sequence is "doc.partner_id.ref". How can i define it and make it work as, let say %(ref) in my sequence settings? Thanks!

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

In create() method you can append it

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 5 25
2412
1
thg 9 24
1331
1
thg 6 23
2319
1
thg 4 23
11392
1
thg 6 22
2652