Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] purchase_partner_incoterm #3

Merged
merged 19 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 119 additions & 0 deletions purchase_partner_incoterm/README.rst
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/OCA/purchase-workflow/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/purchase-workflow/issues/new?body=module:%20purchase_partner_incoterm%0Aversion:%2017.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
-------

* Camptocamp

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

- `Camptocamp <https://www.camptocamp.com>`__:

- Thierry Ducrest <[email protected]>
- Denis Leemann <[email protected]>

- `Trobz <https://trobz.com>`__:

- Son Ho <[email protected]>
- Chau Le <[email protected]>

- `Akretion <https://akretion.com>`__:

- David BEAL <[email protected]>
- Raphaël Reverdy <[email protected]>

- `InitOS <https://www.initos.com>`__:

- Dhara Solanki <[email protected]>

- Manish Kumar Bohra [email protected]

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 <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-TDu| |maintainer-bealdav|

This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/17.0/purchase_partner_incoterm>`_ 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 purchase_partner_incoterm/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
21 changes: 21 additions & 0 deletions purchase_partner_incoterm/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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,
}
50 changes: 50 additions & 0 deletions purchase_partner_incoterm/i18n/it.po
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>\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"
46 changes: 46 additions & 0 deletions purchase_partner_incoterm/i18n/purchase_partner_incoterm.pot
Original file line number Diff line number Diff line change
@@ -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 ""
2 changes: 2 additions & 0 deletions purchase_partner_incoterm/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import purchase_order
from . import res_partner
22 changes: 22 additions & 0 deletions purchase_partner_incoterm/models/purchase_order.py
Original file line number Diff line number Diff line change
@@ -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
25 changes: 25 additions & 0 deletions purchase_partner_incoterm/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -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",
]
3 changes: 3 additions & 0 deletions purchase_partner_incoterm/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
16 changes: 16 additions & 0 deletions purchase_partner_incoterm/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
- [Camptocamp](https://www.camptocamp.com):
- Thierry Ducrest \<<[email protected]>\>
- Denis Leemann \<<[email protected]>\>

- [Trobz](https://trobz.com):
- Son Ho \<<[email protected]>\>
- Chau Le \<<[email protected]>\>

- [Akretion](https://akretion.com):
- David BEAL \<<[email protected]>\>
- Raphaël Reverdy \<<[email protected]>\>

- [InitOS](https://www.initos.com):
- Dhara Solanki \<<[email protected]>\>

- Manish Kumar Bohra <[email protected]>
3 changes: 3 additions & 0 deletions purchase_partner_incoterm/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Financial support**
- Cosanum
- Camptocamp R&D
6 changes: 6 additions & 0 deletions purchase_partner_incoterm/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading