Merge lp:~mukunde/unifield-server/US-11212 into lp:unifield-server

Proposed by jftempo
Status: Needs review
Proposed branch: lp:~mukunde/unifield-server/US-11212
Merge into: lp:unifield-server
Diff against target: 43 lines (+12/-10)
1 file modified
bin/addons/account/wizard/account_chart.py (+12/-10)
To merge this branch: bzr merge lp:~mukunde/unifield-server/US-11212
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+438774@code.launchpad.net
To post a comment you must log in.
lp:~mukunde/unifield-server/US-11212 updated
6417. By Gaël Mukunde

US-11212 [FIX] Code enhancement to take into account the possibility of order change of the queries union results.

Unmerged revisions

6417. By Gaël Mukunde

US-11212 [FIX] Code enhancement to take into account the possibility of order change of the queries union results.

6416. By Gaël Mukunde

US-11212 [FIX] Fix the period field selection

6415. By jftempo

US-11195 [IMP] OCA patch script: NR on periods Jul and Jun 2022

lp:~jfb-tempo-consulting/unifield-server/US-11195

6414. By jftempo

US-7603 [IMP] KIT name on screen and pdf

lp:~dorian-kemps/unifield-server/US-7603-2

6413. By jftempo

US-7598 [FIX] KCL: Fixed context cleaning when recursive closing is applied

lp:~dorian-kemps/unifield-server/US-7598-2

6412. By jftempo

Release UF28.0rc2

6411. By jftempo

US-11143 [FIX] Line added to FO must go to orignal FO

lp:~jfb-tempo-consulting/unifield-server/US-11143

6410. By jftempo

US-11139 FIX] PICK/OUT conversion: Remove KCL Refs when converting to OUT, remove KCL Refs from OUT processors and changing context when converting to Pick. Fixed unrelated translations

lp:~dorian-kemps/unifield-server/US-11139

6409. By jftempo

Release UF28.0rc1

6408. By jftempo

[FIX] Remove BAR on sale.order.line

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/account/wizard/account_chart.py'
2--- bin/addons/account/wizard/account_chart.py 2017-01-13 15:57:06 +0000
3+++ bin/addons/account/wizard/account_chart.py 2023-03-14 10:07:51 +0000
4@@ -42,27 +42,29 @@
5 def onchange_fiscalyear(self, cr, uid, ids, fiscalyear_id=False, context=None):
6 res = {}
7 res['value'] = {}
8+ periods = {}
9 if fiscalyear_id:
10 start_period = end_period = False
11- cr.execute('''
12- SELECT * FROM (SELECT p.id
13+ cr.execute('''SELECT p.id AS start_id
14 FROM account_period p
15 LEFT JOIN account_fiscalyear f ON (p.fiscalyear_id = f.id)
16 WHERE f.id = %s and number != 0
17 ORDER BY p.date_start ASC
18- LIMIT 1) AS period_start
19- UNION
20- SELECT * FROM (SELECT p.id
21+ LIMIT 1''', (fiscalyear_id,))
22+ periods['period_from'] = [i[0] for i in cr.fetchall()] or False
23+
24+ cr.execute('''SELECT p.id AS stop_id
25 FROM account_period p
26 LEFT JOIN account_fiscalyear f ON (p.fiscalyear_id = f.id)
27 WHERE f.id = %s and number != 0
28 AND p.date_start < NOW()
29 ORDER BY p.date_stop DESC
30- LIMIT 1) AS period_stop''', (fiscalyear_id, fiscalyear_id))
31- periods = [i[0] for i in cr.fetchall()]
32- if periods and len(periods) > 1:
33- start_period = periods[0]
34- end_period = periods[1]
35+ LIMIT 1''', (fiscalyear_id,))
36+ periods['period_to'] = [i[0] for i in cr.fetchall()] or False
37+
38+ if periods and periods['period_from'] and periods['period_to']:
39+ start_period = periods['period_from'][0]
40+ end_period = periods['period_to'][0]
41 res['value'] = {'period_from': start_period, 'period_to': end_period}
42
43 # US-1179

Subscribers

People subscribed via source and target branches