bug fix on account_payment
bzr revid: mra@tinyerp.com-20081104123547-orzs8stmnesalnzi
This commit is contained in:
parent
601c4118dd
commit
4926e9a9d0
|
@ -1,7 +1,7 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
|
@ -400,7 +400,7 @@ class payment_line(osv.osv):
|
|||
method=True, type='date',help="Invoice Effective Date"),
|
||||
# 'reference': fields.function(select_by_name, string="Ref", method=True,
|
||||
# type='char'),
|
||||
'ml_maturity_date': fields.function(_get_ml_maturity_date, method=True, type='char', string='Maturity Date'),
|
||||
'ml_maturity_date': fields.function(_get_ml_maturity_date, method=True, type='date', string='Maturity Date'),
|
||||
'ml_inv_ref': fields.function(_get_ml_inv_ref, method=True, type='many2one', relation='account.invoice', string='Invoice Ref'),
|
||||
'info_owner': fields.function(info_owner, string="Owner Account", method=True, type="text",help='Address of the Main Partner'),
|
||||
'info_partner': fields.function(info_partner, string="Destination Account", method=True, type="text",help='Address of the Ordering Customer.'),
|
||||
|
|
|
@ -17,47 +17,17 @@
|
|||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#000000" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#000000" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#000000" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#000000" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#000000" start="4,0" stop="4,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#000000" start="4,0" stop="4,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
|
||||
<blockBackground colorName="#e6e6e6" start="0,0" stop="0,-1"/>
|
||||
<blockBackground colorName="#e6e6e6" start="1,0" stop="1,-1"/>
|
||||
<blockBackground colorName="#e6e6e6" start="2,0" stop="2,-1"/>
|
||||
<blockBackground colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<blockBackground colorName="#e6e6e6" start="4,0" stop="4,-1"/>
|
||||
<lineStyle kind="GRID" colorName="black"/>
|
||||
<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"/>
|
||||
<blockBackground colorName="#e6e6e6" start="3,0" stop="3,0"/>
|
||||
<blockBackground colorName="#e6e6e6" start="4,0" stop="4,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#000000" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#000000" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#000000" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#000000" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#000000" start="4,0" stop="4,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#000000" start="4,0" stop="4,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="GRID" colorName="black"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
|
@ -77,7 +47,6 @@
|
|||
<paraStyle name="Table Contents" fontName="Times-Roman"/>
|
||||
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER"/>
|
||||
</stylesheet>
|
||||
<images/>
|
||||
<story>
|
||||
<para style="Standard">[[ repeatIn(objects, 'o') ]]</para>
|
||||
<para style="Standard">
|
||||
|
@ -115,7 +84,7 @@
|
|||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="83.0,98.0,190.0,71.0,85.0" style="Table2">
|
||||
<blockTable colWidths="83.0,98.0,190.0,70.0,85.0" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P4">Partner</para>
|
||||
|
@ -134,7 +103,7 @@
|
|||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="83.0,98.0,190.0,71.0,85.0" style="Table1">
|
||||
<blockTable colWidths="83.0,98.0,190.0,70.0,85.0" style="Table1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="Table Contents">[[repeatIn(o.line_ids, 'line') ]]</para>
|
||||
|
@ -144,13 +113,13 @@
|
|||
<para style="Table Contents">[[ line.bank_id and line.bank_id.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="Table Contents">[[ line.reference ]]</para>
|
||||
<para style="Table Contents">[[ line.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2">[[ formatLang(line.value_date, date=True) ]]</para>
|
||||
<para style="P2">[[ line.date ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">[[ formatLang(line.to_pay_currency) ]] [[ line.currency.name ]]</para>
|
||||
<para style="P3">[[ formatLang(line.amount_currency) ]] [[ line.currency.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
|
@ -42,7 +42,7 @@ arch_duedate='''<?xml version="1.0"?>
|
|||
|
||||
def search_entries(self, cr, uid, data, context):
|
||||
search_due_date=data['form']['duedate']
|
||||
|
||||
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
order_obj = pool.get('payment.order')
|
||||
line_obj = pool.get('account.move.line')
|
||||
|
@ -54,14 +54,9 @@ def search_entries(self, cr, uid, data, context):
|
|||
ctx = '''context="{'journal_id': %d}"''' % payment.mode.journal.id
|
||||
|
||||
# Search for move line to pay:
|
||||
line_ids = line_obj.search(cr, uid, [
|
||||
('reconcile_id', '=', False),
|
||||
('account_id.type', '=', 'payable'),
|
||||
('amount_to_pay', '>', 0),
|
||||
('date_maturity','<=',search_due_date)
|
||||
], context=context)
|
||||
|
||||
|
||||
domain = [('reconcile_id', '=', False),('account_id.type', '=', 'payable'),('amount_to_pay', '>', 0)]
|
||||
domain = domain + ['|',('date_maturity','<',search_due_date),('date_maturity','=',False)]
|
||||
line_ids = line_obj.search(cr, uid, domain, context=context)
|
||||
FORM.string = '''<?xml version="1.0"?>
|
||||
<form string="Populate Payment:">
|
||||
<field name="entries" colspan="4" height="300" width="800" nolabel="1"
|
||||
|
@ -115,7 +110,7 @@ class wizard_payment_order(wizard.interface):
|
|||
If a type is given, unsuitable account move lines are ignored.
|
||||
"""
|
||||
states = {
|
||||
|
||||
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {
|
||||
|
@ -128,7 +123,7 @@ class wizard_payment_order(wizard.interface):
|
|||
]
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
'search': {
|
||||
'actions': [search_entries],
|
||||
'result': {
|
||||
|
|
Loading…
Reference in New Issue