Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
6076 มุมมอง

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?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
ผู้เขียน

This is it. Thank you.

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ส.ค. 20
2953
0
ก.พ. 20
3973
0
เม.ย. 22
2128
0
พ.ย. 21
2387
1
ก.ย. 21
3428