-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[3851][16.0][ADD] purchase_order_no_owner (#51)
* [ADD] purchase_order_no_owner
- Loading branch information
1 parent
aedb0d2
commit 94f45ff
Showing
12 changed files
with
587 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
======================= | ||
Purchase Order No Owner | ||
======================= | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
:target: https://odoo-community.org/page/development-status | ||
:alt: Beta | ||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
.. |badge3| image:: https://img.shields.io/badge/github-qrtl%2Faxls--custom-lightgray.png?logo=github | ||
:target: https://github.com/qrtl/axls-custom/tree/16.0/purchase_order_no_owner | ||
:alt: qrtl/axls-custom | ||
|
||
|badge1| |badge2| |badge3| | ||
|
||
This module is designed to prevent users from accidentally forgetting to input owner information on a purchase order | ||
by implementing an order confirmation prevention if the owner_id is not filled in. | ||
If the order is not associated with any specific owner, users have the option to set the no_owner field to "True" instead. | ||
|
||
Background | ||
~~~~~~~~~~ | ||
|
||
Users may unintentionally overlook filling out the owner_id field when creating a purchase order | ||
for inventory items that should be linked to a specific owner and subsequently confirm the order. | ||
Once the PO is confirmed, users are not be able to edit the owner_id field to fill in the correct owner. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
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 smashing it by providing a detailed and welcomed | ||
`feedback <https://github.com/qrtl/axls-custom/issues/new?body=module:%20purchase_order_no_owner%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_order_no_owner>`_ project on GitHub. | ||
|
||
You are welcome to contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright 2023 Quartile Limited | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
{ | ||
"name": "Purchase Order No Owner", | ||
"version": "16.0.1.0.0", | ||
"author": "Quartile Limited", | ||
"website": "https://www.quartile.co", | ||
"category": "purchase", | ||
"license": "AGPL-3", | ||
"depends": ["purchase_order_owner"], # owner_id | ||
"data": [ | ||
"views/purchase_order_views.xml", | ||
], | ||
"installable": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * purchase_order_no_owner | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2023-10-11 10:32+0000\n" | ||
"PO-Revision-Date: 2023-10-11 10:32+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_order_no_owner | ||
#: model:ir.model.fields,field_description:purchase_order_no_owner.field_purchase_order__no_owner | ||
msgid "No Owner" | ||
msgstr "オーナー無し" | ||
|
||
#. module: purchase_order_no_owner | ||
#. odoo-python | ||
#: code:addons/purchase_order_no_owner/models/purchase_order.py:0 | ||
#, python-format | ||
msgid "" | ||
"Please select the owner. if you don't want to select any owner for this " | ||
"order, you can set No Owner field as True." | ||
msgstr "オーナーを選択してください。このオーダはオーナーを指定する必要がない場合は、「オーナー無し」項目にチェック入れてください。" | ||
|
||
#. module: purchase_order_no_owner | ||
#: model:ir.model,name:purchase_order_no_owner.model_purchase_order | ||
msgid "Purchase Order" | ||
msgstr "購買オーダ" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import purchase_order |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright 2023 Quartile Limited | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import _, api, fields, models | ||
from odoo.exceptions import UserError | ||
|
||
|
||
class PurchaseOrder(models.Model): | ||
_inherit = "purchase.order" | ||
|
||
no_owner = fields.Boolean() | ||
|
||
def button_confirm(self): | ||
for record in self: | ||
if not record.no_owner and not record.owner_id: | ||
raise UserError( | ||
_( | ||
"Please select the owner. if you don't want to select any owner for" | ||
" this order, you can set No Owner field as True." | ||
) | ||
) | ||
return super(PurchaseOrder, self).button_confirm() | ||
|
||
@api.onchange("no_owner") | ||
def onchange_no_owner(self): | ||
if self.no_owner and self.owner_id: | ||
self.owner_id = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
This module is designed to prevent users from accidentally forgetting to input owner information on a purchase order | ||
by implementing an order confirmation prevention if the owner_id is not filled in. | ||
If the order is not associated with any specific owner, users have the option to set the no_owner field to "True" instead. | ||
|
||
Background | ||
~~~~~~~~~~ | ||
|
||
Users may unintentionally overlook filling out the owner_id field when creating a purchase order | ||
for inventory items that should be linked to a specific owner and subsequently confirm the order. | ||
Once the PO is confirmed, users are not be able to edit the owner_id field to fill in the correct owner. |
Oops, something went wrong.