Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
6063 Widoki

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?

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Autor

This is it. Thank you.

Powiązane posty Odpowiedzi Widoki Czynność
2
sie 20
2923
0
lut 20
3951
0
kwi 22
2112
0
lis 21
2381
1
wrz 21
3381