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

(odoo 10)

Hi,

First of all I'm sorry for my english: I'm new in odoo.

I know, when I create a Quotation, I can press  on "Confirm sale" in order to save and confirm it in only one time.

This is done by the method "action_confirm".

When i push on "Confirm Sale" i discover that before is  called  the  "create" method of "sale.order" model.

I don't know why.

Is there anyone can help me to understand why?


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

While click on any button first the record will save (create will call) after that corresponding button action will call. 

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

Every time you called the create method it will generate the new record in your model and if you are making some of the object button and you clicked it the activity which you have defined on the object button will get called first and the changes which are done in the form will get save when you clicked on the save button.

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

@subbarao

Ok,

thank you.

Is this an odoo implicit behavior ?

What can I do if I want create a new button without this behavior? I know how to modify the view but I don't know how TO AVOID the implicit save of the record.........

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

Is this an odoo implicit behavior ?

yes it's odoo default, even if you create new button it will happen.

let me know one thing, if calling create method what's the problem?

Tác giả

I don't need this behaviour in this moment but in the future I might need it and I was wondering how to do that.

Well, I understand that:

everytime I'm in a view and I define an object button odoo, before to execute the method defined, create an istance of the current model

Is it correct?

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 11 24
20315
1
thg 9 23
3122
7
thg 4 23
49084
1
thg 12 22
7917
4
thg 12 23
26621