rpms/tinyerp/F-9 tinyerp-pgsql.patch, NONE, 1.1 tinyerp.spec, 1.35, 1.36

Dan Horák sharkcz at fedoraproject.org
Mon Sep 1 07:31:25 UTC 2008


Author: sharkcz

Update of /cvs/extras/rpms/tinyerp/F-9
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv18459

Modified Files:
	tinyerp.spec 
Added Files:
	tinyerp-pgsql.patch 
Log Message:
* Mon Sep  1 2008 Dan Horak <dan[at]danny.cz> 4.2.2-4
- add patch for PostgreSQL 8.3 compatibility (from Pieter. J. Kersten)


tinyerp-pgsql.patch:

--- NEW FILE tinyerp-pgsql.patch ---
diff -Nru tinyerp-server-4.2.2.orig/bin/addons/report_analytic_line/report_analytic_line.py tinyerp-server-4.2.2/bin/addons/report_analytic_line/report_analytic_line.py
--- tinyerp-server-4.2.2.orig/bin/addons/report_analytic_line/report_analytic_line.py	2008-02-06 10:19:25.000000000 +0100
+++ tinyerp-server-4.2.2/bin/addons/report_analytic_line/report_analytic_line.py	2008-09-01 08:57:45.000000000 +0200
@@ -48,7 +48,7 @@
         cr.execute("""
             CREATE OR REPLACE VIEW report_account_analytic_line_to_invoice AS (
                 SELECT
-                    DISTINCT(SUBSTRING(l.date for 7))||'-'||'01' AS name,
+                    DISTINCT(TO_CHAR(l.date, 'YYYY-MM'))||'-'||'01' AS name,
                     MIN(l.id) AS id,
                     l.product_id,
                     l.account_id,
@@ -65,7 +65,7 @@
                 WHERE
                     (invoice_id IS NULL) and (to_invoice IS NOT NULL)
                 GROUP BY
-                    SUBSTRING(date for 7), product_id, product_uom_id, account_id
+                    TO_CHAR(date, 'YYYY-MM'), product_id, product_uom_id, account_id
             )
         """)
 report_account_analytic_line_to_invoice()
diff -Nru tinyerp-server-4.2.2.orig/bin/addons/report_crm/report_crm.py tinyerp-server-4.2.2/bin/addons/report_crm/report_crm.py
--- tinyerp-server-4.2.2.orig/bin/addons/report_crm/report_crm.py	2008-02-06 10:19:25.000000000 +0100
+++ tinyerp-server-4.2.2/bin/addons/report_crm/report_crm.py	2008-09-01 08:57:45.000000000 +0200
@@ -59,7 +59,7 @@
 			create or replace view report_crm_case_user as (
 				select
 					min(c.id) as id,
-					substring(c.create_date for 7)||'-01' as name,
+					to_char(c.create_date, 'YYYY-MM')||'-01' as name,
 					c.state,
 					c.user_id,
 					c.section_id,
@@ -71,7 +71,7 @@
 					to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
 				from
 					crm_case c
-				group by substring(c.create_date for 7), c.state, c.user_id, c.section_id
+				group by to_char(c.create_date, 'YYYY-MM'), c.state, c.user_id, c.section_id
 			)""")
 report_crm_case_user()
 
@@ -97,7 +97,7 @@
 			create or replace view report_crm_case_categ as (
 				select
 					min(c.id) as id,
-					substring(c.create_date for 7)||'-01' as name,
+					to_char(c.create_date, 'YYYY-MM')||'-01' as name,
 					c.state,
 					c.categ_id,
 					c.section_id,
@@ -109,6 +109,6 @@
 					to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
 				from
 					crm_case c
-				group by substring(c.create_date for 7), c.state, c.categ_id, c.section_id
+				group by to_char(c.create_date, 'YYYY-MM'), c.state, c.categ_id, c.section_id
 			)""")
 report_crm_case_categ()
