From 957916b8447819e24c7926aa4b19cbec2ef705e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 24 Apr 2012 12:19:27 +0200 Subject: [PATCH 1/6] Increase version number --- __tryton__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tryton__.py b/__tryton__.py index a1d02f454b..5996795aca 100644 --- a/__tryton__.py +++ b/__tryton__.py @@ -9,7 +9,7 @@ 'name_es_CO': 'Ingresos por proyectos', 'name_es_ES': 'Ingresos por proyecto', 'name_fr_FR': 'Revenu des projets', - 'version': '2.4.0', + 'version': '2.4.1', 'author': 'B2CK', 'email': 'info@b2ck.com', 'website': 'http://www.tryton.org/', From e1f7effe25529bffc5f8c6e756cc494dfb43f0e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 17 Oct 2012 16:30:06 +0200 Subject: [PATCH 2/6] Fix revenue/cost computation issue2827 (transplanted from c1347f5c387598330db7ddb64b112f8d25ea7328) --- work.py | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/work.py b/work.py index eefb7ea21b..ca10fbbaac 100644 --- a/work.py +++ b/work.py @@ -57,10 +57,11 @@ class Work(ModelSQL, ModelView): ('parent', 'child_of', ids), ('active', '=', True)]) + ids all_ids = list(set(all_ids)) + works = set(self.browse(all_ids)) res = {} id2work = {} leafs = set() - for work in self.browse(all_ids): + for work in works: id2work[work.id] = work if not work.children: leafs.add(work.id) @@ -70,20 +71,20 @@ class Work(ModelSQL, ModelView): res[work.id] += timesheet_line_obj.compute_cost(ts_line) while leafs: - parents = set() for work_id in leafs: work = id2work[work_id] + works.remove(work) if not work.active: continue if work.parent and work.parent.id in res: res[work.parent.id] += res[work_id] - parents.add(work.parent.id) - leafs = parents - - for id in all_ids: - if id not in ids: - del res[id] - + next_leafs = set(w.id for w in works) + for work in works: + if not work.parent: + continue + if work.parent.id in next_leafs and work.parent in works: + next_leafs.remove(work.parent.id) + leafs = next_leafs return res def get_revenue(self, ids, name): @@ -91,10 +92,11 @@ class Work(ModelSQL, ModelView): ('parent', 'child_of', ids), ('active', '=', True)]) + ids all_ids = list(set(all_ids)) + works = set(self.browse(all_ids)) res = {} id2work = {} leafs = set() - for work in self.browse(all_ids): + for work in works: id2work[work.id] = work if not work.children: leafs.add(work.id) @@ -106,20 +108,20 @@ class Work(ModelSQL, ModelView): res[work.id] = Decimal('0') while leafs: - parents = set() for work_id in leafs: work = id2work[work_id] + works.remove(work) if not work.active: continue if work.parent and work.parent.id in res: res[work.parent.id] += res[work_id] - parents.add(work.parent.id) - leafs = parents - - for id in all_ids: - if id not in ids: - del res[id] - + next_leafs = set(w.id for w in works) + for work in works: + if not work.parent: + continue + if work.parent.id in next_leafs and work.parent in works: + next_leafs.remove(work.parent.id) + leafs = next_leafs return res def get_currency_digits(self, ids, name): From 9eb59365f778bfac351f2caf3b8297195bf5fdcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 19 Oct 2012 00:11:56 +0200 Subject: [PATCH 3/6] Fix compute_cost_price issue2720 review570002 (transplanted from aea0802162b1ce5311048a35017f0d0e3cf1fc77) --- service.py | 1 + 1 file changed, 1 insertion(+) diff --git a/service.py b/service.py index 2d698c9fd3..2611de1959 100644 --- a/service.py +++ b/service.py @@ -58,6 +58,7 @@ class Employee(ModelSQL, ModelView, Cacheable): for edate, ecost in employee_costs: if date >= edate: cost = ecost + else: break return cost From b311af660ecd7956f64e1d298e4fa6ba76c0b23b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 5 Nov 2012 18:03:41 +0100 Subject: [PATCH 4/6] Prepare release 2.4.1 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 1dcc670f1c..e83828bfa8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +Version 2.4.1 - 2012-11-05 +* Bug fixes (see mercurial logs for details) + Version 2.4.0 - 2012-04-24 * Bug fixes (see mercurial logs for details) From 653e45a3d0b15ef6bdcc2d941089a39f47784f05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 5 Nov 2012 18:03:42 +0100 Subject: [PATCH 5/6] Added tag 2.4.1 for changeset d1a0973a08fb --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 383ecc7a5e..7690cd920b 100644 --- a/.hgtags +++ b/.hgtags @@ -4,3 +4,4 @@ f523c8e44b80900659959a1e5c6468cd237b266b 1.8.0 940dd31347eb51632ea3de312a591311cb2f7707 2.0.0 5deaba26e5eb26930d82c46f199d298bd0703c08 2.2.0 0c0e7bb05215ca381a09d2fe696fdc829e7e738b 2.4.0 +d1a0973a08fb2cbe19669449c528660de9196eff 2.4.1 From c82c4b1b5e173161da31c66b25bd5c07f1ff23e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 5 Nov 2012 18:03:53 +0100 Subject: [PATCH 6/6] Increase version number --- __tryton__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tryton__.py b/__tryton__.py index 5996795aca..a27a890b9a 100644 --- a/__tryton__.py +++ b/__tryton__.py @@ -9,7 +9,7 @@ 'name_es_CO': 'Ingresos por proyectos', 'name_es_ES': 'Ingresos por proyecto', 'name_fr_FR': 'Revenu des projets', - 'version': '2.4.1', + 'version': '2.4.2', 'author': 'B2CK', 'email': 'info@b2ck.com', 'website': 'http://www.tryton.org/',