[IMP, MERGE] merge with mdi branch
bzr revid: psi@tinyerp.com-20120504094028-mg0dusamo6trdrf3
This commit is contained in:
commit
d2b906f8d0
|
@ -467,14 +467,17 @@ class account_invoice(osv.osv):
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def onchange_payment_term_date_invoice(self, cr, uid, ids, payment_term_id, date_invoice):
|
def onchange_payment_term_date_invoice(self, cr, uid, ids, payment_term_id, date_invoice):
|
||||||
if not payment_term_id:
|
|
||||||
return {}
|
|
||||||
res = {}
|
res = {}
|
||||||
pt_obj = self.pool.get('account.payment.term')
|
if not payment_term_id:
|
||||||
|
if date_invoice:
|
||||||
|
res = {'value':{'date_due': date_invoice}}
|
||||||
|
else:
|
||||||
|
res = {'value':{'date_due': time.strftime('%Y-%m-%d')}}
|
||||||
|
return res
|
||||||
if not date_invoice:
|
if not date_invoice:
|
||||||
date_invoice = time.strftime('%Y-%m-%d')
|
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 = self.pool.get('account.payment.term').compute(cr, uid, payment_term_id, value=1, date_ref=date_invoice)
|
||||||
|
|
||||||
if pterm_list:
|
if pterm_list:
|
||||||
pterm_list = [line[0] for line in pterm_list]
|
pterm_list = [line[0] for line in pterm_list]
|
||||||
|
|
|
@ -39,10 +39,10 @@ class res_company(osv.osv):
|
||||||
|
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'expects_chart_of_accounts': True,
|
'expects_chart_of_accounts': True,
|
||||||
'overdue_msg': '''Our records indicate that the following payments are still due. If the amount
|
'overdue_msg': '''Our records indicate that the payments on your account are still due. Please find details below.
|
||||||
has already been paid, please disregard this notice. However, if you have any
|
If the amount has already been paid, please disregard this notice. Otherwise, please forward us
|
||||||
queries regarding your account, please contact us.
|
the total amount stated below. If you have any queries regarding your account, Please contact us.
|
||||||
Thank you in advance.
|
\nThank you in advance for your cooperation.
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -153,25 +153,26 @@
|
||||||
<para style="terp_default_9">
|
<para style="terp_default_9">
|
||||||
<font color="white"> </font>
|
<font color="white"> </font>
|
||||||
</para>
|
</para>
|
||||||
<para style="terp_default_9">Dear Sir/Madam,</para>
|
<para style="terp_default_9">[[ not getLines(o) and removeParentNode('para') or 'Dear Sir/Madam,']]</para>
|
||||||
<para style="terp_default_9">
|
<para style="terp_default_9">
|
||||||
<font color="white"> </font>
|
<font color="white"> </font>
|
||||||
</para>
|
</para>
|
||||||
|
<para style="terp_default_9">[[ not getLines(o) and removeParentNode('para') or message(o, company) ]]</para>
|
||||||
<para style="terp_default_9">
|
<para style="terp_default_9">
|
||||||
<font color="white"> </font>
|
<font color="white"> </font>
|
||||||
</para>
|
</para>
|
||||||
<para style="terp_default_9">[[ message(o, company) ]]</para>
|
<para style="terp_default_Bold_9">[[ getLines(o) and removeParentNode('para') or 'There is nothing due with this customer.']]</para>
|
||||||
<para style="terp_default_9">
|
<para style="terp_default_9">
|
||||||
<font color="white"> </font>
|
<font color="white"> </font>
|
||||||
</para>
|
</para>
|
||||||
<para style="terp_default_9">Best regards.</para>
|
<para style="terp_default_9">[[ not getLines(o) and removeParentNode('para') or 'Best regards.']]</para>
|
||||||
<para style="terp_default_9">
|
<para style="terp_default_9">
|
||||||
<font color="white"> </font>
|
<font color="white"> </font>
|
||||||
</para>
|
</para>
|
||||||
<blockTable colWidths="57.0,136.0,51.0,72.0,54.0,56.0,66.0,18.0" style="Table1">
|
<blockTable colWidths="56.0,136.0,51.0,72.0,54.0,56.0,66.0,18.0" style="Table1">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<para style="terp_tblheader_Details">Date</para>
|
<para style="terp_tblheader_Details">Date[[ not getLines(o) and removeParentNode('blockTable') ]]</para>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<para style="terp_tblheader_Details">Description</para>
|
<para style="terp_tblheader_Details">Description</para>
|
||||||
|
@ -198,7 +199,7 @@
|
||||||
</blockTable>
|
</blockTable>
|
||||||
<section>
|
<section>
|
||||||
<para style="terp_default_8">[[repeatIn(getLines(o), 'line') ]]</para>
|
<para style="terp_default_8">[[repeatIn(getLines(o), 'line') ]]</para>
|
||||||
<blockTable colWidths="57.0,136.0,52.0,71.0,55.0,56.0,66.0,17.0" style="Table3">
|
<blockTable colWidths="56.0,136.0,52.0,71.0,55.0,56.0,66.0,17.0" style="Table3">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<para style="terp_default_9">[[ formatLang(line['date'],date=True) ]]</para>
|
<para style="terp_default_9">[[ formatLang(line['date'],date=True) ]]</para>
|
||||||
|
@ -219,7 +220,7 @@
|
||||||
<para style="terp_default_Right_9">[[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]]</para>
|
<para style="terp_default_Right_9">[[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]]</para>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<para style="terp_default_Right_9">[[ time.strftime('%Y-%m-%d') > formatLang((line['date_maturity'])) and formatLang(line['debit'] - line['credit']) ]] [[ company.currency_id.symbol ]] </para>
|
<para style="terp_default_Right_9">[[ time.strftime('%Y-%m-%d') > formatLang((line['date_maturity'])) and formatLang(line['debit'] - line['credit']) ]] [[ company.currency_id.symbol ]]</para>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<para style="terp_default_Centre_9">[[ line['blocked'] and 'X' or '' ]]</para>
|
<para style="terp_default_Centre_9">[[ line['blocked'] and 'X' or '' ]]</para>
|
||||||
|
@ -227,7 +228,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
</blockTable>
|
</blockTable>
|
||||||
</section>
|
</section>
|
||||||
<blockTable colWidths="245.0,71.0,56.0,56.0,66.0,17.0" style="Table2">
|
<blockTable colWidths="244.0,71.0,56.0,56.0,66.0,17.0" style="Table2">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<para style="terp_default_8">
|
<para style="terp_default_8">
|
||||||
|
@ -235,7 +236,7 @@
|
||||||
</para>
|
</para>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<para style="terp_default_Bold_9">Sub-Total : </para>
|
<para style="terp_default_Bold_9">[[ not getLines(o) and removeParentNode('blockTable') or 'Sub-Total :']]</para>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]] </para>
|
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]] </para>
|
||||||
|
@ -244,7 +245,7 @@
|
||||||
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['credit'] or 0) or (y['account_id']['type'] == 'payable' and y['debit'] * -1 or 0)), getLines(o), 0))) ]] </para>
|
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['credit'] or 0) or (y['account_id']['type'] == 'payable' and y['debit'] * -1 or 0)), getLines(o), 0))) ]] </para>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0)), currency_obj=company.currency_id) ]]</para>
|
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0))) ]] [[ company.currency_id.symbol ]]</para>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<para style="terp_default_9">
|
<para style="terp_default_9">
|
||||||
|
@ -261,10 +262,10 @@
|
||||||
</para>
|
</para>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<para style="terp_default_Bold_9">Balance : </para>
|
<para style="terp_default_Bold_9">[[ not getLines(o) and removeParentNode('blockTable') or 'Balance :']]</para>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<para style="terp_tblheader_Details_Right">[[ formatLang((reduce(lambda x, y: x +(y['debit'] - y['credit']), getLines(o), 0)), currency_obj=company.currency_id) ]]</para>
|
<para style="terp_tblheader_Details_Right">[[ formatLang((reduce(lambda x, y: x +(y['debit'] - y['credit']), getLines(o), 0))) ]] [[ company.currency_id.symbol ]]</para>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<para style="terp_default_8">
|
<para style="terp_default_8">
|
||||||
|
@ -279,7 +280,7 @@
|
||||||
<para style="terp_default_9">
|
<para style="terp_default_9">
|
||||||
<font color="white"> </font>
|
<font color="white"> </font>
|
||||||
</para>
|
</para>
|
||||||
<para style="terp_default_9">Total amount due: [[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), getLines(o), 0)), currency_obj=company.currency_id) ]].</para>
|
<para style="terp_default_9">Total amount due: [[ not getLines(o) and removeParentNode('blockTable') or formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), getLines(o), 0)), currency_obj=company.currency_id) ]].</para>
|
||||||
<para style="terp_default_8">
|
<para style="terp_default_8">
|
||||||
<font color="white"> </font>
|
<font color="white"> </font>
|
||||||
</para>
|
</para>
|
||||||
|
|
Loading…
Reference in New Issue