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

Hello,

I have create a sequence with our problem but I do not know how to apply it to a given field i.e. I would like my customer references (field 'reference' of contact) to follow that sequence. 

Does anyone know how to link a sequence to a field?


Thank you so much for your help!

Ảnh đại diện
Huỷ bỏ
Tác giả

Thank you very much, both of you!

Câu trả lời hay nhất
you can apply like this:

name = fields.Char(string='Number', required=True, copy=False, default=lambda self: self.env['ir.sequence'].next_by_code('account.reconcile'))


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

Hi,

If you are looking to do it from the code, you can see this video explaining the same: https://www.youtube.com/watch?v=yruFgeKag3s&list=PLqRRLx0cl0homY1elJbSoWfeQbRKJ-oPO&index=18

Also it can be done from the user interface using automated action, if you need to do it from user interface, see this: https://www.youtube.com/watch?v=Cz5eM5FDmTE&list=PLqRRLx0cl0hq6DeOzGlfHyjgBxjN5jW90&index=1

Thanks

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 2 23
5036
0
thg 1 23
94
1
thg 10 22
4322
0
thg 4 22
2860
2
thg 4 25
13177