[fix] inheretied view of account followup
bzr revid: rgaopenerp-20120809091747-46o45ssfkmoh9shf
This commit is contained in:
@@ -12,16 +12,14 @@ class account_move_reconciliation(osv.osv):
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'account_move_reconciliation')
|
||||
cr.execute("""
|
||||
CREATE or REPLACE VIEW account_move_reconciliation as (
|
||||
SELECT p.id, p.id as partner_id,
|
||||
MAX(p.last_reconciliation_date) as last_reconciliation_date,
|
||||
MAX(l.date) as latest_date,
|
||||
COUNT(l.id) as move_lines_count,
|
||||
MAX(p.partner_move_count) as partner_move_count,
|
||||
MAX(l.followup_date) as followup_date,
|
||||
MAX(l.followup_line_id) as max_followup_id
|
||||
FROM account_move_line as l INNER JOIN res_partner AS p ON (l.partner_id = p.id)
|
||||
GROUP by p.id
|
||||
CREATE or REPLACE VIEW account_move_reconciliation as (
|
||||
SELECT move_line.partner_id as id, move_line.partner_id,
|
||||
MAX(move_line.date) as latest_date,
|
||||
MAX(move_line.followup_date) as followup_date,
|
||||
MAX(move_line.followup_line_id) as max_followup_id,
|
||||
(select count(unreconcile.id) from account_move_line as unreconcile where unreconcile.reconcile_id is null and unreconcile.partner_id = move_line.partner_id) as unreconcile_count
|
||||
FROM account_move_line as move_line where move_line.state <> 'draft'
|
||||
GROUP by move_line.partner_id
|
||||
)
|
||||
""")
|
||||
account_move_reconciliation()
|
||||
Reference in New Issue
Block a user