← Back to team overview

openerp-community-reviewer team mailing list archive

lp:~akretion-team/stock-logistic-flows/70-invoice-link-enhanced into lp:stock-logistic-flows/7.0

 

Alexis de Lattre has proposed merging lp:~akretion-team/stock-logistic-flows/70-invoice-link-enhanced into lp:stock-logistic-flows/7.0.

Requested reviews:
  Lorenzo Battistini - Agile BG (elbati)
  Stock and Logistic Core Editors (stock-logistic-core-editors)

For more details, see:
https://code.launchpad.net/~akretion-team/stock-logistic-flows/70-invoice-link-enhanced/+merge/192887

This merge proposal contains :
- one2many from invoice to pickings and display this one2many in the invoice view (in a dedicated tab)
- minor coding style improvements
-- 
https://code.launchpad.net/~akretion-team/stock-logistic-flows/70-invoice-link-enhanced/+merge/192887
Your team Stock and Logistic Core Editors is requested to review the proposed merge of lp:~akretion-team/stock-logistic-flows/70-invoice-link-enhanced into lp:stock-logistic-flows/7.0.
=== modified file 'stock_picking_invoice_link/__init__.py'
--- stock_picking_invoice_link/__init__.py	2013-10-11 07:29:16 +0000
+++ stock_picking_invoice_link/__init__.py	2013-10-28 15:25:11 +0000
@@ -18,4 +18,4 @@
 #
 ##############################################################################
 
-import stock
+from . import stock

=== modified file 'stock_picking_invoice_link/__openerp__.py'
--- stock_picking_invoice_link/__openerp__.py	2013-10-11 07:29:16 +0000
+++ stock_picking_invoice_link/__openerp__.py	2013-10-28 15:25:11 +0000
@@ -36,10 +36,10 @@
     "depends": ['stock'],
     "data": [
         "stock_view.xml",
+        "account_invoice_view.xml",
     ],
     "demo": [],
-    'test': [
-    ],
+    'test': [],
     "active": False,
     "installable": True
 }

=== added file 'stock_picking_invoice_link/account_invoice_view.xml'
--- stock_picking_invoice_link/account_invoice_view.xml	1970-01-01 00:00:00 +0000
+++ stock_picking_invoice_link/account_invoice_view.xml	2013-10-28 15:25:11 +0000
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+
+<!--
+    Stock Picking Invoice Link module for OpenERP
+    Copyright (C) 2013 Akretion (http://www.akretion.com/)
+    @author: Alexis de Lattre <alexis.delattre@xxxxxxxxxxxx>
+    The licence is in the file __openerp__.py
+-->
+
+<record id="invoice_form" model="ir.ui.view">
+    <field name="name">related.pickings.account.invoice.form</field>
+    <field name="model">account.invoice</field>
+    <field name="inherit_id" ref="account.invoice_form"/>
+    <field name="arch" type="xml">
+        <notebook position="inside">
+            <page string="Delivery Orders" name="pickings">
+                <field name="picking_ids"/>
+            </page>
+        </notebook>
+    </field>
+</record>
+
+<record id="invoice_supplier_form" model="ir.ui.view">
+    <field name="name">related.pickings.account.invoice.supplier.form</field>
+    <field name="model">account.invoice</field>
+    <field name="inherit_id" ref="account.invoice_supplier_form"/>
+    <field name="arch" type="xml">
+        <notebook position="inside">
+            <page string="Incoming Shipments" name="pickings">
+                <field name="picking_ids"/>
+            </page>
+        </notebook>
+    </field>
+</record>
+
+
+</data>
+</openerp>

=== modified file 'stock_picking_invoice_link/stock.py'
--- stock_picking_invoice_link/stock.py	2013-10-11 07:29:16 +0000
+++ stock_picking_invoice_link/stock.py	2013-10-28 15:25:11 +0000
@@ -19,7 +19,6 @@
 ##############################################################################
 
 from openerp.osv import fields, orm
-from openerp.tools.translate import _
 
 
 class stock_move(orm.Model):
@@ -68,3 +67,13 @@
         'invoice_id': fields.many2one(
             'account.invoice', 'Invoice', readonly=True),
     }
+
+
+class account_invoice(orm.Model):
+    _inherit = "account.invoice"
+
+    _columns = {
+        'picking_ids': fields.one2many(
+            'stock.picking', 'invoice_id', 'Related Pickings', readonly=True,
+            help="Related pickings (only when the invoice has been generated from the picking)."),
+    }