diff --git a/.module-readme.rst.j2 b/.module-readme.rst.j2 new file mode 100644 index 000000000..30ffec80c --- /dev/null +++ b/.module-readme.rst.j2 @@ -0,0 +1,90 @@ +{%- macro fragment(name, title, sub='=') %} +{%- if name in fragments %} +{{- title }} +{{ sub * title|length }} + +{{ fragments[name] }} +{% endif %} +{%- endmacro -%} + +{{ '=' * manifest.name|length }} +{{ manifest.name }} +{{ '=' * manifest.name|length }} + +.. +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! This file is generated by oca-gen-addon-readme !! +!! changes will be overwritten. !! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! source digest: {{ source_digest }} +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge_devstat| image:: https://img.shields.io/badge/maturity-{{ development_status | replace("-", "--") | urlencode +}}-brightgreen.png +:target: https://odoo-community.org/page/development-status +:alt: {{ development_status | title }} + +.. |badge_license| image:: https://img.shields.io/badge/license-{{ manifest.license | d("Unknown") | replace("-", "--") +| urlencode }}-blue.png +:alt: {{ manifest.license | d("Unknown") }} + +|badge_devstat| |badge_license| + +{{ fragments.get('DESCRIPTION', '') }} +{% if development_status == 'alpha' -%} + +.. IMPORTANT:: +This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +`More details on development status `_ + + {% endif -%} + + **Table of contents** + + .. contents:: + :local: + + {{ fragment('CONTEXT', 'Use Cases / Context') }} + {{- fragment('INSTALL', 'Installation') }} + {{- fragment('CONFIGURE', 'Configuration') }} + {{- fragment('USAGE', 'Usage') }} + {{- fragment('DEVELOP', 'Development') }} + {{- fragment('ROADMAP', 'Known issues / Roadmap') -}} + {{- fragment('HISTORY', 'Changelog') -}} + + Credits + {#- HACK Avoid conflicts with pre-commit's check-merge-conflict #} + {{ "=======" }} + + {% if authors -%} + Authors + {{ level3_underline * 7 }} + + {% for author in authors if author -%} + * {{ author }} + {% endfor %} + {% endif -%} + + {{ fragment('CONTRIBUTORS', 'Contributors', sub=level3_underline) }} + {{- fragment('CREDITS', 'Other credits', sub=level3_underline) -}} + Maintainers + {{ level3_underline * 11 }} + + This module is maintained by {{ org_name }}. + + Contact the maintainer through their official support channels in case you find + any issues with this module. + {% if manifest.maintainers %} + + {% for maintainer in manifest.maintainers %} + .. |maintainer-{{ maintainer }}| image:: https://github.com/{{ maintainer }}.png?size=40px + :target: https://github.com/{{ maintainer }} + :alt: {{ maintainer}} + {%- endfor %} + + Current maintainer{% if manifest.maintainers|length > 1 %}s{% endif %}: + + {% for maintainer in manifest.maintainers %}|maintainer-{{ maintainer }}|{% if not loop.last %} {% endif %}{% endfor + %} + {% endif %} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fb3d36dcb..4384618b0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,104 +3,61 @@ exclude: | # NOT INSTALLABLE ADDONS # END NOT INSTALLABLE ADDONS # Files and folders generated by bots, to avoid loops - ^setup/|/static/description/index\.html$| - # We don't want to mess with tool-generated files - .svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/| - # Maybe reactivate this when all README files include prettier ignore tags? - ^README\.md$| + /static/description/index\.html$| + # Files that fail if changed manually + .*\.(diff|patch)$| # Library files can have extraneous formatting (even minimized) /static/(src/)?lib/| - # Repos using Sphinx to generate docs don't need prettying - ^docs/_templates/.*\.html$| - # Don't bother non-technical authors with formatting issues in docs - readme/.*\.(rst|md)$| - # Ignore build and dist directories in addons - /build/|/dist/| - # Ignore test files in addons - /tests/samples/.*| # You don't usually want a bot to modify your legal texts (LICENSE.*|COPYING.*) default_language_version: python: python3 - node: "16.17.0" + node: "18.17.1" repos: - repo: local hooks: - # These files are most likely copier diff rejection junks; if found, - # review them manually, fix the problem (if needed) and remove them - id: forbidden-files name: forbidden files entry: found forbidden files; remove them language: fail files: "\\.rej$" - - id: en-po-files - name: en.po files cannot exist - entry: found a en.po file - language: fail - files: '[a-zA-Z0-9_]*/i18n/en\.po$' - - repo: https://github.com/oca/maintainer-tools - rev: d5fab7ee87fceee858a3d01048c78a548974d935 + - &maintainer_tools + repo: https://github.com/oca/maintainer-tools + rev: 400ffa99242c8b225ab4d34de78721a68b292a61 hooks: # update the NOT INSTALLABLE ADDONS section above - id: oca-update-pre-commit-excluded-addons - - id: oca-fix-manifest-website - args: ["https://github.com/aginix/kmitl"] - - id: oca-gen-addon-readme args: - - --addons-dir=. - - --branch=16.0 - - --org-name=aginix - - --repo-name=kmitl - - --if-source-changed - - --keep-source-digest + - --addons-dir + - . - repo: https://github.com/OCA/odoo-pre-commit-hooks - rev: v0.0.25 + rev: v0.0.29 hooks: - id: oca-checks-odoo-module - id: oca-checks-po - - repo: https://github.com/myint/autoflake - rev: v1.6.1 + args: ["--fix"] + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.3 hooks: - - id: autoflake - args: - - --expand-star-imports - - --ignore-init-module-imports - - --in-place - - --remove-all-unused-imports - - --remove-duplicate-keys - - --remove-unused-variables - - repo: https://github.com/psf/black - rev: 22.8.0 - hooks: - - id: black + - id: ruff + args: [--fix, --exit-non-zero-on-fix] + - id: ruff-format - repo: https://github.com/pre-commit/mirrors-prettier + # HACK https://github.com/prettier/prettier/issues/15696 rev: v2.7.1 hooks: - id: prettier - name: prettier (with plugin-xml) + name: prettier + plugin-xml + args: [--plugin=@prettier/plugin-xml] additional_dependencies: - - "prettier@2.7.1" - - "@prettier/plugin-xml@2.2.0" - args: - - --plugin=@prettier/plugin-xml - files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$ - - repo: https://github.com/pre-commit/mirrors-eslint - rev: v8.24.0 - hooks: - - id: eslint - verbose: true - args: - - --color - - --fix + # HACK https://github.com/prettier/pre-commit/issues/16#issuecomment-713474520 + - prettier@2.7.1 + - "@prettier/plugin-xml@v2.2.0" - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.5.0 hooks: - id: trailing-whitespace - # exclude autogenerated files - exclude: /README\.rst$|\.pot?$ - id: end-of-file-fixer - # exclude autogenerated files - exclude: /README\.rst$|\.pot?$ - id: debug-statements - id: fix-encoding-pragma args: ["--remove"] @@ -108,43 +65,14 @@ repos: - id: check-docstring-first - id: check-executables-have-shebangs - id: check-merge-conflict - # exclude files where underlines are not distinguishable from merge conflicts - exclude: /README\.rst$|^docs/.*\.rst$ + args: [--assume-in-merge] + exclude: \.rst$ # HACK https://github.com/pre-commit/pre-commit-hooks/issues/985 - id: check-symlinks - id: check-xml - id: mixed-line-ending args: ["--fix=lf"] - - repo: https://github.com/asottile/pyupgrade - rev: v2.38.2 - hooks: - - id: pyupgrade - args: ["--keep-percent-format"] - - repo: https://github.com/PyCQA/isort - rev: 5.12.0 - hooks: - - id: isort - name: isort except __init__.py - args: - - --settings=. - exclude: /__init__\.py$ - - repo: https://github.com/acsone/setuptools-odoo - rev: 3.1.8 - hooks: - - id: setuptools-odoo-make-default - - id: setuptools-odoo-get-requirements - args: - - --output - - requirements.txt - - --header - - "# generated from manifests external_dependencies" - - repo: https://github.com/PyCQA/flake8 - rev: 3.9.2 - hooks: - - id: flake8 - name: flake8 - additional_dependencies: ["flake8-bugbear==21.9.2"] - repo: https://github.com/OCA/pylint-odoo - rev: v8.0.19 + rev: v8.0.20 hooks: - id: pylint_odoo name: pylint with optional checks @@ -155,3 +83,24 @@ repos: - id: pylint_odoo args: - --rcfile=.pylintrc-mandatory + - repo: https://github.com/pre-commit/mirrors-eslint + rev: v8.49.0 + hooks: + - id: eslint + verbose: true + args: + - --color + - --fix + - <<: *maintainer_tools + hooks: + # Generate readme is last, so its digest includes changes from above + - id: oca-gen-addon-readme + args: + - --addons-dir=. + - --org-name=nopparuts + - --repo-name=kmitl + - --convert-fragments-to-markdown + - --gen-html + - --if-fragments-changed + - --branch=16.0 + - --template-filename=.module-readme.rst.j2 diff --git a/account_kmitl/README.rst b/account_kmitl/README.rst index e578a936c..e57018107 100644 --- a/account_kmitl/README.rst +++ b/account_kmitl/README.rst @@ -2,54 +2,42 @@ KMITL - Accounting ================== -.. - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! This file is generated by oca-gen-addon-readme !! - !! changes will be overwritten. !! - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:fde09dfb1902e2a26563cdd69baf3fd820dacaabb8377aef7b60b56f6bfe31f3 - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png - :target: https://odoo-community.org/page/development-status - :alt: Beta -.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png - :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html - :alt: License: LGPL-3 -.. |badge3| image:: https://img.shields.io/badge/github-aginix%2Fkmitl-lightgray.png?logo=github - :target: https://github.com/aginix/kmitl/tree/16.0/account_kmitl - :alt: aginix/kmitl - -|badge1| |badge2| |badge3| +.. +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! This file is generated by oca-gen-addon-readme !! +!! changes will be overwritten. !! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! source digest: sha256:375c85c2aad5776222a885b224c73284a57037b9c63a12429b22cff3f0af9c6c +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -Chart of Accounts for KMITL. +.. |badge_devstat| image:: https://img.shields.io/badge/maturity-beta-brightgreen.png +:target: https://odoo-community.org/page/development-status +:alt: Beta -**Table of contents** +.. |badge_license| image:: https://img.shields.io/badge/license-LGPL--3-blue.png +:alt: LGPL-3 -.. contents:: - :local: +|badge_devstat| |badge_license| -Bug Tracker -=========== +Chart of Accounts for KMITL. -Bugs are tracked on `GitHub Issues `_. -In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +**Table of contents** -Do not contact contributors directly about support or help with technical issues. + .. contents:: + :local: -Credits -======= + Credits + ======= -Authors -~~~~~~~ + Authors + ------- -* Aginix Technologies + * Aginix Technologies -Maintainers -~~~~~~~~~~~ + Maintainers + ----------- -This module is part of the `aginix/kmitl `_ project on GitHub. + This module is maintained by nopparuts. -You are welcome to contribute. + Contact the maintainer through their official support channels in case you find + any issues with this module. diff --git a/account_kmitl/readme/DESCRIPTION.md b/account_kmitl/readme/DESCRIPTION.md new file mode 100644 index 000000000..c24d8a236 --- /dev/null +++ b/account_kmitl/readme/DESCRIPTION.md @@ -0,0 +1 @@ +Chart of Accounts for KMITL. diff --git a/account_kmitl/readme/DESCRIPTION.rst b/account_kmitl/readme/DESCRIPTION.rst deleted file mode 100644 index bb330d79a..000000000 --- a/account_kmitl/readme/DESCRIPTION.rst +++ /dev/null @@ -1 +0,0 @@ -Chart of Accounts for KMITL. \ No newline at end of file diff --git a/budget_demo/__init__.py b/budget_demo/__init__.py index 031bac158..a449448a6 100644 --- a/budget_demo/__init__.py +++ b/budget_demo/__init__.py @@ -1,39 +1 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo import api, SUPERUSER_ID -from odoo.fields import Command - - -def post_init(cr, registry): - # This is a placeholder for the post-init method. - env = api.Environment(cr, SUPERUSER_ID, {}) - - # Install the Thai language pack - th = ( - env["res.lang"].with_context(active_test=False).search([("code", "=", "th_TH")]) - ) - ll = env["base.language.install"].create( - {"lang_ids": [Command.clear(), Command.link(th.id)]} - ) - ll.lang_install() - - # Set the default language for the system to Thai - default_lang = env["ir.default"].browse([1]) - default_lang.json_value = '"th_TH"' - - # Set the default language for all users to Thai - users = env["res.users"].search([]) - users.lang = "th_TH" - - -def uninstall_hook(cr, registry): - # This is a placeholder for the uninstall method. - env = api.Environment(cr, SUPERUSER_ID, {}) - - default_lang = env["ir.default"].browse([1]) - default_lang.json_value = '"en_US"' - - users = env["res.users"].search([]) - users.lang = "en_US" - - rl = env["res.lang"].search([("code", "=", "th_TH")]) - rl.active = False diff --git a/budget_demo/__manifest__.py b/budget_demo/__manifest__.py index bc114dbf7..705c72290 100644 --- a/budget_demo/__manifest__.py +++ b/budget_demo/__manifest__.py @@ -12,8 +12,6 @@ "data/budget.appropriation.csv", "data/budget.appropriation.line.csv", ], - "post_init_hook": "post_init", - "uninstall_hook": "uninstall_hook", "auto_install": False, "application": True, "license": "AGPL-3", diff --git a/kmitl_demo/README.rst b/kmitl_demo/README.rst new file mode 100644 index 000000000..cdfae7ec2 --- /dev/null +++ b/kmitl_demo/README.rst @@ -0,0 +1,5 @@ +========== +KMITL DEMO +========== + +KMITL Demo is a module for Odoo that provides a demonstration of the KMITL system. It includes various features and functionalities that showcase the capabilities of the KMITL system. diff --git a/kmitl_demo/__init__.py b/kmitl_demo/__init__.py index aa9a7bd88..e6fc360d8 100644 --- a/kmitl_demo/__init__.py +++ b/kmitl_demo/__init__.py @@ -1,4 +1 @@ -# -*- coding: utf-8 -*- -from . import hooks - -post_init_hook = hooks.post_init_hook +from .hooks import post_init, uninstall_hook diff --git a/kmitl_demo/__manifest__.py b/kmitl_demo/__manifest__.py index 67bb6b9e5..cc7c63a4c 100644 --- a/kmitl_demo/__manifest__.py +++ b/kmitl_demo/__manifest__.py @@ -13,13 +13,19 @@ "hr", "hr_department_code", "account_fiscal_year", + "account_analytic_kmitl", + "l10n_th_kmitl_procurement", + "procurement_plan", ], "data": [ "data/company.xml", "data/hr.department.csv", "data/account.fiscal.year.csv", - "data/ir_config_parameter.xml" + "data/ir_config_parameter.xml", + "data/procurement_plan.xml", ], + "post_init_hook": "post_init", + "uninstall_hook": "uninstall_hook", "application": False, "installable": True, "auto_install": False, diff --git a/kmitl_demo/data/account.fiscal.year.csv b/kmitl_demo/data/account.fiscal.year.csv index 75cb39678..c47310ed5 100644 --- a/kmitl_demo/data/account.fiscal.year.csv +++ b/kmitl_demo/data/account.fiscal.year.csv @@ -1,3 +1,3 @@ id,name,date_from,date_to -account_fiscal_year_y2567,ปีงบประมาณ พ.ศ.2567,2023-10-01,2024-09-30 -account_fiscal_year_y2568,ปีงบประมาณ พ.ศ.2568,2024-10-01,2025-09-30 +account_fiscal_year_y2567,2567,2023-10-01,2024-09-30 +account_fiscal_year_y2568,2568,2024-10-01,2025-09-30 diff --git a/kmitl_demo/data/hr.department.csv b/kmitl_demo/data/hr.department.csv index 5c9de0638..a37e1b208 100644 --- a/kmitl_demo/data/hr.department.csv +++ b/kmitl_demo/data/hr.department.csv @@ -99,7 +99,6 @@ "38040",ศูนย์วิจัยและนวัตกรรมแพทย์ สจล.โรงพยาบาลสิรินธร,"38040",คณะแพทยศาสตร์ "39",วิทยาลัยการจัดการนวัตกรรมและอุตสาหกรรม,"39", "39010",สำนักงานวิทยาลัยวิจัยนวัตกรรมทางการศึกษา,"39010",วิทยาลัยการจัดการนวัตกรรมและอุตสาหกรรม -"39010",สํานักงานวิทยาลัยวิจัยนวัตกรรมทางการศึกษา,"39010",วิทยาลัยการจัดการนวัตกรรมและอุตสาหกรรม "39020",ภาควิชาการศึกษาขั้นพื้นฐาน,"39020",วิทยาลัยการจัดการนวัตกรรมและอุตสาหกรรม "39030",ภาควิชาวิจัยและพัฒนานวัตกรรม,"39030",วิทยาลัยการจัดการนวัตกรรมและอุตสาหกรรม "39050",ศูนย์วิจัยนวัตกรรมทางการศึกษา,"39050",วิทยาลัยการจัดการนวัตกรรมและอุตสาหกรรม @@ -165,4 +164,4 @@ "99070",งานจัดการทรัพย์สินทางปัญญา,"99070",สำนักบริหารงานวิจัยและนวัตกรรมพระจอมเกล้าลาดกระบัง "99080",งานส่งเสริมและสนับสนุนนโยบายภาครัฐและเอกชนเชิงรุก,"99080",สำนักบริหารงานวิจัยและนวัตกรรมพระจอมเกล้าลาดกระบัง "kmitl",สถาบันเทคโนโลยีพระจอมเกล้าเจ้าคุณทหารลาดกระบัง,, -"37001",ส่วนสนับสนุนวิชาการ,,วิทยาลัยการจัดการนวัตกรรมและอุตสาหกรรม \ No newline at end of file +"37001",ส่วนสนับสนุนวิชาการ,,วิทยาลัยการจัดการนวัตกรรมและอุตสาหกรรม diff --git a/kmitl_demo/data/ir_config_parameter.xml b/kmitl_demo/data/ir_config_parameter.xml index e980321de..1bf63ca56 100644 --- a/kmitl_demo/data/ir_config_parameter.xml +++ b/kmitl_demo/data/ir_config_parameter.xml @@ -1,9 +1,15 @@ - + - - - - - - + + + + diff --git a/kmitl_demo/data/procurement_plan.xml b/kmitl_demo/data/procurement_plan.xml new file mode 100644 index 000000000..fdf9b73a4 --- /dev/null +++ b/kmitl_demo/data/procurement_plan.xml @@ -0,0 +1,298 @@ + + + + + + ปรับปรุงอาคารเรียนรวม 12 ชั้น + 12 + ชั้น + 1500000 + + draft + ผู้รับเหมาจะดำเนินงานในวันหยุดพิเศษต่าง ๆ ด้วย + 1 + 2 + 2 + 3 + 4 + + + + + + + + 1 + 30 + 1 + 4000000 + + + + 2 + 30 + 2 + 4000000 + + + + 3 + 30 + 3 + 2500000 + + + + 4 + 90 + 6 + 7400000 + + + + 5 + 5 + 6 + 100000 + + + + + + ปรับปรุงห้องเรียนและห้องปฏิบัติการ อาคารปฏิบัติการพิเศษจอมไตร + 7 + ห้อง + 750000 + + done + 4 + 5 + 6 + 7 + 8 + + + + + + + + 1 + 90 + 1 + 2250000 + + + + 2 + 90 + 4 + 2250000 + + + + 3 + 30 + 7 + 750000 + + + + + + ครุภัณฑ์วิทยาศาสตร์และการแพทย์ จำนวน 5 รายการ + 1 + โครงการ + 2360700 + + procurement + รับประกันสินค้าทั้งหมด 1.5 ปี + 1 + 2 + 2 + 3 + 4 + + + + + + + + 1 + 15 + 1 + 2360700 + + + + + + ปรับปรุงห้องผ่าตัด โรงพยาบาลพระจอมเกล้าเจ้าคุณทหาร + 1 + ห้อง + 17540000 + + pending + - + 11 + 5 + 7 + 8 + 9 + + + + + + + + 1 + 30 + 1 + 140000 + + + + 2 + 60 + 3 + 500000 + + + + 3 + 45 + 5 + 7000000 + + + + 4 + 15 + 7 + 10000000 + + + + + + ปรับปรุงไฟแสงสว่างสนามฟุตบอล + 1 + สนาม + 4498300 + + cancel + + 1 + 1 + 1 + 2 + 2 + + + + + + + + 1 + 10 + 1 + 2000000 + + + + 2 + 20 + 1 + 2498300 + + + + + + ปรับปรุงห้องปฏิบัติการฟิสิกส์ + 1 + รายการ + 19500000 + + done + + 8 + 9 + 10 + 10 + 2 + + + + + + + + 1 + 30 + 11 + 5000000 + + + + 2 + 30 + 12 + 5000000 + + + + 2 + 30 + 1 + 7500000 + + + + 2 + 30 + 2 + 2000000 + + diff --git a/kmitl_demo/hooks.py b/kmitl_demo/hooks.py index aa0ffa911..87e16fd4e 100644 --- a/kmitl_demo/hooks.py +++ b/kmitl_demo/hooks.py @@ -1,12 +1,38 @@ -from odoo import api, SUPERUSER_ID +from odoo import SUPERUSER_ID, api +from odoo.fields import Command -def post_init_hook(cr, registry): + +def post_init(cr, registry): + # This is a placeholder for the post-init method. + env = api.Environment(cr, SUPERUSER_ID, {}) + + # Install the Thai language pack + th = ( + env["res.lang"].with_context(active_test=False).search([("code", "=", "th_TH")]) + ) + ll = env["base.language.install"].create( + {"lang_ids": [Command.clear(), Command.link(th.id)]} + ) + ll.lang_install() + + # Set the default language for the system to Thai + default_lang = env["ir.default"].browse([1]) + default_lang.json_value = '"th_TH"' + + # Set the default language for all users to Thai + users = env["res.users"].search([]) + users.lang = "th_TH" + + +def uninstall_hook(cr, registry): + # This is a placeholder for the uninstall method. env = api.Environment(cr, SUPERUSER_ID, {}) - # โหลดภาษาไทยถ้ายังไม่ถูกโหลด - if 'th_TH' not in env['res.lang'].search([('code', '=', 'th_TH')]).mapped('code'): - env['res.lang'].load_lang('th_TH') - # ตั้งค่าภาษาให้กับผู้ใช้ทุกคน - users = env['res.users'].search([]) - users.write({'lang': 'th_TH'}) - # ตรวจสอบให้แน่ใจว่า th_TH ถูกเปิดใช้งาน - env['res.lang']._activate_lang('th_TH') + + default_lang = env["ir.default"].browse([1]) + default_lang.json_value = '"en_US"' + + users = env["res.users"].search([]) + users.lang = "en_US" + + rl = env["res.lang"].search([("code", "=", "th_TH")]) + rl.active = False diff --git a/procurement_plan/README.rst b/procurement_plan/README.rst new file mode 100644 index 000000000..b2d082617 --- /dev/null +++ b/procurement_plan/README.rst @@ -0,0 +1,5 @@ +================ +procurement_plan +================ + +Procurement Plan \ No newline at end of file diff --git a/procurement_plan/__manifest__.py b/procurement_plan/__manifest__.py index 8b3db25c3..0b6a0d8ff 100644 --- a/procurement_plan/__manifest__.py +++ b/procurement_plan/__manifest__.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- { "name": "Procurement Plan", - "version": "16.0.1.0.0", + "version": "16.0.1.0.3", "author": "Aginix Technologies", "website": "https://github.com/aginix/kmitl", "category": "KMITL", diff --git a/procurement_plan/i18n/th.po b/procurement_plan/i18n/th.po index 4c8312195..ef9044205 100644 --- a/procurement_plan/i18n/th.po +++ b/procurement_plan/i18n/th.po @@ -6,76 +6,16 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-06 07:49+0000\n" -"PO-Revision-Date: 2025-05-06 17:27+0700\n" +"POT-Creation-Date: 2025-05-07 07:01+0000\n" +"PO-Revision-Date: 2025-05-07 14:04+0700\n" "Last-Translator: \n" "Language-Team: \n" -"Language: th_TH\n" +"Language: th\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.6\n" - -#. module: procurement_plan -#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__1 -msgid "1/68" -msgstr "" - -#. module: procurement_plan -#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__10 -msgid "10/67" -msgstr "" - -#. module: procurement_plan -#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__11 -msgid "11/67" -msgstr "" - -#. module: procurement_plan -#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__12 -msgid "12/67" -msgstr "" - -#. module: procurement_plan -#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__2 -msgid "2/68" -msgstr "" - -#. module: procurement_plan -#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__3 -msgid "3/68" -msgstr "" - -#. module: procurement_plan -#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__4 -msgid "4/68" -msgstr "" - -#. module: procurement_plan -#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__5 -msgid "5/68" -msgstr "" - -#. module: procurement_plan -#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__6 -msgid "6/68" -msgstr "" - -#. module: procurement_plan -#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__7 -msgid "7/68" -msgstr "" - -#. module: procurement_plan -#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__8 -msgid "8/68" -msgstr "" - -#. module: procurement_plan -#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__9 -msgid "9/68" -msgstr "" +"X-Generator: Poedit 3.5\n" #. module: procurement_plan #: model:ir.model.fields,field_description:procurement_plan.field_procurement_plan__acceptance_eta @@ -112,11 +52,31 @@ msgstr "" msgid "Approval Signing (ETA)" msgstr "อนุมัติผล (รอลงนามสัญญา)" +#. module: procurement_plan +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__acceptance_eta__4 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__approval_signing_eta__4 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__contract_order_signing_eta__4 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__procurement_announcement_eta__4 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__purchase_request_eta__4 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__4 +msgid "April" +msgstr "เมษายน" + #. module: procurement_plan #: model:ir.model.fields,field_description:procurement_plan.field_procurement_plan__message_attachment_count msgid "Attachment Count" msgstr "" +#. module: procurement_plan +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__acceptance_eta__8 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__approval_signing_eta__8 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__contract_order_signing_eta__8 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__procurement_announcement_eta__8 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__purchase_request_eta__8 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__8 +msgid "August" +msgstr "สิงหาคม" + #. module: procurement_plan #: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__state__cancel msgid "Cancelled" @@ -139,6 +99,16 @@ msgstr "" msgid "Created on" msgstr "" +#. module: procurement_plan +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__acceptance_eta__12 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__approval_signing_eta__12 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__contract_order_signing_eta__12 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__procurement_announcement_eta__12 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__purchase_request_eta__12 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__12 +msgid "December" +msgstr "ธันวาคม" + #. module: procurement_plan #: model:ir.model.fields,field_description:procurement_plan.field_procurement_plan__display_name #: model:ir.model.fields,field_description:procurement_plan.field_procurement_plan_payment__display_name @@ -155,6 +125,16 @@ msgstr "จัดซื้อจัดจ้างเสร็จสิ้น" msgid "Draft" msgstr "แบบร่าง" +#. module: procurement_plan +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__acceptance_eta__2 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__approval_signing_eta__2 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__contract_order_signing_eta__2 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__procurement_announcement_eta__2 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__purchase_request_eta__2 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__2 +msgid "February" +msgstr "กุมภาพันธ์" + #. module: procurement_plan #: model:ir.model.fields,field_description:procurement_plan.field_procurement_plan__date_range_fy_id msgid "Fiscal year" @@ -207,6 +187,36 @@ msgstr "งวดที่" msgid "Is Follower" msgstr "" +#. module: procurement_plan +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__acceptance_eta__1 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__approval_signing_eta__1 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__contract_order_signing_eta__1 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__procurement_announcement_eta__1 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__purchase_request_eta__1 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__1 +msgid "January" +msgstr "มกราคม" + +#. module: procurement_plan +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__acceptance_eta__7 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__approval_signing_eta__7 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__contract_order_signing_eta__7 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__procurement_announcement_eta__7 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__purchase_request_eta__7 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__7 +msgid "July" +msgstr "กรกฎาคม" + +#. module: procurement_plan +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__acceptance_eta__6 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__approval_signing_eta__6 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__contract_order_signing_eta__6 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__procurement_announcement_eta__6 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__purchase_request_eta__6 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__6 +msgid "June" +msgstr "มิถุนายน" + #. module: procurement_plan #: model:ir.model.fields,field_description:procurement_plan.field_procurement_plan____last_update #: model:ir.model.fields,field_description:procurement_plan.field_procurement_plan_payment____last_update @@ -230,6 +240,26 @@ msgstr "" msgid "Main Attachment" msgstr "" +#. module: procurement_plan +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__acceptance_eta__3 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__approval_signing_eta__3 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__contract_order_signing_eta__3 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__procurement_announcement_eta__3 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__purchase_request_eta__3 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__3 +msgid "March" +msgstr "มีนาคม" + +#. module: procurement_plan +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__acceptance_eta__5 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__approval_signing_eta__5 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__contract_order_signing_eta__5 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__procurement_announcement_eta__5 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__purchase_request_eta__5 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__5 +msgid "May" +msgstr "พฤษภาคม" + #. module: procurement_plan #: model:ir.model.fields,field_description:procurement_plan.field_procurement_plan__message_has_error msgid "Message Delivery error" @@ -251,6 +281,16 @@ msgstr "ชื่อ" msgid "Notes" msgstr "โน๊ต" +#. module: procurement_plan +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__acceptance_eta__11 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__approval_signing_eta__11 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__contract_order_signing_eta__11 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__procurement_announcement_eta__11 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__purchase_request_eta__11 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__11 +msgid "November" +msgstr "พฤศจิกายน" + #. module: procurement_plan #: model:ir.model.fields,field_description:procurement_plan.field_procurement_plan__message_needaction_counter msgid "Number of Actions" @@ -276,6 +316,16 @@ msgstr "" msgid "Number of messages with delivery error" msgstr "" +#. module: procurement_plan +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__acceptance_eta__10 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__approval_signing_eta__10 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__contract_order_signing_eta__10 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__procurement_announcement_eta__10 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__purchase_request_eta__10 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__10 +msgid "October" +msgstr "ตุลาคม" + #. module: procurement_plan #: model:ir.model.fields,field_description:procurement_plan.field_procurement_plan__payment_ids msgid "Payment" @@ -341,8 +391,19 @@ msgstr "จัดทำ พ.1" msgid "SMS Delivery error" msgstr "" +#. module: procurement_plan +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__acceptance_eta__9 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__approval_signing_eta__9 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__contract_order_signing_eta__9 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__procurement_announcement_eta__9 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan__purchase_request_eta__9 +#: model:ir.model.fields.selection,name:procurement_plan.selection__procurement_plan_payment__month__9 +msgid "September" +msgstr "กันยายน" + #. module: procurement_plan #: model:ir.model.fields,field_description:procurement_plan.field_procurement_plan__state +#: model:ir.model.fields,field_description:procurement_plan.field_procurement_plan_payment__state msgid "Status" msgstr "สถานะ" @@ -401,11 +462,6 @@ msgstr "" msgid "จำนวน" msgstr "" -#. module: procurement_plan -#: model_terms:ir.ui.view,arch_db:procurement_plan.view_procurement_plan_form -msgid "จำนวนต่อหน่วย" -msgstr "" - #. module: procurement_plan #: model:ir.model.fields,field_description:procurement_plan.field_procurement_plan__activity_analytic_id msgid "ด้าน/แผนงาน/กิจกรรม" @@ -421,6 +477,16 @@ msgstr "" msgid "ประกาศจัดซื้อจัดจ้าง" msgstr "" +#. module: procurement_plan +#: model_terms:ir.ui.view,arch_db:procurement_plan.view_procurement_plan_tree +msgid "รวมทั้งหมด" +msgstr "" + +#. module: procurement_plan +#: model_terms:ir.ui.view,arch_db:procurement_plan.view_procurement_plan_form +msgid "ราคาต่อหน่วย" +msgstr "" + #. module: procurement_plan #: model_terms:ir.ui.view,arch_db:procurement_plan.view_procurement_plan_form msgid "รายละเอียดงบประมาณ" diff --git a/procurement_plan/models/procurement_plan.py b/procurement_plan/models/procurement_plan.py index 4f8fd5c9a..6c57b9984 100644 --- a/procurement_plan/models/procurement_plan.py +++ b/procurement_plan/models/procurement_plan.py @@ -1,11 +1,24 @@ -# -*- coding: utf-8 -*- import logging -from odoo import _, api, fields, models -from odoo.exceptions import UserError, ValidationError +from odoo import api, fields, models _logger = logging.getLogger(__name__) +MONTH_SELECTION = [ + ("1", "January"), + ("2", "February"), + ("3", "March"), + ("4", "April"), + ("5", "May"), + ("6", "June"), + ("7", "July"), + ("8", "August"), + ("9", "September"), + ("10", "October"), + ("11", "November"), + ("12", "December"), +] + class ProcurementPlan(models.Model): _name = "procurement.plan" @@ -23,10 +36,8 @@ class ProcurementPlan(models.Model): date_range_fy_id = fields.Many2one( comodel_name="account.fiscal.year", string="Fiscal year", states=READONLY_STATES ) - name = fields.Char("Name", required=True, tracking=True, states=READONLY_STATES) - amount = fields.Integer( - "Amount", required=True, tracking=True, states=READONLY_STATES - ) + name = fields.Char(required=True, tracking=True, states=READONLY_STATES) + amount = fields.Integer(required=True, tracking=True, states=READONLY_STATES) unit = fields.Char( "Unit of Measure", required=True, tracking=True, states=READONLY_STATES ) @@ -62,20 +73,26 @@ class ProcurementPlan(models.Model): tracking=True, ) note = fields.Text("Notes", tracking=True, states=READONLY_STATES) - purchase_request_eta = fields.Integer( - "Purchase Request (ETA)", tracking=True, states=READONLY_STATES + purchase_request_eta = fields.Selection( + MONTH_SELECTION, "Purchase Request (ETA)", tracking=True, states=READONLY_STATES ) - procurement_announcement_eta = fields.Integer( - "Procurement Announcement (ETA)", tracking=True, states=READONLY_STATES + procurement_announcement_eta = fields.Selection( + MONTH_SELECTION, + "Procurement Announcement (ETA)", + tracking=True, + states=READONLY_STATES, ) - approval_signing_eta = fields.Integer( - "Approval Signing (ETA)", tracking=True, states=READONLY_STATES + approval_signing_eta = fields.Selection( + MONTH_SELECTION, "Approval Signing (ETA)", tracking=True, states=READONLY_STATES ) - contract_order_signing_eta = fields.Integer( - "Contract Order Signing (ETA)", tracking=True, states=READONLY_STATES + contract_order_signing_eta = fields.Selection( + MONTH_SELECTION, + "Contract Order Signing (ETA)", + tracking=True, + states=READONLY_STATES, ) - acceptance_eta = fields.Integer( - "Acceptance (ETA)", tracking=True, states=READONLY_STATES + acceptance_eta = fields.Selection( + MONTH_SELECTION, "Acceptance (ETA)", tracking=True, states=READONLY_STATES ) payment_ids = fields.One2many( comodel_name="procurement.plan.payment", diff --git a/procurement_plan/models/procurement_plan_payment.py b/procurement_plan/models/procurement_plan_payment.py index a89951628..bedfced19 100644 --- a/procurement_plan/models/procurement_plan_payment.py +++ b/procurement_plan/models/procurement_plan_payment.py @@ -1,11 +1,24 @@ -# -*- coding: utf-8 -*- import logging -from odoo import models, fields, api, _ -from odoo.exceptions import UserError, ValidationError +from odoo import fields, models _logger = logging.getLogger(__name__) +MONTH_SELECTION = [ + ("1", "January"), + ("2", "February"), + ("3", "March"), + ("4", "April"), + ("5", "May"), + ("6", "June"), + ("7", "July"), + ("8", "August"), + ("9", "September"), + ("10", "October"), + ("11", "November"), + ("12", "December"), +] + class ProcurementPlanPayment(models.Model): _name = "procurement.plan.payment" @@ -16,6 +29,6 @@ class ProcurementPlanPayment(models.Model): ) number = fields.Integer("Installment Number", default=1) number_of_days = fields.Integer("Number of Days") - month = fields.Integer(string="Payment Disbursement Date (Month)") + month = fields.Selection(MONTH_SELECTION, "Payment Disbursement Date (Month)") amount = fields.Float("Payment Amount") - state = fields.Selection(related='procurement_plan_id.state') + state = fields.Selection(related="procurement_plan_id.state") diff --git a/procurement_plan/views/procurement_plan_views.xml b/procurement_plan/views/procurement_plan_views.xml index 3f82b8955..fbf1a43fa 100644 --- a/procurement_plan/views/procurement_plan_views.xml +++ b/procurement_plan/views/procurement_plan_views.xml @@ -1,4 +1,4 @@ - + @@ -6,17 +6,27 @@ view.procurement.plan.tree procurement.plan - - + + - - - - + + + + - - + + @@ -28,14 +38,18 @@
- +
- - - + + + @@ -46,7 +60,7 @@
- + @@ -59,28 +73,31 @@
- + - + - + - +
- + - + @@ -88,7 +105,9 @@ ประกาศจัดซื้อจัดจ้าง - + @@ -113,21 +132,21 @@
จัดทำพ.1การจัดซื้อจัดจ้างการจัดซื้อจัดจ้าง ตรวจรับ/ส่งมอบ
อนุมัติผล (รอลงนามสัญญา)ลงนามสัญญา/ใบสั่งซื้อสั่งจ้างลงนามสัญญา/ใบสั่งซื้อสั่งจ้าง
- + - - - - + + + +
- - + +
@@ -140,7 +159,12 @@ - + diff --git a/project_proposal/__init__.py b/project_proposal/__init__.py new file mode 100644 index 000000000..a0fdc10fe --- /dev/null +++ b/project_proposal/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import models diff --git a/project_proposal/__manifest__.py b/project_proposal/__manifest__.py new file mode 100644 index 000000000..5586fe1fe --- /dev/null +++ b/project_proposal/__manifest__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +{ + "name": "Project Proposal", + "version": "16.0.1.0.0", + "summary": """ Project Proposal Summary """, + "author": "Aginix Technology", + "website": "", + "category": "KMITL", + "depends": ["base", "web", "project", "hr", "account_fiscal_year"], + "data": [ + "data/project.evaluation.methods.csv", + "data/project.fight.csv", + "data/project.global.index.csv", + "data/project.impact.csv", + "security/ir.model.access.csv", + "views/project_kmitl_views.xml", + ], + "assets": { + "web.assets_backend": ["project_proposal/static/src/**/*"], + }, + "application": True, + "installable": True, + "auto_install": False, + "license": "LGPL-3", +} diff --git a/project_proposal/data/project.evaluation.methods.csv b/project_proposal/data/project.evaluation.methods.csv new file mode 100644 index 000000000..5c14b6dbd --- /dev/null +++ b/project_proposal/data/project.evaluation.methods.csv @@ -0,0 +1,4 @@ +"id","name" +questionaire,"แบบสำรวจ/สอบถามความคิดเห็น" +test,"แบบทดสอบ" +other,"อื่นๆ(โปรดระบุ)" diff --git a/project_proposal/data/project.fight.csv b/project_proposal/data/project.fight.csv new file mode 100644 index 000000000..d0e9fc393 --- /dev/null +++ b/project_proposal/data/project.fight.csv @@ -0,0 +1,6 @@ +"id","name","name_th" +futurist,"Futurist","วิสัยทัศน์กว้างไกล, กล้าแตกต่าง" +ignite,"Ignite","พัฒนาอย่างต่อเนื่อง, พร้อมนำการเปลี่ยนแปลง" +greatness,"Greatness","มุ่งเน้นความเป็นเลิศ, สหวิชาชีพ" +honor,"Honor","ยึดหลักธรรมาภิบาล, สร้างความยั่งยืน" +team_spirit,"Team Spirit","ทำงานเป็นทีม, ผสานประโยชน์จากความหลากหลาย" diff --git a/project_proposal/data/project.global.index.csv b/project_proposal/data/project.global.index.csv new file mode 100644 index 000000000..f79977eda --- /dev/null +++ b/project_proposal/data/project.global.index.csv @@ -0,0 +1,6 @@ +"id","name" +infrastructure,"Infrastructure" +management,"Management" +citizen,"Citizen" +innovation,"Innovation" +learning,"Learning" diff --git a/project_proposal/data/project.impact.csv b/project_proposal/data/project.impact.csv new file mode 100644 index 000000000..185d582f0 --- /dev/null +++ b/project_proposal/data/project.impact.csv @@ -0,0 +1,5 @@ +"id","name" +education,"Education" +academic,"Academic" +industrial,"Industrial" +social,"Social" diff --git a/project_proposal/models/__init__.py b/project_proposal/models/__init__.py new file mode 100644 index 000000000..d6ecf4323 --- /dev/null +++ b/project_proposal/models/__init__.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +from . import project_kmitl +from . import project_impact +from . import project_global_index +from . import project_okr +from . import project_output +from . import project_evaluation_methods +from . import project_fight +from . import project_objectives +from . import project_activity diff --git a/project_proposal/models/project_activity.py b/project_proposal/models/project_activity.py new file mode 100644 index 000000000..ac9f13453 --- /dev/null +++ b/project_proposal/models/project_activity.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +import logging + +from odoo import _, api, fields, models +from odoo.exceptions import UserError, ValidationError + +_logger = logging.getLogger(__name__) + + +class ProjectActivity(models.Model): + _name = "project.activity" + _description = "ProjectActivity" + + name = fields.Char(string="ชื่อ") + seq = fields.Integer(string="ลำดับการแสดงผล") + amount = fields.Float(string="งบประมาณ") + line_type = fields.Selection( + [("activity", "กิจกรรม"), ("plan", "ขั้นตอน")], string="ประเภท" + ) + percentage = fields.Float(string="ร้อยละ", digits=(5, 2)) + m1 = fields.Boolean(string="ม.ค.") + m2 = fields.Boolean(string="ก.พ.") + m3 = fields.Boolean(string="มี.ค.") + m4 = fields.Boolean(string="เม.ย.") + m5 = fields.Boolean(string="พ.ค.") + m6 = fields.Boolean(string="มิ.ย.") + m7 = fields.Boolean(string="ก.ค.") + m8 = fields.Boolean(string="ส.ค.") + m9 = fields.Boolean(string="ก.ย.") + m10 = fields.Boolean(string="ต.ค.") + m11 = fields.Boolean(string="พ.ย.") + m12 = fields.Boolean(string="ธ.ค.") + project_kmitl_id = fields.Many2one("project.kmitl", string="โครงการ", readonly=True) + + @api.onchange("line_type") + def _onchange_line_type(self): + if self.line_type != "activity": + self.amount = None diff --git a/project_proposal/models/project_evaluation_methods.py b/project_proposal/models/project_evaluation_methods.py new file mode 100644 index 000000000..1284ac898 --- /dev/null +++ b/project_proposal/models/project_evaluation_methods.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +import logging + +from odoo import _, api, fields, models +from odoo.exceptions import UserError, ValidationError + +_logger = logging.getLogger(__name__) + + +class ProjectEvaluationMethods(models.Model): + _name = "project.evaluation.methods" + _description = "ProjectEvaluationMethods" + + name = fields.Char(string="ชื่อ") diff --git a/project_proposal/models/project_fight.py b/project_proposal/models/project_fight.py new file mode 100644 index 000000000..95673caa6 --- /dev/null +++ b/project_proposal/models/project_fight.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +import logging + +from odoo import _, api, fields, models +from odoo.exceptions import UserError, ValidationError + +_logger = logging.getLogger(__name__) + + +class ProjectFight(models.Model): + _name = "project.fight" + _description = "ProjectFight" + + name = fields.Char(string="ชื่อ") + name_th = fields.Char(string="ชื่อภาษาไทย") diff --git a/project_proposal/models/project_global_index.py b/project_proposal/models/project_global_index.py new file mode 100644 index 000000000..6e8451d5e --- /dev/null +++ b/project_proposal/models/project_global_index.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +import logging + +from odoo import _, api, fields, models +from odoo.exceptions import UserError, ValidationError + +_logger = logging.getLogger(__name__) + + +class ProjectGlobalIndex(models.Model): + _name = "project.global.index" + _description = "ProjectGlobalIndex" + + name = fields.Char(string="ชื่อ") diff --git a/project_proposal/models/project_impact.py b/project_proposal/models/project_impact.py new file mode 100644 index 000000000..6aadc14e8 --- /dev/null +++ b/project_proposal/models/project_impact.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +import logging + +from odoo import _, api, fields, models +from odoo.exceptions import UserError, ValidationError + +_logger = logging.getLogger(__name__) + + +class ProjectImpact(models.Model): + _name = "project.impact" + _description = "ProjectImpact" + + name = fields.Char(string="ชื่อ") diff --git a/project_proposal/models/project_kmitl.py b/project_proposal/models/project_kmitl.py new file mode 100644 index 000000000..ebe3e8ce6 --- /dev/null +++ b/project_proposal/models/project_kmitl.py @@ -0,0 +1,98 @@ +import logging + +from odoo import fields, models + +_logger = logging.getLogger(__name__) + + +class ProjectKmitl(models.Model): + _name = "project.kmitl" + _description = "ProjectKmitl" + _inherit = ["mail.thread"] + + date_range_fy_id = fields.Many2one( + comodel_name="account.fiscal.year", + string="ปีงบประมาณ", + tracking=True, + ) + name = fields.Char(string="ชื่อโครงการ") + source = fields.Selection( + [("national_budget", "เงินงบประมาณแผ่นดิน"), ("income_budget", "เงินรายได้")], + string="ประเภทแหล่งเงิน", + ) + introduction = fields.Html(string="หลักการและเหตุผล", sanitize_attributes=False) + national_strategy_id = fields.Integer(string="ความสอดคล้องกับยุทธศาสตร์") + impact_ids = fields.Many2many("project.impact", string="Impact") + global_index_ids = fields.Many2many("project.global.index", string="Global Index") + okr_1 = fields.Many2many( + "project.okr", string="Objective Key Result (OKR)(ตัวชี้วัดตามแผนบริหารสถาบัน)" + ) + fight_ids = fields.Many2many("project.fight", string="ความสอดคล้องกับค่านิยม") + objective_ids = fields.One2many( + comodel_name="project.objectives", + inverse_name="project_kmitl_id", + string="วัตถุประสงค์ของโครงการ", + ) + department_id = fields.Many2one( + comodel_name="hr.department", string="หน่วยงานผู้รับผิดชอบโครงการ" + ) + department_name = fields.Char( + string="=ชื่อหน่วยงานผู้รับผิดชอบโครงการ", related="department_id.name", store=True + ) + project_manager_name = fields.Char(string="หัวหน้าโครงการ") + project_manager_position = fields.Char(string="หัวหน้าโครงการ ตำแหน่ง") + project_manager_tel = fields.Char(string="หัวหน้าโครงการ เบอร์โทร") + project_manager_email = fields.Char(string="หัวหน้าโครงการ อีเมล") + location = fields.Text(string="สถานที่/พื้นที่ดำเนินโครงการ") + methodology = fields.Selection( + [ + ("describe", "บรรยาย"), + ("lecture", "บรรยายเชิงปฏิบัติการ"), + ("exhibition", "นิทรรศการ"), + ("other", "อื่น ๆ"), + ], + string="วิธีดำเนินการ", + ) + methodology_description = fields.Text(string="วิธีดำเนินการ ระบุ") + target_ids = fields.Text(string="กลุ่มเป้าหมาย/ผู้ดำเนินโครงการ") + output_ids = fields.One2many( + comodel_name="project.output", + inverse_name="project_kmitl_id", + string="เป้าหมาย ผลผลิต และผลลัพธ์", + ) + activity_ids = fields.One2many( + comodel_name="project.activity", + inverse_name="project_kmitl_id", + string="แผนการดําเนินงานและแผนการใช้จ่ายงบประมาณ", + ) + expected_result = fields.Text(string="ผลที่คาดว่าจะได้รับ") + evaluation_method_ids = fields.Many2many( + "project.evaluation.methods", string="วิธีการ/เครื่องมือติดตามและประเมินผล มีตัวเลือกดังนี้" + ) + evaluation_method_description = fields.Text( + string="วิธีการ/เครื่องมือติดตามและประเมินผล ระบุ" + ) + user_id = fields.Many2one( + "res.users", string="ผู้รับผิดชอบข้อมูล", default=lambda self: self.env.user + ) + attachment_ids = fields.Binary(string="เอกสารประกอบการพิจารณาโครงการ") + total_budget = fields.Float(string="จำนวนงบประมาณทั้งหมด") + state = fields.Selection( + [ + ("draft", "แบบร่าง"), + ("submit", "กรอกข้อมูลเสร็จสิ้น"), + ("pending", "อยู่ระหว่างพิจารณา"), + ("approved", "อนุมัติโครงการแล้ว"), + ], + string="สถานะการขออนุมัติโครงการ", + default="draft", + ) + + def action_next_state(self): + for rec in self: + if rec.state == "draft": + rec.state = "submit" + elif rec.state == "submit": + rec.state = "pending" + elif rec.state == "pending": + rec.state = "approved" diff --git a/project_proposal/models/project_objectives.py b/project_proposal/models/project_objectives.py new file mode 100644 index 000000000..3ebe807eb --- /dev/null +++ b/project_proposal/models/project_objectives.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +import logging + +from odoo import _, api, fields, models +from odoo.exceptions import UserError, ValidationError + +_logger = logging.getLogger(__name__) + + +class ProjectObjectives(models.Model): + _name = "project.objectives" + _description = "ProjectObjectives" + + name = fields.Char(string="ชื่อ") + project_kmitl_id = fields.Many2one("project.kmitl", string="โครงการ") diff --git a/project_proposal/models/project_okr.py b/project_proposal/models/project_okr.py new file mode 100644 index 000000000..780034f39 --- /dev/null +++ b/project_proposal/models/project_okr.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +import logging + +from odoo import _, api, fields, models +from odoo.exceptions import UserError, ValidationError + +_logger = logging.getLogger(__name__) + + +class ProjectOkr(models.Model): + _name = "project.okr" + _description = "ProjectOkr" + + name = fields.Char(string="ชื่อ") diff --git a/project_proposal/models/project_output.py b/project_proposal/models/project_output.py new file mode 100644 index 000000000..e1cd76fd8 --- /dev/null +++ b/project_proposal/models/project_output.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +import logging + +from odoo import _, api, fields, models +from odoo.exceptions import UserError, ValidationError + +_logger = logging.getLogger(__name__) + + +class ProjectOutput(models.Model): + _name = "project.output" + _description = "ProjectOutput" + + name = fields.Char(string="ชื่อ") + line_type = fields.Selection( + [("output", "ผลผลิต"), ("outcome", "ผลลัพธ์")], string="ประเภท" + ) + unit = fields.Char(string="หน่วยนับ") + target = fields.Char(string="เป้าหมาย") + project_kmitl_id = fields.Many2one("project.kmitl", string="โครงการ") diff --git a/project_proposal/security/ir.model.access.csv b/project_proposal/security/ir.model.access.csv new file mode 100644 index 000000000..83a75369a --- /dev/null +++ b/project_proposal/security/ir.model.access.csv @@ -0,0 +1,10 @@ +id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink +access_project_kmitl_manager,project_kmitl_manager,model_project_kmitl,,1,1,1,1 +access_project_impact_manager,project_impact_manager,model_project_impact,,1,1,1,1 +access_project_global_index_manager,project_global_index_manager,model_project_global_index,,1,1,1,1 +access_project_okr_manager,project_okr_manager,model_project_okr,,1,1,1,1 +access_project_output_manager,project_output_manager,model_project_output,,1,1,1,1 +access_project_evaluation_methods_manager,project_evaluation_methods_manager,model_project_evaluation_methods,,1,1,1,1 +access_project_fight_manager,project_fight_manager,model_project_fight,,1,1,1,1 +access_project_objectives_manager,project_objectives_manager,model_project_objectives,,1,1,1,1 +access_project_activity_manager,project_activity_manager,model_project_activity,,1,1,1,1 diff --git a/project_proposal/static/src/components/list_renderer_output/list_render_output.xml b/project_proposal/static/src/components/list_renderer_output/list_render_output.xml new file mode 100644 index 000000000..c7fa07fae --- /dev/null +++ b/project_proposal/static/src/components/list_renderer_output/list_render_output.xml @@ -0,0 +1,176 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + ตัวชี้วัดหน่วยนับเป้าหมาย ปีงบประมาณ 2568
+ + + + + + + +
+
+
+ + + + + ผลผลิต (Output) + + + + + + + + + + + + + + + + + + + + + ผลลัพธ์ (Outcome) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/project_proposal/views/project_kmitl_views.xml b/project_proposal/views/project_kmitl_views.xml new file mode 100644 index 000000000..6c4e70219 --- /dev/null +++ b/project_proposal/views/project_kmitl_views.xml @@ -0,0 +1,227 @@ + + + + + + view.project.kmitl.tree + project.kmitl + + + + + + + + + + + + view.project.kmitl.form + project.kmitl + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + view.project.kmitl.search + project.kmitl + + + + + + + + + + + + Project Kmitl + ir.actions.act_window + project.kmitl + tree,form + [] + {} + +

