← Back to team overview

openerp-community-reviewer team mailing list archive

[Merge] lp:~akretion-team/stock-logistic-flows/61-invoice-link-updated into lp:stock-logistic-flows/6.1

 

Alexis de Lattre has proposed merging lp:~akretion-team/stock-logistic-flows/61-invoice-link-updated into lp:stock-logistic-flows/6.1.

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

For more details, see:
https://code.launchpad.net/~akretion-team/stock-logistic-flows/61-invoice-link-updated/+merge/204977

Backport the enhancements of the stock_picking_invoice_link module from the 7.0 branch.
Add POT file.
-- 
https://code.launchpad.net/~akretion-team/stock-logistic-flows/61-invoice-link-updated/+merge/204977
Your team Stock and Logistic Core Editors is requested to review the proposed merge of lp:~akretion-team/stock-logistic-flows/61-invoice-link-updated into lp:stock-logistic-flows/6.1.
=== modified file 'stock_picking_invoice_link/AUTHORS.txt'
--- stock_picking_invoice_link/AUTHORS.txt	2013-06-03 14:50:36 +0000
+++ stock_picking_invoice_link/AUTHORS.txt	2014-02-05 15:14:43 +0000
@@ -1,1 +1,2 @@
 Lorenzo Battistini <lorenzo.battistini@xxxxxxxxxxx>
+Alexis de Lattre <alexis.delattre@xxxxxxxxxxxx>

=== modified file 'stock_picking_invoice_link/__init__.py'
--- stock_picking_invoice_link/__init__.py	2013-06-03 14:50:36 +0000
+++ stock_picking_invoice_link/__init__.py	2014-02-05 15:14:43 +0000
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 ##############################################################################
-#    
+#
 #    Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>)
 #
 #    This program is free software: you can redistribute it and/or modify
