~openerp-chinese-team/openobject-addons/V6

« back to all changes in this revision

Viewing changes to event/wizard/make_invoice.py

  • Committer: qdp
  • Date: 2008-10-28 16:29:45 UTC
  • mto: (1776.1.1 addons)
  • mto: This revision was merged to the branch mainline in revision 1778.
  • Revision ID: qdp-launchpad@tinyerp.com-20081028162945-hk81vldgjt0y0cq3
*splitted event into 2 modules (added event_project) in order to remove the dependancy to project
*small bugfix

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
        obj_event_reg=pool_obj.get('event.registration')
64
64
        data_event_reg=obj_event_reg.browse(cr,uid,data['ids'])
65
65
        obj_lines=pool_obj.get('account.invoice.line')
 
66
        partner_address_id = reg.partner_invoice_id and reg.partner_invoice_id.
66
67
 
67
68
        for reg in data_event_reg:
68
69
            if reg.state=='draft':
71
72
               continue
72
73
            if (not reg.tobe_invoiced):
73
74
                inv_reject = inv_reject + 1
74
 
                inv_rej_reason += "ID "+str(reg.id)+": Registration Cannot Be Invoiced. \n"
 
75
                inv_rej_reason += "ID "+str(reg.id)+": Registration is set as 'Cannot be invoiced'. \n"
75
76
                continue
76
77
            if reg.invoice_id:
77
78
                inv_reject = inv_reject + 1
78
 
                inv_rej_reason += "ID "+str(reg.id)+": Registration Already Has an Invoice Linked. \n"
 
79
                inv_rej_reason += "ID "+str(reg.id)+": Registration already has an invoice linked. \n"
79
80
                continue
80
81
            if not reg.event_id.product_id:
81
82
                inv_reject = inv_reject + 1
82
 
                inv_rej_reason += "ID "+str(reg.id)+": Event Related Doesn't Have any Product. \n"
83
 
                continue
84
 
            if not reg.partner_address_id:
85
 
                inv_reject = inv_reject + 1
86
 
                inv_rej_reason += "ID "+str(reg.id)+": Registration Doesn't Have any Contact. \n"
 
83
                inv_rej_reason += "ID "+str(reg.id)+": Event related doesn't have any product defined. \n"
87
84
                continue
88
85
            if not reg.partner_invoice_id:
89
86
                inv_reject = inv_reject + 1
90
 
                inv_rej_reason += "ID "+str(reg.id)+": Registration Doesn't Have any Partner to Invoice. \n"
 
87
                inv_rej_reason += "ID "+str(reg.id)+": Registration doesn't have any partner to invoice. \n"
 
88
                continue
 
89
            if not partner_address_id:
 
90
                inv_reject = inv_reject + 1
 
91
                inv_rej_reason += "ID "+str(reg.id)+": Registered partner doesn't have an address to make the invoice. \n"
91
92
                continue
92
93
 
93
94
            inv_create = inv_create + 1