~vauxoo/openerp-venezuela-localization/ovl70-import-libs-kty

« back to all changes in this revision

Viewing changes to l10n_ve_withholding_iva/test/iva_sale_wh.yml

  • Committer: Humberto Arocha
  • Date: 2013-01-24 22:19:44 UTC
  • mfrom: (764.5.40 ovl70-whiva-rev-kty)
  • Revision ID: humbertoarocha@gmail.com-20130124221944-0j2046jr4g76wcn5
[MERGE] Second Revision to WH IVA - YAML TESTS

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
    company_id: base.main_company
8
8
    currency_id: base.EUR
9
9
    date_invoice: !eval time.strftime('%Y-%m-%d')
10
 
    address_contact_id: base.res_partner_address_3
11
 
    address_invoice_id: base.res_partner_address_3
12
10
    account_id: account.a_recv
13
11
    invoice_line:
14
 
      - product_id: product.product_product_pc3
 
12
      - product_id: product.product_product_3
15
13
        quantity: 3
16
14
        uos_id: product.product_uom_unit
17
15
        price_unit: 10
19
17
        account_id: account.a_sale
20
18
        invoice_line_tax_id:
21
19
        - iva_sale1
22
 
      - product_id: product.product_product_pc2
 
20
      - product_id: product.product_product_4
23
21
        quantity: 5
24
22
        uos_id: product.product_uom_unit
25
23
        price_unit: 20
28
26
        invoice_line_tax_id:
29
27
        - iva_sale1
30
28
    journal_id: account.sales_journal
31
 
    partner_id: base.res_partner_notsotinysarl0
 
29
    partner_id: base.res_partner_23
32
30
    reference_type: none
33
31
-
34
32
  7.2 I check that Initially customer invoice is in the "Draft" state
88
86
-
89
87
  !record {model: account.wh.iva, id: wh_iva_sale01}:
90
88
    journal_id: wh_sales_journal
91
 
    partner_id: base.res_partner_notsotinysarl0
 
89
    partner_id: base.res_partner_23
92
90
    number: 111222333
93
91
    account_id: account.a_recv
94
92
    name: 'IVA wh vat customer'
111
109
    ap_obj=self.pool.get('account.period')
112
110
    period = ap_obj.find(cr, uid, time.strftime('%Y/%m/%d'), context={'company_id':ref("base.main_company")})
113
111
    assert period, 'There aren\'t periods for this date'
114
 
    ap_brw = ap.browse(cr, uid, period[0])
 
112
    ap_brw = ap_obj.browse(cr, uid, period[0])
115
113
    if ap_brw.state == 'done':
116
114
        ap.action_draft(cr, uid, period)
117
115
        ap_brw = ap.browse(cr, uid, period[0])
128
126
-
129
127
  !python {model: account.wh.iva}: |
130
128
    wil_obj=self.pool.get('account.wh.iva.line')
131
 
    res = self.onchange_partner_id(cr, uid, [1], 'out_invoice', ref("base.res_partner_notsotinysarl0"))
 
129
    res = self.onchange_partner_id(cr, uid, [1], 'out_invoice', ref("base.res_partner_23"))
132
130
    ind_id = res['value']['wh_lines'][0]['invoice_id']
133
131
    res['value']['wh_lines'][0].update({'retention_id': ref("wh_iva_sale01")})
134
132
    wil_id = wil_obj.create(cr, uid, res['value']['wh_lines'][0])
135
133
    wil_obj.load_taxes(cr, uid, [wil_id])
136
 
-
137
 
  7.16 I try to confirm the withholding vat customer
138
 
-
139
 
  !workflow {model: account.wh.iva, action: wh_iva_confirmed, ref: wh_iva_sale01}
 
134
#~ -
 
135
  #~ 7.16 I try to confirm the withholding vat customer (This test raise an exception - is ok - but its commented to pursue next steps in the test)
 
136
#~ -
 
137
  #~ !workflow {model: account.wh.iva, action: wh_iva_confirmed, ref: wh_iva_sale01}
140
138
-
141
139
  7.17 I check withholding vat not is confirmed because invoice has not control number
142
140
-
176
174
-
177
175
  !workflow {model: account.wh.iva, action: wh_iva_done, ref: wh_iva_sale01}
178
176
-
179
 
  7.24 I check withholding vat is confirmed
 
177
  7.24 I check withholding vat is done
180
178
-
181
179
  !assert {model: account.wh.iva, id: wh_iva_sale01}:
182
180
    - state == 'done'