rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
def attendance_action_change(self, cr, uid, ids, type='action', context={}, dt=False, *args): id = False warning_sign = 'sign' if type == 'sign_in': warning_sign = "Sign In" elif type == 'sign_out': warning_sign = "Sign Out" for emp in self.read(cr, uid, ids, ['id'], context=context): if not self._action_check(cr, ui...
f1918969ee73de516c55b6894138ddae2fb76ce8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f1918969ee73de516c55b6894138ddae2fb76ce8/hr_attendance.py
default.update({'name': group_name +' (copy)'})
default.update({'name': _('%s (copy)')%group_name})
def copy(self, cr, uid, id, default=None, context={}): group_name = self.read(cr, uid, [id], ['name'])[0]['name'] default.update({'name': group_name +' (copy)'}) return super(groups, self).copy(cr, uid, id, default, context)
4d406ba4748c4d84f2261f081595271ee065f7c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4d406ba4748c4d84f2261f081595271ee065f7c3/res_user.py
def copy(self, cr, uid, id, default={}, context={}, done_list=[], local=False): group = self.browse(cr, uid, id, context=context) default = default.copy() if not 'name' in default: default['name'] = group['name'] default['name'] = default['name'] + _(' (copy)') return super(groups, self).copy(cr, uid, id, default, con...
def create(self, cr, uid, vals, context=None): if 'name' in vals: if vals['name'].startswith('-'): raise osv.except_osv(_('Error'), _('The name of the group can not start with "-"')) gid = super(groups, self).create(cr, uid, vals, context=context) if context and context.get('noadmin', False): pass else: # assign this n...
4d406ba4748c4d84f2261f081595271ee065f7c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4d406ba4748c4d84f2261f081595271ee065f7c3/res_user.py
"use the standard `logging.getLogger` API instead")
"use the standard `logging.getLogger` API instead", PendingDeprecationWarning, stacklevel=2)
def __init__(self): warnings.warn("The netsvc.Logger API shouldn't be used anymore, please " "use the standard `logging.getLogger` API instead") super(Logger, self).__init__()
9150c0695ffbf7f76809f2811c27aaeb7177e087 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9150c0695ffbf7f76809f2811c27aaeb7177e087/netsvc.py
"the standard `logging` module instead")
"the standard `logging` module instead", PendingDeprecationWarning, stacklevel=2)
def notifyChannel(self, name, level, msg): warnings.warn("notifyChannel API shouldn't be used anymore, please use " "the standard `logging` module instead") from service.web_services import common
9150c0695ffbf7f76809f2811c27aaeb7177e087 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9150c0695ffbf7f76809f2811c27aaeb7177e087/netsvc.py
def onchange_uos_quantity(self, cr, uid, ids, product_id, product_uos_qty, product_uos, product_uom): """ On change of product quantity finds UoM and UoS quantities @param product_id: Product id @param product_uos_qty: Changed UoS Quantity of product @param product_uom: Unit of measure of product @param product_uos: Un...
16f6a1eebc8fbc9a60923408704bdf6fe22f8217 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/16f6a1eebc8fbc9a60923408704bdf6fe22f8217/stock.py
def action_done(self, cr, uid, ids, context=None): """ Finished the inventory @return: True """
16f6a1eebc8fbc9a60923408704bdf6fe22f8217 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/16f6a1eebc8fbc9a60923408704bdf6fe22f8217/stock.py
product_context.update(uom=line.product_uom.id)
product_context.update(uom=line.product_uom.id,date=inv.date)
def action_confirm(self, cr, uid, ids, context=None): """ Confirm the inventory and writes its finished date @return: True """ if context is None: context = {} # to perform the correct inventory corrections we need analyze stock location by # location, never recursively, so we use a special context product_context = di...
16f6a1eebc8fbc9a60923408704bdf6fe22f8217 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/16f6a1eebc8fbc9a60923408704bdf6fe22f8217/stock.py
'date': inv.date,
def action_confirm(self, cr, uid, ids, context=None): """ Confirm the inventory and writes its finished date @return: True """ if context is None: context = {} # to perform the correct inventory corrections we need analyze stock location by # location, never recursively, so we use a special context product_context = di...
16f6a1eebc8fbc9a60923408704bdf6fe22f8217 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/16f6a1eebc8fbc9a60923408704bdf6fe22f8217/stock.py
def on_change_product_id(self, cr, uid, ids, location_id, product, uom=False):
def on_change_product_id(self, cr, uid, ids, location_id, product, uom=False, to_date=False):
def on_change_product_id(self, cr, uid, ids, location_id, product, uom=False): """ Changes UoM and name if product_id changes. @param location_id: Location id @param product: Changed product_id @param uom: UoM product @return: Dictionary of changed values """ if not product: return {} if not uom: prod = self.pool.get(...
16f6a1eebc8fbc9a60923408704bdf6fe22f8217 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/16f6a1eebc8fbc9a60923408704bdf6fe22f8217/stock.py
amount = self.pool.get('stock.location')._product_get(cr, uid, location_id, [product], {'uom': uom})[product]
amount = self.pool.get('stock.location')._product_get(cr, uid, location_id, [product], {'uom': uom, 'to_date': to_date})[product]
def on_change_product_id(self, cr, uid, ids, location_id, product, uom=False): """ Changes UoM and name if product_id changes. @param location_id: Location id @param product: Changed product_id @param uom: UoM product @return: Dictionary of changed values """ if not product: return {} if not uom: prod = self.pool.get(...
16f6a1eebc8fbc9a60923408704bdf6fe22f8217 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/16f6a1eebc8fbc9a60923408704bdf6fe22f8217/stock.py
params = right[:]
params = right and right[:] or []
def __leaf_to_sql(self, leaf, table): if leaf == self.__DUMMY_LEAF: return ('(1=1)', []) left, operator, right = leaf
91a867f9de43c5124315d75dfcc201df991cc307 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/91a867f9de43c5124315d75dfcc201df991cc307/expression.py
def __leaf_to_sql(self, leaf, table): if leaf == self.__DUMMY_LEAF: return ('(1=1)', []) left, operator, right = leaf
91a867f9de43c5124315d75dfcc201df991cc307 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/91a867f9de43c5124315d75dfcc201df991cc307/expression.py
else: if operator == 'in': query = '(%s.%s IS NULL)' % (table._table, left) else: query = '(%s.%s IS NOT NULL)' % (table._table, left)
def __leaf_to_sql(self, leaf, table): if leaf == self.__DUMMY_LEAF: return ('(1=1)', []) left, operator, right = leaf
91a867f9de43c5124315d75dfcc201df991cc307 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/91a867f9de43c5124315d75dfcc201df991cc307/expression.py
query = obj+".state <> 'draft' AND "+obj+".period_id IN (SELECT id FROM account_period WHERE fiscalyear_id IN (%s) OR id IN (%s)) %s %s" % (fiscalyear_clause, periods, where_move_state, where_move_lines_by_date)
query = obj+".state <> 'draft' AND "+obj+".period_id IN (SELECT id FROM account_period WHERE fiscalyear_id IN (%s) AND id IN (%s)) %s %s" % (fiscalyear_clause, periods, where_move_state, where_move_lines_by_date)
def _query_get(self, cr, uid, obj='l', context=None): fiscalyear_obj = self.pool.get('account.fiscalyear') fiscalperiod_obj = self.pool.get('account.period') account_obj = self.pool.get('account.account') fiscalyear_ids = [] if context is None: context = {} initial_bal = context.get('initial_bal', False) company_clause...
55ef479cf0b40fbf6bb0aec9660af00df2104a24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/55ef479cf0b40fbf6bb0aec9660af00df2104a24/account_move_line.py
elif (txt is not None) and (txt is not False):
elif txt and (txt is not None) and (txt is not False):
def _process_text(self, txt): if not self.localcontext: return str2xml(txt) if not txt: return '' result = '' sps = _regex.split(txt) while sps: # This is a simple text to translate to_translate = tools.ustr(sps.pop(0)) result += tools.ustr(self.localcontext.get('translate', lambda x:x)(to_translate)) if sps: try: txt ...
cfad3fdbb9d13b9a605f09d2ab6dbf7be5c77130 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cfad3fdbb9d13b9a605f09d2ab6dbf7be5c77130/utils.py
'inventory_line_id': fields.one2many('stock.inventory.line', 'inventory_id', 'Inventories', readonly=True, states={'draft': [('readonly', False)]}),
'inventory_line_id': fields.one2many('stock.inventory.line', 'inventory_id', 'Inventories', states={'draft': [('readonly', False)]}),
def unlink(self, cr, uid, ids, context=None): for move in self.browse(cr, uid, ids, context=context): if move.state != 'draft': raise osv.except_osv(_('UserError'), _('You can only delete draft moves.')) return super(stock_move, self).unlink( cr, uid, ids, context=context)
861b74a08121eb833cfa23b3981c24fc2d3d81da /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/861b74a08121eb833cfa23b3981c24fc2d3d81da/stock.py
dict = self.style_properties_dict[(s.getAttribute("style:name")).encode("latin-1")] or {}
dict = self.style_properties_dict[(s.getAttribute("style:name")).encode("utf-8")] or {}
def normalizeStyleProperties(self): """Transfer all style:style-properties attributes from the self.style_properties_hierarchical dict to the automatic-styles from content.xml. Use this function to preprocess content.xml for XSLT transformations etc.Do not try to implement this function with XSlT - believe me, it's a t...
c4851f039c96e0215fde839e16d5b5e0400a1ab4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c4851f039c96e0215fde839e16d5b5e0400a1ab4/tiny_sxw2rml.py
name = s.getAttribute("style:name").encode("latin-1")
name = s.getAttribute("style:name").encode("utf-8")
def buildStyleDict(self): """Store all style:style-nodes from content.xml and styles.xml in self.style_dict. Caution: in this dict the nodes from two dom apis are merged!""" for st in (self.styles_dom,self.content_dom): for s in st.getElementsByTagName("style:style"): name = s.getAttribute("style:name").encode("latin-1...
c4851f039c96e0215fde839e16d5b5e0400a1ab4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c4851f039c96e0215fde839e16d5b5e0400a1ab4/tiny_sxw2rml.py
parent = self.style_dict[style_name].getAttribute("style:parent-style-name").encode("latin-1")
parent = self.style_dict[style_name].getAttribute("style:parent-style-name").encode("utf-8")
def getStylePropertiesDict(self,style_name): res = {}
c4851f039c96e0215fde839e16d5b5e0400a1ab4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c4851f039c96e0215fde839e16d5b5e0400a1ab4/tiny_sxw2rml.py
res[attr] = c.getAttribute(attr).encode("latin-1")
res[attr] = c.getAttribute(attr).encode("utf-8")
def getStylePropertiesDict(self,style_name): res = {}
c4851f039c96e0215fde839e16d5b5e0400a1ab4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c4851f039c96e0215fde839e16d5b5e0400a1ab4/tiny_sxw2rml.py
domain=[('type','=','cr')], context={'default_type':'cr'}),
domain=[('type','=','cr')], context={'default_type':'cr'}, readonly=True, states={'draft':[('readonly',False)]}),
def _get_currency(self, cr, uid, context): user = self.pool.get('res.users').browse(cr, uid, uid) if user.company_id: return user.company_id.currency_id.id return False
a408fd8234d1e27254be9b5bfdd2483b7ff7f77e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a408fd8234d1e27254be9b5bfdd2483b7ff7f77e/voucher.py
domain=[('type','=','dr')], context={'default_type':'dr'}),
domain=[('type','=','dr')], context={'default_type':'dr'}, readonly=True, states={'draft':[('readonly',False)]}),
def _get_currency(self, cr, uid, context): user = self.pool.get('res.users').browse(cr, uid, uid) if user.company_id: return user.company_id.currency_id.id return False
a408fd8234d1e27254be9b5bfdd2483b7ff7f77e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a408fd8234d1e27254be9b5bfdd2483b7ff7f77e/voucher.py
['invoice', 'delivery', 'contact'])
['default', 'invoice', 'delivery', 'contact'])
def makeOrder(self, cr, uid, ids, context=None): """ This function create Quotation on given case. @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of crm make sale' ids @param context: A standard dictionary fo...
2f9a1347ccab3c9e044adcafb2ebf4c60218100d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2f9a1347ccab3c9e044adcafb2ebf4c60218100d/crm_make_sale.py
'close': 1
def _get_shop_id(self, cr, uid, ids, context=None): if context is None: context = {} cmpny_id = self.pool.get('res.users')._get_company(cr, uid, context=context) shop = self.pool.get('sale.shop').search(cr, uid, [('company_id', '=', cmpny_id)]) return shop and shop[0] or False
2f9a1347ccab3c9e044adcafb2ebf4c60218100d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2f9a1347ccab3c9e044adcafb2ebf4c60218100d/crm_make_sale.py
if workitem_ids: self.process(cr, uid, workitem_ids, context)
if workitem_ids: self.process(cr, uid, workitem_ids, context)
def process_all(self, cr, uid, camp_ids=None, context={}): camp_obj = self.pool.get('marketing.campaign') if not camp_ids: camp_ids = camp_obj.search(cr, uid, [('state','=','running')], context=context) for camp in camp_obj.browse(cr, uid, camp_ids, context=context): if camp.mode in ('test_realtime','active'): workitem...
4d4484ca391be360b65388c3d343e84aaa937b09 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4d4484ca391be360b65388c3d343e84aaa937b09/marketing_campaign.py
if not context:
if context is None:
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s with or without domain
22f85f783ada9dd1ece26f6cd1afb4ab08534b93 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/22f85f783ada9dd1ece26f6cd1afb4ab08534b93/orm.py
if ids: cr.execute('select number_of_days_temp from hr_holidays where id in ('+','.join(map(str, ids))+')') res = cr.fetchall() if res and res[0][0] < 0:
for rec in self.read(cr, uid, ids, ['number_of_days','date_from','date_to']): if rec['number_of_days'] < 0:
def _check_date(self, cr, uid, ids): if ids: cr.execute('select number_of_days_temp from hr_holidays where id in ('+','.join(map(str, ids))+')') res = cr.fetchall() if res and res[0][0] < 0: return False return True
f495432c7f7629ebc36337557faa7b5fb9ccc964 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f495432c7f7629ebc36337557faa7b5fb9ccc964/hr_holidays.py
return True _constraints = [(_check_date, 'Start date should not be larger than end date! ', ['number_of_days'])]
date_from = time.strptime(rec['date_from'], '%Y-%m-%d %H:%M:%S') date_to = time.strptime(rec['date_to'], '%Y-%m-%d %H:%M:%S') if date_from > date_to: return False return True _constraints = [(_check_date, 'Start date should not be larger than end date!\nNumber of Days should be greater than 1!', ['number_of_days'])]
def _check_date(self, cr, uid, ids): if ids: cr.execute('select number_of_days_temp from hr_holidays where id in ('+','.join(map(str, ids))+')') res = cr.fetchall() if res and res[0][0] < 0: return False return True
f495432c7f7629ebc36337557faa7b5fb9ccc964 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f495432c7f7629ebc36337557faa7b5fb9ccc964/hr_holidays.py
total_amount = 0.0 if inv.tax_amount: total_amount = inv.amount + inv.tax_amount
total_amount = inv.amount
def action_move_line_create(self, cr, uid, ids, *args): journal_pool = self.pool.get('account.journal') sequence_pool = self.pool.get('ir.sequence') move_pool = self.pool.get('account.move') move_line_pool = self.pool.get('account.move.line') analytic_pool = self.pool.get('account.analytic.line') currency_pool = self....
d4ff1f58bea753671b299017e5489a9b9d3a8c71 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d4ff1f58bea753671b299017e5489a9b9d3a8c71/voucher.py
res[r[1]].append(r[0])
if r[0] not in res[r[1]]: res[r[1]].append(r[0])
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): if not context: context = {} if not values: values = {} res = {} if not ids: return res for id in ids: res[id] = [] if offset: warnings.warn("Specifying offset at a many2many.get() may produce unpredictable results.", DeprecationWarning,...
6decbe75377c19f8552784ecad59ef24a64aebc5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6decbe75377c19f8552784ecad59ef24a64aebc5/fields.py
fields_def = self.__view_look_dom(cr, user, node, view_id, context=context)
26bb219a74ca586de0f935e544991a9202da311f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/26bb219a74ca586de0f935e544991a9202da311f/orm.py
msg += "\n\nEither you wrongly customised this view, or some modules bringing those views are not compatible with your current data model"
msg += "\n\nEither you wrongly customized this view, or some modules bringing those views are not compatible with your current data model"
fields_def = self.__view_look_dom(cr, user, node, view_id, context=context)
26bb219a74ca586de0f935e544991a9202da311f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/26bb219a74ca586de0f935e544991a9202da311f/orm.py
result += self.localcontext.get('translate', lambda x:x)(sps.pop(0))
result += tools.ustr(self.localcontext.get('translate', lambda x:x)(sps.pop(0)))
def _process_text(self, txt): if not self.localcontext: return str2xml(txt) if not txt: return '' result = '' sps = _regex.split(txt) while sps: # This is a simple text to translate result += self.localcontext.get('translate', lambda x:x)(sps.pop(0)) if sps: try: expr = sps.pop(0) txt = eval(expr,self.localcontext) if ...
d961fd76daac5c66b843b0c4327a5822b5b16e46 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d961fd76daac5c66b843b0c4327a5822b5b16e46/utils.py
txt = self.localcontext.get('translate', lambda x:x)(txt)
txt = tools.ustr(self.localcontext.get('translate', lambda x:x)(txt))
def _process_text(self, txt): if not self.localcontext: return str2xml(txt) if not txt: return '' result = '' sps = _regex.split(txt) while sps: # This is a simple text to translate result += self.localcontext.get('translate', lambda x:x)(sps.pop(0)) if sps: try: expr = sps.pop(0) txt = eval(expr,self.localcontext) if ...
d961fd76daac5c66b843b0c4327a5822b5b16e46 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d961fd76daac5c66b843b0c4327a5822b5b16e46/utils.py
result1 = tools.ustr(txt2) result = result + str(result1)
result += tools.ustr(txt2)
def _process_text(self, txt): if not self.localcontext: return str2xml(txt) if not txt: return '' result = '' sps = _regex.split(txt) while sps: # This is a simple text to translate result += self.localcontext.get('translate', lambda x:x)(sps.pop(0)) if sps: try: expr = sps.pop(0) txt = eval(expr,self.localcontext) if ...
d961fd76daac5c66b843b0c4327a5822b5b16e46 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d961fd76daac5c66b843b0c4327a5822b5b16e46/utils.py
result += str(txt)
result += tools.ustr(txt)
def _process_text(self, txt): if not self.localcontext: return str2xml(txt) if not txt: return '' result = '' sps = _regex.split(txt) while sps: # This is a simple text to translate result += self.localcontext.get('translate', lambda x:x)(sps.pop(0)) if sps: try: expr = sps.pop(0) txt = eval(expr,self.localcontext) if ...
d961fd76daac5c66b843b0c4327a5822b5b16e46 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d961fd76daac5c66b843b0c4327a5822b5b16e46/utils.py
'sum_debit': self._sum_debit, 'sum_credit': self._sum_credit,
def __init__(self, cr, uid, name, context=None): super(third_party_ledger, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'lines': self.lines, 'sum_debit_partner': self._sum_debit_partner, 'sum_credit_partner': self._sum_credit_partner, 'sum_debit': self._sum_debit, 'sum_credit'...
33fa22f0ff5d3dc5bab99620831a2c268a91835f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/33fa22f0ff5d3dc5bab99620831a2c268a91835f/account_partner_ledger.py
return result_tmp
return result_tmp + result_init
def _sum_debit_partner(self, partner): move_state = ['draft','posted'] if self.target_move == 'posted': move_state = ['posted']
33fa22f0ff5d3dc5bab99620831a2c268a91835f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/33fa22f0ff5d3dc5bab99620831a2c268a91835f/account_partner_ledger.py
return result_tmp def _sum_debit(self): move_state = ['draft','posted'] if self.target_move == 'posted': move_state = ['posted'] if not self.ids: return 0.0 result_tmp = 0.0 result_init = 0.0 if self.reconcil : RECONCILE_TAG = " " else: RECONCILE_TAG = "AND reconcile_id IS NULL" if self.initial_balance: self.cr.execu...
def _sum_credit_partner(self, partner): move_state = ['draft','posted'] if self.target_move == 'posted': move_state = ['posted']
33fa22f0ff5d3dc5bab99620831a2c268a91835f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/33fa22f0ff5d3dc5bab99620831a2c268a91835f/account_partner_ledger.py
def _sum_credit(self): move_state = ['draft','posted'] if self.target_move == 'posted': move_state = ['posted'] if not self.ids: return 0.0 result_tmp = 0.0 result_init = 0.0 if self.reconcil : RECONCILE_TAG = " " else: RECONCILE_TAG = "AND reconcile_id IS NULL" if self.initial_balance: self.cr.execute( "SELECT sum(cr...
def _sum_credit(self): move_state = ['draft','posted'] if self.target_move == 'posted': move_state = ['posted']
33fa22f0ff5d3dc5bab99620831a2c268a91835f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/33fa22f0ff5d3dc5bab99620831a2c268a91835f/account_partner_ledger.py
reference = obj_inv.reference or ''
reference = obj_inv.reference or number or ''
def action_number(self, cr, uid, ids, *args): #TODO: not correct fix but required a frech values before reading it. self.write(cr, uid, ids, {})
f603f8e3635ca7bce6b4ab02bd7dfd8003912512 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f603f8e3635ca7bce6b4ab02bd7dfd8003912512/invoice.py
'title': _('Bad Lot Assignation !'),
'title': _('Insufficient Stock in Lot !'),
def onchange_lot_id(self, cr, uid, ids, prodlot_id=False, product_qty=False, loc_id=False, product_id=False, context=None): """ On change of production lot gives a warning message. @param prodlot_id: Changed production lot id @param product_qty: Quantity of product @param loc_id: Location id @param product_id: Product ...
1b74ce256736079146d2340019c95af0bd276610 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1b74ce256736079146d2340019c95af0bd276610/stock.py
if node.text:
if node.text or node.tail:
def preprocess_rml(self, root_node,type='pdf'): _regex1 = re.compile("\[\[(.*?)(repeatIn\(.*?\s*,\s*[\'\"].*?[\'\"]\s*(?:,\s*(.*?)\s*)?\s*\))(.*?)\]\]") _regex11= re.compile("\[\[(.*?)(repeatIn\(.*?\s*\(.*?\s*[\'\"].*?[\'\"]\s*\),[\'\"].*?[\'\"](?:,\s*(.*?)\s*)?\s*\))(.*?)\]\]") _regex2 = re.compile("\[\[(.*?)(removePa...
94b0ad26df4e0c4a067b89cdc4a481be12a22bf0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/94b0ad26df4e0c4a067b89cdc4a481be12a22bf0/preprocess.py
t = _regex1.sub(_sub1, node.text)
t = _regex1.sub(_sub1, node.text or node.tail)
def _sub1(txt): if len(txt.group(4)) > 1: return " " match = rml_parents if type == 'odt': match = odt_parents if type == 'sxw': match = sxw_parents if type =='html2html': match = html_parents if txt.group(3): match = [txt.group(3)] n = node while n.tag not in match: n = n.getparent() n.set('rml_loop', txt.group(2)) re...
94b0ad26df4e0c4a067b89cdc4a481be12a22bf0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/94b0ad26df4e0c4a067b89cdc4a481be12a22bf0/preprocess.py
t = _regex11.sub(_sub1, node.text)
t = _regex11.sub(_sub1, node.text or node.tail)
def _sub1(txt): if len(txt.group(4)) > 1: return " " match = rml_parents if type == 'odt': match = odt_parents if type == 'sxw': match = sxw_parents if type =='html2html': match = html_parents if txt.group(3): match = [txt.group(3)] n = node while n.tag not in match: n = n.getparent() n.set('rml_loop', txt.group(2)) re...
94b0ad26df4e0c4a067b89cdc4a481be12a22bf0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/94b0ad26df4e0c4a067b89cdc4a481be12a22bf0/preprocess.py
if (pick.type == 'in'):
if (pick.type == 'in') and 'purchase_id' in pick._columns.keys():
def default_get(self, cr, uid, fields, context=None): """ To get default values for the object. @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param fields: List of fields for which we want default values @param context: A standard dictionary @return: A dic...
fd0169cb95c512eff4ab18880d48e02587110c12 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fd0169cb95c512eff4ab18880d48e02587110c12/stock_partial_picking.py
if (pick.type == 'out'):
if (pick.type == 'out') and 'sale_id' in pick._columns.keys():
def default_get(self, cr, uid, fields, context=None): """ To get default values for the object. @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param fields: List of fields for which we want default values @param context: A standard dictionary @return: A dic...
fd0169cb95c512eff4ab18880d48e02587110c12 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fd0169cb95c512eff4ab18880d48e02587110c12/stock_partial_picking.py
ids = self.search(cr, user, [('code', operator, name.split()[0]), ('name', operator, name.split()[1])]+ args, limit=limit)
operand1,operand2 = name.split(' ',1) ids = self.search(cr, user, [('code', operator, operand1), ('name', operator, operand2)]+ args, limit=limit)
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100): if not args: args = [] if not context: context = {} args = args[:] ids = [] try: if name and str(name).startswith('partner:'): part_id = int(name.split(':')[1]) part = self.pool.get('res.partner').browse(cr, user, part_id, cont...
f2e519b591a57fc1d4d61e80c145b10fafc00100 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f2e519b591a57fc1d4d61e80c145b10fafc00100/account.py
email_text = MIMEText(mail_body, _subtype=subtype, _charset='utf-8')
email_text = MIMEText(email_body, _subtype=subtype, _charset='utf-8')
def email_send(email_from, email_to, subject, body, email_cc=None, email_bcc=None, reply_to=False, attach=None, openobject_id=False, ssl=False, debug=False, subtype='plain', x_headers=None, priority='3'): """Send an email.""" import smtplib from email.MIMEText import MIMEText from email.MIMEBase import MIMEBase from e...
2dd21b183e956dcfb1b5755986500c1cadc30409 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2dd21b183e956dcfb1b5755986500c1cadc30409/misc.py
def _makeOrder(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) case_obj = pool.get('crm.case') sale_obj = pool.get('sale.order') partner_obj = pool.get('res.partner') sale_line_obj = pool.get('sale.order.line')
98c0c350443f94f2e610594c870cff2cdd5e73cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/98c0c350443f94f2e610594c870cff2cdd5e73cf/makesale.py
'fiscal_position': fpos
'fiscal_position': fpos,
def _makeOrder(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) case_obj = pool.get('crm.case') sale_obj = pool.get('sale.order') partner_obj = pool.get('res.partner') sale_line_obj = pool.get('sale.order.line')
98c0c350443f94f2e610594c870cff2cdd5e73cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/98c0c350443f94f2e610594c870cff2cdd5e73cf/makesale.py
if journal.currency: result = {'value': { 'currency_id': journal.currency.id
currency_id = journal.currency and journal.currency.id or journal.company_id.currency_id.id result = {'value': { 'currency_id': currency_id,
def onchange_journal_id(self, cr, uid, ids, journal_id): if journal_id: journal = self.pool.get('account.journal').browse(cr, uid, journal_id) if journal.currency: result = {'value': { 'currency_id': journal.currency.id } } return result user_company = self.pool.get('res.users').browse(cr, uid, [uid])[0].company_id res...
5b7264282b8ab93d6d0119460684a550cd1f2d69 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5b7264282b8ab93d6d0119460684a550cd1f2d69/invoice.py
return result user_company = self.pool.get('res.users').browse(cr, uid, [uid])[0].company_id result = {'value': { 'currency_id': user_company.currency_id.id } }
def onchange_journal_id(self, cr, uid, ids, journal_id): if journal_id: journal = self.pool.get('account.journal').browse(cr, uid, journal_id) if journal.currency: result = {'value': { 'currency_id': journal.currency.id } } return result user_company = self.pool.get('res.users').browse(cr, uid, [uid])[0].company_id res...
5b7264282b8ab93d6d0119460684a550cd1f2d69 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5b7264282b8ab93d6d0119460684a550cd1f2d69/invoice.py
def name_search(self, cr, user, name, args=None, operator='ilike', context={}, limit=100):
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
def name_search(self, cr, user, name, args=None, operator='ilike', context={}, limit=100): if not args: args = [] ids = [] if context.get('journal_type', False): args += [('type','=',context.get('journal_type'))]
3b9c2c2e6d57123ec1157d7ace285096460e138f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3b9c2c2e6d57123ec1157d7ace285096460e138f/account.py
def name_search(self, cr, user, name, args=None, operator='ilike', context={}, limit=100): if not args: args = [] ids = [] if context.get('journal_type', False): args += [('type','=',context.get('journal_type'))]
3b9c2c2e6d57123ec1157d7ace285096460e138f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3b9c2c2e6d57123ec1157d7ace285096460e138f/account.py
ids = self.search(cr, user, [('name', operator, name)]+ args, limit=limit, context=context)
ids = self.search(cr, user, [('name', 'ilike', name)]+ args, limit=limit, context=context)
def name_search(self, cr, user, name, args=None, operator='ilike', context={}, limit=100): if not args: args = [] ids = [] if context.get('journal_type', False): args += [('type','=',context.get('journal_type'))]
3b9c2c2e6d57123ec1157d7ace285096460e138f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3b9c2c2e6d57123ec1157d7ace285096460e138f/account.py
except KeyError, e:
except KeyError:
def _get_views(self, cr, uid, ids, field_name=None, arg=None, context={}): res = {} model_data_obj = self.pool.get('ir.model.data') view_obj = self.pool.get('ir.ui.view') report_obj = self.pool.get('ir.actions.report.xml') menu_obj = self.pool.get('ir.ui.menu') mlist = self.browse(cr, uid, ids, context=context) mnames ...
9d8bbcbb602f7f3461be85a118eb79eb8c061018 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9d8bbcbb602f7f3461be85a118eb79eb8c061018/module.py
except Exception, e:
except Exception:
def download(self, cr, uid, ids, download=True, context=None): res = [] for mod in self.browse(cr, uid, ids, context=context): if not mod.url: continue match = re.search('-([a-zA-Z0-9\._-]+)(\.zip)', mod.url, re.I) version = '0' if match: version = match.group(1) if parse_version(mod.installed_version or '0') >= parse_...
9d8bbcbb602f7f3461be85a118eb79eb8c061018 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9d8bbcbb602f7f3461be85a118eb79eb8c061018/module.py
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, orderby=False, context=None):
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False):
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, orderby=False, context=None): raise NotImplementedError(_('The read_group method is not implemented on this object !'))
62e83fd5a0172eea46483dc64bca371b215a864b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/62e83fd5a0172eea46483dc64bca371b215a864b/orm.py
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, orderby=False, context=None):
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False):
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, orderby=False, context=None): """ Get the list of records in list view grouped by the given ``groupby`` fields
62e83fd5a0172eea46483dc64bca371b215a864b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/62e83fd5a0172eea46483dc64bca371b215a864b/orm.py
import libxslt import libxml2
from lxml import etree from StringIO import StringIO
def sxw2rml(sxw_file, xsl, output='.', save_pict=False): import libxslt import libxml2 tool = PyOpenOffice(output, save_pict = save_pict) res = tool.unpackNormalize(sxw_file) styledoc = libxml2.parseDoc(xsl) style = libxslt.parseStylesheetDoc(styledoc) doc = libxml2.parseMemory(res,len(res)) result = style.applyStylesh...
60936534d1975b3943355ef76194a640d430bd6a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/60936534d1975b3943355ef76194a640d430bd6a/tiny_sxw2rml.py
styledoc = libxml2.parseDoc(xsl) style = libxslt.parseStylesheetDoc(styledoc) doc = libxml2.parseMemory(res,len(res)) result = style.applyStylesheet(doc, None) root = result.xpathEval("/document/stylesheet")
f = StringIO(xsl) styledoc = etree.parse(f) style = etree.XSLT(styledoc) f = StringIO(res) doc = etree.parse(f) result = style(doc) root = etree.XPathEvaluator(result)("/document/stylesheet")
def sxw2rml(sxw_file, xsl, output='.', save_pict=False): import libxslt import libxml2 tool = PyOpenOffice(output, save_pict = save_pict) res = tool.unpackNormalize(sxw_file) styledoc = libxml2.parseDoc(xsl) style = libxslt.parseStylesheetDoc(styledoc) doc = libxml2.parseMemory(res,len(res)) result = style.applyStylesh...
60936534d1975b3943355ef76194a640d430bd6a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/60936534d1975b3943355ef76194a640d430bd6a/tiny_sxw2rml.py
images = libxml2.newNode("images")
images = etree.Element("images")
def sxw2rml(sxw_file, xsl, output='.', save_pict=False): import libxslt import libxml2 tool = PyOpenOffice(output, save_pict = save_pict) res = tool.unpackNormalize(sxw_file) styledoc = libxml2.parseDoc(xsl) style = libxslt.parseStylesheetDoc(styledoc) doc = libxml2.parseMemory(res,len(res)) result = style.applyStylesh...
60936534d1975b3943355ef76194a640d430bd6a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/60936534d1975b3943355ef76194a640d430bd6a/tiny_sxw2rml.py
node = libxml2.newNode('image') node.setProp('name', img) node.setContent( base64.encodestring(tool.images[img])) images.addChild(node) root.addNextSibling(images)
node = etree.Element('image', name=img) node.text = base64.encodestring(tool.images[img]) images.append(node) root.append(images)
def sxw2rml(sxw_file, xsl, output='.', save_pict=False): import libxslt import libxml2 tool = PyOpenOffice(output, save_pict = save_pict) res = tool.unpackNormalize(sxw_file) styledoc = libxml2.parseDoc(xsl) style = libxslt.parseStylesheetDoc(styledoc) doc = libxml2.parseMemory(res,len(res)) result = style.applyStylesh...
60936534d1975b3943355ef76194a640d430bd6a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/60936534d1975b3943355ef76194a640d430bd6a/tiny_sxw2rml.py
xml = style.saveResultToString(result)
xml = str(result)
def sxw2rml(sxw_file, xsl, output='.', save_pict=False): import libxslt import libxml2 tool = PyOpenOffice(output, save_pict = save_pict) res = tool.unpackNormalize(sxw_file) styledoc = libxml2.parseDoc(xsl) style = libxslt.parseStylesheetDoc(styledoc) doc = libxml2.parseMemory(res,len(res)) result = style.applyStylesh...
60936534d1975b3943355ef76194a640d430bd6a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/60936534d1975b3943355ef76194a640d430bd6a/tiny_sxw2rml.py
f = StringIO.StringIO(file(fname).read())
f = fname
def sxw2rml(sxw_file, xsl, output='.', save_pict=False): import libxslt import libxml2 tool = PyOpenOffice(output, save_pict = save_pict) res = tool.unpackNormalize(sxw_file) styledoc = libxml2.parseDoc(xsl) style = libxslt.parseStylesheetDoc(styledoc) doc = libxml2.parseMemory(res,len(res)) result = style.applyStylesh...
60936534d1975b3943355ef76194a640d430bd6a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/60936534d1975b3943355ef76194a640d430bd6a/tiny_sxw2rml.py
if quantity_rest <= 0:
if quantity_rest < 0:
def split(self, cr, uid, ids, move_ids, context=None): """ To split stock moves into production lot @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param ids: the ID or list of IDs if we want more than one @param move_ids: the ID or list of IDs of stock mov...
b5ed5d2ccad62da30eb92e76c8f43611dfc232fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b5ed5d2ccad62da30eb92e76c8f43611dfc232fd/stock_move.py
current_move = move_obj.copy(cr, uid, move.id, default_val) new_move.append(current_move)
if quantity_rest > 0: current_move = move_obj.copy(cr, uid, move.id, default_val) new_move.append(current_move) if quantity_rest == 0: current_move = move.id
def split(self, cr, uid, ids, move_ids, context=None): """ To split stock moves into production lot @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param ids: the ID or list of IDs if we want more than one @param move_ids: the ID or list of IDs of stock mov...
b5ed5d2ccad62da30eb92e76c8f43611dfc232fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b5ed5d2ccad62da30eb92e76c8f43611dfc232fd/stock_move.py
def get_module_from_path(path,mod_paths=None): if not mod_paths: def_path = os.path.abspath(os.path.join(tools.config['root_path'], 'addons')) ad_paths= map(lambda m: os.path.abspath(m.strip()),tools.config['addons_path'].split(',')) mod_paths=[def_path] for adp in ad_paths: mod_paths.append(adp) if not adp.startswith...
def get_module_from_path(path, mod_paths=None): path_dir = os.path.dirname(path[1:]) if path_dir: if os.path.exists(os.path.join(tools.config['addons_path'],path[1:])): return path.split(os.path.sep)[1] else: root_addons = os.path.join(tools.config['root_path'], 'addons') if os.path.exists(os.path.join(r...
def get_module_from_path(path,mod_paths=None): if not mod_paths: # First, construct a list of possible paths def_path = os.path.abspath(os.path.join(tools.config['root_path'], 'addons')) # default addons path (base) ad_paths= map(lambda m: os.path.abspath(m.strip()),tools.config['addons_path'].split(',')) mod_paths...
773238132b42fa48ac87322f3fbf430936006f44 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/773238132b42fa48ac87322f3fbf430936006f44/translate.py
def get_module_from_path(path,mod_paths=None): if not mod_paths: # First, construct a list of possible paths def_path = os.path.abspath(os.path.join(tools.config['root_path'], 'addons')) # default addons path (base) ad_paths= map(lambda m: os.path.abspath(m.strip()),tools.config['addons_path'].split(',')) mod_paths...
773238132b42fa48ac87322f3fbf430936006f44 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/773238132b42fa48ac87322f3fbf430936006f44/translate.py
if 'analytic_account_id' in vals and vals['analytic_account_id']:
if vals.get('analytic_account_id',False):
def create(self, cr, uid, vals, context=None, check=True): if not context: context={} account_obj = self.pool.get('account.account') tax_obj=self.pool.get('account.tax') if ('account_id' in vals) and not account_obj.read(cr, uid, vals['account_id'], ['active'])['active']: raise osv.except_osv(_('Bad account!'), _('You ...
0398d67493ad4d8dd4f6e0123963e9a32ff7574d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0398d67493ad4d8dd4f6e0123963e9a32ff7574d/account_move_line.py
'partner_id': fields.many2one('res.partner', 'Partner', select=1),
'partner_id': fields.many2one('res.partner', 'Partner', select=1, ondelete='restrict'),
def _get_move_lines(self, cr, uid, ids, context=None): result = [] for move in self.pool.get('account.move').browse(cr, uid, ids, context=context): for line in move.line_id: result.append(line.id) return result
488a43b7170f94011e2f438805b27b5cca29adcd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/488a43b7170f94011e2f438805b27b5cca29adcd/account_move_line.py
att_ids = []
def create_record(msg): if hasattr(model_pool, 'message_new'): res_id = model_pool.message_new(cr, uid, msg, context) else: data = { 'name': msg.get('subject'), 'email_from': msg.get('from'), 'email_cc': msg.get('cc'), 'user_id': False, 'description': msg.get('body'), 'state' : 'draft', } data.update(self.get_partner(c...
41a15f72a02613fc823e32c36f48444d555f1bb6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/41a15f72a02613fc823e32c36f48444d555f1bb6/mail_gateway.py
body = tools.html2plaintext(content)
body = tools.ustr(tools.html2plaintext(content))
def create_record(msg): if hasattr(model_pool, 'message_new'): res_id = model_pool.message_new(cr, uid, msg, context) else: data = { 'name': msg.get('subject'), 'email_from': msg.get('from'), 'email_cc': msg.get('cc'), 'user_id': False, 'description': msg.get('body'), 'state' : 'draft', } data.update(self.get_partner(c...
41a15f72a02613fc823e32c36f48444d555f1bb6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/41a15f72a02613fc823e32c36f48444d555f1bb6/mail_gateway.py
body = content
body = tools.ustr(content)
def create_record(msg): if hasattr(model_pool, 'message_new'): res_id = model_pool.message_new(cr, uid, msg, context) else: data = { 'name': msg.get('subject'), 'email_from': msg.get('from'), 'email_cc': msg.get('cc'), 'user_id': False, 'description': msg.get('body'), 'state' : 'draft', } data.update(self.get_partner(c...
41a15f72a02613fc823e32c36f48444d555f1bb6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/41a15f72a02613fc823e32c36f48444d555f1bb6/mail_gateway.py
res = tools.ustr(res)
res = tools.ustr(res, encoding)
def create_record(msg): if hasattr(model_pool, 'message_new'): res_id = model_pool.message_new(cr, uid, msg, context) else: data = { 'name': msg.get('subject'), 'email_from': msg.get('from'), 'email_cc': msg.get('cc'), 'user_id': False, 'description': msg.get('body'), 'state' : 'draft', } data.update(self.get_partner(c...
41a15f72a02613fc823e32c36f48444d555f1bb6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/41a15f72a02613fc823e32c36f48444d555f1bb6/mail_gateway.py
for line in self.browse(cr, uid, ids): if line.journal_id.internal_sequence: seq_no = obj_sequence.get_id(cr, uid, line.journal_id.internal_sequence.id, context=context)
for move in self.browse(cr, uid, ids, context): if move.journal_id.internal_sequence_id: seq_no = obj_sequence.get_id(cr, uid, move.journal_id.internal_sequence_id.id, context=context)
def post(self, cr, uid, ids, context=None): obj_sequence = self.pool.get('ir.sequence') res = super(account_move, self).post(cr, uid, ids, context=context) seq_no = False for line in self.browse(cr, uid, ids): if line.journal_id.internal_sequence: seq_no = obj_sequence.get_id(cr, uid, line.journal_id.internal_sequence....
18a03628af95800807077569e07780a7509f76d9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18a03628af95800807077569e07780a7509f76d9/account_sequence.py
self.write(cr, uid, [line.id], {'internal_sequence_number': seq_no})
self.write(cr, uid, [move.id], {'internal_sequence_number': seq_no})
def post(self, cr, uid, ids, context=None): obj_sequence = self.pool.get('ir.sequence') res = super(account_move, self).post(cr, uid, ids, context=context) seq_no = False for line in self.browse(cr, uid, ids): if line.journal_id.internal_sequence: seq_no = obj_sequence.get_id(cr, uid, line.journal_id.internal_sequence....
18a03628af95800807077569e07780a7509f76d9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18a03628af95800807077569e07780a7509f76d9/account_sequence.py
'References':"%s" % (message_id)
x_headers['References'] = "%s" % (message_id)
def action_send(self, cr, uid, ids, context=None): """ This sends an email to ALL the addresses of the selected partners. """
f6b5858e5c28f9c375a2beab229becadbdea2b68 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f6b5858e5c28f9c375a2beab229becadbdea2b68/crm_send_email.py
name = cls._name or parent_name
name = cls._name or parent_names
def createInstance(cls, pool, module, cr): parent_names = getattr(cls, '_inherit', None) if parent_names: if isinstance(parent_names, (str, unicode)): name = cls._name or parent_name parent_names = [parent_names] else: name = cls._name if not name: raise TypeError('_name is mandatory in case of multiple inheritance')
fad2b1bb64361c64321cd8f726f9ef8479372e00 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fad2b1bb64361c64321cd8f726f9ef8479372e00/osv.py
name = cls._name or parent_name
name = cls._name or parent_names
def createInstance(cls, pool, module, cr): parent_names = getattr(cls, '_inherit', None) if parent_names: if isinstance(parent_names, (str, unicode)): name = cls._name or parent_name parent_names = [parent_names] else: name = cls._name if not name: raise TypeError('_name is mandatory in case of multiple inheritance')
fad2b1bb64361c64321cd8f726f9ef8479372e00 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fad2b1bb64361c64321cd8f726f9ef8479372e00/osv.py
if type(value) == type(''): parse_format = DHM_FORMAT if (not date_time): return str(value)
def formatLang(self, value, digits=2, date=False,date_time=False, grouping=True, monetary=False): if isinstance(value, (str, unicode)) and not value: return '' if not self.lang_dict_called: self._get_lang_dict() self.lang_dict_called = True
e389b5d89333dc4e8320e307c2a01f186c8f6d0e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e389b5d89333dc4e8320e307c2a01f186c8f6d0e/report_sxw.py
res['value'].update({'purchase_price': purchase_price})
price = self.pool.get('res.currency').compute(cr, uid, frm_cur, to_cur, purchase_price, round=False) res['value'].update({'purchase_price': price})
def product_id_change(self, cr, uid, ids, pricelist, product, qty=0, uom=False, qty_uos=0, uos=False, name='', partner_id=False, lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False): res = super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty=...
f32adf267a672519e1fc6125fcf596e6e6c504d8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f32adf267a672519e1fc6125fcf596e6e6c504d8/sale_margin.py
raise
return (-1, res, 'Line ' + str(counter) +' : ' + str(e), '' )
fields_def = self.fields_get(cr, uid, context=context)
50747906e7de269d22c302b3114335dcddd65cca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/50747906e7de269d22c302b3114335dcddd65cca/orm.py
res[voucher.id] = abs(voucher.amount - abs(credit - debit))
res[voucher.id] = abs(voucher.amount - abs(credit - debit))
def _get_writeoff_amount(self, cr, uid, ids, name, args, context=None): if not ids: return {} res = {} debit = credit = 0.0 for voucher in self.browse(cr, uid, ids, context=context): for l in voucher.line_dr_ids: debit += l.amount for l in voucher.line_cr_ids: credit += l.amount res[voucher.id] = abs(voucher.amount - ...
87049df61d356f2a2fdc27857afde71632dfb74d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/87049df61d356f2a2fdc27857afde71632dfb74d/account_voucher.py
'company_id': fields.related('voucher_id','company_id', relation='res.company', string='Company', store=True),
'company_id': fields.related('voucher_id','company_id', relation='res.company', type='many2one', string='Company', store=True),
def _compute_balance(self, cr, uid, ids, name, args, context=None): currency_pool = self.pool.get('res.currency') rs_data = {} for line in self.browse(cr, uid, ids): res = {} company_currency = line.voucher_id.journal_id.company_id.currency_id.id voucher_currency = line.voucher_id.currency_id.id move_line = line.move_l...
87049df61d356f2a2fdc27857afde71632dfb74d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/87049df61d356f2a2fdc27857afde71632dfb74d/account_voucher.py
cr.execute('update "' + self._table + '" set ' + \ string.join(upd0, ',') + ' where id = %s', upd1)
if upd0 and upd1: cr.execute('update "' + self._table + '" set ' + \ string.join(upd0, ',') + ' where id = %s', upd1)
def _store_set_values(self, cr, uid, ids, fields, context): field_flag = False field_dict = {} if self._log_access: cr.execute('select id,write_date from '+self._table+' where id in ('+','.join(map(str, ids))+')') res = cr.fetchall() for r in res: if r[1]: field_dict.setdefault(r[0], []) res_date = time.strptime((r[1])...
ee854ffcf19de888170d8a9fc62b7664f8b82b3a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ee854ffcf19de888170d8a9fc62b7664f8b82b3a/orm.py
def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None): """ Consumed product with specific quatity from specific source location @param cr: the database cursor @param uid: the user id @param ids: ids of stock move object to be consumed @param quantity : specify consume quantity @param locatio...
bcdfc08fb79a3005f6a98430318d7bfcd41ad6fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bcdfc08fb79a3005f6a98430318d7bfcd41ad6fc/stock.py
def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None): """ Consumed product with specific quatity from specific source location @param cr: the database cursor @param uid: the user id @param ids: ids of stock move object to be consumed @param quantity : specify consume quantity @param locatio...
bcdfc08fb79a3005f6a98430318d7bfcd41ad6fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bcdfc08fb79a3005f6a98430318d7bfcd41ad6fc/stock.py
if move.product_id.track_production and location_id:
if (not move.prodlot_id.id) and (move.product_id.track_production and location_id):
def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None): """ Consumed product with specific quatity from specific source location @param cr: the database cursor @param uid: the user id @param ids: ids of stock move object to be consumed @param quantity : specify consume quantity @param locatio...
bcdfc08fb79a3005f6a98430318d7bfcd41ad6fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bcdfc08fb79a3005f6a98430318d7bfcd41ad6fc/stock.py
if move.product_id.track_production and location_id:
if (not move.prodlot_id.id) and (move.product_id.track_production and location_id):
def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None): """ Consumed product with specific quatity from specific source location @param cr: the database cursor @param uid: the user id @param ids: ids of stock move object to be consumed @param quantity : specify consume quantity @param locatio...
bcdfc08fb79a3005f6a98430318d7bfcd41ad6fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bcdfc08fb79a3005f6a98430318d7bfcd41ad6fc/stock.py
elif ext == '.yaml':
elif ext == '.yml':
def load_module_graph(cr, graph, status=None, perform_checks=True, **kwargs): # **kwargs is passed directly to convert_xml_import if not status: status = {} status = status.copy() package_todo = [] statusi = 0 pool = pooler.get_pool(cr.dbname) migrations = MigrationManager(cr, graph) has_updates = False modobj = Non...
52185a68e951a1e59525b20c7eff4d58a6111225 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/52185a68e951a1e59525b20c7eff4d58a6111225/__init__.py
case.user_id.address_id.email) or tools.config.get('email_from',False)})
case.user_id.address_id.email and \ "%s <%s>" % (case.user_id.name, case.user_id.address_id.email)) or \ tools.config.get('email_from',False)})
def default_get(self, cr, uid, fields, context=None): """ This function gets default values """ if not context: context = {}
170bc320cc2ff1a86628679cd4a7c8ce38b047c4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/170bc320cc2ff1a86628679cd4a7c8ce38b047c4/crm_send_email.py
def _get_journal(self, cr, uid, context={}): journal_pool = self.pool.get('account.journal') if context.get('journal_id', False): return context.get('journal_id') if not context.get('journal_id', False) and context.get('search_default_journal_id', False): return context.get('search_default_journal_id') ttype = context...
a6c16ae879ae1b7c6b5cc027559bd6bb0eb33e96 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a6c16ae879ae1b7c6b5cc027559bd6bb0eb33e96/voucher.py
'date_due': fields.date('Due Date'),
'date_due': fields.date('Due Date', readonly=True, states={'draft':[('readonly',False)]}),
def _get_partner(self, cr, uid, context={}): return context.get('partner_id', False)
3db30f732752ade5c9c2e3f43b43414620071ca3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3db30f732752ade5c9c2e3f43b43414620071ca3/voucher.py
if line[1]: line_amount = voucher_line_pool.browse(cr, uid, line[1]).untax_amount else: line_amount = line[2].get('amount')
line_amount = line[2].get('amount')
def onchange_price(self, cr, uid, ids, line_ids, tax_id, partner_id=False, context={}): tax_pool = self.pool.get('account.tax') partner_pool = self.pool.get('res.partner') position_pool = self.pool.get('account.fiscal.position') voucher_line_pool = self.pool.get('account.voucher.line') res = { 'tax_amount':False, 'amou...
3db30f732752ade5c9c2e3f43b43414620071ca3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3db30f732752ade5c9c2e3f43b43414620071ca3/voucher.py
'amount':total,
'amount':total or voucher_total,
def onchange_price(self, cr, uid, ids, line_ids, tax_id, partner_id=False, context={}): tax_pool = self.pool.get('account.tax') partner_pool = self.pool.get('res.partner') position_pool = self.pool.get('account.fiscal.position') voucher_line_pool = self.pool.get('account.voucher.line') res = { 'tax_amount':False, 'amou...
3db30f732752ade5c9c2e3f43b43414620071ca3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3db30f732752ade5c9c2e3f43b43414620071ca3/voucher.py
def onchange_price(self, cr, uid, ids, line_ids, tax_id, partner_id=False, context={}): tax_pool = self.pool.get('account.tax') partner_pool = self.pool.get('res.partner') position_pool = self.pool.get('account.fiscal.position') voucher_line_pool = self.pool.get('account.voucher.line') res = { 'tax_amount':False, 'amou...
3db30f732752ade5c9c2e3f43b43414620071ca3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3db30f732752ade5c9c2e3f43b43414620071ca3/voucher.py
def _get_payment_term_lines(term_id, amount): term_pool = self.pool.get('account.payment.term') if term_id and amount: terms = term_pool.compute(cr, uid, term_id, amount) return terms return False
3db30f732752ade5c9c2e3f43b43414620071ca3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3db30f732752ade5c9c2e3f43b43414620071ca3/voucher.py