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

Hello, Please what does this error mean? I don't know where to look to solve it.

Thank you for your immediate response.

Here is my code:

class store_issuing_voucher(osv.osv): _name = "store.issuing.voucher" _inherit = [ 'mail.thread','ir.needaction_mixin'] _description = "The Store Issuing Voucher"

_columns={

          'employee_id': fields.many2one('hr.employee', 'Requestor', required=False,track_visibility='onchange'),
          'department_id': fields.many2one('hr.department', 'Department', required=False, track_visibility='onchange'),
          'organizational_id': fields.many2one('store.voucher.organization', 'Organizational Code', required=False, track_visibility='onchange'),
          'fund_code': fields.char('Fund Code', size=32, readonly=False, required=False, track_visibility='onchange'),
          'program_code': fields.char('Program Code', size=32, readonly=False, required=False, track_visibility='onchange'),
          'location_code': fields.char('Location Code', size=32, readonly=False, track_visibility='onchange'),
          'manager_id': fields.many2one('hr.employee', 'Store Voucher Manager', required=False, track_visibility='onchange'),              
          'store_voucher_state': fields.selection([('draft','Draft'),('in_progress','Waiting Approval'),('denied','Denied'),('approved','Approved')],'Store Voucher Status',  track_visibility='onchange'),
          'stock_journal_id': fields.many2one('stock.journal','Stock Journal', select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
          'store_voucher_approval_id': fields.one2many('store.voucher.approval', 'store_voucher_id', 'Store Voucher Authorizations', readonly=True, ondelete='cascade'),
          'date': fields.datetime('Date', track_visibility='onchange'),
          'mystore_product_ids': fields.one2many('store.products', 'store_product_id', 'Store Product Lines'),
          'note': fields.text('Notes'),

          }

store_issuing_voucher()

class store_products(osv.osv): _name='store.products' _description='Store Products' _inherit=['mail.thread'] _columns={

         'my_product_id': fields.many2one('product.product', 'Product', required=True, select=True),
         'product_qty': fields.float('Quantity', required=True, track_visibility='onchange'),
         'store_product_id': fields.many2one('store.issuing.voucher', 'Products'),
         'value': fields.float('Value (NGN)',track_visibility='onchange'),
         'account_code': fields.many2one('account.account', 'Account Code', required=True, track_visibility='onchange',
                                          help="The partner account used for this invoice."),

          }

store_products()

class store_voucher_approval(osv.osv): _name = "store.voucher.approval" _description = "Store Issuing Voucher Approval" _columns={ 'store_voucher_id': fields.many2one('store.issuing.voucher', 'Store Issuing Voucher'), 'manager_id': fields.many2one('store.voucher.manager', 'Approval Manager'),
'state': fields.selection([('in_progress', 'Waiting Approval'),('approved','Approved'),('denied','Denied')],'Approval State'), 'create_date': fields.datetime('Date Created'), 'write_date': fields.datetime('Approval Date'), 'write_uid': fields.many2one('res.users', 'Processed By'), 'can_approve': fields.boolean('Can Approve'), }

store_voucher_approval()

class store_voucher_manager(osv.osv): _name='store.voucher.manager' _description='Store Voucher Approval Manager' _sql_constraints =[ ('id_unigue', 'unique (sequence)', 'Sequence must be unique!') ] _order = 'sequence ASC' _columns={ 'employee_id': fields.many2one('hr.employee', 'Store Voucher Approval Manager', required=True, track_visibility='onchange'), 'employee_ids': fields.many2many('hr.employee', 'store_voucher_employee_rel', 'manager_id', 'employee_id', 'Employees', track_visibility='onchange'),

'employee_user_ids': fields.function(_get_employee_users, string='Employee Users', type='many2many', method=True, store=False, relation='res.users', track_visibility='onchange'),

          'name': fields.char('Name', size=32,required=True, track_visibility='onchange'),
          'type': fields.selection([('department', 'By Department')], 'Approval Type', track_visibility='onchange'),
          'role': fields.char([('supervisor', 'Supervisor'), ('manager', 'Manager')], 'Role', track_visibility='onchange'),
          'sequence': fields.integer('Sequence', required=True, track_visibility='onchange'),
        }

store_voucher_manager()

Please what am doing wrong and how can I fix it?? Thank you

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

Hi,

you have assigned a value of type string to an integer varaible.

plz post your code.

Ảnh đại diện
Huỷ bỏ
Tác giả

Hi Borni, here is my code. Pls tell me what am not doing right.