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

hai everyone...

I want to ask how to solve errors in my program code. Here I tried to call the data from the module 'hr.payslip' to take the salary based on the salary structure, as well as based on the period, but here what I got was an error, can anyone help to solve the problem?


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

Hi,

It says strftime is not valid on the Date object, regarding the main question to retrieve data from current model or any models, you can utilize the odoo orm, using self, relational fields and using the search you can get datas from any models

Odoo ORM:  


  
Thanks

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

Hi,

The specific error that you are getting is of strftime the Date object doesn’t have strftime attribute
Try using 
date_from_formatted_date = "{:04d}-{:02d}-{:02d}".format(date_from.year, date_from.month, date_from.day)
date_to_formatted_date = "{:04d}-{:02d}-{:02d}".format(date_to.year, date_to.month, date_to.day)


Hope it helps

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 2 24
3195
2
thg 3 15
5205
1
thg 3 15
5733
4
thg 5 24
7662
1
thg 3 24
1882