Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

how to solve product.uom error

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
errorcustom
2 Replies
12920 Tampilan
Avatar
Aijay Ogbugha

Hey guys, I created a form to receive data for a store. But on clicking the "save" button, i get this error: except_osv: ('Integrity Error', 'The operation cannot be completed, probably due to the following:\n- deletion: you may be trying to delete a record while other records still reference it\n- creation/update: a mandatory field is not correctly set\n\n[object with reference: Product Unit of Measure - product.uom]')

I really don't know why this error since i didn't inherit any object except the "mail.thread" object. Please i need help concerning this. It has really taken my time and i have limited time to deliver. And I don't know where else to look to solve it.

Any help will be appreciated please.

class store_products(osv.osv):
    _name='store.products'
    _description='Store Products'
    _inherit=['mail.thread']
    _columns={
         'name': fields.char('Description', size=128, required=True, translate=True, select=True),
         'my_product_id': fields.many2one('product.product', 'Product', required=True, select=True),
         'product_qty': fields.integer('Quantity', required=True, track_visibility='onchange'),
         'store_product_id': fields.many2one('store.issuing.voucher', 'Products'),
         'value': fields.float('Value (NGN)', size=32,track_visibility='onchange'),
         #'account_code': fields.char('Account Code', size=32, readonly=False, required=True, 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_issuing_voucher(osv.osv):
    _name = "store.issuing.voucher"
    _inherit = [ 'mail.thread']
    _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 Present Manager', required=False, track_visibility='onchange'),              
          'stock_journal_id': fields.many2one('stock.journal','Stock Journal', select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
          'date': fields.datetime('Date', require=True, select=True),
          'mystore_product_ids': fields.one2many('store.products', 'store_product_id', 'Store Product Lines'),
          'value': fields.float('Value (NGN)', size=32,track_visibility='onchange'),
          'note': fields.text('Notes'),
}
store_issuing_voucher()

XML :

<record id="store_issuing_voucher_form" model="ir.ui.view">
        <field name="name">store.issuing.voucher.form</field>
        <field name="model">store.issuing.voucher</field>
        <field name="arch" type="xml">
            <form string="Store Issuing Voucher" version="7.0">
                    <sheet string="Store Issuing Voucher">
                        <group string="Requestor Details" col="4">
                            <field name="employee_id" on_change="onchange_employee_id(employee_id,department_id)" />
                            <field name="department_id"/>
                            <field name="date" />
                            <field name="organizational_id"  />
                            <field name="fund_code"  />
                            <field name="program_code"  />
                            <field name="location_code"  />
                            <field name="manager_id" />                                 
                        </group>
                    <group string="Product Item Details">
                        <notebook>
                            <page string="Store Products Lines">
                                <field name= "mystore_product_ids" />
                                <field name="note" placeholder="Add any note..." class="oe_inline" />
                            </page>
                        </notebook> 
                    </group>
                </sheet>
                <div class="oe_chatter">
                    <field name="message_follower_ids" widget="mail_followers"/>
                    <field name="message_ids" widget="mail_thread"/>
                </div>
            </form>
        </field>
    </record>
    <!-- End of Store Issuing Voucher Form View -->

     <!-- Store Issuing Voucher tree View -->

    <record id="store_issuing_voucher_tree" model="ir.ui.view">
        <field name="name">store.issuing.voucher.tree</field>
        <field name="model">store.issuing.voucher</field>
        <field name="type">tree</field>
        <field name="arch" type="xml">
            <tree string="Vouchers" >
              <!--  <field name="my_product_id"/>  -->
                <field name="employee_id"/>
                <field name="department_id" />
                <field name="organizational_id"/>
                <field name="program_code"/>
                <field name="value"/>
                <field name="date"/>
            </tree>
        </field>
    </record>

 <record id="store_products_form" model="ir.ui.view">
        <field name="name">store.products.form</field>
        <field name="model">store.products</field>
        <field name="arch" type="xml">
            <form string="Store Product Lines" version="7.0">
                <sheet>
                    <group col="4">
                        <field name="account_code"/>
                      <field name="my_product_id" on_change="onchange_my_product_id(my_product_id)"/>  
                      <!-- <field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, False)"/>
                        <field name="name"/>-->
                        <field name="product_qty"/>
                        <field name="value"/>
                    </group>
                </sheet>
                <div class="oe_chatter">
                    <field name="message_follower_ids" widget="mail_followers"/>
                    <field name="message_ids" widget="mail_thread"/>
                </div>
            </form>

 <record id="store_products_tree" model="ir.ui.view">
        <field name="name">store.products.tree</field>
        <field name="model">store.products</field>
        <field name="arch" type="xml">
            <tree string="Store Products">
                <field name="account_code"/>
                <field name="my_product_id"/>
                <field name="product_qty"/> 
                <field name="value"/>
            </tree>
        </field>
   </record>
0
Avatar
Buang
Ghanshyam Prajapati

paste your code over here.

patrick

Canyou post your XML as well in the original question?

Aijay Ogbugha
Penulis

I have posted both py and xml files. thanks

Avatar
patrick
Jawaban Terbai

The error-message indicates that during deletion or creating/saving an error occured regarding consistency.

You say you want to save, so that means that your object somehow needs to know the uom (Unit Of Manufacturing). It might help, if you post your code in your question, so we can have a look how/what.

0
Avatar
Buang
Avatar
Aijay Ogbugha
Penulis Jawaban Terbai
class store_products(osv.osv):
    _name='store.products'
    _description='Store Products'
    _inherit=['mail.thread']
    _columns={
         'name': fields.char('Description', size=128, required=True, translate=True, select=True),
         'my_product_id': fields.many2one('product.product', 'Product', required=True, select=True),
         'product_qty': fields.integer('Quantity', required=True, track_visibility='onchange'),
         'store_product_id': fields.many2one('store.issuing.voucher', 'Products'),
         'value': fields.float('Value (NGN)', size=32,track_visibility='onchange'),
         #'account_code': fields.char('Account Code', size=32, readonly=False, required=True, 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_issuing_voucher(osv.osv):
    _name = "store.issuing.voucher"
    _inherit = [ 'mail.thread']
    _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 Present Manager', required=False, track_visibility='onchange'),              
          'stock_journal_id': fields.many2one('stock.journal','Stock Journal', select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
          'date': fields.datetime('Date', require=True, select=True),
          'mystore_product_ids': fields.one2many('store.products', 'store_product_id', 'Store Product Lines'),
          'value': fields.float('Value (NGN)', size=32,track_visibility='onchange'),
          'note': fields.text('Notes'),
}
store_issuing_voucher()
0
Avatar
Buang
Aijay Ogbugha
Penulis

This is the py file

Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
"Undefined get method" error after installing unrelated model
error custom sale.order
Avatar
2
Mei 16
4922
Can´t install custom modules odoo 8.0
error module custom
Avatar
Avatar
2
Mar 15
7396
?"Your country might be blocked by our hosting provider" error when I create new website
error
Avatar
0
Okt 25
534
Payment Page Return Error with Razorpay on Mobile Devices
error
Avatar
0
Sep 25
1158
Error after installing "purchase" app in Odoo version 18
error
Avatar
Avatar
1
Des 24
6605
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik 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