Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
2156 Zobrazení

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
Zrušit
Autor Nejlepší odpověď

i found error

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

thanks

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
úno 21
3528
1
led 21
3351
1
pro 19
5626
1
zář 15
5033
2
zář 21
8436