Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
5 Відповіді
6255 Переглядів

on the new Sales Orders page, I added a checkbox to be true if the (unit price > cost) in the order Lines table 

the problem is i need to find out  if all the checkboxes in the order Lines table  are true then set a checkbox outside the table to be true but I can't find out how 

I am using odoo studio as I am new to odoo and thank you for the help

Аватар
Відмінити
Найкраща відповідь

Hi, 
Checkout this code , hope it will help.

​Dependencies : order_line.x_studio_min_price_sale_by_cost

Compute :

for record in self:
    flag = False
    if any(line.x_studio_min_price_sale_by_cost for line in record.order_line):
        flag = True
    if not flag:
        record['x_studio_check_min_cost'] = True
(Beware of Indentation)
Аватар
Відмінити
Найкраща відповідь

Do you find the answer? I also kind of need this. The difference is, i need to change the status based on all checked item.

Аватар
Відмінити
Автор Найкраща відповідь

x

Аватар
Відмінити
Найкраща відповідь

Hi,

Please refer invoice status field in sale order

Invoice status field will update based on order lines invoice status

Аватар
Відмінити
Автор
Автор

what is an invoice status field and how to to use it

Найкраща відповідь

Please change the code for the field  x_studio_check_min_cost in sale order


Dependencies: order_line, order_line.x_studio_min_price_sale_by_cost

compute:

for record in self:
true_false_list = list(set(record.order_line.mapped('x_studio_min_price_sale_by_cost')))
if 'false' in true_false_list:
record['x_studio_check_min_cost'] = False
else:
record['x_studio_check_min_cost'] = True




Аватар
Відмінити
Автор

No, it did not work. Also, you set both to `False`

i have updated with true

Related Posts Відповіді Переглядів Дія
1
лип. 25
1348
2
бер. 25
1611
0
лют. 25
1238
0
лют. 25
1434
0
лют. 25
1382