Merge lp:~jfb-tempo-consulting/unifield-server/US-4204 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 4879
Proposed branch: lp:~jfb-tempo-consulting/unifield-server/US-4204
Merge into: lp:unifield-server
Diff against target: 27 lines (+3/-2)
1 file modified
bin/addons/consumption_calculation/consumption_calculation.py (+3/-2)
To merge this branch: bzr merge lp:~jfb-tempo-consulting/unifield-server/US-4204
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+343393@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/consumption_calculation/consumption_calculation.py'
2--- bin/addons/consumption_calculation/consumption_calculation.py 2018-04-03 10:18:51 +0000
3+++ bin/addons/consumption_calculation/consumption_calculation.py 2018-04-17 09:11:58 +0000
4@@ -1737,12 +1737,13 @@
5 if from_date and to_date:
6 rac_ids = self.pool.get('real.average.consumption').search(cr, uid, [
7 ('cons_location_id', 'in', location_ids),
8+ ('state', '!=', 'cancel'),
9 # All lines with a report started out the period and finished in the period
10 '|', '&', ('period_to', '>=', from_date), ('period_to', '<=', to_date),
11 #  All lines with a report started in the period and finished out the period
12 '|', '&', ('period_from', '<=', to_date), ('period_from', '>=', from_date),
13 #  All lines with a report started before the period and finished after the period
14- '&', ('period_from', '<=', from_date), ('period_to', '>=', to_date)
15+ '&', ('period_from', '<=', from_date), ('period_to', '>=', to_date),
16 ])
17 rcr_domain = [('product_id', '=', id), ('rac_id', 'in', rac_ids)]
18
19@@ -1837,7 +1838,7 @@
20 # Search all real consumption line included in the period
21 # If no period found, take all stock moves
22 if from_date and to_date:
23- rcr_domain = ['&', ('product_id', 'in', ids),
24+ rcr_domain = ['&', '&', ('rac_id.state', '!=', 'cancel'), ('product_id', 'in', ids),
25 # All lines with a report started out the period and finished in the period
26 '|', '&', ('rac_id.period_to', '>=', from_date), ('rac_id.period_to', '<=', to_date),
27 # All lines with a report started in the period and finished out the period

Subscribers

People subscribed via source and target branches