diff --git a/purchase_partner_incoterm/README.rst b/purchase_partner_incoterm/README.rst new file mode 100644 index 00000000000..e8fd5ff968a --- /dev/null +++ b/purchase_partner_incoterm/README.rst @@ -0,0 +1,119 @@ +===================================== +Default purchase incoterm per partner +===================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:1679d1ffb6e608db2dac3887451673e17077113039e4bb701b2159d3bf55b06c + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fpurchase--workflow-lightgray.png?logo=github + :target: https://github.com/OCA/purchase-workflow/tree/17.0/purchase_partner_incoterm + :alt: OCA/purchase-workflow +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/purchase-workflow-17-0/purchase-workflow-17-0-purchase_partner_incoterm + :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/purchase-workflow&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds incoterms for suppliers and purchase order: + +- incoterm modes +- incoterm address + +Based on Partner/Supplier It will add Incoterm address. + +**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 +------- + +* Camptocamp + +Contributors +------------ + +- `Camptocamp `__: + + - Thierry Ducrest + - Denis Leemann + +- `Trobz `__: + + - Son Ho + - Chau Le + +- `Akretion `__: + + - David BEAL + - Raphaël Reverdy + +- `InitOS `__: + + - Dhara Solanki + +- Manish Kumar Bohra manishkumarbohra@outlook.com + +Other credits +------------- + +**Financial support** + +- Cosanum +- Camptocamp R&D + +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-TDu| image:: https://github.com/TDu.png?size=40px + :target: https://github.com/TDu + :alt: TDu +.. |maintainer-bealdav| image:: https://github.com/bealdav.png?size=40px + :target: https://github.com/bealdav + :alt: bealdav + +Current `maintainers `__: + +|maintainer-TDu| |maintainer-bealdav| + +This module is part of the `OCA/purchase-workflow `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/purchase_partner_incoterm/__init__.py b/purchase_partner_incoterm/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/purchase_partner_incoterm/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/purchase_partner_incoterm/__manifest__.py b/purchase_partner_incoterm/__manifest__.py new file mode 100644 index 00000000000..6b2aaa231ad --- /dev/null +++ b/purchase_partner_incoterm/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2020-2022 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "Default purchase incoterm per partner", + "summary": "Add a an incoterm field for supplier and use it on purchase order", + "version": "17.0.1.0.0", + "category": "Purchase", + "author": "Camptocamp, Odoo Community Association (OCA)", + "license": "AGPL-3", + "maintainers": ["TDu", "bealdav"], + "depends": [ + "account", + "purchase_stock", + ], + "website": "https://github.com/OCA/purchase-workflow", + "data": [ + "views/partner_view.xml", + "views/purchase_view.xml", + ], + "installable": True, +} diff --git a/purchase_partner_incoterm/i18n/it.po b/purchase_partner_incoterm/i18n/it.po new file mode 100644 index 00000000000..b6224017bda --- /dev/null +++ b/purchase_partner_incoterm/i18n/it.po @@ -0,0 +1,50 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_partner_incoterm +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-12-24 15:34+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: purchase_partner_incoterm +#: model:ir.model.fields,help:purchase_partner_incoterm.field_purchase_order__incoterm_address_id +msgid "Address where goods responsibility is transferred to the buyer" +msgstr "" +"Indirizzo dove la responsabilità della merce viene trasferita all'acquirente" + +#. module: purchase_partner_incoterm +#: model:ir.model,name:purchase_partner_incoterm.model_res_partner +msgid "Contact" +msgstr "Contatto" + +#. module: purchase_partner_incoterm +#: model:ir.model.fields,field_description:purchase_partner_incoterm.field_res_partner__purchase_incoterm_id +#: model:ir.model.fields,field_description:purchase_partner_incoterm.field_res_users__purchase_incoterm_id +msgid "Default Purchase Incoterm" +msgstr "Incoterm acquisto predefinito" + +#. module: purchase_partner_incoterm +#: model:ir.model.fields,field_description:purchase_partner_incoterm.field_res_partner__purchase_incoterm_address_id +#: model:ir.model.fields,field_description:purchase_partner_incoterm.field_res_users__purchase_incoterm_address_id +msgid "Default Purchase Incoterm Address" +msgstr "Indirizzo incoterm acquisto predefinito" + +#. module: purchase_partner_incoterm +#: model:ir.model.fields,field_description:purchase_partner_incoterm.field_purchase_order__incoterm_address_id +msgid "Incoterm Address" +msgstr "Indirizzo Incoterm" + +#. module: purchase_partner_incoterm +#: model:ir.model,name:purchase_partner_incoterm.model_purchase_order +msgid "Purchase Order" +msgstr "Ordine di acquisto" diff --git a/purchase_partner_incoterm/i18n/purchase_partner_incoterm.pot b/purchase_partner_incoterm/i18n/purchase_partner_incoterm.pot new file mode 100644 index 00000000000..73290fa48a2 --- /dev/null +++ b/purchase_partner_incoterm/i18n/purchase_partner_incoterm.pot @@ -0,0 +1,46 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_partner_incoterm +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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: purchase_partner_incoterm +#: model:ir.model.fields,help:purchase_partner_incoterm.field_purchase_order__incoterm_address_id +msgid "Address where goods responsibility is transferred to the buyer" +msgstr "" + +#. module: purchase_partner_incoterm +#: model:ir.model,name:purchase_partner_incoterm.model_res_partner +msgid "Contact" +msgstr "" + +#. module: purchase_partner_incoterm +#: model:ir.model.fields,field_description:purchase_partner_incoterm.field_res_partner__purchase_incoterm_id +#: model:ir.model.fields,field_description:purchase_partner_incoterm.field_res_users__purchase_incoterm_id +msgid "Default Purchase Incoterm" +msgstr "" + +#. module: purchase_partner_incoterm +#: model:ir.model.fields,field_description:purchase_partner_incoterm.field_res_partner__purchase_incoterm_address_id +#: model:ir.model.fields,field_description:purchase_partner_incoterm.field_res_users__purchase_incoterm_address_id +msgid "Default Purchase Incoterm Address" +msgstr "" + +#. module: purchase_partner_incoterm +#: model:ir.model.fields,field_description:purchase_partner_incoterm.field_purchase_order__incoterm_address_id +msgid "Incoterm Address" +msgstr "" + +#. module: purchase_partner_incoterm +#: model:ir.model,name:purchase_partner_incoterm.model_purchase_order +msgid "Purchase Order" +msgstr "" diff --git a/purchase_partner_incoterm/models/__init__.py b/purchase_partner_incoterm/models/__init__.py new file mode 100644 index 00000000000..abb5aa08ab9 --- /dev/null +++ b/purchase_partner_incoterm/models/__init__.py @@ -0,0 +1,2 @@ +from . import purchase_order +from . import res_partner diff --git a/purchase_partner_incoterm/models/purchase_order.py b/purchase_partner_incoterm/models/purchase_order.py new file mode 100644 index 00000000000..1d2cbee8d75 --- /dev/null +++ b/purchase_partner_incoterm/models/purchase_order.py @@ -0,0 +1,22 @@ +# Copyright 2020 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import api, fields, models + + +class PurchaseOrder(models.Model): + _inherit = "purchase.order" + + incoterm_address_id = fields.Many2one( + comodel_name="res.partner", + string="Incoterm Address", + help="Address where goods responsibility is transferred to the buyer", + ) + + @api.onchange("partner_id") + def onchange_partner_id(self): + res = super().onchange_partner_id() + self.incoterm_id = self.partner_id.commercial_partner_id.purchase_incoterm_id + self.incoterm_address_id = ( + self.partner_id.commercial_partner_id.purchase_incoterm_address_id + ) + return res diff --git a/purchase_partner_incoterm/models/res_partner.py b/purchase_partner_incoterm/models/res_partner.py new file mode 100644 index 00000000000..bbb9af86bcf --- /dev/null +++ b/purchase_partner_incoterm/models/res_partner.py @@ -0,0 +1,25 @@ +# Copyright 2020 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import api, fields, models + + +class ResPartner(models.Model): + _inherit = "res.partner" + + purchase_incoterm_id = fields.Many2one( + comodel_name="account.incoterms", + ondelete="restrict", + string="Default Purchase Incoterm", + ) + purchase_incoterm_address_id = fields.Many2one( + comodel_name="res.partner", + ondelete="restrict", + string="Default Purchase Incoterm Address", + ) + + @api.model + def _commercial_fields(self): + return super()._commercial_fields() + [ + "purchase_incoterm_address_id", + "purchase_incoterm_id", + ] diff --git a/purchase_partner_incoterm/pyproject.toml b/purchase_partner_incoterm/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/purchase_partner_incoterm/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/purchase_partner_incoterm/readme/CONTRIBUTORS.md b/purchase_partner_incoterm/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..8bffe6af755 --- /dev/null +++ b/purchase_partner_incoterm/readme/CONTRIBUTORS.md @@ -0,0 +1,16 @@ +- [Camptocamp](https://www.camptocamp.com): + - Thierry Ducrest \<\> + - Denis Leemann \<\> + +- [Trobz](https://trobz.com): + - Son Ho \<\> + - Chau Le \<\> + +- [Akretion](https://akretion.com): + - David BEAL \<\> + - Raphaël Reverdy \<\> + +- [InitOS](https://www.initos.com): + - Dhara Solanki \<\> + +- Manish Kumar Bohra diff --git a/purchase_partner_incoterm/readme/CREDITS.md b/purchase_partner_incoterm/readme/CREDITS.md new file mode 100644 index 00000000000..3447680f444 --- /dev/null +++ b/purchase_partner_incoterm/readme/CREDITS.md @@ -0,0 +1,3 @@ +**Financial support** +- Cosanum +- Camptocamp R&D diff --git a/purchase_partner_incoterm/readme/DESCRIPTION.md b/purchase_partner_incoterm/readme/DESCRIPTION.md new file mode 100644 index 00000000000..7d14ecb445d --- /dev/null +++ b/purchase_partner_incoterm/readme/DESCRIPTION.md @@ -0,0 +1,6 @@ +This module adds incoterms for suppliers and purchase order: + +- incoterm modes +- incoterm address + +Based on Partner/Supplier It will add Incoterm address. diff --git a/purchase_partner_incoterm/static/description/icon.png b/purchase_partner_incoterm/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/purchase_partner_incoterm/static/description/icon.png differ diff --git a/purchase_partner_incoterm/static/description/index.html b/purchase_partner_incoterm/static/description/index.html new file mode 100644 index 00000000000..892700bbcaf --- /dev/null +++ b/purchase_partner_incoterm/static/description/index.html @@ -0,0 +1,459 @@ + + + + + + +Default purchase incoterm per partner + + + +
+

