Better relates:
Partner to all entries Partner to reconciled entries Account to entries Reconciliation to entries Better wizards for (un)reconcile bzr revid: fp@tinyerp.com-b78a872a8522cfa9c20172a179f8ca2644f485e0
This commit is contained in:
parent
bfdf9b77b9
commit
b425a26fd1
|
@ -260,6 +260,14 @@ class account_account(osv.osv):
|
|||
|
||||
def name_search(self, cr, user, name, args=[], operator='ilike', context={}):
|
||||
ids = []
|
||||
try:
|
||||
if name and str(name).startswith('partner:'):
|
||||
part_id = int(name.split(':')[1])
|
||||
part = self.pool.get('res.partner').browse(cr, user, part_id, context)
|
||||
args += [('id','in', (part.property_account_payable[0],part.property_account_receivable[0]))]
|
||||
name = False
|
||||
except:
|
||||
pass
|
||||
if name:
|
||||
ids = self.search(cr, user, [('code','=like',name+"%")]+ args)
|
||||
if not ids:
|
||||
|
|
|
@ -1037,7 +1037,22 @@
|
|||
type="wizard"
|
||||
/>
|
||||
|
||||
<act_window name="Entries"
|
||||
domain="[('account_id', '=', active_id)]"
|
||||
res_model="account.move.line"
|
||||
src_model="account.account"
|
||||
id="act_account_acount_move_line_open"/>
|
||||
<act_window name="Unreconciled entries"
|
||||
domain="[('account_id', '=', active_id),('reconcile_id','=',False)]"
|
||||
res_model="account.move.line"
|
||||
src_model="account.account"
|
||||
id="act_account_acount_move_line_open_unreconciled"/>
|
||||
|
||||
<act_window name="Reconciled entries"
|
||||
domain="[('reconcile_id', '=', active_id)]"
|
||||
res_model="account.move.line"
|
||||
src_model="account.move.reconcile"
|
||||
id="act_account_acount_move_line_reconcile_open"/>
|
||||
|
||||
<menuitem name="Financial Management/Reporting" sequence="8"/>
|
||||
|
||||
|
@ -1509,11 +1524,25 @@
|
|||
src_model="account.journal"
|
||||
id="act_account_journal_2_account_move_line"/>
|
||||
|
||||
<act_window name="Account entries"
|
||||
domain="[('journal_id', '=', active_id)]"
|
||||
res_model="account.move"
|
||||
src_model="account.journal"
|
||||
id="act_account_journal_2_account_move"/>
|
||||
<act_window name="Unreconciled account entries"
|
||||
domain="[('partner_id', '=', active_id),('account_id','=','partner:'+str(active_id)),('reconcile_id','=',False)]"
|
||||
res_model="account.move.line"
|
||||
src_model="res.partner"
|
||||
id="act_account_partner_account_move_unreconciled"/>
|
||||
|
||||
<act_window name="All account entries"
|
||||
domain="[('partner_id', '=', active_id)]"
|
||||
res_model="account.move.line"
|
||||
src_model="res.partner"
|
||||
id="act_account_partner_account_move"/>
|
||||
|
||||
<act_window name="Statement entries"
|
||||
domain="[('statement_id', '=', active_id)]"
|
||||
res_model="account.move.line"
|
||||
src_model="account.bank.statement"
|
||||
id="act_account_bank_statement_account_move_unreconciled"/>
|
||||
|
||||
|
||||
|
||||
</data>
|
||||
</terp>
|
||||
|
|
|
@ -60,6 +60,13 @@
|
|||
name="account.move.line.reconcile"
|
||||
id="wizard_reconcile"/>
|
||||
|
||||
<wizard
|
||||
string="Unreconcile Entries"
|
||||
model="account.move.reconcile"
|
||||
name="account.reconcile.unreconcile"
|
||||
id="wizard_reconcile_unreconcile"/>
|
||||
|
||||
|
||||
<wizard
|
||||
string="Reconcile Entries"
|
||||
model="account.move.line"
|
||||
|
|
|
@ -46,3 +46,20 @@ class wiz_unreconcile(wizard.interface):
|
|||
}
|
||||
wiz_unreconcile('account.move.line.unreconcile')
|
||||
|
||||
|
||||
def _trans_unrec_reconcile(self, cr, uid, data, context):
|
||||
rec_ids = data['ids']
|
||||
if len(rec_ids):
|
||||
cr.execute('update account_move_line set state=\'valid\' where reconcile_id in ('+','.join(map(str,rec_ids))+')')
|
||||
pooler.get_pool(cr.dbname).get('account.move.reconcile').unlink(cr, uid, rec_ids)
|
||||
return {}
|
||||
|
||||
class wiz_unreconcile_reconcile(wizard.interface):
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [_trans_unrec_reconcile],
|
||||
'result': {'type': 'state', 'state':'end'}
|
||||
}
|
||||
}
|
||||
wiz_unreconcile_reconcile('account.reconcile.unreconcile')
|
||||
|
||||
|
|
Loading…
Reference in New Issue