rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
cr.close() def execute(self, db, uid, object, method, *args, **kw):
return True def execute(self, db, uid, model, method, *args, **kw):
def log_fct(self, db, uid, object, method, fct_src, *args): """ Logging function: This function is performs logging oprations according to method @param db: the current database @param uid: the current user’s ID for security checks, @param object: Object who's values are being changed @param method: method to log: crea...
@param method: method to log: create, read, write, unlink @return: Returns result as per method of Object proxy """
@param method: get any method and create log @return: Returns result as per method of Object proxy """ pool = pooler.get_pool(db) model_pool = pool.get('ir.model') rule_pool = pool.get('audittrail.rule') cr = pooler.get_db(db).cursor() cr.autocommit(True) logged_uids = [] fct_src = super(audittrail_objects_proxy, self...
def execute(self, db, uid, object, method, *args, **kw): """ Overrides Object Proxy execute method @param db: the current database @param uid: the current user’s ID for security checks, @param object: Object who's values are being changed @param method: method to log: create, read, write, unlink @return: Returns resul...
fct_src = super(audittrail_objects_proxy, self).execute def my_fct(db, uid, object, method, *args): field = method rule = False obj_ids = pool.get('ir.model').search(cr, uid, [('model', '=', object)]) for obj_name in pool.obj_list(): if obj_name == 'audittrail.rule': rule = True if not rule: return fct_src(db, uid, ob...
fct_src = super(audittrail_objects_proxy, self).exec_workflow field = method rule = False model_pool = pool.get('ir.model') rule_pool = pool.get('audittrail.rule') model_ids = model_pool.search(cr, uid, [('model', '=', model)]) for obj_name in pool.obj_list(): if obj_name == 'audittrail.rule': rule = True if not rule: ...
def execute(self, db, uid, object, method, *args, **kw): """ Overrides Object Proxy execute method @param db: the current database @param uid: the current user’s ID for security checks, @param object: Object who's values are being changed @param method: method to log: create, read, write, unlink @return: Returns resul...
return res
return True
def my_fct(db, uid, object, method, *args): field = method rule = False obj_ids = pool.get('ir.model').search(cr, uid, [('model', '=', object)]) for obj_name in pool.obj_list(): if obj_name == 'audittrail.rule': rule = True if not rule: return fct_src(db, uid, object, method, *args) if not obj_ids: return fct_src(db, u...
if int(vat[7:10]) > 121: return False
def check_vat_it(self, vat): ''' Check Italy VAT number. ''' if len(vat) != 11: return False try: int(vat) except: return False if int(vat[0:7]) <= 0: return False if int(vat[7:10]) <= 0: return False if int(vat[7:10]) > 100 and int(vat[7:10]) < 120: return False if int(vat[7:10]) > 121: return False
help="Total of Prospect Registrations"),
help="Total of Prospect Registrati./event/event.py:41:ons"),
def write(self, cr, uid, ids, vals, context=None): """ Writes values in one or several fields. @param ids: List of Event registration type's IDs @param vals: dictionary with values to update. @return: True """ register_pool = self.pool.get('event.registration') res = super(event_event, self).write(cr, uid, ids, vals, c...
(_check_recursion, 'Error ! You cannot create recursive event.', ['parent_id'])
(_check_recursion, 'Error ! You cannot create recursive event.', ['parent_id']), (_check_closing_date, 'Error ! Closing Date cannot be set before Beginning Date.', ['date_end']),
def _check_recursion(self, cr, uid, ids): """ Checks for recursion level for event """ level = 100
prod_obj = self.pool.get('product.template') location_obj = self.pool.get('stock.location') lot_obj = self.pool.get('stock.report.prodlots') move_obj = self.pool.get('account.move') move_line_obj = self.pool.get('account.move.line') data_obj = self.pool.get('ir.model.data') res = self.read(cr, uid, ids[0], ['new_price...
assert rec_id, _('Active ID is not set in Context') prod_obj = self.pool.get('product.product') res = self.browse(cr, uid, ids) datas = { 'new_price' : res[0].new_price, 'stock_output_account' : res[0].stock_account_output.id, 'stock_input_account' : res[0].stock_account_input.id, 'stock_journal' : res[0].stock_journal...
def change_price(self, cr, uid, ids, context): """ Changes the Standard Price of Product. And creates an account move accordingly. @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param ids: List of IDs selected @param context: A standard dictionary @return...
def draft_validate(self, cr, uid, ids, *args):
def draft_validate(self, cr, uid, ids, context=None):
def draft_validate(self, cr, uid, ids, *args): """ Validates picking directly from draft state. @return: True """ wf_service = netsvc.LocalService("workflow") self.draft_force_assign(cr, uid, ids) for pick in self.browse(cr, uid, ids): move_ids = [x.id for x in pick.move_lines] self.pool.get('stock.move').force_assign(...
self.action_move(cr, uid, [pick.id]) wf_service.trg_validate(uid, 'stock.picking', pick.id, 'button_done', cr) return True
context.update({'active_ids':ids}) return { 'name': 'Make Picking', 'view_type': 'form', 'view_mode': 'form', 'res_model': 'stock.partial.picking', 'type': 'ir.actions.act_window', 'target': 'new', 'nodestroy': True, 'context':context }
def draft_validate(self, cr, uid, ids, *args): """ Validates picking directly from draft state. @return: True """ wf_service = netsvc.LocalService("workflow") self.draft_force_assign(cr, uid, ids) for pick in self.browse(cr, uid, ids): move_ids = [x.id for x in pick.move_lines] self.pool.get('stock.move').force_assign(...
WHERE emp.id IN %s', (tuple(parent_ids),)) parent_ids = [x[0] for x in cr.fetchall() if x[0]]
WHERE emp.id IN %s AND res.user_id IS NOT NULL', (tuple(parent_ids),)) parent_ids = [x[0] for x in cr.fetchall()]
def _parent_compute(self, cr, uid, ids, name, args, context=None): if context is None: context = {} result = {} obj_dept = self.pool.get('hr.department') for user_id in ids: emp_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id', '=', user_id)], context=context) cr.execute('SELECT emp.department_id FROM hr_...
class record(yaml.YAMLObject): yaml_tag = u'!record' def __init__(self, model, id=None, attrs={}): self.model = model self.id = id self.attrs=attrs def __repr__(self): return '!record {model: %s, id: %s}:' % (str(self.model,), str(self.id,)) class workflow(yaml.YAMLObject): yaml_tag = u'!workflow' def __init__(self, m...
from tools import yaml_tag
def doc_createXElement(xdoc, tagName): e = xElement(tagName) e.ownerDocument = xdoc return e
ids = ','.join([str(x) for x in context['periods']]) query = obj+".state<>'draft' AND "+obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id in (%s) AND id in (%s)) %s %s" % (fiscalyear_clause, ids, where_move_state, where_move_lines_by_date)
if initial_bal: query = obj+".state<>'draft' AND "+obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id in (%s) %s %s)" % (fiscalyear_clause, where_move_state, where_move_lines_by_date) period_ids = fiscalperiod_obj.search(cr, uid, [('id', 'in', context['periods'])], order='date_start', limit=1) if per...
def _query_get(self, cr, uid, obj='l', context={}): fiscalyear_obj = self.pool.get('account.fiscalyear') fiscalperiod_obj = self.pool.get('account.period') fiscalyear_ids = [] fiscalperiod_ids = [] initial_bal = context.get('initial_bal', False) company_clause = "" if context.get('company_id', False): company_clause = ...
res.update({'trans_nbr':data['credit']})
res.update({'credit':data['credit']})
def default_get(self, cr, uid, fields, context=None): res = super(account_move_line_reconcile, self).default_get(cr, uid, fields, context=context) data = self.trans_rec_get(cr, uid, context['active_ids'], context) if 'trans_nbr' in fields: res.update({'trans_nbr':data['trans_nbr']}) if 'credit' in fields: res.update({'...
res.update({'trans_nbr':data['debit']})
res.update({'debit':data['debit']})
def default_get(self, cr, uid, fields, context=None): res = super(account_move_line_reconcile, self).default_get(cr, uid, fields, context=context) data = self.trans_rec_get(cr, uid, context['active_ids'], context) if 'trans_nbr' in fields: res.update({'trans_nbr':data['trans_nbr']}) if 'credit' in fields: res.update({'...
res.update({'trans_nbr':data['writeoff']})
res.update({'writeoff':data['writeoff']})
def default_get(self, cr, uid, fields, context=None): res = super(account_move_line_reconcile, self).default_get(cr, uid, fields, context=context) data = self.trans_rec_get(cr, uid, context['active_ids'], context) if 'trans_nbr' in fields: res.update({'trans_nbr':data['trans_nbr']}) if 'credit' in fields: res.update({'...
'allounce':round(allow), 'deduction':round(deduct), 'grows':round(rs.basic + allow), 'net':round(rs.basic + allow - deduct),
'allounce':allow, 'deduction':deduct, 'grows':rs.basic + allow, 'net':rs.basic + allow - deduct,
def _calculate(self, cr, uid, ids, field_names, arg, context=None): slip_line_obj = self.pool.get('hr.payslip.line') if context is None: context = {} res = {} for rs in self.browse(cr, uid, ids, context=context): allow = 0.0 deduct = 0.0 others = 0.0 obj = {'basic':rs.basic} if rs.igross > 0: obj['gross'] = rs.igross i...
'total_pay':round(rs.basic + allow - deduct)
'total_pay':rs.basic + allow - deduct
def _calculate(self, cr, uid, ids, field_names, arg, context=None): slip_line_obj = self.pool.get('hr.payslip.line') if context is None: context = {} res = {} for rs in self.browse(cr, uid, ids, context=context): allow = 0.0 deduct = 0.0 others = 0.0 obj = {'basic':rs.basic} if rs.igross > 0: obj['gross'] = rs.igross i...
'basic_before_leaves': fields.float('Basic Salary', readonly=True, digits=(16, 2)), 'leaves': fields.float('Leave Deductions', readonly=True, digits=(16, 2)), 'basic': fields.float('Net Basic', readonly=True, digits=(16, 2)), 'grows': fields.function(_calculate, method=True, store=True, multi='dc', string='Gross Sal...
'basic_before_leaves': fields.float('Basic Salary', readonly=True, digits_compute=dp.get_precision('Account')), 'leaves': fields.float('Leave Deductions', readonly=True, digits_compute=dp.get_precision('Account')), 'basic': fields.float('Net Basic', readonly=True, digits_compute=dp.get_precision('Account')), 'grows'...
def _calculate(self, cr, uid, ids, field_names, arg, context=None): slip_line_obj = self.pool.get('hr.payslip.line') if context is None: context = {} res = {} for rs in self.browse(cr, uid, ids, context=context): allow = 0.0 deduct = 0.0 others = 0.0 obj = {'basic':rs.basic} if rs.igross > 0: obj['gross'] = rs.igross i...
'total': fields.float('Sub Total', readonly=True, digits=(16, 4)),
'total': fields.float('Sub Total', readonly=True, digits_compute=dp.get_precision('Account')),
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}}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', account_ids)]))
parent_ids = tuple(account_obj.search(cr, uid, [('parent_id', 'child_of', account_ids)]))
def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') cr.execute('SELECT MAX(id) FROM res_users') max_user = cr.fetchone()[0] account_ids = [int(str(x/max_user - (x%max_user == 0 and 1 or 0))) for x in ids] user_ids = [int(str(x-((x/max_user - (x...
'AND "user" IN %s',(parent_ids, user_ids,))
'AND "user" IN %s',(parent_ids, tuple(user_ids),))
def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') cr.execute('SELECT MAX(id) FROM res_users') max_user = cr.fetchone()[0] account_ids = [int(str(x/max_user - (x%max_user == 0 and 1 or 0))) for x in ids] user_ids = [int(str(x-((x/max_user - (x...
d1, d2 = self.pool.get('ir.rule').domain_get(cr, user, self._name)
d1, d2, tables = self.pool.get('ir.rule').domain_get(cr, user, self._name, 'read', context=context)
def _read_flat(self, cr, user, ids, fields, context=None, load='_classic_read'): if not context: context={} if not ids: return []
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', account_ids)]))
parent_ids = tuple(account_obj.search(cr, uid, [('parent_id', 'child_of', account_ids)]))
def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') account_ids = [int(str(int(x))[:-6]) for x in ids] month_ids = [int(str(int(x))[-6:]) for x in ids] parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', account_ids)])) if parent...
'AND month_id IN %s ',(parent_ids, month_ids,))
'AND month_id IN %s ',(parent_ids, tuple(month_ids),))
def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') account_ids = [int(str(int(x))[:-6]) for x in ids] month_ids = [int(str(int(x))[-6:]) for x in ids] parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', account_ids)])) if parent...
d1, d2 = self.pool.get('ir.rule').domain_get(cr, user, self._name)
d1, d2, tables = self.pool.get('ir.rule').domain_get(cr, user, self._name)
def _read_flat(self, cr, user, ids, fields, context=None, load='_classic_read'): if not context: context={} if not ids: return []
picking_obj = self.pool.get('stock.picking') wf_service = netsvc.LocalService("workflow") for pick_id in picking_ids: wf_service.trg_write(uid, 'stock.picking', pick_id, cr)
def action_done(self, cr, uid, ids, context={}): """ Makes the move done and if all moves are done, it will finish the picking. @return: """ track_flag = False picking_ids = [] product_uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') product_obj=self.pool.get('product.product'...
datas.append(str(value[1])) else: datas.append(str(value))
datas.append(ustr(value[1])) else: datas.append(ustr(value))
def export_data(self, cr, uid, ids, fields_to_export, context=None): if not context: context = {} data_l = self.read(cr, uid, ids, ['sql_query'], context) final_datas = [] #start Loop for i in data_l: datas = [] for key, value in i.items(): if key not in fields_to_export: continue if isinstance(value, tuple): datas.ap...
self.write(cr, uid, ids, {'state': 'ready'})
for repair in self.browse(cr, uid, ids, context=context): self.pool.get('mrp.repair.line').write(cr, uid, [l.id for l in repair.operations], {'state': 'confirmed'}) self.write(cr, uid, [repair.id], {'state': 'ready'})
def action_repair_ready(self, cr, uid, ids, context=None): """ Writes repair order state to 'Ready' @return: True """ self.write(cr, uid, ids, {'state': 'ready'}) return True
self.write(cr, uid, ids, {'state': 'under_repair'})
for repair in self.browse(cr, uid, ids, context=context): self.pool.get('mrp.repair.line').write(cr, uid, [l.id for l in repair.operations], {'state': 'confirmed'}) self.write(cr, uid, [repair.id], {'state': 'under_repair'})
def action_repair_start(self, cr, uid, ids, context=None): """ Writes repair order state to 'Under Repair' @return: True """ self.write(cr, uid, ids, {'state': 'under_repair'}) return True
repair_line_obj.write(cr, uid, [move.id], {'move_id': move_id})
repair_line_obj.write(cr, uid, [move.id], {'move_id': move_id, 'state': 'done'})
def action_repair_done(self, cr, uid, ids, context=None): """ Creates stock move and picking for repair order. @return: Picking ids. """ res = {} move_obj = self.pool.get('stock.move') wf_service = netsvc.LocalService("workflow") repair_line_obj = self.pool.get('mrp.repair.line') seq_obj = self.pool.get('ir.sequence') ...
key = operator.itemgetter(0)
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): if not context: context = {}
exval = map(lambda x: x.strftime('%Y%m%dT%H%M%S'), exdates) self.ical_set(cal_data.name.lower(), ','.join(exval), 'value')
exvals = [] for exdate in exdates: exvals.append(datetime.fromtimestamp(time.mktime(exdate.utctimetuple())).strftime('%Y%m%dT%H%M%S')) self.ical_set(cal_data.name.lower(), ','.join(exvals), 'value')
def parse_ics(self, cr, uid, child, cal_children=None, context=None): """ parse 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 ...
for id in ids: move_lines = self.move_line_id_payment_get(cr, uid, [id]) if not move_lines: res[id] = []
for invoice in self.browse(cr, uid, ids, context=context): id = invoice.id res[id] = [] if not invoice.move_id:
def _get_lines(self, cr, uid, ids, name, arg, context=None): res = {} for id in ids: move_lines = self.move_line_id_payment_get(cr, uid, [id]) if not move_lines: res[id] = [] continue res[id] = [] data_lines = self.pool.get('account.move.line').browse(cr, uid, move_lines) partial_ids = []# Keeps the track of ids where ...
res[id] = [] data_lines = self.pool.get('account.move.line').browse(cr, uid, move_lines) partial_ids = []
data_lines = invoice.move_id.line_id partial_ids = []
def _get_lines(self, cr, uid, ids, name, arg, context=None): res = {} for id in ids: move_lines = self.move_line_id_payment_get(cr, uid, [id]) if not move_lines: res[id] = [] continue res[id] = [] data_lines = self.pool.get('account.move.line').browse(cr, uid, move_lines) partial_ids = []# Keeps the track of ids where ...
moves = self.move_line_id_payment_get(cr, uid, [invoice.id])
def _compute_lines(self, cr, uid, ids, name, args, context=None): result = {} for invoice in self.browse(cr, uid, ids, context): moves = self.move_line_id_payment_get(cr, uid, [invoice.id]) src = [] lines = [] for m in self.pool.get('account.move.line').browse(cr, uid, moves, context): temp_lines = []#Added temp list t...
for m in self.pool.get('account.move.line').browse(cr, uid, moves, context): temp_lines = [] if m.reconcile_id: temp_lines = map(lambda x: x.id, m.reconcile_id.line_id) elif m.reconcile_partial_id: temp_lines = map(lambda x: x.id, m.reconcile_partial_id.line_partial_ids) lines += [x for x in temp_lines if x not in line...
if invoice.move_id: for m in invoice.move_id.line_id: temp_lines = [] if m.reconcile_id: temp_lines = map(lambda x: x.id, m.reconcile_id.line_id) elif m.reconcile_partial_id: temp_lines = map(lambda x: x.id, m.reconcile_partial_id.line_partial_ids) lines += [x for x in temp_lines if x not in lines] src.append(m.id)
def _compute_lines(self, cr, uid, ids, name, args, context=None): result = {} for invoice in self.browse(cr, uid, ids, context): moves = self.move_line_id_payment_get(cr, uid, [invoice.id]) src = [] lines = [] for m in self.pool.get('account.move.line').browse(cr, uid, moves, context): temp_lines = []#Added temp list t...
res = []
print '** la' if not ids: return [] result = self.move_line_id_payment_gets(cr, uid, ids, *args) return result.get(ids[0], []) def move_line_id_payment_gets(self, cr, uid, ids, *args): print '** ICI' res = {}
def move_line_id_payment_get(self, cr, uid, ids, *args): res = [] if not ids: return res cr.execute('SELECT l.id '\ 'FROM account_move_line l '\ 'LEFT JOIN account_invoice i ON (i.move_id=l.move_id) '\ 'WHERE i.id IN %s '\ 'AND l.account_id=i.account_id', (tuple(ids),)) res = map(itemgetter(0), cr.fetchall()) return re...
cr.execute('SELECT l.id '\
cr.execute('SELECT i.id, l.id '\
def move_line_id_payment_get(self, cr, uid, ids, *args): res = [] if not ids: return res cr.execute('SELECT l.id '\ 'FROM account_move_line l '\ 'LEFT JOIN account_invoice i ON (i.move_id=l.move_id) '\ 'WHERE i.id IN %s '\ 'AND l.account_id=i.account_id', (tuple(ids),)) res = map(itemgetter(0), cr.fetchall()) return re...
res = map(itemgetter(0), cr.fetchall())
for r in cr.fetchall(): res.setdefault(r[0], []) res[r[0]].append( r[1] )
def move_line_id_payment_get(self, cr, uid, ids, *args): res = [] if not ids: return res cr.execute('SELECT l.id '\ 'FROM account_move_line l '\ 'LEFT JOIN account_invoice i ON (i.move_id=l.move_id) '\ 'WHERE i.id IN %s '\ 'AND l.account_id=i.account_id', (tuple(ids),)) res = map(itemgetter(0), cr.fetchall()) return re...
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ search parnter address @param self: The object pointer @param cr: the current row, from the database cursor, @param user: the current user @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ......
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ search parnter address @param self: The object pointer @param cr: the current row, from the database cursor, @param user: the current user @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ......
'address_id': fields.many2one('res.partner.address','Address', \
'address_id': fields.many2one('res.partner.address', 'Address', domain=[('partner_id', '=', name)], \
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ search parnter job @param self: The object pointer @param cr: the current row, from the database cursor, @param user: the current user @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...]. @...
def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ retur...
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ search parnter job @param self: The object pointer @param cr: the current row, from the database cursor, @param user: the current user @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...]. @...
if currency.company_id != company_id:
if currency.company_id.id != company_id:
def onchange_currency_id(self, cr, uid, ids, curr_id, company_id): if curr_id: currency = self.pool.get('res.currency').browse(cr, uid, curr_id) if currency.company_id != company_id: raise osv.except_osv(_('Configration Error !'), _('Can not select currency that is not related to current company.\nPlease select accordi...
if 'account_id' in line: line['account_id'] = line.get('account_id', False) and line['account_id'][0] if 'product_id' in line: line['product_id'] = line.get('product_id', False) and line['product_id'][0] if 'uos_id' in line: line['uos_id'] = line.get('uos_id', False) and line['uos_id'][0]
for field in ('company_id', 'partner_id', 'account_id', 'product_id', 'uos_id', 'account_analytic_id', 'tax_code_id', 'base_code_id'): line[field] = line.get(field, False) and line[field][0]
def _refund_cleanup_lines(self, cr, uid, lines): for line in lines: del line['id'] del line['invoice_id'] if 'account_id' in line: line['account_id'] = line.get('account_id', False) and line['account_id'][0] if 'product_id' in line: line['product_id'] = line.get('product_id', False) and line['product_id'][0] if 'uos_id...
if 'account_analytic_id' in line: line['account_analytic_id'] = line.get('account_analytic_id', False) and line['account_analytic_id'][0] if 'tax_code_id' in line : if isinstance(line['tax_code_id'],tuple) and len(line['tax_code_id']) >0 : line['tax_code_id'] = line['tax_code_id'][0] if 'base_code_id' in line : if isi...
def _refund_cleanup_lines(self, cr, uid, lines): for line in lines: del line['id'] del line['invoice_id'] if 'account_id' in line: line['account_id'] = line.get('account_id', False) and line['account_id'][0] if 'product_id' in line: line['product_id'] = line.get('product_id', False) and line['product_id'][0] if 'uos_id...
help='When the stock move is created it is in the \'Draft\' state.\n After that it is set to \'Confirmed\' state.\n If stock is available state is set to \'Avaiable\'.\n When the picking it done the state is \'Done\'.\
help='When the stock move is created it is in the \'Draft\' state.\n After that it is set to \'Confirmed\' state.\n If stock is available state is set to \'Available\'.\n When the picking is done the state is \'Done\'.\
def _check_product_lot(self, cr, uid, ids): """ Checks whether move is done or not and production lot is assigned to that move. @return: True or False """ for move in self.browse(cr, uid, ids): if move.prodlot_id and move.state == 'done' and (move.prodlot_id.product_id.id != move.product_id.id): return False return Tru...
cr.execute("update account_account set active='f' where id=%s" % (account_id))
cr.execute("update account_account set active='f' where id in " + str(tuple(acc_ids)))
def execute(self, cr, uid, ids, context=None): obj_multi = self.browse(cr, uid, ids[0]) obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_sequence = self.pool.get('ir.sequence') obj_acc_template = self.pool.get('account.account.templ...
_rec_name = "date_time"
_rec_name = "summary"
def write(self, cr, uid, ids, vals, context=None):
line1 = text1.splitlines(1) line2 = text2.splitlines(1)
line1 = line2 = '' if text1: line1 = text1.splitlines(1) if text2: line2 = text2.splitlines(1) if (not line1 and not line2) or (line1 == line2): raise osv.except_osv(_('Warning !'), _('There are no chnages in revisions'))
def getDiff(self, cr, uid, v1, v2, context={}):
res[purchase.id] = False
res[purchase.id] = time.strftime('%Y-%m-%d %H:%M:%S')
def _minimum_planned_date(self, cr, uid, ids, field_name, arg, context=None): res={} purchase_obj=self.browse(cr, uid, ids, context=context) for purchase in purchase_obj: res[purchase.id] = False if purchase.order_line: min_date=purchase.order_line[0].date_planned for line in purchase.order_line: if line.date_planned <...
period_start = datetime(last_date,"%Y-%m-%d %H:%M:%S")+ relativedelta(days=1)
period_start = datetime.strptime(last_date,"%Y-%m-%d %H:%M:%S")+ relativedelta(days=1)
def _get_new_period_start(self, cr, uid, context=None): cr.execute("select max(date_stop) from stock_period") result = cr.fetchone() last_date = result and result[0] or False if last_date: period_start = datetime(last_date,"%Y-%m-%d %H:%M:%S")+ relativedelta(days=1) period_start = period_start - relativedelta(hours=per...
while ds.strftime('%Y-%m-%d') < p.date_stop:
while ds.strftime('%Y-%m-%d') <= p.date_stop:
def create_stock_periods(self, cr, uid, ids, context=None): interval = context.get('interval',0) name = context.get('name','Daily') period_obj = self.pool.get('stock.period') lines = [] for p in self.browse(cr, uid, ids, context=context): dt = p.date_start ds = datetime.strptime(p.date_start, '%Y-%m-%d') while ds.strft...
de = ds + relativedelta(days=interval, minutes =-1)
de = ds + relativedelta(days=(interval + 1), seconds =-1)
def create_stock_periods(self, cr, uid, ids, context=None): interval = context.get('interval',0) name = context.get('name','Daily') period_obj = self.pool.get('stock.period') lines = [] for p in self.browse(cr, uid, ids, context=context): dt = p.date_start ds = datetime.strptime(p.date_start, '%Y-%m-%d') while ds.strft...
ds = ds + relativedelta(days=interval) + 1
ds = ds + relativedelta(days=(interval + 1))
def create_stock_periods(self, cr, uid, ids, context=None): interval = context.get('interval',0) name = context.get('name','Daily') period_obj = self.pool.get('stock.period') lines = [] for p in self.browse(cr, uid, ids, context=context): dt = p.date_start ds = datetime.strptime(p.date_start, '%Y-%m-%d') while ds.strft...
de = ds + relativedelta(days=interval, minutes =-1) new_name = de.strftime('%Y, week %W')
de = ds + relativedelta(days=(interval + 1), seconds =-1) if dt_stp < de: de = dt_stp + relativedelta(days=1,seconds =-1) else: de = ds + relativedelta(days=(interval + 1), seconds =-1) start_week = ds.strftime('%W') start_year = ds.strftime('%Y') end_week = de.strftime('%W') end_year = de.strftime('%Y') if start_year ...
def create_stock_periods(self, cr, uid, ids, context=None): interval = context.get('interval',0) name = context.get('name','Daily') period_obj = self.pool.get('stock.period') lines = [] for p in self.browse(cr, uid, ids, context=context): dt = p.date_start ds = datetime.strptime(p.date_start, '%Y-%m-%d') while ds.strft...
de = ds + relativedelta(months=interval, minutes=-1)
de = ds + relativedelta(months=interval, seconds=-1) if dt_stp < de: de = dt_stp + relativedelta(days=1,seconds =-1) else: de = ds + relativedelta(months=interval, seconds=-1)
def create_stock_periods(self, cr, uid, ids, context=None): interval = context.get('interval',0) name = context.get('name','Daily') period_obj = self.pool.get('stock.period') lines = [] for p in self.browse(cr, uid, ids, context=context): dt = p.date_start ds = datetime.strptime(p.date_start, '%Y-%m-%d') while ds.strft...
invoices = self.read(cr, uid, ids, ['move_id'])
invoices = self.read(cr, uid, ids, ['move_id', 'payment_ids'])
def action_cancel(self, cr, uid, ids, *args): account_move_obj = self.pool.get('account.move') invoices = self.read(cr, uid, ids, ['move_id']) for i in invoices: if i['move_id']: account_move_obj.button_cancel(cr, uid, [i['move_id'][0]]) # delete the move this invoice was pointing to # Note that the corresponding move_...
self._log.exception('Cannot rename "%s" to "%s" at "%s"', src, dst_basename, dst_basedir)
self._log.exception('Cannot rename "%s" to "%s" at "%s"', src, datacr[2], datacr[1])
def rename(self, src, datacr): """ Renaming operation, the effect depends on the src: * A file: read, create and remove * A directory: change the parent and reassign childs to ressource """ cr = datacr[0] try: nname = _to_unicode(datacr[2]) ret = src.move_to(cr, datacr[1], new_name=nname) # API shouldn't wait for us to...
account_move_line_obj.reconcile(cr, uid, torec, 'statement', writeoff_acc_id=writeoff_acc_id, writeoff_period_id=st.period_id.id, writeoff_journal_id=st.journal_id.id, context=context)
if previous_partial: account_move_line_obj.reconcile_partial(cr, uid, torec, 'statement', context) else: account_move_line_obj.reconcile(cr, uid, torec, 'statement', writeoff_acc_id=writeoff_acc_id, writeoff_period_id=st.period_id.id, writeoff_journal_id=st.journal_id.id, context=context)
def button_confirm(self, cr, uid, ids, context={}): done = [] res_currency_obj = self.pool.get('res.currency') res_users_obj = self.pool.get('res.users') account_move_obj = self.pool.get('account.move') account_move_line_obj = self.pool.get('account.move.line') account_bank_statement_line_obj = \ self.pool.get('account...
reference = obj_inv.reference
reference = obj_inv.reference or ''
def action_number(self, cr, uid, ids, *args): for obj_inv in self.browse(cr, uid, ids): id = obj_inv.id invtype = obj_inv.type number = obj_inv.number move_id = obj_inv.move_id and obj_inv.move_id.id or False reference = obj_inv.reference if not number: tmp_context = { 'fiscalyear_id': obj_inv.period_id.fiscalyear_id.i...
perc_state = (state_cases / float(case.nbr_cases) ) * 100
perc_state = (state_cases / float(case.nbr) ) * 100
def _get_data(self, cr, uid, ids, field_name, arg, context={}): res = {} state_perc = 0.0 avg_ans = 0.0 for case in self.browse(cr, uid, ids, context): if field_name != 'avg_answers': state = field_name[5:] cr.execute("select count(*) from crm_opportunity where section_id =%s and state='%s'"%(case.section_id.id,state)...
avg_ans = logs / case.nbr_cases
avg_ans = logs / case.nbr
def _get_data(self, cr, uid, ids, field_name, arg, context={}): res = {} state_perc = 0.0 avg_ans = 0.0 for case in self.browse(cr, uid, ids, context): if field_name != 'avg_answers': state = field_name[5:] cr.execute("select count(*) from crm_opportunity where section_id =%s and state='%s'"%(case.section_id.id,state)...
'state': fields.selection(AVAILABLE_STATES, 'Status', size=16, readonly=True),
'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True),
def _get_data(self, cr, uid, ids, field_name, arg, context={}): res = {} state_perc = 0.0 avg_ans = 0.0 for case in self.browse(cr, uid, ids, context): if field_name != 'avg_answers': state = field_name[5:] cr.execute("select count(*) from crm_opportunity where section_id =%s and state='%s'"%(case.section_id.id,state)...
model_pool._history(cr, uid, [case], _('Send'), history=True, email=False) model_pool.write(cr, uid, [case.id], { 'som': False, 'canal_id': False, })
model_pool._history(cr, uid, [case], _('Send'), history=True, email=False)
def _mass_mail_send(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) hist_obj = pool.get('crm.case.history').browse(cr,uid,data['ids'])[0] model = hist_obj.log_id.model_id.model model_pool = pool.get(model) case = model_pool.browse(cr, uid, hist_obj.log_id.res_id) model_pool._history(cr, uid, [case], _...
data_picking = self.browse(cr, uid, ids, context) for picking in data_picking:
uom_obj = self.pool.get('product.uom') for picking in self.browse(cr, uid, ids, context):
def _cal_weight(self, cr, uid, ids, name, args, context=None): res = {} data_picking = self.browse(cr, uid, ids, context) for picking in data_picking: total_weight = 0.00 if picking.move_lines: weight = 0.00 for move in picking.move_lines: if move.product_id.weight > 0.00: weight = (move.product_uos_qty * move.product_...
if picking.move_lines: weight = 0.00 for move in picking.move_lines: if move.product_id.weight > 0.00: weight = (move.product_uos_qty * move.product_id.weight) total_weight += weight
for move in picking.move_lines: total_weight += move.weight
def _cal_weight(self, cr, uid, ids, name, args, context=None): res = {} data_picking = self.browse(cr, uid, ids, context) for picking in data_picking: total_weight = 0.00 if picking.move_lines: weight = 0.00 for move in picking.move_lines: if move.product_id.weight > 0.00: weight = (move.product_uos_qty * move.product_...
print "========", bom.product_id.name
def _compute_price(bom): print bom.product_id price = 0
print "XXXXXXXXXXXXX", p, test_obj.child_ids
def _compute_price(bom): print bom.product_id price = 0
limit = datetime.strptime(move.date_planned, '%Y-%m-%d %H:%M:%S') + relativedelta(months=product.warranty)
limit = datetime.strptime(move.date_expected, '%Y-%m-%d %H:%M:%S') + relativedelta(months=product.warranty)
def onchange_move_id(self, cr, uid, ids, prod_id=False, move_id=False): """ On change of move id sets values of guarantee limit, source location, destination location, partner and partner address. @param prod_id: Id of product in current record. @param move_id: Changed move. @return: Dictionary of values. """ data = {}...
def refund(self, cr, uid, ids, date=None, period_id=None, description=None):
def refund(self, cr, uid, ids, date=None, period_id=None, description=None, journal_id=None):
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]
new_id = super(account_invoice,self).refund(cr, uid, ids, date=date, period_id=period_id, description=description)
new_id = super(account_invoice,self).refund(cr, uid, ids, date=date, period_id=period_id, description=description, journal_id=journal_id)
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]
if res_obj and len(res_obj): res_obj = res_obj[0]
def _send_mail(self, cr, uid, ids, mail_to, email_from=tools.config.get('email_from', False), context={}): company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.name for att in self.browse(cr, uid, ids, context=context): sign = att.sent_by_uid and att.sent_by_uid.signature or '' sign = '...
other_invitaion_ids = self.search(cr, uid, [('ref','=',att.ref)])
other_invitaion_ids = self.search(cr, uid, [('ref','=', att.ref._name + ',' + str(att.ref.id))])
def _send_mail(self, cr, uid, ids, mail_to, email_from=tools.config.get('email_from', False), context={}): company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.name for att in self.browse(cr, uid, ids, context=context): sign = att.sent_by_uid and att.sent_by_uid.signature or '' sign = '...
rec_line_data = property_obj.read(cr,uid,rec_pro_id,['name','value','res_id']) pay_line_data = property_obj.read(cr,uid,pay_pro_id,['name','value','res_id']) rec_res_id = rec_line_data and int(rec_line_data[0]['value'].split(',')[1]) or False pay_res_id = pay_line_data and int(pay_line_data[0]['value'].split(',')[1]) o...
rec_line_data = property_obj.read(cr,uid,rec_pro_id,['name','value_reference','res_id']) pay_line_data = property_obj.read(cr,uid,pay_pro_id,['name','value_reference','res_id']) rec_res_id = rec_line_data and rec_line_data[0].get('value_reference',False) and int(rec_line_data[0]['value_reference'].split(',')[1]) or Fal...
def onchange_partner_id(self, cr, uid, ids, type, partner_id,\ date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False): invoice_addr_id = False contact_addr_id = False partner_payment_term = False acc_id = False bank_id = False fiscal_position = False
rec_line_data = property_obj.read(cr, uid, rec_pro_id, ['name','value','res_id']) pay_line_data = property_obj.read(cr, uid, pay_pro_id, ['name','value','res_id']) rec_res_id = rec_line_data and int(rec_line_data[0]['value'].split(',')[1]) or False pay_res_id = pay_line_data and int(pay_line_data[0]['value'].split(',')...
rec_line_data = property_obj.read(cr, uid, rec_pro_id, ['name','value_reference','res_id']) pay_line_data = property_obj.read(cr, uid, pay_pro_id, ['name','value_reference','res_id']) rec_res_id = rec_line_data and rec_line_data[0].get('value_reference',False) and int(rec_line_data[0]['value_reference'].split(',')[1]) ...
def onchange_company_id(self, cr, uid, ids, company_id, part_id, type, invoice_line, currency_id): val = {} dom = {} obj_journal = self.pool.get('account.journal') if company_id and part_id and type: acc_id = False partner_obj = self.pool.get('res.partner').browse(cr,uid,part_id) if partner_obj.property_account_payable...
app_acc_in = account_obj.browse(cr, uid, in_pro_id)[0]
my_value = property_obj.read(cr,uid,in_pro_id,['name','value_reference','res_id']) account_id = int (my_value[0]["value_reference"].split(",")[1]) app_acc_in = account_obj.browse(cr, uid, [account_id])[0]
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...
t = payment.mode and payment.mode.type.id or None
t = None
def create_payment(self, cr, uid, ids, context=None): order_obj = self.pool.get('payment.order') line_obj = self.pool.get('account.move.line') payment_obj = self.pool.get('payment.line') if context is None: context = {} data = self.read(cr, uid, ids, [])[0] line_ids = data['entries'] if not line_ids: return {}
company_data = self.pool.get('base.setup.company').read(cr, uid, company_id)[0]
company_data = self.pool.get('base.setup.company').read(cr, uid, company_id) company_data = company_data and company_data[0]
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)[0] country1 = '' if company_data.get('country_id', False): country = self.pool.get('res.country').read(cr, uid, company_data['c...
'context' : context
'context' : context, 'nodestroy':True,
def action_print_survey(self, cr, uid, ids, context=None): """ If response is available then print this response otherwise print survey form(print template of the survey). @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 ...
dt=DateTime.strptime(order.date_order, '%Y-%m-%d') + DateTime.RelativeDateTime(days=line.delay or 0.0)
dt = datetime.strptime(order.date_order, '%Y-%m-%d') + relativedelta(days=line.delay or 0.0)
def _get_commitment_date(self, cr, uid, ids, name, arg, context={}): res = {} dates_list = [] for order in self.browse(cr, uid, ids): dates_list = [] for line in order.order_line: dt=DateTime.strptime(order.date_order, '%Y-%m-%d') + DateTime.RelativeDateTime(days=line.delay or 0.0) dt_s = dt.strftime('%Y-%m-%d') dates_...
result = mod_obj._get_id(cr, uid, module, wizard) id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id'] return act_obj.read(cr, uid, [id])[0]
result = obj_model._get_id(cr, uid, module, wizard) id = obj_model.read(cr, uid, [result], ['res_id'])[0]['res_id'] return obj_act.read(cr, uid, [id])[0]
def launch_wizard(self, cr, uid, ids, context=None): """ Search for a wizard to launch according to the type. If type is manual. just confirm the order. """ obj_payment_order = self.pool.get('payment.order') obj_model = self.pool.get('ir.model.data') obj_act = self.pool.get('ir.actions.act_window') order= obj_payment_o...
message = _('Voucher ') + " '" + inv.name + "' "+ _("is confirm")
message = _('Voucher ') + " '" + inv.name + "' "+ _("is confirmed")
def action_move_line_create(self, cr, uid, ids, *args):
context.update({'uom': uom})
context.update(uom=uom, compute_child=False)
def fill_inventory(self, cr, uid, ids, context): """ To fill 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: ...
if result['product_uom_id'] and (not result['product_uom_id'] == default_uom):
if result.get('product_uom_id',False) and (not result['product_uom_id'] == default_uom):
def write(self, cr, uid, ids, vals, context=None): if context is None: context = {} obj = self.pool.get('hr.analytic.timesheet') timesheet_obj = self.pool.get('hr.analytic.timesheet') project_obj = self.pool.get('project.project') uom_obj = self.pool.get('product.uom') if isinstance(ids, (long, int)): ids = [ids,]
result['product_uom_qty'] = qty
result['product_uom_qty'] = pack.qty
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 ...
res = super(wiz_auc_lots_numerotate_per_lot, self).default_get(cr, uid, fields, context=context)
res = super(auction_lots_numerotate_per_lot, self).default_get(cr, uid, fields, context=context)
def default_get(self, cr, uid, fields, context): """ To get default values for the object. @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param fields: List of fields for which we want default values @param context: A standard dictionary @return: A dictiona...
date_and_hours_by_cal = [(op.production_id.date_planned, op.hour, op.workcenter_id.calendar_id.id) for op in ops]
date_and_hours_by_cal = [(op.date_planned, op.hour, op.workcenter_id.calendar_id.id) for op in ops if op.date_planned]
def _get_date_end(self, cr, uid, ids, field_name, arg, context): """ Finds ending date. @return: Dictionary of values. """ ops = self.browse(cr, uid, ids, context=context) date_and_hours_by_cal = [(op.production_id.date_planned, op.hour, op.workcenter_id.calendar_id.id) for op in ops] intervals = self.pool.get('resourc...
i = intervals[(op.date_planned, op.hour, op.workcenter_id.calendar_id.id)]
i = intervals.get((op.date_planned, op.hour, op.workcenter_id.calendar_id.id))
def _get_date_end(self, cr, uid, ids, field_name, arg, context): """ Finds ending date. @return: Dictionary of values. """ ops = self.browse(cr, uid, ids, context=context) date_and_hours_by_cal = [(op.production_id.date_planned, op.hour, op.workcenter_id.calendar_id.id) for op in ops] intervals = self.pool.get('resourc...
def onchange_currency(self, cr, uid, ids, account_id, amount, currency_id, date=False, journal=False):
def onchange_currency(self, cr, uid, ids, account_id, amount, currency_id, date=False, journal=False, context=None): if context is None: context = {}
def onchange_currency(self, cr, uid, ids, account_id, amount, currency_id, date=False, journal=False): account_obj = self.pool.get('account.account') journal_obj = self.pool.get('account.journal') currency_obj = self.pool.get('res.currency') if (not currency_id) or (not account_id): return {} result = {} acc = account_...
v = currency_obj.compute(cr, uid, currency_id, acc.company_id.currency_id.id, amount, account=acc)
context.update({'date': date}) v = currency_obj.compute(cr, uid, currency_id, acc.company_id.currency_id.id, amount, account=acc, context=context)
def onchange_currency(self, cr, uid, ids, account_id, amount, currency_id, date=False, journal=False): account_obj = self.pool.get('account.account') journal_obj = self.pool.get('account.journal') currency_obj = self.pool.get('res.currency') if (not currency_id) or (not account_id): return {} result = {} acc = account_...
res[id]=[x for x in l if x <> line.id]
partial_ids.append(line.id) res[id] =[x for x in l if x <> line.id and x not in partial_ids]
def _get_lines(self, cr, uid, ids, name, arg, context=None): res = {} for id in ids: move_lines = self.move_line_id_payment_get(cr,uid,[id]) if not move_lines: res[id] = [] continue data_lines = self.pool.get('account.move.line').browse(cr,uid,move_lines) for line in data_lines: ids_line = [] if line.reconcile_id: ids_...
lines += map(lambda x: x.id, m.reconcile_id.line_id)
temp_lines = map(lambda x: x.id, m.reconcile_id.line_id)
def _compute_lines(self, cr, uid, ids, name, args, context=None): result = {} for invoice in self.browse(cr, uid, ids, context): moves = self.move_line_id_payment_get(cr, uid, [invoice.id]) src = [] lines = [] for m in self.pool.get('account.move.line').browse(cr, uid, moves, context): if m.reconcile_id: lines += map(l...
lines += map(lambda x: x.id, m.reconcile_partial_id.line_partial_ids)
temp_lines = map(lambda x: x.id, m.reconcile_partial_id.line_partial_ids) lines += [x for x in temp_lines if x not in lines]
def _compute_lines(self, cr, uid, ids, name, args, context=None): result = {} for invoice in self.browse(cr, uid, ids, context): moves = self.move_line_id_payment_get(cr, uid, [invoice.id]) src = [] lines = [] for m in self.pool.get('account.move.line').browse(cr, uid, moves, context): if m.reconcile_id: lines += map(l...
resource_id = len(resource_ids) or resource_ids[0]
if resource_ids: resource_id = len(resource_ids) or resource_ids[0]
def _compute_day(self, cr, uid, ids, fields, args, context={}): """ @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of Openday’s IDs @return: difference between current date and log date @param context: A standard dictionary for contextual va...
number = self.pool.get('ir.sequence').get(cr, uid, 'account.cash.statement')
if statement.name and statement.name == '/': number = self.pool.get('ir.sequence').get(cr, uid, 'account.cash.statement') vals.update({ 'name':number })
def button_open(self, cr, uid, ids, context=None): """ Changes statement state to Running. @return: True """ cash_pool = self.pool.get('account.cashbox.line') statement_pool = self.pool.get('account.bank.statement')
vals = {
vals.update({
def button_open(self, cr, uid, ids, context=None): """ Changes statement state to Running. @return: True """ cash_pool = self.pool.get('account.cashbox.line') statement_pool = self.pool.get('account.bank.statement')
'name':number }
})
def button_open(self, cr, uid, ids, context=None): """ Changes statement state to Running. @return: True """ cash_pool = self.pool.get('account.cashbox.line') statement_pool = self.pool.get('account.bank.statement')
except ValueError:
except:
def create(self, cr, uid, data, context=None): if context is None: context = {} user_id = super(res_users, self).create(cr, uid, data, context) data_obj = self.pool.get('ir.model.data') try: data_id = data_obj._get_id(cr, uid, 'crm', 'ir_ui_view_sc_calendar0') view_id = data_obj.browse(cr, uid, data_id, context=contex...
objid = self.pool.get('ir.model.data')
data_pool = self.pool.get('ir.model.data')
def _get_root_calendar_directory(self, cr, uid, context=None): objid = self.pool.get('ir.model.data') try: mid = objid._get_id(cr, uid, 'document', 'dir_calendars') if not mid: return False root_id = objid.read(cr, uid, mid, ['res_id'])['res_id'] root_cal_dir = self.browse(cr,uid, root_id, context=context) return root_...