Skip to content

Commit

Permalink
[ADD] account_warn_option
Browse files Browse the repository at this point in the history
  • Loading branch information
Shide committed Apr 17, 2024
1 parent f3939eb commit 8574e22
Show file tree
Hide file tree
Showing 19 changed files with 820 additions and 0 deletions.
114 changes: 114 additions & 0 deletions account_warn_option/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
===================
Account Warn Option
===================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8174803b56739b3e0208de58af9fe84bce692be69b48273b88c608ea51e90460
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
:target: https://odoo-community.org/page/development-status
:alt: Alpha
.. |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-OCA%2Faccount--invoicing-lightgray.png?logo=github
:target: https://github.com/OCA/account-invoicing/tree/15.0/account_warn_option
:alt: OCA/account-invoicing
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-invoicing-15-0/account-invoicing-15-0-account_warn_option
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-invoicing&target_branch=15.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module extends the functionality of Partner blocking messages to
support more consistency between messages and to allow you to set a
blocking message quickly.

.. 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 <https://odoo-community.org/page/development-status>`_

**Table of contents**

.. contents::
:local:

Use Cases / Context
===================

This module has been developed to maintain consistency in the messages
used when blocking customers in account models.

If you need this module for those reasons, these might interest you too:

- sale_warn_option
- purchase_warn_option
- stock_warn_option

Usage
=====

To use this module, you need to:

- Go to a Partner
- Select Warn Options under *Warning on the Invoice*

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-invoicing/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/OCA/account-invoicing/issues/new?body=module:%20account_warn_option%0Aversion:%2015.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
-------

* Moduon

Contributors
------------

- Eduardo de Miguel (`Moduon <https://www.moduon.team/>`__)

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

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-Shide| image:: https://github.com/Shide.png?size=40px
:target: https://github.com/Shide
:alt: Shide
.. |maintainer-rafaelbn| image:: https://github.com/rafaelbn.png?size=40px
:target: https://github.com/rafaelbn
:alt: rafaelbn

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-Shide| |maintainer-rafaelbn|

