Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
5425 Представления

Dear all,

I am using Odoo 12 and need to access a value from a list returned by a vals.get('order_line') method.

When I print the list using "print(vals.get('order_line'))", I get the following list:

    [[0, 'virtual_94',
     {'sequence': 10,
     'display_type': False,
     'product_uom_qty': 1,
     'qty_delivered_manual': 0,
     'price_unit': 1000,
     'discount': 0,
     'customer_lead': 0,
     'product_id': 1,
     'product_no_variant_attribute_value_ids': [[6, False, []]],
     'name': 'Produto de teste',
     'product_uom': 1,
     'analytic_tag_ids': [[6, False, []]],
     'route_id': False,
     'tax_id': [[6, False, [1]]], 
     'sale_line_exemption_id': False}]]

How can I access the value "1" on "'tax_id': [[6, False, [1]]]"? Here I need to access the value on "1".

Can anyone please help me?

Thank you all in advance

Best regards

Paulo


Аватар
Отменить
Автор Лучший ответ

Hello,

I have found the solution.

    result = vals.get('order_line')

    desired_id = result[0][2]["tax_id"][0][2][0]

Thank you all

Best regards

PM

Аватар
Отменить
Related Posts Ответы Просмотры Активность
3
окт. 23
9013
1
сент. 23
3416
1
мая 23
2381
2
апр. 23
2956
1
мар. 23
2326