← Back to team overview

openerp-community-reviewer team mailing list archive

[Merge] lp:~camptocamp/sale-wkfl/7.0-add_reorderable_lines-afe into lp:sale-wkfl

 

Alexandre Fayolle - camptocamp has proposed merging lp:~camptocamp/sale-wkfl/7.0-add_reorderable_lines-afe into lp:sale-wkfl.

Requested reviews:
  Sale Core Editors (sale-core-editors)

For more details, see:
https://code.launchpad.net/~camptocamp/sale-wkfl/7.0-add_reorderable_lines-afe/+merge/197175

[ADD] account_invoice_reorder_lines, purchase_order_reorder_lines stock_picking_reorder_lines

These 3 modules add the necessary fields and views to invoices, purchase orders and stock moves to enable reordering.

They also manage the propagation of the order from the sale order to the various documents
-- 
https://code.launchpad.net/~camptocamp/sale-wkfl/7.0-add_reorderable_lines-afe/+merge/197175
Your team Sale Core Editors is requested to review the proposed merge of lp:~camptocamp/sale-wkfl/7.0-add_reorderable_lines-afe into lp:sale-wkfl.
=== added directory 'account_invoice_reorder_lines'
=== added file 'account_invoice_reorder_lines/__init__.py'
--- account_invoice_reorder_lines/__init__.py	1970-01-01 00:00:00 +0000
+++ account_invoice_reorder_lines/__init__.py	2013-11-29 11:27:59 +0000
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
+#
+#    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/>.     
+#
+##############################################################################
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+from . import invoice
+

=== added file 'account_invoice_reorder_lines/__openerp__.py'
--- account_invoice_reorder_lines/__openerp__.py	1970-01-01 00:00:00 +0000
+++ account_invoice_reorder_lines/__openerp__.py	2013-11-29 11:27:59 +0000
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
+#
+#    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' : 'Invoice lines with sequence number',
+    'version' : '0.1',
+    'category' : 'Generic Modules/Accounting',
+    'description': '''
+Provide a new field on the invoice line form, allowing to manage the lines order.
+    ''',
+    'author' : 'Tiny',
+    'website' : 'http://www.openerp.com',
+    'depends' : ['account', 'base'],
+    'data' : ['invoice_view.xml'],
+    'demo' : [],
+    'test' : [],
+    'installable': True,
+    'auto_install' : False,
+    'application' : False,
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== added directory 'account_invoice_reorder_lines/i18n'
=== added file 'account_invoice_reorder_lines/i18n/en.po'
--- account_invoice_reorder_lines/i18n/en.po	1970-01-01 00:00:00 +0000
+++ account_invoice_reorder_lines/i18n/en.po	2013-11-29 11:27:59 +0000
@@ -0,0 +1,21 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-09-30 12:00+0000\n"
+"PO-Revision-Date: 2013-09-30 12:00+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: account_invoice_reorder_lines
+#: model:ir.model,name:account_invoice_reorder_lines.model_account_invoice_line
+msgid "Invoice Line"
+msgstr "Invoice Line"
+

=== added file 'account_invoice_reorder_lines/i18n/fr.po'
--- account_invoice_reorder_lines/i18n/fr.po	1970-01-01 00:00:00 +0000
+++ account_invoice_reorder_lines/i18n/fr.po	2013-11-29 11:27:59 +0000
@@ -0,0 +1,21 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-09-30 12:00+0000\n"
+"PO-Revision-Date: 2013-09-30 12:00+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: account_invoice_reorder_lines
+#: model:ir.model,name:account_invoice_reorder_lines.model_account_invoice_line
+msgid "Invoice Line"
+msgstr "Ligne de Facturation"
+

=== added file 'account_invoice_reorder_lines/i18n/invoice_sequence.pot'
--- account_invoice_reorder_lines/i18n/invoice_sequence.pot	1970-01-01 00:00:00 +0000
+++ account_invoice_reorder_lines/i18n/invoice_sequence.pot	2013-11-29 11:27:59 +0000
@@ -0,0 +1,38 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* invoice_sequence
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 5.0.6\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2009-11-26 08:01:40+0000\n"
+"PO-Revision-Date: 2009-11-26 08:01:40+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: invoice_sequence
+#: model:ir.module.module,shortdesc:invoice_sequence.module_meta_information
+msgid "Invoice lines with sequence number"
+msgstr ""
+
+#. module: invoice_sequence
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr ""
+
+#. module: invoice_sequence
+#: model:ir.module.module,description:invoice_sequence.module_meta_information
+msgid "Provide a new field on the invoice line form, allowing to manage the lines order.\n"
+"    "
+msgstr ""
+
+#. module: invoice_sequence
+#: field:account.invoice.line,sequence:0
+msgid "Sequence"
+msgstr ""
+

