Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

TypeError: VARCHAR parameter should be an int, got <type 'str'>

By
Aijay Ogbugha
on 7/10/13, 5:34 AM 1,351 views

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

0

Borni DHIFI

--Borni DHIFI--
5102
| 6 8 9
Tunis, Tunisia
--Borni DHIFI--

Techno Functional Consultant Odoo(OpenERP) 

http://www.linkedin.com/in/borni

Skype : dhifi.borni

Borni DHIFI
On 7/10/13, 6:50 AM

Hi,

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

plz post your code.

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

Aijay Ogbugha
on 7/10/13, 11:25 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 7/10/13, 5:34 AM
Seen: 1351 times
Last updated: 3/16/15, 8:10 AM