Merge lp:~akretion-team/account-financial-tools/7-account-journal-sale-refund-link-cde into lp:~account-core-editors/account-financial-tools/7.0

Proposed by Chafique DELLI on 2014-06-13
Status: Rejected
Rejected by: Nicolas Bessi - Camptocamp on 2014-06-30
Proposed branch: lp:~akretion-team/account-financial-tools/7-account-journal-sale-refund-link-cde
Merge into: lp:~account-core-editors/account-financial-tools/7.0
Diff against target: 191 lines (+166/-0)
5 files modified
account_journal_sale_refund_link/__init__.py (+25/-0)
account_journal_sale_refund_link/__openerp__.py (+45/-0)
account_journal_sale_refund_link/account.py (+34/-0)
account_journal_sale_refund_link/account_invoice_refund.py (+41/-0)
account_journal_sale_refund_link/account_view.xml (+21/-0)
To merge this branch: bzr merge lp:~akretion-team/account-financial-tools/7-account-journal-sale-refund-link-cde
Reviewer Review Type Date Requested Status
Pedro Manuel Baeza code review Approve on 2014-06-13
Akretion Team 2014-06-13 Pending
Review via email: mp+223037@code.launchpad.net

Commit message

add module 'account_journal_sale_refund_link'

Description of the change

add module 'account_journal_sale_refund_link' who was in the branch 'lp:account-extra-addons' in the version 6.1 and i ported in the version 7.0

To post a comment you must log in.
Pedro Manuel Baeza (pedro.baeza) wrote :

LGTM. Thanks.

Regards.

review: Approve (code review)
2. By Chafique DELLI on 2014-06-16

[IMP] add description of module

The project has moved to Github https://github.com/OCA/account-financial-tools.
Please resubmit your MP on github using following procedure https://github.com/OCA/maintainers-tools/wiki/How-to-move-a-Merge-Proposal-to-GitHub.

I put this MP in rejected in the meanwhile.

Regards

Unmerged revisions

2. By Chafique DELLI on 2014-06-16

[IMP] add description of module

1. By Chafique DELLI on 2014-06-13

