Skip to Content
Odoo เมนู
  • ลงชื่อเข้าใช้
  • ทดลองใช้ฟรี
  • แอป
    การเงิน
    • ระบบบัญชี
    • ระบบการออกใบแจ้งหนี้
    • ระบบบัญชีรายจ่าย
    • ระบบการจัดการข้อมูลผ่านสเปรดชีต (BI)
    • เอกสาร
    • ระบบลงลายเซ็น
    การขาย
    • ลูกค้าสัมพันธ์
    • การขาย
    • POS ร้านค้า
    • POS ร้านอาหาร
    • ระบบสมัครสมาชิก
    • การเช่า
    การจัดการเว็บไซต์
    • เครื่องมือสร้างเว็บไซต์
    • ระบบการขายออนไลน์
    • บล็อก
    • ฟอรั่ม
    • ไลฟ์แชท
    • ระบบการอบรมออนไลน์
    ซัพพลายเชน
    • คลังสินค้า
    • ระบบการผลิต
    • PLM
    • ระบบการจัดซื้อ
    • การซ่อมบำรุง
    • ระบบจัดการคุณภาพ
    ทรัพยากรบุคคล
    • ข้อมูลพนักงาน
    • ระบบสรรหาบุคลากร
    • ระบบการลา
    • การประเมิน
    • ระบบการแนะนำพนักงาน
    • ระบบจัดการยานพาหนะ
    การตลาด
    • โซเชียลมาร์เก็ตติ้ง
    • การตลาดผ่านอีเมล
    • ระบบการตลาดผ่าน SMS
    • ระบบการจัดงานอีเวนต์
    • การตลาดแบบอัตโนมัติ
    • ระบบแบบสำรวจ
    การบริการ
    • โปรเจกต์
    • ระบบบันทึกเวลา
    • ระบบการจัดการบริการภาคสนาม
    • ระบบดูแลช่วยเหลือ
    • การวางแผน
    • การนัดหมาย
    ประสิทธิผล
    • ระบบแสดงความคิดเห็น
    • ระบบการอนุมัติ
    • ไอโอที
    • VoIP
    • คลังข้อมูล
    • WhatsApp
    แอปพลิเคชันของบุคคลที่สาม Odoo สตูดิโอ แพลตฟอร์มคลาวด์ของ Odoo
  • อุตสาหกรรม
    การค้าปลีก
    • ร้านขายหนังสือ
    • ร้านขายเสื้อผ้า
    • ร้านขายเฟอร์นิเจอร์
    • ร้านขายของชำ
    • ร้านขายฮาร์ดแวร์
    • ร้านขายของเล่น
    Food & Hospitality
    • บาร์และผับ
    • ร้านอาหาร
    • อาหารฟาสต์ฟู้ด
    • Guest House
    • ตัวแทนจำหน่ายเครื่องดื่ม
    • Hotel
    อสังหาริมทรัพย์
    • Real Estate Agency
    • บริษัทสถาปัตยกรรม
    • บริษัทรับเหมา
    • การจัดการอสังหาริมทรัพย์
    • การจัดสวน
    • สมาคมเจ้าของอสังหาริมทรัพย์
    ปรึกษา
    • สำนักงานบัญชี
    • Odoo พาร์ทเนอร์
    • เอเจนซี่การตลาด
    • สำนักงานกฎหมาย
    • บริการสรรหาบุคลากร
    • การตรวจสอบและการรับรอง
    ระบบการผลิต
    • Textile
    • เหล็ก
    • เฟอร์นิเจอร์
    • อาหาร
    • Brewery
    • ของขวัญขององค์กร
    สุขภาพ & ฟิตเนส
    • ชมรมกีฬา
    • ร้านขายแว่นตา
    • ฟิตเนส
    • ผู้ประกอบวิชาชีพด้านสุขภาพ
    • ร้านขายยา
    • ร้านทำผม
    Trades
    • ช่างซ่อม
    • ฮาร์ดแวร์และการสนับสนุนด้านไอที
    • ระบบพลังงานแสงอาทิตย์
    • ช่างทำรองเท้า
    • บริการทำความสะอาด
    • HVAC Services
    อื่น ๆ
    • Nonprofit Organization
    • สำนักงานสิ่งแวดล้อม
    • ร้านเช่าป้ายโฆษณา
    • การถ่ายภาพ
    • ร้านเช่าจักรยาน
    • ตัวแทนจำหน่ายซอฟต์แวร์
    Browse all Industries
  • คอมมูนิตี้
    ศึกษา
    • บทเรียน
    • เอกสารกำกับโปรแกรม
    • การรับรอง
    • การฝึกอบรม
    • บล็อก
    • พอดแคสต์
    เพิ่มศักยภาพให้กับการศึกษา
    • โปรแกรมการศึกษา
    • Scale Up! Business Game
    • เยี่ยมชม Odoo
    รับซอฟต์แวร์
    • ดาวน์โหลด
    • เปรียบเทียบรุ่น
    • เผยแพร่
    ทำงานร่วมกัน
    • Github
    • ฟอรั่ม
    • ระบบการจัดงานอีเวนต์
    • การแปล
    • ร่วมเป็นพาร์ทเนอร์
    • Services for Partners
    • ลงทะเบียนเพื่อสร้างบัญชีบริษัทของคุณ
    รับบริการ
    • ค้นหาพาร์ทเนอร์
    • ค้นหานักบัญชี
    • พบกับที่ปรึกษา
    • บริการติดตั้งระบบเพื่อใช้งาน
    • ข้อมูลอ้างอิงลูกค้า
    • การสนับสนุน
    • อัปเกรด
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    รับการสาธิต
  • ราคา
  • ช่วยเหลือ

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • ลูกค้าสัมพันธ์
  • e-Commerce
  • ระบบบัญชี
  • สินค้าคงคลัง
  • PoS
  • โปรเจกต์
  • MRP
