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

How to limit the choice in radio button depending on other fields

ติดตาม

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

คำถามนี้ถูกตั้งค่าสถานะ
restaurantform_viewodooV8
1563 มุมมอง
อวตาร
Sonny

I need to make the radio button option to only "container" when the values of direction='export', transport='ocean' and ocean_shipment_type='fcl'.

Here are the snippets of models involved:

class FreightShipment(models.Model): 
    _name = 'freight.shipment'

    direction = fields.Selection(([('import', 'Import'), ('export', 'Export')]), string='Direction' )
    transport = fields.Selection(([('air', 'Air'), ('ocean', 'Ocean'), ('land', 'Land')]),
                                 string='Transport Via')
    ocean_shipment_type = fields.Selection(([('fcl', 'Full Container(FCL)'),
                                             ('lcl', 'Less Container(LCL)')]),
                                           string='Ocean Shipment Type')
    freight_packages = fields.One2many( 'shipment.package.line', 'shipment_id')
class ShipmentPackageLine(models.Model): 
    _name = 'shipment.package.line'
    _rec_name = 'package'

     package_type = fields.Selection([('item', 'Loose Cargo'), ('container', 'Containerized')] ,
                                    string="Package Type", default='item')
     ...

Here is the XML view snippet:

<record model="ir.ui.view" id="freight_shipment_form_view"> 
   <field name="name">freight.shipment.form.view</field>
   <field name="model">freight.shipment</field >
   ...
   <sheet>
      ...
      <div class="oe_title mb24">
         <h1>
            <field class="text-break" name="name" default_focus="1" readonly="1"/>
         </ h1>
         <h3>
            <field name="direction" widget="radio" required="1" options="{'horizontal': true}"/>
         </h3>
      </div>
      ...
      <group string="Transport Details">
         <field name="is_transport_read_only" invisible="1" />
         <group>
            <field name="transport" widget="radio" options="{'horizontal': true}" required="1" readonly="is_transport_read_only"/>
         </group>
         <group>
            <field name ="ocean_shipment_type" invisible="shipment != 'ocean'" required="shipment == 'ocean'"/>
            <field name="inland_shipment_type" invisible="transport != 'land'" required="transport == 'land'"/>
         </group>
      </group>
      ...
      <notebook>
         ...
        <page string="Package Details" invisible="direction != 'export'">
           <field name="freight_packages" nolabel="1" widget="one2many_list">
              <tree string="Package">
                 <field name="name" required="1 "/>
                 ...
              </tree>
              <form string="Package">
                 <group>
                    <label for="package_type"/>
                    <div>
                       <field name="package_type" widget="radio" options="{'horizontal':True}"/>
                    </div>
                 </group>
                 <group invisible="package_type != 'container'">
                    <group string="Containerized">
                       <field name="name" required="1"/>
                    </group>
                    ...
                 <group invisible="package_type != 'item'">
                    <group string="Loose Cargo">
                       <field name="name" required="1"/>
                    </group>
                 ...


Here is the solution Microsoft pilot recommended but this not worked.

# Package type options 
@api.onchange('direction', 'transport', 'ocean_shipment_type')
def _onchange_shipment_conditions(self):
   for package in self.freight_packages:
      if self.direction == 'export' and self.transport == ' ocean' and self.ocean_shipment_type == 'fcl':
         package.package_type = 'container'
         package.fields_get()['package_type']['selection'] = [('container', 'Containerized')]
      else:
         package.fields_get()['package_type']['selection'] = [('item', 'Loose Cargo'), ('container', 'Containerized')]


How to fix my issue?



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

Sehr geehrte Damen und Herren,

 

ich bin bis einschließlich 03.01.2025 nicht im Büro. Eingehende E-Mails werden nicht zeitnah bearbeitet oder weitergeleitet.

 

Für dringende allgemeine Anfragen bitte ich Sie unsere Info-E-Mail-Adresse zu verwenden (info@be4energ.com).

 

Für Angebotsanfrage oder Fragen zu Projekten oder Planungen ist unser Projektierungsteam (projects@be4energy.com) für Sie erreichbar.

 

Mit herzlichem Gruße

 

Stefan Galler

 

 

Dear Sir or Madam,

 

I will be out of the office until January 3rd, 2025. Incoming emails will not be processed or forwarded promptly.

 

For urgent general inquiries, please use our general email address (info@be4energ.com).

 

For requests for quotations or questions regarding projects or planning, our project planning team (projects@be4energy.com) is available to assist you.

 

With kind regards,

 

Stefan Galler

 

 

 

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

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

ลงชื่อ
Related Posts ตอบกลับ มุมมอง กิจกรรม
can't find table planner in Odoo8 POS for restuarant
pos restaurant odooV8
อวตาร
อวตาร
1
เม.ย. 16
3293
Hide or remove button added by xpath แก้ไขแล้ว
xpath inherited form_view odooV8
อวตาร
อวตาร
อวตาร
อวตาร
8
ต.ค. 22
33087
How do I filter selection from form view?
filtering form_view res.users odooV8
อวตาร
อวตาร
1
พ.ค. 16
7850
Orders on a kitchen screen?
restaurant
อวตาร
อวตาร
อวตาร
อวตาร
อวตาร
5
ก.ค. 25
9914
CONFIGURACION DE CORREO PROPIO POR PRUMERA VEZ
odooV8
อวตาร
0
มี.ค. 25
1991
คอมมูนิตี้
  • บทเรียน
  • เอกสารกำกับโปรแกรม
  • ฟอรั่ม
โอเพนซอร์ส
  • ดาวน์โหลด
  • 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