跳至內容
選單
此問題已被標幟
1 回覆
6069 瀏覽次數

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.

相關帖文 回覆 瀏覽次數 活動
2
8月 20
2936
0
2月 20
3963
0
4月 22
2120
0
11月 21
2383
1
9月 21
3386