[IMP] remove function field from account voucher and set search default on move line entry
bzr revid: rgaopenerp-20120822135904-y03fti3q0yooxnxu
This commit is contained in:
parent
b4a38f16ac
commit
b246b1955a
|
@ -1545,7 +1545,7 @@
|
|||
<field name="view_mode">tree,form</field>
|
||||
<field eval="False" name="auto_search"/>
|
||||
<field name="domain">[('partner_id.customer','=',True)]</field>
|
||||
<field name="context" eval="{'view_mode':True,'extended_form_view_id': ref('view_account_move_reconciliation_form_view')}"></field>
|
||||
<field name="context" eval="{'view_mode':True,'extended_form_view_id': ref('view_account_move_reconciliation_form_view'), 'search_default_unreconciled': 1}"></field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_payable_manual_reconcile" model="ir.actions.act_window">
|
||||
|
@ -1555,7 +1555,7 @@
|
|||
<field name="view_mode">tree,form</field>
|
||||
<field eval="False" name="auto_search"/>
|
||||
<field name="domain">[('partner_id.supplier','=',True)]</field>
|
||||
<field name="context" eval="{'view_mode':True,'extended_form_view_id': ref('view_account_move_reconciliation_form_view')}"></field>
|
||||
<field name="context" eval="{'view_mode':True,'extended_form_view_id': ref('view_account_move_reconciliation_form_view'), 'search_default_unreconciled': 1}"></field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
|
|
|
@ -1553,16 +1553,7 @@ class account_bank_statement_line(osv.osv):
|
|||
else:
|
||||
res[line.id] = 0.0
|
||||
return res
|
||||
|
||||
def _is_reconciled(self, cr, uid, ids, name, args, context=None):
|
||||
res = {}
|
||||
for line in self.browse(cr, uid, ids, context=context):
|
||||
if line.voucher_id and line.voucher_id.state == 'posted':
|
||||
res[line.id] = True
|
||||
else:
|
||||
res[line.id] = False
|
||||
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:
|
||||
|
@ -1576,8 +1567,11 @@ class account_bank_statement_line(osv.osv):
|
|||
]
|
||||
|
||||
_columns = {
|
||||
'is_reconciled': fields.function(_is_reconciled,
|
||||
string='Statement is reconciled?', type='boolean'),
|
||||
'voucher_state': fields.related('voucher_id', 'state', type="selection", selection= [('draft','Draft'),
|
||||
('cancel','Cancelled'),
|
||||
('proforma','Pro-forma'),
|
||||
('posted','Posted')
|
||||
], string='Voucher State'),
|
||||
'amount_reconciled': fields.function(_amount_reconciled,
|
||||
string='Amount reconciled', type='float'),
|
||||
'voucher_id': fields.many2one('account.voucher', 'Payment'),
|
||||
|
|
|
@ -217,8 +217,8 @@
|
|||
<button type="button" class="oe_mail_button_follow oe_mail_button_mouseout">Reconcile</button>
|
||||
<button type="button" class="oe_mail_button_unfollow oe_mail_button_mouseout">Unreconcile</button>
|
||||
-->
|
||||
<button class="reconcile_btn" attrs="{'readonly':[('is_reconciled','=',True)]}" name="action_payment_reconcile" string="Reconcile" type="object"/>
|
||||
<field name="is_reconciled" invisible="1"/>
|
||||
<button class="reconcile_btn" attrs="{'readonly':[('voucher_state','=','posted')]}" name="action_payment_reconcile" string="Reconcile" type="object"/>
|
||||
<field name="voucher_state" invisible="1"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
|
Loading…
Reference in New Issue