diff -Nru tinyerp-server-4.2.2.orig/bin/addons/report_intrastat/report_intrastat.py tinyerp-server-4.2.2/bin/addons/report_intrastat/report_intrastat.py
--- tinyerp-server-4.2.2.orig/bin/addons/report_intrastat/report_intrastat.py	2008-02-06 10:19:29.000000000 +0100
+++ tinyerp-server-4.2.2/bin/addons/report_intrastat/report_intrastat.py	2008-09-01 08:57:45.000000000 +0200
@@ -74,7 +74,7 @@
 		cr.execute("""
 			create or replace view report_intrastat as (
 				select
-					substring(m.create_date for 7)||'-01' as name,
+					to_char(m.create_date, 'YYYY-MM')||'-01' as name,
 					min(m.id) as id,
 					pt.intrastat_id as intrastat_id,
 					case when l.usage in ('supplier', 'customer') then upper(pc.code) else upper(c.code) end as code,
@@ -122,7 +122,7 @@
 					and ((l.usage in ('supplier', 'customer') and dl.usage not in ('supplier', 'customer'))
 						or (dl.usage in ('supplier', 'customer') and l.usage not in ('supplier', 'customer')))
 					and (c.intrastat is not null or pc.intrastat is not null)
-				group by substring(m.create_date for 7), pt.intrastat_id, c.code, pc.code, l.usage, dl.usage, ppl.currency_id, spl.currency_id
+				group by to_char(m.create_date, 'YYYY-MM'), pt.intrastat_id, c.code, pc.code, l.usage, dl.usage, ppl.currency_id, spl.currency_id
 			)""")
 report_intrastat()
 
diff -Nru tinyerp-server-4.2.2.orig/bin/addons/report_project/report_project.py tinyerp-server-4.2.2/bin/addons/report_project/report_project.py
--- tinyerp-server-4.2.2.orig/bin/addons/report_project/report_project.py	2008-02-06 10:19:29.000000000 +0100
+++ tinyerp-server-4.2.2/bin/addons/report_project/report_project.py	2008-09-01 08:57:45.000000000 +0200
@@ -49,7 +49,7 @@
             create or replace view report_project_task_user as (
                 select
                     min(t.id) as id,
-                    substring(date_close for 7)||'-01' as name,
+                    to_char(date_close, 'YYYY-MM')||'-01' as name,
                     count(distinct t.id) as task_closed,
                     t.user_id,
                     t.project_id,
@@ -62,7 +62,7 @@
                 where
                     t.state='done'
                 group by
-                    substring(date_close for 7),t.user_id,project_id
+                    to_char(date_close, 'YYYY-MM'),t.user_id,project_id
             )
         """)
 report_project_task_user()
@@ -87,7 +87,7 @@
             create or replace view report_project_task as (
                 select
                     min(t.id) as id,
-                    substring(date_close for 7)||'-01' as name,
+                    to_char(date_close, 'YYYY-MM')||'-01' as name,
                     count(distinct t.id) as task_closed,
                     t.project_id,
                     sum(planned_hours) as hours_planned,
@@ -99,7 +99,7 @@
                 where
                     t.state='done'
                 group by
-                    substring(date_close for 7),project_id
+                    to_char(date_close, 'YYYY-MM'),project_id
             )
         """)
 report_project_task()
diff -Nru tinyerp-server-4.2.2.orig/bin/addons/report_purchase/report_purchase.py tinyerp-server-4.2.2/bin/addons/report_purchase/report_purchase.py
--- tinyerp-server-4.2.2.orig/bin/addons/report_purchase/report_purchase.py	2008-02-06 10:19:29.000000000 +0100
+++ tinyerp-server-4.2.2/bin/addons/report_purchase/report_purchase.py	2008-09-01 08:57:45.000000000 +0200
@@ -61,7 +61,7 @@
 			create or replace view report_purchase_order_product as (
 				select
 					min(l.id) as id,
-					substring(s.date_order for 7)||'-'||'01' as name,
+					to_char(s.date_order, 'YYYY-MM')||'-'||'01' as name,
 					s.state,
 					l.product_id,
 					sum(l.product_qty*u.factor) as quantity,
@@ -71,7 +71,7 @@
 				from purchase_order s
 					left join purchase_order_line l on (s.id=l.order_id)
 					left join product_uom u on (u.id=l.product_uom)
-				group by l.product_id, substring(s.date_order for 7),s.state
+				group by l.product_id, to_char(s.date_order, 'YYYY-MM'),s.state
 			)
 		""")
 report_purchase_order_product()
@@ -104,7 +104,7 @@
 			create or replace view report_purchase_order_category as (
 				select
 					min(l.id) as id,
-					substring(s.date_order for 7)||'-'||'01' as name,
+					to_char(s.date_order, 'YYYY-MM')||'-'||'01' as name,
 					s.state,
 					t.categ_id as category_id,
 					sum(l.product_qty*u.factor) as quantity,
@@ -116,7 +116,7 @@
 					left join product_product p on (p.id=l.product_id)
 					left join product_template t on (t.id=p.product_tmpl_id)
 					left join product_uom u on (u.id=l.product_uom)
-				group by t.categ_id, substring(s.date_order for 7),s.state
+				group by t.categ_id, to_char(s.date_order, 'YYYY-MM'),s.state
 			 )
 		""")
 report_purchase_order_category()
