diff --git a/agreement_sale/README.rst b/agreement_sale/README.rst new file mode 100644 index 0000000000..c73fc7ed9c --- /dev/null +++ b/agreement_sale/README.rst @@ -0,0 +1,92 @@ +============== +Agreement Sale +============== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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-OCA%2Fcontract-lightgray.png?logo=github + :target: https://github.com/OCA/contract/tree/12.0/agreement_sale + :alt: OCA/contract +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-agreement_sale + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/110/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds *Agreement* field to Sales Orders + +**Table of contents** + +.. contents:: + :local: + +Known issues / Roadmap +====================== + +Features to evaluate before implementation + +* add smart button on agreement to access implied sales +* add module agreement_account: agreement_sale'll depends on it + +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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Akretion + +Contributors +~~~~~~~~~~~~ + +* Alexis de Lattre + +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-alexis-via| image:: https://github.com/alexis-via.png?size=40px + :target: https://github.com/alexis-via + :alt: alexis-via +.. |maintainer-bealdav| image:: https://github.com/bealdav.png?size=40px + :target: https://github.com/bealdav + :alt: bealdav + +Current `maintainers `__: + +|maintainer-alexis-via| |maintainer-bealdav| + +This module is part of the `OCA/contract `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/agreement_sale/__init__.py b/agreement_sale/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/agreement_sale/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/agreement_sale/__manifest__.py b/agreement_sale/__manifest__.py new file mode 100644 index 0000000000..2d2f61c3a6 --- /dev/null +++ b/agreement_sale/__manifest__.py @@ -0,0 +1,22 @@ +# © 2017 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Agreement Sale", + "summary": "Agreement on sales", + "version": "13.0.1.0.0", + "category": "Contract", + "author": "Akretion, " "Odoo Community Association (OCA)", + "website": "https://github.com/oca/contract", + "license": "AGPL-3", + "depends": ["sale_management", "agreement"], + "data": [ + "security/ir.model.access.csv", + "views/agreement.xml", + "views/sale_order.xml", + "views/res_config_settings.xml", + ], + "development_status": "Beta", + "maintainers": ["alexis-via", "bealdav"], + "installable": True, +} diff --git a/agreement_sale/i18n/agreement_sale.pot b/agreement_sale/i18n/agreement_sale.pot new file mode 100644 index 0000000000..8b5099c0b6 --- /dev/null +++ b/agreement_sale/i18n/agreement_sale.pot @@ -0,0 +1,65 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_sale +# +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: agreement_sale +#: model:ir.model.fields,field_description:agreement_sale.field_sale_order__agreement_id +msgid "Agreement" +msgstr "" + +#. module: agreement_sale +#: model:ir.model.fields,field_description:agreement_sale.field_sale_order__agreement_type_id +msgid "Agreement Type" +msgstr "" + +#. module: agreement_sale +#: model_terms:ir.ui.view,arch_db:agreement_sale.res_config_settings_view_form +msgid "Agreement types" +msgstr "" + +#. module: agreement_sale +#: model_terms:ir.ui.view,arch_db:agreement_sale.res_config_settings_view_form +msgid "Agreements" +msgstr "" + +#. module: agreement_sale +#: model:ir.model,name:agreement_sale.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: agreement_sale +#: model_terms:ir.ui.view,arch_db:agreement_sale.res_config_settings_view_form +msgid "Have a special kind of agreements which act as templates" +msgstr "" + +#. module: agreement_sale +#: model_terms:ir.ui.view,arch_db:agreement_sale.res_config_settings_view_form +msgid "Manage agreements by types" +msgstr "" + +#. module: agreement_sale +#: model:ir.model,name:agreement_sale.model_sale_order +msgid "Sale Order" +msgstr "" + +#. module: agreement_sale +#: model:ir.model.fields,field_description:agreement_sale.field_res_config_settings__group_use_agreement_template +msgid "Use agreement template" +msgstr "" + +#. module: agreement_sale +#: model:ir.model.fields,field_description:agreement_sale.field_res_config_settings__group_use_agreement_type +msgid "Use agreement types" +msgstr "" + diff --git a/agreement_sale/i18n/zh_CN.po b/agreement_sale/i18n/zh_CN.po new file mode 100644 index 0000000000..bd063e6337 --- /dev/null +++ b/agreement_sale/i18n/zh_CN.po @@ -0,0 +1,73 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * agreement_sale +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-09-04 18:23+0000\n" +"Last-Translator: 黎伟杰 <674416404@qq.com>\n" +"Language-Team: none\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 3.8\n" + +#. module: agreement_sale +#: model:ir.model.fields,field_description:agreement_sale.field_sale_order__agreement_id +msgid "Agreement" +msgstr "协议" + +#. module: agreement_sale +#: model:ir.model.fields,field_description:agreement_sale.field_sale_order__agreement_type_id +#, fuzzy +#| msgid "Agreement" +msgid "Agreement Type" +msgstr "协议" + +#. module: agreement_sale +#: model_terms:ir.ui.view,arch_db:agreement_sale.res_config_settings_view_form +#, fuzzy +#| msgid "Agreement" +msgid "Agreement types" +msgstr "协议" + +#. module: agreement_sale +#: model_terms:ir.ui.view,arch_db:agreement_sale.res_config_settings_view_form +#, fuzzy +#| msgid "Agreement" +msgid "Agreements" +msgstr "协议" + +#. module: agreement_sale +#: model:ir.model,name:agreement_sale.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: agreement_sale +#: model_terms:ir.ui.view,arch_db:agreement_sale.res_config_settings_view_form +msgid "Have a special kind of agreements which act as templates" +msgstr "" + +#. module: agreement_sale +#: model_terms:ir.ui.view,arch_db:agreement_sale.res_config_settings_view_form +msgid "Manage agreements by types" +msgstr "" + +#. module: agreement_sale +#: model:ir.model,name:agreement_sale.model_sale_order +msgid "Sale Order" +msgstr "销售订单" + +#. module: agreement_sale +#: model:ir.model.fields,field_description:agreement_sale.field_res_config_settings__group_use_agreement_template +msgid "Use agreement template" +msgstr "" + +#. module: agreement_sale +#: model:ir.model.fields,field_description:agreement_sale.field_res_config_settings__group_use_agreement_type +msgid "Use agreement types" +msgstr "" diff --git a/agreement_sale/models/__init__.py b/agreement_sale/models/__init__.py new file mode 100644 index 0000000000..534c392d21 --- /dev/null +++ b/agreement_sale/models/__init__.py @@ -0,0 +1,2 @@ +from . import sale +from . import res_config_settings diff --git a/agreement_sale/models/res_config_settings.py b/agreement_sale/models/res_config_settings.py new file mode 100644 index 0000000000..71c6827287 --- /dev/null +++ b/agreement_sale/models/res_config_settings.py @@ -0,0 +1,12 @@ +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + _inherit = "res.config.settings" + + group_use_agreement_type = fields.Boolean( + "Use agreement types", implied_group="agreement.group_use_agreement_type" + ) + group_use_agreement_template = fields.Boolean( + "Use agreement template", implied_group="agreement.group_use_agreement_template" + ) diff --git a/agreement_sale/models/sale.py b/agreement_sale/models/sale.py new file mode 100644 index 0000000000..88b52345cd --- /dev/null +++ b/agreement_sale/models/sale.py @@ -0,0 +1,29 @@ +# © 2017 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +from odoo import fields, models + + +class SaleOrder(models.Model): + _inherit = "sale.order" + + agreement_id = fields.Many2one( + comodel_name="agreement", + string="Agreement", + ondelete="restrict", + track_visibility="onchange", + readonly=True, + copy=False, + states={"draft": [("readonly", False)], "sent": [("readonly", False)]}, + ) + + agreement_type_id = fields.Many2one( + comodel_name="agreement.type", + string="Agreement Type", + ondelete="restrict", + track_visibility="onchange", + readonly=True, + copy=True, + states={"draft": [("readonly", False)], "sent": [("readonly", False)]}, + ) diff --git a/agreement_sale/readme/CONTRIBUTORS.rst b/agreement_sale/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..ff65d68ce6 --- /dev/null +++ b/agreement_sale/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Alexis de Lattre diff --git a/agreement_sale/readme/DESCRIPTION.rst b/agreement_sale/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..3f0417552f --- /dev/null +++ b/agreement_sale/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module adds *Agreement* field to Sales Orders diff --git a/agreement_sale/readme/ROADMAP.rst b/agreement_sale/readme/ROADMAP.rst new file mode 100644 index 0000000000..1edf6e09bf --- /dev/null +++ b/agreement_sale/readme/ROADMAP.rst @@ -0,0 +1,4 @@ +Features to evaluate before implementation + +* add smart button on agreement to access implied sales +* add module agreement_account: agreement_sale'll depends on it diff --git a/agreement_sale/security/ir.model.access.csv b/agreement_sale/security/ir.model.access.csv new file mode 100644 index 0000000000..f6e188f41b --- /dev/null +++ b/agreement_sale/security/ir.model.access.csv @@ -0,0 +1,4 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +agreement.access_agreement_full,Full access on agreement grp,agreement.model_agreement,sales_team.group_sale_manager,1,1,1,1 +agreement_sale.access_agreement_type_full,Full access on agreement type grp,agreement.model_agreement_type,sales_team.group_sale_manager,1,1,1,1 +agreement_sale.access_agreement_type_read,Read access on agreement grp,agreement.model_agreement_type,base.group_user,1,0,0,0 diff --git a/agreement_sale/static/description/icon.png b/agreement_sale/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/agreement_sale/static/description/icon.png differ diff --git a/agreement_sale/static/description/index.html b/agreement_sale/static/description/index.html new file mode 100644 index 0000000000..198c00cdc8 --- /dev/null +++ b/agreement_sale/static/description/index.html @@ -0,0 +1,430 @@ + + + + + + +Agreement Sale + + + +
+

