Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][MIG] stock_location_address: Migration to 16.0 #124

Open
wants to merge 21 commits into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions setup/stock_location_address/setup.py
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,
)
86 changes: 86 additions & 0 deletions stock_location_address/README.rst
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/15.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-15-0/stock-logistics-transport-15-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=15.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:%2015.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 <[email protected]>
* Joan Mateu <[email protected]>

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/15.0/stock_location_address>`_ 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 stock_location_address/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions stock_location_address/__manifest__.py
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,
}
30 changes: 30 additions & 0 deletions stock_location_address/i18n/stock_location_address.pot
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 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: 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 ""
1 change: 1 addition & 0 deletions stock_location_address/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import stock_location
33 changes: 33 additions & 0 deletions stock_location_address/models/stock_location.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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",
)

def _get_parent_address(self):
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"]

@api.depends("address_id", "location_id")
def _compute_real_address_id(self):
for record in self:
if record.address_id:
record.real_address_id = record.address_id
elif record.location_id:
record.real_address_id = record._get_parent_address()
else:
record.real_address_id = False
2 changes: 2 additions & 0 deletions stock_location_address/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Enric Tobella <[email protected]>
* Joan Mateu <[email protected]>
1 change: 1 addition & 0 deletions stock_location_address/readme/DESCRIPTION.rst
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.
5 changes: 5 additions & 0 deletions stock_location_address/readme/USAGE.rst
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.
Loading