[FIX] account_payment: Clean module
bzr revid: mra@tinyerp.com-20100604091645-jtxbzpk022r2ef2j
This commit is contained in:
@@ -58,16 +58,16 @@ class payment_order_create(osv.osv_memory):
|
||||
def create_payment(self, cr, uid, ids, context=None):
|
||||
order_obj = self.pool.get('payment.order')
|
||||
line_obj = self.pool.get('account.move.line')
|
||||
|
||||
data = self.read(cr, uid, ids, [], context)[0]
|
||||
line_ids= data['entries']
|
||||
payment_obj = self.pool.get('payment.line')
|
||||
if context is None:
|
||||
context = {}
|
||||
data = self.read(cr, uid, ids, [])[0]
|
||||
line_ids = data['entries']
|
||||
if not line_ids: return {}
|
||||
|
||||
payment = order_obj.browse(cr, uid, data['active_id'],
|
||||
context=context)
|
||||
payment = order_obj.browse(cr, uid, context['active_id'], context=context)
|
||||
t = payment.mode and payment.mode.type.id or None
|
||||
line2bank = pool.get('account.move.line').line2bank(cr, uid,
|
||||
line_ids, t, context)
|
||||
line2bank = line_obj.line2bank(cr, uid, line_ids, t, context)
|
||||
|
||||
## Finally populate the current payment with new lines:
|
||||
for line in line_obj.browse(cr, uid, line_ids, context=context):
|
||||
@@ -78,7 +78,7 @@ class payment_order_create(osv.osv_memory):
|
||||
date_to_pay = line.date_maturity
|
||||
elif payment.date_prefered == 'fixed':
|
||||
date_to_pay = payment.date_planned
|
||||
pool.get('payment.line').create(cr, uid,{
|
||||
payment_obj.create(cr, uid,{
|
||||
'move_line_id': line.id,
|
||||
'amount_currency': line.amount_to_pay,
|
||||
'bank_id': line2bank.get(line.id),
|
||||
@@ -88,13 +88,14 @@ class payment_order_create(osv.osv_memory):
|
||||
'date': date_to_pay,
|
||||
'currency': line.invoice and line.invoice.currency_id.id or False,
|
||||
}, context=context)
|
||||
return {}
|
||||
return {'nodestroy':True,}
|
||||
|
||||
def search_entries(self, cr, uid, ids, context=None):
|
||||
order_obj = self.pool.get('payment.order')
|
||||
line_obj = self.pool.get('account.move.line')
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
|
||||
if context is None:
|
||||
context = {}
|
||||
data = self.read(cr, uid, ids, [], context=context)[0]
|
||||
search_due_date = data['duedate']
|
||||
payment = order_obj.browse(cr, uid, context['active_id'], context=context)
|
||||
|
||||
@@ -7,12 +7,14 @@
|
||||
<field name="model">account.payment.make.payment</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Make Payment">
|
||||
<label string ="Are you sure you want to make payment?" />
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="launch_wizard" string="Print" type="object" icon="gtk-print" default_focus="1"/>
|
||||
<form string="Make Payment">
|
||||
<group height="80" width="320">
|
||||
<separator string="Are you sure you want to make payment?"/>
|
||||
<newline/>
|
||||
<group colspan="2" col="4">
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="launch_wizard" string="Yes" type="object" icon="gtk-ok" default_focus="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user