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

Proposed by Alexis de Lattre
Status: Merged
Merged at revision: 29
Proposed branch: lp:~akretion-team/stock-logistic-flows/61-invoice-link-updated
Merge into: lp:stock-logistic-flows/6.1
Diff against target: 304 lines (+196/-18)
7 files modified
stock_picking_invoice_link/AUTHORS.txt (+1/-0)
stock_picking_invoice_link/__init__.py (+2/-2)
stock_picking_invoice_link/__openerp__.py (+6/-8)
stock_picking_invoice_link/account_invoice_view.xml (+40/-0)
stock_picking_invoice_link/i18n/stock_picking_invoice_link.pot (+99/-0)
stock_picking_invoice_link/stock.py (+46/-6)
stock_picking_invoice_link/stock_view.xml (+2/-2)
To merge this branch: bzr merge lp:~akretion-team/stock-logistic-flows/61-invoice-link-updated
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp code review Approve
Pedro Manuel Baeza code review Approve
Review via email: mp+204977@code.launchpad.net

Description of the change

Backport the enhancements of the stock_picking_invoice_link module from the 7.0 branch.
Add POT file.

To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Thanks for backporting it. Seems OK for me reviewing code, but I didn't test it.

Regards.

review: Approve (code review)
30. By Alexis de Lattre

Display the appropriate form view.

31. By Alexis de Lattre

Add nolabel="1"

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

LTGM Thanks