=== added file 'account_invoice_reorder_lines/invoice.py'
--- account_invoice_reorder_lines/invoice.py	1970-01-01 00:00:00 +0000
+++ account_invoice_reorder_lines/invoice.py	2013-11-29 11:27:59 +0000
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
+#
+#    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 orm
+
+class account_invoice_line(orm.Model):
+    _inherit = 'account.invoice.line'
+    _order = 'invoice_id desc, sequence, id'

=== added file 'account_invoice_reorder_lines/invoice_view.xml'
--- account_invoice_reorder_lines/invoice_view.xml	1970-01-01 00:00:00 +0000
+++ account_invoice_reorder_lines/invoice_view.xml	2013-11-29 11:27:59 +0000
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <!--record model="ir.ui.view" id="view_invoice_line_form">
+            <field name="name">Invoice Line</field>
+            <field name="model">account.invoice.line</field>
+            <field name="inherit_id" ref="account.view_invoice_line_form"/>
+            <field name="arch" type="xml">
+                <field name="invoice_line_tax_id" position="after">
+                    <field name="sequence" />
+                </field>
+            </field>
+        </record-->
+
+        <record id="invoice_supplier_form" model="ir.ui.view">
+            <field name="name">account.invoice.supplier.form2</field>
+            <field name="model">account.invoice</field>
+            <field name="inherit_id" ref="account.invoice_supplier_form" />
+<!--field name="priority">2</field-->
+            <field name="arch" type="xml">
+                <xpath expr="//field[@name='invoice_line']/tree[@string='Invoice lines']/field[@name='product_id']" position="before">
+                    <field name="sequence" widget="handle"/>
+                </xpath>
+            </field>
+        </record>
+
+        <record id="invoice_form" model="ir.ui.view">
+            <field name="name">account.invoice.form</field>
+            <field name="model">account.invoice</field>
+            <field name="inherit_id" ref="account.invoice_form" />
+            <field name="priority">2</field>
+            <field name="arch" type="xml">
+                <xpath expr="//field[@name='invoice_line']/tree[@string='Invoice Lines']/field[@name='product_id']" position="before">
+                    <field name="sequence" widget="handle"/>
+                </xpath>
+            </field>
+        </record>
+
+    </data>
+</openerp>

=== added directory 'purchase_order_reorder_lines'
=== added file 'purchase_order_reorder_lines/__init__.py'
--- purchase_order_reorder_lines/__init__.py	1970-01-01 00:00:00 +0000
+++ purchase_order_reorder_lines/__init__.py	2013-11-29 11:27:59 +0000
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Author: Alexandre Fayolle
+#    Copyright 2013 Camptocamp SA
+#
+#    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 purchase