All apps
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
ช่วยเหลือ

Odoo client error

ติดตาม

รับการแจ้งเตือนเมื่อมีกิจกรรมในโพสต์นี้

คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
3489 มุมมอง
อวตาร
chainika

i made some custom fields in HR Module.

it is properly working in terms of functionality but when i open a employee form then a odoo client occur.

Please suggest.

Error: Field 'undefined' specified in view could not be found.
http://localhost:8069/web/static/src/js/view_form.js:1254
0
อวตาร
ละทิ้ง
Jignesh Mehta

can you post your code ?

อวตาร
chainika
ผู้เขียน คำตอบที่ดีที่สุด

from openerp.osv import fields, osv

import time

from openerp.tools import DEFAULT_SERVER_DATE_FORMAT,DEFAULT_SERVER_DATETIME_FORMAT

import re

import base64, urllib

import os

import math

from openerp.tools.translate import _

class emp_year(osv.osv):

_name="emp.year"

def _check_year(self, cr, uid, ids, context=None):

str="^-?[0-9]+$"

obj=self.browse(cr, uid, ids)[0]

ph=obj.name

if ph and len(ph)!= 4:

raise osv.except_osv(_('Invalid Year'), _(' Year must contain 4 digits only.'))

if ph and re.match(str, ph) == None:

return False

return True

_columns = {

'name' :fields.char('Name',size=4, select=True),

}

_constraints = [

(_check_year, 'Must contain only integer values', [' Year ']),

]

_sql_constraints=[('unique_year','unique(name)','Year must be unique !')]

class qualification_list(osv.osv):

_name="qualification.list"

_columns = {

'name':fields.char('Name',size=64,select=True),

}

class qualification(osv.osv):

_name="qualification"

_columns = {

'name':fields.many2one('qualification.list','Qualification',select=True),

'college' :fields.char('College Name', size=64,select=True),

'employee_id':fields.many2one('hr.employee','Employee',select=True),

'year':fields.many2one('emp.year','Year'),

}

class experience(osv.osv):

_name="experience"

_columns = {

'name' :fields.char('Company Name', size=64,select=True),

'address' :fields.char('Company Address', size=512,select=True),

'employee_id':fields.many2one('hr.employee','Employee',select=True),

'year1':fields.many2one('emp.year','From Year'),

'year2':fields.many2one('emp.year','To Year'),

}

class salary(osv.osv):

_name="salary"

def onchange_food_amt(self,cr,uid,ids,basic,hra,convenience,medical,food_amt,context=None):

result={}

if context:

gross = basic + hra + convenience + medical + food_amt

