-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[16.0][ADD] purchase_stock_picking_type_location_src: In purchase ord…
…er if the picking type has a default source location defined, use that location to create the picking.
- Loading branch information
1 parent
94fd724
commit ddcbe08
Showing
14 changed files
with
301 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
|
||
======================================== | ||
Purchase Stock Picking Type Location Src | ||
======================================== | ||
|
||
* When creating a picking from a purchase order, if the picking type has a | ||
default source location defined, use that location to create the picking. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues | ||
<https://github.com/avanzosc/odoo-addons/issues>`_. In case of trouble, | ||
please check there if your issue has already been reported. If you spotted | ||
it first, help us smash it by providing detailed and welcomed feedback. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Ana Juaristi <anajuaristi@avanzosc.es> | ||
* Alfredo de la Fuente <alfredodelafuente@avanzosc.es> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright 2024 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
{ | ||
"name": "Purchase Stock Picking Type Location Src", | ||
"version": "14.0.1.0.0", | ||
"license": "AGPL-3", | ||
"author": "Avanzosc", | ||
"category": "Inventory/Purchase", | ||
"website": "https://github.com/avanzosc/odoo-addons", | ||
"depends": ["purchase", "stock"], | ||
"data": [], | ||
"installable": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * purchase_stock_picking_type_location_src | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 14.0+e\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-12-03 10:36+0000\n" | ||
"PO-Revision-Date: 2024-12-03 10:36+0000\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_stock_picking_type_location_src | ||
#: model:ir.model.fields,field_description:purchase_stock_picking_type_location_src.field_purchase_order__display_name | ||
msgid "Display Name" | ||
msgstr "" | ||
|
||
#. module: purchase_stock_picking_type_location_src | ||
#: model:ir.model.fields,field_description:purchase_stock_picking_type_location_src.field_purchase_order__id | ||
msgid "ID" | ||
msgstr "" | ||
|
||
#. module: purchase_stock_picking_type_location_src | ||
#: model:ir.model.fields,field_description:purchase_stock_picking_type_location_src.field_purchase_order____last_update | ||
msgid "Last Modified on" | ||
msgstr "" | ||
|
||
#. module: purchase_stock_picking_type_location_src | ||
#: model:ir.model,name:purchase_stock_picking_type_location_src.model_purchase_order | ||
msgid "Purchase Order" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * purchase_stock_picking_type_location_src | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 14.0+e\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-12-03 10:37+0000\n" | ||
"PO-Revision-Date: 2024-12-03 10:37+0000\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_stock_picking_type_location_src | ||
#: model:ir.model.fields,field_description:purchase_stock_picking_type_location_src.field_purchase_order__display_name | ||
msgid "Display Name" | ||
msgstr "Nombre mostrado" | ||
|
||
#. module: purchase_stock_picking_type_location_src | ||
#: model:ir.model.fields,field_description:purchase_stock_picking_type_location_src.field_purchase_order__id | ||
msgid "ID" | ||
msgstr "" | ||
|
||
#. module: purchase_stock_picking_type_location_src | ||
#: model:ir.model.fields,field_description:purchase_stock_picking_type_location_src.field_purchase_order____last_update | ||
msgid "Last Modified on" | ||
msgstr "Última modificación el" | ||
|
||
#. module: purchase_stock_picking_type_location_src | ||
#: model:ir.model,name:purchase_stock_picking_type_location_src.model_purchase_order | ||
msgid "Purchase Order" | ||
msgstr "Pedido de compra" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * purchase_stock_picking_type_location_src | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 14.0+e\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-12-03 10:36+0000\n" | ||
"PO-Revision-Date: 2024-12-03 10:36+0000\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_stock_picking_type_location_src | ||
#: model:ir.model.fields,field_description:purchase_stock_picking_type_location_src.field_purchase_order__display_name | ||
msgid "Display Name" | ||
msgstr "Nome visualizzato" | ||
|
||
#. module: purchase_stock_picking_type_location_src | ||
#: model:ir.model.fields,field_description:purchase_stock_picking_type_location_src.field_purchase_order__id | ||
msgid "ID" | ||
msgstr "" | ||
|
||
#. module: purchase_stock_picking_type_location_src | ||
#: model:ir.model.fields,field_description:purchase_stock_picking_type_location_src.field_purchase_order____last_update | ||
msgid "Last Modified on" | ||
msgstr "Ultima modifica il" | ||
|
||
#. module: purchase_stock_picking_type_location_src | ||
#: model:ir.model,name:purchase_stock_picking_type_location_src.model_purchase_order | ||
msgid "Purchase Order" | ||
msgstr "Ordine di acquisto" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * purchase_stock_picking_type_location_src | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 14.0+e\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-12-03 10:36+0000\n" | ||
"PO-Revision-Date: 2024-12-03 10:36+0000\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_stock_picking_type_location_src | ||
#: model:ir.model.fields,field_description:purchase_stock_picking_type_location_src.field_purchase_order__display_name | ||
msgid "Display Name" | ||
msgstr "Nome" | ||
|
||
#. module: purchase_stock_picking_type_location_src | ||
#: model:ir.model.fields,field_description:purchase_stock_picking_type_location_src.field_purchase_order__id | ||
msgid "ID" | ||
msgstr "Id." | ||
|
||
#. module: purchase_stock_picking_type_location_src | ||
#: model:ir.model.fields,field_description:purchase_stock_picking_type_location_src.field_purchase_order____last_update | ||
msgid "Last Modified on" | ||
msgstr "Última Modificação em" | ||
|
||
#. module: purchase_stock_picking_type_location_src | ||
#: model:ir.model,name:purchase_stock_picking_type_location_src.model_purchase_order | ||
msgid "Purchase Order" | ||
msgstr "Ordem de Compra" |
36 changes: 36 additions & 0 deletions
36
purchase_stock_picking_type_location_src/i18n/purchase_stock_picking_type_location_src.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * purchase_stock_picking_type_location_src | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 14.0+e\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-12-03 10:35+0000\n" | ||
"PO-Revision-Date: 2024-12-03 10:35+0000\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_stock_picking_type_location_src | ||
#: model:ir.model.fields,field_description:purchase_stock_picking_type_location_src.field_purchase_order__display_name | ||
msgid "Display Name" | ||
msgstr "" | ||
|
||
#. module: purchase_stock_picking_type_location_src | ||
#: model:ir.model.fields,field_description:purchase_stock_picking_type_location_src.field_purchase_order__id | ||
msgid "ID" | ||
msgstr "" | ||
|
||
#. module: purchase_stock_picking_type_location_src | ||
#: model:ir.model.fields,field_description:purchase_stock_picking_type_location_src.field_purchase_order____last_update | ||
msgid "Last Modified on" | ||
msgstr "" | ||
|
||
#. module: purchase_stock_picking_type_location_src | ||
#: model:ir.model,name:purchase_stock_picking_type_location_src.model_purchase_order | ||
msgid "Purchase Order" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * purchase_stock_picking_type_location_src | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 14.0+e\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-12-03 10:35+0000\n" | ||
"PO-Revision-Date: 2024-12-03 10:35+0000\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_stock_picking_type_location_src | ||
#: model:ir.model.fields,field_description:purchase_stock_picking_type_location_src.field_purchase_order__display_name | ||
msgid "Display Name" | ||
msgstr "显示名称" | ||
|
||
#. module: purchase_stock_picking_type_location_src | ||
#: model:ir.model.fields,field_description:purchase_stock_picking_type_location_src.field_purchase_order__id | ||
msgid "ID" | ||
msgstr "" | ||
|
||
#. module: purchase_stock_picking_type_location_src | ||
#: model:ir.model.fields,field_description:purchase_stock_picking_type_location_src.field_purchase_order____last_update | ||
msgid "Last Modified on" | ||
msgstr "最后修改日" | ||
|
||
#. module: purchase_stock_picking_type_location_src | ||
#: model:ir.model,name:purchase_stock_picking_type_location_src.model_purchase_order | ||
msgid "Purchase Order" | ||
msgstr "采购订单" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import purchase_order | ||
from . import purchase_order_line |
13 changes: 13 additions & 0 deletions
13
purchase_stock_picking_type_location_src/models/purchase_order.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright 2024 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
from odoo import models | ||
|
||
|
||
class PurchaseOrder(models.Model): | ||
_inherit = "purchase.order" | ||
|
||
def _prepare_picking(self): | ||
result = super(PurchaseOrder, self)._prepare_picking() | ||
if self.picking_type_id.default_location_src_id: | ||
result["location_id"] = self.picking_type_id.default_location_src_id.id | ||
return result |
20 changes: 20 additions & 0 deletions
20
purchase_stock_picking_type_location_src/models/purchase_order_line.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2024 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
from odoo import models | ||
|
||
|
||
class PurchaseOrderLine(models.Model): | ||
_inherit = "purchase.order.line" | ||
|
||
def _prepare_stock_move_vals( | ||
self, picking, price_unit, product_uom_qty, product_uom | ||
): | ||
self.ensure_one() | ||
vals = super(PurchaseOrderLine, self)._prepare_stock_move_vals( | ||
picking, price_unit, product_uom_qty, product_uom | ||
) | ||
if self.order_id.picking_type_id.default_location_src_id: | ||
vals[ | ||
"location_id" | ||
] = self.order_id.picking_type_id.default_location_src_id.id | ||
return vals |
1 change: 1 addition & 0 deletions
1
...hase_stock_picking_type_location_src/odoo/addons/purchase_stock_picking_type_location_src
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../purchase_stock_picking_type_location_src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |