bzr revid: fp@tinyerp.com-20090330231116-qhh5w358par1mdy5
This commit is contained in:
Fabien Pinckaers 2009-03-31 01:11:16 +02:00
commit 90af347f05
216 changed files with 1589 additions and 963 deletions

View File

@ -1497,7 +1497,7 @@ class account_model(osv.osv):
for model in self.browse(cr, uid, ids, context):
period_id = self.pool.get('account.period').find(cr,uid, context=context)
if not period_id:
raise osv.except_osv('No period found !', 'Unable to find a valid period !')
raise osv.except_osv(_('No period found !'), _('Unable to find a valid period !'))
period_id = period_id[0]
move_id = self.pool.get('account.move').create(cr, uid, {
'ref': model.ref,
@ -1545,7 +1545,7 @@ class account_model_line(osv.osv):
'ref': fields.char('Ref.', size=16),
'amount_currency': fields.float('Amount Currency', help="The amount expressed in an optionnal other currency."),
'amount_currency': fields.float('Amount Currency', help="The amount expressed in an optional other currency."),
'currency_id': fields.many2one('res.currency', 'Currency'),
'partner_id': fields.many2one('res.partner', 'Partner Ref.'),
@ -2275,7 +2275,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
for tax in position.tax_ids:
vals_tax = {
'tax_src_id' : tax_template_ref[tax.tax_src_id.id],
'tax_dest_id' : tax_template_ref[tax.tax_dest_id.id],
'tax_dest_id' : tax.tax_dest_id and tax_template_ref[tax.tax_dest_id.id] or False,
'position_id' : new_fp,
}
obj_tax_fp.create(cr, uid, vals_tax)

View File

@ -170,8 +170,8 @@
<field name="tax_line" nolabel="1">
<tree editable="bottom" string="Taxes">
<field name="name"/>
<field name="base" on_change="base_change(base)" readonly="1"/>
<field name="amount" on_change="amount_change(amount)"/>
<field name="base" on_change="base_change(base,parent.currency_id,parent.company_id,parent.date_invoice)" readonly="1"/>
<field name="amount" on_change="amount_change(amount,parent.currency_id,parent.company_id,parent.date_invoice)"/>
<field invisible="True" name="base_amount"/>
<field invisible="True" name="tax_amount"/>
@ -257,8 +257,8 @@
<field name="tax_line" nolabel="1">
<tree editable="bottom" string="Taxes">
<field name="name"/>
<field name="base" on_change="base_change(base)" readonly="1"/>
<field name="amount" on_change="amount_change(amount)"/>
<field name="base" on_change="base_change(base,parent.currency_id,parent.company_id,parent.date_invoice)" readonly="1"/>
<field name="amount" on_change="amount_change(amount,parent.currency_id,parent.company_id,parent.date_invoice)"/>
<field invisible="True" name="base_amount"/>
<field invisible="True" name="tax_amount"/>
</tree>

View File

@ -40,16 +40,22 @@ class account_move_line(osv.osv):
else:
fiscalyear_clause = '%s' % context['fiscalyear']
state=context.get('state',False)
where_move_state=''
where_move_state = ''
where_move_lines_by_date = ''
if context.get('date_from', False) and context.get('date_to', False):
where_move_lines_by_date = " AND " +obj+".move_id in ( select id from account_move where date >= '" +context['date_from']+"' AND date <= '"+context['date_to']+"')"
if state:
if state.lower() not in ['all']:
where_move_state= " AND "+obj+".move_id in (select id from account_move where account_move.state = '"+state+"')"
if context.get('periods', False):
ids = ','.join([str(x) for x in context['periods']])
return obj+".state<>'draft' AND "+obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id in (%s) AND id in (%s)) %s" % (fiscalyear_clause, ids,where_move_state)
return 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)
else:
return obj+".state<>'draft' AND "+obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id in (%s) %s)" % (fiscalyear_clause,where_move_state)
return 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)
def default_get(self, cr, uid, fields, context={}):
data = self._default_get(cr, uid, fields, context)
@ -342,8 +348,8 @@ class account_move_line(osv.osv):
'statement_id': fields.many2one('account.bank.statement', 'Statement', help="The bank statement used for bank reconciliation", select=1),
'reconcile_id': fields.many2one('account.move.reconcile', 'Reconcile', readonly=True, ondelete='set null', select=2),
'reconcile_partial_id': fields.many2one('account.move.reconcile', 'Partial Reconcile', readonly=True, ondelete='set null', select=2),
'amount_currency': fields.float('Amount Currency', help="The amount expressed in an optionnal other currency if it is a multi-currency entry."),
'currency_id': fields.many2one('res.currency', 'Currency', help="The optionnal other currency if it is a multi-currency entry."),
'amount_currency': fields.float('Amount Currency', help="The amount expressed in an optional other currency if it is a multi-currency entry."),
'currency_id': fields.many2one('res.currency', 'Currency', help="The optional other currency if it is a multi-currency entry."),
'period_id': fields.many2one('account.period', 'Period', required=True, select=2),
'journal_id': fields.many2one('account.journal', 'Journal', required=True, select=1),

View File

