-
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by rousseldenis
- Loading branch information
Showing
16 changed files
with
701 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
setup/stock_location_address/odoo/addons/stock_location_address
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 @@ | ||
../../../../stock_location_address |
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, | ||
) |
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,86 @@ | ||
====================== | ||
Stock Location address | ||
====================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:2ddab809c43b89c0fa4cd0a76b38bf4156e6b8b440058ee2b8bf9f4b4057368f | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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%2Fstock--logistics--transport-lightgray.png?logo=github | ||
:target: https://github.com/OCA/stock-logistics-transport/tree/16.0/stock_location_address | ||
:alt: OCA/stock-logistics-transport | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/stock-logistics-transport-16-0/stock-logistics-transport-16-0-stock_location_address | ||
: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/stock-logistics-transport&target_branch=16.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module adds an address on location so it can be used on purchases. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Usage | ||
===== | ||
|
||
To use this module you have to activate storage locations, going to | ||
Configuration > settings > and activate Storage Locations. | ||
then, | ||
Go to 'Inventory > Settings > Locations' and select an address for the location. | ||
If no address is selected, parent address will be used. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-transport/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/stock-logistics-transport/issues/new?body=module:%20stock_location_address%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 | ||
~~~~~~~ | ||
|
||
* Creu Blanca | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* Enric Tobella <etobella@creublanca.es> | ||
* Joan Mateu <joan.mateu@forgeflow.com> | ||
|
||
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/stock-logistics-transport <https://github.com/OCA/stock-logistics-transport/tree/16.0/stock_location_address>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
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,16 @@ | ||
# Copyright 2018 Creu Blanca | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
{ | ||
"name": "Stock Location address", | ||
"summary": "Adds an address on locations", | ||
"version": "16.0.1.0.0", | ||
"author": "Creu Blanca, " "Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/stock-logistics-transport", | ||
"category": "Warehouse Management", | ||
"depends": ["stock"], | ||
"data": ["views/stock_location_views.xml"], | ||
"license": "AGPL-3", | ||
"installable": True, | ||
"application": False, | ||
} |
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,30 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * stock_location_address | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 15.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: stock_location_address | ||
#: model:ir.model.fields,field_description:stock_location_address.field_stock_location__address_id | ||
#: model_terms:ir.ui.view,arch_db:stock_location_address.view_location_form | ||
msgid "Address" | ||
msgstr "" | ||
|
||
#. module: stock_location_address | ||
#: model:ir.model,name:stock_location_address.model_stock_location | ||
msgid "Inventory Locations" | ||
msgstr "" | ||
|
||
#. module: stock_location_address | ||
#: model:ir.model.fields,field_description:stock_location_address.field_stock_location__real_address_id | ||
msgid "Real Address" | ||
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 @@ | ||
from . import stock_location |
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,38 @@ | ||
# Copyright 2018 Creu Blanca | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class StockLocation(models.Model): | ||
_inherit = "stock.location" | ||
|
||
address_id = fields.Many2one(comodel_name="res.partner", string="Address") | ||
real_address_id = fields.Many2one( | ||
comodel_name="res.partner", | ||
string="Real Address", | ||
compute="_compute_real_address_id", | ||
recursive=True, | ||
) | ||
|
||
def _get_parent_address(self): | ||
"""Recursively fetches the address from parent locations.""" | ||
if self.location_id and self.location_id.address_id: | ||
return self.location_id.address_id | ||
elif self.location_id: | ||
return self.location_id._get_parent_address() | ||
else: | ||
return self.env["res.partner"].browse() | ||
|
||
@api.depends("address_id", "location_id", "location_id.address_id") | ||
def _compute_real_address_id(self): | ||
""" | ||
Computes the real_address_id field. | ||
If the current location has an address, use it. | ||
Otherwise, inherit from the nearest parent location. | ||
""" | ||
for record in self: | ||
if record.address_id: | ||
record.real_address_id = record.address_id | ||
else: | ||
record.real_address_id = record._get_parent_address() |
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 @@ | ||
* Enric Tobella <etobella@creublanca.es> | ||
* Joan Mateu <joan.mateu@forgeflow.com> |
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 @@ | ||
This module adds an address on location so it can be used on purchases. |
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,5 @@ | ||
To use this module you have to activate storage locations, going to | ||
Configuration > settings > and activate Storage Locations. | ||
then, | ||
Go to 'Inventory > Settings > Locations' and select an address for the location. | ||
If no address is selected, parent address will be used. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.