← Back to team overview

openerp-community-reviewer team mailing list archive

lp:~pedro.baeza/stock-logistic-flows/7.0-stock_picking_show_returns into lp:stock-logistic-flows/7.0

 

Pedro Manuel Baeza has proposed merging lp:~pedro.baeza/stock-logistic-flows/7.0-stock_picking_show_returns into lp:stock-logistic-flows/7.0.

Requested reviews:
  Stock and Logistic Core Editors (stock-logistic-core-editors)

For more details, see:
https://code.launchpad.net/~pedro.baeza/stock-logistic-flows/7.0-stock_picking_show_returns/+merge/193075

[ADD] stock_picking_show_returns: Little module that shows in a new tab the returns associated to the current picking.
-- 
https://code.launchpad.net/~pedro.baeza/stock-logistic-flows/7.0-stock_picking_show_returns/+merge/193075
Your team Stock and Logistic Core Editors is requested to review the proposed merge of lp:~pedro.baeza/stock-logistic-flows/7.0-stock_picking_show_returns into lp:stock-logistic-flows/7.0.
=== added directory 'stock_picking_show_returns'
=== added file 'stock_picking_show_returns/__init__.py'
--- stock_picking_show_returns/__init__.py	1970-01-01 00:00:00 +0000
+++ stock_picking_show_returns/__init__.py	2013-10-29 16:00:48 +0000
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (c) 2013 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
+#                       Pedro M. Baeza <pedro.baeza@xxxxxxxxxxxxxxxxxx> 
+#    $Id$
+#
+#    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/>.
+#
+##############################################################################
+from . import stock_picking

=== added file 'stock_picking_show_returns/__openerp__.py'
--- stock_picking_show_returns/__openerp__.py	1970-01-01 00:00:00 +0000
+++ stock_picking_show_returns/__openerp__.py	2013-10-29 16:00:48 +0000
@@ -0,0 +1,43 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (c) 2013 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
+#                       Pedro M. Baeza <pedro.baeza@xxxxxxxxxxxxxxxxxx> 
+#    $Id$
+#
+#    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" : "Show returns on stock pickings",
+    "version" : "1.0",
+    "author" : "Serv. Tecnol. Avanzados - Pedro M. Baeza",
+    "category" : "Warehouse Management",
+    "description" : """
+    Show in pickings one tab that contains returns made for that picking.
+    """,
+    "website" : "www.serviciosbaeza.com",
+    "license" : "AGPL-3",
+    "depends" : [
+        "stock",
+    ],
+    "demo" : [],
+    "data" : [
+        'stock_picking_view.xml',
+    ],
+    "installable" : True,
+    "active" : False,
+}

=== added directory 'stock_picking_show_returns/i18n'
=== added file 'stock_picking_show_returns/i18n/es.po'
--- stock_picking_show_returns/i18n/es.po	1970-01-01 00:00:00 +0000
+++ stock_picking_show_returns/i18n/es.po	2013-10-29 16:00:48 +0000
@@ -0,0 +1,38 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* stock_picking_show_returns
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-10-29 15:55+0000\n"
+"PO-Revision-Date: 2013-10-29 16:56+0100\n"
+"Last-Translator: Pedro Manuel Baeza <pedro.baeza@xxxxxxxxxxxxxxxxxx>\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"
+
+#. module: stock_picking_show_returns
+#: view:stock.picking.in:0
+#: view:stock.picking.out:0
+msgid "Returns"
+msgstr "Devoluciones"
+
+#. module: stock_picking_show_returns
+#: model:ir.model,name:stock_picking_show_returns.model_stock_picking
+msgid "Picking List"
+msgstr "Albarán"
+
+#. module: stock_picking_show_returns
+#: model:ir.model,name:stock_picking_show_returns.model_stock_picking_out
+msgid "Delivery Orders"
+msgstr "Albaranes de salida"
+
+#. module: stock_picking_show_returns
+#: model:ir.model,name:stock_picking_show_returns.model_stock_picking_in
+msgid "Incoming Shipments"
+msgstr "Albaranes de entrada"
+