@ -382,13 +382,14 @@ class account_invoice(osv.osv):
if not date_invoice :
date_invoice = time.strftime('%Y-%m-%d')
pterm_list= pt_obj.compute(cr, uid, payment_term_id, value=1, date_ref=date_invoice)
pterm_list = pt_obj.compute(cr, uid, payment_term_id, value=1, date_ref=date_invoice)
if pterm_list:
pterm_list = [line[0] for line in pterm_list]
pterm_list.sort()
res= {'value':{'date_due': pterm_list[-1]}}
else:
raise osv.except_osv(_('Data Insufficient !'), _('The Payment Term of Supplier does not have Payment Term Lines(Computation) defined !'))
return res
def onchange_invoice_line(self, cr, uid, ids, lines):
@ -917,8 +918,14 @@ account_invoice()
class account_invoice_line(osv.osv):
def _amount_line(self, cr, uid, ids, prop, unknow_none,unknow_dict):
res = {}
cur_obj=self.pool.get('res.currency')
for line in self.browse(cr, uid, ids):
res[line.id] = round(line.price_unit * line.quantity * (1-(line.discount or 0.0)/100.0),2)
if line.invoice_id:
res[line.id] = line.price_unit * line.quantity * (1-(line.discount or 0.0)/100.0)
cur = line.invoice_id.currency_id
res[line.id] = cur_obj.round(cr, uid, cur, res[line.id])
else:
res[line.id] = round(line.price_unit * line.quantity * (1-(line.discount or 0.0)/100.0),2)
return res
def _price_unit_default(self, cr, uid, context=None):
@ -1111,9 +1118,23 @@ class account_invoice_tax(osv.osv):
'tax_code_id': fields.many2one('account.tax.code', 'Tax Code', help="The tax basis of the tax declaration."),
'tax_amount': fields.float('Tax Code Amount', digits=(16,2)),
}
def base_change(self, cr, uid, ids, base):
def base_change(self, cr, uid, ids, base,currency_id=False,company_id=False,date_invoice=False):
cur_obj = self.pool.get('res.currency')
company_obj = self.pool.get('res.company')
company_currency=False
if company_id:
company_currency=company_obj.browse(cr,uid,company_id).id
if currency_id and company_currency:
base=cur_obj.compute(cr, uid, currency_id, company_currency, base, context={'date': date_invoice or time.strftime('%Y-%m-%d')}, round=False)
return {'value': {'base_amount':base}}
def amount_change(self, cr, uid, ids, amount):
def amount_change(self, cr, uid, ids, amount,currency_id=False,company_id=False,date_invoice=False):
cur_obj = self.pool.get('res.currency')
company_obj = self.pool.get('res.company')
company_currency=False
if company_id:
company_currency=company_obj.browse(cr,uid,company_id).id
if currency_id and company_currency:
amount=cur_obj.compute(cr, uid, currency_id, company_currency, amount, context={'date': date_invoice or time.strftime('%Y-%m-%d')}, round=False)
return {'value': {'tax_amount':amount}}
_order = 'sequence'
_defaults = {

View File

@ -98,8 +98,8 @@
<td><para style="tbl_content"></para></td>
<td><para style="tbl_content">[[ move.name ]]</para></td>
<td><para style="tbl_content">[[ move.account_id.code ]] - [[ move.account_id.name ]]</para></td>
<td><para style="tbl_content"></para></td>
<td><para style="tbl_content_right">[[ formatLang(move.debit-move.credit) ]]</para></td>
<td><para style="tbl_content"></para></td>
</tr>
</blockTable>

View File

@ -77,3 +77,4 @@ class account_analytic_line(wizard.interface):
}
}
account_analytic_line('account.analytic.line')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -60,55 +60,26 @@ class account_balance(report_sxw.rml_parse):
if form.has_key('periods') and form['periods'][0][2]:
period_ids = ",".join([str(x) for x in form['periods'][0][2] if x])
self.cr.execute("select name from account_period where id in (%s)" % (period_ids))
res=self.cr.fetchall()
res = self.cr.fetchall()
len_res = len(res)
for r in res:
if (r == res[res.__len__()-1]):
if (r == res[len_res-1]):
result+=r[0]+". "
else:
result+=r[0]+", "
else:
fy_obj = self.pool.get('account.fiscalyear').browse(self.cr,self.uid,form['fiscalyear'])
res = fy_obj.period_ids
len_res = len(res)
for r in res:
if r == res[len_res-1]:
result+=r.name+". "
else:
result+=r.name+", "
return str(result and result[:-1]) or ''
def transform_both_into_date_array(self,data):
if not data['periods'][0][2] :
periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
else:
periods_id = data['periods'][0][2]
date_array = []
for period_id in periods_id:
period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop)
period_start_date = date_array[0]
date_start_date = data['date_from']
period_stop_date = date_array[-1]
date_stop_date = data['date_to']
if period_start_date<date_start_date:
start_date = period_start_date
else :
start_date = date_start_date
if date_stop_date<period_stop_date:
stop_date = period_stop_date
else :
stop_date = date_stop_date
final_date_array = []
final_date_array = final_date_array + self.date_range(start_date, stop_date)
self.date_lst = final_date_array
self.date_lst.sort()
def transform_none_into_date_array(self,data):
sql = "SELECT min(date) as start_date from account_move_line"
self.cr.execute(sql)
start_date = self.cr.fetchone()[0]
sql = "SELECT max(date) as start_date from account_move_line"
self.cr.execute(sql)
stop_date = self.cr.fetchone()[0]
array= []
array = array + self.date_range(start_date, stop_date)
self.date_lst = array
self.date_lst.sort()
def lines(self, form, ids={}, done=None, level=1):
if not ids:
ids = self.ids
@ -122,51 +93,59 @@ class account_balance(report_sxw.rml_parse):
res={}
result_acc=[]
ctx = self.context.copy()
ctx['fiscalyear'] = form['fiscalyear']
if form['state']=='byperiod' :
self.transform_period_into_date_array(form)
ctx['fiscalyear'] = form['fiscalyear']
ctx['periods'] = form['periods'][0][2]
elif form['state']== 'bydate':
self.transform_date_into_date_array(form)
ctx['date_from'] = form['date_from']
ctx['date_to'] = form['date_to']
elif form['state'] == 'all' :
self.transform_both_into_date_array(form)
elif form['state'] == 'none' :
self.transform_none_into_date_array(form)
accounts = self.pool.get('account.account').browse(self.cr, self.uid, ids, ctx)
def cmp_code(x, y):
return cmp(x.code, y.code)
accounts.sort(cmp_code)
ctx['periods'] = form['periods'][0][2]
ctx['date_from'] = form['date_from']
ctx['date_to'] = form['date_to']
# accounts = self.pool.get('account.account').browse(self.cr, self.uid, ids, ctx)
# def cmp_code(x, y):
# return cmp(x.code, y.code)
# accounts.sort(cmp_code)
child_ids = self.pool.get('account.account')._get_children_and_consol(self.cr, self.uid, ids, ctx)
if child_ids:
ids = child_ids
accounts = self.pool.get('account.account').read(self.cr, self.uid, ids,['type','code','name','debit','credit','balance','parent_id'], ctx)
for account in accounts:
if account.id in done:
if account['id'] in done:
continue
done[account.id] = 1
done[account['id']] = 1
res = {
'id' : account.id,
'type' : account.type,
'code': account.code,
'name': account.name,
'id' : account['id'],
'type' : account['type'],
'code': account['code'],
'name': account['name'],
'level': level,
'debit': account.debit,
'credit': account.credit,
'balance': account.balance,
'leef': not bool(account.child_id),
'debit': account['debit'],
'credit': account['credit'],
'balance': account['balance'],
# 'leef': not bool(account['child_id']),
'parent_id':account['parent_id'],
'bal_type':'',
}
self.sum_debit += account.debit
self.sum_credit += account.credit
if account.child_id:
def _check_rec(account):
if not account.child_id:
return bool(account.credit or account.debit)
for c in account.child_id:
if not _check_rec(c) or _check_rec(c):
return True
return False
if not _check_rec(account) :
continue
self.sum_debit += account['debit']
self.sum_credit += account['credit']
# if account.child_id:
# def _check_rec(account):
# if not account.child_id:
# return bool(account.credit or account.debit)
# for c in account.child_id:
# if not _check_rec(c) or _check_rec(c):
# return True
# return False
# if not _check_rec(account) :
# continue
if account['parent_id']:
# acc = self.pool.get('account.account').read(self.cr, self.uid, [ account['parent_id'][0] ] ,['name'], ctx)
for r in result_acc:
if r['id'] == account['parent_id'][0]:
res['level'] = r['level'] + 1
break
if form['display_account'] == 'bal_mouvement':
if res['credit'] > 0 or res['debit'] > 0 or res['balance'] > 0 :
result_acc.append(res)
@ -175,51 +154,18 @@ class account_balance(report_sxw.rml_parse):
result_acc.append(res)
else:
result_acc.append(res)
if account.child_id:
acc_id = [acc.id for acc in account.child_id]
lst_string = ''
lst_string = '\'' + '\',\''.join(map(str,acc_id)) + '\''
self.cr.execute("select code,id from account_account where id IN (%s)"%(lst_string))
a_id = self.cr.fetchall()
a_id.sort()
ids2 = [x[1] for x in a_id]
result_acc += self.lines(form, ids2, done, level+1)
# if account.child_id:
# acc_id = [acc.id for acc in account.child_id]
# lst_string = ''
# lst_string = '\'' + '\',\''.join(map(str,acc_id)) + '\''
# self.cr.execute("select code,id from account_account where id IN (%s)"%(lst_string))
# a_id = self.cr.fetchall()
# a_id.sort()
# ids2 = [x[1] for x in a_id]
#
# result_acc += self.lines(form, ids2, done, level+1)
return result_acc
def date_range(self,start,end):
start = datetime.date.fromtimestamp(time.mktime(time.strptime(start,"%Y-%m-%d")))
end = datetime.date.fromtimestamp(time.mktime(time.strptime(end,"%Y-%m-%d")))
full_str_date = []
#
r = (end+datetime.timedelta(days=1)-start).days
#
date_array = [start+datetime.timedelta(days=i) for i in range(r)]
for date in date_array:
full_str_date.append(str(date))
return full_str_date
#
def transform_period_into_date_array(self,form):
## Get All Period Date
if not form['periods'][0][2] :
periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',form['fiscalyear'])])
else:
periods_id = form['periods'][0][2]
date_array = []
for period_id in periods_id:
period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop)
self.date_lst = date_array
self.date_lst.sort()
def transform_date_into_date_array(self,form):
return_array = self.date_range(form['date_from'],form['date_to'])
self.date_lst = return_array
self.date_lst.sort()
def _sum_credit(self):
return self.sum_credit
@ -227,3 +173,4 @@ class account_balance(report_sxw.rml_parse):
return self.sum_debit
report_sxw.report_sxw('report.account.account.balance', 'account.account', 'addons/account/report/account_balance.rml', parser=account_balance, header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -38,3 +38,4 @@ class account_tax_code_report(rml_parse.rml_parse):
report_sxw.report_sxw('report.account.tax.code.entries', 'account.tax.code',
'addons/account/report/account_tax_code.rml', parser=account_tax_code_report, header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -61,7 +61,7 @@ class aged_trial_report(rml_parse.rml_parse):
context={'fiscalyear': form['fiscalyear']})
self.cr.execute("SELECT DISTINCT res_partner.id AS id, " \
"res_partner.name AS name " \
"FROM res_partner,account_move_line AS line, account_account,account_move_reconcile AS recon " \
"FROM res_partner,account_move_line AS line, account_account " \
"WHERE (line.account_id=account_account.id) " \
"AND ((reconcile_id IS NULL) " \
"OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s ))) " \
@ -178,3 +178,4 @@ report_sxw.report_sxw('report.account.aged_trial_balance', 'res.partner',
'addons/account/report/aged_trial_balance.rml',parser=aged_trial_report,header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -427,3 +427,4 @@ class general_ledger(rml_parse.rml_parse):
report_sxw.report_sxw('report.account.general.ledger', 'account.account', 'addons/account/report/general_ledger.rml', parser=general_ledger, header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -41,7 +41,7 @@
<blockTableStyle id="tbl_content">
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,1" stop="-1,-1"/>
<blockValign value="TOP"/>
</blockTableStyle>
@ -90,7 +90,7 @@
<paraStyle name="Index" fontName="Helvetica"/>
</stylesheet>
<story>
<para>[[ repeatIn(objects, 'a') ]]</para>
<blockTable colWidths="66.0,124.0,70.0,40.0,80.0,59.0,52.0,54.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
<tr>
<td><para style="date">Date</para></td>
@ -102,10 +102,11 @@
<td><para style="P4">Crebit</para></td>
<td><para style="P9">Balance</para></td>
</tr>
<tr>
<para>[[ repeatIn(objects, 'a') ]]</para>
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
</blockTable>
<section>
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
<blockTable colWidths="66.0,124.0,70.0,40.0,80.0,59.0,52.0,54.0" style="tbl_content">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
<tr>
<td>
<blockTable colWidths="280.0,100.0,52.5,52.5,52.5" style="Table5">
<tr>
@ -115,28 +116,30 @@
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_credit_account(o, data['form'])) ]]</u></para></td>
<td><para style="P9b"><u>[[formatLang(sum_solde_account(o, data['form'])) ]]</u></para></td>
</tr>
<tr>
<td>[[ repeatIn(lines(o, data['form']), 'line') ]]
<blockTable colWidths="54.0,123.0,70.0,40.0,80.0,59.0,52.0,54.0" style="tbl_content">
<tr>
<td><para style="P3">[[ formatLang(line['date'],date=True) ]]</para></td>
<td><para style="P3">[[ line['partner'] or '']]</para></td>
<td><para style="P3">[[ line['ref'] or '']]</para></td>
<td><para style="P3">[[ line['move'] or '']]</para></td>
<td><para style="P3">[[ line['name'] or '' ]]</para></td>
<td><para style="P4">[[ formatLang(line['debit']) ]]</para></td>
<td><para style="P4">[[ formatLang(line['credit']) ]]</para></td>
<td><para style="P4">[[ formatLang(line['progress']) ]]</para></td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
</blockTable>
</td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
</tr>
<tr>
<td><para style="P3">[[ repeatIn(lines(o, data['form']), 'line') ]] <font>[[ formatLang(line['date'],date=True) ]]</font></para></td>
<td><para style="P3">[[ line['partner'] or '']]</para></td>
<td><para style="P3">[[ line['ref'] or '']]</para></td>
<td><para style="P3">[[ line['move'] or '']]</para></td>
<td><para style="P3">[[ line['name'] or '' ]]</para></td>
<td><para style="P4">[[ formatLang(line['debit']) ]]</para></td>
<td><para style="P4">[[ formatLang(line['credit']) ]]</para></td>
<td><para style="P4">[[ formatLang(line['progress']) ]]</para></td>
</tr>
</blockTable>
</section>
<blockTable colWidths="72.0,93.0,66.0,40.0,100.0,50.0,50.0,50.0,40.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
<tr>
@ -150,10 +153,11 @@
<td><para style="P4">Balance</para></td>
<td><para style="P4">Currency</para></td>
</tr>
<tr>
<para>[[ repeatIn(objects, 'a') ]]</para>
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
</blockTable>
<section>
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
<blockTable colWidths="72.0,93.0,66.0,40.0,100.0,50.0,50.0,50.0,40.0" style="tbl_content">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
<tr>
<td>
<blockTable colWidths="264.00,100.0,50.0,50.0,49.0,40.00" style="Table5">
<tr>
@ -164,29 +168,30 @@
<td><para style="P9b"><u>[[formatLang(sum_solde_account(o, data['form'])) ]]</u></para></td>
<td><para style="P9b"><u> [[ formatLang(sum_currency_amount_account(a, data['form'])) ]]</u></para></td>
</tr>
<tr>
<td>[[ repeatIn(lines(o, data['form']), 'line') ]]
<blockTable colWidths="59.0,93.0,66.0,40.0,100.0,50.0,50.0,50.0,40.0" style="tbl_content">
<tr>
<td><para style="P3">[[ formatLang(line['date'],date=True) ]]</para></td>
<td><para style="P3">[[ line['partner'] or '' ]]</para></td>
<td><para style="P3">[[ line['ref'] or '']]</para></td>
<td><para style="P3">[[ line['move'] or '' ]]</para></td>
<td><para style="P3">[[ line['name'] or '' ]]</para></td>
<td><para style="P4">[[ formatLang(line['debit']) ]]</para></td>
<td><para style="P4">[[ formatLang(line['credit']) ]]</para></td>
<td><para style="P4">[[ formatLang(line['progress']) ]]</para></td>
<td><para style="P4">[[ formatLang(line['amount_currency'] or 0.00) ]] [[ line['currency_code'] or '']]</para></td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
</blockTable>
</td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
</tr>
<tr>
<td><para style="P3">[[ repeatIn(lines(o, data['form']), 'line') ]] <font>[[ formatLang(line['date'],date=True) ]]</font></para></td>
<td><para style="P3">[[ line['partner'] or '' ]]</para></td>
<td><para style="P3">[[ line['ref'] or '']]</para></td>
<td><para style="P3">[[ line['move'] or '' ]]</para></td>
<td><para style="P3">[[ line['name'] or '' ]]</para></td>
<td><para style="P4">[[ formatLang(line['debit']) ]]</para></td>
<td><para style="P4">[[ formatLang(line['credit']) ]]</para></td>
<td><para style="P4">[[ formatLang(line['progress']) ]]</para></td>
<td><para style="P4">[[ formatLang(line['amount_currency'] or 0.00) ]] [[ line['currency_code'] or '']]</para></td>
</tr>
</blockTable>
</section>
</story>

View File

@ -406,3 +406,4 @@ class general_ledger_landscape(rml_parse.rml_parse):
return currency_total
report_sxw.report_sxw('report.account.general.ledger_landscape', 'account.account', 'addons/account/report/general_ledger_landscape.rml', parser=general_ledger_landscape, header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -2,7 +2,7 @@
<document filename="test.pdf">
<template pageSize="(1120.0,770.0)" title="Test" author="Martin Simon" allowSplitting="20" >
<pageTemplate id="first">
<frame id="first" x1="22.0" y1="35.0" width="1080" height="680"/>
<frame id="first" x1="22.0" y1="31.0" width="1080" height="680"/>
<pageGraphics>
<!--logo-->
<!--<fill color="darkblue"/>-->
@ -34,28 +34,19 @@
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="tbl_header">
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="tbl_content">
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,1" stop="-1,-1"/>
<blockValign value="TOP"/>
<blockAlignment value="RIGHT" start="2,1" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="Table5">
<blockAlignment value="LEFT"/>
<lineStyle kind="LINEBELOW" colorName="#777777" start="0,0" stop="0,0"/>
<blockValign value="TOP"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
@ -91,63 +82,11 @@
<paraStyle name="Index" fontName="Helvetica"/>
</stylesheet>
<story>
<blockTable colWidths="66.0,35.0,150.0, 90.0,60.0,335.0,50.0,69.0,72.0,64.0,58.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
<para>[[ repeatIn(objects, 'a') ]]</para>
<blockTable colWidths="66.0,35.0,150.0, 90.0,60.0,335.0,50.0,69.0,72.0,64.0,58.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
<tr>
<td><para style="P12"><font color="white"> </font></para><para style="date">Date</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P2">JNRL</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P2">Partner</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P2">Ref</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P2">Mvt</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P3">Entry Label</para></td>
<td><para style="P12"><font color="white"> </font> </para><para style="P3">Counterpart</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P4">Debit</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P4">Credit</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P4">Balance</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P4">Currency</para></td>
</tr>
<tr>
<para>[[ repeatIn(objects, 'a') ]]</para>
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
<td>
<blockTable colWidths="404.0,375.0,69.0,72.0,64.0,59.00" style="Table5">
<tr>
<td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
<td><para style="Standard"></para></td>
<td alignment="right"><para style="P9b"><u>[[ formatLang(sum_debit_account(o, data['form'])) ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[ formatLang(sum_credit_account(o, data['form'])) ]]</u></para></td>
<td><para style="P9b"><u>[[ formatLang(sum_solde_account(o, data['form'])) ]]</u></para></td>
<td><para style="P9b"><u> [[ formatLang(sum_currency_amount_account(o, data['form'])) ]]</u></para></td>
</tr>
<tr>
<td> [[ repeatIn(lines(o, data['form']), 'line') ]]
<blockTable colWidths="55.0,35.0,150.0, 90.0,60.0,333.0,50.0,69.0,72.0,64.0,58.0" style="tbl_content" >
<tr>
<td><para style="P2_content">[[ formatLang(line['date'],date=True) ]]</para></td>
<td><para style="P2_content">[[ line['code'] ]]</para></td>
<td><para style="P2_content">[[ line['partner'] ]]</para></td>
<td><para style="P2_content">[[ line['ref'] ]]</para></td>
<td><para style="P2_content">[[ line['move'] ]]</para></td>
<td><para style="P3_content">[[ line['name'] ]]</para></td>
<td><para style="P3_content">[[ strip_name(line['line_corresp'],55) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['debit']) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['credit']) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['progress']) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['amount_currency'] or 0.00)]] [[ line['currency_code'] ]]</para></td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
<blockTable colWidths="66.0,35.0,166.0,90.0,60.0,378.0,50.0,69.0,72.0,64.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
<tr>
<td><para style="P12"><font color="white"> </font></para><para style="date">Date</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P2">JNRL</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P2">Partner</para></td>
@ -158,43 +97,112 @@
<td><para style="P12"><font color="white"> </font></para><para style="P4">Debit</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P4">Credit</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P4">Balance</para></td>
</tr>
<td><para style="P12"><font color="white"> </font></para><para style="P4">Currency</para></td>
</tr>
</blockTable>
<section>
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
<blockTable colWidths="66.0,35.0,150.0, 90.0,60.0,335.0,50.0,69.0,72.0,64.0,58.0" style="tbl_content">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
<tr>
<td>
<blockTable colWidths="404.0,375.0,69.0,72.0,64.0,59.00" style="Table5">
<tr>
<td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
<td><para style="Standard"></para></td>
<td alignment="right"><para style="P9b"><u>[[ formatLang(sum_debit_account(o, data['form'])) ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[ formatLang(sum_credit_account(o, data['form'])) ]]</u></para></td>
<td><para style="P9b"><u>[[ formatLang(sum_solde_account(o, data['form'])) ]]</u></para></td>
<td><para style="P9b"><u> [[ formatLang(sum_currency_amount_account(o, data['form'])) ]]</u></para></td>
</tr>
</blockTable>
</td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
</tr>
<tr>
<td><para style="P2_content">[[ repeatIn(lines(o, data['form']), 'line') ]]<font> [[ formatLang(line['date'],date=True) ]]</font></para></td>
<td><para style="P2_content">[[ line['code'] ]]</para></td>
<td><para style="P2_content">[[ line['partner'] ]]</para></td>
<td><para style="P2_content">[[ line['ref'] ]]</para></td>
<td><para style="P2_content">[[ line['move'] ]]</para></td>
<td><para style="P3_content">[[ line['name'] ]]</para></td>
<td><para style="P3_content">[[ strip_name(line['line_corresp'],15) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['debit']) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['credit']) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['progress']) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['amount_currency'] or 0.00)]] [[ line['currency_code'] ]]</para></td>
</tr>
</blockTable>
</section>
<blockTable colWidths="66.0,35.0,166.0,90.0,60.0,378.0,50.0,69.0,72.0,64.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
<tr>
<td><para style="P12"><font color="white"> </font></para><para style="date">Date</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P2">JNRL</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P2">Partner</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P2">Ref</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P2">Mvt</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P3">Entry Label</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P3">Counterpart</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P4">Debit</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P4">Credit</para></td>
<td><para style="P12"><font color="white"> </font></para><para style="P4">Balance</para></td>
</tr>
</blockTable>
<section>
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
<tr>
<para>[[ repeatIn(objects, 'a') ]]</para>
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
<td>
<blockTable colWidths="405.0,435.0,69.0,72.0,64.0" style="Table5">
<tr>
<td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
<td><para style="Standard"></para></td>
<td alignment="right"><para style="P9b"><u>[[ formatLang(sum_debit_account(o, data['form']))]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_credit_account(o, data['form']))]]</u></para></td>
<td><para style="P9b"><u>[[formatLang(sum_solde_account(o, data['form'])) ]]</u></para></td>
</tr>
<tr>
<td> [[ repeatIn(lines(o, data['form']), 'line') ]]
<blockTable colWidths="55.0,35.0,166.0,90.0,60.0,378.0,50.0,69.0,72.0,64.0" style="tbl_content">
<blockTable colWidths="66.0,35.0,166.0,90.0,60.0,378.0,50.0,69.0,72.0,64.0" style="tbl_content">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
<tr>
<td>
<blockTable colWidths="405.0,435.0,69.0,72.0,64.0" style="Table5">
<tr>
<td><para style="P2_content">[[ formatLang(line['date'],date=True) ]]</para></td>
<td><para style="P2_content">[[ line['code'] ]]</para></td>
<td><para style="P2_content">[[ line['partner'] ]]</para></td>
<td><para style="P2_content">[[ line['ref'] ]]</para></td>
<td><para style="P2_content">[[ line['move'] ]]</para></td>
<td><para style="P3_content">[[ line['name'] ]]</para></td>
<td><para style="P3_content">[[ strip_name(line['line_corresp'],55) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['debit']) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['credit']) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['progress']) ]]</para></td>
</tr>
<td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
<td><para style="Standard"></para></td>
<td alignment="right"><para style="P9b"><u>[[ formatLang(sum_debit_account(o, data['form']))]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_credit_account(o, data['form']))]]</u></para></td>
<td><para style="P9b"><u>[[formatLang(sum_solde_account(o, data['form'])) ]]</u></para></td>
</tr>
</blockTable>
</td>
</td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
<td><para style="Standard"></para></td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
<tr>
<td><para style="P2_content">[[ repeatIn(lines(o, data['form']), 'line') ]]<font>[[ formatLang(line['date'],date=True) ]]</font></para></td>
<td><para style="P2_content">[[ line['code'] ]]</para></td>
<td><para style="P2_content">[[ line['partner'] ]]</para></td>
<td><para style="P2_content">[[ line['ref'] ]]</para></td>
<td><para style="P2_content">[[ line['move'] ]]</para></td>
<td><para style="P3_content">[[ line['name'] ]]</para></td>
<td><para style="P3_content">[[ strip_name(line['line_corresp'],15) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['debit']) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['credit']) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['progress']) ]]</para></td>
</tr>
</blockTable>
</section>
</story>
</document>

