rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
operator = fget[f].get('group_operator', 'sum')
group_operator = fget[f].get('group_operator', 'sum')
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): """ Get the list of records in list view grouped by the given ``groupby`` fields
99608428f8798699de8a678ed91f2ea221f5030b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/99608428f8798699de8a678ed91f2ea221f5030b/orm.py
flist += operator+'('+f+') as '+f
flist += group_operator+'('+f+') as '+f
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): """ Get the list of records in list view grouped by the given ``groupby`` fields
99608428f8798699de8a678ed91f2ea221f5030b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/99608428f8798699de8a678ed91f2ea221f5030b/orm.py
if fget[groupby]['type'] in ('date','datetime'):
if d[groupby] and fget[groupby]['type'] in ('date','datetime'):
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): context = context or {} self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context) if not fields: fields = self._columns.keys()
7dc05435ff40cd9d48d66646c63715d2c1283add /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7dc05435ff40cd9d48d66646c63715d2c1283add/orm.py
country1 = ''
country = ''
def execute(self, cr, uid, ids, context=None): company_id = self.pool.get('base.setup.company').search(cr, uid, []) company_data = self.pool.get('base.setup.company').read(cr, uid, company_id) company_data = company_data and company_data[0] or False country1 = '' if company_data and company_data.get('country_id', False...
2e4d93604cc5f7a4ad9f955550a43a21a2d51415 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2e4d93604cc5f7a4ad9f955550a43a21a2d51415/gtk_contact_form.py
def get_data(self, form):
def get_data(self, data):
def get_data(self, form): cr, uid = self.cr, self.uid db_pool = pooler.get_pool(self.cr.dbname)
23f3f286dd55d8bb58aa9afdf315b22bfafe76e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/23f3f286dd55d8bb58aa9afdf315b22bfafe76e0/report_pl.py
ctx['fiscalyear'] = form['fiscalyear']
ctx['fiscalyear'] = data['form']['fiscalyear_id']
def get_data(self, form): cr, uid = self.cr, self.uid db_pool = pooler.get_pool(self.cr.dbname)
23f3f286dd55d8bb58aa9afdf315b22bfafe76e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/23f3f286dd55d8bb58aa9afdf315b22bfafe76e0/report_pl.py
if form['filter']=='filter_period' : ctx['periods'] = form['periods'] elif form['filter']== 'filter_date': ctx['date_from'] = form['date_from'] ctx['date_to'] = form['date_to']
if data['form']['filter']=='filter_period' : ctx['periods'] = data['periods'] elif data['form']['filter']== 'filter_date': ctx['date_from'] = data['date_from'] ctx['date_to'] = data['date_to']
def get_data(self, form): cr, uid = self.cr, self.uid db_pool = pooler.get_pool(self.cr.dbname)
23f3f286dd55d8bb58aa9afdf315b22bfafe76e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/23f3f286dd55d8bb58aa9afdf315b22bfafe76e0/report_pl.py
account_id = [form['Account_list']]
account_id =data['form']['chart_account_id']
def get_data(self, form): cr, uid = self.cr, self.uid db_pool = pooler.get_pool(self.cr.dbname)
23f3f286dd55d8bb58aa9afdf315b22bfafe76e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/23f3f286dd55d8bb58aa9afdf315b22bfafe76e0/report_pl.py
if form['display_account'] == 'bal_mouvement':
if data['form']['display_account'] == 'bal_mouvement':
def get_data(self, form): cr, uid = self.cr, self.uid db_pool = pooler.get_pool(self.cr.dbname)
23f3f286dd55d8bb58aa9afdf315b22bfafe76e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/23f3f286dd55d8bb58aa9afdf315b22bfafe76e0/report_pl.py
elif form['display_account'] == 'bal_solde':
elif data['form']['display_account'] == 'bal_solde':
def get_data(self, form): cr, uid = self.cr, self.uid db_pool = pooler.get_pool(self.cr.dbname)
23f3f286dd55d8bb58aa9afdf315b22bfafe76e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/23f3f286dd55d8bb58aa9afdf315b22bfafe76e0/report_pl.py
def _search_amount(self, cr, uid, obj, name, args, context): ids = set() for cond in args: amount = cond[2] if isinstance(cond[2],(list,tuple)): if cond[1] in ['in','not in']: amount = tuple(cond[2]) else: continue else: if cond[1] in ['=like', 'like', 'not like', 'ilike', 'not ilike', 'in', 'not in', 'child_of']: cont...
03a800077fc72b77a4eedff0a84b84850c98ff03 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/03a800077fc72b77a4eedff0a84b84850c98ff03/account.py
else:
else:
def _search_amount(self, cr, uid, obj, name, args, context): ids = set() for cond in args: amount = cond[2] if isinstance(cond[2],(list,tuple)): if cond[1] in ['in','not in']: amount = tuple(cond[2]) else: continue else: if cond[1] in ['=like', 'like', 'not like', 'ilike', 'not ilike', 'in', 'not in', 'child_of']: cont...
03a800077fc72b77a4eedff0a84b84850c98ff03 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/03a800077fc72b77a4eedff0a84b84850c98ff03/account.py
(parent_ids,)+where_params)
(parent_ids,) + where_params)
def _sum(self, cr, uid, ids, name, args, context,where ='', where_params=()): parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) if context.get('based_on', 'invoices') == 'payments': cr.execute('SELECT line.tax_code_id, sum(line.tax_amount) \ FROM account_move_line AS line, \ account_move AS mov...
03a800077fc72b77a4eedff0a84b84850c98ff03 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/03a800077fc72b77a4eedff0a84b84850c98ff03/account.py
FROM account_move_line AS line \
FROM account_move_line AS line, \ account_move AS move \
def _sum(self, cr, uid, ids, name, args, context,where ='', where_params=()): parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) if context.get('based_on', 'invoices') == 'payments': cr.execute('SELECT line.tax_code_id, sum(line.tax_amount) \ FROM account_move_line AS line, \ account_move AS mov...
03a800077fc72b77a4eedff0a84b84850c98ff03 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/03a800077fc72b77a4eedff0a84b84850c98ff03/account.py
(parent_ids,)+where_params)
(parent_ids,) + where_params)
def _sum(self, cr, uid, ids, name, args, context,where ='', where_params=()): parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) if context.get('based_on', 'invoices') == 'payments': cr.execute('SELECT line.tax_code_id, sum(line.tax_amount) \ FROM account_move_line AS line, \ account_move AS mov...
03a800077fc72b77a4eedff0a84b84850c98ff03 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/03a800077fc72b77a4eedff0a84b84850c98ff03/account.py
def _sum_year(self, cr, uid, ids, name, args, context):
def _sum_year(self, cr, uid, ids, name, args, context=None): if context is None: context = {} move_state = ('posted', ) if 'state' in context and context['state'] == 'all': move_state = ('draft', 'posted', )
def _sum_year(self, cr, uid, ids, name, args, context): if 'fiscalyear_id' in context and context['fiscalyear_id']: fiscalyear_id = context['fiscalyear_id'] else: fiscalyear_id = self.pool.get('account.fiscalyear').find(cr, uid, exception=False) where = '' where_params = () if fiscalyear_id: pids = map(lambda x: str(x....
03a800077fc72b77a4eedff0a84b84850c98ff03 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/03a800077fc72b77a4eedff0a84b84850c98ff03/account.py
where = ' and period_id IN %s' where_params = (tuple(pids),)
where = ' AND line.period_id IN %s AND move.state IN %s ' where_params = (tuple(pids), move_state)
def _sum_year(self, cr, uid, ids, name, args, context): if 'fiscalyear_id' in context and context['fiscalyear_id']: fiscalyear_id = context['fiscalyear_id'] else: fiscalyear_id = self.pool.get('account.fiscalyear').find(cr, uid, exception=False) where = '' where_params = () if fiscalyear_id: pids = map(lambda x: str(x....
03a800077fc72b77a4eedff0a84b84850c98ff03 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/03a800077fc72b77a4eedff0a84b84850c98ff03/account.py
where=' and line.period_id=%s', where_params=(period_id,))
where=' AND line.period_id=%s AND move.state IN %s', where_params=(period_id, move_state))
def _sum_period(self, cr, uid, ids, name, args, context): if 'period_id' in context and context['period_id']: period_id = context['period_id'] else: period_id = self.pool.get('account.period').find(cr, uid) if not len(period_id): return dict.fromkeys(ids, 0.0) period_id = period_id[0] return self._sum(cr, uid, ids, nam...
03a800077fc72b77a4eedff0a84b84850c98ff03 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/03a800077fc72b77a4eedff0a84b84850c98ff03/account.py
def action_done(self, cr, uid, ids, context=None):
def action_done(self, cr, uid, ids, context={}):
def action_done(self, cr, uid, ids, context=None): track_flag = False picking_ids = [] for move in self.browse(cr, uid, ids): if move.picking_id: picking_ids.append(move.picking_id.id) if move.move_dest_id.id and (move.state != 'done'): cr.execute('insert into stock_move_history_ids (parent_id,child_id) values (%s,%s)'...
236e0e35d74af3f7e0b707748e0f165c4c1c7baf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/236e0e35d74af3f7e0b707748e0f165c4c1c7baf/stock.py
product_uom_obj = self.pool.get('product.uom')
def action_done(self, cr, uid, ids, context=None): track_flag = False picking_ids = [] for move in self.browse(cr, uid, ids): if move.picking_id: picking_ids.append(move.picking_id.id) if move.move_dest_id.id and (move.state != 'done'): cr.execute('insert into stock_move_history_ids (parent_id,child_id) values (%s,%s)'...
236e0e35d74af3f7e0b707748e0f165c4c1c7baf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/236e0e35d74af3f7e0b707748e0f165c4c1c7baf/stock.py
company_id=move.company_id.id context['currency_id']=move.company_id.currency_id.id pricetype=self.pool.get('product.price.type').browse(cr,uid,move.company_id.property_valuation_price_type.id) amount_unit=move.product_id.price_get(pricetype.field, context)[move.product_id.id] amount=amount_unit * q or 1.0
company_id = move.company_id.id context['currency_id'] = move.company_id.currency_id.id pricetype = price_type_obj.browse(cr,uid,move.company_id.property_valuation_price_type.id) amount_unit = move.product_id.price_get(pricetype.field, context)[move.product_id.id] amount = amount_unit * q or 1.0
def action_done(self, cr, uid, ids, context=None): track_flag = False picking_ids = [] for move in self.browse(cr, uid, ids): if move.picking_id: picking_ids.append(move.picking_id.id) if move.move_dest_id.id and (move.state != 'done'): cr.execute('insert into stock_move_history_ids (parent_id,child_id) values (%s,%s)'...
236e0e35d74af3f7e0b707748e0f165c4c1c7baf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/236e0e35d74af3f7e0b707748e0f165c4c1c7baf/stock.py
self.pool.get('account.move').create(cr, uid, {
move_obj.create(cr, uid, {
def action_done(self, cr, uid, ids, context=None): track_flag = False picking_ids = [] for move in self.browse(cr, uid, ids): if move.picking_id: picking_ids.append(move.picking_id.id) if move.move_dest_id.id and (move.state != 'done'): cr.execute('insert into stock_move_history_ids (parent_id,child_id) values (%s,%s)'...
236e0e35d74af3f7e0b707748e0f165c4c1c7baf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/236e0e35d74af3f7e0b707748e0f165c4c1c7baf/stock.py
tracking_id = context.get('tracking_id', False) if tracking_id: tracking = self.pool.get('stock.tracking') tracking_id = tracking.get_create_tracking_lot(cr, uid,[rec_id], context=context ) self.write(cr, uid, ids, {'state': 'done', 'date_planned': time.strftime('%Y-%m-%d %H:%M:%S'), 'tracking_id': tracking_id}) for p...
tracking_id = False if context: tracking_id = context.get('tracking_id', False) if tracking_id: rec_id = context and context.get('active_id', False) tracking = self.pool.get('stock.tracking') tracking_id = tracking.get_create_tracking_lot(cr, uid,[rec_id], context=context ) self.write(cr, uid, ids, {'state': 'done', '...
def action_done(self, cr, uid, ids, context=None): track_flag = False picking_ids = [] for move in self.browse(cr, uid, ids): if move.picking_id: picking_ids.append(move.picking_id.id) if move.move_dest_id.id and (move.state != 'done'): cr.execute('insert into stock_move_history_ids (parent_id,child_id) values (%s,%s)'...
236e0e35d74af3f7e0b707748e0f165c4c1c7baf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/236e0e35d74af3f7e0b707748e0f165c4c1c7baf/stock.py
self.pool.get('stock.picking').action_done(cr, uid, [pick.id])
picking_obj.action_done(cr, uid, [pick.id])
def action_done(self, cr, uid, ids, context=None): track_flag = False picking_ids = [] for move in self.browse(cr, uid, ids): if move.picking_id: picking_ids.append(move.picking_id.id) if move.move_dest_id.id and (move.state != 'done'): cr.execute('insert into stock_move_history_ids (parent_id,child_id) values (%s,%s)'...
236e0e35d74af3f7e0b707748e0f165c4c1c7baf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/236e0e35d74af3f7e0b707748e0f165c4c1c7baf/stock.py
def ir_get(cr, uid, key, key2, models, meta=False, context={}, res_id_req=False):
def ir_get(cr, uid, key, key2, models, meta=False, context=None, res_id_req=False):
def ir_get(cr, uid, key, key2, models, meta=False, context={}, res_id_req=False): obj = pooler.get_pool(cr.dbname).get('ir.values') res = obj.get(cr, uid, key, key2, models, meta=meta, context=context, res_id_req=res_id_req) return res
f9b199fa5fea39ae09cb52a593f4ddb4bb80d449 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f9b199fa5fea39ae09cb52a593f4ddb4bb80d449/ir.py
val_invoice = pool_obj.get('account.invoice').onchange_partner_id(cr, uid, [], 'out_invoice', reg.partner_invoice_id.id, False, False)
val_invoice = inv_obj.onchange_partner_id(cr, uid, [], 'out_invoice', reg.partner_invoice_id.id, False, False)
def _makeInvoices(self, cr, uid, context={}): invoices = {} invoice_ids = [] create_ids=[] tax_ids=[] inv_create = 0 inv_reject = 0 inv_rej_reason = "" list_inv = [] obj_event_reg = self.pool.get('event.registration') obj_lines = self.pool.get('account.invoice.line') inv_obj = self.pool.get('account.invoice') data_even...
9adfda2f9586a76b2b3c863c5b512b88aa05f49b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9adfda2f9586a76b2b3c863c5b512b88aa05f49b/event_make_invoice.py
journal_id = context['journal_id'] period_id = context['period_id'] journal = self.pool.get('account.journal').browse(cr, uid, [journal_id])[0] if journal.allow_date: period = self.pool.get('account.period').browse(cr, uid, [period_id])[0] if not time.strptime(vals['date'],'%Y-%m-%d')>=time.strptime(period.date_start,'...
journal_id = context.get('journal_id',False) period_id = context.get('period_id',False) if journal_id: journal = self.pool.get('account.journal').browse(cr, uid, [journal_id])[0] if journal.allow_date and period_id: period = self.pool.get('account.period').browse(cr, uid, [period_id])[0] if not time.strptime(vals['date...
def _check_date(self, cr, uid, vals, context=None, check=True): if context is None: context = {} if 'date' in vals.keys(): if 'journal_id' in vals and 'journal_id' not in context: journal_id = vals['journal_id'] if 'period_id' in vals and 'period_id' not in context: period_id = vals['period_id'] elif 'journal_id' not i...
80f5c0b3ab2f9fab3cfbf25f88219d1cbc872ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/80f5c0b3ab2f9fab3cfbf25f88219d1cbc872ee9/account_move_line.py
lang=part.lang context.update({'lang': lang})
if part.lang: context.update({'lang': part.lang})
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None): if context is None: context = {} company_id = context.get('company_id',False) if not partner_id: raise osv.excep...
81f997998d110da6216677673e826ae33749b27e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/81f997998d110da6216677673e826ae33749b27e/invoice.py
def refund(self, cr, uid, ids, date=None, period_id=None, description=None): map_old_new = {} refund_ids = [] for old_inv_id in ids: new_id = super(account_invoice,self).refund(cr, uid, ids, date=date, period_id=period_id, description=description) refund_ids += new_id map_old_new[old_inv_id] = new_id[0] for old_inv_id...
d06f4a6c874b3f9000a8b6e11e1354086f155cab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d06f4a6c874b3f9000a8b6e11e1354086f155cab/invoice_tax_incl.py
def refund(self, cr, uid, ids, date=None, period_id=None, description=None): map_old_new = {} refund_ids = [] for old_inv_id in ids: new_id = super(account_invoice,self).refund(cr, uid, ids, date=date, period_id=period_id, description=description) refund_ids += new_id map_old_new[old_inv_id] = new_id[0] for old_inv_id...
d06f4a6c874b3f9000a8b6e11e1354086f155cab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d06f4a6c874b3f9000a8b6e11e1354086f155cab/invoice_tax_incl.py
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, context=None):
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None):
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, context=None): # note: will call product_id_change_unit_price_inv with context...
d06f4a6c874b3f9000a8b6e11e1354086f155cab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d06f4a6c874b3f9000a8b6e11e1354086f155cab/invoice_tax_incl.py
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, context=None): # note: will call product_id_change_unit_price_inv with context...
d06f4a6c874b3f9000a8b6e11e1354086f155cab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d06f4a6c874b3f9000a8b6e11e1354086f155cab/invoice_tax_incl.py
return super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, context=ctx)
return super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, currency_id=currency_id, context=ctx)
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, context=None): # note: will call product_id_change_unit_price_inv with context...
d06f4a6c874b3f9000a8b6e11e1354086f155cab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d06f4a6c874b3f9000a8b6e11e1354086f155cab/invoice_tax_incl.py
def compute(self, cr, uid, invoice_id, context=None): inv = self.pool.get('account.invoice').browse(cr, uid, invoice_id) line_ids = map(lambda x: x.id, inv.invoice_line)
d06f4a6c874b3f9000a8b6e11e1354086f155cab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d06f4a6c874b3f9000a8b6e11e1354086f155cab/invoice_tax_incl.py
def compute(self, cr, uid, invoice_id, context=None): inv = self.pool.get('account.invoice').browse(cr, uid, invoice_id) line_ids = map(lambda x: x.id, inv.invoice_line)
d06f4a6c874b3f9000a8b6e11e1354086f155cab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d06f4a6c874b3f9000a8b6e11e1354086f155cab/invoice_tax_incl.py
"AND " + self.query +" " \
def set_context(self, objects, data, ids, report_type=None): obj_move = self.pool.get('account.move.line') self.query = obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context', {})) ctx2 = data['form'].get('used_context',{}).copy() ctx2.update({'initial_bal': True}) self.init_query = obj...
bd2c3e195d99043897a15501601813e527f96c68 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bd2c3e195d99043897a15501601813e527f96c68/account_partner_ledger.py
objects = self.pool.get('res.partner').browse(self.cr, self.uid, new_ids)
objects = obj_partner.browse(self.cr, self.uid, new_ids)
def set_context(self, objects, data, ids, report_type=None): obj_move = self.pool.get('account.move.line') self.query = obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context', {})) ctx2 = data['form'].get('used_context',{}).copy() ctx2.update({'initial_bal': True}) self.init_query = obj...
bd2c3e195d99043897a15501601813e527f96c68 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bd2c3e195d99043897a15501601813e527f96c68/account_partner_ledger.py
res[val.id]['date_from']=date_from
res[val.id]['date_from']=date_from
def _product_margin(self, cr, uid, ids, field_names, arg, context=None): res = {} if context is None: context = {} for val in self.browse(cr, uid, ids,context=context): res[val.id] = {} date_from = context.get('date_from', time.strftime('%Y-01-01')) date_to = context.get('date_to', time.strftime('%Y-12-31')) invoice_st...
9e50339257b7e3619201e7ad01eb9a5913f0d71c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9e50339257b7e3619201e7ad01eb9a5913f0d71c/product_margin.py
res[val.id]['invoice_state']=invoice_state
res[val.id]['invoice_state']=invoice_state
def _product_margin(self, cr, uid, ids, field_names, arg, context=None): res = {} if context is None: context = {} for val in self.browse(cr, uid, ids,context=context): res[val.id] = {} date_from = context.get('date_from', time.strftime('%Y-01-01')) date_to = context.get('date_to', time.strftime('%Y-12-31')) invoice_st...
9e50339257b7e3619201e7ad01eb9a5913f0d71c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9e50339257b7e3619201e7ad01eb9a5913f0d71c/product_margin.py
def _product_margin(self, cr, uid, ids, field_names, arg, context=None): res = {} if context is None: context = {} for val in self.browse(cr, uid, ids,context=context): res[val.id] = {} date_from = context.get('date_from', time.strftime('%Y-01-01')) date_to = context.get('date_to', time.strftime('%Y-12-31')) invoice_st...
9e50339257b7e3619201e7ad01eb9a5913f0d71c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9e50339257b7e3619201e7ad01eb9a5913f0d71c/product_margin.py
ids = [x[1] for x in data['form']['pickings']]
ids = data['form']['pickings'][0][2]
def _make_packing(obj, cursor, user, data, context): wkf_service = netsvc.LocalService('workflow') pool = pooler.get_pool(cursor.dbname) picking_obj = pool.get('stock.picking') ids = [x[1] for x in data['form']['pickings']] picking_obj.force_assign(cursor, user, ids) picking_obj.action_move(cursor, user, ids) for pick...
a558d4fd30a657e3a257176002e1d1d7594fb54c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a558d4fd30a657e3a257176002e1d1d7594fb54c/wizard_picking_make.py
return open(os.path.join( tools.config['addons_path'], 'hr/image', 'photo.png'), 'rb') .read().encode('base64')
paths = tools.config['addons_path'].split(",") for path in paths: full_path = os.path.join(path, 'hr/image', 'photo.png') if os.path.exists(full_path): return open(full_path,'rb') .read().encode('base64') raise Exception("photo.png could not be found")
def _get_photo(self, cr, uid, context=None): return open(os.path.join( tools.config['addons_path'], 'hr/image', 'photo.png'), 'rb') .read().encode('base64')
a5f271f50de72282bbaaac624d14295eef7d51f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a5f271f50de72282bbaaac624d14295eef7d51f4/hr.py
'where id in %s', sub_ids)
'where id in %s', (sub_ids,))
def unlink(self, cr, uid, ids, context=None): if not ids: return True if isinstance(ids, (int, long)): ids = [ids]
877fde1280102e1154402b2e00c8347276fba33f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/877fde1280102e1154402b2e00c8347276fba33f/orm.py
if not company_id or 'company_id' in defaults: return defaults
if not company_id or 'company_id' not in fields_list: return defaults
def default_get(self, cr, uid, fields_list=None, context=None): """ get default company if any, and the various other fields from the company's fields """ defaults = super(base_setup_company, self)\ .default_get(cr, uid, fields_list=fields_list, context=context)
3d2d2478a1d9e1534183367ebef2559b4c339ea5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3d2d2478a1d9e1534183367ebef2559b4c339ea5/todo.py
def modify_this(self, cr, uid, event_id, defaults, real_date, context=None, *args): """Modifies only one event record out of virtual recurrent events and creates new event as a specific instance of a Recurring Event", @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the ...
def modify_this(self, cr, uid, event_id, defaults, real_date, context=None, *args): """Modifies only one event record out of virtual recurrent events and creates new event as a specific instance of a Recurring Event", @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the ...
d53b3d9c693a99a0ae03bd7d21fb2ab9c8727117 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d53b3d9c693a99a0ae03bd7d21fb2ab9c8727117/base_calendar.py
def modify_all(self, cr, uid, event_ids, defaults, context=None, *args): """ Modifies the recurring event @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param event_ids: List of crm meeting’s IDs. @param context: A standard dictionary for contextual values ...
d53b3d9c693a99a0ae03bd7d21fb2ab9c8727117 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d53b3d9c693a99a0ae03bd7d21fb2ab9c8727117/base_calendar.py
def compute_rule_string(self, cr, uid, datas, context=None, *args): """ Compute rule string according to value type RECUR of iCalendar from the values given. @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 datas: diction...
d53b3d9c693a99a0ae03bd7d21fb2ab9c8727117 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d53b3d9c693a99a0ae03bd7d21fb2ab9c8727117/base_calendar.py
def search(self, cr, uid, args, offset=0, limit=100, order=None, context=None, count=False): """ Overrides orm search method. @param cr: the current row, from the database cursor, @param user: the current user’s ID for security checks, @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...]....
d53b3d9c693a99a0ae03bd7d21fb2ab9c8727117 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d53b3d9c693a99a0ae03bd7d21fb2ab9c8727117/base_calendar.py
real_date = data.get('date') data.update(vals) new_id = self.modify_this(cr, uid, event_id, data, \ real_date, context)
vals.update({ 'recurrent_uid': real_event_id, 'recurrent_id': data.get('date'), 'rrule_type': 'none', 'rrule': '' }) new_id = self.copy(cr, uid, real_event_id, default=vals, context=context)
def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True): """ Overrides orm write method. @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 meeting's ids @param vals: Dictionary of ...
d53b3d9c693a99a0ae03bd7d21fb2ab9c8727117 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d53b3d9c693a99a0ae03bd7d21fb2ab9c8727117/base_calendar.py
event_id = base_calendar_id2real_id(event_id) if not event_id in new_ids: new_ids.append(event_id)
if not real_event_id in new_ids: new_ids.append(real_event_id)
def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True): """ Overrides orm write method. @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 meeting's ids @param vals: Dictionary of ...
d53b3d9c693a99a0ae03bd7d21fb2ab9c8727117 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d53b3d9c693a99a0ae03bd7d21fb2ab9c8727117/base_calendar.py
bank_statement = {}
def _coda_parsing(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) codafile = data['form']['coda'] journal_code = pool.get('account.journal').browse(cr, uid, data['form']['journal_id'], context).code def_pay_acc = data['form']['def_payable'] def_rec_acc = data['form']['def_receivable'] str_log = "" err...
d5ba08370e947611dc83b337b8cf252c9e9d1ae4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d5ba08370e947611dc83b337b8cf252c9e9d1ae4/coda_import.py
'period_id':statement['period_id'],
'period_id':statement['period_id'] or period,
def _coda_parsing(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) codafile = data['form']['coda'] journal_code = pool.get('account.journal').browse(cr, uid, data['form']['journal_id'], context).code def_pay_acc = data['form']['def_payable'] def_rec_acc = data['form']['def_receivable'] str_log = "" err...
d5ba08370e947611dc83b337b8cf252c9e9d1ae4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d5ba08370e947611dc83b337b8cf252c9e9d1ae4/coda_import.py
def apply_rule(added_clause, added_params, added_tables):
def apply_rule(added_clause, added_params, added_tables, parent_model=None, child_object=None):
def apply_rule(added_clause, added_params, added_tables): if added_clause: query.where_clause += added_clause query.where_clause_params += added_params for table in added_tables: if table not in query.tables: query.tables.append(table) return True return False
7f30ad68d56a78aee746389192a1acac245f67ac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7f30ad68d56a78aee746389192a1acac245f67ac/orm.py
def apply_rule(added_clause, added_params, added_tables): if added_clause: query.where_clause += added_clause query.where_clause_params += added_params for table in added_tables: if table not in query.tables: query.tables.append(table) return True return False
7f30ad68d56a78aee746389192a1acac245f67ac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7f30ad68d56a78aee746389192a1acac245f67ac/orm.py
if apply_rule(*rule_obj.domain_get(cr, uid, inherited_model, mode, context=context)): self._inherits_join_add(inherited_model, query)
apply_rule(*rule_obj.domain_get(cr, uid, inherited_model, mode, context=context), parent_model=inherited_model, child_object=self)
def apply_rule(added_clause, added_params, added_tables): if added_clause: query.where_clause += added_clause query.where_clause_params += added_params for table in added_tables: if table not in query.tables: query.tables.append(table) return True return False
7f30ad68d56a78aee746389192a1acac245f67ac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7f30ad68d56a78aee746389192a1acac245f67ac/orm.py
(sum(l.product_uom_qty*l.price_unit)/sum(l.product_uom_qty/u.factor)*count(l.product_id))::decimal(16,2) as price_average,
def init(self, cr): tools.drop_view_if_exists(cr, 'sale_report') cr.execute(""" create or replace view sale_report as ( select el.*, -- (select count(1) from sale_order_line where order_id = s.id) as nbr, (select 1) as nbr, s.date_order as date, s.date_confirm as date_confirm, to_char(s.date_order, 'YYYY') as year, to_...
81a13374c7f68a790d69445bed428bc0a61d37d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/81a13374c7f68a790d69445bed428bc0a61d37d1/sale_report.py
el.price_average,
def init(self, cr): tools.drop_view_if_exists(cr, 'sale_report') cr.execute(""" create or replace view sale_report as ( select el.*, -- (select count(1) from sale_order_line where order_id = s.id) as nbr, (select 1) as nbr, s.date_order as date, s.date_confirm as date_confirm, to_char(s.date_order, 'YYYY') as year, to_...
81a13374c7f68a790d69445bed428bc0a61d37d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/81a13374c7f68a790d69445bed428bc0a61d37d1/sale_report.py
'get_end_date':self._get_end_date,
'get_end_date':self._get_end_date, 'print_data':self._print_data,
def __init__(self, cr, uid, name, context=None): if context is None: context = {} super(journal_print, self).__init__(cr, uid, name, context=context) self.period_ids = [] self.journal_ids = [] self.localcontext.update( { 'time': time, 'lines': self.lines, 'periods': self.periods, 'sum_debit_period': self._sum_debit_per...
98f9040f31ae5a102000d26d4899212cbbf380ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/98f9040f31ae5a102000d26d4899212cbbf380ea/general_journal.py
def unlink(self, cr, uid, ids, *args, **kwargs): context = kwargs.get('context', {}) project_obj = self.pool.get('project.project') user_uom, default_uom = project_obj._get_user_and_default_uom_ids(cr, uid)
06d9252426b971d92373540d3331073c142e47eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/06d9252426b971d92373540d3331073c142e47eb/project.py
return super(project_work,self).unlink(cr, uid, ids, *args, **kwargs)
return super(project_work, self).unlink(cr, uid, ids, *args, **kwargs)
def unlink(self, cr, uid, ids, *args, **kwargs): context = kwargs.get('context', {}) project_obj = self.pool.get('project.project') user_uom, default_uom = project_obj._get_user_and_default_uom_ids(cr, uid)
06d9252426b971d92373540d3331073c142e47eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/06d9252426b971d92373540d3331073c142e47eb/project.py
purchase_obj = self.pool.get('purchase.order')
def makeInvoices(self, cr, uid, ids, context=None):
79e0568ace03ad940d19c8d89e1967cd7d2e1f21 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/79e0568ace03ad940d19c8d89e1967cd7d2e1f21/purchase_line_invoice.py
'model': fields.char('Object Name', size=64, required=True),
'model': fields.char('Object Name', size=64, required=True, select=1),
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False, submenu=False): result = super(ir_model_grid, self).fields_view_get(cr, uid, view_id, view_type, context=context, toolbar=toolbar, submenu=submenu) groups = self.pool.get('res.groups').search(cr, uid, []) groups_br = self.pool...
a439ae096bff599c037611b910c5824bd6702e0e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a439ae096bff599c037611b910c5824bd6702e0e/ir_model.py
'state': fields.selection([('manual','Custom Field'),('base','Base Field')],'Manually Created', required=True, readonly=True),
'state': fields.selection([('manual','Custom Field'),('base','Base Field')],'Manually Created', required=True, readonly=True, select=1),
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False, submenu=False): result = super(ir_model_grid, self).fields_view_get(cr, uid, view_id, view_type, context=context, toolbar=toolbar, submenu=submenu) groups = self.pool.get('res.groups').search(cr, uid, []) groups_br = self.pool...
a439ae096bff599c037611b910c5824bd6702e0e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a439ae096bff599c037611b910c5824bd6702e0e/ir_model.py
'name': fields.char('Name', size=64, required=True), 'model_id': fields.many2one('ir.model', 'Object', required=True, domain=[('osv_memory','=', False)]), 'group_id': fields.many2one('res.groups', 'Group', ondelete='cascade'),
'name': fields.char('Name', size=64, required=True, select=True), 'model_id': fields.many2one('ir.model', 'Object', required=True, domain=[('osv_memory','=', False)], select=True), 'group_id': fields.many2one('res.groups', 'Group', ondelete='cascade', select=True),
def create(self, cr, user, vals, context=None): if 'model_id' in vals: model_data = self.pool.get('ir.model').browse(cr, user, vals['model_id']) vals['model'] = model_data.model if context is None: context = {} if context and context.get('manual',False): vals['state'] = 'manual' res = super(ir_model_fields,self).create...
a439ae096bff599c037611b910c5824bd6702e0e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a439ae096bff599c037611b910c5824bd6702e0e/ir_model.py
'name': fields.char('XML Identifier', required=True, size=128), 'model': fields.char('Object', required=True, size=64), 'module': fields.char('Module', required=True, size=64), 'res_id': fields.integer('Resource ID'),
'name': fields.char('XML Identifier', required=True, size=128, select=1), 'model': fields.char('Object', required=True, size=64, select=1), 'module': fields.char('Module', required=True, size=64, select=1), 'res_id': fields.integer('Resource ID', select=1),
def unlink(self, cr, uid, *args, **argv): self.call_cache_clearing_methods(cr) res = super(ir_model_access, self).unlink(cr, uid, *args, **argv) return res
a439ae096bff599c037611b910c5824bd6702e0e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a439ae096bff599c037611b910c5824bd6702e0e/ir_model.py
nyear = next_date.strftime("%Y") nmonth = str(int(next_date.strftime("%m"))% 12+1) nday = "1" ndate = "%s-%s-%s" % (nyear, nmonth, nday) nseconds = time.mktime(time.strptime(ndate, '%Y-%m-%d')) next_month = datetime.fromtimestamp(nseconds) delta = timedelta(seconds=1) next_date = next_month - delta next_date = next_d...
next_first_date = next_date + relativedelta(day=1,months=1) next_date = next_first_date + relativedelta(days=line.days2)
def compute(self, cr, uid, id, value, date_ref=False, context=None): if not date_ref: date_ref = datetime.now().strftime('%Y-%m-%d') pt = self.browse(cr, uid, id, context=context) amount = value result = [] obj_precision = self.pool.get('decimal.precision') for line in pt.line_ids: prec = obj_precision.precision_get(cr...
670b65336da3fac1b5ff208f57caed546a022139 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/670b65336da3fac1b5ff208f57caed546a022139/account.py
'ir.actions.report.xml': 'model',
'ir.actions.report.xml': 'model',
def search(self, cr, uid, args, offset=0, limit=2000, order=None, context=None, count=False): if context is None: context = {} ids = osv.orm.orm.search(self, cr, uid, args, offset, limit, order, context=context, count=(count and uid==1)) if uid==1: return ids
6d599c6ccacd0e726e8a4f18711c6b64c5e8465c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6d599c6ccacd0e726e8a4f18711c6b64c5e8465c/ir_ui_menu.py
new_id = ir_values_obj.copy(cr, uid, iv.id, default={'res_id': res}, context=context)
ir_values_obj.copy(cr, uid, iv.id, default={'res_id': res}, context=context)
def copy(self, cr, uid, id, default=None, context=None): ir_values_obj = self.pool.get('ir.values') res = super(ir_ui_menu, self).copy(cr, uid, id, context=context) datas=self.read(cr,uid,[res],['name'])[0] rex=re.compile('\([0-9]+\)') concat=rex.findall(datas['name']) if concat: next_num=eval(concat[0])+1 datas['name'...
6d599c6ccacd0e726e8a4f18711c6b64c5e8465c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6d599c6ccacd0e726e8a4f18711c6b64c5e8465c/ir_ui_menu.py
rcal = self.export_cal(cr, uid, rdata, context=context)
event_obj = self.pool.get('basic.calendar.event') rcal = event_obj.export_cal(cr, uid, rdata, context=context)
def create_ics(self, cr, uid, datas, name, ical, context=None): if not datas: return for data in datas: vevent = ical.add(name) for field in self.__attribute__.keys(): map_field = self.ical_get(field, 'field') map_type = self.ical_get(field, 'type') if map_field in data.keys(): if field == 'uid': model = context.get('m...
b4d7610933f13a88136bdcbb393f6fe25eabb16f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b4d7610933f13a88136bdcbb393f6fe25eabb16f/base_calendar.py
vevent.add(field).value = key1
vevent.add(field).value = key1.upper()
def create_ics(self, cr, uid, datas, name, ical, context=None): """ create calendaring and scheduling information @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 context: A standard dictionary for contextual values """
04c771ac516d876e0f7243c007fb8c03be3e686c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/04c771ac516d876e0f7243c007fb8c03be3e686c/calendar.py
name = name[-4] ext = '.ics'
name = name[:-4] ext = 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) where = [('collection_id','=',self.dir_id)] ext = False if name and name.endswith('.ics'): name = name[-4] ext = '.ics' if name: where.append((...
6ad4fbfc80f644b3f6dffa15560076d26074a777 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6ad4fbfc80f644b3f6dffa15560076d26074a777/caldav_node.py
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))
for cal in fil_obj.browse(cr, uid, ids, context=ctx): if (not name) or not ext: res.append(node_calendar(cal.name, self, self.context, cal)) if (not name) or ext: res.append(res_node_calendar(cal.name+'.ics', self, self.context, cal))
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 and name.endswith('.ics'): name = name[-4] ext = '.ics' if name: where.append((...
6ad4fbfc80f644b3f6dffa15560076d26074a777 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6ad4fbfc80f644b3f6dffa15560076d26074a777/caldav_node.py
res = journal_obj.search(cr, uid, [('type', '=', type2journal.get(type_inv, 'sale'))], limit=1)
res = journal_obj.search(cr, uid, [('type', '=', type2journal.get(type_inv, 'sale')), ('refund_journal', '=', refund_journal.get(type_inv, False))], limit=1)
def _get_journal(self, cr, uid, context): if context is None: context = {} type_inv = context.get('type', 'out_invoice') type2journal = {'out_invoice': 'sale', 'in_invoice': 'purchase', 'out_refund': 'sale', 'in_refund': 'purchase'} journal_obj = self.pool.get('account.journal') res = journal_obj.search(cr, uid, [('typ...
7681deb834152087166b72896be7c64059da55c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7681deb834152087166b72896be7c64059da55c3/invoice.py
ean = pack.ean
ean = pack.ean or _('(n/a)')
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): if not partner_id: raise osv.except_osv(_('No Customer Defined !'), _('You have to select ...
e37f0384f8048782e51c70cb7637aebc3b214eaf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e37f0384f8048782e51c70cb7637aebc3b214eaf/sale.py
warn_msg = _("You selected a quantity of %d Units.\nBut it's not compatible with the selected packaging.\nHere is a proposition of quantities according to the packaging: ") % (qty) warn_msg = warn_msg + "\n\n" + _("EAN: ") + str(ean) + _(" Quantity: ") + str(qty_pack) + _(" Type of ul: ") + str(type_ul.name)
warn_msg = _("You selected a quantity of %d Units.\n" "But it's not compatible with the selected packaging.\n" "Here is a proposition of quantities according to the packaging:\n\n" "EAN: %s Quantity: %s Type of ul: %s") % \ (qty, ean, qty_pack, type_ul.name)
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): if not partner_id: raise osv.except_osv(_('No Customer Defined !'), _('You have to select ...
e37f0384f8048782e51c70cb7637aebc3b214eaf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e37f0384f8048782e51c70cb7637aebc3b214eaf/sale.py
if 'text' in fields:
if include_original == True and 'text' in fields:
def get_reply_defaults(self, cr, uid, fields, context=None): """ This function gets default values for reply mail """ hist_obj = self.pool.get('crm.case.history') res_ids = context and context.get('active_ids', []) or [] res = {} for hist in hist_obj.browse(cr, uid, res_ids): model = hist.log_id.model_id.model model_po...
615b6be349c3f059343ebff6250c79ca1e2aec40 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/615b6be349c3f059343ebff6250c79ca1e2aec40/crm_send_email.py
'amount': fields.float('Total', readonly=True, select=True),
def init(self, cr): tools.drop_view_if_exists(cr, 'report_sales_by_user_pos_month') cr.execute(""" create or replace view report_sales_by_user_pos_month as ( select min(po.id) as id, to_char(date_trunc('month',po.date_order),'YYYY-MM-DD')::text as date_order, po.user_id as user_id, sum(pol.qty)as qty, sum((pol.price_un...
05caefc880abb2a70158b14885ef72a9ddd4f32d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/05caefc880abb2a70158b14885ef72a9ddd4f32d/pos.py
'amount': fields.float('Total', readonly=True, select=True),
def init(self, cr): tools.drop_view_if_exists(cr, 'report_sales_by_margin_pos') cr.execute(""" create or replace view report_sales_by_margin_pos as ( select min(pol.id) as id, po.user_id as user_id, pt.name as product_name, to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::text as date_order, sum(pol.qty) as qty, ...
05caefc880abb2a70158b14885ef72a9ddd4f32d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/05caefc880abb2a70158b14885ef72a9ddd4f32d/pos.py
def _product_get_report(self, cr, uid, ids, product_ids=False, context=None, recursive=False): if context is None: context = {} product_obj = self.pool.get('product.product') # Take the user company and pricetype price_type_id=self.pool.get('res.users').browse(cr,uid,uid).company_id.property_valuation_price_type.id pri...
d1c818f1f1c2c2310b1b2eff79c5c8c61511f900 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d1c818f1f1c2c2310b1b2eff79c5c8c61511f900/stock.py
def _product_get_report(self, cr, uid, ids, product_ids=False, context=None, recursive=False): if context is None: context = {} product_obj = self.pool.get('product.product') # Take the user company and pricetype price_type_id=self.pool.get('res.users').browse(cr,uid,uid).company_id.property_valuation_price_type.id pri...
d1c818f1f1c2c2310b1b2eff79c5c8c61511f900 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d1c818f1f1c2c2310b1b2eff79c5c8c61511f900/stock.py
amount_unit=product.price_get(pricetype.field, context)[product.id]
amount_unit=product.price_get(pricetype.field, context)[product.id]
def _product_get_report(self, cr, uid, ids, product_ids=False, context=None, recursive=False): if context is None: context = {} product_obj = self.pool.get('product.product') # Take the user company and pricetype price_type_id=self.pool.get('res.users').browse(cr,uid,uid).company_id.property_valuation_price_type.id pri...
d1c818f1f1c2c2310b1b2eff79c5c8c61511f900 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d1c818f1f1c2c2310b1b2eff79c5c8c61511f900/stock.py
pricetype=self.pool.get('product.price.type').browse(cr,uid,price_type_id) amount_unit=move_line.product_id.price_get(pricetype.field, context)[move_line.product_id.id]
pricetype=self.pool.get('product.price.type').browse(cr,uid,price_type_id) amount_unit=move_line.product_id.price_get(pricetype.field, context)[move_line.product_id.id]
def _get_price_unit_invoice(self, cursor, user, move_line, type): '''Return the price unit for the move line''' if type in ('in_invoice', 'in_refund'): # Take the user company and pricetype price_type_id=self.pool.get('res.users').browse(cr,users,users).company_id.property_valuation_price_type.id pricetype=self.pool.ge...
d1c818f1f1c2c2310b1b2eff79c5c8c61511f900 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d1c818f1f1c2c2310b1b2eff79c5c8c61511f900/stock.py
def action_done(self, cr, uid, ids, context=None): track_flag = False picking_ids = [] for move in self.browse(cr, uid, ids): if move.picking_id: picking_ids.append(move.picking_id.id) if move.move_dest_id.id and (move.state != 'done'): cr.execute('insert into stock_move_history_ids (parent_id,child_id) values (%s,%s)'...
d1c818f1f1c2c2310b1b2eff79c5c8c61511f900 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d1c818f1f1c2c2310b1b2eff79c5c8c61511f900/stock.py
def action_done(self, cr, uid, ids, context=None): track_flag = False picking_ids = [] for move in self.browse(cr, uid, ids): if move.picking_id: picking_ids.append(move.picking_id.id) if move.move_dest_id.id and (move.state != 'done'): cr.execute('insert into stock_move_history_ids (parent_id,child_id) values (%s,%s)'...
d1c818f1f1c2c2310b1b2eff79c5c8c61511f900 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d1c818f1f1c2c2310b1b2eff79c5c8c61511f900/stock.py
cr, uid, ids, context=context)
cr, uid, ids, context=context)
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)
d1c818f1f1c2c2310b1b2eff79c5c8c61511f900 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d1c818f1f1c2c2310b1b2eff79c5c8c61511f900/stock.py
prodlot = prodlot_obj.browse(cr, uid, prodlot_id)
prodlot = prodlot_obj.browse(cr, uid, prodlot_id)
def _create_lot(self, cr, uid, ids, product_id, prefix=False): prodlot_obj = self.pool.get('stock.production.lot') ir_sequence_obj = self.pool.get('ir.sequence') sequence = ir_sequence_obj.get(cr, uid, 'stock.lot.serial') if not sequence: raise wizard.except_wizard(_('Error!'), _('No production sequence defined')) prod...
d1c818f1f1c2c2310b1b2eff79c5c8c61511f900 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d1c818f1f1c2c2310b1b2eff79c5c8c61511f900/stock.py
ref = '%s, %s' % (prodlot.ref, ref)
ref = '%s, %s' % (prodlot.ref, ref)
def _create_lot(self, cr, uid, ids, product_id, prefix=False): prodlot_obj = self.pool.get('stock.production.lot') ir_sequence_obj = self.pool.get('ir.sequence') sequence = ir_sequence_obj.get(cr, uid, 'stock.lot.serial') if not sequence: raise wizard.except_wizard(_('Error!'), _('No production sequence defined')) prod...
d1c818f1f1c2c2310b1b2eff79c5c8c61511f900 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d1c818f1f1c2c2310b1b2eff79c5c8c61511f900/stock.py
def split_lines(self, cr, uid, ids, quantity, split_by_qty=1, prefix=False, with_lot=True, context=None):
d1c818f1f1c2c2310b1b2eff79c5c8c61511f900 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d1c818f1f1c2c2310b1b2eff79c5c8c61511f900/stock.py
for move in self.browse(cr, uid, ids):
for move in self.browse(cr, uid, ids):
def split_lines(self, cr, uid, ids, quantity, split_by_qty=1, prefix=False, with_lot=True, context=None):
d1c818f1f1c2c2310b1b2eff79c5c8c61511f900 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d1c818f1f1c2c2310b1b2eff79c5c8c61511f900/stock.py
} for idx in range(int(quantity//split_by_qty)):
} for idx in range(int(quantity//split_by_qty)):
def split_lines(self, cr, uid, ids, quantity, split_by_qty=1, prefix=False, with_lot=True, context=None):
d1c818f1f1c2c2310b1b2eff79c5c8c61511f900 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d1c818f1f1c2c2310b1b2eff79c5c8c61511f900/stock.py
if quantity_rest > 0: idx = int(quantity//split_by_qty)
if quantity_rest > 0: idx = int(quantity//split_by_qty)
def split_lines(self, cr, uid, ids, quantity, split_by_qty=1, prefix=False, with_lot=True, context=None):
d1c818f1f1c2c2310b1b2eff79c5c8c61511f900 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d1c818f1f1c2c2310b1b2eff79c5c8c61511f900/stock.py
update_val['product_uos_qty'] = uos_qty_rest if not idx and move.product_qty<=quantity: current_move = move.id
update_val['product_uos_qty'] = uos_qty_rest if not idx and move.product_qty<=quantity: current_move = move.id
def split_lines(self, cr, uid, ids, quantity, split_by_qty=1, prefix=False, with_lot=True, context=None):
d1c818f1f1c2c2310b1b2eff79c5c8c61511f900 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d1c818f1f1c2c2310b1b2eff79c5c8c61511f900/stock.py
current_move = self.copy(cr, uid, move.id, {'state': move.state})
current_move = self.copy(cr, uid, move.id, {'state': move.state})
def split_lines(self, cr, uid, ids, quantity, split_by_qty=1, prefix=False, with_lot=True, context=None):
d1c818f1f1c2c2310b1b2eff79c5c8c61511f900 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d1c818f1f1c2c2310b1b2eff79c5c8c61511f900/stock.py
if with_lot:
if with_lot:
def split_lines(self, cr, uid, ids, quantity, split_by_qty=1, prefix=False, with_lot=True, context=None):
d1c818f1f1c2c2310b1b2eff79c5c8c61511f900 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d1c818f1f1c2c2310b1b2eff79c5c8c61511f900/stock.py
return res def consume_moves(self, cr, uid, ids, quantity, location_id=False, location_dest_id=False, consume=True, context=None):
return res def consume_moves(self, cr, uid, ids, quantity, location_id=False, location_dest_id=False, consume=True, context=None):
def split_lines(self, cr, uid, ids, quantity, split_by_qty=1, prefix=False, with_lot=True, context=None):
d1c818f1f1c2c2310b1b2eff79c5c8c61511f900 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d1c818f1f1c2c2310b1b2eff79c5c8c61511f900/stock.py
def consume_moves(self, cr, uid, ids, quantity, location_id=False, location_dest_id=False, consume=True, context=None): if not context: context = {} if quantity <= 0: raise osv.except_osv(_('Warning!'), _('Please provide Proper Quantity !'))
d1c818f1f1c2c2310b1b2eff79c5c8c61511f900 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d1c818f1f1c2c2310b1b2eff79c5c8c61511f900/stock.py
res = [] for move in self.browse(cr, uid, ids, context=context):
res = [] for move in self.browse(cr, uid, ids, context=context):
def consume_moves(self, cr, uid, ids, quantity, location_id=False, location_dest_id=False, consume=True, context=None): if not context: context = {} if quantity <= 0: raise osv.except_osv(_('Warning!'), _('Please provide Proper Quantity !'))
d1c818f1f1c2c2310b1b2eff79c5c8c61511f900 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d1c818f1f1c2c2310b1b2eff79c5c8c61511f900/stock.py
quantity_rest -= quantity
quantity_rest -= quantity
def consume_moves(self, cr, uid, ids, quantity, location_id=False, location_dest_id=False, consume=True, context=None): if not context: context = {} if quantity <= 0: raise osv.except_osv(_('Warning!'), _('Please provide Proper Quantity !'))
d1c818f1f1c2c2310b1b2eff79c5c8c61511f900 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d1c818f1f1c2c2310b1b2eff79c5c8c61511f900/stock.py
quantity_rest = 0
quantity_rest = 0
def consume_moves(self, cr, uid, ids, quantity, location_id=False, location_dest_id=False, consume=True, context=None): if not context: context = {} if quantity <= 0: raise osv.except_osv(_('Warning!'), _('Please provide Proper Quantity !'))
d1c818f1f1c2c2310b1b2eff79c5c8c61511f900 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d1c818f1f1c2c2310b1b2eff79c5c8c61511f900/stock.py
def consume_moves(self, cr, uid, ids, quantity, location_id=False, location_dest_id=False, consume=True, context=None): if not context: context = {} if quantity <= 0: raise osv.except_osv(_('Warning!'), _('Please provide Proper Quantity !'))
d1c818f1f1c2c2310b1b2eff79c5c8c61511f900 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d1c818f1f1c2c2310b1b2eff79c5c8c61511f900/stock.py