=== added file 'purchase_order_reorder_lines/__openerp__.py'
--- purchase_order_reorder_lines/__openerp__.py	1970-01-01 00:00:00 +0000
+++ purchase_order_reorder_lines/__openerp__.py	2013-11-29 11:27:59 +0000
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Author: Alexandre Fayolle
+#    Copyright 2013 Camptocamp SA
+#
+#    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' : 'Purchase order lines with sequence number',
+    'version' : '0.1',
+    'category' : 'Purchase Management',
+    'description': '''
+Provide a new field on the purchase order form, allowing to manage the lines order.
+    ''',
+    'author' : 'Camptocamp',
+    'website' : 'http://www.camptocamp.com',
+    'depends' : ['purchase', 'stock_picking_reorder_lines', 'account_invoice_reorder_lines'],
+    'data' : ['purchase_view.xml'],
+    'demo' : [],
+    'test' : [],
+    'installable': True,
+    'auto_install' : False,
+    'application' : False,
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== added directory 'purchase_order_reorder_lines/i18n'
=== added file 'purchase_order_reorder_lines/i18n/en.po'
--- purchase_order_reorder_lines/i18n/en.po	1970-01-01 00:00:00 +0000
+++ purchase_order_reorder_lines/i18n/en.po	2013-11-29 11:27:59 +0000
@@ -0,0 +1,42 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* purchase_order_reorder_lines
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-09-30 12:03+0000\n"
+"PO-Revision-Date: 2013-09-30 12:03+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: purchase_order_reorder_lines
+#: model:ir.model,name:purchase_order_reorder_lines.model_purchase_order_line
+msgid "Purchase Order Line"
+msgstr "Purchase Order Line"
+
+#. module: purchase_order_reorder_lines
+#: field:purchase.order.line,sequence:0
+msgid "Sequence"
+msgstr "Sequence"
+
+#. module: purchase_order_reorder_lines
+#: model:ir.model,name:purchase_order_reorder_lines.model_purchase_order_line_invoice
+msgid "Purchase Order Line Make Invoice"
+msgstr "Purchase Order Line Make Invoice"
+
+#. module: purchase_order_reorder_lines
+#: help:purchase.order.line,sequence:0
+msgid "Gives the sequence of this line when displaying the purchase order."
+msgstr "Gives the sequence of this line when displaying the purchase order."
+
+#. module: purchase_order_reorder_lines
+#: model:ir.model,name:purchase_order_reorder_lines.model_purchase_order
+msgid "Purchase Order"
+msgstr "Purchase Order"
+

=== added file 'purchase_order_reorder_lines/i18n/fr.po'
--- purchase_order_reorder_lines/i18n/fr.po	1970-01-01 00:00:00 +0000
+++ purchase_order_reorder_lines/i18n/fr.po	2013-11-29 11:27:59 +0000
@@ -0,0 +1,42 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* purchase_order_reorder_lines
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-09-30 12:03+0000\n"
+"PO-Revision-Date: 2013-09-30 14:05+0200\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: purchase_order_reorder_lines
+#: model:ir.model,name:purchase_order_reorder_lines.model_purchase_order_line
+msgid "Purchase Order Line"
+msgstr "Ligne de commande d'achat"
+
+#. module: purchase_order_reorder_lines
+#: field:purchase.order.line,sequence:0
+msgid "Sequence"
+msgstr "Séquence"
+
+#. module: purchase_order_reorder_lines
+#: model:ir.model,name:purchase_order_reorder_lines.model_purchase_order_line_invoice
+msgid "Purchase Order Line Make Invoice"
+msgstr "Créer la facture des lignes de commande d'achat"
+
+#. module: purchase_order_reorder_lines
+#: help:purchase.order.line,sequence:0
+msgid "Gives the sequence of this line when displaying the purchase order."
+msgstr "Numéro d'ordre des lines lors de l'affichage du bon de commande."
+
+#. module: purchase_order_reorder_lines
+#: model:ir.model,name:purchase_order_reorder_lines.model_purchase_order
+msgid "Purchase Order"
+msgstr "Bon de commande"
+

=== added file 'purchase_order_reorder_lines/purchase.py'
--- purchase_order_reorder_lines/purchase.py	1970-01-01 00:00:00 +0000
+++ purchase_order_reorder_lines/purchase.py	2013-11-29 11:27:59 +0000
@@ -0,0 +1,63 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Author: Alexandre Fayolle
+#    Copyright 2013 Camptocamp SA
+#
+#    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 orm, fields
+
+class purchase_order_line(orm.Model):
+    _inherit = 'purchase.order.line'
+    _columns = {
+        'sequence': fields.integer('Sequence', help="Gives the sequence of this line when displaying the purchase order."),
+        }
+    _order = 'order_id desc, sequence, id'
+    _defaults = {'sequence': 10,
+                 }
+
+class purchase_order(orm.Model):
+    _inherit = 'purchase.order'
+
+    def _prepare_inv_line(self, cr, uid, account_id, order_line, context=None):
+        res = super(purchase_order, self)._prepare_inv_line(cr, uid, account_id, order_line, context)
+        res['sequence'] = order_line.sequence
+        return res
+
+    def _prepare_order_line_move(self, cr, uid, order, line, picking_id, context=None):
+        res = super(purchase_order, self)._prepare_order_line_move(cr, uid, order, line, picking_id)
+        res['sequence'] = line.sequence
+        return res
+
+class purchase_line_invoice(orm.TransientModel):
+    _inherit = 'purchase.order.line_invoice'
+
+    def makeInvoices(self, cr, uid, ids, context=None):
+        invoice_line_obj = self.pool.get('account.invoice.line')
+        purchase_line_obj = self.pool.get('purchase.order.line')
+        res = super(purchase_line_invoice, self).makeInvoices(cr, uid, ids, context)
+        invoice_ids = eval(res['domain'])[0][-1] # OMG :-(
+        invoice_line_ids = invoice_line_obj.search(cr, uid, [('invoice_id', 'in', invoice_ids)], context=context)
+        for invoice_line in invoice_line_obj.browse(cr, uid, invoice_line_ids, context=context):
+            order_line_ids = purchase_line_obj.search(cr, uid, [('invoice_lines', '=', invoice_line.id)], context=context)
+            if not order_line_ids:
+                continue
+            order_line_seq = purchase_line_obj.read(cr, uid, order_line_ids[0], ['sequence'], context=context)['sequence']
+            if not invoice_line.sequence:
+                invoice_line.write({'sequence': order_line_seq})
+        return res
+