review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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-06 22:48:31 +0000
@@ -1,1 +1,2 @@
1Lorenzo Battistini <lorenzo.battistini@agilebg.com>1Lorenzo Battistini <lorenzo.battistini@agilebg.com>
2Alexis de Lattre <alexis.delattre@akretion.com>
23
=== 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-06 22:48:31 +0000
@@ -1,6 +1,6 @@
1# -*- coding: utf-8 -*-1# -*- coding: utf-8 -*-
2##############################################################################2##############################################################################
3# 3#
4# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>)4# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>)
5#5#
6# This program is free software: you can redistribute it and/or modify6# This program is free software: you can redistribute it and/or modify
@@ -18,4 +18,4 @@
18#18#
19##############################################################################19##############################################################################
2020
21import stock21from . import stock
2222
=== 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-06 22:48:31 +0000
@@ -20,23 +20,21 @@
2020
21{21{
22 'name': "Picking Invoice Link",22 'name': "Picking Invoice Link",
23 'version': '0.1',23 'version': '0.2',
24 'category': 'Warehouse Management',24 'category': 'Warehouse Management',
25 'description': """25 'description': """
26This module adds a link between pickings and generated invoices. So that user can easly reach the invoice related to the picking.26This 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.
2727
28""",28""",
29 'author': 'Agile Business Group',29 'author': 'Agile Business Group',
30 'website': 'http://www.agilebg.com',30 'website': 'http://www.agilebg.com',
31 'license': 'AGPL-3',31 'license': 'AGPL-3',
32 "depends": ['stock'],32 "depends": ['stock'],
33 "init_xml": [],33 "data": [
34 "update_xml": [
35 "stock_view.xml",34 "stock_view.xml",
36 ],35 "account_invoice_view.xml",
37 "demo_xml": [],36 ],
38 'tests': [37 'tests': [],
39 ],
40 "installable": True,38 "installable": True,
41 "auto_install": False,39 "auto_install": False,
42 "application": False,40 "application": False,
4341
=== 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-06 22:48:31 +0000
@@ -0,0 +1,40 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3<data>
4
5<!--
6 Stock Picking Invoice Link module for OpenERP
7 Copyright (C) 2013 Akretion (http://www.akretion.com/)
8 @author: Alexis de Lattre <alexis.delattre@akretion.com>
9 The licence is in the file __openerp__.py
10-->
11
12<record id="invoice_form" model="ir.ui.view">
13 <field name="name">related.pickings.account.invoice.form</field>
14 <field name="model">account.invoice</field>
15 <field name="inherit_id" ref="account.invoice_form"/>
16 <field name="arch" type="xml">
17 <notebook position="inside">
18 <page string="Delivery Orders" name="pickings">
19 <field name="picking_ids" nolabel="1"/>
20 </page>
21 </notebook>
22 </field>
23</record>
24
25<record id="invoice_supplier_form" model="ir.ui.view">
26 <field name="name">related.pickings.account.invoice.supplier.form</field>
27 <field name="model">account.invoice</field>
28 <field name="inherit_id" ref="account.invoice_supplier_form"/>
29 <field name="arch" type="xml">
30 <notebook position="inside">
31 <page string="Incoming Shipments" name="pickings">
32 <field name="picking_ids" nolabel="1"/>
33 </page>
34 </notebook>
35 </field>
36</record>
37
38
39</data>
40</openerp>
041
=== 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-06 22:48:31 +0000
@@ -0,0 +1,99 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * stock_picking_invoice_link
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.1\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2014-02-05 15:08+0000\n"
10"PO-Revision-Date: 2014-02-05 15:08+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: stock_picking_invoice_link
19#: sql_constraint:account.invoice:0
20msgid "Invoice Number must be unique per Company!"
21msgstr ""
22
23#. module: stock_picking_invoice_link
24#: sql_constraint:stock.picking:0
25msgid "Reference must be unique per Company!"
26msgstr ""
27
28#. module: stock_picking_invoice_link
29#: view:account.invoice:0
30msgid "Incoming Shipments"
31msgstr ""
32
33#. module: stock_picking_invoice_link
34#: model:ir.model,name:stock_picking_invoice_link.model_stock_move
35msgid "Stock Move"
36msgstr ""
37
38#. module: stock_picking_invoice_link
39#: constraint:stock.move:0
40msgid "You can not move products from or to a location of the type view."
41msgstr ""
42
43#. module: stock_picking_invoice_link
44#: constraint:stock.move:0
45msgid "You must assign a production lot for this product"
46msgstr ""
47
48#. module: stock_picking_invoice_link
49#: field:account.invoice,picking_ids:0
50msgid "Related Pickings"
51msgstr ""
52
53#. module: stock_picking_invoice_link
54#: help:account.invoice,picking_ids:0
55msgid "Related pickings (only when the invoice has been generated from the picking)."
56msgstr ""
57
58#. module: stock_picking_invoice_link
59#: field:stock.move,invoice_line_id:0
60msgid "Invoice line"
61msgstr ""
62
63#. module: stock_picking_invoice_link
64#: model:ir.model,name:stock_picking_invoice_link.model_account_invoice_line
65msgid "Invoice Line"
66msgstr ""
67
68#. module: stock_picking_invoice_link
69#: constraint:stock.move:0
70msgid "You try to assign a lot which is not from the same product"
71msgstr ""
72
73#. module: stock_picking_invoice_link
74#: field:account.invoice.line,move_line_ids:0
75msgid "Related Stock Moves"
76msgstr ""
77
78#. module: stock_picking_invoice_link
79#: model:ir.model,name:stock_picking_invoice_link.model_account_invoice
80#: view:stock.picking:0
81#: field:stock.picking,invoice_id:0
82msgid "Invoice"
83msgstr ""
84
85#. module: stock_picking_invoice_link
86#: model:ir.model,name:stock_picking_invoice_link.model_stock_picking
87msgid "Picking List"
88msgstr ""
89
90#. module: stock_picking_invoice_link
91#: help:account.invoice.line,move_line_ids:0
92msgid "Related stock moves (only when the invoice has been generated from the picking)."
93msgstr ""
94
95#. module: stock_picking_invoice_link
96#: view:account.invoice:0
97msgid "Delivery Orders"
98msgstr ""
99
0100
=== 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-06 22:48:31 +0000
@@ -1,6 +1,6 @@
1# -*- coding: utf-8 -*-1# -*- coding: utf-8 -*-
2##############################################################################2##############################################################################
3# 3#
4# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>)4# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>)
5#5#
6# This program is free software: you can redistribute it and/or modify6# This program is free software: you can redistribute it and/or modify
@@ -19,16 +19,56 @@
19##############################################################################19##############################################################################
2020
21from openerp.osv import fields, orm21from openerp.osv import fields, orm
22from openerp.tools.translate import _22
23
24class stock_move(orm.Model):
25 _inherit = "stock.move"
26
27 _columns = {
28 'invoice_line_id': fields.many2one(
29 'account.invoice.line', 'Invoice Line', readonly=True),
30 }
31
2332
24class stock_picking(orm.Model):33class stock_picking(orm.Model):
25 _inherit = "stock.picking"34 _inherit = "stock.picking"
26 35
27 _columns = {36 _columns = {
28 'invoice_id': fields.many2one('account.invoice', 'Invoice', readonly=True),37 'invoice_id': fields.many2one(
38 'account.invoice', 'Invoice', readonly=True),
29 }39 }
30 40
31 def _invoice_hook(self, cr, uid, picking, invoice_id):41 def _invoice_hook(self, cr, uid, picking, invoice_id):
32 res = super(stock_picking,self)._invoice_hook(cr, uid, picking, invoice_id)42 res = super(stock_picking, self)._invoice_hook(
43 cr, uid, picking, invoice_id)
33 picking.write({'invoice_id': invoice_id})44 picking.write({'invoice_id': invoice_id})
34 return res45 return res
46
47 def _invoice_line_hook(self, cr, uid, move_line, invoice_line_id):
48 res = super(stock_picking, self)._invoice_line_hook(
49 cr, uid, move_line, invoice_line_id)
50 move_line.write({'invoice_line_id': invoice_line_id})
51 return res
52
53
54class account_invoice(orm.Model):
55 _inherit = "account.invoice"
56
57 _columns = {
58 'picking_ids': fields.one2many(
59 'stock.picking', 'invoice_id', 'Related Pickings', readonly=True,
60 help="Related pickings (only when the invoice has been generated "
61 "from the picking)."),
62 }
63
64
65class account_invoice_line(orm.Model):
66 _inherit = "account.invoice.line"
67
68 _columns = {
69 'move_line_ids': fields.one2many(
70 'stock.move', 'invoice_line_id', 'Related Stock Moves',
71 readonly=True,
72 help="Related stock moves (only when the invoice has been "
73 "generated from the picking)."),
74 }
3575
=== modified file 'stock_picking_invoice_link/stock_view.xml'
--- stock_picking_invoice_link/stock_view.xml 2013-10-03 20:54:30 +0000
+++ stock_picking_invoice_link/stock_view.xml 2014-02-06 22:48:31 +0000
@@ -7,7 +7,7 @@
7 <field name="inherit_id" ref="stock.view_picking_out_form"></field>7 <field name="inherit_id" ref="stock.view_picking_out_form"></field>
8 <field name="arch" type="xml">8 <field name="arch" type="xml">
9 <field name="invoice_state" position="after">9 <field name="invoice_state" position="after">
10 <field name="invoice_id" string="Invoice" groups="account.group_account_invoice" attrs="{'invisible':[('invoice_state', '=', 'none')]}"/>10 <field name="invoice_id" string="Invoice" groups="account.group_account_invoice" attrs="{'invisible':[('invoice_state', '=', 'none')]}" context="{'form_view_ref': 'account.invoice_form'}"/>
11 </field>11 </field>
12 </field>12 </field>
13 </record>13 </record>
@@ -17,7 +17,7 @@
17 <field name="inherit_id" ref="stock.view_picking_in_form"></field>17 <field name="inherit_id" ref="stock.view_picking_in_form"></field>
18 <field name="arch" type="xml">18 <field name="arch" type="xml">
19 <field name="invoice_state" position="after">19 <field name="invoice_state" position="after">
20 <field name="invoice_id" string="Invoice" groups="account.group_account_invoice" attrs="{'invisible':[('invoice_state', '=', 'none')]}"/>20 <field name="invoice_id" string="Invoice" groups="account.group_account_invoice" attrs="{'invisible':[('invoice_state', '=', 'none')]}" context="{'form_view_ref': 'account.invoice_supplier_form'}"/>
21 </field>21 </field>
22 </field>22 </field>
23 </record>23 </record>

Subscribers

People subscribed via source and target branches