[MERGE] Account, voucher, Payment: misc changes from pad

bzr revid: mra@mra-laptop-20101210052757-7hqsuabf9112o4i0
This commit is contained in:
Mustufa Rangwala
2010-12-10 10:57:57 +05:30
4 changed files with 18 additions and 6 deletions
+1 -1
View File
@@ -2445,7 +2445,7 @@
<attribute name='string'></attribute>
</xpath>
<group string="res_config_contents" position="replace">
<field name="company_id" widget="selection"/>
<field name="company_id" widget="selection" groups="base.group_extended"/>
<field name ="code_digits" groups="base.group_extended"/>
<field name="chart_template_id" widget="selection" on_change="onchange_chart_template_id(chart_template_id)"/>
<field name ="seq_journal" groups="base.group_extended"/>
@@ -37,10 +37,12 @@ class account_payment_populate_statement(osv.osv_memory):
res = super(account_payment_populate_statement, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False)
line_ids = line_obj.search(cr, uid, [
('move_line_id.reconcile_id', '=', False),
('bank_statement_line_id', '=', False),])
('bank_statement_line_id', '=', False),
('move_line_id.state','=','valid')])
line_ids.extend(line_obj.search(cr, uid, [
('move_line_id.reconcile_id', '=', False),
('order_id.mode', '=', False)]))
('order_id.mode', '=', False),
('move_line_id.state','=','valid')]))
domain = '[("id", "in", '+ str(line_ids)+')]'
doc = etree.XML(res['arch'])
nodes = doc.xpath("//field[@name='lines']")
+12 -2
View File
@@ -841,7 +841,6 @@ class account_voucher_line(osv.osv):
_defaults = {
'name': ''
}
def onchange_move_line_id(self, cr, user, ids, move_line_id, context={}):
"""
Returns a dict that contains new values and context
@@ -964,6 +963,17 @@ class account_bank_statement_line(osv.osv):
res[line.id] = 0.0
return res
def _check_amount(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):
if obj.voucher_id:
if not (obj.amount == obj.voucher_id.amount):
return False
return True
_constraints = [
(_check_amount, 'The amount of the voucher must be the same amount as the one on the statement line', ['amount']),
]
_columns = {
'amount_reconciled': fields.function(_amount_reconciled,
string='Amount reconciled', method=True, type='float'),
@@ -983,4 +993,4 @@ class account_bank_statement_line(osv.osv):
account_bank_statement_line()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -38,7 +38,7 @@
<form string="Import Entries">
<group colspan="4" expand="1">
<separator string="Payable and Receivables" colspan="4"/>
<field height="300" width="700" name="line_ids" colspan="4" nolabel="1" domain="[('account_id.type','in',['receivable','payable']),('reconcile_id','=',False), ('reconcile_partial_id','=',False)]"/>
<field height="300" width="700" name="line_ids" colspan="4" nolabel="1" domain="[('account_id.type','in',['receivable','payable']),('reconcile_id','=',False), ('reconcile_partial_id','=',False), ('state', '=', 'valid')]"/>
</group>
<group colspan="4" col="6">
<label string ="" colspan="2"/>