Merge lp:~unifield-team/unifield-addons/UF_2139 into lp:unifield-addons

Proposed by jftempo
Status: Merged
Merged at revision: 4597
Proposed branch: lp:~unifield-team/unifield-addons/UF_2139
Merge into: lp:unifield-addons
Diff against target: 139 lines (+50/-7)
6 files modified
account/sequence.py (+5/-5)
account/test/account_customer_invoice.yml (+9/-0)
account_payment/test/account_payment.yml (+9/-2)
account_voucher/test/account_voucher.yml (+9/-0)
purchase/test/purchase_from_order.yml (+9/-0)
sale/test/data_test.yml (+9/-0)
To merge this branch: bzr merge lp:~unifield-team/unifield-addons/UF_2139
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+197566@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 'account/sequence.py'
2--- account/sequence.py 2011-01-14 00:11:01 +0000
3+++ account/sequence.py 2013-12-03 16:42:19 +0000
4@@ -46,11 +46,11 @@
5 'fiscal_ids': fields.one2many('account.sequence.fiscalyear',
6 'sequence_main_id', 'Sequences')
7 }
8- def get_id(self, cr, uid, sequence_id, test='id', context=None):
9+ def get_id(self, cr, uid, sequence_id, code_or_id='id', context=None):
10 if context is None:
11 context = {}
12 cr.execute('select id from ir_sequence where '
13- + test + '=%s and active=%s', (sequence_id, True,))
14+ + code_or_id + '=%s and active=%s', (sequence_id, True,))
15 res = cr.dictfetchone()
16 if res:
17 for line in self.browse(cr, uid, res['id'],
18@@ -58,11 +58,11 @@
19 if line.fiscalyear_id.id == context.get('fiscalyear_id', False):
20 return super(ir_sequence, self).get_id(cr, uid,
21 line.sequence_id.id,
22- test="id",
23+ code_or_id="id",
24 context=context)
25- return super(ir_sequence, self).get_id(cr, uid, sequence_id, test,
26+ return super(ir_sequence, self).get_id(cr, uid, sequence_id, code_or_id,
27 context=context)
28
29 ir_sequence()
30
31-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
32\ No newline at end of file
33+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
34
35=== modified file 'account/test/account_customer_invoice.yml'
36--- account/test/account_customer_invoice.yml 2011-01-14 00:11:01 +0000
37+++ account/test/account_customer_invoice.yml 2013-12-03 16:42:19 +0000
38@@ -19,6 +19,15 @@
39 partner_id: base.res_partner_3
40 reference_type: none
41 -
42+ I overwrite periods with right number and open them (UF-2139 Unifield ticket)
43+-
44+ !python {model: account.period}: |
45+ import datetime
46+ period_ids = self.search(cr, uid, [], order='date_start, name')
47+ for p in self.browse(cr, uid, period_ids):
48+ self.write(cr, uid, [p.id], {'number': int(datetime.datetime.strptime(p.date_start, '%Y-%m-%d').strftime('%m'))})
49+ self.action_set_state(cr, uid, period_ids, {'state': 'draft'})
50+-
51 I check that Initially customer invoice is in the "Draft" state
52 -
53 !assert {model: account.invoice, id: account_invoice_customer0}:
54
55=== modified file 'account_payment/test/account_payment.yml'
56--- account_payment/test/account_payment.yml 2011-01-14 00:11:01 +0000
57+++ account_payment/test/account_payment.yml 2013-12-03 16:42:19 +0000
58@@ -10,7 +10,15 @@
59 sequence: 0.0
60 state: bank
61 bank: base.res_bank_1
62-
63+-
64+ I overwrite periods with right number and open them
65+-
66+ !python {model: account.period}: |
67+ import datetime
68+ period_ids = self.search(cr, uid, [], order='date_start, name')
69+ for p in self.browse(cr, uid, period_ids):
70+ self.write(cr, uid, [p.id], {'number': int(datetime.datetime.strptime(p.date_start, '%Y-%m-%d').strftime('%m'))})
71+ self.action_set_state(cr, uid, period_ids, {'state': 'draft'})
72 -
73 I created a new Payment Mode
74 -
75@@ -20,7 +28,6 @@
76 bank_id: res_partner_bank_0
77 journal: account.bank_journal
78 name: TestMode
79-
80 -
81 I created a Supplier Invoice
82 -
83
84=== modified file 'account_voucher/test/account_voucher.yml'
85--- account_voucher/test/account_voucher.yml 2011-08-31 13:34:01 +0000
86+++ account_voucher/test/account_voucher.yml 2013-12-03 16:42:19 +0000
87@@ -9,6 +9,15 @@
88 name: Current Period
89 special: 1
90 -
91+ I overwrite periods with right number and open them (UF-2139 Unifield ticket)
92+-
93+ !python {model: account.period}: |
94+ import datetime
95+ period_ids = self.search(cr, uid, [], order='date_start, name')
96+ for p in self.browse(cr, uid, period_ids):
97+ self.write(cr, uid, [p.id], {'number': int(datetime.datetime.strptime(p.date_start, '%Y-%m-%d').strftime('%m'))})
98+ self.action_set_state(cr, uid, period_ids, {'state': 'draft'})
99+-
100 In order to check account voucher module in OpenERP I create a customer voucher
101 -
102 !record {model: account.voucher, id: account_voucher_voucherforaxelor0}:
103
104=== modified file 'purchase/test/purchase_from_order.yml'
105--- purchase/test/purchase_from_order.yml 2011-08-18 08:36:51 +0000
106+++ purchase/test/purchase_from_order.yml 2013-12-03 16:42:19 +0000
107@@ -43,6 +43,15 @@
108 partner_id: base.res_partner_4
109 pricelist_id: purchase.list0
110 -
111+ I overwrite periods with right number and open them
112+-
113+ !python {model: account.period}: |
114+ import datetime
115+ period_ids = self.search(cr, uid, [], order='date_start, name')
116+ for p in self.browse(cr, uid, period_ids):
117+ self.write(cr, uid, [p.id], {'number': int(datetime.datetime.strptime(p.date_start, '%Y-%m-%d').strftime('%m'))})
118+ self.action_set_state(cr, uid, period_ids, {'state': 'draft'})
119+-
120 Initially purchase order is in the draft state.
121 -
122 !assert {model: purchase.order, id: purchase_order_po0}:
123
124=== modified file 'sale/test/data_test.yml'
125--- sale/test/data_test.yml 2011-01-14 00:11:01 +0000
126+++ sale/test/data_test.yml 2013-12-03 16:42:19 +0000
127@@ -286,3 +286,12 @@
128 type: product
129 uom_id: product.product_uom_unit
130 uom_po_id: product.product_uom_unit
131+-
132+ I overwrite periods with right number and open them
133+-
134+ !python {model: account.period}: |
135+ import datetime
136+ period_ids = self.search(cr, uid, [], order='date_start, name')
137+ for p in self.browse(cr, uid, period_ids):
138+ self.write(cr, uid, [p.id], {'number': int(datetime.datetime.strptime(p.date_start, '%Y-%m-%d').strftime('%m'))})
139+ self.action_set_state(cr, uid, period_ids, {'state': 'draft'})

Subscribers

People subscribed via source and target branches

to all changes: