rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
print 'validando padre NC compra: ',scl_obj.parent_id | def validate_nc_compra(self,cr,uid, ids,scl_obj,q_mov,tot,prom,q_des,no_cp,lst_org,act_sml_id,s_ord): if not no_cp and q_des >= q_mov: if scl_obj.parent_id: print 'validando padre NC compra: ',scl_obj.parent_id if scl_obj.parent_id.id in lst_org or scl_obj.parent_id.id in no_cp: no_cp.append(act_sml_id) else: print 'pr... | |
print 'procesoooo NC COMPRA padre procesado:' | def validate_nc_compra(self,cr,uid, ids,scl_obj,q_mov,tot,prom,q_des,no_cp,lst_org,act_sml_id,s_ord): if not no_cp and q_des >= q_mov: if scl_obj.parent_id: print 'validando padre NC compra: ',scl_obj.parent_id if scl_obj.parent_id.id in lst_org or scl_obj.parent_id.id in no_cp: no_cp.append(act_sml_id) else: print 'pr... | |
print 'procesoooo NC COMPRA:' | def validate_nc_compra(self,cr,uid, ids,scl_obj,q_mov,tot,prom,q_des,no_cp,lst_org,act_sml_id,s_ord): if not no_cp and q_des >= q_mov: if scl_obj.parent_id: print 'validando padre NC compra: ',scl_obj.parent_id if scl_obj.parent_id.id in lst_org or scl_obj.parent_id.id in no_cp: no_cp.append(act_sml_id) else: print 'pr... | |
print 'no procesoooo NC COMPRA:' | def validate_nc_compra(self,cr,uid, ids,scl_obj,q_mov,tot,prom,q_des,no_cp,lst_org,act_sml_id,s_ord): if not no_cp and q_des >= q_mov: if scl_obj.parent_id: print 'validando padre NC compra: ',scl_obj.parent_id if scl_obj.parent_id.id in lst_org or scl_obj.parent_id.id in no_cp: no_cp.append(act_sml_id) else: print 'pr... | |
print 'vals: ',vals print 'sc_line_obj.read ANTES', sc_line_obj.read(cr, uid, scl_id) | def write_data(self, cr, uid, ids, scl_id, vals, seq): sc_line_obj = self.pool.get('stock.card.line') seq += 1 vals.update({'sequence':seq}) print 'vals: ',vals print 'sc_line_obj.read ANTES', sc_line_obj.read(cr, uid, scl_id) sc_line_obj.write(cr, uid, scl_id, vals) print 'sc_line_obj.read DESPUES', sc_line_obj.read(c... | |
print 'sc_line_obj.read DESPUES', sc_line_obj.read(cr, uid, scl_id) | def write_data(self, cr, uid, ids, scl_id, vals, seq): sc_line_obj = self.pool.get('stock.card.line') seq += 1 vals.update({'sequence':seq}) print 'vals: ',vals print 'sc_line_obj.read ANTES', sc_line_obj.read(cr, uid, scl_id) sc_line_obj.write(cr, uid, scl_id, vals) print 'sc_line_obj.read DESPUES', sc_line_obj.read(c... | |
print 'OTROS 5 SEG. MAS' time.sleep(5) | def action_get_ready(self, cr, uid, ids, context={}): product_ids = self.action_unico(cr, uid, ids) aml_obj = self.pool.get('account.move.line') scpm_cost_obj = self.pool.get('stock.card.product.move.cost') scpm_inv_obj = self.pool.get('stock.card.product.move.inv') scal_obj = self.pool.get('stock.card.account.lines') ... | |
if pending: print '@'*10 print 'procesando: ',self.pool.get('product.product').browse(cr,uid,prod_id).name | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'encontre costo inicccc' | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'cantidad inicialxxxxx: ',q avg = rpp.invoice_price_unit | avg = rpp.invoice_line_id.price_subtotal / q | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... |
print 'cantidad inicial: ',q print 'costo inicial: ',avg | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'q inicial: ',q print 'avg: ',avg print 'qda inicial: ',qda print 'seq inicial: ',seq | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'viene operac: ',sml_id print 'packing: ',rpp.picking_id.name print 'seq antes operac: ',seq | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'validando VENTA:' | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'seq despues operac: ',seq | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'validando NC compra:' | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'procesooo compra:' | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'agregando nuevamente las vta:' | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'no cumplioooo: ',no_cump | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'nueva listaaa: ',sml_x_pd_id | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'validando NC VENTA:' | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'agregando nuevamente los movimientos:' | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'validando USO INTERNO:' | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'validando PROCESAMIENTO:' | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'nomb ubic: ',move.location_dest_id.name | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
if pending: print 'EN RECURRENTE SLC.ID %s Y SML_ID %s'%(scl.id,sml_id) | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'validando PRODUCTO MANUFACTURADO:' | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'identificador de scl: ', i.id | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'id de sml: ',i_id print 'producto destino: ',rpp.product_id.name print 'producto origen: ',i.product_id.name print 'lista se sml: ',Dict[i.product_id.id]['sml'] | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print ' | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print '%'*9 | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'sc_line_obj.read(cr,uid,i.id): ',sc_line_obj.browse(cr,uid,i.id).subtotal print 'subtotal: ',subtotal print 'i.subtotal: ',i.subtotal | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print '&'*25 | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'value ANTES DE self.write_data: ',value | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'nomb ubic: ',move.location_dest_id.name print 'scl.aml_cost_price_unit: ',scl.aml_cost_price_unit | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'compr. contable: ',self.pool.get('account.move').read(cr,uid,acc_mov_id) | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'cont: ',acc_mov_obj.ref | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'asietttt: ',aml.ref print 'credit: ',aml.credit print 'debit: ',aml.debit | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'asientoooo: ',valores | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
if not kkk['aml_cost_id'] or not kkk['aml_inv_id']: print 'objeto: ',sc_line_obj.read(cr, uid, scl.id) | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'procesando vtas y la NC COMPRAS faltantes:' | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print 'saliendo de procesar:',rpp.product_id.name | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... | |
print '_get_scl_out:',ids | def _get_scl_out(self, cr, uid, ids, field_name, arg, context={}): result = {} print '_get_scl_out:',ids for scl in self.browse(cr, uid, ids, context): result[scl.id] = False if scl.stk_mov_id.sml_out_id: scl_out_ids = self.search(cr, uid, [('stk_mov_id.id','=',scl.stk_mov_id.sml_out_id.id)]) if scl_out_ids: scl_obj = ... | |
print '_get_scl_from_sm:',ids | def _get_scl_from_sm(self, cr, uid, ids, context={}): print '_get_scl_from_sm:',ids scl_ids = [] scl_ids = self.pool.get('stock.card.line').search(cr, uid, [('stk_mov_id','in',ids)], context=context) return scl_ids | |
print '_get_scl_from_scl:',ids | def _get_scl_from_scl(self, cr, uid, ids, context={}): scl_ids = [] print '_get_scl_from_scl:',ids for scl in self.browse(cr, uid, ids, context): if scl.stk_mov_id.in_sml_ids: scl_ids = self._get_scl_from_sm(cr, uid, [x.id for x in scl.stk_mov_id.in_sml_ids], context) print 'scl_entradas:',ids return scl_ids | |
print 'scl_entradas:',ids | def _get_scl_from_scl(self, cr, uid, ids, context={}): scl_ids = [] print '_get_scl_from_scl:',ids for scl in self.browse(cr, uid, ids, context): if scl.stk_mov_id.in_sml_ids: scl_ids = self._get_scl_from_sm(cr, uid, [x.id for x in scl.stk_mov_id.in_sml_ids], context) print 'scl_entradas:',ids return scl_ids | |
ai."nro_ctrl" ASC | ar."number" ASC | def init(self, cr): ''' Create or replace view fiscal_reports_purchase ''' drop_view_if_exists(cr, 'fiscal_reports_purchase') cr.execute(""" create or replace view fiscal_reports_purchase as ( SELECT ai."date_invoice" AS ai_date_invoice, rp."vat" AS rp_vat, rp."id" AS rp_id, ai."nro_ctrl" AS ai_nro_ctrl, ai."reference"... |
'get_partner_addr': self._get_partner_addr | 'get_partner_addr': self._get_partner_addr, 'get_rif': self._get_rif | def __init__(self, cr, uid, name, context): super(rep_comprobante_islr, self).__init__(cr, uid, name, context) self.localcontext.update({ 'time': time, 'get_partner_addr': self._get_partner_addr }) |
ok = ok and bool(cr.fetchone()[0]) | ok = ok and bool(cr.fetchone()) | def test_retenida(self, cr, uid, ids, type, *args): res = self.move_journal_id_payment_get(cr, uid, ids) if not res: return False ok = True |
'amount_tax_ret': fields.function(_amount_all, method=True, digits=(16,4), string='Monto Retenido', multi='all', help="Total impuesto retenido de la factura"), 'base_ret': fields.function(_amount_all, method=True, digits=(16,4), string='Base Retenida', multi='all', help="Base retenida de la factura"), | 'amount_tax_ret': fields.function(_amount_all, method=True, digits=(16,2), string='Monto Retenido', multi='all', help="Total impuesto retenido de la factura"), 'base_ret': fields.function(_amount_all, method=True, digits=(16,2), string='Base Retenida', multi='all', help="Base retenida de la factura"), | def _retention_rate(self, cr, uid, ids, name, args, context=None): res = {} for ret_line in self.browse(cr, uid, ids, context=context): if ret_line.invoice_id: res[ret_line.id] = ret_line.invoice_id.p_ret else: res[ret_line.id] = 0.0 return res |
for line in ret.retention_line: journal_id = line.invoice_id.journal_id.id | for line in ret.retention_line: | def action_move_create(self, cr, uid, ids, *args): inv_obj = self.pool.get('account.invoice') context = {} |
avg = qda and total/qda or 0.0, | avg = qda and total/qda or 0.0 | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[p... |
ai."id" AS ai_id | ai."id" AS ai_id, ar_line."id" AS ar_line_id | def init(self, cr): cr.execute(""" create or replace view fiscal_reports_purchase as ( SELECT ai."date_invoice" AS ai_date_invoice, rp."vat" AS rp_vat, rp."id" AS rp_id, ai."nro_ctrl" AS ai_nro_ctrl, ai."reference" AS ai_reference, ai."amount_total" AS ai_amount_total, ai."amount_untaxed" AS ai_amount_untaxed, ai."amou... |
ai."id" AS ai_id | ai."id" AS ai_id, ar_line."id" AS ar_line_id | def init(self, cr): cr.execute(""" create or replace view fiscal_reports_sale as ( SELECT ai."date_invoice" AS ai_date_invoice, rp."vat" AS rp_vat, rp."id" AS rp_id, ai."number" AS ai_number, ai."nro_ctrl" AS ai_nro_ctrl, ai."amount_total" AS ai_amount_total, ai."amount_untaxed" AS ai_amount_untaxed, ai."amount_tax" AS... |
number = self.pool.get('ir.sequence').get(cr, uid, 'account.retencion_islr.%s' % obj_ret.type) | number = self.pool.get('ir.sequence').get(cr, uid, 'account.ret_islr.%s' % obj_ret.type) | def action_number(self, cr, uid, ids, *args): obj_ret = self.browse(cr, uid, ids)[0] if obj_ret.type == 'in_invoice': cr.execute('SELECT id, number ' \ 'FROM account_retencion_islr ' \ 'WHERE id IN ('+','.join(map(str,ids))+')') |
ai."amount_total" AS ai_amount_total, ai."amount_untaxed" AS ai_amount_untaxed, ai."amount_tax" AS ai_amount_tax, | case when ai.type='in_refund' then ai."amount_total"*(-1) else ai."amount_total" end as ai_amount_total, case when ai.type='in_refund' then ai."amount_tax"*(-1) else ai."amount_tax" end as ai_amount_tax, case when ai.type='in_refund' then ai."amount_untaxed"*(-1) else ai."amount_untaxed" end as ai_amount_untaxed, | def init(self, cr): ''' Create or replace view fiscal_reports_whp ''' drop_view_if_exists(cr, 'fiscal_reports_whp') cr.execute(""" create or replace view fiscal_reports_whp as ( SELECT ar."date_ret" AS ar_date_ret, rp."vat" AS rp_vat, ar."number" AS ar_number, ai."reference" AS ai_reference, ai."amount_total" AS ai_amo... |
return str(tax.amount*100) | return str(tax.amount*100).replace('.',',') | def _get_alicuota(self, tnom=None): if not tnom: return [] |
val['base_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['base'] * tax['base_sign'], context={'date': inv.date_invoice or time.strftime('%Y-%m-%d')}) val['tax_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['amount'] * tax['tax_sign'], context={'date': inv.da... | val['base_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['base'] * tax['base_sign'], context={'date': inv.date_invoice or time.strftime('%Y-%m-%d')}, round=False) val['tax_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['amount'] * tax['tax_sign'], context={'... | def compute(self, cr, uid, invoice_id, context={}): tax_grouped = {} tax_obj = self.pool.get('account.tax') cur_obj = self.pool.get('res.currency') inv = self.pool.get('account.invoice').browse(cr, uid, invoice_id, context) cur = inv.currency_id company_currency = inv.company_id.currency_id.id |
val['base_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['base'] * tax['ref_base_sign'], context={'date': inv.date_invoice or time.strftime('%Y-%m-%d')}) val['tax_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['amount'] * tax['ref_tax_sign'], context={'date'... | val['base_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['base'] * tax['ref_base_sign'], context={'date': inv.date_invoice or time.strftime('%Y-%m-%d')}, round=False) val['tax_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['amount'] * tax['ref_tax_sign'], co... | def compute(self, cr, uid, invoice_id, context={}): tax_grouped = {} tax_obj = self.pool.get('account.tax') cur_obj = self.pool.get('res.currency') inv = self.pool.get('account.invoice').browse(cr, uid, invoice_id, context) cur = inv.currency_id company_currency = inv.company_id.currency_id.id |
class product_uom_consol(): | class product_uom_consol(osv.osv): | # def _factor(self, cursor, user, ids, name, arg, context): |
_description = 'Object to control a third unit to consolidate the sales and purchase.' | _description = 'A third unit to consolidate the sales and purchase.' | # def _factor(self, cursor, user, ids, name, arg, context): |
super(rep_comprobante_islr, self).__init__(cr, uid, name, context) | super(rep_comprobante_munici, self).__init__(cr, uid, name, context) | def __init__(self, cr, uid, name, context): super(rep_comprobante_islr, self).__init__(cr, uid, name, context) self.localcontext.update({ 'time': time, 'get_partner_addr': self._get_partner_addr, 'get_rif': self._get_rif }) |
'report.comprobante.retencion.islr', 'account.retencion.islr', 'addons/retencion_islr/report/comprobante_islr.rml', parser=rep_comprobante_islr, | 'report.comprobante.retencion.munici', 'account.retencion.munici', 'addons/retencion_munici/report/comprobante_munici.rml', parser=rep_comprobante_munici, | def _get_rif(self, vat=''): if not vat: return [] return vat[2:].replace(' ', '') |
if invoice_id and record[0]==invoice_id: | if invoice_id and record and record[0]==invoice_id: | def _product_get_invoice(self, cr, uid, ids, invoice_id=False, supplier_id=False, date_ref=False, context={}, states=['open', 'paid'], what='in_invoice'): res = {} states_str = ','.join(map(lambda s: "'%s'" % s, states)) date = date_ref or time.strftime('%Y-%m-%d') for product in self.browse(cr, uid, ids): sql = "selec... |
self.assertRaises(Exception, test_view( 'purchase_invoice_line_standalone')) | test_view('purchase_invoice_line_standalone') | def test0005views(self): ''' Test views. ''' self.assertRaises(Exception, test_view( 'purchase_invoice_line_standalone')) |
resp = self._get_response(terms, count) | resp = self._get_response(terms, count + 1) | def search(self, terms, count): resp = self._get_response(terms, count) titles = self._scrape(resp) return titles |
if settings['key']: | if options.key: | def proxy_handler(client): global target_host, target_port, options, rec, fname if settings['record']: fname = "%s.%s" % (settings['record'], settings['handler_id']) handler_msg("opening record file: %s" % fname) rec = open(fname, 'w+') rec.write("var VNC_frame_data = [\n") handler_msg("connecting to: %s:%s" % (targe... |
global target_host, target_port, options, rec | global target_host, target_port, options, rec, fname | def proxy_handler(client): global target_host, target_port, options, rec if settings['record']: handler_msg("opening record file: %s" % settings['record']) rec = open("%s.%s" % (settings['record'], settings['handler_id']), 'w+') rec.write("var VNC_frame_data = [\n") handler_msg("connecting to: %s:%s" % (target_host, ... |
handler_msg("opening record file: %s" % settings['record']) rec = open("%s.%s" % (settings['record'], settings['handler_id']), 'w+') | fname = "%s.%s" % (settings['record'], settings['handler_id']) handler_msg("opening record file: %s" % fname) rec = open(fname, 'w+') | def proxy_handler(client): global target_host, target_port, options, rec if settings['record']: handler_msg("opening record file: %s" % settings['record']) rec = open("%s.%s" % (settings['record'], settings['handler_id']), 'w+') rec.write("var VNC_frame_data = [\n") handler_msg("connecting to: %s:%s" % (target_host, ... |
def handshake(client): | def do_handshake(client): | def handshake(client): handshake = client.recv(1024) print "Handshake [%s]" % handshake if handshake.startswith("<policy-file-request/>"): print "Sending:", policy_response client.send(policy_response) handshake = client.recv(1024) print "Handshake [%s]" % handshake req_lines = handshake.split("\r\n") _, path, _ = req_... |
print "Sending:", policy_response | print "Sending flash policy response" | def handshake(client): handshake = client.recv(1024) print "Handshake [%s]" % handshake if handshake.startswith("<policy-file-request/>"): print "Sending:", policy_response client.send(policy_response) handshake = client.recv(1024) print "Handshake [%s]" % handshake req_lines = handshake.split("\r\n") _, path, _ = req_... |
handshake = client.recv(1024) print "Handshake [%s]" % handshake | client.close() return False | def handshake(client): handshake = client.recv(1024) print "Handshake [%s]" % handshake if handshake.startswith("<policy-file-request/>"): print "Sending:", policy_response client.send(policy_response) handshake = client.recv(1024) print "Handshake [%s]" % handshake req_lines = handshake.split("\r\n") _, path, _ = req_... |
def responder(client, delay=500): | def responder(client, delay=10): | def responder(client, delay=500): global errors cqueue = [] cpartial = "" socks = [client] last_send = time.time() * 1000 while True: ins, outs, excepts = select(socks, socks, socks, 1) if excepts: raise Exception("Socket exception") if client in ins: buf = client.recv(buffer_size) if len(buf) == 0: raise Exception("... |
def start_server(listen_port, delay=500): | def start_server(listen_port, delay=10): | def start_server(listen_port, delay=500): global errors, send_cnt, recv_cnt lsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) lsock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) lsock.bind(('', listen_port)) lsock.listen(100) while True: try: csock = None print 'listening on port %s' % listen_port csock... |
handshake(csock) | if not do_handshake(csock): continue | def start_server(listen_port, delay=500): global errors, send_cnt, recv_cnt lsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) lsock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) lsock.bind(('', listen_port)) lsock.listen(100) while True: try: csock = None print 'listening on port %s' % listen_port csock... |
delay = 500 | delay = 10 | def start_server(listen_port, delay=500): global errors, send_cnt, recv_cnt lsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) lsock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) lsock.bind(('', listen_port)) lsock.listen(100) while True: try: csock = None print 'listening on port %s' % listen_port csock... |
print "handshake: " + repr(handshake) | def do_handshake(sock): global client_settings, send_seq client_settings['b64encode'] = False client_settings['seq_num'] = False send_seq = 0 # Peek, but don't read the data handshake = sock.recv(1024, socket.MSG_PEEK) #print "Handshake [%s]" % repr(handshake) if handshake.startswith("<policy-file-request/>"): handsh... | |
print "sending response:", repr(response) | def do_handshake(sock): global client_settings, send_seq client_settings['b64encode'] = False client_settings['seq_num'] = False send_seq = 0 # Peek, but don't read the data handshake = sock.recv(1024, socket.MSG_PEEK) #print "Handshake [%s]" % repr(handshake) if handshake.startswith("<policy-file-request/>"): handsh... | |
packed = struct.pack('>II8s', num1, num2, key3) digest = md5(packed).digest() print "num1:", num1 print "num2:", num2 print "key3:", repr(key3) print "packed:", packed print "digest:", repr(digest) return digest | return md5(struct.pack('>II8s', num1, num2, key3)).digest() | def gen_md5(keys): key1 = keys['Sec-WebSocket-Key1'] key2 = keys['Sec-WebSocket-Key2'] key3 = keys['key3'] spaces1 = key1.count(" ") spaces2 = key2.count(" ") num1 = int("".join([c for c in key1 if c.isdigit()])) / spaces1 num2 = int("".join([c for c in key2 if c.isdigit()])) / spaces2 packed = struct.pack('>II8s', nu... |
rec = open(settings['record'], 'w') | rec = open(settings['record'], 'a') | def proxy_handler(client): global target_host, target_port, options, rec if settings['record']: print "Opening record file: %s" % settings['record'] rec = open(settings['record'], 'w') print "Connecting to: %s:%s" % (target_host, target_port) tsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) tsock.connect((ta... |
settings['record'] = os.path.abspath(options.record) | if options.record: settings['record'] = os.path.abspath(options.record) | def proxy_handler(client): global target_host, target_port, options, rec if settings['record']: print "Opening record file: %s" % settings['record'] rec = open(settings['record'], 'w') print "Connecting to: %s:%s" % (target_host, target_port) tsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) tsock.connect((ta... |
rec = open(settings['record'], 'w+') | rec = open("%s.%s" % (settings['record'], settings['handler_id']), 'w+') | def proxy_handler(client): global target_host, target_port, options, rec if settings['record']: handler_msg("opening record file: %s" % settings['record']) rec = open(settings['record'], 'w+') rec.write("var VNC_frame_data = [\n") handler_msg("connecting to: %s:%s" % (target_host, target_port)) tsock = socket.socket(... |
help="record session to a file", metavar="FILE") | help="record sessions to FILE.[session_number]", metavar="FILE") | def proxy_handler(client): global target_host, target_port, options, rec if settings['record']: handler_msg("opening record file: %s" % settings['record']) rec = open(settings['record'], 'w+') rec.write("var VNC_frame_data = [\n") handler_msg("connecting to: %s:%s" % (target_host, target_port)) tsock = socket.socket(... |
var, delim, val = line.partition(": ") | var, val = line.split(": ") | def parse_handshake(handshake): ret = {} req_lines = handshake.split("\r\n") if not req_lines[0].startswith("GET "): raise Exception("Invalid handshake: no GET request line") ret['path'] = req_lines[0].split(" ")[1] for line in req_lines[1:]: if line == "": break var, delim, val = line.partition(": ") ret[var] = val i... |
cvars = h['path'].partition('?')[2].partition(' for cvar in [c for c in cvars if c]: name, _, val = cvar.partition('=') | cvars = parse_qsl(urlsplit(h['path'])[3], True) for name, val in cvars: | def do_handshake(sock): global client_settings client_settings['b64encode'] = False # Peek, but don't read the data handshake = sock.recv(1024, socket.MSG_PEEK) #print "Handshake [%s]" % repr(handshake) if handshake == "": print "Ignoring empty handshake" sock.close() return False elif handshake.startswith("<policy-f... |
socks = [client, target] | rlist = [client, target] | def do_proxy(client, target): """ Proxy WebSocket to normal socket. """ cqueue = [] cpartial = "" tqueue = [] socks = [client, target] while True: time.sleep(0.01) # 10ms ins, outs, excepts = select(socks, socks, socks, 1) if excepts: raise Exception("Socket exception") if tqueue and target in outs: dat = tqueue.pop... |
time.sleep(0.01) ins, outs, excepts = select(socks, socks, socks, 1) | wlist = [] if tqueue: wlist.append(target) if cqueue: wlist.append(client) ins, outs, excepts = select(rlist, wlist, [], 1) | def do_proxy(client, target): """ Proxy WebSocket to normal socket. """ cqueue = [] cpartial = "" tqueue = [] socks = [client, target] while True: time.sleep(0.01) # 10ms ins, outs, excepts = select(socks, socks, socks, 1) if excepts: raise Exception("Socket exception") if tqueue and target in outs: dat = tqueue.pop... |
if tqueue and target in outs: | if target in outs: | def do_proxy(client, target): """ Proxy WebSocket to normal socket. """ cqueue = [] cpartial = "" tqueue = [] socks = [client, target] while True: time.sleep(0.01) # 10ms ins, outs, excepts = select(socks, socks, socks, 1) if excepts: raise Exception("Socket exception") if tqueue and target in outs: dat = tqueue.pop... |
if cqueue and client in outs: | if client in outs: | def do_proxy(client, target): """ Proxy WebSocket to normal socket. """ cqueue = [] cpartial = "" tqueue = [] socks = [client, target] while True: time.sleep(0.01) # 10ms ins, outs, excepts = select(socks, socks, socks, 1) if excepts: raise Exception("Socket exception") if tqueue and target in outs: dat = tqueue.pop... |
func = choose_func() | (func, p0) = choose_func(params=True) | def fit_pot(p0, x, y, x_len, func): from scipy import optimize opt_p, cov_x, infodict, mesg, s = optimize.leastsq(pot_error, p0, args=(x, y, x_len, func), full_output=1, maxfev=0) print mesg return opt_p |
p0 = [2.4E-10, 2.4E-10, 1, 2, 1, 2, 3, 4, 1, 2] | def fit_pot(p0, x, y, x_len, func): from scipy import optimize opt_p, cov_x, infodict, mesg, s = optimize.leastsq(pot_error, p0, args=(x, y, x_len, func), full_output=1, maxfev=0) print mesg return opt_p | |
io_time = total_time - compute | def pretty_print(key,value): print "%30s: %12.4f" % ( key, value ) | |
print 'Expected %s, got %s' % (data,fdata) | print 'Expected %s, got %s' % (data[:100],fdata[:100]) | def checkData(path,data,phase,verbose): fdata = None f = openFile(path,'r') fdata = f.read() f.close() if (fdata == data): return else: print 'Data integrity error after %s' % phase if(len(fdata)!=len(data)): print "Length mismatch %d != %d" %(len(fdata),len(data)) print 'Expected %s, got %s' % (data,fdata) if (verbose... |
f = os.fdopen(fd,'w') | f = os.fdopen(fd,'w',0) | def writeFile(target,data,offset,mode): fd = os.open(target, mode) f = os.fdopen(fd,'w') f.seek(offset,0) print "Writing %d bytes to %s at off %d" % (len(data),target,offset) f.write(data) f.close() |
f = os.fdopen(fd,'w',0) | f = os.fdopen(fd,'w') | def writeFile(target,data,offset,mode): fd = os.open(target, mode) f = os.fdopen(fd,'w',0) f.seek(offset,0) print "Writing %d bytes to %s at off %d" % (len(data),target,offset) f.write(data) f.flush() os.fsync(fd) f.close() |
cookies = BaseCookie() | cookies = _ExtendedCookie() | def str_cookies(self): """ Return a *plain* dictionary of cookies as found in the request. """ env = self.environ source = env.get('HTTP_COOKIE', '') if 'webob._parsed_cookies' in env: vars, var_source = env['webob._parsed_cookies'] if var_source == source: return vars vars = {} if source: cookies = BaseCookie() cookie... |
max_age = cookie_prop('max-age', _serialize_max_age) | def _set_expires(self, v): self['expires'] = serialize_cookie_date(v) | |
suffixes = [] | def __str__(self): result = [] suffixes = [] RA = result.append RA("%s=%s" % (self.name, _quote(self.value))) for k in _cookie_valprops: v = self[k] if v: assert isinstance(v, str), v RA("%s=%s" % (_cookie_props[k], _quote(v))) if self.secure: RA('secure') if self.httponly: RA('HttpOnly') return '; '.join(result+suffix... | |
return '; '.join(result+suffixes) | return '; '.join(result) | def __str__(self): result = [] suffixes = [] RA = result.append RA("%s=%s" % (self.name, _quote(self.value))) for k in _cookie_valprops: v = self[k] if v: assert isinstance(v, str), v RA("%s=%s" % (_cookie_props[k], _quote(v))) if self.secure: RA('secure') if self.httponly: RA('HttpOnly') return '; '.join(result+suffix... |
if pattern is not None: if not re.match(pattern, path): return None if '/' not in path: self.script_name = sname + path self.path_info = '' return path else: segment, path = path.split('/', 1) self.path_info = '/' + path self.script_name = sname + segment return segment | idx = path.find('/') if idx == -1: idx = len(path) r = path[:idx] if pattern is None or re.match(pattern, r): self.script_name = sname + r self.path_info = path[idx:] return r | def path_info_pop(self, pattern=None): """ 'Pops' off the next segment of PATH_INFO, pushing it onto SCRIPT_NAME, and returning the popped segment. Returns None if there is nothing left on PATH_INFO. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.