跳至内容
菜单
此问题已终结
1 回复
4404 查看

i was add record to invoice_line_ids in account.invoice from code 

new_line = {
'product_tmp_id':product_id.id,
'product_multi_barcode':multi_barcode_ids,
'name': name,
'uom_id': product_id.uom_id,
'barcode': barcode,
'product_id': product_id.product_variant_ids.id,
'account_id': account_id,
'price_unit': price_unit,
'quantity': 1,
'discount': 0,
'invoice_line_tax_ids': invoice_line_tax_ids,
}
line = self.env['account.invoice.line'].new(new_line)
self.invoice_line_ids += line



now i want to filter the uom_id field like onchange do in normal add product 

形象
丢弃
最佳答案

Hello Omer Ahmed,


Please find a first description related corrections,

self .invoice_line_ids = [(4, line.id)]


As per your question, You need to return the domain return in the Onchange then find the following solution:

Example: (In this list which condition you need to use)

return {'domain': {'uom_id': [('id', '=', product_id.uom_id)] }}

Regards,




Email:      odoo@aktivsoftware.com  

Skype: kalpeshmaheshwari

   

形象
丢弃
相关帖文 回复 查看 活动
1
9月 23
1224
0
5月 21
2579
1
10月 20
4549
1
5月 24
4579
3
3月 24
1436