This module is part of the `OCA/account-invoicing <https://github.com/OCA/account-invoicing/tree/15.0/account_warn_option>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions account_warn_option/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
21 changes: 21 additions & 0 deletions account_warn_option/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2024 Moduon Team S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0)

{
"name": "Account Warn Option",
"summary": "Add Options to Account Warn Messages",
"version": "15.0.1.0.0",
"development_status": "Alpha",
"category": "Accounting/Accounting",
"website": "https://github.com/OCA/account-invoicing",
"author": "Moduon, Odoo Community Association (OCA)",
"maintainers": ["Shide", "rafaelbn"],
"license": "LGPL-3",
"application": False,
"installable": True,
"auto_install": True,
"depends": ["account", "base_warn_option"],
"data": [
"views/res_partner_views.xml",
],
}
52 changes: 52 additions & 0 deletions account_warn_option/i18n/account_warn_option.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_warn_option
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-04-11 09:05+0000\n"
"PO-Revision-Date: 2024-04-11 09:05+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: account_warn_option
#: model:ir.model.fields.selection,name:account_warn_option.selection__warn_option__allowed_warning_usage__partner_invoice_warn
msgid "(Partner) Warning on the Invoice"
msgstr ""

#. module: account_warn_option
#: model:ir.model.fields,field_description:account_warn_option.field_warn_option__allowed_warning_usage
msgid "Allowed Warning Usage"
msgstr ""

#. module: account_warn_option
#: model:ir.model.fields,help:account_warn_option.field_warn_option__allowed_warning_usage
msgid "Allows to choose where the message can be selected"
msgstr ""

#. module: account_warn_option
#: model:ir.model,name:account_warn_option.model_res_partner
msgid "Contact"
msgstr ""

#. module: account_warn_option
#: model:ir.model.fields,field_description:account_warn_option.field_res_partner__invoice_warn_option
#: model:ir.model.fields,field_description:account_warn_option.field_res_users__invoice_warn_option
msgid "Invoice Warn Option"
msgstr ""

#. module: account_warn_option
#: model_terms:ir.ui.view,arch_db:account_warn_option.account_warn_option_partner_form
msgid "Select a warning option"
msgstr ""

#. module: account_warn_option
#: model:ir.model,name:account_warn_option.model_warn_option
msgid "Warn Option"
msgstr ""
54 changes: 54 additions & 0 deletions account_warn_option/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_warn_option
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-04-11 09:05+0000\n"
"PO-Revision-Date: 2024-04-11 11:08+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.4.2\n"

#. module: account_warn_option
#: model:ir.model.fields.selection,name:account_warn_option.selection__warn_option__allowed_warning_usage__partner_invoice_warn
msgid "(Partner) Warning on the Invoice"
msgstr "(Contacto) Advertencia en la factura"

#. module: account_warn_option
#: model:ir.model.fields,field_description:account_warn_option.field_warn_option__allowed_warning_usage
msgid "Allowed Warning Usage"
msgstr "Uso de la alerta permitida"

#. module: account_warn_option
#: model:ir.model.fields,help:account_warn_option.field_warn_option__allowed_warning_usage
msgid "Allows to choose where the message can be selected"
msgstr "Permite elegir dónde puede ser seleccionado el mensaje"

#. module: account_warn_option
#: model:ir.model,name:account_warn_option.model_res_partner
msgid "Contact"
msgstr "Contacto"

#. module: account_warn_option
#: model:ir.model.fields,field_description:account_warn_option.field_res_partner__invoice_warn_option
#: model:ir.model.fields,field_description:account_warn_option.field_res_users__invoice_warn_option
msgid "Invoice Warn Option"
msgstr "Opción de alerta en facturas"

#. module: account_warn_option
#: model_terms:ir.ui.view,arch_db:account_warn_option.account_warn_option_partner_form
msgid "Select a warning option"
msgstr "Selecciona una opción de alerta"

#. module: account_warn_option
#: model:ir.model,name:account_warn_option.model_warn_option
msgid "Warn Option"
msgstr "Opción de alerta"
2 changes: 2 additions & 0 deletions account_warn_option/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import warn_option
from . import res_partner
17 changes: 17 additions & 0 deletions account_warn_option/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2024 Moduon Team S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0)

from odoo import api, fields, models


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

invoice_warn_option = fields.Many2one(
comodel_name="warn.option",
)

@api.onchange("invoice_warn_option")
def _onchange_invoice_warn_option(self):
if self.invoice_warn != "no-message" and self.invoice_warn_option:
self.invoice_warn_msg = self.invoice_warn_option.name
17 changes: 17 additions & 0 deletions account_warn_option/models/warn_option.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2024 Moduon Team S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0)

from odoo import fields, models


class WarnOption(models.Model):
_inherit = "warn.option"

allowed_warning_usage = fields.Selection(
selection_add=[
("partner_invoice_warn", "(Partner) Warning on the Invoice"),
],
ondelete={
"partner_invoice_warn": "set default",
},
)
8 changes: 8 additions & 0 deletions account_warn_option/readme/CONTEXT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This module has been developed to maintain consistency in the messages used when
blocking customers in account models.

If you need this module for those reasons, these might interest you too:

- sale_warn_option
- purchase_warn_option
- stock_warn_option
1 change: 1 addition & 0 deletions account_warn_option/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Eduardo de Miguel ([Moduon](https://www.moduon.team/))
2 changes: 2 additions & 0 deletions account_warn_option/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module extends the functionality of Partner blocking messages to support more
consistency between messages and to allow you to set a blocking message quickly.
4 changes: 4 additions & 0 deletions account_warn_option/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
To use this module, you need to:

- Go to a Partner
- Select Warn Options under _Warning on the Invoice_
Binary file added account_warn_option/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8574e22

Please sign in to comment.