Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

[Odoo 16] Quality Checks

Subscriure's

Get notified when there's activity on this post

This question has been flagged
QualityQualityChecks
1 Respondre
2445 Vistes
Avatar
Sophia Raudhah

I want to implement a quality module that consists of two types of quality control (pre and post-production), each with its own set of tests, is it possible to create a package to generate reports from these tests? or do you have other recommendations to manage the quality module?


0
Avatar
Descartar
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi, 
Please go through the below code. You will get an idea .
from odoo import fields, models, api
class QualityControlTest(models.Model):
    _name = 'quality.control.test'
    _description = 'Quality Control Test'

    name = fields.Char(string='Name', required=True)
    test_type = fields.Selection([('pre', 'Pre-Production'), ('post', 'Post-Production')],
                                 string='Test Type', required=True)
    test_status = fields.Selection([('passed', 'Passed'), ('failed', 'Failed')],
                                   string='Test Status', default='passed')
    error_message = fields.Text(string='Error Message')
    timestamp = fields.Datetime(string='Timestamp', default=fields.Datetime.now)

class QualityControlReport(models.Model):
    _name = 'quality.control.report'
    _description = 'Quality Control Report'

    name = fields.Char(string='Name', required=True)
    test_ids = fields.One2many('quality.control.test', 'report_id', string='Tests')

class QualityControlWizard(models.TransientModel):
    _name = 'quality.control.wizard'
    _description = 'Quality Control Wizard'

    name = fields.Char(string='Name')
    test_type = fields.Selection([('pre', 'Pre-Production'), ('post', 'Post-Production')],
                                 string='Test Type', required=True)

    def run_tests(self):
        test_model = self.env['quality.control.test']
        tests = test_model.search([('test_type', '=', self.test_type)])
        for test in tests:
            if test.name == 'Sample Test':
                test.test_status = 'failed'
                test.error_message = 'Test failed due to invalid input'
            else:
                test.test_status = 'passed'
        report_model = self.env['quality.control.report']
        report_vals = {
            'name': self.name,
            'test_ids': [(6, 0, tests.ids)] 
        }
        report_model.create(report_vals)
        return {
            'type': 'ir.actions.act_window',
            'name': 'Quality Control Report',
            'res_model': 'quality.control.report',
            'view_mode': 'form',
            'res_id': report.id,
            'target': 'new',
        }

When the wizard is launched, the run_tests() method is invoked. According to the chosen test type, it runs the tests, updates the test results, compiles the results into a quality control report, and then opens the report in a new window. The run_tests() method's logic can be modified to carry out your unique tests and update the test results appropriately. You must install this module in your Odoo instance and configure the proper views and menu items in the module's XML files in order to use it.

Hope it helps

0
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
Quality Control Worksheet Fields Solved
Quality worksheet QualityChecks
Avatar
1
d’oct. 25
650
Quality control - fail location doesn´t work
locations Quality QualityChecks
Avatar
0
d’ag. 24
1792
Quality assurance check with IAFT 16949 standards for the automative industry.
qualitycontrol Quality QualityChecks
Avatar
0
de des. 23
1798
View quality checks in one checklist, rather than being done one by one.
quality qualitycontrol Quality QualityChecks
Avatar
2
de febr. 25
54
quality checks on the quantity
quantity qualitycontrol Quality QualityChecks
Avatar
0
de set. 23
2114
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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