Merge lp:~vauxoo/addons-vauxoo/validate_type_line_invoice_dev_luis into lp:addons-vauxoo
Proposed by
Luis Torres - http://www.vauxoo.com
Status: | Merged |
---|---|
Merged at revision: | 485 |
Proposed branch: | lp:~vauxoo/addons-vauxoo/validate_type_line_invoice_dev_luis |
Merge into: | lp:addons-vauxoo |
Diff against target: |
136 lines (+121/-0) 3 files modified
validate_type_line_invoice/__init__.py (+26/-0) validate_type_line_invoice/__openerp__.py (+46/-0) validate_type_line_invoice/account_invoice.py (+49/-0) |
To merge this branch: | bzr merge lp:~vauxoo/addons-vauxoo/validate_type_line_invoice_dev_luis |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Luis Torres - http://www.vauxoo.com | Needs Resubmitting | ||
Rodolfo Lopez (community) | Needs Fixing | ||
Moisés López - http://www.vauxoo.com | Pending | ||
Isaac López Zúñiga | Pending | ||
Review via email: mp+124524@code.launchpad.net |
Description of the change
Se agrego una validacion para que al momento de validar la factura revise que el tipo de cuenta de las lineas sea diferente a 'payable' o receivable'
To post a comment you must log in.
Luis,
Tienes que regresar lo mismo que regresaría la original.
Y si llegara a entrar al raise te darás cuenta, que ya no frena todo lo que estaba haciendo la función, y hace rollback de lo demás.
Mira, aquí te mando un cambio de lógica de esto que te comento.
119 + def action_ move_create( self, cr, uid, ids, context=None): line_obj= self.pool. get('account. invoice. line') obj=self. pool.get( 'account. account' ) line_obj. search( cr,uid, [('invoice_ id','=' ,ids)]) invoice_ line_obj. browse( cr,uid, line).account_ id.id account_ obj.browse( cr,uid, id_account) .type osv(_(' Error') , _("Type of account in line's most be differt to invoice, self).action_ move_create( cr, uid, ids)
120 + invoice_
121 + account_
122 + lines = invoice_
123 + ban=0
124 + for line in lines:
125 + id_account=
126 + type_line=
127 + if type_line == 'receivable' or type_line == 'payable':
132 + raise osv.except_
133 + return super(account_