[MERGE]: Merge with lp:openobject-trunk-dev-addons2

bzr revid: aag@tinyerp.co.in-20101026060410-j1us08lhn49tik9l
This commit is contained in:
aag (OpenERP)
2010-10-26 11:34:10 +05:30
1313 changed files with 136123 additions and 126393 deletions
+3 -1
View File
@@ -119,7 +119,7 @@ module named account_voucher.
'project/project_demo.xml',
'project/analytic_account_demo.xml',
'demo/account_minimal.xml',
'account_unit_test.xml',
#'account_unit_test.xml',
],
'test': [
'test/account_customer_invoice.yml',
@@ -131,6 +131,8 @@ module named account_voucher.
'test/account_use_model.yml',
'test/account_validate_account_move.yml',
'test/account_fiscalyear_close.yml',
'test/account_bank_statement.yml',
'test/account_cash_statement.yml',
'test/account_report.yml',
],
'installable': True,
+44 -8
View File
@@ -457,7 +457,9 @@ class account_account(osv.osv):
if not ids:
ids = self.search(cr, user, [('name', operator, name)]+ args, limit=limit)
if not ids and len(name.split()) >= 2:
ids = self.search(cr, user, [('code', operator, name.split()[0]), ('name', operator, name.split()[1])]+ args, limit=limit)
#Separating code and name of account for searching
operand1,operand2 = name.split(' ',1) #name can contain spaces e.g. OpenERP S.A.
ids = self.search(cr, user, [('code', operator, operand1), ('name', operator, operand2)]+ args, limit=limit)
else:
ids = self.search(cr, user, args, context=context, limit=limit)
return self.name_get(cr, user, ids, context=context)
@@ -1105,7 +1107,7 @@ class account_move(osv.osv):
help='All manually created new journal entry are usually in the state \'Unposted\', but you can set the option to skip that state on the related journal. In that case, they will be behave as journal entries automatically created by the system on document validation (invoices, bank statements...) and will be created in \'Posted\' state.'),
'line_id': fields.one2many('account.move.line', 'move_id', 'Entries', states={'posted':[('readonly',True)]}),
'to_check': fields.boolean('To Review', help='Check this box if you are unsure of that journal entry and if you want to note it as \'to be reviewed\' by an accounting expert.'),
'partner_id': fields.related('line_id', 'partner_id', type="many2one", relation="res.partner", string="Partner"),
'partner_id': fields.related('line_id', 'partner_id', type="many2one", relation="res.partner", string="Partner", store=True),
'amount': fields.function(_amount_compute, method=True, string='Amount', digits_compute=dp.get_precision('Account'), type='float', fnct_search=_search_amount),
'date': fields.date('Date', required=True, states={'posted':[('readonly',True)]}),
'narration':fields.text('Narration'),
@@ -1215,7 +1217,8 @@ class account_move(osv.osv):
#
# TODO: Check if period is closed !
#
def create(self, cr, uid, vals, context={}):
def create(self, cr, uid, vals, context=None):
context = context or {}
if 'line_id' in vals and context.get('copy'):
for l in vals['line_id']:
if not l[0]:
@@ -1256,6 +1259,7 @@ class account_move(osv.osv):
return result
def copy(self, cr, uid, id, default={}, context={}):
context = context or {}
default.update({
'state':'draft',
'name':'/',
@@ -1265,7 +1269,8 @@ class account_move(osv.osv):
})
return super(account_move, self).copy(cr, uid, id, default, context)
def unlink(self, cr, uid, ids, context={}, check=True):
def unlink(self, cr, uid, ids, context=None, check=True):
context = context or {}
toremove = []
obj_move_line = self.pool.get('account.move.line')
for move in self.browse(cr, uid, ids, context):
@@ -1605,7 +1610,7 @@ class account_tax_code(osv.osv):
if isinstance(ids, (int, long)):
ids = [ids]
reads = self.read(cr, uid, ids, ['name','code'], context, load='_classic_write')
return [(x['id'], (x['code'] and x['code'] + ' - ' or '') + x['name']) \
return [(x['id'], (x['code'] and (x['code'] + ' - ') or '') + x['name']) \
for x in reads]
def _default_company(self, cr, uid, context={}):
@@ -2019,7 +2024,7 @@ class account_model(osv.osv):
}
_defaults = {
'legend': lambda self, cr, uid, context:_('You can specify year, month and date in the name of the model using the following labels:\n\n%(year)s : To Specify Year \n%(month)s : To Specify Month \n%(date)s : Current Date\n\ne.g. My model on %(date)s'),
'legend': lambda self, cr, uid, context:_('You can specify year, month and date in the name of the model using the following labels:\n\n%(year)s: To Specify Year \n%(month)s: To Specify Month \n%(date)s: Current Date\n\ne.g. My model on %(date)s'),
}
def generate(self, cr, uid, ids, datas={}, context=None):
move_ids = []
@@ -2221,7 +2226,7 @@ class account_subscription_line(osv.osv):
account_subscription_line()
# ---------------------------------------------------------------
# Account Templates : Account, Tax, Tax Code and chart. + Wizard
# Account Templates: Account, Tax, Tax Code and chart. + Wizard
# ---------------------------------------------------------------
class account_tax_template(osv.osv):
@@ -2394,7 +2399,7 @@ class account_chart_template(osv.osv):
'property_account_income_categ': fields.many2one('account.account.template','Income Category Account'),
'property_account_expense': fields.many2one('account.account.template','Expense Account on Product Template'),
'property_account_income': fields.many2one('account.account.template','Income Account on Product Template'),
'property_reserve_and_surplus_account': fields.many2one('account.account.template', 'Reserve and Profit/Loss Account', domain=[('type', '=', 'payable')], help='This Account is used for transferring Profit/Loss(If It is Profit : Amount will be added, Loss : Amount will be deducted.), Which is calculated from Profilt & Loss Report'),
'property_reserve_and_surplus_account': fields.many2one('account.account.template', 'Reserve and Profit/Loss Account', domain=[('type', '=', 'payable')], help='This Account is used for transferring Profit/Loss(If It is Profit: Amount will be added, Loss: Amount will be deducted.), Which is calculated from Profilt & Loss Report'),
}
account_chart_template()
@@ -2537,16 +2542,39 @@ class wizard_multi_charts_accounts(osv.osv_memory):
'bank_accounts_id': fields.one2many('account.bank.accounts.wizard', 'bank_account_id', 'Bank Accounts', required=True),
'code_digits':fields.integer('# of Digits', required=True, help="No. of Digits to use for account code"),
'seq_journal':fields.boolean('Separated Journal Sequences', help="Check this box if you want to use a different sequence for each created journal. Otherwise, all will use the same sequence."),
"sale_tax": fields.many2one("account.tax.template", "Sale Tax"),
"purchase_tax": fields.many2one("account.tax.template", "Purchase Tax"),
}
def onchange_chart_template_id(self, cr, uid, ids, chart_template_id=False, context=None):
res = {}
res['value'] = {}
res['value']["sale_tax"] = False
res['value']["purchase_tax"] = False
if chart_template_id:
ids = self.pool.get('account.tax.template').search(cr, uid, [("chart_template_id"
, "=", chart_template_id)], order="sequence")
if len(ids) > 0:
id=ids[0]
res['value']["sale_tax"] = id
res['value']["purchase_tax"] = id
return res
def _get_chart(self, cr, uid, context={}):
ids = self.pool.get('account.chart.template').search(cr, uid, [], context=context)
if ids:
return ids[0]
return False
def _get_default_accounts(self, cr, uid, context=None):
accounts = [{'acc_name':'Current','account_type':'bank'},
{'acc_name':'Deposit','account_type':'bank'},
{'acc_name':'Cash','account_type':'cash'}]
return accounts
_defaults = {
'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, [uid], c)[0].company_id.id,
'chart_template_id': _get_chart,
'bank_accounts_id': _get_default_accounts,
'code_digits': 6,
'seq_journal': True
}
@@ -2591,6 +2619,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
tax_code_template_ref[tax_code_template.id] = new_tax_code
#create all the tax
tax_template_to_tax = {}
for tax in obj_multi.chart_template_id.tax_template_ids:
#create it
vals_tax = {
@@ -2619,6 +2648,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
'type_tax_use': tax.type_tax_use
}
new_tax = obj_acc_tax.create(cr, uid, vals_tax)
tax_template_to_tax[tax.id] = new_tax
#as the accounts have not been created yet, we have to wait before filling these fields
todo_dict[new_tax] = {
'account_collected_id': tax.account_collected_id and tax.account_collected_id.id or False,
@@ -2843,6 +2873,12 @@ class wizard_multi_charts_accounts(osv.osv_memory):
}
obj_ac_fp.create(cr, uid, vals_acc)
ir_values = self.pool.get('ir.values')
ir_values.set(cr, uid, key='default', key2=False, name="taxes_id", company=obj_multi.company_id.id
, models =[('product.product',False)], value=[tax_template_to_tax[obj_multi.sale_tax.id]])
ir_values.set(cr, uid, key='default', key2=False, name="supplier_taxes_id", company=obj_multi.company_id.id
, models =[('product.product',False)], value=[tax_template_to_tax[obj_multi.purchase_tax.id]])
wizard_multi_charts_accounts()
class account_bank_accounts_wizard(osv.osv_memory):
+7 -11
View File
@@ -24,8 +24,6 @@ import time
from osv import fields
from osv import osv
from tools.translate import _
import tools
from tools import config
class account_analytic_line(osv.osv):
_inherit = 'account.analytic.line'
@@ -82,12 +80,13 @@ class account_analytic_line(osv.osv):
return {}
product_obj = self.pool.get('product.product')
analytic_journal_obj =self.pool.get('account.analytic.journal')
company_obj = self.pool.get('res.company')
product_price_type_obj = self.pool.get('product.price.type')
j_id = analytic_journal_obj.browse(cr, uid, journal_id, context=context)
prod = product_obj.browse(cr, uid, prod_id)
if not company_id:
company_id = j_id.company_id.id
result = 0.0
is_purchase = False
if j_id.type <> 'sale':
a = prod.product_tmpl_id.property_account_expense.id
@@ -99,8 +98,6 @@ class account_analytic_line(osv.osv):
'for this product: "%s" (id:%d)') % \
(prod.name, prod.id,))
amount_unit = prod.price_get('standard_price', context)[prod.id]
is_purchase = True
else:
a = prod.product_tmpl_id.property_account_income.id
if not a:
@@ -113,7 +110,7 @@ class account_analytic_line(osv.osv):
amount_unit = prod.price_get('list_price', context)[prod_id]
if not company_id:
company_id=company_obj._company_default_get(cr, uid, 'account.analytic.line', context)
company_id = company_obj._company_default_get(cr, uid, 'account.analytic.line', context=context)
flag = False
# Compute based on pricetype
product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','standard_price')], context)
@@ -128,15 +125,14 @@ class account_analytic_line(osv.osv):
if pricetype.field == 'list_price':
flag = True
amount_unit = prod.price_get(pricetype.field, context)[prod.id]
amount = amount_unit*unit_amount or 1.0
prec = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
amount = amount_unit*unit_amount or 1.0
amount = amount_unit*unit or 1.0
result = round(amount, prec)
if not flag:
result *= -1
return {'value': {
'amount': result,
'general_account_id': a,
return {'value': {
'amount': result,
'general_account_id': a,
}
}
+5 -8
View File
@@ -38,12 +38,13 @@ class account_bank_statement(osv.osv):
def write(self, cr, uid, ids, vals, context=None):
res = super(account_bank_statement, self).write(cr, uid, ids, vals, context=context)
account_bank_statement_line_obj = self.pool.get('account.bank.statement.line')
for statement in self.browse(cr, uid, ids, context):
seq = 0
for line in statement.line_ids:
seq += 1
if not line.sequence:
self.pool.get('account.bank.statement.line').write(cr, uid, [line.id], {'sequence': seq}, context=context)
account_bank_statement_line_obj.write(cr, uid, [line.id], {'sequence': seq}, context=context)
return res
def button_import_invoice(self, cr, uid, ids, context=None):
@@ -86,7 +87,6 @@ class account_bank_statement(osv.osv):
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,
@@ -216,10 +216,8 @@ class account_bank_statement(osv.osv):
def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, st_line_number, context=None):
res_currency_obj = self.pool.get('res.currency')
res_users_obj = self.pool.get('res.users')
account_move_obj = self.pool.get('account.move')
account_move_line_obj = self.pool.get('account.move.line')
account_analytic_line_obj = self.pool.get('account.analytic.line')
account_bank_statement_line_obj = self.pool.get('account.bank.statement.line')
st_line = account_bank_statement_line_obj.browse(cr, uid, st_line_id, context)
st = st_line.statement_id
@@ -378,25 +376,24 @@ class account_bank_statement(osv.osv):
self.create_move_from_st_line(cr, uid, st_line.id, company_currency_id, st_line_number, context)
self.write(cr, uid, [st.id], {'name': st_number}, context=context)
self.log(cr, uid, st.id, 'Statement %s is confirmed and entries are created.' % st_number)
self.log(cr, uid, st.id, _('Statement %s is confirmed, journal items are created.') % (st_number,))
done.append(st.id)
return self.write(cr, uid, ids, {'state':'confirm'}, context=context)
def button_cancel(self, cr, uid, ids, context=None):
done = []
account_move_obj = self.pool.get('account.move')
for st in self.browse(cr, uid, ids, context):
if st.state=='draft':
continue
ids = []
for line in st.line_ids:
ids += [x.id for x in line.move_ids]
self.pool.get('account.move').unlink(cr, uid, ids, context)
account_move_obj.unlink(cr, uid, ids, context)
done.append(st.id)
return self.write(cr, uid, done, {'state':'draft'}, context=context)
def onchange_journal_id(self, cursor, user, statement_id, journal_id, context=None):
account_journal_obj = self.pool.get('account.journal')
res_users_obj = self.pool.get('res.users')
cursor.execute('SELECT balance_end_real \
FROM account_bank_statement \
WHERE journal_id = %s AND NOT state = %s \
+61 -66
View File
@@ -19,10 +19,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from osv import osv, fields
from decimal import Decimal
from tools.translate import _
import decimal_precision as dp
@@ -45,22 +45,23 @@ class account_cashbox_line(osv.osv):
res[obj.id] = obj.pieces * obj.number
return res
def on_change_sub(self, cr, uid, ids, pieces, number,*a):
def on_change_sub(self, cr, uid, ids, pieces, number, *a):
""" Calculates Sub total on change of number
@param pieces: Names of fields.
@param number:
"""
sub=pieces*number
return {'value':{'subtotal': sub or 0.0}}
sub = pieces * number
return {'value': {'subtotal': sub or 0.0}}
_columns = {
'pieces': fields.float('Values', digits_compute=dp.get_precision('Account')),
'number': fields.integer('Number'),
'subtotal': fields.function(_sub_total, method=True, string='Sub Total', type='float', digits_compute=dp.get_precision('Account')),
'starting_id': fields.many2one('account.bank.statement',ondelete='cascade'),
'ending_id': fields.many2one('account.bank.statement',ondelete='cascade'),
'starting_id': fields.many2one('account.bank.statement', ondelete='cascade'),
'ending_id': fields.many2one('account.bank.statement', ondelete='cascade'),
}
account_cashbox_line()
class account_cash_statement(osv.osv):
@@ -74,7 +75,7 @@ class account_cash_statement(osv.osv):
@param arg: User defined arguments
@return: Dictionary of values.
"""
res ={}
res = {}
for statement in self.browse(cr, uid, ids):
amount_total = 0.0
@@ -84,7 +85,7 @@ class account_cash_statement(osv.osv):
for line in statement.starting_details_ids:
amount_total+= line.pieces * line.number
res[statement.id] = {
'balance_start':amount_total
'balance_start': amount_total
}
return res
@@ -96,10 +97,10 @@ class account_cash_statement(osv.osv):
"""
res ={}
for statement in self.browse(cr, uid, ids):
amount_total=0.0
amount_total = 0.0
for line in statement.ending_details_ids:
amount_total+= line.pieces * line.number
res[statement.id]=amount_total
amount_total += line.pieces * line.number
res[statement.id] = amount_total
return res
def _get_sum_entry_encoding(self, cr, uid, ids, name, arg, context=None):
@@ -113,14 +114,13 @@ class account_cash_statement(osv.osv):
for statement in self.browse(cr, uid, ids):
encoding_total=0.0
for line in statement.line_ids:
encoding_total+= line.amount
res2[statement.id]=encoding_total
encoding_total += line.amount
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,
@@ -165,13 +165,13 @@ class account_cash_statement(osv.osv):
curr = [1, 2, 5, 10, 20, 50, 100, 500]
for rs in curr:
dct = {
'pieces':rs,
'number':0
'pieces': rs,
'number': 0
}
res.append(dct)
journal_ids = self.pool.get('account.journal').search(cr, uid, [('type','=','cash')], context=context)
journal_ids = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'cash')], context=context)
if journal_ids:
results = self.search(cr, uid, [('journal_id','in',journal_ids),('state','=','confirm')],context=context)
results = self.search(cr, uid, [('journal_id', 'in', journal_ids),('state', '=', 'confirm')], context=context)
if results:
cash_st = self.browse(cr, uid, results, context)[0]
for cash_line in cash_st.ending_details_ids:
@@ -185,8 +185,8 @@ class account_cash_statement(osv.osv):
curr = [1, 2, 5, 10, 20, 50, 100, 500]
for rs in curr:
dct = {
'pieces':rs,
'number':0
'pieces': rs,
'number': 0
}
res.append(dct)
return res
@@ -196,10 +196,10 @@ class account_cash_statement(osv.osv):
curr = [1, 2, 5, 10, 20, 50, 100, 500]
for rs in curr:
dct = {
'pieces':rs,
'number':0
'pieces': rs,
'number': 0
}
res.append((0,0,dct))
res.append((0, 0, dct))
return res
def _get_cash_open_close_box_lines(self, cr, uid, context={}):
@@ -209,39 +209,41 @@ class account_cash_statement(osv.osv):
starting_details = self._get_cash_open_box_lines(cr, uid, context)
ending_details = self._get_default_cash_close_box_lines(cr, uid, context)
for start in starting_details:
start_l.append((0,0,start))
start_l.append((0, 0, start))
for end in ending_details:
end_l.append((0,0,end))
end_l.append((0, 0, end))
res['start'] = start_l
res['end'] = end_l
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"),
'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, method=True, store=True, string="Cash Transaction", help="Total cash transactions"),
'closing_date':fields.datetime("Closed On"),
'total_entry_encoding': fields.function(_get_sum_entry_encoding, method=True, store=True, string="Cash Transaction", help="Total cash transactions"),
'closing_date': fields.datetime("Closed On"),
'balance_end': fields.function(_end_balance, method=True, store=True, string='Balance', help="Closing balance based on Starting Balance and Cash Transactions"),
'balance_end_cash': fields.function(_balance_end_cash, method=True, 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),
'user_id': fields.many2one('res.users', 'Responsible', required=False),
}
_defaults = {
'state': lambda *a: 'draft',
'date': lambda *a:time.strftime("%Y-%m-%d %H:%M:%S"),
'state': 'draft',
'date': time.strftime("%Y-%m-%d %H:%M:%S"),
'user_id': lambda self, cr, uid, context=None: uid,
'starting_details_ids':_get_cash_open_box_lines,
'ending_details_ids':_get_default_cash_close_box_lines
'starting_details_ids': _get_cash_open_box_lines,
'ending_details_ids': _get_default_cash_close_box_lines
}
def create(self, cr, uid, vals, context=None):
if 'journal_id' not in vals:
raise osv.except_osv('Error', _('You cannot create a bank or cash register without a journal!'))
sql = [
('journal_id', '=', vals['journal_id']),
('journal_id', '=', vals.get('journal_id', False)),
('state', '=', 'open')
]
open_jrnl = self.search(cr, uid, sql)
@@ -250,20 +252,20 @@ class account_cash_statement(osv.osv):
if self.pool.get('account.journal').browse(cr, uid, vals['journal_id']).type == 'cash':
open_close = self._get_cash_open_close_box_lines(cr, uid, context)
if vals.get('starting_details_ids',False):
if vals.get('starting_details_ids', False):
for start in vals.get('starting_details_ids'):
dict_val = start[2]
for end in open_close['end']:
if end[2]['pieces'] == dict_val['pieces']:
end[2]['number'] += dict_val['number']
vals.update({
'ending_details_ids':open_close['start'],
'starting_details_ids':open_close['end']
# 'ending_details_ids': open_close['start'],
'starting_details_ids': open_close['end']
})
else:
vals.update({
'ending_details_ids':False,
'starting_details_ids':False
'ending_details_ids': False,
'starting_details_ids': False
})
res_id = super(account_cash_statement, self).create(cr, uid, vals, context=context)
self.write(cr, uid, [res_id], {})
@@ -295,10 +297,6 @@ class account_cash_statement(osv.osv):
@param journal_id: Changed journal_id
@return: Dictionary of changed values
"""
cash_pool = self.pool.get('account.cashbox.line')
statement_pool = self.pool.get('account.bank.statement')
res = {}
balance_start = 0.0
@@ -307,8 +305,7 @@ class account_cash_statement(osv.osv):
'balance_start': balance_start
})
return res
res = super(account_cash_statement, self).onchange_journal_id(cr, uid, statement_id, journal_id, context=context)
return res
return super(account_cash_statement, self).onchange_journal_id(cr, uid, statement_id, journal_id, context=context)
def _equal_balance(self, cr, uid, cash_id, context=None):
statement = self.browse(cr, uid, cash_id, context=context)
@@ -319,36 +316,34 @@ class account_cash_statement(osv.osv):
else:
return True
def _user_allow(self, cr, uid, ids, statement, context={}):
def _user_allow(self, cr, uid, statement_id, context=None):
return True
def button_open(self, cr, uid, ids, context=None):
""" Changes statement state to Running.
@return: True
"""
cash_pool = self.pool.get('account.cashbox.line')
if context is None:
context = {}
statement_pool = self.pool.get('account.bank.statement')
for statement in statement_pool.browse(cr, uid, ids, context=context):
vals = {}
statement = statement_pool.browse(cr, uid, ids[0])
vals = {}
if not self._user_allow(cr, uid, statement.id, context=context):
raise osv.except_osv(_('Error !'), _('User %s does not have rights to access %s journal !' % (statement.user_id.name, statement.journal_id.name)))
if not self._user_allow(cr, uid, ids, statement, context={}):
raise osv.except_osv(_('Error !'), _('User %s does not have rights to access %s journal !' % (statement.user_id.name, statement.journal_id.name)))
if statement.name and statement.name == '/':
number = self.pool.get('ir.sequence').get(cr, uid, 'account.cash.statement')
vals.update({
'name': number
})
if statement.name and statement.name == '/':
number = self.pool.get('ir.sequence').get(cr, uid, 'account.cash.statement')
vals.update({
'name': number
'date': time.strftime("%Y-%m-%d %H:%M:%S"),
'state': 'open',
})
vals.update({
'date':time.strftime("%Y-%m-%d %H:%M:%S"),
'state':'open',
})
self.write(cr, uid, ids, vals)
self.write(cr, uid, [statement.id], vals)
return True
def balance_check(self, cr, uid, cash_id, journal_type='bank', context=None):
@@ -363,7 +358,7 @@ class account_cash_statement(osv.osv):
return super(account_cash_statement, self).statement_close(cr, uid, ids, journal_type, context)
vals = {
'state':'confirm',
'closing_date':time.strftime("%Y-%m-%d %H:%M:%S")
'closing_date': time.strftime("%Y-%m-%d %H:%M:%S")
}
return self.write(cr, uid, ids, vals, context=context)
@@ -374,14 +369,14 @@ class account_cash_statement(osv.osv):
def button_confirm_cash(self, cr, uid, ids, context=None):
super(account_cash_statement, self).button_confirm_bank(cr, uid, ids, context=context)
return self.write(cr, uid, ids, {'closing_date':time.strftime("%Y-%m-%d %H:%M:%S")}, context=context)
return self.write(cr, uid, ids, {'closing_date': time.strftime("%Y-%m-%d %H:%M:%S")}, context=context)
def button_cancel(self, cr, uid, ids, context=None):
cash_box_line_pool = self.pool.get('account.cashbox.line')
super(account_cash_statement, self).button_cancel(cr, uid, ids, context=context)
for st in self.browse(cr, uid, ids, context):
for end in st.ending_details_ids:
cash_box_line_pool.write(cr, uid, [end.id], {'number':0})
cash_box_line_pool.write(cr, uid, [end.id], {'number': 0})
return True
account_cash_statement()
+1 -1
View File
@@ -14,7 +14,7 @@
action="action_account_period_tree"
id="menu_action_account_period_close_tree"
parent="account.menu_account_end_year_treatments"
sequence="0" groups="base.group_extended"/>
sequence="0" groups="base.group_extended,group_account_manager,group_account_user"/>
</data>
</openerp>
+7 -23
View File
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--
Invoices
-->
@@ -151,7 +150,7 @@
<field name="journal_id" on_change="onchange_journal_id(journal_id)" widget="selection"/>
<field name="number" readonly="1"/>
<field name="type" invisible="1"/>
<field name="currency_id" on_change="onchange_currency_id(currency_id, company_id)" width="50"/>
<field name="currency_id" width="50"/>
<button name="%(action_account_change_currency)d" type="action" icon="terp-stock_effects-object-colorize" string="Change" attrs="{'invisible':[('state','!=','draft')]}" groups="account.group_account_user"/>
<newline/>
<field string="Supplier" name="partner_id" domain="[('supplier','=', 1)]" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)" context="{'default_customer': 0}"/>
@@ -260,7 +259,7 @@
<field name="journal_id" groups="base.group_user" on_change="onchange_journal_id(journal_id)" widget="selection"/>
<field name="number"/>
<field name="type" invisible="1"/>
<field name="currency_id" on_change="onchange_currency_id(currency_id, company_id)" width="50"/>
<field name="currency_id" width="50"/>
<button name="%(action_account_change_currency)d" type="action" icon="terp-stock_effects-object-colorize" string="Change" attrs="{'invisible':[('state','!=','draft')]}" groups="account.group_account_user"/>
<newline/>
<field string="Customer" name="partner_id" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)" groups="base.group_user"/>
@@ -431,9 +430,10 @@
<field name="domain">[('type','=','out_invoice')]</field>
<field name="context">{'type':'out_invoice', 'journal_type': 'sale'}</field>
<field name="search_view_id" ref="view_account_invoice_filter"/>
<field name="help">Most of customer invoices are automatically generated in draft mode by OpenERP flows, following a purchase order for instance. Review, confirm or cancel, pay or refund your customers' invoices here. A manual invoice can be created here.</field>
<field name="help">Customer Invoices allows you create and manage invoices issued to your customers. OpenERP generates draft of invoices automatically so that you only have to confirm them before sending them to your customers.</field>
</record>
<record id="action_invoice_tree1_view1" model="ir.actions.act_window.view">
<field eval="1" name="sequence"/>
<field name="view_mode">tree</field>
@@ -446,6 +446,7 @@
<field name="view_id" ref="invoice_form"/>
<field name="act_window_id" ref="action_invoice_tree1"/>
</record>
<menuitem action="action_invoice_tree1" id="menu_action_invoice_tree1" parent="menu_finance_receivables"/>
<record id="action_invoice_tree2" model="ir.actions.act_window">
@@ -457,7 +458,7 @@
<field name="domain">[('type','=','in_invoice')]</field>
<field name="context">{'type':'in_invoice', 'journal_type': 'purchase'}</field>
<field name="search_view_id" ref="view_account_invoice_filter"/>
<field name="help">Proposal for supplier invoices are usually automatically generate by OpenERP, following a procurement order or a production order for instance. To consult and to check for, or to manually create a customer invoice, use this menu. You can review, confirm or cancel, pay or refund an invoice from the view from of the invoices.</field>
<field name="help">Supplier Invoices allows you to enter and manage invoices issued by your suppliers. OpenERP generates draft of supplier invoices automatically so that you can control what you received from your supplier according to what you purchased or received.</field>
</record>
<menuitem action="action_invoice_tree2" id="menu_action_invoice_tree2" parent="menu_finance_payables"/>
@@ -470,7 +471,7 @@
<field name="domain">[('type','=','out_refund')]</field>
<field name="context">{'type':'out_refund', 'journal_type': 'sale_refund'}</field>
<field name="search_view_id" ref="view_account_invoice_filter"/>
<field name="help">A customer refund is a credit note to your customer that cancel invoice or a part of it.</field>
<field name="help">Customer Refunds helps you manage the credit notes issued/to be issued for your customers. A refund invoice is a document that cancels an invoice or a part of it. You can easily generate refunds and reconcile them from the invoice form.</field>
</record>
<record id="action_invoice_tree3_view1" model="ir.actions.act_window.view">
@@ -509,22 +510,5 @@
res_model="account.invoice"
src_model="account.journal"/>
<act_window
domain="[('account_id.reconcile', '=', True)]"
context="{'search_default_unreconciled':True,'search_default_partner_id':[partner_id]}"
id="act_account_invoice_account_move_unreconciled"
groups="base.group_extended"
name="Items to Reconcile"
res_model="account.move.line"
src_model="account.invoice"/>
<act_window
context="{'search_default_move_id':move_id, 'search_default_unreconciled':False,}"
id="act_account_invoice_account_move_invoice_link"
name="Invoice Items"
groups="base.group_extended"
res_model="account.move.line"
src_model="account.invoice"/>
</data>
</openerp>
+8 -8
View File
@@ -7,8 +7,8 @@
<menuitem id="menu_finance_receivables" name="Customers" parent="menu_finance" sequence="1"/>
<menuitem id="menu_finance_payables" name="Suppliers" parent="menu_finance" sequence="2"/>
<menuitem id="menu_finance_bank_and_cash" name="Bank and Cash" parent="menu_finance" sequence="3"
groups="group_account_user"/>
<menuitem id="menu_finance_periodical_processing" name="Periodical Processing" parent="menu_finance" sequence="8" groups="group_account_user"/>
groups="group_account_user,group_account_manager"/>
<menuitem id="menu_finance_periodical_processing" name="Periodical Processing" parent="menu_finance" sequence="8" groups="group_account_user,group_account_manager"/>
<!-- This menu is used in account_code module -->
<menuitem id="menu_account_pp_statements" name="Statements" parent="menu_finance_periodical_processing" sequence="12"/>
<menuitem id="periodical_processing_journal_entries_validation" name="Draft Entries" parent="menu_finance_periodical_processing"/>
@@ -21,16 +21,16 @@
<menuitem id="menu_finance_management_belgian_reports" name="Belgian Reports" parent="menu_finance_reporting"/>
<menuitem id="menu_finance_configuration" name="Configuration" parent="menu_finance" sequence="13" groups="group_account_manager"/>
<menuitem id="menu_finance_accounting" name="Financial Accounting" parent="menu_finance_configuration"/>
<menuitem id="menu_analytic_accounting" name="Analytic Accounting" parent="menu_finance_configuration"/>
<menuitem id="menu_analytic_accounting" name="Analytic Accounting" parent="menu_finance_configuration" groups="analytic.group_analytic_accounting"/>
<menuitem id="menu_analytic" parent="menu_analytic_accounting" name="Accounts" groups="analytic.group_analytic_accounting"/>
<menuitem id="menu_low_level" name="Low Level" parent="menu_finance_accounting" groups="base.group_extended"/>
<menuitem id="menu_low_level" name="Low Level" parent="menu_finance_accounting" groups="base.group_extended,group_account_manager"/>
<menuitem id="menu_configuration_misc" name="Miscellaneous" parent="menu_finance_configuration" sequence="30" groups="group_account_manager"/>
<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="4" groups="group_account_user"/>
<menuitem id="account.menu_finance_recurrent_entries" name="Recurring Entries" parent="menu_finance_periodical_processing" sequence="15" groups="base.group_extended"/>
<menuitem id="menu_finance_entries" name="Journal Entries" parent="menu_finance" sequence="4" groups="group_account_user,group_account_manager"/>
<menuitem id="account.menu_finance_recurrent_entries" name="Recurring Entries" parent="menu_finance_periodical_processing" sequence="15" groups="base.group_extended,group_account_manager,group_account_user"/>
<menuitem id="menu_account_end_year_treatments" name="End of Period" parent="menu_finance_periodical_processing" groups="group_account_manager" sequence="25"/>
<menuitem id="menu_account_end_year_treatments" name="End of Period" parent="menu_finance_periodical_processing" groups="group_account_manager,group_account_user" sequence="25"/>
<menuitem id="menu_finance_periodical_processing_billing" name="Billing" parent="menu_finance_periodical_processing" sequence="35"/>
<menuitem id="menu_finance_statistic_report_statement" name="Statistic Reports" parent="menu_finance_reporting" sequence="300"/>
@@ -43,7 +43,7 @@
<menuitem
parent="account.menu_finance_legal_statement"
id="menu_journals_report"
groups="group_account_user"
groups="group_account_user,group_account_manager"
name="Journals"/>
</data>
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -45,7 +45,7 @@
<menuitem
id="menu_tax_report"
name="Taxes"
groups="group_account_user"
groups="group_account_user,group_account_manager"
parent="account.menu_finance_generic_reporting" sequence="3"/>
<report id="account_account_balance_landscape"
+177 -77
View File
@@ -23,8 +23,8 @@
<separator colspan="4" string="Periods"/>
<field colspan="4" name="period_ids" nolabel="1" widget="one2many_list">
<form string="Period">
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="name"/>
<field name="code"/>
<field name="date_start"/>
<field name="date_stop"/>
<field name="special"/>
@@ -59,7 +59,7 @@
<search string="Search Fiscalyear">
<group>
<filter string="Open" domain="[('state','=','draft')]" icon="terp-camera_test"/>
<filter string="Closed" domain="[('state','=','done')]" icon="terp-dialog_close"/>
<filter string="Closed" domain="[('state','=','done')]" icon="terp-dialog-close"/>
<separator orientation="vertical"/>
<field name="code"/>
<field name="name"/>
@@ -237,16 +237,16 @@
</field>
</record>
<record id="view_treasory_graph" model="ir.ui.view">
<field name="name">account.treasory.graph</field>
<field name="model">account.account</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Treasory Analysis" type="bar">
<field name="name"/>
<field name="balance" operator="+"/>
</graph>
<field name="name">account.treasory.graph</field>
<field name="model">account.account</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Treasory Analysis" type="bar">
<field name="name"/>
<field name="balance" operator="+"/>
</graph>
</field>
</record>
</record>
<record id="action_account_form" model="ir.actions.act_window">
<field name="name">Accounts</field>
<field name="res_model">account.account</field>
@@ -314,13 +314,33 @@
</field>
</record>
<record id="view_account_journal_view_search" model="ir.ui.view">
<field name="name">account.journal.view.search</field>
<field name="model">account.journal.view</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Journal View">
<field name="name"/>
</search>
</field>
</record>
<record id="view_account_journal_view_tree" model="ir.ui.view">
<field name="name">account.journal.view.tree</field>
<field name="model">account.journal.view</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Journal View">
<field name="name"/>
</tree>
</field>
</record>
<record id="view_account_journal_view_form" model="ir.ui.view">
<field name="name">account.journal.view.form</field>
<field name="model">account.journal.view</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Journal View">
<field name="name" select="1"/>
<field name="name"/>
<field colspan="4" name="columns_id" nolabel="1" widget="one2many_list"/>
</form>
</field>
@@ -330,7 +350,9 @@
<field name="res_model">account.journal.view</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_account_journal_view_search"/>
</record>
<menuitem action="action_account_journal_view" id="menu_action_account_journal_view" parent="account.menu_low_level"/>
<!--
@@ -369,8 +391,9 @@
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Type" context="{'group_by':'type'}" icon="terp-stock_effects-object-colorize"/>
<filter string="User" context="{'group_by':'user_id'}" icon="terp-personal"/>
<separator orientation="vertical"/>
<filter string="Type" context="{'group_by':'type'}" icon="terp-stock_effects-object-colorize"/>
</group>
</tree>
</field>
@@ -612,6 +635,7 @@
<field name="domain">[('journal_id.type', '=', 'bank')]</field>
<field name="context">{'journal_type':'bank'}</field>
<field name="search_view_id" ref="view_bank_statement_search"/>
<field name="help">A bank statement is a summary of all financial transactions occurring over a given period of time on a deposit account, a credit card, or any other type of account. Start by encoding the starting and closing balance, then record all lines of your statement. When you are in the Payment column of the a line, you can press F1 to open the reconciliation form.</field>
</record>
<record model="ir.actions.act_window.view" id="action_bank_statement_tree_bank">
<field name="sequence" eval="1"/>
@@ -664,6 +688,18 @@
<!--
Account Types
-->
<record id="view_account_type_search" model="ir.ui.view">
<field name="name">account.account.type.search</field>
<field name="model">account.account.type</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Account Type">
<field name="name"/>
<field name="code"/>
</search>
</field>
</record>
<record id="view_account_type_tree" model="ir.ui.view">
<field name="name">account.account.type.tree</field>
<field name="model">account.account.type</field>
@@ -705,8 +741,9 @@
<field name="res_model">account.account.type</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_account_type_search"/>
</record>
<menuitem action="action_account_type_form" groups="base.group_extended" id="menu_action_account_type_form" parent="menu_low_level"/>
<menuitem action="action_account_type_form" groups="base.group_extended,group_account_manager" id="menu_action_account_type_form" parent="menu_low_level"/>
<!--
Entries
-->
@@ -754,6 +791,19 @@
<!--
Tax Codes
-->
<record id="view_tax_code_search" model="ir.ui.view">
<field name="name">account.tax.code.search</field>
<field name="model">account.tax.code</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Account Tax Code">
<field name="name"/>
<field name="code"/>
<field name="parent_id"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</search>
</field>
</record>
<record id="view_tax_code_tree" model="ir.ui.view">
<field name="name">account.tax.code.tree</field>
<field name="model">account.tax.code</field>
@@ -777,10 +827,10 @@
<field name="arch" type="xml">
<form string="Account Tax Code">
<group col="6" colspan="4">
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="parent_id" select="1"/>
<field name="company_id" select="1" groups="base.group_multi_company"/>
<field name="name"/>
<field name="code"/>
<field name="parent_id"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
<group colspan="2" col="2">
<separator string="Reporting Configuration" colspan="4"/>
@@ -803,6 +853,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_tax_code_tree"/>
<field name="search_view_id" ref="view_tax_code_search"/>
</record>
<menuitem id="next_id_27" name="Taxes" parent="account.menu_finance_accounting"/>
<menuitem action="action_tax_code_list" id="menu_action_tax_code_list" parent="menu_low_level" sequence="12"/>
@@ -834,7 +885,6 @@
<field name="name"/>
<field name="description"/>
</group>
<newline/>
</search>
</field>
</record>
@@ -845,9 +895,9 @@
<field name="arch" type="xml">
<form string="Account Tax">
<group colspan="4" col="6">
<field name="name" select="1"/>
<field name="description" select="1"/>
<field name="type_tax_use"/>
<field name="name"/>
<field name="description"/>
<field name="type_tax_use"/>
<field name="price_include"/>
<field name="active"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
@@ -881,8 +931,8 @@
</page>
<page groups="base.group_extended" string="Special Computation">
<separator colspan="4" string="Applicability Options"/>
<field name="applicable_type"/>
<field name="domain"/>
<field name="applicable_type"/>
<field name="domain"/>
<separator colspan="4" string="Applicable Code (if type=code)"/>
<field colspan="4" name="python_applicable" nolabel="1" attrs="{'readonly':[('applicable_type','=','true')], 'required':[('applicable_type','=','code')]}"/>
<separator colspan="4" string="Compute Code (if type=code)"/>
@@ -907,7 +957,7 @@
<field name="domain">[('parent_id','=',False)]</field>
<field name="view_type">tree</field>
<field name="view_id" ref="view_tax_code_tree"/>
<field name="help">Chart of Taxes is a tree view reflecting the structure of the Tax Cases (or tax codes) and shows the current tax situation. The tax chart represents the amount of each area of the tax declaration for your country. It’s presented in a hierarchical structure, which can be modified to fit your needs.</field>
<field name="help">The chart of taxes is used to generate your periodic tax statement. You will see here the taxes with codes related to your legal statement according to your country.</field>
</record>
<!--
@@ -1139,6 +1189,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_account_move_line_filter"/>
<field name="help">This view is used by accountants in order to record entries massively in OpenERP. If you want to record a supplier invoice, start by recording the line of the expense account, OpenERP will propose to you automatically the Tax related to this account and the counter-part "Account Payable".</field>
</record>
<menuitem
@@ -1227,24 +1278,24 @@
<field name="arch" type="xml">
<form string="Journal Entries">
<group colspan="4" col="6">
<field name="name" select="1" readonly="True"/>
<field name="ref" select="1"/>
<field name="name" readonly="True"/>
<field name="ref"/>
<field name="to_check" groups="base.group_extended"/>
<field name="journal_id" select="1"/>
<field name="journal_id"/>
<field name="period_id"/>
<field name="date" select="1"/>
<field name="date"/>
<field name="company_id" required="1" groups="base.group_multi_company"/>
<field name="partner_id" invisible="1" select="1"/>
<field name="amount" invisible="1" select="1"/>
<field name="partner_id" invisible="1"/>
<field name="amount" invisible="1"/>
</group>
<notebook colspan="4">
<page string="Journal Items">
<field colspan="4" name="line_id" nolabel="1" height="250" widget="one2many_list" default_get="{'lines':line_id ,'journal':journal_id }">
<form string="Journal Item">
<group col="6" colspan="4">
<field name="name" select="1"/>
<field name="name"/>
<field name="ref"/>
<field name="partner_id" select="1" on_change="onchange_partner_id(False,partner_id,account_id,debit,credit,date)"/>
<field name="partner_id" on_change="onchange_partner_id(False,partner_id,account_id,debit,credit,date)"/>
<field name="journal_id"/>
<field name="period_id"/>
@@ -1254,7 +1305,7 @@
<page string="Information">
<group col="2" colspan="2">
<separator colspan="2" string="Amount"/>
<field name="account_id" select="1" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<field name="account_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<field name="debit"/>
<field name="credit"/>
<field name="quantity"/>
@@ -1269,7 +1320,7 @@
<group col="2" colspan="2">
<separator colspan="2" string="Dates"/>
<field name="date" select="1"/>
<field name="date"/>
<field name="date_maturity"/>
<field name="date_created"/>
</group>
@@ -1355,15 +1406,15 @@
<separator orientation="vertical"/>
<filter icon="terp-stock_zoom" string="To Review" domain="[('to_check','=',True)]" groups="base.group_extended" help="Journal Entries to Review"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="ref" select="1"/>
<field name="partner_id" select='1'/>
<field name="date" select='1'/>
<field name="name"/>
<field name="ref"/>
<field name="partner_id"/>
<field name="date"/>
</group>
<newline/>
<group col='8' colspan='4'>
<field name="journal_id" widget="selection" select='1'/>
<field name="period_id" select='1'/>
<field name="journal_id" widget="selection"/>
<field name="period_id"/>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="12" col="10">
@@ -1386,6 +1437,7 @@
<field name="view_mode">tree,form,graph</field>
<field name="view_id" ref="view_move_tree"/>
<field name="search_view_id" ref="view_account_move_filter"/>
<field name="help">A journal entry consists of several journal items, each of which is either a debit or a credit. OpenERP creates automatically one journal entry per accounting document: invoices, refund, supplier payment, bank statements, etc.</field>
</record>
<menuitem
@@ -1393,7 +1445,7 @@
action="action_move_journal_line"
id="menu_action_move_journal_line_form"
parent="account.menu_finance_entries"
groups="group_account_user"
groups="group_account_user,group_account_manager"
sequence="5"/>
<record id="action_move_line_form" model="ir.actions.act_window">
@@ -1471,7 +1523,7 @@
<field name="type"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency)"/>
<field domain="[('journal_id', '=', parent.journal_id)]" name="account_id"/>
<field name="analytic_account_id" groups="base.group_extended" />
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" />
<field name="amount"/>
<field context="{'partner_id': partner_id, 'amount': amount, 'account_id': account_id, 'date':date}" name="reconcile_id"/>
</form>
@@ -1505,7 +1557,7 @@
<menuitem
name="Manual Reconcilication" icon="STOCK_EXECUTE"
name="Manual Reconciliation" icon="STOCK_EXECUTE"
action="action_account_manual_reconcile"
id="menu_manual_reconcile"
parent="account.periodical_processing_reconciliation"/>
@@ -1603,9 +1655,9 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Journal Entry Model">
<field name="name" select="1"/>
<field name="journal_id" select="1"/>
<field name="company_id" select="1" widget='selection' groups="base.group_multi_company"/>
<field name="name"/>
<field name="journal_id"/>
<field name="company_id" widget='selection' groups="base.group_multi_company"/>
<field colspan="4" nolabel="1" name="lines_id" height="250" widget="one2many_list"/>
<separator string="Legend" colspan="4"/>
<field name="legend" colspan="4" nolabel="1"/>
@@ -1641,7 +1693,7 @@
<separator orientation="vertical"/>
<field name="name"/>
<field name="journal_id" widget="selection"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
<newline/>
<group expand="0" string="Group By...">
@@ -1660,7 +1712,7 @@
</record>
<menuitem
action="action_model_form" id="menu_action_model_form" sequence="5"
parent="account.menu_configuration_misc" groups="base.group_extended"/>
parent="account.menu_configuration_misc" groups="base.group_extended,group_account_manager"/>
<!--
# Payment Terms
@@ -1723,6 +1775,18 @@
</field>
</record>
<record id="view_payment_term_search" model="ir.ui.view">
<field name="name">account.payment.term.search</field>
<field name="model">account.payment.term</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Payment Term">
<field name="name"/>
<field name="active"/>
</search>
</field>
</record>
<record id="view_payment_term_form" model="ir.ui.view">
<field name="name">account.payment.term.form</field>
<field name="model">account.payment.term</field>
@@ -1745,6 +1809,7 @@
<field name="res_model">account.payment.term</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_payment_term_search"/>
</record>
<menuitem action="action_payment_term_form"
id="menu_action_payment_term_form" parent="menu_configuration_misc"
@@ -1862,7 +1927,7 @@
</record>
<menuitem
name="Define Recurring Entries" action="action_subscription_form"
groups="base.group_extended"
groups="base.group_extended,group_account_manager,group_account_user"
id="menu_action_subscription_form" sequence="1"
parent="account.menu_finance_recurrent_entries"/>
@@ -1999,17 +2064,17 @@
id="account_template_folder"
name="Templates"
parent="menu_finance_accounting"
groups="base.group_multi_company"/>
groups="base.group_multi_company,group_account_manager"/>
<menuitem
id="account_template_taxes"
name="Taxes"
parent="account_template_folder"
groups="base.group_multi_company" sequence="2"/>
groups="base.group_multi_company,group_account_manager" sequence="2"/>
<menuitem
id="account_template_accounts"
name="Accounts"
parent="account_template_folder"
groups="base.group_multi_company" sequence="1"/>
groups="base.group_multi_company,group_account_manager" sequence="1"/>
<record id="view_account_template_form" model="ir.ui.view">
@@ -2084,6 +2149,7 @@
<field name="res_model">account.account.template</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,search</field>
<field name="search_view_id" ref="view_account_template_search"/>
</record>
<menuitem action="action_account_template_form" id="menu_action_account_template_form" parent="account_template_accounts"/>
@@ -2243,7 +2309,6 @@
<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"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="description"/>
<field name="chart_template_id"/>
@@ -2257,6 +2322,7 @@
<field name="res_model">account.tax.template</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_account_tax_template_search"/>
</record>
<menuitem action="action_account_tax_template_form" id="menu_action_account_tax_template_form" parent="account_template_taxes" sequence="13"/>
@@ -2317,6 +2383,7 @@
<field name="res_model">account.tax.code.template</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,search</field>
<field name="search_view_id" ref="view_tax_code_template_search"/>
</record>
<menuitem action="action_account_tax_code_template_form" id="menu_action_account_tax_code_template_form" parent="account_template_taxes" sequence="14"/>
@@ -2346,23 +2413,24 @@
<attribute name='string'></attribute>
</xpath>
<group string="res_config_contents" position="replace">
<field name="company_id" widget="selection"/>
<field name ="code_digits" />
<field name="chart_template_id" widget="selection"/>
<field name ="seq_journal" />
<field colspan="4" mode="tree" name="bank_accounts_id"
nolabel="1" widget="one2many_list">
<form string="Bank Information">
<field name="acc_name"/>
<field name="account_type"/>
<field name="currency_id" widget="selection"/>
</form>
<tree editable="bottom" string="Bank Information">
<field name="acc_name"/>
<field name="account_type"/>
<field name="currency_id" widget="selection"/>
</tree>
</field>
<field name="company_id" widget="selection"/>
<field name ="code_digits" groups="base.group_extended"/>
<field name="chart_template_id" widget="selection" on_change="onchange_chart_template_id(chart_template_id)"/>
<field name ="seq_journal" groups="base.group_extended"/>
<field name="sale_tax" domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False)]"/>
<field name="purchase_tax" domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False)]"/>
<field colspan="4" mode="tree" name="bank_accounts_id" nolabel="1" widget="one2many_list">
<form string="Bank Information">
<field name="acc_name"/>
<field name="account_type"/>
<field name="currency_id" widget="selection" groups="base.group_extended"/>
</form>
<tree editable="bottom" string="Bank Information">
<field name="acc_name"/>
<field name="account_type"/>
<field name="currency_id" widget="selection" groups="base.group_extended"/>
</tree>
</field>
</group>
</data>
</field>
@@ -2377,10 +2445,29 @@
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<record id="ir_actions_server_action_wizard_multi_chart" model="ir.actions.server">
<field name="type">ir.actions.server</field>
<field name="condition">True</field>
<field name="state">code</field>
<field name="model_id" ref="base.model_ir_actions_todo"/>
<field eval="5" name="sequence"/>
<field name="code">
act_window_ids = self.pool.get('ir.actions.act_window').search(cr, uid,[('name', 'in', ('Accounting Chart Configuration', 'Generate Chart of Accounts from a Chart Template'))], context=context)
todo_ids = self.pool.get('ir.actions.todo').search(cr, uid, [('action_id', 'in', act_window_ids)], context=context)
self.pool.get('ir.actions.todo').write(cr, uid, todo_ids, {'state':'open'}, context=context)
action = self.pool.get('res.config').next(cr, uid, [], context)
</field>
<field name="name">New Company Financial Setting</field>
</record>
<menuitem name="New Company Financial Setting" parent="account.account_template_folder"
groups="group_account_manager"
action="account.action_account_configuration_installer" id="menu_wizard"/>
<record id="menu_act_ir_actions_bleble" model="ir.ui.menu">
<field name="name">New Company Financial Setting</field>
<field eval="1" name="sequence"/>
<field name="parent_id" ref="account.menu_finance_accounting"/>
<field name="icon">STOCK_JUSTIFY_FILL</field>
<field name="action" ref="ir_actions_server_action_wizard_multi_chart"/>
</record>
<record id="account_account_graph" model="ir.ui.view">
<field name="name">account.account.graph</field>
@@ -2396,13 +2483,24 @@
<!-- Fiscal Position Templates -->
<record id="view_account_position_template_search" model="ir.ui.view">
<field name="name">account.fiscal.position.template.search</field>
<field name="model">account.fiscal.position.template</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Fiscal Position">
<field name="name"/>
</search>
</field>
</record>
<record id="view_account_position_template_form" model="ir.ui.view">
<field name="name">account.fiscal.position.template.form</field>
<field name="model">account.fiscal.position.template</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Fiscal Position Template">
<field name="name" select="1"/>
<field name="name"/>
<field name="chart_template_id"/>
<newline/>
<field name="tax_ids" colspan="4" nolabel="1">
@@ -2444,6 +2542,7 @@
<field name="res_model">account.fiscal.position.template</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_account_position_template_search"/>
</record>
<menuitem
@@ -2599,6 +2698,7 @@
<field name="search_view_id" ref="view_account_bank_statement_filter"/>
<field name="domain">[('journal_id.type', '=', 'cash')]</field>
<field name="context">{'journal_type':'cash'}</field>
<field name="help">Cash Register allows you to manage cash entries in your cash journals.</field>
</record>
<record model="ir.actions.act_window.view" id="act_cash_statement1_all">
<field name="sequence" eval="1"/>
@@ -2619,7 +2719,7 @@
<field name="act_window_id" ref="action_view_bank_statement_tree"/>
</record>
<menuitem action="action_view_bank_statement_tree" id="journal_cash_move_lines" parent="menu_finance_bank_and_cash"
groups="group_account_user"/>
groups="group_account_user,group_account_manager"/>
</data>
</openerp>
+18 -16
View File
@@ -20,22 +20,22 @@
<field name="view_mode">graph,tree</field>
<field name="domain">[('type','=','income')]</field>
</record>
<record id="action_company_analysis_tree" model="ir.actions.act_window">
<field name="name">Company Analysis</field>
<field name="res_model">account.entries.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{'group_by':['user_type'], 'group_by_no_leaf':1}</field>
<field name="view_id" ref="account.view_company_analysis_tree"/>
</record>
<record id="action_treasory_graph" model="ir.actions.act_window">
<field name="name">Treasory</field>
<field name="res_model">account.account</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<record id="action_company_analysis_tree" model="ir.actions.act_window">
<field name="name">Company Analysis</field>
<field name="res_model">account.entries.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{'group_by':['user_type'], 'group_by_no_leaf':1}</field>
<field name="view_id" ref="account.view_account_entries_report_tree"/>
</record>
<record id="action_treasory_graph" model="ir.actions.act_window">
<field name="name">Treasory</field>
<field name="res_model">account.account</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="domain">[('type','=','liquidity')]</field>
<field name="view_id" ref="account.view_treasory_graph"/>
</record>
</record>
<record id="board_account_form" model="ir.ui.view">
<field name="name">board.account.form</field>
<field name="model">board.board</field>
@@ -44,7 +44,7 @@
<form string="Account Board">
<hpaned>
<child1>
<action colspan="4" height="160" width="400" name="%(account.action_invoice_tree1)d" string="Draft Customer Invoices" domain="[('state','=','draft'),('type','=','out_invoice')]"/>
<action colspan="4" height="160" width="400" name="%(account.action_invoice_tree1)d" string="Customer Invoices to Validate" domain="[('state','=','draft'),('type','=','out_invoice')]"/>
<action colspan="4" height="160" width="400" name="%(action_company_analysis_tree)d" string="Company Analysis" />
</child1>
<child2>
@@ -68,6 +68,8 @@
<menuitem id="menu_dashboard_acc" name="Dashboard" sequence="2" parent="account.menu_finance_reporting" groups="group_account_user,group_account_manager"/>
<menuitem action="open_board_account" icon="terp-graph" id="menu_board_account" parent="menu_dashboard_acc" sequence="1"/>
<menuitem icon="terp-account" id="account.menu_finance" name="Accounting" sequence="13" action="open_board_account"/>
</data>
</openerp>
+1 -1
View File
@@ -33,7 +33,7 @@ class res_company(osv.osv):
method=True,
view_load=True,
domain="[('type', '=', 'payable')]",
help="This Account is used for transferring Profit/Loss(If It is Profit : Amount will be added, Loss : Amount will be deducted.), Which is calculated from Profit & Loss Report"),
help="This Account is used for transferring Profit/Loss(If It is Profit: Amount will be added, Loss : Amount will be deducted.), Which is calculated from Profit & Loss Report"),
}
_defaults = {
+35 -1
View File
@@ -2,6 +2,11 @@
<openerp>
<data noupdate="1">
<record id="analytic_journal_sale" model="account.analytic.journal">
<field name="name">Sales</field>
<field name="type">sale</field>
</record>
<!--
Payment term
-->
@@ -465,13 +470,42 @@
<field eval="3" name="padding"/>
<field name="prefix">SAJ/%(year)s/</field>
</record>
<record id="sequence_refund_sales_journal" model="ir.sequence">
<field name="name">Sales Credit Note Journal</field>
<field name="code">account.journal</field>
<field eval="3" name="padding"/>
<field name="prefix">SCNJ/%(year)s/</field>
</record>
<record id="sequence_purchase_journal" model="ir.sequence">
<field name="name">Purchase Journal</field>
<field name="code">account.journal</field>
<field eval="3" name="padding"/>
<field name="prefix">EXJ/%(year)s/</field>
</record>
<record id="sequence_refund_purchase_journal" model="ir.sequence">
<field name="name">Expenses Credit Notes Journal</field>
<field name="code">account.journal</field>
<field eval="3" name="padding"/>
<field name="prefix">ECNJ/%(year)s/</field>
</record>
<record id="sequence_bank_journal" model="ir.sequence">
<field name="name">Bank Journal</field>
<field name="code">account.journal</field>
<field eval="3" name="padding"/>
<field name="prefix">BNK/%(year)s/</field>
</record>
<record id="sequence_check_journal" model="ir.sequence">
<field name="name">Checks Journal</field>
<field name="code">account.journal</field>
<field eval="3" name="padding"/>
<field name="prefix">CHK/%(year)s/</field>
</record>
<record id="sequence_cash_journal" model="ir.sequence">
<field name="name">Cash Journal</field>
<field name="code">account.journal</field>
<field eval="3" name="padding"/>
<field name="prefix">CSH/%(year)s/</field>
</record>
<!--
Account Statement Sequences
-->
+5 -5
View File
@@ -357,7 +357,7 @@
<field name="type">sale_refund</field>
<field eval="True" name="refund_journal"/>
<field name="view_id" ref="account_sp_refund_journal_view"/>
<field name="sequence_id" ref="sequence_sale_journal"/>
<field name="sequence_id" ref="sequence_refund_sales_journal"/>
<field model="account.account" name="default_credit_account_id" ref="a_sale"/>
<field model="account.account" name="default_debit_account_id" ref="a_sale"/>
<field name="analytic_journal_id" ref="cose_journal_sale"/>
@@ -381,7 +381,7 @@
<field name="type">purchase_refund</field>
<field eval="True" name="refund_journal"/>
<field name="view_id" ref="account_sp_refund_journal_view"/>
<field name="sequence_id" ref="sequence_purchase_journal"/>
<field name="sequence_id" ref="sequence_refund_purchase_journal"/>
<field model="account.account" name="default_debit_account_id" ref="a_expense"/>
<field model="account.account" name="default_credit_account_id" ref="a_expense"/>
<field name="analytic_journal_id" ref="exp"/>
@@ -393,7 +393,7 @@
<field name="code">BNK</field>
<field name="type">bank</field>
<field name="view_id" ref="account_journal_bank_view"/>
<field name="sequence_id" ref="sequence_journal"/>
<field name="sequence_id" ref="sequence_bank_journal"/>
<field model="account.account" name="default_debit_account_id" ref="cash"/>
<field model="account.account" name="default_credit_account_id" ref="cash"/>
<field name="analytic_journal_id" ref="sit"/>
@@ -404,7 +404,7 @@
<field name="code">CHK</field>
<field name="type">bank</field>
<field name="view_id" ref="account_journal_bank_view"/>
<field name="sequence_id" ref="sequence_journal"/>
<field name="sequence_id" ref="sequence_check_journal"/>
<field model="account.account" name="default_debit_account_id" ref="cash"/>
<field model="account.account" name="default_credit_account_id" ref="cash"/>
<field name="analytic_journal_id" ref="sit"/>
@@ -415,7 +415,7 @@
<field name="code">CSH</field>
<field name="type">cash</field>
<field name="view_id" ref="account_journal_bank_view"/>
<field name="sequence_id" ref="sequence_journal"/>
<field name="sequence_id" ref="sequence_cash_journal"/>
<field model="account.account" name="default_debit_account_id" ref="cash"/>
<field model="account.account" name="default_credit_account_id" ref="cash"/>
<field name="analytic_journal_id" ref="sit"/>
File diff suppressed because it is too large Load Diff
+4 -5
View File
@@ -7,14 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-09-29 09:09+0000\n"
"Last-Translator: Albert Cervera i Areny - http://www.NaN-tic.com <albert@nan-"
"tic.com>\n"
"PO-Revision-Date: 2010-10-25 07:09+0000\n"
"Last-Translator: Carlos-smile <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-09-30 04:42+0000\n"
"X-Launchpad-Export-Date: 2010-10-26 04:40+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
@@ -1055,7 +1054,7 @@ msgstr "Hijos"
#. module: account
#: model:ir.model,name:account.model_account_fiscal_position_tax
msgid "Taxes Fiscal Mapping"
msgstr ""
msgstr "Mapeo de impuestos ficales"
#. module: account
#: model:ir.actions.act_window,name:account.action_invoice_tree2_new
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-10-13 15:51+0000\n"
"Last-Translator: zmmaj <Unknown>\n"
"PO-Revision-Date: 2010-10-14 07:28+0000\n"
"Last-Translator: OpenERP Administrators <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-10-14 04:45+0000\n"
"X-Launchpad-Export-Date: 2010-10-15 04:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
+3 -3
View File
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-09-09 07:08+0000\n"
"PO-Revision-Date: 2010-10-22 10:28+0000\n"
"Last-Translator: OpenERP Administrators <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-09-29 05:01+0000\n"
"X-Launchpad-Export-Date: 2010-10-23 04:51+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
@@ -4442,7 +4442,7 @@ msgstr ""
#. module: account
#: model:ir.actions.act_window,name:account.act_account_partner_account_move_unreconciled
msgid "Receivables & Payables"
msgstr ""
msgstr "Követelések és kötelezettségek"
#. module: account
#: rml:account.general.ledger:0
+10 -10
View File
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-09-29 11:28+0000\n"
"Last-Translator: OpenERP Administrators <Unknown>\n"
"PO-Revision-Date: 2010-10-25 21:04+0000\n"
"Last-Translator: Davide Corio - Domsense <davide.corio@domsense.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-09-30 04:41+0000\n"
"X-Launchpad-Export-Date: 2010-10-26 04:39+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
@@ -353,7 +353,7 @@ msgstr "Delta di Debito"
#: field:account.invoice,amount_tax:0
#: field:account.move.line,account_tax_id:0
msgid "Tax"
msgstr "Imposte"
msgstr "Tassa"
#. module: account
#: rml:account.general.journal:0
@@ -372,7 +372,7 @@ msgstr "Contabilità Analitica"
#: field:account.tax,child_depend:0
#: field:account.tax.template,child_depend:0
msgid "Tax on Children"
msgstr ""
msgstr "Calcolo su tasse figlie"
#. module: account
#: rml:account.central.journal:0
@@ -416,7 +416,7 @@ msgstr "Riconciliazione dei pagamenti"
#. module: account
#: model:account.journal,name:account.expenses_journal
msgid "Journal de frais"
msgstr ""
msgstr "Giornale Acquisti"
#. module: account
#: model:ir.actions.act_window,name:account.act_acc_analytic_acc_5_report_hr_timesheet_invoice_journal
@@ -494,7 +494,7 @@ msgstr "Rif"
#. module: account
#: field:account.tax.template,type_tax_use:0
msgid "Tax Use In"
msgstr ""
msgstr "Tassa usata per"
#. module: account
#: help:account.tax.template,include_base_amount:0
@@ -572,7 +572,7 @@ msgstr "Linea"
#. module: account
#: rml:account.analytic.account.cost_ledger:0
msgid "J.C. or Move name"
msgstr ""
msgstr "J.C. o nome movimento"
#. module: account
#: selection:account.tax,applicable_type:0
@@ -634,7 +634,7 @@ msgstr "(Tenere vuoto per aprire la situazione corrente)"
#. module: account
#: model:ir.model,name:account.model_account_fiscal_position_account
msgid "Accounts Fiscal Mapping"
msgstr ""
msgstr "Mappatura Posizioni Fiscali"
#. module: account
#: field:account.analytic.account,contact_id:0
@@ -666,7 +666,7 @@ msgstr "Sconto (%)"
#: wizard_field:account.move.line.reconcile,init_full,writeoff:0
#: wizard_field:account.move.line.reconcile,init_partial,writeoff:0
msgid "Write-Off amount"
msgstr ""
msgstr "Conto per storno"
#. module: account
#: help:account.fiscalyear,company_id:0
+137 -133
View File
File diff suppressed because it is too large Load Diff
+6 -6
View File
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-10-04 06:51+0000\n"
"PO-Revision-Date: 2010-10-25 07:13+0000\n"
"Last-Translator: Chertykov Denis <chertykov@gmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-10-05 04:57+0000\n"
"X-Launchpad-Export-Date: 2010-10-26 04:39+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
@@ -1348,7 +1348,7 @@ msgstr "Сообщение"
#. module: account
#: model:process.node,note:account.process_node_supplierpaymentorder0
msgid "Select invoices you want to pay and manages advances"
msgstr ""
msgstr "Выберите счета для оплаты и авансирования"
#. module: account
#: selection:account.account,type:0
@@ -1513,7 +1513,7 @@ msgstr ""
#. module: account
#: field:account.journal,refund_journal:0
msgid "Refund Journal"
msgstr ""
msgstr "Журнал возвратов"
#. module: account
#: model:account.account.type,name:account.account_type_income
@@ -2380,7 +2380,7 @@ msgstr ""
#. module: account
#: rml:account.journal.period.print:0
msgid "Voucher No"
msgstr ""
msgstr "Ваучер №"
#. module: account
#: model:ir.actions.wizard,name:account.wizard_automatic_reconcile
@@ -4294,7 +4294,7 @@ msgstr "Период счета"
#. module: account
#: wizard_field:account.invoice.pay,init,journal_id:0
msgid "Journal/Payment Mode"
msgstr ""
msgstr "Журнал/Форма оплаты"
#. module: account
#: rml:account.invoice:0
+44 -26
View File
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-10-13 16:24+0000\n"
"PO-Revision-Date: 2010-10-25 21:56+0000\n"
"Last-Translator: zmmaj <Unknown>\n"
"Language-Team: Serbian <sr@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-10-14 04:45+0000\n"
"X-Launchpad-Export-Date: 2010-10-26 04:39+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
@@ -80,7 +80,7 @@ msgstr ""
#. module: account
#: help:account.invoice,period_id:0
msgid "Keep empty to use the period of the validation(invoice) date."
msgstr ""
msgstr "Ostavi prazno da bi koristio validacioni period ( racuna) datuma."
#. module: account
#: wizard_view:account.automatic.reconcile,reconcile:0
@@ -501,6 +501,8 @@ msgid ""
"Set if the amount of tax must be included in the base amount before "
"computing the next taxes."
msgstr ""
"Postavi ovo ukoliko iznos ovog poreza mora biti ukljucen u osnovicu pre "
"izračuna sledećeg poreza."
#. module: account
#: model:ir.ui.menu,name:account.menu_finance_periodical_processing
@@ -569,7 +571,7 @@ msgstr "Red"
#. module: account
#: rml:account.analytic.account.cost_ledger:0
msgid "J.C. or Move name"
msgstr ""
msgstr "J.C. ili pomeri ime"
#. module: account
#: selection:account.tax,applicable_type:0
@@ -589,7 +591,7 @@ msgstr ""
#. module: account
#: model:ir.model,name:account.model_account_tax
msgid "account.tax"
msgstr ""
msgstr "account.tax"
#. module: account
#: rml:account.central.journal:0
@@ -599,13 +601,13 @@ msgstr "Datum štampe"
#. module: account
#: rml:account.general.ledger:0
msgid "Mvt"
msgstr ""
msgstr "Mvt"
#. module: account
#: model:ir.actions.wizard,name:account.wizard_aged_trial_balance
#: model:ir.ui.menu,name:account.menu_aged_trial_balance
msgid "Aged Partner Balance"
msgstr ""
msgstr "Godisnja potraživanja/obaveze partnera"
#. module: account
#: view:account.journal:0
@@ -618,6 +620,7 @@ msgid ""
"The sequence field is used to order the resources from lower sequences to "
"higher ones"
msgstr ""
"Ovo polje se koristi da se odredi redosled resursa od najnizeg ka najvecem"
#. module: account
#: wizard_view:account.analytic.account.chart,init:0
@@ -726,12 +729,12 @@ msgstr "Ukupan iznos dugovanja kupca"
#. module: account
#: view:account.move.line:0
msgid "St."
msgstr ""
msgstr "St."
#. module: account
#: model:ir.actions.act_window,name:account.action_tax_code_line_open
msgid "account.move.line"
msgstr ""
msgstr "account.move.line"
#. module: account
#: model:process.transition,name:account.process_transition_supplieranalyticcost0
@@ -773,7 +776,7 @@ msgstr "Delimično plaćanje"
#. module: account
#: wizard_view:account_use_models,create:0
msgid "Move Lines Created."
msgstr ""
msgstr "Kreirani redovi prenosa"
#. module: account
#: field:account.fiscalyear,state:0
@@ -920,6 +923,8 @@ msgid ""
"If a default tax is given in the partner it only overrides taxes from "
"accounts (or products) in the same group."
msgstr ""
"Ako je dat podrazumevani porez partnera, on samo upisuje poreze iz naloga ( "
"ili proizvoda) iste grupe."
#. module: account
#: wizard_field:account.open_closed_fiscalyear,init,fyear_id:0
@@ -1024,7 +1029,7 @@ msgstr "Neto Ukupno"
#: model:ir.model,name:account.model_account_fiscal_position
#: field:res.partner,property_account_position:0
msgid "Fiscal Mapping"
msgstr ""
msgstr "Poreska mapiranja"
#. module: account
#: field:account.analytic.line,product_uom_id:0
@@ -1167,7 +1172,7 @@ msgstr "Iznos je predstavljen opciono u drugoj valuti"
#: view:account.fiscal.position.template:0
#: field:account.fiscal.position.template,name:0
msgid "Fiscal Mapping Template"
msgstr ""
msgstr "Predlozak poreskog mapiranja"
#. module: account
#: field:account.payment.term,line_ids:0
@@ -1238,7 +1243,7 @@ msgstr "Valuta preduzeca"
#. module: account
#: model:ir.model,name:account.model_account_fiscal_position_account_template
msgid "Template Account Fiscal Mapping"
msgstr ""
msgstr "Predlozak poreskog mapiranja konta"
#. module: account
#: field:account.analytic.account,parent_id:0
@@ -2023,7 +2028,7 @@ msgstr "Iznos poreza"
#. module: account
#: rml:account.analytic.account.quantity_cost_ledger:0
msgid "J.C./Move name"
msgstr ""
msgstr "J.C./Pomeri ime"
#. module: account
#: field:account.journal.period,name:0
@@ -2034,7 +2039,7 @@ msgstr "Naziv dnevnika-razdoblja"
#: field:account.tax.code,name:0
#: field:account.tax.code.template,name:0
msgid "Tax Case Name"
msgstr ""
msgstr "Naziv pozicije PDV obrasca"
#. module: account
#: help:account.journal,entry_posted:0
@@ -2043,6 +2048,9 @@ msgid ""
"'draft' state and instead goes directly to the 'posted state' without any "
"manual validation."
msgstr ""
"Cekirajte ovde ukoliko ne zelite da novi nalog ne prolazi \" pripremni "
"stadijum\" vec zelite da ode u \" zakljuceno stanje\" bez ikakve rucne "
"validacije"
#. module: account
#: field:account.bank.statement.line,partner_id:0
@@ -2104,7 +2112,7 @@ msgstr "Period početnog stanja"
#: model:ir.actions.wizard,name:account.wizard_validate_account_moves_line
#: model:ir.ui.menu,name:account.menu_validate_account_moves
msgid "Validate Account Moves"
msgstr ""
msgstr "Potvrdi osnovice"
#. module: account
#: selection:account.subscription,period_type:0
@@ -2375,7 +2383,7 @@ msgstr "Predložak kontnog plana"
#. module: account
#: model:account.journal,name:account.refund_sales_journal
msgid "Journal d'extourne"
msgstr ""
msgstr "Dnevnik povrata"
#. module: account
#: rml:account.journal.period.print:0
@@ -2469,7 +2477,7 @@ msgstr "Otvori dnevnik"
#. module: account
#: rml:account.analytic.account.journal:0
msgid "KI"
msgstr ""
msgstr "KI"
#. module: account
#: model:ir.actions.wizard,name:account.action_account_analytic_line
@@ -2682,10 +2690,10 @@ msgid ""
"partners accounts (for debit/credit computations), closed for deprecated "
"accounts."
msgstr ""
"Sintetički zbirni konto, ne sadrži knjiženja\r\n"
"Konsolidacija: Zbirni konto za više preduzeća i paralelne kontne planove\r\n"
"Obveze: Salda konta partnera - dobavljači\r\n"
"Potraživanja: Salda konta partnera - kupci\r\n"
"Sintetički zbirni konto, ne sadrži knjiženja\n"
"Konsolidacija: Zbirni konto za više preduzeća i paralelne kontne planove\n"
"Obveze: Salda konta partnera - dobavljači\n"
"Potraživanja: Salda konta partnera - kupci\n"
"Zatvoren: Za konta koja se više ne koriste"
#. module: account
@@ -3151,7 +3159,7 @@ msgstr "Osnova"
#. module: account
#: field:account.model,name:0
msgid "Model Name"
msgstr ""
msgstr "Naziv modela"
#. module: account
#: selection:account.account,type:0
@@ -3404,6 +3412,8 @@ msgid ""
"This account will be used instead of the default one as the receivable "
"account for the current partner"
msgstr ""
"Ovaj ce se nalog koristiti umesto podrazumevanog kao prijemni nalog datog "
"partnera"
#. module: account
#: selection:account.tax,applicable_type:0
@@ -3490,6 +3500,7 @@ msgid ""
"The amount expressed in an optional other currency if it is a multi-currency "
"entry."
msgstr ""
"Iznos troskova u drugoj opcionoj valuti ako je ovo multi-valutni sadrzaj"
#. module: account
#: field:account.tax,parent_id:0
@@ -3907,6 +3918,8 @@ msgid ""
"This account will be used instead of the default one to value outgoing stock "
"for the current product"
msgstr ""
"Ovaj nalog ce se koristiti umesto podrazumevanog da potvrdi izlazni magacin "
"za dati prozivod"
#. module: account
#: model:process.node,note:account.process_node_manually0
@@ -4444,6 +4457,9 @@ msgid ""
"to the higher ones. The order is important if you have a tax with several "
"tax children. In this case, the evaluation order is important."
msgstr ""
"Ovo polje se korosti da odredi redosled poreza od najmanjeg do najveceg. "
"Ovaj redosled je vazan ako imate porez sa nekoliko podporeza,\r\n"
"U tom slucaju, evolucioni poredak je jako vazan."
#. module: account
#: view:account.tax:0
@@ -4510,7 +4526,7 @@ msgstr "Opcione kolicine u stavkama"
#: rml:account.third_party_ledger:0
#: rml:account.third_party_ledger_other:0
msgid "JNRL"
msgstr ""
msgstr "JNRL"
#. module: account
#: view:account.fiscalyear:0
@@ -5265,7 +5281,7 @@ msgstr "Predznak na izveštajima"
#. module: account
#: help:account.move.line,currency_id:0
msgid "The optional other currency if it is a multi-currency entry."
msgstr ""
msgstr "Opciona druga valuta ako je ovo multi-valutni sadrzaj"
#. module: account
#: view:account.invoice:0
@@ -5747,6 +5763,8 @@ msgid ""
"This account will be used instead of the default one as the payable account "
"for the current partner"
msgstr ""
"Ovaj nalog ce se koristiti umesto podrazumevanog kao platni nalog za datog "
"partnera"
#. module: account
#: field:account.tax.code,code:0
@@ -6066,7 +6084,7 @@ msgstr "Dospela potraživanja"
#. module: account
#: model:ir.module.module,shortdesc:account.module_meta_information
msgid "Board for accountant"
msgstr ""
msgstr "Tabla Naloga"
#. module: account
#: model:ir.actions.act_window,name:account.action_aged_income
+301 -284
View File
@@ -35,100 +35,105 @@ class account_installer(osv.osv_memory):
_inherit = 'res.config.installer'
def _get_default_accounts(self, cr, uid, context=None):
accounts = [{'acc_name':'Current','account_type':'bank'},
{'acc_name':'Deposit','account_type':'bank'},
{'acc_name':'Cash','account_type':'cash'}]
accounts = [{'acc_name': 'Current', 'account_type': 'bank'},
{'acc_name': 'Deposit', 'account_type': 'bank'},
{'acc_name': 'Cash', 'account_type': 'cash'}]
return accounts
def _get_charts(self, cr, uid, context=None):
modules = self.pool.get('ir.module.module')
ids = modules.search(cr, uid, [('category_id','=','Account Charts')])
ids = modules.search(cr, uid, [('category_id', '=', 'Account Charts')], context=context)
charts = list(
sorted(((m.name, m.shortdesc)
for m in modules.browse(cr, uid, ids)),
key=itemgetter(1)))
charts.insert(0,('configurable','Generic Chart Of Account'))
charts.insert(0, ('configurable', 'Generic Chart Of Account'))
return charts
_columns = {
# Accounting
'charts':fields.selection(_get_charts, 'Chart of Accounts',
'charts': fields.selection(_get_charts, 'Chart of Accounts',
required=True,
help="Installs localized accounting charts to match as closely as "
"possible the accounting needs of your company based on your "
"country."),
'date_start': fields.date('Start Date', required=True),
'date_stop': fields.date('End Date', required=True),
'period':fields.selection([('month','Monthly'), ('3months','3 Monthly')],
'Periods', required=True),
'bank_accounts_id': fields.one2many('account.bank.accounts.wizard', 'bank_account_id', 'Your Bank and Cash Accounts',required=True),
'sale_tax':fields.float('Sale Tax(%)'),
'purchase_tax':fields.float('Purchase Tax(%)'),
'period': fields.selection([('month', 'Monthly'), ('3months','3 Monthly')], 'Periods', required=True),
'bank_accounts_id': fields.one2many('account.bank.accounts.wizard', 'bank_account_id', 'Your Bank and Cash Accounts'),
'sale_tax': fields.float('Sale Tax(%)'),
'purchase_tax': fields.float('Purchase Tax(%)'),
'company_id': fields.many2one('res.company', 'Company'),
}
def _default_company(self, cr, uid, context=None):
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
if user.company_id:
return user.company_id.id
return False
return user.company_id and user.company_id.id or False
def _get_default_charts(self, cr, uid, context=None):
module_name = False
company_id = self._default_company(cr, uid, context=context)
company = self.pool.get('res.company').browse(cr, uid, company_id)
company = self.pool.get('res.company').browse(cr, uid, company_id, context=context)
address_id = self.pool.get('res.partner').address_get(cr, uid, [company.partner_id.id])
if address_id['default']:
address = self.pool.get('res.partner.address').browse(cr, uid, address_id['default'])
address = self.pool.get('res.partner.address').browse(cr, uid, address_id['default'], context=context)
code = address.country_id.code
module_name = (code and 'l10n_' + code.lower()) or False
if module_name:
module_id = self.pool.get('ir.module.module').search(cr, uid, [('name', '=', module_name)])
module_id = self.pool.get('ir.module.module').search(cr, uid, [('name', '=', module_name)], context=context)
if module_id:
return module_name
return 'configurable'
_defaults = {
'date_start': lambda *a: time.strftime('%Y-01-01'),
'date_stop': lambda *a: time.strftime('%Y-12-31'),
'period': lambda *a:'month',
'sale_tax': lambda *a:0.0,
'purchase_tax': lambda *a:0.0,
'date_start': time.strftime('%Y-01-01'),
'date_stop': time.strftime('%Y-12-31'),
'period': 'month',
'sale_tax': 0.0,
'purchase_tax': 0.0,
'company_id': _default_company,
'bank_accounts_id': _get_default_accounts,
'charts': _get_default_charts
}
def on_change_tax(self, cr, uid, id, tax):
return {'value':{'purchase_tax':tax}}
return {'value': {'purchase_tax': tax}}
def on_change_start_date(self, cr, uid, id, start_date=False):
if start_date:
start_date = datetime.datetime.strptime(start_date, "%Y-%m-%d")
end_date = (start_date + relativedelta(months=12)) - relativedelta(days=1)
return {'value':{'date_stop':end_date.strftime('%Y-%m-%d')}}
return {'value': {'date_stop': end_date.strftime('%Y-%m-%d')}}
return {}
def generate_configurable_chart(self, cr, uid, ids, context=None):
obj_acc = self.pool.get('account.account')
obj_acc_tax = self.pool.get('account.tax')
obj_journal = self.pool.get('account.journal')
obj_sequence = self.pool.get('ir.sequence')
obj_acc_tax_code = self.pool.get('account.tax.code')
obj_acc_template = self.pool.get('account.account.template')
obj_acc_tax_template = self.pool.get('account.tax.code.template')
obj_fiscal_position_template = self.pool.get('account.fiscal.position.template')
obj_fiscal_position = self.pool.get('account.fiscal.position')
mod_obj = self.pool.get('ir.model.data')
analytic_journal_obj = self.pool.get('account.analytic.journal')
obj_acc_chart_template = self.pool.get('account.chart.template')
obj_acc_journal_view = self.pool.get('account.journal.view')
mod_obj = self.pool.get('ir.model.data')
obj_sequence = self.pool.get('ir.sequence')
property_obj = self.pool.get('ir.property')
fields_obj = self.pool.get('ir.model.fields')
obj_tax_fp = self.pool.get('account.fiscal.position.tax')
obj_ac_fp = self.pool.get('account.fiscal.position.account')
result = mod_obj._get_id(cr, uid, 'account', 'configurable_chart_template')
id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
obj_multi = self.pool.get('account.chart.template').browse(cr, uid, id)
id = mod_obj.read(cr, uid, [result], ['res_id'], context=context)[0]['res_id']
obj_multi = obj_acc_chart_template.browse(cr, uid, id, context=context)
record = self.browse(cr, uid, ids, context=context)[0]
if context is None:
context = {}
company_id = self.browse(cr, uid, ids, context)[0].company_id
company_id = self.browse(cr, uid, ids, context=context)[0].company_id
seq_journal = True
# Creating Account
@@ -142,10 +147,10 @@ class account_installer(osv.osv_memory):
todo_dict = {}
#create all the tax code
children_tax_code_template = self.pool.get('account.tax.code.template').search(cr, uid, [('parent_id','child_of',[tax_code_root_id])], order='id')
children_tax_code_template = obj_acc_tax_template.search(cr, uid, [('parent_id', 'child_of', [tax_code_root_id])], order='id')
children_tax_code_template.sort()
for tax_code_template in self.pool.get('account.tax.code.template').browse(cr, uid, children_tax_code_template):
vals={
for tax_code_template in obj_acc_tax_template.browse(cr, uid, children_tax_code_template, context=context):
vals = {
'name': (tax_code_root_id == tax_code_template.id) and company_id.name or tax_code_template.name,
'code': tax_code_template.code,
'info': tax_code_template.info,
@@ -153,7 +158,7 @@ class account_installer(osv.osv_memory):
'company_id': company_id.id,
'sign': tax_code_template.sign,
}
new_tax_code = self.pool.get('account.tax.code').create(cr, uid, vals)
new_tax_code = obj_acc_tax_code.create(cr, uid, vals, context=context)
#recording the new tax code to do the mapping
tax_code_template_ref[tax_code_template.id] = new_tax_code
@@ -161,12 +166,12 @@ class account_installer(osv.osv_memory):
for tax in obj_multi.tax_template_ids:
#create it
vals_tax = {
'name':tax.name,
'name': tax.name,
'sequence': tax.sequence,
'amount':tax.amount,
'type':tax.type,
'amount': tax.amount,
'type': tax.type,
'applicable_type': tax.applicable_type,
'domain':tax.domain,
'domain': tax.domain,
'parent_id': tax.parent_id and ((tax.parent_id.id in tax_template_ref) and tax_template_ref[tax.parent_id.id]) or False,
'child_depend': tax.child_depend,
'python_compute': tax.python_compute,
@@ -181,11 +186,11 @@ class account_installer(osv.osv_memory):
'ref_base_sign': tax.ref_base_sign,
'ref_tax_sign': tax.ref_tax_sign,
'include_base_amount': tax.include_base_amount,
'description':tax.description,
'description': tax.description,
'company_id': company_id.id,
'type_tax_use': tax.type_tax_use
}
new_tax = obj_acc_tax.create(cr, uid, vals_tax)
new_tax = obj_acc_tax.create(cr, uid, vals_tax, context=context)
#as the accounts have not been created yet, we have to wait before filling these fields
todo_dict[new_tax] = {
'account_collected_id': tax.account_collected_id and tax.account_collected_id.id or False,
@@ -196,9 +201,9 @@ class account_installer(osv.osv_memory):
#deactivate the parent_store functionnality on account_account for rapidity purpose
self.pool._init = True
children_acc_template = obj_acc_template.search(cr, uid, [('parent_id','child_of',[obj_acc_root.id]),('nocreate','!=',True)])
children_acc_template = obj_acc_template.search(cr, uid, [('parent_id', 'child_of', [obj_acc_root.id]), ('nocreate', '!=', True)], context=context)
children_acc_template.sort()
for account_template in obj_acc_template.browse(cr, uid, children_acc_template):
for account_template in obj_acc_template.browse(cr, uid, children_acc_template, context=context):
tax_ids = []
for tax in account_template.tax_ids:
tax_ids.append(tax_template_ref[tax.id])
@@ -207,9 +212,9 @@ class account_installer(osv.osv_memory):
dig = 6
code_main = account_template.code and len(account_template.code) or 0
code_acc = account_template.code or ''
if code_main>0 and code_main<=dig and account_template.type != 'view':
code_acc=str(code_acc) + (str('0'*(dig-code_main)))
vals={
if code_main > 0 and code_main <= dig and account_template.type != 'view':
code_acc = str(code_acc) + (str('0'*(dig-code_main)))
vals = {
'name': (obj_acc_root.id == account_template.id) and company_id.name or account_template.name,
#'sign': account_template.sign,
'currency_id': account_template.currency_id and account_template.currency_id.id or False,
@@ -220,13 +225,13 @@ class account_installer(osv.osv_memory):
'shortcut': account_template.shortcut,
'note': account_template.note,
'parent_id': account_template.parent_id and ((account_template.parent_id.id in acc_template_ref) and acc_template_ref[account_template.parent_id.id]) or False,
'tax_ids': [(6,0,tax_ids)],
'tax_ids': [(6, 0, tax_ids)],
'company_id': company_id.id,
}
new_account = obj_acc.create(cr, uid, vals)
new_account = obj_acc.create(cr, uid, vals, context=context)
acc_template_ref[account_template.id] = new_account
if account_template.name == 'Bank Current Account':
b_vals={
b_vals = {
'name': 'Bank Accounts',
'code': '110500',
'type': 'view',
@@ -237,103 +242,111 @@ class account_installer(osv.osv_memory):
'tax_ids': [(6,0,tax_ids)],
'company_id': company_id.id,
}
bank_account = obj_acc.create(cr, uid, b_vals)
bank_account = obj_acc.create(cr, uid, b_vals, context=context)
view_id_cash = self.pool.get('account.journal.view').search(cr,uid,[('name','=','Bank/Cash Journal View')])[0] #why fixed name here?
view_id_cur = self.pool.get('account.journal.view').search(cr,uid,[('name','=','Bank/Cash Journal (Multi-Currency) View')])[0] #Why Fixed name here?
view_id_cash = obj_acc_journal_view.search(cr, uid, [('name', '=', 'Bank/Cash Journal View')], context=context)[0] #why fixed name here?
view_id_cur = obj_acc_journal_view.search(cr, uid, [('name', '=', 'Bank/Cash Journal (Multi-Currency) View')], context=context)[0] #Why Fixed name here?
cash_result = mod_obj._get_id(cr, uid, 'account', 'conf_account_type_cash')
cash_type_id = mod_obj.read(cr, uid, [cash_result], ['res_id'])[0]['res_id']
cash_type_id = mod_obj.read(cr, uid, [cash_result], ['res_id'], context=context)[0]['res_id']
bank_result = mod_obj._get_id(cr, uid, 'account', 'conf_account_type_bnk')
bank_type_id = mod_obj.read(cr, uid, [bank_result], ['res_id'])[0]['res_id']
bank_type_id = mod_obj.read(cr, uid, [bank_result], ['res_id'], context=context)[0]['res_id']
check_result = mod_obj._get_id(cr, uid, 'account', 'conf_account_type_chk')
check_type_id = mod_obj.read(cr, uid, [check_result], ['res_id'])[0]['res_id']
check_type_id = mod_obj.read(cr, uid, [check_result], ['res_id'], context=context)[0]['res_id']
# record = self.browse(cr, uid, ids, context=context)[0]
code_cnt = 1
vals_seq = {
'name': _('Bank Journal '),
'code': 'account.journal',
'prefix': 'BAN/',
'padding': 5
}
seq_id = obj_sequence.create(cr,uid,vals_seq)
'name': _('Bank Journal '),
'code': 'account.journal',
'prefix': 'BNK/%(year)s/',
'padding': 5
}
seq_id = obj_sequence.create(cr, uid, vals_seq, context=context)
#create the bank journals
analitical_bank_ids = analytic_journal_obj.search(cr,uid,[('type','=','situation')])
analitical_bank_ids = analytic_journal_obj.search(cr, uid, [('type', '=', 'situation')], context=context)
analitical_journal_bank = analitical_bank_ids and analitical_bank_ids[0] or False
vals_journal = {}
vals_journal['name']= _('Bank Journal ')
vals_journal['code']= _('BNK')
vals_journal['sequence_id'] = seq_id
vals_journal['type'] = 'bank'
vals_journal['analytic_journal_id'] = analitical_journal_bank
vals_journal = {
'name': _('Bank Journal '),
'code': _('BNK'),
'sequence_id': seq_id,
'type': 'bank',
'analytic_journal_id': analitical_journal_bank
}
if vals.get('currency_id', False):
vals_journal['view_id'] = view_id_cur
vals_journal['currency'] = vals.get('currency_id', False)
vals_journal.update({
'view_id': view_id_cur,
'currency': vals.get('currency_id', False)
})
else:
vals_journal['view_id'] = view_id_cash
vals_journal['default_credit_account_id'] = new_account
vals_journal['default_debit_account_id'] = new_account
obj_journal.create(cr,uid,vals_journal)
vals_journal.update({'view_id': view_id_cash})
vals_journal.update({
'default_credit_account_id': new_account,
'default_debit_account_id': new_account,
})
obj_journal.create(cr, uid, vals_journal, context=context)
for val in record.bank_accounts_id:
seq_prefix = None
seq_padding = 5
if val.account_type == 'cash':
type = cash_type_id
seq_prefix = "CSH/"
elif val.account_type == 'bank':
type = bank_type_id
seq_prefix = "BAN/"
elif val.account_type == 'check':
type = check_type_id
seq_prefix = "CHK/"
else:
type = check_type_id
seq_padding = None
vals_bnk = {'name': val.acc_name or '',
vals_bnk = {
'name': val.acc_name or '',
'currency_id': val.currency_id.id or False,
'code': str(110500 + code_cnt),
'type': 'liquidity',
'user_type': type,
'parent_id':bank_account,
'company_id': company_id.id }
child_bnk_acc = obj_acc.create(cr, uid, vals_bnk)
'parent_id': bank_account,
'company_id': company_id.id
}
child_bnk_acc = obj_acc.create(cr, uid, vals_bnk, context=context)
vals_seq_child = {
'name': _(vals_bnk['name']),
'name': _(vals_bnk['name'] + ' ' + 'Journal'),
'code': 'account.journal',
'prefix': seq_prefix,
'prefix': _((vals_bnk['name'][:3].upper()) + '/%(year)s/'),
'padding': seq_padding
}
seq_id = obj_sequence.create(cr, uid, vals_seq_child)
}
seq_id = obj_sequence.create(cr, uid, vals_seq_child, context=context)
#create the bank journal
vals_journal = {}
vals_journal['name']= vals_bnk['name'] + ' Journal'
vals_journal['code']= _(vals_bnk['name'][:3])
vals_journal['sequence_id'] = seq_id
vals_journal['type'] = 'cash'
vals_journal = {
'name': vals_bnk['name'] + _(' Journal'),
'code': _(vals_bnk['name'][:3]).upper(),
'sequence_id': seq_id,
'type': 'cash',
}
if vals.get('currency_id', False):
vals_journal['view_id'] = view_id_cur
vals_journal['currency'] = vals_bnk.get('currency_id', False)
vals_journal.update({
'view_id': view_id_cur,
'currency': vals_bnk.get('currency_id', False),
})
else:
vals_journal['view_id'] = view_id_cash
vals_journal['default_credit_account_id'] = child_bnk_acc
vals_journal['default_debit_account_id'] = child_bnk_acc
vals_journal['analytic_journal_id'] = analitical_journal_bank
obj_journal.create(cr,uid,vals_journal)
vals_journal.update({'view_id': view_id_cash})
vals_journal.update({
'default_credit_account_id': child_bnk_acc,
'default_debit_account_id': child_bnk_acc,
'analytic_journal_id': analitical_journal_bank
})
obj_journal.create(cr, uid, vals_journal, context=context)
code_cnt += 1
#reactivate the parent_store functionality on account_account
self.pool._init = False
self.pool.get('account.account')._parent_store_compute(cr)
obj_acc._parent_store_compute(cr)
for key,value in todo_dict.items():
for key, value in todo_dict.items():
if value['account_collected_id'] or value['account_paid_id']:
obj_acc_tax.write(cr, uid, [key], {
'account_collected_id': acc_template_ref[value['account_collected_id']],
@@ -341,173 +354,185 @@ class account_installer(osv.osv_memory):
})
# Creating Journals Sales and Purchase
vals_journal={}
data_id = mod_obj.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_sp_journal_view')])
data = mod_obj.browse(cr, uid, data_id[0])
vals_journal = {}
data_id = mod_obj.search(cr, uid, [('model', '=', 'account.journal.view'), ('name', '=', 'account_sp_journal_view')], context=context)
data = mod_obj.browse(cr, uid, data_id[0], context=context)
view_id = data.res_id
seq_id = obj_sequence.search(cr,uid,[('name','=','Account Journal')])[0]
seq_id = obj_sequence.search(cr,uid,[('name', '=', 'Account Journal')], context=context)[0]
if seq_journal:
seq_sale = {
'name': 'Sale Journal',
'code': 'account.journal',
'prefix': '%(year)s/',
'padding': 3
}
seq_id_sale = obj_sequence.create(cr, uid, seq_sale)
'name': 'Sale Journal',
'code': 'account.journal',
'prefix': 'SAJ/%(year)s/',
'padding': 3
}
seq_id_sale = obj_sequence.create(cr, uid, seq_sale, context=context)
seq_purchase = {
'name': 'Purchase Journal',
'code': 'account.journal',
'prefix': '%(year)s/',
'padding': 3
}
seq_id_purchase = obj_sequence.create(cr, uid, seq_purchase)
'name': 'Purchase Journal',
'code': 'account.journal',
'prefix': 'EXJ/%(year)s/',
'padding': 3
}
seq_id_purchase = obj_sequence.create(cr, uid, seq_purchase, context=context)
seq_refund_sale = {
'name': 'Sales Refund Journal',
'code': 'account.journal',
'prefix': 'SCNJ/%(year)s/',
'padding': 3
}
seq_id_sale_refund = obj_sequence.create(cr, uid, seq_refund_sale, context=context)
seq_refund_purchase = {
'name': 'Purchase Refund Journal',
'code': 'account.journal',
'prefix': 'ECNJ/%(year)s/',
'padding': 3
}
seq_id_purchase_refund = obj_sequence.create(cr, uid, seq_refund_purchase, context=context)
else:
seq_id_sale = seq_id
seq_id_purchase = seq_id
seq_id_sale_refund = seq_id
seq_id_purchase_refund = seq_id
vals_journal['view_id'] = view_id
#Sales Journal
analitical_sale_ids = analytic_journal_obj.search(cr,uid,[('type','=','sale')])
analitical_sale_ids = analytic_journal_obj.search(cr, uid, [('type','=','sale')], context=context)
analitical_journal_sale = analitical_sale_ids and analitical_sale_ids[0] or False
vals_journal['name'] = _('Sales Journal')
vals_journal['type'] = 'sale'
vals_journal['code'] = _('SAJ')
vals_journal['sequence_id'] = seq_id_sale
vals_journal['analytic_journal_id'] = analitical_journal_sale
vals_journal.update({
'name': _('Sales Journal'),
'type': 'sale',
'code': _('SAJ'),
'sequence_id': seq_id_sale,
'analytic_journal_id': analitical_journal_sale
})
if obj_multi.property_account_receivable:
vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.property_account_income_categ.id]
vals_journal['default_debit_account_id'] = acc_template_ref[obj_multi.property_account_income_categ.id]
obj_journal.create(cr,uid,vals_journal)
vals_journal.update({
'default_credit_account_id': acc_template_ref[obj_multi.property_account_income_categ.id],
'default_debit_account_id': acc_template_ref[obj_multi.property_account_income_categ.id],
})
obj_journal.create(cr, uid, vals_journal, context=context)
# Purchase Journal
analitical_purchase_ids = analytic_journal_obj.search(cr,uid,[('type','=','purchase')])
analitical_purchase_ids = analytic_journal_obj.search(cr, uid, [('type', '=', 'purchase')], context=context)
analitical_journal_purchase = analitical_purchase_ids and analitical_purchase_ids[0] or False
vals_journal['name'] = _('Purchase Journal')
vals_journal['type'] = 'purchase'
vals_journal['code'] = _('EXJ')
vals_journal['sequence_id'] = seq_id_purchase
vals_journal['analytic_journal_id'] = analitical_journal_purchase
vals_journal.update({
'name': _('Purchase Journal'),
'type': 'purchase',
'code': _('EXJ'),
'sequence_id': seq_id_purchase,
'analytic_journal_id': analitical_journal_purchase
})
if obj_multi.property_account_payable:
vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.property_account_expense_categ.id]
vals_journal['default_debit_account_id'] = acc_template_ref[obj_multi.property_account_expense_categ.id]
obj_journal.create(cr,uid,vals_journal)
vals_journal.update({
'default_credit_account_id': acc_template_ref[obj_multi.property_account_expense_categ.id],
'default_debit_account_id': acc_template_ref[obj_multi.property_account_expense_categ.id]
})
obj_journal.create(cr, uid, vals_journal, context=context)
# Creating Journals Sales Refund and Purchase Refund
vals_journal={}
data_id = mod_obj.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_sp_refund_journal_view')])
data = mod_obj.browse(cr, uid, data_id[0])
vals_journal = {}
data_id = mod_obj.search(cr, uid, [('model', '=', 'account.journal.view'), ('name', '=', 'account_sp_refund_journal_view')], context=context)
data = mod_obj.browse(cr, uid, data_id[0], context=context)
view_id = data.res_id
seq_id_sale_refund = seq_id_sale
seq_id_purchase_refund = seq_id_purchase
vals_journal['view_id'] = view_id
#Sales Refund Journal
vals_journal['name'] = _('Sales Refund Journal')
vals_journal['type'] = 'sale_refund'
vals_journal['refund_journal'] = True
vals_journal['code'] = _('SCNJ')
vals_journal['sequence_id'] = seq_id_sale_refund
vals_journal['analytic_journal_id'] = analitical_journal_sale
vals_journal = {
'view_id': view_id,
'name': _('Sales Refund Journal'),
'type': 'sale_refund',
'refund_journal': True,
'code': _('SCNJ'),
'sequence_id': seq_id_sale_refund,
'analytic_journal_id': analitical_journal_sale
}
if obj_multi.property_account_receivable:
vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.property_account_income_categ.id]
vals_journal['default_debit_account_id'] = acc_template_ref[obj_multi.property_account_income_categ.id]
vals_journal.update({
'default_credit_account_id': acc_template_ref[obj_multi.property_account_income_categ.id],
'default_debit_account_id': acc_template_ref[obj_multi.property_account_income_categ.id]
})
obj_journal.create(cr,uid,vals_journal)
obj_journal.create(cr, uid, vals_journal, context=context)
# Purchase Refund Journal
vals_journal['name'] = _('Purchase Refund Journal')
vals_journal['type'] = 'purchase_refund'
vals_journal['refund_journal'] = True
vals_journal['code'] = _('ECNJ')
vals_journal['sequence_id'] = seq_id_purchase_refund
vals_journal['analytic_journal_id'] = analitical_journal_purchase
vals_journal = {
'view_id': view_id,
'name': _('Purchase Refund Journal'),
'type': 'purchase_refund',
'refund_journal': True,
'code': _('ECNJ'),
'sequence_id': seq_id_purchase_refund,
'analytic_journal_id': analitical_journal_purchase
}
if obj_multi.property_account_payable:
vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.property_account_expense_categ.id]
vals_journal['default_debit_account_id'] = acc_template_ref[obj_multi.property_account_expense_categ.id]
obj_journal.create(cr,uid,vals_journal)
vals_journal.update({
'default_credit_account_id': acc_template_ref[obj_multi.property_account_expense_categ.id],
'default_debit_account_id': acc_template_ref[obj_multi.property_account_expense_categ.id]
})
obj_journal.create(cr, uid, vals_journal, context=context)
# Bank Journals
view_id_cash = self.pool.get('account.journal.view').search(cr, uid, [('name','=','Bank/Cash Journal View')])[0] #TOFIX: Why put fixed name ?
view_id_cur = self.pool.get('account.journal.view').search(cr, uid, [('name','=','Bank/Cash Journal (Multi-Currency) View')])[0] #TOFIX: why put fixed name?
view_id_cash = obj_acc_journal_view.search(cr, uid, [('name', '=', 'Bank/Cash Journal View')], context=context)[0] #TOFIX: Why put fixed name ?
view_id_cur = obj_acc_journal_view.search(cr, uid, [('name', '=', 'Bank/Cash Journal (Multi-Currency) View')], context=context)[0] #TOFIX: why put fixed name?
#create the properties
property_obj = self.pool.get('ir.property')
fields_obj = self.pool.get('ir.model.fields')
todo_list = [
('property_account_receivable','res.partner','account.account'),
('property_account_payable','res.partner','account.account'),
('property_account_expense_categ','product.category','account.account'),
('property_account_income_categ','product.category','account.account'),
('property_account_expense','product.template','account.account'),
('property_account_income','product.template','account.account'),
('property_reserve_and_surplus_account','res.company','account.account'),
('property_account_receivable', 'res.partner', 'account.account'),
('property_account_payable', 'res.partner', 'account.account'),
('property_account_expense_categ', 'product.category', 'account.account'),
('property_account_income_categ', 'product.category', 'account.account'),
('property_account_expense', 'product.template', 'account.account'),
('property_account_income', 'product.template', 'account.account'),
('property_reserve_and_surplus_account', 'res.company', 'account.account'),
]
for record in todo_list:
r = []
r = property_obj.search(cr, uid, [('name','=', record[0] ),('company_id','=',company_id.id)])
r = property_obj.search(cr, uid, [('name', '=', record[0]), ('company_id', '=', company_id.id)], context=context)
account = getattr(obj_multi, record[0])
field = fields_obj.search(cr, uid, [('name','=',record[0]),('model','=',record[1]),('relation','=',record[2])])
field = fields_obj.search(cr, uid, [('name', '=', record[0]), ('model', '=', record[1]), ('relation', '=', record[2])], context=context)
vals = {
'name': record[0],
'company_id': company_id.id,
'fields_id': field[0],
'value': account and 'account.account,'+str(acc_template_ref[account.id]) or False,
'value': account and 'account.account, '+str(acc_template_ref[account.id]) or False,
}
if r:
#the property exist: modify it
property_obj.write(cr, uid, r, vals)
property_obj.write(cr, uid, r, vals, context=context)
else:
#create the property
property_obj.create(cr, uid, vals)
fp_ids = obj_fiscal_position_template.search(cr, uid,[('chart_template_id', '=', obj_multi.id)])
property_obj.create(cr, uid, vals, context=context)
fp_ids = obj_fiscal_position_template.search(cr, uid, [('chart_template_id', '=', obj_multi.id)], context=context)
if fp_ids:
for position in obj_fiscal_position_template.browse(cr, uid, fp_ids):
for position in obj_fiscal_position_template.browse(cr, uid, fp_ids, context=context):
vals_fp = {
'company_id': company_id.id,
'name': position.name,
}
new_fp = obj_fiscal_position.create(cr, uid, vals_fp)
obj_tax_fp = self.pool.get('account.fiscal.position.tax')
obj_ac_fp = self.pool.get('account.fiscal.position.account')
'company_id': company_id.id,
'name': position.name,
}
new_fp = obj_fiscal_position.create(cr, uid, vals_fp, context=context)
for tax in position.tax_ids:
vals_tax = {
'tax_src_id': tax_template_ref[tax.tax_src_id.id],
'tax_dest_id': tax.tax_dest_id and tax_template_ref[tax.tax_dest_id.id] or False,
'position_id': new_fp,
}
obj_tax_fp.create(cr, uid, vals_tax)
'tax_src_id': tax_template_ref[tax.tax_src_id.id],
'tax_dest_id': tax.tax_dest_id and tax_template_ref[tax.tax_dest_id.id] or False,
'position_id': new_fp,
}
obj_tax_fp.create(cr, uid, vals_tax, context=context)
for acc in position.account_ids:
vals_acc = {
'account_src_id': acc_template_ref[acc.account_src_id.id],
'account_dest_id': acc_template_ref[acc.account_dest_id.id],
'position_id': new_fp,
}
obj_ac_fp.create(cr, uid, vals_acc)
'account_src_id': acc_template_ref[acc.account_src_id.id],
'account_dest_id': acc_template_ref[acc.account_dest_id.id],
'position_id': new_fp,
}
obj_ac_fp.create(cr, uid, vals_acc, context=context)
def execute(self, cr, uid, ids, context=None):
if context is None:
@@ -517,65 +542,65 @@ class account_installer(osv.osv_memory):
obj_acc = self.pool.get('account.account')
obj_tax_code = self.pool.get('account.tax.code')
obj_temp_tax_code = self.pool.get('account.tax.code.template')
obj_tax = self.pool.get('account.tax')
obj_product = self.pool.get('product.product')
ir_values = self.pool.get('ir.values')
super(account_installer, self).execute(cr, uid, ids, context=context)
record = self.browse(cr, uid, ids, context=context)[0]
company_id = record.company_id
for res in self.read(cr, uid, ids):
for res in self.read(cr, uid, ids, context=context):
if record.charts == 'configurable':
fp = tools.file_open(opj('account','configurable_account_chart.xml'))
tools.convert_xml_import(cr, 'account', fp, {}, 'init',True, None)
fp = tools.file_open(opj('account', 'configurable_account_chart.xml'))
tools.convert_xml_import(cr, 'account', fp, {}, 'init', True, None)
fp.close()
self.generate_configurable_chart(cr, uid, ids, context=context)
obj_tax = self.pool.get('account.tax')
obj_product = self.pool.get('product.product')
ir_values = self.pool.get('ir.values')
s_tax = (res.get('sale_tax',0.0))/100
p_tax = (res.get('purchase_tax',0.0))/100
s_tax = (res.get('sale_tax', 0.0))/100
p_tax = (res.get('purchase_tax', 0.0))/100
tax_val = {}
default_tax = []
pur_temp_tax = mod_obj._get_id(cr, uid, 'account', 'tax_code_base_purchases')
pur_temp_tax_id = mod_obj.read(cr, uid, [pur_temp_tax], ['res_id'])[0]['res_id']
pur_temp_tax_names = obj_temp_tax_code.read(cr, uid, [pur_temp_tax_id], ['name'])
pur_temp_tax_id = mod_obj.read(cr, uid, [pur_temp_tax], ['res_id'], context=context)[0]['res_id']
pur_temp_tax_names = obj_temp_tax_code.read(cr, uid, [pur_temp_tax_id], ['name'], context=context)
pur_tax_parent_name = pur_temp_tax_names and pur_temp_tax_names[0]['name'] or False
pur_taxcode_parent_id = obj_tax_code.search(cr, uid, [('name', 'ilike', pur_tax_parent_name)])
pur_taxcode_parent_id = obj_tax_code.search(cr, uid, [('name', 'ilike', pur_tax_parent_name)], context=context)
if pur_taxcode_parent_id:
pur_taxcode_parent_id = pur_taxcode_parent_id[0]
else:
pur_taxcode_parent_id = False
pur_temp_tax_paid = mod_obj._get_id(cr, uid, 'account', 'tax_code_input')
pur_temp_tax_paid_id = mod_obj.read(cr, uid, [pur_temp_tax_paid], ['res_id'])[0]['res_id']
pur_temp_tax_paid_names = obj_temp_tax_code.read(cr, uid, [pur_temp_tax_paid_id], ['name'])
pur_temp_tax_paid_id = mod_obj.read(cr, uid, [pur_temp_tax_paid], ['res_id'], context=context)[0]['res_id']
pur_temp_tax_paid_names = obj_temp_tax_code.read(cr, uid, [pur_temp_tax_paid_id], ['name'], context=context)
pur_tax_paid_parent_name = pur_temp_tax_names and pur_temp_tax_paid_names[0]['name'] or False
pur_taxcode_paid_parent_id = obj_tax_code.search(cr, uid, [('name', 'ilike', pur_tax_paid_parent_name)])
pur_taxcode_paid_parent_id = obj_tax_code.search(cr, uid, [('name', 'ilike', pur_tax_paid_parent_name)], context=context)
if pur_taxcode_paid_parent_id:
pur_taxcode_paid_parent_id = pur_taxcode_paid_parent_id[0]
else:
pur_taxcode_paid_parent_id = False
sale_temp_tax = mod_obj._get_id(cr, uid, 'account', 'tax_code_base_sales')
sale_temp_tax_id = mod_obj.read(cr, uid, [sale_temp_tax], ['res_id'])[0]['res_id']
sale_temp_tax_names = obj_temp_tax_code.read(cr, uid, [sale_temp_tax_id], ['name'])
sale_temp_tax_id = mod_obj.read(cr, uid, [sale_temp_tax], ['res_id'], context=context)[0]['res_id']
sale_temp_tax_names = obj_temp_tax_code.read(cr, uid, [sale_temp_tax_id], ['name'], context=context)
sale_tax_parent_name = sale_temp_tax_names and sale_temp_tax_names[0]['name'] or False
sale_taxcode_parent_id = obj_tax_code.search(cr, uid, [('name', 'ilike', sale_tax_parent_name)])
sale_taxcode_parent_id = obj_tax_code.search(cr, uid, [('name', 'ilike', sale_tax_parent_name)], context=context)
if sale_taxcode_parent_id:
sale_taxcode_parent_id = sale_taxcode_parent_id[0]
else:
sale_taxcode_parent_id = False
sale_temp_tax_paid = mod_obj._get_id(cr, uid, 'account', 'tax_code_output')
sale_temp_tax_paid_id = mod_obj.read(cr, uid, [sale_temp_tax_paid], ['res_id'])[0]['res_id']
sale_temp_tax_paid_names = obj_temp_tax_code.read(cr, uid, [sale_temp_tax_paid_id], ['name'])
sale_temp_tax_paid_id = mod_obj.read(cr, uid, [sale_temp_tax_paid], ['res_id'], context=context)[0]['res_id']
sale_temp_tax_paid_names = obj_temp_tax_code.read(cr, uid, [sale_temp_tax_paid_id], ['name'], context=context)
sale_tax_paid_parent_name = sale_temp_tax_paid_names and sale_temp_tax_paid_names[0]['name'] or False
sale_taxcode_paid_parent_id = obj_tax_code.search(cr, uid, [('name', 'ilike', sale_tax_paid_parent_name)])
sale_taxcode_paid_parent_id = obj_tax_code.search(cr, uid, [('name', 'ilike', sale_tax_paid_parent_name)], context=context)
if sale_taxcode_paid_parent_id:
sale_taxcode_paid_parent_id = sale_taxcode_paid_parent_id[0]
else:
sale_taxcode_paid_parent_id = False
if s_tax*100 > 0.0:
tax_account_ids = obj_acc.search(cr, uid, [('name','=','Tax Received')], context=context)
tax_account_ids = obj_acc.search(cr, uid, [('name', '=', 'Tax Received')], context=context)
sales_tax_account_id = tax_account_ids and tax_account_ids[0] or False
vals_tax_code = {
'name': 'TAX%s%%'%(s_tax*100),
@@ -583,8 +608,8 @@ class account_installer(osv.osv_memory):
'company_id': company_id.id,
'sign': 1,
'parent_id': sale_taxcode_parent_id
}
new_tax_code = self.pool.get('account.tax.code').create(cr, uid, vals_tax_code)
}
new_tax_code = obj_tax_code.create(cr, uid, vals_tax_code, context=context)
vals_paid_tax_code = {
'name': 'TAX Received %s%%'%(s_tax*100),
@@ -593,25 +618,24 @@ class account_installer(osv.osv_memory):
'sign': 1,
'parent_id': sale_taxcode_paid_parent_id
}
new_paid_tax_code = self.pool.get('account.tax.code').create(cr, uid, vals_paid_tax_code)
new_paid_tax_code = obj_tax_code.create(cr, uid, vals_paid_tax_code, context=context)
sales_tax = obj_tax.create(cr, uid,
{'name':'TAX%s%%'%(s_tax*100),
'description':'TAX%s%%'%(s_tax*100),
'amount':s_tax,
'base_code_id':new_tax_code,
'tax_code_id':new_paid_tax_code,
'type_tax_use':'sale',
'account_collected_id':sales_tax_account_id,
'account_paid_id':sales_tax_account_id
})
default_account_ids = obj_acc.search(cr, uid, [('name','=','Product Sales')],context=context)
{'name': 'TAX %s%%'%(s_tax*100),
'amount': s_tax,
'base_code_id': new_tax_code,
'tax_code_id': new_paid_tax_code,
'type_tax_use': 'sale',
'account_collected_id': sales_tax_account_id,
'account_paid_id': sales_tax_account_id
}, context=context)
default_account_ids = obj_acc.search(cr, uid, [('name', '=', 'Product Sales')], context=context)
if default_account_ids:
obj_acc.write(cr, uid, default_account_ids, {'tax_ids':[(6,0,[sales_tax])]})
tax_val.update({'taxes_id':[(6,0,[sales_tax])]})
default_tax.append(('taxes_id',sales_tax))
obj_acc.write(cr, uid, default_account_ids, {'tax_ids': [(6, 0, [sales_tax])]}, context=context)
tax_val.update({'taxes_id': [(6, 0, [sales_tax])]})
default_tax.append(('taxes_id', sales_tax))
if p_tax*100 > 0.0:
tax_account_ids = obj_acc.search(cr, uid, [('name','=','Tax Paid')], context=context)
tax_account_ids = obj_acc.search(cr, uid, [('name', '=', 'Tax Paid')], context=context)
purchase_tax_account_id = tax_account_ids and tax_account_ids[0] or False
vals_tax_code = {
'name': 'TAX%s%%'%(p_tax*100),
@@ -620,8 +644,7 @@ class account_installer(osv.osv_memory):
'sign': 1,
'parent_id': pur_taxcode_parent_id
}
new_tax_code = self.pool.get('account.tax.code').create(cr, uid, vals_tax_code)
new_tax_code = obj_tax_code.create(cr, uid, vals_tax_code, context=context)
vals_paid_tax_code = {
'name': 'TAX Paid %s%%'%(p_tax*100),
'code': 'TAX Paid %s%%'%(p_tax*100),
@@ -629,43 +652,44 @@ class account_installer(osv.osv_memory):
'sign': 1,
'parent_id': pur_taxcode_paid_parent_id
}
new_paid_tax_code = self.pool.get('account.tax.code').create(cr, uid, vals_paid_tax_code)
new_paid_tax_code = obj_tax_code.create(cr, uid, vals_paid_tax_code, context=context)
purchase_tax = obj_tax.create(cr, uid,
{'name':'TAX%s%%'%(p_tax*100),
'description':'TAX%s%%'%(p_tax*100),
'amount':p_tax,
'base_code_id':new_tax_code,
'tax_code_id':new_paid_tax_code,
'type_tax_use':'purchase',
'account_collected_id':purchase_tax_account_id,
'account_paid_id':purchase_tax_account_id
})
default_account_ids = obj_acc.search(cr, uid, [('name','=','Expenses')], context=context)
{'name': 'TAX%s%%'%(p_tax*100),
'description': 'TAX%s%%'%(p_tax*100),
'amount': p_tax,
'base_code_id': new_tax_code,
'tax_code_id': new_paid_tax_code,
'type_tax_use': 'purchase',
'account_collected_id': purchase_tax_account_id,
'account_paid_id': purchase_tax_account_id
}, context=context)
default_account_ids = obj_acc.search(cr, uid, [('name', '=', 'Expenses')], context=context)
if default_account_ids:
obj_acc.write(cr, uid, default_account_ids, {'tax_ids':[(6,0,[purchase_tax])]})
tax_val.update({'supplier_taxes_id':[(6,0,[purchase_tax])]})
default_tax.append(('supplier_taxes_id',purchase_tax))
obj_acc.write(cr, uid, default_account_ids, {'tax_ids': [(6, 0, [purchase_tax])]}, context=context)
tax_val.update({'supplier_taxes_id': [(6 ,0, [purchase_tax])]})
default_tax.append(('supplier_taxes_id', purchase_tax))
if tax_val:
product_ids = obj_product.search(cr, uid, [])
for product in obj_product.browse(cr, uid, product_ids):
obj_product.write(cr, uid, product.id, tax_val)
product_ids = obj_product.search(cr, uid, [], context=context)
for product in obj_product.browse(cr, uid, product_ids, context=context):
obj_product.write(cr, uid, product.id, tax_val, context=context)
for name, value in default_tax:
ir_values.set(cr, uid, key='default', key2=False, name=name, models =[('product.product',False)], value=[value])
ir_values.set(cr, uid, key='default', key2=False, name=name, models =[('product.product', False)], value=[value])
if 'date_start' in res and 'date_stop' in res:
f_ids = fy_obj.search(cr, uid, [('date_start', '<=', res['date_start']), ('date_stop', '>=', res['date_stop']), ('company_id','=',res['company_id'])])
f_ids = fy_obj.search(cr, uid, [('date_start', '<=', res['date_start']), ('date_stop', '>=', res['date_stop']), ('company_id', '=', res['company_id'])], context=context)
if not f_ids:
name = code = res['date_start'][:4]
if int(name) != int(res['date_stop'][:4]):
name = res['date_start'][:4] +'-'+ res['date_stop'][:4]
code = res['date_start'][2:4] +'-'+ res['date_stop'][2:4]
vals = {'name': name,
'code': code,
'date_start': res['date_start'],
'date_stop': res['date_stop'],
'company_id': res['company_id']
}
vals = {
'name': name,
'code': code,
'date_start': res['date_start'],
'date_stop': res['date_stop'],
'company_id': res['company_id']
}
fiscal_id = fy_obj.create(cr, uid, vals, context=context)
if res['period'] == 'month':
fy_obj.create_period(cr, uid, [fiscal_id])
@@ -690,13 +714,10 @@ class account_bank_accounts_wizard(osv.osv_memory):
_columns = {
'acc_name': fields.char('Account Name.', size=64, required=True),
'bank_account_id': fields.many2one('wizard.multi.charts.accounts', 'Bank Account', required=True),
'bank_account_id': fields.many2one('account.installer', 'Bank Account', required=True),
'currency_id': fields.many2one('res.currency', 'Secondary Currency', help="Forces all moves for this account to have this secondary currency."),
'account_type': fields.selection([('cash','Cash'),('check','Check'),('bank','Bank')], 'Account Type', size=32),
'account_type': fields.selection([('cash','Cash'), ('check','Check'), ('bank','Bank')], 'Account Type', size=32),
}
# _defaults = {
# 'currency_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.currency_id.id,
# }
account_bank_accounts_wizard()
@@ -704,26 +725,22 @@ class account_installer_modules(osv.osv_memory):
_name = 'account.installer.modules'
_inherit = 'res.config.installer'
_columns = {
# Accounting
'account_analytic_plans':fields.boolean('Multiple Analytic Plans',
'account_analytic_plans': fields.boolean('Multiple Analytic Plans',
help="Allows invoice lines to impact multiple analytic accounts "
"simultaneously."),
'account_payment':fields.boolean('Suppliers Payment Management',
'account_payment': fields.boolean('Suppliers Payment Management',
help="Streamlines invoice payment and creates hooks to plug "
"automated payment systems in."),
'account_followup':fields.boolean('Followups Management',
'account_followup': fields.boolean('Followups Management',
help="Helps you generate reminder letters for unpaid invoices, "
"including multiple levels of reminding and customized "
"per-partner policies."),
'account_voucher':fields.boolean('Voucher Management',
'account_voucher': fields.boolean('Voucher Management',
help="Account Voucher module includes all the basic requirements of "
"Voucher Entries for Bank, Cash, Sales, Purchase, Expenses, Contra, etc... "),
'account_anglo_saxon': fields.boolean('Anglo-Saxon Accounting',
help="This module will support the Anglo-Saxons accounting methodology by "
"changing the accounting logic with stock transactions."),
# 'account_voucher_payment':fields.boolean('Voucher and Reconcile Management',
# help="Extension Account Voucher module includes allows to link payment / receipt "
# "entries with voucher, also automatically reconcile during the payment and receipt entries."),
}
_defaults = {
@@ -732,4 +749,4 @@ class account_installer_modules(osv.osv_memory):
account_installer_modules()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+54 -51
View File
@@ -24,8 +24,8 @@ from lxml import etree
import decimal_precision as dp
import netsvc
from osv import fields, osv, orm
import pooler
from osv import fields, osv, orm
from tools.translate import _
class account_invoice(osv.osv):
@@ -57,17 +57,13 @@ class account_invoice(osv.osv):
('company_id', '=', company_id),
('refund_journal', '=', refund_journal.get(type_inv, False))],
limit=1)
if res:
return res[0]
else:
return False
return res and res[0] or False
def _get_currency(self, cr, uid, context=None):
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, [uid])[0]
if user.company_id:
return user.company_id.currency_id.id
else:
return pooler.get_pool(cr.dbname).get('res.currency').search(cr, uid, [('rate','=',1.0)])[0]
return pooler.get_pool(cr.dbname).get('res.currency').search(cr, uid, [('rate','=', 1.0)])[0]
def _get_journal_analytic(self, cr, uid, type_inv, context=None):
type2journal = {'out_invoice': 'sale', 'in_invoice': 'purchase', 'out_refund': 'sale', 'in_refund': 'purchase'}
@@ -134,7 +130,6 @@ class account_invoice(osv.osv):
result = inv.amount_total - amount
# Use is_zero function to avoid rounding trouble => should be fixed into ORM
res[inv.id] = not self.pool.get('res.currency').is_zero(cr, uid, inv.company_id.currency_id, result) and result or 0.0
return res
# Give Journal Items related to the payment reconciled to this invoice
@@ -351,7 +346,7 @@ class account_invoice(osv.osv):
if view_type == 'tree':
doc = etree.XML(res['arch'])
nodes = doc.xpath("//field[@name='partner_id']")
partner_string = 'Customer'
partner_string = _('Customer')
if context.get('type', 'out_invoice') in ('in_invoice', 'in_refund'):
partner_string = _('Supplier')
for node in nodes:
@@ -359,12 +354,26 @@ class account_invoice(osv.osv):
res['arch'] = etree.tostring(doc)
return res
def get_log_context(self, cr, uid, context=None):
if context is None:
context = {}
mob_obj = self.pool.get('ir.model.data')
res = mob_obj.get_object_reference(cr, uid, 'account', 'invoice_form') or False
view_id = res and res[1] or False
context.update({'view_id': view_id})
return context
def create(self, cr, uid, vals, context=None):
if context is None:
context = {}
try:
res = super(account_invoice, self).create(cr, uid, vals, context)
for inv_id, name in self.name_get(cr, uid, [res], context=context):
message = _('Invoice ') + " '" + name + "' "+ _("is waiting for validation.")
self.log(cr, uid, inv_id, message)
ctx = context.copy()
if vals.get('type', 'in_invoice') in ('out_invoice', 'out_refund'):
ctx = self.get_log_context(cr, uid, context=ctx)
message = _("Invoice '%s' is waiting for validation.") % name
self.log(cr, uid, inv_id, message, context=ctx)
return res
except Exception, e:
if '"journal_id" viol' in e.args[0]:
@@ -375,6 +384,9 @@ class account_invoice(osv.osv):
def confirm_paid(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state':'paid'}, context=context)
for inv_id, name in self.name_get(cr, uid, ids, context=context):
message = _("Invoice '%s' is paid.") % name
self.log(cr, uid, inv_id, message)
return True
def unlink(self, cr, uid, ids, context=None):
@@ -461,14 +473,6 @@ class account_invoice(osv.osv):
result['value'].update(to_update['value'])
return result
def onchange_currency_id(self, cr, uid, ids, curr_id, company_id):
if curr_id and company_id:
currency = self.pool.get('res.currency').browse(cr, uid, curr_id)
if currency.company_id.id != company_id:
raise osv.except_osv(_('Configuration Error !'),
_('Can not select currency that is not related to current company.\nPlease select accordingly !.'))
return {}
def onchange_journal_id(self, cr, uid, ids, journal_id=False):
result = {}
if journal_id:
@@ -496,7 +500,6 @@ class account_invoice(osv.osv):
res = {'value':{'date_due': pterm_list[-1]}}
else:
raise osv.except_osv(_('Data Insufficient !'), _('The Payment Term of Supplier does not have Payment Term Lines(Computation) defined !'))
return res
def onchange_invoice_line(self, cr, uid, ids, lines):
@@ -509,6 +512,8 @@ class account_invoice(osv.osv):
val = {}
dom = {}
obj_journal = self.pool.get('account.journal')
account_obj = self.pool.get('account.account')
inv_line_obj = self.pool.get('account.invoice.line')
if company_id and part_id and type:
acc_id = False
partner_obj = self.pool.get('res.partner').browse(cr,uid,part_id)
@@ -533,7 +538,6 @@ class account_invoice(osv.osv):
else:
acc_id = pay_res_id
val= {'account_id': acc_id}
account_obj = self.pool.get('account.account')
if ids:
if company_id:
inv_obj = self.browse(cr,uid,ids)
@@ -544,7 +548,7 @@ class account_invoice(osv.osv):
if not result_id:
raise osv.except_osv(_('Configuration Error !'),
_('Can not find account chart for this company in invoice line account, Please Create account.'))
self.pool.get('account.invoice.line').write(cr, uid, [line.id], {'account_id': result_id[0]})
inv_line_obj.write(cr, uid, [line.id], {'account_id': result_id[0]})
else:
if invoice_line:
for inv_line in invoice_line:
@@ -585,7 +589,7 @@ class account_invoice(osv.osv):
else:
val['currency_id'] = company.currency_id.id
return {'value': val, 'domain': dom }
return {'value': val, 'domain': dom}
# go from canceled state to draft state
def action_cancel_draft(self, cr, uid, ids, *args):
@@ -674,7 +678,7 @@ class account_invoice(osv.osv):
return (ref or '').replace('/','')
def _get_analytic_lines(self, cr, uid, id):
inv = self.browse(cr, uid, [id])[0]
inv = self.browse(cr, uid, id)
cur_obj = self.pool.get('res.currency')
company_currency = inv.company_id.currency_id.id
@@ -690,6 +694,8 @@ class account_invoice(osv.osv):
ref = inv.reference
else:
ref = self._convert_ref(cr, uid, inv.number)
if not inv.journal_id.analytic_journal_id:
raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (inv.journal_id.name,))
il['analytic_lines'] = [(0,0, {
'name': il['name'],
'date': inv['date_invoice'],
@@ -699,7 +705,7 @@ class account_invoice(osv.osv):
'product_id': il['product_id'],
'product_uom_id': il['uos_id'],
'general_account_id': il['account_id'],
'journal_id': self._get_journal_analytic(cr, uid, inv.type),
'journal_id': inv.journal_id.analytic_journal_id.id,
'ref': ref,
})]
return iml
@@ -795,7 +801,6 @@ class account_invoice(osv.osv):
line = []
for key, val in line2.items():
line.append((0,0,val))
return line
def action_move_create(self, cr, uid, ids, *args):
@@ -833,7 +838,7 @@ class account_invoice(osv.osv):
total_fixed += line.value_amount
if line.value == 'procent':
total_percent += line.value_amount
total_fixed = (total_fixed * 100) / inv.amount_total
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."))
@@ -970,7 +975,9 @@ class account_invoice(osv.osv):
'analytic_account_id':x.get('account_analytic_id',False),
}
def action_number(self, cr, uid, ids, *args):
def action_number(self, cr, uid, ids, context=None):
if context is None:
context = {}
#TODO: not correct fix but required a frech values before reading it.
self.write(cr, uid, ids, {})
@@ -984,7 +991,10 @@ class account_invoice(osv.osv):
self.write(cr, uid, ids, {'internal_number':number})
if invtype in ('in_invoice', 'in_refund'):
ref = reference
if not reference:
ref = self._convert_ref(cr, uid, number)
else:
ref = reference
else:
ref = self._convert_ref(cr, uid, number)
@@ -1001,9 +1011,11 @@ class account_invoice(osv.osv):
(ref, move_id))
for inv_id, name in self.name_get(cr, uid, [id]):
ctx = context.copy()
if obj_inv.type in ('out_invoice', 'out_refund'):
ctx = self.get_log_context(cr, uid, context=ctx)
message = _('Invoice ') + " '" + name + "' "+ _("is validated.")
self.log(cr, uid, inv_id, message)
self.log(cr, uid, inv_id, message, context=ctx)
return True
def action_cancel(self, cr, uid, ids, *args):
@@ -1218,12 +1230,13 @@ class account_invoice(osv.osv):
inv_id, name = self.name_get(cr, uid, [invoice.id], context=context)[0]
if (not round(total,self.pool.get('decimal.precision').precision_get(cr, uid, 'Account'))) or writeoff_acc_id:
self.log(cr, uid, inv_id, _('Invoice ') + " '" + name + "' "+ _("is totally paid."))
self.pool.get('account.move.line').reconcile(cr, uid, line_ids, 'manual', writeoff_acc_id, writeoff_period_id, writeoff_journal_id, context)
else:
code = invoice.currency_id.code
amt = str(pay_amount) + code + ' on ' + str(invoice.amount_total) + code + ' (' + str(total) + code + ' remaining)'
self.log(cr, uid, inv_id, _('Invoice ') + " '" + name + "' "+ _("is paid partially: ") + amt)
# TODO: use currency's formatting function
msg = _("Invoice '%s' is paid partially: %s%s of %s%s (%s%s remaining)") % \
(name, pay_amount, code, invoice.amount_total, code, total, code)
self.log(cr, uid, inv_id, msg)
self.pool.get('account.move.line').reconcile_partial(cr, uid, line_ids, 'manual', context)
# Update the stored value (fields.function), so we write to trigger recompute
@@ -1289,14 +1302,6 @@ class account_invoice_line(osv.osv):
'price_unit': _price_unit_default,
}
def product_id_change_unit_price_inv(self, cr, uid, tax_id, price_unit, qty, address_invoice_id, product, partner_id, context=None):
tax_obj = self.pool.get('account.tax')
if price_unit:
taxes = tax_obj.browse(cr, uid, tax_id)
for tax in tax_obj.compute_inv(cr, uid, taxes, price_unit, qty, address_invoice_id, product, partner_id):
price_unit = price_unit - tax['amount']
return {'price_unit': price_unit,'invoice_line_tax_id': tax_id}
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None):
if context is None:
context = {}
@@ -1361,7 +1366,7 @@ class account_invoice_line(osv.osv):
else:
app_acc_in = in_acc_cate
app_acc_exp = ex_acc_cate
if app_acc_in.company_id.id != company_id and app_acc_exp.company_id.id != company_id:
if app_acc_in and app_acc_in.company_id.id != company_id and app_acc_exp and app_acc_exp.company_id.id != company_id:
in_res_id = account_obj.search(cr, uid, [('name','=',app_acc_in.name),('company_id','=',company_id)])
exp_res_id = account_obj.search(cr, uid, [('name','=',app_acc_exp.name),('company_id','=',company_id)])
if not in_res_id and not exp_res_id:
@@ -1396,8 +1401,7 @@ class account_invoice_line(osv.osv):
taxes = res.supplier_taxes_id and res.supplier_taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a).tax_ids or False)
tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes)
if type in ('in_invoice', 'in_refund'):
to_update = self.product_id_change_unit_price_inv(cr, uid, tax_id, price_unit or res.standard_price, qty, address_invoice_id, product, partner_id, context=context)
result.update(to_update)
result.update( {'price_unit': price_unit or res.standard_price,'invoice_line_tax_id': tax_id} )
else:
result.update({'price_unit': res.list_price, 'invoice_line_tax_id': tax_id})
@@ -1500,8 +1504,8 @@ class account_invoice_line(osv.osv):
taxes = self.pool.get('account.account').browse(cr, uid, account_id).tax_ids
fpos = fposition_id and self.pool.get('account.fiscal.position').browse(cr, uid, fposition_id) or False
res = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, taxes)
r = {'value':{'invoice_line_tax_id': res}}
return r
return {'value':{'invoice_line_tax_id': res}}
account_invoice_line()
class account_invoice_tax(osv.osv):
@@ -1533,7 +1537,6 @@ class account_invoice_tax(osv.osv):
'amount': fields.float('Amount', digits_compute=dp.get_precision('Account')),
'manual': fields.boolean('Manual'),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of invoice tax."),
'base_code_id': fields.many2one('account.tax.code', 'Base Code', help="The account basis of the tax declaration."),
'base_amount': fields.float('Base Code Amount', digits_compute=dp.get_precision('Account')),
'tax_code_id': fields.many2one('account.tax.code', 'Tax Code', help="The tax basis of the tax declaration."),
@@ -1571,9 +1574,9 @@ class account_invoice_tax(osv.osv):
_order = 'sequence'
_defaults = {
'manual': lambda *a: 1,
'base_amount': lambda *a: 0.0,
'tax_amount': lambda *a: 0.0,
'manual': 1,
'base_amount': 0.0,
'tax_amount': 0.0,
}
def compute(self, cr, uid, invoice_id, context={}):
tax_grouped = {}
+7 -4
View File
@@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from operator import itemgetter
from osv import fields, osv
@@ -58,8 +59,8 @@ class account_fiscal_position(osv.osv):
account_id = pos.account_dest_id.id
break
return account_id
account_fiscal_position()
account_fiscal_position()
class account_fiscal_position_tax(osv.osv):
_name = 'account.fiscal.position.tax'
@@ -70,8 +71,8 @@ class account_fiscal_position_tax(osv.osv):
'tax_src_id': fields.many2one('account.tax', 'Tax Source', required=True),
'tax_dest_id': fields.many2one('account.tax', 'Replacement Tax')
}
account_fiscal_position_tax()
account_fiscal_position_tax()
class account_fiscal_position_account(osv.osv):
_name = 'account.fiscal.position.account'
@@ -82,6 +83,7 @@ class account_fiscal_position_account(osv.osv):
'account_src_id': fields.many2one('account.account', 'Account Source', domain=[('type','<>','view')], required=True),
'account_dest_id': fields.many2one('account.account', 'Account Destination', domain=[('type','<>','view')], required=True)
}
account_fiscal_position_account()
class res_partner(osv.osv):
@@ -89,7 +91,7 @@ class res_partner(osv.osv):
_inherit = 'res.partner'
_description = 'Partner'
def _credit_debit_get(self, cr, uid, ids, field_names, arg, context):
def _credit_debit_get(self, cr, uid, ids, field_names, arg, context=None):
query = self.pool.get('account.move.line')._query_get(cr, uid, context=context)
cr.execute("""SELECT l.partner_id, a.type, SUM(l.debit-l.credit)
FROM account_move_line l
@@ -184,6 +186,7 @@ class res_partner(osv.osv):
'Companies that refers to partner'),
'last_reconciliation_date': fields.datetime('Latest Reconciliation Date', help='Date on which the partner accounting entries were reconciled last time')
}
res_partner()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+2 -2
View File
@@ -19,8 +19,6 @@
#
##############################################################################
import time
import netsvc
from osv import fields, osv
class product_category(osv.osv):
@@ -75,5 +73,7 @@ class product_template(osv.osv):
view_load=True,
help="This account will be used for invoices instead of the default one to value expenses for the current product"),
}
product_template()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+10 -12
View File
@@ -19,36 +19,34 @@
#
##############################################################################
import time
import operator
from osv import fields
from osv import osv
class account_analytic_journal(osv.osv):
_name = 'account.analytic.journal'
_columns = {
'name' : fields.char('Journal Name', size=64, required=True),
'code' : fields.char('Journal Code', size=8),
'active' : fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the analytic journal without removing it."),
'name': fields.char('Journal Name', size=64, required=True),
'code': fields.char('Journal Code', size=8),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the analytic journal without removing it."),
'type': fields.selection([('sale','Sale'), ('purchase','Purchase'), ('cash','Cash'), ('general','General'), ('situation','Situation')], 'Type', size=32, required=True, help="Gives the type of the analytic journal. When it needs for a document (eg: an invoice) to create analytic entries, OpenERP will look for a matching journal of the same type."),
'line_ids' : fields.one2many('account.analytic.line', 'journal_id', 'Lines'),
'line_ids': fields.one2many('account.analytic.line', 'journal_id', 'Lines'),
'company_id': fields.many2one('res.company', 'Company', required=True),
}
_defaults = {
'active': lambda *a: True,
'type': lambda *a: 'general',
'active': True,
'type': 'general',
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
}
account_analytic_journal()
class account_journal(osv.osv):
_inherit="account.journal"
_columns = {
'analytic_journal_id':fields.many2one('account.analytic.journal','Analytic Journal',help="Journal for analytic entries"),
'analytic_journal_id':fields.many2one('account.analytic.journal','Analytic Journal', help="Journal for analytic entries"),
}
account_journal()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+9 -7
View File
@@ -14,6 +14,8 @@
<field name="quantity"/>
<field name="quantity_max"/>
<field name="date"/>
<field name="user_id" invisible="1"/>
<field name="parent_id" invisible="1"/>
</tree>
</field>
</record>
@@ -109,7 +111,7 @@
<field name="view_id" ref="view_account_analytic_account_tree"/>
<field name="search_view_id" ref="account.view_account_analytic_account_search"/>
</record>
<menuitem action="action_account_analytic_account_form" id="account_analytic_def_account" parent="menu_analytic_accounting" groups="analytic.group_analytic_accounting"/>
<menuitem action="action_account_analytic_account_form" id="account_analytic_def_account" parent="menu_analytic_accounting" groups="analytic.group_analytic_accounting,group_account_manager"/>
<record id="act_account_renew_view" model="ir.actions.act_window">
<field name="name">Accounts to Renew</field>
@@ -127,10 +129,10 @@
<field name="view_type">tree</field>
<field name="view_id" ref="view_account_analytic_account_tree"/>
<field name="domain">[('parent_id','=',False)]</field>
<field name="help">Analytic Charts of Accounts allows you to access to reports by analytic accounts (or cost accounts) . From this menu you can access to analytic balance, a report that relates the analytic accounts to the general accounts. It is useful for analyzing the profitability of projects, giving you the profitability of a project for the different operations that you used to carry out the project.</field>
<field name="help">The normal chart of accounts has a structure defined by the legal requirement of the country. The analytic chart of account structure should reflect your own business needs in term of costs/revenues reporting. They are usually structured by contracts, projects, products or departements. Most of the OpenERP operations (invoices, timesheets, expenses, etc) generate analytic entries on the related account.</field>
</record>
<menuitem groups="analytic.group_analytic_accounting" id="next_id_40" name="Analytic" parent="account.menu_finance_generic_reporting" sequence="4"/>
<menuitem groups="analytic.group_analytic_accounting,group_account_manager,group_account_user" id="next_id_40" name="Analytic" parent="account.menu_finance_generic_reporting" sequence="4"/>
<record id="view_account_analytic_line_form" model="ir.ui.view">
<field name="name">account.analytic.line.form</field>
@@ -195,7 +197,7 @@
<group col='6' colspan='4'>
<filter name="sales" string="Sales" domain="[('journal_id.type','=','sale')]" icon="terp-sale" 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"/>
<filter name="others" string="Others" domain="[('journal_id.type','in',('cash','general','situation'))]" icon="terp-folder-orange"/>
<separator orientation="vertical"/>
<field name="date"/>
<field name="name"/>
@@ -337,7 +339,7 @@
<field name="view_mode">tree,form,search</field>
<field name="search_view_id" ref="view_analytic_journal_search" />
</record>
<menuitem groups="analytic.group_analytic_accounting" action="action_account_analytic_journal_form" id="account_def_analytic_journal" parent="menu_analytic_accounting" sequence="5"/>
<menuitem groups="analytic.group_analytic_accounting,group_account_manager" action="action_account_analytic_journal_form" id="account_def_analytic_journal" parent="menu_analytic_accounting" sequence="5"/>
#
# Open journal entries
@@ -349,7 +351,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem groups="analytic.group_analytic_accounting" action="action_account_analytic_journal_open_form" id="account_analytic_journal_entries" parent="menu_finance_entries"/>
<menuitem groups="analytic.group_analytic_accounting,group_account_manager,group_account_user" action="action_account_analytic_journal_open_form" id="account_analytic_journal_entries" parent="menu_finance_entries"/>
#
# Reporting
@@ -361,7 +363,7 @@
<field name="view_type">tree</field>
<field name="help">To print an analytics (or costs) journal for a given period. The report give code, move name, account number, general amount and analytic amount.</field>
</record>
<menuitem groups="analytic.group_analytic_accounting" action="action_account_analytic_journal_tree" id="account_analytic_journal_print" parent="account.next_id_40"/>
<menuitem groups="analytic.group_analytic_accounting,group_account_manager,group_account_user" action="action_account_analytic_journal_tree" id="account_analytic_journal_print" parent="account.next_id_40"/>
#
# Statistics
@@ -39,7 +39,7 @@
action="action_account_analytic_chart"
id="menu_action_analytic_account_tree2"
icon="STOCK_INDENT"
groups="analytic.group_analytic_accounting"/>
groups="analytic.group_analytic_accounting,group_account_manager,group_account_user"/>
</data>
</openerp>
@@ -8,18 +8,16 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Select period">
<group width="450">
<separator string="Cost Ledger for period" colspan="4"/>
<field name="date1"/>
<field name="date2"/>
<separator string="and Journals" colspan="4"/>
<field name="journal" colspan="4" nolabel="1"/>
<separator colspan="4"/>
<group colspan="4" col="6">
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="check_report" string="Print" type="object" icon="gtk-print"/>
</group>
</group>
<separator string="Cost Ledger for period" colspan="4"/>
<field name="date1"/>
<field name="date2"/>
<separator string="and Journals" colspan="4"/>
<field name="journal" colspan="4" nolabel="1"/>
<separator colspan="4"/>
<group colspan="4" col="6">
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="check_report" string="Print" type="object" icon="gtk-print"/>
</group>
</form>
</field>
</record>
@@ -21,7 +21,6 @@
import time
import pooler
import rml_parse
from report import report_sxw
from common_report_header import common_report_header
@@ -96,7 +95,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
AND ' + self.query + '\
AND account_account.active\
GROUP BY partner_id ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), tuple(partner_ids), self.date_from))
GROUP BY l.partner_id ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), tuple(partner_ids), self.date_from))
t = self.cr.fetchall()
for i in t:
totals[i[0]] = i[1]
@@ -137,7 +136,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
future_past[i[0]] = i[1]
# Use one query per period and store results in history (a list variable)
# Each history will contain : history[1] = {'<partner_id>': <partner_debit-credit>}
# Each history will contain: history[1] = {'<partner_id>': <partner_debit-credit>}
history = []
for i in range(5):
args_list = (tuple(move_state), tuple(self.ACCOUNT_TYPE), tuple(partner_ids),self.date_from,)
@@ -61,7 +61,7 @@
<filter string="Partner" icon="terp-partner" context="{'group_by':'partner_id'}"/>
<separator orientation="vertical"/>
<filter string="Account" name="Account" icon="terp-folder-green" context="{'group_by':'account_id'}" groups="analytic.group_analytic_accounting"/>
<filter string="General Account" icon="terp-folder-green" context="{'group_by':'general_account_id'}"/>
<filter string="General Account" icon="terp-folder-orange" context="{'group_by':'general_account_id'}"/>
<filter string="Journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
<separator orientation="vertical"/>
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
@@ -73,17 +73,6 @@
<filter string="Month" name="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="currency_id" widget="selection"/>
<field name="general_account_id" widget="selection"/>
<field name="product_uom_id" widget="selection"/>
<field name="journal_id" widget="selection"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="account_id" groups="analytic.group_analytic_accounting"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
</search>
</field>
</record>
@@ -111,7 +100,7 @@
<menuitem action="action_analytic_entries_report"
id="menu_action_analytic_entries_report"
groups="analytic.group_analytic_accounting"
groups="analytic.group_analytic_accounting,group_account_manager"
parent="account.menu_finance_statistic_report_statement" sequence="4"/>
</data>
+13 -9
View File
@@ -26,6 +26,7 @@ import rml_parse
from report import report_sxw
from account.report import account_profit_loss
from common_report_header import common_report_header
from tools.translate import _
class report_balancesheet_horizontal(rml_parse.rml_parse, common_report_header):
def __init__(self, cr, uid, name, context=None):
@@ -61,12 +62,12 @@ class report_balancesheet_horizontal(rml_parse.rml_parse, common_report_header):
self.context = context
def sum_dr(self):
if self.res_bl['type'] == 'Net Profit':
if self.res_bl['type'] == _('Net Profit'):
self.result_sum_dr += self.res_bl['balance']*-1
return self.result_sum_dr
def sum_cr(self):
if self.res_bl['type'] == 'Net Loss':
if self.res_bl['type'] == _('Net Loss'):
self.result_sum_cr += self.res_bl['balance']
return self.result_sum_cr
@@ -78,11 +79,10 @@ class report_balancesheet_horizontal(rml_parse.rml_parse, common_report_header):
db_pool = pooler.get_pool(self.cr.dbname)
#Getting Profit or Loss Balance from profit and Loss report
result_pl = self.obj_pl.get_data(data)
self.obj_pl.get_data(data)
self.res_bl = self.obj_pl.final_result()
account_pool = db_pool.get('account.account')
year_pool = db_pool.get('account.fiscalyear')
types = [
'liability',
@@ -105,12 +105,16 @@ class report_balancesheet_horizontal(rml_parse.rml_parse, common_report_header):
account_ids = account_pool._get_children_and_consol(cr, uid, account_id, context=ctx)
accounts = account_pool.browse(cr, uid, account_ids, context=ctx)
if self.res_bl['type'] == 'Net Profit C.F.B.L.':
self.res_bl['type'] = 'Net Profit'
if not self.res_bl:
self.res_bl['type'] = _('Net Profit')
self.res_bl['balance'] = 0.0
if self.res_bl['type'] == _('Net Profit'):
self.res_bl['type'] = _('Net Profit')
else:
self.res_bl['type'] = 'Net Loss'
self.res_bl['type'] = _('Net Loss')
pl_dict = {
'code': False,
'code': self.res_bl['type'],
'name': self.res_bl['type'],
'level': False,
'balance':self.res_bl['balance'],
@@ -201,4 +205,4 @@ report_sxw.report_sxw('report.account.balancesheet', 'account.account',
'addons/account/report/account_balance_sheet.rml',parser=report_balancesheet_horizontal,
header='internal')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -72,15 +72,15 @@ class journal_print(report_sxw.rml_parse, common_report_header):
if self.target_move == 'posted':
move_state = ['posted']
self.cr.execute('SELECT a.currency_id ,a.code, a.name, c.code AS currency_code, l.currency_id, l.amount_currency, SUM(debit) AS debit, SUM(credit) AS credit \
self.cr.execute('SELECT a.currency_id, a.code, a.name, c.symbol AS currency_code, l.currency_id, l.amount_currency, SUM(debit) AS debit, SUM(credit) AS credit \
from account_move_line l \
LEFT JOIN account_move am ON (l.move_id=am.id) \
LEFT JOIN account_account a ON (l.account_id=a.id) \
LEFT JOIN res_currency c on (l.currency_id=c.id) WHERE am.state IN %s AND l.period_id=%s AND l.journal_id=%s '+self.query_get_clause+' GROUP BY a.id, a.code, a.name,l.amount_currency,c.code, a.currency_id,l.currency_id', (tuple(move_state), period_id, journal_id))
LEFT JOIN res_currency c on (l.currency_id=c.id) WHERE am.state IN %s AND l.period_id=%s AND l.journal_id=%s '+self.query_get_clause+' GROUP BY a.id, a.code, a.name,l.amount_currency,c.symbol, a.currency_id,l.currency_id', (tuple(move_state), period_id, journal_id))
return self.cr.dictfetchall()
def _set_get_account_currency_code(self, account_id):
self.cr.execute("SELECT c.code as code "\
self.cr.execute("SELECT c.symbol as code "\
"FROM res_currency c,account_account as ac "\
"WHERE ac.id = %s AND ac.currency_id = c.id"%(account_id))
result = self.cr.fetchone()
@@ -33,9 +33,9 @@ class account_entries_report(osv.osv):
'date_created': fields.date('Date Created', readonly=True),
'date_maturity': fields.date('Date Maturity', readonly=True),
'ref': fields.char('Reference', size=64, readonly=True),
'nbr':fields.integer('# of Items', readonly=True),
'debit':fields.float('Debit', readonly=True),
'credit':fields.float('Credit', readonly=True),
'nbr': fields.integer('# of Items', readonly=True),
'debit': fields.float('Debit', readonly=True),
'credit': fields.float('Credit', readonly=True),
'balance': fields.float('Balance', readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'year': fields.char('Year', size=4, readonly=True),
@@ -77,14 +77,16 @@ class account_entries_report(osv.osv):
def search(self, cr, uid, args, offset=0, limit=None, order=None,
context=None, count=False):
fiscalyear_obj = self.pool.get('account.fiscalyear')
period_obj = self.pool.get('account.period')
for arg in args:
if arg[0] == 'period_id' and arg[2] == 'current_period':
current_period = self.pool.get('account.period').find(cr, uid)[0]
current_period = period_obj.find(cr, uid)[0]
args.append(['period_id','in',[current_period]])
break
elif arg[0] == 'period_id' and arg[2] == 'current_year':
current_year = self.pool.get('account.fiscalyear').find(cr, uid)
ids = self.pool.get('account.fiscalyear').read(cr, uid, [current_year], ['period_ids'])[0]['period_ids']
current_year = fiscalyear_obj.find(cr, uid)
ids = fiscalyear_obj.read(cr, uid, [current_year], ['period_ids'])[0]['period_ids']
args.append(['period_id','in',ids])
for a in [['period_id','in','current_year'], ['period_id','in','current_period']]:
if a in args:
@@ -94,15 +96,17 @@ class account_entries_report(osv.osv):
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None):
todel=[]
fiscalyear_obj = self.pool.get('account.fiscalyear')
period_obj = self.pool.get('account.period')
for arg in domain:
if arg[0] == 'period_id' and arg[2] == 'current_period':
current_period = self.pool.get('account.period').find(cr, uid)[0]
current_period = period_obj.find(cr, uid)[0]
domain.append(['period_id','in',[current_period]])
todel.append(arg)
break
elif arg[0] == 'period_id' and arg[2] == 'current_year':
current_year = self.pool.get('account.fiscalyear').find(cr, uid)
ids = self.pool.get('account.fiscalyear').read(cr, uid, [current_year], ['period_ids'])[0]['period_ids']
current_year = fiscalyear_obj.find(cr, uid)
ids = fiscalyear_obj.read(cr, uid, [current_year], ['period_ids'])[0]['period_ids']
domain.append(['period_id','in',ids])
todel.append(arg)
for a in [['period_id','in','current_year'], ['period_id','in','current_period']]:
@@ -87,19 +87,6 @@
<field name="journal_id" widget="selection"/>
<field name="period_id"/>
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="fiscalyear_id"/>
<separator orientation="vertical"/>
<field name="product_id"/>
<field name="partner_id"/>
<separator orientation="vertical" groups="base.group_multi_company"/>
<field name="company_id" groups="base.group_multi_company"/>
<newline/>
<field name="date_created"/>
<field name="date"/>
<field name="date_maturity"/>
</group>
<newline/>
<group expand="1" string="Group By...">
<filter string="Partner" icon="terp-partner" context="{'group_by':'partner_id'}"/>
@@ -119,6 +106,19 @@
<filter string="Period" icon="terp-go-month" name="group_period" context="{'group_by':'period_id'}"/>
<filter string="Fiscal Year" icon="terp-go-year" context="{'group_by':'fiscalyear_id'}"/>
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="fiscalyear_id"/>
<separator orientation="vertical"/>
<field name="product_id"/>
<field name="partner_id"/>
<separator orientation="vertical" groups="base.group_multi_company"/>
<field name="company_id" groups="base.group_multi_company"/>
<newline/>
<field name="date_created"/>
<field name="date"/>
<field name="date_maturity"/>
</group>
</search>
</field>
</record>
@@ -127,6 +127,8 @@
<field name="res_model">account.entries.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="search_view_id" ref="view_account_entries_report_search"/>
<field name="view_id" ref="view_account_entries_report_tree"/>
<field name="context">{'group_by':[], 'search_default_usertype':1, 'search_default_thisyear':1, 'group_by_no_leaf':1}</field>
<field name="help">A tool search lets you know statistics on your different financial accounts that match your needs.</field>
</record>
@@ -87,19 +87,19 @@ class journal_print(report_sxw.rml_parse, common_report_header):
move_state = ['draft','posted']
if self.target_move == 'posted':
move_state = ['posted']
self.cr.execute('SELECT j.code, j.name, l.amount_currency,c.code AS currency_code,l.currency_id , '
self.cr.execute('SELECT j.code, j.name, l.amount_currency,c.symbol AS currency_code,l.currency_id, '
'SUM(l.debit) AS debit, SUM(l.credit) AS credit '
'FROM account_move_line l '
'LEFT JOIN account_move am ON (l.move_id=am.id) '
'LEFT JOIN account_journal j ON (l.journal_id=j.id) '
'LEFT JOIN res_currency c on (l.currency_id=c.id)'
'WHERE am.state IN %s AND l.period_id=%s AND l.journal_id IN %s ' + self.query_get_clause + ' '
'GROUP BY j.id, j.code, j.name, l.amount_currency, c.code, l.currency_id ',
'GROUP BY j.id, j.code, j.name, l.amount_currency, c.symbol, l.currency_id ',
(tuple(move_state), period_id, tuple(self.journal_ids)))
return self.cr.dictfetchall()
def _set_get_account_currency_code(self, account_id):
self.cr.execute("SELECT c.code AS code "\
self.cr.execute("SELECT c.symbol AS code "\
"FROM res_currency c, account_account AS ac "\
"WHERE ac.id = %s AND ac.currency_id = c.id" % (account_id))
result = self.cr.fetchone()
@@ -111,7 +111,7 @@ class journal_print(report_sxw.rml_parse, common_report_header):
def _get_account(self, data):
if data['model'] == 'account.journal.period':
return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).company_id.name
return super(journal_print ,self)._get_account(data)
return super(journal_print, self)._get_account(data)
def _get_fiscalyear(self, data):
if data['model'] == 'account.journal.period':
@@ -287,7 +287,7 @@
<td><para style="terp_tblheader_Details_Right">Currency</para></td>
</tr>
<tr>
<td><para style="terp_default_Bold_9">Total:([[ company.currency_id.code]])</para></td>
<td><para style="terp_default_Bold_9">Total:</para></td>
<td><para style="terp_default_Bold_9"><font color="white"> </font></para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang(sum_debit()) ]]</para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit()) ]]</para></td>
@@ -266,10 +266,10 @@
<tr>
<td><para style="Standard"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code ]] [[ o.name ]]</para></td>
<td><para style="Standard"></para></td>
<td alignment="right"><para style="P9b"><u>[[ formatLang(sum_debit_account(o), dp='Account') ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[ formatLang(sum_credit_account(o), dp='Account') ]]</u></para></td>
<td><para style="P9b"><u>[[ formatLang(sum_balance_account(o), dp='Account') ]] [[ company.currency_id.symbol ]]</u></para></td>
<td><para style="P9b"><u>[[ o.currency_id and formatLang(sum_currency_amount_account(o), dp='Account') + o.currency_id.code or '' ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]]</u></para></td>
<td><para style="P9b"><u>[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</u></para></td>
<td><para style="P9b"><u>[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.code or '' ]]</u></para></td>
</tr>
</blockTable>
</td>
@@ -292,9 +292,9 @@
<td><para style="P2_content">[[ line['move'] ]]</para></td>
<td><para style="P3_content">[[ line['lname'] ]]</para></td>
<td><para style="P3_content_center">[[ strip_name(line['line_corresp'].replace(', ',','),40) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['debit'], dp='Account') ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['credit'], dp='Account') ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['progress'], dp='Account') ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['debit'], digits=get_digits(dp='Account')) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['credit'], digits=get_digits(dp='Account')) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['progress'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P4_content"><font>[[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'])]] [[ line['currency_code'] or '']]</font></para></td>
</tr>
</blockTable>
@@ -352,9 +352,9 @@
<td><para style="P2_content">[[ line['move'] ]]</para></td>
<td><para style="P3_content">[[ line['lname'] ]]</para></td>
<td><para style="P3_content_center">[[ strip_name(line['line_corresp'],15) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['debit'], dp='Account') ]] </para></td>
<td><para style="P4_content">[[ formatLang(line['credit'], dp='Account') ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['progress'], dp='Account') ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['debit'], digits=get_digits(dp='Account')) ]] </para></td>
<td><para style="P4_content">[[ formatLang(line['credit'], digits=get_digits(dp='Account')) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['progress'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</para></td>
</tr>
</blockTable>
@@ -98,19 +98,8 @@
<field name="categ_id" />
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="product_id"/>
<separator orientation="vertical"/>
<field name="journal_id" widget="selection"/>
<field name="account_id"/>
<separator orientation="vertical"/>
<field name="date_due"/>
<separator orientation="vertical" groups="base.group_multi_company"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
</group>
<newline/>
<group expand="1" string="Group By...">
<filter string="Partner" icon="terp-partner" context="{'group_by':'partner_id','residual_visible':True}"/>
<filter string="Partner" name="partner" icon="terp-partner" context="{'group_by':'partner_id','residual_visible':True}"/>
<filter string="Salesman" name='user' icon="terp-personal" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id','set_visible':True,'residual_invisible':True}"/>
@@ -130,6 +119,17 @@
<filter string="Month" name="month" icon="terp-go-month" context="{'group_by':'month'}" help="Group by month of Invoice Date"/>
<filter string="Year" name="year" icon="terp-go-year" context="{'group_by':'year'}" help="Group by year of Invoice Date"/>
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="product_id"/>
<separator orientation="vertical"/>
<field name="journal_id" widget="selection"/>
<field name="account_id"/>
<separator orientation="vertical"/>
<field name="date_due"/>
<separator orientation="vertical" groups="base.group_multi_company"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
</group>
</search>
</field>
</record>
@@ -139,7 +139,7 @@
<field name="res_model">account.invoice.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{'search_default_current':1,'search_default_customer':1, 'search_default_date': time.strftime('%Y-01-01'), 'group_by':[], 'group_by_no_leaf':1,}</field>
<field name="context">{'search_default_current':1, 'search_default_partner':1, 'search_default_customer':1, 'search_default_date': time.strftime('%Y-01-01'), 'group_by':[], 'group_by_no_leaf':1,}</field>
<field name="search_view_id" ref="view_account_invoice_report_search"/>
<field name="help">A tool search lets you know statistics on invoices that match your needs.</field>
+1 -3
View File
@@ -45,8 +45,6 @@ class journal_print(report_sxw.rml_parse, common_report_header):
'get_start_date': self._get_start_date,
'get_end_date': self._get_end_date,
'get_fiscalyear': self._get_fiscalyear,
'get_start_date':self._get_start_date,
'get_end_date':self._get_end_date,
'display_currency':self._display_currency,
'get_sortby': self._get_sortby,
'get_target_move': self._get_target_move,
@@ -126,7 +124,7 @@ class journal_print(report_sxw.rml_parse, common_report_header):
return obj_mline.browse(self.cr, self.uid, ids)
def _set_get_account_currency_code(self, account_id):
self.cr.execute("SELECT c.code AS code "\
self.cr.execute("SELECT c.symbol AS code "\
"FROM res_currency c,account_account AS ac "\
"WHERE ac.id = %s AND ac.currency_id = c.id" % (account_id))
result = self.cr.fetchone()
@@ -20,8 +20,6 @@
##############################################################################
import time
import re
import copy
from tools.translate import _
from report import report_sxw
+13 -14
View File
@@ -46,8 +46,6 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
'get_start_date': self._get_start_date,
'get_end_date': self._get_end_date,
'get_fiscalyear': self._get_fiscalyear,
'get_start_date':self._get_start_date,
'get_end_date': self._get_end_date,
'get_journal': self._get_journal,
'get_partners':self._get_partners,
'get_intial_balance':self._get_intial_balance,
@@ -58,6 +56,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
def set_context(self, objects, data, ids, report_type=None):
obj_move = self.pool.get('account.move.line')
obj_partner = self.pool.get('res.partner')
self.query = obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context', {}))
ctx2 = data['form'].get('used_context',{}).copy()
ctx2.update({'initial_bal': True})
@@ -100,7 +99,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
"AND l.account_id = account.id " \
"AND am.id = l.move_id " \
"AND am.state IN %s"
"AND " + self.query +" " \
# "AND " + self.query +" " \
"AND l.account_id IN %s " \
" " + PARTNER_REQUEST + " " \
"AND account.active ",
@@ -111,7 +110,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
partner_to_use.append(res_line['partner_id'])
new_ids = partner_to_use
self.partner_ids = new_ids
objects = self.pool.get('res.partner').browse(self.cr, self.uid, new_ids)
objects = obj_partner.browse(self.cr, self.uid, new_ids)
return super(third_party_ledger, self).set_context(objects, data, new_ids, report_type)
def comma_me(self, amount):
@@ -139,7 +138,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
else:
RECONCILE_TAG = "AND l.reconcile_id IS NULL"
self.cr.execute(
"SELECT l.id, l.date, j.code, acc.code as a_code, acc.name as a_name, l.ref, m.name as move_name, l.name, l.debit, l.credit, l.amount_currency, c.symbol AS currency_code " \
"SELECT l.id, l.date, j.code, acc.code as a_code, acc.name as a_name, l.ref, m.name as move_name, l.name, l.debit, l.credit, l.amount_currency,l.currency_id, c.symbol AS currency_code " \
"FROM account_move_line l " \
"LEFT JOIN account_journal j " \
"ON (l.journal_id = j.id) " \
@@ -170,7 +169,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
"SELECT COALESCE(SUM(l.debit),0.0), COALESCE(SUM(l.credit),0.0), COALESCE(sum(debit-credit), 0.0) " \
"FROM account_move_line AS l, " \
"account_move AS m "
"WHERE partner_id = %s " \
"WHERE l.partner_id = %s " \
"AND m.id = l.move_id " \
"AND m.state IN %s "
"AND account_id IN %s" \
@@ -195,7 +194,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
"SELECT sum(debit) " \
"FROM account_move_line AS l, " \
"account_move AS m "
"WHERE partner_id = %s" \
"WHERE l.partner_id = %s" \
"AND m.id = l.move_id " \
"AND m.state IN %s "
"AND account_id IN %s" \
@@ -212,7 +211,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
"SELECT sum(debit) " \
"FROM account_move_line AS l, " \
"account_move AS m "
"WHERE partner_id = %s " \
"WHERE l.partner_id = %s " \
"AND m.id = l.move_id " \
"AND m.state IN %s "
"AND account_id IN %s" \
@@ -244,7 +243,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
"SELECT sum(credit) " \
"FROM account_move_line AS l, " \
"account_move AS m "
"WHERE partner_id = %s" \
"WHERE l.partner_id = %s" \
"AND m.id = l.move_id " \
"AND m.state IN %s "
"AND account_id IN %s" \
@@ -261,7 +260,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
"SELECT sum(credit) " \
"FROM account_move_line AS l, " \
"account_move AS m "
"WHERE partner_id=%s " \
"WHERE l.partner_id=%s " \
"AND m.id = l.move_id " \
"AND m.state IN %s "
"AND account_id IN %s" \
@@ -286,7 +285,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
# return 0.0
# result_tmp = 0.0
# result_init = 0.0
# if self.reconcil :
# if self.reconcil:
# RECONCILE_TAG = " "
# else:
# RECONCILE_TAG = "AND reconcile_id IS NULL"
@@ -317,7 +316,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
# "AND m.state IN %s "
# "AND account_id IN %s" \
# " " + RECONCILE_TAG + " " \
# "AND " + self.query + " " ,
# "AND " + self.query + " ",
# (tuple(self.partner_ids), tuple(move_state) ,tuple(self.account_ids),))
# contemp = self.cr.fetchone()
# if contemp != None:
@@ -335,7 +334,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
# return 0.0
# result_tmp = 0.0
# result_init = 0.0
# if self.reconcil :
# if self.reconcil:
# RECONCILE_TAG = " "
# else:
# RECONCILE_TAG = "AND reconcile_id IS NULL"
@@ -366,7 +365,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
# "AND m.state IN %s "
# "AND account_id IN %s" \
# " " + RECONCILE_TAG + " " \
# "AND " + self.query + " " ,
# "AND " + self.query + " ",
# (tuple(self.partner_ids), tuple(move_state), tuple(self.account_ids),))
# contemp = self.cr.fetchone()
# if contemp != None:
@@ -487,7 +487,7 @@
<para style="terp_default_Right_9">[[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(line['amount_currency'] or '') ]] [[ line['currency_code'] or '' ]]</para>
<para style="terp_default_Right_9"><font>[[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]]</font></para>
</td>
</tr>
</blockTable>
@@ -627,7 +627,7 @@
<para style="terp_default_Right_9">[[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(line['amount_currency'] or '') ]] [[ line['currency_code'] or '' ]]</para>
<para style="terp_default_Right_9"><font>[[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]]</font></para>
</td>
</tr>
</blockTable>
+22 -19
View File
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<document filename="test.pdf">
<template pageSize="(595.0,842.0)" title="Invoices" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
<document filename="Invoices.pdf">
<template pageSize="(595.0,842.0)" title="Invoices" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="34.0" y1="28.0" width="530" height="786"/>
</pageTemplate>
@@ -140,18 +140,18 @@
</para>
</td>
<td>
<para style="terp_default_8">[[ o.partner_id.title.name or '' ]] [[ o.partner_id.name ]]</para>
<para style="terp_default_8">[[ o.address_invoice_id.street ]]</para>
<para style="terp_default_8">[[ o.address_invoice_id.street2 or removeParentNode('para') ]]</para>
<para style="terp_default_8">[[ o.address_invoice_id.zip or '' ]] [[ o.address_invoice_id.city or '' ]]</para>
<para style="terp_default_8">[[ o.address_invoice_id.state_id and o.address_invoice_id.state_id.name or removeParentNode('para') ]]</para>
<para style="terp_default_8">[[ o.address_invoice_id.country_id and o.address_invoice_id.country_id.name or '' ]]</para>
<para style="terp_default_8">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para>
<para style="terp_default_8">[[ (o.address_invoice_id and o.address_invoice_id.street) or '' ]]</para>
<para style="terp_default_8">[[ (o.address_invoice_id and o.address_invoice_id.street2) or removeParentNode('para') ]]</para>
<para style="terp_default_8">[[ (o.address_invoice_id and o.address_invoice_id.zip) or '' ]] [[ (o.address_invoice_id and o.address_invoice_id.city) or '' ]]</para>
<para style="terp_default_8">[[ (o.address_invoice_id and o.address_invoice_id.state_id and o.address_invoice_id.state_id.name) or removeParentNode('para') ]]</para>
<para style="terp_default_8">[[ (o.address_invoice_id and o.address_invoice_id.country_id and o.address_invoice_id.country_id.name) or '' ]]</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<para style="terp_default_8">Tel. : [[ o.address_invoice_id.phone or removeParentNode('para') ]]</para>
<para style="terp_default_8">Fax : [[ o.address_invoice_id.fax or removeParentNode('para') ]]</para>
<para style="terp_default_8">VAT : [[ o.partner_id.vat or removeParentNode('para') ]]</para>
<para style="terp_default_8">Tel. : [[ (o.address_invoice_id and o.address_invoice_id.phone) or removeParentNode('para') ]]</para>
<para style="terp_default_8">Fax : [[ (o.address_invoice_id and o.address_invoice_id.fax) or removeParentNode('para') ]]</para>
<para style="terp_default_8">VAT : [[ (o.partner_id and o.partner_id.vat) or removeParentNode('para') ]]</para>
</td>
</tr>
</blockTable>
@@ -187,14 +187,14 @@
<para style="terp_default_Centre_9">[[ formatLang(o.date_invoice,date=True) ]]</para>
</td>
<td>
<para style="terp_default_Centre_9">[[ o.address_invoice_id.partner_id.ref or ' ' ]]</para>
<para style="terp_default_Centre_9">[[ (o.address_invoice_id and o.address_invoice_id.partner_id and o.address_invoice_id.partner_id.ref) or ' ' ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<blockTable colWidths="219.0,87.0,56.0,56.0,51.0,62.0" style="Table7">
<blockTable colWidths="219.0,87.0,62.0,56.0,46.0,62.0" style="Table7">
<tr>
<td>
<para style="terp_tblheader_Details">Description</para>
@@ -218,7 +218,7 @@
</blockTable>
<section>
<para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para>
<blockTable colWidths="218.0,88.0,56.0,56.0,51.0,62.0" style="Table8">
<blockTable colWidths="218.0,88.0,62.0,55.0,46.0,62.0" style="Table8">
<tr>
<td>
<para style="terp_default_9">[[ l.name ]]</para>
@@ -315,10 +315,10 @@
<para style="Text body">
<font color="white"> </font>
</para>
<blockTable colWidths="167.0,59.0,56.0,247.0" style="Table9">
<blockTable colWidths="206.0,51.0,49.0,225.0" style="Table9">
<tr>
<td>
<para style="terp_tblheader_Details">Tax</para>
<para style="terp_tblheader_Details">Tax [[ o.tax_line==[] and removeParentNode('blockTable') ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Base </para>
@@ -335,7 +335,7 @@
</blockTable>
<section>
<para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para>
<blockTable colWidths="167.0,60.0,55.0,248.0" style="Table2">
<blockTable colWidths="205.0,52.0,49.0,224.0" style="Table2">
<tr>
<td>
<para style="terp_default_8">[[ t.name ]]</para>
@@ -354,11 +354,14 @@
</tr>
</blockTable>
</section>
<para style="terp_default_9">
<font color="white"> </font>
</para>
<para style="terp_default_9">[[ (o.comment and format(o.comment )) or removeParentNode('para') ]]</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<para style="terp_default_9">[[ (o.payment_term.note and format(o.payment_term and o.payment_term.note)) or removeParentNode('para') ]]</para>
<para style="terp_default_9">[[ (o.payment_term and o.payment_term.note and format(o.payment_term and o.payment_term.note)) or removeParentNode('para') ]]</para>
<para style="terp_default_9">
<font color="white"> </font>
</para>
@@ -368,7 +371,7 @@
<para style="terp_default_Bold_9">Fiscal Position Remark : </para>
</td>
<td>
<para style="terp_default_9">[[ (o.fiscal_position.note and format(o.fiscal_position and o.fiscal_position.note)) or removeParentNode('blockTable') ]]</para>
<para style="terp_default_9">[[ (o.fiscal_position and o.fiscal_position.note and format(o.fiscal_position.note)) or removeParentNode('blockTable') ]]</para>
</td>
</tr>
</blockTable>
@@ -21,8 +21,6 @@
import time
import ir
from osv import osv
from report import report_sxw
import pooler
@@ -199,7 +199,7 @@
<para style="terp_default_Bold_9">Code</para>
</td>
<td>
<para style="terp_default_Bold_9">Perticular</para>
<para style="terp_default_Bold_9">Particular</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Balance</para>
@@ -208,7 +208,7 @@
<para style="terp_default_Bold_9">Code</para>
</td>
<td>
<para style="terp_default_Bold_9">Perticular</para>
<para style="terp_default_Bold_9">Particular</para>
</td>
<td>
<para style="P1">Balance</para>
@@ -250,19 +250,19 @@
<para style="terp_default_Bold_9"></para>
</td>
<td>
<para style="terp_default_Bold_9">[[ final_result()['type'] == 'Net Profit C.F.B.L.' and final_result()['type'] or '' ]]</para>
<para style="terp_default_Bold_9">[[ final_result()['type'] == 'Net Profit' and final_result()['type'] or '' ]]</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Profit C.F.B.L.' and formatLang(abs(final_result()['balance'])) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Profit' and formatLang(abs(final_result()['balance'])) ]] [[ company.currency_id.symbol ]]</para>
</td>
<td>
<para style="terp_default_Bold_9"></para>
</td>
<td>
<para style="terp_default_Bold_9">[[ final_result()['type'] == 'Net Loss C.F.B.L.' and final_result()['type'] or '' ]]</para>
<para style="terp_default_Bold_9">[[ final_result()['type'] == 'Net Loss' and final_result()['type'] or '' ]]</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Loss C.F.B.L.' and formatLang(abs(final_result()['balance'])) ]] [[ final_result()['balance'] and final_result()['type'] == 'Net Loss C.F.B.L.' and company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Loss' and formatLang(abs(final_result()['balance'])) ]] [[ final_result()['balance'] and final_result()['type'] == 'Net Loss' and company.currency_id.symbol ]]</para>
</td>
</tr>
</blockTable>
+5 -4
View File
@@ -24,6 +24,7 @@ import pooler
import rml_parse
from report import report_sxw
from common_report_header import common_report_header
from tools.translate import _
class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header):
@@ -62,12 +63,12 @@ class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header):
return self.res_pl
def sum_dr(self):
if self.res_pl['type'] == 'Net Profit C.F.B.L.':
if self.res_pl['type'] == _('Net Profit'):
self.result_sum_dr += self.res_pl['balance']
return self.result_sum_dr
def sum_cr(self):
if self.res_pl['type'] == 'Net Loss C.F.B.L.':
if self.res_pl['type'] == _('Net Loss'):
self.result_sum_cr += self.res_pl['balance']
return self.result_sum_cr
@@ -114,10 +115,10 @@ class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header):
else:
accounts_temp.append(account)
if self.result_sum_dr > self.result_sum_cr:
self.res_pl['type'] = 'Net Loss C.F.B.L.'
self.res_pl['type'] = _('Net Loss')
self.res_pl['balance'] = (self.result_sum_dr - self.result_sum_cr)
else:
self.res_pl['type'] = 'Net Profit C.F.B.L.'
self.res_pl['type'] = _('Net Profit')
self.res_pl['balance'] = (self.result_sum_cr - self.result_sum_dr)
self.result[typ] = accounts_temp
cal_list[typ] = self.result[typ]
@@ -228,10 +228,10 @@
<para style="terp_default_Bold_9"></para>
</td>
<td>
<para style="terp_default_Bold_9">[[ final_result()['type'] == 'Net Profit C.F.B.L.' and final_result()['type'] or removeParentNode('blockTable') ]]</para>
<para style="terp_default_Bold_9">[[ final_result()['type'] == 'Net Profit' and final_result()['type'] or removeParentNode('blockTable') ]]</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Loss C.F.B.L.' and formatLang(abs(final_result()['balance'])) ]] [[ final_result()['balance'] and final_result()['type'] == 'Net Loss C.F.B.L.' and company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Loss' and formatLang(abs(final_result()['balance'])) ]] [[ final_result()['balance'] and final_result()['type'] == 'Net Loss' and company.currency_id.symbol ]]</para>
</td>
</tr>
</blockTable>
@@ -283,10 +283,10 @@
<para style="terp_default_Bold_9"></para>
</td>
<td>
<para style="terp_default_Bold_9">[[ final_result()['type'] == 'Net Loss C.F.B.L.' and final_result()['type'] or removeParentNode('blockTable') ]]</para>
<para style="terp_default_Bold_9">[[ final_result()['type'] == 'Net Loss' and final_result()['type'] or removeParentNode('blockTable') ]]</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Loss C.F.B.L.' and formatLang(abs(final_result()['balance'])) ]] [[ final_result()['balance'] and final_result()['type'] == 'Net Loss C.F.B.L.' and company.currency_id.symbol ]]</para>
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Loss' and formatLang(abs(final_result()['balance'])) ]] [[ final_result()['balance'] and final_result()['type'] == 'Net Loss' and company.currency_id.symbol ]]</para>
</td>
</tr>
</blockTable>
+4 -5
View File
@@ -22,11 +22,11 @@
import time
from datetime import datetime
from dateutil.relativedelta import relativedelta
import pooler
import tools
from osv import fields,osv
def _code_get(self, cr, uid, context={}):
acc_type_obj = self.pool.get('account.account.type')
ids = acc_type_obj.search(cr, uid, [])
@@ -74,7 +74,7 @@ class temp_range(osv.osv):
_description = 'A Temporary table used for Dashboard view'
_columns = {
'name' : fields.char('Range',size=64)
'name': fields.char('Range',size=64)
}
temp_range()
@@ -177,7 +177,7 @@ class report_invoice_created(osv.osv):
('cancel','Cancelled')
],'State', readonly=True),
'origin': fields.char('Source Document', size=64, readonly=True, help="Reference of the document that generated this invoice report."),
'create_date' : fields.datetime('Create Date', readonly=True)
'create_date': fields.datetime('Create Date', readonly=True)
}
_order = 'create_date'
@@ -283,5 +283,4 @@ class report_account_sales(osv.osv):
)""")
report_account_sales()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -21,9 +21,7 @@
##############################################################################
import time
import pooler
import rml_parse
import copy
from report import report_sxw
import re
+40 -25
View File
@@ -20,29 +20,54 @@
##############################################################################
import time
import copy
import rml_parse
from common_report_header import common_report_header
from report import report_sxw
class tax_report(rml_parse.rml_parse):
class tax_report(rml_parse.rml_parse, common_report_header):
_name = 'report.account.vat.declaration'
def __init__(self, cr, uid, name, context={}):
def set_context(self, objects, data, ids, report_type=None):
new_ids = ids
res = {}
self.period_ids = []
period_obj = self.pool.get('account.period')
res['periods'] = ''
res['fiscalyear'] = data['form']['fiscalyear_id']
if data['form']['period_from'] and data['form']['period_to']:
self.period_ids = period_obj.build_ctx_periods(self.cr, self.uid, data['form']['period_from'], data['form']['period_to'])
periods_l = period_obj.read(self.cr, self.uid, self.period_ids, ['name'])
for period in periods_l:
if res['periods'] == '':
res['periods'] = period['name']
else:
res['periods'] += ", "+ period['name']
return super(tax_report, self).set_context(objects, data, new_ids, report_type=report_type)
def __init__(self, cr, uid, name, context=None):
super(tax_report, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
'get_period': self._get_period,
'get_codes': self._get_codes,
'get_general': self._get_general,
'get_company': self._get_company,
'get_currency': self._get_currency,
'get_lines': self._get_lines,
'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_basedon': self._get_basedon,
})
def _get_lines(self, based_on, period_list, company_id=False, parent=False, level=0, context={}):
res = self._get_codes(based_on, company_id, parent, level, period_list, context=context)
def _get_basedon(self, form):
return form['form']['based_on']
def _get_lines(self, based_on, company_id=False, parent=False, level=0, context=None):
period_list = self.period_ids
res = self._get_codes(based_on, company_id, parent, level, period_list, context=context)
if period_list:
res = self._add_codes(based_on, res, period_list, context=context)
else:
@@ -79,13 +104,9 @@ class tax_report(rml_parse.rml_parse):
ind_general+=1
i+=1
return top_result
#return array_result
def _get_period(self, period_id, context={}):
return self.pool.get('account.period').browse(self.cr, self.uid, period_id, context=context).name
def _get_general(self, tax_code_id, period_list,company_id, based_on, context={}):
res=[]
def _get_general(self, tax_code_id, period_list, company_id, based_on, context=None):
res = []
obj_account = self.pool.get('account.account')
periods_ids = tuple(period_list)
if based_on == 'payments':
@@ -138,7 +159,7 @@ class tax_report(rml_parse.rml_parse):
i+=1
return res
def _get_codes(self, based_on, company_id, parent=False, level=0, period_list=[], context={}):
def _get_codes(self, based_on, company_id, parent=False, level=0, period_list=[], context=None):
obj_tc = self.pool.get('account.tax.code')
ids = obj_tc.search(self.cr, self.uid, [('parent_id','=',parent),('company_id','=',company_id)], context=context)
@@ -149,7 +170,7 @@ class tax_report(rml_parse.rml_parse):
res += self._get_codes(based_on, company_id, code.id, level+1, context=context)
return res
def _add_codes(self, based_on, account_list=[], period_list=[], context={}):
def _add_codes(self, based_on, account_list=[], period_list=[], context=None):
res = []
obj_tc = self.pool.get('account.tax.code')
for account in account_list:
@@ -164,16 +185,10 @@ class tax_report(rml_parse.rml_parse):
res.append((account[0], code))
return res
def _get_currency(self, form, context=None):
return self.pool.get('res.company').browse(self.cr, self.uid, form['company_id'], context=context).currency_id.name
def _get_company(self, form, context={}):
obj_company = self.pool.get('res.company')
return obj_company.browse(self.cr, self.uid, form['company_id'], context=context).name
def _get_currency(self, form, context={}):
obj_company = self.pool.get('res.company')
return obj_company.browse(self.cr, self.uid, form['company_id'], context=context).currency_id.name
def sort_result(self, accounts, context={}):
def sort_result(self, accounts, context=None):
# On boucle sur notre rapport
result_accounts = []
ind=0
@@ -216,4 +231,4 @@ class tax_report(rml_parse.rml_parse):
report_sxw.report_sxw('report.account.vat.declaration', 'account.tax.code',
'addons/account/report/account_tax_report.rml', parser=tax_report, header="internal")
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+66 -2
View File
@@ -61,6 +61,42 @@
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table4">
<blockAlignment value="LEFT"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
</blockTableStyle>
<blockTableStyle id="Table3">
<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>
<blockTableStyle id="Tableau1">
<blockAlignment value="LEFT"/>
@@ -100,11 +136,39 @@
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Helvetica" fontSize="1.0" leading="1" spaceBefore="0" spaceAfter="0"/>
<paraStyle name="Index" fontName="Helvetica"/>
<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_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
</stylesheet>
<story>
<para style="P2">Tax Statement</para>
<para style="P2"><font color="white"> </font></para>
<blockTable colWidths="140.0,120.0,160.0,120.0" style="Table3">
<tr>
<td><para style="terp_tblheader_General_Centre">Chart of Tax</para></td>
<td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
<td><para style="terp_tblheader_General_Centre">Periods</para></td>
<td><para style="terp_tblheader_General_Centre">Based On</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>
<blockTable colWidths="80.0,80.0" style="Table4">
<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 '' ]]</para></td>
<td><para style="terp_default_Centre_8">[[ get_end_period(data) or '' ]]</para></td>
</tr>
</blockTable>
</td>
<td><para style="terp_default_Centre_8">[[ get_basedon(data) or '' ]]</para></td>
</tr>
</blockTable>
<para style="P2"><font color="white"> </font></para>
<blockTable colWidths="340.0,55.0,55.0,90.0" style="Table2" repeatRows="1">
<tr>
<td><para style="P12">Tax Name</para></td>
@@ -113,7 +177,7 @@
<td><para style="P12a">Tax Amount</para></td>
</tr>
<tr>
<td><para style="P5"><font>[[ repeatIn(get_lines(data['form']['based_on'],data['form']['periods'],data['form']['company_id']), 'o') ]]</font><font color="white">[[ (o['level']) ]]</font> <font>[[ (len(o['level'])&lt;5 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font><font>[[ o['code'] ]] [[ o['name'] ]] </font></para></td>
<td><para style="P5"><font>[[ repeatIn(get_lines(data['form']['based_on'], data['form']['company_id']), 'o') ]]</font><font color="white">[[ (o['level']) ]]</font> <font>[[ (len(o['level'])&lt;5 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font><font>[[ o['code'] ]] [[ o['name'] ]] </font></para></td>
<td><para style="P6"><font>[[ len(o['level'])&lt;5 and setTag('para','para',{'fontName':"Helvetica-Bold"}) or removeParentNode('font')]]</font><font>[[ o['type']=='view' and removeParentNode('font') ]][[ formatLang(o['debit']) ]]</font><font>[[ o['type']&lt;&gt;'view' and removeParentNode('font') ]][[ formatLang(o['debit']) ]]</font></para></td>
<td><para style="P6"><font>[[ len(o['level'])&lt;5 and setTag('para','para',{'fontName':"Helvetica-Bold"}) or removeParentNode('font')]]</font><font>[[ o['type']=='view' and removeParentNode('font') ]][[ formatLang(o['credit']) ]]</font><font>[[ o['type']&lt;&gt;'view' and removeParentNode('font') ]][[ formatLang(o['credit'])]]</font></para></td>
<td><para style="P6"><font>[[ len(o['level'])&lt;5 and setTag('para','para',{'fontName':"Helvetica-Bold"}) or removeParentNode('font')]]</font><font>[[ o['type']=='view' and removeParentNode('font') ]][[ formatLang(o['tax_amount']) ]] [[ company.currency_id.symbol ]]</font><font>[[ o['type']&lt;&gt;'view' and removeParentNode('font') ]][[ formatLang(o['tax_amount']) ]] [[ company.currency_id.symbol ]]</font> </para></td>
+2 -4
View File
@@ -19,14 +19,11 @@
#
##############################################################################
from report import report_sxw
import xml.dom.minidom
import time
import osv
import re
import pooler
import sys
from report import report_sxw
class rml_parse(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
@@ -148,3 +145,4 @@ class rml_parse(report_sxw.rml_parse):
else:
return Stringer
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+2 -2
View File
@@ -100,14 +100,14 @@
<field name="name">Account fiscal Mapping company rule</field>
<field model="ir.model" name="model_id" ref="model_account_fiscal_position"/>
<field eval="True" name="global"/>
<field name="domain_force">[('company_id','=',user.company_id.id)]</field>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
<record id="account_model_comp_rule" model="ir.rule">
<field name="name">Account model company rule</field>
<field model="ir.model" name="model_id" ref="model_account_model"/>
<field eval="True" name="global"/>
<field name="domain_force">[('company_id','=',user.company_id.id)]</field>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
</data></openerp>
+9 -45
View File
@@ -31,7 +31,7 @@
"access_account_chart_template","account.chart.template","model_account_chart_template","account.group_account_manager",1,1,1,1
"access_account_tax_template","account.tax.template","model_account_tax_template","account.group_account_manager",1,1,1,1
"access_account_bank_statement","account.bank.statement","model_account_bank_statement","account.group_account_user",1,0,0,0
"access_account_bank_statement_line","account.bank.statement.line","model_account_bank_statement_line","account.group_account_user",1,0,0,0
"access_account_bank_statement_line","account.bank.statement.line","model_account_bank_statement_line","account.group_account_user",1,1,1,1
"access_account_analytic_line","account.analytic.line","model_account_analytic_line","account.group_account_user",1,1,1,1
"access_account_analytic_line_manager","account.analytic.line manager","model_account_analytic_line","account.group_account_manager",1,0,0,0
"access_account_analytic_account","account.analytic.account","analytic.model_account_analytic_account","base.group_user",1,0,0,0
@@ -39,17 +39,17 @@
"access_account_invoice_uinvoice","account.invoice","model_account_invoice","account.group_account_invoice",1,1,1,1
"access_account_invoice_line_uinvoice","account.invoice.line","model_account_invoice_line","account.group_account_invoice",1,1,1,1
"access_account_invoice_tax_uinvoice","account.invoice.tax","model_account_invoice_tax","account.group_account_invoice",1,1,1,1
"access_account_move_uinvoice","account.move","model_account_move","account.group_account_invoice",1,0,0,0
"access_account_move_uinvoice","account.move","model_account_move","account.group_account_invoice",1,1,1,1
"access_account_move_line_uinvoice","account.move.line invoice","model_account_move_line","account.group_account_invoice",1,1,1,1
"access_account_move_reconcile_uinvoice","account.move.reconcile","model_account_move_reconcile","account.group_account_invoice",1,1,1,1
"access_account_journal_period_uinvoice","account.journal.period","model_account_journal_period","account.group_account_invoice",1,1,1,1
"access_account_payment_term_manager","account.payment.term","model_account_payment_term","account.group_account_manager",1,1,1,1
"access_account_payment_term_line_manager","account.payment.term.line","model_account_payment_term_line","account.group_account_manager",1,0,0,0
"access_account_payment_term_line_manager","account.payment.term.line","model_account_payment_term_line","account.group_account_manager",1,1,1,1
"access_account_account_type_manager","account.account.type","model_account_account_type","account.group_account_manager",1,1,1,1
"access_account_tax_manager","account.tax","model_account_tax","account.group_account_manager",1,1,1,1
"access_account_account_manager","account.account","model_account_account","account.group_account_manager",1,1,1,1
"access_account_journal_view_manager","account.journal.view","model_account_journal_view","account.group_account_manager",1,1,1,1
"access_account_journal_column_manager","account.journal.column","model_account_journal_column","account.group_account_manager",1,0,0,0
"access_account_journal_column_manager","account.journal.column","model_account_journal_column","account.group_account_manager",1,1,1,1
"access_account_journal_manager","account.journal","model_account_journal","account.group_account_manager",1,1,1,1
"access_account_journal_invoice","account.journal invoice","model_account_journal","account.group_account_invoice",1,0,0,0
"access_account_period_manager","account.period","model_account_period","account.group_account_manager",1,1,1,1
@@ -77,8 +77,8 @@
"access_account_fiscal_position_tax","account.fiscal.position.tax all","model_account_fiscal_position_tax","base.group_user",1,0,0,0
"access_account_fiscal_position_account","account.fiscal.position all","model_account_fiscal_position_account","base.group_user",1,0,0,0
"access_account_fiscal_position_template","account.fiscal.position.template","model_account_fiscal_position_template","account.group_account_manager",1,1,1,1
"access_account_fiscal_position_tax_template","account.fiscal.position.tax.template","model_account_fiscal_position_tax_template","account.group_account_manager",1,0,0,0
"access_account_fiscal_position_account_template","account.fiscal.position.account.template","model_account_fiscal_position_account_template","account.group_account_manager",1,0,0,0
"access_account_fiscal_position_tax_template","account.fiscal.position.tax.template","model_account_fiscal_position_tax_template","account.group_account_manager",1,1,1,1
"access_account_fiscal_position_account_template","account.fiscal.position.account.template","model_account_fiscal_position_account_template","account.group_account_manager",1,1,1,1
"access_account_sequence_fiscal_year","account.sequence.fiscalyear","model_account_sequence_fiscalyear","account.group_account_user",1,1,1,1
"access_account_sequence_fiscal_year_user","account.sequence.fiscalyear user","model_account_sequence_fiscalyear","base.group_user",1,0,0,0
"access_report_account_receivable","report.account.receivable","model_report_account_receivable","account.group_account_manager",1,1,1,1
@@ -94,47 +94,12 @@
"access_account_move_line_manager","account.move.line manager","model_account_move_line","account.group_account_manager",1,0,0,0
"access_account_move_manager","account.move manager","model_account_move","account.group_account_manager",1,0,0,0
"access_account_invoice_manager","account.invoice manager","model_account_invoice","account.group_account_manager",1,0,0,0
"access_account_bank_statement_manager","account.bank.statement manager","model_account_bank_statement","account.group_account_manager",1,0,0,0
"access_account_bank_statement_manager","account.bank.statement manager","model_account_bank_statement","account.group_account_manager",1,1,1,1
"access_account_entries_report_manager","account.entries.report","model_account_entries_report","account.group_account_manager",1,1,1,1
"access_analytic_entries_report_manager","analytic.entries.report","model_analytic_entries_report","account.group_account_manager",1,0,0,0
"access_account_cashbox_line","account.cashbox.line","model_account_cashbox_line","account.group_account_manager",1,0,0,0
"access_account_cashbox_line","account.cashbox.line","model_account_cashbox_line","account.group_account_user",1,0,0,0
"access_account_move_line_system","account.move.line system","model_account_move_line","base.group_system",1,0,0,0
"access_account_invoice_system","account.invoice system","model_account_invoice","base.group_system",1,0,0,0
"access_account_bank_statement_system","account.bank.statement system","model_account_bank_statement","base.group_system",1,0,0,0
"access_account_move_system","account.move system","model_account_move","base.group_system",1,0,0,0
"access_account_analytic_line_system","account.analytic.line system","model_account_analytic_line","base.group_system",1,0,0,0
"access_account_tax_code_system","account.tax.code system","model_account_tax_code","base.group_system",1,1,1,1
"access_account_journal_system","account.journal system","model_account_journal","base.group_system",1,1,1,1
"access_account_period_system","account.period system","model_account_period","base.group_system",1,1,1,1
"access_account_journal_view_system","account.journal.view system","model_account_journal_view","base.group_system",1,1,1,1
"access_account_account_type_system","account.account.type system","model_account_account_type","base.group_system",1,1,1,1
"access_account_analytic_journal_system","account.analytic.journal system","model_account_analytic_journal","base.group_system",1,1,1,1
"access_account_fiscalyear_system","account.fiscalyear system","model_account_fiscalyear","base.group_system",1,1,1,1
"access_account_tax_system","account.tax system","model_account_tax","base.group_system",1,1,1,1
"access_account_model_system","account.model system","model_account_model","base.group_system",1,1,1,1
"access_account_subscription_system","account.subscription system","model_account_subscription","base.group_system",1,1,1,1
"access_account_journal_column_system","account.journal.column system","model_account_journal_column","base.group_system",1,1,1,1
"access_account_invoice_report_system","account.invoice.report system","model_account_invoice_report","base.group_system",1,0,0,0
"access_account_entries_report_system","account.entries.report system","model_account_entries_report","base.group_system",1,0,0,0
"access_analytic_entries_report_system","analytic.entries.report system","model_analytic_entries_report","base.group_system",1,0,0,0
"access_account_journal_period_system","account.journal.period system","model_account_journal_period","base.group_system",1,0,0,0
"access_account_invoice_tax_system","account.invoice.tax system","model_account_invoice_tax","base.group_system",1,0,0,0
"access_account_tax_code_template_system","account.tax.code.template system","model_account_tax_code_template","base.group_system",1,1,1,1
"access_account_sequence_fiscal_year_system","account.sequence.fiscalyear system","model_account_sequence_fiscalyear","base.group_system",1,1,1,1
"access_account_fiscal_position_system","account.fiscal.position system","model_account_fiscal_position","base.group_system",1,1,1,1
"access_account_move_reconcile_system","account.move.reconcile system","model_account_move_reconcile","base.group_system",1,0,0,0
"access_account_account_system","account.account system","model_account_account","base.group_system",1,1,1,1
"access_account_analytic_system","account.analytic.account system","analytic.model_account_analytic_account","base.group_system",1,1,1,1
"access_account_model_line_system","account.model.line system","model_account_model_line","base.group_system",1,1,1,1
"access_account_subscription_line_system","account.subscription.line system","model_account_subscription_line","base.group_system",1,1,1,1
"access_account_payment_term_system","account.payment.term system","model_account_payment_term","base.group_system",1,1,1,1
"access_account_payment_term_line_system","account.payment.term.line system","model_account_payment_term_line","base.group_system",1,1,1,1
"access_report_account_receivable_system","report.account.receivable system","model_report_account_receivable","base.group_system",1,1,1,1
"access_account_fiscal_position_tax_system","account.fiscal.position.tax system","model_account_fiscal_position_tax","base.group_system",1,1,1,1
"access_account_fiscal_position_account_template_system","account.fiscal.position.account.template system","model_account_fiscal_position_account_template","base.group_system",1,1,1,1
"access_account_cashbox_line","account.cashbox.line","model_account_cashbox_line","account.group_account_manager",1,1,1,1
"access_account_cashbox_line","account.cashbox.line","model_account_cashbox_line","account.group_account_user",1,1,1,1
"access_account_journal_view_invoice","account.journal.view invoice","model_account_journal_view","account.group_account_invoice",1,1,1,1
"access_account_fiscal_position_account_system","account.fiscal.position.account system","model_account_fiscal_position_account","base.group_system",1,1,1,1
"access_account_journal_column_invoice","account.journal.column invoice","model_account_journal_column","account.group_account_invoice",1,1,1,1
"access_account_invoice_tax_manager","account.invoice.tax manager","model_account_invoice_tax","account.group_account_manager",1,0,0,0
"access_account_invoice_tax_accountant","account.invoice.tax accountant","model_account_invoice_tax","account.group_account_user",1,0,0,0
@@ -145,7 +110,6 @@
"access_account_invoice_line_manager","account.invoice.line manager","model_account_invoice_line","account.group_account_manager",1,0,0,0
"access_account_account_invoice","account.account invoice","model_account_account","account.group_account_invoice",1,1,1,1
"access_res_partner_address_invoice","res.partner.address invoice","base.model_res_partner_address","account.group_account_invoice",1,1,1,1
"access_account_invoice_line_system","account.invoice.line system","model_account_invoice_line","base.group_system",1,0,0,0
"access_account_analytic_accountant","account.analytic.account accountant","analytic.model_account_analytic_account","account.group_account_user",1,1,1,1
"access_account_account_type_invoice","account.account.type invoice","model_account_account_type","account.group_account_invoice",1,1,1,1
"access_report_account_receivable_invoice","report.account.receivable.invoice","model_report_account_receivable","account.group_account_invoice",1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
31 access_account_chart_template account.chart.template model_account_chart_template account.group_account_manager 1 1 1 1
32 access_account_tax_template account.tax.template model_account_tax_template account.group_account_manager 1 1 1 1
33 access_account_bank_statement account.bank.statement model_account_bank_statement account.group_account_user 1 0 0 0
34 access_account_bank_statement_line account.bank.statement.line model_account_bank_statement_line account.group_account_user 1 0 1 0 1 0 1
35 access_account_analytic_line account.analytic.line model_account_analytic_line account.group_account_user 1 1 1 1
36 access_account_analytic_line_manager account.analytic.line manager model_account_analytic_line account.group_account_manager 1 0 0 0
37 access_account_analytic_account account.analytic.account analytic.model_account_analytic_account base.group_user 1 0 0 0
39 access_account_invoice_uinvoice account.invoice model_account_invoice account.group_account_invoice 1 1 1 1
40 access_account_invoice_line_uinvoice account.invoice.line model_account_invoice_line account.group_account_invoice 1 1 1 1
41 access_account_invoice_tax_uinvoice account.invoice.tax model_account_invoice_tax account.group_account_invoice 1 1 1 1
42 access_account_move_uinvoice account.move model_account_move account.group_account_invoice 1 0 1 0 1 0 1
43 access_account_move_line_uinvoice account.move.line invoice model_account_move_line account.group_account_invoice 1 1 1 1
44 access_account_move_reconcile_uinvoice account.move.reconcile model_account_move_reconcile account.group_account_invoice 1 1 1 1
45 access_account_journal_period_uinvoice account.journal.period model_account_journal_period account.group_account_invoice 1 1 1 1
46 access_account_payment_term_manager account.payment.term model_account_payment_term account.group_account_manager 1 1 1 1
47 access_account_payment_term_line_manager account.payment.term.line model_account_payment_term_line account.group_account_manager 1 0 1 0 1 0 1
48 access_account_account_type_manager account.account.type model_account_account_type account.group_account_manager 1 1 1 1
49 access_account_tax_manager account.tax model_account_tax account.group_account_manager 1 1 1 1
50 access_account_account_manager account.account model_account_account account.group_account_manager 1 1 1 1
51 access_account_journal_view_manager account.journal.view model_account_journal_view account.group_account_manager 1 1 1 1
52 access_account_journal_column_manager account.journal.column model_account_journal_column account.group_account_manager 1 0 1 0 1 0 1
53 access_account_journal_manager account.journal model_account_journal account.group_account_manager 1 1 1 1
54 access_account_journal_invoice account.journal invoice model_account_journal account.group_account_invoice 1 0 0 0
55 access_account_period_manager account.period model_account_period account.group_account_manager 1 1 1 1
77 access_account_fiscal_position_tax account.fiscal.position.tax all model_account_fiscal_position_tax base.group_user 1 0 0 0
78 access_account_fiscal_position_account account.fiscal.position all model_account_fiscal_position_account base.group_user 1 0 0 0
79 access_account_fiscal_position_template account.fiscal.position.template model_account_fiscal_position_template account.group_account_manager 1 1 1 1
80 access_account_fiscal_position_tax_template account.fiscal.position.tax.template model_account_fiscal_position_tax_template account.group_account_manager 1 0 1 0 1 0 1
81 access_account_fiscal_position_account_template account.fiscal.position.account.template model_account_fiscal_position_account_template account.group_account_manager 1 0 1 0 1 0 1
82 access_account_sequence_fiscal_year account.sequence.fiscalyear model_account_sequence_fiscalyear account.group_account_user 1 1 1 1
83 access_account_sequence_fiscal_year_user account.sequence.fiscalyear user model_account_sequence_fiscalyear base.group_user 1 0 0 0
84 access_report_account_receivable report.account.receivable model_report_account_receivable account.group_account_manager 1 1 1 1
94 access_account_move_line_manager account.move.line manager model_account_move_line account.group_account_manager 1 0 0 0
95 access_account_move_manager account.move manager model_account_move account.group_account_manager 1 0 0 0
96 access_account_invoice_manager account.invoice manager model_account_invoice account.group_account_manager 1 0 0 0
97 access_account_bank_statement_manager account.bank.statement manager model_account_bank_statement account.group_account_manager 1 0 1 0 1 0 1
98 access_account_entries_report_manager account.entries.report model_account_entries_report account.group_account_manager 1 1 1 1
99 access_analytic_entries_report_manager analytic.entries.report model_analytic_entries_report account.group_account_manager 1 0 0 0
100 access_account_cashbox_line account.cashbox.line model_account_cashbox_line account.group_account_manager 1 0 1 0 1 0 1
101 access_account_cashbox_line account.cashbox.line model_account_cashbox_line account.group_account_user 1 0 1 0 1 0 1
access_account_move_line_system account.move.line system model_account_move_line base.group_system 1 0 0 0
access_account_invoice_system account.invoice system model_account_invoice base.group_system 1 0 0 0
access_account_bank_statement_system account.bank.statement system model_account_bank_statement base.group_system 1 0 0 0
access_account_move_system account.move system model_account_move base.group_system 1 0 0 0
access_account_analytic_line_system account.analytic.line system model_account_analytic_line base.group_system 1 0 0 0
access_account_tax_code_system account.tax.code system model_account_tax_code base.group_system 1 1 1 1
access_account_journal_system account.journal system model_account_journal base.group_system 1 1 1 1
access_account_period_system account.period system model_account_period base.group_system 1 1 1 1
access_account_journal_view_system account.journal.view system model_account_journal_view base.group_system 1 1 1 1
access_account_account_type_system account.account.type system model_account_account_type base.group_system 1 1 1 1
access_account_analytic_journal_system account.analytic.journal system model_account_analytic_journal base.group_system 1 1 1 1
access_account_fiscalyear_system account.fiscalyear system model_account_fiscalyear base.group_system 1 1 1 1
access_account_tax_system account.tax system model_account_tax base.group_system 1 1 1 1
access_account_model_system account.model system model_account_model base.group_system 1 1 1 1
access_account_subscription_system account.subscription system model_account_subscription base.group_system 1 1 1 1
access_account_journal_column_system account.journal.column system model_account_journal_column base.group_system 1 1 1 1
access_account_invoice_report_system account.invoice.report system model_account_invoice_report base.group_system 1 0 0 0
access_account_entries_report_system account.entries.report system model_account_entries_report base.group_system 1 0 0 0
access_analytic_entries_report_system analytic.entries.report system model_analytic_entries_report base.group_system 1 0 0 0
access_account_journal_period_system account.journal.period system model_account_journal_period base.group_system 1 0 0 0
access_account_invoice_tax_system account.invoice.tax system model_account_invoice_tax base.group_system 1 0 0 0
access_account_tax_code_template_system account.tax.code.template system model_account_tax_code_template base.group_system 1 1 1 1
access_account_sequence_fiscal_year_system account.sequence.fiscalyear system model_account_sequence_fiscalyear base.group_system 1 1 1 1
access_account_fiscal_position_system account.fiscal.position system model_account_fiscal_position base.group_system 1 1 1 1
access_account_move_reconcile_system account.move.reconcile system model_account_move_reconcile base.group_system 1 0 0 0
access_account_account_system account.account system model_account_account base.group_system 1 1 1 1
access_account_analytic_system account.analytic.account system analytic.model_account_analytic_account base.group_system 1 1 1 1
access_account_model_line_system account.model.line system model_account_model_line base.group_system 1 1 1 1
access_account_subscription_line_system account.subscription.line system model_account_subscription_line base.group_system 1 1 1 1
access_account_payment_term_system account.payment.term system model_account_payment_term base.group_system 1 1 1 1
access_account_payment_term_line_system account.payment.term.line system model_account_payment_term_line base.group_system 1 1 1 1
access_report_account_receivable_system report.account.receivable system model_report_account_receivable base.group_system 1 1 1 1
access_account_fiscal_position_tax_system account.fiscal.position.tax system model_account_fiscal_position_tax base.group_system 1 1 1 1
access_account_fiscal_position_account_template_system account.fiscal.position.account.template system model_account_fiscal_position_account_template base.group_system 1 1 1 1
102 access_account_journal_view_invoice account.journal.view invoice model_account_journal_view account.group_account_invoice 1 1 1 1
access_account_fiscal_position_account_system account.fiscal.position.account system model_account_fiscal_position_account base.group_system 1 1 1 1
103 access_account_journal_column_invoice account.journal.column invoice model_account_journal_column account.group_account_invoice 1 1 1 1
104 access_account_invoice_tax_manager account.invoice.tax manager model_account_invoice_tax account.group_account_manager 1 0 0 0
105 access_account_invoice_tax_accountant account.invoice.tax accountant model_account_invoice_tax account.group_account_user 1 0 0 0
110 access_account_invoice_line_manager account.invoice.line manager model_account_invoice_line account.group_account_manager 1 0 0 0
111 access_account_account_invoice account.account invoice model_account_account account.group_account_invoice 1 1 1 1
112 access_res_partner_address_invoice res.partner.address invoice base.model_res_partner_address account.group_account_invoice 1 1 1 1
access_account_invoice_line_system account.invoice.line system model_account_invoice_line base.group_system 1 0 0 0
113 access_account_analytic_accountant account.analytic.account accountant analytic.model_account_analytic_account account.group_account_user 1 1 1 1
114 access_account_account_type_invoice account.account.type invoice model_account_account_type account.group_account_invoice 1 1 1 1
115 access_report_account_receivable_invoice report.account.receivable.invoice model_report_account_receivable account.group_account_invoice 1 1 1 1
+2 -1
View File
@@ -62,6 +62,7 @@ class ir_sequence(osv.osv):
context=context)
return super(ir_sequence, self).get_id(cr, uid, sequence_id, test,
context=context)
ir_sequence()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,63 @@
-
In order to test Bank Statement feature of account I create a bank statement line and confirm it and check it's move created
-
I create a bank statement with Opening and Closing balance 0.
-
!record {model: account.bank.statement, id: account_bank_statement_0}:
balance_end_real: 0.0
balance_start: 0.0
date: '2010-10-14'
journal_id: account.bank_journal
name: /
period_id: account.period_10
line_ids:
- account_id: account.a_recv
amount: 1000.0
date: '2010-10-14'
name: a
partner_id: base.res_partner_4
sequence: 0.0
type: general
-
I check that Initially bank statement is in the "Draft" state
-
!assert {model: account.bank.statement, id: account_bank_statement_0}:
- state == 'draft'
-
I compute bank statement using Compute button
-
!python {model: account.bank.statement}: |
self.button_dummy(cr, uid, [ref("account_bank_statement_0")], {"lang": "en_US",
"tz": False, "active_model": "ir.ui.menu", "journal_type": "bank", "section_id":
False, "period_id": 10, "active_ids": [ref("account.menu_bank_statement_tree")],
"active_id": ref("account.menu_bank_statement_tree"), })
-
I modify the bank statement and set the Closing Balance.
-
!record {model: account.bank.statement, id: account_bank_statement_0}:
balance_end_real: 1000.0
-
I confirm the bank statement using Confirm button
-
!python {model: account.bank.statement}: |
self.button_confirm_bank(cr, uid, [ref("account_bank_statement_0")], {"lang":
"en_US", "tz": False, "active_model": "ir.ui.menu", "journal_type": "bank",
"section_id": False, "period_id": 10, "active_ids": [ref("account.menu_bank_statement_tree")],
"active_id": ref("account.menu_bank_statement_tree"), })
-
I check that bank statement state is now "Closed"
-
!assert {model: account.bank.statement, id: account_bank_statement_0}:
- state == 'confirm'
-
I check that move lines created for bank statement and move state is Posted
-
!python {model: account.bank.statement}: |
move_line_obj = self.pool.get('account.move.line')
bank_data = self.browse(cr, uid, ref("account_bank_statement_0"))
assert bank_data.move_line_ids, "Move lines not created for bank statement"
for line in bank_data.move_line_ids:
assert line.move_id.state == 'posted', "Move state is not posted"
@@ -0,0 +1,82 @@
-
In order to test Cash statement I create a Cash statement and confirm it and check it's move created
-
!record {model: account.bank.statement, id: account_bank_statement_1}:
date: '2010-10-16'
journal_id: account.cash_journal
name: /
period_id: account.period_10
user_id: base.user_root
starting_details_ids:
- pieces: 10.0
number: 2
subtotal: 20.0
- pieces: 100.0
number: 1
subtotal: 100.0
balance_start: 120.0
balance_end: 120.0
-
I check that Initially bank statement is in the "Draft" state
-
!assert {model: account.bank.statement, id: account_bank_statement_1}:
- state == 'draft'
-
I clicked on Open CashBox button to open the cashbox
-
!python {model: account.bank.statement}: |
self.button_open(cr, uid, [ref("account_bank_statement_1")], {"lang": "en_US", "tz": False, "active_model": "account.bank.statement", "active_ids": [ref("account_bank_statement_1")], "active_id": ref("account_bank_statement_1"), })
-
I check that now bank statement is in the "Open" state
-
!assert {model: account.bank.statement, id: account_bank_statement_1}:
- state == 'open'
-
I enter values in Closing balance before close the cashbox
-
!record {model: account.bank.statement, id: account_bank_statement_1}:
line_ids:
- account_id: account.a_recv
amount: 1000.0
date: '2010-10-16'
name: test
partner_id: base.res_partner_4
sequence: 0.0
type: general
balance_end: 1120.0
ending_details_ids:
- pieces: 10.0
number: 2
subtotal: 20.0
- pieces: 100.0
number: 1
subtotal: 100.0
- pieces: 500.0
number: 2
subtotal: 1000.0
balance_end_cash: 1120.0
-
I clicked on Close CashBox button to close the cashbox
-
!python {model: account.bank.statement}: |
self.button_confirm_cash(cr, uid, [ref("account_bank_statement_1")], {"lang": "en_US", "tz": False, "active_model": "account.bank.statement", "active_ids": [ref("account_bank_statement_1")], "active_id": ref("account_bank_statement_1"), })
-
I check that bank statement state is now "Closed"
-
!assert {model: account.bank.statement, id: account_bank_statement_1}:
- state == 'confirm'
-
I check that move lines created for bank statement and move state is Posted
-
!python {model: account.bank.statement}: |
move_line_obj = self.pool.get('account.move.line')
bank_data = self.browse(cr, uid, ref("account_bank_statement_1"))
assert bank_data.move_line_ids, "Move lines not created for bank statement"
for line in bank_data.move_line_ids:
assert line.move_id.state == 'posted', "Move state is not posted"
+25 -10
View File
@@ -1,9 +1,22 @@
-
In order to test the PDF reports defined on an invoice, we will create a Invoice Record
-
!record {model: account.invoice, id: test_invoice_1}:
currency_id: base.EUR
company_id: base.main_company
address_invoice_id: base.res_partner_address_tang
partner_id: base.res_partner_asus
state: draft
type: out_invoice
account_id: account.a_recv
name: Test invoice 1
address_contact_id: base.res_partner_address_tang
-
In order to test the PDF reports defined on an invoice, we will print an Invoice Report
-
!python {model: account.invoice}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('account.test_invoice_1')], {}, {})
(data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('test_invoice_1')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account-invoice.'+format), 'wb+').write(data)
@@ -56,7 +69,7 @@
-
!python {model: account.invoice}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('account.test_invoice_1')], {}, {})
(data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('test_invoice_1')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account-invoice.'+format), 'wb+').write(data)
@@ -65,21 +78,23 @@
-
!python {model: res.partner}: |
import netsvc, tools, os, time
import datetime
from mx.DateTime import *
import warnings
warnings.filterwarnings('ignore',".*struct integer overflow masking is deprecated*")
start = datetime.date.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d")))
start = DateTime(int(start.year), int(start.month), int(start.day))
from datetime import datetime
from dateutil.relativedelta import relativedelta
import warnings
import md5
import hashlib
warnings.filterwarnings('ignore',".*struct integer overflow masking is deprecated*")
start = datetime.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d")))
start = datetime(int(start.year), int(start.month), int(start.day))
res = {}
for i in range(5)[::-1]:
stop = start - RelativeDateTime(days=30)
stop = start - relativedelta(days=30)
res[str(i)] = {
'name': (i!=0 and (str((5-(i+1)) * 30) + '-' + str((5-i) * 30)) or ('+'+str(4 * 30))),
'stop': start.strftime('%Y-%m-%d'),
'start': (i!=0 and stop.strftime('%Y-%m-%d') or False),
}
start = stop - RelativeDateTime(days=1)
start = stop - relativedelta(days=1)
obj_move = self.pool.get('account.move.line')
ctx = {}
fy_id = ref('account.data_fiscalyear')
@@ -6,7 +6,6 @@
sign : 1.00
-
In order to test the 'Validate Journal Entries' wizard in OpenERP, I created an account move
-
!record {model: account.move, id: account_move_0}:
date: '2010-06-07'
@@ -248,4 +248,4 @@ class account_automatic_reconcile(osv.osv_memory):
account_automatic_reconcile()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -51,7 +51,7 @@
action="action_account_automatic_reconcile"
id="menu_automatic_reconcile"
parent="periodical_processing_reconciliation"
groups="base.group_extended"/>
groups="base.group_extended,group_account_manager,group_account_user"/>
<record id="account_automatic_reconcile_view1" model="ir.ui.view">
<field name="name">Automatic reconcile unreconcile</field>
@@ -19,6 +19,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import osv, fields
from tools.translate import _
@@ -34,7 +35,6 @@ class account_change_currency(osv.osv_memory):
if context is None:
context = {}
if context.get('active_id',False):
state = obj_inv.browse(cr, uid, context['active_id']).state
if obj_inv.browse(cr, uid, context['active_id']).state != 'draft':
raise osv.except_osv(_('Error'), _('You can only change currency for Draft Invoice !'))
pass
@@ -43,7 +43,6 @@ class account_change_currency(osv.osv_memory):
obj_inv = self.pool.get('account.invoice')
obj_inv_line = self.pool.get('account.invoice.line')
obj_currency = self.pool.get('res.currency')
invoice_ids = []
if context is None:
context = {}
data = self.read(cr, uid, ids)[0]
@@ -77,4 +76,4 @@ class account_change_currency(osv.osv_memory):
account_change_currency()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+6 -12
View File
@@ -18,9 +18,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from osv import fields, osv
from tools.translate import _
class account_chart(osv.osv_memory):
"""
@@ -38,12 +37,6 @@ class account_chart(osv.osv_memory):
('posted', 'All Posted Entries')], 'Target Moves', required = True),
}
def _get_fiscalyear(self, cr, uid, context=None):
"""Return default Fiscalyear value"""
now = time.strftime('%Y-%m-%d')
fiscalyears = self.pool.get('account.fiscalyear').search(cr, uid, [('date_start', '<', now), ('date_stop', '>', now)], limit=1 )
return fiscalyears and fiscalyears[0] or False
def onchange_fiscalyear(self, cr, uid, ids, fiscalyear_id=False, context=None):
res = {}
res['value'] = {}
@@ -81,23 +74,24 @@ class account_chart(osv.osv_memory):
"""
mod_obj = self.pool.get('ir.model.data')
act_obj = self.pool.get('ir.actions.act_window')
period_obj = self.pool.get('account.period')
fy_obj = self.pool.get('account.fiscalyear')
if context is None:
context = {}
data = self.read(cr, uid, ids, [], context=context)[0]
result = mod_obj._get_id(cr, uid, 'account', 'action_account_tree')
id = mod_obj.read(cr, uid, [result], ['res_id'], context=context)[0]['res_id']
result = act_obj.read(cr, uid, [id], context=context)[0]
result['periods'] = []
result['periods'] = []
if data['period_from'] and data['period_to']:
result['periods'] = self.pool.get('account.period').build_ctx_periods(cr, uid, data['period_from'], data['period_to'])
result['periods'] = period_obj.build_ctx_periods(cr, uid, data['period_from'], data['period_to'])
result['context'] = str({'fiscalyear': data['fiscalyear'], 'periods': result['periods'], \
'state': data['target_move']})
if data['fiscalyear']:
result['name'] += ':' + self.pool.get('account.fiscalyear').read(cr, uid, [data['fiscalyear']], context=context)[0]['code']
result['name'] += ':' + fy_obj.read(cr, uid, [data['fiscalyear']], context=context)[0]['code']
return result
_defaults = {
'fiscalyear': _get_fiscalyear,
'target_move': 'all'
}
@@ -31,6 +31,7 @@
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_account_chart"/>
<field name="target">new</field>
<field name="help">Display your company chart of accounts per fiscal year and filter by period. Have a complete tree view of all journal items per account code by clicking on an account.</field>
</record>
<menuitem icon="STOCK_INDENT" action="action_account_chart"
@@ -18,9 +18,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
from tools.translate import _
import tools
class account_fiscalyear_close(osv.osv_memory):
"""
@@ -30,14 +30,14 @@ class account_fiscalyear_close(osv.osv_memory):
_description = "Fiscalyear Close"
_columns = {
'fy_id': fields.many2one('account.fiscalyear', \
'Fiscal Year to close', required=True),
'Fiscal Year to close', required=True, help="Select a Fiscal year to close"),
'fy2_id': fields.many2one('account.fiscalyear', \
'New Fiscal Year', required=True),
'journal_id': fields.many2one('account.journal', \
'Opening Entries Journal', required=True, help='The best practice here is to use a journal dedicated to contain the opening entries of all fiscal years. Note that you should define it with default debit/credit accounts and with a centralized counterpart.'),
'period_id': fields.many2one('account.period', \
'Opening Entries Period', required=True),
'report_name': fields.char('Name of new entries',size=64, required=True),
'report_name': fields.char('Name of new entries',size=64, required=True, help="Give name of the new entries"),
}
_defaults = {
'report_name':'End of Fiscal Year Entry',
@@ -57,7 +57,6 @@ class account_fiscalyear_close(osv.osv_memory):
obj_acc_move_line = self.pool.get('account.move.line')
obj_acc_account = self.pool.get('account.account')
obj_acc_journal_period = self.pool.get('account.journal.period')
obj_rec = self.pool.get('account.move.reconcile')
data = self.read(cr, uid, ids, context=context)
@@ -80,9 +79,9 @@ class account_fiscalyear_close(osv.osv_memory):
if not new_journal.default_credit_account_id or not new_journal.default_debit_account_id:
raise osv.except_osv(_('UserError'),
_('The journal must have default credit and debit account'))
if not new_journal.centralisation:
if (not new_journal.centralisation) or new_journal.entry_posted:
raise osv.except_osv(_('UserError'),
_('The journal must have centralised counterpart'))
_('The journal must have centralised counterpart without the Skipping draft state option checked!'))
move_ids = obj_acc_move_line.search(cr, uid, [
('journal_id', '=', new_journal.id), ('period_id.fiscalyear_id', '=', new_fyear.id)])
@@ -222,4 +221,4 @@ class account_fiscalyear_close(osv.osv_memory):
account_fiscalyear_close()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -20,8 +20,6 @@
##############################################################################
from osv import fields, osv
from tools.translate import _
import tools
class account_fiscalyear_close_state(osv.osv_memory):
"""
@@ -31,7 +29,7 @@ class account_fiscalyear_close_state(osv.osv_memory):
_description = "Fiscalyear Close state"
_columns = {
'fy_id': fields.many2one('account.fiscalyear', \
'Fiscal Year to close', required=True),
'Fiscal Year to close', required=True, help="Select a fiscal year to close"),
}
def data_save(self, cr, uid, ids, context=None):
@@ -63,4 +61,4 @@ class account_fiscalyear_close_state(osv.osv_memory):
account_fiscalyear_close_state()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -7,13 +7,14 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Close states of Fiscal year and periods">
<label string ="This wizard will definitelly close a fiscal year and its related periods. That means that no one will be able to create or modify journal entries in it." colspan="4"/>
<field name="fy_id" domain = "[('state','=','draft')]" colspan="4"/>
<separator string="" colspan="4" />
<group colspan="4" col="6">
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="terp-locked" string="Close Fiscalyear" name="data_save" type="object"/>
</group>
<label string ="This wizard will definitelly close a fiscal year and its related periods. That means that no one will be able to create or modify journal entries in it." colspan="4"/>
<separator colspan="4" />
<field name="fy_id" domain = "[('state','=','draft')]" colspan="4"/>
<separator colspan="4" />
<group colspan="4" col="6">
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="terp-locked" string="Close Fiscalyear" name="data_save" type="object"/>
</group>
</form>
</field>
</record>
@@ -6,21 +6,22 @@
<field name="model">account.fiscalyear.close</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Generate Fiscal Year Opening Entries">
<label string="This wizard will generate the end of year journal entries of selected fiscal year. Note that you can run this wizard many times for the same fiscal year: it will simply replace the old opening entries with the new ones." colspan="4"/>
<field name="fy_id" domain = "[('state','=','draft')]"/>
<field name="fy2_id" domain = "[('state','=','draft')]"/>
<field name="journal_id"/>
<field name="period_id" domain ="[('fiscalyear_id','=',fy2_id)]"/>
<field name="report_name" colspan="4"/>
<separator string="" colspan="4"/>
<group colspan="4" col="6">
<label string="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-execute" string="Create" name="data_save" type="object"/>
</group>
</form>
</field>
<form string="Generate Fiscal Year Opening Entries">
<label string="This wizard will generate the end of year journal entries of selected fiscal year. Note that you can run this wizard many times for the same fiscal year: it will simply replace the old opening entries with the new ones." colspan="4"/>
<separator colspan="4"/>
<field name="fy_id" domain = "[('state','=','draft')]"/>
<field name="fy2_id" domain = "[('state','=','draft')]"/>
<field name="journal_id"/>
<field name="period_id" domain ="[('fiscalyear_id','=',fy2_id)]" />
<field name="report_name" colspan="4"/>
<separator colspan="4"/>
<group colspan="4" col="6">
<label string="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-execute" string="Create" name="data_save" type="object"/>
</group>
</form>
</field>
</record>
<record id="action_account_fiscalyear_close" model="ir.actions.act_window">
@@ -36,7 +36,7 @@ class account_invoice_refund(osv.osv_memory):
'period': fields.many2one('account.period', 'Force period'),
'journal_id': fields.many2one('account.journal', 'Refund Journal', help='You can select here the journal to use for the refund invoice that will be created. If you leave that field empty, it will use the same journal as the current invoice.'),
'description': fields.char('Description', size=128, required=True),
'filter_refund': fields.selection([('modify', 'Modify'), ('refund', 'Refund'), ('cancel', 'Cancel')], "Refund Type", required=True, help='Refund invoice base on this type. You can not Modify and Cancel if the invoice is already rencociled'),
'filter_refund': fields.selection([('modify', 'Modify'), ('refund', 'Refund'), ('cancel', 'Cancel')], "Refund Type", required=True, help='Refund invoice base on this type. You can not Modify and Cancel if the invoice is already reconciled'),
}
def _get_journal(self, cr, uid, context=None):
@@ -84,7 +84,7 @@ class account_invoice_refund(osv.osv_memory):
wf_service = netsvc.LocalService('workflow')
inv_tax_obj = self.pool.get('account.invoice.tax')
inv_line_obj = self.pool.get('account.invoice.line')
res_users_obj = self.pool.get('res.users')
if context is None:
context = {}
@@ -93,7 +93,7 @@ class account_invoice_refund(osv.osv_memory):
date = False
period = False
description = False
company = self.pool.get('res.users').browse(cr, uid, uid).company_id
company = res_users_obj.browse(cr, uid, uid).company_id
journal_id = form.get('journal_id', False)
for inv in inv_obj.browse(cr, uid, context.get('active_ids'), context=context):
if inv.state in ['draft', 'proforma2', 'cancel']:
@@ -179,7 +179,6 @@ class account_invoice_refund(osv.osv_memory):
invoice_lines = inv_obj._refund_cleanup_lines(cr, uid, invoice_lines)
tax_lines = inv_tax_obj.read(cr, uid, invoice['tax_line'], context=context)
tax_lines = inv_obj._refund_cleanup_lines(cr, uid, tax_lines)
invoice.update({
'type': inv.type,
'date_invoice': date,
@@ -190,33 +189,32 @@ class account_invoice_refund(osv.osv_memory):
'period_id': period,
'name': description
})
for field in ('address_contact_id', 'address_invoice_id', 'partner_id',
'account_id', 'currency_id', 'payment_term', 'journal_id'):
invoice[field] = invoice[field] and invoice[field][0]
inv_id = inv_obj.create(cr, uid, invoice, {})
if inv.payment_term.id:
data = inv_obj.onchange_payment_term_date_invoice(cr, uid, [inv_id], inv.payment_term.id, date)
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'
result = mod_obj._get_id(cr, uid, 'account', xml_id)
id = mod_obj.read(cr, uid, result, ['res_id'], context=context)['res_id']
result = act_obj.read(cr, uid, id, context=context)
result['res_id'] = created_inv
invoice_domain = eval(result['domain'])
invoice_domain.append(('id', 'in', created_inv))
result['domain'] = invoice_domain
return result
def invoice_refund(self, cr, uid, ids, context=None):
data_refund = self.read(cr, uid, ids, [],context=context)[0]['filter_refund']
return self.compute_refund(cr, uid, ids, data_refund, context=context)
account_invoice_refund()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -18,7 +18,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
from osv import osv
from tools.translate import _
import netsvc
import pooler
@@ -19,7 +19,7 @@
#
##############################################################################
from osv import fields, osv
from osv import osv
class account_journal_select(osv.osv_memory):
"""
@@ -45,8 +45,6 @@ class account_journal_select(osv.osv_memory):
result['context'] = str({'journal_id': journal_id, 'period_id': period_id})
return result
account_journal_select()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -18,11 +18,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import tools
from osv import fields, osv
from tools.translate import _
class account_move_bank_reconcile(osv.osv_memory):
"""
Bank Reconciliation
+13 -6
View File
@@ -19,7 +19,9 @@
#
##############################################################################
from osv import fields, osv
from lxml import etree
from osv import osv
from tools.translate import _
import tools
@@ -31,7 +33,8 @@ class account_move_journal(osv.osv_memory):
"""
Return default account period value
"""
ids = self.pool.get('account.period').find(cr, uid, context=context)
account_period_obj = self.pool.get('account.period')
ids = account_period_obj.find(cr, uid, context=context)
period_id = False
if ids:
period_id = ids[0]
@@ -100,10 +103,13 @@ class account_move_journal(osv.osv_memory):
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="terp-gtk-go-back-rtl" string="Open" name="action_open_window" default_focus="1" type="object"/>
</group>
</form>""" % (str(journal), str(period))
</form>""" % (tools.ustr(journal), tools.ustr(period))
view = etree.fromstring(view.encode('utf8'))
xarch, xfields = self._view_look_dom_arch(cr, uid, view, view_id, context=context)
view = xarch
res.update({
'arch':view
'arch': view
})
return res
@@ -119,6 +125,7 @@ class account_move_journal(osv.osv_memory):
period_pool = self.pool.get('account.journal.period')
data_pool = self.pool.get('ir.model.data')
journal_pool = self.pool.get('account.journal')
account_period_obj = self.pool.get('account.period')
if context is None:
context = {}
@@ -132,7 +139,7 @@ class account_move_journal(osv.osv_memory):
if not ids:
journal = journal_pool.browse(cr, uid, journal_id)
period = self.pool.get('account.period').browse(cr, uid, period_id)
period = account_period_obj.browse(cr, uid, period_id)
name = journal.name
state = period.state
@@ -169,4 +176,4 @@ class account_move_journal(osv.osv_memory):
account_move_journal()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -20,6 +20,7 @@
<field name="view_id" ref="view_account_move_journal_form"/>
<field name="context">{'journal_type':'sale','view_mode':False}</field>
<field name="target">new</field>
<field name="help">This view is used by accountants in order to record entries massively in OpenERP. If you want to record a customer invoice, select the journal and the period in the search toolbar. Then, start by recording the entry line of the income account. OpenERP will propose to you automatically the Tax related to this account and the counter-part "Account receivable".</field>
</record>
<menuitem action="action_account_moves_sale" sequence="16" id="menu_eaction_account_moves_sale"
parent="menu_finance_receivables" icon="STOCK_JUSTIFY_FILL" groups="group_account_user,group_account_manager"/>
@@ -31,6 +32,7 @@
<field name="view_id" ref="view_account_move_journal_form"/>
<field name="context">{'journal_type':'purchase','view_mode':False}</field>
<field name="target">new</field>
<field name="help">This view is used by accountants in order to record entries massively in OpenERP. If you want to record a supplier invoice, start by recording the line of the expense account, OpenERP will propose to you automatically the Tax related to this account and the counter-part "Account Payable".</field>
</record>
<menuitem action="action_account_moves_purchase"
id="menu_eaction_account_moves_purchase"
@@ -46,6 +48,7 @@
<field name="view_id" ref="view_account_move_journal_form"/>
<field name="context">{'journal_type':'bank','view_mode':False}</field>
<field name="target">new</field>
<field name="help">This view is used by accountants in order to record entries massively in OpenERP. Journal items are created by OpenERP if you use Bank Statements, Cash Registers, or Customer/Supplier payments.</field>
</record>
<menuitem
@@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
from tools.translate import _
@@ -19,8 +19,7 @@
#
##############################################################################
from osv import fields, osv
from tools.translate import _
from osv import osv
class account_move_line_select(osv.osv_memory):
"""
@@ -20,8 +20,6 @@
##############################################################################
from osv import fields, osv
from tools.translate import _
import tools
class account_move_line_unreconcile_select(osv.osv_memory):
_name = "account.move.line.unreconcile.select"
@@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
from tools.translate import _
@@ -30,15 +31,19 @@ class account_open_closed_fiscalyear(osv.osv_memory):
}
def remove_entries(self, cr, uid, ids, context={}):
fy_obj = self.pool.get('account.fiscalyear')
move_obj = self.pool.get('account.move')
data = self.read(cr, uid, ids, [])[0]
data_fyear = self.pool.get('account.fiscalyear').browse(cr, uid, data['fyear_id'])
data_fyear = fy_obj.browse(cr, uid, data['fyear_id'])
if not data_fyear.end_journal_period_id:
raise osv.except_osv(_('Error'), _('No journal for ending writing has been defined for the fiscal year'))
period_journal = data_fyear.end_journal_period_id
ids_move = self.pool.get('account.move').search(cr, uid, [('journal_id','=',period_journal.journal_id.id),('period_id','=',period_journal.period_id.id)])
ids_move = move_obj.search(cr, uid, [('journal_id','=',period_journal.journal_id.id),('period_id','=',period_journal.period_id.id)])
if ids_move:
cr.execute('delete from account_move where id IN %s', (tuple(ids_move),))
return {}
account_open_closed_fiscalyear()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -20,7 +20,6 @@
##############################################################################
from osv import fields, osv
from tools.translate import _
class account_period_close(osv.osv_memory):
"""
@@ -39,6 +38,7 @@ class account_period_close(osv.osv_memory):
@param uid: the current user’s ID for security checks,
@param ids: account period close’s ID or list of IDs
"""
period_pool = self.pool.get('account.period')
mode = 'done'
for form in self.read(cr, uid, ids, context=context):
@@ -48,7 +48,6 @@ class account_period_close(osv.osv_memory):
cr.execute('update account_period set state=%s where id=%s', (mode, id))
# Log message for Period
period_pool = self.pool.get('account.period')
for period_id, name in period_pool.name_get(cr, uid, [id]):
period_pool.log(cr, uid, period_id, "Period '%s' is closed, no more modification allowed for this period." % (name))
return {}
+6 -4
View File
@@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from osv import fields, osv
@@ -72,6 +73,7 @@ class account_move_line_reconcile(osv.osv_memory):
def trans_rec_reconcile_full(self, cr, uid, ids, context=None):
account_move_line_obj = self.pool.get('account.move.line')
period_obj = self.pool.get('account.period')
date = False
period_id = False
journal_id= False
@@ -80,9 +82,8 @@ class account_move_line_reconcile(osv.osv_memory):
if context is None:
context = {}
data = self.read(cr, uid, ids, context=context)
date = time.strftime('%Y-%m-%d')
ids = self.pool.get('account.period').find(cr, uid, dt=date, context=context)
ids = period_obj.find(cr, uid, dt=date, context=context)
if ids:
period_id = ids[0]
#stop the reconciliation process by partner (manual reconciliation) only if there is nothing more to reconcile for this partner
@@ -148,6 +149,7 @@ class account_move_line_reconcile_writeoff(osv.osv_memory):
def trans_rec_reconcile(self, cr, uid, ids, context=None):
account_move_line_obj = self.pool.get('account.move.line')
period_obj = self.pool.get('account.period')
if context is None:
context = {}
data = self.read(cr, uid, ids,context=context)[0]
@@ -160,7 +162,7 @@ class account_move_line_reconcile_writeoff(osv.osv_memory):
if context['date_p']:
date = context['date_p']
ids = self.pool.get('account.period').find(cr, uid, dt=date, context=context)
ids = period_obj.find(cr, uid, dt=date, context=context)
if ids:
period_id = ids[0]
@@ -171,4 +173,4 @@ class account_move_line_reconcile_writeoff(osv.osv_memory):
account_move_line_reconcile_writeoff()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -18,10 +18,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from osv import osv, fields
from tools.translate import _
class account_partner_reconcile_process(osv.osv_memory):
_name = 'account.partner.reconcile.process'
@@ -29,15 +29,15 @@ class account_partner_reconcile_process(osv.osv_memory):
def _get_to_reconcile(self, cr, uid, context=None):
cr.execute("""
SELECT p_id FROM (SELECT l.partner_id as p_id, SUM(l.debit) AS debit, SUM(l.credit) AS credit
FROM account_move_line AS l LEFT JOIN account_account a ON (l.account_id = a.id)
LEFT JOIN res_partner p ON (p.id = l.partner_id)
WHERE a.reconcile = 't'
AND l.reconcile_id IS NULL
AND (%s > to_char(p.last_reconciliation_date, 'YYYY-MM-DD') OR p.last_reconciliation_date IS NULL )
AND l.state <> 'draft'
GROUP BY l.partner_id) AS tmp
WHERE debit > 0
SELECT p_id FROM (SELECT l.partner_id as p_id, SUM(l.debit) AS debit, SUM(l.credit) AS credit
FROM account_move_line AS l LEFT JOIN account_account a ON (l.account_id = a.id)
LEFT JOIN res_partner p ON (p.id = l.partner_id)
WHERE a.reconcile = 't'
AND l.reconcile_id IS NULL
AND (%s > to_char(p.last_reconciliation_date, 'YYYY-MM-DD') OR p.last_reconciliation_date IS NULL )
AND l.state <> 'draft'
GROUP BY l.partner_id) AS tmp
WHERE debit > 0
AND credit > 0
""",(time.strftime('%Y-%m-%d'),)
)
@@ -55,7 +55,9 @@ class account_partner_reconcile_process(osv.osv_memory):
return len(map(lambda x: x[0], cr.fetchall())) + 1
def _get_partner(self, cr, uid, context=None):
partner = self.pool.get('account.move.line').get_next_partner_only(cr, uid, offset=1, context=context)
move_line_obj = self.pool.get('account.move.line')
partner = move_line_obj.get_next_partner_only(cr, uid, offset=1, context=context)
if not partner:
return False
return partner[0]
@@ -71,9 +73,12 @@ class account_partner_reconcile_process(osv.osv_memory):
return res
def next_partner(self, cr, uid, ids, context=None):
partner_id = self.pool.get('account.move.line').read(cr, uid, context['active_id'], ['partner_id'])['partner_id']
move_line_obj = self.pool.get('account.move.line')
res_partner_obj = self.pool.get('res.partner')
partner_id = move_line_obj.read(cr, uid, context['active_id'], ['partner_id'])['partner_id']
if partner_id:
self.pool.get('res.partner').write(cr, uid, partner_id[0], {'last_reconciliation_date': time.strftime('%Y-%m-%d')}, context)
res_partner_obj.write(cr, uid, partner_id[0], {'last_reconciliation_date': time.strftime('%Y-%m-%d')}, context)
#TODO: we have to find a way to update the context of the current tab (we could open a new tab with the context but it's not really handy)
#TODO: remove that comments when the client side dev is done
return {}
@@ -93,4 +98,4 @@ class account_partner_reconcile_process(osv.osv_memory):
account_partner_reconcile_process()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -8,22 +8,20 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Reconciliation">
<group height="210" width="550">
<separator string="Reconciliation transactions" colspan="4"/>
<field name="trans_nbr"/>
<newline/>
<field name="credit"/>
<field name="debit"/>
<separator string="Write-Off" colspan="4"/>
<field name="writeoff"/>
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="terp-stock_effects-object-colorize" string="Reconcile" name="trans_rec_reconcile_full" type="object" default_focus="1" attrs="{'invisible':[('writeoff','!=',0)]}"/>
<button icon="gtk-ok" string="Reconcile With Write-Off" name="trans_rec_addendum_writeoff" type="object" attrs="{'invisible':[('writeoff','==',0)]}"/>
<button icon="gtk-ok" string="Partial Reconcile" name="trans_rec_reconcile_partial_reconcile" type="object" attrs="{'invisible':[('writeoff','==',0)]}"/>
</group>
</group>
<separator string="Reconciliation transactions" colspan="4"/>
<field name="trans_nbr"/>
<newline/>
<field name="credit"/>
<field name="debit"/>
<separator string="Write-Off" colspan="4"/>
<field name="writeoff"/>
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="terp-stock_effects-object-colorize" string="Reconcile" name="trans_rec_reconcile_full" type="object" default_focus="1" attrs="{'invisible':[('writeoff','!=',0)]}"/>
<button icon="gtk-ok" string="Reconcile With Write-Off" name="trans_rec_addendum_writeoff" type="object" attrs="{'invisible':[('writeoff','==',0)]}"/>
<button icon="gtk-ok" string="Partial Reconcile" name="trans_rec_reconcile_partial_reconcile" type="object" attrs="{'invisible':[('writeoff','==',0)]}"/>
</group>
</form>
</field>
</record>
@@ -35,7 +35,7 @@ class account_bs_report(osv.osv_memory):
_columns = {
'display_type': fields.boolean("Landscape Mode"),
'reserve_account_id': fields.many2one('account.account', 'Reserve & Profit/Loss Account',required = True,
help='This Account is used for trasfering Profit/Loss(If It is Profit : Amount will be added, Loss : Amount will be duducted.), Which is calculated from Profilt & Loss Report', domain = [('type','=','payable')]),
help='This Account is used for trasfering Profit/Loss(If It is Profit: Amount will be added, Loss : Amount will be duducted.), Which is calculated from Profilt & Loss Report', domain = [('type','=','payable')]),
}
_defaults={
@@ -44,7 +44,6 @@ class account_bs_report(osv.osv_memory):
}
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
mod_obj = self.pool.get('ir.model.data')
res = super(account_bs_report, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False)
doc = etree.XML(res['arch'])
nodes = doc.xpath("//field[@name='journal_ids']")
@@ -30,7 +30,7 @@
<menuitem icon="STOCK_PRINT"
name="Balance Sheet"
action="action_account_bs_report"
groups="group_account_user"
groups="group_account_user,group_account_manager"
id="menu_account_bs_report"
parent="final_accounting_reports"/>
@@ -20,8 +20,6 @@
##############################################################################
import time
import datetime
from datetime import timedelta
from lxml import etree
from osv import fields, osv
@@ -46,7 +44,6 @@ class account_common_report(osv.osv_memory):
}
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
mod_obj = self.pool.get('ir.model.data')
res = super(account_common_report, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False)
if context.get('active_model', False) == 'account.account' and view_id:
doc = etree.XML(res['arch'])
@@ -100,7 +97,7 @@ class account_common_report(osv.osv_memory):
return self.pool.get('account.journal').search(cr, uid ,[])
_defaults = {
'fiscalyear_id' : _get_fiscalyear,
'fiscalyear_id': _get_fiscalyear,
'journal_ids': _get_all_journal,
'filter': 'filter_no',
'chart_account_id': _get_account,
@@ -111,8 +108,6 @@ class account_common_report(osv.osv_memory):
if context is None:
context = {}
result = {}
period_obj = self.pool.get('account.period')
fiscal_obj = self.pool.get('account.fiscalyear')
result['fiscalyear'] = 'fiscalyear_id' in data['form'] and data['form']['fiscalyear_id'] 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
@@ -132,7 +127,6 @@ class account_common_report(osv.osv_memory):
def check_report(self, cr, uid, ids, context=None):
if context is None:
context = {}
obj_move = self.pool.get('account.move.line')
data = {}
data['ids'] = context.get('active_ids', [])
data['model'] = context.get('active_model', 'ir.ui.menu')
@@ -28,7 +28,7 @@ class account_common_partner_report(osv.osv_memory):
_columns = {
'result_selection': fields.selection([('customer','Receivable Accounts'),
('supplier','Payable Accounts'),
('customer_supplier' ,'Receivable and Payable Accounts')],
('customer_supplier','Receivable and Payable Accounts')],
"Partner's", required=True),
}
@@ -56,7 +56,7 @@
name="General Ledger"
parent="account.final_accounting_reports"
action="action_account_general_ledger_menu"
groups="group_account_manager"
groups="group_account_manager,group_account_user"
id="menu_general_ledger"
/>
@@ -34,7 +34,7 @@
<menuitem icon="STOCK_PRINT"
name="Partner Ledger"
action="action_account_partner_ledger"
groups="group_account_manager"
groups="group_account_manager,group_account_user"
id="menu_account_partner_ledger"
parent="account.next_id_22"/>
+1 -1
View File
@@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import osv, fields
from osv import osv
import netsvc
from tools.translate import _
@@ -8,17 +8,15 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Subscription Compute">
<group colspan="4" >
<separator string="Generate entries before:" colspan="4"/>
<field name="date"/>
</group>
<separator string="" colspan="4" />
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel" />
<button icon="gtk-execute" string="Generate Entries"
name="action_generate" type="object" />
</group>
<separator string="Generate entries before:" colspan="4"/>
<field name="date"/>
<separator colspan="4" />
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel" />
<button icon="gtk-execute" string="Generate Entries"
name="action_generate" type="object" />
</group>
</form>
</field>
</record>
@@ -39,7 +39,7 @@
action="action_account_tax_chart"
id="menu_action_tax_code_tree"
parent="menu_finance_charts"
groups="group_account_user"
groups="group_account_user,group_account_manager"
sequence="12"/>
</data>
+1 -1
View File
@@ -19,7 +19,7 @@
#
##############################################################################
from osv import fields, osv
from osv import osv
class account_unreconcile(osv.osv_memory):
_name = "account.unreconcile"
@@ -19,7 +19,6 @@
#
##############################################################################
import time
import datetime
from osv import fields, osv
from tools.translate import _
@@ -38,12 +38,10 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Use Model">
<group colspan="4" col="6" width="300" height="70">
<label string = "Are you sure you want to create entries?" colspan="2"/>
<newline/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-execute" string="Ok" name="create_entries" type="object" default_focus='1'/>
</group>
<label string = "Are you sure you want to create entries?" colspan="2"/>
<newline/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-execute" string="Ok" name="create_entries" type="object" default_focus='1'/>
</form>
</field>
</record>

Some files were not shown because too many files have changed in this diff Show More