diff --git a/account_payment_term_restricted/README.rst b/account_payment_term_restricted/README.rst new file mode 100644 index 00000000000..fabdfb1a95c --- /dev/null +++ b/account_payment_term_restricted/README.rst @@ -0,0 +1,93 @@ +======================================================== +Account Payment Terms - Customer / Supplier Restrictions +======================================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:8eb5bd25c0d6d1848b3a8d137b90ec7c7364ffc77eb2756f5b971be696ec2b04 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-OCA%2Faccount--payment-lightgray.png?logo=github + :target: https://github.com/OCA/account-payment/tree/18.0/account_payment_term_restricted + :alt: OCA/account-payment +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/account-payment-18-0/account-payment-18-0-account_payment_term_restricted + :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-payment&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +- Model account payment term. + + - Add two new fields + + - for_customer + - for_supplier + + - Add domain on partner form, to limit displays of account payment + term. + +This module is distributed in the hope that it will be useful. + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Sylvain LE GAL +* La Louve +* Druidoo + +Contributors +------------ + +- Sylvain LE GAL + <`https://twitter.com/legalsylvain\\> >`__ +- Druidoo <`https://www.druidoo.io\\> >`__ +- `Trobz `__ + + - Phan Hong Phuc + +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. + +This module is part of the `OCA/account-payment `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_payment_term_restricted/__init__.py b/account_payment_term_restricted/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/account_payment_term_restricted/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/account_payment_term_restricted/__manifest__.py b/account_payment_term_restricted/__manifest__.py new file mode 100644 index 00000000000..487c385321b --- /dev/null +++ b/account_payment_term_restricted/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright (C) 2016-Today: La Louve () +# Copyright (C) 2019-Today: Druidoo () +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Account Payment Terms - Customer / Supplier Restrictions", + "version": "18.0.1.0.0", + "category": "Accounting", + "author": "Sylvain LE GAL, La Louve, Druidoo, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/account-payment", + "license": "AGPL-3", + "depends": [ + "account", + ], + "data": [ + "views/view_account_payment_term.xml", + ], +} diff --git a/account_payment_term_restricted/i18n/account_payment_term_restricted.pot b/account_payment_term_restricted/i18n/account_payment_term_restricted.pot new file mode 100644 index 00000000000..02b32921ce3 --- /dev/null +++ b/account_payment_term_restricted/i18n/account_payment_term_restricted.pot @@ -0,0 +1,59 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_term_restricted +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \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_payment_term_restricted +#: model:ir.model,name:account_payment_term_restricted.model_res_partner +msgid "Contact" +msgstr "" + +#. module: account_payment_term_restricted +#: model:ir.model.fields,field_description:account_payment_term_restricted.field_res_partner__property_payment_term_id +#: model:ir.model.fields,field_description:account_payment_term_restricted.field_res_users__property_payment_term_id +msgid "Customer Payment Terms" +msgstr "" + +#. module: account_payment_term_restricted +#: model:ir.model,name:account_payment_term_restricted.model_account_payment_term +msgid "Payment Terms" +msgstr "" + +#. module: account_payment_term_restricted +#: model:ir.model.fields,help:account_payment_term_restricted.field_res_partner__property_supplier_payment_term_id +#: model:ir.model.fields,help:account_payment_term_restricted.field_res_users__property_supplier_payment_term_id +msgid "This payment term will be used instead of the default one for purchase orders and vendor bills" +msgstr "" + +#. module: account_payment_term_restricted +#: model:ir.model.fields,help:account_payment_term_restricted.field_res_partner__property_payment_term_id +#: model:ir.model.fields,help:account_payment_term_restricted.field_res_users__property_payment_term_id +msgid "This payment term will be used instead of the default one for sales orders and customer invoices" +msgstr "" + +#. module: account_payment_term_restricted +#: model:ir.model.fields,field_description:account_payment_term_restricted.field_res_partner__property_supplier_payment_term_id +#: model:ir.model.fields,field_description:account_payment_term_restricted.field_res_users__property_supplier_payment_term_id +msgid "Vendor Payment Terms" +msgstr "" + +#. module: account_payment_term_restricted +#: model:ir.model.fields,field_description:account_payment_term_restricted.field_account_payment_term__for_customer +msgid "for Customers" +msgstr "" + +#. module: account_payment_term_restricted +#: model:ir.model.fields,field_description:account_payment_term_restricted.field_account_payment_term__for_supplier +msgid "for Suppliers" +msgstr "" + diff --git a/account_payment_term_restricted/i18n/fr.po b/account_payment_term_restricted/i18n/fr.po new file mode 100644 index 00000000000..9e98a07bad3 --- /dev/null +++ b/account_payment_term_restricted/i18n/fr.po @@ -0,0 +1,69 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_term_restricted +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-03-19 14:37+0000\n" +"PO-Revision-Date: 2020-03-19 14:37+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_payment_term_restricted +#: model:ir.model,name:account_payment_term_restricted.model_res_partner +msgid "Contact" +msgstr "Contact" + +#. module: account_payment_term_restricted +#: model:ir.model.fields,field_description:account_payment_term_restricted.field_res_partner__property_payment_term_id +#: model:ir.model.fields,field_description:account_payment_term_restricted.field_res_users__property_payment_term_id +msgid "Customer Payment Terms" +msgstr "Conditions de paiement du client" + +#. module: account_payment_term_restricted +#: model:ir.model,name:account_payment_term_restricted.model_account_payment_term +msgid "Payment Terms" +msgstr "Modalités de paiement" + +#. module: account_payment_term_restricted +#: model:ir.model.fields,help:account_payment_term_restricted.field_res_partner__property_supplier_payment_term_id +#: model:ir.model.fields,help:account_payment_term_restricted.field_res_users__property_supplier_payment_term_id +msgid "" +"This payment term will be used instead of the default one for purchase " +"orders and vendor bills" +msgstr "" +"Ce délai de paiement sera utilisé à la place de celui par défaut pour les " +"bons de commande et les factures fournisseurs" + +#. module: account_payment_term_restricted +#: model:ir.model.fields,help:account_payment_term_restricted.field_res_partner__property_payment_term_id +#: model:ir.model.fields,help:account_payment_term_restricted.field_res_users__property_payment_term_id +msgid "" +"This payment term will be used instead of the default one for sales orders " +"and customer invoices" +msgstr "" +"Ce délai de paiement sera utilisé à la place de celui par défaut pour les " +"commandes clients et les factures clients" + +#. module: account_payment_term_restricted +#: model:ir.model.fields,field_description:account_payment_term_restricted.field_res_partner__property_supplier_payment_term_id +#: model:ir.model.fields,field_description:account_payment_term_restricted.field_res_users__property_supplier_payment_term_id +msgid "Vendor Payment Terms" +msgstr "Conditions de paiement du fournisseur" + +#. module: account_payment_term_restricted +#: model:ir.model.fields,field_description:account_payment_term_restricted.field_account_payment_term__for_customer +msgid "for Customers" +msgstr "pour les clients" + +#. module: account_payment_term_restricted +#: model:ir.model.fields,field_description:account_payment_term_restricted.field_account_payment_term__for_supplier +msgid "for Suppliers" +msgstr "pour les fournisseurs" diff --git a/account_payment_term_restricted/models/__init__.py b/account_payment_term_restricted/models/__init__.py new file mode 100644 index 00000000000..99d857997e1 --- /dev/null +++ b/account_payment_term_restricted/models/__init__.py @@ -0,0 +1,7 @@ +# Copyright (C) 2016-Today: La Louve () +# Copyright (C) 2019-Today: Druidoo () +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import res_partner +from . import account_payment_term diff --git a/account_payment_term_restricted/models/account_payment_term.py b/account_payment_term_restricted/models/account_payment_term.py new file mode 100644 index 00000000000..7d3309cc57e --- /dev/null +++ b/account_payment_term_restricted/models/account_payment_term.py @@ -0,0 +1,13 @@ +# Copyright (C) 2016-Today: La Louve () +# Copyright (C) 2019-Today: Druidoo () +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class AccountPaymentTerm(models.Model): + _inherit = "account.payment.term" + + for_customer = fields.Boolean(default=True) + for_supplier = fields.Boolean(default=True) diff --git a/account_payment_term_restricted/models/res_partner.py b/account_payment_term_restricted/models/res_partner.py new file mode 100644 index 00000000000..eb7a6a773ed --- /dev/null +++ b/account_payment_term_restricted/models/res_partner.py @@ -0,0 +1,17 @@ +# Copyright (C) 2016-Today: La Louve () +# Copyright (C) 2019-Today: Druidoo () +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class ResPartner(models.Model): + _inherit = "res.partner" + + property_payment_term_id = fields.Many2one( + domain="[('for_customer', '=', True)]", + ) + property_supplier_payment_term_id = fields.Many2one( + domain="[('for_supplier', '=', True)]", + ) diff --git a/account_payment_term_restricted/pyproject.toml b/account_payment_term_restricted/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/account_payment_term_restricted/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/account_payment_term_restricted/readme/CONTRIBUTORS.md b/account_payment_term_restricted/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..db7a3afd639 --- /dev/null +++ b/account_payment_term_restricted/readme/CONTRIBUTORS.md @@ -0,0 +1,4 @@ +- Sylvain LE GAL \ +- Druidoo \ +- [Trobz](https://www.trobz.com) + - Phan Hong Phuc \ diff --git a/account_payment_term_restricted/readme/DESCRIPTION.md b/account_payment_term_restricted/readme/DESCRIPTION.md new file mode 100644 index 00000000000..a0ea9152adc --- /dev/null +++ b/account_payment_term_restricted/readme/DESCRIPTION.md @@ -0,0 +1,9 @@ +- Model account payment term. + - Add two new fields + - for_customer + - for_supplier + + - Add domain on partner form, to limit displays of account payment + term. + +This module is distributed in the hope that it will be useful. diff --git a/account_payment_term_restricted/static/description/icon.png b/account_payment_term_restricted/static/description/icon.png new file mode 100644 index 00000000000..fd60220fbe2 Binary files /dev/null and b/account_payment_term_restricted/static/description/icon.png differ diff --git a/account_payment_term_restricted/static/description/index.html b/account_payment_term_restricted/static/description/index.html new file mode 100644 index 00000000000..a680c448a8a --- /dev/null +++ b/account_payment_term_restricted/static/description/index.html @@ -0,0 +1,443 @@ + + + + + +Account Payment Terms - Customer / Supplier Restrictions + + + +
+

Account Payment Terms - Customer / Supplier Restrictions

+ + +

Beta License: AGPL-3 OCA/account-payment Translate me on Weblate Try me on Runboat

+
    +
  • Model account payment term.
      +
    • Add two new fields
        +
      • for_customer
      • +
      • for_supplier
      • +
      +
    • +
    • Add domain on partner form, to limit displays of account payment +term.
    • +
    +
  • +
+

This module is distributed in the hope that it will be useful.

+

Table of contents

+ +
+

Bug Tracker

+

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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Sylvain LE GAL
  • +
  • La Louve
  • +
  • Druidoo
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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.

+

This module is part of the OCA/account-payment project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/account_payment_term_restricted/views/view_account_payment_term.xml b/account_payment_term_restricted/views/view_account_payment_term.xml new file mode 100644 index 00000000000..3a4188c4978 --- /dev/null +++ b/account_payment_term_restricted/views/view_account_payment_term.xml @@ -0,0 +1,13 @@ + + + + account.payment.term + + + + + +