Skip to content

Commit

Permalink
Merge PR OCA#1526 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Feb 28, 2024
2 parents 0fe41d7 + 27f62c3 commit 8262d14
Show file tree
Hide file tree
Showing 21 changed files with 974 additions and 0 deletions.
117 changes: 117 additions & 0 deletions product_supplierinfo_stock_picking_type/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
=======================================
Product supplierinfo stock picking type
=======================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:ad2e3f5f5180421afe87f06c3b91c43c4f9f145c5b418e2a12b5352b7c790231
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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%2Fproduct--attribute-lightgray.png?logo=github
:target: https://github.com/OCA/product-attribute/tree/16.0/product_supplierinfo_stock_picking_type
:alt: OCA/product-attribute
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_supplierinfo_stock_picking_type
: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/product-attribute&target_branch=16.0
:alt: Try me on Runboat

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

This module allows to set picking types in 'Vendors' of 'Purchase' tab.

**Table of contents**

.. contents::
:local:

Configuration
=============

#. Go to *Inventory > Configuration > Settings*.
#. Check 'Storage Locations' checkbox in *Warehouse* section.

Usage
=====

#. Go to *Inventory > Configuration > Operations types* and create two records
named 'Incoming A' and 'Incoming B' with 'Type of Operation' equal to
'Receipt'.
#. Go to *Inventory > Products > Products*, then create a product named
'Test product' and set 'Purchase' tab as follows:
#. [Vendor line 1] Vendor: Azure Interior, Picking type: Incoming A, Price: 5.
#. [Vendor line 2] Vendor: Azure Interior, Picking type: Incoming B, Price: 10.
#. Then click on 'Save'.

Next steps:

Purchase order flow A:
#. Go to *Purchase > Orders > Requests for Quotation* and create a new order as follows:
#. Vendor: Azure Interior; Product: Test product; Deliver To: Incoming A (under 'Other information' tab)
#. The unit price of the product will be 5.

Purchase order flow B:
#. Go to *Purchase > Orders > Requests for Quotation* and create a new order as follows:
#. Vendor: Azure Interior; Product: Test product; Deliver To: Incoming B (under 'Other information' tab)
#. The unit price of the product will be 10.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/product-attribute/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/product-attribute/issues/new?body=module:%20product_supplierinfo_stock_picking_type%0Aversion:%2016.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>`_:

* Víctor Martínez
* Pedro M. Baeza

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/product-attribute <https://github.com/OCA/product-attribute/tree/16.0/product_supplierinfo_stock_picking_type>`_ 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_stock_picking_type/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions product_supplierinfo_stock_picking_type/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2022 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Product supplierinfo stock picking type",
"version": "16.0.1.0.0",
"category": "Product",
"website": "https://github.com/OCA/product-attribute",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": ["purchase_stock"],
"installable": True,
"data": [
"views/product_supplierinfo_view.xml",
],
"maintainers": ["victoralmau"],
}
60 changes: 60 additions & 0 deletions product_supplierinfo_stock_picking_type/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_supplierinfo_stock_picking_type
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-09-01 16:08+0000\n"
"PO-Revision-Date: 2024-01-15 16:36+0000\n"
"Last-Translator: Ivorra78 <[email protected]>\n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: product_supplierinfo_stock_picking_type
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_product__display_name
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_supplierinfo__display_name
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_purchase_order__display_name
msgid "Display Name"
msgstr "Nombre mostrado"

#. module: product_supplierinfo_stock_picking_type
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_product__id
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_supplierinfo__id
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_purchase_order__id
msgid "ID"
msgstr "ID"

#. module: product_supplierinfo_stock_picking_type
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_product____last_update
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_supplierinfo____last_update
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_purchase_order____last_update
msgid "Last Modified on"
msgstr "Última modificación el"

#. module: product_supplierinfo_stock_picking_type
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_customerinfo__picking_type_id
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_supplierinfo__picking_type_id
msgid "Picking Type"
msgstr "Tipo de albarán"

#. module: product_supplierinfo_stock_picking_type
#: model:ir.model,name:product_supplierinfo_stock_picking_type.model_product_product
msgid "Product"
msgstr "Producto"

#. module: product_supplierinfo_stock_picking_type
#: model:ir.model,name:product_supplierinfo_stock_picking_type.model_purchase_order
msgid "Purchase Order"
msgstr "Orden de Compra"

#. module: product_supplierinfo_stock_picking_type
#: model:ir.model,name:product_supplierinfo_stock_picking_type.model_product_supplierinfo
msgid "Supplier Pricelist"
msgstr "Tarifa de proveedor"
59 changes: 59 additions & 0 deletions product_supplierinfo_stock_picking_type/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_supplierinfo_stock_picking_type
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-11-03 13:36+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: product_supplierinfo_stock_picking_type
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_product__display_name
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_supplierinfo__display_name
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_purchase_order__display_name
msgid "Display Name"
msgstr "Nome visualizzato"

#. module: product_supplierinfo_stock_picking_type
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_product__id
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_supplierinfo__id
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_purchase_order__id
msgid "ID"
msgstr "ID"

