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
เกี่ยวกับฟอรั่มนี้
ช่วยเหลือ

TypeError: argument of type 'bool' is not iterable in openerp

ติดตาม

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

คำถามนี้ถูกตั้งค่าสถานะ
openerpfields_view_get
2 ตอบกลับ
19573 มุมมอง
อวตาร
Group ODOO

Here is the thing: I wanted to inherit the tree view(id is "view_employee_tree") of the moudle --hr: in the hr_contract module. Here is my code:

 <record id="hr_contract_hr_employee_tree" model="ir.ui.view">
                <field name="name">hr.contract.hr.employee.tree</field>
                <field name="model">hr.employee</field>
                <field name="inherit_id" ref="hr.view_employee_tree"/>
                <field name="arch" type="xml">
                    <field name="work_phone" position="after">
                        <field name="contract_ids"/>
                    </field>
                </field>
            </record>

After I update modules(hr,hr_contract),I get the error as follows:)

OpenERP Server Error Client Traceback (most recent call last): File "d:\Program Files\OpenERP 7.0-20130726-231403\Server\server\openerp\addons\web\http.py", line 204, in dispatch File "d:\Program Files\OpenERP 7.0-20130726-231403\Server\server\openerp\addons\web\controllers\main.py", line 1128, in call_kw File "d:\Program Files\OpenERP 7.0-20130726-231403\Server\server\openerp\addons\web\controllers\main.py", line 1120, in _call_kw File "d:\Program Files\OpenERP 7.0-20130726-231403\Server\server\openerp\addons\web\session.py", line 42, in proxy File "d:\Program Files\OpenERP 7.0-20130726-231403\Server\server\openerp\addons\web\session.py", line 30, in proxy_method File "d:\Program Files\OpenERP 7.0-20130726-231403\Server\server\openerp\addons\web\session.py", line 103, in send

Server Traceback (most recent call last): File "d:\Program Files\OpenERP 7.0-20130726-231403\Server\server\openerp\addons\web\session.py", line 89, in send File "D:\Program Files\OpenERP 7.0-20130726-231403\Server\server.\openerp\netsvc.py", line 292, in dispatch_rpc File "D:\Program Files\OpenERP 7.0-20130726-231403\Server\server.\openerp\service\web_services.py", line 626, in dispatch File "D:\Program Files\OpenERP 7.0-20130726-231403\Server\server.\openerp\osv\osv.py", line 188, in execute_kw File "D:\Program Files\OpenERP 7.0-20130726-231403\Server\server.\openerp\osv\osv.py", line 131, in wrapper File "D:\Program Files\OpenERP 7.0-20130726-231403\Server\server.\openerp\osv\osv.py", line 197, in execute File "D:\Program Files\OpenERP 7.0-20130726-231403\Server\server.\openerp\osv\osv.py", line 185, in execute_cr File "D:\Program Files\OpenERP 7.0-20130726-231403\Server\server.\openerp\osv\orm.py", line 2290, in fields_view_get File "D:\Program Files\OpenERP 7.0-20130726-231403\Server\server.\openerp\osv\orm.py", line 2270, in clean TypeError: argument of type 'bool' is not iterable

I have been tracking the bug for a whole day. i went to the file:\openerp\osv\orm.py,and get the codes near the line 2270:

            ir_values_obj = self.pool.get('ir.values')
            resprint = ir_values_obj.get(cr, user, 'action',
                    'client_print_multi', [(self._name, False)], False,
                    context)
            resaction = ir_values_obj.get(cr, user, 'action',
                    'client_action_multi', [(self._name, False)], False,
                    context)

            resrelate = ir_values_obj.get(cr, user, 'action',
                    'client_action_relate', [(self._name, False)], False,
                    context)

            #I added this for output
            for action in resaction:
                print 'orm debug : '
                print 'action[1]:',action[1]
                print 'action[2]',action[2]

            resaction = [clean(action) for action in resaction
                         if view_type == 'tree' or not action[2].get('multi')]
            resprint = [clean(print_) for print_ in resprint
                        if view_type == 'tree' or not print_[2].get('multi')]
            #When multi="True" set it will display only in More of the list view 
            resrelate = [clean(action) for action in resrelate
                         if (action[2].get('multi') and view_type == 'tree') or (not action[2].get('multi') and view_type == 'form')]

            for x in itertools.chain(resprint, resaction, resrelate):
                x['string'] = x['name']

And I added print code to output the var:resaction, and this is the output:

#output: orm_debug: Subordinate Hierarchy False

Excellent! It seems that the error:TypeError: argument of type 'bool' is not iterable makes sense. Subordinate Hierarchy is the name of an act_window in the file hr_view.xml:

<record id="action2" model="ir.actions.act_window">
        <field name="name">Subordinate Hierarchy</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">hr.employee</field>
        <field name="domain">[('id','in',active_ids)]</field>
        <field name="view_type">tree</field>
        <field name="view_id" ref="view_partner_tree2"/>
        <field name="view_id" ref="view_employee_tree"/>
</record>

But what is the real problem?? what did I do wrong ?

Any help is highly appreciated!! Thanks in advance!!

1
อวตาร
ละทิ้ง
อวตาร
Anil Kesariya
คำตอบที่ดีที่สุด

Hello Letitgo,

What you exactly want ?

you want to add one2many field on of Contract object(hr.contract) to th Employee object (hr.employee) ?

for that you need to add this this code in your custom module.

Code in your py file....

class hr_employee(osv.osv)

    _inherit = 'hr.employee'
    _columns = { 
    'contract_ids' : fields.one2many('hr.contract', 'emp_id' string="Contracts")
   }

hr_employee()

class hr_contract(osv.osv)

    _inherit = 'hr.contract'

    _columns = { 
      'emp_id':fields.many2one('hr.employee', string="Employee"),
      }

hr_contract()

Now you can add your contracts in to employee objects. by using xpath.

This is the relationship fields scenario to add on object.

Check it will work.

Or else you need different thing tell me your exact requirement what you needed

Regards,

Anil Kesariya.

1
อวตาร
ละทิ้ง
อวตาร
Qutechs, Ahmed M.Elmubarak
คำตอบที่ดีที่สุด

Hi,

you didn't want to go to the ORM, it is a python error, I thing you're trying to make a loop with not [iterable] variable , you can try this on your python

for i in True:
print 'hello'

you 'll get the same error msg ...

so you can check your .py file for something like this ...

Thanks..

0
อวตาร
ละทิ้ง
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!

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

ลงชื่อ
Related Posts ตอบกลับ มุมมอง กิจกรรม
2 beginner questions about function(fields_view_get)
v7 openerp fields_view_get
อวตาร
อวตาร
1
มี.ค. 15
8049
Create selection type field dynamically?
openerp
อวตาร
อวตาร
อวตาร
2
ก.ย. 23
8465
How to hide the create button dynamical tree view in openerp ? แก้ไขแล้ว
openerp
อวตาร
อวตาร
2
มี.ค. 23
47708
ProgrammingError: can't adapt type 'dict' [SOLVED]
openerp
อวตาร
อวตาร
อวตาร
2
ธ.ค. 23
58851
How to use the audit app
openerp
อวตาร
0
มี.ค. 22
3022
คอมมูนิตี้
  • บทเรียน
  • เอกสารกำกับโปรแกรม
  • ฟอรั่ม
โอเพนซอร์ส
  • ดาวน์โหลด
  • 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