=== added file 'stock_picking_show_returns/i18n/stock_picking_show_returns.pot'
--- stock_picking_show_returns/i18n/stock_picking_show_returns.pot	1970-01-01 00:00:00 +0000
+++ stock_picking_show_returns/i18n/stock_picking_show_returns.pot	2013-10-29 16:00:48 +0000
@@ -0,0 +1,38 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* stock_picking_show_returns
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-10-29 15:56+0000\n"
+"PO-Revision-Date: 2013-10-29 15:56+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: stock_picking_show_returns
+#: view:stock.picking.in:0
+#: view:stock.picking.out:0
+msgid "Returns"
+msgstr ""
+
+#. module: stock_picking_show_returns
+#: model:ir.model,name:stock_picking_show_returns.model_stock_picking
+msgid "Picking List"
+msgstr ""
+
+#. module: stock_picking_show_returns
+#: model:ir.model,name:stock_picking_show_returns.model_stock_picking_out
+msgid "Delivery Orders"
+msgstr ""
+
+#. module: stock_picking_show_returns
+#: model:ir.model,name:stock_picking_show_returns.model_stock_picking_in
+msgid "Incoming Shipments"
+msgstr ""
+

=== added file 'stock_picking_show_returns/stock_picking.py'
--- stock_picking_show_returns/stock_picking.py	1970-01-01 00:00:00 +0000
+++ stock_picking_show_returns/stock_picking.py	2013-10-29 16:00:48 +0000
@@ -0,0 +1,75 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (c) 2013 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
+#                       Pedro M. Baeza <pedro.baeza@xxxxxxxxxxxxxxxxxx> 
+#
+#    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/>.
+#
+##############################################################################
+from openerp.osv import fields, orm
+
+class stock_picking(orm.Model):
+    _inherit = 'stock.picking'
+
+    def _get_return_ids(self, cr, uid, ids, name, arg, context=None):
+        result = {}
+        for picking in self.browse(cr, uid, ids, context=context):
+            for line in picking.move_lines:
+                return_ids = []
+                if line.state == 'done':
+                    for rec in line.move_history_ids2:
+                        if rec.location_dest_id.id == line.location_id.id \
+                                and rec.location_id.id == line.location_dest_id.id:
+                            return_ids.append(rec.picking_id.id)
+                result[picking.id] = return_ids
+        return result
+
+    _columns = {
+        'return_ids': fields.function(_get_return_ids,
+                                      relation='stock.picking',
+                                      string="Return pickings",
+                                      type='many2many'),
+    }
+
+class stock_picking_out(orm.Model):
+    _inherit = 'stock.picking.out'
+
+    def _get_return_ids(self, cr, uid, ids, name, arg, context=None):
+        return super(stock_picking_out, self)._get_return_ids(cr, uid, ids,
+                                                              name, arg,
+                                                              context=context)
+
+    _columns = {
+        'return_ids': fields.function(_get_return_ids,
+                                      relation='stock.picking',
+                                      string="Return pickings",
+                                      type='many2many'),
+    }
+
+class stock_picking_in(orm.Model):
+    _inherit = 'stock.picking.in'
+
+    def _get_return_ids(self, cr, uid, ids, name, arg, context=None):
+        return super(stock_picking_out, self)._get_return_ids(cr, uid, ids,
+                                                              name, arg,
+                                                              context=context)
+
+    _columns = {
+        'return_ids': fields.function(_get_return_ids,
+                                      relation='stock.picking',
+                                      string="Return pickings",
+                                      type='many2many'),
+    }

=== added file 'stock_picking_show_returns/stock_picking_view.xml'
--- stock_picking_show_returns/stock_picking_view.xml	1970-01-01 00:00:00 +0000
+++ stock_picking_show_returns/stock_picking_view.xml	2013-10-29 16:00:48 +0000
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <record id="view_picking_out_form_returns" model="ir.ui.view">
+            <field name="name">stock.picking.out.form.returns</field>
+            <field name="model">stock.picking.out</field>
+            <field name="inherit_id" ref="stock.view_picking_out_form"></field>
+            <field name="arch" type="xml">
+                <notebook position="inside">
+                    <page string="Returns">
+                        <field name="return_ids"/>
+                    </page>
+                </notebook>
+            </field>
+        </record>
+
+        <record id="view_picking_in_form_returns" model="ir.ui.view">
+            <field name="name">stock.picking.in.form.returns</field>
+            <field name="model">stock.picking.in</field>
+            <field name="inherit_id" ref="stock.view_picking_in_form"></field>
+            <field name="arch" type="xml">
+                <notebook position="inside">
+                    <page string="Returns">
+                        <field name="return_ids"/>
+                    </page>
+                </notebook>
+            </field>
+        </record>
+
+    </data>
+</openerp>


Follow ups