[IMP] Account correct entries analysis, other misc changes
bzr revid: mra@mra-laptop-20100814103045-m7tkki6fjl843ft1
This commit is contained in:
parent
bb58b65d0d
commit
4d44919026
|
@ -2146,11 +2146,10 @@ class account_subscription_line(osv.osv):
|
|||
'date': fields.date('Date', required=True),
|
||||
'move_id': fields.many2one('account.move', 'Entry'),
|
||||
}
|
||||
_defaults = {
|
||||
}
|
||||
def move_create(self, cr, uid, ids, context={}):
|
||||
|
||||
def move_create(self, cr, uid, ids, context=None):
|
||||
tocheck = {}
|
||||
for line in self.browse(cr, uid, ids, context):
|
||||
for line in self.browse(cr, uid, ids, context=context):
|
||||
datas = {
|
||||
'date': line.date,
|
||||
}
|
||||
|
@ -2159,7 +2158,8 @@ class account_subscription_line(osv.osv):
|
|||
self.write(cr, uid, [line.id], {'move_id':ids[0]})
|
||||
if tocheck:
|
||||
self.pool.get('account.subscription').check(cr, uid, tocheck.keys(), context)
|
||||
return True
|
||||
return ids
|
||||
|
||||
_rec_name = 'date'
|
||||
account_subscription_line()
|
||||
|
||||
|
|
|
@ -856,7 +856,7 @@ class account_move_line(osv.osv):
|
|||
result['fields']['journal_id']['selection'] = journal_list
|
||||
return result
|
||||
|
||||
if not context.get('view_mode', False):
|
||||
if context.get('view_mode', False):
|
||||
return result
|
||||
|
||||
fld = []
|
||||
|
|
|
@ -898,9 +898,9 @@
|
|||
<field name="analytic_account_id"/>
|
||||
<field name="amount_currency" groups="base.group_extended"/>
|
||||
<field name="currency_id" groups="base.group_extended"/>
|
||||
<field name="state"/>
|
||||
<field name="reconcile_id"/>
|
||||
<field name="reconcile_partial_id" groups="base.group_extended"/>
|
||||
<field name="reconcile_id"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -1094,7 +1094,6 @@
|
|||
<field name="res_model">account.move.line</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_move_line_tree"/>
|
||||
<field name="search_view_id" ref="view_account_move_line_filter"/>
|
||||
</record>
|
||||
|
||||
|
@ -1518,15 +1517,16 @@
|
|||
<!-- <wizard id="action_account_bank_reconcile_tree" menu="False" model="account.move.line" name="account.move.bank.reconcile" string="Bank reconciliation"/> -->
|
||||
<!-- <menuitem action="action_account_bank_reconcile_tree" id="menu_action_account_bank_reconcile_check_tree" parent="account.next_id_30" type="wizard"/> -->
|
||||
|
||||
<!-- bank reconsilation -->
|
||||
<menuitem action="action_account_bank_reconcile_tree"
|
||||
id="menu_action_account_bank_reconcile_check_tree"
|
||||
parent="periodical_processing_reconciliation" groups="group_account_user" />
|
||||
<!-- bank reconciliation -->
|
||||
<!-- <menuitem action="action_account_bank_reconcile_tree"-->
|
||||
<!-- id="menu_action_account_bank_reconcile_check_tree"-->
|
||||
<!-- parent="periodical_processing_reconciliation" groups="group_account_user" />-->
|
||||
|
||||
<act_window
|
||||
context="{'search_default_next_partner':1}"
|
||||
context="{'search_default_next_partner':1,'view_mode':True}"
|
||||
id="action_account_manual_reconcile" name="Entry Lines"
|
||||
res_model="account.move.line"
|
||||
view_id="view_move_line_tree"/>
|
||||
/>
|
||||
|
||||
<menuitem
|
||||
|
@ -1581,7 +1581,7 @@
|
|||
<field name="view_type">tree</field>
|
||||
<field name="help">You can look up individual account entries by searching for useful information. To search for account entries, open a journal, then select a record line.</field>
|
||||
</record>
|
||||
<menuitem action="action_account_journal_period_tree" id="menu_action_account_journal_period_tree" parent="account.menu_finance_generic_reporting" sequence="2"/>
|
||||
<!-- <menuitem action="action_account_journal_period_tree" id="menu_action_account_journal_period_tree" parent="account.menu_finance_generic_reporting" sequence="2"/>-->
|
||||
|
||||
|
||||
<!--
|
||||
|
@ -1833,7 +1833,7 @@
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<menuitem action="action_subscription_form" id="menu_action_subscription_form" sequence="5" parent="account.menu_configuration_misc"/>
|
||||
<menuitem name="Define Recurring Entries" action="action_subscription_form" id="menu_action_subscription_form" sequence="1" parent="account.menu_finance_recurrent_entries"/>
|
||||
|
||||
<record id="action_subscription_form_running" model="ir.actions.act_window">
|
||||
<field name="name">Running Subscriptions</field>
|
||||
|
|
|
@ -145,7 +145,7 @@
|
|||
<menuitem icon="STOCK_INDENT" action="wizard_analytic_account_chart" id="menu_action_analytic_account_tree2" parent="account.menu_finance_charts" type="wizard"/>-->
|
||||
|
||||
<menuitem id="next_id_40" name="Analytic" parent="account.menu_finance_generic_reporting" sequence="4"/>
|
||||
<menuitem action="action_account_analytic_account_tree2" id="account_analytic_chart_balance" parent="next_id_40"/>
|
||||
<!-- <menuitem action="action_account_analytic_account_tree2" id="account_analytic_chart_balance" parent="next_id_40"/>-->
|
||||
|
||||
<record id="view_account_analytic_line_form" model="ir.ui.view">
|
||||
<field name="name">account.analytic.line.form</field>
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
<field name="search_view_id" ref="view_account_account_report_search"/>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_account_account_report" id="menu_action_account_account_report" parent="account.menu_finance_statistic_report_statement" sequence="6"/>
|
||||
<!-- <menuitem action="action_account_account_report" id="menu_action_account_account_report" parent="account.menu_finance_statistic_report_statement" sequence="6"/>-->
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
<field name="context">{'search_default_This Month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
<field name="search_view_id" ref="view_analytic_report_search"/>
|
||||
</record>
|
||||
<menuitem action="action_analytic_report_all" id="menu_action_analytic_report_all" parent="account.menu_finance_statistic_report_statement" sequence="8"/>
|
||||
<!-- <menuitem action="action_analytic_report_all" id="menu_action_analytic_report_all" parent="account.menu_finance_statistic_report_statement" sequence="8"/>-->
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -51,6 +51,7 @@ class account_entries_report(osv.osv):
|
|||
help='When new account move is created the state will be \'Draft\'. When all the payments are done it will be in \'Posted\' state.'),
|
||||
'state_2': fields.selection([('draft','Draft'), ('valid','Valid')], 'State of Move Line', readonly=True,
|
||||
help='When new move line is created the state will be \'Draft\'.\n* When all the payments are done it will be in \'Valid\' state.'),
|
||||
'reconcile_id': fields.many2one('account.move.reconcile', readonly=True),
|
||||
'partner_id': fields.many2one('res.partner','Partner', readonly=True),
|
||||
'analytic_account_id' : fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
|
||||
'quantity': fields.float('Products Quantity', digits=(16,2), readonly=True),
|
||||
|
@ -81,6 +82,7 @@ class account_entries_report(osv.osv):
|
|||
am.ref as ref,
|
||||
am.state as state,
|
||||
l.state as state_2,
|
||||
l.reconcile_id as reconcile_id,
|
||||
to_char(am.date, 'YYYY') as year,
|
||||
to_char(am.date, 'MM') as month,
|
||||
to_char(am.date, 'YYYY-MM-DD') as day,
|
||||
|
@ -104,6 +106,7 @@ class account_entries_report(osv.osv):
|
|||
left join account_account a on (l.account_id = a.id)
|
||||
left join account_move am on (am.id=l.move_id)
|
||||
left join account_period p on (am.period_id=p.id)
|
||||
where l.state != 'draft'
|
||||
)
|
||||
""")
|
||||
account_entries_report()
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
<field name="credit"/>
|
||||
<field name="balance"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="state_2" invisible="1"/>
|
||||
<field name="day" invisible="1"/>
|
||||
<field name="month" invisible="1"/>
|
||||
<field name="year" invisible="1"/>
|
||||
|
@ -26,7 +25,6 @@
|
|||
<field name="company_id" invisible="1" groups="base.group_multi_company"/>
|
||||
<field name="journal_id" invisible="1"/>
|
||||
<field name="account_id" invisible="1"/>
|
||||
<field name="analytic_account_id" invisible="1"/>
|
||||
<field name="fiscalyear_id" invisible="1"/>
|
||||
<field name="period_id" invisible="1"/>
|
||||
<field name="user_type" invisible="1"/>
|
||||
|
@ -54,23 +52,24 @@
|
|||
<field name="arch" type="xml">
|
||||
<search string="Entries Analysis">
|
||||
<group colspan="10" col="12">
|
||||
<filter icon="terp-go-year" string="This Year"
|
||||
<filter icon="terp-go-year" string="Year"
|
||||
name="year"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Tasks performed in this year"/>
|
||||
<filter icon="terp-go-month" string="This Month"
|
||||
name="month"
|
||||
help="Entries created in this year"/>
|
||||
<filter icon="terp-go-month" string="Period"
|
||||
name="period"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Tasks performed in this month"/>
|
||||
<filter icon="terp-go-week"
|
||||
string="7 Days"
|
||||
separator="1"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Tasks during last 7 days"/>
|
||||
help="Entries created in this period"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Draft" icon="terp-document-new" domain="[('state','=','draft')]" help = "Draft entries"/>
|
||||
<filter string="Posted" icon="terp-camera_test" domain="[('state','=','posted')]" help = "Posted entries"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Reconciled" icon="terp-document-new" domain="[('reconcile_id','!=',False)]" help = "Reconciled entries"/>
|
||||
<filter string="Unreconciled" icon="terp-stock_symbol-selection" domain="[('reconcile_id','=',False)]" help = "Unreconciled entries"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="account_id"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="period_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By...">
|
||||
|
@ -89,9 +88,6 @@
|
|||
<filter string="Fiscal Year" icon="terp-go-month" context="{'group_by':'fiscalyear_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Analytic Account" name="Analytic Account" icon="terp-folder-green" context="{'group_by':'analytic_account_id'}"/>
|
||||
<filter string="State of Move Line" icon="terp-stock_effects-object-colorize" context="{'group_by':'state_2'}"/>
|
||||
<newline/>
|
||||
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
|
||||
|
@ -103,7 +99,6 @@
|
|||
<field name="period_id"/>
|
||||
<field name="fiscalyear_id"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="analytic_account_id"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="product_id"/>
|
||||
<field name="partner_id"/>
|
||||
|
@ -122,7 +117,7 @@
|
|||
<field name="res_model">account.entries.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
<field name="context">{'search_default_profit': 1,'search_default_group_account':1,'search_default_group_month': 1, 'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
<field name="context">{'search_default_profit': 1,'search_default_group_account':1,'search_default_group_journal':1,'search_default_group_month': 1, 'group_by_no_leaf':1,'group_by':[], 'search_default_year':1, 'search_default_period':1}</field>
|
||||
<field name="help">A tool search lets you know statistics on your different financial accounts that match your needs.</field>
|
||||
</record>
|
||||
<menuitem action="action_account_entries_report_all" id="menu_action_account_entries_report_all" parent="account.menu_finance_statistic_report_statement" sequence="2"/>
|
||||
|
|
|
@ -87,7 +87,7 @@ class account_move_journal(osv.osv_memory):
|
|||
|
||||
view = """<?xml version="1.0" encoding="utf-8"?>
|
||||
<form string="Standard entries">
|
||||
<separator string="Open a Journal Items !" colspan="4"/>
|
||||
<separator string="Open Journal Items !" colspan="4"/>
|
||||
<group colspan="4" >
|
||||
<label width="300" string="Journal : %s"/>
|
||||
<newline/>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<field name="res_model">account.move.journal</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_account_move_journal_form"/>
|
||||
<field name="context">{'journal_type':'sale','view_mode':True}</field>
|
||||
<field name="context">{'journal_type':'sale','view_mode':False}</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
<menuitem action="action_account_moves_sale" sequence="4" id="menu_eaction_account_moves_sale" parent="menu_finance_receivables" icon="STOCK_JUSTIFY_FILL"/>
|
||||
|
@ -38,7 +38,7 @@
|
|||
<field name="res_model">account.move.journal</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_account_move_journal_form"/>
|
||||
<field name="context">{'journal_type':'purchase','view_mode':True}</field>
|
||||
<field name="context">{'journal_type':'purchase','view_mode':False}</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
<menuitem action="action_account_moves_purchase" sequence="4" id="menu_eaction_account_moves_purchase" parent="menu_finance_payables" icon="STOCK_JUSTIFY_FILL"/>
|
||||
|
@ -58,7 +58,7 @@
|
|||
<field name="res_model">account.move.journal</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_account_move_journal_form"/>
|
||||
<field name="context">{'journal_type':'bank','view_mode':True}</field>
|
||||
<field name="context">{'journal_type':'bank','view_mode':False}</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
|
||||
from osv import fields, osv
|
||||
|
@ -33,11 +34,20 @@ class account_subscription_generate(osv.osv_memory):
|
|||
'date': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
}
|
||||
def action_generate(self, cr, uid, ids, context={}):
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
act_obj = self.pool.get('ir.actions.act_window')
|
||||
moves_created=[]
|
||||
for data in self.read(cr, uid, ids, context=context):
|
||||
cr.execute('select id from account_subscription_line where date<%s and move_id is null', (data['date'],))
|
||||
ids = map(lambda x: x[0], cr.fetchall())
|
||||
self.pool.get('account.subscription.line').move_create(cr, uid, ids, context=context)
|
||||
return {}
|
||||
moves = self.pool.get('account.subscription.line').move_create(cr, uid, ids, context=context)
|
||||
moves_created.extend(moves)
|
||||
result = mod_obj._get_id(cr, uid, 'account', 'action_move_line_form')
|
||||
id = mod_obj.read(cr, uid, [result], ['res_id'], context=context)[0]['res_id']
|
||||
result = act_obj.read(cr, uid, [id], context=context)[0]
|
||||
result['domain'] = str([('id','in',moves_created)])
|
||||
return result
|
||||
|
||||
account_subscription_generate()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -16,7 +16,7 @@
|
|||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel" />
|
||||
<button icon="gtk-execute" string="Compute Entry Dates"
|
||||
<button icon="gtk-execute" string="Generate Entries"
|
||||
name="action_generate" type="object" />
|
||||
</group>
|
||||
</form>
|
||||
|
@ -32,7 +32,7 @@
|
|||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_account_subscription_generate" id="menu_generate_subscription" parent="account.menu_finance_recurrent_entries" />
|
||||
<menuitem sequence="3" action="action_account_subscription_generate" id="menu_generate_subscription" parent="account.menu_finance_recurrent_entries" />
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
Loading…
Reference in New Issue