Agreement Sale

+ + +

Beta License: AGPL-3 OCA/contract Translate me on Weblate Try me on Runbot

+

This module adds Agreement field to Sales Orders

+

Table of contents

+ +
+

Known issues / Roadmap

+

Features to evaluate before implementation

+
    +
  • add smart button on agreement to access implied sales
  • +
  • add module agreement_account: agreement_sale’ll depends on it
  • +
+
+
+

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 smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Akretion
  • +
+
+
+

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.

+

Current maintainers:

+

alexis-via bealdav

+

This module is part of the OCA/contract project on GitHub.

+

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

+
+
+
+ + diff --git a/agreement_sale/views/agreement.xml b/agreement_sale/views/agreement.xml new file mode 100644 index 0000000000..ae4fa7005c --- /dev/null +++ b/agreement_sale/views/agreement.xml @@ -0,0 +1,16 @@ + + + + + diff --git a/agreement_sale/views/res_config_settings.xml b/agreement_sale/views/res_config_settings.xml new file mode 100644 index 0000000000..62a9c67577 --- /dev/null +++ b/agreement_sale/views/res_config_settings.xml @@ -0,0 +1,60 @@ + + + + res.config.settings.view.form.inherit.agreement + res.config.settings + + + + +

Agreements

+
+
+
+ +
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
diff --git a/agreement_sale/views/sale_order.xml b/agreement_sale/views/sale_order.xml new file mode 100644 index 0000000000..fa1c9b6ad7 --- /dev/null +++ b/agreement_sale/views/sale_order.xml @@ -0,0 +1,19 @@ + + + + sale.order.agreement.form.view + sale.order + + + + + + + + + + + diff --git a/setup/agreement_sale/odoo/addons/agreement_sale b/setup/agreement_sale/odoo/addons/agreement_sale new file mode 120000 index 0000000000..e5afcacde1 --- /dev/null +++ b/setup/agreement_sale/odoo/addons/agreement_sale @@ -0,0 +1 @@ +../../../../agreement_sale \ No newline at end of file diff --git a/setup/agreement_sale/setup.py b/setup/agreement_sale/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/agreement_sale/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)