@@ -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-03 20:54:30 +0000
+++ stock_picking_invoice_link/__openerp__.py	2014-02-05 15:14:43 +0000
@@ -20,23 +20,21 @@
 
 {
     'name': "Picking Invoice Link",
-    'version': '0.1',
+    'version': '0.2',
     'category': 'Warehouse Management',
     'description': """
-This module adds a link between pickings and generated invoices. So that user can easly reach the invoice related to the picking.
+This module adds a link between pickings and generated invoices, so that user can easly reach the invoice related to the picking. It also adds a link between stock moves and invoice lines.
 
 """,
     'author': 'Agile Business Group',
     'website': 'http://www.agilebg.com',
     'license': 'AGPL-3',
     "depends": ['stock'],
-    "init_xml": [],
-    "update_xml": [
+    "data": [
         "stock_view.xml",
-    ],
-    "demo_xml": [],
-    'tests': [
-    ],
+        "account_invoice_view.xml",
+    ],
+    'tests': [],
     "installable": True,
     "auto_install": False,
     "application": False,

=== 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	2014-02-05 15:14:43 +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>

=== added directory 'stock_picking_invoice_link/i18n'
=== added file 'stock_picking_invoice_link/i18n/stock_picking_invoice_link.pot'
--- stock_picking_invoice_link/i18n/stock_picking_invoice_link.pot	1970-01-01 00:00:00 +0000
+++ stock_picking_invoice_link/i18n/stock_picking_invoice_link.pot	2014-02-05 15:14:43 +0000
@@ -0,0 +1,99 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* stock_picking_invoice_link
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-02-05 15:08+0000\n"
+"PO-Revision-Date: 2014-02-05 15:08+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_invoice_link
+#: sql_constraint:account.invoice:0
+msgid "Invoice Number must be unique per Company!"
+msgstr ""
+
+#. module: stock_picking_invoice_link
+#: sql_constraint:stock.picking:0
+msgid "Reference must be unique per Company!"
+msgstr ""
+
+#. module: stock_picking_invoice_link
+#: view:account.invoice:0
+msgid "Incoming Shipments"
+msgstr ""
+
+#. module: stock_picking_invoice_link
+#: model:ir.model,name:stock_picking_invoice_link.model_stock_move
+msgid "Stock Move"
+msgstr ""
+
+#. module: stock_picking_invoice_link
+#: constraint:stock.move:0
+msgid "You can not move products from or to a location of the type view."
+msgstr ""
+
+#. module: stock_picking_invoice_link
+#: constraint:stock.move:0
+msgid "You must assign a production lot for this product"
+msgstr ""
+
+#. module: stock_picking_invoice_link
+#: field:account.invoice,picking_ids:0
+msgid "Related Pickings"
+msgstr ""
+
+#. module: stock_picking_invoice_link
+#: help:account.invoice,picking_ids:0
+msgid "Related pickings (only when the invoice has been generated from the picking)."
+msgstr ""
+
+#. module: stock_picking_invoice_link
+#: field:stock.move,invoice_line_id:0
+msgid "Invoice line"
+msgstr ""
+
+#. module: stock_picking_invoice_link
+#: model:ir.model,name:stock_picking_invoice_link.model_account_invoice_line
+msgid "Invoice Line"
+msgstr ""
+
+#. module: stock_picking_invoice_link
+#: constraint:stock.move:0
+msgid "You try to assign a lot which is not from the same product"
+msgstr ""
+
+#. module: stock_picking_invoice_link
+#: field:account.invoice.line,move_line_ids:0
+msgid "Related Stock Moves"
+msgstr ""
+
+#. module: stock_picking_invoice_link
+#: model:ir.model,name:stock_picking_invoice_link.model_account_invoice
+#: view:stock.picking:0
+#: field:stock.picking,invoice_id:0
+msgid "Invoice"
+msgstr ""
+
+#. module: stock_picking_invoice_link
+#: model:ir.model,name:stock_picking_invoice_link.model_stock_picking
+msgid "Picking List"
+msgstr ""
+
+#. module: stock_picking_invoice_link
+#: help:account.invoice.line,move_line_ids:0
+msgid "Related stock moves (only when the invoice has been generated from the picking)."
+msgstr ""
+
+#. module: stock_picking_invoice_link
+#: view:account.invoice:0
+msgid "Delivery Orders"
+msgstr ""
+

=== modified file 'stock_picking_invoice_link/stock.py'
--- stock_picking_invoice_link/stock.py	2013-10-03 20:54:30 +0000
+++ stock_picking_invoice_link/stock.py	2014-02-05 15:14:43 +0000
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 ##############################################################################
-#    
+#
 #    Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>)
 #
 #    This program is free software: you can redistribute it and/or modify
@@ -19,16 +19,56 @@
 ##############################################################################
 
 from openerp.osv import fields, orm
-from openerp.tools.translate import _
+
+
+class stock_move(orm.Model):
+    _inherit = "stock.move"
+
+    _columns = {
+        'invoice_line_id': fields.many2one(
+            'account.invoice.line', 'Invoice Line', readonly=True),
+    }
+
 
 class stock_picking(orm.Model):
     _inherit = "stock.picking"
-    
+
     _columns = {
-        'invoice_id': fields.many2one('account.invoice', 'Invoice', readonly=True),
+        'invoice_id': fields.many2one(
+            'account.invoice', 'Invoice', readonly=True),
         }
-        
+
     def _invoice_hook(self, cr, uid, picking, invoice_id):
-        res = super(stock_picking,self)._invoice_hook(cr, uid, picking, invoice_id)
+        res = super(stock_picking, self)._invoice_hook(
+            cr, uid, picking, invoice_id)
         picking.write({'invoice_id': invoice_id})
         return res
+
+    def _invoice_line_hook(self, cr, uid, move_line, invoice_line_id):
+        res = super(stock_picking, self)._invoice_line_hook(
+            cr, uid, move_line, invoice_line_id)
+        move_line.write({'invoice_line_id': invoice_line_id})
+        return res
+
+
+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)."),
+    }
+
+
+class account_invoice_line(orm.Model):
+    _inherit = "account.invoice.line"
+
+    _columns = {
+        'move_line_ids': fields.one2many(
+            'stock.move', 'invoice_line_id', 'Related Stock Moves',
+            readonly=True,
+            help="Related stock moves (only when the invoice has been "
+            "generated from the picking)."),
+        }


Follow ups