+ There is no examples click here to add new Project Kmitl. +

+
+
+ + + project.activity.form + project.activity + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + +
diff --git a/setup/account_analytic_kmitl/odoo 2/addons/account_analytic_kmitl b/setup/account_analytic_kmitl/odoo 2/addons/account_analytic_kmitl new file mode 120000 index 000000000..20efbda03 --- /dev/null +++ b/setup/account_analytic_kmitl/odoo 2/addons/account_analytic_kmitl @@ -0,0 +1 @@ +../../../../account_analytic_kmitl \ No newline at end of file diff --git a/setup/account_analytic_plan_code/odoo 2/addons/account_analytic_plan_code b/setup/account_analytic_plan_code/odoo 2/addons/account_analytic_plan_code new file mode 120000 index 000000000..cbe30a95c --- /dev/null +++ b/setup/account_analytic_plan_code/odoo 2/addons/account_analytic_plan_code @@ -0,0 +1 @@ +../../../../account_analytic_plan_code \ No newline at end of file diff --git a/setup/account_analytic_seq/odoo/addons/account_analytic_seq b/setup/account_analytic_seq/odoo/addons/account_analytic_seq index 35610e982..124e5c5c8 120000 --- a/setup/account_analytic_seq/odoo/addons/account_analytic_seq +++ b/setup/account_analytic_seq/odoo/addons/account_analytic_seq @@ -1 +1 @@ -../../../../account_analytic_sequence \ No newline at end of file +../../../../account_analytic_seq \ No newline at end of file diff --git a/setup/account_analytic_sequence/odoo 2/addons/account_analytic_sequence b/setup/account_analytic_sequence/odoo 2/addons/account_analytic_sequence new file mode 120000 index 000000000..35610e982 --- /dev/null +++ b/setup/account_analytic_sequence/odoo 2/addons/account_analytic_sequence @@ -0,0 +1 @@ +../../../../account_analytic_sequence \ No newline at end of file diff --git a/setup/budget/odoo 2/addons/budget b/setup/budget/odoo 2/addons/budget new file mode 120000 index 000000000..862fc1bf0 --- /dev/null +++ b/setup/budget/odoo 2/addons/budget @@ -0,0 +1 @@ +../../../../budget \ No newline at end of file diff --git a/setup/budget_demo/odoo/addons/budget_demo b/setup/budget_demo/odoo/addons/budget_demo new file mode 120000 index 000000000..1855b972b --- /dev/null +++ b/setup/budget_demo/odoo/addons/budget_demo @@ -0,0 +1 @@ +../../../../budget_demo \ No newline at end of file diff --git a/setup/budget_demo/odoo/addons/budget_demo 2 b/setup/budget_demo/odoo/addons/budget_demo 2 new file mode 120000 index 000000000..1855b972b --- /dev/null +++ b/setup/budget_demo/odoo/addons/budget_demo 2 @@ -0,0 +1 @@ +../../../../budget_demo \ No newline at end of file diff --git a/setup/budget_demo/setup.py b/setup/budget_demo/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/budget_demo/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/budget_plan/odoo 2/addons/budget_plan b/setup/budget_plan/odoo 2/addons/budget_plan new file mode 120000 index 000000000..a8fea120d --- /dev/null +++ b/setup/budget_plan/odoo 2/addons/budget_plan @@ -0,0 +1 @@ +../../../../budget_plan \ No newline at end of file diff --git a/setup/budget_plan_widget_ztree/odoo 2/addons/budget_plan_widget_ztree b/setup/budget_plan_widget_ztree/odoo 2/addons/budget_plan_widget_ztree new file mode 120000 index 000000000..7557f0dd1 --- /dev/null +++ b/setup/budget_plan_widget_ztree/odoo 2/addons/budget_plan_widget_ztree @@ -0,0 +1 @@ +../../../../budget_plan_widget_ztree \ No newline at end of file diff --git a/setup/budget_template_print/odoo 2/addons/budget_template_print b/setup/budget_template_print/odoo 2/addons/budget_template_print new file mode 120000 index 000000000..0a17352f0 --- /dev/null +++ b/setup/budget_template_print/odoo 2/addons/budget_template_print @@ -0,0 +1 @@ +../../../../budget_template_print \ No newline at end of file diff --git a/setup/budget_template_print/odoo/addons/budget_template_print b/setup/budget_template_print/odoo/addons/budget_template_print new file mode 120000 index 000000000..0a17352f0 --- /dev/null +++ b/setup/budget_template_print/odoo/addons/budget_template_print @@ -0,0 +1 @@ +../../../../budget_template_print \ No newline at end of file diff --git a/setup/budget_template_print/odoo/addons/budget_template_print 2 b/setup/budget_template_print/odoo/addons/budget_template_print 2 new file mode 120000 index 000000000..0a17352f0 --- /dev/null +++ b/setup/budget_template_print/odoo/addons/budget_template_print 2 @@ -0,0 +1 @@ +../../../../budget_template_print \ No newline at end of file diff --git a/setup/budget_template_print/setup.py b/setup/budget_template_print/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/budget_template_print/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/procurement_plan/odoo/addons/procurement_plan b/setup/procurement_plan/odoo/addons/procurement_plan new file mode 120000 index 000000000..53cfba55a --- /dev/null +++ b/setup/procurement_plan/odoo/addons/procurement_plan @@ -0,0 +1 @@ +../../../../procurement_plan \ No newline at end of file diff --git a/setup/procurement_plan/odoo/addons/procurement_plan 2 b/setup/procurement_plan/odoo/addons/procurement_plan 2 new file mode 120000 index 000000000..53cfba55a --- /dev/null +++ b/setup/procurement_plan/odoo/addons/procurement_plan 2 @@ -0,0 +1 @@ +../../../../procurement_plan \ No newline at end of file diff --git a/setup/procurement_plan/setup.py b/setup/procurement_plan/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/procurement_plan/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)