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

Hi all,

I added a new field on the table "Sale_Order". On the file "sale.py" during the fonction "action_button_confirm", i would like to now the value of the field of the current Order.

Is it possible? How?

Thank you a lot!

Selverine

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

It is possible to get the value from the new field.

How to do it: make sure you have an object of sale_order. When using the browse method, you can use a dot (.) to access the value. Check the various .py files.

Example (from sale.py, in folder /addons/sale):

'currency_id': self.pool.get('product.pricelist').browse(cr, uid, pricelist_id, context=context).currency_id.id

This will store the value of the ID of the currency of the product.pricelist in the variable currency_id

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 24
1922
1
thg 2 24
931
1
thg 9 23
1754
0
thg 10 22
1708
1
thg 9 20
3931