Merge lp:~sandi-dirntis/openerpsl/20140717_1 into lp:openerpsl/7.0

Proposed by Aleksander Dirntiš
Status: Merged
Merged at revision: 436
Proposed branch: lp:~sandi-dirntis/openerpsl/20140717_1
Merge into: lp:openerpsl/7.0
Diff against target: 156 lines (+87/-38)
4 files modified
.bzrignore (+1/-0)
accounting_reports/__init__.py (+3/-2)
accounting_reports/overdue_and_financial_report.py (+44/-36)
accounting_reports/res_partner.py (+39/-0)
To merge this branch: bzr merge lp:~sandi-dirntis/openerpsl/20140717_1
Reviewer Review Type Date Requested Status
Mentis Pending
Review via email: mp+228790@code.launchpad.net

Description of the change

[MOD] Modified accounting_reports addon

To post a comment you must log in.
436. By Dušan Laznik (Mentis)

[MOD] Modified accounting_reports addon

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2014-07-17 08:30:12 +0000
3+++ .bzrignore 2014-07-30 06:50:44 +0000
4@@ -1,1 +1,2 @@
5 ./.git
6+.DS_Store
7
8=== modified file 'accounting_reports/__init__.py'
9--- accounting_reports/__init__.py 2014-05-07 12:52:05 +0000
10+++ accounting_reports/__init__.py 2014-07-30 06:50:44 +0000
11@@ -19,7 +19,8 @@
12 #
13 ##############################################################################
14
15-import report
16+import res_partner
17 import account_account
18+import overdue_and_financial_report
19 import wizard
20-import overdue_and_financial_report
21+import report
22
23=== modified file 'accounting_reports/overdue_and_financial_report.py'
24--- accounting_reports/overdue_and_financial_report.py 2014-05-08 07:47:31 +0000
25+++ accounting_reports/overdue_and_financial_report.py 2014-07-30 06:50:44 +0000
26@@ -46,42 +46,50 @@
27 def init(self, cr):
28 drop_view_if_exists(cr, 'overdue_financial_report')
29 cr.execute("""
30- create or replace view overdue_financial_report as (
31- SELECT
32- AML.id as id,
33- AML.date as date,
34- AML.date_maturity as date_maturity,
35- AML.name as name,
36- AML.ref as reference,
37- P.name as partner,
38- AM.name as journal_entry,
39- AML.debit as debit,
40- AML.credit as credit,
41- AML.debit-AML.credit as saldo,
42- AP.name as period,
43- AML.reconcile_id as reconcile,
44- CASE
45- WHEN P.business_partner_type = '1' THEN 'D.D.'
46- WHEN P.business_partner_type = '2' THEN 'D.O.O.'
47- WHEN P.business_partner_type = '3' THEN 'S.P.'
48- WHEN P.business_partner_type = '4' THEN 'Bolnice'
49- WHEN P.business_partner_type = '5' THEN 'Šole'
50- WHEN P.business_partner_type = '6' THEN 'Sindikati'
51- WHEN P.business_partner_type = '7' THEN 'Društva'
52- WHEN P.business_partner_type = '8' THEN 'Zavarovalnice'
53- WHEN P.business_partner_type = '9' THEN 'Vrtec'
54- WHEN P.business_partner_type = '10' THEN 'Občine'
55- ELSE 'Neopredeljeni'
56- END as partner_type,
57- AA.type as account_type,
58- AA.code as account_code
59- FROM account_move_line AML
60- LEFT JOIN account_account AA ON AML.account_id = AA.id
61- LEFT JOIN res_partner P ON AML.partner_id = P.id
62- LEFT JOIN account_move AM ON AML.move_id = AM.id
63- LEFT JOIN account_period AP ON AML.period_id = AP.id
64- WHERE
65- AA.reconcile = true
66+ CREATE OR REPLACE VIEW overdue_financial_report AS (
67+ SELECT aml.id AS id,
68+ aml.date AS date,
69+ aml.date_maturity AS date_maturity,
70+ aml.name AS name,
71+ aml.ref AS reference,
72+ pa.name AS partner,
73+ am.name AS journal_entry,
74+ aml.debit AS debit,
75+ aml.credit AS credit,
76+ aml.debit-aml.credit AS saldo,
77+ ap.name AS period,
78+ aml.reconcile_id AS reconcile,
79+ CASE
80+ WHEN pa.business_partner_type = '1'
81+ THEN 'D.D.'
82+ WHEN pa.business_partner_type = '2'
83+ THEN 'D.O.O.'
84+ WHEN pa.business_partner_type = '3'
85+ THEN 'S.pa.'
86+ WHEN pa.business_partner_type = '4'
87+ THEN 'Bolnice'
88+ WHEN pa.business_partner_type = '5'
89+ THEN 'Šole'
90+ WHEN pa.business_partner_type = '6'
91+ THEN 'Sindikati'
92+ WHEN pa.business_partner_type = '7'
93+ THEN 'Društva'
94+ WHEN pa.business_partner_type = '8'
95+ THEN 'Zavarovalnice'
96+ WHEN pa.business_partner_type = '9'
97+ THEN 'Vrtec'
98+ WHEN pa.business_partner_type = '10'
99+ THEN 'Občine'
100+ ELSE 'Neopredeljeni'
101+ END AS partner_type,
102+ aa.type AS account_type,
103+ aa.code AS account_code
104+ FROM account_move_line AS aml
105+ LEFT JOIN account_account AS aa ON aa.id = aml.account_id
106+ LEFT JOIN res_partner AS pa ON pa.id = aml.partner_id
107+ LEFT JOIN account_move AS am ON am.id = aml.move_id
108+ LEFT JOIN account_period AS ap ON ap.id = aml.period_id
109+ WHERE aa.reconcile = true
110 )""")
111 overdue_financial_report()
112
113
114=== added file 'accounting_reports/res_partner.py'
115--- accounting_reports/res_partner.py 1970-01-01 00:00:00 +0000
116+++ accounting_reports/res_partner.py 2014-07-30 06:50:44 +0000
117@@ -0,0 +1,39 @@
118+# -*- coding: utf-8 -*-
119+##############################################################################
120+#
121+# OpenERP, Open Source Management Solution
122+# Copyright (C) 2014 Mentis d.o.o.
123+#
124+# This program is free software: you can redistribute it and/or modify
125+# it under the terms of the GNU Affero General Public License as
126+# published by the Free Software Foundation, either version 3 of the
127+# License, or (at your option) any later version.
128+#
129+# This program is distributed in the hope that it will be useful,
130+# but WITHOUT ANY WARRANTY; without even the implied warranty of
131+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
132+# GNU Affero General Public License for more details.
133+#
134+# You should have received a copy of the GNU Affero General Public License
135+# along with this program. If not, see <http://www.gnu.org/licenses/>.
136+#
137+##############################################################################
138+
139+from osv import fields, osv
140+from tools.translate import _
141+
142+class res_partner(osv.osv):
143+ _inherit = 'res.partner'
144+
145+ _columns = {
146+ 'business_partner_type': fields.selection([('1','D.D.'),
147+ ('2','D.O.O.'),
148+ ('3','S.P.'),
149+ ('4','Bolnice'),
150+ ('5','Šole'),
151+ ('6','Sindikati'),
152+ ('7','Društva'),
153+ ('8','Zavarovalnice'),
154+ ('9','Vrtec'),
155+ ('10','Občine')], 'Type of Business Partner')
156+ }

Subscribers

People subscribed via source and target branches