Merge lp:~sebastien.beau/stock-logistic-flows/stock-logistic-flows-61-backport-stock_picking_invoice_link into lp:stock-logistic-flows/6.1

Proposed by Sébastien BEAU - http://www.akretion.com
Status: Merged
Merged at revision: 27
Proposed branch: lp:~sebastien.beau/stock-logistic-flows/stock-logistic-flows-61-backport-stock_picking_invoice_link
Merge into: lp:stock-logistic-flows/6.1
Diff against target: 151 lines (+124/-0)
5 files modified
stock_picking_invoice_link/AUTHORS.txt (+1/-0)
stock_picking_invoice_link/__init__.py (+21/-0)
stock_picking_invoice_link/__openerp__.py (+43/-0)
stock_picking_invoice_link/stock.py (+34/-0)
stock_picking_invoice_link/stock_view.xml (+25/-0)
To merge this branch: bzr merge lp:~sebastien.beau/stock-logistic-flows/stock-logistic-flows-61-backport-stock_picking_invoice_link
Reviewer Review Type Date Requested Status
Pedro Manuel Baeza code review, no test Approve
Joël Grand-Guillaume @ camptocamp code review, no tests Approve
Review via email: mp+189179@code.launchpad.net

Description of the change

Backport the usefull module stock_picking_invoice_link

To post a comment you must log in.
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

LGTM, Thanks !

review: Approve (code review, no tests)
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

LGTM.

Maybe AUTHORS.txt file can be removed and include this information as a comment on __openerp__.py.

Regards.

