~inddiana/sisb/sisb_merge_modificacion_hoja_carga_y_facturacion_flete

« back to all changes in this revision

Viewing changes to sisb_hoja_de_carga/model/sisb_hoja_de_carga.py

  • Committer: Aryrosa Fuentes
  • Date: 2014-01-03 12:25:39 UTC
  • Revision ID: afuentes@industriasdiana.gob.ve-20140103122539-t01pp0unxubxhskh

[MOD] Se excluye al administrador de la validacion en el registro de transporte en la hoja de carga.
Se amplia mensaje de validacion al crear factura cliente. Actualizada las traducciones.

Show diffs side-by-side

added added

removed removed

Lines of Context:
393
393
        return res
394
394
        
395
395
    def _check_permissions_default(self, cr, uid, context=None):
 
396
        if uid == 1:
 
397
            return True
 
398
            
396
399
        # Get the user and see what groups he/she is in Warehouse / Manager or Warehouse / User
397
400
        cr.execute("""select * from ir_model_data imd
398
401
            inner join res_groups rg on imd.res_id = rg.id
926
929
        
927
930
        if hc.hoja_carga_state in ('2binvoiced','invoiced'):
928
931
            invoice_custo = [pick for pick in hc.picking_ids if pick.sale_id]
 
932
            if not invoice_custo:
 
933
                raise osv.except_osv(_('Error'), _('No se pudo crear factura. No hay albaranes asociados a un pedido de venta.'))
929
934
            invoice_custo = [pick for pick in invoice_custo if pick.sale_id.freight_charge == 'si']
 
935
            if not invoice_custo:
 
936
                raise osv.except_osv(_('Error'), _('No se pudo crear factura. A los pedidos asociados no se le factura flete al cliente.'))
930
937
            journal_id = hc.shop_id.journal_id and hc.shop_id.journal_id.id or False
931
938
            payment_term_id = hc.shop_id.payment_default_id and hc.shop_id.payment_default_id.id or False
932
939