rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
subject = self.merge_message(cr, uid, str(action.subject), action, context)
subject = self.merge_message(cr, uid, action.subject, action, context)
def run(self, cr, uid, ids, context={}): logger = netsvc.Logger() act_ids = [] for action in self.browse(cr, uid, ids, context): obj_pool = self.pool.get(action.model_id.model) obj = obj_pool.browse(cr, uid, context['active_id'], context=context) cxt = { 'context':context, 'object': obj, 'time':time, 'cr': cr, 'pool'...
'date_end': campaign.date_start.split(' ')[0]})
'date_end': campaign.date_start})
def _create_duplicate(self, cr, uid, data, context): campaign_obj = pooler.get_pool(cr.dbname).get('dm.campaign') project_obj = pooler.get_pool(cr.dbname).get('project.project') campaign = campaign_obj.browse(cr, uid, data['id']) tasks_obj = pooler.get_pool(cr.dbname).get('project.task') duplicate_project_id = project_...
if data.invoice_id.state == 'paid': new_ids = self.pool.get('account.invoice').refund(cr, uid,[data.invoice_id.id]) self.write(cr, uid,ids, {'invoice_id' : new_ids[0]}) else: wf_service = netsvc.LocalService('workflow') wf_service.trg_validate(uid, 'account.invoice', data.invoice_id.id, 'invoice_cancel', cr)
if data.invoice_id: if data.invoice_id.state == 'paid': new_ids = self.pool.get('account.invoice').refund(cr, uid,[data.invoice_id.id]) self.write(cr, uid,ids, {'invoice_id' : new_ids[0]}) else: wf_service = netsvc.LocalService('workflow') wf_service.trg_validate(uid, 'account.invoice', data.invoice_id.id, 'invoice_can...
def cci_dossier_cancel_cci(self, cr, uid, ids, *args): data=self.browse(cr,uid,ids[0]) if data.invoice_id.state == 'paid': new_ids = self.pool.get('account.invoice').refund(cr, uid,[data.invoice_id.id]) self.write(cr, uid,ids, {'invoice_id' : new_ids[0]}) else: wf_service = netsvc.LocalService('workflow') wf_service.tr...
'document': wi.sale_order_id and ('sale.order' +','+ wi.sale_order_id.id) or ''})
'document': wi.sale_order_id and ('sale.order' +',' +'%d' %wi.sale_order_id.id) or ''})
def run(self, cr, uid, wi, context={}): result = super(dm_workitem, self).run(cr, uid, wi, context) if wi.sale_order_id: so_res = self.pool.get('sale.order')._sale_order_process(cr, uid, wi.sale_order_id.id) if wi.step_id.partner_event_create: self.pool.get('res.partner.event').create(cr, uid, { 'name': wi.step_id.name...
self.write(cr, uid, [wi.id], {'state': 'error',
wi_id = self.pool.get('dm.workitem').search(cr, uid, [('sale_order_id', '=', sale_order_id)]) self.write(cr, uid, wi_id, {'state': 'error',
def _sale_order_process(self, cr, uid, sale_order_id): so = self.pool.get('sale.order').browse(cr, uid, sale_order_id) wf_service = netsvc.LocalService('workflow')
'Purchase Line')
'Purchase Line'), 'dm_campaign_group_purchase_line_ids': fields.many2many('dm.campaign.group.purchase_line', 'dm_campaign_group_purchase_line_purchase_order_rel', 'purchase_order_id', 'dm_campaign_group_purchase_line_id', 'Purchase Line (for Campaign Group)')
def get_campaign_purchase_line_ids(self , cr, uid, ids, context): result = {}
print "camppppppppp",camp.date
def write(self, cr, uid, ids, vals, context=None): value = super(dm_campaign, self).write(cr, uid, ids, vals, context) for camp in self.browse(cr, uid, ids): print "camppppppppp",camp.date if camp.project_id : self.pool.get('project.project').write(cr, uid, [camp.project_id.id], {'date_end': camp.date_start) return val...
'step_id': fields.many2one('dm.offer.step', 'Offer Step'),
'step_id': fields.many2one('dm.offer.step', 'Offer Step', ondelete='cascade'),
def onchange_plugin(self, cr, uid, ids, document_template_id): res = {'value': {}} if document_template_id: template = self.pool.get('dm.document.template').read(cr, uid, [document_template_id])[0] res['value'] = {'document_template_plugin_ids':template['plugin_ids']} return res
if val is not False:
if val is not False and isinstance(val,basestring):
def _get_tax_amount(cr, uid, tax_id): if isinstance(tax_id, (int, long)): account_tax_obj = self.pool.get('account.tax') tax = account_tax_obj.browse(cr, uid, tax_id) else: tax = tax_id
certificates = obj_certificate.browse(cr,uid,certificates_ids)
def make_lines(self,cr,uid,res_file, data): lines=[] # first header line : _field_separator + _record_separator + _field_separator # so the receiver can detect which separators we use lines.append( self._field_separator + self._record_separator + self._field_separator) # second header line : give the id code of the C...
for certificate in certificates:
for cert in certificates_ids:
def make_lines(self,cr,uid,res_file, data): lines=[] # first header line : _field_separator + _record_separator + _field_separator # so the receiver can detect which separators we use lines.append( self._field_separator + self._record_separator + self._field_separator) # second header line : give the id code of the C...
file.write(self._record_separator.join(lines))
file.write(self._record_separator.join(lines).encode('utf-8'))
def write_txt(self,name,lines): file=open(name, 'w') file.write(self._record_separator.join(lines)) file.write(self._record_separator) file.close()
cancel_clause = not(data['form']['canceled']) and " and b.state not in ('cancel_customer','cancel_cci')" or '' query = 'select a.id from cci_missions_certificate as a, cci_missions_dossier as b where ( a.dossier_id = b.id ) and ( a.sending_spf is null ) and ( b.type_id = %s ) and ( b.date between %s )' + cancel_clause
def _send_mail(self, cr, uid, data, context):
cr.execute('select a.id from cci_missions_certificate as a, cci_missions_dossier as b where ( a.dossier_id = b.id ) and ( a.sending_spf is null ) and ( b.type_id = %s ) and ( b.date between %s )'%(certificate_type,period))
cr.execute(query % (certificate_type,period))
def _send_mail(self, cr, uid, data, context):
def convertByStream(self, stdinBytes, outputExt):
def convertByStream(self, stdinBytes, outputExt='pdf'):
def convertByStream(self, stdinBytes, outputExt): inputStream = self.ServiceManager.createInstanceWithContext("com.sun.star.io.SequenceInputStream", self.localContext) inputStream.initialize((uno.ByteSequence(stdinBytes),)) document = self.desktop.loadComponentFromURL('private:stream' , "_blank", 0, self._toPropertie...
def storeByPath(self, stdinBytes, outputExt):
def storeByPath(self, stdinBytes, outputExt='pdf'):
def storeByPath(self, stdinBytes, outputExt): inputStream = self.ServiceManager.createInstanceWithContext("com.sun.star.io.SequenceInputStream", self.localContext) inputStream.initialize((uno.ByteSequence(stdinBytes),))
def convertByPath(self, inputFile, outputFile, outputExt):
def convertByPath(self, inputFile, outputFile, outputExt='pdf'):
def convertByPath(self, inputFile, outputFile, outputExt): inputUrl = self._toFileUrl(inputFile) outputUrl = self._toFileUrl(outputFile) document = self.desktop.loadComponentFromURL(inputUrl, "_blank", 0, self._toProperties(Hidden=True))
elif line.amount_type == 'fix':
elif line.amount_type in ('fix', 'func'):
def _calculate(self, cr, uid, ids, field_names, arg, context): res = {} for rs in self.browse(cr, uid, ids, context): allow = 0.0 deduct = 0.0 others = 0.0 obj = {'basic':rs.basic} for line in rs.line_ids: amount = 0.0 if line.amount_type == 'per': amount = line.amount * eval(line.category_id.base, obj) elif line.am...
if contrib > amount: contrib = amount
def _calculate(self, cr, uid, ids, field_names, arg, context): res = {} for rs in self.browse(cr, uid, ids, context): allow = 0.0 deduct = 0.0 others = 0.0 obj = {'basic':rs.basic} for line in rs.line_ids: amount = 0.0 if line.amount_type == 'per': amount = line.amount * eval(line.category_id.base, obj) elif line.am...
elif line.category_id.contribute and line.category_id.include_in_salary and line.category_id.amount_type == 'fix': com_value = line.category_id.contribute_per elif line.category_id.contribute and line.category_id.include_in_salary and line.category_id.amount_type == 'func': com_value = self.pool.get('hr.allounce.deduct...
def compute_sheet(self, cr, uid, ids, context={}): emp_pool = self.pool.get('hr.employee') slip_pool = self.pool.get('hr.payslip') func_pool = self.pool.get('hr.employee.grade') slip_line_pool = self.pool.get('hr.payslip.line') holiday_pool = self.pool.get('hr.holidays') vals = self.read(cr, uid, ids)[0] emp_ids = ids...
value = 0.0 if line.category_id.amount_type == 'func': value = self.pool.get('hr.allounce.deduction.categoty').execute_function(cr, uid, line.category_id.id, contract.wage, context) slip_line_pool.write(cr, uid, [line.id], {'amount':value})
value = line.amount com_value = 0.0
def compute_sheet(self, cr, uid, ids, context={}): emp_pool = self.pool.get('hr.employee') slip_pool = self.pool.get('hr.payslip') func_pool = self.pool.get('hr.employee.grade') slip_line_pool = self.pool.get('hr.payslip.line') holiday_pool = self.pool.get('hr.holidays') vals = self.read(cr, uid, ids)[0] emp_ids = ids...
if not value and line.amount: value = line.amount
elif line.category_id.contribute and line.category_id.include_in_salary and line.category_id.amount_type == 'fix': com_value = line.category_id.contribute_per elif line.category_id.contribute and line.category_id.include_in_salary and line.category_id.amount_type == 'func': com_value = self.pool.get('hr.allounce.deduct...
def compute_sheet(self, cr, uid, ids, context={}): emp_pool = self.pool.get('hr.employee') slip_pool = self.pool.get('hr.payslip') func_pool = self.pool.get('hr.employee.grade') slip_line_pool = self.pool.get('hr.payslip.line') holiday_pool = self.pool.get('hr.holidays') vals = self.read(cr, uid, ids)[0] emp_ids = ids...
amount = line.amount
elif line.amount_type == 'func': value = self.pool.get('hr.payslip.line').execute_function(cr, uid, line.id, contract.wage, context) com_value = 0.0 if line.category_id.contribute and line.category_id.include_in_salary and line.category_id.amount_type == 'per': amt = amt + (amt * line.category_id.contribute_per) elif ...
def compute_sheet(self, cr, uid, ids, context={}): emp_pool = self.pool.get('hr.employee') slip_pool = self.pool.get('hr.payslip') func_pool = self.pool.get('hr.employee.grade') slip_line_pool = self.pool.get('hr.payslip.line') holiday_pool = self.pool.get('hr.holidays') vals = self.read(cr, uid, ids)[0] emp_ids = ids...
elif line.amount_type == 'fix': value = 0.0 if line.category_id.amount_type == 'func': value = self.pool.get('hr.allounce.deduction.categoty').execute_function(cr, uid, line.category_id.id, contract.wage, context) slip_line_pool.write(cr, uid, [line.id], {'amount':value}) if line.category_id.contribute and line.catego...
ded_fix += com_value
def compute_sheet(self, cr, uid, ids, context={}): emp_pool = self.pool.get('hr.employee') slip_pool = self.pool.get('hr.payslip') func_pool = self.pool.get('hr.employee.grade') slip_line_pool = self.pool.get('hr.payslip.line') holiday_pool = self.pool.get('hr.holidays') vals = self.read(cr, uid, ids)[0] emp_ids = ids...
amount = line.amount
if value: amount = value else: amount = line.amount
def compute_sheet(self, cr, uid, ids, context={}): emp_pool = self.pool.get('hr.employee') slip_pool = self.pool.get('hr.payslip') func_pool = self.pool.get('hr.employee.grade') slip_line_pool = self.pool.get('hr.payslip.line') holiday_pool = self.pool.get('hr.holidays') vals = self.read(cr, uid, ids)[0] emp_ids = ids...
'note':fields.text('Description')
'note':fields.text('Description'), 'line_ids':fields.one2many('hr.payslip.line.line', 'slipline_id', 'Calculations', required=False)
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}}
self.pool.get('sale.shop').write(cr, uid, shop.id, {'last_inventory_export_date': time.strftime('%Y-%m-%d %H:%M:%S')})
shop.write({'last_inventory_export_date': time.strftime('%Y-%m-%d %H:%M:%S')})
def export_inventory(self, cr, uid, ids, ctx=None): if ctx is None: ctx = {} for shop in self.browse(cr, uid, ids): ctx['shop_id'] = shop.id ctx['conn_obj'] = self.external_connection(cr, uid, shop.referential_id) product_ids = [product.id for product in shop.exportable_product_ids] if shop.last_inventory_export_date: ...
case = case[0]
if isinstance(case, list): case = case[0]
def create(self, cr, uid, values, context={}): # to be check res = super(crm_case, self).create(cr, uid, values, context=context) cr.commit() case = self.browse(cr, uid, res, context=context) case = case[0] if case.project_id: desc = ''' Hello, \n \t The new case is created for the Project: %s \n\n And its Details are:...
message.append(msg)
def send_email(cr, uid, obj, context): """ Get Emailmvision connection infos """ ev_host = obj.mail_service_id.ev_host ev_service = obj.mail_service_id.ev_service if obj.document_id.ev_template: ev_encrypt = obj.document_id.ev_template.ev_encrypt ev_random = obj.document_id.ev_template.ev_random else: ev_encrypt = ob...
message.extend(msg) else: return {'code':'emv_doc_error'}
if msg in ('plugin_error','plugin_missing') : return {'code':msg,'ids':[obj.id]} message.extend(msg)
def send_email(cr, uid, obj, context): """ Get Emailmvision connection infos """ ev_host = obj.mail_service_id.ev_host ev_service = obj.mail_service_id.ev_service if obj.document_id.ev_template: ev_encrypt = obj.document_id.ev_template.ev_encrypt ev_random = obj.document_id.ev_template.ev_random else: ev_encrypt = ob...
'plugin_ids':fields.many2many('dm.dtp.plugin', 'dm_template_plugin_rel', 'dm_dtp_plugin_id', 'dm_document_template_id', 'Plugins'),
def _get_preview(self, cr, uid, ids, name, arg, context=None): result = {} if context is None: context = {} ctx = context.copy() ctx['bin_size'] = False for i in self.browse(cr, uid, ids, context=ctx): result[i.id] = False for format in ('png','jpg','jpeg','gif','bmp'): if (i.preview_fname and i.preview_fname.lower() o...
logger.notifyChannel('extdata_from_oevals', netsvc.DEBUG, "Error in import mapping: %r" % (each_mapping_line['in_function'],))
logger.notifyChannel('extdata_from_oevals', netsvc.LOG_DEBUG, "Error in import mapping: %r" % (each_mapping_line['in_function'],))
def oevals_from_extdata(self, cr, uid, external_referential_id, data_record, key_field, mapping_lines, defaults, context): if context is None: context = {} vals = {} #Dictionary for create record for each_mapping_line in mapping_lines: #Type cast if the expression exists if each_mapping_line['external_field'] in data_r...
logger.notifyChannel('extdata_from_oevals', netsvc.DEBUG, "Mapping Context: %r" % (space,)) logger.notifyChannel('extdata_from_oevals', netsvc.DEBUG, "Exception: %r" % (e,))
logger.notifyChannel('extdata_from_oevals', netsvc.LOG_DEBUG, "Mapping Context: %r" % (space,)) logger.notifyChannel('extdata_from_oevals', netsvc.LOG_DEBUG, "Exception: %r" % (e,))
def oevals_from_extdata(self, cr, uid, external_referential_id, data_record, key_field, mapping_lines, defaults, context): if context is None: context = {} vals = {} #Dictionary for create record for each_mapping_line in mapping_lines: #Type cast if the expression exists if each_mapping_line['external_field'] in data_r...
raw_datas = "2;US-OERP-0000;162220;MR;Shah;Harshit;W Sussex;;25 Oxford Road;;BE;BN;BN11 1XQ;WORTHING.LU.SX"
def onchange_rawdatas(self, cr, uid, ids, raw_datas): if not raw_datas: return {} raw_datas = "2;US-OERP-0000;162220;MR;Shah;Harshit;W Sussex;;25 Oxford Road;;BE;BN;BN11 1XQ;WORTHING.LU.SX" value = raw_datas.split(';') key = ['datamatrix_type', 'segment_id', 'customer_code', 'title', 'customer_lastname', 'customer_firs...
if f_id: value[field]= f_id raise osv.except_osv(_('Error !'), _('No %s found for the code '%field_check[m][1]))
if not f_id: raise osv.except_osv(_('Error !'), _('No %s found for the code '%field_check[m][1])) value[field]= f_id[0]
def onchange_rawdatas(self, cr, uid, ids, raw_datas): if not raw_datas: return {} raw_datas = "2;US-OERP-0000;162220;MR;Shah;Harshit;W Sussex;;25 Oxford Road;;BE;BN;BN11 1XQ;WORTHING.LU.SX" value = raw_datas.split(';') key = ['datamatrix_type', 'segment_id', 'customer_code', 'title', 'customer_lastname', 'customer_firs...
def _write_relationship_graph(self, module_name=''):
def _write_relationship_graph(self, module_name=False):
def _write_relationship_graph(self, module_name=''): sl = ["", "Relationship Graph", "------------", ".. figure:: %s_module.png" %module_name , " :scale: 50", " :align: center", ""] sl.append("") return '\n'.join(sl)
def write(self, module_name=''):
def write(self, module_name=False):
def write(self, module_name=''): s = '' s += self._write_header() s += self._write_depends() s += self._write_reports() s += self._write_menus() s += self._write_views() s += self._write_objects() s += self._write_relationship_graph(module_name)
s += self._write_relationship_graph(module_name)
if module_name: s += self._write_relationship_graph(module_name)
def write(self, module_name=''): s = '' s += self._write_header() s += self._write_depends() s += self._write_reports() s += self._write_menus() s += self._write_views() s += self._write_objects() s += self._write_relationship_graph(module_name)
out = rstdoc.write(module.name)
graph_mod = False module_name = False if module.file_graph: graph_mod = base64.decodestring(module.file_graph) else: module_data = module_model.get_relation_graph(cr, uid, module.name, context=context) if module_data['module_file']: graph_mod = base64.decodestring(module_data['module_file']) if graph_mod: module_name =...
def _generate(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) module_model = pool.get('ir.module.module') module_ids = data['ids']
try: if module.file_graph: graph_mod = base64.decodestring(module.file_graph) else: module_data = module_model.get_relation_graph(cr, uid, module.name, context=context) graph_mod = base64.decodestring(module_data['module_file']) tmpdir = tempfile.mkdtemp() tmp_file_graph = tempfile.NamedTemporaryFile() tmp_file_graph.w...
def _generate(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) module_model = pool.get('ir.module.module') module_ids = data['ids']
if server.openerp2vm.delete_product(website.login, website.password, eid): cdelete += 1
server.openerp2vm.delete_product(website.login, website.password, eid)
def _get_tax_amount(cr, uid, tax_id): if isinstance(tax_id, (int, long)): account_tax_obj = self.pool.get('account.tax') tax = account_tax_obj.browse(cr, uid, tax_id) else: tax = tax_id
context.update({'partner_id':data.order_partner_id})
context.update({'partner_id':data.order_partner_id.id})
def _createInvoices(self, cr, uid, data, context={}): list_inv = [] pool_obj = pooler.get_pool(cr.dbname) obj_dossier = pool_obj.get(data['model']) current_model=data['model'] data_dossier = obj_dossier.browse(cr,uid,data['ids']) obj_lines=pool_obj.get('account.invoice.line') inv_create = 0 inv_reject = 0 inv_rej_reaso...
'name': data.name,
def _createInvoices(self, cr, uid, data, context={}): list_inv = [] pool_obj = pooler.get_pool(cr.dbname) obj_dossier = pool_obj.get(data['model']) current_model=data['model'] data_dossier = obj_dossier.browse(cr,uid,data['ids']) obj_lines=pool_obj.get('account.invoice.line') inv_create = 0 inv_reject = 0 inv_rej_reaso...
self.pool.get('ir.attachment').write(cr, uid, attachment_id, {'datas': base64.encodestring(open(transfo['kettle_dir'] +"/" + log_file_name + '.log', 'rb').read()), 'datas_fname': log_file_name + '.log'}, context)
if os_result != 0: prefixe_log_name = "[ERROR]" else: note = self.pool.get('ir.attachment').read(cr, uid, attachment_id, ['description'], context)['description'] if 'WARNING' in note: prefixe_log_name = "[WARNING]" else: prefixe_log_name = "[SUCCESS]" self.pool.get('ir.attachment').write(cr, uid, attachment_id, {'data...
def execute_transformation(self, cr, uid, id, filter, log_file_name, attachment_id, context): transfo = self.read(cr, uid, id, ['kettle_dir','file_name'], context) logger = netsvc.Logger() file = transfo['kettle_dir']+'/transformations/'+transfo['file_name'] if not os.path.isfile(file + '.ktr'): raise osv.except_osv('E...
{'date_end': camp.date_start)
{'date_end': camp.date_start})
def write(self, cr, uid, ids, vals, context=None): value = super(dm_campaign, self).write(cr, uid, ids, vals, context) for camp in self.browse(cr, uid, ids): if camp.project_id : self.pool.get('project.project').write(cr, uid, [camp.project_id.id], {'date_end': camp.date_start) return value
{'date_end': camp.date_start.split(' ')[0]})
{'date_end': camp.date_start)
def write(self, cr, uid, ids, vals, context=None): value = super(dm_campaign, self).write(cr, uid, ids, vals, context) for camp in self.browse(cr, uid, ids): print "camppppppppp",camp.date if camp.project_id : self.pool.get('project.project').write(cr, uid, [camp.project_id.id], {'date_end': camp.date_start.split(' ')[...
before_date = dt.now() + dt.RelativeDateTime(months=-1)
today = dt.now() before_date = dt.now() + dt.RelativeDateTime(months=1)
def _carnet_before(self): import mx.DateTime as dt res = {} res_list = [] before_date = dt.now() + dt.RelativeDateTime(months=-1) before_date = before_date.strftime("%Y-%m-%d") carnet_obj = self.pool.get('cci_missions.ata_carnet') carnet_ids = carnet_obj.search(self.cr, self.uid, [('validity_date', '>=', before_date),...
carnet_ids = carnet_obj.search(self.cr, self.uid, [('validity_date', '>=', before_date), ('state', '>=', 'created')])
carnet_ids = carnet_obj.search(self.cr, self.uid, [('validity_date', '<=', before_date),('validity_date','>=',today), ('state', '>=', 'created')])
def _carnet_before(self): import mx.DateTime as dt res = {} res_list = [] before_date = dt.now() + dt.RelativeDateTime(months=-1) before_date = before_date.strftime("%Y-%m-%d") carnet_obj = self.pool.get('cci_missions.ata_carnet') carnet_ids = carnet_obj.search(self.cr, self.uid, [('validity_date', '>=', before_date),...
'invoice' : iml[0]['invoice'],
'voucher_invoice' : iml[0]['invoice'].id,
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
vcs3 = inv.number.split('/')[2]
vcs3 = inv.number.split('/')[1]
def action_number(self, cr, uid, ids, *args): res = super(account_invoice,self).action_number(cr, uid, ids, args) for inv in self.browse(cr, uid, ids): vcs ='' if inv.number and not inv.name: vcs3 = inv.number.split('/')[2] vcs1 = '0'+ str(inv.date_invoice[2:4]) if len(vcs3) >= 6: vcs2= vcs3[0:6] else: vcs2 = vcs3.rjus...
'voucher_invoice' : iml[0]['invoice'].id,
'voucher_invoice' : iml and iml[0]['invoice'] and iml[0]['invoice'].id or False,
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
if ptype == 'member_price':
partner_status = context.get('partner_id') and context['partner_id'].membership_state or False if ptype == 'member_price' or partner_status in ['waiting','associated','free','paid','invoiced']:
def price_get(self, cr, uid, ids, ptype='list_price',context={}): res = {} product_uom_obj = self.pool.get('product.uom') # force_member works for forcing member price if partner is non member, same reasonning for force_non_member for product in self.browse(cr, uid, ids, context=context): if ptype == 'member_price': re...
state = self.pool.get('res.partner').browse(cr, uid, [context['partner_id']])[0].membership_state
state = context['partner_id'].membership_state
def price_get(self, cr, uid, ids, ptype='list_price',context={}): res = {} product_uom_obj = self.pool.get('product.uom') # force_member works for forcing member price if partner is non member, same reasonning for force_non_member for product in self.browse(cr, uid, ids, context=context): if ptype == 'member_price': re...
f_name = tempfile.gettempdir() +'/'+ attach.datas_fname
f_name = tempfile.gettempdir() +'/'+ attach.name
def _send_mails(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) po_id = data['id'] attachment_ids = pool.get('ir.attachment').search(cr, uid, [('res_model', '=', 'purchase.order'), ('res_id', '=', po_id)]) attachments = [] for attach in pool.get('ir.attachment').browse(cr, uid, attachment_ids): f_name ...
(result, format) = service.create(cr, uid, [], {}, context)
(result, format) = service.create(cr, uid, [po_id], {}, context)
def _send_mails(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) po_id = data['id'] attachment_ids = pool.get('ir.attachment').search(cr, uid, [('res_model', '=', 'purchase.order'), ('res_id', '=', po_id)]) attachments = [] for attach in pool.get('ir.attachment').browse(cr, uid, attachment_ids): f_name ...
msg_string = 'Email is send at % successsfully'%email_to[0] return {}
msg_string = 'Email is send at %s successfully'%email_to[0] return {'email_sent':msg_string}
def _send_mails(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) po_id = data['id'] attachment_ids = pool.get('ir.attachment').search(cr, uid, [('res_model', '=', 'purchase.order'), ('res_id', '=', po_id)]) attachments = [] for attach in pool.get('ir.attachment').browse(cr, uid, attachment_ids): f_name ...
'result': {'type': 'form', 'arch': email_done_form, 'fields': email_done_fields, 'state': [('end','Cancel'),] }
'result': {'type': 'form', 'arch': email_done_form, 'fields': email_done_fields, 'state': [('end','Ok'),] }
def _send_mails(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) po_id = data['id'] attachment_ids = pool.get('ir.attachment').search(cr, uid, [('res_model', '=', 'purchase.order'), ('res_id', '=', po_id)]) attachments = [] for attach in pool.get('ir.attachment').browse(cr, uid, attachment_ids): f_name ...
AND ha.employee_id = %s """, (evaluation_obj.date_current, start_date, emp_id))
AND ha.employee_id = %s """, (stop_date, start_date, emp_id))
def action_create(self, cr, uid, ids, context=None): data = {} objs = [] value = {} my_dict = {} bjs = [] contract_obj = self.pool.get('hr.contract') evaluation_obj = self.browse(cr, uid, ids, context = context)[0] group_id = evaluation_obj.hr_timesheet_group_id.id contract_ids = contract_obj.search(cr, uid, [('working...
'price':item.list_price,
'price':item.list_price + price,
def _select_prices_prog(self, cr, uid, data, context): if context.has_key('prices_prog_id'): prices_prog_id = context['prices_prog_id'] else : prices_prog_id = data['form']['prices_progression']
if google_auth_details.company_id.partner_id.address: add = google_auth_details.company_id.partner_id.address[0] city = add.city or '' street = add.street or '' street2 = add.street2 or '' zip = add.zip or '' country = add.country_id and add.country_id.name or '' location = street + " " +street2 + " " + city + " " + zi...
if not google_auth_details.company_id.partner_id.address: raise wizard.except_wizard(_('Warning'), _('The Partner of the Main Company does not have any address defined!')) add = google_auth_details.company_id.partner_id.address[0] city = add.city or '' street = add.street or '' street2 = add.street2 or '' zip = add.zi...
def _synch_events(self, cr, uid, data, context={}):
vcs3=str(inv.number).split('/')[1] vcs1='0'+ str(inv.date_invoice[2:4]) if len(str(vcs3))>=5: vcs2=str(inv.number[3]) + str(vcs3[0:5]) elif len(str(vcs3))==4: vcs2=str(inv.number[3]) + '0' +str(vcs3)
vcs3 = inv.number.split('/')[2] vcs1 = '0'+ str(inv.date_invoice[2:4]) if len(vcs3) >= 6: vcs2= vcs3[0:6]
def action_number(self, cr, uid, ids, *args): res = super(account_invoice,self).action_number(cr, uid, ids, args) for inv in self.browse(cr, uid, ids): vcs ='' if inv.number and not inv.name: vcs3=str(inv.number).split('/')[1] vcs1='0'+ str(inv.date_invoice[2:4]) if len(str(vcs3))>=5: vcs2=str(inv.number[3]) + str(vcs3...
vcs2=str(inv.number[3]) + '00' +str(vcs3)
vcs2 = vcs3.rjust(6,'0')
def action_number(self, cr, uid, ids, *args): res = super(account_invoice,self).action_number(cr, uid, ids, args) for inv in self.browse(cr, uid, ids): vcs ='' if inv.number and not inv.name: vcs3=str(inv.number).split('/')[1] vcs1='0'+ str(inv.date_invoice[2:4]) if len(str(vcs3))>=5: vcs2=str(inv.number[3]) + str(vcs3...
vcs5=int(vcs4) check_digit=vcs5%97 if check_digit==0: check_digit='97' if check_digit<=9: check_digit='0'+str(check_digit) vcs=vcs1+'/'+vcs2+'/'+ '0' +str(check_digit)
vcs5 = int(vcs4) check_digit = vcs5 % 97 if check_digit == 0: check_digit = '97' if check_digit <= 9: check_digit = '0' + str(check_digit) vcs = vcs1 + '/' + vcs2[0:4] + '/' + vcs2[4:6] + '0' + str(check_digit)
def action_number(self, cr, uid, ids, *args): res = super(account_invoice,self).action_number(cr, uid, ids, args) for inv in self.browse(cr, uid, ids): vcs ='' if inv.number and not inv.name: vcs3=str(inv.number).split('/')[1] vcs1='0'+ str(inv.date_invoice[2:4]) if len(str(vcs3))>=5: vcs2=str(inv.number[3]) + str(vcs3...
newname = obj_pool.get('ir.sequence').get(cr, uid,type_rec.sequence_id.code)
def _create_legalization(self, cr, uid, data, context): obj_pool = pooler.get_pool(cr.dbname) obj_certi = obj_pool.get('cci_missions.certificate') data_certi = obj_certi.browse(cr, uid, data['ids']) list_leglization = [] leg_create = 0 leg_reject = 0 leg_rej_reason = "" type_id = data['form']['leg_type_id'] type_rec = ...
'name': newname,
def _create_legalization(self, cr, uid, data, context): obj_pool = pooler.get_pool(cr.dbname) obj_certi = obj_pool.get('cci_missions.certificate') data_certi = obj_certi.browse(cr, uid, data['ids']) list_leglization = [] leg_create = 0 leg_reject = 0 leg_rej_reason = "" type_id = data['form']['leg_type_id'] type_rec = ...
for invoice_rec in self.browse(cr, uid, ids): if invoice_rec.move_id and not invoice_rec.ref_move: self.write(cr, uid, [invoice_rec.id], {'ref_move':invoice_rec.move_id.name})
def action_move_create(self, cr, uid, ids, context=None): flag = membership_flag = False product_ids = [] move_obj = self.pool.get('account.move') move_line_obj = self.pool.get('account.move.line') data_invoice = self.browse(cr,uid,ids[0]) #raise an error if one of the account_invoice_line doesn't have an analytic entr...
if journal.sequence_id:
if inv.move_id: name = inv.move_id.name elif journal.sequence_id:
def action_move_create(self, cr, uid, ids, context=None): flag = membership_flag = False product_ids = [] move_obj = self.pool.get('account.move') move_line_obj = self.pool.get('account.move.line') data_invoice = self.browse(cr,uid,ids[0]) #raise an error if one of the account_invoice_line doesn't have an analytic entr...
err_log = ""
err_log = "Errors:\n------\n" nb_err=0 std_log='' str_log1 = "Coda File is Imported : " str_not='' str_not1=''
def _coda_parsing(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) codafile = data['form']['coda'] jur_id = data['form']['journal_id'] def_pay_acc = data['form']['def_payable'] def_rec_acc = data['form']['def_receivable'] str_log = "" err_log = "" bank_statement={} bank_statement_lines={} bank_statemen...
bank_statement_lines[st_line['name']]=st_line
bank_statement_lines[line[2:6] + st_line['name']]=st_line
def _coda_parsing(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) codafile = data['form']['coda'] jur_id = data['form']['journal_id'] def_pay_acc = data['form']['def_payable'] def_rec_acc = data['form']['def_receivable'] str_log = "" err_log = "" bank_statement={} bank_statement_lines={} bank_statemen...
st_line_name = st_line['name']
st_line_name = line[2:6] + st_line['name']
def _coda_parsing(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) codafile = data['form']['coda'] jur_id = data['form']['journal_id'] def_pay_acc = data['form']['def_payable'] def_rec_acc = data['form']['def_receivable'] str_log = "" err_log = "" bank_statement={} bank_statement_lines={} bank_statemen...
cntry_number=line[10:47] contry_name=line[47:125]
cntry_number=line[10:47].strip() contry_name=line[47:125].strip()
def _coda_parsing(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) codafile = data['form']['coda'] jur_id = data['form']['journal_id'] def_pay_acc = data['form']['def_payable'] def_rec_acc = data['form']['def_receivable'] str_log = "" err_log = "" bank_statement={} bank_statement_lines={} bank_statemen...
line=bank_statement_lines[st_line_name] line['cntry_number']=cntry_number line['contry_name']=contry_name
def _coda_parsing(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) codafile = data['form']['coda'] jur_id = data['form']['journal_id'] def_pay_acc = data['form']['def_payable'] def_rec_acc = data['form']['def_receivable'] str_log = "" err_log = "" bank_statement={} bank_statement_lines={} bank_statemen...
line['partner_id']=bank.partner_id.id if line['amount'] < 0 : line['account_id']=bank.partner_id.property_account_payable.id
bank_statement_lines[st_line_name].update({'partner_id': bank.partner_id.id}) if bank_statement_lines[st_line_name]['amount'] < 0 : bank_statement_lines[st_line_name].update({'account_id': bank.partner_id.property_account_payable.id})
def _coda_parsing(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) codafile = data['form']['coda'] jur_id = data['form']['journal_id'] def_pay_acc = data['form']['def_payable'] def_rec_acc = data['form']['def_receivable'] str_log = "" err_log = "" bank_statement={} bank_statement_lines={} bank_statemen...
line['account_id']=bank.partner_id.property_account_receivable.id bank_statement_lines[st_line_name]=line
bank_statement_lines[st_line_name].update({'account_id': bank.partner_id.property_account_receivable.id})
def _coda_parsing(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) codafile = data['form']['coda'] jur_id = data['form']['journal_id'] def_pay_acc = data['form']['def_payable'] def_rec_acc = data['form']['def_receivable'] str_log = "" err_log = "" bank_statement={} bank_statement_lines={} bank_statemen...
line=bank_statement_lines[st_line_name] line['cntry_number']=cntry_number line['contry_name']=contry_name bank_statement_lines[st_line_name]=line
nb_err += 1 err_log += _('The bank account %s is not defined for the partner %s.\n')%(cntry_number,contry_name) bank_statement_lines[st_line_name].update({'account_id': data['form']['awaiting_account']})
def _coda_parsing(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) codafile = data['form']['coda'] jur_id = data['form']['journal_id'] def_pay_acc = data['form']['def_payable'] def_rec_acc = data['form']['def_receivable'] str_log = "" err_log = "" bank_statement={} bank_statement_lines={} bank_statemen...
nb_err=0 err_log='' str_log='' std_log='' str_log1 = "Coda File is Imported : " str_not='' str_not1=''
def _coda_parsing(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) codafile = data['form']['coda'] jur_id = data['form']['journal_id'] def_pay_acc = data['form']['def_payable'] def_rec_acc = data['form']['def_receivable'] str_log = "" err_log = "" bank_statement={} bank_statement_lines={} bank_statemen...
str_not1="Partner name:%s \n Partner Account Number:%s \n Communication:%s \n Value Date:%s \n Entry Date:%s \n"%(line["contry_name"],line["cntry_number"],line["free_comm"],line["val_date"],line["entry_date"][0])
str_not1 = '' if line['partner_id'] == 0: nb_err+=1 err_log += '\nThe bank account %s is not defined for the partner %s.'%(cntry_number,contry_name) if line.has_key('contry_name') and line.has_key('cntry_number'): str_not1="Partner name:%s \n Partner Account Number:%s \n Communication:%s \n Value Date:%s \n Entry Date:...
def _coda_parsing(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) codafile = data['form']['coda'] jur_id = data['form']['journal_id'] def_pay_acc = data['form']['def_payable'] def_rec_acc = data['form']['def_receivable'] str_log = "" err_log = "" bank_statement={} bank_statement_lines={} bank_statemen...
std_log = std_log + "\nDate : %s, Starting Balance : %.2f , Ending Balance : %.2f "\
std_log = std_log + "\nDate : %s, Starting Balance : %.2f , Ending Balance : %.2f \n"\
def _coda_parsing(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) codafile = data['form']['coda'] jur_id = data['form']['journal_id'] def_pay_acc = data['form']['def_payable'] def_rec_acc = data['form']['def_receivable'] str_log = "" err_log = "" bank_statement={} bank_statement_lines={} bank_statemen...
selection.append((ans['id'], ans['answer']))
selection.append((str(ans['id']), ans['answer']))
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False): result = super(survey_question_wiz, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar) surv_name_wiz = self.pool.get('survey.name.wiz') sur_name_rec = surv_name_wiz.read(cr, uid, context['sur_name_id'])[0]...
def execute(self, db, uid, data, state='init', context=None): self.dm_wiz_data = data return super(wizard_document_report, self).execute( db, uid, data, state, context) def _print_report(self, cr, uid, data, context):
def _print_report(self, cr, uid, data, context):
def execute(self, db, uid, data, state='init', context=None): # {{{ self.dm_wiz_data = data return super(wizard_document_report, self).execute( db, uid, data, state, context) # }}}
return res def get_campaings(self,cr,uid,context): document_id = self.dm_wiz_data['id'] pool = pooler.get_pool(cr.dbname) seg_obj = pool.get('dm.campaign.proposition.segment') document = pool.get('dm.offer.document').browse(cr,uid,document_id) if document.step_id: offer=document.step_id.offer_id.id if offer: camp_ids=...
return res
def _get_reports(self, cr, uid, context): # {{{ document_id = self.dm_wiz_data['id'] pool = pooler.get_pool(cr.dbname) group_obj = pool.get('ir.actions.report.xml') ids = group_obj.search(cr, uid, [('document_id', '=', document_id)]) res = [(group.id, group.name) for group in group_obj.browse(cr, uid, ids)] res.sort(la...
report_list_fields = { 'report': {'string': 'Select Report', 'type': 'selection', 'selection': _get_reports, }, 'address_id': {'string': 'Select Customer Address', 'type': 'many2one', 'relation': 'res.partner.address', 'domain': [('partner_id.category_id', '=', 'DTP Preview Customers')] }, 'segment_id': {'string': 'Sel...
def _set_segment(self, cr, uid, data, context): address = data['form']['address_id']
def get_campaings(self,cr,uid,context): document_id = self.dm_wiz_data['id'] pool = pooler.get_pool(cr.dbname) seg_obj = pool.get('dm.campaign.proposition.segment') document = pool.get('dm.offer.document').browse(cr,uid,document_id) if document.step_id: offer=document.step_id.offer_id.id if offer: camp_ids=pool.get('dm...
report_send_fields = { 'mail_service_id': {'string': 'Select Mail Service', 'type': 'many2one', 'relation': 'dm.mail_service',}, }
domain = [] if address: pool = pooler.get_pool(cr.dbname) wi_obj = pool.get('dm.workitem') workitem_ids = wi_obj.search(cr, uid, [('address_id', '=', address)]) segment_ids = list(set([wi.segment_id.id for wi in wi_obj.browse(cr, uid, workitem_ids) if wi.segment_id.id])) domain = [('id', 'in', tuple(segment_ids))]
def get_campaings(self,cr,uid,context): document_id = self.dm_wiz_data['id'] pool = pooler.get_pool(cr.dbname) seg_obj = pool.get('dm.campaign.proposition.segment') document = pool.get('dm.offer.document').browse(cr,uid,document_id) if document.step_id: offer=document.step_id.offer_id.id if offer: camp_ids=pool.get('dm...
states = {
self.states['init2']['result']['fields']['segment_id']['domain'] = domain return {} report_list_fields1 = { 'report': { 'string': 'Select Report', 'type': 'selection', 'selection': _get_reports, }, 'address_id': { 'string': 'Select Customer Address', 'type': 'many2one', 'relation': 'res.partner.address', 'selection':...
def get_campaings(self,cr,uid,context): document_id = self.dm_wiz_data['id'] pool = pooler.get_pool(cr.dbname) seg_obj = pool.get('dm.campaign.proposition.segment') document = pool.get('dm.offer.document').browse(cr,uid,document_id) if document.step_id: offer=document.step_id.offer_id.id if offer: camp_ids=pool.get('dm...
'result': {'type': 'form', 'arch': report_list_form, 'fields': report_list_fields, 'state': [('end', 'Cancel'),('print_report', 'Print Report'), ('send_report', 'Send Report'),]} },
'result': { 'type': 'form', 'arch': report_list_form1, 'fields': report_list_fields1, 'state': [('end', 'Cancel'), ('init2', 'Select Segment'),], } }, 'init2': { 'actions': [_set_segment], 'result': { 'type': 'form', 'arch': report_list_form2, 'fields': report_list_fields2, 'state': [('end', 'Cancel'), ('print_report',...
def get_campaings(self,cr,uid,context): document_id = self.dm_wiz_data['id'] pool = pooler.get_pool(cr.dbname) seg_obj = pool.get('dm.campaign.proposition.segment') document = pool.get('dm.offer.document').browse(cr,uid,document_id) if document.step_id: offer=document.step_id.offer_id.id if offer: camp_ids=pool.get('dm...
'result': {'type': 'print', 'report': '', 'state': 'end'} },
'result': { 'type': 'print', 'report': '', 'state': 'end', } },
def get_campaings(self,cr,uid,context): document_id = self.dm_wiz_data['id'] pool = pooler.get_pool(cr.dbname) seg_obj = pool.get('dm.campaign.proposition.segment') document = pool.get('dm.offer.document').browse(cr,uid,document_id) if document.step_id: offer=document.step_id.offer_id.id if offer: camp_ids=pool.get('dm...
list.sort(key=lambda inv: inv.number)
def filter_invoices(self, list, dest) : if not list : return tmp = {} #We sort the invoice by currency in a tmp dict #{'currency':[browse, records]} for inv in list: currency = inv.currency_id.name if tmp.has_key(currency) : tmp[currency].append(inv) else : tmp[currency] = [inv] #We compute the total by currency for cu...
((1-pi.price_discount)*100) as comrate,((al.quantity *al.price_unit)*(1-pi.price_discount))
((1-pi.price_discount)*100)::double precision as comrate,((al.quantity *al.price_unit)*(1-pi.price_discount))
def init(self, cr): cr.execute(""" create or replace view report_commission_month as (select * from (select sg.id as id,sg.name as name,so.name as sono,ai.number as invno,
data = voucher_obj.onchange_partner_id(cr, uid, [], partner_id, journal_id, int(amount), False, 'receipt')['value']
data = voucher_obj.onchange_partner_id(cr, uid, [], partner_id, journal_id, int(amount), False, 'receipt', date, context)['value']
def generate_payment_with_journal(self, cr, uid, journal_id, partner_id, amount, payment_ref, entry_name, date, should_validate, context): voucher_obj = self.pool.get('account.voucher') voucher_line_obj = self.pool.get('account.voucher.line') data = voucher_obj.onchange_partner_id(cr, uid, [], partner_id, journal_id, i...
missing_wi.append(camp_doc.workitem_id.id)
missing_wi.append(camp_doc.id)
def state_resent(self, cr, uid, ids, context={}): camp_doc_obj = self.browse(cr, uid, ids) write_ids = {} #wi_id : camp_doc_id missing_wi = [] for camp_doc in camp_doc_obj: if camp_doc.workitem_id: write_ids[camp_doc.workitem_id.id] = camp_doc.id else: missing_wi.append(camp_doc.workitem_id.id) if write_ids : self.pool...
tmp_room_lines = vals['room_lines'] tmp_service_lines = vals['service_lines']
tmp_room_lines = vals.get('room_lines',[]) tmp_service_lines = vals.get('service_lines',[])
def create(self, cr, uid, vals, context=None, check=True): tmp_room_lines = vals['room_lines'] tmp_service_lines = vals['service_lines'] if not vals.has_key("folio_id"): vals.update({'room_lines':[],'service_lines':[]}) folio_id = super(hotel_folio, self).create(cr, uid, vals, context) for line in tmp_room_lines: line[...
account_id = self.pool.get('account.bank.statement.line').onchange_partner_id(cr, uid, [], partner_id, "customer", statement.currency.id, ctx)['value']['account_id']
account_id = self.pool.get('account.bank.statement.line').onchange_type(cr, uid, [], partner_id, "customer", ctx)['value']['account_id']
def generate_payment_with_journal(self, cr, uid, journal_id, partner_id, amount, payment_ref, entry_name, date, should_validate, ctx): statement_vals = { 'name': 'ST_' + entry_name, 'journal_id': journal_id, 'balance_start': 0, 'balance_end_real': amount, 'date' : date } statement_id = self.pool.get('account.bank.state...
res['uos']='_____' res['name']='______________________________________'
res['uos']='_______' res['name']='____________________________________________'
def invoice_lines(self,invoice): result =[] sub_total={} info=[] invoice_list=[] res={} list_in_seq={} k=0 ids = self.pool.get('account.invoice.line').search(self.cr, self.uid, [('invoice_id', '=', invoice.id)]) ids.sort() for id in range(0,len(ids)): info = self.pool.get('account.invoice.line').browse(self.cr, self.ui...
if abs(res['balance']) < 10**-int(config['price_accuracy']):
if abs(res['balance']) < 0.5 * 10**-int(config['price_accuracy']):
def lines(self, form, ids={}, done=None, level=0): """ Returns all the data needed for the report lines (account info plus debit/credit/balance in the selected period and the full year) """ if not ids: ids = self.ids if not ids: return [] if not done: done = {} if form.has_key('account_list') and form['account_list']: ...
if abs(res['balance_fy']) < 10**-int(config['price_accuracy']):
if abs(res['balance_fy']) < 0.5 * 10**-int(config['price_accuracy']):
def lines(self, form, ids={}, done=None, level=0): """ Returns all the data needed for the report lines (account info plus debit/credit/balance in the selected period and the full year) """ if not ids: ids = self.ids if not ids: return [] if not done: done = {} if form.has_key('account_list') and form['account_list']: ...
if abs(res['balanceinit']) < 10**-int(config['price_accuracy']):
if abs(res['balanceinit']) < 0.5 * 10**-int(config['price_accuracy']):
def lines(self, form, ids={}, done=None, level=0): """ Returns all the data needed for the report lines (account info plus debit/credit/balance in the selected period and the full year) """ if not ids: ids = self.ids if not ids: return [] if not done: done = {} if form.has_key('account_list') and form['account_list']: ...
if abs(res['balanceinit_fy']) < 10**-int(config['price_accuracy']):
if abs(res['balanceinit_fy']) < 0.5 * 10**-int(config['price_accuracy']):
def lines(self, form, ids={}, done=None, level=0): """ Returns all the data needed for the report lines (account info plus debit/credit/balance in the selected period and the full year) """ if not ids: ids = self.ids if not ids: return [] if not done: done = {} if form.has_key('account_list') and form['account_list']: ...
if res['credit'] > 0 or res['debit'] > 0 or res['balance'] > 0 :
if abs(res['balance']) >= 0.5 * 10**-int(config['price_accuracy']) \ or abs(res['credit']) >= 0.5 * 10**-int(config['price_accuracy']) \ or abs(res['debit']) >= 0.5 * 10**-int(config['price_accuracy']):
def lines(self, form, ids={}, done=None, level=0): """ Returns all the data needed for the report lines (account info plus debit/credit/balance in the selected period and the full year) """ if not ids: ids = self.ids if not ids: return [] if not done: done = {} if form.has_key('account_list') and form['account_list']: ...
if res['balance'] != 0:
if abs(res['balance']) >= 0.5 * 10**-int(config['price_accuracy']):
def lines(self, form, ids={}, done=None, level=0): """ Returns all the data needed for the report lines (account info plus debit/credit/balance in the selected period and the full year) """ if not ids: ids = self.ids if not ids: return [] if not done: done = {} if form.has_key('account_list') and form['account_list']: ...
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): if context and 'campaign_id' in context: campaign_country=self.pool.get('dm.campaign').read(cr,uid,context['campaign_id'],['country_id'])
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): if context and 'campaign_id' in context and context['campaign_id']: campaign_country = self.pool.get('dm.campaign').read(cr,uid,context['campaign_id'],['country_id'])
def _check(self, cr, uid, ids=False, context={}): ''' Function called by the scheduler to create workitem from the segments of propositions. ''' ids = self.search(cr, uid, [('date_start', '=', time.strftime('%Y-%m-%d'))]) for id in ids: res = self.browse(cr, uid, [id])[0] offer_step_id = self.pool.get('dm.offer.step')....