Default purchase incoterm per partner

+ + +

Beta License: AGPL-3 OCA/purchase-workflow Translate me on Weblate Try me on Runboat

+

This module adds incoterms for suppliers and purchase order:

+
    +
  • incoterm modes
  • +
  • incoterm address
  • +
+

Based on Partner/Supplier It will add Incoterm address.

+

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

+
    +
  • Camptocamp
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

Financial support

+
    +
  • Cosanum
  • +
  • Camptocamp R&D
  • +
+
+
+

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:

+

TDu bealdav

+

This module is part of the OCA/purchase-workflow project on GitHub.

+

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

+
+
+
+ + diff --git a/purchase_partner_incoterm/views/partner_view.xml b/purchase_partner_incoterm/views/partner_view.xml new file mode 100644 index 00000000000..8ef3a4bed79 --- /dev/null +++ b/purchase_partner_incoterm/views/partner_view.xml @@ -0,0 +1,14 @@ + + + + res.partner.purchase.form.inherit + res.partner + + + + + + + + + diff --git a/purchase_partner_incoterm/views/purchase_view.xml b/purchase_partner_incoterm/views/purchase_view.xml new file mode 100644 index 00000000000..fbda9080d30 --- /dev/null +++ b/purchase_partner_incoterm/views/purchase_view.xml @@ -0,0 +1,14 @@ + + + + + purchase.order + + + + + + + + +