result['value'] ={'gross':gross}

return result

def onchange_basic(self,cr,uid,ids,basic,hra,convenience,medical,context=None):

result={}

if context:

gross = basic + hra + convenience + medical

result['value'] = {'gross':gross}

return result

def onchange_hra(self,cr,uid,ids,basic,hra,convenience,medical,context=None):

result={}

if context:

gross = basic + hra + convenience + medical

result['value'] = {'gross':gross}

return result

def onchange_convenience(self,cr,uid,ids,basic,hra,convenience,medical,context=None):

result={}

if context:

gross = basic + hra + convenience + medical

result['value'] = {'gross':gross}

return result

def onchange_medical(self,cr,uid,ids,basic,hra,convenience,medical,context=None):

result={}

if context:

gross = basic + hra + convenience + medical

result['value'] = {'gross':gross}

return result

def onchange_esi(self,cr,uid,ids,basic,hra,convenience,esi,context=None):

result={}

if context:

amt = basic+hra+convenience

esi_amt = (amt * esi)/100

print"esi_amt",esi_amt

result['value'] = {'esi_amt':math.ceil(esi_amt)}

return result

def onchange_epf(self,cr,uid,ids,basic,epf,context=None):

result={}

if context:

epf_amt = (basic * epf)/100

result['value'] = {'epf_amt':math.ceil(epf_amt)}

return result

def onchange_esi_com(self,cr,uid,ids,basic,hra,convenience,esi_com,gross,context=None):

result={}

if context:

esi_amt_comp = ((basic+hra+convenience) * esi_com)/100

ctc = gross + esi_amt_comp

result['value'] = {'esi_amt_comp':math.ceil(esi_amt_comp), 'ctc':ctc}

return result

def onchange_epf_com(self,cr,uid,ids,basic,epf_com,context=None):

result={}

if context:

epf_amt_comp = (basic * epf_com)/100

result['value'] = {'epf_amt_comp':math.ceil(epf_amt_comp)}

return result

_columns = {

'select':fields.boolean('Select'),

'basic':fields.float('Basic'),

'hra':fields.float('HRA'),

'convenience':fields.float('Conveyance'),

'medical':fields.float('Medical'),

'esi':fields.float(' Employee ESI(%)'),

'esi_com':fields.float('Company ESI(%)'),

'epf_com':fields.float('Company EPF(%)'),

'esi_amt_comp':fields.float('Comapny ESI Amount', readonly=True),

'epf_amt_comp':fields.float('Company EPF Amount',readonly=True),

'esi_amt':fields.float(' Employee ESI Amount',readonly=True),

'epf':fields.float('Emoployee EPF(%)'),

'epf_amt':fields.float(' Employee EPF Amount',readonly=True),

'gross':fields.float('Gross'),

'ctc':fields.float('CTC'),

'food_tick':fields.boolean('Food'),

'other_tick':fields.boolean('Other Expenses'),

'other_amt':fields.float('Other Expenses Amount'),

'food_amt':fields.float('Food Amount'),

'employee_id':fields.many2one('hr.employee','Employee',select=True)

}

class skill(osv.osv):

_name="skill"

_columns = {

'name' :fields.char('Name', size=255,select=True),

'note':fields.text('Description '),

}

class hr_department(osv.osv):

_inherit = "hr.department"

def onchange_manager(self, cr, uid, ids, manager_id,context=None):

result={}

arg=[]

if manager_id:

manager = self.pool.get('hr.employee').browse(cr, uid, manager_id, context=context)

if manager:

result = {'value': {'manager_name': manager.name }}

return result

_columns = {

'department_code':fields.char('Department Code',size=64),

'manager_name':fields.char('Manager Name',size=256),

'manager_id': fields.many2one('hr.employee', 'Manager'),

}

def create(self, cr, uid, vals, context=None):

seq = self.pool.get('ir.sequence').get(cr, uid, 'hr.department')

print"seqqq",seq

vals['department_code'] = seq

print"vallll",vals

res = super(hr_department,self).create(cr, uid, vals, context)

print"resss",res

return res

class hr_employee(osv.osv):

_inherit = "hr.employee"

_order = 'emp_id'

def onchange_food_tick(self,cr,uid,ids,food_tick,context=None):

result={}

if context:

