Skip to content

Commit

Permalink
[5006][ADD] purchase_acceptance_tester (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
yostashiro authored Dec 4, 2024
1 parent a3f6a13 commit 494a129
Show file tree
Hide file tree
Showing 17 changed files with 789 additions and 0 deletions.
67 changes: 67 additions & 0 deletions purchase_acceptance_tester/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
==========================
Purchase Acceptance Tester
==========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:fa735a6e728fd196674c48fe5bae6b865e0a20e9e027ccf32140de84c8869e05
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-qrtl%2Faxls--custom-lightgray.png?logo=github
:target: https://github.com/qrtl/axls-custom/tree/16.0/purchase_acceptance_tester
:alt: qrtl/axls-custom

|badge1| |badge2| |badge3|

This module adds an Acceptance Tester field to the purchase order to
indicate to whom an acceptance test request should be routed.

**Table of contents**

.. contents::
:local:

Configuration
=============

Go to purchase settings and select 'Enable Acceptance Tester Check' to
make the Acceptance Tester field of purchase orders required on certain
conditions (i.e. the order contains a non-service product that has not
been fully received).

For contact records that are to be used as Acceptance Testers, select
the 'Is Acceptance Tester' field in the contact form.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/qrtl/axls-custom/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 <https://github.com/qrtl/axls-custom/issues/new?body=module:%20purchase_acceptance_tester%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Quartile Limited

Maintainers
-----------

This module is part of the `qrtl/axls-custom <https://github.com/qrtl/axls-custom/tree/16.0/purchase_acceptance_tester>`_ project on GitHub.

You are welcome to contribute.
1 change: 1 addition & 0 deletions purchase_acceptance_tester/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions purchase_acceptance_tester/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2024 Quartile
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Purchase Acceptance Tester",
"version": "16.0.1.0.0",
"author": "Quartile Limited",
"website": "https://www.quartile.co",
"category": "purchase",
"license": "AGPL-3",
"depends": ["purchase"],
"data": [
"views/purchase_order_views.xml",
"views/res_config_settings_views.xml",
"views/res_partner_views.xml",
],
"installable": True,
}
81 changes: 81 additions & 0 deletions purchase_acceptance_tester/i18n/ja.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_acceptance_tester
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-03 08:31+0000\n"
"PO-Revision-Date: 2024-12-03 08:31+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: purchase_acceptance_tester
#: model:ir.model.fields,field_description:purchase_acceptance_tester.field_purchase_order__acceptance_tester_id
#: model:ir.model.fields,field_description:purchase_acceptance_tester.field_res_partner__is_acceptance_tester
#: model:ir.model.fields,field_description:purchase_acceptance_tester.field_res_users__is_acceptance_tester
#: model_terms:ir.ui.view,arch_db:purchase_acceptance_tester.purchase_order_view_search
#: model_terms:ir.ui.view,arch_db:purchase_acceptance_tester.view_purchase_order_filter
msgid "Acceptance Tester"
msgstr "受入検査依頼先"

#. module: purchase_acceptance_tester
#: model:ir.model.fields,field_description:purchase_acceptance_tester.field_res_config_settings__enable_acceptance_tester_check
msgid "Acceptance Tester Check"
msgstr "受入検査依頼先チェック"

#. module: purchase_acceptance_tester
#: model:ir.model,name:purchase_acceptance_tester.model_res_company
msgid "Companies"
msgstr "会社"

#. module: purchase_acceptance_tester
#: model:ir.model,name:purchase_acceptance_tester.model_res_config_settings
msgid "Config Settings"
msgstr "コンフィグ設定"

#. module: purchase_acceptance_tester
#: model:ir.model,name:purchase_acceptance_tester.model_res_partner
msgid "Contact"
msgstr "連絡先"

#. module: purchase_acceptance_tester
#: model:ir.model.fields,field_description:purchase_acceptance_tester.field_res_company__enable_acceptance_tester_check
#: model_terms:ir.ui.view,arch_db:purchase_acceptance_tester.res_config_settings_view_form_purchase
msgid "Enable Acceptance Tester Check"
msgstr "受入検査依頼先項目へのチェックを有効化"