View File

@ -35,3 +35,4 @@ report_sxw.report_sxw(
'addons/account/report/invoice.rml',
parser=account_invoice
)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

153
addons/account/report/partner_balance.py Normal file → Executable file
View File

@ -169,18 +169,12 @@ class partner_balance(report_sxw.rml_parse):
self.transform_both_into_date_array(data)
# if data['form']['fiscalyear']:
# print"data['form']['fiscalyear']=True"
# self.transform_period_into_date_array(data)
# else:
# print"data['form']['fiscalyear']=False"
# self.transform_date_into_date_array(data)
##
self.date_lst_string =''
if self.date_lst:
self.date_lst_string = '\'' + '\',\''.join(map(str,self.date_lst)) + '\''
## Compute Code
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
#
@ -207,43 +201,6 @@ class partner_balance(report_sxw.rml_parse):
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
full_account = []
result_tmp = 0.0
#
#
#
if self.date_lst and data['form']['soldeinit'] :
self.cr.execute(
"SELECT p.ref, p.name,l.account_id,ac.name as account_name,ac.code as code , sum(debit) as debit, sum(credit) as credit, " \
"CASE WHEN sum(debit) > sum(credit) " \
"THEN sum(debit) - sum(credit) " \
"ELSE 0 " \
"END AS sdebit, " \
"CASE WHEN sum(debit) < sum(credit) " \
"THEN sum(credit) - sum(debit) " \
"ELSE 0 " \
"END AS scredit, " \
"(SELECT sum(debit-credit) " \
"FROM account_move_line l " \
"WHERE partner_id = p.id " \
"AND date < %s " \
"AND blocked = TRUE AND l.reconcile_id IS NULL " \
") AS enlitige " \
"FROM account_move_line l LEFT JOIN res_partner p ON (l.partner_id=p.id) " \
"JOIN account_account ac ON (l.account_id = ac.id)" \
"WHERE ac.type IN " + self.ACCOUNT_TYPE + " " \
"AND l.date < %s AND l.reconcile_id IS NULL " \
"GROUP BY p.id, p.ref, p.name,l.account_id,ac.name,ac.code " \
"ORDER BY l.account_id,p.name",
(self.date_lst[0],self.date_lst[0]))
res = self.cr.dictfetchall()
for r in res:
full_account.append(r)
#
#
#
if self.date_lst_string:
self.cr.execute(
"SELECT p.ref,l.account_id,ac.name as account_name,ac.code as code ,p.name, sum(debit) as debit, sum(credit) as credit, " \
@ -317,23 +274,6 @@ class partner_balance(report_sxw.rml_parse):
#
else:
if cleanarray[i]['account_id'] <> cleanarray[i-1]['account_id']:
##
# new_tot = {}
# new_tot['ref'] = 'Total'
# new_tot['name'] = cleanarray[i-1]['account_name']
# new_tot['code'] = cleanarray[i-1]['code']
#
# new_tot['debit'] = tot_debit
# new_tot['credit'] = tot_credit
# new_tot['scredit'] = tot_scredit
# new_tot['sdebit'] = tot_sdebit
# new_tot['enlitige'] = tot_enlitige
# new_tot['balance'] = float(tot_sdebit) - float(tot_scredit)
# new_tot['type'] = 3
# ##
# completearray.append(new_tot)
new_header['debit'] = tot_debit
new_header['credit'] = tot_credit
@ -415,19 +355,6 @@ class partner_balance(report_sxw.rml_parse):
return 0.0
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
result_tmp = 0.0
#
#
if self.date_lst and data['form']['soldeinit'] :
self.cr.execute(
"SELECT sum(debit) " \
"FROM account_move_line AS l " \
"WHERE l.account_id IN (" + self.account_ids + ") " \
"AND l.reconcile_id IS NULL " \
"AND date < %s ",
(self.date_lst[0],))
result_tmp = float(self.cr.fetchone()[0] or 0.0)
#
#
temp_res = 0.0
if self.date_lst_string:
self.cr.execute(
@ -446,19 +373,6 @@ class partner_balance(report_sxw.rml_parse):
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
result_tmp = 0.0
#
#
if self.date_lst and data['form']['soldeinit'] :
self.cr.execute(
"SELECT sum(credit) " \
"FROM account_move_line AS l " \
"WHERE l.account_id IN (" + self.account_ids + ") " \
"AND l.reconcile_id IS NULL " \
"AND l.date < %s " ,
(self.date_lst[0],))
result_tmp = float(self.cr.fetchone()[0] or 0.0)
#
#
temp_res = 0.0
if self.date_lst_string:
self.cr.execute(
@ -476,21 +390,6 @@ class partner_balance(report_sxw.rml_parse):
return 0.0
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
result_tmp = 0.0
#
#
if self.date_lst and data['form']['soldeinit'] :
self.cr.execute(
"SELECT sum(debit-credit) " \
"FROM account_move_line AS l " \
"WHERE l.account_id IN (" + self.account_ids + ") " \
"AND l.reconcile_id IS NULL " \
"AND l.date < %s " \
"AND l.blocked=TRUE " ,
(self.date_lst[0],))
result_tmp = float(self.cr.fetchone()[0] or 0.0)
#
#
temp_res = 0.0
if self.date_lst_string:
self.cr.execute(
@ -509,28 +408,6 @@ class partner_balance(report_sxw.rml_parse):
return 0.0
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
result_tmp = 0.0
#
#
if self.date_lst and data['form']['soldeinit'] :
self.cr.execute(
"SELECT CASE WHEN sum(debit) > sum(credit) " \
"THEN sum(debit) - sum(credit) " \
"ELSE 0 " \
"END " \
"FROM account_move_line AS l " \
"WHERE l.account_id IN (" + self.account_ids + ") " \
"AND l.date < %s " \
"AND l.reconcile_id IS NULL " \
"GROUP BY l.partner_id",
(self.date_lst[0],))
if self.cr.fetchone() != None:
result_tmp = float(self.cr.fetchone()[0])
else:
result_tmp = 0.0
#
#
a = 0.0
if self.date_lst_string:
self.cr.execute(
@ -558,27 +435,6 @@ class partner_balance(report_sxw.rml_parse):
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
result_tmp = 0.0
#
#
if self.date_lst and data['form']['soldeinit'] :
self.cr.execute(
"SELECT CASE WHEN sum(debit) < sum(credit) " \
"THEN sum(credit) - sum(debit) " \
"ELSE 0 " \
"END " \
"FROM account_move_line AS l " \
"WHERE l.account_id IN (" + self.account_ids + ") " \
"AND l.date <= %s " \
"AND l.reconcile_id IS NULL " \
"GROUP BY l.partner_id",
(self.date_lst[0],))
if self.cr.fetchone() != None:
result_tmp = float(self.cr.fetchone()[0]) or 0.0
else:
result_tmp = 0.0
#
#
a = 0.0
if self.date_lst_string:
self.cr.execute(
@ -591,10 +447,10 @@ class partner_balance(report_sxw.rml_parse):
"AND l.date IN (" + self.date_lst_string + ") " \
"GROUP BY l.partner_id")
a = self.cr.fetchone()[0] or 0.0
if self.cr.fetchone() != None:
result_tmp = result_tmp + (a or 0.0)
else:
result_tmp = 0.0
@ -617,3 +473,4 @@ class partner_balance(report_sxw.rml_parse):
report_sxw.report_sxw('report.account.partner.balance', 'res.partner',
'account/report/partner_balance.rml',parser=partner_balance,
header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -175,3 +175,4 @@ class rml_parse(report_sxw.rml_parse):
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -236,3 +236,4 @@ class tax_report(rml_parse.rml_parse):
report_sxw.report_sxw('report.account.vat.declaration', 'account.tax.code',
'addons/account/report/tax_report.rml', parser=tax_report, header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -447,3 +447,4 @@ report_sxw.report_sxw('report.account.third_party_ledger', 'res.partner',
'addons/account/report/third_party_ledger.rml',parser=third_party_ledger,
header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -49,3 +49,4 @@ class ir_sequence(osv.osv):
ir_sequence()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -23,6 +23,7 @@
import wizard
import pooler
import time
from tools.translate import _
period_form = '''<?xml version="1.0"?>
<form string="Select period">
@ -86,10 +87,10 @@ class wizard_report(wizard.interface):
company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
data['form']['company_id'] = company_id
fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
periods_obj=pooler.get_pool(cr.dbname).get('account.period')
# periods_obj=pooler.get_pool(cr.dbname).get('account.period')
data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
data['form']['periods'] =periods_obj.search(cr, uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
data['form']['fiscalyear'] = False
# data['form']['periods'] = periods_obj.search(cr, uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
# data['form']['fiscalyear'] = False
data['form']['display_account']='bal_all'
return data['form']
@ -97,9 +98,9 @@ class wizard_report(wizard.interface):
if data['form']['state'] == 'bydate':
self._check_date(cr, uid, data, context)
data['form']['fiscalyear'] = 0
else :
data['form']['fiscalyear'] = 1
# data['form']['fiscalyear'] = 0
# else :
# data['form']['fiscalyear'] = 1
return data['form']
def _check_path(self, cr, uid, data, context):
@ -115,11 +116,11 @@ class wizard_report(wizard.interface):
res = cr.dictfetchall()
if res:
if (data['form']['date_to'] > res[0]['date_stop'] or data['form']['date_to'] < res[0]['date_start']):
raise wizard.except_wizard('UserError','Date to must be set between ' + res[0]['date_start'] + " and " + res[0]['date_stop'])
raise wizard.except_wizard(_('UserError'),_('Date to must be set between %s and %s') % (res[0]['date_start'], res[0]['date_stop']))
else:
return 'report'
else:
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
raise wizard.except_wizard(_('UserError'),_('Date not in a defined fiscal year'))
states = {
@ -141,3 +142,4 @@ class wizard_report(wizard.interface):
}
}
wizard_report('account.account.balance.report')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -26,6 +26,7 @@ import datetime
import pooler
from mx.DateTime import *
from tools.translate import _
_aged_trial_form = """<?xml version="1.0"?>
<form string="Aged Trial Balance">
@ -63,7 +64,7 @@ def _calc_dates(self, cr, uid, data, context):
res = {}
period_length = data['form']['period_length']
if period_length<=0:
raise wizard.except_wizard('UserError', 'You must enter a period length that cannot be 0 or below !')
raise wizard.except_wizard(_('UserError'), _('You must enter a period length that cannot be 0 or below !'))
start = datetime.date.fromtimestamp(time.mktime(time.strptime(data['form']['date1'],"%Y-%m-%d")))
start = DateTime(int(start.year),int(start.month),int(start.day))
if data['form']['direction_selection'] == 'past':
@ -110,3 +111,4 @@ class wizard_report(wizard.interface):
}
wizard_report('account.aged.trial.balance')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -24,6 +24,7 @@ import wizard
import netsvc
import pooler
import time
from tools.translate import _
#TODO:

View File

@ -24,6 +24,7 @@ import wizard
import pooler
import locale
import time
from tools.translate import _
account_form = '''<?xml version="1.0"?>
<form string="Select Chart">
@ -108,12 +109,12 @@ def _check_date(self, cr, uid, data, context):
res = cr.dictfetchall()
if res:
if (data['form']['date_to'] > res[0]['date_stop'] or data['form']['date_to'] < res[0]['date_start']):
raise wizard.except_wizard('UserError','Date to must be set between ' + res[0]['date_start'] + " and " + res[0]['date_stop'])
raise wizard.except_wizard(_('UserError'),_('Date to must be set between %s and %s') % (str(res[0]['date_start']), str(res[0]['date_stop'])))
else:
return 'checkreport'
else:
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
raise wizard.except_wizard(_('UserError'),_('Date not in a defined fiscal year'))
def _check_state(self, cr, uid, data, context):
@ -173,3 +174,4 @@ class wizard_report(wizard.interface):
}
}
wizard_report('account.general.ledger.report')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -23,6 +23,7 @@
import time
import wizard
import pooler
from tools.translate import _
period_form = '''<?xml version="1.0"?>
<form string="Select Date-Period">
@ -106,12 +107,12 @@ class wizard_report(wizard.interface):
res = cr.dictfetchall()
if res:
if (data['form']['date2'] > res[0]['date_stop'] or data['form']['date2'] < res[0]['date_start']):
raise wizard.except_wizard('UserError','Date to must be set between ' + res[0]['date_start'] + " and " + res[0]['date_stop'])
raise wizard.except_wizard(_('UserError'),_('Date to must be set between %s and %s') % (str(res[0]['date_start']), str(res[0]['date_stop'])))
else:
return 'report'
else:
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
raise wizard.except_wizard(_('UserError'),_('Date not in a defined fiscal year'))
states = {
'init': {
@ -125,3 +126,4 @@ class wizard_report(wizard.interface):
}
}
wizard_report('account.partner.balance.report')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -24,6 +24,7 @@ import pooler
import osv
import netsvc
import time
from tools.translate import _
sur_form = '''<?xml version="1.0"?>
<form string="Credit Note">

View File

@ -38,7 +38,7 @@ def _change_inv_state(self, cr, uid, data, context):
pool_obj = pooler.get_pool(cr.dbname)
data_inv = pool_obj.get('account.invoice').browse(cr, uid, data['ids'][0])
if data_inv.reconciled:
raise wizard.except_wizard('Warning', 'Invoice is already reconciled')
raise wizard.except_wizard(_('Warning'), _('Invoice is already reconciled'))
wf_service = netsvc.LocalService("workflow")
res = wf_service.trg_validate(uid, 'account.invoice', data['ids'][0], 'open_test', cr)
return {}

View File

@ -1,3 +1,4 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008 Camptocamp SA All Rights Reserved. (JGG)
@ -171,3 +172,4 @@ class PopulateStatementFromInv(wizard.interface):
},
}
PopulateStatementFromInv('populate_statement_from_inv')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -23,6 +23,7 @@
import time
import wizard
import pooler
from tools.translate import _
period_form = '''<?xml version="1.0"?>
@ -112,12 +113,12 @@ class wizard_report(wizard.interface):
res = cr.dictfetchall()
if res:
if (data['form']['date2'] > res[0]['date_stop'] or data['form']['date2'] < res[0]['date_start']):
raise wizard.except_wizard('UserError','Date to must be set between ' + res[0]['date_start'] + " and " + res[0]['date_stop'])
raise wizard.except_wizard(_('UserError'),_('Date to must be set between %s and %s') % (str(res[0]['date_start']) , str(res[0]['date_stop'])))
else:
return 'report'
else:
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
raise wizard.except_wizard(_('UserError'),_('Date not in a defined fiscal year'))
def _check_state(self, cr, uid, data, context):
@ -142,3 +143,4 @@ class wizard_report(wizard.interface):
wizard_report('account.third_party_ledger.report')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -23,6 +23,7 @@ import wizard
import time
import datetime
import pooler
from tools.translate import _
model_form = """<?xml version="1.0"?>
<form string="Select Message">
@ -52,7 +53,7 @@ def _create_entries(self, cr, uid, data, context):
period_id = pool_obj.get('account.period').find(cr,uid, context=context)
if not period_id:
raise wizard.except_wizard('No period found !', 'Unable to find a valid period !')
raise wizard.except_wizard(_('No period found !'), _('Unable to find a valid period !'))
period_id = period_id[0]
move_id = pool_obj.get('account.move').create(cr, uid, {
'ref': model.ref,

View File

@ -88,3 +88,4 @@ class wizard_report(wizard.interface):
wizard_report('account.vat.declaration')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -20,3 +20,4 @@
#
##############################################################################
import account_analytic_default
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -106,3 +106,4 @@ class account_invoice_line(osv.osv):
return res_prod
account_invoice_line()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -30,6 +30,7 @@ from osv import fields, osv,orm
import ir
import tools
from tools.translate import _
class one2many_mod2(fields.one2many):
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None):
@ -176,7 +177,7 @@ class account_analytic_plan_instance(osv.osv):
pids = self.pool.get('account.analytic.plan.instance').search(cr, uid, [('name','=',vals['name']),('code','=',vals['code']),('plan_id','<>',False)])
if pids:
raise osv.except_osv('Error', 'A model having this name and code already exists !')
raise osv.except_osv(_('Error'), _('A model having this name and code already exists !'))
res = self.pool.get('account.analytic.plan.line').search(cr,uid,[('plan_id','=',journal.plan_id.id)])
for i in res:
@ -189,7 +190,7 @@ class account_analytic_plan_instance(osv.osv):
if self.pool.get('account.analytic.account').search(cr,uid,[('parent_id','child_of',[item.root_analytic_id.id]),('id','=',tempo[2]['analytic_account_id'])]):
total_per_plan += tempo[2]['rate']
if total_per_plan < item.min_required or total_per_plan > item.max_required:
raise osv.except_osv("Value Error" ,"The Total Should be Between " + str(item.min_required) + " and " + str(item.max_required))
raise osv.except_osv(_('Value Error') ,_('The Total Should be Between %s and %s' % (str(item.min_required), str(item.max_required))))
return super(account_analytic_plan_instance, self).create(cr, uid, vals, context)
@ -374,3 +375,4 @@ class analytic_default(osv.osv):
}
analytic_default()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -23,6 +23,7 @@ import wizard
import time
import netsvc
import pooler
from tools.translate import _
info = '''<?xml version="1.0"?>
<form string="Distribution Model Saved">
@ -35,10 +36,10 @@ def activate(self, cr, uid, data, context):
if data['id']:
plan = plan_obj.browse(cr, uid, data['id'], context)
if (not plan.name) or (not plan.code):
raise wizard.except_wizard('Error', 'Please put a name and a code before saving the model !')
raise wizard.except_wizard(_('Error'), _('Please put a name and a code before saving the model !'))
pids = pooler.get_pool(cr.dbname).get('account.analytic.plan').search(cr, uid, [], context=context)
if (not pids):
raise wizard.except_wizard('Error', 'No analytic plan defined !')
raise wizard.except_wizard(_('Error'), _('No analytic plan defined !'))
plan_obj.write(cr,uid,[data['id']],{'plan_id':pids[0]})
return 'info'
else:

View File

@ -23,6 +23,7 @@ import wizard
import time
import datetime
import pooler
from tools.translate import _
form = """<?xml version="1.0"?>
<form string="Select Information">
@ -59,7 +60,7 @@ class wizard_crossovered_analytic(wizard.interface):
break
if flag:
raise wizard.except_wizard('User Error',"There are no Analytic lines related to Account '" + name +"'" )
raise wizard.except_wizard(_('User Error'),_('There are no Analytic lines related to Account %s' % name))
return {}
states = {

View File

@ -25,6 +25,7 @@ import netsvc
from mx import DateTime
import time
import datetime
from tools.translate import _
def strToDate(dt):
@ -161,7 +162,7 @@ class crossovered_budget_lines(osv.osv):
for line in self.browse(cr, uid, ids):
acc_ids = [x.id for x in line.general_budget_id.account_ids]
if not acc_ids:
raise osv.except_osv('Error!',"The General Budget '" + str(line.general_budget_id.name) + "' has no Accounts!" )
raise osv.except_osv(_('Error!'),_("The General Budget '%s' has no Accounts!" % str(line.general_budget_id.name)))
date_to = line.date_to
date_from = line.date_from
if context.has_key('wizard_date_from'):

View File

@ -1,8 +1,8 @@
<?xml version="1.0"?>
<document filename="test.pdf">
<template pageSize="(612.0,792.0)" title="Test" author="Martin Simon" allowSplitting="20">
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="57.0" y1="57.0" width="498" height="678"/>
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
</pageTemplate>
</template>
<stylesheet>

View File

@ -1,8 +1,8 @@
<?xml version="1.0"?>
<document filename="test.pdf">
<template pageSize="(612.0,792.0)" title="Test" author="Martin Simon" allowSplitting="20">
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="57.0" y1="57.0" width="498" height="678"/>
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
</pageTemplate>
</template>
<stylesheet>

View File

@ -1,8 +1,8 @@
<?xml version="1.0"?>
<document filename="test.pdf">
<template pageSize="(612.0,792.0)" title="Test" author="Martin Simon" allowSplitting="20">
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="57.0" y1="57.0" width="498" height="678"/>
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
</pageTemplate>
</template>
<stylesheet>

View File

@ -24,6 +24,7 @@ import time
import wizard
import datetime
import pooler
from tools.translate import _
dates_form = '''<?xml version="1.0"?>
<form string="Select period">
@ -41,7 +42,7 @@ class wizard_report(wizard.interface):
pool_obj = pooler.get_pool(cr.dbname)
data_model = pool_obj.get(data['model']).browse(cr,uid,data['id'])
if not data_model.dotation_ids:
raise wizard.except_wizard('Insufficient Data!',"No Dotations or Master Budget Expenses Found on Budget '"+ data_model.name +"'!")
raise wizard.except_wizard(_('Insufficient Data!'),_('No Dotations or Master Budget Expenses Found on Budget %s!') % data_model.name)
return data['form']
states = {

View File

@ -29,6 +29,7 @@ import ir
from mx import DateTime
import pooler
from tools import config
from tools.translate import _
class account_journal(osv.osv):
_inherit='account.journal'
@ -62,7 +63,7 @@ class account_move_line(osv.osv):
if not journal.allow_date:
period=self.pool.get('account.period').browse(cr,uid,[period_id])[0]
if not time.strptime(vals['date'],'%Y-%m-%d')>=time.strptime(period.date_start,'%Y-%m-%d') and time.strptime(vals['date'],'%Y-%m-%d')<=time.strptime(period.date_stop,'%Y-%m-%d'):
raise osv.except_osv('Error','The date of your account move is not in the defined period !')
raise osv.except_osv(_('Error'),_('The date of your account move is not in the defined period !'))
else:
return True

View File

@ -37,7 +37,13 @@
It will generate a PDF with all the letters according the the
different levels of recall defined. You can define different policies
for different companies.""",
for different companies.
Note that if you want to change the followup level for a given partner/account entry, you can do it in the menu:
Financial_Management/Reporting/Follow-Ups/All Receivable Entries
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['account'],

View File

@ -50,7 +50,7 @@ class report_rappel(report_sxw.rml_parse):
res_partner = pooler.get_pool(self.cr.dbname).get('res.partner')
res_partner_address = pooler.get_pool(self.cr.dbname).get('res.partner.address')
adr = res_partner.address_get(self.cr, self.uid, [partner.id], [type])[type]
return res_partner_address.read(self.cr, self.uid, [adr])
return adr and res_partner_address.read(self.cr, self.uid, [adr]) or False
def _lines_get(self, partner):
moveline_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
@ -70,7 +70,7 @@ class report_rappel(report_sxw.rml_parse):
li_delay.sort(reverse=True)
text = ""
a = {}
partner_line = pooler.get_pool(self.cr.dbname).get('account.move.line').search(self.cr, self.uid, [('partner_id','=',partner.id)])
partner_line = pooler.get_pool(self.cr.dbname).get('account.move.line').search(self.cr, self.uid, [('partner_id','=',partner.id),('reconcile_id','=',False)])
partner_delay = []
context={}
context.update({'lang': partner.lang})

View File

@ -21,7 +21,7 @@
##############################################################################
from osv import fields, osv
from tools.translate import _
class account_move_line(osv.osv):
_inherit = "account.move.line"

View File

@ -21,3 +21,4 @@
##############################################################################
import payment_order
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -31,4 +31,6 @@ class payment_order(report_sxw.rml_parse):
'time': time,
})
report_sxw.report_sxw('report.payment.order', 'payment.order', 'addons/account_payment/report/payment_order.rml', parser=payment_order,header=False)
report_sxw.report_sxw('report.payment.order', 'payment.order', 'addons/account_payment/report/payment_order.rml', parser=payment_order,header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -24,6 +24,7 @@ import netsvc
from osv import fields, osv
import pooler
from tools.misc import currency
from tools.translate import _
import mx.DateTime
from mx.DateTime import RelativeDateTime, now, DateTime, localtime

View File

@ -22,6 +22,7 @@
import wizard
import pooler
from tools.translate import _
form = '''<?xml version="1.0"?>
<form string="Print Indicators">
@ -55,7 +56,7 @@ def _load_base(self, cr, uid, data, context):
def _check_len(self, cr, uid, data, context):
if len(data['form']['base_selection'][0][2])>8:
raise wizard.except_wizard('User Error!',"Please select maximum 8 records to fit the page-width.")
raise wizard.except_wizard(_('User Error!'),_("Please select maximum 8 records to fit the page-width."))
return data['form']
class wizard_print_indicators(wizard.interface):

View File

@ -20,7 +20,7 @@
<field name="report_type" />
<newline/>
<separator string="Accounts" colspan="4"/>
<field name="account_id" colspan="4" nolabel="1" domain="[('type','=','view')]"/>
<field name="account_id" colspan="4" nolabel="1"/>
</page><page string="Notes">
<field name="note" nolabel="1" colspan="4"/>
</page>

View File

@ -58,9 +58,11 @@ class account_report_bs(report_sxw.rml_parse):
_total +=self.line_total(report,ctx)
return _total
def lines(self, form, ids={}, done=None, level=1):
if not ids:
ids = self.ids
def lines(self, form, ids={}, done=None, level=1, object=False):
if object:
ids = [object.id]
elif not ids:
ids = self.ids
if not ids:
return []
if not done:
@ -76,7 +78,7 @@ class account_report_bs(report_sxw.rml_parse):
def cmp_code(x, y):
return cmp(x.code, y.code)
report_objs.sort(cmp_code)
for report_obj in report_objs:
if report_obj.id in done:
continue
@ -87,12 +89,12 @@ class account_report_bs(report_sxw.rml_parse):
color_font = report_obj.color_font.name
if report_obj.color_back:
color_back = report_obj.color_back.name
res = {
'code': report_obj.code,
'name': report_obj.name,
'level': level,
'balance': self.line_total(report_obj.id,ctx),
'parent_id':False,
'color_font':color_font,
'color_back':color_back,
'font_style' : report_obj.font_style
@ -101,35 +103,55 @@ class account_report_bs(report_sxw.rml_parse):
report_type = report_obj.report_type
if report_type != 'only_obj':
account_ids = self.pool.get('account.report.bs').read(self.cr,self.uid,[report_obj.id],['account_id'])[0]['account_id']
for account_id in account_ids:
res1 = self.check_child_id(account_id,level,ctx,report_type)
result += res1
if report_type == 'acc_with_child':
acc_ids = self.pool.get('account.account')._get_children_and_consol(self.cr, self.uid, account_ids )
account_ids = acc_ids
account_objs = self.pool.get('account.account').browse(self.cr,self.uid,account_ids,ctx)
for acc_obj in account_objs:
res1={}
res1 = {
'code': acc_obj.code,
'name': acc_obj.name,
'level': level+1,
'balance': acc_obj.balance,
'parent_id':acc_obj.parent_id,
'color_font' : 'black',
'color_back' :'white',
'font_style' : 'Helvetica',
}
if acc_obj.parent_id:
for r in result:
if r['name']== acc_obj.parent_id.name:
res1['level'] = r['level'] + 1
break
result.append(res1)
#res1 = self.check_child_id(account_id,level,ctx,report_type)
#result += res1
if report_obj.child_id:
ids2 = [(x.code,x.id) for x in report_obj.child_id]
ids2.sort()
result += self.lines(form, [x[1] for x in ids2], done, level+1)
result += self.lines(form,[x[1] for x in ids2], done, level+1,object=False)
return result
def check_child_id(self,account_id,level,ctx,report_type):
account = self.pool.get('account.account').browse(self.cr,self.uid,[account_id],ctx)[0]
result = []
res = {
'code': account.code,
'name': account.name,
'level': level+1,
'balance': account.balance,
'color_font' : 'black',
'color_back' :'pink',
'font_style' : 'Helvetica-BoldOblique',
}
result.append(res)
if report_type != 'with_account':
acc_child_id = self.pool.get('account.account').search(self.cr,self.uid,[('parent_id','=',[account_id]),('type','=','view')])
for child_id in acc_child_id :
result += self.check_child_id(child_id,level+1,ctx,report_type)
return result
# def check_child_id(self,account_id,level,ctx,report_type):
# account = self.pool.get('account.account').browse(self.cr,self.uid,[account_id],ctx)[0]
# result = []
# res = {
# 'code': account.code,
# 'name': account.name,
# 'level': level+1,
# 'balance': account.balance,
# 'color_font' : 'black',
# 'color_back' :'white',
# 'font_style' : 'Helvetica',
# }
# result.append(res)
# if report_type != 'with_account':
# acc_child_id = self.pool.get('account.account').search(self.cr,self.uid,[('parent_id','=',[account_id]),('type','=','view')])
# for child_id in acc_child_id :
# result += self.check_child_id(child_id,level+1,ctx,report_type)
# return result
@ -138,6 +160,8 @@ class account_report_bs(report_sxw.rml_parse):
#
# def _sum_debit(self):
# return self.sum_debit
report_sxw.report_sxw('report.account.report.bs', 'account.report.bs', 'addons/account_reporting/report/account_report_bs.rml', parser=account_report_bs)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -13,9 +13,6 @@
<blockTableStyle id="Table1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<blockBackground colorName="#e6e6e6" start="0,0" stop="0,0"/>
<blockBackground colorName="#e6e6e6" start="1,0" stop="1,0"/>
<blockBackground colorName="#e6e6e6" start="2,0" stop="2,0"/>
</blockTableStyle>
<blockTableStyle id="Table2">
<blockAlignment value="LEFT"/>
@ -24,41 +21,52 @@
<blockTableStyle id="Table7">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,2" stop="-1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,1"/>
</blockTableStyle>
<blockTableStyle id="Table4">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,1" stop="-1,1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,2" stop="-1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,1" stop="-1,1"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" fontName="Times-Roman" fontSize="15.0" leading="25" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P2" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P3" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P4" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P5" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P6" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P7" fontName="Times-Roman" fontSize="6.0" leading="8" alignment="LEFT"/>
<paraStyle name="P8" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="RIGHT"/>
<paraStyle name="P9" fontName="Times-Roman" fontSize="8.0" leading="10"/>
<paraStyle name="P10" fontName="Times-Roman" fontSize="8.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P11" fontName="Times-Roman" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P12" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P13" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P14" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P15" fontName="Times-Roman" fontSize="20.0" leading="25" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P16" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P17" fontName="Times-Roman" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P18" fontName="Times-Roman" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P19" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P20" fontName="Times-Roman" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Standard" fontName="Times-Roman"/>
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Times-Roman"/>
<paraStyle name="P1" fontName="Helvetica" fontSize="15.0" leading="25" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P2" fontName="Helvetica" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P3" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P4" fontName="Helvetica" fontSize="12.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P5" fontName="Helvetica" fontSize="12.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P6" fontName="Helvetica" fontSize="12.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P7" fontName="Helvetica" fontSize="6.0" leading="8" alignment="LEFT"/>
<paraStyle name="P8" fontName="Helvetica" fontSize="12.0" leading="14" alignment="RIGHT"/>
<paraStyle name="P9" fontName="Helvetica" fontSize="8.0" leading="10"/>
<paraStyle name="P10" fontName="Helvetica" fontSize="9.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P11" fontName="Helvetica" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P12" fontName="Helvetica" fontSize="12.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P12a" fontName="Helvetica" fontSize="12.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P13" fontName="Helvetica" fontSize="12.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P14" fontName="Helvetica" fontSize="12.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P15" fontName="Helvetica" fontSize="20.0" leading="25" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P16" fontName="Helvetica" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P17" fontName="Helvetica" fontSize="9.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P18" fontName="Helvetica" fontSize="9.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P19" fontName="Helvetica" fontSize="12.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P20" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Standard" fontName="Helvetica"/>
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Helvetica"/>
</stylesheet>
<story>
<blockTable colWidths="143.0,226.0,156.0" repeatRows="1" style="Table1">
@ -95,29 +103,29 @@
</td>
</tr>
</blockTable>
<blockTable colWidths="70.0,341.0,131.0" style="Table7">
<blockTable colWidths="131.0,280.0,131.0" style="Table7">
<tr>
<td>
<para style="P12" ><font color='blue'>Code</font></para>
<para style="P12a" ><font color='blue'>Code</font></para>
</td>
<td>
<para style="P12"><font color='blue'>Account name</font></para>
<para style="P12a"><font color='blue'>Account Name</font></para>
</td>
<td>
<para style="P13"><font color='blue'>Balance</font></para>
</td>
</tr>
</blockTable>
<blockTable colWidths="75.0,341.0,131.0" style="Table4">
<blockTable colWidths="131.0,280.0,131.0" style="Table4">
<tr>
<td>
<para style="P10">[[ repeatIn(lines(data['form']), 'a') ]]<font> [[ a['code'] ]] [[ a['font_style'] and (setTag('font','font',{'face':a['font_style'] })) ]] [[ a['color_font'] and ( setTag('font','font',{'color':a['color_font']})) ]] [[ a['color_back'] and ( setTag('para','para',{'backColor':a['color_back']})) ]]</font></para>
<para style="P10">[[ repeatIn(lines(data['form'],object=o), 'a') ]]<font> [[ a['code'] ]] [[ (a['font_style']) and (setTag('font','font',{'face':a['font_style']})) or (a['level']==1 and (setTag('para','para',{'fontName':'Helvetica-Bold'}))) ]] [[ a['color_font'] and ( setTag('font','font',{'color':a['color_font']})) ]] [[ a['color_back'] and ( setTag('para','para',{'backColor':a['color_back']})) ]]</font></para>
</td>
<td>
<para style="P17"><font>[[ '.. .. '*(a['level']-1) ]] [[ a['name'] ]] [[ a['font_style'] and (setTag('font','font',{'face':a['font_style']})) ]] [[ a['color_font'] and ( setTag('font','font',{'color':a['color_font']})) ]] [[ a['color_back'] and ( setTag('para','para',{'backColor':a['color_back']})) ]]</font></para>
<para style="P17"><font><font color="white">[[ '..'*(a['level']-1) ]]</font> [[ a['name'] ]] [[ (a['font_style']) and (setTag('font','font',{'face':a['font_style']})) or (a['level']==1 and (setTag('para','para',{'fontName':'Helvetica-Bold'}))) ]] [[ a['color_font'] and ( setTag('font','font',{'color':a['color_font']})) ]] [[ a['color_back'] and ( setTag('para','para',{'backColor':a['color_back']})) ]]</font></para>
</td>
<td>
<para style="P18"><font>[[ '%.2f'% a['balance'] ]] [[ a['font_style'] and (setTag('font','font', {'face':a['font_style'] })) ]] [[ a['color_font'] and ( setTag('font','font',{'color':a['color_font']})) ]] [[ a['color_back'] and ( setTag('para','para',{'backColor':a['color_back']})) ]]</font></para>
<para style="P18"><font>[[ '%.2f'% a['balance'] ]] [[ (a['font_style']) and (setTag('font','font',{'face':a['font_style']})) or (a['level']==1 and (setTag('para','para',{'fontName':'Helvetica-Bold'}))) ]] [[ a['color_font'] and ( setTag('font','font',{'color':a['color_font']})) ]] [[ a['color_back'] and ( setTag('para','para',{'backColor':a['color_back']})) ]]</font></para>
</td>
</tr>

View File

@ -159,7 +159,8 @@ class account_invoice_tax(osv.osv):
tax_obj = self.pool.get('account.tax')
cur_obj = self.pool.get('res.currency')
cur = inv.currency_id
company_currency = inv.company_id.currency_id.id
for line in inv.invoice_line:
data = self.pool.get('account.invoice.line')._amount_line2(cr, uid, [line.id], [], [], context)[line.id]
for tax in data['data']:
@ -174,14 +175,14 @@ class account_invoice_tax(osv.osv):
if inv.type in ('out_invoice','in_invoice'):
val['base_code_id'] = tax['base_code_id']
val['tax_code_id'] = tax['tax_code_id']
val['base_amount'] = val['base'] * tax['base_sign']
val['tax_amount'] = val['amount'] * tax['tax_sign']
val['base_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['base'] * tax['base_sign'], context={'date': inv.date_invoice or time.strftime('%Y-%m-%d')}, round=False)
val['tax_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['amount'] * tax['tax_sign'], context={'date': inv.date_invoice or time.strftime('%Y-%m-%d')}, round=False)
val['account_id'] = tax['account_collected_id'] or line.account_id.id
else:
val['base_code_id'] = tax['ref_base_code_id']
val['tax_code_id'] = tax['ref_tax_code_id']
val['base_amount'] = val['base'] * tax['ref_base_sign']
val['tax_amount'] = val['amount'] * tax['ref_tax_sign']
val['base_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['base'] * tax['ref_base_sign'], context={'date': inv.date_invoice or time.strftime('%Y-%m-%d')}, round=False)
val['tax_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['amount'] * tax['ref_tax_sign'], context={'date': inv.date_invoice or time.strftime('%Y-%m-%d')}, round=False)
val['account_id'] = tax['account_paid_id'] or line.account_id.id
key = (val['tax_code_id'], val['base_code_id'], val['account_id'])
@ -193,6 +194,11 @@ class account_invoice_tax(osv.osv):
tax_grouped[key]['base_amount'] += val['base_amount']
tax_grouped[key]['tax_amount'] += val['tax_amount']
for t in tax_grouped.values():
t['amount'] = cur_obj.round(cr, uid, cur, t['amount'])
t['base_amount'] = cur_obj.round(cr, uid, cur, t['base_amount'])
t['tax_amount'] = cur_obj.round(cr, uid, cur, t['tax_amount'])
return tax_grouped
account_invoice_tax()

View File

@ -23,3 +23,4 @@
import voucher
import voucher_account
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -20,4 +20,6 @@
#
##############################################################################
import report_voucher
import report_voucher_amount
import report_voucher_amount
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -64,4 +64,6 @@ report_sxw.report_sxw(
'account.voucher',
'addons/account_voucher/report/report_voucher.rml',
parser=report_voucher,header=False
)
)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -43,4 +43,6 @@ report_sxw.report_sxw(
'account.voucher',
'addons/account_voucher/report/report_voucher_amount.rml',
parser=report_voucher_amount,header=False
)
)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -28,6 +28,7 @@ import mx.DateTime
from mx.DateTime import RelativeDateTime
from tools import config
from tools.translate import _
type2journal = {
'rec_voucher':'cash',
@ -180,7 +181,7 @@ class account_voucher(osv.osv):
if t['state'] in ('draft', 'cancel'):
unlink_ids.append(t['id'])
else:
raise osv.except_osv('Invalid action !', 'Cannot delete invoice(s) which are already opened or paid !')
raise osv.except_osv(_('Invalid action !'), _('Cannot delete invoice(s) which are already opened or paid !'))
osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
return True
@ -604,3 +605,4 @@ class VoucherLine(osv.osv):
}
VoucherLine()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -144,3 +144,4 @@ class Account(osv.osv):
}
Account()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -20,3 +20,4 @@
#
##############################################################################
import open_voucher
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -21,6 +21,7 @@
##############################################################################
from osv import fields,osv
from osv import orm
from tools.translate import _
class analytic_user_funct_grid(osv.osv):
@ -94,9 +95,9 @@ class hr_analytic_timesheet(osv.osv):
if not a:
a = r.product_id.categ_id.property_account_expense_categ.id
if not a:
raise osv.except_osv('Error !',
'There is no expense account define ' \
'for this product: "%s" (id:%d)' % \
raise osv.except_osv(_('Error !'),
_('There is no expense account define ' \
'for this product: "%s" (id:%d)') % \
(r.product_id.name, r.product_id.id,))
amount = unit_amount * self.pool.get('product.uom')._compute_price(cr, uid,
r.product_id.uom_id.id, r.product_id.standard_price, False)
@ -127,9 +128,9 @@ class hr_analytic_timesheet(osv.osv):
if not a:
a = r.product_id.categ_id.property_account_expense_categ.id
if not a:
raise osv.except_osv('Error !',
'There is no expense account define ' \
'for this product: "%s" (id:%d)' % \
raise osv.except_osv(_('Error !'),
_('There is no expense account define ' \
'for this product: "%s" (id:%d)') % \
(r.product_id.name, r.product_id.id,))
amount = unit_amount * r.product_id.uom_id._compute_price(cr, uid,
r.product_id.uom_id.id, r.product_id.standard_price, False)

View File

@ -25,6 +25,7 @@ import netsvc
from osv import fields, osv, orm
import ir
from mx import DateTime
from tools.translate import _
#----------------------------------------------------------
# Auction Artists
@ -627,7 +628,7 @@ class auction_lots(osv.osv):
continue
partner_r=self.pool.get('res.partner')
if not lot.ach_uid.id:
raise orm.except_orm('Missed buyer !', 'The object "%s" has no buyer assigned.' % (lot.name,))
raise orm.except_orm(_('Missed buyer !'), _('The object "%s" has no buyer assigned.') % (lot.name,))
else:
partner_ref =lot.ach_uid.id
lot_name = lot.obj_num
@ -635,7 +636,7 @@ class auction_lots(osv.osv):
contact_addr_id = res['contact']
invoice_addr_id = res['invoice']
if not invoice_addr_id:
raise orm.except_orm('No Invoice Address', 'The Buyer "%s" has no Invoice Address.' % (contact_addr_id,))
raise orm.except_orm(_('No Invoice Address'), _('The Buyer "%s" has no Invoice Address.') % (contact_addr_id,))
inv = {
'name': 'Auction proforma:' +lot.name,
'journal_id': lot.auction_id.journal_id.id,
@ -754,13 +755,13 @@ class auction_lots(osv.osv):
continue
partner_r=self.pool.get('res.partner')
if not lot.ach_uid.id:
raise orm.except_orm('Missed buyer !', 'The object "%s" has no buyer assigned.' % (lot.name,))
raise orm.except_orm(_('Missed buyer !'), _('The object "%s" has no buyer assigned.') % (lot.name,))
if (lot.auction_id.id,lot.ach_uid.id) in invoices:
inv_id = invoices[(lot.auction_id.id,lot.ach_uid.id)]
else:
add = partner_r.read(cr, uid, [lot.ach_uid.id], ['address'])[0]['address']
if not len(add):
raise orm.except_orm('Missed Address !', 'The Buyer has no Invoice Address.')
raise orm.except_orm(_('Missed Address !'), _('The Buyer has no Invoice Address.'))
price = lot.obj_price or 0.0
lot_name =lot.obj_num
inv={

View File

@ -31,3 +31,4 @@
#
__version__ = '0.9'
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -319,3 +319,4 @@ class Code128(MultiWidthBarcode):
dval = dval + _patterns[c]
self.decomposed = dval
return self.decomposed
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -253,3 +253,4 @@ class Extended39(_Code39Base):
raise ValueError
self.encoded = _encode39(self.encoded, self.checksum)
return self.encoded
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -230,3 +230,4 @@ class Extended93(_Code93Base):
raise ValueError
self.encoded = _encode93(self.encoded)
return self.encoded
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -703,3 +703,4 @@ class Code11(Barcode):
dval = dval + self.patterns[c] + 'i'
self.decomposed = dval[:-1]
return self.decomposed
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -79,3 +79,4 @@ _ozC_patterns = {
}
#http://www.auspost.com.au/futurepost/
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -53,3 +53,4 @@ if __name__=='__main__':
run()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -229,3 +229,4 @@ class POSTNET(Barcode):
h = self.fbarheight
self.rect(left, 0.0, self.barwide, h)
left = left + self.barwide + self.spacewide
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -25,6 +25,7 @@ import pooler
import time
from report import report_sxw
from osv import osv
from tools.translate import _
class buyer_list(report_sxw.rml_parse):
auc_lot_ids=[]

View File

@ -30,6 +30,7 @@ import base64
import mimetypes
import httplib
import threading
from tools.translate import _
login_form = '''<?xml version="1.0"?>
<form title="Login">

View File

@ -26,6 +26,7 @@
import wizard
import netsvc
from tools.translate import _
login_form = '''<?xml version="1.0"?>
<form title="Login">

View File

@ -27,6 +27,7 @@ import netsvc
import pooler
import string
import time,copy
from tools.translate import _
class audittrail_rule(osv.osv):
_name = 'audittrail.rule'
@ -59,8 +60,8 @@ class audittrail_rule(osv.osv):
obj = self.pool.get(thisrule.object_id.model)
if not obj:
raise osv.except_osv(
'WARNING:audittrail is not part of the pool',
'Change audittrail depends -- Setting rule as DRAFT')
_('WARNING:audittrail is not part of the pool'),
_('Change audittrail depends -- Setting rule as DRAFT'))
self.write(cr, uid, [thisrule.id], {"state": "draft"})
val={
"name":'View Log',

View File

@ -47,6 +47,7 @@ class res_partner_contact(osv.osv):
'active' : fields.boolean('Active'),
'partner_id':fields.related('job_ids','address_id','partner_id',type='many2one', relation='res.partner', string='Main Employer'),
'function_id':fields.related('job_ids','function_id',type='many2one', relation='res.partner.function', string='Main Job'),
'email': fields.char('E-Mail', size=240),
}
_defaults = {
'active' : lambda *a: True,
@ -121,6 +122,9 @@ class res_partner_job(osv.osv):
'sequence_partner':fields.integer('Partner Seq.',help='Order of importance of this job title in the list of job title of the linked partner'),
'email': fields.char('E-Mail', size=240),
'phone': fields.char('Phone', size=64),
'fax': fields.char('Fax', size=64),
'extension': fields.char('Extension', size=64, help='Internal/External extension phone number'),
'other': fields.char('Other', size=64, help='Additional phone field'),
'date_start' : fields.date('Date Start'),
'date_stop' : fields.date('Date Stop'),
'state' : fields.selection([('past', 'Past'),('current', 'Current')], 'State', required=True),

View File

@ -12,6 +12,7 @@
<field name="name"/>
<field name="first_name"/>
<field name="mobile"/>
<field name="email"/>
<field name="lang_id"/>
<field name="partner_id"/>
<field name="function_id"/>
@ -34,6 +35,7 @@
<field name="mobile" select="2"/>
<field name="title" select="1" />
<field name="website"/>
<field name="email"/>
<field name="lang_id"/>
<field name="active"/>
<field name="partner_id" invisible="1" select="2"/>
@ -45,6 +47,9 @@
<field name="name"/>
<field name="sequence_contact"/>
<field name="phone"/>
<field name="fax"/>
<field name="extension"/>
<field name="other"/>
<field name="email" widget="email"/>
<field name="date_start" />
<field name="date_stop" />
@ -56,6 +61,9 @@
<field name="name"/>
<field name="address_id"/>
<field name="phone"/>
<field name="fax"/>
<field name="extension"/>
<field name="other"/>
<field name="email"/>
<field name="state" />
</tree>
@ -113,6 +121,9 @@
<field name="contact_id"/>
<field name="function_id"/>
<field name="phone"/>
<field name="fax"/>
<field name="extension"/>
<field name="other"/>
<field name="email"/>
</tree>
<form string="Contacts">
@ -121,6 +132,9 @@
<field name="contact_id"/>
<field name="function_id"/>
<field name="phone"/>
<field name="fax"/>
<field name="extension"/>
<field name="other"/>
<field name="email" widget="email"/>
</form>
</field>
@ -271,12 +285,16 @@
<field name="contact_id"/>
<field name="function_id"/>
<field name="phone"/>
<field name="fax"/>
<field name="extension"/>
<field name="email"/>
</tree>
<form string="Contacts">
<field name="contact_id"/>
<field name="function_id"/>
<field name="phone"/>
<field name="fax"/>
<field name="extension"/>
<field name="email" widget="email"/>
</form>
</field>
@ -297,6 +315,8 @@
<field name="address_id"/>
<field name="email"/>
<field name="phone"/>
<field name="fax"/>
<field name="extension"/>
<field name="state" />
</tree>
</field>
@ -316,6 +336,8 @@
<field name="function_id" select="1"/>
<field name="email" select="2" widget="email"/>
<field name="phone" select="2"/>
<field name="fax"/>
<field name="extension"/>
<field name="sequence_contact" select="2" groups="base.group_user"/>
<field name="sequence_partner" select="2" groups="base.group_user"/>
<field name="date_start" groups="base.group_user"/>

View File

@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-02-06 15:20:38+0000\n"
"PO-Revision-Date: 2009-02-06 15:20:38+0000\n"
"POT-Creation-Date: 2009-02-19 22:54:38+0000\n"
"PO-Revision-Date: 2009-02-19 22:54:38+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -31,13 +31,21 @@ msgid "The Object name must start with x_ and not contain any special character
msgstr ""
#. module: base_contact
#: model:ir.actions.act_window,name:base_contact.action_partner_contact_form
#: model:ir.ui.menu,name:base_contact.menu_partner_contact_form
#: model:process.node,name:base_contact.process_node_contacts0
#: view:res.partner:0
#: view:res.partner.address:0
#: field:res.partner.address,job_ids:0
msgid "Contacts"
#: model:ir.module.module,description:base_contact.module_meta_information
msgid "\n"
" This module allows you to manage entirely your contacts.\n"
"\n"
" It lets you define\n"
" *contacts unrelated to a partner,\n"
" *contacts working at several addresses (possibly for different partners),\n"
" *contacts with possibly different functions for each of its job's addresses\n"
"\n"
" It also add new menu items located in\n"
" Partners \ Contacts\n"
" Partners \ Functions\n"
"\n"
" Pay attention that this module converts the existing addresses into \"addresses + contacts\". It means that some fields of the addresses will be missing (like the contact name), since these are supposed to be defined in an other object.\n"
" "
msgstr ""
#. module: base_contact
@ -45,6 +53,11 @@ msgstr ""
msgid "Partner Seq."
msgstr ""
#. module: base_contact
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: base_contact
#: selection:res.partner.job,state:0
msgid "Current"
@ -60,6 +73,11 @@ msgstr ""
msgid "Contact Partner Function"
msgstr ""
#. module: base_contact
#: field:res.partner.job,other:0
msgid "Other"
msgstr ""
#. module: base_contact
#: model:process.transition,name:base_contact.process_transition_contacttofunction0
msgid "Contact to function"
@ -70,6 +88,11 @@ msgstr ""
msgid "Partner Function"
msgstr ""
#. module: base_contact
#: field:res.partner.contact,title:0
msgid "Title"
msgstr ""
#. module: base_contact
#: model:process.transition,name:base_contact.process_transition_partnertoaddress0
msgid "Partner to address"
@ -86,8 +109,13 @@ msgid "Function"
msgstr ""
#. module: base_contact
#: field:res.partner.contact,function_id:0
msgid "Main Job"
#: field:res.partner.job,fax:0
msgid "Fax"
msgstr ""
#. module: base_contact
#: field:res.partner.contact,lang_id:0
msgid "Language"
msgstr ""
#. module: base_contact
@ -101,8 +129,13 @@ msgid "Defines contacts and functions."
msgstr ""
#. module: base_contact
#: field:res.partner.contact,title:0
msgid "Title"
#: model:ir.actions.act_window,name:base_contact.action_partner_contact_form
#: model:ir.ui.menu,name:base_contact.menu_partner_contact_form
#: model:process.node,name:base_contact.process_node_contacts0
#: view:res.partner:0
#: view:res.partner.address:0
#: field:res.partner.address,job_ids:0
msgid "Contacts"
msgstr ""
#. module: base_contact
@ -121,6 +154,7 @@ msgid "Order of importance of this job title in the list of job title of the lin
msgstr ""
#. module: base_contact
#: field:res.partner.contact,email:0
#: field:res.partner.job,email:0
msgid "E-Mail"
msgstr ""
@ -152,6 +186,11 @@ msgstr ""
msgid "Order of importance of this address in the list of addresses of the linked contact"
msgstr ""
#. module: base_contact
#: field:res.partner.contact,function_id:0
msgid "Main Job"
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid "Categories"
@ -163,8 +202,8 @@ msgid "Define partners and their addresses."
msgstr ""
#. module: base_contact
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
#: help:res.partner.job,other:0
msgid "Additionnal phone field"
msgstr ""
#. module: base_contact
@ -178,8 +217,8 @@ msgid "Seq."
msgstr ""
#. module: base_contact
#: field:res.partner.contact,lang_id:0
msgid "Language"
#: field:res.partner.job,extension:0
msgid "Extension"
msgstr ""
#. module: base_contact
@ -187,6 +226,11 @@ msgstr ""
msgid "Mobile"
msgstr ""
#. module: base_contact
#: help:res.partner.job,extension:0
msgid "Internal/External extension phone number"
msgstr ""
#. module: base_contact
#: model:process.node,note:base_contact.process_node_contacts0
msgid "People you work with."

View File

@ -26,6 +26,7 @@ import pooler
import tools
import os
from xml.dom import minidom
from tools.translate import _
info_start_form = '''<?xml version="1.0"?>
<form string="Module Merging">

View File

@ -29,6 +29,7 @@ import base64
import module_zip
import tools
from tools.translate import _
intro_form = '''<?xml version="1.0"?>
<form string="Module publication">

View File

@ -25,6 +25,7 @@ import pooler
import module_zip
from base_module_publish import post_multipart
from urllib import urlopen
from tools.translate import _
intro_form = '''<?xml version="1.0"?>
<form string="Module publication">
@ -102,7 +103,7 @@ def _upload(self, cr, uid, datas, context):
res['module_file'])
])
if result[0] == "1":
raise wizard.except_wizard('Error', 'Login failed!')
raise wizard.except_wizard(_('Error'), _('Login failed!'))
elif result[0] == "0":
log[0].append(mod.name)
elif result[0] == "2":

