Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3555 Lượt xem

Hi, 

I m trying to get the default Sales Tax From settings --> Invoicing --> Taxes  (field name  is

"sale_tax_id" )in odoo 14


I try this :

Defualt_sale_tax = self.env['res.config.settings'].sale_tax_id

print(" Defualt_sale_tax = ", Defualt_sale_tax  )


Result :

Defualt_sale_tax = account.tax()


& i add record on it but still getting no result (i try  it  in  other  field  in  settings  but get nothing)

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

You can get it from the company record as follows:  self.env.company.account_sale_tax_id


sale_tax_id in the res.config.settings is  a  related  field  of  account_sale_tax_id  in  the  company  model.

 

Thanks

Ảnh đại diện
Huỷ bỏ
Tác giả

So this mean that res.config.settings doesn't store the data , right ?
& Thanks this work !

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 12 22
3316
1
thg 6 25
2423
1
thg 4 24
5289
2
thg 3 24
9206
2
thg 2 24
3004