=== added file 'purchase_order_reorder_lines/purchase_view.xml'
--- purchase_order_reorder_lines/purchase_view.xml	1970-01-01 00:00:00 +0000
+++ purchase_order_reorder_lines/purchase_view.xml	2013-11-29 11:27:59 +0000
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <record model="ir.ui.view" id="purchase_order_line_form">
+            <field name="name">purchase.order.line.form</field>
+            <field name="model">purchase.order.line</field>
+            <field name="inherit_id" ref="purchase.purchase_order_line_form"/>
+            <field name="arch" type="xml">
+                <field name="company_id" position="after">
+                    <field name="sequence" />
+                </field>
+            </field>
+        </record>
+
+        <record id="purchase_order_form" model="ir.ui.view">
+            <field name="name">purchase.order.form</field>
+            <field name="model">purchase.order</field>
+            <field name="inherit_id" ref="purchase.purchase_order_form" />
+            <field name="priority">2</field>
+            <field name="arch" type="xml">
+                <xpath expr="//field[@name='order_line']/tree/field[@name='product_id']" position="before">
+                    <field name="sequence" widget="handle"/>
+                </xpath>
+            </field>
+        </record>
+
+
+    </data>
+</openerp>

=== added directory 'stock_picking_reorder_lines'
=== added file 'stock_picking_reorder_lines/__init__.py'
--- stock_picking_reorder_lines/__init__.py	1970-01-01 00:00:00 +0000
+++ stock_picking_reorder_lines/__init__.py	2013-11-29 11:27:59 +0000
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Author: Alexandre Fayolle
+#    Copyright 2013 Camptocamp SA
+#
+#    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

=== added file 'stock_picking_reorder_lines/__openerp__.py'
--- stock_picking_reorder_lines/__openerp__.py	1970-01-01 00:00:00 +0000
+++ stock_picking_reorder_lines/__openerp__.py	2013-11-29 11:27:59 +0000
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Author: Alexandre Fayolle
+#    Copyright 2013 Camptocamp SA
+#
+#    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' : 'Stock picking lines with sequence number',
+    'version' : '0.1',
+    'category' : 'Warehouse Management',
+    'description': '''
+Provide a new field on stock moves, allowing to manage the orders of moves in a picking.
+    ''',
+    'author' : 'Camptocamp',
+    'website' : 'http://www.camptocamp.com',
+    'depends' : ['stock', 'sale', 'sale_stock'],
+    'data' : ['stock_view.xml'],
+    'demo' : [],
+    'test' : [],
+    'installable': True,
+    'auto_install' : False,
+    'application' : False,
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== added directory 'stock_picking_reorder_lines/i18n'
=== added file 'stock_picking_reorder_lines/i18n/en.po'
--- stock_picking_reorder_lines/i18n/en.po	1970-01-01 00:00:00 +0000
+++ stock_picking_reorder_lines/i18n/en.po	2013-11-29 11:27:59 +0000
@@ -0,0 +1,42 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* stock_picking_reorder_lines
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-09-30 12:04+0000\n"
+"PO-Revision-Date: 2013-09-30 12:04+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_reorder_lines
+#: model:ir.model,name:stock_picking_reorder_lines.model_stock_move
+msgid "Stock Move"
+msgstr "Stock Move"
+
+#. module: stock_picking_reorder_lines
+#: field:stock.move,sequence:0
+msgid "Sequence"
+msgstr "Sequence"
+
+#. module: stock_picking_reorder_lines
+#: model:ir.model,name:stock_picking_reorder_lines.model_sale_order
+msgid "Sales Order"
+msgstr "Sales Order"
+
+#. module: stock_picking_reorder_lines
+#: help:stock.move,sequence:0
+msgid "Gives the sequence of this line when displaying the picking."
+msgstr "Gives the sequence of this line when displaying the picking."
+
+#. module: stock_picking_reorder_lines
+#: model:ir.model,name:stock_picking_reorder_lines.model_stock_picking
+msgid "Picking List"
+msgstr "Picking List"
+

