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

Hello, please help me.


i'm using odoo online and use odoo studio for create new apps. I have create new apps with name is INQUIRY.

1. Create Apps INQUIRY

2. On Setting (developer Mode) i create sequence Inquiry_seq with Number INQ-%(y)s%(month)s with sequence size is 6


How can i use that sequence while i create New Inquiry in Form like New Quotation, when i click new and Save it, the Sequence number has created.


Thank you.

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

Hi,
You can create an automated action in the db, which we will read the next sequence from the ir.sequence record and assign it to the field in your model.

Steps to do:
   * Create a record in ir.sequence table
   * Ensure base_automation module is installed in db
   * Create automated action, select model as needed model and trigger on create
   * Add python code to assign the sequence value for field

See the example shown here:  Generate Sequence Using Automated Action In Odoo



Thanks

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

Thank you all for the answer, the solution from youtube is great and can be a solution for my problems.


I'm sorry i cannot UPVOTE or make BEST Answer because notif your KARMA is not enough.

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

https://www.youtube.com/watch?v=LOK0jxYb1rM

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 6 24
2883
3
thg 7 25
2187
1
thg 7 25
541
1
thg 6 25
2753
2
thg 5 25
2161