diff -Nru tinyerp-server-4.2.2.orig/bin/addons/report_sale/report_sale.py tinyerp-server-4.2.2/bin/addons/report_sale/report_sale.py
--- tinyerp-server-4.2.2.orig/bin/addons/report_sale/report_sale.py	2008-02-06 10:19:22.000000000 +0100
+++ tinyerp-server-4.2.2/bin/addons/report_sale/report_sale.py	2008-09-01 08:57:45.000000000 +0200
@@ -57,7 +57,7 @@
 			create or replace view report_sale_order_product as (
 				select
 					min(l.id) as id,
-					substring(s.date_order for 7)||'-'||'01' as name,
+					to_char(s.date_order, 'YYYY-MM')||'-'||'01' as name,
 					s.state,
 					l.product_id,
 					sum(l.product_uom_qty*u.factor) as quantity,
@@ -67,7 +67,7 @@
 				from sale_order s
 					right join sale_order_line l on (s.id=l.order_id)
 					left join product_uom u on (u.id=l.product_uom)
-				group by l.product_id, substring(s.date_order for 7),s.state
+				group by l.product_id, to_char(s.date_order, 'YYYY-MM'),s.state
 			)
 		""")
 # Done in the _auto_init
@@ -109,7 +109,7 @@
 			create or replace view report_sale_order_category as (
 				select
 					min(l.id) as id,
-					substring(s.date_order for 7)||'-'||'01' as name,
+					to_char(s.date_order, 'YYYY-MM')||'-'||'01' as name,
 					s.state,
 					t.categ_id as category_id,
 					sum(l.product_uom_qty*u.factor) as quantity,
@@ -121,7 +121,7 @@
 					left join product_product p on (p.id=l.product_id)
 					left join product_template t on (t.id=p.product_tmpl_id)
 					left join product_uom u on (u.id=l.product_uom)
-				group by t.categ_id, substring(s.date_order for 7),s.state
+				group by t.categ_id, to_char(s.date_order, 'YYYY-MM'),s.state
 			)
 		""")
 report_sale_order_category()
diff -Nru tinyerp-server-4.2.2.orig/bin/addons/report_timesheet/report_timesheet.py tinyerp-server-4.2.2/bin/addons/report_timesheet/report_timesheet.py
--- tinyerp-server-4.2.2.orig/bin/addons/report_timesheet/report_timesheet.py	2008-02-06 10:19:23.000000000 +0100
+++ tinyerp-server-4.2.2/bin/addons/report_timesheet/report_timesheet.py	2008-09-01 08:57:45.000000000 +0200
@@ -74,14 +74,14 @@
 			create or replace view report_timesheet_account as (
 				select
 					min(id) as id,
-					substring(create_date for 7)||'-01' as name,
+					to_char(create_date, 'YYYY-MM')||'-01' as name,
 					user_id,
 					account_id,
 					sum(unit_amount) as quantity
 				from
 					account_analytic_line
 				group by
-					substring(create_date for 7), user_id, account_id
+					to_char(create_date, 'YYYY-MM'), user_id, account_id
 			)
 		""")
 report_timesheet_account()


Index: tinyerp.spec
===================================================================
RCS file: /cvs/extras/rpms/tinyerp/F-9/tinyerp.spec,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- tinyerp.spec	1 Jul 2008 10:22:30 -0000	1.35
+++ tinyerp.spec	1 Sep 2008 07:30:54 -0000	1.36
@@ -4,7 +4,7 @@
 
 Name:		tinyerp
 Version:	4.2.2
-Release:	3%{?dist}
+Release:	4%{?dist}
 License:	GPLv2+
 Group:		Applications/Productivity
 Summary:	Open Source ERP Client
@@ -16,6 +16,7 @@
 Source4:	tinyerp-server
 Source5:	tinyerp-server.logrotate
 Source6:	README.Fedora
+Patch0:		tinyerp-pgsql.patch
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:	noarch
 BuildRequires:	python, pygtk2-devel, pygtk2-libglade
@@ -55,6 +56,7 @@
 
 %prep
 %setup -q -a 1 -c %{name}-%{version}
+%patch0 -p0
 
 # update docs
 rm tinyerp-client-%{version}/doc/License.rtf
@@ -162,6 +164,9 @@
 
 
 %changelog
+* Mon Sep  1 2008 Dan Horak <dan[at]danny.cz> 4.2.2-4
+- add patch for PostgreSQL 8.3 compatibility (from Pieter. J. Kersten)
+
 * Fri May 30 2008 Dan Horak <dan[at]danny.cz> 4.2.2-3
 - add missing R: python-matplotlib (Resolves: #449118)
 




More information about the fedora-extras-commits mailing list