=== added file 'stock_picking_reorder_lines/i18n/fr.po'
--- stock_picking_reorder_lines/i18n/fr.po	1970-01-01 00:00:00 +0000
+++ stock_picking_reorder_lines/i18n/fr.po	2013-11-29 11:27:59 +0000
@@ -0,0 +1,42 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* stock_picking_reorder_lines
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-09-30 12:04+0000\n"
+"PO-Revision-Date: 2013-09-30 14:09+0200\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_reorder_lines
+#: model:ir.model,name:stock_picking_reorder_lines.model_stock_move
+msgid "Stock Move"
+msgstr "Mouvement de stock"
+
+#. module: stock_picking_reorder_lines
+#: field:stock.move,sequence:0
+msgid "Sequence"
+msgstr "Séquence"
+
+#. module: stock_picking_reorder_lines
+#: model:ir.model,name:stock_picking_reorder_lines.model_sale_order
+msgid "Sales Order"
+msgstr "Bon de commande"
+
+#. module: stock_picking_reorder_lines
+#: help:stock.move,sequence:0
+msgid "Gives the sequence of this line when displaying the picking."
+msgstr "Numéro d'ordre de la ligne lors de l'affichage de l'opération de manutention."
+
+#. module: stock_picking_reorder_lines
+#: model:ir.model,name:stock_picking_reorder_lines.model_stock_picking
+msgid "Picking List"
+msgstr "Opération de manutention"
+

=== added file 'stock_picking_reorder_lines/stock.py'
--- stock_picking_reorder_lines/stock.py	1970-01-01 00:00:00 +0000
+++ stock_picking_reorder_lines/stock.py	2013-11-29 11:27:59 +0000
@@ -0,0 +1,49 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Author: Alexandre Fayolle
+#    Copyright 2013 Camptocamp SA
+#
+#    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 orm, fields
+
+class stock_move(orm.Model):
+    _inherit = 'stock.move'
+    _columns = {
+        'sequence': fields.integer('Sequence', help="Gives the sequence of this line when displaying the picking."),
+        }
+    _order = 'date_expected desc, sequence, id'
+    _defaults = {'sequence': 10,
+                 }
+
+class stock_picking(orm.Model):
+    _inherit = 'stock.picking'
+
+    def _prepare_invoice_line(self, cr, uid, group, picking, move_line, invoice_id,
+                              invoice_vals, context=None):
+        res = super(stock_picking, self)._prepare_invoice_line(cr, uid, group, picking, move_line, invoice_id,
+                                                          invoice_vals, context)
+        res['sequence'] = move_line.sequence
+        return res
+
+class sale_order(orm.Model):
+    _inherit = 'sale.order'
+
+    def _prepare_order_line_move(self, cr, uid, order, line, picking_id, date_planned, context=None):
+        res = super(sale_order, self)._prepare_order_line_move(cr, uid, order, line, picking_id, date_planned, context)
+        res['sequence'] = line.sequence
+        return res

=== added file 'stock_picking_reorder_lines/stock_view.xml'
--- stock_picking_reorder_lines/stock_view.xml	1970-01-01 00:00:00 +0000
+++ stock_picking_reorder_lines/stock_view.xml	2013-11-29 11:27:59 +0000
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <record id="view_move_picking_tree" model="ir.ui.view">
+            <field name="name">stock.move.tree</field>
+            <field name="model">stock.move</field>
+            <field name="inherit_id" ref="stock.view_move_picking_tree" />
+            <field name="arch" type="xml">
+              <field name='product_id' position="before">
+                <field name="sequence" widget="handle"/>
+              </field>
+            </field>
+        </record>
+
+
+    </data>
+</openerp>


Follow ups