[IMP] change model name + clean up
bzr revid: rgaopenerp-20120806125332-y0bp5ojab6d72ksq
This commit is contained in:
parent
08fd6917b5
commit
89328b74ab
|
@ -38,6 +38,6 @@ import company
|
|||
import res_currency
|
||||
import edi
|
||||
import res_config
|
||||
import account_move_line_extended
|
||||
import account_move_reconciliation
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -66,7 +66,7 @@ financial year and for preparation of vouchers there is a module named account_v
|
|||
'wizard/account_period_close_view.xml',
|
||||
'wizard/account_reconcile_view.xml',
|
||||
'wizard/account_unreconcile_view.xml',
|
||||
'account_move_line_extended.xml',
|
||||
'account_move_reconciliation.xml',
|
||||
'account_view.xml',
|
||||
'account_report.xml',
|
||||
'account_financial_report_data.xml',
|
||||
|
|
|
@ -50,8 +50,8 @@ class account_move_line(osv.osv):
|
|||
account_move_line();
|
||||
|
||||
|
||||
class account_move_partner_info(osv.osv):
|
||||
_name = "account.move.partner.info"
|
||||
class account_move_reconciliation(osv.osv):
|
||||
_name = "account.move.reconciliation"
|
||||
_description = "All partner info related account move line"
|
||||
_auto = False
|
||||
|
||||
|
@ -72,7 +72,7 @@ class account_move_partner_info(osv.osv):
|
|||
return res_all
|
||||
|
||||
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
|
||||
ids = super(account_move_partner_info, self).search(cr, uid, args, offset, limit, order, context, count)
|
||||
ids = super(account_move_reconciliation, self).search(cr, uid, args, offset, limit, order, context, count)
|
||||
res = []
|
||||
for l in self.browse(cr, uid, ids, context=context):
|
||||
if (not l.partner_move_count) or (l.move_lines_count >l.partner_move_count):
|
||||
|
@ -93,17 +93,17 @@ class account_move_partner_info(osv.osv):
|
|||
res_partner.write(cr, uid, [line.id] ,{'partner_move_count':line.move_lines_count})
|
||||
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'account_move_partner_info')
|
||||
tools.drop_view_if_exists(cr, 'account_move_reconciliation')
|
||||
cr.execute("""
|
||||
create or replace view account_move_partner_info as (
|
||||
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(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
|
||||
FROM account_move_line as l INNER JOIN res_partner AS p ON (l.partner_id = p.id)
|
||||
group by p.id
|
||||
GROUP by p.id
|
||||
)
|
||||
""")
|
||||
account_move_partner_info()
|
||||
account_move_reconciliation()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -1,9 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_move_line_extended_form_view" model="ir.ui.view">
|
||||
<field name="name">account.move.partner.info.form</field>
|
||||
<field name="model">account.move.partner.info</field>
|
||||
<record id="view_account_move_reconciliation_form_view" model="ir.ui.view">
|
||||
<field name="name">account.move.reconciliation.form</field>
|
||||
<field name="model">account.move.reconciliation</field>
|
||||
<field name="type">form</field>
|
||||
<field eval="2" name="priority"/>
|
||||
<field name="arch" type="xml">
|
|
@ -1087,7 +1087,7 @@
|
|||
<field name="type">tree</field>
|
||||
<field eval="4" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<tree colors="red:state == 'draft';black:reconcile_id > 0" string="Journal Items" editable="top" on_write="on_create_write" default_selection="get_selection_ids">
|
||||
<tree colors="red:state == 'draft';black:state == 'valid'" string="Journal Items" editable="top" on_write="on_create_write" default_selection="get_unreconcile_entry">
|
||||
<field name="date"/>
|
||||
<field name="period_id" invisible="1"/>
|
||||
<field name="move_id"/>
|
||||
|
@ -1589,7 +1589,7 @@
|
|||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_move_line_tree"/>
|
||||
<field eval="False" name="auto_search"/>
|
||||
<field name="extended_form_view_id" ref="view_move_line_extended_form_view"/>
|
||||
<field name="extended_form_view_id" ref="view_account_move_reconciliation_form_view"/>
|
||||
<field name="context">{'view_mode':True}</field>
|
||||
</record>
|
||||
|
||||
|
@ -1599,7 +1599,7 @@
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field eval="False" name="auto_search"/>
|
||||
<field name="extended_form_view_id" ref="view_move_line_extended_form_view"/>
|
||||
<field name="extended_form_view_id" ref="view_account_move_reconciliation_form_view"/>
|
||||
<field name="domain">[('partner_id.customer','=',True)]</field>
|
||||
<field name="context">{'view_mode':True}</field>
|
||||
</record>
|
||||
|
@ -1610,7 +1610,7 @@
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field eval="False" name="auto_search"/>
|
||||
<field name="extended_form_view_id" ref="view_move_line_extended_form_view"/>
|
||||
<field name="extended_form_view_id" ref="view_account_move_reconciliation_form_view"/>
|
||||
<field name="domain">[('partner_id.supplier','=',True)]</field>
|
||||
<field name="context">{'view_mode':True}</field>
|
||||
</record>
|
||||
|
|
|
@ -55,7 +55,7 @@ instance.account.extend_viewmanager = instance.web.ViewManagerAction.extend({
|
|||
init: function(parent, action) {
|
||||
this._super.apply(this, arguments);
|
||||
//Fix me: pass hard coded model name, find the way to fetch it from server
|
||||
this.dataset_form = new instance.web.DataSetSearch(this, 'account.move.partner.info', action.context, action.domain);
|
||||
this.dataset_form = new instance.web.DataSetSearch(this, 'account.move.reconciliation', action.context, action.domain);
|
||||
},
|
||||
start : function(){
|
||||
this._super()
|
||||
|
|
|
@ -22,5 +22,6 @@
|
|||
import account_followup
|
||||
import wizard
|
||||
import report
|
||||
import account_move_reconciliation
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -58,6 +58,7 @@ entry, you can do from in the menu:
|
|||
'report/account_followup_report.xml',
|
||||
'account_followup_demo.xml', # Defined by default
|
||||
'account_followup_view.xml',
|
||||
'account_move_reconciliation.xml',
|
||||
'account_followup_data.xml',
|
||||
],
|
||||
'demo_xml': [],
|
||||
|
|
|
@ -76,31 +76,6 @@ class account_move_line(osv.osv):
|
|||
|
||||
account_move_line()
|
||||
|
||||
class account_move_partner_info(osv.osv):
|
||||
_inherit = 'account.move.partner.info'
|
||||
_columns = {
|
||||
'followup_date': fields.date('Latest Follow-up'),
|
||||
'max_followup_id':fields.many2one('account_followup.followup.line',
|
||||
'Max Follow Up Level' )
|
||||
}
|
||||
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'account_move_partner_info')
|
||||
cr.execute("""
|
||||
create or replace view account_move_partner_info 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
|
||||
)
|
||||
""")
|
||||
account_move_partner_info()
|
||||
|
||||
class res_company(osv.osv):
|
||||
_inherit = "res.company"
|
||||
_columns = {
|
||||
|
|
|
@ -132,19 +132,6 @@
|
|||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_move_line_form" model="ir.ui.view">
|
||||
<field name="name">account.move.partner.info.followup</field>
|
||||
<field name="model">account.move.partner.info</field>
|
||||
<field name="inherit_id" ref="account.view_move_line_extended_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="reconciliation_progress" position="after">
|
||||
<label for="followup_date"/>
|
||||
<field name="followup_date"/>
|
||||
<field name="max_followup_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_move_line_tree" model="ir.ui.view">
|
||||
<field name="name">account.move.line.tree.followup</field>
|
||||
|
|
Loading…
Reference in New Issue