#. module: purchase_acceptance_tester
#: model:ir.model.fields,help:purchase_acceptance_tester.field_res_config_settings__enable_acceptance_tester_check
msgid ""
"Enable the check on the Acceptance Tester field in purchase orders to "
"determine whether setting a value is required or not."
msgstr "購買オーダの受入検査依頼先項目への必須/任意のチェックを有効化します。"

#. module: purchase_acceptance_tester
#: model_terms:ir.ui.view,arch_db:purchase_acceptance_tester.res_config_settings_view_form_purchase
msgid ""
"If this option is ticked, the Acceptance Tester field in purchase orders "
"becomes required under certain conditions."
msgstr "このオプションを選択すると、購買オーダの受入検査依頼先項目が所定の条件に応じて必須となります。"

#. module: purchase_acceptance_tester
#: model:ir.model.fields,field_description:purchase_acceptance_tester.field_purchase_order__need_acceptance_test
msgid "Need Acceptance Test"
msgstr "要受入検査"

#. module: purchase_acceptance_tester
#: model:ir.model,name:purchase_acceptance_tester.model_purchase_order
msgid "Purchase Order"
msgstr "購買オーダ"

#. module: purchase_acceptance_tester
#: model:ir.model.fields,help:purchase_acceptance_tester.field_res_partner__is_acceptance_tester
#: model:ir.model.fields,help:purchase_acceptance_tester.field_res_users__is_acceptance_tester
msgid "Select this field if the partner is an acceptance tester."
msgstr "取引先が検査依頼先の場合は、この項目を選択してください。"
4 changes: 4 additions & 0 deletions purchase_acceptance_tester/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from . import purchase_order
from . import res_company
from . import res_config_settings
from . import res_partner
25 changes: 25 additions & 0 deletions purchase_acceptance_tester/models/purchase_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2024 Quartile
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class PurchaseOrder(models.Model):
_inherit = "purchase.order"

acceptance_tester_id = fields.Many2one(
"res.partner", domain=[("is_acceptance_tester", "=", True)]
)
need_acceptance_test = fields.Boolean(compute="_compute_need_acceptance_test")

def _compute_need_acceptance_test(self):
for order in self:
order.need_acceptance_test = False
if not order.company_id.enable_acceptance_tester_check:
continue
if order.order_line.filtered(
lambda x: x.product_id
and x.product_type != "service"
and x.qty_received != x.product_qty
):
order.need_acceptance_test = True
10 changes: 10 additions & 0 deletions purchase_acceptance_tester/models/res_company.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2024 Quartile
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResCompany(models.Model):
_inherit = "res.company"

enable_acceptance_tester_check = fields.Boolean()
16 changes: 16 additions & 0 deletions purchase_acceptance_tester/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024 Quartile
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"

enable_acceptance_tester_check = fields.Boolean(
"Acceptance Tester Check",
related="company_id.enable_acceptance_tester_check",
readonly=False,
help="Enable the check on the Acceptance Tester field in purchase orders "
"to determine whether setting a value is required or not.",
)
13 changes: 13 additions & 0 deletions purchase_acceptance_tester/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2024 Quartile
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResPartner(models.Model):
_inherit = "res.partner"

is_acceptance_tester = fields.Boolean(
"Acceptance Tester",
help="Select this field if the partner is an acceptance tester.",
)
6 changes: 6 additions & 0 deletions purchase_acceptance_tester/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Go to purchase settings and select 'Enable Acceptance Tester Check' to make the
Acceptance Tester field of purchase orders required on certain conditions (i.e. the
order contains a non-service product that has not been fully received).

For contact records that are to be used as Acceptance Testers, select the 'Is Acceptance
Tester' field in the contact form.
2 changes: 2 additions & 0 deletions purchase_acceptance_tester/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module adds an Acceptance Tester field to the purchase order to indicate to whom an
acceptance test request should be routed.
Loading

0 comments on commit 494a129

Please sign in to comment.