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
=== modified file 'account/sequence.py'
--- account/sequence.py 2011-01-14 00:11:01 +0000
+++ account/sequence.py 2013-12-03 16:42:19 +0000
@@ -46,11 +46,11 @@
46 'fiscal_ids': fields.one2many('account.sequence.fiscalyear',46 'fiscal_ids': fields.one2many('account.sequence.fiscalyear',
47 'sequence_main_id', 'Sequences')47 'sequence_main_id', 'Sequences')
48 }48 }
49 def get_id(self, cr, uid, sequence_id, test='id', context=None):49 def get_id(self, cr, uid, sequence_id, code_or_id='id', context=None):
50 if context is None:50 if context is None:
51 context = {}51 context = {}
52 cr.execute('select id from ir_sequence where '52 cr.execute('select id from ir_sequence where '
53 + test + '=%s and active=%s', (sequence_id, True,))53 + code_or_id + '=%s and active=%s', (sequence_id, True,))
54 res = cr.dictfetchone()54 res = cr.dictfetchone()
55 if res:55 if res:
56 for line in self.browse(cr, uid, res['id'],56 for line in self.browse(cr, uid, res['id'],
@@ -58,11 +58,11 @@
58 if line.fiscalyear_id.id == context.get('fiscalyear_id', False):58 if line.fiscalyear_id.id == context.get('fiscalyear_id', False):
59 return super(ir_sequence, self).get_id(cr, uid,59 return super(ir_sequence, self).get_id(cr, uid,
60 line.sequence_id.id,60 line.sequence_id.id,
61 test="id",61 code_or_id="id",
62 context=context)62 context=context)
63 return super(ir_sequence, self).get_id(cr, uid, sequence_id, test,63 return super(ir_sequence, self).get_id(cr, uid, sequence_id, code_or_id,
64 context=context)64 context=context)
6565
66ir_sequence()66ir_sequence()
6767
68# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
69\ No newline at end of file68\ No newline at end of file
69# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
7070
=== modified file 'account/test/account_customer_invoice.yml'
--- account/test/account_customer_invoice.yml 2011-01-14 00:11:01 +0000
+++ account/test/account_customer_invoice.yml 2013-12-03 16:42:19 +0000
@@ -19,6 +19,15 @@
19 partner_id: base.res_partner_319 partner_id: base.res_partner_3
20 reference_type: none20 reference_type: none
21-21-
22 I overwrite periods with right number and open them (UF-2139 Unifield ticket)
23-
24 !python {model: account.period}: |
25 import datetime
26 period_ids = self.search(cr, uid, [], order='date_start, name')
27 for p in self.browse(cr, uid, period_ids):
28 self.write(cr, uid, [p.id], {'number': int(datetime.datetime.strptime(p.date_start, '%Y-%m-%d').strftime('%m'))})
29 self.action_set_state(cr, uid, period_ids, {'state': 'draft'})
30-
22 I check that Initially customer invoice is in the "Draft" state31 I check that Initially customer invoice is in the "Draft" state
23-32-
24 !assert {model: account.invoice, id: account_invoice_customer0}:33 !assert {model: account.invoice, id: account_invoice_customer0}:
2534
=== modified file 'account_payment/test/account_payment.yml'
--- account_payment/test/account_payment.yml 2011-01-14 00:11:01 +0000
+++ account_payment/test/account_payment.yml 2013-12-03 16:42:19 +0000
@@ -10,7 +10,15 @@
10 sequence: 0.010 sequence: 0.0
11 state: bank11 state: bank
12 bank: base.res_bank_112 bank: base.res_bank_1
1313-
14 I overwrite periods with right number and open them
15-
16 !python {model: account.period}: |
17 import datetime
18 period_ids = self.search(cr, uid, [], order='date_start, name')
19 for p in self.browse(cr, uid, period_ids):
20 self.write(cr, uid, [p.id], {'number': int(datetime.datetime.strptime(p.date_start, '%Y-%m-%d').strftime('%m'))})
21 self.action_set_state(cr, uid, period_ids, {'state': 'draft'})
14-22-
15 I created a new Payment Mode23 I created a new Payment Mode
16-24-
@@ -20,7 +28,6 @@
20 bank_id: res_partner_bank_028 bank_id: res_partner_bank_0
21 journal: account.bank_journal29 journal: account.bank_journal
22 name: TestMode30 name: TestMode
23
24-31-
25 I created a Supplier Invoice32 I created a Supplier Invoice
26-33-
2734
=== modified file 'account_voucher/test/account_voucher.yml'
--- account_voucher/test/account_voucher.yml 2011-08-31 13:34:01 +0000
+++ account_voucher/test/account_voucher.yml 2013-12-03 16:42:19 +0000
@@ -9,6 +9,15 @@
9 name: Current Period9 name: Current Period
10 special: 110 special: 1
11-11-
12 I overwrite periods with right number and open them (UF-2139 Unifield ticket)
13-
14 !python {model: account.period}: |
15 import datetime
16 period_ids = self.search(cr, uid, [], order='date_start, name')
17 for p in self.browse(cr, uid, period_ids):
18 self.write(cr, uid, [p.id], {'number': int(datetime.datetime.strptime(p.date_start, '%Y-%m-%d').strftime('%m'))})
19 self.action_set_state(cr, uid, period_ids, {'state': 'draft'})
20-
12 In order to check account voucher module in OpenERP I create a customer voucher21 In order to check account voucher module in OpenERP I create a customer voucher
13-22-
14 !record {model: account.voucher, id: account_voucher_voucherforaxelor0}:23 !record {model: account.voucher, id: account_voucher_voucherforaxelor0}:
1524
=== modified file 'purchase/test/purchase_from_order.yml'
--- purchase/test/purchase_from_order.yml 2011-08-18 08:36:51 +0000
+++ purchase/test/purchase_from_order.yml 2013-12-03 16:42:19 +0000
@@ -43,6 +43,15 @@
43 partner_id: base.res_partner_443 partner_id: base.res_partner_4
44 pricelist_id: purchase.list044 pricelist_id: purchase.list0
45-45-
46 I overwrite periods with right number and open them
47-
48 !python {model: account.period}: |
49 import datetime
50 period_ids = self.search(cr, uid, [], order='date_start, name')
51 for p in self.browse(cr, uid, period_ids):
52 self.write(cr, uid, [p.id], {'number': int(datetime.datetime.strptime(p.date_start, '%Y-%m-%d').strftime('%m'))})
53 self.action_set_state(cr, uid, period_ids, {'state': 'draft'})
54-
46 Initially purchase order is in the draft state.55 Initially purchase order is in the draft state.
47-56-
48 !assert {model: purchase.order, id: purchase_order_po0}:57 !assert {model: purchase.order, id: purchase_order_po0}:
4958
=== modified file 'sale/test/data_test.yml'
--- sale/test/data_test.yml 2011-01-14 00:11:01 +0000
+++ sale/test/data_test.yml 2013-12-03 16:42:19 +0000
@@ -286,3 +286,12 @@
286 type: product286 type: product
287 uom_id: product.product_uom_unit287 uom_id: product.product_uom_unit
288 uom_po_id: product.product_uom_unit288 uom_po_id: product.product_uom_unit
289-
290 I overwrite periods with right number and open them
291-
292 !python {model: account.period}: |
293 import datetime
294 period_ids = self.search(cr, uid, [], order='date_start, name')
295 for p in self.browse(cr, uid, period_ids):
296 self.write(cr, uid, [p.id], {'number': int(datetime.datetime.strptime(p.date_start, '%Y-%m-%d').strftime('%m'))})
297 self.action_set_state(cr, uid, period_ids, {'state': 'draft'})

Subscribers

People subscribed via source and target branches

to all changes: