[Merge]with: lp:openobject-addons
bzr revid: dbr@tinyerp.com-20110921104455-yg1j8lu1yfoufeel
This commit is contained in:
@@ -98,6 +98,7 @@ module named account_voucher.
|
||||
'wizard/account_reconcile_view.xml',
|
||||
'wizard/account_reconcile_partner_process_view.xml',
|
||||
'wizard/account_automatic_reconcile_view.xml',
|
||||
'wizard/account_financial_report_view.xml',
|
||||
'project/wizard/project_account_analytic_line_view.xml',
|
||||
'account_end_fy.xml',
|
||||
'account_invoice_view.xml',
|
||||
|
||||
+121
-24
@@ -431,9 +431,16 @@ class account_account(osv.osv):
|
||||
return False
|
||||
return True
|
||||
|
||||
def _check_account_type(self, cr, uid, ids, context=None):
|
||||
for account in self.browse(cr, uid, ids, context=context):
|
||||
if account.type in ('receivable', 'payable') and account.user_type.close_method != 'unreconciled':
|
||||
return False
|
||||
return True
|
||||
|
||||
_constraints = [
|
||||
(_check_recursion, 'Error ! You can not create recursive accounts.', ['parent_id']),
|
||||
(_check_type, 'Configuration Error! \nYou cannot define children to an account with internal type different of "View"! ', ['type']),
|
||||
(_check_type, 'Configuration Error! \nYou can not define children to an account with internal type different of "View"! ', ['type']),
|
||||
(_check_account_type, 'Configuration Error! \nYou can not select an account type with a deferral method different of "Unreconciled" for accounts with internal type "Payable/Receivable"! ', ['user_type','type']),
|
||||
]
|
||||
_sql_constraints = [
|
||||
('code_company_uniq', 'unique (code,company_id)', 'The code of the account must be unique per company !')
|
||||
@@ -509,14 +516,14 @@ class account_account(osv.osv):
|
||||
|
||||
if line_obj.search(cr, uid, [('account_id', 'in', account_ids)]):
|
||||
if method == 'write':
|
||||
raise osv.except_osv(_('Error !'), _('You cannot deactivate an account that contains account moves.'))
|
||||
raise osv.except_osv(_('Error !'), _('You can not desactivate an account that contains some journal items.'))
|
||||
elif method == 'unlink':
|
||||
raise osv.except_osv(_('Error !'), _('You cannot remove an account which has account entries!. '))
|
||||
raise osv.except_osv(_('Error !'), _('You can not remove an account containing journal items!. '))
|
||||
#Checking whether the account is set as a property to any Partner or not
|
||||
value = 'account.account,' + str(ids[0])
|
||||
partner_prop_acc = self.pool.get('ir.property').search(cr, uid, [('value_reference','=',value)], context=context)
|
||||
if partner_prop_acc:
|
||||
raise osv.except_osv(_('Warning !'), _('You cannot remove/deactivate an account which is set as a property to any Partner.'))
|
||||
raise osv.except_osv(_('Warning !'), _('You can not remove/desactivate an account which is set on a customer or supplier.'))
|
||||
return True
|
||||
|
||||
def _check_allow_type_change(self, cr, uid, ids, new_type, context=None):
|
||||
@@ -529,15 +536,20 @@ class account_account(osv.osv):
|
||||
if line_obj.search(cr, uid, [('account_id', 'in', account_ids)]):
|
||||
#Check for 'Closed' type
|
||||
if old_type == 'closed' and new_type !='closed':
|
||||
raise osv.except_osv(_('Warning !'), _("You cannot change the type of account from 'Closed' to any other type which contains account entries!"))
|
||||
raise osv.except_osv(_('Warning !'), _("You cannot change the type of account from 'Closed' to any other type which contains journal items!"))
|
||||
#Check for change From group1 to group2 and vice versa
|
||||
if (old_type in group1 and new_type in group2) or (old_type in group2 and new_type in group1):
|
||||
raise osv.except_osv(_('Warning !'), _("You cannot change the type of account from '%s' to '%s' type as it contains account entries!") % (old_type,new_type,))
|
||||
raise osv.except_osv(_('Warning !'), _("You cannot change the type of account from '%s' to '%s' type as it contains journal items!") % (old_type,new_type,))
|
||||
return True
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
|
||||
if context is None:
|
||||
context = {}
|
||||
if not ids:
|
||||
return True
|
||||
if isinstance(ids, (int, long)):
|
||||
ids = [ids]
|
||||
|
||||
# Dont allow changing the company_id when account_move_line already exist
|
||||
if 'company_id' in vals:
|
||||
@@ -650,11 +662,13 @@ class account_journal(osv.osv):
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
if isinstance(ids, (int, long)):
|
||||
ids = [ids]
|
||||
for journal in self.browse(cr, uid, ids, context=context):
|
||||
if 'company_id' in vals and journal.company_id.id != vals['company_id']:
|
||||
move_lines = self.pool.get('account.move.line').search(cr, uid, [('journal_id', 'in', ids)])
|
||||
if move_lines:
|
||||
raise osv.except_osv(_('Warning !'), _('You cannot modify company of this journal as its related record exist in Entry Lines'))
|
||||
raise osv.except_osv(_('Warning !'), _('You can not modify the company of this journal as its related record exist in journal items'))
|
||||
return super(account_journal, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
def create_sequence(self, cr, uid, vals, context=None):
|
||||
@@ -800,8 +814,8 @@ class account_fiscalyear(osv.osv):
|
||||
return True
|
||||
|
||||
_constraints = [
|
||||
(_check_duration, 'Error! The duration of the Fiscal Year is invalid. ', ['date_stop']),
|
||||
(_check_fiscal_year, 'Error! You cannot define overlapping fiscal years',['date_start', 'date_stop'])
|
||||
(_check_duration, 'Error! The start date of the fiscal year must be before his end date.', ['date_start','date_stop']),
|
||||
(_check_fiscal_year, 'Error! You can not define overlapping fiscal years for the same company.',['date_start', 'date_stop'])
|
||||
]
|
||||
|
||||
def create_period3(self, cr, uid, ids, context=None):
|
||||
@@ -879,7 +893,10 @@ class account_period(osv.osv):
|
||||
'state': 'draft',
|
||||
}
|
||||
_order = "date_start, special desc"
|
||||
|
||||
_sql_constraints = [
|
||||
('name_company_uniq', 'unique(name, company_id)', 'The name of the period must be unique per company!'),
|
||||
]
|
||||
|
||||
def _check_duration(self,cr,uid,ids,context=None):
|
||||
obj_period = self.browse(cr, uid, ids[0], context=context)
|
||||
if obj_period.date_stop < obj_period.date_start:
|
||||
@@ -952,7 +969,7 @@ class account_period(osv.osv):
|
||||
if 'company_id' in vals:
|
||||
move_lines = self.pool.get('account.move.line').search(cr, uid, [('period_id', 'in', ids)])
|
||||
if move_lines:
|
||||
raise osv.except_osv(_('Warning !'), _('You cannot modify company of this period as its related record exist in Entry Lines'))
|
||||
raise osv.except_osv(_('Warning !'), _('You can not modify company of this period as some journal items exists.'))
|
||||
return super(account_period, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
def build_ctx_periods(self, cr, uid, period_from_id, period_to_id):
|
||||
@@ -1180,10 +1197,10 @@ class account_move(osv.osv):
|
||||
|
||||
_constraints = [
|
||||
(_check_centralisation,
|
||||
'You cannot create more than one move per period on centralized journal',
|
||||
'You can not create more than one move per period on centralized journal',
|
||||
['journal_id']),
|
||||
(_check_period_journal,
|
||||
'You cannot create entries on different periods/journals in the same move',
|
||||
'You can not create journal items on different periods/journals in the same journal entry',
|
||||
['line_id']),
|
||||
]
|
||||
|
||||
@@ -1194,7 +1211,7 @@ class account_move(osv.osv):
|
||||
valid_moves = self.validate(cr, uid, ids, context)
|
||||
|
||||
if not valid_moves:
|
||||
raise osv.except_osv(_('Integrity Error !'), _('You cannot validate a non-balanced entry !\nMake sure you have configured Payment Term properly !\nIt should contain atleast one Payment Term Line with type "Balance" !'))
|
||||
raise osv.except_osv(_('Integrity Error !'), _('You can not validate a non-balanced entry !\nMake sure you have configured payment terms properly !\nThe latest payment term line should be of the type "Balance" !'))
|
||||
obj_sequence = self.pool.get('ir.sequence')
|
||||
for move in self.browse(cr, uid, valid_moves, context=context):
|
||||
if move.name =='/':
|
||||
@@ -1230,7 +1247,7 @@ class account_move(osv.osv):
|
||||
if not top:
|
||||
top = account2.id
|
||||
elif top<>account2.id:
|
||||
raise osv.except_osv(_('Error !'), _('You cannot validate a Journal Entry unless all journal items are in same chart of accounts !'))
|
||||
raise osv.except_osv(_('Error !'), _('You can not validate a journal entry unless all journal items belongs to the same chart of accounts !'))
|
||||
return self.post(cursor, user, ids, context=context)
|
||||
|
||||
def button_cancel(self, cr, uid, ids, context=None):
|
||||
@@ -1317,7 +1334,7 @@ class account_move(osv.osv):
|
||||
for move in self.browse(cr, uid, ids, context=context):
|
||||
if move['state'] != 'draft':
|
||||
raise osv.except_osv(_('UserError'),
|
||||
_('You can not delete posted movement: "%s"!') % \
|
||||
_('You can not delete a posted journal entry "%s"!') % \
|
||||
move['name'])
|
||||
line_ids = map(lambda x: x.id, move.line_id)
|
||||
context['journal_id'] = move.journal_id.id
|
||||
@@ -1337,7 +1354,7 @@ class account_move(osv.osv):
|
||||
|
||||
def _centralise(self, cr, uid, move, mode, context=None):
|
||||
assert mode in ('debit', 'credit'), 'Invalid Mode' #to prevent sql injection
|
||||
currency_obj = self.pool.get('res.currency')
|
||||
currency_obj = self.pool.get('res.currency')
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
@@ -1599,7 +1616,7 @@ class account_tax_code(osv.osv):
|
||||
(parent_ids,) + where_params)
|
||||
res=dict(cr.fetchall())
|
||||
obj_precision = self.pool.get('decimal.precision')
|
||||
res2 = {}
|
||||
res2 = {}
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
def _rec_get(record):
|
||||
amount = res.get(record.id, 0.0)
|
||||
@@ -1768,6 +1785,9 @@ class account_tax(osv.osv):
|
||||
'type_tax_use': fields.selection([('sale','Sale'),('purchase','Purchase'),('all','All')], 'Tax Application', required=True)
|
||||
|
||||
}
|
||||
_sql_constraints = [
|
||||
('name_company_uniq', 'unique(name, company_id)', 'Tax Name must be unique per company!'),
|
||||
]
|
||||
|
||||
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80):
|
||||
"""
|
||||
@@ -2126,7 +2146,11 @@ class account_model(osv.osv):
|
||||
period_id = period_id[0]
|
||||
|
||||
for model in self.browse(cr, uid, ids, context=context):
|
||||
entry['name'] = model.name%{'year':time.strftime('%Y'), 'month':time.strftime('%m'), 'date':time.strftime('%Y-%m')}
|
||||
try:
|
||||
entry['name'] = model.name%{'year':time.strftime('%Y'), 'month':time.strftime('%m'), 'date':time.strftime('%Y-%m')}
|
||||
except:
|
||||
raise osv.except_osv(_('Wrong model !'), _('You have a wrong expression "%(...)s" in your model !'))
|
||||
|
||||
move_id = account_move_obj.create(cr, uid, {
|
||||
'ref': entry['name'],
|
||||
'period_id': period_id,
|
||||
@@ -2198,8 +2222,8 @@ class account_model_line(osv.osv):
|
||||
}
|
||||
_order = 'sequence'
|
||||
_sql_constraints = [
|
||||
('credit_debit1', 'CHECK (credit*debit=0)', 'Wrong credit or debit value in model (Credit Or Debit Must Be "0")!'),
|
||||
('credit_debit2', 'CHECK (credit+debit>=0)', 'Wrong credit or debit value in model (Credit + Debit Must Be greater "0")!'),
|
||||
('credit_debit1', 'CHECK (credit*debit=0)', 'Wrong credit or debit value in model, they must be positive!'),
|
||||
('credit_debit2', 'CHECK (credit+debit>=0)', 'Wrong credit or debit value in model, they must be positive!'),
|
||||
]
|
||||
account_model_line()
|
||||
|
||||
@@ -2365,7 +2389,7 @@ class account_account_template(osv.osv):
|
||||
_check_recursion = check_cycle
|
||||
_constraints = [
|
||||
(_check_recursion, 'Error ! You can not create recursive account templates.', ['parent_id']),
|
||||
(_check_type, 'Configuration Error! \nYou cannot define children to an account with internal type different of "View"! ', ['type']),
|
||||
(_check_type, 'Configuration Error!\nYou can not define children to an account with internal type different of "View"! ', ['type']),
|
||||
|
||||
]
|
||||
|
||||
@@ -2398,7 +2422,7 @@ class account_add_tmpl_wizard(osv.osv_memory):
|
||||
ptids = tmpl_obj.read(cr, uid, [tids[0]['parent_id'][0]], ['code'])
|
||||
res = None
|
||||
if not ptids or not ptids[0]['code']:
|
||||
raise osv.except_osv(_('Error !'), _('Cannot locate parent code for template account!'))
|
||||
raise osv.except_osv(_('Error !'), _('I can not locate a parent code for the template account!'))
|
||||
res = acc_obj.search(cr, uid, [('code','=',ptids[0]['code'])])
|
||||
return res and res[0] or False
|
||||
|
||||
@@ -2613,6 +2637,79 @@ class account_fiscal_position_account_template(osv.osv):
|
||||
|
||||
account_fiscal_position_account_template()
|
||||
|
||||
class account_financial_report(osv.osv):
|
||||
_name = "account.financial.report"
|
||||
_description = "Account Report"
|
||||
|
||||
def _get_level(self, cr, uid, ids, field_name, arg, context=None):
|
||||
res = {}
|
||||
for report in self.browse(cr, uid, ids, context=context):
|
||||
level = 0
|
||||
if report.parent_id:
|
||||
level = report.parent_id.level + 1
|
||||
res[report.id] = level
|
||||
return res
|
||||
|
||||
def _get_children_by_order(self, cr, uid, ids, context=None):
|
||||
res = []
|
||||
for id in ids:
|
||||
res.append(id)
|
||||
ids2 = self.search(cr, uid, [('parent_id', '=', id)], order='sequence ASC', context=context)
|
||||
res += self._get_children_by_order(cr, uid, ids2, context=context)
|
||||
return res
|
||||
|
||||
def _get_balance(self, cr, uid, ids, name, args, context=None):
|
||||
res = {}
|
||||
res_all = {}
|
||||
for report in self.browse(cr, uid, ids, context=context):
|
||||
balance = 0.0
|
||||
if report.id in res_all:
|
||||
balance = res_all[report.id]
|
||||
elif report.type == 'accounts':
|
||||
# it's the sum of balance of the linked accounts
|
||||
for a in report.account_ids:
|
||||
balance += a.balance
|
||||
elif report.type == 'account_report' and report.account_report_id:
|
||||
# it's the amount of the linked report
|
||||
res2 = self._get_balance(cr, uid, [report.account_report_id.id], 'balance', False, context=context)
|
||||
res_all.update(res2)
|
||||
for key, value in res2.items():
|
||||
balance += value
|
||||
elif report.type == 'sum':
|
||||
# it's the sum of balance of the children of this account.report
|
||||
#for child in report.children_ids:
|
||||
res2 = self._get_balance(cr, uid, [rec.id for rec in report.children_ids], 'balance', False, context=context)
|
||||
res_all.update(res2)
|
||||
for key, value in res2.items():
|
||||
balance += value
|
||||
res[report.id] = balance
|
||||
res_all[report.id] = balance
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Report Name', size=128, required=True),
|
||||
'parent_id': fields.many2one('account.financial.report', 'Parent'),
|
||||
'children_ids': fields.one2many('account.financial.report', 'parent_id', 'Account Report'),
|
||||
'sequence': fields.integer('Sequence'),
|
||||
'type': fields.selection([
|
||||
('sum','Sum'),
|
||||
('accounts','Accounts'),
|
||||
('account_report','Account Report'),
|
||||
],'Type'),
|
||||
'account_ids': fields.many2many('account.account', 'account_account_financial_report', 'report_line_id', 'account_id', 'Accounts'),
|
||||
'note': fields.text('Notes'),
|
||||
'account_report_id': fields.many2one('account.financial.report', 'Account Report'),
|
||||
'balance': fields.function(_get_balance, 'Balance'),
|
||||
'display_detail': fields.boolean('Display the account list'),
|
||||
'level': fields.function(_get_level, string='Level', store=True, type='integer'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'type': 'sum',
|
||||
}
|
||||
|
||||
account_financial_report()
|
||||
|
||||
# Multi charts of Accounts wizard
|
||||
|
||||
class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
@@ -2706,7 +2803,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
unconfigured_cmp = list(set(company_ids)-set(configured_cmp))
|
||||
for field in res['fields']:
|
||||
if field == 'company_id':
|
||||
res['fields'][field]['domain'] = unconfigured_cmp
|
||||
res['fields'][field]['domain'] = [('id','in',unconfigured_cmp)]
|
||||
res['fields'][field]['selection'] = [('', '')]
|
||||
if unconfigured_cmp:
|
||||
cmp_select = [(line.id, line.name) for line in self.pool.get('res.company').browse(cr, uid, unconfigured_cmp)]
|
||||
|
||||
@@ -58,13 +58,6 @@ class account_bank_statement(osv.osv):
|
||||
journal_id = ids[0]
|
||||
return journal_id
|
||||
|
||||
def _default_balance_start(self, cr, uid, context=None):
|
||||
cr.execute('select id from account_bank_statement where journal_id=%s order by date desc limit 1', (1,))
|
||||
res = cr.fetchone()
|
||||
if res:
|
||||
return self.browse(cr, uid, res[0], context=context).balance_end
|
||||
return 0.0
|
||||
|
||||
def _end_balance(self, cursor, user, ids, name, attr, context=None):
|
||||
res_currency_obj = self.pool.get('res.currency')
|
||||
res_users_obj = self.pool.get('res.users')
|
||||
@@ -90,7 +83,8 @@ class account_bank_statement(osv.osv):
|
||||
res[statement.id] -= res_currency_obj.compute(cursor,
|
||||
user, company_currency_id, currency_id,
|
||||
line.credit, context=context)
|
||||
if statement.state == 'draft':
|
||||
|
||||
if statement.state in ('draft', 'open'):
|
||||
for line in statement.line_ids:
|
||||
res[statement.id] += line.amount
|
||||
for r in res:
|
||||
@@ -127,7 +121,7 @@ class account_bank_statement(osv.osv):
|
||||
_name = "account.bank.statement"
|
||||
_description = "Bank Statement"
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=64, required=True, help='if you give the Name other then /, its created Accounting Entries Move will be with same name as statement name. This allows the statement entries to have the same references than the statement itself', states={'confirm': [('readonly', True)]}),
|
||||
'name': fields.char('Name', size=64, required=True, states={'draft': [('readonly', False)]}, readonly=True, help='if you give the Name other then /, its created Accounting Entries Move will be with same name as statement name. This allows the statement entries to have the same references than the statement itself'), # readonly for account_cash_statement
|
||||
'date': fields.date('Date', required=True, states={'confirm': [('readonly', True)]}),
|
||||
'journal_id': fields.many2one('account.journal', 'Journal', required=True,
|
||||
readonly=True, states={'draft':[('readonly',False)]}),
|
||||
@@ -136,19 +130,21 @@ class account_bank_statement(osv.osv):
|
||||
'balance_start': fields.float('Starting Balance', digits_compute=dp.get_precision('Account'),
|
||||
states={'confirm':[('readonly',True)]}),
|
||||
'balance_end_real': fields.float('Ending Balance', digits_compute=dp.get_precision('Account'),
|
||||
states={'confirm':[('readonly', True)]}),
|
||||
'balance_end': fields.function(_end_balance, string='Balance'),
|
||||
states={'confirm': [('readonly', True)]}),
|
||||
'balance_end': fields.function(_end_balance, store=True, # store=True for account_cash_statement
|
||||
string="Balance", help='Balance as calculated based on Starting Balance and transaction lines'),
|
||||
'company_id': fields.related('journal_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
|
||||
'line_ids': fields.one2many('account.bank.statement.line',
|
||||
'statement_id', 'Statement lines',
|
||||
states={'confirm':[('readonly', True)]}),
|
||||
'move_line_ids': fields.one2many('account.move.line', 'statement_id',
|
||||
'Entry lines', states={'confirm':[('readonly',True)]}),
|
||||
'state': fields.selection([('draft', 'Draft'),('confirm', 'Confirmed')],
|
||||
'State', required=True,
|
||||
states={'confirm': [('readonly', True)]}, readonly="1",
|
||||
help='When new statement is created the state will be \'Draft\'. \
|
||||
\n* And after getting confirmation from the bank it will be in \'Confirmed\' state.'),
|
||||
'state': fields.selection([('draft', 'Draft'),
|
||||
('open','Open'), # used by cash statements
|
||||
('confirm', 'Closed')],
|
||||
'State', required=True, readonly="1",
|
||||
help='When new statement is created the state will be \'Draft\'.\n'
|
||||
'And after getting confirmation from the bank it will be in \'Confirmed\' state.'),
|
||||
'currency': fields.function(_currency, string='Currency',
|
||||
type='many2one', relation='res.currency'),
|
||||
'account_id': fields.related('journal_id', 'default_debit_account_id', type='many2one', relation='account.account', string='Account used in this journal', readonly=True, help='used in statement reconciliation domain, but shouldn\'t be used elswhere.'),
|
||||
@@ -158,7 +154,6 @@ class account_bank_statement(osv.osv):
|
||||
'name': "/",
|
||||
'date': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
'state': 'draft',
|
||||
'balance_start': _default_balance_start,
|
||||
'journal_id': _default_journal_id,
|
||||
'period_id': _get_period,
|
||||
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.bank.statement',context=c),
|
||||
@@ -386,7 +381,7 @@ class account_bank_statement(osv.osv):
|
||||
if t['state'] in ('draft'):
|
||||
unlink_ids.append(t['id'])
|
||||
else:
|
||||
raise osv.except_osv(_('Invalid action !'), _('Cannot delete bank statement(s) which are already confirmed !'))
|
||||
raise osv.except_osv(_('Invalid action !'), _('In order to delete a bank statement, you must first cancel it to delete related journal items.'))
|
||||
osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
|
||||
return True
|
||||
|
||||
|
||||
@@ -119,39 +119,6 @@ class account_cash_statement(osv.osv):
|
||||
res2[statement.id] = encoding_total
|
||||
return res2
|
||||
|
||||
def _end_balance(self, cursor, user, ids, name, attr, context=None):
|
||||
res_currency_obj = self.pool.get('res.currency')
|
||||
res_users_obj = self.pool.get('res.users')
|
||||
res = {}
|
||||
|
||||
company_currency_id = res_users_obj.browse(cursor, user, user,
|
||||
context=context).company_id.currency_id.id
|
||||
|
||||
statements = self.browse(cursor, user, ids, context=context)
|
||||
for statement in statements:
|
||||
res[statement.id] = statement.balance_start
|
||||
currency_id = statement.currency.id
|
||||
for line in statement.move_line_ids:
|
||||
if line.debit > 0:
|
||||
if line.account_id.id == \
|
||||
statement.journal_id.default_debit_account_id.id:
|
||||
res[statement.id] += res_currency_obj.compute(cursor,
|
||||
user, company_currency_id, currency_id,
|
||||
line.debit, context=context)
|
||||
else:
|
||||
if line.account_id.id == \
|
||||
statement.journal_id.default_credit_account_id.id:
|
||||
res[statement.id] -= res_currency_obj.compute(cursor,
|
||||
user, company_currency_id, currency_id,
|
||||
line.credit, context=context)
|
||||
|
||||
if statement.state in ('draft', 'open'):
|
||||
for line in statement.line_ids:
|
||||
res[statement.id] += line.amount
|
||||
for r in res:
|
||||
res[r] = round(res[r], 2)
|
||||
return res
|
||||
|
||||
def _get_company(self, cr, uid, context=None):
|
||||
user_pool = self.pool.get('res.users')
|
||||
company_pool = self.pool.get('res.company')
|
||||
@@ -218,18 +185,11 @@ class account_cash_statement(osv.osv):
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'balance_end_real': fields.float('Closing Balance', digits_compute=dp.get_precision('Account'), states={'confirm': [('readonly', True)]}, help="closing balance entered by the cashbox verifier"),
|
||||
'state': fields.selection(
|
||||
[('draft', 'Draft'),
|
||||
('confirm', 'Closed'),
|
||||
('open','Open')], 'State', required=True, states={'confirm': [('readonly', True)]}, readonly="1"),
|
||||
'total_entry_encoding': fields.function(_get_sum_entry_encoding, store=True, string="Cash Transaction", help="Total cash transactions"),
|
||||
'closing_date': fields.datetime("Closed On"),
|
||||
'balance_end': fields.function(_end_balance, store=True, string='Balance', help="Closing balance based on Starting Balance and Cash Transactions"),
|
||||
'balance_end_cash': fields.function(_balance_end_cash, store=True, string='Balance', help="Closing balance based on cashBox"),
|
||||
'starting_details_ids': fields.one2many('account.cashbox.line', 'starting_id', string='Opening Cashbox'),
|
||||
'ending_details_ids': fields.one2many('account.cashbox.line', 'ending_id', string='Closing Cashbox'),
|
||||
'name': fields.char('Name', size=64, required=True, states={'draft': [('readonly', False)]}, readonly=True, help='if you give the Name other then /, its created Accounting Entries Move will be with same name as statement name. This allows the statement entries to have the same references than the statement itself'),
|
||||
'user_id': fields.many2one('res.users', 'Responsible', required=False),
|
||||
}
|
||||
_defaults = {
|
||||
@@ -247,7 +207,7 @@ class account_cash_statement(osv.osv):
|
||||
]
|
||||
open_jrnl = self.search(cr, uid, sql)
|
||||
if open_jrnl:
|
||||
raise osv.except_osv(_('Error'), _('You can not have two open register for the same journal'))
|
||||
raise osv.except_osv(_('Error'), _('You can not have two open register for the same journal!'))
|
||||
|
||||
if self.pool.get('account.journal').browse(cr, uid, vals['journal_id'], context=context).type == 'cash':
|
||||
open_close = self._get_cash_open_close_box_lines(cr, uid, context)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<attribute name="rowspan">23</attribute>
|
||||
<attribute name="string"/>
|
||||
</xpath>
|
||||
<group colspan="8">
|
||||
<group colspan="8" position="inside">
|
||||
<group colspan="4" width="600">
|
||||
<field name="charts"/>
|
||||
<group colspan="4" groups="base.group_extended">
|
||||
|
||||
@@ -294,7 +294,7 @@
|
||||
</field>
|
||||
</group>
|
||||
<group col="4" colspan="2">
|
||||
<button colspan="2" name="button_reset_taxes" states="draft" string="Compute Taxes" type="object" groups="base.group_user" icon="terp-stock_format-scientific" help="This action will erase taxes"/>
|
||||
<button colspan="2" name="button_reset_taxes" states="draft,proforma2" string="Compute Taxes" type="object" groups="base.group_user" icon="terp-stock_format-scientific" help="This action will erase taxes"/>
|
||||
<field name="amount_untaxed"/>
|
||||
<label string="" colspan="2"/>
|
||||
<field name="amount_tax"/>
|
||||
@@ -355,7 +355,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Invoice">
|
||||
<group col="10" colspan="4">
|
||||
<group>
|
||||
<filter name="draft" icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Invoices"/>
|
||||
<filter name="proforma" icon="terp-gtk-media-pause" string="Proforma" domain="[('state','=','proforma2')]" help="Proforma Invoices"/>
|
||||
<filter name="invoices" icon="terp-dolar" string="Invoices" domain="[('state','not in',['draft','cancel'])]" help="Proforma/Open/Paid Invoices"/>
|
||||
@@ -364,16 +364,16 @@
|
||||
<separator orientation="vertical"/>
|
||||
<field name="number"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="user_id" select="1" widget="selection" string="Salesman">
|
||||
<filter domain="[('user_id','=',uid)]" help="My invoices" icon="terp-personal" separator="1"/>
|
||||
<field name="user_id" widget="selection" string="Salesman">
|
||||
<filter domain="[('user_id','=',uid)]" help="My invoices" icon="terp-personal" />
|
||||
</field>
|
||||
<field name="origin"/>
|
||||
<field name="amount_total"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group col="10" colspan="4">
|
||||
<field name="journal_id" widget="selection" select='1'/>
|
||||
<field name="period_id" select='1' string="Period"/>
|
||||
<group>
|
||||
<field name="journal_id" widget="selection"/>
|
||||
<field name="period_id" string="Period"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
<menuitem id="base.menu_action_currency_form" parent="menu_configuration_misc" sequence="20"/>
|
||||
<menuitem id="menu_finance_generic_reporting" name="Generic Reporting" parent="menu_finance_reporting" sequence="100"/>
|
||||
<menuitem id="menu_finance_entries" name="Journal Entries" parent="menu_finance" sequence="5" groups="group_account_user,group_account_manager"/>
|
||||
<menuitem id="menu_account_reports" name="Financial Reports" parent="menu_finance_accounting" sequence="18"/>
|
||||
|
||||
<menuitem id="account.menu_finance_recurrent_entries" name="Recurring Entries"
|
||||
parent="menu_finance_periodical_processing" sequence="15"
|
||||
|
||||
@@ -650,14 +650,15 @@ class account_move_line(osv.osv):
|
||||
id2 = part.property_account_receivable.id
|
||||
if journal:
|
||||
jt = journal_obj.browse(cr, uid, journal).type
|
||||
#FIXME: Bank and cash journal are such a journal we can not assume a account based on this 2 journals
|
||||
# Bank and cash journal can have a payment or receipt transaction, and in both type partner account
|
||||
# will not be same id payment then payable, and if receipt then receivable
|
||||
#if jt in ('sale', 'purchase_refund', 'bank', 'cash'):
|
||||
if jt in ('sale', 'purchase_refund'):
|
||||
val['account_id'] = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, id2)
|
||||
elif jt in ('purchase', 'sale_refund', 'expense', 'bank', 'cash'):
|
||||
elif jt in ('purchase', 'sale_refund'):
|
||||
val['account_id'] = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, id1)
|
||||
elif jt in ('general', 'bank', 'cash'):
|
||||
if part.customer:
|
||||
val['account_id'] = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, id2)
|
||||
elif part.supplier:
|
||||
val['account_id'] = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, id1)
|
||||
if val.get('account_id', False):
|
||||
d = self.onchange_account_id(cr, uid, ids, val['account_id'])
|
||||
val.update(d['value'])
|
||||
@@ -1021,7 +1022,7 @@ class account_move_line(osv.osv):
|
||||
attrs.append("context=\"{'journal_id': journal_id}\"")
|
||||
|
||||
elif field == 'account_id' and journal.id:
|
||||
attrs.append('domain="[(\'journal_id\', \'=\', '+str(journal.id)+'),(\'type\',\'<>\',\'view\'), (\'type\',\'<>\',\'closed\')]" on_change="onchange_account_id(account_id, partner_id)"')
|
||||
attrs.append('domain="[(\'journal_id\', \'=\', journal_id),(\'type\',\'<>\',\'view\'), (\'type\',\'<>\',\'closed\')]" on_change="onchange_account_id(account_id, partner_id)"')
|
||||
|
||||
elif field == 'partner_id':
|
||||
attrs.append('on_change="onchange_partner_id(move_id, partner_id, account_id, debit, credit, date, journal_id)"')
|
||||
@@ -1231,7 +1232,7 @@ class account_move_line(osv.osv):
|
||||
move_id = move_obj.create(cr, uid, v, context)
|
||||
vals['move_id'] = move_id
|
||||
else:
|
||||
raise osv.except_osv(_('No piece number !'), _('Can not create an automatic sequence for this piece !\n\nPut a sequence in the journal definition for automatic numbering or create a sequence manually for this piece.'))
|
||||
raise osv.except_osv(_('No piece number !'), _('Can not create an automatic sequence for this piece!\nPut a sequence in the journal definition for automatic numbering or create a sequence manually for this piece.'))
|
||||
ok = not (journal.type_control_ids or journal.account_control_ids)
|
||||
if ('account_id' in vals):
|
||||
account = account_obj.browse(cr, uid, vals['account_id'], context=context)
|
||||
@@ -1256,7 +1257,7 @@ class account_move_line(osv.osv):
|
||||
vals['amount_currency'] = cur_obj.compute(cr, uid, account.company_id.currency_id.id,
|
||||
account.currency_id.id, vals.get('debit', 0.0)-vals.get('credit', 0.0), context=ctx)
|
||||
if not ok:
|
||||
raise osv.except_osv(_('Bad account !'), _('You can not use this general account in this journal !'))
|
||||
raise osv.except_osv(_('Bad account !'), _('You can not use this general account in this journal, check the tab \'Entry Controls\' on the related journal !'))
|
||||
|
||||
if vals.get('analytic_account_id',False):
|
||||
if journal.analytic_journal_id:
|
||||
|
||||
+118
-21
@@ -202,7 +202,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Accounts">
|
||||
<group col="10" colspan="4">
|
||||
<group>
|
||||
<filter icon="terp-sale" string="Receivable Accounts" domain="[('type','=','receivable')]"/>
|
||||
<filter icon="terp-purchase" string="Payable Accounts" domain="[('type','=','payable')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
@@ -387,7 +387,7 @@
|
||||
<field name="model">account.journal</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Search Account Journal">
|
||||
<search string="Search Account Journal">
|
||||
<group>
|
||||
<filter domain="['|', ('type', '=', 'sale'), ('type', '=', 'sale_refund')]" string="Sale" icon="terp-camera_test"/>
|
||||
<filter domain="['|', ('type', '=', 'purchase'), ('type', '=', 'purchase_refund')]" string="Purchase" icon="terp-purchase"/>
|
||||
@@ -404,7 +404,7 @@
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Type" context="{'group_by':'type'}" icon="terp-stock_symbol-selection"/>
|
||||
</group>
|
||||
</tree>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_account_journal_form" model="ir.ui.view">
|
||||
@@ -482,7 +482,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Bank Statements">
|
||||
<group col="8" colspan="4">
|
||||
<group>
|
||||
<filter string="Draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
|
||||
<filter string="Confirmed" domain="[('state','=','confirm')]" icon="terp-camera_test"/>
|
||||
<separator orientation="vertical"/>
|
||||
@@ -526,7 +526,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Bank Statements">
|
||||
<group col="8" colspan="4">
|
||||
<group>
|
||||
<filter string="Draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
|
||||
<filter string="Confirmed" domain="[('state','=','confirm')]" icon="terp-camera_test"/>
|
||||
<separator orientation="vertical"/>
|
||||
@@ -907,7 +907,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Taxes">
|
||||
<group col="10" colspan="4">
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="description"/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
@@ -1102,7 +1102,7 @@
|
||||
<separator string="Internal Note" colspan="4"/>
|
||||
<field name="narration" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Analytic Lines" groups="base.group_analytic_accounting">
|
||||
<page string="Analytic Lines" groups="analytic.group_analytic_accounting">
|
||||
<field colspan="4" name="analytic_lines" nolabel="1" context="{'default_general_account_id':account_id, 'default_name': name, 'default_date':date, 'amount': (debit or 0.0)-(credit or 0.0)}"/>
|
||||
</page>
|
||||
</notebook>
|
||||
@@ -1149,7 +1149,7 @@
|
||||
<field name="reconcile_partial_id"/>
|
||||
<field name="state"/>
|
||||
</page>
|
||||
<page string="Analytic Lines" groups="base.group_analytic_accounting">
|
||||
<page string="Analytic Lines" groups="analytic.group_analytic_accounting">
|
||||
<field colspan="4" name="analytic_lines" nolabel="1" />
|
||||
</page>
|
||||
</notebook>
|
||||
@@ -1176,7 +1176,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Journal Items">
|
||||
<group col='10' colspan='4'>
|
||||
<group>
|
||||
<filter icon="terp-document-new" string="Unbalanced" domain="[('state','=','draft')]" help="Unbalanced Journal Items"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-document-new" string="Unposted" domain="[('move_id.state','=','draft')]" help="Unposted Journal Items"/>
|
||||
@@ -1188,20 +1188,20 @@
|
||||
domain="[('reconcile_id','=',False), ('account_id.reconcile','=',True)]" help="Unreconciled Journal Items"
|
||||
name="unreconciled"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="move_id" select="1" string="Number (Move)"/>
|
||||
<field name="date" select='1'/>
|
||||
<field name="account_id" select='1'/>
|
||||
<field name="partner_id" select='1'>
|
||||
<field name="move_id" string="Number (Move)"/>
|
||||
<field name="date"/>
|
||||
<field name="account_id"/>
|
||||
<field name="partner_id">
|
||||
<filter help="Next Partner Entries to reconcile" name="next_partner" string="Next Partner to reconcile" context="{'next_partner_only': 1}" icon="terp-gtk-jump-to-ltr" domain="[('account_id.reconcile','=',True),('reconcile_id','=',False)]"/>
|
||||
</field>
|
||||
</group>
|
||||
<newline/>
|
||||
<group col="10" colspan="4">
|
||||
<group>
|
||||
<field name="journal_id" widget="selection" context="{'journal_id':self, 'visible_id':self, 'normal_view':False}"/>
|
||||
<field name="period_id" context="{'period_id':self, 'search_default_period_id':self}"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="12" col="10">
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
|
||||
@@ -1390,7 +1390,7 @@
|
||||
<separator string="Internal Note" colspan="4"/>
|
||||
<field name="narration" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Analytic Lines" groups="base.group_analytic_accounting">
|
||||
<page string="Analytic Lines" groups="analytic.group_analytic_accounting">
|
||||
<field colspan="4" name="analytic_lines" nolabel="1" context="{'default_general_account_id':account_id, 'default_name': name, 'default_date':date, 'amount': (debit or 0.0)-(credit or 0.0)}"/>
|
||||
</page>
|
||||
</notebook>
|
||||
@@ -1433,7 +1433,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Move">
|
||||
<group col='8' colspan='4'>
|
||||
<group>
|
||||
<filter icon="terp-document-new" string="Unposted" domain="[('state','=','draft')]" help="Unposted Journal Entries"/>
|
||||
<filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Journal Entries"/>
|
||||
<separator orientation="vertical"/>
|
||||
@@ -1445,12 +1445,12 @@
|
||||
<field name="date"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group col='8' colspan='4'>
|
||||
<group>
|
||||
<field name="journal_id" widget="selection"/>
|
||||
<field name="period_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="12" col="10">
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
|
||||
@@ -1832,7 +1832,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Entry Subscription">
|
||||
<group col="8" colspan="4">
|
||||
<group>
|
||||
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Subscription"/>
|
||||
<filter icon="terp-camera_test" string="Running" domain="[('state','=','running')]" help="Running Subscription"/>
|
||||
<separator orientation="vertical"/>
|
||||
@@ -2278,7 +2278,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Tax Templates">
|
||||
<group col="10" colspan="4">
|
||||
<group>
|
||||
<filter icon="terp-sale" string="Sale" domain="[('type_tax_use','=','sale')]" help="Taxes used in Sales"/>
|
||||
<filter icon="terp-purchase" string="Purchase" domain="[('type_tax_use','=','purchase')]" help="Taxes used in Purchases"/>
|
||||
<separator orientation="vertical"/>
|
||||
@@ -2703,5 +2703,102 @@ action = pool.get('res.config').next(cr, uid, [], context)
|
||||
parent="menu_finance_payables"
|
||||
action="base.action_partner_supplier_form" sequence="100"/>
|
||||
|
||||
<!--
|
||||
Account Reports
|
||||
-->
|
||||
|
||||
<record id="view_account_financial_report_form" model="ir.ui.view">
|
||||
<field name="name">account.financial.report.form</field>
|
||||
<field name="model">account.financial.report</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Account Report">
|
||||
<field name="name"/>
|
||||
<field name="parent_id"/>
|
||||
<field name="sequence"/>
|
||||
<field name="type"/>
|
||||
<field name="account_report_id" attrs="{'readonly': [('type', '!=', 'account_report')]}"/>
|
||||
<separator string="Accounts" colspan="4"/>
|
||||
<field name="display_detail" attrs="{'readonly': [('type', '!=', 'accounts')]}"/>
|
||||
<field name="account_ids" nolabel="1" colspan="4" attrs="{'readonly': [('type', '!=', 'accounts')]}"/>
|
||||
<separator string="Notes" colspan="4"/>
|
||||
<field name="note" nolabel="1" colspan="4"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_financial_report_tree" model="ir.ui.view">
|
||||
<field name="name">account.financial.report.tree</field>
|
||||
<field name="model">account.financial.report</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Account Report">
|
||||
<field name="name"/>
|
||||
<field name="parent_id" invisible="1"/>
|
||||
<field name="type"/>
|
||||
<field name="account_report_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_financial_report_search" model="ir.ui.view">
|
||||
<field name="name">account.financial.report.search</field>
|
||||
<field name="model">account.financial.report</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Account Report">
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="account_report_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Parent Report" icon="terp-folder-orange" domain="" context="{'group_by':'parent_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Report Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_financial_report_tree" model="ir.actions.act_window">
|
||||
<field name="name">Account Reports</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">account.financial.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_account_financial_report_search"/>
|
||||
<field name="view_id" ref="view_account_financial_report_tree"/>
|
||||
<field name="help">Makes a generic system to draw financial reports easily.</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_account_financial_reports_tree" name="Account Reports" parent="menu_account_reports" action="action_account_financial_report_tree"/>
|
||||
|
||||
<record id="view_account_report_tree_hierarchy" model="ir.ui.view">
|
||||
<field name="name">account.report.hierarchy</field>
|
||||
<field name="model">account.financial.report</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="field_parent">children_ids</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Account Reports Hierarchy">
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="parent_id" invisible="1"/>
|
||||
<field name="account_report_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_account_report_tree_hierarchy" model="ir.actions.act_window">
|
||||
<field name="name">Account Reports Hierarchy</field>
|
||||
<field name="res_model">account.financial.report</field>
|
||||
<field name="view_type">tree</field>
|
||||
<field name="view_id" ref="view_account_report_tree_hierarchy"/>
|
||||
<field name="domain">[('parent_id','=',False)]</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_account_report_tree_hierarchy" name="Account Reports Hierarchy"
|
||||
parent="menu_account_reports" action="action_account_report_tree_hierarchy"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<field name="model">res.company</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<notebook>
|
||||
<notebook position="inside">
|
||||
<page string="Overdue Payments" position="inside">
|
||||
<separator string="Overdue Payments Message" colspan="4"/>
|
||||
<field name="overdue_msg" nolabel="1" colspan ="4"/>
|
||||
|
||||
@@ -3090,6 +3090,16 @@ msgstr ""
|
||||
#: model:ir.actions.act_window,name:account.action_account_chart
|
||||
#: model:ir.actions.act_window,name:account.action_account_tree
|
||||
#: model:ir.ui.menu,name:account.menu_action_account_tree2
|
||||
#: report:account.account.balance:0
|
||||
#: report:account.partner.balance:0
|
||||
#: report:account.third_party_ledger:0
|
||||
#: report:account.third_party_ledger_other:0
|
||||
#: report:account.balancesheet:0
|
||||
#: report:account.balancesheet.horizontal:0
|
||||
#: report:account.general.ledger:0
|
||||
#: report:account.general.ledger_landscape:0
|
||||
#: report:pl.account:0
|
||||
#: report:pl.account.horizontal:0
|
||||
msgid "Chart of Accounts"
|
||||
msgstr ""
|
||||
|
||||
@@ -7134,20 +7144,6 @@ msgstr ""
|
||||
msgid "Company Currency"
|
||||
msgstr ""
|
||||
|
||||
#. module: account
|
||||
#: report:account.account.balance:0
|
||||
#: report:account.partner.balance:0
|
||||
#: report:account.third_party_ledger:0
|
||||
#: report:account.third_party_ledger_other:0
|
||||
#: report:account.balancesheet:0
|
||||
#: report:account.balancesheet.horizontal:0
|
||||
#: report:account.general.ledger:0
|
||||
#: report:account.general.ledger_landscape:0
|
||||
#: report:pl.account:0
|
||||
#: report:pl.account.horizontal:0
|
||||
msgid "Chart of Accounts"
|
||||
msgstr ""
|
||||
|
||||
#. module: account
|
||||
#: model:process.node,name:account.process_node_paymententries0
|
||||
#: model:process.transition,name:account.process_transition_reconcilepaid0
|
||||
@@ -9250,4 +9246,4 @@ msgstr ""
|
||||
#: report:account.balancesheet:0
|
||||
#: report:account.balancesheet.horizontal:0
|
||||
msgid "Liabilities"
|
||||
msgstr ""
|
||||
msgstr ""
|
||||
|
||||
+350
-270
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+331
-252
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+337
-255
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+331
-252
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+331
-252
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+326
-250
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+213
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+330
-251
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+338
-259
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+336
-252
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+331
-252
File diff suppressed because it is too large
Load Diff
+331
-252
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+331
-252
File diff suppressed because it is too large
Load Diff
+331
-252
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+328
-252
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
@@ -100,7 +100,7 @@ class account_installer(osv.osv_memory):
|
||||
unconfigured_cmp = list(set(company_ids)-set(configured_cmp))
|
||||
for field in res['fields']:
|
||||
if field == 'company_id':
|
||||
res['fields'][field]['domain'] = unconfigured_cmp
|
||||
res['fields'][field]['domain'] = [('id','in',unconfigured_cmp)]
|
||||
res['fields'][field]['selection'] = [('', '')]
|
||||
if unconfigured_cmp:
|
||||
cmp_select = [(line.id, line.name) for line in self.pool.get('res.company').browse(cr, uid, unconfigured_cmp)]
|
||||
|
||||
@@ -375,7 +375,7 @@ class account_invoice(osv.osv):
|
||||
if t['state'] in ('draft', 'cancel') and t['internal_number']== False:
|
||||
unlink_ids.append(t['id'])
|
||||
else:
|
||||
raise osv.except_osv(_('Invalid action !'), _('Cannot delete invoice(s) that are already opened(or been in opened state ever) or paid!'))
|
||||
raise osv.except_osv(_('Invalid action !'), _('You can not delete an invoice which is open or paid. We suggest you to refund it instead.'))
|
||||
osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
|
||||
return True
|
||||
|
||||
@@ -828,7 +828,7 @@ class account_invoice(osv.osv):
|
||||
total_percent += line.value_amount
|
||||
total_fixed = (total_fixed * 100) / (inv.amount_total or 1.0)
|
||||
if (total_fixed + total_percent) > 100:
|
||||
raise osv.except_osv(_('Error !'), _("Cannot create the invoice !\nThe payment term defined gives a computed amount greater than the total invoiced amount."))
|
||||
raise osv.except_osv(_('Error !'), _("Can not create the invoice !\nThe related payment term is probably misconfigured as it gives a computed amount greater than the total invoiced amount."))
|
||||
|
||||
# one move line per tax line
|
||||
iml += ait_obj.move_line_get(cr, uid, inv.id)
|
||||
@@ -860,10 +860,10 @@ class account_invoice(osv.osv):
|
||||
if totlines:
|
||||
res_amount_currency = total_currency
|
||||
i = 0
|
||||
ctx.update({'date': inv.date_invoice})
|
||||
for t in totlines:
|
||||
if inv.currency_id.id != company_currency:
|
||||
amount_currency = cur_obj.compute(cr, uid,
|
||||
company_currency, inv.currency_id.id, t[1])
|
||||
amount_currency = cur_obj.compute(cr, uid, company_currency, inv.currency_id.id, t[1], context=ctx)
|
||||
else:
|
||||
amount_currency = False
|
||||
|
||||
@@ -910,7 +910,7 @@ class account_invoice(osv.osv):
|
||||
journal = self.pool.get('account.journal').browse(cr, uid, journal_id)
|
||||
if journal.centralisation:
|
||||
raise osv.except_osv(_('UserError'),
|
||||
_('Cannot create invoice move on centralised journal'))
|
||||
_('You cannot create an invoice on a centralised journal. Uncheck the centralised counterpart box in the related journal from the configuration menu.'))
|
||||
|
||||
line = self.finalize_invoice_move_lines(cr, uid, inv, line)
|
||||
|
||||
@@ -1019,7 +1019,7 @@ class account_invoice(osv.osv):
|
||||
pay_ids = account_move_line_obj.browse(cr, uid, i['payment_ids'])
|
||||
for move_line in pay_ids:
|
||||
if move_line.reconcile_partial_id and move_line.reconcile_partial_id.line_partial_ids:
|
||||
raise osv.except_osv(_('Error !'), _('You cannot cancel the Invoice which is Partially Paid! You need to unreconcile concerned payment entries!'))
|
||||
raise osv.except_osv(_('Error !'), _('You can not cancel an invoice which is partially paid! You need to unreconcile related payment entries first!'))
|
||||
|
||||
# First, set the invoices as cancelled and detach the move ids
|
||||
self.write(cr, uid, ids, {'state':'cancel', 'move_id':False})
|
||||
@@ -1241,6 +1241,7 @@ class account_invoice(osv.osv):
|
||||
account_invoice()
|
||||
|
||||
class account_invoice_line(osv.osv):
|
||||
|
||||
def _amount_line(self, cr, uid, ids, prop, unknow_none, unknow_dict):
|
||||
res = {}
|
||||
tax_obj = self.pool.get('account.tax')
|
||||
|
||||
@@ -28,12 +28,17 @@ class account_fiscal_position(osv.osv):
|
||||
_description = 'Fiscal Position'
|
||||
_columns = {
|
||||
'name': fields.char('Fiscal Position', size=64, required=True),
|
||||
'active': fields.boolean('Active', help="By unchecking the active field, you may hide a fiscal position without deleting it."),
|
||||
'company_id': fields.many2one('res.company', 'Company'),
|
||||
'account_ids': fields.one2many('account.fiscal.position.account', 'position_id', 'Account Mapping'),
|
||||
'tax_ids': fields.one2many('account.fiscal.position.tax', 'position_id', 'Tax Mapping'),
|
||||
'note': fields.text('Notes', translate=True),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'active': True,
|
||||
}
|
||||
|
||||
def map_tax(self, cr, uid, fposition_id, taxes, context=None):
|
||||
if not taxes:
|
||||
return []
|
||||
|
||||
@@ -8,8 +8,11 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Fiscal Position">
|
||||
<field name="name" select="1"/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
<group colspan="4" col="6">
|
||||
<field name="name" select="1"/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
<field name="active" groups="base.group_extended"/>
|
||||
</group>
|
||||
<separator string="Mapping" colspan="4"/>
|
||||
<newline/>
|
||||
<field name="tax_ids" colspan="2" widget="one2many_list" nolabel="1">
|
||||
|
||||
@@ -28,15 +28,15 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Analytic Account">
|
||||
<group col="8" colspan="4">
|
||||
<group>
|
||||
<filter icon="terp-gtk-media-pause" string="Pending" domain="[('state','=','pending')]" help="Pending Accounts"/>
|
||||
<filter icon="terp-camera_test" string="Current" domain="[('state','=','open')]" help="Current Accounts"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-go-today" string="Overdue Account" domain="[('date','<',time.strftime('%%Y-%%m-%%d'))]" help="Analytic Accounts with a past deadline."/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="partner_id" select="1"/>
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="user_id" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
@@ -204,7 +204,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Analytic Lines">
|
||||
<group col='6' colspan='4'>
|
||||
<group>
|
||||
<filter name="sales" string="Sales" domain="[('journal_id.type','=','sale')]" icon="terp-camera_test" help="Analytic Journal Items related to a sale journal."/>
|
||||
<filter name="purchases" string="Purchases" domain="[('journal_id.type','=','purchase')]" icon="terp-purchase" help="Analytic Journal Items related to a purchase journal."/>
|
||||
<filter name="others" string="Others" domain="[('journal_id.type','in',('cash','general','situation'))]" icon="terp-folder-orange"/>
|
||||
@@ -430,13 +430,13 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Analytic Entries Stats">
|
||||
<group col="8" colspan="4">
|
||||
<group>
|
||||
<filter icon="terp-go-year" string="This Year" domain="[('name','=',time.strftime('%%Y'))]" help="Sale journal in this year"/>
|
||||
<filter icon="terp-go-month" string="This Month" domain="[('month','=',time.strftime('%%m'))]" help="Sale journal in this month"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="month" select="1"/>
|
||||
<field name="account_id" select="1"/>
|
||||
<field name="name"/>
|
||||
<field name="month"/>
|
||||
<field name="account_id"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
|
||||
@@ -42,6 +42,7 @@ import account_analytic_entries_report
|
||||
import account_balance_sheet
|
||||
import account_profit_loss
|
||||
import account_treasury_report
|
||||
import account_financial_report
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Analytic Entries Analysis">
|
||||
<group col="10" colspan="12">
|
||||
<group>
|
||||
<filter icon="terp-go-year" string=" 365 Days "
|
||||
domain="[('day','<=', time.strftime('%%Y-%%m-%%d')),('day','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Analytic Entries of last 365 days"/>
|
||||
@@ -44,7 +44,6 @@
|
||||
help="Analytic Entries of last 30 days"/>
|
||||
<filter icon="terp-go-week"
|
||||
string=" 7 Days "
|
||||
separator="1"
|
||||
domain="[('day','<=', time.strftime('%%Y-%%m-%%d')), ('day','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Analytic Entries during last 7 days"/>
|
||||
<separator orientation="vertical"/>
|
||||
|
||||
@@ -218,7 +218,7 @@
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
<font color="white">[[ '. '*(a['level']-1) ]]</font>
|
||||
<font>[[ (a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) and a['name']!='Net Profit') or removeParentNode('font') ]][[ a['name'] ]]</font>
|
||||
<font>[[ ( a['level']<4 or a['name']=='Net Profit') and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Entries Analysis">
|
||||
<group colspan="10" col="12">
|
||||
<group>
|
||||
<filter icon="terp-go-year" string="This F.Year"
|
||||
name="thisyear"
|
||||
context="{'year':'current_year'}"
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
|
||||
from report import report_sxw
|
||||
from common_report_header import common_report_header
|
||||
from tools.translate import _
|
||||
|
||||
class report_account_common(report_sxw.rml_parse, common_report_header):
|
||||
|
||||
def __init__(self, cr, uid, name, context=None):
|
||||
super(report_account_common, self).__init__(cr, uid, name, context=context)
|
||||
self.localcontext.update( {
|
||||
'get_lines': self.get_lines,
|
||||
'time': time,
|
||||
'get_fiscalyear': self._get_fiscalyear,
|
||||
'get_account': self._get_account,
|
||||
'get_start_period': self.get_start_period,
|
||||
'get_end_period': self.get_end_period,
|
||||
'get_filter': self._get_filter,
|
||||
'get_start_date':self._get_start_date,
|
||||
'get_end_date':self._get_end_date,
|
||||
})
|
||||
self.context = context
|
||||
|
||||
def set_context(self, objects, data, ids, report_type=None):
|
||||
new_ids = ids
|
||||
if (data['model'] == 'ir.ui.menu'):
|
||||
new_ids = 'chart_account_id' in data['form'] and [data['form']['chart_account_id']] or []
|
||||
objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids)
|
||||
return super(report_account_common, self).set_context(objects, data, new_ids, report_type=report_type)
|
||||
|
||||
def get_lines(self, data):
|
||||
lines = []
|
||||
account_obj = self.pool.get('account.account')
|
||||
currency_obj = self.pool.get('res.currency')
|
||||
ids2 = self.pool.get('account.financial.report')._get_children_by_order(self.cr, self.uid, [data['form']['account_report_id'][0]], context=data['form']['used_context'])
|
||||
for report in self.pool.get('account.financial.report').browse(self.cr, self.uid, ids2, context=data['form']['used_context']):
|
||||
vals = {
|
||||
'name': report.name,
|
||||
'balance': report.balance,
|
||||
'type': 'report',
|
||||
'level': report.level,
|
||||
}
|
||||
if data['form']['enable_filter']:
|
||||
vals['balance_cmp'] = self.pool.get('account.financial.report').browse(self.cr, self.uid, report.id, context=data['form']['comparison_context']).balance
|
||||
lines.append(vals)
|
||||
if report.type == 'accounts' and report.display_detail and report.account_ids:
|
||||
account_ids = account_obj._get_children_and_consol(self.cr, self.uid, [x.id for x in report.account_ids])
|
||||
for account in account_obj.browse(self.cr, self.uid, account_ids, context=data['form']['used_context']):
|
||||
if account.type != 'view':
|
||||
flag = False
|
||||
vals = {
|
||||
'name': account.code + ' ' + account.name,
|
||||
'balance': account.balance,
|
||||
'type': 'account',
|
||||
'level': 6,
|
||||
'account_type': account.type,
|
||||
}
|
||||
if not currency_obj.is_zero(self.cr, self.uid, account.company_id.currency_id, vals['balance']):
|
||||
flag = True
|
||||
if data['form']['enable_filter']:
|
||||
vals['balance_cmp'] = account_obj.browse(self.cr, self.uid, account.id, context=data['form']['comparison_context']).balance
|
||||
if not currency_obj.is_zero(self.cr, self.uid, account.company_id.currency_id, vals['balance_cmp']):
|
||||
flag = True
|
||||
if flag:
|
||||
lines.append(vals)
|
||||
return lines
|
||||
|
||||
report_sxw.report_sxw('report.account.financial.report', 'account.financial.report',
|
||||
'addons/account/report/account_financial_report.rml', parser=report_account_common, header='internal')
|
||||
|
||||
@@ -0,0 +1,272 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="Financial Report.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Financial Report" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="28.0" y1="28.0" width="539" height="786"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Heading">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Company_Name">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Date_from_To">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Account_Line_Title">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="MIDDLE"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table6">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Net_Profit_Loss">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table4">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Final_Result">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2_header">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="5,0" stop="5,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="6,0" stop="6,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="6,0" stop="6,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="6,0" stop="6,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="7,0" stop="7,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="7,0" stop="7,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="7,0" stop="7,0"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" rightIndent="2.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P2" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Standard" fontName="Times-Roman"/>
|
||||
<paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Helvetica" fontSize="9.0" leading="11"/>
|
||||
<paraStyle name="Footer" fontName="Times-Roman"/>
|
||||
<paraStyle name="Table Contents" fontName="Times-Roman"/>
|
||||
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER"/>
|
||||
<paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
|
||||
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
|
||||
<paraStyle name="terp_level_0_name" fontName="Helvetica-Bold" fontSize="9.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_0_balance" fontName="Helvetica-Bold" fontSize="9.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_1_name" fontName="Helvetica-Bold" fontSize="9.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_1_balance" fontName="Helvetica-Bold" fontSize="9.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_2_name" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="10.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_2_balance" fontName="Helvetica-Bold" fontSize="8.0" leftIndent=".0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_3_name" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="20.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_3_balance" fontName="Helvetica-Bold" fontSize="8.0" leftIndent=".0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_4_name" fontName="Helvetica" fontSize="8.0" leftIndent="30.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_4_balance" fontName="Helvetica" fontSize="8.0" leftIndent="0.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_5_name" fontName="Helvetica" fontSize="8.0" leftIndent="40.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_5_balance" fontName="Helvetica-Oblique" fontSize="8.0" leftIndent="0.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_6_name" fontName="Helvetica" fontSize="8.0" leftIndent="50.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_level_6_balance" fontName="Helvetica" fontSize="8.0" leftIndent="0.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
|
||||
<blockTableStyle id="Table1">
|
||||
<blockTopPadding start="0,0" stop="-1,0" length="15"/>
|
||||
<blockFont name="Helvetica-Bold" size="10.0" />
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,1" thickness="1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<blockTopPadding start="0,0" stop="-1,0" length="10"/>
|
||||
<blockAlignment value="LEFT"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#666666" start="1,1" stop="1,1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
|
||||
<blockTableStyle id="Table2_Report">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="GRID" colorName="#cccccc"/>
|
||||
</blockTableStyle>
|
||||
|
||||
<blockTableStyle id="Table1_main">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
|
||||
|
||||
</stylesheet>
|
||||
<images/>
|
||||
<story>
|
||||
<blockTable colWidths="539.0" style="Table_Company_Name">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_header_Centre">[[ data['form']['account_report_id'][1] ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="163.0,163.0,163.0" style="Table2_header">
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_General_Centre">Chart of Account </para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!='No Filter' and get_filter(data) ]]</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_filter(data)=='No Filter' and get_filter(data) or removeParentNode('para') ]] </para>
|
||||
<blockTable colWidths="60.0,60.0" style="Table3">[[ get_filter(data)=='Date' or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_General_Centre">Start Date</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">End Date</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="terp_default_Centre_8">[[ formatLang(get_start_date(data),date=True) ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ formatLang(get_end_date(data),date=True) ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="65.0,60.0" style="Table3">[[ get_filter(data)=='Periods' or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_General_Centre">Start Period</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">End Period</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="terp_default_Centre_8">[[ get_start_period(data) or removeParentNode('para') ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_end_period(data) or removeParentNode('para') ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="390.0,100.0" style="Table_Account_Line_Title">
|
||||
[[ data['form']['enable_filter'] == 0 or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Name</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Balance</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="Table1">
|
||||
[[ repeatIn(get_lines(data), 'a') ]]
|
||||
[[ (a.get('level') <> 0) or removeParentNode('tr') ]]
|
||||
[[ setTag('tr','tr',{'style': 'Table'+str(min(3,'level' in a and a.get('level') or 1))}) ]]
|
||||
<td><para style="terp_level_1_name">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_name'}) ]] [[ a.get('name') ]]</para></td>
|
||||
<td>[[ a.get('level') == 4 or removeParentNode('td') ]]<para style="terp_level_1_balance"><u>[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance'))]] [[company.currency_id.symbol]]</u></para></td>
|
||||
<td>[[ a.get('level') <> 4 or removeParentNode('td') ]]<para style="terp_level_1_balance">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance'))]] [[company.currency_id.symbol]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="263.0,100.0,100" style="Table_Account_Line_Title">
|
||||
[[ data['form']['enable_filter'] == 1 or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Name</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Balance</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ data['form']['label_filter'] ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="Table3">
|
||||
[[ repeatIn(get_lines(data), 'a') ]]
|
||||
[[ (a.get('level') <> 0) or removeParentNode('tr') ]]
|
||||
[[ setTag('tr','tr',{'style': 'Table'+str(min(3,'level' in a and a.get('level') or 1))}) ]]
|
||||
<td><para style="terp_level_1_name">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_name'}) ]] [[ a.get('name') ]]</para></td>
|
||||
<td>[[ a.get('level') == 4 or removeParentNode('td') ]]<para style="terp_level_1_balance"><u>[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance'))]] [[company.currency_id.symbol]]</u></para></td>
|
||||
<td>[[ a.get('level') <> 4 or removeParentNode('td') ]]<para style="terp_level_1_balance">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance'))]] [[company.currency_id.symbol]]</para></td>
|
||||
<td>[[ a.get('level') == 4 or removeParentNode('td') ]]<para style="terp_level_1_balance"><u>[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance_cmp'))]] [[company.currency_id.symbol]]</u></para></td>
|
||||
<td>[[ a.get('level') <> 4 or removeParentNode('td') ]]<para style="terp_level_1_balance">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance_cmp'))]] [[company.currency_id.symbol]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
||||
@@ -57,7 +57,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Invoices Analysis">
|
||||
<group col="10" colspan="12">
|
||||
<group>
|
||||
<filter string="Draft"
|
||||
icon="terp-document-new"
|
||||
domain="[('state','=','draft')]"
|
||||
@@ -78,7 +78,6 @@
|
||||
help="Customer Invoices And Refunds"/>
|
||||
<filter icon="terp-personal"
|
||||
string="Supplier"
|
||||
separator="1"
|
||||
domain="['|', ('type','=','in_invoice'),('type','=','in_refund')]"
|
||||
help="Supplier Invoices And Refunds"/>
|
||||
<separator orientation="vertical"/>
|
||||
@@ -87,7 +86,6 @@
|
||||
help="Customer And Supplier Invoices"/>
|
||||
<filter icon="terp-dolar_ok!"
|
||||
string="Refund"
|
||||
separator="1"
|
||||
domain="['|', ('type','=','out_refund'),('type','=','in_refund')]"
|
||||
help="Customer And Supplier Refunds"/>
|
||||
<separator orientation="vertical"/>
|
||||
|
||||
@@ -152,8 +152,8 @@
|
||||
<filter icon="terp-go-year" string="This Year" domain="[('name','=',time.strftime('%%Y'))]" help="This year's Sales by type"/>
|
||||
<filter icon="terp-go-month" string="This Month" domain="[('month','=',time.strftime('%%m'))]" help="This months' Sales by type"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="month" select="1"/>
|
||||
<field name="name"/>
|
||||
<field name="month"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
@@ -218,8 +218,8 @@
|
||||
<filter icon="terp-go-year" string="This Year" domain="[('name','=',time.strftime('%%Y'))]" help="All Months Sales by type"/>
|
||||
<filter icon="terp-go-month" string="This Month" domain="[('month','=',time.strftime('%%m'))]" help="This Months Sales by type"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="month" select="1"/>
|
||||
<field name="name"/>
|
||||
<field name="month"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
"access_account_fiscalyear_employee","account.fiscalyear employee","model_account_fiscalyear","base.group_user",1,0,0,0
|
||||
"access_res_currency_account_manager","res.currency account manager","base.model_res_currency","group_account_manager",1,1,1,1
|
||||
"access_res_currency_rate_account_manager","res.currency.rate account manager","base.model_res_currency_rate","group_account_manager",1,1,1,1
|
||||
"access_res_currency_rate_type_account_manager","res.currency.rate.type account manager","base.model_res_currency_rate_type","group_account_manager",1,1,1,1
|
||||
"access_account_invoice_user","account.invoice user","model_account_invoice","base.group_user",1,0,0,0
|
||||
"access_account_invoice_user","account.invoice.line user","model_account_invoice_line","base.group_user",1,0,0,0
|
||||
"access_account_payment_term_partner_manager","account.payment.term partner manager","model_account_payment_term","base.group_user",1,0,0,0
|
||||
@@ -127,4 +128,7 @@
|
||||
"access_account_sequence_fiscal_year_sale_user","account.sequence.fiscalyear.sale.user","model_account_sequence_fiscalyear","base.group_sale_salesman",1,1,1,0
|
||||
"access_account_sequence_fiscal_year_sale_manager","account.sequence.fiscalyear.sale.manager","model_account_sequence_fiscalyear","base.group_sale_manager",1,1,1,1
|
||||
"access_account_treasury_report_manager","account.treasury.report.manager","model_account_treasury_report","account.group_account_manager",1,0,0,0
|
||||
"access_account_financial_report","account.financial.report","model_account_financial_report","account.group_account_user",1,1,1,1
|
||||
"access_account_financial_report_invoice","account.financial.report invoice","model_account_financial_report","account.group_account_invoice",1,0,0,0
|
||||
"access_account_financial_report_manager","account.financial.report","model_account_financial_report","account.group_account_manager",1,1,1,1
|
||||
|
||||
|
||||
|
@@ -47,6 +47,7 @@ import account_open_closed_fiscalyear
|
||||
import account_invoice_state
|
||||
import account_chart
|
||||
import account_tax_chart
|
||||
import account_financial_report
|
||||
#TODO: remove this file no moe used
|
||||
# also remove related view fiel
|
||||
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
|
||||
class accounting_report(osv.osv_memory):
|
||||
_name = "accounting.report"
|
||||
_inherit = "account.common.report"
|
||||
_description = "Accounting Report"
|
||||
|
||||
_columns = {
|
||||
'enable_filter': fields.boolean('Enable Comparison'),
|
||||
'account_report_id': fields.many2one('account.financial.report', 'Account Reports', required=True),
|
||||
'label_filter': fields.char('Column Label', size=32, help="This label will be displayed on report to show the balance computed for the given comparison filter."),
|
||||
'fiscalyear_id_cmp': fields.many2one('account.fiscalyear', 'Fiscal Year', help='Keep empty for all open fiscal year'),
|
||||
'filter_cmp': fields.selection([('filter_no', 'No Filters'), ('filter_date', 'Date'), ('filter_period', 'Periods')], "Filter by", required=True),
|
||||
'period_from_cmp': fields.many2one('account.period', 'Start Period'),
|
||||
'period_to_cmp': fields.many2one('account.period', 'End Period'),
|
||||
'date_from_cmp': fields.date("Start Date"),
|
||||
'date_to_cmp': fields.date("End Date"),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'filter_cmp': 'filter_no',
|
||||
'target_move': 'posted',
|
||||
}
|
||||
|
||||
def _build_comparison_context(self, cr, uid, ids, data, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
result = {}
|
||||
result['fiscalyear'] = 'fiscalyear_id_cmp' in data['form'] and data['form']['fiscalyear_id_cmp'] or False
|
||||
result['journal_ids'] = 'journal_ids' in data['form'] and data['form']['journal_ids'] or False
|
||||
result['chart_account_id'] = 'chart_account_id' in data['form'] and data['form']['chart_account_id'] or False
|
||||
if data['form']['filter_cmp'] == 'filter_date':
|
||||
result['date_from'] = data['form']['date_from_cmp']
|
||||
result['date_to'] = data['form']['date_to_cmp']
|
||||
elif data['form']['filter_cmp'] == 'filter_period':
|
||||
if not data['form']['period_from_cmp'] or not data['form']['period_to_cmp']:
|
||||
raise osv.except_osv(_('Error'),_('Select a starting and an ending period'))
|
||||
result['period_from'] = data['form']['period_from_cmp']
|
||||
result['period_to'] = data['form']['period_to_cmp']
|
||||
return result
|
||||
|
||||
def check_report(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
res = super(accounting_report, self).check_report(cr, uid, ids, context=context)
|
||||
data = {}
|
||||
data['form'] = self.read(cr, uid, ids, ['account_report_id', 'date_from_cmp', 'date_to_cmp', 'fiscalyear_id_cmp', 'journal_ids', 'period_from_cmp', 'period_to_cmp', 'filter_cmp', 'chart_account_id', 'target_move'], context=context)[0]
|
||||
for field in ['fiscalyear_id_cmp', 'chart_account_id', 'period_from_cmp', 'period_to_cmp', 'account_report_id']:
|
||||
if isinstance(data['form'][field], tuple):
|
||||
data['form'][field] = data['form'][field][0]
|
||||
comparison_context = self._build_comparison_context(cr, uid, ids, data, context=context)
|
||||
res['datas']['form']['comparison_context'] = comparison_context
|
||||
return res
|
||||
|
||||
def _print_report(self, cr, uid, ids, data, context=None):
|
||||
data['form'].update(self.read(cr, uid, ids, ['date_from_cmp', 'date_to_cmp', 'fiscalyear_id_cmp', 'period_from_cmp', 'period_to_cmp', 'filter_cmp', 'account_report_id', 'enable_filter', 'label_filter'], context=context)[0])
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'account.financial.report',
|
||||
'datas': data,
|
||||
}
|
||||
|
||||
accounting_report()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="accounting_report_view" model="ir.ui.view">
|
||||
<field name="name">Accounting Report</field>
|
||||
<field name="model">accounting.report</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="account.account_common_report_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='target_move']" position="after">
|
||||
<field name="account_report_id" domain="[('parent_id','=',False)]"/>
|
||||
<field name="enable_filter"/>
|
||||
</xpath>
|
||||
<xpath expr="//notebook/page[@string='Filters']" position="after">
|
||||
<page string="Comparison" attrs="{'invisible': [('enable_filter','=',False)]}">
|
||||
<field name="label_filter" attrs="{'required': [('enable_filter', '=', True)]}"/>
|
||||
<field name="fiscalyear_id_cmp"/><newline/>
|
||||
<field name="filter_cmp"/>
|
||||
<separator string="Dates" colspan="4"/>
|
||||
<field name="date_from_cmp" attrs="{'readonly':[('filter_cmp', '!=', 'filter_date')], 'required':[('filter_cmp', '=', 'filter_date')]}" colspan="4"/>
|
||||
<field name="date_to_cmp" attrs="{'readonly':[('filter_cmp', '!=', 'filter_date')], 'required':[('filter_cmp', '=', 'filter_date')]}" colspan="4"/>
|
||||
<separator string="Periods" colspan="4"/>
|
||||
<field name="period_from_cmp" domain="[('fiscalyear_id', '=', fiscalyear_id_cmp)]" attrs="{'readonly':[('filter_cmp','!=','filter_period')], 'required':[('filter_cmp', '=', 'filter_period')]}" colspan="4"/>
|
||||
<field name="period_to_cmp" domain="[('fiscalyear_id', '=', fiscalyear_id_cmp)]" attrs="{'readonly':[('filter_cmp','!=','filter_period')], 'required':[('filter_cmp', '=', 'filter_period')]}" colspan="4"/>
|
||||
</page>
|
||||
</xpath>
|
||||
<xpath expr="//notebook/page[@string='Journals']" position="replace">
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_report" model="ir.actions.act_window">
|
||||
<field name="name">Financial Report</field>
|
||||
<field name="res_model">accounting.report</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="accounting_report_view"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem icon="STOCK_PRINT"
|
||||
name="Financial Report"
|
||||
action="action_account_report"
|
||||
groups="group_account_user,group_account_manager"
|
||||
id="menu_account_report"
|
||||
parent="final_accounting_reports"
|
||||
sequence="100"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -41,12 +41,16 @@ class account_invoice_refund(osv.osv_memory):
|
||||
|
||||
def _get_journal(self, cr, uid, context=None):
|
||||
obj_journal = self.pool.get('account.journal')
|
||||
user_obj = self.pool.get('res.users')
|
||||
if context is None:
|
||||
context = {}
|
||||
journal = obj_journal.search(cr, uid, [('type', '=', 'sale_refund')])
|
||||
if context.get('type', False):
|
||||
if context['type'] in ('in_invoice', 'in_refund'):
|
||||
journal = obj_journal.search(cr, uid, [('type', '=', 'purchase_refund')])
|
||||
inv_type = context.get('type', 'out_invoice')
|
||||
company_id = user_obj.browse(cr, uid, uid, context=context).company_id.id
|
||||
type = (inv_type == 'out_invoice') and 'sale_refund' or \
|
||||
(inv_type == 'out_refund') and 'sale' or \
|
||||
(inv_type == 'in_invoice') and 'purchase_refund' or \
|
||||
(inv_type == 'in_refund') and 'purchase'
|
||||
journal = obj_journal.search(cr, uid, [('type', '=', type), ('company_id','=',company_id)], limit=1, context=context)
|
||||
return journal and journal[0] or False
|
||||
|
||||
_defaults = {
|
||||
@@ -57,15 +61,17 @@ class account_invoice_refund(osv.osv_memory):
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
|
||||
journal_obj = self.pool.get('account.journal')
|
||||
user_obj = self.pool.get('res.users')
|
||||
res = super(account_invoice_refund,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
|
||||
type = context.get('journal_type', 'sale_refund')
|
||||
if type in ('sale', 'sale_refund'):
|
||||
type = 'sale_refund'
|
||||
else:
|
||||
type = 'purchase_refund'
|
||||
type = context.get('type', 'out_invoice')
|
||||
company_id = user_obj.browse(cr, uid, uid, context=context).company_id.id
|
||||
journal_type = (type == 'out_invoice') and 'sale_refund' or \
|
||||
(type == 'out_refund') and 'sale' or \
|
||||
(type == 'in_invoice') and 'purchase_refund' or \
|
||||
(type == 'in_refund') and 'purchase'
|
||||
for field in res['fields']:
|
||||
if field == 'journal_id':
|
||||
journal_select = journal_obj._name_search(cr, uid, '', [('type', '=', type)], context=context, limit=None, name_get_uid=1)
|
||||
journal_select = journal_obj._name_search(cr, uid, '', [('type', '=', journal_type), ('company_id','child_of',[company_id])], context=context)
|
||||
res['fields'][field]['selection'] = journal_select
|
||||
return res
|
||||
|
||||
@@ -198,10 +204,10 @@ class account_invoice_refund(osv.osv_memory):
|
||||
if 'value' in data and data['value']:
|
||||
inv_obj.write(cr, uid, [inv_id], data['value'])
|
||||
created_inv.append(inv_id)
|
||||
if inv.type in ('out_invoice', 'out_refund'):
|
||||
xml_id = 'action_invoice_tree3'
|
||||
else:
|
||||
xml_id = 'action_invoice_tree4'
|
||||
xml_id = (inv.type == 'out_refund') and 'action_invoice_tree1' or \
|
||||
(inv.type == 'in_refund') and 'action_invoice_tree2' or \
|
||||
(inv.type == 'out_invoice') and 'action_invoice_tree3' or \
|
||||
(inv.type == 'in_invoice') and 'action_invoice_tree4'
|
||||
result = mod_obj.get_object_reference(cr, uid, 'account', xml_id)
|
||||
id = result and result[1] or False
|
||||
result = act_obj.read(cr, uid, id, context=context)
|
||||
|
||||
@@ -110,7 +110,7 @@ class account_move_line_reconcile_writeoff(osv.osv_memory):
|
||||
It opens the write off wizard form, in that user can define the journal, account, analytic account for reconcile
|
||||
"""
|
||||
_name = 'account.move.line.reconcile.writeoff'
|
||||
_description = 'Account move line reconcile'
|
||||
_description = 'Account move line reconcile (writeoff)'
|
||||
_columns = {
|
||||
'journal_id': fields.many2one('account.journal','Write-Off Journal', required=True),
|
||||
'writeoff_acc_id': fields.many2one('account.account','Write-Off account', required=True),
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<field name="domain">[('invoice_id','=',False)]</field>
|
||||
<field name="search_view_id" ref="account.view_account_analytic_line_filter"/>
|
||||
</record>
|
||||
<menuitem action="action_hr_tree_invoiced_all" id="menu_action_hr_tree_invoiced_all" parent="menu_invoicing" groups="base.group_extended"/>
|
||||
<menuitem action="action_hr_tree_invoiced_all" id="menu_action_hr_tree_invoiced_all" parent="menu_invoicing" groups="analytic.group_analytic_accounting"/>
|
||||
|
||||
<record id="action_account_analytic_managed_overpassed" model="ir.actions.act_window">
|
||||
<field name="name">Overpassed Accounts</field>
|
||||
@@ -20,6 +20,6 @@
|
||||
<field name="view_mode">tree,form,graph</field>
|
||||
<field name="domain">[('date','<=',time.strftime('%Y-%m-%d')),('state','=','open')]</field>
|
||||
</record>
|
||||
<menuitem action="action_account_analytic_managed_overpassed" id="menu_action_account_analytic_managed_overpassed" sequence="50" parent="menu_invoicing" groups="base.group_extended"/>
|
||||
<menuitem action="action_account_analytic_managed_overpassed" id="menu_action_account_analytic_managed_overpassed" sequence="50" parent="menu_invoicing" groups="analytic.group_analytic_accounting"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -39,7 +39,11 @@ Allows to automatically select analytic accounts based on criterions:
|
||||
'images' : ['images/analytic_defaults.jpeg'],
|
||||
'depends' : ['sale'],
|
||||
'init_xml' : [],
|
||||
'update_xml': ['security/ir.model.access.csv', 'account_analytic_default_view.xml'],
|
||||
'update_xml': [
|
||||
'security/ir.model.access.csv',
|
||||
'security/account_analytic_default_security.xml',
|
||||
'account_analytic_default_view.xml'
|
||||
],
|
||||
'demo_xml' : [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Accounts">
|
||||
<group col="10" colspan="4">
|
||||
<group>
|
||||
<filter icon="terp-go-month" string="Current" name = "current" help="Analytical defaults whose end date is greater than today or None" domain = "['|', ('date_stop', '>', datetime.date.today().strftime('%%Y-%%m-%%d')), ('date_stop', '=', False)]" />
|
||||
<separator orientation="vertical"/>
|
||||
<field name="analytic_id" groups="analytic.group_analytic_accounting"/>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user