mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
@@ -2,4 +2,5 @@
|
||||
# Add a repository url and branch if you need a forked version
|
||||
product-attribute
|
||||
purchase-workflow
|
||||
stock-logistics-warehouse
|
||||
stock-logistics-warehouse
|
||||
management-system
|
||||
144
quality_control_plan/README.rst
Normal file
144
quality_control_plan/README.rst
Normal file
@@ -0,0 +1,144 @@
|
||||
==============================
|
||||
Quality Control - Control Plan
|
||||
==============================
|
||||
|
||||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||
:target: https://odoo-community.org/page/development-status
|
||||
:alt: Beta
|
||||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github
|
||||
:target: https://github.com/OCA/manufacture/tree/11.0/quality_control_plan
|
||||
:alt: OCA/manufacture
|
||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
||||
:target: https://translation.odoo-community.org/projects/manufacture-11-0/manufacture-11-0-quality_control_plan
|
||||
:alt: Translate me on Weblate
|
||||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
||||
:target: https://runbot.odoo-community.org/runbot/129/11.0
|
||||
:alt: Try me on Runbot
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
|
||||
These module manages the Control Plans for Quality Control, to define how many products to check on an inspection.
|
||||
|
||||
It is possible to create a list of Control Plans with names and free pass flag.
|
||||
Only one Plan a time can have the free pass flagged.
|
||||
|
||||
For each Control Plan is possible to assign different levels of control each with
|
||||
a minimum quantity, a value to check and the type of check value: the check
|
||||
type can be an absolute number of pieces or a percentage.
|
||||
|
||||
On Products, Product Category and Partner is possible to set a specific Control Plan.
|
||||
|
||||
When Inspection is generated the Control Plan to use is selected trought Product-Partner,
|
||||
Category-Partner, Product, Category, Partner.
|
||||
|
||||
Creates a reference between Inspections and Nonconformities.
|
||||
|
||||
**Table of contents**
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
Istall with standar method
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
This module doesn't need configuration
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
Steps to follow to use Control Plans:
|
||||
|
||||
- create a list of Control Plans
|
||||
- define levels of control for Control Pans
|
||||
|
||||
**Control Plan**
|
||||
* Go to Quality Control
|
||||
* From Test menu select Control Plan
|
||||
* Create a Control Plan with a name, description and eventually with Free Pass flag checked
|
||||
|
||||
**Control Plan Levels**
|
||||
|
||||
- Option A
|
||||
* Go to Quality Control
|
||||
* From Test menu select Control Plan
|
||||
* Select a Control Plan
|
||||
* Add rows with quantity level, value to check, type of value
|
||||
|
||||
- Option B
|
||||
* Go to Quality Control
|
||||
* From Test menu select Control Plan Levels
|
||||
* Create a new element selecting the Control Plan and filling other fields
|
||||
|
||||
**Inspection → Nonconformity**
|
||||
* Go to Qaulity Control
|
||||
* From Inspection menu select Inspection
|
||||
* Open or create an Inspection
|
||||
* On tab Nonconformity add a new line, or click «Add Nonconformity»
|
||||
|
||||
**Nonconformity → Inspection**
|
||||
* Go to Management System
|
||||
* From Management System menu select Nonconformity
|
||||
* Open or create a Nonconformity
|
||||
* On field Inspection select or create the relative Inspection
|
||||
|
||||
Changelog
|
||||
=========
|
||||
|
||||
11.0.1.0.0 (2020-01-01)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* [INI] Initial development
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/manufacture/issues>`_.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/OCA/manufacture/issues/new?body=module:%20quality_control_plan%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
|
||||
Do not contact contributors directly about support or help with technical issues.
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Authors
|
||||
~~~~~~~
|
||||
|
||||
* Associazione PNLUG - Gruppo Odoo
|
||||
|
||||
Contributors
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* Marcelo Frare <mf2965@gmail.com>
|
||||
* Stefano Consolaro <stefano.consolaro@mymage.it>
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
||||
This module is maintained by the OCA.
|
||||
|
||||
.. image:: https://odoo-community.org/logo.png
|
||||
:alt: Odoo Community Association
|
||||
:target: https://odoo-community.org
|
||||
|
||||
OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||
mission is to support the collaborative development of Odoo features and
|
||||
promote its widespread use.
|
||||
|
||||
This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/11.0/quality_control_plan>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||
4
quality_control_plan/__init__.py
Normal file
4
quality_control_plan/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
from . import (
|
||||
models,
|
||||
)
|
||||
35
quality_control_plan/__manifest__.py
Normal file
35
quality_control_plan/__manifest__.py
Normal file
@@ -0,0 +1,35 @@
|
||||
# Copyright 2019 Marcelo Frare (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
# Copyright 2019 Stefano Consolaro (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
"name": "Quality Control - Control Plan",
|
||||
"summary": "Control Plan for Inspection quantity definition.",
|
||||
"version": "11.0.1.0.0",
|
||||
|
||||
"author": "Associazione PNLUG - Gruppo Odoo, Odoo Community Association (OCA)",
|
||||
"website": "https://gitlab.com/PNLUG/Odoo/management-system-improvements/tree/"
|
||||
"11.0/quality_control_plan",
|
||||
"license": "AGPL-3",
|
||||
|
||||
"category": "Quality control",
|
||||
|
||||
"depends": [
|
||||
'stock',
|
||||
'product',
|
||||
'mgmtsystem',
|
||||
'mgmtsystem_nonconformity',
|
||||
'quality_control',
|
||||
'quality_control_stock',
|
||||
],
|
||||
"data": [
|
||||
'security/ir.model.access.csv',
|
||||
'views/qc_menu.xml',
|
||||
'views/qc_plan_view.xml',
|
||||
'views/qc_inspection_view.xml',
|
||||
'views/mgmtsystem_nonconformity_view.xml',
|
||||
'views/partner_view.xml',
|
||||
'views/product_view.xml',
|
||||
],
|
||||
'installable': True,
|
||||
}
|
||||
263
quality_control_plan/i18n/it.po
Normal file
263
quality_control_plan/i18n/it.po
Normal file
@@ -0,0 +1,263 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * quality_control_plan
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 11.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-04-08 20:35+0000\n"
|
||||
"PO-Revision-Date: 2020-04-08 22:59+0200\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: Poedit 2.3\n"
|
||||
"Last-Translator: \n"
|
||||
"Language: it\n"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: selection:qc.level,chk_type:0
|
||||
msgid "Absolute value"
|
||||
msgstr "Valore assoluto"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.qc_inspection_qty_checked
|
||||
msgid "Add Nonconformity"
|
||||
msgstr "Aggiungi non conformità"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model,name:quality_control_plan.model_res_partner
|
||||
msgid "Contact"
|
||||
msgstr "Contatto"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_inspection_plan_id
|
||||
msgid "Control Plan"
|
||||
msgstr "Piano di controllo"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.actions.act_window,name:quality_control_plan.qc_level_action
|
||||
#: model:ir.ui.menu,name:quality_control_plan.menu_qc_level
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.view_form_plan
|
||||
msgid "Control Plan Levels"
|
||||
msgstr "Livelli piano di controllo"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.actions.act_window,name:quality_control_plan.qc_plan_action
|
||||
#: model:ir.ui.menu,name:quality_control_plan.menu_qc_plan
|
||||
msgid "Control Plans"
|
||||
msgstr "Piani di controllo"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: code:addons/quality_control_plan/models/qc_inspection_plan.py:193
|
||||
#, python-format
|
||||
msgid "Create Nonconformity on not compliant Inspection"
|
||||
msgstr "Crea una non conformità per una ispezione non conforme"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_level_create_uid
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_plan_create_uid
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_trigger_partner_line_create_uid
|
||||
msgid "Created by"
|
||||
msgstr "Creato da"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_level_create_date
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_plan_create_date
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_trigger_partner_line_create_date
|
||||
msgid "Created on"
|
||||
msgstr "Creato il"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_plan_description
|
||||
msgid "Description"
|
||||
msgstr "Descrizione"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_level_display_name
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_plan_display_name
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_trigger_partner_line_display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Nome visualizzato"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_plan_free_pass
|
||||
msgid "Free pass"
|
||||
msgstr "Fre pass"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_level_id
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_plan_id
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_trigger_partner_line_id
|
||||
msgid "ID"
|
||||
msgstr "ID"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,help:quality_control_plan.field_qc_level_chk_type
|
||||
msgid "Indicate how to use quantity checked value"
|
||||
msgstr "Indica come considerare il valore della quantità da controllare"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_mgmtsystem_nonconformity_inspection_id
|
||||
msgid "Inspection"
|
||||
msgstr "Ispezione"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: code:addons/quality_control_plan/models/qc_inspection_plan.py:202
|
||||
#, python-format
|
||||
msgid "Inspection not compliant"
|
||||
msgstr "Ispezione non conforme"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_level___last_update
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_plan___last_update
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_trigger_partner_line___last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr "Ultima modifica il"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_level_write_uid
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_plan_write_uid
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_trigger_partner_line_write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr "Aggiornato da"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_level_write_date
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_plan_write_date
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_trigger_partner_line_write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr "Aggiornato il"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.view_form_plan
|
||||
msgid "Level lines"
|
||||
msgstr "Linee livello"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_level_chk_type
|
||||
msgid "Measure"
|
||||
msgstr "Misura"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,help:quality_control_plan.field_qc_level_qty_received
|
||||
msgid "Minimum received quantity reference"
|
||||
msgstr "Riferimento minima quantità ricevuta"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_plan_name
|
||||
msgid "Name"
|
||||
msgstr "Nome"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model,name:quality_control_plan.model_mgmtsystem_nonconformity
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_inspection_inspection_ids
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.qc_inspection_qty_checked
|
||||
msgid "Nonconformity"
|
||||
msgstr "Non conformità"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_trigger_partner_line_partner
|
||||
msgid "Partner"
|
||||
msgstr "Fornitore"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: selection:qc.level,chk_type:0
|
||||
msgid "Percent"
|
||||
msgstr "Percentuale"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_level_plan_id
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_plan_plan_ids
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_trigger_partner_line_plan_id
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_trigger_product_category_line_plan_id
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_trigger_product_template_line_plan_id
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.view_form_plan
|
||||
msgid "Plan"
|
||||
msgstr "Piano"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.view_tree_plan
|
||||
msgid "QC Plan"
|
||||
msgstr "Piano QC"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.view_form_level
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.view_tree_level
|
||||
msgid "QC level"
|
||||
msgstr "Livello QC"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.view_mgmtsystem_nonconformity_partner
|
||||
msgid "Quality"
|
||||
msgstr "Qualità"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model,name:quality_control_plan.model_qc_plan
|
||||
msgid "Quality Control Plan"
|
||||
msgstr "Piano controllo qualità"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model,name:quality_control_plan.model_qc_level
|
||||
msgid "Quality Control Plan Levels"
|
||||
msgstr "Livelli piano controllo qualità"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.view_mgmtsystem_nonconformity_partner
|
||||
msgid "Quality control"
|
||||
msgstr "Controllo qualità"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model,name:quality_control_plan.model_qc_inspection
|
||||
msgid "Quality control inspection"
|
||||
msgstr "Ispezione controllo qualità"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_res_partner_qc_triggers
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_res_users_qc_triggers
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.view_mgmtsystem_nonconformity_partner
|
||||
msgid "Quality control triggers"
|
||||
msgstr "Automatismi controllo qualità"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_inspection_qty_checked
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_level_qty_checked
|
||||
msgid "Quantity checked"
|
||||
msgstr "Quantità controllata"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,help:quality_control_plan.field_qc_level_qty_checked
|
||||
msgid "Quantity to check if the received goods is higher than the reference"
|
||||
msgstr "Quantità da controllare se la merce ricevuta è superiore al riferimento"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_level_qty_received
|
||||
msgid "Quantity to inspect"
|
||||
msgstr "Quantità da controllare"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.qc_inspection_qty_checked
|
||||
msgid "Total quantity"
|
||||
msgstr "Quantità totale"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model,name:quality_control_plan.model_stock_picking
|
||||
msgid "Transfer"
|
||||
msgstr "Trasferimento"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model,name:quality_control_plan.model_qc_trigger_partner_line
|
||||
msgid "qc.trigger.partner_line"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model,name:quality_control_plan.model_qc_trigger_product_category_line
|
||||
msgid "qc.trigger.product_category_line"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model,name:quality_control_plan.model_qc_trigger_product_template_line
|
||||
msgid "qc.trigger.product_template_line"
|
||||
msgstr ""
|
||||
262
quality_control_plan/i18n/quality_control_plan.pot
Normal file
262
quality_control_plan/i18n/quality_control_plan.pot
Normal file
@@ -0,0 +1,262 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * quality_control_plan
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 11.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-04-08 20:35+0000\n"
|
||||
"PO-Revision-Date: 2020-04-08 20:35+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: selection:qc.level,chk_type:0
|
||||
msgid "Absolute value"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.qc_inspection_qty_checked
|
||||
msgid "Add Nonconformity"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model,name:quality_control_plan.model_res_partner
|
||||
msgid "Contact"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_inspection_plan_id
|
||||
msgid "Control Plan"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.actions.act_window,name:quality_control_plan.qc_level_action
|
||||
#: model:ir.ui.menu,name:quality_control_plan.menu_qc_level
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.view_form_plan
|
||||
msgid "Control Plan Levels"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.actions.act_window,name:quality_control_plan.qc_plan_action
|
||||
#: model:ir.ui.menu,name:quality_control_plan.menu_qc_plan
|
||||
msgid "Control Plans"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: code:addons/quality_control_plan/models/qc_inspection_plan.py:193
|
||||
#, python-format
|
||||
msgid "Create Nonconformity on not compliant Inspection"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_level_create_uid
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_plan_create_uid
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_trigger_partner_line_create_uid
|
||||
msgid "Created by"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_level_create_date
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_plan_create_date
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_trigger_partner_line_create_date
|
||||
msgid "Created on"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_plan_description
|
||||
msgid "Description"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_level_display_name
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_plan_display_name
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_trigger_partner_line_display_name
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_plan_free_pass
|
||||
msgid "Free pass"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_level_id
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_plan_id
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_trigger_partner_line_id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,help:quality_control_plan.field_qc_level_chk_type
|
||||
msgid "Indicate how to use quantity checked value"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_mgmtsystem_nonconformity_inspection_id
|
||||
msgid "Inspection"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: code:addons/quality_control_plan/models/qc_inspection_plan.py:202
|
||||
#, python-format
|
||||
msgid "Inspection not compliant"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_level___last_update
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_plan___last_update
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_trigger_partner_line___last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_level_write_uid
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_plan_write_uid
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_trigger_partner_line_write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_level_write_date
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_plan_write_date
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_trigger_partner_line_write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.view_form_plan
|
||||
msgid "Level lines"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_level_chk_type
|
||||
msgid "Measure"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,help:quality_control_plan.field_qc_level_qty_received
|
||||
msgid "Minimum received quantity reference"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_plan_name
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model,name:quality_control_plan.model_mgmtsystem_nonconformity
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_inspection_inspection_ids
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.qc_inspection_qty_checked
|
||||
msgid "Nonconformity"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_trigger_partner_line_partner
|
||||
msgid "Partner"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: selection:qc.level,chk_type:0
|
||||
msgid "Percent"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_level_plan_id
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_plan_plan_ids
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_trigger_partner_line_plan_id
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_trigger_product_category_line_plan_id
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_trigger_product_template_line_plan_id
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.view_form_plan
|
||||
msgid "Plan"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.view_tree_plan
|
||||
msgid "QC Plan"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.view_form_level
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.view_tree_level
|
||||
msgid "QC level"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.view_mgmtsystem_nonconformity_partner
|
||||
msgid "Quality"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model,name:quality_control_plan.model_qc_plan
|
||||
msgid "Quality Control Plan"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model,name:quality_control_plan.model_qc_level
|
||||
msgid "Quality Control Plan Levels"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.view_mgmtsystem_nonconformity_partner
|
||||
msgid "Quality control"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model,name:quality_control_plan.model_qc_inspection
|
||||
msgid "Quality control inspection"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_res_partner_qc_triggers
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_res_users_qc_triggers
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.view_mgmtsystem_nonconformity_partner
|
||||
msgid "Quality control triggers"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_inspection_qty_checked
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_level_qty_checked
|
||||
msgid "Quantity checked"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,help:quality_control_plan.field_qc_level_qty_checked
|
||||
msgid "Quantity to check if the received goods is higher than the reference"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model.fields,field_description:quality_control_plan.field_qc_level_qty_received
|
||||
msgid "Quantity to inspect"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.ui.view,arch_db:quality_control_plan.qc_inspection_qty_checked
|
||||
msgid "Total quantity"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model,name:quality_control_plan.model_stock_picking
|
||||
msgid "Transfer"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model,name:quality_control_plan.model_qc_trigger_partner_line
|
||||
msgid "qc.trigger.partner_line"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model,name:quality_control_plan.model_qc_trigger_product_category_line
|
||||
msgid "qc.trigger.product_category_line"
|
||||
msgstr ""
|
||||
|
||||
#. module: quality_control_plan
|
||||
#: model:ir.model,name:quality_control_plan.model_qc_trigger_product_template_line
|
||||
msgid "qc.trigger.product_template_line"
|
||||
msgstr ""
|
||||
|
||||
3
quality_control_plan/models/__init__.py
Normal file
3
quality_control_plan/models/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
from . import mgmtsystem_nonconformity_inspection, partner_quality, \
|
||||
qc_inspection_plan, qc_plan, qc_trigger, stock_picking_inspection
|
||||
@@ -0,0 +1,17 @@
|
||||
# Copyright 2019 Marcelo Frare (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
# Copyright 2019 Stefano Consolaro (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class MgmtsystemMgmInspection(models.Model):
|
||||
"""
|
||||
Extends nonconformity adding related inspection
|
||||
"""
|
||||
|
||||
_inherit = ['mgmtsystem.nonconformity']
|
||||
|
||||
# new field
|
||||
# inspection reference
|
||||
inspection_id = fields.Many2one('qc.inspection', 'Inspection')
|
||||
21
quality_control_plan/models/partner_quality.py
Normal file
21
quality_control_plan/models/partner_quality.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# Copyright 2019 Marcelo Frare (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
# Copyright 2019 Stefano Consolaro (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class MgmtsystemMgmPartner(models.Model):
|
||||
"""
|
||||
Extends partner with quality control triggers
|
||||
"""
|
||||
|
||||
_inherit = ['res.partner']
|
||||
|
||||
# new fields
|
||||
# trigger to activate inspection
|
||||
qc_triggers = fields.One2many(
|
||||
comodel_name="qc.trigger.partner_line",
|
||||
inverse_name="partner",
|
||||
string="Quality control triggers"
|
||||
)
|
||||
29
quality_control_plan/models/product_trigger.py
Normal file
29
quality_control_plan/models/product_trigger.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# Copyright 2019 Marcelo Frare (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
# Copyright 2019 Stefano Consolaro (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class QcProduct(models.Model):
|
||||
"""
|
||||
Extends product model with a field to store quality control plan assigned
|
||||
"""
|
||||
|
||||
_inherit = ['qc.trigger.product_template_line']
|
||||
|
||||
# new filed
|
||||
# product's control plan
|
||||
plan_id = fields.Many2one('qc.plan', 'Plan')
|
||||
|
||||
|
||||
class QcCategory(models.Model):
|
||||
"""
|
||||
Extends product category model with a field to store quality control plan assigned
|
||||
"""
|
||||
|
||||
_inherit = ['qc.trigger.product_category_line']
|
||||
|
||||
# new filed
|
||||
# sets product category's control plan
|
||||
plan_id = fields.Many2one('qc.plan', 'Plan')
|
||||
211
quality_control_plan/models/qc_inspection_plan.py
Normal file
211
quality_control_plan/models/qc_inspection_plan.py
Normal file
@@ -0,0 +1,211 @@
|
||||
# Copyright 2019 Marcelo Frare (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
# Copyright 2019 Stefano Consolaro (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models, api, _
|
||||
|
||||
|
||||
class QcInspection(models.Model):
|
||||
"""
|
||||
Extends inspection with:
|
||||
- plan control
|
||||
- nonconformity relations
|
||||
- method to fill inspection with control plan data
|
||||
- method create nonconformity from inspection
|
||||
"""
|
||||
|
||||
_inherit = ['qc.inspection']
|
||||
|
||||
# new fields
|
||||
# the control plan to be used
|
||||
plan_id = fields.Many2one('qc.plan', 'Control Plan')
|
||||
# quantity to be checked
|
||||
qty_checked = fields.Float('Quantity checked')
|
||||
# nonconformity reference
|
||||
inspection_ids = fields.One2many('mgmtsystem.nonconformity',
|
||||
'inspection_id',
|
||||
'Nonconformity'
|
||||
)
|
||||
|
||||
@api.model
|
||||
def create(self, values):
|
||||
"""
|
||||
Extends inspection method by integrating logic to determine the control plan
|
||||
to be used and the calculation of the quantity to be checked
|
||||
"""
|
||||
|
||||
# calls original method
|
||||
new_record = super(QcInspection, self).create(values)
|
||||
|
||||
# gets product of the inspection
|
||||
product_id = new_record.product_id
|
||||
|
||||
# gets partner from picking if exists
|
||||
if new_record.picking_id:
|
||||
partner_id = self.env['stock.picking'
|
||||
].search([('id', '=', new_record.picking_id.id)],
|
||||
limit=1
|
||||
).partner_id.id
|
||||
else:
|
||||
partner_id = False
|
||||
|
||||
# temporary presetted solutions
|
||||
solution_art_prt = '' # plan for product (article) and partner
|
||||
solution_cat_prt = '' # plan for product category and partner
|
||||
solution_art = '' # plan for product (article)
|
||||
solution_cat = '' # plan for product category
|
||||
solution_prt = '' # plan for partner
|
||||
|
||||
# tries to get plan for product and partner
|
||||
solution_art_prt = self.env['qc.trigger.product_template_line'
|
||||
].search([('product_template',
|
||||
'=',
|
||||
product_id.product_tmpl_id.id),
|
||||
('partners', '!=', False),
|
||||
('partners', '=', partner_id)
|
||||
],
|
||||
limit=1
|
||||
)
|
||||
|
||||
if (len(solution_art_prt)
|
||||
== 0):
|
||||
# tries to gets plan for category and partner
|
||||
solution_cat_prt = self.env['qc.trigger.product_category_line'
|
||||
].search([('product_category',
|
||||
'=',
|
||||
product_id.categ_id.id),
|
||||
('partners', '!=', False),
|
||||
('partners', '=', partner_id)
|
||||
],
|
||||
limit=1
|
||||
)
|
||||
|
||||
if (len(solution_art_prt)
|
||||
+ len(solution_cat_prt)
|
||||
== 0):
|
||||
# tries to get plan for product
|
||||
solution_art = self.env['qc.trigger.product_template_line'
|
||||
].search([('product_template',
|
||||
'=',
|
||||
product_id.product_tmpl_id.id
|
||||
),
|
||||
('partners', '=', False)
|
||||
],
|
||||
limit=1
|
||||
)
|
||||
|
||||
if (len(solution_art_prt)
|
||||
+ len(solution_cat_prt)
|
||||
+ len(solution_art)
|
||||
== 0):
|
||||
# tries to get plan for category
|
||||
solution_cat = self.env['qc.trigger.product_category_line'
|
||||
].search([('product_category',
|
||||
'=',
|
||||
product_id.categ_id.id
|
||||
),
|
||||
('partners', '=', False)
|
||||
],
|
||||
limit=1
|
||||
)
|
||||
|
||||
if (len(solution_art_prt)
|
||||
+ len(solution_cat_prt)
|
||||
+ len(solution_art)
|
||||
+ len(solution_cat)
|
||||
== 0):
|
||||
# tries to get plan for partner
|
||||
solution_prt = self.env['qc.trigger.partner_line'
|
||||
].search([('partner', '=', partner_id)
|
||||
],
|
||||
limit=1
|
||||
)
|
||||
|
||||
# gets the plan from the first positive try
|
||||
if len(solution_art_prt):
|
||||
plan_id = solution_art_prt.plan_id
|
||||
elif len(solution_cat_prt):
|
||||
plan_id = solution_cat_prt.plan_id
|
||||
elif len(solution_art):
|
||||
plan_id = solution_art.plan_id
|
||||
elif len(solution_cat):
|
||||
plan_id = solution_cat.plan_id
|
||||
elif len(solution_prt):
|
||||
plan_id = solution_prt.plan_id
|
||||
else:
|
||||
new_record.qty_checked = '1'
|
||||
new_record.plan_id = ''
|
||||
return new_record
|
||||
|
||||
if plan_id:
|
||||
# assigns plan to be used
|
||||
new_record.plan_id = plan_id
|
||||
|
||||
if new_record.plan_id.free_pass:
|
||||
# for free pass doesn't check product
|
||||
new_record.qty_checked = 0
|
||||
|
||||
else:
|
||||
# gets check informations from levels
|
||||
qty_related = self.env['qc.level'
|
||||
].search([('plan_id', '=', plan_id.id),
|
||||
('qty_received', '<', new_record.qty)
|
||||
],
|
||||
limit=1,
|
||||
order='qty_received desc'
|
||||
)
|
||||
# assigns qty to check
|
||||
if qty_related:
|
||||
if qty_related.chk_type == 'percent':
|
||||
# as percent of qty to check
|
||||
new_record.qty_checked = int(new_record.qty
|
||||
* qty_related.qty_checked
|
||||
/ 100
|
||||
)
|
||||
else:
|
||||
# as absolute value
|
||||
new_record.qty_checked = qty_related.qty_checked
|
||||
|
||||
# verifies if enough pcs to check
|
||||
if new_record.qty_checked > new_record.qty:
|
||||
new_record.qty_checked = new_record.qty
|
||||
|
||||
# checks and fix absolute minimum value lower to 1
|
||||
if new_record.qty_checked < 1:
|
||||
new_record.qty_checked = 1
|
||||
|
||||
return new_record
|
||||
|
||||
@api.multi
|
||||
def create_nonconformity(self, **kwargs):
|
||||
"""
|
||||
Opens nonconformity form view prefilled with inspection data
|
||||
"""
|
||||
|
||||
# gets partner if exists
|
||||
if self.picking_id.partner_id.id:
|
||||
partner = self.picking_id.partner_id.id
|
||||
else:
|
||||
partner = False
|
||||
|
||||
tmp_form_name = "mgmtsystem_nonconformity.view_mgmtsystem_nonconformity_form"
|
||||
return {
|
||||
# opens nonconformity form view
|
||||
'name' : _('Create Nonconformity on not compliant Inspection'),
|
||||
'view_type' : 'form',
|
||||
'view_mode' : 'form',
|
||||
'res_model' : 'mgmtsystem.nonconformity',
|
||||
'view_id' : self.env.ref(tmp_form_name).id,
|
||||
'type' : 'ir.actions.act_window',
|
||||
|
||||
# fills fields with inspection data
|
||||
'context': {
|
||||
'default_name' : _('Inspection not compliant'),
|
||||
'default_product_id' : self.product_id.id,
|
||||
'default_partner_id' : partner,
|
||||
'default_qty_checked' : self.qty_checked,
|
||||
'default_inspection_id' : self.id
|
||||
},
|
||||
|
||||
'target': 'new'
|
||||
}
|
||||
86
quality_control_plan/models/qc_plan.py
Normal file
86
quality_control_plan/models/qc_plan.py
Normal file
@@ -0,0 +1,86 @@
|
||||
# Copyright 2019 Marcelo Frare (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
# Copyright 2019 Stefano Consolaro (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models, api, _
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
|
||||
class QcPlan(models.Model):
|
||||
"""
|
||||
Manages quality control plans
|
||||
"""
|
||||
|
||||
# model
|
||||
_name = 'qc.plan'
|
||||
_description = 'Quality Control Plan'
|
||||
|
||||
_inherit = ['mail.thread']
|
||||
|
||||
# fields
|
||||
# alphanumeric identification code
|
||||
name = fields.Char('Name', required=True)
|
||||
# description of plan calculation
|
||||
description = fields.Char('Description')
|
||||
# free pass option
|
||||
free_pass = fields.Boolean('Free pass')
|
||||
# control levels of the plan
|
||||
plan_ids = fields.One2many('qc.level', 'plan_id', 'Plan')
|
||||
|
||||
@api.onchange('free_pass')
|
||||
def on_change_free_pass(self):
|
||||
"""
|
||||
Checks if there is only one free pass plan
|
||||
Sets the last changed to false if another one exists
|
||||
"""
|
||||
|
||||
if self.free_pass:
|
||||
free_p = self.env['qc.plan'].search([('free_pass', '=', True)])[0]
|
||||
if free_p:
|
||||
self.free_pass = False
|
||||
raise ValidationError(_("A free pass plan already exists: %s.")
|
||||
% free_p.name)
|
||||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
"""
|
||||
Avoids multiple free pass plans
|
||||
"""
|
||||
if vals['free_pass']:
|
||||
if self.env['qc.plan'].search([('free_pass', '=', True)]):
|
||||
return False
|
||||
return super(QcPlan, self).create(vals)
|
||||
|
||||
|
||||
class QcLevel(models.Model):
|
||||
"""
|
||||
Manages the lelevs for a control plan
|
||||
"""
|
||||
|
||||
# model
|
||||
_name = 'qc.level'
|
||||
_description = 'Quality Control Plan Levels'
|
||||
|
||||
# fields
|
||||
# plan reference
|
||||
plan_id = fields.Many2one('qc.plan', 'Plan', required=True)
|
||||
# minimum ingoing quantity
|
||||
qty_received = fields.Float('Quantity to inspect',
|
||||
help='Minimum received quantity reference'
|
||||
)
|
||||
# quantity value to check
|
||||
qty_checked = fields.Float(
|
||||
'Quantity checked',
|
||||
help='Quantity to check if the received goods is higher than the reference'
|
||||
)
|
||||
# chek value type: absolute or percent of ingoing quantity
|
||||
chk_type = fields.Selection([('absolute', 'Absolute value'),
|
||||
('percent', 'Percent'),
|
||||
],
|
||||
'Measure',
|
||||
default='absolute',
|
||||
help='Indicate how to use quantity checked value'
|
||||
)
|
||||
|
||||
# defines record name to display in form view
|
||||
_rec_name = 'id'
|
||||
51
quality_control_plan/models/qc_trigger.py
Normal file
51
quality_control_plan/models/qc_trigger.py
Normal file
@@ -0,0 +1,51 @@
|
||||
# Copyright 2010 NaN Projectes de Programari Lliure, S.L.
|
||||
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||
# Copyright 2014 Oihane Crucelaegui - AvanzOSC
|
||||
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# Copyright 2017 Simone Rubino - Agile Business Group
|
||||
# Copyright 2019 Marcelo Frare (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
# Copyright 2019 Stefano Consolaro (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class QcTriggerPartnerLine(models.Model):
|
||||
"""
|
||||
Extends quality trigger with partner control plan
|
||||
"""
|
||||
|
||||
_inherit = "qc.trigger.line"
|
||||
|
||||
# model
|
||||
_name = "qc.trigger.partner_line"
|
||||
|
||||
# new fields
|
||||
# reference partner
|
||||
partner = fields.Many2one(comodel_name="res.partner")
|
||||
# control plan to use
|
||||
plan_id = fields.Many2one('qc.plan', 'Plan', required=True)
|
||||
|
||||
|
||||
class QcTriggerProductLine(models.Model):
|
||||
"""
|
||||
Extends product model with a field to store quality control plan assigned
|
||||
"""
|
||||
|
||||
_inherit = ['qc.trigger.product_template_line']
|
||||
|
||||
# new filed
|
||||
# product's control plan
|
||||
plan_id = fields.Many2one('qc.plan', 'Plan')
|
||||
|
||||
|
||||
class QcTriggerCategoryLine(models.Model):
|
||||
"""
|
||||
Extends product category model with a field to store quality control plan assigned
|
||||
"""
|
||||
|
||||
_inherit = ['qc.trigger.product_category_line']
|
||||
|
||||
# new filed
|
||||
# sets product category's control plan
|
||||
plan_id = fields.Many2one('qc.plan', 'Plan')
|
||||
27
quality_control_plan/models/qc_trigger_partner_line.py
Normal file
27
quality_control_plan/models/qc_trigger_partner_line.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# Copyright 2010 NaN Projectes de Programari Lliure, S.L.
|
||||
# Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
|
||||
# Copyright 2014 Oihane Crucelaegui - AvanzOSC
|
||||
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# Copyright 2017 Simone Rubino - Agile Business Group
|
||||
# Copyright 2019 Marcelo Frare (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
# Copyright 2019 Stefano Consolaro (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class QcTriggerPartnerLine(models.Model):
|
||||
"""
|
||||
Extend quality trigger with partner control plan
|
||||
"""
|
||||
|
||||
_inherit = "qc.trigger.line"
|
||||
|
||||
# model
|
||||
_name = "qc.trigger.partner_line"
|
||||
|
||||
# new fields
|
||||
# reference partner
|
||||
partner = fields.Many2one(comodel_name="res.partner")
|
||||
# control plan to use
|
||||
plan_id = fields.Many2one('qc.plan', 'Plan', required=True)
|
||||
51
quality_control_plan/models/stock_picking_inspection.py
Normal file
51
quality_control_plan/models/stock_picking_inspection.py
Normal file
@@ -0,0 +1,51 @@
|
||||
# Copyright 2019 Marcelo Frare (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
# Copyright 2019 Stefano Consolaro (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, api
|
||||
|
||||
|
||||
class StockPicking(models.Model):
|
||||
"""
|
||||
Extend picking method
|
||||
"""
|
||||
|
||||
_inherit = 'stock.picking'
|
||||
|
||||
@api.multi
|
||||
def action_done(self):
|
||||
"""
|
||||
Extend actions on done stock move adding inspection defined on Partner
|
||||
"""
|
||||
|
||||
# does original action and memorize result
|
||||
result = super(StockPicking, self).action_done()
|
||||
|
||||
# gets model of the inspection
|
||||
inspection_model = self.env['qc.inspection']
|
||||
|
||||
# for each line moved
|
||||
for operation in self.move_lines:
|
||||
# gets quality trigger associate to movement type
|
||||
qc_trigger = self.env['qc.trigger'
|
||||
].search([('picking_type_id',
|
||||
'=',
|
||||
self.picking_type_id.id)
|
||||
])
|
||||
|
||||
# gets partner associate to movement
|
||||
partner = (self.partner_id)
|
||||
|
||||
# gets trigger for movement type on partner
|
||||
trigger_line = self.env['qc.trigger.partner_line'
|
||||
].search([('partner', '=', partner.id),
|
||||
('trigger', '=', qc_trigger.id)
|
||||
],
|
||||
limit=1
|
||||
)
|
||||
|
||||
# adds new ispection
|
||||
if trigger_line:
|
||||
inspection_model._make_inspection(operation, trigger_line)
|
||||
|
||||
return result
|
||||
1
quality_control_plan/readme/CONFIGURE.rst
Normal file
1
quality_control_plan/readme/CONFIGURE.rst
Normal file
@@ -0,0 +1 @@
|
||||
This module doesn't need configuration
|
||||
2
quality_control_plan/readme/CONTRIBUTORS.rst
Normal file
2
quality_control_plan/readme/CONTRIBUTORS.rst
Normal file
@@ -0,0 +1,2 @@
|
||||
* Marcelo Frare <mf2965@gmail.com>
|
||||
* Stefano Consolaro <stefano.consolaro@mymage.it>
|
||||
15
quality_control_plan/readme/DESCRIPTION.rst
Normal file
15
quality_control_plan/readme/DESCRIPTION.rst
Normal file
@@ -0,0 +1,15 @@
|
||||
These module manages the Control Plans for Quality Control, to define how many products to check on an inspection.
|
||||
|
||||
It is possible to create a list of Control Plans with names and free pass flag.
|
||||
Only one Plan a time can have the free pass flagged.
|
||||
|
||||
For each Control Plan is possible to assign different levels of control each with
|
||||
a minimum quantity, a value to check and the type of check value: the check
|
||||
type can be an absolute number of pieces or a percentage.
|
||||
|
||||
On Products, Product Category and Partner is possible to set a specific Control Plan.
|
||||
|
||||
When Inspection is generated the Control Plan to use is selected trought Product-Partner,
|
||||
Category-Partner, Product, Category, Partner.
|
||||
|
||||
Creates a reference between Inspections and Nonconformities.
|
||||
4
quality_control_plan/readme/HISTORY.rst
Normal file
4
quality_control_plan/readme/HISTORY.rst
Normal file
@@ -0,0 +1,4 @@
|
||||
11.0.1.0.0 (2020-01-01)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* [INI] Initial development
|
||||
1
quality_control_plan/readme/INSTALL.rst
Normal file
1
quality_control_plan/readme/INSTALL.rst
Normal file
@@ -0,0 +1 @@
|
||||
Istall with standar method
|
||||
34
quality_control_plan/readme/USAGE.rst
Normal file
34
quality_control_plan/readme/USAGE.rst
Normal file
@@ -0,0 +1,34 @@
|
||||
Steps to follow to use Control Plans:
|
||||
|
||||
- create a list of Control Plans
|
||||
- define levels of control for Control Pans
|
||||
|
||||
**Control Plan**
|
||||
* Go to Quality Control
|
||||
* From Test menu select Control Plan
|
||||
* Create a Control Plan with a name, description and eventually with Free Pass flag checked
|
||||
|
||||
**Control Plan Levels**
|
||||
|
||||
- Option A
|
||||
* Go to Quality Control
|
||||
* From Test menu select Control Plan
|
||||
* Select a Control Plan
|
||||
* Add rows with quantity level, value to check, type of value
|
||||
|
||||
- Option B
|
||||
* Go to Quality Control
|
||||
* From Test menu select Control Plan Levels
|
||||
* Create a new element selecting the Control Plan and filling other fields
|
||||
|
||||
**Inspection → Nonconformity**
|
||||
* Go to Qaulity Control
|
||||
* From Inspection menu select Inspection
|
||||
* Open or create an Inspection
|
||||
* On tab Nonconformity add a new line, or click «Add Nonconformity»
|
||||
|
||||
**Nonconformity → Inspection**
|
||||
* Go to Management System
|
||||
* From Management System menu select Nonconformity
|
||||
* Open or create a Nonconformity
|
||||
* On field Inspection select or create the relative Inspection
|
||||
7
quality_control_plan/security/ir.model.access.csv
Normal file
7
quality_control_plan/security/ir.model.access.csv
Normal file
@@ -0,0 +1,7 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_qc_level_manager,access_qc_level_manager,model_qc_level,quality_control.group_quality_control_manager,1,1,1,1
|
||||
access_qc_level_user,access_qc_level_user,model_qc_level,quality_control.group_quality_control_user,1,0,0,0
|
||||
access_qc_plan_manager,access_qc_plan_manager,model_qc_plan,quality_control.group_quality_control_manager,1,1,1,1
|
||||
access_qc_plan_user,access_qc_plan_user,model_qc_plan,quality_control.group_quality_control_user,1,0,0,0
|
||||
access_qc_trigger_partner_line_manager,access_qc_trigger_partner_line_manager,model_qc_trigger_partner_line,quality_control.group_quality_control_manager,1,1,1,1
|
||||
access_qc_trigger_partner_line_user,access_qc_trigger_partner_line_user,model_qc_trigger_partner_line,quality_control.group_quality_control_user,1,0,0,0
|
||||
|
BIN
quality_control_plan/static/description/icon.png
Normal file
BIN
quality_control_plan/static/description/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.5 KiB |
512
quality_control_plan/static/description/index.html
Normal file
512
quality_control_plan/static/description/index.html
Normal file
@@ -0,0 +1,512 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
||||
<title>Quality Control - Control Plan</title>
|
||||
<style type="text/css">
|
||||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
|
||||
:Copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
|
||||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
|
||||
customize this style sheet.
|
||||
*/
|
||||
|
||||
/* used to remove borders from tables and images */
|
||||
.borderless, table.borderless td, table.borderless th {
|
||||
border: 0 }
|
||||
|
||||
table.borderless td, table.borderless th {
|
||||
/* Override padding for "table.docutils td" with "! important".
|
||||
The right padding separates the table cells. */
|
||||
padding: 0 0.5em 0 0 ! important }
|
||||
|
||||
.first {
|
||||
/* Override more specific margin styles with "! important". */
|
||||
margin-top: 0 ! important }
|
||||
|
||||
.last, .with-subtitle {
|
||||
margin-bottom: 0 ! important }
|
||||
|
||||
.hidden {
|
||||
display: none }
|
||||
|
||||
.subscript {
|
||||
vertical-align: sub;
|
||||
font-size: smaller }
|
||||
|
||||
.superscript {
|
||||
vertical-align: super;
|
||||
font-size: smaller }
|
||||
|
||||
a.toc-backref {
|
||||
text-decoration: none ;
|
||||
color: black }
|
||||
|
||||
blockquote.epigraph {
|
||||
margin: 2em 5em ; }
|
||||
|
||||
dl.docutils dd {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
||||
dl.docutils dt {
|
||||
font-weight: bold }
|
||||
*/
|
||||
|
||||
div.abstract {
|
||||
margin: 2em 5em }
|
||||
|
||||
div.abstract p.topic-title {
|
||||
font-weight: bold ;
|
||||
text-align: center }
|
||||
|
||||
div.admonition, div.attention, div.caution, div.danger, div.error,
|
||||
div.hint, div.important, div.note, div.tip, div.warning {
|
||||
margin: 2em ;
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.admonition p.admonition-title, div.hint p.admonition-title,
|
||||
div.important p.admonition-title, div.note p.admonition-title,
|
||||
div.tip p.admonition-title {
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
div.attention p.admonition-title, div.caution p.admonition-title,
|
||||
div.danger p.admonition-title, div.error p.admonition-title,
|
||||
div.warning p.admonition-title, .code .error {
|
||||
color: red ;
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
/* Uncomment (and remove this text!) to get reduced vertical space in
|
||||
compound paragraphs.
|
||||
div.compound .compound-first, div.compound .compound-middle {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
div.compound .compound-last, div.compound .compound-middle {
|
||||
margin-top: 0.5em }
|
||||
*/
|
||||
|
||||
div.dedication {
|
||||
margin: 2em 5em ;
|
||||
text-align: center ;
|
||||
font-style: italic }
|
||||
|
||||
div.dedication p.topic-title {
|
||||
font-weight: bold ;
|
||||
font-style: normal }
|
||||
|
||||
div.figure {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
div.footer, div.header {
|
||||
clear: both;
|
||||
font-size: smaller }
|
||||
|
||||
div.line-block {
|
||||
display: block ;
|
||||
margin-top: 1em ;
|
||||
margin-bottom: 1em }
|
||||
|
||||
div.line-block div.line-block {
|
||||
margin-top: 0 ;
|
||||
margin-bottom: 0 ;
|
||||
margin-left: 1.5em }
|
||||
|
||||
div.sidebar {
|
||||
margin: 0 0 0.5em 1em ;
|
||||
border: medium outset ;
|
||||
padding: 1em ;
|
||||
background-color: #ffffee ;
|
||||
width: 40% ;
|
||||
float: right ;
|
||||
clear: right }
|
||||
|
||||
div.sidebar p.rubric {
|
||||
font-family: sans-serif ;
|
||||
font-size: medium }
|
||||
|
||||
div.system-messages {
|
||||
margin: 5em }
|
||||
|
||||
div.system-messages h1 {
|
||||
color: red }
|
||||
|
||||
div.system-message {
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.system-message p.system-message-title {
|
||||
color: red ;
|
||||
font-weight: bold }
|
||||
|
||||
div.topic {
|
||||
margin: 2em }
|
||||
|
||||
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
||||
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
||||
margin-top: 0.4em }
|
||||
|
||||
h1.title {
|
||||
text-align: center }
|
||||
|
||||
h2.subtitle {
|
||||
text-align: center }
|
||||
|
||||
hr.docutils {
|
||||
width: 75% }
|
||||
|
||||
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
||||
clear: left ;
|
||||
float: left ;
|
||||
margin-right: 1em }
|
||||
|
||||
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
||||
clear: right ;
|
||||
float: right ;
|
||||
margin-left: 1em }
|
||||
|
||||
img.align-center, .figure.align-center, object.align-center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table.align-center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.align-left {
|
||||
text-align: left }
|
||||
|
||||
.align-center {
|
||||
clear: both ;
|
||||
text-align: center }
|
||||
|
||||
.align-right {
|
||||
text-align: right }
|
||||
|
||||
/* reset inner alignment in figures */
|
||||
div.align-right {
|
||||
text-align: inherit }
|
||||
|
||||
/* div.align-center * { */
|
||||
/* text-align: left } */
|
||||
|
||||
.align-top {
|
||||
vertical-align: top }
|
||||
|
||||
.align-middle {
|
||||
vertical-align: middle }
|
||||
|
||||
.align-bottom {
|
||||
vertical-align: bottom }
|
||||
|
||||
ol.simple, ul.simple {
|
||||
margin-bottom: 1em }
|
||||
|
||||
ol.arabic {
|
||||
list-style: decimal }
|
||||
|
||||
ol.loweralpha {
|
||||
list-style: lower-alpha }
|
||||
|
||||
ol.upperalpha {
|
||||
list-style: upper-alpha }
|
||||
|
||||
ol.lowerroman {
|
||||
list-style: lower-roman }
|
||||
|
||||
ol.upperroman {
|
||||
list-style: upper-roman }
|
||||
|
||||
p.attribution {
|
||||
text-align: right ;
|
||||
margin-left: 50% }
|
||||
|
||||
p.caption {
|
||||
font-style: italic }
|
||||
|
||||
p.credits {
|
||||
font-style: italic ;
|
||||
font-size: smaller }
|
||||
|
||||
p.label {
|
||||
white-space: nowrap }
|
||||
|
||||
p.rubric {
|
||||
font-weight: bold ;
|
||||
font-size: larger ;
|
||||
color: maroon ;
|
||||
text-align: center }
|
||||
|
||||
p.sidebar-title {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold ;
|
||||
font-size: larger }
|
||||
|
||||
p.sidebar-subtitle {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
p.topic-title {
|
||||
font-weight: bold }
|
||||
|
||||
pre.address {
|
||||
margin-bottom: 0 ;
|
||||
margin-top: 0 ;
|
||||
font: inherit }
|
||||
|
||||
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
pre.code .ln { color: grey; } /* line numbers */
|
||||
pre.code, code { background-color: #eeeeee }
|
||||
pre.code .comment, code .comment { color: #5C6576 }
|
||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
||||
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
||||
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
||||
pre.code .inserted, code .inserted { background-color: #A3D289}
|
||||
|
||||
span.classifier {
|
||||
font-family: sans-serif ;
|
||||
font-style: oblique }
|
||||
|
||||
span.classifier-delimiter {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
span.interpreted {
|
||||
font-family: sans-serif }
|
||||
|
||||
span.option {
|
||||
white-space: nowrap }
|
||||
|
||||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic {
|
||||
color: red }
|
||||
|
||||
span.section-subtitle {
|
||||
/* font-size relative to parent (h1..h6 element) */
|
||||
font-size: 80% }
|
||||
|
||||
table.citation {
|
||||
border-left: solid 1px gray;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docinfo {
|
||||
margin: 2em 4em }
|
||||
|
||||
table.docutils {
|
||||
margin-top: 0.5em ;
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
table.footnote {
|
||||
border-left: solid 1px black;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docutils td, table.docutils th,
|
||||
table.docinfo td, table.docinfo th {
|
||||
padding-left: 0.5em ;
|
||||
padding-right: 0.5em ;
|
||||
vertical-align: top }
|
||||
|
||||
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
||||
font-weight: bold ;
|
||||
text-align: left ;
|
||||
white-space: nowrap ;
|
||||
padding-left: 0 }
|
||||
|
||||
/* "booktabs" style (no vertical lines) */
|
||||
table.docutils.booktabs {
|
||||
border: 0px;
|
||||
border-top: 2px solid;
|
||||
border-bottom: 2px solid;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.docutils.booktabs * {
|
||||
border: 0px;
|
||||
}
|
||||
table.docutils.booktabs th {
|
||||
border-bottom: thin solid;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
||||
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
||||
font-size: 100% }
|
||||
|
||||
ul.auto-toc {
|
||||
list-style-type: none }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="quality-control-control-plan">
|
||||
<h1 class="title">Quality Control - Control Plan</h1>
|
||||
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/manufacture/tree/11.0/quality_control_plan"><img alt="OCA/manufacture" src="https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/manufacture-11-0/manufacture-11-0-quality_control_plan"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/129/11.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p>These module manages the Control Plans for Quality Control, to define how many products to check on an inspection.</p>
|
||||
<p>It is possible to create a list of Control Plans with names and free pass flag.
|
||||
Only one Plan a time can have the free pass flagged.</p>
|
||||
<p>For each Control Plan is possible to assign different levels of control each with
|
||||
a minimum quantity, a value to check and the type of check value: the check
|
||||
type can be an absolute number of pieces or a percentage.</p>
|
||||
<p>On Products, Product Category and Partner is possible to set a specific Control Plan.</p>
|
||||
<p>When Inspection is generated the Control Plan to use is selected trought Product-Partner,
|
||||
Category-Partner, Product, Category, Partner.</p>
|
||||
<p>Creates a reference between Inspections and Nonconformities.</p>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#installation" id="id2">Installation</a></li>
|
||||
<li><a class="reference internal" href="#configuration" id="id3">Configuration</a></li>
|
||||
<li><a class="reference internal" href="#usage" id="id4">Usage</a></li>
|
||||
<li><a class="reference internal" href="#changelog" id="id5">Changelog</a><ul>
|
||||
<li><a class="reference internal" href="#id1" id="id6">11.0.1.0.0 (2020-01-01)</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="reference internal" href="#bug-tracker" id="id7">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="id8">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="id9">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="id10">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="id11">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="installation">
|
||||
<h1><a class="toc-backref" href="#id2">Installation</a></h1>
|
||||
<p>Istall with standar method</p>
|
||||
</div>
|
||||
<div class="section" id="configuration">
|
||||
<h1><a class="toc-backref" href="#id3">Configuration</a></h1>
|
||||
<p>This module doesn’t need configuration</p>
|
||||
</div>
|
||||
<div class="section" id="usage">
|
||||
<h1><a class="toc-backref" href="#id4">Usage</a></h1>
|
||||
<p>Steps to follow to use Control Plans:</p>
|
||||
<ul class="simple">
|
||||
<li>create a list of Control Plans</li>
|
||||
<li>define levels of control for Control Pans</li>
|
||||
</ul>
|
||||
<dl class="docutils">
|
||||
<dt><strong>Control Plan</strong></dt>
|
||||
<dd><ul class="first last simple">
|
||||
<li>Go to Quality Control</li>
|
||||
<li>From Test menu select Control Plan</li>
|
||||
<li>Create a Control Plan with a name, description and eventually with Free Pass flag checked</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
<p><strong>Control Plan Levels</strong></p>
|
||||
<ul class="simple">
|
||||
<li><dl class="first docutils">
|
||||
<dt>Option A</dt>
|
||||
<dd><ul class="first last">
|
||||
<li>Go to Quality Control</li>
|
||||
<li>From Test menu select Control Plan</li>
|
||||
<li>Select a Control Plan</li>
|
||||
<li>Add rows with quantity level, value to check, type of value</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li><dl class="first docutils">
|
||||
<dt>Option B</dt>
|
||||
<dd><ul class="first last">
|
||||
<li>Go to Quality Control</li>
|
||||
<li>From Test menu select Control Plan Levels</li>
|
||||
<li>Create a new element selecting the Control Plan and filling other fields</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
</ul>
|
||||
<dl class="docutils">
|
||||
<dt><strong>Inspection → Nonconformity</strong></dt>
|
||||
<dd><ul class="first last simple">
|
||||
<li>Go to Qaulity Control</li>
|
||||
<li>From Inspection menu select Inspection</li>
|
||||
<li>Open or create an Inspection</li>
|
||||
<li>On tab Nonconformity add a new line, or click «Add Nonconformity»</li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dt><strong>Nonconformity → Inspection</strong></dt>
|
||||
<dd><ul class="first last simple">
|
||||
<li>Go to Management System</li>
|
||||
<li>From Management System menu select Nonconformity</li>
|
||||
<li>Open or create a Nonconformity</li>
|
||||
<li>On field Inspection select or create the relative Inspection</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="section" id="changelog">
|
||||
<h1><a class="toc-backref" href="#id5">Changelog</a></h1>
|
||||
<div class="section" id="id1">
|
||||
<h2><a class="toc-backref" href="#id6">11.0.1.0.0 (2020-01-01)</a></h2>
|
||||
<ul class="simple">
|
||||
<li>[INI] Initial development</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#id7">Bug Tracker</a></h1>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/manufacture/issues">GitHub Issues</a>.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/OCA/manufacture/issues/new?body=module:%20quality_control_plan%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
<h1><a class="toc-backref" href="#id8">Credits</a></h1>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#id9">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Associazione PNLUG - Gruppo Odoo</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#id10">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Marcelo Frare <<a class="reference external" href="mailto:mf2965@gmail.com">mf2965@gmail.com</a>></li>
|
||||
<li>Stefano Consolaro <<a class="reference external" href="mailto:stefano.consolaro@mymage.it">stefano.consolaro@mymage.it</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#id11">Maintainers</a></h2>
|
||||
<p>This module is maintained by the OCA.</p>
|
||||
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
|
||||
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||
mission is to support the collaborative development of Odoo features and
|
||||
promote its widespread use.</p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/manufacture/tree/11.0/quality_control_plan">OCA/manufacture</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
1
quality_control_plan/tests/__init__.py
Normal file
1
quality_control_plan/tests/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import test_plan
|
||||
201
quality_control_plan/tests/test_plan.py
Normal file
201
quality_control_plan/tests/test_plan.py
Normal file
@@ -0,0 +1,201 @@
|
||||
from odoo.tests.common import TransactionCase
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
|
||||
class TestQualityControl(TransactionCase):
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
Sets some enviroment
|
||||
"""
|
||||
super(TestQualityControl, self).setUp()
|
||||
|
||||
self.plan_model = self.env['qc.plan']
|
||||
self.level_model = self.env['qc.level']
|
||||
self.inspection_model = self.env['qc.inspection']
|
||||
self.category_model = self.env['product.category']
|
||||
self.Trigger_product_model = self.env['qc.trigger.product_template_line']
|
||||
self.Trigger_category_model = self.env['qc.trigger.product_category_line']
|
||||
self.Trigger_partner_model = self.env['qc.trigger.partner_line']
|
||||
self.Partner_model = self.env['res.partner']
|
||||
|
||||
self.qc_trigger = self.env['qc.trigger'].create({
|
||||
'name': 'Test Trigger',
|
||||
'active': True,
|
||||
})
|
||||
self.test = self.env.ref('quality_control.qc_test_1')
|
||||
self.product = self.env.ref('product.product_product_10')
|
||||
self.product1 = self.env.ref('product.product_product_11')
|
||||
self.product2 = self.env.ref('product.product_product_12')
|
||||
self.product3 = self.env.ref('product.product_product_13')
|
||||
self.category = self.category_model.create({'name': 'Plan test Category'})
|
||||
self.product1.categ_id = self.category.id
|
||||
|
||||
def test_plan(self):
|
||||
"""
|
||||
Test Plan
|
||||
"""
|
||||
# creating plan
|
||||
plan1 = self.plan_model.create({'name': 'Test', 'free_pass': False})
|
||||
self.assertEqual(plan1.id > 0, True)
|
||||
self.assertEqual(plan1.name == 'Test', True)
|
||||
self.assertEqual(plan1.free_pass is False, True)
|
||||
# assigning a level to the plan
|
||||
level = self.level_model.create({'plan_id': plan1.id,
|
||||
'qty_received': 10,
|
||||
'qty_checked': 3,
|
||||
'chk_type': 'percent'})
|
||||
self.assertEqual(level.plan_id.id == plan1.id, True)
|
||||
|
||||
# adding second free pass plan
|
||||
plan2 = self.plan_model.create({'name': 'Test2', 'free_pass': True})
|
||||
if plan2:
|
||||
plan3 = self.plan_model.create({'name': 'Test3', 'free_pass': True})
|
||||
self.assertEqual(plan3, False)
|
||||
|
||||
# setting another plan as free pass
|
||||
plan3 = self.plan_model.create({'name': 'Test3', 'free_pass': False})
|
||||
plan3.free_pass = True
|
||||
with self.assertRaises(ValidationError) as ve:
|
||||
plan3.on_change_free_pass()
|
||||
self.assertIn('A free pass plan already exists', str(ve.exception))
|
||||
|
||||
# create a the plan
|
||||
plan2.free_pass = False
|
||||
self.level_model.create({'plan_id': plan2.id,
|
||||
'qty_received': 10,
|
||||
'qty_checked': 7,
|
||||
'chk_type': 'absolute'})
|
||||
|
||||
partner = self.Partner_model.create({'name': 'Plan test Partner'})
|
||||
|
||||
# creating quality triggers
|
||||
trigger_product = self.Trigger_product_model.create({
|
||||
'product_template': self.product.product_tmpl_id.id,
|
||||
'trigger': self.qc_trigger.id,
|
||||
'test': self.test.id,
|
||||
'plan_id': plan1.id})
|
||||
|
||||
trigger_product_partner = self.Trigger_product_model.create({
|
||||
'product_template': self.product.product_tmpl_id.id,
|
||||
'trigger': self.qc_trigger.id,
|
||||
'test': self.test.id,
|
||||
'plan_id': plan2.id})
|
||||
trigger_product_partner.partners = partner
|
||||
|
||||
trigger_category = self.Trigger_category_model.create({
|
||||
'product_category': self.category.id,
|
||||
'trigger': self.qc_trigger.id,
|
||||
'test': self.test.id,
|
||||
'plan_id': plan1.id})
|
||||
|
||||
trigger_category_partner = self.Trigger_category_model.create({
|
||||
'product_category': self.category.id,
|
||||
'trigger': self.qc_trigger.id,
|
||||
'test': self.test.id,
|
||||
'plan_id': plan1.id})
|
||||
trigger_category_partner.partners = partner
|
||||
|
||||
trigger_partner = self.Trigger_partner_model.create({
|
||||
'trigger': self.qc_trigger.id,
|
||||
'test': self.test.id,
|
||||
'plan_id': plan1.id})
|
||||
trigger_partner.partner = partner
|
||||
|
||||
self.assertEqual(trigger_product.id > 0, True)
|
||||
self.assertEqual(trigger_product_partner.id > 0, True)
|
||||
self.assertEqual(trigger_category.id > 0, True)
|
||||
self.assertEqual(trigger_category_partner.id > 0, True)
|
||||
self.assertEqual(trigger_partner.id > 0, True)
|
||||
|
||||
# creates inspection for product
|
||||
# get a move and a picking
|
||||
get_move = self.env['stock.move'].search([])[0]
|
||||
get_picking = self.env['stock.picking'].search([])[0]
|
||||
# tests picking inherit
|
||||
picking_ck = get_picking.action_done()
|
||||
self.assertEqual(picking_ck, True)
|
||||
|
||||
# creates inspection for free pass
|
||||
# adapt move's attributes with used data
|
||||
get_move.product_id = self.product.id
|
||||
obj_id = 'stock.move,' + str(get_move.id)
|
||||
plan1.free_pass = True
|
||||
self.inspection2 = self.inspection_model.create({
|
||||
'object_id': obj_id,
|
||||
'state': 'ready',
|
||||
'test': 1,
|
||||
'user': 1,
|
||||
'auto_generated': True,
|
||||
'qty': 300.0
|
||||
})
|
||||
self.assertEqual(self.inspection2.qty_checked == 0, True)
|
||||
|
||||
# creates inspection for product
|
||||
plan1.free_pass = False
|
||||
self.inspection2 = self.inspection_model.create({
|
||||
'object_id': obj_id,
|
||||
'state': 'ready',
|
||||
'test': 1,
|
||||
'user': 1,
|
||||
'auto_generated': True,
|
||||
'qty': 300.0
|
||||
})
|
||||
self.assertEqual(self.inspection2.qty_checked == 9, True)
|
||||
|
||||
# creates inspection for product partner
|
||||
get_move.picking_id = get_picking.id
|
||||
get_picking.partner_id = partner
|
||||
self.inspection2 = self.inspection_model.create({
|
||||
'object_id': obj_id,
|
||||
'state': 'ready',
|
||||
'test': 1,
|
||||
'user': 1,
|
||||
'auto_generated': True,
|
||||
'qty': 300.0
|
||||
})
|
||||
self.assertEqual(self.inspection2.qty_checked == 7, True)
|
||||
|
||||
# creates inspection for category
|
||||
get_move.product_id = self.product1.id
|
||||
get_move.picking_id = False
|
||||
self.product.category = self.category.id
|
||||
self.inspection2 = self.inspection_model.create({
|
||||
'object_id': obj_id,
|
||||
'state': 'ready',
|
||||
'test': 1,
|
||||
'user': 1,
|
||||
'auto_generated': True,
|
||||
'qty': 150.0
|
||||
})
|
||||
self.assertEqual(self.inspection2.qty_checked == 4, True)
|
||||
|
||||
# creates inspection for partner
|
||||
# get a move from db
|
||||
get_move.product_id = self.product2.id
|
||||
get_move.picking_id = get_picking.id
|
||||
get_picking.partner_id = partner
|
||||
self.inspection2 = self.inspection_model.create({
|
||||
'object_id': obj_id,
|
||||
'state': 'ready',
|
||||
'test': 1,
|
||||
'user': 1,
|
||||
'auto_generated': True,
|
||||
'qty': 400.0
|
||||
})
|
||||
self.assertEqual(self.inspection2.qty_checked == 12, True)
|
||||
|
||||
# create inspection without plan
|
||||
partner2 = self.Partner_model.create({'name': 'Plan test Partner2'})
|
||||
get_move.product_id = self.product3.id
|
||||
get_move.picking_id = get_picking.id
|
||||
get_picking.partner_id = partner2
|
||||
self.inspection2 = self.inspection_model.create({
|
||||
'object_id': obj_id,
|
||||
'state': 'ready',
|
||||
'test': 1,
|
||||
'user': 1,
|
||||
'auto_generated': True,
|
||||
'qty': 400.0
|
||||
})
|
||||
self.assertEqual(self.inspection2.qty_checked == 1, True)
|
||||
20
quality_control_plan/views/mgmtsystem_nonconformity_view.xml
Normal file
20
quality_control_plan/views/mgmtsystem_nonconformity_view.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- Copyright 2019 Marcelo Frare (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
Copyright 2019 Stefano Consolaro (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) -->
|
||||
|
||||
<odoo>
|
||||
<!-- extends nonconformity form view adding new field inspection reference -->
|
||||
<record id="view_mgmtsystem_nonconformity_inspection" model="ir.ui.view">
|
||||
<field name="name">view.mgmtsystem.nonconformity.inspection</field>
|
||||
<field name="model">mgmtsystem.nonconformity</field>
|
||||
<field name="inherit_id"
|
||||
ref="mgmtsystem_nonconformity.view_mgmtsystem_nonconformity_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="system_id" position="after">
|
||||
<field name="inspection_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
30
quality_control_plan/views/partner_view.xml
Normal file
30
quality_control_plan/views/partner_view.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- Copyright 2019 Marcelo Frare (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
Copyright 2019 Stefano Consolaro (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) -->
|
||||
|
||||
<odoo>
|
||||
<!-- inherits partner form view adding new quality tab -->
|
||||
<record id="view_mgmtsystem_nonconformity_partner" model="ir.ui.view">
|
||||
<field name="name">view.mgmtsystem.nonconformity.partner</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<notebook position="inside">
|
||||
<page string="Quality">
|
||||
<group name="qc" string="Quality control">
|
||||
<field name="qc_triggers" nolabel="1">
|
||||
<tree string="Quality control triggers" editable="bottom">
|
||||
<field name="trigger" widget="selection"/>
|
||||
<field name="test"/>
|
||||
<field name="plan_id"/>
|
||||
<field name="user" />
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
34
quality_control_plan/views/product_view.xml
Normal file
34
quality_control_plan/views/product_view.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- Copyright 2019 Marcelo Frare (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
Copyright 2019 Stefano Consolaro (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) -->
|
||||
|
||||
<odoo>
|
||||
<!-- inherits product form view with control plan -->
|
||||
<record id="view_product_template_plan" model="ir.ui.view">
|
||||
<field name="name">view.product.template.plan</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_only_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='qc_triggers']/tree/field[@name='partners']"
|
||||
position="after">
|
||||
<field name="plan_id"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- inherits product category from view with control plan -->
|
||||
<record id="view_product_category_plan" model="ir.ui.view">
|
||||
<field name="name">view.product.category.plan</field>
|
||||
<field name="model">product.category</field>
|
||||
<field name="inherit_id" ref="quality_control.product_category_qc_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='qc_triggers']/tree/field[@name='partners']"
|
||||
position="after">
|
||||
<field name="plan_id"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
35
quality_control_plan/views/qc_inspection_view.xml
Normal file
35
quality_control_plan/views/qc_inspection_view.xml
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- Copyright 2019 Marcelo Frare (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
Copyright 2019 Stefano Consolaro (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) -->
|
||||
|
||||
<odoo>
|
||||
|
||||
<!-- inherits inspection form view adding new fields plan_id, qty_checked
|
||||
and disable total qty modification -->
|
||||
<record model="ir.ui.view" id="qc_inspection_qty_checked">
|
||||
<field name="name">qc.inspection.qty.checked</field>
|
||||
<field name="model">qc.inspection</field>
|
||||
<field name="inherit_id" ref="quality_control.qc_inspection_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="qty" position="attributes">
|
||||
<attribute name="readonly">1</attribute>
|
||||
<attribute name="string">Total quantity</attribute>
|
||||
</field>
|
||||
<field name="qty" position="after">
|
||||
<field name="plan_id" readonly="1"/>
|
||||
<field name="qty_checked" readonly="1"/>
|
||||
</field>
|
||||
<field name="success" position="after">
|
||||
<button name="create_nonconformity" string="Add Nonconformity"
|
||||
type="object" class="btn-danger"/>
|
||||
</field>
|
||||
<notebook position="inside">
|
||||
<page string="Nonconformity">
|
||||
<field name="inspection_ids"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
40
quality_control_plan/views/qc_menu.xml
Normal file
40
quality_control_plan/views/qc_menu.xml
Normal file
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- Copyright 2019 Marcelo Frare (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
Copyright 2019 Stefano Consolaro (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) -->
|
||||
|
||||
<odoo>
|
||||
<!-- adds menu voice for control plan to test menu -->
|
||||
|
||||
<!-- manage Control Plan list -->
|
||||
<!-- action -->
|
||||
<act_window id = "qc_plan_action"
|
||||
name = "Control Plans"
|
||||
res_model = "qc.plan"
|
||||
view_mode = "tree,form"
|
||||
/>
|
||||
<!-- menu voice -->
|
||||
<menuitem name = "Control Plans"
|
||||
id = "menu_qc_plan"
|
||||
parent = "quality_control.qc_menu_test_parent"
|
||||
sequence = "110"
|
||||
action = "qc_plan_action"
|
||||
/>
|
||||
|
||||
<!-- manage Plan Levels -->
|
||||
<!-- action -->
|
||||
<act_window id = "qc_level_action"
|
||||
name = "Control Plan Levels"
|
||||
res_model = "qc.level"
|
||||
view_mode = "tree,form"
|
||||
/>
|
||||
<!-- menu voice -->
|
||||
<menuitem name = "Control Plan Levels"
|
||||
id = "menu_qc_level"
|
||||
parent = "quality_control.qc_menu_test_parent"
|
||||
sequence = "120"
|
||||
action = "qc_level_action"
|
||||
/>
|
||||
|
||||
</odoo>
|
||||
97
quality_control_plan/views/qc_plan_view.xml
Normal file
97
quality_control_plan/views/qc_plan_view.xml
Normal file
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- Copyright 2019 Marcelo Frare (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
Copyright 2019 Stefano Consolaro (Ass. PNLUG - Gruppo Odoo <http://odoo.pnlug.it>)
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) -->
|
||||
|
||||
<odoo>
|
||||
<!-- Defines views for plan and levels -->
|
||||
|
||||
<!-- ############# PLAN #################### -->
|
||||
<!-- Plan Form view -->
|
||||
<record id="view_form_plan" model="ir.ui.view">
|
||||
<field name="name">QC plan</field>
|
||||
<field name="model">qc.plan</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Plan">
|
||||
<sheet>
|
||||
<label for="name" class="oe_edit_only"/>
|
||||
<h1>
|
||||
<field name="name"/>
|
||||
</h1>
|
||||
<group>
|
||||
<group>
|
||||
<field name="description" style="width:40em !important"/>
|
||||
<field name="free_pass"/>
|
||||
</group>
|
||||
<group>
|
||||
|
||||
</group>
|
||||
</group>
|
||||
<label string="Control Plan Levels" style="display: block;"/>
|
||||
<field name="plan_ids" nolabel="1" style="width: 70%">
|
||||
<tree string="Level lines" editable="top" delete="true"
|
||||
create="true">
|
||||
<field name="qty_received" />
|
||||
<field name="qty_checked" />
|
||||
<field name="chk_type" />
|
||||
</tree>
|
||||
</field>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers" />
|
||||
<field name="message_ids" widget="mail_thread" />
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Plan Tree view -->
|
||||
<record id="view_tree_plan" model="ir.ui.view">
|
||||
<field name="name">view.tree.plan</field>
|
||||
<field name="model">qc.plan</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="QC Plan">
|
||||
<field name="name"/>
|
||||
<field name="description"/>
|
||||
<field name="free_pass"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- ############# LEVEL ############################### -->
|
||||
<!-- Level Form view -->
|
||||
<record id="view_form_level" model="ir.ui.view">
|
||||
<field name="name">QC level</field>
|
||||
<field name="model">qc.level</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="QC level">
|
||||
<sheet>
|
||||
<group>
|
||||
<field name="plan_id" style="width: 25%"/>
|
||||
<field name="qty_received"
|
||||
style="text-align: right; width: 6em"/>
|
||||
<field name="qty_checked"
|
||||
style="text-align: right; width: 6em"/>
|
||||
<field name="chk_type" style="width: 25%"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Level Tree view -->
|
||||
<record id="view_tree_level" model="ir.ui.view">
|
||||
<field name="name">view.tree.level</field>
|
||||
<field name="model">qc.level</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="QC level">
|
||||
<field name="plan_id"/>
|
||||
<field name="qty_received"/>
|
||||
<field name="qty_checked"/>
|
||||
<field name="chk_type"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user