rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
new_obj = move_obj.copy(cr, uid, move.id, { | defaults = { | def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial picking and moves done. @param partial_datas : Dictionary containing details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom @return: Dictionary of values """ if context is None: context = {} else: context = dict(context) res = {} move_obj = self.pool.get('stock.move') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) for pick in self.browse(cr, uid, ids, context=context): new_picking = None new_moves = [] complete, too_many, too_few = [], [], [] move_product_qty = {} for move in pick.move_lines: if move.state in ('done', 'cancel'): continue partial_data = partial_datas.get('move%s'%(move.id), False) assert partial_data, _('Do not Found Partial data of Stock Move Line :%s' %(move.id)) product_qty = partial_data.get('product_qty',0.0) move_product_qty[move.id] = product_qty product_uom = partial_data.get('product_uom',False) product_price = partial_data.get('product_price',0.0) product_currency = partial_data.get('product_currency',False) prodlot_id = partial_data.get('prodlot_id',False) if move.product_qty == product_qty: complete.append(move) elif move.product_qty > product_qty: too_few.append(move) else: too_many.append(move) | 9f6c10ca2a1258aae7d418c26f5083177e38b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6c10ca2a1258aae7d418c26f5083177e38b1a6/stock.py |
}) | } prodlot_id = prodlot_ids[move.id] if prodlot_id: defaults.update(prodlot_id=prodlot_id) new_obj = move_obj.copy(cr, uid, move.id, defaults) | def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial picking and moves done. @param partial_datas : Dictionary containing details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom @return: Dictionary of values """ if context is None: context = {} else: context = dict(context) res = {} move_obj = self.pool.get('stock.move') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) for pick in self.browse(cr, uid, ids, context=context): new_picking = None new_moves = [] complete, too_many, too_few = [], [], [] move_product_qty = {} for move in pick.move_lines: if move.state in ('done', 'cancel'): continue partial_data = partial_datas.get('move%s'%(move.id), False) assert partial_data, _('Do not Found Partial data of Stock Move Line :%s' %(move.id)) product_qty = partial_data.get('product_qty',0.0) move_product_qty[move.id] = product_qty product_uom = partial_data.get('product_uom',False) product_price = partial_data.get('product_price',0.0) product_currency = partial_data.get('product_currency',False) prodlot_id = partial_data.get('prodlot_id',False) if move.product_qty == product_qty: complete.append(move) elif move.product_qty > product_qty: too_few.append(move) else: too_many.append(move) | 9f6c10ca2a1258aae7d418c26f5083177e38b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6c10ca2a1258aae7d418c26f5083177e38b1a6/stock.py |
def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial picking and moves done. @param partial_datas : Dictionary containing details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom @return: Dictionary of values """ if context is None: context = {} else: context = dict(context) res = {} move_obj = self.pool.get('stock.move') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) for pick in self.browse(cr, uid, ids, context=context): new_picking = None new_moves = [] complete, too_many, too_few = [], [], [] move_product_qty = {} for move in pick.move_lines: if move.state in ('done', 'cancel'): continue partial_data = partial_datas.get('move%s'%(move.id), False) assert partial_data, _('Do not Found Partial data of Stock Move Line :%s' %(move.id)) product_qty = partial_data.get('product_qty',0.0) move_product_qty[move.id] = product_qty product_uom = partial_data.get('product_uom',False) product_price = partial_data.get('product_price',0.0) product_currency = partial_data.get('product_currency',False) prodlot_id = partial_data.get('prodlot_id',False) if move.product_qty == product_qty: complete.append(move) elif move.product_qty > product_qty: too_few.append(move) else: too_many.append(move) | 9f6c10ca2a1258aae7d418c26f5083177e38b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6c10ca2a1258aae7d418c26f5083177e38b1a6/stock.py |
||
for move in too_many: product_qty = move_product_qty[move.id] move_obj.write(cr, uid, [move.id], { 'product_qty' : product_qty, 'product_uos_qty': product_qty, 'picking_id': new_picking, }) else: for move in too_many: product_qty = move_product_qty[move.id] move_obj.write(cr, uid, [move.id], { 'product_qty': product_qty, 'product_uos_qty': product_qty }) | for move in complete: if prodlot_ids.get(move.id): move_obj.write(cr, uid, move.id, {'prodlot_id': prodlot_ids[move.id]}) for move in too_many: product_qty = move_product_qty[move.id] defaults = { 'product_qty' : product_qty, 'product_uos_qty': product_qty, } prodlot_id = prodlot_ids.get(move.id) if prodlot_ids.get(move.id): defaults.update(prodlot_id=prodlot_id) if new_picking: defaults.update(picking_id=new_picking) move_obj.write(cr, uid, [move.id], defaults) | def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial picking and moves done. @param partial_datas : Dictionary containing details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom @return: Dictionary of values """ if context is None: context = {} else: context = dict(context) res = {} move_obj = self.pool.get('stock.move') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) for pick in self.browse(cr, uid, ids, context=context): new_picking = None new_moves = [] complete, too_many, too_few = [], [], [] move_product_qty = {} for move in pick.move_lines: if move.state in ('done', 'cancel'): continue partial_data = partial_datas.get('move%s'%(move.id), False) assert partial_data, _('Do not Found Partial data of Stock Move Line :%s' %(move.id)) product_qty = partial_data.get('product_qty',0.0) move_product_qty[move.id] = product_qty product_uom = partial_data.get('product_uom',False) product_price = partial_data.get('product_price',0.0) product_currency = partial_data.get('product_currency',False) prodlot_id = partial_data.get('prodlot_id',False) if move.product_qty == product_qty: complete.append(move) elif move.product_qty > product_qty: too_few.append(move) else: too_many.append(move) | 9f6c10ca2a1258aae7d418c26f5083177e38b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6c10ca2a1258aae7d418c26f5083177e38b1a6/stock.py |
if new_picking: | def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial picking and moves done. @param partial_datas : Dictionary containing details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom @return: Dictionary of values """ if context is None: context = {} else: context = dict(context) res = {} move_obj = self.pool.get('stock.move') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) for pick in self.browse(cr, uid, ids, context=context): new_picking = None new_moves = [] complete, too_many, too_few = [], [], [] move_product_qty = {} for move in pick.move_lines: if move.state in ('done', 'cancel'): continue partial_data = partial_datas.get('move%s'%(move.id), False) assert partial_data, _('Do not Found Partial data of Stock Move Line :%s' %(move.id)) product_qty = partial_data.get('product_qty',0.0) move_product_qty[move.id] = product_qty product_uom = partial_data.get('product_uom',False) product_price = partial_data.get('product_price',0.0) product_currency = partial_data.get('product_currency',False) prodlot_id = partial_data.get('prodlot_id',False) if move.product_qty == product_qty: complete.append(move) elif move.product_qty > product_qty: too_few.append(move) else: too_many.append(move) | 9f6c10ca2a1258aae7d418c26f5083177e38b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6c10ca2a1258aae7d418c26f5083177e38b1a6/stock.py |
|
'date': fields.datetime('Date', required=True, help="Scheduled date for the movement of the products or real date if the move is done.", readonly=True), 'date_expected': fields.datetime('Date Expected', required=True, help="Scheduled date for the movement of the products"), | 'date': fields.datetime('Date', required=True, help="Move date: scheduled date until move is done, then date of actual move processing", readonly=True), 'date_expected': fields.datetime('Scheduled Date', required=True, help="Scheduled date for the processing of this move"), | def _check_product_lot(self, cr, uid, ids): """ Checks whether move is done or not and production lot is assigned to that move. @return: True or False """ for move in self.browse(cr, uid, ids): if move.prodlot_id and move.state == 'done' and (move.prodlot_id.product_id.id != move.product_id.id): return False return True | 9f6c10ca2a1258aae7d418c26f5083177e38b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6c10ca2a1258aae7d418c26f5083177e38b1a6/stock.py |
users_obj = self.pool.get('res.users') | def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial pickings and moves done. @param partial_datas: Dictionary containing details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) new_moves = [] | 9f6c10ca2a1258aae7d418c26f5083177e38b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6c10ca2a1258aae7d418c26f5083177e38b1a6/stock.py |
|
prodlot_id = partial_data.get('prodlot_id',False) | prodlot_ids[move.id] = partial_data.get('prodlot_id') | def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial pickings and moves done. @param partial_datas: Dictionary containing details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) new_moves = [] | 9f6c10ca2a1258aae7d418c26f5083177e38b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6c10ca2a1258aae7d418c26f5083177e38b1a6/stock.py |
def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial pickings and moves done. @param partial_datas: Dictionary containing details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) new_moves = [] | 9f6c10ca2a1258aae7d418c26f5083177e38b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6c10ca2a1258aae7d418c26f5083177e38b1a6/stock.py |
||
user = users_obj.browse(cr, uid, uid) context['currency_id'] = move.company_id.currency_id.id | move_currency_id = move.company_id.currency_id.id context['currency_id'] = move_currency_id | def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial pickings and moves done. @param partial_datas: Dictionary containing details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) new_moves = [] | 9f6c10ca2a1258aae7d418c26f5083177e38b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6c10ca2a1258aae7d418c26f5083177e38b1a6/stock.py |
user.company_id.currency_id.id, product_price) | move_currency_id, product_price) | def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial pickings and moves done. @param partial_datas: Dictionary containing details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) new_moves = [] | 9f6c10ca2a1258aae7d418c26f5083177e38b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6c10ca2a1258aae7d418c26f5083177e38b1a6/stock.py |
new_move = self.copy(cr, uid, move.id, { 'product_qty' : product_qty, 'product_uos_qty': product_qty, 'picking_id' : move.picking_id.id, 'state': 'assigned', 'move_dest_id': False, 'price_unit': move.price_unit, }) | defaults = { 'product_qty' : product_qty, 'product_uos_qty': product_qty, 'picking_id' : move.picking_id.id, 'state': 'assigned', 'move_dest_id': False, 'price_unit': move.price_unit, } prodlot_id = prodlot_ids[move.id] if prodlot_id: defaults.update(prodlot_id=prodlot_id) new_move = self.copy(cr, uid, move.id, defaults) | def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial pickings and moves done. @param partial_datas: Dictionary containing details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) new_moves = [] | 9f6c10ca2a1258aae7d418c26f5083177e38b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6c10ca2a1258aae7d418c26f5083177e38b1a6/stock.py |
if prodlot_id: self.write(cr, uid, [move.id],{'prodlot_id': prodlot_id,}) | if prodlot_ids.get(move.id): self.write(cr, uid, [move.id],{'prodlot_id': prodlot_ids.get(move.id)}) | def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial pickings and moves done. @param partial_datas: Dictionary containing details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) new_moves = [] | 9f6c10ca2a1258aae7d418c26f5083177e38b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6c10ca2a1258aae7d418c26f5083177e38b1a6/stock.py |
ref = {} done_move_ids = [] for move in complete: done_move_ids.append(move.id) return done_move_ids | return [move.id for move in complete] | def do_partial(self, cr, uid, ids, partial_datas, context=None): """ Makes partial pickings and moves done. @param partial_datas: Dictionary containing details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) new_moves = [] | 9f6c10ca2a1258aae7d418c26f5083177e38b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6c10ca2a1258aae7d418c26f5083177e38b1a6/stock.py |
select stock.create_date, min(stock.id) as id, sum(stock.product_qty) as qty, 0 as planned_qty | select stock.create_date as date, min(stock.id) as id, sum(stock.product_qty) as qty, 0 as planned_qty | def init(self, cr): tools.drop_view_if_exists(cr, 'report_delivery_products_planned') cr.execute(""" create or replace view report_delivery_products_planned as ( select stock.create_date, min(stock.id) as id, sum(stock.product_qty) as qty, 0 as planned_qty from stock_picking picking inner join stock_move stock on picking.id = stock.picking_id and picking.type = 'out' where stock.create_date between (select cast(date_trunc('week', current_date) as date)) and (select cast(date_trunc('week', current_date) as date) + 7) group by stock.create_date | bb17e729bfc8340d44fc3ca03151c8abc9ea45b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bb17e729bfc8340d44fc3ca03151c8abc9ea45b9/stock.py |
select stock.date, min(stock.id), 0 as actual_qty, sum(stock.product_qty) as planned_qty | select stock.date as date, min(stock.id), 0 as actual_qty, sum(stock.product_qty) as planned_qty | def init(self, cr): tools.drop_view_if_exists(cr, 'report_delivery_products_planned') cr.execute(""" create or replace view report_delivery_products_planned as ( select stock.create_date, min(stock.id) as id, sum(stock.product_qty) as qty, 0 as planned_qty from stock_picking picking inner join stock_move stock on picking.id = stock.picking_id and picking.type = 'out' where stock.create_date between (select cast(date_trunc('week', current_date) as date)) and (select cast(date_trunc('week', current_date) as date) + 7) group by stock.create_date | bb17e729bfc8340d44fc3ca03151c8abc9ea45b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bb17e729bfc8340d44fc3ca03151c8abc9ea45b9/stock.py |
group by stock.date | group by stock.date | def init(self, cr): tools.drop_view_if_exists(cr, 'report_delivery_products_planned') cr.execute(""" create or replace view report_delivery_products_planned as ( select stock.create_date, min(stock.id) as id, sum(stock.product_qty) as qty, 0 as planned_qty from stock_picking picking inner join stock_move stock on picking.id = stock.picking_id and picking.type = 'out' where stock.create_date between (select cast(date_trunc('week', current_date) as date)) and (select cast(date_trunc('week', current_date) as date) + 7) group by stock.create_date | bb17e729bfc8340d44fc3ca03151c8abc9ea45b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bb17e729bfc8340d44fc3ca03151c8abc9ea45b9/stock.py |
if fil.parent_id: self.storage_id = fil.parent_id.storage_id.id else: self.storage_id = None | self.storage_id = None par = fil.parent_id while par: if par.storage_id and par.storage_id.id: self.storage_id = par.storage_id.id break par = par.parent_id | def __init__(self, path, parent, context, fil): super(node_file,self).__init__(path, parent,context) self.file_id = fil.id #todo: more info from ir_attachment if fil.file_type and '/' in fil.file_type: self.mimetype = str(fil.file_type) self.create_date = fil.create_date self.write_date = fil.write_date or fil.create_date self.content_length = fil.file_size self.displayname = fil.name # This only propagates the problem to get_data. Better # fix those files to point to the root dir. if fil.parent_id: self.storage_id = fil.parent_id.storage_id.id else: self.storage_id = None | bba02abfddd63d40945a29f8ab31e0938506ad3a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bba02abfddd63d40945a29f8ab31e0938506ad3a/nodes.py |
return self._get_dav_props_hlpr(cr, nodes.node_dir, | return self._get_dav_props_hlpr(cr, nodes.node_file, | def get_dav_props(self, cr): return self._get_dav_props_hlpr(cr, nodes.node_dir, None, 'file_id', self.file_id) #'document.webdav.dir.property', 'dir_id', self.dir_id) | a7cc6e51a439584931bc234557d528e9ac59ac4a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a7cc6e51a439584931bc234557d528e9ac59ac4a/nodes.py |
return self._get_dav_props_hlpr(cr, nodes.node_dir, | return self._get_dav_props_hlpr(cr, nodes.node_database, | def get_dav_props(self, cr): return self._get_dav_props_hlpr(cr, nodes.node_dir, 'document.webdav.dir.property', 'dir_id', False) | a7cc6e51a439584931bc234557d528e9ac59ac4a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a7cc6e51a439584931bc234557d528e9ac59ac4a/nodes.py |
return self._get_dav_eprop_hlpr(cr, nodes.node_dir, ns, prop, | return self._get_dav_eprop_hlpr(cr, nodes.node_database, ns, prop, | def get_dav_eprop(self, cr, ns, prop): return self._get_dav_eprop_hlpr(cr, nodes.node_dir, ns, prop, 'document.webdav.dir.property', 'dir_id', False) | a7cc6e51a439584931bc234557d528e9ac59ac4a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a7cc6e51a439584931bc234557d528e9ac59ac4a/nodes.py |
def _import(name, globals={}, locals={}, fromlist=[], level=-1): if name in _ALLOWED_MODULES: return __import__(name, globals, locals, level) raise ImportError(name) | def literal_eval(node_or_string): """literal_eval(expression) -> value Safely evaluate an expression node or a string containing a Python expression. The string or node provided may only consist of the following Python literal structures: strings, numbers, tuples, lists, dicts, booleans, and None. | 6c1ec1803a800cbbdee006e20cf6e7e0b1429a88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6c1ec1803a800cbbdee006e20cf6e7e0b1429a88/safe_eval.py |
|
def _set_previous_todo(self, cr, uid, state): """ lookup the previous (which is still the next at this point) ir.actions.todo, set it to whatever state was provided. | 50f599947e37d9be6565cf4ff2c959f5369a957b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/50f599947e37d9be6565cf4ff2c959f5369a957b/res_config.py |
||
""" Returns the next action to execute execute (using the default | """ Returns the next todo action to execute (using the default | def next(self, cr, uid, ids, context=None): """ Returns the next action to execute execute (using the default sort order) """ return self._next(cr, uid) | 50f599947e37d9be6565cf4ff2c959f5369a957b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/50f599947e37d9be6565cf4ff2c959f5369a957b/res_config.py |
where = [('parent_id','=',parent_id)] domain2 = domain + [('calendar_collection','=', True)] | where = [('parent_id','=',parent_id)] domain2 = domain + [('calendar_collection','=', True)] | def _child_get(self, cr, name=False, parent_id=False, domain=None): dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) if not domain: domain = [] domain2 = domain + [('calendar_collection','=', False)] res = super(node_database, self)._child_get(cr, name=name, parent_id=parent_id, domain=domain2) where = [('parent_id','=',parent_id)] domain2 = domain + [('calendar_collection','=', True)] if name: where.append(('name','=',name)) if domain2: where += domain2 | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
ids = dirobj.search(cr, uid, where2, context=ctx) for dirr in dirobj.browse(cr,uid,ids,context=ctx): | ids = dirobj.search(cr, uid, where2, context=ctx) for dirr in dirobj.browse(cr,uid,ids,context=ctx): | def _child_get(self, cr, name=False, parent_id=False, domain=None): dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) if not domain: domain = [] domain2 = domain + [('calendar_collection','=', False)] res = super(node_database, self)._child_get(cr, name=name, parent_id=parent_id, domain=domain2) where = [('parent_id','=',parent_id)] domain2 = domain + [('calendar_collection','=', True)] if name: where.append(('name','=',name)) if domain2: where += domain2 | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
class node_calendar_collection(nodes.node_dir): | class node_calendar_collection(nodes.node_dir): | def _child_get(self, cr, name=False, parent_id=False, domain=None): dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) if not domain: domain = [] domain2 = domain + [('calendar_collection','=', False)] res = super(node_database, self)._child_get(cr, name=name, parent_id=parent_id, domain=domain2) where = [('parent_id','=',parent_id)] domain2 = domain + [('calendar_collection','=', True)] if name: where.append(('name','=',name)) if domain2: where += domain2 | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
} M_NS = { | } M_NS = { | def _child_get(self, cr, name=False, parent_id=False, domain=None): dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) if not domain: domain = [] domain2 = domain + [('calendar_collection','=', False)] res = super(node_database, self)._child_get(cr, name=name, parent_id=parent_id, domain=domain2) where = [('parent_id','=',parent_id)] domain2 = domain + [('calendar_collection','=', True)] if name: where.append(('name','=',name)) if domain2: where += domain2 | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
} def get_dav_props(self, cr): | } def get_dav_props(self, cr): | def _child_get(self, cr, name=False, parent_id=False, domain=None): dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) if not domain: domain = [] domain2 = domain + [('calendar_collection','=', False)] res = super(node_database, self)._child_get(cr, name=name, parent_id=parent_id, domain=domain2) where = [('parent_id','=',parent_id)] domain2 = domain + [('calendar_collection','=', True)] if name: where.append(('name','=',name)) if domain2: where += domain2 | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
def get_dav_eprop(self,cr, ns, propname): | def get_dav_eprop(self,cr, ns, propname): | def get_dav_props(self, cr): return self.PROPS | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
print "Exception:", e | print "Exception:", e | def get_dav_eprop(self,cr, ns, propname): if self.M_NS.has_key(ns): prefix = self.M_NS[ns] else: print "No namespace:",ns, "( for prop:", propname,")" return None | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
def _child_get(self, cr, name=False, parent_id=False, domain=None): | def _child_get(self, cr, name=False, parent_id=False, domain=None): | def _file_get(self,cr, nodename=False): return [] | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
where = [('collection_id','=',self.dir_id)] ext = False if name: res = name.split('.ics') | where = [('collection_id','=',self.dir_id)] ext = False if name: res = name.split('.ics') | def _child_get(self, cr, name=False, parent_id=False, domain=None): dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) where = [('collection_id','=',self.dir_id)] ext = False if name: res = name.split('.ics') if len(res) > 1: name = res[0] ext = '.ics' if name: where.append(('name','=',name)) if not domain: domain = [] where = where + domain fil_obj = dirobj.pool.get('basic.calendar') ids = fil_obj.search(cr,uid,where,context=ctx) res = [] for calender in fil_obj.browse(cr, uid, ids, context=ctx): if not ext: res.append(node_calendar(calender.name, self, self.context, calender)) else: res.append(res_node_calendar(name, self, self.context, calender)) return res | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
if name: | if name: | def _child_get(self, cr, name=False, parent_id=False, domain=None): dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) where = [('collection_id','=',self.dir_id)] ext = False if name: res = name.split('.ics') if len(res) > 1: name = res[0] ext = '.ics' if name: where.append(('name','=',name)) if not domain: domain = [] where = where + domain fil_obj = dirobj.pool.get('basic.calendar') ids = fil_obj.search(cr,uid,where,context=ctx) res = [] for calender in fil_obj.browse(cr, uid, ids, context=ctx): if not ext: res.append(node_calendar(calender.name, self, self.context, calender)) else: res.append(res_node_calendar(name, self, self.context, calender)) return res | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
domain = [] | domain = [] | def _child_get(self, cr, name=False, parent_id=False, domain=None): dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) where = [('collection_id','=',self.dir_id)] ext = False if name: res = name.split('.ics') if len(res) > 1: name = res[0] ext = '.ics' if name: where.append(('name','=',name)) if not domain: domain = [] where = where + domain fil_obj = dirobj.pool.get('basic.calendar') ids = fil_obj.search(cr,uid,where,context=ctx) res = [] for calender in fil_obj.browse(cr, uid, ids, context=ctx): if not ext: res.append(node_calendar(calender.name, self, self.context, calender)) else: res.append(res_node_calendar(name, self, self.context, calender)) return res | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
fil_obj = dirobj.pool.get('basic.calendar') | fil_obj = dirobj.pool.get('basic.calendar') | def _child_get(self, cr, name=False, parent_id=False, domain=None): dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) where = [('collection_id','=',self.dir_id)] ext = False if name: res = name.split('.ics') if len(res) > 1: name = res[0] ext = '.ics' if name: where.append(('name','=',name)) if not domain: domain = [] where = where + domain fil_obj = dirobj.pool.get('basic.calendar') ids = fil_obj.search(cr,uid,where,context=ctx) res = [] for calender in fil_obj.browse(cr, uid, ids, context=ctx): if not ext: res.append(node_calendar(calender.name, self, self.context, calender)) else: res.append(res_node_calendar(name, self, self.context, calender)) return res | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
def _get_dav_owner(self, cr): return False | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
||
result = self.get_etag(cr) return str(result) class node_calendar(nodes.node_class): our_type = 'collection' | result = self.get_etag(cr) return str(result) class node_calendar(nodes.node_class): our_type = 'collection' | def _get_dav_getctag(self, cr): result = self.get_etag(cr) return str(result) | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
"DAV:" : '_get_dav', | "DAV:" : '_get_dav', | def _get_dav_getctag(self, cr): result = self.get_etag(cr) return str(result) | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
"urn:ietf:params:xml:ns:caldav" : '_get_caldav'} | "urn:ietf:params:xml:ns:caldav" : '_get_caldav'} | def _get_dav_getctag(self, cr): result = self.get_etag(cr) return str(result) | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
def _get_dav_getctag(self, cr): | def _get_dav_getctag(self, cr): | def _get_dav_getctag(self, cr): result = self._get_ttag(cr) + ':' + str(time.time()) return str(result) | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
return str(result) | return str(result) | def _get_dav_getctag(self, cr): result = self._get_ttag(cr) + ':' + str(time.time()) return str(result) | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
ctx = self.context.context.copy() | ctx = self.context.context.copy() | def match_dav_eprop(self, cr, match, ns, prop): if ns == "DAV:" and prop == "getetag": dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() tem, dav_time = tuple(match.split(':')) model, res_id = tuple(tem.split('_')) model_obj = dirobj.pool.get(model) model = model_obj.browse(cr, uid, res_id, context=ctx) write_time = model.write_date or model.create_date wtime = time.mktime(time.strptime(write_time,'%Y-%m-%d %H:%M:%S')) if float(dav_time) == float(wtime): return True return False res = super(node_calendar, self).match_dav_eprop(cr, match, ns, prop) return res | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
wtime = time.mktime(time.strptime(write_time,'%Y-%m-%d %H:%M:%S')) | wtime = time.mktime(time.strptime(write_time,'%Y-%m-%d %H:%M:%S')) | def match_dav_eprop(self, cr, match, ns, prop): if ns == "DAV:" and prop == "getetag": dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() tem, dav_time = tuple(match.split(':')) model, res_id = tuple(tem.split('_')) model_obj = dirobj.pool.get(model) model = model_obj.browse(cr, uid, res_id, context=ctx) write_time = model.write_date or model.create_date wtime = time.mktime(time.strptime(write_time,'%Y-%m-%d %H:%M:%S')) if float(dav_time) == float(wtime): return True return False res = super(node_calendar, self).match_dav_eprop(cr, match, ns, prop) return res | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
return res def get_domain(self, cr, filters): | return res def get_domain(self, cr, filters): | def match_dav_eprop(self, cr, match, ns, prop): if ns == "DAV:" and prop == "getetag": dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() tem, dav_time = tuple(match.split(':')) model, res_id = tuple(tem.split('_')) model_obj = dirobj.pool.get(model) model = model_obj.browse(cr, uid, res_id, context=ctx) write_time = model.write_date or model.create_date wtime = time.mktime(time.strptime(write_time,'%Y-%m-%d %H:%M:%S')) if float(dav_time) == float(wtime): return True return False res = super(node_calendar, self).match_dav_eprop(cr, match, ns, prop) return res | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
if filters.localName == 'calendar-query': | if filters.localName == 'calendar-query': | def get_domain(self, cr, filters): res = [] dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) calendar_obj = dirobj.pool.get('basic.calendar') if not filters: return res if filters.localName == 'calendar-query': res = [] for filter_child in filters.childNodes: if filter_child.nodeType == filter_child.TEXT_NODE: continue if filter_child.localName == 'filter': for vcalendar_filter in filter_child.childNodes: if vcalendar_filter.nodeType == vcalendar_filter.TEXT_NODE: continue if vcalendar_filter.localName == 'comp-filter': if vcalendar_filter.getAttribute('name') == 'VCALENDAR': for vevent_filter in vcalendar_filter.childNodes: if vevent_filter.nodeType == vevent_filter.TEXT_NODE: continue if vevent_filter.localName == 'comp-filter': if vevent_filter.getAttribute('name') == 'VEVENT': res = [('type','=','vevent')] if vevent_filter.getAttribute('name') == 'VTODO': res = [('type','=','vtodo')] return res elif filters.localName == 'calendar-multiget': names = [] for filter_child in filters.childNodes: if filter_child.nodeType == filter_child.TEXT_NODE: continue if filter_child.localName == 'href': if not filter_child.firstChild: continue uri = filter_child.firstChild.data caluri = uri.split('/') if len(caluri): caluri = caluri[-2] if caluri not in names : names.append(caluri) res = [('name','in',names)] return res return res | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
continue if filter_child.localName == 'filter': | continue if filter_child.localName == 'filter': | def get_domain(self, cr, filters): res = [] dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) calendar_obj = dirobj.pool.get('basic.calendar') if not filters: return res if filters.localName == 'calendar-query': res = [] for filter_child in filters.childNodes: if filter_child.nodeType == filter_child.TEXT_NODE: continue if filter_child.localName == 'filter': for vcalendar_filter in filter_child.childNodes: if vcalendar_filter.nodeType == vcalendar_filter.TEXT_NODE: continue if vcalendar_filter.localName == 'comp-filter': if vcalendar_filter.getAttribute('name') == 'VCALENDAR': for vevent_filter in vcalendar_filter.childNodes: if vevent_filter.nodeType == vevent_filter.TEXT_NODE: continue if vevent_filter.localName == 'comp-filter': if vevent_filter.getAttribute('name') == 'VEVENT': res = [('type','=','vevent')] if vevent_filter.getAttribute('name') == 'VTODO': res = [('type','=','vtodo')] return res elif filters.localName == 'calendar-multiget': names = [] for filter_child in filters.childNodes: if filter_child.nodeType == filter_child.TEXT_NODE: continue if filter_child.localName == 'href': if not filter_child.firstChild: continue uri = filter_child.firstChild.data caluri = uri.split('/') if len(caluri): caluri = caluri[-2] if caluri not in names : names.append(caluri) res = [('name','in',names)] return res return res | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
if vcalendar_filter.nodeType == vcalendar_filter.TEXT_NODE: | if vcalendar_filter.nodeType == vcalendar_filter.TEXT_NODE: | def get_domain(self, cr, filters): res = [] dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) calendar_obj = dirobj.pool.get('basic.calendar') if not filters: return res if filters.localName == 'calendar-query': res = [] for filter_child in filters.childNodes: if filter_child.nodeType == filter_child.TEXT_NODE: continue if filter_child.localName == 'filter': for vcalendar_filter in filter_child.childNodes: if vcalendar_filter.nodeType == vcalendar_filter.TEXT_NODE: continue if vcalendar_filter.localName == 'comp-filter': if vcalendar_filter.getAttribute('name') == 'VCALENDAR': for vevent_filter in vcalendar_filter.childNodes: if vevent_filter.nodeType == vevent_filter.TEXT_NODE: continue if vevent_filter.localName == 'comp-filter': if vevent_filter.getAttribute('name') == 'VEVENT': res = [('type','=','vevent')] if vevent_filter.getAttribute('name') == 'VTODO': res = [('type','=','vtodo')] return res elif filters.localName == 'calendar-multiget': names = [] for filter_child in filters.childNodes: if filter_child.nodeType == filter_child.TEXT_NODE: continue if filter_child.localName == 'href': if not filter_child.firstChild: continue uri = filter_child.firstChild.data caluri = uri.split('/') if len(caluri): caluri = caluri[-2] if caluri not in names : names.append(caluri) res = [('name','in',names)] return res return res | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
if vevent_filter.getAttribute('name') == 'VEVENT': | if vevent_filter.getAttribute('name') == 'VEVENT': | def get_domain(self, cr, filters): res = [] dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) calendar_obj = dirobj.pool.get('basic.calendar') if not filters: return res if filters.localName == 'calendar-query': res = [] for filter_child in filters.childNodes: if filter_child.nodeType == filter_child.TEXT_NODE: continue if filter_child.localName == 'filter': for vcalendar_filter in filter_child.childNodes: if vcalendar_filter.nodeType == vcalendar_filter.TEXT_NODE: continue if vcalendar_filter.localName == 'comp-filter': if vcalendar_filter.getAttribute('name') == 'VCALENDAR': for vevent_filter in vcalendar_filter.childNodes: if vevent_filter.nodeType == vevent_filter.TEXT_NODE: continue if vevent_filter.localName == 'comp-filter': if vevent_filter.getAttribute('name') == 'VEVENT': res = [('type','=','vevent')] if vevent_filter.getAttribute('name') == 'VTODO': res = [('type','=','vtodo')] return res elif filters.localName == 'calendar-multiget': names = [] for filter_child in filters.childNodes: if filter_child.nodeType == filter_child.TEXT_NODE: continue if filter_child.localName == 'href': if not filter_child.firstChild: continue uri = filter_child.firstChild.data caluri = uri.split('/') if len(caluri): caluri = caluri[-2] if caluri not in names : names.append(caluri) res = [('name','in',names)] return res return res | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
res = [('type','=','vtodo')] | res = [('type','=','vtodo')] | def get_domain(self, cr, filters): res = [] dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) calendar_obj = dirobj.pool.get('basic.calendar') if not filters: return res if filters.localName == 'calendar-query': res = [] for filter_child in filters.childNodes: if filter_child.nodeType == filter_child.TEXT_NODE: continue if filter_child.localName == 'filter': for vcalendar_filter in filter_child.childNodes: if vcalendar_filter.nodeType == vcalendar_filter.TEXT_NODE: continue if vcalendar_filter.localName == 'comp-filter': if vcalendar_filter.getAttribute('name') == 'VCALENDAR': for vevent_filter in vcalendar_filter.childNodes: if vevent_filter.nodeType == vevent_filter.TEXT_NODE: continue if vevent_filter.localName == 'comp-filter': if vevent_filter.getAttribute('name') == 'VEVENT': res = [('type','=','vevent')] if vevent_filter.getAttribute('name') == 'VTODO': res = [('type','=','vtodo')] return res elif filters.localName == 'calendar-multiget': names = [] for filter_child in filters.childNodes: if filter_child.nodeType == filter_child.TEXT_NODE: continue if filter_child.localName == 'href': if not filter_child.firstChild: continue uri = filter_child.firstChild.data caluri = uri.split('/') if len(caluri): caluri = caluri[-2] if caluri not in names : names.append(caluri) res = [('name','in',names)] return res return res | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
uri = filter_child.firstChild.data | uri = filter_child.firstChild.data | def get_domain(self, cr, filters): res = [] dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) calendar_obj = dirobj.pool.get('basic.calendar') if not filters: return res if filters.localName == 'calendar-query': res = [] for filter_child in filters.childNodes: if filter_child.nodeType == filter_child.TEXT_NODE: continue if filter_child.localName == 'filter': for vcalendar_filter in filter_child.childNodes: if vcalendar_filter.nodeType == vcalendar_filter.TEXT_NODE: continue if vcalendar_filter.localName == 'comp-filter': if vcalendar_filter.getAttribute('name') == 'VCALENDAR': for vevent_filter in vcalendar_filter.childNodes: if vevent_filter.nodeType == vevent_filter.TEXT_NODE: continue if vevent_filter.localName == 'comp-filter': if vevent_filter.getAttribute('name') == 'VEVENT': res = [('type','=','vevent')] if vevent_filter.getAttribute('name') == 'VTODO': res = [('type','=','vtodo')] return res elif filters.localName == 'calendar-multiget': names = [] for filter_child in filters.childNodes: if filter_child.nodeType == filter_child.TEXT_NODE: continue if filter_child.localName == 'href': if not filter_child.firstChild: continue uri = filter_child.firstChild.data caluri = uri.split('/') if len(caluri): caluri = caluri[-2] if caluri not in names : names.append(caluri) res = [('name','in',names)] return res return res | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
return res def children(self, cr, domain=None): | return res def children(self, cr, domain=None): | def get_domain(self, cr, filters): res = [] dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) calendar_obj = dirobj.pool.get('basic.calendar') if not filters: return res if filters.localName == 'calendar-query': res = [] for filter_child in filters.childNodes: if filter_child.nodeType == filter_child.TEXT_NODE: continue if filter_child.localName == 'filter': for vcalendar_filter in filter_child.childNodes: if vcalendar_filter.nodeType == vcalendar_filter.TEXT_NODE: continue if vcalendar_filter.localName == 'comp-filter': if vcalendar_filter.getAttribute('name') == 'VCALENDAR': for vevent_filter in vcalendar_filter.childNodes: if vevent_filter.nodeType == vevent_filter.TEXT_NODE: continue if vevent_filter.localName == 'comp-filter': if vevent_filter.getAttribute('name') == 'VEVENT': res = [('type','=','vevent')] if vevent_filter.getAttribute('name') == 'VTODO': res = [('type','=','vtodo')] return res elif filters.localName == 'calendar-multiget': names = [] for filter_child in filters.childNodes: if filter_child.nodeType == filter_child.TEXT_NODE: continue if filter_child.localName == 'href': if not filter_child.firstChild: continue uri = filter_child.firstChild.data caluri = uri.split('/') if len(caluri): caluri = caluri[-2] if caluri not in names : names.append(caluri) res = [('name','in',names)] return res return res | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
def child(self,cr, name, domain=None): res = self._child_get(cr, name, domain=domain) | def child(self,cr, name, domain=None): res = self._child_get(cr, name, domain=domain) | def child(self,cr, name, domain=None): res = self._child_get(cr, name, domain=domain) if res: return res[0] return None | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
return None | return None | def child(self,cr, name, domain=None): res = self._child_get(cr, name, domain=domain) if res: return res[0] return None | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
ctx.update(self.dctx) where = [] if name: where.append(('id','=',int(name))) | ctx.update(self.dctx) where = [] if name: where.append(('id','=',int(name))) | def _child_get(self, cr, name=False, parent_id=False, domain=None): dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) where = [] if name: where.append(('id','=',int(name))) if not domain: domain = [] #for opr1, opt, opr2 in domain: # if opr1 == 'type' and opr2 != self.cal_type: # return [] | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
fil_obj = dirobj.pool.get('basic.calendar') | fil_obj = dirobj.pool.get('basic.calendar') | def _child_get(self, cr, name=False, parent_id=False, domain=None): dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) where = [] if name: where.append(('id','=',int(name))) if not domain: domain = [] #for opr1, opt, opr2 in domain: # if opr1 == 'type' and opr2 != self.cal_type: # return [] | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
res = fil_obj.get_calendar_objects(cr, uid, [self.calendar_id], self, domain=where, context=ctx) return res def get_dav_props(self, cr): | res = fil_obj.get_calendar_objects(cr, uid, [self.calendar_id], self, domain=where, context=ctx) return res def get_dav_props(self, cr): | def _child_get(self, cr, name=False, parent_id=False, domain=None): dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) where = [] if name: where.append(('id','=',int(name))) if not domain: domain = [] #for opr1, opt, opr2 in domain: # if opr1 == 'type' and opr2 != self.cal_type: # return [] | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
r = m(cr) | r = m(cr) | def get_dav_eprop(self,cr, ns, propname): if self.M_NS.has_key(ns): prefix = self.M_NS[ns] else: print "No namespace:",ns, "( for prop:", propname,")" return None propname = propname.replace('-','_') mname = prefix + "_" + propname if not hasattr(self, mname): return None | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
print "Exception:", e | print "Exception:", e | def get_dav_eprop(self,cr, ns, propname): if self.M_NS.has_key(ns): prefix = self.M_NS[ns] else: print "No namespace:",ns, "( for prop:", propname,")" return None propname = propname.replace('-','_') mname = prefix + "_" + propname if not hasattr(self, mname): return None | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
return self.set_data(cr, data) | return self.set_data(cr, data) | def create_child(self,cr,path,data): """ API function to create a child file object and node Return the node_* created """ return self.set_data(cr, data) | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
def get_data_len(self, cr, fil_obj = None): | def get_data_len(self, cr, fil_obj = None): | def get_data_len(self, cr, fil_obj = None): return self.content_length | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
def get_data_len(self, cr, fil_obj = None): return self.content_length | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
||
return 'calendar-%d' % (self.calendar_id,) | return 'calendar-%d' % (self.calendar_id,) | def _get_ttag(self,cr): return 'calendar-%d' % (self.calendar_id,) | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
return str(wtime) | return str(wtime) | def _get_wtag(self, cr): """ Return the modification time as a unique, compact string """ if self.write_date: wtime = time.mktime(time.strptime(self.write_date, '%Y-%m-%d %H:%M:%S')) else: wtime = time.time() return str(wtime) | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
M_NS = { | M_NS = { | def rmcol(self, cr): return False | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
"urn:ietf:params:xml:ns:caldav" : '_get_caldav'} | "urn:ietf:params:xml:ns:caldav" : '_get_caldav'} | def rmcol(self, cr): return False | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
super(res_node_calendar,self).__init__(path, parent, context) | super(res_node_calendar,self).__init__(path, parent, context) | def __init__(self,path, parent, context, res_obj, res_model=None, res_id=None): super(res_node_calendar,self).__init__(path, parent, context) self.mimetype = 'text/calendar' self.create_date = parent.create_date self.write_date = parent.write_date or parent.create_date self.calendar_id = hasattr(parent, 'calendar_id') and parent.calendar_id or False if res_obj: if not self.calendar_id: self.calendar_id = res_obj.id self.create_date = res_obj.create_date self.write_date = res_obj.write_date or res_obj.create_date self.displayname = res_obj.name | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
def __init__(self,path, parent, context, res_obj, res_model=None, res_id=None): super(res_node_calendar,self).__init__(path, parent, context) self.mimetype = 'text/calendar' self.create_date = parent.create_date self.write_date = parent.write_date or parent.create_date self.calendar_id = hasattr(parent, 'calendar_id') and parent.calendar_id or False if res_obj: if not self.calendar_id: self.calendar_id = res_obj.id self.create_date = res_obj.create_date self.write_date = res_obj.write_date or res_obj.create_date self.displayname = res_obj.name | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
||
def __init__(self,path, parent, context, res_obj, res_model=None, res_id=None): super(res_node_calendar,self).__init__(path, parent, context) self.mimetype = 'text/calendar' self.create_date = parent.create_date self.write_date = parent.write_date or parent.create_date self.calendar_id = hasattr(parent, 'calendar_id') and parent.calendar_id or False if res_obj: if not self.calendar_id: self.calendar_id = res_obj.id self.create_date = res_obj.create_date self.write_date = res_obj.write_date or res_obj.create_date self.displayname = res_obj.name | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
||
uid = self.context.uid | uid = self.context.uid | def open(self, cr, mode=False): uid = self.context.uid if self.type in ('collection','database'): return False s = StringIO.StringIO(self.get_data(cr)) s.name = self return s | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
return False s = StringIO.StringIO(self.get_data(cr)) | return False s = StringIO.StringIO(self.get_data(cr)) | def open(self, cr, mode=False): uid = self.context.uid if self.type in ('collection','database'): return False s = StringIO.StringIO(self.get_data(cr)) s.name = self return s | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
return s def get_dav_props(self, cr): | return s def get_dav_props(self, cr): | def open(self, cr, mode=False): uid = self.context.uid if self.type in ('collection','database'): return False s = StringIO.StringIO(self.get_data(cr)) s.name = self return s | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
def get_dav_eprop(self,cr, ns, propname): | def get_dav_eprop(self,cr, ns, propname): | def get_dav_eprop(self,cr, ns, propname): if self.M_NS.has_key(ns): prefix = self.M_NS[ns] else: print "No namespace:",ns, "( for prop:", propname,")" return None propname = propname.replace('-','_') mname = prefix + "_" + propname if not hasattr(self, mname): return None | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
r = m(cr) | r = m(cr) | def get_dav_eprop(self,cr, ns, propname): if self.M_NS.has_key(ns): prefix = self.M_NS[ns] else: print "No namespace:",ns, "( for prop:", propname,")" return None propname = propname.replace('-','_') mname = prefix + "_" + propname if not hasattr(self, mname): return None | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
print "Exception:", e | print "Exception:", e | def get_dav_eprop(self,cr, ns, propname): if self.M_NS.has_key(ns): prefix = self.M_NS[ns] else: print "No namespace:",ns, "( for prop:", propname,")" return None propname = propname.replace('-','_') mname = prefix + "_" + propname if not hasattr(self, mname): return None | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
def get_data(self, cr, fil_obj = None): | def get_data(self, cr, fil_obj = None): | def get_data(self, cr, fil_obj = None): uid = self.context.uid calendar_obj = self.context._dirobj.pool.get('basic.calendar') context = self.context.context.copy() context.update({'model': self.model, 'res_id':self.res_id}) res = calendar_obj.export_cal(cr, uid, [self.calendar_id], context=context) return res | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
context = self.context.context.copy() context.update({'model': self.model, 'res_id':self.res_id}) res = calendar_obj.export_cal(cr, uid, [self.calendar_id], context=context) return res def get_data_len(self, cr, fil_obj = None): | context = self.context.context.copy() context.update({'model': self.model, 'res_id':self.res_id}) res = calendar_obj.export_cal(cr, uid, [self.calendar_id], context=context) return res def get_data_len(self, cr, fil_obj = None): | def get_data(self, cr, fil_obj = None): uid = self.context.uid calendar_obj = self.context._dirobj.pool.get('basic.calendar') context = self.context.context.copy() context.update({'model': self.model, 'res_id':self.res_id}) res = calendar_obj.export_cal(cr, uid, [self.calendar_id], context=context) return res | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
def _get_caldav_calendar_data(self, cr): | def _get_caldav_calendar_data(self, cr): | def _get_ttag(self,cr): res = False if self.model and self.res_id: res = '%s_%d' % (self.model, self.res_id) elif self.calendar_id: res = '%d' % (self.calendar_id) return res | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
def _get_caldav_calendar_data(self, cr): return self.get_data(cr) | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
||
ctx.update(self.dctx) | ctx.update(self.dctx) | def _get_caldav_calendar_description(self, cr): uid = self.context.uid calendar_obj = self.context._dirobj.pool.get('basic.calendar') ctx = self.context.context.copy() ctx.update(self.dctx) calendar = calendar_obj.browse(cr, uid, self.calendar_id, context=ctx) return calendar.description | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
def _get_caldav_calendar_description(self, cr): uid = self.context.uid calendar_obj = self.context._dirobj.pool.get('basic.calendar') ctx = self.context.context.copy() ctx.update(self.dctx) calendar = calendar_obj.browse(cr, uid, self.calendar_id, context=ctx) return calendar.description | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
||
import urllib uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) doc = xml.dom.minidom.getDOMImplementation().createDocument(None, 'href', None) calendar_obj = self.context._dirobj.pool.get('basic.calendar') | import urllib uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) doc = xml.dom.minidom.getDOMImplementation().createDocument(None, 'href', None) calendar_obj = self.context._dirobj.pool.get('basic.calendar') | def _get_caldav_calendar_home_set(self, cr): import xml.dom.minidom import urllib uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) doc = xml.dom.minidom.getDOMImplementation().createDocument(None, 'href', None) calendar_obj = self.context._dirobj.pool.get('basic.calendar') calendar = calendar_obj.browse(cr, uid, self.calendar_id, context=ctx) huri = doc.createTextNode(urllib.quote('/%s/%s' % (cr.dbname, calendar.collection_id.name))) href = doc.documentElement href.tagName = 'D:href' href.appendChild(huri) return href | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
user = user_obj.browse(cr, uid, uid, context=ctx) | user = user_obj.browse(cr, uid, uid, context=ctx) | def _get_caldav_calendar_user_address_set(self, cr): import xml.dom.minidom dirobj = self.context._dirobj uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) user_obj = self.context._dirobj.pool.get('res.users') user = user_obj.browse(cr, uid, uid, context=ctx) doc = xml.dom.minidom.getDOMImplementation().createDocument(None, 'href', None) href = doc.documentElement href.tagName = 'D:href' huri = doc.createTextNode('MAILTO:' + user.email) href.appendChild(huri) return href | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
import urllib uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) calendar_obj = self.context._dirobj.pool.get('basic.calendar') | import urllib uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) calendar_obj = self.context._dirobj.pool.get('basic.calendar') | def _get_caldav_schedule_inbox_URL(self, cr): import xml.dom.minidom import urllib uid = self.context.uid ctx = self.context.context.copy() ctx.update(self.dctx) calendar_obj = self.context._dirobj.pool.get('basic.calendar') calendar = calendar_obj.browse(cr, uid, self.calendar_id, context=ctx) res = '%s/%s' %(calendar.name, calendar.collection_id.name) doc = xml.dom.minidom.getDOMImplementation().createDocument(None, 'href', None) href = doc.documentElement href.tagName = 'D:href' huri = doc.createTextNode(urllib.quote('/%s/%s' % (cr.dbname, res))) href.appendChild(huri) return href | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
return False if self.model and self.res_id: | return False if self.model and self.res_id: | def rm(self, cr): uid = self.context.uid res = False if self.type in ('collection','database'): return False if self.model and self.res_id: document_obj = self.context._dirobj.pool.get(self.model) if document_obj: res = False #res = document_obj.unlink(cr, uid, [self.res_id]) #TOFIX return res | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
return res | return res | def rm(self, cr): uid = self.context.uid res = False if self.type in ('collection','database'): return False if self.model and self.res_id: document_obj = self.context._dirobj.pool.get(self.model) if document_obj: res = False #res = document_obj.unlink(cr, uid, [self.res_id]) #TOFIX return res | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
def _get_caldav_schedule_outbox_URL(self, cr): return self._get_caldav_schedule_inbox_URL(cr) | fe0ee384c7b5a64c12f8725027352df173701456 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fe0ee384c7b5a64c12f8725027352df173701456/caldav_node.py |
||
context.update({'lang': inv.partner_id.lang}) compute_taxes = ait_obj.compute(cr, uid, inv.id, context=context) | ctx = context.copy() ctx.update({'lang': inv.partner_id.lang}) compute_taxes = ait_obj.compute(cr, uid, inv.id, context=ctx) | def action_move_create(self, cr, uid, ids, *args): """Creates invoice related analytics and financial move lines""" ait_obj = self.pool.get('account.invoice.tax') cur_obj = self.pool.get('res.currency') context = {} for inv in self.browse(cr, uid, ids): if not inv.journal_id.sequence_id: raise osv.except_osv(_('Error !'), _('Please define sequence on invoice journal')) if not inv.invoice_line: raise osv.except_osv(_('No Invoice Lines !'), _('Please create some invoice lines.')) if inv.move_id: continue | 67a53dd997301f80f0ca8e3f935beb79c1bc3598 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/67a53dd997301f80f0ca8e3f935beb79c1bc3598/invoice.py |
print "formmmmmmmmmm", form | def get_fiscalyear(self,form): print "formmmmmmmmmm", form return pooler.get_pool(self.cr.dbname).get('account.fiscalyear').browse(self.cr,self.uid,form['fiscalyear_id']).name | 2f81b78ca6861b10a66bc7e08209114bbd4d6653 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2f81b78ca6861b10a66bc7e08209114bbd4d6653/general_ledger.py |
|
return pooler.get_pool(self.cr.dbname).get('account.period').browse(self.cr,self.uid,form['period_from']).name | if form['filter'] == 'filter_period': if form['period_from']: return pooler.get_pool(self.cr.dbname).get('account.period').browse(self.cr,self.uid,form['period_from']).name return '' | def get_start_period(self, form): return pooler.get_pool(self.cr.dbname).get('account.period').browse(self.cr,self.uid,form['period_from']).name | 2f81b78ca6861b10a66bc7e08209114bbd4d6653 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2f81b78ca6861b10a66bc7e08209114bbd4d6653/general_ledger.py |
return pooler.get_pool(self.cr.dbname).get('account.period').browse(self.cr,self.uid,form['period_to']).name | if form['filter'] == 'filter_period': if form['period_to']: return pooler.get_pool(self.cr.dbname).get('account.period').browse(self.cr,self.uid,form['period_to']).name return '' | def get_end_period(self, form): return pooler.get_pool(self.cr.dbname).get('account.period').browse(self.cr,self.uid,form['period_to']).name | 2f81b78ca6861b10a66bc7e08209114bbd4d6653 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2f81b78ca6861b10a66bc7e08209114bbd4d6653/general_ledger.py |
obj=[] | def write(self, cr, uid, ids, vals, context=None): obj=[] if 'company_id' in vals: move_lines = self.pool.get('account.move.line').search(cr, uid, [('journal_id', 'in', ids)]) if move_lines: raise osv.except_osv(_('Warning !'), _('You cannot modify company of this journal as its related record exist in Entry Lines')) return super(account_journal, self).write(cr, uid, ids, vals, context=context) | 95242daa1c43f6e085dfbc4823d71749d4846a5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/95242daa1c43f6e085dfbc4823d71749d4846a5d/account.py |
|
journal_type = ('sale', 'sale_refund', 'purchase', 'purchase_refund') journal_seq = { 'sale':'seq_out_invoice', 'purchase':'seq_in_invoice', 'purchase_refund':'seq_out_refund', 'sale_refund':'seq_in_refund' } | def create_sequence(self, cr, uid, vals, context=None): """ Create new entry sequence for every new Joural @param cr: cursor to database @param user: id of current user @param ids: list of record ids to be process @param context: context arguments, like lang, time zone @return: return a result """ | 95242daa1c43f6e085dfbc4823d71749d4846a5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/95242daa1c43f6e085dfbc4823d71749d4846a5d/account.py |
|
date_pool = self.pool.get('ir.model.data') result = True | def create_sequence(self, cr, uid, vals, context=None): """ Create new entry sequence for every new Joural @param cr: cursor to database @param user: id of current user @param ids: list of record ids to be process @param context: context arguments, like lang, time zone @return: return a result """ | 95242daa1c43f6e085dfbc4823d71749d4846a5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/95242daa1c43f6e085dfbc4823d71749d4846a5d/account.py |
|
obj=[] | def write(self, cr, uid, ids, vals, context={}): obj=[] if 'company_id' in vals: move_lines = self.pool.get('account.move.line').search(cr, uid, [('period_id', 'in', ids)]) if move_lines: raise osv.except_osv(_('Warning !'), _('You cannot modify company of this period as its related record exist in Entry Lines')) return super(account_period, self).write(cr, uid, ids, vals, context=context) | 95242daa1c43f6e085dfbc4823d71749d4846a5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/95242daa1c43f6e085dfbc4823d71749d4846a5d/account.py |
|
new_account = acc_obj.create(cr, uid, vals) | acc_obj.create(cr, uid, vals) | def action_create(self,cr,uid,ids,context=None): acc_obj = self.pool.get('account.account') tmpl_obj = self.pool.get('account.account.template') data = self.read(cr, uid, ids) company_id = acc_obj.read(cr, uid, [data[0]['cparent_id']], ['company_id'])[0]['company_id'][0] account_template = tmpl_obj.browse(cr, uid, context['tmpl_ids']) vals = { 'name': account_template.name, 'currency_id': account_template.currency_id and account_template.currency_id.id or False, 'code': account_template.code, 'type': account_template.type, 'user_type': account_template.user_type and account_template.user_type.id or False, 'reconcile': account_template.reconcile, 'shortcut': account_template.shortcut, 'note': account_template.note, 'parent_id': data[0]['cparent_id'], 'company_id': company_id, } new_account = acc_obj.create(cr, uid, vals) return {'type':'state', 'state': 'end' } | 95242daa1c43f6e085dfbc4823d71749d4846a5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/95242daa1c43f6e085dfbc4823d71749d4846a5d/account.py |
except Exception,e: | except: | def execute(self, cr, uid, ids, context=None): obj_multi = self.browse(cr, uid, ids[0]) obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_sequence = self.pool.get('ir.sequence') obj_acc_template = self.pool.get('account.account.template') obj_fiscal_position_template = self.pool.get('account.fiscal.position.template') obj_fiscal_position = self.pool.get('account.fiscal.position') data_pool = self.pool.get('ir.model.data') analytic_journal_obj = self.pool.get('account.analytic.journal') | 95242daa1c43f6e085dfbc4823d71749d4846a5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/95242daa1c43f6e085dfbc4823d71749d4846a5d/account.py |
def update_from_db(self, cr): # update the graph with values from the database (if exist) ## First, we set the default values for each package in graph additional_data = dict.fromkeys(self.keys(), {'id': 0, 'state': 'uninstalled', 'dbdemo': False, 'installed_version': None}) ## Then we get the values from the database cr.execute('SELECT name, id, state, demo AS dbdemo, latest_version AS installed_version' ' FROM ir_module_module' ' WHERE name IN %s',(tuple(additional_data),) ) | 75d569cc6c5ed18f920052415c23e7b838e3b6a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/75d569cc6c5ed18f920052415c23e7b838e3b6a4/__init__.py |
||
global not_loaded not_loaded.append(module) logger.notifyChannel('init', netsvc.LOG_WARNING, 'module %s: not installable' % (module)) | logger.notifyChannel('init', netsvc.LOG_WARNING, 'module %s: not found, skipped' % (module)) | def upgrade_graph(graph, cr, module_list, force=None): if force is None: force = [] packages = [] len_graph = len(graph) for module in module_list: mod_path = get_module_path(module) terp_file = get_module_resource(module, '__openerp__.py') if not terp_file or not os.path.isfile(terp_file): terp_file = get_module_resource(module, '__terp__.py') if not mod_path or not terp_file: global not_loaded not_loaded.append(module) logger.notifyChannel('init', netsvc.LOG_WARNING, 'module %s: not installable' % (module)) continue #raise osv.osv.except_osv('Error!',"Module '%s' was not found" % (module,)) if os.path.isfile(terp_file) or zipfile.is_zipfile(mod_path+'.zip'): try: info = eval(tools.file_open(terp_file).read()) except: logger.notifyChannel('init', netsvc.LOG_ERROR, 'module %s: eval file %s' % (module, terp_file)) raise if info.get('installable', True): packages.append((module, info.get('depends', []), info)) dependencies = dict([(p, deps) for p, deps, data in packages]) current, later = set([p for p, dep, data in packages]), set() while packages and current > later: package, deps, data = packages[0] # if all dependencies of 'package' are already in the graph, add 'package' in the graph if reduce(lambda x, y: x and y in graph, deps, True): if not package in current: packages.pop(0) continue later.clear() current.remove(package) graph.addNode(package, deps) node = Node(package, graph) node.data = data for kind in ('init', 'demo', 'update'): if package in tools.config[kind] or 'all' in tools.config[kind] or kind in force: setattr(node, kind, True) else: later.add(package) packages.append((package, deps, data)) packages.pop(0) graph.update_from_db(cr) for package in later: unmet_deps = filter(lambda p: p not in graph, dependencies[package]) logger.notifyChannel('init', netsvc.LOG_ERROR, 'module %s: Unmet dependencies: %s' % (package, ', '.join(unmet_deps))) result = len(graph) - len_graph if result != len(module_list): logger.notifyChannel('init', netsvc.LOG_WARNING, 'Not all modules have loaded.') return result | 75d569cc6c5ed18f920052415c23e7b838e3b6a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/75d569cc6c5ed18f920052415c23e7b838e3b6a4/__init__.py |
def upgrade_graph(graph, cr, module_list, force=None): if force is None: force = [] packages = [] len_graph = len(graph) for module in module_list: mod_path = get_module_path(module) terp_file = get_module_resource(module, '__openerp__.py') if not terp_file or not os.path.isfile(terp_file): terp_file = get_module_resource(module, '__terp__.py') if not mod_path or not terp_file: global not_loaded not_loaded.append(module) logger.notifyChannel('init', netsvc.LOG_WARNING, 'module %s: not installable' % (module)) continue #raise osv.osv.except_osv('Error!',"Module '%s' was not found" % (module,)) if os.path.isfile(terp_file) or zipfile.is_zipfile(mod_path+'.zip'): try: info = eval(tools.file_open(terp_file).read()) except: logger.notifyChannel('init', netsvc.LOG_ERROR, 'module %s: eval file %s' % (module, terp_file)) raise if info.get('installable', True): packages.append((module, info.get('depends', []), info)) dependencies = dict([(p, deps) for p, deps, data in packages]) current, later = set([p for p, dep, data in packages]), set() while packages and current > later: package, deps, data = packages[0] # if all dependencies of 'package' are already in the graph, add 'package' in the graph if reduce(lambda x, y: x and y in graph, deps, True): if not package in current: packages.pop(0) continue later.clear() current.remove(package) graph.addNode(package, deps) node = Node(package, graph) node.data = data for kind in ('init', 'demo', 'update'): if package in tools.config[kind] or 'all' in tools.config[kind] or kind in force: setattr(node, kind, True) else: later.add(package) packages.append((package, deps, data)) packages.pop(0) graph.update_from_db(cr) for package in later: unmet_deps = filter(lambda p: p not in graph, dependencies[package]) logger.notifyChannel('init', netsvc.LOG_ERROR, 'module %s: Unmet dependencies: %s' % (package, ', '.join(unmet_deps))) result = len(graph) - len_graph if result != len(module_list): logger.notifyChannel('init', netsvc.LOG_WARNING, 'Not all modules have loaded.') return result | 75d569cc6c5ed18f920052415c23e7b838e3b6a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/75d569cc6c5ed18f920052415c23e7b838e3b6a4/__init__.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.