[ADD]: add module account_journal_sale_refund_link

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'account_journal_sale_refund_link'
2=== added file 'account_journal_sale_refund_link/__init__.py'
3--- account_journal_sale_refund_link/__init__.py 1970-01-01 00:00:00 +0000
4+++ account_journal_sale_refund_link/__init__.py 2014-06-16 08:19:46 +0000
5@@ -0,0 +1,25 @@
6+# -*- encoding: utf-8 -*-
7+#################################################################################
8+#
9+# account_journal_sale_refund_link for OpenERP
10+# Copyright (C) 2011 Akretion Sébastien BEAU <sebastien.beau@akretion.com>
11+# 2014 Akretion Chafique DELLI <chafique.delli@akretion.com>
12+#
13+# This program is free software: you can redistribute it and/or modify
14+# it under the terms of the GNU Affero General Public License as
15+# published by the Free Software Foundation, either version 3 of the
16+# License, or (at your option) any later version.
17+#
18+# This program is distributed in the hope that it will be useful,
19+# but WITHOUT ANY WARRANTY; without even the implied warranty of
20+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+# GNU Affero General Public License for more details.
22+#
23+# You should have received a copy of the GNU Affero General Public License
24+# along with this program. If not, see <http://www.gnu.org/licenses/>.
25+#
26+#################################################################################
27+
28+
29+from . import account
30+from . import account_invoice_refund
31
32=== added file 'account_journal_sale_refund_link/__openerp__.py'
33--- account_journal_sale_refund_link/__openerp__.py 1970-01-01 00:00:00 +0000
34+++ account_journal_sale_refund_link/__openerp__.py 2014-06-16 08:19:46 +0000
35@@ -0,0 +1,45 @@
36+# -*- encoding: utf-8 -*-
37+#################################################################################
38+#
39+# account_journal_sale_refund_link for OpenERP
40+# Copyright (C) 2011 Akretion Sébastien BEAU <sebastien.beau@akretion.com>
41+# 2014 Akretion Chafique DELLI <chafique.delli@akretion.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
45+# published by the Free Software Foundation, either version 3 of the
46+# License, or (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+{
60+ 'name': 'account_journal_sale_refund_link',
61+ 'version': '0.1',
62+ 'category': 'Generic Modules/Others',
63+ 'license': 'AGPL-3',
64+ 'description': """
65+ Account Journal Sale Refund Link
66+ ================================
67+
68+ Binds a sale journal with a refund journal
69+
70+ """,
71+ 'author': 'Akretion',
72+ 'website': 'http://www.akretion.com/',
73+ 'depends': ['account'],
74+ 'data': [
75+ 'account_view.xml',
76+ ],
77+ 'demo': [],
78+ 'installable': True,
79+ 'active': False,
80+}
81
82=== added file 'account_journal_sale_refund_link/account.py'
83--- account_journal_sale_refund_link/account.py 1970-01-01 00:00:00 +0000
84+++ account_journal_sale_refund_link/account.py 2014-06-16 08:19:46 +0000
85@@ -0,0 +1,34 @@
86+# -*- encoding: utf-8 -*-
87+#################################################################################
88+#
89+# account_journal_sale_refund_link for OpenERP
90+# Copyright (C) 2011 Akretion Sébastien BEAU <sebastien.beau@akretion.com>
91+# 2014 Akretion Chafique DELLI <chafique.delli@akretion.com>
92+#
93+# This program is free software: you can redistribute it and/or modify
94+# it under the terms of the GNU Affero General Public License as
95+# published by the Free Software Foundation, either version 3 of the
96+# License, or (at your option) any later version.
97+#
98+# This program is distributed in the hope that it will be useful,
99+# but WITHOUT ANY WARRANTY; without even the implied warranty of
100+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
101+# GNU Affero General Public License for more details.
102+#
103+# You should have received a copy of the GNU Affero General Public License
104+# along with this program. If not, see <http://www.gnu.org/licenses/>.
105+#
106+#################################################################################
107+
108+from openerp.osv import fields, orm
109+
110+
111+class AccountJournal(orm.Model):
112+
113+ _inherit = "account.journal"
114+
115+
116+ _columns = {
117+ 'refund_journal_id':fields.many2one('account.journal', 'Refund Journal',
118+ domain=[('type', '=', 'sale_refund')]),
119+ }
120
121=== added file 'account_journal_sale_refund_link/account_invoice_refund.py'
122--- account_journal_sale_refund_link/account_invoice_refund.py 1970-01-01 00:00:00 +0000
123+++ account_journal_sale_refund_link/account_invoice_refund.py 2014-06-16 08:19:46 +0000
124@@ -0,0 +1,41 @@
125+# -*- encoding: utf-8 -*-
126+#################################################################################
127+#
128+# account_journal_sale_refund_link for OpenERP
129+# Copyright (C) 2011 Akretion Sébastien BEAU <sebastien.beau@akretion.com>
130+# 2014 Akretion Chafique DELLI <chafique.delli@akretion.com>
131+#
132+# This program is free software: you can redistribute it and/or modify
133+# it under the terms of the GNU Affero General Public License as
134+# published by the Free Software Foundation, either version 3 of the
135+# License, or (at your option) any later version.
136+#
137+# This program is distributed in the hope that it will be useful,
138+# but WITHOUT ANY WARRANTY; without even the implied warranty of
139+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
140+# GNU Affero General Public License for more details.
141+#
142+# You should have received a copy of the GNU Affero General Public License
143+# along with this program. If not, see <http://www.gnu.org/licenses/>.
144+#
145+#################################################################################
146+
147+from openerp.osv import orm
148+
149+
150+class AccountInvoiceRefund(orm.TransientModel):
151+
152+ _inherit = "account.invoice.refund"
153+
154+ def _get_journal(self, cr, uid, context=None):
155+ invoice_id = context.get('invoice_ids', [context['active_id']])[0]
156+ invoice = self.pool.get('account.invoice').browse(cr, uid, invoice_id, context=context)
157+ refund_journal_id = invoice.journal_id.refund_journal_id
158+ if refund_journal_id:
159+ return refund_journal_id.id
160+ else:
161+ return super(AccountInvoiceRefund, self)._get_journal(cr, uid, context)
162+
163+ _defaults = {
164+ 'journal_id': _get_journal,
165+ }
166
167=== added file 'account_journal_sale_refund_link/account_view.xml'
168--- account_journal_sale_refund_link/account_view.xml 1970-01-01 00:00:00 +0000
169+++ account_journal_sale_refund_link/account_view.xml 2014-06-16 08:19:46 +0000
170@@ -0,0 +1,21 @@
171+<?xml version="1.0" encoding="utf-8"?>
172+
173+<openerp>
174+ <data>
175+
176+ <record id="account_journal_sale_refund_link_account_journal_view_form" model="ir.ui.view">
177+ <field name="model">account.journal</field>
178+ <field name="inherit_id" ref="account.view_account_journal_form" />
179+ <field eval="16" name="priority"/>
180+ <field name="type">form</field>
181+ <field name="arch" type="xml">
182+ <data>
183+ <field name="type" position="after">
184+ <field name="refund_journal_id" attrs="{'invisible' : [('type', '!=', 'sale')]}"/>
185+ </field>
186+ </data>
187+ </field>
188+ </record>
189+
190+ </data>
191+</openerp>

Subscribers

People subscribed via source and target branches