View File

@ -21,6 +21,7 @@
##############################################################################
import pooler
import addons
from tools.translate import _
def createzip(cr, uid, moduleid, context, b64enc=True, src=True):
pool = pooler.get_pool(cr.dbname)

View File

@ -24,6 +24,7 @@ import string
import time
import tools
from osv import fields,osv,orm
from tools.translate import _
#class ir_model_fields(osv.osv):
# _inherit = 'ir.model.fields'
@ -216,7 +217,7 @@ class report_creator(osv.osv):
if reference_model_dict:
self.model_set_id = model_dict.get(reference_model_dict.keys()[reference_model_dict.values().index(min(reference_model_dict.values()))])
if model_list and not len(model_dict.keys()) == 1:
raise osv.except_osv("No Related Models!!",'These is/are model(s) (%s) in selection which is/are not related to any other model'%','.join(model_list) )
raise osv.except_osv(_('No Related Models!!'),_('These is/are model(s) (%s) in selection which is/are not related to any other model') % ','.join(model_list))
if filter_ids and where_list<>[]:
where_list.append('and')
where_list.append(' ')
@ -305,7 +306,7 @@ from
return True
def _aggregation_error(self, cr, uid, ids):
aggregate_columns = ('int','float')
aggregate_columns = ('integer','float')
apply_functions = ('sum','min','max','avg','count')
this_objs = self.browse(cr, uid, ids)
for obj in this_objs:

View File

@ -27,6 +27,7 @@ import pooler
import urllib
import base64
import tools
from tools.translate import _
intro_form = '''<?xml version="1.0"?>
<form string="Report designer">

View File

@ -3,7 +3,7 @@
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
# Copyright (C) 2008-2009 B2CK, Cedric Krier, Bertrand Chenal (the methods "check_vat_[a-z]{2}"
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -20,13 +20,6 @@
#
##############################################################################
#
# The methods "check_vat_[a-z]{2}" are copyrighted:
# - Cedric Krier.
# - Bertrand Chenal
# - B2CK
#
from osv import osv
from osv import fields

View File

@ -81,8 +81,7 @@ class board_board(osv.osv):
'type': 'form',
'arch': self.create_view(cr, user, id, context),
})
vals['view_id'] = view_id
super(board_board, self).write(cr, user, [id], vals, context)
super(board_board,self).write(cr, user, [id], {'view_id': view_id}, context)
return id
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False):

View File

@ -25,6 +25,7 @@ import time
import wizard
import osv
import pooler
from tools.translate import _
section_form = '''<?xml version="1.0"?>
<form string="Create Menu For Dashboard">
@ -42,7 +43,7 @@ def check_views(self, cr, uid, data, context):
pool = pooler.get_pool(cr.dbname)
board = pool.get('board.board').browse(cr, uid, data['id'])
if not board.line_ids:
raise wizard.except_wizard('User Error!',"Please Insert Dashboard View(s) !")
raise wizard.except_wizard(_('User Error!'),_('Please Insert Dashboard View(s) !'))
return data['form']
def board_menu_create(self, cr, uid, data, context):

