Skip to content
Open
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 product_supplierinfo_purchase_contact/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=================================
Product Supplier Purchase Contact
=================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:4e40ad1a5516889c80e7723b017b02fb0e2f0cb7b4ec51d6f0f897ac01ff093f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/license-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/19.0/product_supplierinfo_purchase_contact
: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-19-0/purchase-workflow-19-0-product_supplierinfo_purchase_contact
: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=19.0
:alt: Try me on Runboat

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

This module adds Purchase contact field on supplier rates
(product.supplierinfo) and allows you to use this contact when creating
the purchase order from supplies (replacement or to order).

**Table of contents**

.. contents::
:local:

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

This module had 2 purposes:

- To specify which contact the purchase orders generated from
procurements associated to this supplierinfo have to be put.
- That the auto-created supplierinfo from the purchase order has the
main partner associated, not the specific contact one.

The 'Purchase contact' (purchase_partner_id) field is required if for
example you use sales pricelist based on supplierinfo
(product_pricelist_supplierinfo), you want to use as supplier filter the
'Supplier' (partner_id) field.

Usage
=====

- Go to Purchase > Configuration > Vendor pricelist and create new
Vendor pricelist and complete Purchase contact.
- Go to Inventory > Operations > Replenishment and create a new
replenishment for product with Vendor pricelist created before.
- Press button "Order once" and will create a new purchase order for
Purchase contact instead of Vendor from Vendor Pricelist.

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:%20product_supplierinfo_purchase_contact%0Aversion:%2019.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
-------

* Tecnativa

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

- `Tecnativa <https://www.tecnativa.com>`__:

- Carolina Fernandez
- Pedro M. Baeza
- Víctor Martínez

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-victoralmau| image:: https://github.com/victoralmau.png?size=40px
:target: https://github.com/victoralmau
:alt: victoralmau

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

|maintainer-victoralmau|

This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/19.0/product_supplierinfo_purchase_contact>`_ 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 product_supplierinfo_purchase_contact/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions product_supplierinfo_purchase_contact/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2024 Tecnativa - Carolina Fernandez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Product Supplier Purchase Contact",
"version": "19.0.1.0.0",
"category": "Purchase Management",
"author": "Tecnativa,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/purchase-workflow",
"license": "AGPL-3",
"summary": "Add Purchase Contact in product supplier info",
"depends": ["purchase_stock"],
"data": [
"views/product_supplierinfo_view.xml",
],
"installable": True,
"maintainers": ["victoralmau"],
}
32 changes: 32 additions & 0 deletions product_supplierinfo_purchase_contact/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_supplierinfo_purchase_contact
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-05-21 14:32+0000\n"
"PO-Revision-Date: 2024-05-21 14:32+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: product_supplierinfo_purchase_contact
#: model:ir.model.fields,field_description:product_supplierinfo_purchase_contact.field_product_supplierinfo__purchase_partner_id
msgid "Purchase contact"
msgstr "Contacto de compra"

#. module: product_supplierinfo_purchase_contact
#: model:ir.model,name:product_supplierinfo_purchase_contact.model_stock_rule
msgid "Stock Rule"
msgstr "Regla de Inventario"

#. module: product_supplierinfo_purchase_contact
#: model:ir.model,name:product_supplierinfo_purchase_contact.model_product_supplierinfo
msgid "Supplier Pricelist"
msgstr "Tarifa de proveedor"
32 changes: 32 additions & 0 deletions product_supplierinfo_purchase_contact/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_supplierinfo_purchase_contact
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-06-04 15:38+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\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: product_supplierinfo_purchase_contact
#: model:ir.model.fields,field_description:product_supplierinfo_purchase_contact.field_product_supplierinfo__purchase_partner_id
msgid "Purchase contact"
msgstr "Contratto di acquisto"

#. module: product_supplierinfo_purchase_contact
#: model:ir.model,name:product_supplierinfo_purchase_contact.model_stock_rule
msgid "Stock Rule"
msgstr "Regola di giacenza"

#. module: product_supplierinfo_purchase_contact
#: model:ir.model,name:product_supplierinfo_purchase_contact.model_product_supplierinfo
msgid "Supplier Pricelist"
msgstr "Listino prezzi fornitore"
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_supplierinfo_purchase_contact
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.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: product_supplierinfo_purchase_contact
#: model:ir.model.fields,field_description:product_supplierinfo_purchase_contact.field_product_supplierinfo__purchase_partner_id
msgid "Purchase contact"
msgstr ""

#. module: product_supplierinfo_purchase_contact
#: model:ir.model,name:product_supplierinfo_purchase_contact.model_stock_rule
msgid "Stock Rule"
msgstr ""

#. module: product_supplierinfo_purchase_contact
#: model:ir.model,name:product_supplierinfo_purchase_contact.model_product_supplierinfo
msgid "Supplier Pricelist"
msgstr ""
2 changes: 2 additions & 0 deletions product_supplierinfo_purchase_contact/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import product_supplierinfo
from . import stock_rule
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2024 Tecnativa - Carolina Fernandez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models


class ProductSupplierInfo(models.Model):
_inherit = "product.supplierinfo"

purchase_partner_id = fields.Many2one(
comodel_name="res.partner",
string="Purchase contact",
domain="[('parent_id', '=', partner_id)]",
)
19 changes: 19 additions & 0 deletions product_supplierinfo_purchase_contact/models/stock_rule.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2024 Tecnativa - Carolina Fernandez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models


class StockRule(models.Model):
_inherit = "stock.rule"

def _make_po_get_domain(self, company_id, values, partner):
if values.get("supplier") and values["supplier"].purchase_partner_id:
partner = values["supplier"].purchase_partner_id
return super()._make_po_get_domain(company_id, values, partner)

def _prepare_purchase_order(self, company_id, origins, values):
res = super()._prepare_purchase_order(company_id, origins, values)
values = values[0]
if "supplier" in values and values["supplier"].purchase_partner_id:
res["partner_id"] = values["supplier"].purchase_partner_id.id
return res
3 changes: 3 additions & 0 deletions product_supplierinfo_purchase_contact/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
6 changes: 6 additions & 0 deletions product_supplierinfo_purchase_contact/readme/CONTEXT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
This module had 2 purposes:
- To specify which contact the purchase orders generated from procurements associated to this supplierinfo have to be put.
- That the auto-created supplierinfo from the purchase order has the main partner associated, not the specific contact one.

The 'Purchase contact' (purchase_partner_id) field is required if for example you use sales pricelist based on supplierinfo
(product_pricelist_supplierinfo), you want to use as supplier filter the 'Supplier' (partner_id) field.
5 changes: 5 additions & 0 deletions product_supplierinfo_purchase_contact/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- [Tecnativa](https://www.tecnativa.com):

> - Carolina Fernandez
> - Pedro M. Baeza
> - Víctor Martínez
3 changes: 3 additions & 0 deletions product_supplierinfo_purchase_contact/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This module adds Purchase contact field on supplier rates
(product.supplierinfo) and allows you to use this contact when creating
the purchase order from supplies (replacement or to order).
6 changes: 6 additions & 0 deletions product_supplierinfo_purchase_contact/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- Go to Purchase \> Configuration \> Vendor pricelist and create new
Vendor pricelist and complete Purchase contact.
- Go to Inventory \> Operations \> Replenishment and create a new
replenishment for product with Vendor pricelist created before.
- Press button "Order once" and will create a new purchase order for
Purchase contact instead of Vendor from Vendor Pricelist.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading