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] cb_stock_location_warning: Migration to 16.0 #525

Open
wants to merge 10 commits into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions cb_stock_location_warning/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add warnings to stock locations, which appear later in purchase orders.
1 change: 1 addition & 0 deletions cb_stock_location_warning/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
14 changes: 14 additions & 0 deletions cb_stock_location_warning/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2019 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Cb Stock Location Warning",
"summary": """
Add warnings to stock locations""",
"version": "14.0.1.0.0",
"license": "AGPL-3",
"author": "CreuBlanca",
"website": "https://github.com/tegin/cb-addons",
"depends": ["stock_location_address_purchase"],
"data": ["views/purchase_order_templates.xml", "views/stock_location.xml"],
}
33 changes: 33 additions & 0 deletions cb_stock_location_warning/i18n/cb_stock_location_warning.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * cb_stock_location_warning
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-03 09:05+0000\n"
"PO-Revision-Date: 2019-05-03 09:05+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: cb_stock_location_warning
#: model:ir.ui.view,arch_db:cb_stock_location_warning.report_purchaseorder_document
msgid "<strong>Warning:</strong>"
msgstr ""

#. module: cb_stock_location_warning
#: model:ir.model,name:cb_stock_location_warning.model_stock_location
msgid "Inventory Locations"
msgstr ""

#. module: cb_stock_location_warning
#: model:ir.model.fields,field_description:cb_stock_location_warning.field_stock_location_warning
#: model:ir.ui.view,arch_db:cb_stock_location_warning.stock_location_form_view
msgid "Warning"
msgstr ""

34 changes: 34 additions & 0 deletions cb_stock_location_warning/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * cb_stock_location_warning
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-03 09:00+0000\n"
"PO-Revision-Date: 2019-05-03 11:01+0200\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\n"
"X-Generator: Poedit 2.0.6\n"

#. module: cb_stock_location_warning
#: model:ir.ui.view,arch_db:cb_stock_location_warning.report_purchaseorder_document
msgid "<strong>Warning:</strong>"
msgstr "<strong>Aviso:</strong>"

#. module: cb_stock_location_warning
#: model:ir.model,name:cb_stock_location_warning.model_stock_location
msgid "Inventory Locations"
msgstr "Ubicaciones de inventario"

#. module: cb_stock_location_warning
#: model:ir.model.fields,field_description:cb_stock_location_warning.field_stock_location_warning
#: model:ir.ui.view,arch_db:cb_stock_location_warning.stock_location_form_view
msgid "Warning"
msgstr "Aviso"
1 change: 1 addition & 0 deletions cb_stock_location_warning/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import stock_location
11 changes: 11 additions & 0 deletions cb_stock_location_warning/models/stock_location.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2019 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class StockLocation(models.Model):

_inherit = "stock.location"

warning = fields.Text(string="Warning")
19 changes: 19 additions & 0 deletions cb_stock_location_warning/views/purchase_order_templates.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template
id="report_purchaseorder_document"
inherit_id="purchase_stock.report_purchaseorder_document"
>
<xpath expr="//t[@t-set='information_block']/.." position="inside">
<div
t-if="o.picking_type_id.default_location_dest_id.warning"
class="col-12"
>
<h3>
<strong>Warning:</strong>
<span t-esc="o.picking_type_id.default_location_dest_id.warning" />
</h3>
</div>
</xpath>
</template>
</odoo>
17 changes: 17 additions & 0 deletions cb_stock_location_warning/views/stock_location.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2019 Creu Blanca
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<record model="ir.ui.view" id="stock_location_form_view">
<field name="name">stock.location.form (in cb_stock_location_warning)</field>
<field name="model">stock.location</field>
<field name="inherit_id" ref="stock.view_location_form" />
<field name="arch" type="xml">
<xpath expr="//group/group[2]" position="after">
<group string="Warning">
<field name="warning" />
</group>
</xpath>
</field>
</record>
</odoo>
6 changes: 6 additions & 0 deletions setup/cb_stock_location_warning/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,
)
Loading