Skip to content
Snippets Groups Projects
Commit 8b7aee26 authored by Gabriel Davini's avatar Gabriel Davini :man_dancing_tone1:
Browse files

Merge branch '12.0-CIT-2-create_lat_long' into '12.0-stage'

Resolve CIT-2 "12.0  create lat long"

Closes CIT-2

See merge request !1
parents dfcffa95 6198677d
No related branches found
No related tags found
1 merge request!1Resolve CIT-2 "12.0 create lat long"
......@@ -6,3 +6,5 @@
__pycache__
*.prpt
*.jasper
.vscode
setup.cfg
from . import models
###############################################################################
#
# Copyright (c) 2020 Eynes/E-MIPS (www.eynes.com.ar)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
{
"name": "Citrux Stock",
"version": "12.0.1.0.0",
"author": "Eynes/E-MIPS",
"license": "AGPL-3",
"description": "Stock and Location Management.",
"category": "Stock",
"depends": ["stock", "decimal_precision"],
"data": ["data/stock_warehouse.xml", "views/stock_warehouse.xml"],
"installable": True,
"application": True,
}
<odoo noupdate="1">
<!-- Precision -->
<record forcecreate="True" id="decimal_stock_location" model="decimal.precision">
<field name="name">Stock Location</field>
<field name="digits">6</field>
</record>
</odoo>
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * citrux_stock
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-21 14:31+0000\n"
"PO-Revision-Date: 2020-02-21 11:34-0300\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"Language: es_AR\n"
"X-Generator: Poedit 2.3\n"
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2015"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2016"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2017"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2018"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2019"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2020"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2021"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2022"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2023"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2024"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2025"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2026"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2027"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2028"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2029"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2030"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2031"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2032"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2033"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2034"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2035"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2036"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2037"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2038"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2039"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2040"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2041"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2042"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2043"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2044"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2045"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2046"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2047"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2048"
msgstr ""
#. module: citrux_stock
#: selection:product.product,implantation_year:0
msgid "2049"
msgstr ""
#. module: citrux_stock
#: model:ir.model,name:citrux_stock.model_stock_location
msgid "Inventory Locations"
msgstr ""
#. module: citrux_stock
#: model:ir.model.fields,field_description:citrux_stock.field_stock_warehouse__latitude
msgid "Latitude"
msgstr "Latitud"
#. module: citrux_stock
#: code:addons/citrux_stock/models/stock_warehouse.py:16
#, python-format
msgid "Latitude value must be between -90 and 90"
msgstr "El valor de Latitud deberá ser entre -90 y 90"
#. module: citrux_stock
#: model:ir.model.fields,field_description:citrux_stock.field_stock_warehouse__longitude
msgid "Longitude"
msgstr "Longitud"
#. module: citrux_stock
#: code:addons/citrux_stock/models/stock_warehouse.py:19
#, python-format
msgid "Longitude value must be between -180 and 180"
msgstr "El valor de Longitud deberá ser entre -180 y 180"
#. module: citrux_stock
#: model:ir.model,name:citrux_stock.model_product_product
msgid "Product"
msgstr "Producto"
#. module: citrux_stock
#: model:ir.model.fields,field_description:citrux_stock.field_stock_location__product_ids
msgid "Varieties"
msgstr "Variedades"
#. module: citrux_stock
#: model:ir.model,name:citrux_stock.model_stock_warehouse
msgid "Warehouse"
msgstr "Depósito"
#. module: citrux_stock
#: model:ir.model.fields,field_description:citrux_stock.field_product_product__implantation_year
msgid "Year"
msgstr "Año"
from . import stock_warehouse
from odoo import _, api, exceptions, fields, models
from odoo.addons import decimal_precision as dp
class CitruxWarehouseLocation(models.Model):
_name = "stock.warehouse"
_inherit = "stock.warehouse"
latitude = fields.Float("Latitude", digits=dp.get_precision("Stock Location"))
longitude = fields.Float("Longitude", digits=dp.get_precision("Stock Location"))
@api.constrains("latitude", "longitude")
def _check_for_valid_coordinates(self):
for warehouse in self:
if not -90 <= warehouse.latitude <= 90:
raise exceptions.ValidationError(_("Latitude value must be between -90 and 90"))
if not -180 <= warehouse.longitude <= 180:
raise exceptions.ValidationError(_("Longitude value must be between -180 and 180"))
<odoo>
<data>
<record model="ir.ui.view" id="view_stock_warehouse_locations">
<field name="name">Stock Warehouse Location</field>
<field name="model">stock.warehouse</field>
<field name="inherit_id" ref="stock.view_warehouse"/>
<field name="arch" type="xml">
<xpath expr="/form/sheet/notebook" position="before">
<group string="Location">
<field name="latitude"/>
<field name="longitude"/>
</group>
</xpath>
</field>
</record>
</data>
</odoo>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment