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
    Supply Chain
    • 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
    • Discuss
    • Kecerdasan Buatan
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • 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
    • Manajemen Properti
    • 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
    • Konsultasi
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan
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

Problem with prototype inheritance model

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
inheritancemrp12.
4464 Tampilan
Avatar
thanhps

Hi,

I am trying to create a Manufacturing Calculation view to calculate the quantities of necessary materials (and equivalent materials in case of lacking the main materials) to produce a product.

Note: This view is only for calculating and doesn't make any stock move.

My solution is to make a copy of Manufacturing Order view. And here is my choices
Solution 1:

Create a new view which inherited from Manufacturing Order view. 

Then use the same model 'mrp.production' as the parent view for calculating. 

However, if I add my logic for calculating in my new view, it changes the logic of the parent view also 

=> It's not my choice

Solution 2:

Create a new view with new model named 'mrp.production.cal', which is prototype inheritance model of 'mrp.production' model. Then I can add my calculation logic to the new model.

However, when I try to create and click 'Save' button. And I don't really know the reason. 

The error shows as below

Odoo Server Error - Validation Error

×The operation cannot be completed, probably due to the following:
- deletion: you may be trying to delete a record while other records still reference it
- creation/update: a mandatory field is not correctly set

[object with reference: Production Order - mrp.production]


Here is my source code for solution 2:

class MrpProductionCalculation(models.Model):
_inherit = 'mrp.production'
_name = 'mrp.production.cal'

Am I doing the right way?

Thanks for any help!

UPDATE:
The details error is
odoo.sql_db: bad query: b'INSERT INTO "stock_move" ("id", "create_uid", "create_date", "write_uid", "write_date", "additional", "company_id", "date", "date_expected", "group_id", "is_done", "location_dest_id", "location_id", "name", "origin", "picking_type_id", "priority", "procure_method", "product_id", "product_uom", "product_uom_qty", "production_id", "propagate", "scrapped", "sequence", "state", "to_refund", "warehouse_id") VALUES (nextval(\'stock_move_id_seq\'), 2, (now() at time zone \'UTC\'), 2, (now() at time zone \'UTC\'), false, 1, \'2019-06-12 04:04:58\', \'2019-06-12 04:04:58\', 23, false, 12, 7, \'WH/MO/00023\', \'WH/MO/00023\', 18, \'1\', \'make_to_stock\', 28, 1, \'10.000\', 13, false, false, 10, \'draft\', false, 1) RETURNING id'
ERROR: insert or update on table "stock_move" violates foreign key constraint "stock_move_production_id_fkey"
DETAIL: Key (production_id)=(13) is not present in table "mrp_production".
​

0
Avatar
Buang
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
MRP for Job Shop Fabricator
mrp
Avatar
Avatar
1
Mar 26
1348
Odoo 17 Bom can't import with Produit / ID externe
mrp
Avatar
Avatar
Avatar
2
Agu 25
3130
Can't inherit base.view_partner_form of res.partner
inheritance
Avatar
Avatar
Avatar
Avatar
Avatar
4
Feb 25
5891
Include in inherit from JS class
inheritance
Avatar
Avatar
1
Agu 24
4067
How to Override a method in parent class in JS Diselesaikan
inheritance
Avatar
Avatar
2
Nov 24
5712
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
  • Karir
  • 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 Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo adalah software terintegrasi dengan 70+ aplikasi seperti CRM, Akuntansi, Inventaris, Sales, eCommerce, Marketing, POS; plus fitur lokal Indonesia!

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