review: Approve (code review, no test)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'stock_picking_invoice_link'
2=== added file 'stock_picking_invoice_link/AUTHORS.txt'
3--- stock_picking_invoice_link/AUTHORS.txt 1970-01-01 00:00:00 +0000
4+++ stock_picking_invoice_link/AUTHORS.txt 2013-10-03 21:33:08 +0000
5@@ -0,0 +1,1 @@
6+Lorenzo Battistini <lorenzo.battistini@agilebg.com>
7
8=== added file 'stock_picking_invoice_link/__init__.py'
9--- stock_picking_invoice_link/__init__.py 1970-01-01 00:00:00 +0000
10+++ stock_picking_invoice_link/__init__.py 2013-10-03 21:33:08 +0000
11@@ -0,0 +1,21 @@
12+# -*- coding: utf-8 -*-
13+##############################################################################
14+#
15+# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>)
16+#
17+# This program is free software: you can redistribute it and/or modify
18+# it under the terms of the GNU Affero General Public License as published
19+# by the Free Software Foundation, either version 3 of the License, or
20+# (at your option) any later version.
21+#
22+# This program is distributed in the hope that it will be useful,
23+# but WITHOUT ANY WARRANTY; without even the implied warranty of
24+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25+# GNU Affero General Public License for more details.
26+#
27+# You should have received a copy of the GNU Affero General Public License
28+# along with this program. If not, see <http://www.gnu.org/licenses/>.
29+#
30+##############################################################################
31+
32+import stock
33
34=== added file 'stock_picking_invoice_link/__openerp__.py'
35--- stock_picking_invoice_link/__openerp__.py 1970-01-01 00:00:00 +0000
36+++ stock_picking_invoice_link/__openerp__.py 2013-10-03 21:33:08 +0000
37@@ -0,0 +1,43 @@
38+# -*- coding: utf-8 -*-
39+##############################################################################
40+#
41+# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>)
42+#
43+# This program is free software: you can redistribute it and/or modify
44+# it under the terms of the GNU Affero General Public License as published
45+# by the Free Software Foundation, either version 3 of the License, or
46+# (at your option) any later version.
47+#
48+# This program is distributed in the hope that it will be useful,
49+# but WITHOUT ANY WARRANTY; without even the implied warranty of
50+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
51+# GNU Affero General Public License for more details.
52+#
53+# You should have received a copy of the GNU Affero General Public License
54+# along with this program. If not, see <http://www.gnu.org/licenses/>.
55+#
56+##############################################################################
57+
58+{
59+ 'name': "Picking Invoice Link",
60+ 'version': '0.1',
61+ 'category': 'Warehouse Management',
62+ 'description': """
63+This module adds a link between pickings and generated invoices. So that user can easly reach the invoice related to the picking.
64+
65+""",
66+ 'author': 'Agile Business Group',
67+ 'website': 'http://www.agilebg.com',
68+ 'license': 'AGPL-3',
69+ "depends": ['stock'],
70+ "init_xml": [],
71+ "update_xml": [
72+ "stock_view.xml",
73+ ],
74+ "demo_xml": [],
75+ 'tests': [
76+ ],
77+ "installable": True,
78+ "auto_install": False,
79+ "application": False,
80+}
81
82=== added file 'stock_picking_invoice_link/stock.py'
83--- stock_picking_invoice_link/stock.py 1970-01-01 00:00:00 +0000
84+++ stock_picking_invoice_link/stock.py 2013-10-03 21:33:08 +0000
85@@ -0,0 +1,34 @@
86+# -*- coding: utf-8 -*-
87+##############################################################################
88+#
89+# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>)
90+#
91+# This program is free software: you can redistribute it and/or modify
92+# it under the terms of the GNU Affero General Public License as published
93+# by the Free Software Foundation, either version 3 of the License, or
94+# (at your option) any later version.
95+#
96+# This program is distributed in the hope that it will be useful,
97+# but WITHOUT ANY WARRANTY; without even the implied warranty of
98+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
99+# GNU Affero General Public License for more details.
100+#
101+# You should have received a copy of the GNU Affero General Public License
102+# along with this program. If not, see <http://www.gnu.org/licenses/>.
103+#
104+##############################################################################
105+
106+from openerp.osv import fields, orm
107+from openerp.tools.translate import _
108+
109+class stock_picking(orm.Model):
110+ _inherit = "stock.picking"
111+
112+ _columns = {
113+ 'invoice_id': fields.many2one('account.invoice', 'Invoice', readonly=True),
114+ }
115+
116+ def _invoice_hook(self, cr, uid, picking, invoice_id):
117+ res = super(stock_picking,self)._invoice_hook(cr, uid, picking, invoice_id)
118+ picking.write({'invoice_id': invoice_id})
119+ return res
120
121=== added file 'stock_picking_invoice_link/stock_view.xml'
122--- stock_picking_invoice_link/stock_view.xml 1970-01-01 00:00:00 +0000
123+++ stock_picking_invoice_link/stock_view.xml 2013-10-03 21:33:08 +0000
124@@ -0,0 +1,25 @@
125+<?xml version="1.0" encoding="utf-8"?>
126+<openerp>
127+<data>
128+ <record id="view_picking_out_form" model="ir.ui.view">
129+ <field name="name">stock.picking.out.form</field>
130+ <field name="model">stock.picking</field>
131+ <field name="inherit_id" ref="stock.view_picking_out_form"></field>
132+ <field name="arch" type="xml">
133+ <field name="invoice_state" position="after">
134+ <field name="invoice_id" string="Invoice" groups="account.group_account_invoice" attrs="{'invisible':[('invoice_state', '=', 'none')]}"/>
135+ </field>
136+ </field>
137+ </record>
138+ <record id="view_picking_in_form" model="ir.ui.view">
139+ <field name="name">stock.picking.in.form</field>
140+ <field name="model">stock.picking</field>
141+ <field name="inherit_id" ref="stock.view_picking_in_form"></field>
142+ <field name="arch" type="xml">
143+ <field name="invoice_state" position="after">
144+ <field name="invoice_id" string="Invoice" groups="account.group_account_invoice" attrs="{'invisible':[('invoice_state', '=', 'none')]}"/>
145+ </field>
146+ </field>
147+ </record>
148+</data>
149+</openerp>
150
151=== added directory 'stock_picking_invoice_link/test'

Subscribers

People subscribed via source and target branches