rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
result = super(osv.osv, self).fields_view_get(cr, uid, view_id,view_type,context,toolbar=toolbar, submenu=submenu)
result = super(osv.osv, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False, submenu=False): result = super(osv.osv, self).fields_view_get(cr, uid, view_id,view_type,context,toolbar=toolbar, submenu=submenu) if view_type != 'tree': return result
f182d69495b1162fde6f9ae30830e3d5417ae818 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f182d69495b1162fde6f9ae30830e3d5417ae818/account_move_line.py
class VoucherLine(osv.osv):
class account_voucher_line(osv.osv):
def action_move_line_create(self, cr, uid, ids, *args): for inv in self.browse(cr, uid, ids): if inv.move_id: continue company_currency = inv.company_id.currency_id.id
ab1423b7f3a0860088715f85782ab9044241f25f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ab1423b7f3a0860088715f85782ab9044241f25f/account_voucher_payment.py
data = super(VoucherLine, self).default_get(cr, uid, fields, context)
data = super(account_voucher_line, self).default_get(cr, uid, fields, context)
def default_get(self, cr, uid, fields, context={}): data = super(VoucherLine, self).default_get(cr, uid, fields, context) self.voucher_context = context return data
ab1423b7f3a0860088715f85782ab9044241f25f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ab1423b7f3a0860088715f85782ab9044241f25f/account_voucher_payment.py
def default_get(self, cr, uid, fields, context={}): data = super(VoucherLine, self).default_get(cr, uid, fields, context) self.voucher_context = context return data
ab1423b7f3a0860088715f85782ab9044241f25f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ab1423b7f3a0860088715f85782ab9044241f25f/account_voucher_payment.py
res = super(VoucherLine, self).move_line_get_item(cr, uid, line, context)
res = super(account_voucher_line, self).move_line_get_item(cr, uid, line, context)
def move_line_get_item(self, cr, uid, line, context={}): res = super(VoucherLine, self).move_line_get_item(cr, uid, line, context) res['invoice'] = line.invoice_id or False return res
ab1423b7f3a0860088715f85782ab9044241f25f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ab1423b7f3a0860088715f85782ab9044241f25f/account_voucher_payment.py
VoucherLine()
account_voucher_line()
def onchange_line_account(self, cr, uid, ids, account_id, type, type1): if not account_id: return {'value' : {'account_id' : False, 'type' : False ,'amount':False}} obj = self.pool.get('account.account') acc_id = False if type1 in ('rec_voucher','bank_rec_voucher', 'journal_voucher'): acc_id = obj.browse(cr, uid, acco...
ab1423b7f3a0860088715f85782ab9044241f25f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ab1423b7f3a0860088715f85782ab9044241f25f/account_voucher_payment.py
def action_cancel(self, cr, uid, ids, *args): res = super(account_invoice, self).action_cancel(cr, uid, ids, *args) invoices = self.read(cr, uid, ids, ['move_id']) voucher_db = self.pool.get('account.voucher') voucher_ids = voucher_db.search(cr, uid, []) voucher_obj = voucher_db.browse(cr, uid, voucher_ids) move_db =...
ab1423b7f3a0860088715f85782ab9044241f25f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ab1423b7f3a0860088715f85782ab9044241f25f/account_voucher_payment.py
def action_cancel(self, cr, uid, ids, *args): res = super(account_invoice, self).action_cancel(cr, uid, ids, *args) invoices = self.read(cr, uid, ids, ['move_id']) voucher_db = self.pool.get('account.voucher') voucher_ids = voucher_db.search(cr, uid, []) voucher_obj = voucher_db.browse(cr, uid, voucher_ids) move_db =...
ab1423b7f3a0860088715f85782ab9044241f25f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ab1423b7f3a0860088715f85782ab9044241f25f/account_voucher_payment.py
def action_cancel(self, cr, uid, ids, *args): res = super(account_invoice, self).action_cancel(cr, uid, ids, *args) invoices = self.read(cr, uid, ids, ['move_id']) voucher_db = self.pool.get('account.voucher') voucher_ids = voucher_db.search(cr, uid, []) voucher_obj = voucher_db.browse(cr, uid, voucher_ids) move_db =...
ab1423b7f3a0860088715f85782ab9044241f25f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ab1423b7f3a0860088715f85782ab9044241f25f/account_voucher_payment.py
if (vals.has_key('project_id') and vals['project_id']) or (vals.has_key('name') and vals['name']):
if vals.get('project_id',False) or vals.get('name',False):
def write(self, cr, uid, ids,vals,context=None): if context is None: context = {} if (vals.has_key('project_id') and vals['project_id']) or (vals.has_key('name') and vals['name']): vals_line = {} hr_anlytic_timesheet = self.pool.get('hr.analytic.timesheet') task_obj_l = self.browse(cr, uid, ids, context) if (vals.has_k...
06740e3519efb2932d4527d922c885f740579ef9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/06740e3519efb2932d4527d922c885f740579ef9/project_timesheet.py
if (vals.has_key('project_id') and vals['project_id']):
if vals.get('project_id',False):
def write(self, cr, uid, ids,vals,context=None): if context is None: context = {} if (vals.has_key('project_id') and vals['project_id']) or (vals.has_key('name') and vals['name']): vals_line = {} hr_anlytic_timesheet = self.pool.get('hr.analytic.timesheet') task_obj_l = self.browse(cr, uid, ids, context) if (vals.has_k...
06740e3519efb2932d4527d922c885f740579ef9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/06740e3519efb2932d4527d922c885f740579ef9/project_timesheet.py
line_id = task_work.hr_analytic_timesheet_id if (vals.has_key('project_id') and vals['project_id']):
line_id = task_work.hr_analytic_timesheet_id.id if vals.get('project_id',False):
def write(self, cr, uid, ids,vals,context=None): if context is None: context = {} if (vals.has_key('project_id') and vals['project_id']) or (vals.has_key('name') and vals['name']): vals_line = {} hr_anlytic_timesheet = self.pool.get('hr.analytic.timesheet') task_obj_l = self.browse(cr, uid, ids, context) if (vals.has_k...
06740e3519efb2932d4527d922c885f740579ef9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/06740e3519efb2932d4527d922c885f740579ef9/project_timesheet.py
if (vals.has_key('name') and vals['name']):
if vals.get('name',False):
def write(self, cr, uid, ids,vals,context=None): if context is None: context = {} if (vals.has_key('project_id') and vals['project_id']) or (vals.has_key('name') and vals['name']): vals_line = {} hr_anlytic_timesheet = self.pool.get('hr.analytic.timesheet') task_obj_l = self.browse(cr, uid, ids, context) if (vals.has_k...
06740e3519efb2932d4527d922c885f740579ef9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/06740e3519efb2932d4527d922c885f740579ef9/project_timesheet.py
AND (aal.account_id IN aal.account_id IN %s)\
AND (aal.account_id IN %s)\
def _lines_g(self, account_id, date1, date2): account_analytic_obj = self.pool.get('account.analytic.account') ids = account_analytic_obj.search(self.cr, self.uid, [('parent_id', 'child_of', [account_id])]) self.cr.execute("SELECT aa.name AS name, aa.code AS code, \ sum(aal.amount) AS balance, sum(aal.unit_amount) AS q...
5593aa4e654da0580a5e968c9bcb1a31a1257196 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5593aa4e654da0580a5e968c9bcb1a31a1257196/analytic_balance.py
def _move_sum(self, account_id, date1, date2, option): if account_id not in self.acc_data_dict: account_analytic_obj = self.pool.get('account.analytic.account') ids = account_analytic_obj.search(self.cr, self.uid,[('parent_id', 'child_of', [account_id])]) self.acc_data_dict[account_id] = ids else: ids = self.acc_data_d...
5593aa4e654da0580a5e968c9bcb1a31a1257196 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5593aa4e654da0580a5e968c9bcb1a31a1257196/analytic_balance.py
raise osv.except_osv(_('Invalid action !'),
raise osv.except_osv(_('Invalid action !'),
def unlink(self, cr, uid, ids, context=None): procurements = self.read(cr, uid, ids, ['state']) unlink_ids = [] for s in procurements: if s['state'] in ['draft','cancel']: unlink_ids.append(s['id']) else: raise osv.except_osv(_('Invalid action !'), _('Cannot delete Procurement Order(s) which are in %s State!') % \ s['s...
be16348523df3d3f4769b71419d143ad492f98b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be16348523df3d3f4769b71419d143ad492f98b4/procurement.py
return all(procurement.move_id.state == 'done' for procurement in self.browse(cr, uid, ids))
res = True for proc in self.browse(cr, uid, ids, context): if proc.move_id: if not proc.move_id.state=='done': res = False return res
def check_move_done(self, cr, uid, ids, context={}): """ Checks if move is done or not. @return: True or False. """ return all(procurement.move_id.state == 'done' for procurement in self.browse(cr, uid, ids))
be16348523df3d3f4769b71419d143ad492f98b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be16348523df3d3f4769b71419d143ad492f98b4/procurement.py
cr.execute('update procurement_order set message=%s where id=%s',
cr.execute('update procurement_order set message=%s where id=%s',
def check_buy(self, cr, uid, ids): """ Checks product type. @return: True or Product Id. """ user = self.pool.get('res.users').browse(cr, uid, uid) partner_obj = self.pool.get('res.partner') for procurement in self.browse(cr, uid, ids): if procurement.product_id.product_tmpl_id.supply_method <> 'buy': return False if n...
be16348523df3d3f4769b71419d143ad492f98b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be16348523df3d3f4769b71419d143ad492f98b4/procurement.py
cr.execute('update procurement_order set message=%s where id=%s',
cr.execute('update procurement_order set message=%s where id=%s',
def check_buy(self, cr, uid, ids): """ Checks product type. @return: True or Product Id. """ user = self.pool.get('res.users').browse(cr, uid, uid) partner_obj = self.pool.get('res.partner') for procurement in self.browse(cr, uid, ids): if procurement.product_id.product_tmpl_id.supply_method <> 'buy': return False if n...
be16348523df3d3f4769b71419d143ad492f98b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be16348523df3d3f4769b71419d143ad492f98b4/procurement.py
raise osv.except_osv(_('Data Insufficient !'),
raise osv.except_osv(_('Data Insufficient !'),
def action_confirm(self, cr, uid, ids, context={}): """ Confirms procurement and writes exception message if any. @return: True """ move_obj = self.pool.get('stock.move') for procurement in self.browse(cr, uid, ids): if procurement.product_qty <= 0.00: raise osv.except_osv(_('Data Insufficient !'), _('Please check the ...
be16348523df3d3f4769b71419d143ad492f98b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be16348523df3d3f4769b71419d143ad492f98b4/procurement.py
self.write(cr, uid, ids, {'state': 'running',
self.write(cr, uid, ids, {'state': 'running',
def action_move_assigned(self, cr, uid, ids, context={}): """ Changes procurement state to Running and writes message. @return: True """ self.write(cr, uid, ids, {'state': 'running', 'message': _('from stock: products assigned.')}) return True
be16348523df3d3f4769b71419d143ad492f98b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be16348523df3d3f4769b71419d143ad492f98b4/procurement.py
cr.execute('update procurement_order set message=%s where id=%s', (_('Not enough stock and no minimum orderpoint rule defined.'),
cr.execute('update procurement_order set message=%s where id=%s', (_('Not enough stock and no minimum orderpoint rule defined.'),
def _check_make_to_stock_product(self, cr, uid, procurement, context={}): """ Checks procurement move state. @param procurement: Current procurement. @return: True or move id. """ ok = True if procurement.move_id: id = procurement.move_id.id if not (procurement.move_id.state in ('done','assigned','cancel')): ok = ok an...
be16348523df3d3f4769b71419d143ad492f98b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be16348523df3d3f4769b71419d143ad492f98b4/procurement.py
def test_finished(self, cursor, user, ids): wf_service = netsvc.LocalService("workflow") res = super(StockPicking, self).test_finished(cursor, user, ids) for picking in self.browse(cursor, user, ids): for move in picking.move_lines: if move.state == 'done' and move.procurements: for procurement in move.procurements: wf...
be16348523df3d3f4769b71419d143ad492f98b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be16348523df3d3f4769b71419d143ad492f98b4/procurement.py
('qty_multiple_check', 'CHECK( qty_multiple > 0 )',
('qty_multiple_check', 'CHECK( qty_multiple > 0 )',
def test_finished(self, cursor, user, ids): wf_service = netsvc.LocalService("workflow") res = super(StockPicking, self).test_finished(cursor, user, ids) for picking in self.browse(cursor, user, ids): for move in picking.move_lines: if move.state == 'done' and move.procurements: for procurement in move.procurements: wf...
be16348523df3d3f4769b71419d143ad492f98b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be16348523df3d3f4769b71419d143ad492f98b4/procurement.py
def onchange_warehouse_id(self, cr, uid, ids, warehouse_id, context={}): """ Finds location id for changed warehouse. @param warehouse_id: Changed id of warehouse. @return: Dictionary of values. """ if warehouse_id: w = self.pool.get('stock.warehouse').browse(cr, uid, warehouse_id, context) v = {'location_id': w.lot_st...
be16348523df3d3f4769b71419d143ad492f98b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be16348523df3d3f4769b71419d143ad492f98b4/procurement.py
def onchange_product_id(self, cr, uid, ids, product_id, context={}): """ Finds UoM for changed product. @param product_id: Changed id of product. @return: Dictionary of values. """ if product_id: prod = self.pool.get('product.product').browse(cr,uid,product_id) v = {'product_uom': prod.uom_id.id} return {'value': v} re...
be16348523df3d3f4769b71419d143ad492f98b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be16348523df3d3f4769b71419d143ad492f98b4/procurement.py
def copy(self, cr, uid, id, default=None,context={}): if not default: default = {} default.update({ 'name': self.pool.get('ir.sequence').get(cr, uid, 'stock.orderpoint') or '', }) return super(stock_warehouse_orderpoint, self).copy(cr, uid, id, default, context)
be16348523df3d3f4769b71419d143ad492f98b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be16348523df3d3f4769b71419d143ad492f98b4/procurement.py
('other','Others'), ],'Type', select=True),
('leaves','Leaves'), ('advance','Advance'), ('loan','Loan'), ('installment','Loan Installment'), ('otherpay','Other Payment'), ('otherdeduct','Other Deduction'), ],'Type', select=True, required=True),
def _total(self, cr, uid, ids, field_names, arg, context=None): if context is None: context = {} res={} for line in self.browse(cr, uid, ids, context=context): res[line.id] = line.emp_deduction + line.comp_deduction return res
52462287f3027f98bcfae6ee920c037e9c3d1c34 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/52462287f3027f98bcfae6ee920c037e9c3d1c34/hr_payroll.py
'code':fields.char('Code', size=64, required=False, readonly=False),
'code': fields.related('head_id','code', type='char', relation='hr.allounce.deduction.categoty', string='Code'),
def compute(self, cr, uid, id, value, context={}): contrib = self.browse(cr, uid, id, context) if contrib.amount_type == 'fix': return contrib.contribute_per elif contrib.amount_type == 'per': return value * contrib.contribute_per elif contrib.amount_type == 'func': return self._execute_function(cr, uid, id, value, con...
52462287f3027f98bcfae6ee920c037e9c3d1c34 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/52462287f3027f98bcfae6ee920c037e9c3d1c34/hr_payroll.py
'code':fields.char('Code', size=64, required=False, readonly=False),
'code':fields.char('Code', size=64, required=False, readonly=False), 'category_id':fields.many2one('hr.allounce.deduction.categoty', 'Category', required=True),
def onchange_amount(self, cr, uid, ids, amount, typ): amt = amount if typ and typ == 'per': if int(amt) > 0: amt = amt / 100 return {'value':{'amount':amt}}
52462287f3027f98bcfae6ee920c037e9c3d1c34 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/52462287f3027f98bcfae6ee920c037e9c3d1c34/hr_payroll.py
'category_id':fields.many2one('hr.allounce.deduction.categoty', 'Category', required=True),
def onchange_amount(self, cr, uid, ids, amount, typ): amt = amount if typ and typ == 'per': if int(amt) > 0: amt = amt / 100 return {'value':{'amount':amt}}
52462287f3027f98bcfae6ee920c037e9c3d1c34 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/52462287f3027f98bcfae6ee920c037e9c3d1c34/hr_payroll.py
],'Amount Type', select=True),
],'Amount Type', select=True, required=True),
def onchange_amount(self, cr, uid, ids, amount, typ): amt = amount if typ and typ == 'per': if int(amt) > 0: amt = amt / 100 return {'value':{'amount':amt}}
52462287f3027f98bcfae6ee920c037e9c3d1c34 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/52462287f3027f98bcfae6ee920c037e9c3d1c34/hr_payroll.py
if cnt:
if not cnt:
def _result_get(x, keys): if x[1] in keys: return False keys.append(x[1]) if x[3]: model,id = x[2].split(',') id = int(id) fields = self.pool.get(model).fields_get_keys(cr, uid) pos = 0 while pos<len(fields): if fields[pos] in ('report_sxw_content', 'report_rml_content', 'report_sxw', 'report_rml', 'report_sxw_content_...
fa369ce13c73f32d8763e070322821cfd6a81789 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fa369ce13c73f32d8763e070322821cfd6a81789/ir_values.py
'arch': '<?xml version="1.0"?>\n<tree string="Unknwown">\n\t<field name="name"/>\n</tree>',
'arch': '<?xml version="1.0"?>\n<tree string="My view">\n\t<field name="name"/>\n</tree>',
def _check_xml(self, cr, uid, ids, context={}): for view in self.browse(cr, uid, ids, context): eview = etree.fromstring(view.arch.encode('utf8')) frng = tools.file_open(os.path.join('base','rng','view.rng')) relaxng_doc = etree.parse(frng) relaxng = etree.RelaxNG(relaxng_doc) if not relaxng.validate(eview): logger = n...
c121703c6d7a06b3e5f24eb7453555fb59d793e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c121703c6d7a06b3e5f24eb7453555fb59d793e2/ir_ui_view.py
res[line.id] = float(line.practical_amount or 0.0 / line.theoritical_amount) * 100
res[line.id] = float((line.practical_amount or 0.0) / line.theoritical_amount) * 100
def _perc(self, cr, uid, ids, name, args, context): res = {} for line in self.browse(cr, uid, ids): if line.theoritical_amount <> 0.00: res[line.id] = float(line.practical_amount or 0.0 / line.theoritical_amount) * 100 else: res[line.id] = 0.00 return res
2be2c91eff7d2c0616d61058eddc7c636e9b7123 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2be2c91eff7d2c0616d61058eddc7c636e9b7123/account_budget.py
uom = False, partner_id = sale.partner_id.id, fiscal_position = sale.fiscal_position.id)
uom = False, partner_id = sale.partner_id.id, fposition_id = sale.fiscal_position.id)
def create_invoices(self, cr, uid, ids, context={}): """ To create invoices.
1e839d87977dd845d70d5633acf70bb08a16ce41 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1e839d87977dd845d70d5633acf70bb08a16ce41/sale_make_invoice_advance.py
if childs: for f in node:
for f in node: if childs or (node.tag == 'field' and f.tag in ('filter','separator')):
def check_group(node): if node.get('groups'): groups = node.get('groups').split(',') access_pool = self.pool.get('ir.model.access') can_see = any(access_pool.check_groups(cr, user, group) for group in groups) if not can_see: node.set('invisible', '1') if 'attrs' in node.attrib: del(node.attrib['attrs']) #avoid making f...
794c319ec9864fa404a404066f6e5f5c47272212 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/794c319ec9864fa404a404066f6e5f5c47272212/orm.py
"""Add what's missing in ``query`` to implement all appropriate ir.rules
"""Add what's missing in ``query`` to implement all appropriate ir.rules
def _apply_ir_rules(self, cr, uid, query, mode='read', context=None): """Add what's missing in ``query`` to implement all appropriate ir.rules (using the ``model_name``'s rules or the current model's rules if ``model_name`` is None)
794c319ec9864fa404a404066f6e5f5c47272212 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/794c319ec9864fa404a404066f6e5f5c47272212/orm.py
def _generate_m2o_order_by(self, order_field, query): """ Add possibly missing JOIN to ``query`` and generate the ORDER BY clause for m2o fields, either native m2o fields or function/related fields that are stored, including intermediate JOINs for inheritance if required.
794c319ec9864fa404a404066f6e5f5c47272212 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/794c319ec9864fa404a404066f6e5f5c47272212/orm.py
if data_holiday[0].holiday_status_id.double_validation:
if not data_holiday[0].holiday_status_id.double_validation:
def holidays_validate(self, cr, uid, ids, *args): data_holiday = self.browse(cr, uid, ids) self.check_holidays(cr, uid, ids) if data_holiday[0].holiday_status_id.double_validation: vals = {'state':'validate1'} else: vals = {'state':'validate'} ids2 = self.pool.get('hr.employee').search(cr, uid, [('user_id','=', uid)]) ...
ee2e1acc780f9a33c3278d7f059fcdc2f8bef1ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ee2e1acc780f9a33c3278d7f059fcdc2f8bef1ed/hr_holidays.py
if not context:
if context is None:
def copy_data(self, cr, uid, id, default=None, context=None): """ Copy given record's data with all its fields values
89e7934e7df3be2c7029e87b9faf5c389bb4a5b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/89e7934e7df3be2c7029e87b9faf5c389bb4a5b5/orm.py
if not default:
if default is None:
def copy_data(self, cr, uid, id, default=None, context=None): """ Copy given record's data with all its fields values
89e7934e7df3be2c7029e87b9faf5c389bb4a5b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/89e7934e7df3be2c7029e87b9faf5c389bb4a5b5/orm.py
data = self.read(cr, uid, [id], context=context)[0]
context_wo_lang = context if 'lang' in context: del context_wo_lang['lang'] data = self.read(cr, uid, [id], context=context_wo_lang)[0]
def copy_data(self, cr, uid, id, default=None, context=None): """ Copy given record's data with all its fields values
89e7934e7df3be2c7029e87b9faf5c389bb4a5b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/89e7934e7df3be2c7029e87b9faf5c389bb4a5b5/orm.py
trans_name=''
def copy_data(self, cr, uid, id, default=None, context=None): """ Copy given record's data with all its fields values
89e7934e7df3be2c7029e87b9faf5c389bb4a5b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/89e7934e7df3be2c7029e87b9faf5c389bb4a5b5/orm.py
trans_flag=True
trans_name = ''
def copy_data(self, cr, uid, id, default=None, context=None): """ Copy given record's data with all its fields values
89e7934e7df3be2c7029e87b9faf5c389bb4a5b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/89e7934e7df3be2c7029e87b9faf5c389bb4a5b5/orm.py
trans_name=self._name+","+f
trans_name = self._name+","+f
def copy_data(self, cr, uid, id, default=None, context=None): """ Copy given record's data with all its fields values
89e7934e7df3be2c7029e87b9faf5c389bb4a5b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/89e7934e7df3be2c7029e87b9faf5c389bb4a5b5/orm.py
trans_name=self._inherit_fields[f][0]+","+f else: trans_flag=False if trans_flag:
trans_name = self._inherit_fields[f][0] + "," + f if trans_name:
def copy_data(self, cr, uid, id, default=None, context=None): """ Copy given record's data with all its fields values
89e7934e7df3be2c7029e87b9faf5c389bb4a5b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/89e7934e7df3be2c7029e87b9faf5c389bb4a5b5/orm.py
if v == None: r[key] = False if key in self._columns.keys(): type = self._columns[key]._type elif key in self._inherit_fields.keys(): type = self._inherit_fields[key][2]._type
if key in self._columns: column = self._columns[key] elif key in self._inherit_fields: column = self._inherit_fields[key][2]
def read(self, cr, user, ids, fields=None, context=None, load='_classic_read'): """ Read records with given ids with the given fields
5b146e80623363f66d775fb7088daa02a541a9d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5b146e80623363f66d775fb7088daa02a541a9d7/orm.py
if type == 'reference' and v: model,ref_id = v.split(',') table = self.pool.get(model)._table cr.execute('select id from "%s" where id=%s' % (table,ref_id)) id_exist = cr.fetchone() if not id_exist: cr.execute('update "'+self._table+'" set "'+key+'"=NULL where "%s"=%s' %(key,''.join("'"+str(v)+"'"))) r[key] = ''
if v and column._type == 'reference': model_name, ref_id = v.split(',', 1) model = self.pool.get(model_name) if not model: reset = True else: cr.execute('SELECT count(1) FROM "%s" WHERE id=%%s' % (model._table,), (ref_id,)) reset = not cr.fetchone()[0] if reset: if column._classic_write: query = 'UPDATE "%s" SET "%s"=N...
def read(self, cr, user, ids, fields=None, context=None, load='_classic_read'): """ Read records with given ids with the given fields
5b146e80623363f66d775fb7088daa02a541a9d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5b146e80623363f66d775fb7088daa02a541a9d7/orm.py
cr.execute("DELETE FROM account_invoice_tax WHERE invoice_id=%s", (id,))
cr.execute("DELETE FROM account_invoice_tax WHERE invoice_id=%s AND manual is False", (id,))
def button_reset_taxes(self, cr, uid, ids, context=None): if context is None: context = {} ctx = context.copy() ait_obj = self.pool.get('account.invoice.tax') for id in ids: cr.execute("DELETE FROM account_invoice_tax WHERE invoice_id=%s", (id,)) partner = self.browse(cr, uid, id, context=ctx).partner_id if partner.lan...
18f7655f915f94fd8771e8c2c8a8d9ab3f45a728 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18f7655f915f94fd8771e8c2c8a8d9ab3f45a728/invoice.py
'opp_id': opp.id
'opportunity_id': opp.id
def action_apply(self, cr, uid, ids, context=None): """ This converts Opportunity to Phonecall and opens Phonecall view @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 Opportunity to Phonecall IDs @param con...
9c62ee0c241dffab2dae0d0ebee27b64fd8084e6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9c62ee0c241dffab2dae0d0ebee27b64fd8084e6/crm_opportunity_to_phonecall.py
[('segment_id.campaign_id', '=', ca_obj.campaign_id.id)])
[('segment_id.campaign_id', '=', ca_obj.campaign_id.id)])
def _total_cost(self, cr, uid, ids, field_name, arg, context={}):
b6abea96454292526d0e63cef0cd1599b427f580 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b6abea96454292526d0e63cef0cd1599b427f580/campaign_analysis.py
type='many2one', relation='res.country', string='Country'),
type='many2one', relation='res.country',string='Country'), 'total_cost' : fields.function(_total_cost, string='Cost', method=True, type="float", store=True), 'revenue': fields.float('Revenue',readonly=True),
def _total_cost(self, cr, uid, ids, field_name, arg, context={}):
b6abea96454292526d0e63cef0cd1599b427f580 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b6abea96454292526d0e63cef0cd1599b427f580/campaign_analysis.py
'total_cost': fields.function(_total_cost, string='Cost', method=True, type="float"), 'revenue': fields.float('Revenue',readonly=True),
def _total_cost(self, cr, uid, ids, field_name, arg, context={}):
b6abea96454292526d0e63cef0cd1599b427f580 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b6abea96454292526d0e63cef0cd1599b427f580/campaign_analysis.py
if task.name.startswith(_('CHECK: ')): newname = str(task.name).replace(_('CHECK: '), '')
if task_name.startswith(_('CHECK: ')): newname = str(task_name).replace(_('CHECK: '), '')
def default_get(self, cr, uid, fields, context=None): """ This function gets default values """ res = super(project_task_delegate, self).default_get(cr, uid, fields, context=context) if context is None: context = {} record_id = context and context.get('active_id', False) or False task_pool = self.pool.get('project.task...
bdb8814237c28f0b296cd7173dc580aa48e85b69 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bdb8814237c28f0b296cd7173dc580aa48e85b69/project_task_delegate.py
newname = task.name or ''
newname = task_name or ''
def default_get(self, cr, uid, fields, context=None): """ This function gets default values """ res = super(project_task_delegate, self).default_get(cr, uid, fields, context=context) if context is None: context = {} record_id = context and context.get('active_id', False) or False task_pool = self.pool.get('project.task...
bdb8814237c28f0b296cd7173dc580aa48e85b69 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bdb8814237c28f0b296cd7173dc580aa48e85b69/project_task_delegate.py
if task.name.startswith(_('CHECK: ')): newname = str(task.name).replace(_('CHECK: '), '')
if task_name.startswith(_('CHECK: ')): newname = str(task_name).replace(_('CHECK: '), '')
def default_get(self, cr, uid, fields, context=None): """ This function gets default values """ res = super(project_task_delegate, self).default_get(cr, uid, fields, context=context) if context is None: context = {} record_id = context and context.get('active_id', False) or False task_pool = self.pool.get('project.task...
bdb8814237c28f0b296cd7173dc580aa48e85b69 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bdb8814237c28f0b296cd7173dc580aa48e85b69/project_task_delegate.py
newname = task.name or ''
newname = task_name or ''
def default_get(self, cr, uid, fields, context=None): """ This function gets default values """ res = super(project_task_delegate, self).default_get(cr, uid, fields, context=context) if context is None: context = {} record_id = context and context.get('active_id', False) or False task_pool = self.pool.get('project.task...
bdb8814237c28f0b296cd7173dc580aa48e85b69 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bdb8814237c28f0b296cd7173dc580aa48e85b69/project_task_delegate.py
return '!workflow {model: %s, action: %s ref: %s}:' % (str(self.model,), str(self.action,), str(self.ref,))
return '!workflow {model: %s, action: %s, ref: %s}' % (str(self.model,), str(self.action,), str(self.ref,))
def __repr__(self): return '!workflow {model: %s, action: %s ref: %s}:' % (str(self.model,), str(self.action,), str(self.ref,))
986a1dbdbf2793ba0d205d6feaf730d0bbafbc0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/986a1dbdbf2793ba0d205d6feaf730d0bbafbc0c/base_module_record.py
def _check_qty(self, cr, uid, ids): lines = self.browse(cr, uid, ids) for line in lines: if line.qty <= 0: return False return True _constraints = [ (_check_qty, 'Order quantity cannot be negative or zero !', ['qty']), ]
def onchange_discount(self, cr, uid,ids, discount,price,*a): pos_order = self.pool.get('pos.order.line') res_obj = self.pool.get('res.users') res_company = self.pool.get('res.company') company_disc = pos_order.browse(cr,uid,ids) if discount: if not company_disc: comp=res_obj.browse(cr,uid,uid).company_id.company_discou...
93ea7917bf76791b50b940d44964aafdd7d14237 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/93ea7917bf76791b50b940d44964aafdd7d14237/pos.py
if (maxdate.strftime('%Y-%m-%d')>=proc.date_planned) or (proc.procure_method=='make_to_order'):
if (maxdate.strftime('%Y-%m-%d')>=proc.date_planned):
def _procure_confirm(self, cr, uid, ids=None, use_new_cursor=False, context=None): ''' use_new_cursor: False or the dbname ''' if not context: context = {}
b3dd6bad347f11f2bebaeaa8d98f82eb43848c64 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b3dd6bad347f11f2bebaeaa8d98f82eb43848c64/schedulers.py
if ((maxdate).strftime('%Y-%m-%d') >= proc.date_planned) or (proc.procure_method=='make_to_order'):
if ((maxdate).strftime('%Y-%m-%d') >= proc.date_planned) :
def _procure_confirm(self, cr, uid, ids=None, use_new_cursor=False, context=None): ''' use_new_cursor: False or the dbname ''' if not context: context = {}
b3dd6bad347f11f2bebaeaa8d98f82eb43848c64 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b3dd6bad347f11f2bebaeaa8d98f82eb43848c64/schedulers.py
if sub_model_object_field: copy_val += "." + sub_model_object_field if null_value: copy_val += " or '''%s'''" % null_value if model_object_field:
if sub_model_object_field: copy_val += "." + sub_model_object_field if null_value: copy_val += " or '''%s'''" % null_value
def compute_pl(self, model_object_field, sub_model_object_field, null_value, template_language='mako'): """ Returns the expression based on data provided @param model_object_field: First level field @param sub_model_object_field: Second level drilled down field (M2O) @param null_value: What has to be returned if the va...
7bf6844f10fc9278901f8e2a61e83df166f8241c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7bf6844f10fc9278901f8e2a61e83df166f8241c/email_template.py
if sub_model_object_field: copy_val += "." + sub_model_object_field if null_value: copy_val = copy_val + "|default:'''%s'''" % null_value copy_val = copy_val + "}}"
if sub_model_object_field: copy_val += "." + sub_model_object_field if null_value: copy_val = copy_val + "|default:'''%s'''" % null_value copy_val = copy_val + "}}"
def compute_pl(self, model_object_field, sub_model_object_field, null_value, template_language='mako'): """ Returns the expression based on data provided @param model_object_field: First level field @param sub_model_object_field: Second level drilled down field (M2O) @param null_value: What has to be returned if the va...
7bf6844f10fc9278901f8e2a61e83df166f8241c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7bf6844f10fc9278901f8e2a61e83df166f8241c/email_template.py
if fill_inventory.set_stock_zero: amount = 0 else: amount = stock_location_obj._product_get(cr, uid,
amount = stock_location_obj._product_get(cr, uid,
def fill_inventory(self, cr, uid, ids, context): """ To Import stock inventory according to products available in the selected locations. @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 context...
7027a0130a5d56bb804004ea8e572de930a5ca48 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7027a0130a5d56bb804004ea8e572de930a5ca48/stock_fill_inventory.py
assert(mode in ('debit', 'credit'), 'Invalid Mode')
assert mode in ('debit', 'credit'), 'Invalid Mode'
def _centralise(self, cr, uid, move, mode, context=None): assert(mode in ('debit', 'credit'), 'Invalid Mode') #to prevent sql injection if context is None: context = {}
7ba4b880bcd7507ba58b684386d692d375105a5e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7ba4b880bcd7507ba58b684386d692d375105a5e/account.py
self.precision_get.clear_cache(cr.dbname)
def write(self, cr, uid, ids, data, *args, **argv): self.precision_get.clear_cache(cr.dbname) res = super(decimal_precision, self).write(cr, uid, ids, data, *args, **argv) for obj in self.pool.obj_list(): for colname,col in self.pool.get(obj)._columns.items(): if isinstance(col, fields.float): col.digits_change(cr) ret...
2a3ee6ed48f5c11cec12b162ff1535c2fe239eac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2a3ee6ed48f5c11cec12b162ff1535c2fe239eac/decimal_precision.py
def _get_survey(self, cr, uid, context=None): """ Set the value In survey_id field.
00b3aab1604b276733eb554e4f61decb0ead3313 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/00b3aab1604b276733eb554e4f61decb0ead3313/survey_selection.py
@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks,
def on_change_survey(self, cr, uid, ids, survey_id, context=None): """ on change event of survey_id field, if note is available in selected survey then display this note in note fields.
00b3aab1604b276733eb554e4f61decb0ead3313 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/00b3aab1604b276733eb554e4f61decb0ead3313/survey_selection.py
result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter')
result = mod_obj._get_id(cr, uid, 'crm', 'view_crm_case_phonecalls_filter')
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) phonecall_case_obj = pool.get('hr.phonecall') job_case_obj = pool.g...
458d8c28ef774c4a4d5516935a73b3779310078f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/458d8c28ef774c4a4d5516935a73b3779310078f/hr_recruitment_wizard.py
phonecall_case_obj = pool.get('hr.phonecall')
phonecall_case_obj = pool.get('crm.phonecall')
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) phonecall_case_obj = pool.get('hr.phonecall') job_case_obj = pool.g...
458d8c28ef774c4a4d5516935a73b3779310078f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/458d8c28ef774c4a4d5516935a73b3779310078f/hr_recruitment_wizard.py
id2 = data_obj._get_id(cr, uid, 'hr', 'hr_case_phone_tree_view') id3 = data_obj._get_id(cr, uid, 'hr', 'hr_case_phone_form_view')
id2 = data_obj._get_id(cr, uid, 'crm', 'crm_case_phone_tree_view') id3 = data_obj._get_id(cr, uid, 'crm', 'crm_case_phone_form_view')
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) phonecall_case_obj = pool.get('hr.phonecall') job_case_obj = pool.g...
458d8c28ef774c4a4d5516935a73b3779310078f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/458d8c28ef774c4a4d5516935a73b3779310078f/hr_recruitment_wizard.py
if not job.case_id: vals.update({'phonecall_id' : new_phonecall.id})
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) phonecall_case_obj = pool.get('hr.phonecall') job_case_obj = pool.g...
458d8c28ef774c4a4d5516935a73b3779310078f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/458d8c28ef774c4a4d5516935a73b3779310078f/hr_recruitment_wizard.py
'res_model': 'hr.phonecall',
'res_model': 'crm.phonecall',
def _doIt(self, cr, uid, data, context): form = data['form'] pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter') res = mod_obj.read(cr, uid, result, ['res_id']) phonecall_case_obj = pool.get('hr.phonecall') job_case_obj = pool.g...
458d8c28ef774c4a4d5516935a73b3779310078f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/458d8c28ef774c4a4d5516935a73b3779310078f/hr_recruitment_wizard.py
'name': case.partner_name2,
'name': case.partner_name,
def _makeOrder(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) mod_obj = pool.get('ir.model.data') result = mod_obj._get_id(cr, uid, 'base', 'view_res_partner_filter') res = mod_obj.read(cr, uid, result, ['res_id']) case_obj = pool.get('hr.applicant') partner_obj = pool.get('res.partner') contact_obj =...
458d8c28ef774c4a4d5516935a73b3779310078f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/458d8c28ef774c4a4d5516935a73b3779310078f/hr_recruitment_wizard.py
def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount,company_id,
def on_change_unit_amount(self, cr, uid, id, prod_id, quantity, company_id,
def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount,company_id, unit=False, journal_id=False, context=None): if context==None: context={} uom_obj = self.pool.get('product.uom') product_obj = self.pool.get('product.product') company_obj=self.pool.get('res.company') analytic_journal_obj=self.pool.get('accou...
cad3242b7fecb1c706a62e51a0213b9ed4c1923f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cad3242b7fecb1c706a62e51a0213b9ed4c1923f/account_analytic_line.py
uom_obj = self.pool.get('product.uom')
if not journal_id or not prod_id: return {}
def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount,company_id, unit=False, journal_id=False, context=None): if context==None: context={} uom_obj = self.pool.get('product.uom') product_obj = self.pool.get('product.product') company_obj=self.pool.get('res.company') analytic_journal_obj=self.pool.get('accou...
cad3242b7fecb1c706a62e51a0213b9ed4c1923f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cad3242b7fecb1c706a62e51a0213b9ed4c1923f/account_analytic_line.py
company_obj=self.pool.get('res.company') analytic_journal_obj=self.pool.get('account.analytic.journal') product_price_type_obj = self.pool.get('product.price.type') if prod_id: result = 0.0 prod = product_obj.browse(cr, uid, prod_id)
analytic_journal_obj =self.pool.get('account.analytic.journal') j_id = analytic_journal_obj.browse(cr, uid, journal_id, context=context) prod = product_obj.browse(cr, uid, prod_id) if not company_id: company_id = j_id.company_id.id result = 0.0 is_purchase = False if j_id.type == 'purchase':
def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount,company_id, unit=False, journal_id=False, context=None): if context==None: context={} uom_obj = self.pool.get('product.uom') product_obj = self.pool.get('product.product') company_obj=self.pool.get('res.company') analytic_journal_obj=self.pool.get('accou...
cad3242b7fecb1c706a62e51a0213b9ed4c1923f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cad3242b7fecb1c706a62e51a0213b9ed4c1923f/account_analytic_line.py
if not company_id: company_id=company_obj._company_default_get(cr, uid, 'account.analytic.line', context) flag = False pricetype=product_price_type_obj.browse(cr, uid, company_obj.browse(cr,uid,company_id).property_valuation_price_type.id) if journal_id: journal = analytic_journal_obj.browse(cr, uid, journal_id) if jo...
amount_unit = prod.price_get('standard_price', context)[prod.id] is_purchase = True else: a = prod.product_tmpl_id.property_account_income.id if not a: a = prod.categ_id.property_account_income_categ.id if not a: raise osv.except_osv(_('Error !'), _('There is no income account defined ' \ 'for this product: "%s" (id:%...
def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount,company_id, unit=False, journal_id=False, context=None): if context==None: context={} uom_obj = self.pool.get('product.uom') product_obj = self.pool.get('product.product') company_obj=self.pool.get('res.company') analytic_journal_obj=self.pool.get('accou...
cad3242b7fecb1c706a62e51a0213b9ed4c1923f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cad3242b7fecb1c706a62e51a0213b9ed4c1923f/account_analytic_line.py
}} return {}
} }
def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount,company_id, unit=False, journal_id=False, context=None): if context==None: context={} uom_obj = self.pool.get('product.uom') product_obj = self.pool.get('product.product') company_obj=self.pool.get('res.company') analytic_journal_obj=self.pool.get('accou...
cad3242b7fecb1c706a62e51a0213b9ed4c1923f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cad3242b7fecb1c706a62e51a0213b9ed4c1923f/account_analytic_line.py
print "CUUULLL" print move.prodlot_id.id
def __create_partial_move_memory(self, move): print "CUUULLL" print move.prodlot_id.id move_memory = { 'product_id' : move.product_id.id, 'quantity' : move.product_qty, 'product_uom' : move.product_uom.id, 'prodlot_id' : move.prodlot_id.id, 'move_id' : move.id, } if move.picking_id.type == 'in': move_memory.update({ 'c...
520224a502d22b13796f67158e6f975f3d318fb2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/520224a502d22b13796f67158e6f975f3d318fb2/stock_partial_move.py
print res
def __get_active_stock_moves(self, cr, uid, context=None): move_obj = self.pool.get('stock.move') if not context: context = {} res = [] for move in move_obj.browse(cr, uid, context.get('active_ids', [])): if move.state in ('done', 'cancel'): continue res.append(self.__create_partial_move_memory(move)) print res retur...
520224a502d22b13796f67158e6f975f3d318fb2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/520224a502d22b13796f67158e6f975f3d318fb2/stock_partial_move.py
'name': repr(result["message"]),
'name': result["message"] if isinstance(result["message"], str) or \ isinstance(result["message"], unicode) else repr(result["message"]),
def send_ping(self, cr, uid, ids, cron_mode=True, context={}): """ Send a message to OpenERP's publisher warranty server to check the validity of the contracts, get notifications, etc... @param cron_mode: If true, catch all exceptions (appropriate for usage in a cron). @type cron_mode: boolean """ try: try: result = s...
5303b58ef63f5dfc96eacfd8f885ce57de9dc7df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/5303b58ef63f5dfc96eacfd8f885ce57de9dc7df/publisher_warranty.py
company_currency_id, st_line.amount, context=context, account=acc_cur)
company_currency_id, st_line.amount, context=context)
def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, st_line_number, context=None): if context is None: context = {} res_currency_obj = self.pool.get('res.currency') account_move_obj = self.pool.get('account.move') account_move_line_obj = self.pool.get('account.move.line') account_bank_statement...
9e5a6481a370feb76aa4a6dee2b9bbafa30e7e99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9e5a6481a370feb76aa4a6dee2b9bbafa30e7e99/account_bank_statement.py
amount = res_currency_obj.compute(cr, uid, st.currency.id, company_currency_id, st_line.amount, context=context, account=acc_cur)
def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, st_line_number, context=None): if context is None: context = {} res_currency_obj = self.pool.get('res.currency') account_move_obj = self.pool.get('account.move') account_move_line_obj = self.pool.get('account.move.line') account_bank_statement...
9e5a6481a370feb76aa4a6dee2b9bbafa30e7e99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9e5a6481a370feb76aa4a6dee2b9bbafa30e7e99/account_bank_statement.py
st.currency.id, amount, context=context, account=acc_cur)
st.currency.id, amount, context=context)
def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, st_line_number, context=None): if context is None: context = {} res_currency_obj = self.pool.get('res.currency') account_move_obj = self.pool.get('account.move') account_move_line_obj = self.pool.get('account.move.line') account_bank_statement...
9e5a6481a370feb76aa4a6dee2b9bbafa30e7e99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9e5a6481a370feb76aa4a6dee2b9bbafa30e7e99/account_bank_statement.py
st_line.account_id.currency_id.id, amount, context=context, account=acc_cur)
st_line.account_id.currency_id.id, amount, context=context)
def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, st_line_number, context=None): if context is None: context = {} res_currency_obj = self.pool.get('res.currency') account_move_obj = self.pool.get('account.move') account_move_line_obj = self.pool.get('account.move.line') account_bank_statement...
9e5a6481a370feb76aa4a6dee2b9bbafa30e7e99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9e5a6481a370feb76aa4a6dee2b9bbafa30e7e99/account_bank_statement.py
amount = unit_amount * r.product_id.uom_id._compute_price(cr, uid,
amount = unit_amount * self.pool.get('product.uom')._compute_price(cr, uid,
def on_change_user_id(self, cr, uid, ids,user_id, account_id, unit_amount=0): res = {} if not (user_id): #avoid a useless call to super return res
6ce9dec0138d246229f3cff7f7d7db5157ebb803 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6ce9dec0138d246229f3cff7f7d7db5157ebb803/analytic_user_function.py
AND f.id = ' + str(fiscalyear_id) + ' ')
AND f.id = ' + str(fiscalyear_id) + ' order by p.date_start')
def onchange_filter(self, cr, uid, ids, filter='filter_no', fiscalyear_id=False, context=None): res = {} if filter == 'filter_no': res['value'] = {'period_from': False, 'period_to': False, 'date_from': False ,'date_to': False} if filter == 'filter_date': res['value'] = {'period_from': False, 'period_to': False, 'date_f...
70b31682cc27d51bdd2b321d22d9c91811783356 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/70b31682cc27d51bdd2b321d22d9c91811783356/account_report_common.py
self.pool.get('stock.move').create(cr, uid, {
self.pool.get('stock.move').create(cr, uid, {
def create_picking(self, cr, uid, ids, context={}): """Create a picking for each order and validate it.""" picking_obj = self.pool.get('stock.picking') pick_name=self.pool.get('ir.sequence').get(cr, uid, 'stock.picking.out') orders = self.browse(cr, uid, ids, context) for order in orders: if not order.picking_id: new...
196972157a654519bffebb5ea5059f89fbc9476a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/196972157a654519bffebb5ea5059f89fbc9476a/pos.py
'text_area':fields.text("Text area",select=True),
'text_area':fields.text("Text area"),
def write(self, cr, uid, ids, vals, context=None): result = super(Wiki,self).write(cr, uid, ids, vals, context) history = self.pool.get('wiki.wiki.history') if vals.get('text_area'): for id in ids: res = { 'minor_edit':vals.get('minor_edit', True), 'text_area':vals.get('text_area',''), 'write_uid':uid, 'wiki_id' : id, ...
08e60b16bf9e4017250cff6b3f605da4122184cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/08e60b16bf9e4017250cff6b3f605da4122184cb/wiki.py
ids = obj.search(cr, uid, [(field, '=', dic['src'])])
ids = obj._search(cr, uid, [(field, '=', dic['src'])])
def fix_xa0(s): if s == '\xa0': return '\xc2\xa0' return s
ff55f829ce88153dc54ba6f50323e43224662a69 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ff55f829ce88153dc54ba6f50323e43224662a69/translate.py
context = context
context = {}
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): if not context: context = context if not context.get('planning'): return super(project_task,self).search(cr, user, args, offset, limit, order, context) cr.execute(" SELECT t.id, t.name \ from project_task t \ join report_acco...
e58e5b6cf14829cf6d94c154b88ab0595d45ce3e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e58e5b6cf14829cf6d94c154b88ab0595d45ce3e/project_planning.py
def _sum_amount_real(self, cr, uid, ids, name, args, context=None): if context is None: context = {} users_obj = self.pool.get('res.users') result = {} tm2 = users_obj.browse(cr, uid, uid, context).company_id.planning_time_mode_id if tm2 and tm2.factor: div2 = tm2.factor else: div2 = 1.0 for line in self.browse(cr, uid...
e58e5b6cf14829cf6d94c154b88ab0595d45ce3e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e58e5b6cf14829cf6d94c154b88ab0595d45ce3e/project_planning.py
def __init__(self, model, action, **kwargs):
def __init__(self, model, action, ref=None, **kwargs):
def __init__(self, model, action, **kwargs): self.model = model self.action = action super(Workflow, self).__init__(**kwargs)
b42095255dc52f7f22bffef37a166fdbc713658e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b42095255dc52f7f22bffef37a166fdbc713658e/yaml_tag.py
def __init__(self, *args, **kwargs):
def __init__(self, expr="False", *args, **kwargs): self.expr = expr
def __init__(self, *args, **kwargs): super(Ref, self).__init__(*args, **kwargs)
b42095255dc52f7f22bffef37a166fdbc713658e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b42095255dc52f7f22bffef37a166fdbc713658e/yaml_tag.py
'context': "{'journal_id': %d, 'search_default_journal_id':%d, 'search_default_period_id':%d, 'partner_id':%s}" % (journal_id, journal_id, period_id, context.get('partner_id',False)),
'context': "{'search_default_journal_id':%d, 'search_default_period_id':%d, 'partner_id':%s}" % (journal_id, period_id, context.get('partner_id',False)),
def action_open_window(self, cr, uid, ids, context=None): """ This function Open action move line window on given period and Journal/Payment Mode @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: account move journal’s ID or list of IDs @return: di...
acad9fa69c406eaa8b5fe9b261cc846bf04dfca3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/acad9fa69c406eaa8b5fe9b261cc846bf04dfca3/account_voucher_open.py
photo_path = addons.get_module_resource('hr','image','photo.png')
photo_path = addons.get_module_resource('hr','image','photo.png')
def _get_photo(self, cr, uid, context=None):
ab9e19e5958596128cf36fdcad83b1c601fae93f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ab9e19e5958596128cf36fdcad83b1c601fae93f/hr.py
email_from = getattr(obj, 'email_from', False)
email_from = getattr(obj, 'email_from', False) x_headers = {}
def action_send(self, cr, uid, ids, context=None): """ This sends an email to ALL the addresses of the selected partners. """
99aa4eb1b384ce39dd5823ed4c7601462b5d6ea8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/99aa4eb1b384ce39dd5823ed4c7601462b5d6ea8/crm_send_email.py
def action_send(self, cr, uid, ids, context=None): """ This sends an email to ALL the addresses of the selected partners. """
99aa4eb1b384ce39dd5823ed4c7601462b5d6ea8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/99aa4eb1b384ce39dd5823ed4c7601462b5d6ea8/crm_send_email.py