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

I have inherited the sale order line and added some custom fields for my needs.

Now I need to add button against each line for a function that is applied on each line of a sale order on that button click.

Is there a way to bring it?

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

Hi,

You can inherit the sale order line view and add a button inside the line similar to the Register Lots, Packs and Location button in picking.
Add the button after your custom fields on sale.order.line view inside your XML file.

.xml

<button name="button_function" string="String you want" type="object" icon="fa-icon_you_like"
width="0.1"
options='{"warn": true}'/>

.py

class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'

def button_function(self):
"""And then write your function"""

Regards

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

This is it. Thank you.

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 8 20
3161
0
thg 2 20
4319
0
thg 4 22
2341
0
thg 11 21
2584
1
thg 9 21
3810