#. module: product_supplierinfo_stock_picking_type
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_product____last_update
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_supplierinfo____last_update
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_purchase_order____last_update
msgid "Last Modified on"
msgstr "Ultima modifica il"

#. module: product_supplierinfo_stock_picking_type
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_customerinfo__picking_type_id
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_supplierinfo__picking_type_id
msgid "Picking Type"
msgstr "Tipologia prelievo"

#. module: product_supplierinfo_stock_picking_type
#: model:ir.model,name:product_supplierinfo_stock_picking_type.model_product_product
msgid "Product"
msgstr "Prodotto"

#. module: product_supplierinfo_stock_picking_type
#: model:ir.model,name:product_supplierinfo_stock_picking_type.model_purchase_order
msgid "Purchase Order"
msgstr "Ordine di acquisto"

#. module: product_supplierinfo_stock_picking_type
#: model:ir.model,name:product_supplierinfo_stock_picking_type.model_product_supplierinfo
msgid "Supplier Pricelist"
msgstr "Listino prezzi fornitore"
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_supplierinfo_stock_picking_type
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.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_stock_picking_type
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_product__display_name
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_supplierinfo__display_name
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_purchase_order__display_name
msgid "Display Name"
msgstr ""

#. module: product_supplierinfo_stock_picking_type
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_product__id
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_supplierinfo__id
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_purchase_order__id
msgid "ID"
msgstr ""

#. module: product_supplierinfo_stock_picking_type
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_product____last_update
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_supplierinfo____last_update
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_purchase_order____last_update
msgid "Last Modified on"
msgstr ""

#. module: product_supplierinfo_stock_picking_type
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_customerinfo__picking_type_id
#: model:ir.model.fields,field_description:product_supplierinfo_stock_picking_type.field_product_supplierinfo__picking_type_id
msgid "Picking Type"
msgstr ""

#. module: product_supplierinfo_stock_picking_type
#: model:ir.model,name:product_supplierinfo_stock_picking_type.model_product_product
msgid "Product"
msgstr ""

#. module: product_supplierinfo_stock_picking_type
#: model:ir.model,name:product_supplierinfo_stock_picking_type.model_purchase_order
msgid "Purchase Order"
msgstr ""

#. module: product_supplierinfo_stock_picking_type
#: model:ir.model,name:product_supplierinfo_stock_picking_type.model_product_supplierinfo
msgid "Supplier Pricelist"
msgstr ""
5 changes: 5 additions & 0 deletions product_supplierinfo_stock_picking_type/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import product_product
from . import product_supplierinfo
from . import purchase_order
16 changes: 16 additions & 0 deletions product_supplierinfo_stock_picking_type/models/product_product.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2022 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models


class ProductProduct(models.Model):
_inherit = "product.product"

def _prepare_sellers(self, params=False):
res = super()._prepare_sellers(params)
if params and params.get("order_id"):
return res.filtered(
lambda x: not x.picking_type_id
or x.picking_type_id == params.get("order_id").picking_type_id
)
return res
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright 2022 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models


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

picking_type_id = fields.Many2one(comodel_name="stock.picking.type")
12 changes: 12 additions & 0 deletions product_supplierinfo_stock_picking_type/models/purchase_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright 2022 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, models


class PurchaseOrder(models.Model):
_inherit = "purchase.order"

@api.onchange("picking_type_id")
def onchange_picking_type_id(self):
for line in self.order_line:
line.onchange_product_id()
2 changes: 2 additions & 0 deletions product_supplierinfo_stock_picking_type/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#. Go to *Inventory > Configuration > Settings*.
#. Check 'Storage Locations' checkbox in *Warehouse* section.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* `Tecnativa <https://www.tecnativa.com>`_:

* Víctor Martínez
* Pedro M. Baeza
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module allows to set picking types in 'Vendors' of 'Purchase' tab.
20 changes: 20 additions & 0 deletions product_supplierinfo_stock_picking_type/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#. Go to *Inventory > Configuration > Operations types* and create two records
named 'Incoming A' and 'Incoming B' with 'Type of Operation' equal to
'Receipt'.
#. Go to *Inventory > Products > Products*, then create a product named
'Test product' and set 'Purchase' tab as follows:
#. [Vendor line 1] Vendor: Azure Interior, Picking type: Incoming A, Price: 5.
#. [Vendor line 2] Vendor: Azure Interior, Picking type: Incoming B, Price: 10.
#. Then click on 'Save'.

Next steps:

Purchase order flow A:
#. Go to *Purchase > Orders > Requests for Quotation* and create a new order as follows:
#. Vendor: Azure Interior; Product: Test product; Deliver To: Incoming A (under 'Other information' tab)
#. The unit price of the product will be 5.

Purchase order flow B:
#. Go to *Purchase > Orders > Requests for Quotation* and create a new order as follows:
#. Vendor: Azure Interior; Product: Test product; Deliver To: Incoming B (under 'Other information' tab)
#. The unit price of the product will be 10.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8262d14

Please sign in to comment.