View File

@ -0,0 +1 @@
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -20,3 +20,4 @@
#
##############################################################################
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1 @@
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -240,6 +240,7 @@ class crm_case_rule(osv.osv):
'trg_priority_from': fields.selection([('','')] + AVAILABLE_PRIORITIES, 'Minimum Priority'),
'trg_priority_to': fields.selection([('','')] + AVAILABLE_PRIORITIES, 'Maximim Priority'),
'trg_max_history': fields.integer('Maximum Communication History'),
'act_method': fields.char('Call Object Method', size=64),
'act_state': fields.selection([('','')]+AVAILABLE_STATES, 'Set state to', size=16),
@ -418,6 +419,7 @@ class crm_case(osv.osv):
ok = ok and (not action.trg_categ_id or action.trg_categ_id.id==case.categ_id.id)
ok = ok and (not action.trg_user_id.id or action.trg_user_id.id==case.user_id.id)
ok = ok and (not action.trg_partner_id.id or action.trg_partner_id.id==case.partner_id.id)
ok = ok and (not action.trg_max_history or action.trg_max_history<=(len(case.history_line)+1))
ok = ok and (
not action.trg_partner_categ_id.id or
(
@ -649,6 +651,9 @@ class crm_case(osv.osv):
if not case.email_from:
raise osv.except_osv(_('Error!'),
_('You must put a Partner eMail to use this action!'))
if not case.user_id:
raise osv.except_osv(_('Error!'),
_('You must define a responsible user for this case in order to use this action!'))
if not case.description:
raise osv.except_osv(_('Error!'),
_('Can not send mail with empty body,you should have description in the body'))
@ -721,6 +726,7 @@ class crm_case(osv.osv):
else:
raise osv.except_osv(_('Error !'), _('You can not escalate this case.\nYou are already at the top level.'))
self.write(cr, uid, ids, data)
cases = self.browse(cr, uid, ids)
self.__history(cr, uid, cases, _('Escalate'))
self._action(cr, uid, cases, 'escalate')
return True
@ -793,6 +799,14 @@ class crm_case_history(osv.osv):
_description = "Case history"
_order = "id desc"
_inherits = {'crm.case.log':"log_id"}
def create(self, cr, user, vals, context=None):
if vals.has_key('case_id') and vals['case_id']:
case_obj = self.pool.get('crm.case')
cases = case_obj.browse(cr, user, [vals['case_id']])
case_obj._action(cr, user, cases, '')
return super(crm_case_history, self).create(cr, user, vals, context)
def _note_get(self, cursor, user, ids, name, arg, context=None):
res = {}
for hist in self.browse(cursor, user, ids, context or {}):

View File

@ -40,7 +40,7 @@ class crm_segmentation(osv.osv):
'state': fields.selection([('not running','Not Running'),('running','Running')], 'Execution Status', readonly=True),
'partner_id': fields.integer('Max Partner ID processed'),
'segmentation_line': fields.one2many('crm.segmentation.line', 'segmentation_id', 'Criteria', required=True),
'som_interval': fields.integer('Days per Periode', help="A period is the average number of days between two cycle of sale or purchase for this segmentation. It's mainly used to detect if a partner has not purchased or buy for a too long time, so we suppose that his state of mind has decreased because he probably bought goods to another supplier. Use this functionnality for recurring businesses."),
'som_interval': fields.integer('Days per Periode', help="A period is the average number of days between two cycle of sale or purchase for this segmentation. It's mainly used to detect if a partner has not purchased or buy for a too long time, so we suppose that his state of mind has decreased because he probably bought goods to another supplier. Use this functionality for recurring businesses."),
'som_interval_max': fields.integer('Max Interval', help="The computation is made on all events that occured during this interval, the past X periods."),
'som_interval_decrease': fields.float('Decrease (0>1)', help="If the partner has not purchased (or buied) during a period, decrease the state of mind by this factor. It\'s a multiplication"),
'som_interval_default': fields.float('Default (0=None)', help="Default state of mind for period preceeding the 'Max Interval' computation. This is the starting state of mind by default if the partner has no event."),
@ -102,7 +102,7 @@ class crm_segmentation_line(osv.osv):
'expr_name': fields.selection([('sale','Sale Amount'),('som','State of Mind'),('purchase','Purchase Amount')], 'Control Variable', size=64, required=True),
'expr_operator': fields.selection([('<','<'),('=','='),('>','>')], 'Operator', required=True),
'expr_value': fields.float('Value', required=True),
'operator': fields.selection([('and','Mandatory Expression'),('or','Optional Expression')],'Mandatory / Optionnal', required=True),
'operator': fields.selection([('and','Mandatory Expression'),('or','Optional Expression')],'Mandatory / Optional', required=True),
}
_defaults = {
'expr_name': lambda *a: 'sale',

View File

@ -20,7 +20,7 @@
</field>
</record>
<!-- Case Sections -->
<!-- Case Sections -->
<record id="crm_case_section_view_form" model="ir.ui.view">
<field name="name">crm.case.section.form</field>
<field name="model">crm.case.section</field>
@ -100,7 +100,7 @@
</tree>
</field>
</record>
<record id="crm_case_categ-act" model="ir.actions.act_window">
<field name="name">Categories</field>
<field name="res_model">crm.case.categ</field>
@ -108,7 +108,7 @@
<field name="view_id" ref="crm_case_categ_tree-view"/>
</record>
<menuitem action="crm_case_categ-act" id="menu_crm_case_categ-act" parent="crm.next_id_51"/>
<!-- Case rules -->
<record id="crm_case_rule-view" model="ir.ui.view">
<field name="name">crm.case.rule.form</field>
@ -123,7 +123,7 @@
<separator colspan="4" string="Conditions on States"/>
<field name="trg_state_from" select="2"/>
<field name="trg_state_to" select="2"/>
<separator colspan="4" string="Conditions on Case Fields"/>
<field name="trg_section_id" select="1"/>
<field name="trg_categ_id"/>
@ -141,6 +141,8 @@
<field name="trg_date_range" nolabel="1"/>
<field name="trg_date_range_type" nolabel="1"/>
</group>
<separator colspan="4" string="Condition on Communication History"/>
<field name="trg_max_history"/>
<separator colspan="4" string="Note"/>
<label align="0.0" string="The rule use a AND operator. The case must match all non empty fields so that the rule execute the action described in the 'Actions' tab." colspan="4"/>
</page>
@ -200,8 +202,8 @@
<field name="view_id" ref="crm_case_rule_tree-view"/>
</record>
<menuitem action="crm_case_rule-act" id="menu_crm_case_rule-act" parent="crm.next_id_51"/>
<!-- Cases -->
<record id="crm_case_log_tree-view" model="ir.ui.view">
<field name="name">crm.case.log.tree</field>
@ -218,8 +220,8 @@
</tree>
</field>
</record>
<record id="crm_case_history_tree-view" model="ir.ui.view">
<field name="name">crm.case.history.tree</field>
<field name="model">crm.case.history</field>
@ -234,7 +236,7 @@
</tree>
</field>
</record>
<record id="crm_case_calendar-view" model="ir.ui.view">
<field name="name">crm.case.calendar</field>
<field name="model">crm.case</field>
@ -247,8 +249,8 @@
</calendar>
</field>
</record>
<record id="crm_case_tree-view" model="ir.ui.view">
<field name="name">crm.case.tree</field>
<field name="model">crm.case</field>
@ -268,7 +270,7 @@
</tree>
</field>
</record>
<record id="crm_case-view" model="ir.ui.view">
<field name="name">crm.case.form</field>
<field name="model">crm.case</field>
@ -292,7 +294,7 @@
<field name="user_id" select="1"/>
<button name="remind_user" states="open,pending" string="Send Reminder" type="object"/>
</group>
<separator colspan="4"/>
<field colspan="2" mode="tree,form" name="history_line" nolabel="1">
<form string="Communication history">
@ -315,7 +317,7 @@
<button name="case_log_reply" states="open" string="Send Partner &amp; Historize" type="object"/>
<button name="case_log" states="open" string="Historize" type="object"/>
</group>
<separator colspan="4"/>
<group col="8" colspan="4">
<field name="state" select="1"/>
@ -362,7 +364,7 @@
</form>
</field>
</record>
<record id="crm_case_categ0-act" model="ir.actions.act_window">
<field name="name">All Cases</field>
<field name="res_model">crm.case</field>
@ -370,7 +372,7 @@
<field name="view_id" ref="crm_case_tree-view"/>
</record>
<menuitem action="crm_case_categ0-act" id="menu_crm_case_categ0-act" parent="crm.next_id_52"/>
<record id="crm_case_categ0-act_open" model="ir.actions.act_window">
<field name="name">Open Cases</field>
<field name="res_model">crm.case</field>
@ -378,8 +380,8 @@
<field name="domain">[('state','&lt;&gt;','done'),('state','&lt;&gt;','cancel'),('state','&lt;&gt;','pending')]</field>
</record>
<menuitem action="crm_case_categ0-act_open" id="menu_crm_case_categ0-act_open" parent="crm.menu_crm_case_categ0-act"/>
<record id="crm_case_categ0-act_my" model="ir.actions.act_window">
<field name="name">My cases</field>
<field name="res_model">crm.case</field>
@ -396,10 +398,10 @@
<field name="domain">[('user_id','=',uid),('state','&lt;&gt;','done'),('state','&lt;&gt;','cancel'),('state','&lt;&gt;','pending')]</field>
</record>
<menuitem action="crm_case_categ0-act_my_open" id="menu_crm_case_categ0-act_my_open" parent="crm.menu_crm_case_categ0-act_my"/>
<record id="crm_case_section_open_act" model="ir.actions.act_window">
<field name="name">crm.case.section.open</field>
<field name="res_model">crm.case</field>
@ -414,8 +416,8 @@
<field eval="'ir.actions.act_window,%d'%crm_case_section_open_act" name="value"/>
<field eval="True" name="object"/>
</record>
<record id="crm_case_history-view" model="ir.ui.view">
<field name="name">crm.case.history.form</field>
<field name="model">crm.case.history</field>
@ -450,7 +452,7 @@
<field name="domain">[('user_id','=',uid)]</field>
</record>
<menuitem action="crm_case_history_my-act" id="menu_crm_case_history_my-act" parent="crm.menu_crm_case_history-act_main"/>
<record id="crm_segmentation_line_tree-view" model="ir.ui.view">
<field name="name">crm.segmentation.line.tree</field>
<field name="model">crm.segmentation.line</field>
@ -465,7 +467,7 @@
</tree>
</field>
</record>
<record id="crm_segmentation_line-view" model="ir.ui.view">
<field name="name">crm.segmentation.line.form</field>
<field name="model">crm.segmentation.line</field>
@ -483,7 +485,7 @@
</form>
</field>
</record>
<record id="crm_segmentation-view" model="ir.ui.view">
<field name="name">crm.segmentation.form</field>
<field name="model">crm.segmentation</field>
@ -532,14 +534,14 @@
</tree>
</field>
</record>
<record id="crm_segmentation-act" model="ir.actions.act_window">
<field name="name">Segmentations</field>
<field name="res_model">crm.segmentation</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_segmentation-view"/>
</record>
<record id="crm_segmentation_tree-act" model="ir.actions.act_window">
<field name="name">Segmentations</field>
<field name="res_model">crm.segmentation</field>
@ -547,17 +549,17 @@
<field name="view_mode">tree,form</field>
</record>
<menuitem id="next_id_53" name="Segmentations" parent="crm.menu_crm_configuration"/><menuitem action="crm_segmentation_tree-act" id="menu_crm_segmentation-act" parent="next_id_53"/>
<act_window domain="[('section_id', '=', active_id),('state','&lt;&gt;','done'),('state','&lt;&gt;','cancel'),('state','&lt;&gt;','pending')]" id="act_crm_case_section_crm_case_opened" name="Open cases" res_model="crm.case" src_model="crm.case.section" view_mode="tree,form,calendar" view_type="form"/>
<act_window domain="[('categ_id', '=', active_id),('state','&lt;&gt;','done'),('state','&lt;&gt;','cancel'),('state','&lt;&gt;','pending')]" id="act_crm_case_categ_crm_case_opened" name="Open cases" res_model="crm.case" src_model="crm.case.categ" view_mode="tree,form,calendar" view_type="form"/>
<act_window domain="[('partner_id', '=', active_id),('state','&lt;&gt;','done'),('state','&lt;&gt;','cancel'),('state','&lt;&gt;','pending')]" id="act_res_partner_2_crm_case_opened" name="Open cases" res_model="crm.case" src_model="res.partner" view_mode="tree,form,calendar" view_type="form"/>
<act_window domain="[('canal_id', '=', active_id),('state','&lt;&gt;','done'),('state','&lt;&gt;','cancel'),('state','&lt;&gt;','pending')]" id="act_res_partner_canal_2_crm_case_opened" name="Open cases" res_model="crm.case" src_model="res.partner.canal" view_mode="tree,form,calendar" view_type="form"/>
<act_window domain="[('user_id', '=', active_id),('state','&lt;&gt;','done'),('state','&lt;&gt;','cancel'),('state','&lt;&gt;','pending')]" id="act_res_users_2_crm_case_opened" name="Open cases" res_model="crm.case" src_model="res.users" view_mode="tree,form,calendar" view_type="form"/>
</data>
</openerp>

View File

@ -141,7 +141,9 @@ class email_parser(object):
message['attachment'] = {};
attachment = message['attachment'];
counter = 1;
def replace(match):
return ''
for part in msg.walk():
if part.get_content_maintype() == 'multipart':
continue
@ -149,7 +151,10 @@ class email_parser(object):
if part.get_content_maintype()=='text' and part.get_content_subtype() == 'plain':
buf = part.get_payload(decode=True)
if buf:
message['body'] += buf.decode(part.get_charsets()[0] or 'ascii', 'replace')
txt = buf.decode(part.get_charsets()[0] or 'ascii', 'replace')
txt = re.sub("<(\w)>", replace, txt)
txt = re.sub("<\/(\w)>", replace, txt)
message['body'] += txt
elif part.get_content_maintype()=='application' or part.get_content_maintype()=='image' or part.get_content_maintype()=='text':
filename = part.get_filename();
if filename :

View File

@ -23,3 +23,4 @@ import crm_config
import report
import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -260,7 +260,7 @@
<field name="view_mode">graph,tree</field>
<field name="domain" eval="'[(\'section_id\',\'=\','+str(section_support2)+')]'"/>
</record>
<menuitem parent="menu_action_report_crm_case_lead" name="Cases by Leads and Category2" action="action_report_crm_case_lead_categ" id="menu_action_report_crm_case_lead_categ"/>
<menuitem parent="menu_action_report_crm_case_lead" name="Cases by Leads and Type" action="action_report_crm_case_lead_categ" id="menu_action_report_crm_case_lead_categ"/>
<record model="ir.actions.act_window" id="action_report_crm_case_lead_stage">
<field name="res_model">report.crm.case.section.stage</field>
@ -284,7 +284,7 @@
<field name="view_mode">tree</field>
<field name="domain" eval="'[(\'section_id\',\'=\','+str(section_support2)+')]'"/>
</record>
<menuitem name="Cases by Section, Category and Category2" parent="menu_action_report_crm_case_lead" action="action_report_crm_case_lead_categ_categ2" id="menu_action_report_crm_case_lead_categ_categ2"/>
<menuitem name="Cases by Section, Category and Type" parent="menu_action_report_crm_case_lead" action="action_report_crm_case_lead_categ_categ2" id="menu_action_report_crm_case_lead_categ_categ2"/>
</data>

View File

@ -125,9 +125,9 @@
<field name="arch" type="xml">
<tree string="Leads Tree" colors="red:state=='open'">
<field name="id"/>
<field name="name" string="Name"/>
<field name="name" string="Lead Subject"/>
<field name="partner_phone"/>
<field name="partner_name2" string="Email"/>
<field name="partner_name2" string="Contact Name"/>
<field name="stage_id"/>
<field name="categ_id" string="Lead Source"/>
<field name="category2_id" string="Campaign Type"/>

View File

@ -271,7 +271,7 @@
<field name="view_mode">tree</field>
<field name="domain" eval="'[(\'section_id\',\'=\','+str(section_support3)+')]'"/>
</record>
<menuitem name="Cases by Opprtunities, Category and Stage" parent="menu_action_report_crm_case_oppor" action="action_report_crm_case_oppor_categ_stage" id="menu_action_report_crm_case_oppor_categ_stage"/>
<menuitem name="Cases by Opportunities, Category and Stage" parent="menu_action_report_crm_case_oppor" action="action_report_crm_case_oppor_categ_stage" id="menu_action_report_crm_case_oppor_categ_stage"/>
<record model="ir.actions.act_window" id="action_report_crm_case_oppor_categ_categ2">
<field name="res_model">report.crm.case.section.categ.categ2</field>
@ -279,7 +279,7 @@
<field name="view_mode">tree</field>
<field name="domain" eval="'[(\'section_id\',\'=\','+str(section_support3)+')]'"/>
</record>
<menuitem name="Cases by Opprtunities, Category and Type" parent="menu_action_report_crm_case_oppor" action="action_report_crm_case_oppor_categ_categ2" id="menu_action_report_crm_case_oppor_categ_categ2"/>
<menuitem name="Cases by Opportunities, Category and Type" parent="menu_action_report_crm_case_oppor" action="action_report_crm_case_oppor_categ_categ2" id="menu_action_report_crm_case_oppor_categ_categ2"/>
</data>

View File

@ -6,11 +6,11 @@
#
<record model="ir.ui.view" id="view_crm_case_section_categ_tree">
<field name="name">CRM Report - Sections and Category2(Tree)</field>
<field name="name">CRM Report - Sections and Type(Tree)</field>
<field name="model">report.crm.case.section.categ2</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Cases by Section and Category2">
<tree string="Cases by Section and Type">
<field name="name"/>
<field name="user_id"/>
<field name="section_id"/>
@ -24,7 +24,7 @@
</field>
</record>
<record model="ir.ui.view" id="view_crm_case_section_categ_form">
<field name="name">CRM Report - Sections and Category2(Form)</field>
<field name="name">CRM Report - Sections and Type(Form)</field>
<field name="model">report.crm.case.section.categ2</field>
<field name="type">form</field>
<field name="arch" type="xml">
@ -42,11 +42,11 @@
</field>
</record>
<record model="ir.ui.view" id="view_crm_case_section_categ_graph">
<field name="name">CRM Report - Sections and Category2(Graph)</field>
<field name="name">CRM Report - Sections and Type(Graph)</field>
<field name="model">report.crm.case.section.categ2</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Cases by Section and Category2" type="bar" orientation="horizontal">
<graph string="Cases by Section and Type" type="bar" orientation="horizontal">
<field name="category2_id"/>
<field name="amount_revenue" operator="+"/>
<field name="section_id" group="True"/>
@ -60,14 +60,14 @@
<field name="view_mode">graph,tree</field>
<field name="domain">[('name','=',time.strftime('%Y-%m-01'))]</field>
</record>
<menuitem parent="report_crm.next_id_65" name="Cases by Section and Category2" action="action_report_crm_case_section_categ_tree_month" id="menu_crm_case_section_categ_tree_month"/>
<menuitem parent="report_crm.next_id_65" name="Cases by Section and Type" action="action_report_crm_case_section_categ_tree_month" id="menu_crm_case_section_categ_tree_month"/>
<record model="ir.actions.act_window" id="action_report_crm_case_section_categ_tree">
<field name="res_model">report.crm.case.section.categ2</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
</record>
<menuitem parent="report_crm.next_id_66" name="Cases by Section and Category2" action="action_report_crm_case_section_categ_tree" id="menu_crm_case_section_categ_tree"/>
<menuitem parent="report_crm.next_id_66" name="Cases by Section and Type" action="action_report_crm_case_section_categ_tree" id="menu_crm_case_section_categ_tree"/>
#
# Cases by section and stage
@ -192,11 +192,11 @@
#
<record model="ir.ui.view" id="view_crm_case_section_categ_categ2_tree">
<field name="name">CRM Report - Section, Category and Category2(Tree)</field>
<field name="name">CRM Report - Section, Category and Type(Tree)</field>
<field name="model">report.crm.case.section.categ.categ2</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Cases by Section, Category and Category2">
<tree string="Cases by Section, Category and Type">
<field name="name"/>
<field name="user_id"/>
<field name="section_id"/>
@ -210,11 +210,11 @@
</field>
</record>
<record model="ir.ui.view" id="view_crm_case_section_categ_categ2_form">
<field name="name">CRM Report - Section, Category and Category2(Form)</field>
<field name="name">CRM Report - Section, Category and Type(Form)</field>
<field name="model">report.crm.case.section.categ.categ2</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Cases by Section, Category and Category2">
<form string="Cases by Section, Category and Type">
<field name="name"/>
<field name="user_id"/>
<field name="section_id" select="1"/>
@ -234,12 +234,12 @@
<field name="view_mode">tree</field>
<field name="domain">[('name','=',time.strftime('%Y-%m-01'))]</field>
</record>
<menuitem parent="report_crm.next_id_65" name="Cases by Section, Category and Category2" action="action_report_crm_case_section_categ_categ2_tree_month" id="menu_crm_case_section_categ_categ2_tree_month"/>
<menuitem parent="report_crm.next_id_65" name="Cases by Section, Category and Type" action="action_report_crm_case_section_categ_categ2_tree_month" id="menu_crm_case_section_categ_categ2_tree_month"/>
<record model="ir.actions.act_window" id="action_report_crm_case_section_categ_categ2_tree">
<field name="res_model">report.crm.case.section.categ.categ2</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
</record>
<menuitem parent="report_crm.next_id_66" name="Cases by Section, Category and Category2" action="action_report_crm_case_section_categ_categ2_tree" id="menu_crm_case_section_categ_categ2_tree"/>
<menuitem parent="report_crm.next_id_66" name="Cases by Section, Category and Type" action="action_report_crm_case_section_categ_categ2_tree" id="menu_crm_case_section_categ_categ2_tree"/>
</data>
</openerp>

View File

@ -23,3 +23,4 @@
import meeting_planify
import wizard_partner_create
import wizard_opportunity_set
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -73,3 +73,4 @@ class make_meeting(wizard.interface):
make_meeting('crm.case.meeting')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -26,6 +26,7 @@ import wizard
import netsvc
import ir
import pooler
from tools.translate import _
case_form = """<?xml version="1.0"?>
<form string="Convert To Opportunity">
@ -49,7 +50,7 @@ class make_opportunity(wizard.interface):
case_obj = pool.get('crm.case')
for case in case_obj.browse(cr, uid, data['ids']):
if not case.partner_id:
raise wizard.except_wizard("Warning !",
raise wizard.except_wizard(_('Warning !'),
_('You must assign a partner to this lead before converting to opportunity.\n' \
'You can use the convert to partner button.'))
return {'name': case.name, 'probability': case.probability or 20.0, 'planned_revenue':case.planned_revenue}
@ -60,7 +61,7 @@ class make_opportunity(wizard.interface):
data_obj = pool.get('ir.model.data')
id = section_obj.search(cr, uid, [('code','=','oppor')], context=context)
if not id:
raise wizard.except_wizard(_("Error !"),
raise wizard.except_wizard(_('Error !'),
_('You did not installed the opportunities tracking when you configured the crm_configuration module.' \
'\nI can not convert the lead to an opportunity, you must create a section with the code \'oppor\'.'
))
@ -106,3 +107,4 @@ class make_opportunity(wizard.interface):
make_opportunity('crm.case.opportunity_set')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

Some files were not shown because too many files have changed in this diff Show More