diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..35410cac --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 00000000..b245076c --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +__manifest__.py \ No newline at end of file diff --git a/.idea/jikimo_sf.iml b/.idea/jikimo_sf.iml new file mode 100644 index 00000000..735af015 --- /dev/null +++ b/.idea/jikimo_sf.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..74e50a18 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/mrp_workorder_expiry/__init__.py b/mrp_workorder_expiry/__init__.py deleted file mode 100644 index dc5e6b69..00000000 --- a/mrp_workorder_expiry/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from . import models diff --git a/mrp_workorder_expiry/__manifest__.py b/mrp_workorder_expiry/__manifest__.py deleted file mode 100644 index a65b3ac7..00000000 --- a/mrp_workorder_expiry/__manifest__.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -{ - 'name': 'MRP II - Expiry', - 'version': '1.0', - 'category': 'Manufacturing/Manufacturing', - 'summary': 'MRP Workorder Expiry', - 'description': """ -Technical module. - """, - 'depends': ['mrp_workorder', 'product_expiry'], - 'data': [ - 'views/quality_views.xml', - 'wizard/confirm_expiry_view.xml', - ], - 'installable': True, - 'auto_install': True, - 'assets': { - 'web.assets_backend': [ - 'mrp_workorder_expiry/static/**/*', - ], - }, - 'license': 'OEEL-1', -} diff --git a/mrp_workorder_expiry/i18n/ar.po b/mrp_workorder_expiry/i18n/ar.po deleted file mode 100644 index 95241c36..00000000 --- a/mrp_workorder_expiry/i18n/ar.po +++ /dev/null @@ -1,41 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_expiry -# -# Translators: -# Martin Trigaux, 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: Martin Trigaux, 2022\n" -"Language-Team: Arabic (https://www.transifex.com/odoo/teams/41243/ar/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: ar\n" -"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" - -#. module: mrp_workorder_expiry -#: model_terms:ir.ui.view,arch_db:mrp_workorder_expiry.quality_check_view_form_tablet_inherit_expiry -msgid " This lot is expired." -msgstr "" -" لقد انتهت صلاحية هذه الدفعة. " - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,field_description:mrp_workorder_expiry.field_quality_check__is_expired -msgid "Product Expiry Alert" -msgstr "تنبيه انتهاء صلاحية المنتج" - -#. module: mrp_workorder_expiry -#: model:ir.model,name:mrp_workorder_expiry.model_quality_check -msgid "Quality Check" -msgstr "فحص الجودة" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,help:mrp_workorder_expiry.field_quality_check__is_expired -msgid "The Expiration Date has been reached." -msgstr "تم الوصول إلى تاريخ انتهاء الصلاحية. " diff --git a/mrp_workorder_expiry/i18n/az.po b/mrp_workorder_expiry/i18n/az.po deleted file mode 100644 index c7face15..00000000 --- a/mrp_workorder_expiry/i18n/az.po +++ /dev/null @@ -1,36 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_expiry -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Language-Team: Azerbaijani (https://www.transifex.com/odoo/teams/41243/az/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: az\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. module: mrp_workorder_expiry -#: model_terms:ir.ui.view,arch_db:mrp_workorder_expiry.quality_check_view_form_tablet_inherit_expiry -msgid " This lot is expired." -msgstr "" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,field_description:mrp_workorder_expiry.field_quality_check__is_expired -msgid "Product Expiry Alert" -msgstr "" - -#. module: mrp_workorder_expiry -#: model:ir.model,name:mrp_workorder_expiry.model_quality_check -msgid "Quality Check" -msgstr "" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,help:mrp_workorder_expiry.field_quality_check__is_expired -msgid "The Expiration Date has been reached." -msgstr "" diff --git a/mrp_workorder_expiry/i18n/ca.po b/mrp_workorder_expiry/i18n/ca.po deleted file mode 100644 index 117f19fa..00000000 --- a/mrp_workorder_expiry/i18n/ca.po +++ /dev/null @@ -1,41 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_expiry -# -# Translators: -# Arnau Ros, 2022 -# marcescu, 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: marcescu, 2022\n" -"Language-Team: Catalan (https://www.transifex.com/odoo/teams/41243/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. module: mrp_workorder_expiry -#: model_terms:ir.ui.view,arch_db:mrp_workorder_expiry.quality_check_view_form_tablet_inherit_expiry -msgid " This lot is expired." -msgstr "Aquest lot ha caducat. " - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,field_description:mrp_workorder_expiry.field_quality_check__is_expired -msgid "Product Expiry Alert" -msgstr "Alerta de caducitat del producte" - -#. module: mrp_workorder_expiry -#: model:ir.model,name:mrp_workorder_expiry.model_quality_check -msgid "Quality Check" -msgstr "Comprovació de qualitat" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,help:mrp_workorder_expiry.field_quality_check__is_expired -msgid "The Expiration Date has been reached." -msgstr "S'ha assolit la data de caducitat." diff --git a/mrp_workorder_expiry/i18n/cs.po b/mrp_workorder_expiry/i18n/cs.po deleted file mode 100644 index a77ccdf1..00000000 --- a/mrp_workorder_expiry/i18n/cs.po +++ /dev/null @@ -1,42 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_expiry -# -# Translators: -# trendspotter , 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: trendspotter , 2022\n" -"Language-Team: Czech (https://www.transifex.com/odoo/teams/41243/cs/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: cs\n" -"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n" - -#. module: mrp_workorder_expiry -#: model_terms:ir.ui.view,arch_db:mrp_workorder_expiry.quality_check_view_form_tablet_inherit_expiry -msgid " This lot is expired." -msgstr "" -" Tomuto produktovému číslu " -"vypršela platnost" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,field_description:mrp_workorder_expiry.field_quality_check__is_expired -msgid "Product Expiry Alert" -msgstr "" - -#. module: mrp_workorder_expiry -#: model:ir.model,name:mrp_workorder_expiry.model_quality_check -msgid "Quality Check" -msgstr "Kontrola kvality" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,help:mrp_workorder_expiry.field_quality_check__is_expired -msgid "The Expiration Date has been reached." -msgstr "" diff --git a/mrp_workorder_expiry/i18n/de.po b/mrp_workorder_expiry/i18n/de.po deleted file mode 100644 index 9e847b42..00000000 --- a/mrp_workorder_expiry/i18n/de.po +++ /dev/null @@ -1,40 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_expiry -# -# Translators: -# Martin Trigaux, 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: Martin Trigaux, 2022\n" -"Language-Team: German (https://www.transifex.com/odoo/teams/41243/de/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: de\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. module: mrp_workorder_expiry -#: model_terms:ir.ui.view,arch_db:mrp_workorder_expiry.quality_check_view_form_tablet_inherit_expiry -msgid " This lot is expired." -msgstr " Diese Charge ist abgelaufen." - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,field_description:mrp_workorder_expiry.field_quality_check__is_expired -msgid "Product Expiry Alert" -msgstr "Produkt Ablaufmeldung" - -#. module: mrp_workorder_expiry -#: model:ir.model,name:mrp_workorder_expiry.model_quality_check -msgid "Quality Check" -msgstr "Qualitätskontrolle" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,help:mrp_workorder_expiry.field_quality_check__is_expired -msgid "The Expiration Date has been reached." -msgstr "Das Ablaufdatum wurde erreicht." diff --git a/mrp_workorder_expiry/i18n/es.po b/mrp_workorder_expiry/i18n/es.po deleted file mode 100644 index 12ed3923..00000000 --- a/mrp_workorder_expiry/i18n/es.po +++ /dev/null @@ -1,40 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_expiry -# -# Translators: -# Martin Trigaux, 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: Martin Trigaux, 2022\n" -"Language-Team: Spanish (https://www.transifex.com/odoo/teams/41243/es/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: es\n" -"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" - -#. module: mrp_workorder_expiry -#: model_terms:ir.ui.view,arch_db:mrp_workorder_expiry.quality_check_view_form_tablet_inherit_expiry -msgid " This lot is expired." -msgstr " Este lote ha caducado." - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,field_description:mrp_workorder_expiry.field_quality_check__is_expired -msgid "Product Expiry Alert" -msgstr "Alerta de caducidad del producto" - -#. module: mrp_workorder_expiry -#: model:ir.model,name:mrp_workorder_expiry.model_quality_check -msgid "Quality Check" -msgstr "Control de calidad" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,help:mrp_workorder_expiry.field_quality_check__is_expired -msgid "The Expiration Date has been reached." -msgstr "Se llegó a la fecha de caducidad." diff --git a/mrp_workorder_expiry/i18n/es_MX.po b/mrp_workorder_expiry/i18n/es_MX.po deleted file mode 100644 index d9b59ed6..00000000 --- a/mrp_workorder_expiry/i18n/es_MX.po +++ /dev/null @@ -1,40 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_expiry -# -# Translators: -# Braulio D. López Vázquez , 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: Braulio D. López Vázquez , 2022\n" -"Language-Team: Spanish (Mexico) (https://www.transifex.com/odoo/teams/41243/es_MX/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: es_MX\n" -"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" - -#. module: mrp_workorder_expiry -#: model_terms:ir.ui.view,arch_db:mrp_workorder_expiry.quality_check_view_form_tablet_inherit_expiry -msgid " This lot is expired." -msgstr " Este lote expiró." - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,field_description:mrp_workorder_expiry.field_quality_check__is_expired -msgid "Product Expiry Alert" -msgstr "Alerta de expiración del producto" - -#. module: mrp_workorder_expiry -#: model:ir.model,name:mrp_workorder_expiry.model_quality_check -msgid "Quality Check" -msgstr "Control de calidad" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,help:mrp_workorder_expiry.field_quality_check__is_expired -msgid "The Expiration Date has been reached." -msgstr "Se llegó a la fecha de expiración." diff --git a/mrp_workorder_expiry/i18n/fr.po b/mrp_workorder_expiry/i18n/fr.po deleted file mode 100644 index e518cb44..00000000 --- a/mrp_workorder_expiry/i18n/fr.po +++ /dev/null @@ -1,40 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_expiry -# -# Translators: -# Martin Trigaux, 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: Martin Trigaux, 2022\n" -"Language-Team: French (https://www.transifex.com/odoo/teams/41243/fr/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: fr\n" -"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" - -#. module: mrp_workorder_expiry -#: model_terms:ir.ui.view,arch_db:mrp_workorder_expiry.quality_check_view_form_tablet_inherit_expiry -msgid " This lot is expired." -msgstr " Ce lot est expiré." - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,field_description:mrp_workorder_expiry.field_quality_check__is_expired -msgid "Product Expiry Alert" -msgstr "Alerte d'expiration de produit" - -#. module: mrp_workorder_expiry -#: model:ir.model,name:mrp_workorder_expiry.model_quality_check -msgid "Quality Check" -msgstr "Contrôle qualité" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,help:mrp_workorder_expiry.field_quality_check__is_expired -msgid "The Expiration Date has been reached." -msgstr "La date d'expiration a été atteinte." diff --git a/mrp_workorder_expiry/i18n/he.po b/mrp_workorder_expiry/i18n/he.po deleted file mode 100644 index a8e1f6c1..00000000 --- a/mrp_workorder_expiry/i18n/he.po +++ /dev/null @@ -1,41 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_expiry -# -# Translators: -# ZVI BLONDER , 2022 -# דודי מלכה , 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: דודי מלכה , 2022\n" -"Language-Team: Hebrew (https://www.transifex.com/odoo/teams/41243/he/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: he\n" -"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n == 2 && n % 1 == 0) ? 1: (n % 10 == 0 && n % 1 == 0 && n > 10) ? 2 : 3;\n" - -#. module: mrp_workorder_expiry -#: model_terms:ir.ui.view,arch_db:mrp_workorder_expiry.quality_check_view_form_tablet_inherit_expiry -msgid " This lot is expired." -msgstr "" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,field_description:mrp_workorder_expiry.field_quality_check__is_expired -msgid "Product Expiry Alert" -msgstr "התראת פקיעת תוקף מוצר" - -#. module: mrp_workorder_expiry -#: model:ir.model,name:mrp_workorder_expiry.model_quality_check -msgid "Quality Check" -msgstr "בדיקת איכות" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,help:mrp_workorder_expiry.field_quality_check__is_expired -msgid "The Expiration Date has been reached." -msgstr "" diff --git a/mrp_workorder_expiry/i18n/id.po b/mrp_workorder_expiry/i18n/id.po deleted file mode 100644 index d6507928..00000000 --- a/mrp_workorder_expiry/i18n/id.po +++ /dev/null @@ -1,36 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_expiry -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Language-Team: Indonesian (https://www.transifex.com/odoo/teams/41243/id/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: id\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#. module: mrp_workorder_expiry -#: model_terms:ir.ui.view,arch_db:mrp_workorder_expiry.quality_check_view_form_tablet_inherit_expiry -msgid " This lot is expired." -msgstr "" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,field_description:mrp_workorder_expiry.field_quality_check__is_expired -msgid "Product Expiry Alert" -msgstr "" - -#. module: mrp_workorder_expiry -#: model:ir.model,name:mrp_workorder_expiry.model_quality_check -msgid "Quality Check" -msgstr "" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,help:mrp_workorder_expiry.field_quality_check__is_expired -msgid "The Expiration Date has been reached." -msgstr "" diff --git a/mrp_workorder_expiry/i18n/it.po b/mrp_workorder_expiry/i18n/it.po deleted file mode 100644 index 2a117cb8..00000000 --- a/mrp_workorder_expiry/i18n/it.po +++ /dev/null @@ -1,40 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_expiry -# -# Translators: -# Martin Trigaux, 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: Martin Trigaux, 2022\n" -"Language-Team: Italian (https://www.transifex.com/odoo/teams/41243/it/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: it\n" -"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" - -#. module: mrp_workorder_expiry -#: model_terms:ir.ui.view,arch_db:mrp_workorder_expiry.quality_check_view_form_tablet_inherit_expiry -msgid " This lot is expired." -msgstr " Il lotto è scaduto." - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,field_description:mrp_workorder_expiry.field_quality_check__is_expired -msgid "Product Expiry Alert" -msgstr "Avviso scadenza prodotto" - -#. module: mrp_workorder_expiry -#: model:ir.model,name:mrp_workorder_expiry.model_quality_check -msgid "Quality Check" -msgstr "Controllo qualità" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,help:mrp_workorder_expiry.field_quality_check__is_expired -msgid "The Expiration Date has been reached." -msgstr "È stata raggiunta la data di scadenza." diff --git a/mrp_workorder_expiry/i18n/ja.po b/mrp_workorder_expiry/i18n/ja.po deleted file mode 100644 index f0439f21..00000000 --- a/mrp_workorder_expiry/i18n/ja.po +++ /dev/null @@ -1,40 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_expiry -# -# Translators: -# Martin Trigaux, 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: Martin Trigaux, 2022\n" -"Language-Team: Japanese (https://www.transifex.com/odoo/teams/41243/ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#. module: mrp_workorder_expiry -#: model_terms:ir.ui.view,arch_db:mrp_workorder_expiry.quality_check_view_form_tablet_inherit_expiry -msgid " This lot is expired." -msgstr "" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,field_description:mrp_workorder_expiry.field_quality_check__is_expired -msgid "Product Expiry Alert" -msgstr "" - -#. module: mrp_workorder_expiry -#: model:ir.model,name:mrp_workorder_expiry.model_quality_check -msgid "Quality Check" -msgstr "品質検査" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,help:mrp_workorder_expiry.field_quality_check__is_expired -msgid "The Expiration Date has been reached." -msgstr "" diff --git a/mrp_workorder_expiry/i18n/ko.po b/mrp_workorder_expiry/i18n/ko.po deleted file mode 100644 index 86380f8d..00000000 --- a/mrp_workorder_expiry/i18n/ko.po +++ /dev/null @@ -1,40 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_expiry -# -# Translators: -# Martin Trigaux, 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: Martin Trigaux, 2022\n" -"Language-Team: Korean (https://www.transifex.com/odoo/teams/41243/ko/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: ko\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#. module: mrp_workorder_expiry -#: model_terms:ir.ui.view,arch_db:mrp_workorder_expiry.quality_check_view_form_tablet_inherit_expiry -msgid " This lot is expired." -msgstr "" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,field_description:mrp_workorder_expiry.field_quality_check__is_expired -msgid "Product Expiry Alert" -msgstr "품목 만료 경고" - -#. module: mrp_workorder_expiry -#: model:ir.model,name:mrp_workorder_expiry.model_quality_check -msgid "Quality Check" -msgstr "품질 검사" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,help:mrp_workorder_expiry.field_quality_check__is_expired -msgid "The Expiration Date has been reached." -msgstr "유통기한이 임박했습니다." diff --git a/mrp_workorder_expiry/i18n/nb.po b/mrp_workorder_expiry/i18n/nb.po deleted file mode 100644 index c075fd28..00000000 --- a/mrp_workorder_expiry/i18n/nb.po +++ /dev/null @@ -1,40 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_expiry -# -# Translators: -# Martin Trigaux, 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: Martin Trigaux, 2022\n" -"Language-Team: Norwegian Bokmål (https://www.transifex.com/odoo/teams/41243/nb/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: nb\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. module: mrp_workorder_expiry -#: model_terms:ir.ui.view,arch_db:mrp_workorder_expiry.quality_check_view_form_tablet_inherit_expiry -msgid " This lot is expired." -msgstr "" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,field_description:mrp_workorder_expiry.field_quality_check__is_expired -msgid "Product Expiry Alert" -msgstr "Utløpsvarsel for produkt" - -#. module: mrp_workorder_expiry -#: model:ir.model,name:mrp_workorder_expiry.model_quality_check -msgid "Quality Check" -msgstr "Kvalitetskontroll" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,help:mrp_workorder_expiry.field_quality_check__is_expired -msgid "The Expiration Date has been reached." -msgstr "" diff --git a/mrp_workorder_expiry/i18n/nl.po b/mrp_workorder_expiry/i18n/nl.po deleted file mode 100644 index 4980fe1f..00000000 --- a/mrp_workorder_expiry/i18n/nl.po +++ /dev/null @@ -1,41 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_expiry -# -# Translators: -# Martin Trigaux, 2022 -# Erwin van der Ploeg , 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: Erwin van der Ploeg , 2022\n" -"Language-Team: Dutch (https://www.transifex.com/odoo/teams/41243/nl/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: nl\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. module: mrp_workorder_expiry -#: model_terms:ir.ui.view,arch_db:mrp_workorder_expiry.quality_check_view_form_tablet_inherit_expiry -msgid " This lot is expired." -msgstr " Deze partij is vervallen." - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,field_description:mrp_workorder_expiry.field_quality_check__is_expired -msgid "Product Expiry Alert" -msgstr "Product vervalwaarschuwing" - -#. module: mrp_workorder_expiry -#: model:ir.model,name:mrp_workorder_expiry.model_quality_check -msgid "Quality Check" -msgstr "Kwaliteitscontrole" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,help:mrp_workorder_expiry.field_quality_check__is_expired -msgid "The Expiration Date has been reached." -msgstr "De vervaldatum is bereikt." diff --git a/mrp_workorder_expiry/i18n/ro.po b/mrp_workorder_expiry/i18n/ro.po deleted file mode 100644 index 63ec4973..00000000 --- a/mrp_workorder_expiry/i18n/ro.po +++ /dev/null @@ -1,41 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_expiry -# -# Translators: -# Foldi Robert , 2022 -# Hongu Cosmin , 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: Hongu Cosmin , 2022\n" -"Language-Team: Romanian (https://www.transifex.com/odoo/teams/41243/ro/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: ro\n" -"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n" - -#. module: mrp_workorder_expiry -#: model_terms:ir.ui.view,arch_db:mrp_workorder_expiry.quality_check_view_form_tablet_inherit_expiry -msgid " This lot is expired." -msgstr "" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,field_description:mrp_workorder_expiry.field_quality_check__is_expired -msgid "Product Expiry Alert" -msgstr "" - -#. module: mrp_workorder_expiry -#: model:ir.model,name:mrp_workorder_expiry.model_quality_check -msgid "Quality Check" -msgstr "Verificare Calitate" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,help:mrp_workorder_expiry.field_quality_check__is_expired -msgid "The Expiration Date has been reached." -msgstr "Data de expirare a fost atinsă." diff --git a/mrp_workorder_expiry/i18n/ru.po b/mrp_workorder_expiry/i18n/ru.po deleted file mode 100644 index 185f4f0c..00000000 --- a/mrp_workorder_expiry/i18n/ru.po +++ /dev/null @@ -1,41 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_expiry -# -# Translators: -# Ivan Kropotkin , 2022 -# Martin Trigaux, 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: Martin Trigaux, 2022\n" -"Language-Team: Russian (https://www.transifex.com/odoo/teams/41243/ru/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: ru\n" -"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" - -#. module: mrp_workorder_expiry -#: model_terms:ir.ui.view,arch_db:mrp_workorder_expiry.quality_check_view_form_tablet_inherit_expiry -msgid " This lot is expired." -msgstr "" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,field_description:mrp_workorder_expiry.field_quality_check__is_expired -msgid "Product Expiry Alert" -msgstr "Оповещения об окончании срока действия товара" - -#. module: mrp_workorder_expiry -#: model:ir.model,name:mrp_workorder_expiry.model_quality_check -msgid "Quality Check" -msgstr "Проверка качества" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,help:mrp_workorder_expiry.field_quality_check__is_expired -msgid "The Expiration Date has been reached." -msgstr "" diff --git a/mrp_workorder_expiry/i18n/th.po b/mrp_workorder_expiry/i18n/th.po deleted file mode 100644 index c4fb1d82..00000000 --- a/mrp_workorder_expiry/i18n/th.po +++ /dev/null @@ -1,40 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_expiry -# -# Translators: -# Wichanon Jamwutthipreecha, 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: Wichanon Jamwutthipreecha, 2022\n" -"Language-Team: Thai (https://www.transifex.com/odoo/teams/41243/th/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: th\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#. module: mrp_workorder_expiry -#: model_terms:ir.ui.view,arch_db:mrp_workorder_expiry.quality_check_view_form_tablet_inherit_expiry -msgid " This lot is expired." -msgstr " ล็อตนี้หมดอายุแล้ว" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,field_description:mrp_workorder_expiry.field_quality_check__is_expired -msgid "Product Expiry Alert" -msgstr "การแจ้งเตือนการหมดอายุของสินค้า" - -#. module: mrp_workorder_expiry -#: model:ir.model,name:mrp_workorder_expiry.model_quality_check -msgid "Quality Check" -msgstr "การตรวจสอบคุณภาพ" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,help:mrp_workorder_expiry.field_quality_check__is_expired -msgid "The Expiration Date has been reached." -msgstr "ถึงวันที่หมดอายุแล้ว" diff --git a/mrp_workorder_expiry/i18n/tr.po b/mrp_workorder_expiry/i18n/tr.po deleted file mode 100644 index 32375263..00000000 --- a/mrp_workorder_expiry/i18n/tr.po +++ /dev/null @@ -1,43 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_expiry -# -# Translators: -# Tugay Hatıl , 2022 -# Umur Akın , 2022 -# Murat Kaplan , 2022 -# abc Def , 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: abc Def , 2022\n" -"Language-Team: Turkish (https://www.transifex.com/odoo/teams/41243/tr/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: tr\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#. module: mrp_workorder_expiry -#: model_terms:ir.ui.view,arch_db:mrp_workorder_expiry.quality_check_view_form_tablet_inherit_expiry -msgid " This lot is expired." -msgstr " Bu lotun süresi doldu." - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,field_description:mrp_workorder_expiry.field_quality_check__is_expired -msgid "Product Expiry Alert" -msgstr "Ürün Son Kullanım Uyarısı" - -#. module: mrp_workorder_expiry -#: model:ir.model,name:mrp_workorder_expiry.model_quality_check -msgid "Quality Check" -msgstr "Kalite Kontrol" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,help:mrp_workorder_expiry.field_quality_check__is_expired -msgid "The Expiration Date has been reached." -msgstr "Süresi Dolma Tarihine ulaşıldı." diff --git a/mrp_workorder_expiry/i18n/uk.po b/mrp_workorder_expiry/i18n/uk.po deleted file mode 100644 index c052fb72..00000000 --- a/mrp_workorder_expiry/i18n/uk.po +++ /dev/null @@ -1,40 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_expiry -# -# Translators: -# Martin Trigaux, 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: Martin Trigaux, 2022\n" -"Language-Team: Ukrainian (https://www.transifex.com/odoo/teams/41243/uk/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: uk\n" -"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != 11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || (n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" - -#. module: mrp_workorder_expiry -#: model_terms:ir.ui.view,arch_db:mrp_workorder_expiry.quality_check_view_form_tablet_inherit_expiry -msgid " This lot is expired." -msgstr " Ця партія протермінована." - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,field_description:mrp_workorder_expiry.field_quality_check__is_expired -msgid "Product Expiry Alert" -msgstr "Попередження про закінчення терміну дії товару" - -#. module: mrp_workorder_expiry -#: model:ir.model,name:mrp_workorder_expiry.model_quality_check -msgid "Quality Check" -msgstr "Перевірка якості" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,help:mrp_workorder_expiry.field_quality_check__is_expired -msgid "The Expiration Date has been reached." -msgstr "Термін дії завершився." diff --git a/mrp_workorder_expiry/i18n/vi.po b/mrp_workorder_expiry/i18n/vi.po deleted file mode 100644 index 0d106355..00000000 --- a/mrp_workorder_expiry/i18n/vi.po +++ /dev/null @@ -1,40 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_expiry -# -# Translators: -# Martin Trigaux, 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: Martin Trigaux, 2022\n" -"Language-Team: Vietnamese (https://www.transifex.com/odoo/teams/41243/vi/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: vi\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#. module: mrp_workorder_expiry -#: model_terms:ir.ui.view,arch_db:mrp_workorder_expiry.quality_check_view_form_tablet_inherit_expiry -msgid " This lot is expired." -msgstr " Lô hàng đã hết hạn. " - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,field_description:mrp_workorder_expiry.field_quality_check__is_expired -msgid "Product Expiry Alert" -msgstr "Cảnh báo hết hạn sản phẩm" - -#. module: mrp_workorder_expiry -#: model:ir.model,name:mrp_workorder_expiry.model_quality_check -msgid "Quality Check" -msgstr "Đánh giá chất lượng" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,help:mrp_workorder_expiry.field_quality_check__is_expired -msgid "The Expiration Date has been reached." -msgstr "The Expiration Date has been reached." diff --git a/mrp_workorder_expiry/i18n/zh_CN.po b/mrp_workorder_expiry/i18n/zh_CN.po deleted file mode 100644 index 953d0479..00000000 --- a/mrp_workorder_expiry/i18n/zh_CN.po +++ /dev/null @@ -1,40 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_expiry -# -# Translators: -# Martin Trigaux, 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: Martin Trigaux, 2022\n" -"Language-Team: Chinese (China) (https://www.transifex.com/odoo/teams/41243/zh_CN/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: zh_CN\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#. module: mrp_workorder_expiry -#: model_terms:ir.ui.view,arch_db:mrp_workorder_expiry.quality_check_view_form_tablet_inherit_expiry -msgid " This lot is expired." -msgstr " 这批货过期了。" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,field_description:mrp_workorder_expiry.field_quality_check__is_expired -msgid "Product Expiry Alert" -msgstr "过期警报" - -#. module: mrp_workorder_expiry -#: model:ir.model,name:mrp_workorder_expiry.model_quality_check -msgid "Quality Check" -msgstr "质量检查" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,help:mrp_workorder_expiry.field_quality_check__is_expired -msgid "The Expiration Date has been reached." -msgstr "已到达过期日期。" diff --git a/mrp_workorder_expiry/i18n/zh_TW.po b/mrp_workorder_expiry/i18n/zh_TW.po deleted file mode 100644 index d80778ad..00000000 --- a/mrp_workorder_expiry/i18n/zh_TW.po +++ /dev/null @@ -1,40 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_expiry -# -# Translators: -# Martin Trigaux, 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: Martin Trigaux, 2022\n" -"Language-Team: Chinese (Taiwan) (https://www.transifex.com/odoo/teams/41243/zh_TW/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: zh_TW\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#. module: mrp_workorder_expiry -#: model_terms:ir.ui.view,arch_db:mrp_workorder_expiry.quality_check_view_form_tablet_inherit_expiry -msgid " This lot is expired." -msgstr "" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,field_description:mrp_workorder_expiry.field_quality_check__is_expired -msgid "Product Expiry Alert" -msgstr "產品過期警告" - -#. module: mrp_workorder_expiry -#: model:ir.model,name:mrp_workorder_expiry.model_quality_check -msgid "Quality Check" -msgstr "品質檢查" - -#. module: mrp_workorder_expiry -#: model:ir.model.fields,help:mrp_workorder_expiry.field_quality_check__is_expired -msgid "The Expiration Date has been reached." -msgstr "已到到期日。" diff --git a/mrp_workorder_expiry/models/__init__.py b/mrp_workorder_expiry/models/__init__.py deleted file mode 100644 index c62a7b4e..00000000 --- a/mrp_workorder_expiry/models/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from . import quality diff --git a/mrp_workorder_expiry/models/quality.py b/mrp_workorder_expiry/models/quality.py deleted file mode 100644 index 8d31fbed..00000000 --- a/mrp_workorder_expiry/models/quality.py +++ /dev/null @@ -1,10 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from odoo import fields, models - - -class QualityCheck(models.Model): - _inherit = 'quality.check' - - is_expired = fields.Boolean(related='lot_id.product_expiry_alert') diff --git a/mrp_workorder_expiry/static/src/scss/expired_alert.scss b/mrp_workorder_expiry/static/src/scss/expired_alert.scss deleted file mode 100644 index 2385d18a..00000000 --- a/mrp_workorder_expiry/static/src/scss/expired_alert.scss +++ /dev/null @@ -1,5 +0,0 @@ -.o_expired_alert { - padding-left: 20px; - text-align: right; - color: orangered; -} diff --git a/mrp_workorder_expiry/views/quality_views.xml b/mrp_workorder_expiry/views/quality_views.xml deleted file mode 100644 index 5dcefea9..00000000 --- a/mrp_workorder_expiry/views/quality_views.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - quality.check.tablet.view.form.inherit.expiry - quality.check - - - - -
- This lot is expired. -
-
-
-
- -
diff --git a/mrp_workorder_expiry/wizard/confirm_expiry_view.xml b/mrp_workorder_expiry/wizard/confirm_expiry_view.xml deleted file mode 100644 index 0d051e52..00000000 --- a/mrp_workorder_expiry/wizard/confirm_expiry_view.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - mrp.workorder.tablet.view.expiry.inherit - mrp.workorder - - - - {'skip_expired': True} - - - {'skip_expired': True} - - - - diff --git a/mrp_workorder_hr/__init__.py b/mrp_workorder_hr/__init__.py deleted file mode 100644 index de9509a6..00000000 --- a/mrp_workorder_hr/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# -*- coding: utf-8 -*- - -from . import models -from . import report -from . import wizard diff --git a/mrp_workorder_hr/__manifest__.py b/mrp_workorder_hr/__manifest__.py deleted file mode 100644 index 077992c8..00000000 --- a/mrp_workorder_hr/__manifest__.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -{ - 'name': "Employees time registration on Work Orders", - 'category': "Hidden", - 'summary': 'Link module between Mrp II and HR employees', - - 'description': """ -This module allows Employees (and not users) to log in to a workorder using a barcode, a PIN number or both. -The actual till still requires one user but an unlimited number of employees can log on to that till and complete manufacturing tasks. - """, - - 'depends': ['mrp_workorder', 'hr_hourly_cost', 'hr'], - - 'data': [ - 'views/hr_employee_views.xml', - 'views/mrp_workorder_views.xml', - 'views/mrp_workcenter_views.xml', - 'views/mrp_operation_views.xml', - ], - 'installable': True, - 'auto_install': ['mrp_workorder', 'hr'], - 'assets': { - 'web.assets_backend': [ - 'mrp_workorder_hr/static/src/**/*.js', - 'mrp_workorder_hr/static/src/**/*.scss', - 'mrp_workorder_hr/static/src/**/*.xml', - ], - 'web.assets_tests': [ - 'mrp_workorder_hr/static/tests/tours/**/*', - ], - }, - 'license': 'OEEL-1', -} diff --git a/mrp_workorder_hr/i18n/ar.po b/mrp_workorder_hr/i18n/ar.po deleted file mode 100644 index 90fa4e6b..00000000 --- a/mrp_workorder_hr/i18n/ar.po +++ /dev/null @@ -1,235 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * mrp_workorder_hr -# -# Translators: -# Martin Trigaux, 2022 -# Malaz Abuidris , 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: Malaz Abuidris , 2022\n" -"Language-Team: Arabic (https://www.transifex.com/odoo/teams/41243/ar/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: ar\n" -"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" - -#. module: mrp_workorder_hr -#. openerp-web -#: code:addons/mrp_workorder_hr/static/src/components/working_employee_popup.xml:0 -#, python-format -msgid "+ New Operator" -msgstr "" - -#. module: mrp_workorder_hr -#: model_terms:ir.ui.view,arch_db:mrp_workorder_hr.mrp_workorder_view_tablet_form_inherit_workorder_hr -msgid "" -", 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: trendspotter , 2022\n" -"Language-Team: Czech (https://www.transifex.com/odoo/teams/41243/cs/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: cs\n" -"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n" - -#. module: mrp_workorder_hr -#. openerp-web -#: code:addons/mrp_workorder_hr/static/src/components/working_employee_popup.xml:0 -#, python-format -msgid "+ New Operator" -msgstr "" - -#. module: mrp_workorder_hr -#: model_terms:ir.ui.view,arch_db:mrp_workorder_hr.mrp_workorder_view_tablet_form_inherit_workorder_hr -msgid "" -", 2022 -# ExcaliberX , 2022 -# Martin Trigaux, 2022 -# hed shefer , 2022 -# שהאב חוסיין , 2022 -# Yihya Hugirat , 2022 -# דודי מלכה , 2022 -# ZVI BLONDER , 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.5alpha1+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-20 09:49+0000\n" -"PO-Revision-Date: 2022-09-22 05:47+0000\n" -"Last-Translator: ZVI BLONDER , 2022\n" -"Language-Team: Hebrew (https://www.transifex.com/odoo/teams/41243/he/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: he\n" -"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n == 2 && n % 1 == 0) ? 1: (n % 10 == 0 && n % 1 == 0 && n > 10) ? 2 : 3;\n" - -#. module: mrp_workorder_hr -#. openerp-web -#: code:addons/mrp_workorder_hr/static/src/components/working_employee_popup.xml:0 -#, python-format -msgid "+ New Operator" -msgstr "" - -#. module: mrp_workorder_hr -#: model_terms:ir.ui.view,arch_db:mrp_workorder_hr.mrp_workorder_view_tablet_form_inherit_workorder_hr -msgid "" -" - - -
- -
-
-
diff --git a/mrp_workorder_hr/static/src/components/popup.js b/mrp_workorder_hr/static/src/components/popup.js deleted file mode 100644 index 44b92f61..00000000 --- a/mrp_workorder_hr/static/src/components/popup.js +++ /dev/null @@ -1,25 +0,0 @@ -/** @odoo-module **/ - -const { Component } = owl; - -export class SelectionPopup extends Component { - - get title() { - return this.props.popupData.title; - } - - get list() { - return this.props.popupData.list; - } - - cancel() { - this.props.onClosePopup('SelectionPopup', true); - } - - async selectItem(id) { - await this.props.onSelectEmployee(id); - this.props.onClosePopup('SelectionPopup'); - } -} - -SelectionPopup.template = 'mrp_workorder_hr.SelectionPopup'; diff --git a/mrp_workorder_hr/static/src/components/popup.xml b/mrp_workorder_hr/static/src/components/popup.xml deleted file mode 100644 index 7bac9a0e..00000000 --- a/mrp_workorder_hr/static/src/components/popup.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - diff --git a/mrp_workorder_hr/static/src/components/tablet.js b/mrp_workorder_hr/static/src/components/tablet.js deleted file mode 100644 index a129c0b8..00000000 --- a/mrp_workorder_hr/static/src/components/tablet.js +++ /dev/null @@ -1,156 +0,0 @@ -/** @odoo-module **/ - -import { useBus, useService } from "@web/core/utils/hooks"; -import Tablet from '@mrp_workorder/components/tablet'; -import { SelectionPopup } from '@mrp_workorder_hr/components/popup'; -import { WorkingEmployeePopup } from '@mrp_workorder_hr/components/working_employee_popup'; -import { patch } from 'web.utils'; -import { PinPopup } from '@mrp_workorder_hr/components/pin_popup'; - -const { onMounted } = owl; - -patch(Tablet.prototype, 'mrp_workorder_hr', { - setup() { - this._super(); - this.notification = useService("notification"); - this.popup.SelectionPopup = { - isShown: false, - data: {}, - }; - this.popup.PinPopup = { - isShown: false, - data: {}, - }; - this.popup.WorkingEmployeePopup = { - isShown: false, - data: {}, - }; - this.state.tabletEmployeeIds = []; - this.employee = this.props.action.context.employee_id; - this.actionRedirect = false; - useBus(this.workorderBus, "popupEmployeeManagement", this.popupEmployeeManagement); - onMounted(() => this.checkEmployeeLogged()); - }, - - checkEmployeeLogged() { - if (this.data.employee_list.length && !this.data.employee && !this.employee) { - this.popupAddEmployee(); - } - }, - // Popup Menu Actions - - popupEmployeeManagement() { - this.showPopup({ workorderId: this.workorderId }, 'WorkingEmployeePopup'); - }, - - popupAddEmployee() { - const list = this.data.employee_list.filter(e => ! this.data.employee_ids.includes(e.id)).map((employee) => { - return { - id: employee.id, - item: employee, - label: employee.name, - isSelected: false, - }; - }); - const title = this.env._t('Change Worker'); - this.showPopup({ title, list }, 'SelectionPopup'); - }, - - popupEmployeePin(employeeId) { - const employee = this.data.employee_list.find(e => e.id === employeeId); - this.showPopup({ employee }, 'PinPopup'); - }, - - // Buisness method - - async lockEmployee(employeeId, pin) { - const pinValid = await this._checkPin(employeeId, pin); - if (! pinValid) { - this.actionRedirect = this.lockEmployee; - return; - } - this.render(); - }, - - async startEmployee(employeeId, pin) { - const pinValid = await this._checkPin(employeeId, pin); - if (! pinValid) { - this.actionRedirect = this.startEmployee; - return; - } - this.state.tabletEmployeeIds.push(employeeId); - await this.orm.call( - 'mrp.workorder', - 'start_employee', - [this.workorderId, employeeId], - ); - await this.getState(); - this.render(); - }, - - async stopEmployee(employeeId, pin) { - const pinValid = await this._checkPin(employeeId, pin, false); - if (! pinValid) { - this.actionRedirect = this.stopEmployee; - return; - } - const index = this.state.tabletEmployeeIds.indexOf(employeeId); - this.state.tabletEmployeeIds.slice(index, 1); - await this.orm.call( - 'mrp.workorder', - 'stop_employee', - [this.workorderId, employeeId], - ); - await this.getState(); - this.render(); - }, - - redirectToAction(employeeId, pin) { - this.actionRedirect(employeeId, pin); - this.actionRedirect = false; - }, - - get isBlocked() { - let isBlocked = this._super(); - if (this.data.employee_list.length !== 0 && ! this.data.employee_id) { - isBlocked = true; - } - return isBlocked; - }, - - // Private - - async _checkPin(employeeId, pin, sessionSave = true) { - const pinValid = await this.orm.call('hr.employee', 'login', [employeeId, pin, sessionSave]); - if (!pinValid) { - this.popupEmployeePin(employeeId); - return; - } - return true; - }, - - _onBarcodeScanned(barcode) { - const employee = this.data.employee_list.find(e => e.barcode === barcode); - if (employee) { - this.startEmployee(employee.id); - } else { - return this._super(barcode); - } - }, - - async _onWillStart() { - const superMethod = this._super; - const employeeId = this.props.action.context.employee_id; - if (employeeId) { - await this.startEmployee(employeeId); - } - await superMethod(); - if (employeeId) { - await this.getState(); - } - }, -}); - -Tablet.components.SelectionPopup = SelectionPopup; -Tablet.components.PinPopup = PinPopup; -Tablet.components.WorkingEmployeePopup = WorkingEmployeePopup; diff --git a/mrp_workorder_hr/static/src/components/tablet.xml b/mrp_workorder_hr/static/src/components/tablet.xml deleted file mode 100644 index 67d6a18a..00000000 --- a/mrp_workorder_hr/static/src/components/tablet.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - -
- -
-
- -
-
- -
-
-
-
diff --git a/mrp_workorder_hr/static/src/components/working_employee_popup.js b/mrp_workorder_hr/static/src/components/working_employee_popup.js deleted file mode 100644 index 4f8dbeb2..00000000 --- a/mrp_workorder_hr/static/src/components/working_employee_popup.js +++ /dev/null @@ -1,80 +0,0 @@ -/** @odoo-module **/ - -import { MrpTimer } from "@mrp/widgets/timer"; -import { useService } from "@web/core/utils/hooks"; -import time from 'web.time'; - -const { Component, onWillStart } = owl; - -export class WorkingEmployeePopup extends Component { - setup() { - super.setup(); - this.orm = useService('orm'); - this.workorderId = this.props.popupData.workorderId; - - onWillStart(() => this._getState()) - } - - addEmployee() { - this.props.onAddEmployee(); - this.close(); - } - - lockEmployee(employeeId) { - this.startEmployee(employeeId); - this.props.onLockEmployee(employeeId); - this.close(); - } - - async stopEmployee(employeeId) { - this.props.onStopEmployee(employeeId); - this.lines.map(l => { - if (l.employee_id === employeeId) { - l.ongoing = false; - } - }); - this.render(); - } - - startEmployee(employeeId) { - this.props.onStartEmployee(employeeId); - this.lines.map(l => { - if (l.employee_id === employeeId) { - l.ongoing = true; - } - }); - this.render(); - } - - close() { - this.props.onClosePopup('WorkingEmployeePopup', true); - } - - async _getState() { - const productivityLines = await this.orm.call('mrp.workcenter.productivity', 'read_group', [ - [ - ['workorder_id', '=', this.workorderId], - ['employee_id', '!=', false], - ], - ['duration', 'date_start:array_agg', 'date_end:array_agg'], - ['employee_id'] - ]); - this.lines = productivityLines.map((pl) => { - let duration = pl.duration * 60; - const ongoingTimerIndex = pl.date_end.indexOf(null); - if ( ongoingTimerIndex != -1 ){ - const additionalDuration = moment(new Date()).diff(moment(time.auto_str_to_date(pl.date_start[ongoingTimerIndex])), 'seconds'); - duration += additionalDuration; - } - return { - 'employee_id': pl.employee_id[0], - 'employee_name': pl.employee_id[1], - 'duration': duration, - 'ongoing': pl.date_end.some(d => !d), - } - }) - } -} - -WorkingEmployeePopup.components = { MrpTimer }; -WorkingEmployeePopup.template = 'mrp_workorder_hr.WorkingEmployeePopup'; diff --git a/mrp_workorder_hr/static/src/components/working_employee_popup.scss b/mrp_workorder_hr/static/src/components/working_employee_popup.scss deleted file mode 100644 index db4914d1..00000000 --- a/mrp_workorder_hr/static/src/components/working_employee_popup.scss +++ /dev/null @@ -1,13 +0,0 @@ -.o_popup_employee_selection { - display: flex; - flex-direction: row; - justify-content: space-between; - line-height: 50px; - color: black; - div { - flex-basis: 25%; - } - .o_popup_employee_name { - flex-basis: 50%; - } -} diff --git a/mrp_workorder_hr/static/src/components/working_employee_popup.xml b/mrp_workorder_hr/static/src/components/working_employee_popup.xml deleted file mode 100644 index c7674160..00000000 --- a/mrp_workorder_hr/static/src/components/working_employee_popup.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - -
- -
-
-
diff --git a/mrp_workorder_hr/static/src/views/kanban/mrp_workorder_kanban_controller.js b/mrp_workorder_hr/static/src/views/kanban/mrp_workorder_kanban_controller.js deleted file mode 100644 index b67367d8..00000000 --- a/mrp_workorder_hr/static/src/views/kanban/mrp_workorder_kanban_controller.js +++ /dev/null @@ -1,152 +0,0 @@ -/** @odoo-module */ - -import { SelectionPopup } from '@mrp_workorder_hr/components/popup'; -import { PinPopup } from '@mrp_workorder_hr/components/pin_popup'; -import { useBus, useService } from "@web/core/utils/hooks"; -import { patch } from "@web/core/utils/patch"; -import {MrpWorkorderKanbanController} from '@mrp_workorder/views/kanban/mrp_workorder_kanban_controller'; - -const {onWillStart, useState, onMounted} = owl; - -MrpWorkorderKanbanController.components.SelectionPopup = SelectionPopup; -MrpWorkorderKanbanController.components.PinPopup = PinPopup; - -patch(MrpWorkorderKanbanController.prototype, 'mrp_workorder_hr', { - setup() { - this._super(); - this.popup = useState({ - PinPopup: { - isShown: false, - data: {}, - }, - SelectionPopup: { - isShown: false, - data: {}, - } - }); - this.notification = useService('notification'); - this.barcode = useService("barcode"); - useBus(this.barcode.bus, 'barcode_scanned', (event) => this._onBarcodeScanned(event.detail.barcode)); - this.workcenterId = this.props.context.default_workcenter_id; - this.workcenter = false; - this.employee = useState({ - name: false || this.props.context.employee_name, - id: 0 || this.props.context.employee_id, - }); - onWillStart(async () => { - await this.onWillStart(); - }); - onMounted(() => { - this.onMount(); - }); - }, - - async onWillStart() { - if (!this.workcenterId) { - return; - } - const workcenter = await this.orm.read( - "mrp.workcenter", [this.workcenterId], ['allow_employee', 'employee_ids'] - ); - this.workcenter = workcenter[0]; - if (!this.workcenter.allow_employee) { - return; - } - const fieldsToRead = ['id', 'name', 'barcode']; - const employees_domain = []; - if (this.workcenter.employee_ids.length) { - employees_domain.push(['id', 'in', this.workcenter.employee_ids]); - } - this.employees = await this.orm.searchRead( - "hr.employee", employees_domain, fieldsToRead, - ); - }, - - onMount() { - if (this.employeeId) { - this.selectEmployee(this.employeeId); - } - }, - - // destroy: function () { - // core.bus.off('barcode_scanned', this, this._onBarcodeScanned); - // this._super(); - // }, - - openEmployeeSelection() { - const employeeList = this.employees.map(employee => Object.create({ - id: employee.id, - item: employee, - label: employee.name, - isSelected: employee === this.employee.id, - })); - this.popup.SelectionPopup = { - data: { title: this.env._t('Select Employee'), list: employeeList }, - isShown: true, - }; - }, - - async selectEmployee(employeeId, pin) { - const employee = this.employees.find(e => e.id === employeeId); - const employee_function = this.employee.name && this.employee.id === employeeId ? 'logout' : 'login'; - const pinValid = await this.orm.call( - "hr.employee", employee_function, [employeeId, pin], - ); - if (!pinValid && this.popup.PinPopup.isShown) { - this.notification.add(this.env._t('Wrong password !'), {type: 'danger'}); - return; - } - if (!pinValid) { - this._askPin(employee); - return; - } - - if (employee_function === 'login') { - this.notification.add(this.env._t('Logged in!'), {type: 'success'}); - this.employee = { - name: employee.name, - id: employee.id, - }; - if (this.context.openRecord) { - this.openRecord(...this.context.openRecord); - - } - } else { - this.employee = { - name: false, - id: 0, - }; - } - }, - - closePopup(popupName) { - this.popup[popupName].isShown = false; - }, - - _askPin(employee) { - this.popup.PinPopup = { - data: {employee: employee}, - isShown: true, - }; - }, - - _onBarcodeScanned(barcode) { - const employee = this.employees.find(e => e.barcode === barcode); - if (employee) { - this.selectEmployee(employee.id); - } else { - this.notification.add(this.env._t('This employee is not allowed on this workcenter'), {type: 'danger'}); - } - }, - - async openRecord(record, mode) { - if (this.employees && !this.employee.name) { - this.context.openRecord = [record, mode]; - this.openEmployeeSelection(); - return; - } - delete this.context.openRecord; - Object.assign(this.context, {employee_id: this.employee.id}); - this._super(...arguments); - }, -}); diff --git a/mrp_workorder_hr/static/src/views/list/mrp_workorder_list_controller.js b/mrp_workorder_hr/static/src/views/list/mrp_workorder_list_controller.js deleted file mode 100644 index fa43f183..00000000 --- a/mrp_workorder_hr/static/src/views/list/mrp_workorder_list_controller.js +++ /dev/null @@ -1,152 +0,0 @@ -/** @odoo-module */ - -import { SelectionPopup } from "@mrp_workorder_hr/components/popup"; -import { PinPopup } from "@mrp_workorder_hr/components/pin_popup"; -import core from "web.core"; -import { useService } from "@web/core/utils/hooks"; -import { patch } from "@web/core/utils/patch"; -import {MrpWorkorderListController} from "@mrp_workorder/views/list/mrp_workorder_list_controller"; - -const {onWillStart, useState, onMounted} = owl; - -MrpWorkorderListController.components.SelectionPopup = SelectionPopup; -MrpWorkorderListController.components.PinPopup = PinPopup; - -patch(MrpWorkorderListController.prototype, "mrp_workorder_hr", { - setup() { - this._super(); - this.popup = useState({ - PinPopup: { - isShown: false, - data: {}, - }, - SelectionPopup: { - isShown: false, - data: {}, - } - }); - this.notification = useService("notification"); - this.orm = useService("orm"); - this.workcenterId = this.props.context.default_workcenter_id; - this.workcenter = false; - this.employee = useState({ - name: false || this.props.context.employee_name, - id: 0 || this.props.context.employee_id, - }); - onWillStart(async () => { - await this.onWillStart(); - }); - onMounted(() => { - this.onMount(); - }); - }, - - async onWillStart() { - if (!this.workcenterId) { - return; - } - const workcenter = await this.orm.read( - "mrp.workcenter", [this.workcenterId], ["allow_employee", "employee_ids"] - ); - this.workcenter = workcenter[0]; - if (!this.workcenter.allow_employee) { - return; - } - const fieldsToRead = ["id", "name", "barcode"]; - const employees_domain = []; - if (this.workcenter.employee_ids.length) { - employees_domain.push(["id", "in", this.workcenter.employee_ids]); - } - this.employees = await this.orm.searchRead( - "hr.employee", employees_domain, fieldsToRead, - ); - }, - - onMount() { - if (this.employeeId) { - this.selectEmployee(this.employeeId); - } - core.bus.on("barcode_scanned", this, this._onBarcodeScanned); - }, - - // destroy: function () { - // core.bus.off("barcode_scanned", this, this._onBarcodeScanned); - // this._super(); - // }, - - openEmployeeSelection() { - const employeeList = this.employees.map(employee => Object.create({ - id: employee.id, - item: employee, - label: employee.name, - isSelected: employee === this.employee.id, - })); - this.popup.SelectionPopup = { - data: { title: this.env._t("Select Employee"), list: employeeList }, - isShown: true, - }; - }, - - async selectEmployee(employeeId, pin) { - const employee = this.employees.find(e => e.id === employeeId); - const employee_function = this.employee.name && this.employee.id === employeeId ? "logout" : "login"; - const pinValid = await this.orm.call( - "hr.employee", employee_function, [employeeId, pin], - ); - if (!pinValid && this.popup.PinPopup.isShown) { - this.notification.add(this.env._t("Wrong password !"), {type: "danger"}); - return; - } - if (!pinValid) { - this._askPin(employee); - return; - } - - if (employee_function === "login") { - this.notification.add(this.env._t("Logged in!"), {type: "success"}); - this.employee = { - name: employee.name, - id: employee.id, - }; - if (this.context.openRecord) { - this.openRecord(...this.context.openRecord); - } - } else { - this.employee = { - name: false, - id: 0, - }; - } - }, - - closePopup(popupName) { - this.popup[popupName].isShown = false; - }, - - _askPin(employee) { - this.popup.PinPopup = { - data: {employee: employee}, - isShown: true, - }; - }, - - _onBarcodeScanned: function (barcode) { - const employee = this.employees.find(e => e.barcode === barcode); - if (employee) { - this.selectEmployee(employee.id); - } else { - this.notification.add(this.env._t("This employee is not allowed on this workcenter"), {type: "danger"}); - } - }, - - async openRecord(record, mode) { - if (this.employees && !this.employee.name) { - this.context.openRecord = [record, mode]; - this.openEmployeeSelection(); - return; - } - delete this.context.openRecord; - Object.assign(this.context, {employee_id: this.employee.id}); - this._super(...arguments); - }, -}); diff --git a/mrp_workorder_hr/static/src/views/xml/mrp_workorder_buttons.xml b/mrp_workorder_hr/static/src/views/xml/mrp_workorder_buttons.xml deleted file mode 100644 index ab77ce2e..00000000 --- a/mrp_workorder_hr/static/src/views/xml/mrp_workorder_buttons.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - -
- -
-
- -
-
-
-
diff --git a/mrp_workorder_hr/static/tests/tours/tour_test_workorder.js b/mrp_workorder_hr/static/tests/tours/tour_test_workorder.js deleted file mode 100644 index 086c703a..00000000 --- a/mrp_workorder_hr/static/tests/tours/tour_test_workorder.js +++ /dev/null @@ -1,94 +0,0 @@ -/** @odoo-module **/ - -import tour from 'web_tour.tour'; -import helper from 'mrp_workorder.tourHelper'; - -tour.register('test_production_with_employee', {test: true}, [ - {trigger: 'div.popup'}, - {trigger: 'h3:contains("Change Worker")'}, - {trigger: 'div.selection-item:contains("Arthur")'}, - {trigger: 'div.popup-numpad'}, - {trigger: '.popup-numpad button:contains("1")'}, - {trigger: 'span.highlight:contains("•")'}, - {trigger: '.popup-numpad button:contains("2")'}, - {trigger: 'span.highlight:contains("••")'}, - {trigger: '.popup-numpad button:contains("3")'}, - {trigger: 'span.highlight:contains("•••")'}, - {trigger: '.popup-numpad button:contains("4")'}, - {trigger: 'span.highlight:contains("••••")'}, - {trigger: 'button.confirm'}, - { - trigger: 'span[title="Arthur Fu"]', - run: function () { - helper.assertCheckLength(3); - helper.assertValidatedCheckLength(0); - helper.assertQtyToProduce(2, 2); - helper.assertCurrentCheck('Instruction 1'); - } - }, - {trigger: 'div[name=employee_name]'}, - {trigger: 'button.btn-link:contains("New")'}, - {trigger: 'h3:contains("Change Worker")'}, - {trigger: 'div.selection-item:contains("Thomas")'}, - {trigger: 'div.popup-numpad'}, - {trigger: '.popup-numpad button:contains("5")'}, - {trigger: 'span.highlight:contains("•")'}, - {trigger: '.popup-numpad button:contains("6")'}, - {trigger: 'span.highlight:contains("••")'}, - {trigger: '.popup-numpad button:contains("7")'}, - {trigger: 'span.highlight:contains("•••")'}, - {trigger: '.popup-numpad button:contains("8")'}, - {trigger: 'span.highlight:contains("••••")'}, - {trigger: 'button.confirm'}, - { - trigger: 'span[title="Thomas Nific"]', - run: function () { - helper.assertCheckLength(3); - helper.assertValidatedCheckLength(0); - helper.assertQtyToProduce(2, 2); - helper.assertCurrentCheck('Instruction 1'); - } - }, - {trigger: 'div[name=employee_name]'}, - {trigger: 'button.btn_employee:contains("Thomas")'}, - {trigger: 'button[name="action_next"]'}, - {trigger: 'div[name=qty_producing]:contains("2")'}, //field become readonly - { - trigger: '.o_tablet_step_ok', - run: function () { - helper.assertCheckLength(3); - helper.assertValidatedCheckLength(1); - helper.assertQtyToProduce(2, 2); - helper.assertCurrentCheck('Instruction 2'); - } - }, - {trigger: 'button[name="action_next"]'}, - { - trigger: 'p:contains("third")', - run: function () { - helper.assertCheckLength(3); - helper.assertValidatedCheckLength(2); - helper.assertQtyToProduce(2, 2); - helper.assertCurrentCheck('Instruction 3'); - } - }, - {trigger: 'button[name=openMenuPopup]'}, - {trigger: '.o_tablet_popups'}, - {trigger: '.btn:contains("Update Instruction")'}, - {trigger: '.modal-title:contains("Update Instruction")'}, - // { - // trigger: "div[name=note] p", - // position: 'bottom', - // run: 'text my new instruction', - // }, { - { - trigger: "input#comment", - position: 'bottom', - run: 'text my reason', - }, - {trigger: '.btn-primary[name="process"]'}, - {trigger: '.o_tablet_client_action'}, - {trigger: '.btn-primary[name="action_next"]'}, - {trigger: '.btn[name=do_finish]'}, - {trigger: '.o_searchview_input'}, -]); diff --git a/mrp_workorder_hr/tests/__init__.py b/mrp_workorder_hr/tests/__init__.py deleted file mode 100644 index 02da47bf..00000000 --- a/mrp_workorder_hr/tests/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from . import test_tablet_client_action diff --git a/mrp_workorder_hr/tests/test_tablet_client_action.py b/mrp_workorder_hr/tests/test_tablet_client_action.py deleted file mode 100644 index ef89d6aa..00000000 --- a/mrp_workorder_hr/tests/test_tablet_client_action.py +++ /dev/null @@ -1,83 +0,0 @@ -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from odoo.tests import Form, HttpCase, tagged -from odoo import Command - -from odoo.addons.mrp.tests.common import TestMrpCommon - - -@tagged('post_install', '-at_install') -class TestTabletWorkorderHr(TestMrpCommon, HttpCase): - def _get_client_action_url(self, workorder_id): - action = self.env["ir.actions.actions"]._for_xml_id("mrp_workorder.tablet_client_action") - return '/web?debug=assets#action=%s&active_id=%s' % (action['id'], workorder_id) - - def test_production_with_employee(self): - self.env['mrp.workcenter'].search([]).write({ - 'allow_employee': True, - 'employee_ids': [ - Command.create({ - 'name': 'Arthur Fu', - 'pin': '1234', - }), - Command.create({ - 'name': 'Thomas Nific', - 'pin': '5678', - }) - ] - }) - self.env['stock.lot'].create([{ - 'product_id': self.product_6.id, - 'name': 'sn1', - 'company_id': self.env.company.id, - }]) - picking_type = self.env.ref('stock.warehouse0').manu_type_id - self.bom_3.operation_ids[0].quality_point_ids = [ - Command.create({ - 'product_ids': self.product_6.ids, - 'picking_type_ids': picking_type.ids, - 'operation_id': self.bom_3.operation_ids[0], - 'test_type_id': self.env.ref('quality.test_type_instructions').id, - 'note': "this is the first note", - 'title': "Instruction 1", - }), - Command.create({ - 'product_ids': self.product_6.ids, - 'picking_type_ids': picking_type.ids, - 'operation_id': self.bom_3.operation_ids[0], - 'test_type_id': self.env.ref('quality.test_type_instructions').id, - 'note': "this is the second note", - 'title': "Instruction 2", - }), - Command.create({ - 'product_ids': self.product_6.ids, - 'picking_type_ids': picking_type.ids, - 'operation_id': self.bom_3.operation_ids[0], - 'test_type_id': self.env.ref('quality.test_type_instructions').id, - 'note': "this is the third note", - 'title': "Instruction 3", - }), - ] - - mrp_order_form = Form(self.env['mrp.production']) - mrp_order_form.product_id = self.product_6 - production = mrp_order_form.save() - production.action_confirm() - production.action_assign() - production.button_plan() - production.qty_producing = 2 - self.assertEqual(len(production.workorder_ids.check_ids), 3) - wo = production.workorder_ids[0] - wo.button_start() - url = self._get_client_action_url(wo.id) - - self.start_tour(url, 'test_production_with_employee', login='admin', timeout=20) - employee1 = self.env['hr.employee'].search([ - ('name', '=', 'Arthur Fu'), - ]) - employee2 = self.env['hr.employee'].search([ - ('name', '=', 'Thomas Nific'), - ]) - self.assertEqual(len(wo.time_ids), 2) - self.assertTrue(wo.time_ids[0].employee_id, employee1) - self.assertTrue(wo.time_ids[1].employee_id, employee2) diff --git a/mrp_workorder_hr/views/hr_employee_views.xml b/mrp_workorder_hr/views/hr_employee_views.xml deleted file mode 100644 index c7b3e283..00000000 --- a/mrp_workorder_hr/views/hr_employee_views.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - hr.employee.view.form.inherit.mrp.workorder.hr - hr.employee - - - - - - - - - diff --git a/mrp_workorder_hr/views/mrp_operation_views.xml b/mrp_workorder_hr/views/mrp_operation_views.xml deleted file mode 100644 index bf32d9d6..00000000 --- a/mrp_workorder_hr/views/mrp_operation_views.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - mrp.routing.workcenter.form.view - mrp.routing.workcenter - - - - - - - - diff --git a/mrp_workorder_hr/views/mrp_workcenter_views.xml b/mrp_workorder_hr/views/mrp_workcenter_views.xml deleted file mode 100644 index da7bbed0..00000000 --- a/mrp_workorder_hr/views/mrp_workcenter_views.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - mrp.workcenter.tree.view.inherit - mrp.workcenter - - - - - - - - - mrp.workcenter.form.view.inherit - mrp.workcenter - - - - - -
- Allowed Employees - -
-
-
- - -
-
-
diff --git a/mrp_workorder_hr/views/mrp_workorder_views.xml b/mrp_workorder_hr/views/mrp_workorder_views.xml deleted file mode 100644 index 427bd254..00000000 --- a/mrp_workorder_hr/views/mrp_workorder_views.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - mrp.workorder.view.tablet.form.inherit.workorder.hr - mrp.workorder - - - - - - - - - - {'invisible': ['|', '|', '|', ('allow_employee', '=', True), ('is_user_working', '=', True), ('working_state', '=', 'blocked'), ('state', '=', ('done', 'cancel'))]} - - - {'invisible': ['|', '|', ('allow_employee', '=', True), ('is_user_working', '=', False), ('working_state', '=', 'blocked')]} - - - - - - mrp.workorder.view.form.inherit.workorder.hr - mrp.workorder - - - - - - - - - - {'column_invisible': [('parent.allow_employee', '!=', False)]} - - - - - - {'column_invisible': [('parent.allow_employee', '!=', False)]} - - - - - - - - - - mrp.workorder.view.kanban.inherit.mrp.workorder.hr - mrp.workorder - - - - - - - record.last_working_user_id.raw_value & ! allow_employee - - - - - diff --git a/mrp_workorder_hr/wizard/__init__.py b/mrp_workorder_hr/wizard/__init__.py deleted file mode 100644 index af231a21..00000000 --- a/mrp_workorder_hr/wizard/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from . import propose_change diff --git a/mrp_workorder_hr/wizard/propose_change.py b/mrp_workorder_hr/wizard/propose_change.py deleted file mode 100644 index adb68917..00000000 --- a/mrp_workorder_hr/wizard/propose_change.py +++ /dev/null @@ -1,13 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from odoo import models - - -class ProposeChange(models.TransientModel): - _inherit = 'propose.change' - - def _workorder_name(self): - if self.workorder_id.employee_id: - return self.workorder_id.employee_id.name - return super()._workorder_name() diff --git a/quality/.idea/.gitignore b/quality/.idea/.gitignore new file mode 100644 index 00000000..35410cac --- /dev/null +++ b/quality/.idea/.gitignore @@ -0,0 +1,8 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/quality/.idea/inspectionProfiles/Project_Default.xml b/quality/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 00000000..6945e437 --- /dev/null +++ b/quality/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,49 @@ + + + + \ No newline at end of file diff --git a/quality/.idea/inspectionProfiles/profiles_settings.xml b/quality/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 00000000..105ce2da --- /dev/null +++ b/quality/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/quality/.idea/misc.xml b/quality/.idea/misc.xml new file mode 100644 index 00000000..d56657ad --- /dev/null +++ b/quality/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/quality/.idea/modules.xml b/quality/.idea/modules.xml new file mode 100644 index 00000000..45662f75 --- /dev/null +++ b/quality/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/quality/.idea/quality.iml b/quality/.idea/quality.iml new file mode 100644 index 00000000..d0876a78 --- /dev/null +++ b/quality/.idea/quality.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/quality/.idea/vcs.xml b/quality/.idea/vcs.xml new file mode 100644 index 00000000..6c0b8635 --- /dev/null +++ b/quality/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/sf_base/__manifest__.py b/sf_base/__manifest__.py index 2daf3ec0..045692f4 100644 --- a/sf_base/__manifest__.py +++ b/sf_base/__manifest__.py @@ -16,7 +16,9 @@ 'security/ir.model.access.csv', 'views/base_view.xml', 'views/common_view.xml', - "views/menu_view.xml" + "views/menu_view.xml", + "views/tool_base_views.xml", + "views/tool_base_menu.xml", ], 'demo': [ diff --git a/sf_base/models/__init__.py b/sf_base/models/__init__.py index 4714c995..f6e247d2 100644 --- a/sf_base/models/__init__.py +++ b/sf_base/models/__init__.py @@ -1,4 +1,5 @@ from . import base from . import common +from . import tool_base diff --git a/sf_base/models/base.py b/sf_base/models/base.py index bf46344f..4c77c114 100644 --- a/sf_base/models/base.py +++ b/sf_base/models/base.py @@ -84,7 +84,31 @@ class MachineTool(models.Model): state = fields.Selection( [("正常", "正常"), ("故障", "故障"), ("不可用", "不可用")], default='正常', string="机床状态") - + #0606新增字段 + machine_tool_picture = fields.Binary('机床图片') + heightened_way = fields.Selection([ + ('sifudianji', '伺服电机驱动'), + ('youyagang', '油压缸驱动'), + ('chilunjia', '齿轮架驱动') + ], string="主轴加高方式", default='sifudianji') + workpiece_load = fields.Char('工件负载') + lead_screw = fields.Char('丝杆') + workbench_L = fields.Char('工作台长度(mm)') + workbench_W = fields.Char('工作台宽度(mm)') + guide_rail = fields.Char('导轨') + machine_tool_L = fields.Char('机床长度(mm)') + machine_tool_W = fields.Char('机床宽度(mm)') + machine_tool_H = fields.Char('机床高度(mm)') + feed_speed = fields.Char('进给速度(mm/min)') + tool_speed = fields.Char('刀具速度') + distance = fields.Char('主轴端面至工作台面距离(mm)') + taper = fields.Char('主轴锥度(°)') + torque = fields.Char('主轴点击扭矩(n/m)') + motor_power = fields.Char('主轴电机功率(kw)') + tool_quality_max = fields.Char('刀具最大质量') + tool_long_max = fields.Char('刀具最大长度') + tool_diameter_max = fields.Char('刀具最大刀径') + machine_tool_category = fields.Many2one('sf.machine_tool.category', string='机床类型') # 一个机床对应一個加工工厂,一个加工工厂对应多个机床 factory_id = fields.Many2one('res.partner', string='所属工厂', domain="[('is_factory', '=', True)]") @@ -152,6 +176,26 @@ class MachineTool(models.Model): item.z_axis = item.type_id.z_axis item.b_axis = item.type_id.b_axis item.c_axis = item.type_id.c_axis + item.machine_tool_picture = item.type_id.machine_tool_picture + item.heightened_way = item.type_id.heightened_way + item.workpiece_load = item.type_id.workpiece_load + item.lead_screw = item.type_id.lead_screw + item.workbench_L = item.type_id.workbench_L + item.workbench_W = item.type_id.workbench_W + item.guide_rail = item.type_id.guide_rail + item.machine_tool_L = item.type_id.machine_tool_L + item.machine_tool_W = item.type_id.machine_tool_W + item.machine_tool_H = item.type_id.machine_tool_H + item.feed_speed = item.type_id.feed_speed + item.tool_speed = item.type_id.tool_speed + item.distance = item.type_id.distance + item.taper = item.type_id.taper + item.torque = item.type_id.torque + item.motor_power = item.type_id.motor_power + item.tool_quality_max = item.type_id.tool_quality_max + item.tool_long_max = item.type_id.tool_long_max + item.tool_diameter_max = item.type_id.tool_diameter_max + item.machine_tool_category = item.type_id.machine_tool_category.id # 注册同步机床 def enroll_machine_tool(self): @@ -214,6 +258,33 @@ class MachineToolType(models.Model): default="", string="刀把类型") number_of_knife_library = fields.Integer('刀库数量') rotate_speed = fields.Integer('转速') + #0606新增字段 + created_user = fields.Many2one('res.users', string='创建人', default=lambda self: self.env.user) + machine_tool_picture = fields.Binary('机床图片') + heightened_way = fields.Selection([ + ('sifudianji', '伺服电机驱动'), + ('youyagang', '油压缸驱动'), + ('chilunjia', '齿轮架驱动') + ], string="主轴加高方式", default='sifudianji') + workpiece_load = fields.Char('工件负载') + lead_screw = fields.Char('丝杆') + workbench_L = fields.Char('工作台长度(mm)') + workbench_W = fields.Char('工作台宽度(mm)') + guide_rail = fields.Char('导轨') + machine_tool_L = fields.Char('机床长度(mm)') + machine_tool_W = fields.Char('机床宽度(mm)') + machine_tool_H = fields.Char('机床高度(mm)') + feed_speed = fields.Char('进给速度(mm/min)') + tool_speed = fields.Char('刀具速度') + distance = fields.Char('主轴端面至工作台面距离(mm)') + taper = fields.Char('主轴锥度(°)') + torque = fields.Char('主轴点击扭矩(n/m)') + motor_power = fields.Char('主轴电机功率(kw)') + tool_quality_max = fields.Char('刀具最大质量') + tool_long_max = fields.Char('刀具最大长度') + tool_diameter_max = fields.Char('刀具最大刀径') + machine_tool_category = fields.Many2one('sf.machine_tool.category', string='机床类型') + # 多个型号对应一个机床 machine_tool_id = fields.Many2one('sf.machine_tool', '机床') number_of_axles = fields.Selection( @@ -259,3 +330,14 @@ class CuttingToolType(models.Model): brand_id = fields.Many2one('sf.machine.brand', string='品牌') remark = fields.Text('备注') active = fields.Boolean('有效', default=True) + +class MachineToolCategory(models.Model): + _name = 'sf.machine_tool.category' + _description = '机床类型' + + code = fields.Char('编码') + name = fields.Char('名称') + remark = fields.Text('备注') + category = fields.Selection([('shukong', u'数控'), ('putong', u'普通')], string=u'机床类别', + default='shukong') + diff --git a/sf_base/models/tool_base.py b/sf_base/models/tool_base.py new file mode 100644 index 00000000..c1a90a92 --- /dev/null +++ b/sf_base/models/tool_base.py @@ -0,0 +1,267 @@ +# -*- coding: utf-8 -*- +import logging + +from odoo import fields, models, api +from odoo.exceptions import UserError +# from odoo.addons import mrs_base, mrs_common +from datetime import datetime + + +# 功能刀具 +class FunctionalCuttingTool(models.Model): + _name = 'mrs.functional.cutting.tool' + _description = '功能刀具' + + code = fields.Char('编码') + name = fields.Char('名称') + # 增加功能刀具类型、整体式刀具型号、刀片型号、刀杆型号、刀盘型号、刀柄型号、夹头型号、直径(mm)、刀具等级、加工精度(mm)、装刀长、刃数、整体刃长(mm)、有效刃长(mm)、最大寿命值、是否标准刀、适用范围 + functional_model_number = fields.Many2one('mrs.functional.cutting.tool.model', string='功能刀具类型', required=True) + integral_model_number = fields.Many2one('mrs.integral.cutting.tool', string='整体式刀具型号') + blade_model_number = fields.Many2one('mrs.blade', string='刀片型号') + cutterbar_model_number = fields.Many2one('mrs.cutter.bar', string='刀杆型号') + cutterpad_model_number = fields.Many2one('mrs.cutter.pad', string='刀盘型号') + handle_model_number = fields.Many2one('mrs.handle', string='刀柄型号', required=True) + chuck_model_number = fields.Many2one('mrs.chuck', string='夹头型号', required=True) + diameter = fields.Float('直径(mm)') + tool_grade = fields.Selection([('1', 'P1'), ('2', 'P2'), ('3', 'P3'), ('4', 'P4'), ('5', 'P5'), ('6', 'P6')], + string='刀具等级') + machining_accuracy = fields.Float('加工精度(mm)') + tool_length = fields.Float('装刀长') + blade_number = fields.Integer('刃数') + integral_blade_length = fields.Float('整体刃长(mm)') + effective_blade_length = fields.Float('有效刃长(mm)') + max_life = fields.Float('最大寿命值') + is_standard = fields.Boolean('是否标准刀') + applicable_range = fields.Char('适用范围') + image = fields.Binary('图片') + + +# 功能刀具类型 +class FunctionalCuttingToolModel(models.Model): + _name = 'mrs.functional.cutting.tool.model' + _description = '功能刀具类型' + + name = fields.Char('名称', required=True) + code = fields.Char('编码', required=True) + remark = fields.Text('备注') + + +# 整体式刀具 +class IntegralCuttingTool(models.Model): + _name = 'mrs.integral.cutting.tool' + _description = '整体式刀具' + + code = fields.Char('编码') + name = fields.Char('型号名称', required=True) + # 整体式刀具类型字段,关联整体式刀具类型对象 + integral_model_number = fields.Many2one('mrs.integral.cutting.tool.model', '整体式刀具类型', required=True) + # 增加品牌、总长度(mm)、柄部长度(mm)、刃部长度(mm)、直径(mm)、刃数、前角(°)、后角(°)、主偏角(°)、材料型号、配对螺母(mm)、适用夹头型号、适用范围、图片、创建人、创建时间等字段 + brand = fields.Many2one('mrs.machine.brand', '品牌', required=True) + total_length = fields.Float('总长度(mm)', required=True) + shank_length = fields.Float('柄部长度(mm)', required=True) + blade_length = fields.Float('刃部长度(mm)', required=True) + diameter = fields.Float('直径(mm)', required=True) + blade_number = fields.Integer('刃数', required=True) + front_angle = fields.Float('前角(°)', required=True) + rear_angle = fields.Float('后角(°)', required=True) + main_included_angle = fields.Float('主偏角(°)', required=True) + material_model = fields.Many2one('mrs.production.materials', '材料型号', required=True) + nut = fields.Float('配对螺母(mm)', required=True) + # 适用夹头型号可以多选 + chuck_model = fields.Many2many('mrs.chuck', string='适用夹头型号', required=True) + scope = fields.Char('适用范围', required=True) + image = fields.Binary('图片') + + +# 整体式刀具类型 +class IntegralCuttingToolModel(models.Model): + _name = 'mrs.integral.cutting.tool.model' + _description = '整体式刀具类型' + + code = fields.Char('编码') + name = fields.Char('名称', required=True) + remark = fields.Text('备注') + + +# 刀片 +class Blade(models.Model): + _name = 'mrs.blade' + _description = '刀片' + + code = fields.Char('编码') + name = fields.Char('型号名称', required=True) + # 刀片类型字段,关联刀片类型对象 + blade_model_number = fields.Many2one('mrs.blade.model', '刀片类型', required=True) + # 编码、型号名称、刀片类型、品牌、长度L(mm)、宽度D(mm)、高度T(mm)、顶角(°)、前角(°)、后角(°)、主偏角(°)、R角(°)、材料型号、加工硬度、配对螺母(mm)、适用刀杆/刀盘型号、刀尖半径(mm)、图片、创建人、创建时间字段 + brand = fields.Many2one('mrs.machine.brand', '品牌', required=True) + length = fields.Float('长度L(mm)', required=True) + width = fields.Float('宽度D(mm)', required=True) + height = fields.Float('高度T(mm)', required=True) + top_angle = fields.Float('顶角(°)', required=True) + front_angle = fields.Float('前角(°)', required=True) + rear_angle = fields.Float('后角(°)', required=True) + main_included_angle = fields.Float('主偏角(°)', required=True) + r_angle = fields.Float('R角(°)', required=True) + material_model = fields.Many2one('mrs.production.materials', '材料型号', required=True) + hardness = fields.Char('加工硬度', required=True) + nut = fields.Float('配对螺母(mm)', required=True) + # 适用刀杆型号可以多选 + cutter_bar = fields.Many2many('mrs.cutter.bar', string='适用刀杆型号') + # 适用刀盘型号可以多选 + cutter_pad = fields.Many2many('mrs.cutter.pad', string='适用刀盘型号') + radius = fields.Float('刀尖半径(mm)', required=True) + image = fields.Binary('图片') + + +# 刀片类型 +class BladeModel(models.Model): + _name = 'mrs.blade.model' + _description = '刀片类型' + + code = fields.Char('编码') + name = fields.Char('名称', required=True) + # 刀片类型字段,关联刀片对象 + blade_ids = fields.One2many('mrs.blade', 'blade_model_number', '刀片类型') + remark = fields.Text('备注') + + +# 刀杆 +class CutterBar(models.Model): + _name = 'mrs.cutter.bar' + _description = '刀杆' + + code = fields.Char('编码') + name = fields.Char('型号名称', required=True) + # 刀杆类型字段,关联刀杆类型对象 + cutter_bar_model_number = fields.Many2one('mrs.cutter.bar.model', '刀杆类型', required=True) + # 品牌、C柄径(mm)、L总长(mm)、材料型号、刃数、D刃径(mm)、适用刀片型号、配对扳手(mm)、配备螺丝(mm)、刀尖圆角半径、精度等级、硬度(°)、适用范围、图片、创建人、创建时间 + brand = fields.Many2one('mrs.machine.brand', '品牌', required=True) + c_diameter = fields.Float('C柄径(mm)', required=True) + total_length = fields.Float('L总长(mm)', required=True) + material_model = fields.Many2one('mrs.production.materials', '材料型号', required=True) + blade_number = fields.Integer('刃数', required=True) + d_diameter = fields.Float('D刃径(mm)', required=True) + blade = fields.Many2many('mrs.blade', string='适用刀片型号') + wrench = fields.Float('配对扳手(mm)', required=True) + screw = fields.Float('配备螺丝(mm)', required=True) + radius = fields.Float('刀尖圆角半径', required=True) + accuracy = fields.Char('精度等级', required=True) + hardness = fields.Char('硬度(°)', required=True) + scope = fields.Char('适用范围', required=True) + image = fields.Binary('图片') + + +# 刀杆类型 +class CutterBarModel(models.Model): + _name = 'mrs.cutter.bar.model' + _description = '刀杆类型' + + code = fields.Char('编码') + name = fields.Char('名称', required=True) + remark = fields.Text('备注') + + +# 刀盘 +class CutterPad(models.Model): + _name = 'mrs.cutter.pad' + _description = '刀盘' + + code = fields.Char('编码') + name = fields.Char('型号名称', required=True) + # 刀盘类型字段,关联刀盘类型对象 + cutter_pad_model_number = fields.Many2one('mrs.cutter.pad.model', '刀盘类型', required=True) + # 增加品牌、C柄径(mm)、L总长(mm)、材料型号、刃数、D刃径(mm)、适用刀片型号、配对扳手(mm)、配备螺丝(mm)、刀尖圆角半径、精度等级、硬度(°)、适用范围、图片、创建人、创建时间 + brand = fields.Many2one('mrs.machine.brand', '品牌', required=True) + c_diameter = fields.Float('C柄径(mm)', required=True) + total_length = fields.Float('L总长(mm)', required=True) + material_model = fields.Many2one('mrs.production.materials', '材料型号', required=True) + blade_number = fields.Integer('刃数', required=True) + d_diameter = fields.Float('D刃径(mm)', required=True) + blade = fields.Many2many('mrs.blade', string='适用刀片型号') + wrench = fields.Float('配对扳手(mm)', required=True) + screw = fields.Float('配备螺丝(mm)', required=True) + radius = fields.Float('刀尖圆角半径', required=True) + accuracy = fields.Char('精度等级', required=True) + hardness = fields.Char('硬度(°)', required=True) + scope = fields.Char('适用范围', required=True) + image = fields.Binary('图片') + + +# 刀盘类型 +class CutterPadModel(models.Model): + _name = 'mrs.cutter.pad.model' + _description = '刀盘类型' + + code = fields.Char('编码') + name = fields.Char('名称', required=True) + remark = fields.Text('备注') + + +# 刀柄 +class Handle(models.Model): + _name = 'mrs.handle' + _description = '刀柄' + + code = fields.Char('编码') + name = fields.Char('型号名称', required=True) + # 刀柄类型字段,关联刀柄类型对象 + handle_model_number = fields.Many2one('mrs.handle.model', '刀柄类型', required=True) + # 增加、刀柄类型、品牌、L(mm)、L1(mm)、D1(mm)、重量(kg)、材料型号、本体精度(mm)、配对螺母(mm)、适用夹头型号、夹持范围(mm)、检测精度、检测硬度、标准转速、图片、创建人、创建时间 + brand = fields.Many2one('mrs.machine.brand', '品牌', required=True) + length = fields.Float('L(mm)', required=True) + length1 = fields.Float('L1(mm)', required=True) + diameter1 = fields.Float('D1(mm)', required=True) + weight = fields.Float('重量(kg)', required=True) + material_model = fields.Many2one('mrs.production.materials', '材料型号', required=True) + body_accuracy = fields.Float('本体精度(mm)', required=True) + nut = fields.Float('配对螺母(mm)', required=True) + chuck_model = fields.Many2many('mrs.chuck.model', string='适用夹头型号', required=True) + clamping_range = fields.Float('夹持范围(mm)', required=True) + detection_accuracy = fields.Float('检测精度', required=True) + detection_hardness = fields.Char('检测硬度', required=True) + standard_speed = fields.Float('标准转速', required=True) + image = fields.Binary('图片') + + +# 刀柄类型 +class HandleModel(models.Model): + _name = 'mrs.handle.model' + _description = '刀柄类型' + + code = fields.Char('编码') + name = fields.Char('名称', required=True) + remark = fields.Text('备注') + + +# 夹头对象(夹头型号对象) +class Chuck(models.Model): + _name = 'mrs.chuck' + _description = '夹头' + + code = fields.Char('编码') + name = fields.Char('型号名称', required=True) + # 夹头类型字段,关联夹头类型对象 + chuck_model_number = fields.Many2one('mrs.chuck.model', '夹头类型', required=True) + # 增加品牌、精度(mm)、外径(mm)、内径(mm)、高度(mm)、材料型号、配对螺母(mm)、适用刀柄型号、夹持范围(mm)、特性、图片、创建人、创建时间 + brand = fields.Many2one('mrs.machine.brand', '品牌', required=True) + accuracy = fields.Float('精度(mm)', required=True) + diameter = fields.Float('外径(mm)', required=True) + inner_diameter = fields.Float('内径(mm)', required=True) + height = fields.Float('高度(mm)', required=True) + material_model = fields.Many2one('mrs.production.materials', '材料型号', required=True) + nut = fields.Float('配对螺母(mm)', required=True) + handle_model = fields.Many2many('mrs.handle.model', string='适用刀柄型号', required=True) + clamping_range = fields.Float('夹持范围(mm)', required=True) + feature = fields.Char('特性', required=True) + image = fields.Binary('图片') + + +# 夹头类型 +class ChuckModel(models.Model): + _name = 'mrs.chuck.model' + _description = '夹头类型' + + code = fields.Char('编码') + name = fields.Char('名称', required=True) + remark = fields.Text('备注') + diff --git a/sf_base/security/ir.model.access.csv b/sf_base/security/ir.model.access.csv index 7c13d58d..6798bfd5 100644 --- a/sf_base/security/ir.model.access.csv +++ b/sf_base/security/ir.model.access.csv @@ -15,7 +15,7 @@ access_sf_tray,sf_tray,model_sf_tray,base.group_user,1,1,1,1 access_sf_supplier_sort,sf_supplier_sort,model_sf_supplier_sort,base.group_user,1,1,1,1 access_sf_production_process_parameter,sf_production_process_parameter,model_sf_production_process_parameter,base.group_user,1,1,1,1 access_sf_production_process_category,sf_production_process_category,model_sf_production_process_category,base.group_user,1,1,1,1 - +access_sf_machine_tool_category,sf_machine_tool_category,model_sf_machine_tool_category,base.group_user,1,1,1,1 diff --git a/sf_base/views/base_view.xml b/sf_base/views/base_view.xml index 6dffe5e0..7aa192c1 100644 --- a/sf_base/views/base_view.xml +++ b/sf_base/views/base_view.xml @@ -91,66 +91,88 @@ + - + form.sf.machine_tool.type sf.machine_tool.type
- - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - -
@@ -169,6 +191,70 @@
+ #------------------机床类型------------------ + + + search.sf.machine_tool.category + sf.machine_tool.category + + + + + + + + + tree.sf.machine_tool.category + sf.machine_tool.category + + + + + + + + + + + + form.sf.machine_tool.category + sf.machine_tool.category + +
+ + + + + + + + + + + + + + + + +
+
+
+ + + 机床类型 + ir.actions.act_window + sf.machine_tool.category + tree,form + +

+ [机床型号] 还没有哦!点左上角的[创建]按钮,沙发归你了! +

+

+

+
+
#------------------刀具型号------------------ diff --git a/sf_base/views/menu_view.xml b/sf_base/views/menu_view.xml index cb02aca2..e011a29d 100644 --- a/sf_base/views/menu_view.xml +++ b/sf_base/views/menu_view.xml @@ -120,6 +120,12 @@ name="机床型号" sequence="1" action="action_sf_machine_tool_type"/> + + + + + + 整体式刀具型号 + ir.actions.act_window + mrs.integral.cutting.tool + + tree,form + + + + 功能刀具型号 + ir.actions.act_window + mrs.functional.cutting.tool + tree,form + + + + 刀片型号 + ir.actions.act_window + mrs.blade + tree,form + + + + 刀杆型号 + ir.actions.act_window + mrs.cutter.bar + tree,form + + + + 刀盘型号 + ir.actions.act_window + mrs.cutter.pad + tree,form + + + + 刀柄型号 + ir.actions.act_window + mrs.handle + tree,form + + + + 夹头型号 + ir.actions.act_window + mrs.chuck + tree,form + + + + 功能刀具类型 + ir.actions.act_window + mrs.functional.cutting.tool.model + tree,form + + + + 整体式刀具类型 + ir.actions.act_window + mrs.integral.cutting.tool.model + tree,form + + + + 刀片类型 + ir.actions.act_window + mrs.blade.model + tree,form + + + + 刀杆类型 + ir.actions.act_window + mrs.cutter.bar.model + tree,form + + + + 刀盘类型 + ir.actions.act_window + mrs.cutter.pad.model + tree,form + + + + 刀柄类型 + ir.actions.act_window + mrs.handle.model + tree,form + + + + 夹头类型 + ir.actions.act_window + mrs.chuck.model + tree,form + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sf_base/views/tool_base_views.xml b/sf_base/views/tool_base_views.xml new file mode 100644 index 00000000..ea091428 --- /dev/null +++ b/sf_base/views/tool_base_views.xml @@ -0,0 +1,695 @@ + + + + + + mrs.functional.cutting.tool.tree + mrs.functional.cutting.tool + + + + + + + + + + + + + mrs.functional.cutting.tool.form + mrs.functional.cutting.tool + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + mrs.integral.cutting.tool.tree + mrs.integral.cutting.tool + + + + + + + + + + + + + + + mrs.integral.cutting.tool.form + mrs.integral.cutting.tool + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + mrs.blade.tree + mrs.blade + + + + + + + + + + + + + mrs.blade.form + mrs.blade + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + mrs.cutter.bar.tree + mrs.cutter.bar + + + + + + + + + + + + + mrs.cutter.bar.form + mrs.cutter.bar + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + mrs.cutter.pad.tree + mrs.cutter.pad + + + + + + + + + + + + + mrs.cutter.pad.form + mrs.cutter.pad + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + mrs.cutter.handle.tree + mrs.handle + + + + + + + + + + + + + mrs.cutter.handle.form + mrs.handle + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + mrs.cutter.chuck.tree + mrs.chuck + + + + + + + + + + + + + mrs.cutter.chuck.form + mrs.chuck + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + mrs.cutter.function.tree + mrs.functional.cutting.tool.model + + + + + + + + + + + + mrs.cutter.function.form + mrs.functional.cutting.tool.model + +
+ + + + + + + + + + + +
+
+
+ + + mrs.integral.cutting.tool.model.tree + mrs.integral.cutting.tool.model + + + + + + + + + + + + mrs.integral.cutting.tool.model.form + mrs.integral.cutting.tool.model + +
+ + + + + + + + + + + +
+
+
+ + + mrs.blade.model.tree + mrs.blade.model + + + + + + + + + + + + mrs.blade.model.form + mrs.blade.model + +
+ + + + + + + + + + + + +
+
+
+ + + mrs.cutter.bar.model.tree + mrs.cutter.bar.model + + + + + + + + + + + + mrs.cutter.bar.model.form + mrs.cutter.bar.model + +
+ + + + + + + + + + + +
+
+
+ + + mrs.cutter.pad.model.tree + mrs.cutter.pad.model + + + + + + + + + + + + mrs.cutter.pad.model.form + mrs.cutter.pad.model + +
+ + + + + + + + + + + +
+
+
+ + + + mrs.handle.model.tree + mrs.handle.model + + + + + + + + + + + + mrs.handle.model.form + mrs.handle.model + +
+ + + + + + + + + + + +
+
+
+ + + mrs.chuck.model.tree + mrs.chuck.model + + + + + + + + + + + + mrs.chuck.model.form + mrs.chuck.model + +
+ + + + + + + + + + + +
+
+
+ + +
+
diff --git a/sf_dlm/__init__.py b/sf_dlm/__init__.py index 0650744f..737b4772 100644 --- a/sf_dlm/__init__.py +++ b/sf_dlm/__init__.py @@ -1 +1 @@ -from . import models +# from . import models diff --git a/sf_dlm/__manifest__.py b/sf_dlm/__manifest__.py index ba5e706b..ae978ecf 100644 --- a/sf_dlm/__manifest__.py +++ b/sf_dlm/__manifest__.py @@ -15,8 +15,8 @@ 'data': [ 'data/product_data.xml', 'data/uom_data.xml', - 'views/product_template_view.xml', - 'views/product_workorder.xml' + # 'views/product_template_view.xml', + # 'views/product_workorder.xml' ], 'demo': [ ], diff --git a/sf_mrs_connect/data/ir_cron_data.xml b/sf_mrs_connect/data/ir_cron_data.xml index 8f3a6e93..9efe1537 100644 --- a/sf_mrs_connect/data/ir_cron_data.xml +++ b/sf_mrs_connect/data/ir_cron_data.xml @@ -142,4 +142,15 @@ -1
+ + + 同步资源库机床型号 + + code + model.sync_machine_tool_category() + 1 + days + -1 + + \ No newline at end of file diff --git a/sf_mrs_connect/models/res_config_setting.py b/sf_mrs_connect/models/res_config_setting.py index 774fcc4e..b657c5a1 100644 --- a/sf_mrs_connect/models/res_config_setting.py +++ b/sf_mrs_connect/models/res_config_setting.py @@ -38,6 +38,8 @@ class ResConfigSettings(models.TransientModel): _logger.info("同步资源库控制系统") self.env['sf.machine_tool.type'].sync_all_machine_tool_type() _logger.info("同步资源库机床型号") + self.env['sf.machine_tool.category'].sync_all_machine_tool_category() + _logger.info("同步资源库机床类型") self.env['sf.cutting_tool.category'].sync_all_cutting_tool_category() _logger.info("同步资源库刀具类别") self.env['sf.cutting_tool.type'].sync_all_cutting_tool_type() diff --git a/sf_mrs_connect/models/sync_common.py b/sf_mrs_connect/models/sync_common.py index 21f75741..edd7e394 100644 --- a/sf_mrs_connect/models/sync_common.py +++ b/sf_mrs_connect/models/sync_common.py @@ -567,121 +567,6 @@ class MachineBrand(models.Model): raise ValidationError("认证未通过") -class MachineTool(models.Model): - _inherit = 'sf.machine_tool' - _description = '机床' - url = '/api/machine_tool/list' - crea_url = '/api/machine_tool/create' - - # 定时同步机床 - def sync_machine_tool(self): - sf_sync_config = self.env['res.config.settings'].get_values() - token = sf_sync_config['token'] - sf_secret_key = sf_sync_config['sf_secret_key'] - headers = Common.get_headers(self, token, sf_secret_key) - - strUrl = sf_sync_config['sf_url'] + self.url - r = requests.post(strUrl, json={}, data=None, headers=headers) - r = r.json() - result = json.loads(r['result']) - if result['status'] == 1: - for item in result['machine_tool_all_yesterday_list']: - brand = self.env['sf.machine_tool'].search( - [("code", '=', item['code'])]) - if brand: - brand.id = item['id'], - brand.name = item['name'], - brand.code = item['code'], - brand.precision = item['precision'], - - brand.knife_type = item['knife_type'], - brand.registration_date = item['registration_date'], - brand.number_of_knife_library = item['number_of_knife_library'], - brand.rotate_speed = item['rotate_speed'], - brand.number_of_axles = item['number_of_axles'], - # brand.control_system_id = item['control_system_id'], - brand.type_id = item['type_id'], - brand.brand_id = item['brand_id'], - brand.x_axis = item['x_axis'], - brand.y_axis = item['y_axis'], - brand.z_axis = item['z_axis'], - brand.b_axis = item['b_axis'], - brand.c_axis = item['c_axis'], - brand.state = item['state'], - brand.active = item['active'] - - else: - self.env['sf.machine_tool'].create({ - "id": item['id'], - "name": item['name'], - "precision": item['precision'], - "code": item['code'], - "status": item['status'], - "knife_type": item['knife_type'], - "registration_date": item['registration_date'], - "number_of_knife_library": item['number_of_knife_library'], - "rotate_speed": item['rotate_speed'], - "number_of_axles": item['number_of_axles'], - # "control_system_id": item['control_system_id'], - "type_id": item['type_id'], - "brand_id": item['brand_id'], - "x_axis": item['x_axis'], - "y_axis": item['y_axis'], - "z_axis": item['z_axis'], - "b_axis": item['b_axis'], - "c_axis": item['c_axis'], - "state": item['state'], - "active": item['active'], - # "tag_ids": item['tag_ids'] - - }) - else: - raise ValidationError("认证未通过") - - # 同步所有机床 - def sync_all_machine_tool(self): - sf_sync_config = self.env['res.config.settings'].get_values() - token = sf_sync_config['token'] - sf_secret_key = sf_sync_config['sf_secret_key'] - headers = Common.get_headers(self, token, sf_secret_key) - - strUrl = sf_sync_config['sf_url'] + self.url - r = requests.post(strUrl, json={}, data=None, headers=headers) - r = r.json() - result = json.loads(r['result']) - if result['status'] == 1: - for item in result['machine_tool_all_list']: - brand = self.env['sf.machine_tool'].search( - [("code", '=', item['code'])]) - if not brand: - self.env['sf.machine_tool'].create({ - - "id": item['id'], - "name": item['name'], - "precision": item['precision'], - "code": item['code'], - "status": item['status'], - "knife_type": item['knife_type'], - "registration_date": item['registration_date'], - "number_of_knife_library": item['number_of_knife_library'], - "rotate_speed": item['rotate_speed'], - "number_of_axles": item['number_of_axles'], - # "control_system_id": item['control_system_id'], - "type_id": item['type_id'], - 'brand_id': self.env['sf.machine.brand'].search([('code', '=', item['brand_id'])]).id, - "x_axis": item['x_axis'], - "y_axis": item['y_axis'], - "z_axis": item['z_axis'], - "b_axis": item['b_axis'], - "c_axis": item['c_axis'], - "state": item['state'], - "active": item['active'], - # "tag_ids": item['tag_ids'] - - }) - else: - raise ValidationError("认证未通过") - class MachineToolType(models.Model): _inherit = 'sf.machine_tool.type' @@ -726,6 +611,7 @@ class MachineToolType(models.Model): [('code', '=', item['machine_tool_id'])]).id else: + print(item['machine_tool_picture'].encode('utf-8')) self.env['sf.machine_tool.type'].create({ "id": item['id'], "name": item['name'], @@ -747,6 +633,28 @@ class MachineToolType(models.Model): [('code', '=', item['control_system_id'])]).id, "active": item['active'], 'brand_id': self.env['sf.machine.brand'].search([('code', '=', item['brand_id'])]).id, + 'machine_tool_picture' : item['machine_tool_picture'].encode('utf-8'), + "heightened_way": item['heightened_way'], + "workpiece_load": item['workpiece_load'], + "lead_screw": item['lead_screw'], + "workbench_L": item['workbench_L'], + "workbench_W": item['workbench_W'], + "guide_rail": item['guide_rail'], + "machine_tool_L": item['machine_tool_L'], + "machine_tool_W": item['machine_tool_W'], + "machine_tool_H": item['machine_tool_H'], + "feed_speed": item['feed_speed'], + "tool_speed": item['tool_speed'], + "distance": item['distance'], + "taper": item['taper'], + "torque": item['torque'], + "motor_power": item['motor_power'], + "tool_quality_max": item['tool_quality_max'], + "tool_long_max": item['tool_long_max'], + "tool_diameter_max": item['tool_diameter_max'], + "machine_tool_category": self.env['sf.machine_tool.category'].search( + [('code', '=', item['machine_tool_category'])]).id, + }) else: @@ -772,6 +680,7 @@ class MachineToolType(models.Model): "id": item['id'], "name": item['name'], "code": item['code'], + "number_of_knife_library": item['number_of_knife_library'], "rotate_speed": item['rotate_speed'], 'machine_tool_id': self.env['sf.machine_tool'].search( @@ -788,6 +697,27 @@ class MachineToolType(models.Model): [('code', '=', item['control_system_id'])]).id, "active": item['active'], 'brand_id': self.env['sf.machine.brand'].search([('code', '=', item['brand_id'])]).id, + 'machine_tool_picture':base64.b64decode( item['machine_tool_picture']), + "heightened_way": item['heightened_way'], + "workpiece_load": item['workpiece_load'], + "lead_screw": item['lead_screw'], + "workbench_L": item['workbench_L'], + "workbench_W": item['workbench_W'], + "guide_rail": item['guide_rail'], + "machine_tool_L": item['machine_tool_L'], + "machine_tool_W": item['machine_tool_W'], + "machine_tool_H": item['machine_tool_H'], + "feed_speed": item['feed_speed'], + "tool_speed": item['tool_speed'], + "distance": item['distance'], + "taper": item['taper'], + "torque": item['torque'], + "motor_power": item['motor_power'], + "tool_quality_max": item['tool_quality_max'], + "tool_long_max": item['tool_long_max'], + "tool_diameter_max": item['tool_diameter_max'], + "machine_tool_category": self.env['sf.machine_tool.category'].search( + [('code', '=', item['machine_tool_category'])]).id, }) else: @@ -1086,3 +1016,63 @@ class sfProductionProcessParameter(models.Model): }) else: raise ValidationError("认证未通过") + +class MachineToolCategory(models.Model): + _inherit = 'sf.machine_tool.category' + _description = '机床类型' + url = '/api/machine_tool_category/list' + + # 定时同步机床类型 + def sync_machine_tool_category(self): + sf_sync_config = self.env['res.config.settings'].get_values() + token = sf_sync_config['token'] + sf_secret_key = sf_sync_config['sf_secret_key'] + headers = Common.get_headers(self, token, sf_secret_key) + strUrl = sf_sync_config['sf_url'] + self.url + r = requests.post(strUrl, json={}, data=None, headers=headers) + r = r.json() + result = json.loads(r['result']) + if result['status'] == 1: + for item in result['machine_tool_category_yesterday_list']: + brand = self.env['sf.machine_tool.category'].search( + [("code", '=', item['code'])]) + if brand: + brand.name = item['name'], + brand.code = item['code'], + brand.category = item['category'], + brand.remark = item['remark'] + + else: + brand.name = item['name'], + brand.code = item['code'], + brand.category = item['category'], + brand.remark = item['remark'] + else: + raise ValidationError("认证未通过") + + # 同步所有机床类型 + def sync_all_machine_tool_category(self): + sf_sync_config = self.env['res.config.settings'].get_values() + token = sf_sync_config['token'] + sf_secret_key = sf_sync_config['sf_secret_key'] + headers = Common.get_headers(self, token, sf_secret_key) + + strUrl = sf_sync_config['sf_url'] + self.url + r = requests.post(strUrl, json={}, data=None, headers=headers) + r = r.json() + result = json.loads(r['result']) + if result['status'] == 1: + for item in result['machine_tool_category_all_list']: + brand = self.env['sf.machine_tool.category'].search( + [("code", '=', item['code'])]) + if not brand: + self.env['sf.machine_tool.category'].create({ + "name": item['name'], + "code": item['code'], + "category": item['category'], + "remark": item['remark'], + + }) + else: + raise ValidationError("认证未通过") + diff --git a/sf_mrs_connect/views/res_config_settings_views.xml b/sf_mrs_connect/views/res_config_settings_views.xml index 7bc7f2ad..e8d81453 100644 --- a/sf_mrs_connect/views/res_config_settings_views.xml +++ b/sf_mrs_connect/views/res_config_settings_views.xml @@ -26,7 +26,7 @@
-
diff --git a/sf_wxwork_approval/models/__init__.py b/sf_wxwork_approval/models/__init__.py index c97e010b..795635d9 100644 --- a/sf_wxwork_approval/models/__init__.py +++ b/sf_wxwork_approval/models/__init__.py @@ -5,5 +5,7 @@ from . import wxwork_approval_template_controls from . import wxwork_settings from . import wxwork_approval_template_summary from . import we_approval_record +from . import wx_work_api + from . import wxwork_approval # from . import res_config_setting diff --git a/sf_wxwork_approval/models/wx_work_api.py b/sf_wxwork_approval/models/wx_work_api.py index eb1b4130..c07c2a3f 100644 --- a/sf_wxwork_approval/models/wx_work_api.py +++ b/sf_wxwork_approval/models/wx_work_api.py @@ -19,6 +19,17 @@ class WxWorkAPI: else: raise Exception(f"获取AccessToken失败: {result}") + def get_template_detail(self, template_data): + url = f"https://qyapi.weixin.qq.com/cgi-bin/oa/gettemplatedetail?access_token={self.access_token}" + headers = {'Content-Type': 'application/json'} + response = requests.post(url, json=template_data, headers=headers) + result = response.json() + if result['errcode'] == 0: + # print(result) + return result + else: + raise Exception(f"获取模板详情请求失败: {result}") + def create_approval_request(self, approval_data): url = f"https://qyapi.weixin.qq.com/cgi-bin/oa/applyevent?access_token={self.access_token}" headers = {'Content-Type': 'application/json'} @@ -60,89 +71,89 @@ class WxWorkAPI: return result['media_id'] -template_id_dict = {"test": "ZvmJBAt7U2iUju9JLePxfkfuN22meQMVTAHymA"} -creator_userid = "MaGuangWei" -corid = 'wweaf7f1caab27a136' -secret = 'L6z-kjrUBOWfhBiLOmX_fNSY3jydDkLUNNWnemafn00' -wx = WxWorkAPI(corid, secret) -media_id = wx.upload_temp_file() -print(media_id) -# access = wx.get_access_token() -approval_datas = { - "creator_userid": creator_userid, - "template_id": template_id_dict['test'], - "use_template_approver": 0, - # "choose_department": 2, - "approver": [ - { - "attr": 2, - "userid": ["MaGuangWei", "YangJinLing"] - }, - { - "attr": 1, - "userid": ["MaGuangWei"] - } - ], - "notifyer": ["MaGuangWei", "PengYuBo"], - # "notifyer": ["MaGuangWei"], - "notify_type": 1, - "apply_data": { - "contents": [ - # 申请事项 - { - "control": "Text", - "id": "Text-1640339319582", - "value": { - "text": "测试测试测试测试测试" - } - }, - # 申请内容 - { - "control": "Textarea", - "id": "Textarea-1640339335659", - "value": { - "text": "odoo>>>企业微信审批" - } - }, - # 附件 - { - "control": "File", - "id": "File-1640339381728", - "value": { - "files": [ - { - "file_id": media_id - } - ] - } - - }, - - ] - }, - "summary_list": [ - { - "summary_info": [{ - "text": "测试附件上传", - "lang": "zh_CN" - }] - }, - # { - # "summary_info": [{ - # "text": "摘要第2行", - # "lang": "zh_CN" - # }] - # }, - # { - # "summary_info": [{ - # "text": "摘要第3行", - # "lang": "zh_CN" - # }] - # } - ] -} -wx.create_approval_request(approval_datas) -print('创建成功') +# template_id_dict = {"test": "ZvmJBAt7U2iUju9JLePxfkfuN22meQMVTAHymA"} +# creator_userid = "MaGuangWei" +# corid = 'wweaf7f1caab27a136' +# secret = 'L6z-kjrUBOWfhBiLOmX_fNSY3jydDkLUNNWnemafn00' +# wx = WxWorkAPI(corid, secret) +# media_id = wx.upload_temp_file() +# print(media_id) +# # access = wx.get_access_token() +# approval_datas = { +# "creator_userid": creator_userid, +# "template_id": template_id_dict['test'], +# "use_template_approver": 0, +# # "choose_department": 2, +# "approver": [ +# { +# "attr": 2, +# "userid": ["MaGuangWei", "YangJinLing"] +# }, +# { +# "attr": 1, +# "userid": ["MaGuangWei"] +# } +# ], +# "notifyer": ["MaGuangWei", "PengYuBo"], +# # "notifyer": ["MaGuangWei"], +# "notify_type": 1, +# "apply_data": { +# "contents": [ +# # 申请事项 +# { +# "control": "Text", +# "id": "Text-1640339319582", +# "value": { +# "text": "测试测试测试测试测试" +# } +# }, +# # 申请内容 +# { +# "control": "Textarea", +# "id": "Textarea-1640339335659", +# "value": { +# "text": "odoo>>>企业微信审批" +# } +# }, +# # 附件 +# { +# "control": "File", +# "id": "File-1640339381728", +# "value": { +# "files": [ +# { +# "file_id": media_id +# } +# ] +# } +# +# }, +# +# ] +# }, +# "summary_list": [ +# { +# "summary_info": [{ +# "text": "测试附件上传", +# "lang": "zh_CN" +# }] +# }, +# # { +# # "summary_info": [{ +# # "text": "摘要第2行", +# # "lang": "zh_CN" +# # }] +# # }, +# # { +# # "summary_info": [{ +# # "text": "摘要第3行", +# # "lang": "zh_CN" +# # }] +# # } +# ] +# } +# wx.create_approval_request(approval_datas) +# print('创建成功') aa = {"errcode": 0, "errmsg": "ok", "template_names": [{"text": "对接开发测试", "lang": "zh_CN"}], "template_content": { "controls": [{"property": {"control": "Text", "id": "Text-1640339319582", diff --git a/sf_wxwork_approval/models/wxwork_approval_template.py b/sf_wxwork_approval/models/wxwork_approval_template.py index f60663c0..2757188b 100644 --- a/sf_wxwork_approval/models/wxwork_approval_template.py +++ b/sf_wxwork_approval/models/wxwork_approval_template.py @@ -14,12 +14,15 @@ class WxWorkApprovalTemplate(models.Model): name = fields.Char(string='模板名称') # content_ids = fields.Many2many('wxwork.approval.template.controls', string='模板内容') content_ids = fields.One2many('wxwork.approval.template.controls', 'template_id', string='模板内容') + # 增加一个与wxwork.approval.vacation.config的关联字段 + vacation_config_id = fields.One2many('wxwork.approval.vacation.config', 'template_id', string='控件配置') + company_id = fields.Many2one('res.company', '公司', default=lambda self: self.env.user.company_id.id) creator_userid = fields.Many2one('res.users', '创建者', default=lambda self: self.env.user.id) use_template_approver = fields.Selection([ ('0', '自选审批人'), ('1', '预设审批人') - ], string='审批人模式', default='0') + ], string='审批人模式', default='1') choose_department = fields.Char(string='提单部门') approver = fields.One2many('wxwork.approval.approver_line', 'main_id', string='审批流程') notifyer = fields.Many2many('res.users', string='抄送人userid列表') diff --git a/sf_wxwork_approval/models/wxwork_approval_template_controls.py b/sf_wxwork_approval/models/wxwork_approval_template_controls.py index cc5e4273..bfdc5873 100644 --- a/sf_wxwork_approval/models/wxwork_approval_template_controls.py +++ b/sf_wxwork_approval/models/wxwork_approval_template_controls.py @@ -6,97 +6,196 @@ from odoo.exceptions import UserError _logger = logging.getLogger(__name__) +# 控件模型 class WxWorkApprovalTemplate(models.Model): _name = 'wxwork.approval.template.controls' _description = "企业微信审批模板控件" + + template_id = fields.Many2one('wxwork.approval.template', string='模板') + property_id = fields.One2many('property.model', 'control_id', string='控件属性') + config_id = fields.One2many('config.model', 'control_id', string='控件配置') + + +# 控件属性模型 +class PropertyModel(models.Model): + _name = 'property.model' _rec_name = "title" - SELECTION_RELATION = { - '申请事项': {'id': 'Text-1640339319582', 'control': 'Text', 'value': '{"text": "文本填写的内容"}'}, - '申请内容': {'id': 'Textarea-1640339335659', 'control': 'Textarea', 'value': '{"text": "文本填写的内容"}'}, - '多行文本': {'id': 'Textarea-1684823453770', 'control': 'Textarea', 'value': '{"text": "文本填写的内容"}'}, - '金额': {'id': 'Money-1684823460232', 'control': 'Money', 'value': '{"new_money": "0"}'}, - '部门': {'id': 'Contact-1684823477216', 'control': 'Contact', - 'value': '{"departments":[{"openapi_id":"2","name":"销售部"},{"openapi_id":"3","name":"生产部"}]}'}, - '成员': {'id': 'Contact-1684823465317', 'control': 'Contact', - 'value': '{"members":[{"userid":"WuJunJie","name":"Jackie"},{"userid":"WangXiaoMing","name":"Tom"}]}'}, - '明细': {'id': 'Table-1684823492261', 'control': 'Table', - 'value': '{"children":[{"list":[' - '{"control":"Text","id":"Text-15111111111","title":' - '[{"text":"明细内文本控件","lang":"zh_CN"}],"value":{"text":"明细文本1"}},' - '{"control":"Money","id":"Text-15111111112","title":[{"text":"明细内金额控件","lang":"zh_CN"}],' - '"value":{"new_money":"700"}}]},' - '{"list":[{"control":"Text","id":"Text-15111111111",' - '"title":[{"text":"明细内文本控件","lang":"zh_CN"}],"value":{"text":"明细文本2"}},' - '{"control":"Money","id":"Text-15111111112","title":[{"text":"明细内金额控件","lang":"zh_CN"}],' - '"value":{"new_money":"900"}}]}]}'}, - '关联申请单': {'id': 'RelatedApproval-1684823485883', 'control': 'RelatedApproval', - 'value': '{"related_approval":[{"sp_no":"202011180001"}]}'}, - '附件': {'id': 'File-1640339381728', 'control': 'File', - 'value': '{"files":[{"file_id":"1G6nrLmr5EC3MMb_-zK1dDdzmd0p7cNliYu9V5w7o8K1aaa"}]}'}, - '数字': {'id': 'File-1640339381728', 'control': 'Number', 'value': '{"new_number": "700"}'}, - '日期/日期+时间': {'id': 'File-1640339381728', 'control': 'Date', - 'value': '{"date": {"type": "day","s_timestamp": "1569859200"}}'}, - '单选/多选': {'id': 'File-1640339381728', 'control': 'Selector', - 'value': '{"selector": ' - '{"type": "multi","options": [{"key": "option-15111111111"},{"key": "option-15222222222"}]}}' - }, - '说明文字': {'id': 'File-1640339381728', 'control': 'Tips'}, - '位置': {'id': 'File-1640339381728', 'control': 'Location', - 'value': '{"location":{"latitude":"30.547239","longitude":"104.063291",' - '"title":"腾讯科技(成都)有限公司(腾讯成都大厦)",' - '"address":"四川省成都市武侯区天府三街198号腾讯成都大厦A座","time":1605690460}}'}, - '公式': {'id': 'File-1640339381728', 'control': 'Formula', 'value': '{"formula":{"value":"5.0"}}'}, - '时长': {'id': 'File-1640339381728', 'control': 'DateRange', - 'value': '{"date_range":{"new_begin":1570550400,"new_end":1570593600,"new_duration":86400}}'}, - '请假组件': {'id': 'File-1640339381728', 'control': 'Vacation', - 'value': '{"vacation":{"selector":{"type":"single","options":[{"key":"3",' - '"value":[{"text":"病假","lang":"zh_CN"}]}],"exp_type":0},' - '"attendance":{"date_range":{"type":"hour","new_begin":1568077200,' - '"new_end":1568368800,"new_duration":291600},"type":1}}}'}, - '出差/外出/加班组件': {'id': 'File-1640339381728', 'control': 'Attendance', - 'value': '{"attendance":{"date_range":{"type":"halfday","new_begin":1570550400,' - '"new_end":1570593600,"new_duration":86400},"type":4}}'}, - - } - - title = fields.Selection( - selection=[(key, key) for key in SELECTION_RELATION.keys()], - string='控件名称', - ) - template_id = fields.Many2one('wxwork.approval.template', string='模板名称') - control_id = fields.Char(string='控件ID') - control = fields.Char(string='控件类型') - value = fields.Char(string='内容') - - placeholder = fields.Char(string='占位符') - require = fields.Boolean(string='必填', compute='_compute_require') - un_print = fields.Boolean(string='不打印') + CONTROL_TYPE_SELECTION = [ + ('Text', '文本'), + ('Textarea', '多行文本'), + ('Number', '数字'), + ('Money', '金额'), + ('Date', '日期/日期+时间'), + ('Selector', '单选/多选'), + ('Contact', '成员/部门'), + ('Tips', '说明文字'), + ('File', '附件'), + ('Table', '明细'), + ('Attendance', '假勤控件'), + ('Vacation', '请假控件'), + ('Location', '位置'), + ('RelatedApproval', '关联审批单'), + ('Formula', '公式'), + ('DateRange', '时长') + ] + control_type = fields.Selection(CONTROL_TYPE_SELECTION, string='控件类型') + control_id = fields.Many2one('wxwork.approval.template.controls', string='控件') + unique_control_id = fields.Char(string='控件ID') + title = fields.Char(string='控件名称', translate=True) + placeholder = fields.Char(string='控件说明', translate=True) + require = fields.Boolean(string='是否必填') + un_print = fields.Boolean(string='是否参与打印') un_replace = fields.Boolean(string='不替换') - display = fields.Boolean(string='显示', compute='_compute_display') + display = fields.Boolean(string='显示') + child_control_id = fields.Many2one('wxwork.approval.table.config', string='明细子控件') - @api.onchange('title') - def _onchange_title(self): - if self.title: - related_values = WxWorkApprovalTemplate.SELECTION_RELATION[self.title] - self.control_id = related_values['id'] - self.control = related_values['control'] - # 特殊处理:对于"说明文字",将"value"设置为空字符串 - if self.control == 'Tips': - self.value = '' - else: - self.value = related_values['value'] +# 控件配置模型 +class ConfigModel(models.Model): + _name = 'config.model' - @api.depends('title') - def _compute_require(self): - for record in self: - record.require = record.title in ['申请事项', '申请内容'] + control_id = fields.Many2one('wxwork.approval.template.controls', string='控件') + # # 在此添加其他字段以存储不同控件类型的附加类型和属性 + # date_type = fields.Selection([('day', '日期'), ('hour', '日期+时间')], string='日期类型') + # + # selector_type = fields.Selection([('single', '单选'), ('multi', '多选')], string='选择器类型') + # options = fields.One2many('config.option', 'config_id', string='选项') + # + # contact_type = fields.Selection( + # [('single', '单选'), ('multi', '多选')], + # string='联系人类型') + # contact_mode = fields.Selection( + # [('user', '成员'), ('department', '部门')], + # string='联系人模式') + # + # # table_children = fields.One2many('config.child', 'config_id', string='明细子控件') + # table_children = fields.One2many('property.model', 'child_control_id', string='明细子控件') + # + # attendance_type = fields.Selection([('1', '请假'), ('3', '出差'), ('4', '外出'), ('5', '加班')], string='假勤组件类型') + # attendance_date_range_type = fields.Selection([('hour', '分钟'), ('halfday', '上午/下午')], string='假勤时间刻度') + # + # vacation_list = fields.One2many('config.option', 'config_id', string='假期类型列表') + # 增加一个wxwork.approval.date.config的关联字段 + date_type = fields.One2many('wxwork.approval.date.config', 'config_id', string='日期控件配置') + # 增加一个与wxwork.approval.selector.config的关联字段 + selector_type = fields.One2many('wxwork.approval.selector.config', 'config_id', string='选择器控件配置') + # 增加一个与wxwork.approval.contact.config的关联字段 + contact_type = fields.One2many('wxwork.approval.contact.config', 'config_id', string='联系人控件配置') + # 增加一个与wxwork.approval.table.config的关联字段 + table_type = fields.One2many('wxwork.approval.table.config', 'config_id', string='明细控件配置') + # 增加一个与wxwork.approval.attendance.config的关联字段 + attendance_type = fields.One2many('wxwork.approval.attendance.config', 'config_id', string='假勤控件配置') + # 增加一个与wxwork.approval.file.config的关联字段 + file_type = fields.One2many('wxwork.approval.file.config', 'config_id', string='附件控件配置') + # 增加一个与wxwork.approval.table.config的Many2one关联字段 + table_child = fields.Many2one('wxwork.approval.table.config', string='明细子控件配置') - @api.depends('title') - def _compute_display(self): - for record in self: - record.display = record.title in ['申请事项', '申请内容'] + +class ConfigOption(models.Model): + _name = 'config.option' + + key = fields.Char(string='选项Key') + text = fields.Char(string='选项Text') + lang = fields.Char(string='语言') + config_id = fields.Many2one('config.model', string='配置') + + +class ConfigChild(models.Model): + _name = 'config.child' + + control = fields.Char(string='控件类型') + control_id = fields.Char(string='控件ID') + # 其他属性... + + +# Date控件config +class DateConfig(models.Model): + _name = 'wxwork.approval.date.config' + + # 增加一个与config.model的关联字段 + config_id = fields.Many2one('config.model', string='控件') + date_type = fields.Selection([('day', '日期'), ('hour', '日期+时间')], string='日期类型') + + +# Selector控件(单选/多选控件)config +class SelectorConfig(models.Model): + _name = 'wxwork.approval.selector.config' + + # 增加一个与config.model的关联字段 + config_id = fields.Many2one('config.model', string='控件') + selector_type = fields.Selection([('single', '单选'), ('multi', '多选')], string='选择器类型') + selector_exp_type = fields.Integer(string='选择器表达式类型', default=0) + options = fields.One2many('selector.option', 'config_id', string='选项') + + +# Selector控件(单选/多选控件)选项 +class SelectorOption(models.Model): + _name = 'selector.option' + + key = fields.Char(string='选项Key') + text = fields.Char(string='选项Text') + lang = fields.Char(string='语言') + config_id = fields.Many2one('wxwork.approval.selector.config', string='配置') + + +# Contact控件(成员/部门控件)config +class ContactConfig(models.Model): + _name = 'wxwork.approval.contact.config' + + # 增加一个与config.model的关联字段 + config_id = fields.Many2one('config.model', string='控件') + contact_type = fields.Selection([('single', '单选'), ('multi', '多选')], string='选择器类型') + contact_mode = fields.Selection([('user', '成员'), ('department', '部门')], string='联系人类型') + + +# Table控件(明细控件)config +class TableConfig(models.Model): + _name = 'wxwork.approval.table.config' + + # 增加一个与config.model的关联字段 + config_id = fields.Many2one('config.model', string='控件') + # table_children = fields.One2many('config.child', 'config_id', string='明细子控件') + table_children = fields.One2many('property.model', 'child_control_id', string='明细属性控件') + # 增加一个与config.model的One2many关联字段 + table_children_config = fields.One2many('config.model', 'table_child', string='明细配置控件') + # stat_field = fields.Many2one('config.model', string='统计字段') + + +# Attendance控件(假勤控件)config +class AttendanceConfig(models.Model): + _name = 'wxwork.approval.attendance.config' + + # 增加一个与config.model的关联字段 + config_id = fields.Many2one('config.model', string='控件') + attendance_type = fields.Selection([('1', '请假'), ('3', '出差'), ('4', '外出'), ('5', '加班')], string='假勤组件类型') + attendance_date_range_type = fields.Selection([('hour', '分钟'), ('halfday', '上午/下午')], string='假勤时间刻度') + + +# Vacation控件(假勤控件)config +class VacationConfig(models.Model): + _name = 'wxwork.approval.vacation.config' + + # 增加一个与wxwork.approval.template的关联字段 + template_id = fields.Many2one('wxwork.approval.template', string='模板') + # control_id = fields.Many2one('wxwork.approval.template.controls', string='控件') + # vacation_list = fields.One2many('config.option', 'config_id', string='假期类型列表') + vacation_id = fields.Integer(string='假期ID') + name = fields.Char(string='假期名称') + lang = fields.Char(string='语言') + +# file控件(文件控件)config +class FileConfig(models.Model): + _name = 'wxwork.approval.file.config' + + # 增加一个与config.model的关联字段 + config_id = fields.Many2one('config.model', string='控件') + # control_id = fields.Many2one('wxwork.approval.template.controls', string='控件') + # vacation_list = fields.One2many('config.option', 'config_id', string='假期类型列表') + # file_id = fields.Integer(string='文件ID') + # name = fields.Char(string='文件名称') + # lang = fields.Char(string= + is_only_photo = fields.Boolean(string='是否只能上传图片') class ApproverLine(models.Model): diff --git a/sf_wxwork_approval/models/wxwork_settings.py b/sf_wxwork_approval/models/wxwork_settings.py index 4e048263..1be0f354 100644 --- a/sf_wxwork_approval/models/wxwork_settings.py +++ b/sf_wxwork_approval/models/wxwork_settings.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- +import json from odoo import api, fields, models +from odoo.addons.sf_wxwork_approval.models import wx_work_api class WxSettings(models.Model): @@ -10,3 +12,422 @@ class WxSettings(models.Model): wx_work_app = fields.Char(string='企业微信应用名称') wx_work_corp_id = fields.Char(string='企业微信CorpID') wx_work_secret = fields.Char(string='企业微信Secret') + wx_work_template_ids = fields.Many2many('wxwork.template.settings', string='审批模板') + + def update_template(self): + template_dict = {} + template_list = [] + print(self.wx_work_template_ids) + for template in self.wx_work_template_ids: + # template_dict[template.sp_name] = template.template_id + template_list.append(template.template_id) + # template_dict = {} + # print(template_list) + wx = wx_work_api.WxWorkAPI(self.wx_work_corp_id, self.wx_work_secret) + # print(wx) + # 获取模型中的所有记录 + all_records = self.env['wxwork.approval.template'].search([]) + all_records1 = self.env['wxwork.approval.template.controls'].search([]) + + # 删除所有记录 + all_records.unlink() + all_records1.unlink() + content_data_list = [] + template_data = {} + controls_data = [] + for template in template_list: + print('====================') + temp_dict = {'template_id': template} + # print(json.dumps(temp_dict)) + # aa = json.dumps(temp_dict) + template_detail = wx.get_template_detail(temp_dict) + print('template_detail%s' % template_detail) + # + # # 准备用于创建记录的字段值 + # values = { + # 'process_code': template, + # 'name': template_detail['template_names'][0]['text'], + # # 如果需要设置content_ids,请按照正确格式添加关联数据 + # } + # # 使用create方法创建记录 + # new_record = self.env['wxwork.approval.template'].create(values) + + # 解析template_detail中的内容数据 + + # print('jjjjjjjj', template_detail['template_content']) + # print('jjjjjjjjjj', template_detail['template_content']['controls']) + for control_data in template_detail['template_content']['controls']: + # print('control_data', control_data) + property_data = control_data['property'] + # print('property_data', property_data) + config_values = {} + + if 'config' in control_data: + config_data = control_data['config'] + print('config_data', config_data) + + # 先提取table_children数据 + table_children_data = config_data.get('table', {}).get('children', []) + + # 创建一个空列表用于存储table_children记录 + table_children_records = [] + + # 遍历table_children_data并为每个子控件创建记录 + for child_data in table_children_data: + print('child_data====================', child_data) + # 提取property相关数据 + child_property_data = { + # 'control_type': child_data.get('property', {}).get('control', None), + # 'unique_control_id': child_data.get('property', {}).get('id', None), + # 'title': child_data.get('property', {}).get('title', [{}])[0].get('text', None), + # 'placeholder': child_data.get('property', {}).get('placeholder', [{}])[0].get('text', None), + # 'require': child_data.get('property', {}).get('require', None), + # 'un_print': child_data.get('property', {}).get('un_print', None), + # 'un_replace': child_data.get('property', {}).get('un_replace', None), + # 'display': child_data.get('property', {}).get('display', None), + 'control_type': child_data.get('property', {}).get('control', None), + 'unique_control_id': child_data.get('property', {}).get('id', None), + 'title': child_data.get('property', {}).get('title', [{}])[0].get('text', None), + 'placeholder': child_data.get('property', {}).get('placeholder', [{}])[0].get('text', None), + 'require': child_data.get('property', {}).get('require', None), + 'un_print': child_data.get('property', {}).get('un_print', None), + 'un_replace': child_data.get('property', {}).get('un_replace', None), + 'display': child_data.get('property', {}).get('display', None), + } + + # 在这里根据控件类型为每个子控件创建相应的config_id数据 + # 例如: + config_id_data = { + 'date_type': [(0, 0, {'date_type': child_data.get('config', {}).get('date', {}).get('type', + None)})] if 'date' in child_data.get( + 'config', {}) else [], + 'selector_type': [(0, 0, { + 'selector_type': 'single', + 'options': [(0, 0, {'key': 'opt1', 'text': '选项1'})], + })] if 'selector' in child_data.get('config', {}) else [], + 'contact_type': [ + (0, 0, {'contact_type': config_data.get('contact', {}).get('type', None), + 'contact_mode': config_data.get('contact', {}).get('mode', + None)})] if 'contact' in child_data.get( + 'config', {}).get('contact', {}) else [], + 'file_type': [ + (0, 0, {'is_only_photo': config_data.get('file', {}).get('is_only_photo', + None)})] if 'file' in child_data.get( + 'config', {}).get('file', {}) else [], + # 'table_type': [(0, 0, { + # 'table_children': [ + # (0, 0, {'control_type': config_data.get('table', {}).get('children', None)[0].get('property', {}).get('control', None), + # 'unique_control_id': config_data.get('table', {}).get('children', None)[0].get('property', {}).get('id', None), + # 'title': config_data.get('table', {}).get('children', None)[0].get('property', {}).get('title', None)[0].get('text', None), + # 'placeholder': config_data.get('table', {}).get('children', None)[0].get('property', {}).get('placeholder', None)[0].get('text', None), + # 'require': config_data.get('table', {}).get('children', None)[0].get('property', {}).get('require', None), + # 'un_print': config_data.get('table', {}).get('children', None)[0].get('property', {}).get('un_print', None), + # 'un_replace': config_data.get('table', {}).get('children', None)[0].get('property', {}).get('un_replace', None), + # 'display': config_data.get('table', {}).get('children', None)[0].get('property', {}).get('display', None), + # })], + # })] if 'table' in config_data else [], + # 'attendance_type': [(0, 0, {'attendance_type': '1', + # 'attendance_date_range_type': 'hour'})] if 'attendance' in config_data else [], + } + + # 将config_id_data添加到property_data中(如果有的话) + if config_id_data: + child_property_data['child_control_id'] = config_id_data + + # 将property_data添加到table_children_records中 + table_children_records.append((0, 0, child_property_data)) + + # 创建一个包含多个wxwork.approval.template.controls的字典列表 + controls_data = [ + (0, 0, { + 'property_id': [(0, 0, { + 'control_type': property_data.get('control', ''), + 'unique_control_id': property_data.get('id', ''), + 'title': property_data['title'][0]['text'] if 'title' in property_data else '', + 'placeholder': property_data['placeholder'][0][ + 'text'] if 'placeholder' in property_data else '', + 'require': property_data.get('require', None), + 'un_print': property_data.get('un_print', None), + 'un_replace': property_data.get('un_replace', None), + 'display': property_data.get('display', None), + })], + 'config_id': [(0, 0, { + 'date_type': [(0, 0, {'date_type': config_data.get('date', {}).get('type', + None)})] if 'date' in config_data else [], + # 'selector_type': [(0, 0, { + # 'selector_type': config_data['table']['children'][0].get('config', {}).get( + # 'selector', {}).get('type', None), + # 'options': [ + # (0, 0, {'key': option['key'], 'text': option['value'][0]['text']}) + # for option in config_data['table']['children'][0].get('config', {}).get('selector', {}).get('options', []) + # ], + # })] if 'selector' in config_data else [], + 'selector_type': [ + (0, 0, { + 'selector_type': child.get('config', {}).get('selector', {}).get('type', None), + 'options': [ + (0, 0, {'key': option['key'], 'text': option['value'][0]['text']}) + for option in child.get('config', {}).get('selector', {}).get('options', []) + ], + }) + for child in config_data.get('table', {}).get('children', []) + if 'selector' in child.get('config', {}) + ], + + 'contact_type': [ + (0, 0, {'contact_type': config_data.get('contact', {}).get('type', None), + 'contact_mode': config_data.get('contact', {}).get('mode', + None)})] if 'contact' in config_data else [], + 'file_type': [ + (0, 0, {'is_only_photo': config_data.get('file', {}).get('is_only_photo', + None)})] if 'file' in config_data else [], + 'table_type': [(0, 0, { + 'table_children': table_children_records, + })] if 'table' in config_data else [], + + # 'contact_type': [ + # (0, 0, {'contact_type': config_data.get('contact', {}).get('type', None)})], + # 'contact_mode': [ + # (0, 0, {'contact_mode': config_data.get('contact', {}).get('mode', None)})], + # 'table_type': [(0, 0, { + # 'table_children': [ + # (0, 0, + # {'control_type': 'Text', 'unique_control_id': 'text_2', 'title': '文本框2'})], + # })], + # # [ + # # (0, 0, {'control_type': config_data.get('table', {}).get('children', {})[0]. + # # get('property', {}).get('control', None), 'unique_control_id': 'text_2', + # # 'title': '文本框2'})] + + 'attendance_type': [(0, 0, {'attendance_type': '1', + 'attendance_date_range_type': 'hour'})] if 'attendance' in config_data else [], + })], + }), + # 在这里添加更多的控件数据 + ] + else: + # 创建一个包含多个wxwork.approval.template.controls的字典列表 + controls_data = [ + (0, 0, { + 'property_id': [(0, 0, { + 'control_type': property_data.get('control', ''), + 'unique_control_id': property_data.get('id', ''), + 'title': property_data['title'][0]['text'] if 'title' in property_data else '', + 'placeholder': property_data['placeholder'][0][ + 'text'] if 'placeholder' in property_data else '', + 'require': property_data.get('require', None), + 'un_print': property_data.get('un_print', None), + 'un_replace': property_data.get('un_replace', None), + 'display': property_data.get('display', None), + })], + }), + # 在这里添加更多的控件数据 + ] + + # 从vacation_list中提取假期类型数据 + vacation_items = [] + vacation_items_data = template_detail.get('vacation_list', []) + # 将假期类型数据转换为适用于vacation_items字段的格式 + if vacation_items_data and 'item' in vacation_items_data: + items = [] + for item in vacation_items_data['item']: + id = item.get('id') + name = item.get('name')[0].get('text') + items.append({'id': id, 'name': name}) + print(items) + + # if vacation_items_data: + # print('vacation_items_data', vacation_items_data) + # print('vacation_items_data', type(vacation_items_data)) + # print('vacation_items_data', vacation_items_data['items']) + # print('vacation_items_data', vacation_items_data[0]) + vacation_items = [(0, 0, { + 'vacation_id': item['id'], + 'name': item['name'], + 'lang': 'zh_CN', + }) for item in items] + + # 创建一个包含WxWorkApprovalTemplate和关联记录数据的字典 + template_data = { + 'process_code': template, + 'name': template_detail['template_names'][0]['text'], + 'content_ids': controls_data, + # 'vacation_config_id': [(0, 0, { + # # 在这里添加wxwork.approval.vacation.config模型的字段数据 + # 'vacation_id': template_detail.get('vacation_id', None), + # 'name': template_detail.get('vacation_name', None), + # 'lang': template_detail.get('vacation_lang', None), + # # ... + # })], + 'vacation_config_id': vacation_items + } + # 检查数据库中是否已经存在具有相同process_code的模板 + existing_template = self.env['wxwork.approval.template'].search( + [('process_code', '=', template)], limit=1) + + if existing_template: + # 如果模板已经存在,更新其content_ids字段(即添加控件记录) + existing_template.write({'content_ids': controls_data}) + else: + # 如果模板不存在,创建一个新的模板及其关联记录 + # 调用create方法创建记录 + template_record = self.env['wxwork.approval.template'].create(template_data) + + # # print(property_data) + # # 准备用于创建记录的字段值 + # property_values = { + # 'control_type': property_data.get('control', ''), + # 'unique_control_id': property_data.get('id', ''), + # 'title': property_data['title'][0]['text'] if 'title' in property_data else '', + # 'placeholder': property_data['placeholder'][0]['text'] if 'placeholder' in property_data else '', + # 'require': property_data.get('require', None), + # 'un_print': property_data.get('un_print', None), + # 'un_replace': property_data.get('un_replace', None), + # 'display': property_data.get('display', None), + # # 'un_replace': template_detail['template_names'][0]['text'], + # # 如果需要设置content_ids,请按照正确格式添加关联数据 + # } + # # print('property_values', property_values) + # # config_data = None + # + # if 'config' in control_data: + # + # config_data = control_data['config'] + # # print('config_data===', config_data) + # if '"date":' in config_data: + # # config_values = { + # # 'date_type': config_data.get('type', ''), + # # } + # config_values['date_type'] = config_data.get('type', '') + # if '"selector":' in config_data: + # # config_values = { + # # 'selector_type': config_data.get('type', ''), + # # # 'options': config_data['title'][0]['text'] if 'title' in property_data else '', + # # } + # config_values['selector_type'] = config_data.get('type', '') + # if '"contact":' in config_data: + # # config_values = { + # # 'contact_type': config_data.get('type', ''), + # # 'contact_mode': config_data.get('mode', ''), + # # + # # } + # config_values['contact_type'] = config_data.get('type', '') + # config_values['contact_mode'] = config_data.get('mode', '') + # if '"table":' in config_data: + # pass + # # config_values = { + # # 'table_children': config_data.get('un_print', None), + # # } + # if '"attendance":' in config_data: + # pass + # # config_values = { + # # 'attendance_type': config_data.get('un_replace', None), + # # 'attendance_date_range_type': config_data.get('display', None), + # # # 如果需要设置content_ids,请按照正确格式添加关联数据 + # # } + # if '"vacation_list":' in config_data: + # pass + # # config_values = { + # # 'vacation_list': config_data['template_names'][0]['text'], + # # # 如果需要设置content_ids,请按照正确格式添加关联数据 + # # } + # + # content_data_list.append((0, 0, { + # 'property_id': [(0, 0, property_values)], + # 'config_id': [(0, 0, config_values)], + # })) + # else: + # content_data_list.append((0, 0, { + # 'property_id': [(0, 0, property_values)], + # # 'config_id': [(0, 0, config_values)], + # })) + # # 准备用于创建记录的字段值 + # property_values = { + # 'control_type': property_data.get('control', ''), + # 'unique_control_id': property_data.get('id', ''), + # 'title': property_data['title'][0]['text'] if 'title' in property_data else '', + # 'placeholder': property_data['placeholder'][0]['text'] if 'placeholder' in property_data else '', + # 'require': property_data.get('require', None), + # 'un_print': property_data.get('un_print', None), + # 'un_replace': property_data.get('un_replace', None), + # 'display': property_data.get('display', None), + # } + # + # if 'config' in control_data: + # config_data = control_data['config'] + # + # # 根据config_data为config.model的One2many字段(如options和table_children)构建命令列表 + # option_vals = [ + # (0, 0, {'key': 'option_key_1', 'text': 'option_text_1', 'lang': 'zh_CN'}), + # (0, 0, {'key': 'option_key_2', 'text': 'option_text_2', 'lang': 'zh_CN'}) + # ] + # vacation_vals = [{'key': 'vacation_key_1', 'text': 'vacation_text_1', 'lang': 'zh_CN'}, + # {'key': 'vacation_key_2', 'text': 'vacation_text_2', 'lang': 'zh_CN'}] + # table_children_vals = [ + # (0, 0, { + # 'control_type': 'Text', + # 'unique_control_id': 'control_id_1', + # 'title': '控件名称1', + # 'placeholder': '控件说明1', + # 'require': True + # }), + # (0, 0, { + # 'control_type': 'Number', + # 'unique_control_id': 'control_id_2', + # 'title': '控件名称2', + # 'placeholder': '控件说明2', + # 'require': False + # }) + # ] + # + # # property_vals = [ + # # (0, 0, { + # # 'control_type': 'Text', + # # 'unique_control_id': 'control_id_1', + # # 'title': '控件名称1', + # # 'placeholder': '控件说明1', + # # 'require': True + # # }), + # # (0, 0, { + # # 'control_type': 'Number', + # # 'unique_control_id': 'control_id_2', + # # 'title': '控件名称2', + # # 'placeholder': '控件说明2', + # # 'require': False + # # }) + # # ] + # + # config_values = { + # 'date_type': config_data.get('type', '') if '"date":' in config_data else '', + # 'selector_type': config_data.get('type', '') if '"selector":' in config_data else '', + # 'contact_type': config_data.get('type', '') if '"contact":' in config_data else '', + # 'contact_mode': config_data.get('mode', '') if '"contact":' in config_data else '', + # 'options': option_vals if '"selector":' in config_data else [(6, 0, [])], # 使用示例中的option_vals + # 'table_children': table_children_vals if '"table":' in config_data else [(6, 0, [])], + # # 使用示例中的property_vals + # 'vacation_list': vacation_vals if '"vacation_list":' in config_data else [] # 添加vacation_vals + # } + # + # content_data_list.append((0, 0, { + # 'property_id': [(0, 0, property_values)], + # 'config_id': [(0, 0, config_values)] if 'config' in control_data else [(6, 0, [])], + # })) + # + # # 准备用于创建记录的字段值,包括content_ids数据 + # values = { + # 'process_code': template, + # 'name': template_detail['template_names'][0]['text'], + # 'content_ids': content_data_list, + # } + # + # # 使用create方法创建记录 + # new_record = self.env['wxwork.approval.template'].create(values) + + +class WxTemplateSettings(models.Model): + _name = 'wxwork.template.settings' + _description = '企业微信模板设置' + + sp_name = fields.Char(string='审批模板名称') + template_id = fields.Char(string='审批模板ID') + # wxwork_id = fields.Many2one('wxwork.settings', string='企业微信') diff --git a/sf_wxwork_approval/security/ir.model.access.csv b/sf_wxwork_approval/security/ir.model.access.csv index a5ea9e77..92e890d5 100644 --- a/sf_wxwork_approval/security/ir.model.access.csv +++ b/sf_wxwork_approval/security/ir.model.access.csv @@ -6,6 +6,18 @@ access_wxwork_approval_template_controls,wxwork.approval.template.controls,model access_wxwork_approval_approver_line,wxwork.approval.approver_line,model_wxwork_approval_approver_line,base.group_user,1,1,1,1 access_wxwork_settings,wxwork.settings,model_wxwork_settings,base.group_user,1,1,1,1 access_wxwork_approval_template_summary,wxwork.approval.template.summary,model_wxwork_approval_template_summary,base.group_user,1,1,1,1 +access_wxwork_template_settings,wxwork.template.settings,model_wxwork_template_settings,base.group_user,1,1,1,1 +access_property_model,property.model,model_property_model,base.group_user,1,1,1,1 +access_config_model,config.model,model_config_model,base.group_user,1,1,1,1 +access_config_option,config.option,model_config_option,base.group_user,1,1,1,1 +access_wxwork_approval_vacation_config,wxwork.approval.vacation.config,model_wxwork_approval_vacation_config,base.group_user,1,1,1,1 +access_wxwork_approval_date_config,wxwork.approval.date.config,model_wxwork_approval_date_config,base.group_user,1,1,1,1 +access_wxwork_approval_selector_config,wxwork.approval.selector.config,model_wxwork_approval_selector_config,base.group_user,1,1,1,1 +access_selector_option,selector.option,model_selector_option,base.group_user,1,1,1,1 +access_wxwork_approval_contact_config,wxwork.approval.contact.config,model_wxwork_approval_contact_config,base.group_user,1,1,1,1 +access_wxwork_approval_table_config,wxwork.approval.table.config,model_wxwork_approval_table_config,base.group_user,1,1,1,1 +access_wxwork_approval_attendance_config,wxwork.approval.attendance.config,model_wxwork_approval_attendance_config,base.group_user,1,1,1,1 +access_wxwork_approval_file_config,wxwork.approval.file.config,model_wxwork_approval_file_config,base.group_user,1,1,1,1 access_wxwork_approval,wxwork.approval,model_wxwork_approval,base.group_user,1,1,1,1 diff --git a/sf_wxwork_approval/views/wxwork_approval_template_view.xml b/sf_wxwork_approval/views/wxwork_approval_template_view.xml index 175ab1dc..9d00ab6f 100644 --- a/sf_wxwork_approval/views/wxwork_approval_template_view.xml +++ b/sf_wxwork_approval/views/wxwork_approval_template_view.xml @@ -10,8 +10,8 @@ - + @@ -23,17 +23,19 @@
- + - - + + + + - +
@@ -57,7 +59,7 @@ - + @@ -72,15 +74,8 @@ - - - - - - - - - + + @@ -91,10 +86,40 @@
+ + + +
+
+ + + + 审批模板控件属性 + property.model + + - - - + + + + + + + + + + + + + 审批模板控件属性 + property.model + +
+ + + + + @@ -105,6 +130,394 @@ + + + 审批模板控件配置 + config.model + + + + + + + + + + + + + + + + + + + + + + 审批模板控件配置 + config.model + + + + + + + + + + + + + + + + + + + + + + + + + + + 审批模板控件Date控件config配置 + wxwork.approval.date.config + + + + + + + + 审批模板控件Date控件config配置 + wxwork.approval.date.config + +
+ + + +
+
+
+ + + 审批模板控件Selector控件(单选/多选控件)config配置 + wxwork.approval.selector.config + + + + + + + + + + 审批模板控件Selector控件(单选/多选控件)config配置 + wxwork.approval.selector.config + +
+ + + + + +
+
+
+ + + 审批模板控件Selector控件(单选/多选控件)选项配置 + selector.option + + + + + + + + + + 审批模板控件Selector控件(单选/多选控件)选项配置 + selector.option + +
+ + + + + +
+
+
+ + + 审批模板控件Contact控件(成员/部门/标签控件)config配置 + wxwork.approval.contact.config + + + + + + + + + 审批模板控件Contact控件(成员/部门/标签控件)config配置 + wxwork.approval.contact.config + +
+ + + + +
+
+
+ + + 审批模板控件Table控件(明细控件)config配置 + wxwork.approval.table.config + + + + + + + + + 审批模板控件Table控件(明细控件)config配置 + wxwork.approval.table.config + +
+ + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 审批模板控件Attendance控件(假勤控件)config配置 + wxwork.approval.attendance.config + + + + + + + + + 审批模板控件Attendance控件(假勤控件)config配置 + wxwork.approval.attendance.config + +
+ + + + +
+
+
+ + + 审批模板控件Vacation控件(假勤控件)config配置 + wxwork.approval.vacation.config + + + + + + + + + + 审批模板控件Vacation控件(假勤控件)config配置 + wxwork.approval.vacation.config + +
+ + + + + +
+
+
+ + + 审批模板控件file控件(文件控件)config配置 + wxwork.approval.file.config + + + + + + + + + 审批模板控件file控件(文件控件)config配置 + wxwork.approval.file.config + +
+ + + +
+
+
+ + + + + + + + 审批模板 wxwork.approval.template diff --git a/sf_wxwork_approval/views/wxwork_settings_view.xml b/sf_wxwork_approval/views/wxwork_settings_view.xml index 904fd019..82808008 100644 --- a/sf_wxwork_approval/views/wxwork_settings_view.xml +++ b/sf_wxwork_approval/views/wxwork_settings_view.xml @@ -9,6 +9,7 @@ + @@ -21,6 +22,37 @@ + + +
+