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

i have custom module

and have 2 model



class AttendanceSheet(models.Model):
_name = 'attendance.sheet'
_inherit = ['mail.thread.cc', 'mail.activity.mixin']
_description = 'Hr Attendance Sheet'

name = fields.Char("name")

employee_id = fields.Many2one(comodel_name='hr.employee', string='Employee',
required=True)

batch_id = fields.Many2one('attendance.sheet.batch')

.....




class AttendanceSheetBatch(models.Model):
_name = 'attendance.sheet.batch'

name = fields.Char("name")
department_id = fields.Many2one('hr.department', 'Department Name',
required=True)
date_from = fields.Date(string='Date From', readonly=True, required=True,
default=lambda self: fields.Date.to_string(
date.today().replace(day=1)), )
date_to = fields.Date(string='Date To', readonly=True, required=True,
default=lambda self: fields.Date.to_string(
(datetime.now() + relativedelta(months=+1, day=1,
days=-1)).date()))

payslip_batch_id = fields.Many2one(comodel_name='hr.payslip.run',
string='Payslip Batch')

att_sheet_ids = fields.One2many('attendance.sheet', 'batch_id')


.....


i have added all depends

i check security file


change name of one2many and mane2one 


all of my solution dosn't work


when i cahnge from one2many to many2many it work

!!!!!!


it work well on test database

but when i add it to stage give me this error


can you help????

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

i found error

there is another module installed has model with name same as my model

thanks

Ả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 21
3746
1
thg 1 21
3547
1
thg 12 19
5797
1
thg 9 15
5213
2
thg 9 21
8800