[IMP] Account correct entries analysis, other misc changes
bzr revid: mra@mra-laptop-20100814103045-m7tkki6fjl843ft1
This commit is contained in:
parent
bb58b65d0d
commit
4d44919026
|
@ -647,7 +647,7 @@ class account_journal(osv.osv):
|
|||
'user_id': lambda self,cr,uid,context: uid,
|
||||
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
|
||||
}
|
||||
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
obj=[]
|
||||
if 'company_id' in vals:
|
||||
|
@ -673,21 +673,21 @@ class account_journal(osv.osv):
|
|||
'purchase_refund':'seq_out_refund',
|
||||
'sale_refund':'seq_in_refund'
|
||||
}
|
||||
|
||||
|
||||
seq_pool = self.pool.get('ir.sequence')
|
||||
seq_typ_pool = self.pool.get('ir.sequence.type')
|
||||
date_pool = self.pool.get('ir.model.data')
|
||||
|
||||
|
||||
result = True
|
||||
|
||||
|
||||
journal = self.browse(cr, uid, ids[0], context)
|
||||
code = journal.code.lower()
|
||||
code = journal.code.lower()
|
||||
types = {
|
||||
'name':journal.name,
|
||||
'code':code
|
||||
}
|
||||
type_id = seq_typ_pool.create(cr, uid, types)
|
||||
|
||||
|
||||
seq = {
|
||||
'name':journal.name,
|
||||
'code':code,
|
||||
|
@ -697,7 +697,7 @@ class account_journal(osv.osv):
|
|||
'number_increment':1
|
||||
}
|
||||
seq_id = seq_pool.create(cr, uid, seq)
|
||||
|
||||
|
||||
res = {}
|
||||
if not journal.sequence_id:
|
||||
res.update({
|
||||
|
@ -711,11 +711,11 @@ class account_journal(osv.osv):
|
|||
res.update({
|
||||
'invoice_sequence_id':inv_seq_id
|
||||
})
|
||||
|
||||
|
||||
result = self.write(cr, uid, [journal.id], res)
|
||||
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def create(self, cr, uid, vals, context={}):
|
||||
journal_id = super(account_journal, self).create(cr, uid, vals, context)
|
||||
self.create_sequence(cr, uid, [journal_id], context)
|
||||
|
@ -738,7 +738,7 @@ class account_journal(osv.osv):
|
|||
|
||||
if context.get('journal_type', False):
|
||||
args += [('type','=',context.get('journal_type'))]
|
||||
|
||||
|
||||
if name:
|
||||
ids = self.search(cr, user, [('code','ilike',name)]+ args, limit=limit, context=context)
|
||||
if not ids:
|
||||
|
@ -749,7 +749,7 @@ class account_journal(osv.osv):
|
|||
def onchange_type(self, cr, uid, ids, type, currency):
|
||||
data_pool = self.pool.get('ir.model.data')
|
||||
user_pool = self.pool.get('res.users')
|
||||
|
||||
|
||||
type_map = {
|
||||
'sale':'account_sp_journal_view',
|
||||
'sale_refund':'account_sp_refund_journal_view',
|
||||
|
@ -761,23 +761,23 @@ class account_journal(osv.osv):
|
|||
'general':'account_journal_view',
|
||||
'situation':'account_journal_view'
|
||||
}
|
||||
|
||||
|
||||
res = {}
|
||||
|
||||
|
||||
view_id = type_map.get(type, 'general')
|
||||
|
||||
|
||||
user = user_pool.browse(cr, uid, uid)
|
||||
if type in ('cash', 'bank') and currency and user.company_id.currency_id.id != currency:
|
||||
view_id = 'account_journal_bank_view_multi'
|
||||
|
||||
|
||||
data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=',view_id)])
|
||||
data = data_pool.browse(cr, uid, data_id[0])
|
||||
|
||||
|
||||
res.update({
|
||||
'centralisation':type == 'situation',
|
||||
'view_id':data.res_id,
|
||||
})
|
||||
|
||||
|
||||
return {
|
||||
'value':res
|
||||
}
|
||||
|
@ -1035,31 +1035,31 @@ class account_move(osv.osv):
|
|||
"""
|
||||
Returns a list of tupples containing id, name, as internally it is called {def name_get}
|
||||
result format : {[(id, name), (id, name), ...]}
|
||||
|
||||
|
||||
@param cr: A database cursor
|
||||
@param user: ID of the user currently logged in
|
||||
@param name: name to search
|
||||
@param name: name to search
|
||||
@param args: other arguments
|
||||
@param operator: default operator is 'ilike', it can be changed
|
||||
@param context: context arguments, like lang, time zone
|
||||
@param limit: Returns first 'n' ids of complete result, default is 80.
|
||||
|
||||
|
||||
@return: Returns a list of tupples containing id and name
|
||||
"""
|
||||
|
||||
|
||||
if not args:
|
||||
args=[]
|
||||
if not context:
|
||||
context={}
|
||||
ids = []
|
||||
|
||||
|
||||
if name:
|
||||
ids += self.search(cr, user, [('name','=',name)], limit=limit)
|
||||
if not ids:
|
||||
ids += self.search(cr, user, [('id','=',name)], limit=limit)
|
||||
|
||||
|
||||
return self.name_get(cr, user, ids, context=context)
|
||||
|
||||
|
||||
def name_get(self, cursor, user, ids, context=None):
|
||||
if not len(ids):
|
||||
return []
|
||||
|
@ -1159,7 +1159,7 @@ class account_move(osv.osv):
|
|||
'You cannot create entries on different periods/journals in the same move',
|
||||
['line_id']),
|
||||
]
|
||||
|
||||
|
||||
def post(self, cr, uid, ids, context=None):
|
||||
if self.validate(cr, uid, ids, context) and len(ids):
|
||||
for move in self.browse(cr, uid, ids):
|
||||
|
@ -1218,7 +1218,7 @@ class account_move(osv.osv):
|
|||
'balance':False,
|
||||
'account_tax_id':False,
|
||||
})
|
||||
|
||||
|
||||
if 'journal_id' in vals and vals.get('journal_id', False):
|
||||
for l in vals['line_id']:
|
||||
if not l[0]:
|
||||
|
@ -1667,15 +1667,15 @@ class account_tax(osv.osv):
|
|||
"""
|
||||
Returns a list of tupples containing id, name, as internally it is called {def name_get}
|
||||
result format : {[(id, name), (id, name), ...]}
|
||||
|
||||
|
||||
@param cr: A database cursor
|
||||
@param user: ID of the user currently logged in
|
||||
@param name: name to search
|
||||
@param name: name to search
|
||||
@param args: other arguments
|
||||
@param operator: default operator is 'ilike', it can be changed
|
||||
@param context: context arguments, like lang, time zone
|
||||
@param limit: Returns first 'n' ids of complete result, default is 80.
|
||||
|
||||
|
||||
@return: Returns a list of tupples containing id and name
|
||||
"""
|
||||
if not args:
|
||||
|
@ -1685,10 +1685,10 @@ class account_tax(osv.osv):
|
|||
ids = []
|
||||
ids = self.search(cr, user, args, limit=limit, context=context)
|
||||
return self.name_get(cr, user, ids, context=context)
|
||||
|
||||
|
||||
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
|
||||
journal_pool = self.pool.get('account.journal')
|
||||
|
||||
|
||||
if context and context.has_key('type'):
|
||||
if context.get('type') in ('out_invoice','out_refund'):
|
||||
args += [('type_tax_use','in',['sale','all'])]
|
||||
|
@ -1699,7 +1699,7 @@ class account_tax(osv.osv):
|
|||
journal = journal_pool.browse(cr, uid, context.get('journal_id'))
|
||||
if journal.type in ('sale', 'purchase'):
|
||||
args += [('type_tax_use','in',[journal.type,'all'])]
|
||||
|
||||
|
||||
return super(account_tax, self).search(cr, uid, args, offset, limit, order, context, count)
|
||||
|
||||
def name_get(self, cr, uid, ids, context={}):
|
||||
|
@ -1716,7 +1716,7 @@ class account_tax(osv.osv):
|
|||
if user.company_id:
|
||||
return user.company_id.id
|
||||
return self.pool.get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
|
||||
|
||||
|
||||
_defaults = {
|
||||
'python_compute': lambda *a: '''# price_unit\n# address : res.partner.address object or False\n# product : product.product object or None\n# partner : res.partner object or None\n\nresult = price_unit * 0.10''',
|
||||
'python_compute_inv': lambda *a: '''# price_unit\n# address : res.partner.address object or False\n# product : product.product object or False\n\nresult = price_unit * 0.10''',
|
||||
|
@ -1836,11 +1836,11 @@ class account_tax(osv.osv):
|
|||
tin = self.compute_inv(cr, uid, tin, price_unit, quantity, address_id=address_id, product=product, partner=partner)
|
||||
for r in tin:
|
||||
totalex -= r['amount']
|
||||
totlex_qty=0.0
|
||||
totlex_qty=0.0
|
||||
try:
|
||||
totlex_qty=totalex/quantity
|
||||
except:
|
||||
pass
|
||||
pass
|
||||
tex = self._compute(cr, uid, tex, totlex_qty, quantity, address_id=address_id, product=product, partner=partner)
|
||||
for r in tex:
|
||||
totalin += r['amount']
|
||||
|
@ -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()
|
||||
|
||||
|
@ -2623,7 +2623,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
|||
data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_sp_journal_view')])
|
||||
data = data_pool.browse(cr, uid, data_id[0])
|
||||
view_id = data.res_id
|
||||
|
||||
|
||||
seq_id = obj_sequence.search(cr, uid, [('name','=','Account Journal')])[0]
|
||||
|
||||
if obj_multi.seq_journal:
|
||||
|
@ -2664,7 +2664,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
|||
data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_journal_bank_view')])
|
||||
data = data_pool.browse(cr, uid, data_id[0])
|
||||
view_id_cash = data.res_id
|
||||
|
||||
|
||||
data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_journal_bank_view_multi')])
|
||||
data = data_pool.browse(cr, uid, data_id[0])
|
||||
ref_acc_bank = data.res_id
|
||||
|
@ -2739,7 +2739,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
|||
'fields_id': field[0],
|
||||
'value': account and 'account.account,'+str(acc_template_ref[account.id]) or False,
|
||||
}
|
||||
|
||||
|
||||
if r:
|
||||
#the property exist: modify it
|
||||
property_obj.write(cr, uid, r, vals)
|
||||
|
@ -2776,7 +2776,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
|||
'position_id' : new_fp,
|
||||
}
|
||||
obj_ac_fp.create(cr, uid, vals_acc)
|
||||
|
||||
|
||||
#fially inactive the demo chart of accounts
|
||||
data_id = data_pool.search(cr, uid, [('model','=','account.account'), ('name','=','chart0')])
|
||||
if data_id:
|
||||
|
|
|
@ -855,8 +855,8 @@ class account_move_line(osv.osv):
|
|||
journal_list = journal_pool.name_search(cr, uid, '', [], context=context)
|
||||
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