if context.get('food_tick') == True:

gross = gross + food_amt

result['value'] ={'gross':gross}

return result

def get_image(self, cr, uid, ids):

each = self.read(cr, uid, ids, ['image_url'])

try:

if each['image_url']:

(filename, header) = urllib.urlretrieve('file://'+os.getcwd()+'/Photo/Employee/'+each['image_url'])

f = open(filename , 'rb')

img = base64.encodestring(f.read())

f.close()

else:

(filename, header) = urllib.urlretrieve('file://'+os.getcwd()+'/addons/hr_employee/images/default.png')

f = open(filename , 'rb')

img = base64.encodestring(f.read())

f.close()

except:

(filename, header) = urllib.urlretrieve('file://'+os.getcwd()+'/addons/hr_employee/images/default.png')

f = open(filename , 'rb')

img = base64.encodestring(f.read())

f.close()

return img

def _get_image(self, cr, uid, ids, field_name, arg, context={}):

res = {}

for each in ids:

img = self.get_image(cr, uid, each)

res[each] = img

return res

def resize_image(self, cr, uid, ids, context=None):

for each in self.browse(cr, uid, self.search(cr, uid, [])):

img = self.get_image(cr, uid, each)

image_url = each.image_url

import io, StringIO, Image

image_stream = io.BytesIO(img.decode('base64'))

img = Image.open(image_stream)

img.thumbnail((240, 200), Image.ANTIALIAS)

img_stream = StringIO.StringIO()

img.save(img_stream, "JPEG")

bin = base64.decodestring(img_stream.getvalue().encode('base64'))

filename = str(os.getcwd()+'/Photo/Employee/'+image_url)

f = open(filename , 'wb')

f.write(bin)

return True

_columns={

'jdate':fields.date('Joining Date'),

'local_address':fields.char('Local Address'),

'permanent_address':fields.char('Permanent Address'),

'category1':fields.selection([('worker','WORKER'),('other','OTHER'),('office_staff','OFFICE STAFF')],'Employee Type'),

'category2':fields.selection([('semi','Semi Skilled'),('skill','Skilled'),('super','Super Skilled'),('nskill','Non Skill')],'Employee Skill'),

'father_name':fields.char('Father Name',size=64),

'emp_id':fields.char('Employee ID',readonly=True),

'shift_lines':fields.one2many('hr.shift.line','employee_id','Master Shift'),

'shift_id':fields.many2one('attendance.shift','Shift',ondaelete="cascade"),

'image_medium':fields.function(_get_image, type="binary", method=True),

'image_url':fields.char('Image URL' , size=256, help="Specify complete path to image when, you are importing images from CSV file. example for local system path=file:///home/directoryname/imagedirectoryname/image.jpg",readonly=True),

'education_id':fields.one2many('qualification','employee_id','Degree/Diploma'),

'experience_id':fields.one2many('experience','employee_id','Experience'),

'salary_lines':fields.one2many('salary','employee_id','Salary'),

'skill_id':fields.many2many('skill','emp_skill_rel','skill_id','name','Skills'),

'daily':fields.boolean('Daily'),

'monthly':fields.boolean('Monthly'),

'new_salary':fields.float('Joining Salary'),

'salary':fields.float('Current Salary'),

'parent_id':fields.many2one('hr.employee','Reporting Officer'),

'job_id':fields.many2one('hr.job','Designation'),

'work_phone': fields.char('Work Phone'),

'emp_status':fields.selection([('working','Working'),('left','Left')],'Employee Status'),

'mobile_phone': fields.char('Work Mobile'),

'work_location': fields.char('Office Location'),

'address_id': fields.many2one('res.partner', 'Working Address'),

'card_no':fields.char('Employee Machine No'),

'nominee_name':fields.char('Nominee Name', size=64),

'nominee_rel':fields.char('Nominee Relation', size=64),

'bank_name':fields.char('Bank Name', size=64),

'account_number':fields.char('Bank Account Number', size=64),

'ifsc_code':fields.char('IFSC Code', size=64),

'leave_date':fields.date('Leaving Date'),

'ot_tick':fields.boolean('OT'),

'select_salary':fields.boolean('Select'),

}

def create(self, cr, uid, vals, context=None):

if 'category1' in vals and vals['category1']:

