Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
2164 Vues

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

Avatar
Ignorer
Auteur Meilleure réponse

i found error

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

thanks

Avatar
Ignorer
Publications associées Réponses Vues Activité
1
févr. 21
3534
1
janv. 21
3365
1
déc. 19
5637
1
sept. 15
5044
2
sept. 21
8451