~vauxoo/openerp-venezuela-localization/ovl70-fr-rev-yani

« back to all changes in this revision

Viewing changes to l10n_ve_fiscal_requirements/wizard/wizard_nro_ctrl.py

  • Committer: Humberto Arocha
  • Date: 2012-12-02 18:44:03 UTC
  • Revision ID: humbertoarocha@gmail.com-20121202184403-1a75bn1xij6o0xjy
[FIX] Warning Removed:
A warning about the state of the document in a wizard where
the document's state is not modified is unneeded

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    _description = "Wizard that changes the invoice control number"
33
33
 
34
34
    def set_noctrl(self, cr, uid, ids, context=None):
35
 
        if context==None:
 
35
        if context is None:
36
36
            context={}
37
37
        data = self.pool.get('wiz.nroctrl').read(cr, uid, ids)[0]
38
38
        if not data['sure']:
41
41
        n_ctrl = data['name']
42
42
        
43
43
        invoice = inv_obj.browse(cr, uid, context['active_id'])
44
 
        if invoice.state == 'draft':
45
 
            raise osv.except_osv(_("Error!"), _("You cannot change the state of a Draft invoice"))
46
44
 
47
45
        inv_obj.write(cr, uid, context.get('active_id'), {'nro_ctrl': n_ctrl}, context=context)
48
46
        return {}