if vals['category1'] == 'office_staff':

seq = self.pool.get('ir.sequence').get(cr, uid, 'hr.employee.staff')

vals['emp_id'] = seq

if vals['category1'] in ('worker'):

seq = self.pool.get('ir.sequence').get(cr, uid, 'hr.employee.worker')

vals['emp_id'] = seq

if vals['category1'] == 'other':

seq = self.pool.get('ir.sequence').get(cr, uid, 'hr.employee.other')

vals['emp_id'] = seq

res = super(hr_employee,self).create(cr, uid, vals, context)

return res

class wiz_image_hr(osv.TransientModel):

_name = 'wiz.image.hr'

_columns = {

'image':fields.binary('Image'),

'image_name':fields.char('Image Name',size=64,required=True,readonly=True),

}

def default_get(self, cr, uid, fields, context=None):

if not context:

context = {}

ids = context.get('active_ids',[])

res = super(wiz_image_hr, self).default_get(cr, uid, fields, context=context)

for line in self.pool.get('hr.employee').browse(cr, uid, ids):

if 'image_name' in fields:

res.update({'image_name':line.emp_id+'.jpg'})

return res

def clear_image(self, cr, uid, ids, context=None):

if not context:

context = {}

hr_ids = context.get('active_ids',[])

model = context.get('active_model')

if model == None:

return {'type':'ir.actions.act_window_close'}

try:

self.pool.get('hr.employee').write(cr, uid, hr_ids, {'image_url':False})

except:

pass

return {'type':'ir.actions.act_window_close'}

def create_image(self, cr, uid, ids, context=None):

if not context:

context = {}

hr_ids = context.get('active_ids',[])

each = self.read(cr, uid, ids, ['image_name','image'])

if each[0]['image_name'] and not each[0]['image']:

raise osv.except_osv(_('UserError'), _('Please select the image..'))

try:

if each[0]['image_name'] and each[0]['image']:

import io, StringIO, Image

image_stream = io.BytesIO(each[0]['image'].decode('base64'))

img = Image.open(image_stream)

img.thumbnail((240, 200), Image.ANTIALIAS)

img_stream = StringIO.StringIO()

img.save(img_stream, "JPEG")

bin = base64.decodestring(img_stream.getvalue().encode('base64'))

filename = str(os.getcwd()+'/Photo/Employee/'+each[0]['image_name'])

f = open(filename , 'wb')

f.write(bin)

self.pool.get('hr.employee').write(cr, uid, hr_ids, {'image_url':each[0]['image_name']})

except:

pass

return {'type':'ir.actions.act_window_close'}


0
อวตาร
ละทิ้ง
Jignesh Mehta

hello, error in your custom xml file.

สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!

สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!

ลงชื่อ
คอมมูนิตี้
  • บทเรียน
  • เอกสารกำกับโปรแกรม
  • ฟอรั่ม
โอเพนซอร์ส
  • ดาวน์โหลด
  • Github
  • Runbot
  • การแปล
บริการ
  • โฮสติ้ง odoo.sh เซิร์ฟเวอร์
  • การสนับสนุน
  • อัปเกรด
  • การพัฒนาที่กำหนดเอง
  • การศึกษา
  • ค้นหานักบัญชี
  • ค้นหาพาร์ทเนอร์
  • ร่วมเป็นพาร์ทเนอร์
เกี่ยวกับเรา
  • บริษัทของเรา
  • ทรัพย์สินในรูปของเครื่องหมายการค้า
  • ติดต่อเรา
  • งาน
  • ระบบการจัดงานอีเวนต์
  • พอดแคสต์
  • บล็อก
  • ลูกค้า
  • กฎหมาย • ความเป็นส่วนตัว
  • ความปลอดภัย
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo เป็นชุดแอปธุรกิจแบบเปิดที่ครอบคลุมทุกความต้องการของบริษัทของคุณ อาธิ CRM eCommerce ระบบบัญชี ระบบสินค้าคงคลัง ระบบการขายหน้าร้าน โปรเจกต์ และ อีกมากมาย

ความเหนือกว่าอันเป็นเอกลักษณ์ของ Odoo คือการใช้งานที่ง่ายดายและผสานการทำงานอย่างสมบูรณ์แบบในเวลาเดียวกัน

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now