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
1854 Widoki


how can change the computation in commission type .

sample i want to change this

formula:

if line._name == 'sale.order.line':
result = 0
if line._name == 'account.invoice.line':
result = 0 


into this 

Quality of product * Linear unit * Linear Price = commission type

the scenario is , i have linear unit and linear price in product template form and i have quantity of the product in sale form 

i want to set the my commission type by getting the product of this three fields

Is it possible?


Awatar
Odrzuć
Najlepsza odpowiedź

Here's the sample code:

if line.product_id.x_fields_1 <= value (100):    

result = 1.00 * line.product_id.x_fields_1 * line.x_fields_2 

elif line.product_id.x_fields_1 >= value (101): 

result = 1.50 * line.product_id.x_fields_1 * line.x_fields_2 


This idea is same with salary rule of payroll module

Awatar
Odrzuć