콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
2477 화면

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????

아바타
취소
작성자 베스트 답변

i found error

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

thanks

아바타
취소
관련 게시물 답글 화면 활동
1
2월 21
4034
1
1월 21
3790
1
12월 19
6007
1
9월 15
5414
2
9월 21
9121