Add oca-purchase submodule with 96 purchase modules moved from oca-workflow-process

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ernad Husremovic 2025-08-30 18:00:40 +02:00
parent b0628ee8ea
commit 7378b233e9
3994 changed files with 334316 additions and 0 deletions

View file

@ -0,0 +1,47 @@
# Purchase Location by Line
Odoo addon: purchase_location_by_line
## Installation
```bash
pip install odoo-bringout-oca-purchase-workflow-purchase_location_by_line
```
## Dependencies
This addon depends on:
- purchase_stock
- purchase_delivery_split_date
## Manifest Information
- **Name**: Purchase Location by Line
- **Version**: 16.0.1.0.0
- **Category**: Purchase Management
- **License**: AGPL-3
- **Installable**: True
## Source
Based on [OCA/purchase-workflow](https://github.com/OCA/purchase-workflow) branch 16.0, addon `purchase_location_by_line`.
## License
This package maintains the original AGPL-3 license from the upstream Odoo project.
## Documentation
- Overview: doc/OVERVIEW.md
- Architecture: doc/ARCHITECTURE.md
- Models: doc/MODELS.md
- Controllers: doc/CONTROLLERS.md
- Wizards: doc/WIZARDS.md
- Reports: doc/REPORTS.md
- Security: doc/SECURITY.md
- Install: doc/INSTALL.md
- Usage: doc/USAGE.md
- Configuration: doc/CONFIGURATION.md
- Dependencies: doc/DEPENDENCIES.md
- Troubleshooting: doc/TROUBLESHOOTING.md
- FAQ: doc/FAQ.md

View file

@ -0,0 +1,32 @@
# Architecture
```mermaid
flowchart TD
U[Users] -->|HTTP| V[Views and QWeb Templates]
V --> C[Controllers]
V --> W[Wizards Transient Models]
C --> M[Models and ORM]
W --> M
M --> R[Reports]
DX[Data XML] --> M
S[Security ACLs and Groups] -. enforces .-> M
subgraph Purchase_location_by_line Module - purchase_location_by_line
direction LR
M:::layer
W:::layer
C:::layer
V:::layer
R:::layer
S:::layer
DX:::layer
end
classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px
```
Notes
- Views include tree/form/kanban templates and report templates.
- Controllers provide website/portal routes when present.
- Wizards are UI flows implemented with `models.TransientModel`.
- Data XML loads data/demo records; Security defines groups and access.

View file

@ -0,0 +1,3 @@
# Configuration
Refer to Odoo settings for purchase_location_by_line. Configure related models, access rights, and options as needed.

View file

@ -0,0 +1,3 @@
# Controllers
This module does not define custom HTTP controllers.

View file

@ -0,0 +1,6 @@
# Dependencies
This addon depends on:
- [purchase_stock](https://github.com/bringout/oca-ocb-warehouse/tree/0ee5ffef60413a71dceb350918ad3fb572ec1875/odoo-bringout-oca-ocb-purchase_stock)
- [purchase_delivery_split_date](https://github.com/bringout/oca-workflow-process)

View file

@ -0,0 +1,4 @@
# FAQ
- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged).
- Q: How to enable? A: Start server with --addon purchase_location_by_line or install in UI.

View file

@ -0,0 +1,7 @@
# Install
```bash
pip install odoo-bringout-oca-purchase-workflow-purchase_location_by_line"
# or
uv pip install odoo-bringout-oca-purchase-workflow-purchase_location_by_line"
```

View file

@ -0,0 +1,13 @@
# Models
Detected core models and extensions in purchase_location_by_line.
```mermaid
classDiagram
class purchase_order_line
class stock_picking
```
Notes
- Classes show model technical names; fields omitted for brevity.
- Items listed under _inherit are extensions of existing models.

View file

@ -0,0 +1,6 @@
# Overview
Packaged Odoo addon: purchase_location_by_line. Provides features documented in upstream Odoo 16 under this addon.
- Source: OCA/OCB 16.0, addon purchase_location_by_line
- License: LGPL-3

View file

@ -0,0 +1,3 @@
# Reports
This module does not define custom reports.

View file

@ -0,0 +1,8 @@
# Security
This module does not define custom security rules or access controls beyond Odoo defaults.
Default Odoo security applies:
- Base user access through standard groups
- Model access inherited from dependencies
- No custom row-level security rules

View file

@ -0,0 +1,5 @@
# Troubleshooting
- Ensure Python and Odoo environment matches repo guidance.
- Check database connectivity and logs if startup fails.
- Validate that dependent addons listed in DEPENDENCIES.md are installed.

View file

@ -0,0 +1,7 @@
# Usage
Start Odoo including this addon (from repo root):
```bash
python3 scripts/nix_odoo_web_server.py --db-name mydb --addon purchase_location_by_line
```

View file

@ -0,0 +1,3 @@
# Wizards
This module does not include UI wizards.

View file

@ -0,0 +1,86 @@
=========================
Purchase Location by Line
=========================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8026c32219e2c393971f5509aec3390b21e1eaa795313f1c7712586db9585e44
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/16.0/purchase_location_by_line
: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-16-0/purchase-workflow-16-0-purchase_location_by_line
: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=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
Allows to define a specific destination location on each Purchase Order line.
When the PO is confirmed, it will generate one Incoming Shipment per
combination of destination location and expected date indicated in the
Purchase Order Lines.
This module is used to send the products to different locations, that may
not be children of the default location of the same PO picking type. Not be confused.
**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_location_by_line%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
~~~~~~~
* ForgeFlow
Contributors
~~~~~~~~~~~~
* Jordi Ballester Alomar <jordi.ballester@forgeflow.com>
* Hizbul Bahar <hizbul25@gmail.com>
* Harald Panten <harald.panten@sygel.es>
* Juany Davila <juany.davila@forgeflow.com>
* Manuel Regidor <manuel.regidor@sygel.es>
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.
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/16.0/purchase_location_by_line>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View file

@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models

View file

@ -0,0 +1,17 @@
# © 2016 ForgeFlow S.L.
# (<http://www.forgeflow.com>)
# © 2018 Hizbul Bahar <hizbul25@gmail.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Purchase Location by Line",
"summary": "Allows to define a specific destination location on each PO line",
"version": "16.0.1.0.0",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/purchase-workflow",
"category": "Purchase Management",
"depends": ["purchase_stock", "purchase_delivery_split_date"],
"license": "AGPL-3",
"data": ["views/purchase_views.xml"],
"installable": True,
}

View file

@ -0,0 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_location_by_line
#
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_location_by_line
#: model:ir.model.fields,field_description:purchase_location_by_line.field_purchase_order_line__location_dest_id
msgid "Destination"
msgstr "Odredište"
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Stavka naloga za nabavu"
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_stock_picking
msgid "Transfer"
msgstr "Transfer"

View file

@ -0,0 +1,34 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_location_by_line
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-04-29 01:00+0000\n"
"PO-Revision-Date: 2017-04-29 01:00+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n"
"Language: ca\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"
#. module: purchase_location_by_line
#: model:ir.model.fields,field_description:purchase_location_by_line.field_purchase_order_line__location_dest_id
msgid "Destination"
msgstr ""
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_purchase_order_line
msgid "Purchase Order Line"
msgstr ""
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_stock_picking
msgid "Transfer"
msgstr "Transferència"

View file

@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_location_by_line
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-11-24 07:53+0000\n"
"PO-Revision-Date: 2020-07-22 12:19+0000\n"
"Last-Translator: c2cdidier <didier.donze@camptocamp.com>\n"
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
"Language: de\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 3.10\n"
#. module: purchase_location_by_line
#: model:ir.model.fields,field_description:purchase_location_by_line.field_purchase_order_line__location_dest_id
msgid "Destination"
msgstr "Ziellager"
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Bestellposition"
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_stock_picking
msgid "Transfer"
msgstr "Transfer"

View file

@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_location_by_line
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-11-24 07:53+0000\n"
"PO-Revision-Date: 2023-07-20 18:09+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
"Language: es\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_location_by_line
#: model:ir.model.fields,field_description:purchase_location_by_line.field_purchase_order_line__location_dest_id
msgid "Destination"
msgstr "Destino"
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Línea orden de compra"
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_stock_picking
msgid "Transfer"
msgstr "Transferir"

View file

@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_location_by_line
#
# Translators:
# Juan González <bifomania@protonmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-08 03:41+0000\n"
"PO-Revision-Date: 2017-03-08 03:41+0000\n"
"Last-Translator: Juan González <bifomania@protonmail.com>, 2017\n"
"Language-Team: Spanish (Mexico) (https://www.transifex.com/oca/teams/23907/"
"es_MX/)\n"
"Language: es_MX\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"
#. module: purchase_location_by_line
#: model:ir.model.fields,field_description:purchase_location_by_line.field_purchase_order_line__location_dest_id
msgid "Destination"
msgstr ""
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Línea de orden de compra"
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_stock_picking
msgid "Transfer"
msgstr ""

View file

@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_location_by_line
#
# Translators:
# Henry Garcia <henry@yaroslab.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-11-24 07:53+0000\n"
"PO-Revision-Date: 2017-11-24 07:53+0000\n"
"Last-Translator: Henry Garcia <henry@yaroslab.com>, 2017\n"
"Language-Team: Spanish (Peru) (https://www.transifex.com/oca/teams/23907/"
"es_PE/)\n"
"Language: es_PE\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"
#. module: purchase_location_by_line
#: model:ir.model.fields,field_description:purchase_location_by_line.field_purchase_order_line__location_dest_id
msgid "Destination"
msgstr ""
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Linea de orden de compra"
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_stock_picking
msgid "Transfer"
msgstr "Transferir"

View file

@ -0,0 +1,34 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_location_by_line
#
# Translators:
# Timo Talvitie <timo.talvitie@vizucom.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-08 03:41+0000\n"
"PO-Revision-Date: 2017-03-08 03:41+0000\n"
"Last-Translator: Timo Talvitie <timo.talvitie@vizucom.com>, 2017\n"
"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n"
"Language: fi\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"
#. module: purchase_location_by_line
#: model:ir.model.fields,field_description:purchase_location_by_line.field_purchase_order_line__location_dest_id
msgid "Destination"
msgstr ""
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Ostotilausrivi"
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_stock_picking
msgid "Transfer"
msgstr ""

View file

@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_location_by_line
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-11-24 07:53+0000\n"
"PO-Revision-Date: 2020-07-22 12:19+0000\n"
"Last-Translator: c2cdidier <didier.donze@camptocamp.com>\n"
"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n"
"Language: fr\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 3.10\n"
#. module: purchase_location_by_line
#: model:ir.model.fields,field_description:purchase_location_by_line.field_purchase_order_line__location_dest_id
msgid "Destination"
msgstr "Destination"
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Ligne de commande d'achat"
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_stock_picking
msgid "Transfer"
msgstr "Transférer"

View file

@ -0,0 +1,34 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_location_by_line
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-04-29 01:00+0000\n"
"PO-Revision-Date: 2017-04-29 01:00+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Galician (https://www.transifex.com/oca/teams/23907/gl/)\n"
"Language: gl\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"
#. module: purchase_location_by_line
#: model:ir.model.fields,field_description:purchase_location_by_line.field_purchase_order_line__location_dest_id
msgid "Destination"
msgstr ""
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_purchase_order_line
msgid "Purchase Order Line"
msgstr ""
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_stock_picking
msgid "Transfer"
msgstr "Transferencia"

View file

@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_location_by_line
#
# Translators:
# Bole <bole@dajmi5.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-03 03:48+0000\n"
"PO-Revision-Date: 2018-03-03 03:48+0000\n"
"Last-Translator: Bole <bole@dajmi5.com>, 2017\n"
"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n"
"Language: hr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
#. module: purchase_location_by_line
#: model:ir.model.fields,field_description:purchase_location_by_line.field_purchase_order_line__location_dest_id
msgid "Destination"
msgstr "Odredište"
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Stavka naloga za nabavu"
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_stock_picking
msgid "Transfer"
msgstr "Transfer"

View file

@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_location_by_line
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
# Paolo Valier <paolo.valier@hotmail.it>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-04-29 01:00+0000\n"
"PO-Revision-Date: 2023-12-20 15:38+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\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_location_by_line
#: model:ir.model.fields,field_description:purchase_location_by_line.field_purchase_order_line__location_dest_id
msgid "Destination"
msgstr "Destinazione"
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Riga ordine di acquisto"
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_stock_picking
msgid "Transfer"
msgstr "Trasferimento"

View file

@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_location_by_line
#
# Translators:
# Peter Hageman <hageman.p@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-11-24 07:53+0000\n"
"PO-Revision-Date: 2017-11-24 07:53+0000\n"
"Last-Translator: Peter Hageman <hageman.p@gmail.com>, 2017\n"
"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/"
"teams/23907/nl_NL/)\n"
"Language: nl_NL\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"
#. module: purchase_location_by_line
#: model:ir.model.fields,field_description:purchase_location_by_line.field_purchase_order_line__location_dest_id
msgid "Destination"
msgstr ""
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Inkooporderregel"
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_stock_picking
msgid "Transfer"
msgstr "Verplaatsen"

View file

@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_location_by_line
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-11-24 07:53+0000\n"
"PO-Revision-Date: 2022-10-03 15:53+0000\n"
"Last-Translator: Douglas Custódio <douglascstd@yahoo.com>\n"
"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/"
"teams/23907/pt_BR/)\n"
"Language: pt_BR\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.3.2\n"
#. module: purchase_location_by_line
#: model:ir.model.fields,field_description:purchase_location_by_line.field_purchase_order_line__location_dest_id
msgid "Destination"
msgstr "Destino"
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Linha do Pedido de Compra"
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_stock_picking
msgid "Transfer"
msgstr "Transferir"

View file

@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_location_by_line
#
# Translators:
# Pedro Castro Silva <pedrocs@sossia.pt>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-08 03:41+0000\n"
"PO-Revision-Date: 2017-03-08 03:41+0000\n"
"Last-Translator: Pedro Castro Silva <pedrocs@sossia.pt>, 2017\n"
"Language-Team: Portuguese (Portugal) (https://www.transifex.com/oca/"
"teams/23907/pt_PT/)\n"
"Language: pt_PT\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"
#. module: purchase_location_by_line
#: model:ir.model.fields,field_description:purchase_location_by_line.field_purchase_order_line__location_dest_id
msgid "Destination"
msgstr ""
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Linha de Encomenda de Compra"
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_stock_picking
msgid "Transfer"
msgstr ""

View file

@ -0,0 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_location_by_line
#
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_location_by_line
#: model:ir.model.fields,field_description:purchase_location_by_line.field_purchase_order_line__location_dest_id
msgid "Destination"
msgstr ""
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_purchase_order_line
msgid "Purchase Order Line"
msgstr ""
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_stock_picking
msgid "Transfer"
msgstr ""

View file

@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_location_by_line
#
# Translators:
# Dorin Hongu <dhongu@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-08 03:41+0000\n"
"PO-Revision-Date: 2017-03-08 03:41+0000\n"
"Last-Translator: Dorin Hongu <dhongu@gmail.com>, 2017\n"
"Language-Team: Romanian (https://www.transifex.com/oca/teams/23907/ro/)\n"
"Language: ro\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?"
"2:1));\n"
#. module: purchase_location_by_line
#: model:ir.model.fields,field_description:purchase_location_by_line.field_purchase_order_line__location_dest_id
msgid "Destination"
msgstr ""
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Linie comandă achiziție"
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_stock_picking
msgid "Transfer"
msgstr ""

View file

@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_location_by_line
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-11-24 07:53+0000\n"
"PO-Revision-Date: 2017-11-24 07:53+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n"
"Language: sl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
"%100==4 ? 2 : 3);\n"
#. module: purchase_location_by_line
#: model:ir.model.fields,field_description:purchase_location_by_line.field_purchase_order_line__location_dest_id
msgid "Destination"
msgstr ""
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Postavka nabavnega naloga"
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_stock_picking
msgid "Transfer"
msgstr "Premestitev"

View file

@ -0,0 +1,30 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_location_by_line
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: sv\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"
#. module: purchase_location_by_line
#: model:ir.model.fields,field_description:purchase_location_by_line.field_purchase_order_line__location_dest_id
msgid "Destination"
msgstr ""
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_purchase_order_line
msgid "Purchase Order Line"
msgstr ""
#. module: purchase_location_by_line
#: model:ir.model,name:purchase_location_by_line.model_stock_picking
msgid "Transfer"
msgstr ""

View file

@ -0,0 +1,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import purchase
from . import stock_picking

View file

@ -0,0 +1,63 @@
# © 2016 ForgeFlow S.L.
# (<http://www.forgeflow.com>)
# © 2018 Hizbul Bahar <hizbul25@gmail.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class PurchaseOrderLine(models.Model):
_inherit = "purchase.order.line"
location_dest_id = fields.Many2one(
comodel_name="stock.location",
string="Destination",
domain=[("usage", "in", ["internal", "transit"])],
)
@api.model
def _first_picking_copy_vals(self, key, lines):
"""The data to be copied to new pickings is updated with data from the
grouping key. This method is designed for extensibility, so that
other modules can store more data based on new keys."""
vals = super()._first_picking_copy_vals(key, lines)
for key_element in key:
if "location_dest_id" in key_element.keys():
vals["location_dest_id"] = key_element["location_dest_id"].id
return vals
@api.model
def _get_group_keys(self, order, line, picking=False):
"""Define the key that will be used to group. The key should be
defined as a tuple of dictionaries, with each element containing a
dictionary element with the field that you want to group by. This
method is designed for extensibility, so that other modules can add
additional keys or replace them by others."""
key = super()._get_group_keys(order, line, picking=picking)
default_picking_location_id = line.order_id._get_destination_location()
default_picking_location = self.env["stock.location"].browse(
default_picking_location_id
)
location = line.location_dest_id or default_picking_location
return key + ({"location_dest_id": location},)
def _get_sorted_keys(self, line):
"""Return a tuple of keys to use in order to sort the order lines.
This method is designed for extensibility, so that other modules can
add additional keys or replace them by others."""
keys = super()._get_sorted_keys(line)
return keys + (line.location_dest_id.id,)
def _create_stock_moves(self, picking):
res = super()._create_stock_moves(picking)
for line in self:
default_picking_location_id = line.order_id._get_destination_location()
default_picking_location = self.env["stock.location"].browse(
default_picking_location_id
)
location = line.location_dest_id or default_picking_location
if location:
line.move_ids.filtered(lambda m: m.state != "done").write(
{"location_dest_id": location.id}
)
return res

View file

@ -0,0 +1,24 @@
# © 2016 ForgeFlow S.L.
# (<http://www.forgeflow.com>)
# © 2018 Hizbul Bahar <hizbul25@gmail.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import models
class StockPicking(models.Model):
_inherit = "stock.picking"
def _update_picking_from_group_key(self, key):
"""The picking is updated with data from the grouping key.
This method is designed for extensibility, so that other modules
can store more data based on new keys."""
super()._update_picking_from_group_key(key)
for rec in self:
for key_element in key:
if (
"location_dest_id" in key_element.keys()
and key_element["location_dest_id"]
):
rec.location_dest_id = key_element["location_dest_id"]
return False

View file

@ -0,0 +1,5 @@
* Jordi Ballester Alomar <jordi.ballester@forgeflow.com>
* Hizbul Bahar <hizbul25@gmail.com>
* Harald Panten <harald.panten@sygel.es>
* Juany Davila <juany.davila@forgeflow.com>
* Manuel Regidor <manuel.regidor@sygel.es>

View file

@ -0,0 +1,7 @@
Allows to define a specific destination location on each Purchase Order line.
When the PO is confirmed, it will generate one Incoming Shipment per
combination of destination location and expected date indicated in the
Purchase Order Lines.
This module is used to send the products to different locations, that may
not be children of the default location of the same PO picking type. Not be confused.

View file

@ -0,0 +1,430 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Purchase Location by Line</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="purchase-location-by-line">
<h1 class="title">Purchase Location by Line</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8026c32219e2c393971f5509aec3390b21e1eaa795313f1c7712586db9585e44
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/purchase-workflow/tree/16.0/purchase_location_by_line"><img alt="OCA/purchase-workflow" src="https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_location_by_line"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Allows to define a specific destination location on each Purchase Order line.
When the PO is confirmed, it will generate one Incoming Shipment per
combination of destination location and expected date indicated in the
Purchase Order Lines.</p>
<p>This module is used to send the products to different locations, that may
not be children of the default location of the same PO picking type. Not be confused.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/purchase-workflow/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_location_by_line%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
<ul class="simple">
<li>ForgeFlow</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<ul class="simple">
<li>Jordi Ballester Alomar &lt;<a class="reference external" href="mailto:jordi.ballester&#64;forgeflow.com">jordi.ballester&#64;forgeflow.com</a>&gt;</li>
<li>Hizbul Bahar &lt;<a class="reference external" href="mailto:hizbul25&#64;gmail.com">hizbul25&#64;gmail.com</a>&gt;</li>
<li>Harald Panten &lt;<a class="reference external" href="mailto:harald.panten&#64;sygel.es">harald.panten&#64;sygel.es</a>&gt;</li>
<li>Juany Davila &lt;<a class="reference external" href="mailto:juany.davila&#64;forgeflow.com">juany.davila&#64;forgeflow.com</a>&gt;</li>
<li>Manuel Regidor &lt;<a class="reference external" href="mailto:manuel.regidor&#64;sygel.es">manuel.regidor&#64;sygel.es</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/purchase-workflow/tree/16.0/purchase_location_by_line">OCA/purchase-workflow</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import test_purchase_delivery

View file

@ -0,0 +1,257 @@
# © 2016 ForgeFlow S.L.
# (<http://www.forgeflow.com>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
import time
from odoo.tests.common import TransactionCase
class TestDeliverySingle(TransactionCase):
def setUp(self):
super().setUp()
# Products
p1 = self.env.ref("product.product_product_13")
p2 = self.env.ref("product.product_product_25")
# Locations
self.l1 = self.env.ref("stock.stock_location_stock")
self.l2 = self.env["stock.location"].create(
{"location_id": self.l1.id, "name": "Shelf 1", "usage": "internal"}
)
# 2 dates we can use to test the features
self.date_sooner = time.strftime("%Y") + "-01-01"
self.date_later = time.strftime("%Y") + "-12-31"
self.po = self.env["purchase.order"].create(
{
"partner_id": self.ref("base.res_partner_3"),
"order_line": [
(
0,
0,
{
"product_id": p1.id,
"product_uom": p1.uom_id.id,
"name": p1.name,
"price_unit": p1.standard_price,
"date_planned": self.date_sooner,
"product_qty": 42.0,
"location_dest_id": self.l1.id,
},
),
(
0,
0,
{
"product_id": p2.id,
"product_uom": p1.uom_id.id,
"name": p2.name,
"price_unit": p2.standard_price,
"date_planned": self.date_sooner,
"product_qty": 12.0,
"location_dest_id": self.l1.id,
},
),
(
0,
0,
{
"product_id": p1.id,
"product_uom": p1.uom_id.id,
"name": p1.name,
"price_unit": p1.standard_price,
"date_planned": self.date_sooner,
"product_qty": 1.0,
"location_dest_id": self.l1.id,
},
),
],
}
)
def test_check_single_date(self):
self.assertEqual(
len(self.po.picking_ids),
0,
"There must not be pickings for the PO when draft",
)
self.po.button_confirm()
self.assertEqual(
len(self.po.picking_ids),
1,
"There must be 1 picking for the PO when confirmed",
)
self.assertEqual(
str(self.po.picking_ids[0].scheduled_date)[:10],
self.date_sooner,
"The picking must be planned at the expected date",
)
def test_check_multiple_dates(self):
# Change the date of the first line
self.po.order_line[0].date_planned = self.date_later
self.assertEqual(
len(self.po.picking_ids),
0,
"There must not be pickings for the PO when draft",
)
self.po.button_confirm()
len_pickings = len(self.po.picking_ids)
self.assertEqual(
len_pickings,
2,
"There must be 2 pickings for the PO when confirmed. %s found"
% len_pickings,
)
sorted_pickings = sorted(self.po.picking_ids, key=lambda x: x.scheduled_date)
self.assertEqual(
str(sorted_pickings[0].scheduled_date)[:10],
self.date_sooner,
"The first picking must be planned at the soonest date",
)
self.assertEqual(
str(sorted_pickings[1].scheduled_date)[:10],
self.date_later,
"The second picking must be planned at the latest date",
)
l2_picking = self.po.picking_ids.filtered(
lambda p: p.location_dest_id == self.l2
)
self.assertEqual(
len(l2_picking), 0, "There must be 0 picking for location Shelf 1"
)
l1_picking = self.po.picking_ids.filtered(
lambda p: p.location_dest_id == self.l1
)
self.assertEqual(
len(l1_picking), 2, "There must be 2 pickings for location Stock"
)
def test_check_multiple_locations_same_date(self):
# Change the location of the first line
self.po.order_line[0].location_dest_id = self.l2
self.assertEqual(
len(self.po.picking_ids),
0,
"There must not be pickings for the PO when draft",
)
self.po.button_confirm()
l2_picking = self.po.picking_ids.filtered(
lambda p: p.location_dest_id == self.l2
)
self.assertGreaterEqual(
len(l2_picking),
1,
"There must be 1 or more pickings for location Shelf 1",
)
l1_picking = self.po.picking_ids.filtered(
lambda p: p.location_dest_id == self.l1
)
self.assertGreaterEqual(
len(l1_picking),
1,
"There must be 1 or more pickings for location Stock",
)
def test_check_multiple_locations_multiple_dates(self):
# Change the location of the first line and date of the second line
self.po.order_line[0].location_dest_id = self.l2
self.po.order_line[1].date_planned = self.date_later
self.assertEqual(
len(self.po.picking_ids),
0,
"There must not be pickings for the PO when draft",
)
self.po.button_confirm()
l2_picking = self.po.picking_ids.filtered(
lambda p: p.location_dest_id == self.l2
)
self.assertGreaterEqual(
len(l2_picking), 1, "There must be 1 picking for location Shelf 1"
)
l1_picking = self.po.picking_ids.filtered(
lambda p: p.location_dest_id == self.l1
)
self.assertGreaterEqual(
len(l1_picking), 2, "There must be 2 or more pickings for location Stock"
)
sorted_pickings = sorted(self.po.picking_ids, key=lambda x: x.scheduled_date)
self.assertEqual(
str(sorted_pickings[0].scheduled_date)[:10],
self.date_sooner,
"The first picking must be planned at the soonest date",
)
self.assertEqual(
str(sorted_pickings[2].scheduled_date)[:10],
self.date_later,
"The second picking must be planned at the latest date",
)
def test_check_multiple_locations_multiple_dates_02(self):
# Leave some locations in the PO line empty
self.po.order_line[0].location_dest_id = self.l2
self.po.order_line[1].location_dest_id = False
self.po.order_line[2].location_dest_id = False
self.po.order_line[1].date_planned = self.date_later
self.assertEqual(
len(self.po.picking_ids),
0,
"There must not be pickings for the PO when draft",
)
self.po.button_confirm()
l2_picking = self.po.picking_ids.filtered(
lambda p: p.location_dest_id == self.l2
)
self.assertGreaterEqual(
len(l2_picking), 1, "There must be 1 picking for location Shelf 1"
)
default_location_picking = self.po.picking_ids.filtered(
lambda p: p.location_dest_id
== self.po.picking_type_id.default_location_dest_id
)
self.assertGreaterEqual(
len(default_location_picking),
2,
"There must be 2 or more pickings for the default location of the PO",
)
sorted_pickings = sorted(self.po.picking_ids, key=lambda x: x.scheduled_date)
self.assertEqual(
str(sorted_pickings[0].scheduled_date)[:10],
self.date_sooner,
"The first picking must be planned at the soonest date",
)
self.assertEqual(
str(sorted_pickings[2].scheduled_date)[:10],
self.date_later,
"The second picking must be planned at the latest date",
)
def test_modify_confirmed(self):
# if all moves contain the location no need to update
self.po.button_confirm()
self.po.order_line[0].write({"product_qty": 43})
self.assertEqual(
self.po.order_line[0].move_ids.mapped("location_dest_id"), self.l1
)

View file

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="purchase_order_form" model="ir.ui.view">
<field name="name">purchase.order.form</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form" />
<field name="arch" type="xml">
<xpath
expr="//field[@name='order_line']//field[@name='date_planned']"
position="after"
>
<field name="state" invisible="1" />
<field
name="location_dest_id"
attrs="{'readonly': [('state', 'in', ('purchase','done', 'cancel'))]}"
/>
</xpath>
</field>
</record>
<record id="purchase_order_line_form2" model="ir.ui.view">
<field name="name">purchase.order.line.form</field>
<field name="model">purchase.order.line</field>
<field name="inherit_id" ref="purchase.purchase_order_line_form2" />
<field name="arch" type="xml">
<field name='date_planned' position="after">
<field name="state" invisible="1" />
<field
name="location_dest_id"
attrs="{'readonly': [('state', 'in', ('purchase','done', 'cancel'))]}"
/>
</field>
</field>
</record>
<record id="purchase_order_line_tree" model="ir.ui.view">
<field name="name">purchase.order.line.tree</field>
<field name="model">purchase.order.line</field>
<field name="inherit_id" ref="purchase.purchase_order_line_tree" />
<field name="arch" type="xml">
<field name='date_planned' position="after">
<field name="location_dest_id" />
</field>
</field>
</record>
</odoo>

View file

@ -0,0 +1,43 @@
[project]
name = "odoo-bringout-oca-purchase-workflow-purchase_location_by_line"
version = "16.0.0"
description = "Purchase Location by Line - Allows to define a specific destination location on each PO line"
authors = [
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
]
dependencies = [
"odoo-bringout-oca-purchase-workflow-purchase_stock>=16.0.0",
"odoo-bringout-oca-purchase-workflow-purchase_delivery_split_date>=16.0.0",
"requests>=2.25.1"
]
readme = "README.md"
requires-python = ">= 3.11"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Office/Business",
]
[project.urls]
homepage = "https://github.com/bringout/0"
repository = "https://github.com/bringout/0"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["purchase_location_by_line"]
[tool.rye]
managed = true
dev-dependencies = [
"pytest>=8.4.1",
]