bzr revid: uco@tinyerp.com-20100914044027-zezh8srdj93c3kun
This commit is contained in:
uco (Open ERP) 2010-09-14 10:10:27 +05:30
commit e60a6f32bf
97 changed files with 6293 additions and 6454 deletions

View File

@ -95,7 +95,6 @@ module named account_voucher.
'account_invoice_workflow.xml',
'project/project_view.xml',
'project/project_report.xml',
'project/wizard/account_analytic_check_view.xml',
'project/wizard/account_analytic_balance_report_view.xml',
'project/wizard/account_analytic_cost_ledger_view.xml',
'project/wizard/account_analytic_inverted_balance_report.xml',

View File

@ -109,10 +109,8 @@ class account_payment_term_line(osv.osv):
'sequence': fields.integer('Sequence', required=True, help="The sequence field is used to order the payment term lines from the lowest sequences to the higher ones"),
'value': fields.selection([('procent', 'Percent'),
('balance', 'Balance'),
('fixed', 'Fixed Amount')], 'Value',
required=True, help="""Example: 14 days 2%, 30 days net
1. Line 1: percent 0.02 14 days
2. Line 2: balance 30 days"""),
('fixed', 'Fixed Amount')], 'Valuation',
required=True, help="""Select here the kind of valuation related to this payment term line. Note that you should have your last line with the type 'Balance' to ensure that the whole amount will be threated."""),
'value_amount': fields.float('Value Amount', help="For Value percent enter % ratio between 0-1."),
'days': fields.integer('Number of Days', required=True, help="Number of days to add before computation of the day of month." \
@ -145,8 +143,12 @@ class account_account_type(osv.osv):
_columns = {
'name': fields.char('Acc. Type Name', size=64, required=True, translate=True),
'code': fields.char('Code', size=32, required=True),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of account types."),
'close_method': fields.selection([('none', 'None'), ('balance', 'Balance'), ('detail', 'Detail'), ('unreconciled', 'Unreconciled')], 'Deferral Method', required=True),
'close_method': fields.selection([('none', 'None'), ('balance', 'Balance'), ('detail', 'Detail'), ('unreconciled', 'Unreconciled')], 'Deferral Method', required=True, help="""Set here the method that will be used to generate the end of year journal entries for all the accounts of this type.
'None' means that nothing will be done.
'Balance' will generally be used for cash accounts.
'Detail' will copy each existing journal item of the previous year, even the reconciled ones.
'Unreconciled' will copy only the journal items that were unreconciled on the first day of the new fiscal year."""),
'sign': fields.selection([(-1, 'Negative'), (1, 'Positive')], 'Sign on Reports', required=True, help='Allows you to change the sign of the balance amount displayed in the reports, so that you can see positive figures instead of negative ones in expenses accounts.'),
'report_type':fields.selection([
('none','/'),
@ -160,11 +162,10 @@ class account_account_type(osv.osv):
'note': fields.text('Description'),
}
_defaults = {
'close_method': lambda *a: 'none',
'sequence': lambda *a: 5,
'sign': lambda *a: 1,
'close_method': 'none',
'sign': 1,
}
_order = "sequence"
_order = "code"
def _check_recursion(self, cr, uid, ids):
#TODO: Need to check for recusrion
@ -368,6 +369,7 @@ class account_account(osv.osv):
('other', 'Regular'),
('receivable', 'Receivable'),
('payable', 'Payable'),
('liquidity','Liquidity'),
('consolidation', 'Consolidation'),
('closed', 'Closed'),
], 'Internal Type', required=True, help="This type is used to differentiate types with "\
@ -465,6 +467,8 @@ class account_account(osv.osv):
ids = self.search(cr, user, [('shortcut', '=', name)]+ args, limit=limit)
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)
else:
ids = self.search(cr, user, args, context=context, limit=limit)
return self.name_get(cr, user, ids, context=context)
@ -596,9 +600,9 @@ class account_journal(osv.osv):
_name = "account.journal"
_description = "Journal"
_columns = {
'name': fields.char('Journal Name', size=64, required=True, translate=True,help="Name of the journal"),
'code': fields.char('Code', size=16,required=True,help="Code of the journal"),
'type': fields.selection([('sale', 'Sale'),('sale_refund','Sale Refund'), ('purchase', 'Purchase'), ('purchase_refund','Purchase Refund'),('expense', 'Expense'), ('cash', 'Cash'), ('bank', 'Bank and Cheques'), ('general', 'General'), ('situation', 'Situation')], 'Type', size=32, required=True,
'name': fields.char('Journal Name', size=64, required=True, translate=True),
'code': fields.char('Code', size=16, required=True, help="The code will be used to generate the numbers of the journal entries of this journal."),
'type': fields.selection([('sale', 'Sale'),('sale_refund','Sale Refund'), ('purchase', 'Purchase'), ('purchase_refund','Purchase Refund'), ('cash', 'Cash'), ('bank', 'Bank and Cheques'), ('general', 'General'), ('situation', 'Situation')], 'Type', size=32, required=True,
help="Select 'Sale' for Sale journal to be used at the time of making invoice."\
" Select 'Purchase' for Purchase Journal to be used at the time of approving purchase order."\
" Select 'Cash' to be used at the time of making payment."\
@ -613,14 +617,12 @@ class account_journal(osv.osv):
'centralisation': fields.boolean('Centralised counterpart', help="Check this box to determine that each entry of this journal won't create a new counterpart but will share the same counterpart. This is used in fiscal year closing."),
'update_posted': fields.boolean('Allow Cancelling Entries', help="Check this box if you want to allow the cancellation the entries related to this journal or of the invoice related to this journal"),
'group_invoice_lines': fields.boolean('Group Invoice Lines', help="If this box is checked, the system will try to group the accounting lines when generating them from invoices."),
'sequence_id': fields.many2one('ir.sequence', 'Entry Sequence', help="The sequence gives the display order for a list of journals", required=False),
'sequence_id': fields.many2one('ir.sequence', 'Entry Sequence', help="This field contains the informatin related to the numbering of the journal entries of this journal.", required=True),
'user_id': fields.many2one('res.users', 'User', help="The user responsible for this journal"),
'groups_id': fields.many2many('res.groups', 'account_journal_group_rel', 'journal_id', 'group_id', 'Groups'),
'currency': fields.many2one('res.currency', 'Currency', help='The currency used to enter statement'),
'entry_posted': fields.boolean('Skip \'Draft\' State for Manual Entries', help='Check this box if you don\'t want new journal entries to pass through the \'draft\' state and instead goes directly to the \'posted state\' without any manual validation. \nNote that journal entries that are automatically created by the system are always skipping that state.'),
'company_id': fields.many2one('res.company', 'Company', required=True, select=1, help="Company related to this journal"),
# 'invoice_sequence_id': fields.many2one('ir.sequence', 'Invoice Sequence', \
# help="The sequence used for invoice numbers in this journal."),
'allow_date':fields.boolean('Check Date not in the Period', help= 'If set to True then do not accept the entry if the entry date is not into the period dates'),
}
@ -637,7 +639,7 @@ class account_journal(osv.osv):
raise osv.except_osv(_('Warning !'), _('You cannot modify company of this journal as its related record exist in Entry Lines'))
return super(account_journal, self).write(cr, uid, ids, vals, context=context)
def create_sequence(self, cr, uid, ids, context={}):
def create_sequence(self, cr, uid, vals, context={}):
"""
Create new entry sequence for every new Joural
@param cr: cursor to database
@ -660,39 +662,29 @@ class account_journal(osv.osv):
date_pool = self.pool.get('ir.model.data')
result = True
name = vals['name']
code = vals['code'].lower()
journal = self.browse(cr, uid, ids[0], context)
code = journal.code.lower()
types = {
'name':journal.name,
'code':code
'name': name,
'code': code
}
type_id = seq_typ_pool.create(cr, uid, types)
seq = {
'name':journal.name,
'code':code,
'active':True,
'prefix':journal.code + "/%(year)s/",
'padding':4,
'number_increment':1
'name': name,
'code': code,
'active': True,
'prefix': code + "/%(year)s/",
'padding': 4,
'number_increment': 1
}
seq_id = seq_pool.create(cr, uid, seq)
res = {}
if not journal.sequence_id:
res.update({
'sequence_id':seq_id
})
result = self.write(cr, uid, [journal.id], res)
return result
return seq_pool.create(cr, uid, seq)
def create(self, cr, uid, vals, context={}):
journal_id = super(account_journal, self).create(cr, uid, vals, context)
self.create_sequence(cr, uid, [journal_id], context)
return journal_id
if not 'sequence_id' in vals or not vals['sequence_id']:
vals.update({'sequence_id' : self.create_sequence(cr, uid, vals, context)})
return super(account_journal, self).create(cr, uid, vals, context)
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
if not args:
@ -718,7 +710,6 @@ class account_journal(osv.osv):
'sale_refund':'account_sp_refund_journal_view',
'purchase':'account_sp_journal_view',
'purchase_refund':'account_sp_refund_journal_view',
'expense':'account_sp_journal_view',
'cash':'account_journal_bank_view',
'bank':'account_journal_bank_view',
'general':'account_journal_view',
@ -760,19 +751,34 @@ class account_fiscalyear(osv.osv):
'state': fields.selection([('draft','Open'), ('done','Closed')], 'State', readonly=True),
}
_defaults = {
'state': lambda *a: 'draft',
'state': 'draft',
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
}
_order = "date_start"
def _check_fiscal_year(self, cr, uid, ids, context=None):
current_fiscal_yr = self.browse(cr, uid, ids, context=context)[0]
obj_fiscal_ids = self.search(cr, uid, [('company_id', '=', current_fiscal_yr.company_id.id)], context=context)
obj_fiscal_ids.remove(ids[0])
data_fiscal_yr = self.browse(cr, uid, obj_fiscal_ids, context=context)
for old_fy in data_fiscal_yr:
if old_fy.company_id.id == current_fiscal_yr['company_id'].id:
# Condition to check if the current fiscal year falls in between any previously defined fiscal year
if old_fy.date_start <= current_fiscal_yr['date_start'] <= old_fy.date_stop or \
old_fy.date_start <= current_fiscal_yr['date_stop'] <= old_fy.date_stop:
return False
return True
def _check_duration(self,cr,uid,ids):
obj_fy=self.browse(cr,uid,ids[0])
obj_fy = self.browse(cr,uid,ids[0])
if obj_fy.date_stop < obj_fy.date_start:
return False
return True
_constraints = [
(_check_duration, 'Error ! The duration of the Fiscal Year is invalid. ', ['date_stop'])
(_check_duration, 'Error! The duration of the Fiscal Year is invalid. ', ['date_stop']),
(_check_fiscal_year, 'Error! You cannot define overlapping fiscal years',['date_start', 'date_stop'])
]
def create_period3(self,cr, uid, ids, context={}):
@ -964,8 +970,8 @@ class account_journal_period(osv.osv):
return super(account_journal_period, self).unlink(cr, uid, ids, context)
_defaults = {
'state': lambda *a: 'draft',
'active': lambda *a: True,
'state': 'draft',
'active': True,
}
_order = "period_id"
@ -978,6 +984,13 @@ class account_fiscalyear(osv.osv):
'end_journal_period_id':fields.many2one('account.journal.period','End of Year Entries Journal', readonly=True),
}
def copy(self, cr, uid, id, default={}, context=None):
default.update({
'period_ids': [],
'end_journal_period_id': False
})
return super(account_fiscalyear, self).copy(cr, uid, id, default=default, context=context)
account_fiscalyear()
#----------------------------------------------------------
# Entries
@ -1075,8 +1088,8 @@ class account_move(osv.osv):
'ref': fields.char('Reference', size=64),
'period_id': fields.many2one('account.period', 'Period', required=True, states={'posted':[('readonly',True)]}),
'journal_id': fields.many2one('account.journal', 'Journal', required=True, states={'posted':[('readonly',True)]}),
'state': fields.selection([('draft','Draft'), ('posted','Posted')], 'State', required=True, readonly=True,
help='When new account move is created the state will be \'Draft\'. When all the payments are done it will be in \'Posted\' state.'),
'state': fields.selection([('draft','Unposted'), ('posted','Posted')], 'State', required=True, readonly=True,
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"),
@ -1086,10 +1099,10 @@ class account_move(osv.osv):
'company_id': fields.related('journal_id','company_id',type='many2one',relation='res.company',string='Company',store=True),
}
_defaults = {
'name': lambda *a: '/',
'state': lambda *a: 'draft',
'name': '/',
'state': 'draft',
'period_id': _get_period,
'date': lambda *a:time.strftime('%Y-%m-%d'),
'date': time.strftime('%Y-%m-%d'),
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
}
@ -1124,8 +1137,9 @@ class account_move(osv.osv):
def post(self, cr, uid, ids, context=None):
invoice = context.get('invoice', False)
if self.validate(cr, uid, ids, context) and len(ids):
for move in self.browse(cr, uid, ids):
valid_moves = self.validate(cr, uid, ids, context)
if valid_moves:
for move in self.browse(cr, uid, valid_moves):
if move.name =='/':
new_name = False
journal = move.journal_id
@ -1145,7 +1159,7 @@ class account_move(osv.osv):
cr.execute('UPDATE account_move '\
'SET state=%s '\
'WHERE id IN %s',
('posted', tuple(ids),))
('posted', tuple(valid_moves),))
else:
raise osv.except_osv(_('Integrity Error !'), _('You can not validate a non-balanced entry !\nMake sure you have configured Payment Term properly !\nIt should contain atleast one Payment Term Line with type "Balance" !'))
return True
@ -1342,8 +1356,8 @@ class account_move(osv.osv):
if not company_id == line.account_id.company_id.id:
raise osv.except_osv(_('Error'), _("Couldn't create move between different companies"))
if line.account_id.currency_id:
if line.account_id.currency_id.id != line.currency_id.id and (line.account_id.currency_id.id != line.account_id.company_id.currency_id.id or line.currency_id):
if line.account_id.currency_id and line.currency_id:
if line.account_id.currency_id.id != line.currency_id.id and (line.account_id.currency_id.id != line.account_id.company_id.currency_id.id):
raise osv.except_osv(_('Error'), _("""Couldn't create move with currency different from the secondary currency of the account "%s - %s". Clear the secondary currency field of the account definition if you want to accept all currencies.""" % (line.account_id.code, line.account_id.name)))
if abs(amount) < 10 ** -4:
@ -1409,7 +1423,8 @@ class account_move(osv.osv):
for record in valid_moves:
self.pool.get('account.move.line').create_analytic_lines(cr, uid, [line.id for line in record.line_id], context)
return len(valid_moves) > 0
valid_moves = [move.id for move in valid_moves]
return len(valid_moves) > 0 and valid_moves or False
account_move()
@ -1503,9 +1518,9 @@ class account_tax_code(osv.osv):
if context is None:
context = {}
move_state = ('posted', )
if 'state' in context and context['state'] == 'all':
if context.get('state', False) == 'all':
move_state = ('draft', 'posted', )
if 'fiscalyear_id' in context and context['fiscalyear_id']:
if context.get('fiscalyear_id', False):
fiscalyear_id = context['fiscalyear_id']
else:
fiscalyear_id = self.pool.get('account.fiscalyear').find(cr, uid, exception=False)
@ -1523,9 +1538,9 @@ class account_tax_code(osv.osv):
if context is None:
context = {}
move_state = ('posted', )
if 'state' in context and context['state'] == 'all':
if context.get('state', False) == 'all':
move_state = ('draft', 'posted', )
if 'period_id' in context and context['period_id']:
if context.get('period_id', False):
period_id = context['period_id']
else:
period_id = self.pool.get('account.period').find(cr, uid)
@ -1548,7 +1563,7 @@ class account_tax_code(osv.osv):
'child_ids': fields.one2many('account.tax.code', 'parent_id', 'Child Codes'),
'line_ids': fields.one2many('account.move.line', 'tax_code_id', 'Lines'),
'company_id': fields.many2one('res.company', 'Company', required=True),
'sign': fields.float('Sign for parent', required=True),
'sign': fields.float('Coefficent for parent', required=True, help='You can specify here the coefficient that will be used when consolidating the amount of this case into its parent. For example, set 1/-1 if you want to add/substract it.'),
'notprintable':fields.boolean("Not Printable in Invoice", help="Check this box if you don't want any VAT related to this Tax Code to appear on invoices"),
}
@ -1578,8 +1593,8 @@ class account_tax_code(osv.osv):
return self.pool.get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
_defaults = {
'company_id': _default_company,
'sign': lambda *args: 1.0,
'notprintable': lambda *a: False,
'sign': 1.0,
'notprintable': False,
}
def copy(self, cr, uid, id, default=None, context=None):
@ -1969,7 +1984,6 @@ class account_model(osv.osv):
_description = "Account Model"
_columns = {
'name': fields.char('Model Name', size=64, required=True, help="This is a model for recurring accounting entries"),
'ref': fields.char('Reference', size=64),
'journal_id': fields.many2one('account.journal', 'Journal', required=True),
'company_id': fields.many2one('res.company', 'Company', required=True),
'lines_id': fields.one2many('account.model.line', 'model_id', 'Model Entries'),
@ -1978,29 +1992,58 @@ 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'),
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
}
def generate(self, cr, uid, ids, datas={}, context={}):
move_ids = []
for model in self.browse(cr, uid, ids, context):
entry = {}
account_move_obj = self.pool.get('account.move')
account_move_line_obj = self.pool.get('account.move.line')
pt_obj = self.pool.get('account.payment.term')
if datas.get('date', False):
context.update({'date':datas['date']})
period_id = self.pool.get('account.period').find(cr, uid, dt=context.get('date', False))
if not period_id:
raise osv.except_osv(_('No period found !'), _('Unable to find a valid period !'))
period_id = period_id[0]
move_id = self.pool.get('account.move').create(cr, uid, {
'ref': model.ref,
period_id = self.pool.get('account.period').find(cr, uid, dt=context.get('date', False))
if not period_id:
raise osv.except_osv(_('No period found !'), _('Unable to find a valid period !'))
period_id = period_id[0]
for model in self.browse(cr, uid, ids, context):
entry['name'] = model.name%{'year':time.strftime('%Y'), 'month':time.strftime('%m'), 'date':time.strftime('%d')}
move_id = account_move_obj.create(cr, uid, {
'ref': entry['name'],
'period_id': period_id,
'journal_id': model.journal_id.id,
'date': context.get('date',time.strftime('%Y-%m-%d'))
})
move_ids.append(move_id)
for line in model.lines_id:
analytic_account_id = False
if line.analytic_account_id:
if not model.journal_id.analytic_journal_id:
raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (model.journal_id.name,))
analytic_account_id = line.analytic_account_id.id
val = {
'move_id': move_id,
'journal_id': model.journal_id.id,
'period_id': period_id
'period_id': period_id,
'analytic_account_id': analytic_account_id
}
date_maturity = time.strftime('%Y-%m-%d')
if line.date_maturity == 'partner':
if not line.partner_id:
raise osv.except_osv(_('Error !'), _("Maturity date of entry line generated by model line '%s' of model '%s' is based on partner payment term! \
\nPlease define partner on it!"%(line.name, model.name)))
if line.partner_id.property_payment_term:
payment_term_id = line.partner_id.property_payment_term.id
pterm_list = pt_obj.compute(cr, uid, payment_term_id, value=1, date_ref=date_maturity)
if pterm_list:
pterm_list = [l[0] for l in pterm_list]
pterm_list.sort()
date_maturity = pterm_list[-1]
val.update({
'name': line.name,
'quantity': line.quantity,
@ -2008,14 +2051,13 @@ class account_model(osv.osv):
'credit': line.credit,
'account_id': line.account_id.id,
'move_id': move_id,
'ref': line.ref,
'partner_id': line.partner_id.id,
'date': context.get('date',time.strftime('%Y-%m-%d')),
'date_maturity': time.strftime('%Y-%m-%d')
'date_maturity': date_maturity
})
c = context.copy()
c.update({'journal_id': model.journal_id.id,'period_id': period_id})
self.pool.get('account.move.line').create(cr, uid, val, context=c)
account_move_line_obj.create(cr, uid, val, context=c)
return move_ids
account_model()
@ -2028,22 +2070,13 @@ class account_model_line(osv.osv):
'quantity': fields.float('Quantity', digits_compute=dp.get_precision('Account'), help="The optional quantity on entries"),
'debit': fields.float('Debit', digits_compute=dp.get_precision('Account')),
'credit': fields.float('Credit', digits_compute=dp.get_precision('Account')),
'account_id': fields.many2one('account.account', 'Account', required=True, ondelete="cascade"),
'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account', ondelete="cascade"),
'model_id': fields.many2one('account.model', 'Model', required=True, ondelete="cascade", select=True),
'ref': fields.char('Reference', size=16),
'amount_currency': fields.float('Amount Currency', help="The amount expressed in an optional other currency."),
'currency_id': fields.many2one('res.currency', 'Currency'),
'partner_id': fields.many2one('res.partner', 'Partner'),
'date_maturity': fields.selection([('today','Date of the day'), ('partner','Partner Payment Term')], 'Due date', help="The due date of the generated entries for this model. You can choose between the creation date or the creation date of the entries plus the partner payment terms."),
'date': fields.selection([('today','Date of the day'), ('partner','Partner Payment Term')], 'Current Date', required=True, help="The date of the generated entries"),
}
_defaults = {
'date': lambda *a: 'today'
'date_maturity': fields.selection([('today','Date of the day'), ('partner','Partner Payment Term')], 'Maturity date', help="The maturity date of the generated entries for this model. You can choose between the creation date or the creation date of the entries plus the partner payment terms."),
}
_order = 'sequence'
_sql_constraints = [
@ -2074,11 +2107,11 @@ class account_subscription(osv.osv):
'lines_id': fields.one2many('account.subscription.line', 'subscription_id', 'Subscription Lines')
}
_defaults = {
'date_start': lambda *a: time.strftime('%Y-%m-%d'),
'period_type': lambda *a: 'month',
'period_total': lambda *a: 12,
'period_nbr': lambda *a: 1,
'state': lambda *a: 'draft',
'date_start': time.strftime('%Y-%m-%d'),
'period_type': 'month',
'period_total': 12,
'period_nbr': 1,
'state': 'draft',
}
def state_draft(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'draft'})
@ -2138,16 +2171,18 @@ class account_subscription_line(osv.osv):
def move_create(self, cr, uid, ids, context=None):
tocheck = {}
all_moves = []
for line in self.browse(cr, uid, ids, context=context):
datas = {
'date': line.date,
}
ids = self.pool.get('account.model').generate(cr, uid, [line.subscription_id.model_id.id], datas, context)
move_ids = self.pool.get('account.model').generate(cr, uid, [line.subscription_id.model_id.id], datas, context)
tocheck[line.subscription_id.id] = True
self.write(cr, uid, [line.id], {'move_id':ids[0]})
self.write(cr, uid, [line.id], {'move_id':move_ids[0]})
all_moves.extend(move_ids)
if tocheck:
self.pool.get('account.subscription').check(cr, uid, tocheck.keys(), context)
return ids
return all_moves
_rec_name = 'date'
account_subscription_line()
@ -2174,6 +2209,7 @@ class account_account_template(osv.osv):
('payable','Payable'),
('view','View'),
('consolidation','Consolidation'),
('liquidity','Liquidity'),
('other','Others'),
('closed','Closed'),
], 'Internal Type', required=True,help="This type is used to differentiate types with "\
@ -2193,9 +2229,9 @@ class account_account_template(osv.osv):
}
_defaults = {
'reconcile': lambda *a: False,
'type' : lambda *a :'view',
'nocreate': lambda *a: False,
'reconcile': False,
'type' : 'view',
'nocreate': False,
}
_check_recursion = check_cycle
@ -2288,8 +2324,8 @@ class account_tax_code_template(osv.osv):
}
_defaults = {
'sign': lambda *args: 1.0,
'notprintable': lambda *a: False,
'sign': 1.0,
'notprintable': False,
}
def name_get(self, cr, uid, ids, context=None):
@ -2389,17 +2425,17 @@ class account_tax_template(osv.osv):
_defaults = {
'python_compute': lambda *a: '''# price_unit\n# address : res.partner.address object or False\n# product : product.product object or None\n# partner : res.partner object or None\n\nresult = price_unit * 0.10''',
'python_compute_inv': lambda *a: '''# price_unit\n# address : res.partner.address object or False\n# product : product.product object or False\n\nresult = price_unit * 0.10''',
'applicable_type': lambda *a: 'true',
'type': lambda *a: 'percent',
'amount': lambda *a: 0,
'sequence': lambda *a: 1,
'tax_group': lambda *a: 'vat',
'ref_tax_sign': lambda *a: 1,
'ref_base_sign': lambda *a: 1,
'tax_sign': lambda *a: 1,
'base_sign': lambda *a: 1,
'include_base_amount': lambda *a: False,
'type_tax_use': lambda *a: 'all',
'applicable_type': 'true',
'type': 'percent',
'amount': 0,
'sequence': 1,
'tax_group': 'vat',
'ref_tax_sign': 1,
'ref_base_sign': 1,
'tax_sign': 1,
'base_sign': 1,
'include_base_amount': False,
'type_tax_use': 'all',
}
_order = 'sequence'
@ -2480,7 +2516,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
_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,
'code_digits': lambda *a:6,
'code_digits': 6,
'seq_journal': True
}

View File

@ -38,12 +38,15 @@ class account_analytic_line(osv.osv):
'journal_id' : fields.many2one('account.analytic.journal', 'Analytic Journal', required=True, ondelete='cascade', select=True),
'code' : fields.char('Code', size=8),
'ref': fields.char('Ref.', size=64),
'currency_id': fields.related('move_id', 'currency_id', type='many2one', relation='res.currency', string='Account currency', store=True, help="The related account currency if not equal to the company one.", readonly=True),
'amount_currency': fields.related('move_id', 'amount_currency', type='float', string='Amount currency', store=True, help="The amount expressed in the related account currency if not equal to the company one.", readonly=True),
}
_defaults = {
'date': lambda *a: time.strftime('%Y-%m-%d'),
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=c),
}
_order = 'date'
_order = 'date desc'
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
if context is None:
@ -70,13 +73,16 @@ class account_analytic_line(osv.osv):
# Compute the cost based on the price type define into company
# property_valuation_price_type property
def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount,company_id,
unit=False, context=None):
unit=False, journal_id=False, context=None):
if context==None:
context={}
uom_obj = self.pool.get('product.uom')
product_obj = self.pool.get('product.product')
company_obj=self.pool.get('res.company')
analytic_journal_obj=self.pool.get('account.analytic.journal')
product_price_type_obj = self.pool.get('product.price.type')
if prod_id:
result = 0.0
prod = product_obj.browse(cr, uid, prod_id)
a = prod.product_tmpl_id.property_account_expense.id
if not a:
@ -88,16 +94,27 @@ class account_analytic_line(osv.osv):
(prod.name, prod.id,))
if not company_id:
company_id=company_obj._company_default_get(cr, uid, 'account.analytic.line', context)
flag = False
# Compute based on pricetype
pricetype=self.pool.get('product.price.type').browse(cr, uid, company_obj.browse(cr,uid,company_id).property_valuation_price_type.id)
pricetype=product_price_type_obj.browse(cr, uid, company_obj.browse(cr,uid,company_id).property_valuation_price_type.id)
if journal_id:
journal = analytic_journal_obj.browse(cr, uid, journal_id)
if journal.type == 'sale':
product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','list_price')], context)
if product_price_type_ids:
pricetype = product_price_type_obj.browse(cr, uid, product_price_type_ids, context)[0]
# Take the company currency as the reference one
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
result = round(amount, prec)
if not flag:
result *= -1
return {'value': {
'amount': - round(amount, prec),
'amount': result,
'general_account_id': a,
}}
return {}
@ -114,52 +131,6 @@ class account_analytic_line(osv.osv):
account_analytic_line()
class timesheet_invoice(osv.osv):
_name = "report.hr.timesheet.invoice.journal"
_description = "Analytic Account Costs and Revenues"
_auto = False
_columns = {
'name': fields.char('Year',size=64,required=False, readonly=True),
'account_id':fields.many2one('account.analytic.account', 'Analytic Account', readonly=True, select=True),
'journal_id': fields.many2one('account.analytic.journal', 'Journal', readonly=True),
'quantity': fields.float('Quantities', readonly=True),
'cost': fields.float('Credit', readonly=True),
'revenue': fields.float('Debit', readonly=True),
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
}
_order = 'name desc, account_id'
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_hr_timesheet_invoice_journal')
cr.execute("""
create or replace view report_hr_timesheet_invoice_journal as (
select
min(l.id) as id,
to_char(l.date, 'YYYY') as name,
to_char(l.date,'MM') as month,
sum(
CASE WHEN l.amount>0 THEN 0 ELSE l.amount
END
) as cost,
sum(
CASE WHEN l.amount>0 THEN l.amount ELSE 0
END
) as revenue,
sum(l.unit_amount* COALESCE(u.factor, 1)) as quantity,
journal_id,
account_id
from account_analytic_line l
LEFT OUTER join product_uom u on (u.id=l.product_uom_id)
group by
to_char(l.date, 'YYYY'),
to_char(l.date,'MM'),
journal_id,
account_id
)""")
timesheet_invoice()
class res_partner(osv.osv):
""" Inherits partner and adds contract information in the partner form """
_inherit = 'res.partner'

View File

@ -141,6 +141,7 @@ class account_bank_statement(osv.osv):
'balance_end_real': fields.float('Ending Balance', digits_compute=dp.get_precision('Account'),
states={'confirm':[('readonly', True)]}),
'balance_end': fields.function(_end_balance, method=True, string='Balance'),
'company_id': fields.related('journal_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, required=True),
'line_ids': fields.one2many('account.bank.statement.line',
'statement_id', 'Statement lines',
states={'confirm':[('readonly', True)]}),
@ -626,13 +627,15 @@ account_bank_statement_reconcile_line()
class account_bank_statement_line(osv.osv):
def onchange_partner_id(self, cursor, user, line_id, partner_id, type, currency_id, context=None):
res_users_obj = self.pool.get('res.users')
res_currency_obj = self.pool.get('res.currency')
res = {'value': {}}
obj_partner = self.pool.get('res.partner')
if context is None:
context = {}
if not partner_id:
return res
account_id = False
line = self.browse(cursor, user, line_id)
if not line or (line and not line[0].account_id):
part = obj_partner.browse(cursor, user, partner_id, context=context)
@ -642,9 +645,7 @@ class account_bank_statement_line(osv.osv):
account_id = part.property_account_receivable.id
res['value']['account_id'] = account_id
if not line or (line and not line[0].amount):
res_users_obj = self.pool.get('res.users')
res_currency_obj = self.pool.get('res.currency')
if account_id and (not line or (line and not line[0].amount)) and not context.get('amount', False):
company_currency_id = res_users_obj.browse(cursor, user, user,
context=context).company_id.currency_id.id
if not currency_id:
@ -710,6 +711,7 @@ class account_bank_statement_line(osv.osv):
'reconcile_amount': fields.function(_reconcile_amount,
string='Amount reconciled', method=True, type='float'),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of bank statement lines."),
'company_id': fields.related('statement_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, required=True),
}
_defaults = {
'name': lambda self,cr,uid,context={}: self.pool.get('ir.sequence').get(cr, uid, 'account.bank.statement.line'),
@ -720,4 +722,4 @@ class account_bank_statement_line(osv.osv):
account_bank_statement_line()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -151,17 +151,37 @@ class account_cash_statement(osv.osv):
res[r] = round(res[r], 2)
return res
def _get_company(self, cr, uid, ids, context={}):
def _get_company(self, cr, uid, context={}):
user_pool = self.pool.get('res.users')
company_pool = self.pool.get('res.company')
user = user_pool.browse(cr, uid, uid, uid)
user = user_pool.browse(cr, uid, uid, context)
company_id = user.company_id and user.company_id.id
if not company_id:
company_id = company_pool.search(cr, uid, [])[0]
return company_id
def _get_cash_open_box_lines(self, cr, uid, ids, context={}):
def _get_cash_open_box_lines(self, cr, uid, context={}):
res = []
curr = [1, 2, 5, 10, 20, 50, 100, 500]
for rs in curr:
dct = {
'pieces':rs,
'number':0
}
res.append(dct)
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)
if results:
cash_st = self.browse(cr, uid, results, context)[0]
for cash_line in cash_st.ending_details_ids:
for r in res:
if cash_line.pieces == r['pieces']:
r['number'] = cash_line.number
return res
def _get_default_cash_close_box_lines(self, cr, uid, context={}):
res = []
curr = [1, 2, 5, 10, 20, 50, 100, 500]
for rs in curr:
@ -172,7 +192,7 @@ class account_cash_statement(osv.osv):
res.append(dct)
return res
def _get_cash_close_box_lines(self, cr, uid, ids, context={}):
def _get_cash_close_box_lines(self, cr, ids, uid, context={}):
res = []
curr = [1, 2, 5, 10, 20, 50, 100, 500]
for rs in curr:
@ -180,16 +200,16 @@ class account_cash_statement(osv.osv):
'pieces':rs,
'number':0
}
res.append((0, 0, dct))
res.append((0,0,dct))
return res
_columns = {
'company_id':fields.many2one('res.company', 'Company', required=False),
'journal_id': fields.many2one('account.journal', 'Journal', required=True, states={'confirm': [('readonly', True)]}, domain=[('type', '=', 'cash')]),
'company_id':fields.many2one('res.company', 'Company', required=True, states={'draft': [('readonly', False)]}, readonly=True,),
'journal_id': fields.many2one('account.journal', 'Journal', required=True, states={'draft': [('readonly', False)]}, readonly=True, domain=[('type', '=', 'cash')]),
'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', 'Confirmed'),
('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"),
@ -197,7 +217,7 @@ class account_cash_statement(osv.osv):
'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, readonly=False, 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'),
'name': fields.char('Name', size=64, required=True, states={'draft': [('readonly', False)]}, readonly=True, help='if you give the Name other then / , its created Accounting Entries Move will be with same name as statement name. This allows the statement entries to have the same references than the statement itself'),
'user_id':fields.many2one('res.users', 'Responsible', required=False),
}
_defaults = {
@ -206,7 +226,7 @@ class account_cash_statement(osv.osv):
'user_id': lambda self, cr, uid, context=None: uid,
'company_id': _get_company,
'starting_details_ids':_get_cash_open_box_lines,
'ending_details_ids':_get_cash_open_box_lines
'ending_details_ids':_get_default_cash_close_box_lines
}
def create(self, cr, uid, vals, context=None):
@ -305,25 +325,25 @@ class account_cash_statement(osv.osv):
'name': number
})
cr.execute("select id from account_bank_statement where journal_id=%s and user_id=%s and state=%s order by id desc limit 1", (statement.journal_id.id, uid, 'confirm'))
rs = cr.fetchone()
rs = rs and rs[0] or None
if rs:
if len(statement.starting_details_ids) > 0:
sid = []
for line in statement.starting_details_ids:
sid.append(line.id)
cash_pool.unlink(cr, uid, sid)
statement = statement_pool.browse(cr, uid, rs)
balance_start = statement.balance_end_real or 0.0
open_ids = cash_pool.search(cr, uid, [('ending_id','=',statement.id)])
for sid in open_ids:
default = {
'ending_id': False,
'starting_id':ids[0]
}
cash_pool.copy(cr, uid, sid, default)
# cr.execute("select id from account_bank_statement where journal_id=%s and user_id=%s and state=%s order by id desc limit 1", (statement.journal_id.id, uid, 'confirm'))
# rs = cr.fetchone()
# rs = rs and rs[0] or None
# if rs:
# if len(statement.starting_details_ids) > 0:
# sid = []
# for line in statement.starting_details_ids:
# sid.append(line.id)
# cash_pool.unlink(cr, uid, sid)
#
# statement = statement_pool.browse(cr, uid, rs)
# balance_start = statement.balance_end_real or 0.0
# open_ids = cash_pool.search(cr, uid, [('ending_id','=',statement.id)])
# for sid in open_ids:
# default = {
# 'ending_id': False,
# 'starting_id':ids[0]
# }
# cash_pool.copy(cr, uid, sid, default)
vals.update({
'date':time.strftime("%Y-%m-%d %H:%M:%S"),

View File

@ -211,11 +211,11 @@
<field name="state"/>
<field name="residual"/>
<group col="6" colspan="4">
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="terp-stock_effects-object-colorize"/>
<button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" icon="gtk-cancel"/>
<button name="invoice_open" states="draft,proforma2" string="Approve" icon="terp-camera_test"/>
<button name="%(action_account_invoice_refund)d" type='action' string='Refund' states='open,paid' icon="gtk-execute"/>
<button name="%(action_account_state_open)d" type='action' string='Re-Open' states='paid' icon="gtk-convert" groups="base.group_no_one"/>
<button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" icon="gtk-cancel"/>
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="terp-stock_effects-object-colorize"/>
</group>
</group>
</page>
@ -360,12 +360,12 @@
<filter icon="terp-gtk-media-pause" string="Proforma" domain="[('state','=','proforma2')]" help="Proforma Invoices"/>
<filter icon="terp-camera_test" string="Invoices" domain="[('state','not in',['draft','cancel'])]" help="Invoices"/>
<separator orientation="vertical"/>
<filter icon="terp-dolar_ok!" string="Unpaid" domain="[('state','=','open')]" help="Unpaid Invoices"/>
<filter name="unpaid" icon="terp-dolar_ok!" string="Unpaid" domain="[('state','=','open')]" help="Unpaid Invoices"/>
<separator orientation="vertical"/>
<field name="number"/>
<field name="partner_id"/>
<field name="user_id" select="1" default="uid" widget="selection" string="Salesman">
<filter domain="[('user_id','=',uid)]" help="My invoices" icon="terp-personal" separator="1"/>
<filter domain="[('user_id','=',uid)]" help="My invoices" icon="terp-personal" separator="1"/>
</field>
<field name="origin"/>
<field name="amount_total"/>
@ -377,13 +377,13 @@
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
<filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id'}"/>
<separator orientation="vertical"/>
<filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id'}"/>
<filter string="Invoice Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_invoice'}"/>
<filter string="Due Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_due'}"/>
</group>
@ -505,9 +505,12 @@
<act_window context="{'search_default_partner_id':[active_id]}" id="act_res_partner_2_account_invoice_opened" name="Invoices" res_model="account.invoice" src_model="res.partner"/>
<act_window domain="[('journal_id','=',active_id),('state','!=','draft'),('reconciled','=',False)]" id="act_account_journal_2_account_invoice_opened" name="Unpaid invoices" res_model="account.invoice" src_model="account.journal"/>
<act_window domain="[('account_analytic_id', '=', active_id)]" id="act_account_analytic_account_2_account_invoice_line" name="Invoice lines" res_model="account.invoice.line" src_model="account.analytic.account"/>
<act_window
id="act_account_journal_2_account_invoice_opened"
name="Unpaid Invoices"
context="{'search_default_journal_id':active_id, 'search_default_unpaid':1,}"
res_model="account.invoice"
src_model="account.journal"/>
<act_window
domain="[('partner_id', '=', partner_id), ('account_id.reconcile', '=', True)]"

View File

@ -7,8 +7,9 @@
<menuitem id="menu_finance_payables" name="Vendors" parent="menu_finance" sequence="2" groups="group_account_user,group_account_manager,base.group_system"/>
<menuitem id="menu_finance_bank_and_cash" name="Bank and Cash" parent="menu_finance" sequence="3"/>
<menuitem id="menu_finance_periodical_processing" name="Periodical Processing" parent="menu_finance" sequence="8" groups="group_account_user,group_account_manager,base.group_system,group_account_invoice"/>
<!-- This menu is used in account_code module -->
<menuitem id="menu_account_coda" name="Statements" parent="menu_finance_periodical_processing" sequence="12"/>
<menuitem id="menu_finance_periodical_processing_bank" name="Bank Reconciliation" parent="menu_finance_periodical_processing" sequence="8" groups="group_account_user,group_account_manager,base.group_system,group_account_invoice"/>
<menuitem id="periodical_processing_journal_entries_validation" name="Draft Entries" parent="menu_finance_periodical_processing" groups="group_account_user,group_account_manager,base.group_system"/>
<menuitem id="periodical_processing_reconciliation" name="Reconciliation" parent="menu_finance_periodical_processing"/>
<menuitem id="periodical_processing_invoicing" name="Invoicing" parent="menu_finance_periodical_processing"/>
@ -19,18 +20,18 @@
<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="base.group_system"/>
<menuitem id="menu_finance_accounting" name="Financial Accounting" parent="menu_finance_configuration"/>
<menuitem id="menu_analytic_accounting" name="Analytic Accounting" parent="menu_finance_configuration" groups="base.group_extended"/>
<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="base.group_extended"/>
<menuitem id="menu_low_level" name="Low Level" parent="menu_finance_accounting" groups="base.group_extended"/>
<menuitem id="menu_configuration_misc" name="Miscellaneous" parent="menu_finance_configuration"/>
<menuitem id="menu_configuration_misc" name="Miscellaneous" parent="menu_finance_configuration" sequence="30"/>
<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" groups="base.group_system,group_account_manager"/>
<menuitem id="menu_finance_entries" name="Accounting" parent="menu_finance" sequence="4"
groups="group_account_user,group_account_manager,base.group_system"/>
<menuitem id="account.menu_finance_recurrent_entries" name="Recurring Entries" parent="menu_finance_periodical_processing" sequence="15"
groups="base.group_extended"/>
<menuitem id="account.menu_finance_recurrent_entries" name="Recurring Entries" parent="menu_finance_periodical_processing" sequence="15" groups="base.group_extended"/>
<menuitem id="menu_account_end_year_treatments" name="End of Period" parent="menu_finance_periodical_processing" groups="group_account_user,group_account_manager,base.group_system"/>
<menuitem id="menu_account_end_year_treatments" name="End of Period" parent="menu_finance_periodical_processing" groups="group_account_user,group_account_manager,base.group_system" 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" groups="account.group_account_manager"/>

View File

@ -159,7 +159,10 @@ class account_move_line(osv.osv):
return context
def _default_get(self, cr, uid, fields, context={}):
if not context.get('journal_id', False) and context.get('search_default_journal_id', False):
context['journal_id'] = context.get('search_default_journal_id')
period_obj = self.pool.get('account.period')
context = self.convert_to_period(cr, uid, context)
@ -459,7 +462,7 @@ class account_move_line(osv.osv):
'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account'),
#TODO: remove this
#'amount_taxed':fields.float("Taxed Amount", digits_compute=dp.get_precision('Account')),
'company_id': fields.related('account_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True)
'company_id': fields.related('account_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True)
}
@ -965,6 +968,24 @@ class account_move_line(osv.osv):
'has been confirmed!') % res[2])
return res
def _remove_move_reconcile(self, cr, uid, move_ids=[], context=None):
# Function remove move rencocile ids related with moves
obj_move_line = self.pool.get('account.move.line')
obj_move_rec = self.pool.get('account.move.reconcile')
unlink_ids = []
if not move_ids:
return True
recs = obj_move_line.read(cr, uid, move_ids, ['reconcile_id','reconcile_partial_id'])
full_recs = filter(lambda x: x['reconcile_id'], recs)
rec_ids = [rec['reconcile_id'][0] for rec in full_recs]
part_recs = filter(lambda x: x['reconcile_partial_id'], recs)
part_rec_ids = [rec['reconcile_partial_id'][0] for rec in part_recs]
unlink_ids += rec_ids
unlink_ids += part_rec_ids
if len(unlink_ids):
obj_move_rec.unlink(cr, uid, unlink_ids)
return True
def unlink(self, cr, uid, ids, context={}, check=True):
self._update_check(cr, uid, ids, context)
result = False
@ -986,7 +1007,7 @@ class account_move_line(osv.osv):
if 'period_id' in vals and 'period_id' not in context:
period_id = vals['period_id']
elif 'journal_id' not in context and 'move_id' in vals:
if vals['move_id']:
if vals.get('move_id', False):
m = self.pool.get('account.move').browse(cr, uid, vals['move_id'])
journal_id = m.journal_id.id
period_id = m.period_id.id
@ -1086,9 +1107,9 @@ class account_move_line(osv.osv):
self._check_date(cr, uid, vals, context, check)
if ('account_id' in vals) and not account_obj.read(cr, uid, vals['account_id'], ['active'])['active']:
raise osv.except_osv(_('Bad account!'), _('You can not use an inactive account!'))
if 'journal_id' in vals and 'journal_id' not in context:
if 'journal_id' in vals:
context['journal_id'] = vals['journal_id']
if 'period_id' in vals and 'period_id' not in context:
if 'period_id' in vals:
context['period_id'] = vals['period_id']
if ('journal_id' not in context) and ('move_id' in vals) and vals['move_id']:
m = self.pool.get('account.move').browse(cr, uid, vals['move_id'])
@ -1097,7 +1118,6 @@ class account_move_line(osv.osv):
self._update_journal_check(cr, uid, context['journal_id'], context['period_id'], context)
company_currency = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id.id
move_id = vals.get('move_id', False)
journal = self.pool.get('account.journal').browse(cr, uid, context['journal_id'])
is_new_move = False

View File

@ -58,8 +58,8 @@
<field name="arch" type="xml">
<search string="Search Fiscalyear">
<group>
<filter string="Done" domain="[('state','=','done')]" icon="terp-dolar_ok!"/>
<filter string="Draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
<filter string="Open" domain="[('state','=','draft')]" icon="terp-camera_test"/>
<filter string="Closed" domain="[('state','=','done')]" icon="terp-dialog_close"/>
<separator orientation="vertical"/>
<field name="code"/>
<field name="name"/>
@ -116,12 +116,12 @@
<field name="date_stop"/>
<field name="special"/>
<field name="state"/>
<button name="action_draft" states="done" string="Set to Draft" type="object" icon="gtk-convert" groups="account.group_account_manager"/>
<button name="%(action_account_period_close)d" states="draft" string="Close Period" type="action" icon="gtk-convert"/>
<button name="action_draft" states="done" string="Set to Draft" type="object" icon="terp-document-new" groups="account.group_account_manager"/>
<button name="%(action_account_period_close)d" states="draft" string="Close Period" type="action" icon="terp-camera_test"/>
</tree>
</field>
</record>
<record id="view_account_period_search" model="ir.ui.view">
<field name="name">account.period.search</field>
<field name="model">account.period</field>
@ -131,13 +131,13 @@
<group>
<filter string="Draft" name="draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
<separator orientation="vertical"/>
<field name="code"/>
<field name="name"/>
<field name="code"/>
</group>
</search>
</field>
</record>
<record id="action_account_period_form" model="ir.actions.act_window">
<field name="name">Periods</field>
<field name="res_model">account.period</field>
@ -225,6 +225,7 @@
<tree colors="blue:type in ('view');black:type in ('other','receivable','payable','consolidation');gray:type in ('closed')" string="Chart of accounts" toolbar="1" >
<field name="code"/>
<field name="name"/>
<field name="parent_id" invisible="1"/>
<field name="user_type" invisible="1"/>
<field name="debit"/>
<field name="credit"/>
@ -333,8 +334,8 @@
<tree string="Account Journal">
<field name="code"/>
<field name="name"/>
<field name="type" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="type"/>
<field name="user_id"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
@ -346,12 +347,14 @@
<field name="arch" type="xml">
<tree string="Search Account Journal">
<group>
<filter domain="[('type', '=', 'sale')]" string="Sale Journals" icon="terp-sale"/>
<filter domain="[('type', '=', 'purchase')]" string="Purchase Journals" icon="terp-purchase"/>
<filter domain="[('centralisation', '=', 'True')]" string="Centralized Journals" icon="terp-stock"/>
<filter domain="['|', ('type', '=', 'sale'), ('type', '=', 'sale_refund')]" string="Customer Journals" icon="terp-sale"/>
<filter domain="['|', ('type', '=', 'purchase'), ('type', '=', 'purchase_refund')]" string="Vendor Journals" icon="terp-purchase"/>
<filter domain="['|', ('type', '=', 'cash'), ('type', '=', 'bank')]" string="Liquidity Journals" icon="terp-dolar"/>
<filter domain="['|', ('type', '=', 'general'), ('type', '=', 'situation')]" string="Global Journals" icon="terp-stock"/>
<separator orientation="vertical"/>
<field name="code"/>
<field name="name"/>
<field name="user_id"/>
</group>
<newline/>
<group expand="0" string="Group By...">
@ -408,7 +411,7 @@
</group>
<group colspan="2" col="2" groups="base.group_extended">
<separator string="Sequence" colspan="4"/>
<field name="sequence_id"/>
<field name="sequence_id" required="0"/>
</group>
</page>
<page string="Entry Controls" groups="base.group_extended">
@ -441,13 +444,14 @@
<separator orientation="vertical"/>
<field name="date"/>
<field name="name"/>
<field name="journal_id"/>
<field name="journal_id" widget='selection'/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Journal" context="{'group_by': 'journal_id'}" icon="terp-folder-orange"/>
<filter string="Period" context="{'group_by': 'period_id'}" icon="terp-go-month"/>
<filter string="State" context="{'group_by': 'state'}" icon="terp-stock_effects-object-colorize"/>
<separator orientation="vertical"/>
<filter string="Period" context="{'group_by': 'period_id'}" icon="terp-go-month"/>
</group>
</search>
</field>
@ -482,15 +486,17 @@
<filter string="Draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
<filter string="Confirmed" domain="[('state','=','confirm')]" icon="terp-camera_test"/>
<separator orientation="vertical"/>
<field name="journal_id" widget="selection"/>
<field name="date"/>
<field name="name"/>
<field name="date"/>
<field name="period_id"/>
<field name="journal_id" widget="selection"/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Journal" context="{'group_by': 'journal_id'}" icon="terp-folder-orange"/>
<filter string="Period" context="{'group_by': 'period_id'}" icon="terp-go-month"/>
<filter string="State" context="{'group_by': 'state'}" icon="terp-stock_effects-object-colorize"/>
<separator orientation="vertical"/>
<filter string="Period" context="{'group_by': 'period_id'}" icon="terp-go-month"/>
</group>
</search>
</field>
@ -518,7 +524,7 @@
<page string="Transaction">
<field colspan="4" name="line_ids" nolabel="1">
<tree editable="bottom" string="Statement lines">
<field name="sequence" invisible="1"/>
<field name="sequence"/>
<field name="date"/>
<field name="ref"/>
<field name="name"/>
@ -526,6 +532,7 @@
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency, {'amount': amount})"/>
<field domain="[('journal_id','=',parent.journal_id)]" name="account_id"/>
<field name="amount"/>
<field name="analytic_account_id"/>
<field context="{'partner_id': partner_id, 'amount': amount, 'account_id': account_id, 'currency_id': parent.currency, 'journal_id': parent.journal_id, 'date':date}" name="reconcile_id"/>
<field invisible="1" name="reconcile_amount"/>
</tree>
@ -533,7 +540,7 @@
<field name="date"/>
<field name="name"/>
<field name="type"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency)"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency, {'amount': amount})"/>
<field domain="[('journal_id', '=', parent.journal_id), ('type', '&lt;&gt;', 'view')]" name="account_id"/>
<field name="analytic_account_id" groups="base.group_extended" />
<field name="amount"/>
@ -647,7 +654,6 @@
<group col="6" colspan="4">
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="sequence"/>
<field name="parent_id"/>
</group>
<group col="2" colspan="2">
@ -740,16 +746,22 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Account Tax Code">
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="company_id" select="1"/>
<field name="notprintable"/>
<field name="parent_id" select="1"/>
<field name="sign"/>
<newline/>
<field name="sum"/>
<field name="sum_period"/>
<newline/>
<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"/>
</group>
<group colspan="2" col="2">
<separator string="Reporting Configuration" colspan="4"/>
<field name="notprintable"/>
<field name="sign"/>
</group>
<group colspan="2" col="2">
<separator string="Statistics" colspan="4"/>
<field name="sum_period"/>
<field name="sum"/>
</group>
<separator string="Description" colspan="4"/>
<field colspan="4" name="info" nolabel="1"/>
</form>
@ -1065,8 +1077,8 @@
<group col='10' colspan='4'>
<filter icon="terp-document-new" string="Unbalanced" domain="[('state','=','draft')]" help="Unbalanced Journal Items"/>
<separator orientation="vertical"/>
<filter icon="terp-document-new" string="Unposted" domain="[('move_id.state','=','draft')]" help="Unposted Journal Items"/>
<filter icon="terp-camera_test" string="Posted" domain="[('move_id.state','=','posted')]" help="Posted Journal Items"/>
<filter icon="terp-stock_symbol-selection" string="Unposted" domain="[('move_id.state','=','draft')]" help="Unposted Journal Items"/>
<separator orientation="vertical"/>
<filter
icon="terp-dolar_ok!"
@ -1088,11 +1100,11 @@
</group>
<newline/>
<group expand="0" string="Group By..." colspan="12" col="10">
<filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
<filter string="Account" icon="terp-folder-orange" context="{'group_by':'account_id'}"/>
<separator orientation="vertical"/>
<filter string="Partner" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
<separator orientation="vertical"/>
<filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
<filter string="Account" icon="terp-folder-green" context="{'group_by':'account_id'}"/>
<separator orientation="vertical"/>
<filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id'}"/>
</group>
<newline/>
@ -1100,7 +1112,6 @@
<field name="ref" select="1" string="Reference"/>
<field name="name" select="1"/>
<field name="narration" select="1"/>
<field name="balance" string="Debit/Credit" select='1'/>
</group>
</search>
@ -1324,7 +1335,7 @@
<field name="arch" type="xml">
<search string="Search Move">
<group col='8' colspan='4'>
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Journal Entries"/>
<filter icon="terp-document-new" string="Unposted" domain="[('state','=','draft')]" help="Unposted Journal Entries"/>
<filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Journal Entries"/>
<separator orientation="vertical"/>
<filter icon="terp-stock_zoom" string="To Review" domain="[('to_check','=',True)]" groups="base.group_extended" help="Journal Entries to Review"/>
@ -1341,11 +1352,12 @@
</group>
<newline/>
<group expand="0" string="Group By..." colspan="12" col="10">
<filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
<filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id'}"/>
<filter string="States" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
<filter string="Partner" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
<separator orientation="vertical"/>
<filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
<filter string="States" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id'}"/>
<filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
</group>
</search>
@ -1490,19 +1502,17 @@
<act_window
domain="[('account_id', '=', active_id)]"
id="act_account_acount_move_line_open"
name="Entries"
context="{'account_id': active_id}"
context="{'search_default_account_id':[active_id], 'search_default_unreconciled':0}"
res_model="account.move.line"
src_model="account.account"/>
<act_window
domain="[('account_id', '=', active_id),('reconcile_id','=',False)]"
id="act_account_acount_move_line_open_unreconciled"
name="Unreconciled entries"
name="Unreconciled Entries"
res_model="account.move.line"
context="{'account_id': active_id}"
context="{'search_default_account_id':[active_id], 'search_default_unreconciled':1,}"
src_model="account.account"/>
<act_window domain="[('reconcile_id', '=', active_id)]" id="act_account_acount_move_line_reconcile_open" name="Reconciled entries" res_model="account.move.line" src_model="account.move.reconcile"/>
@ -1546,13 +1556,12 @@
<field name="arch" type="xml">
<tree string="Journal Entry Model Line" editable="bottom">
<field name="sequence"/>
<field name="ref"/>
<field name="name"/>
<field name="account_id"/>
<field name="analytic_account_id"/>
<field name="partner_id"/>
<field name="debit"/>
<field name="credit"/>
<field name="date"/>
<field name="date_maturity"/>
</tree>
</field>
@ -1567,14 +1576,12 @@
<form string="Journal Entry Model Line">
<field colspan="4" name="name" select="1"/>
<field name="sequence"/>
<field name="ref" select="1"/>
<field name="account_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<field name="analytic_account_id"/>
<field name="partner_id"/>
<field name="debit" select="1"/>
<field name="credit" select="1"/>
<field name="quantity"/>
<newline/>
<field name="date"/>
<field name="quantity"/>
<field name="date_maturity"/>
</form>
</field>
@ -1587,9 +1594,8 @@
<field name="arch" type="xml">
<form string="Journal Entry Model">
<field name="name" select="1"/>
<field name="ref" select="1"/>
<field name="journal_id" select="1"/>
<field name="company_id" select="1" widget='selection'/>
<field name="company_id" select="1" 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"/>
@ -1599,6 +1605,7 @@
</form>
</field>
</record>
<record id="view_model_tree" model="ir.ui.view">
<field name="name">account.model.tree</field>
<field name="model">account.model</field>
@ -1607,15 +1614,39 @@
<tree string="Journal Entry Model">
<field name="name"/>
<field name="journal_id"/>
<field name="company_id"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<record id="view_model_search" model="ir.ui.view">
<field name="name">account.model.search</field>
<field name="model">account.model</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Journal Entry Model">
<group>
<filter string="Sale" icon="terp-sale" domain="[('journal_id.type', '=', 'sale')]"/>
<filter string="Purchase" icon="terp-purchase" domain="[('journal_id.type', '=', 'purchase')]"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="journal_id"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
</group>
</search>
</field>
</record>
<record id="action_model_form" model="ir.actions.act_window">
<field name="name">Recurring Models</field>
<field name="res_model">account.model</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">tree,form,search</field>
<field name="search_view_id" ref="view_model_search"/>
</record>
<menuitem action="action_model_form" id="menu_action_model_form" sequence="5" parent="account.menu_configuration_misc" groups="base.group_extended"/>
@ -1648,11 +1679,34 @@
<form string="Payment Term">
<field name="name" select="1"/>
<field name="sequence"/>
<field name="value"/>
<field name="value_amount" attrs="{'readonly':[('value','=','balance')]}"/>
<group colspan="2" col="4">
<separator string="Amount Computation" colspan="4"/>
<field name="value" colspan="4"/>
<field name="value_amount" colspan="4" attrs="{'readonly':[('value','=','balance')]}"/>
</group>
<group colspan="2" col="4">
<separator string="Due date Computation" colspan="4"/>
<field name="days" colspan="4"/>
<field name="days2" colspan="4"/>
</group>
<label string=""/>
<newline/>
<field name="days"/>
<field name="days2"/>
<label string="Example: at 14 net days 2 percents, remaining amount at 30 days end of month." colspan="4"/>
<group colspan="2" col="2">
<label string="Line 1:" colspan="2"/>
<label string=" valuation: percent"/>
<label string=" number of days: 14"/>
<label string=" value amount: 0.02"/>
<label string=" day of the month: 0"/>
</group>
<newline/>
<group colspan="2" col="2">
<label string="Line 2:" colspan="2"/>
<label string=" valuation: balance"/>
<label string=" number of days: 30"/>
<label string=" value amount: n.a"/>
<label string=" day of the month= -1"/>
</group>
</form>
</field>
</record>
@ -1716,13 +1770,38 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree colors="blue:state in ('draft');gray:state in ('done');black:state in ('running')" string="Entry Subscription">
<field name="ref"/>
<field name="name"/>
<field name="model_id"/>
<field name="ref"/>
<field name="date_start"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="view_subscription_search" model="ir.ui.view">
<field name="name">account.subscription.search</field>
<field name="model">account.subscription</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Entry Subscription">
<group col="8" colspan="4">
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Subscription"/>
<filter icon="terp-camera_test" string="Running" domain="[('state','=','running')]" help="Running Subscription"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="model_id"/>
<field name="date_start"/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Model" icon="terp-folder-orange" domain="[]" context="{'group_by':'model_id'}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
</group>
</search>
</field>
</record>
<record id="view_subscription_form" model="ir.ui.view">
<field name="name">account.subscription.form</field>
<field name="model">account.subscription</field>
@ -1765,6 +1844,7 @@
<field name="res_model">account.subscription</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_subscription_search"/>
</record>
<menuitem name="Define Recurring Entries" action="action_subscription_form" id="menu_action_subscription_form" sequence="1" parent="account.menu_finance_recurrent_entries"/>
@ -1853,9 +1933,19 @@
# Admin config
-->
<act_window domain="[('journal_id', '=', active_id)]" id="act_account_journal_2_account_bank_statement" name="Bank statements" res_model="account.bank.statement" src_model="account.journal"/>
<act_window
id="act_account_journal_2_account_bank_statement"
name="Bank statements"
context="{'search_default_journal_id':active_id,}"
res_model="account.bank.statement"
src_model="account.journal"/>
<act_window domain="[('journal_id', '=', active_id)]" id="act_account_journal_2_account_move_line" name="Journal Items" res_model="account.move.line" src_model="account.journal"/>
<act_window
id="act_account_journal_2_account_move_line"
name="Journal Items"
context="{'search_default_journal_id':active_id,}"
res_model="account.move.line"
src_model="account.journal"/>
<act_window context="{'search_default_reconcile_id':False, 'search_default_partner_id':[active_id]}" domain="[('account_id.reconcile', '=', True),('account_id.type', 'in', ['receivable', 'payable'])]" id="act_account_partner_account_move_all" name="Receivables &amp; Payables" res_model="account.move.line" src_model="res.partner" groups="base.group_extended"/>
@ -2386,13 +2476,14 @@
<page string="Cash Transactions" attrs="{'invisible': [('state','=','draft')]}">
<field colspan="4" name="line_ids" nolabel="1">
<tree editable="bottom" string="Statement lines">
<field name="sequence" invisible="1"/>
<field name="sequence"/>
<field name="date"/>
<field name="ref"/>
<field name="name"/>
<field name="type"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency, {'amount': amount})"/>
<field domain="[('journal_id','=',parent.journal_id)]" name="account_id"/>
<field name="analytic_account_id" groups="base.group_extended" />
<field name="amount"/>
<field context="{'partner_id': partner_id, 'amount': amount, 'account_id': account_id, 'currency_id': parent.currency, 'journal_id': parent.journal_id, 'date':date}" name="reconcile_id"/>
<field invisible="1" name="reconcile_amount"/>
@ -2451,11 +2542,11 @@
<group col="2" colspan="2">
<separator string="Dates" colspan="4"/>
<field name="date" select="1" attrs="{'readonly':[('state','!=','draft')]}" on_change="onchange_date(date)"/>
<field name="closing_date" select="1" attrs="{'readonly':[('state','=','confirm')]}"/>
<field name="closing_date" select="1" readonly="1"/>
</group>
<group col="2" colspan="2">
<separator string="Opening Balance" colspan="4"/>
<field name="balance_start" attrs="{'readonly':[('state','in',('open','confirm'))]}" string="Opening Balance"/>
<field name="balance_start" readonly="1" string="Opening Balance"/>
<field name="total_entry_encoding"/>
</group>
<group col="2" colspan="2">

View File

@ -463,13 +463,13 @@
<field name="name">Sale Journal</field>
<field name="code">account.journal</field>
<field eval="3" name="padding"/>
<field name="prefix">%(year)s/</field>
<field name="prefix">SAJ/%(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">%(year)s/</field>
<field name="prefix">EXJ/%(year)s/</field>
</record>
<!--

View File

@ -151,7 +151,7 @@
<field name="code">X11004</field>
<field name="name">Bank Current Account - (test)</field>
<field ref="cas" name="parent_id"/>
<field name="type">other</field>
<field name="type">liquidity</field>
<field name="user_type" ref="account_type_asset"/>
</record>
@ -159,7 +159,7 @@
<field name="code">X11005</field>
<field name="name">Cash - (test)</field>
<field ref="cas" name="parent_id"/>
<field name="type">other</field>
<field name="type">liquidity</field>
<field name="user_type" ref="account_type_asset"/>
</record>
@ -346,7 +346,6 @@
<field name="type">sale</field>
<field name="view_id" ref="account_sp_journal_view"/>
<field name="sequence_id" ref="sequence_sale_journal"/>
<field name="invoice_sequence_id" ref="seq_out_invoice"/>
<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="user_id" ref="base.user_root"/>
@ -358,7 +357,6 @@
<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="invoice_sequence_id" ref="seq_out_refund"/>
<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="user_id" ref="base.user_root"/>
@ -370,7 +368,6 @@
<field name="type">purchase</field>
<field name="view_id" ref="account_sp_journal_view"/>
<field name="sequence_id" ref="sequence_purchase_journal"/>
<field name="invoice_sequence_id" ref="seq_in_invoice"/>
<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="user_id" ref="base.user_root"/>
@ -382,7 +379,6 @@
<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="invoice_sequence_id" ref="seq_in_refund"/>
<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="user_id" ref="base.user_root"/>

View File

@ -469,7 +469,7 @@ class account_installer(osv.osv_memory):
def execute(self, cr, uid, ids, context=None):
if context is None:
context = {}
res_obj = self.pool.get('account.fiscalyear')
fy_obj = self.pool.get('account.fiscalyear')
data_pool = self.pool.get('ir.model.data')
obj_acc = self.pool.get('account.account')
super(account_installer, self).execute(cr, uid, ids, context=context)
@ -531,7 +531,7 @@ class account_installer(osv.osv_memory):
'company_id': company_id.id,
'sign': 1,
'parent_id':pur_tax_parent_id
}
}
new_tax_code = self.pool.get('account.tax.code').create(cr, uid, vals_tax_code)
purchase_tax = obj_tax.create(cr, uid,
{'name':'TAX%s%%'%(p_tax*100),
@ -556,21 +556,23 @@ class account_installer(osv.osv_memory):
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:
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']
}
period_id = res_obj.create(cr, uid, vals, context=context)
if res['period'] == 'month':
res_obj.create_period(cr, uid, [period_id])
elif res['period'] == '3months':
res_obj.create_period3(cr, uid, [period_id])
f_ids = fy_obj.search(cr, uid, [('date_start', '<=', res['date_start']), ('date_stop', '>=', res['date_stop']), ('company_id','=',res['company_id'])])
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']
}
fiscal_id = fy_obj.create(cr, uid, vals, context=context)
if res['period'] == 'month':
fy_obj.create_period(cr, uid, [fiscal_id])
elif res['period'] == '3months':
fy_obj.create_period3(cr, uid, [fiscal_id])
# #fially inactive the demo chart of accounts
# data_id = data_pool.search(cr, uid, [('model','=','account.account'), ('name','=','chart0')])

View File

@ -397,10 +397,10 @@ class account_invoice(osv.osv):
rec_pro_id = property_obj.search(cr,uid,[('name','=','property_account_receivable'),('company_id','=',company_id)])
if not pay_pro_id:
pay_pro_id = property_obj.search(cr,uid,[('name','=','property_account_payable'),('company_id','=',company_id)])
rec_line_data = property_obj.read(cr,uid,rec_pro_id,['name','value','res_id'])
pay_line_data = property_obj.read(cr,uid,pay_pro_id,['name','value','res_id'])
rec_res_id = rec_line_data and int(rec_line_data[0]['value'].split(',')[1]) or False
pay_res_id = pay_line_data and int(pay_line_data[0]['value'].split(',')[1]) or False
rec_line_data = property_obj.read(cr,uid,rec_pro_id,['name','value_reference','res_id'])
pay_line_data = property_obj.read(cr,uid,pay_pro_id,['name','value_reference','res_id'])
rec_res_id = rec_line_data and rec_line_data[0].get('value_reference',False) and int(rec_line_data[0]['value_reference'].split(',')[1]) or False
pay_res_id = pay_line_data and pay_line_data[0].get('value_reference',False) and int(pay_line_data[0]['value_reference'].split(',')[1]) or False
if not rec_res_id and not pay_res_id:
raise osv.except_osv(_('Configuration Error !'),
_('Can not find account chart for this company, Please Create account.'))
@ -493,10 +493,10 @@ class account_invoice(osv.osv):
rec_pro_id = property_obj.search(cr, uid, [('name','=','property_account_receivable'),('company_id','=',company_id)])
if not pay_pro_id:
pay_pro_id = property_obj.search(cr, uid, [('name','=','property_account_payable'),('company_id','=',company_id)])
rec_line_data = property_obj.read(cr, uid, rec_pro_id, ['name','value','res_id'])
pay_line_data = property_obj.read(cr, uid, pay_pro_id, ['name','value','res_id'])
rec_res_id = rec_line_data and int(rec_line_data[0]['value'].split(',')[1]) or False
pay_res_id = pay_line_data and int(pay_line_data[0]['value'].split(',')[1]) or False
rec_line_data = property_obj.read(cr, uid, rec_pro_id, ['name','value_reference','res_id'])
pay_line_data = property_obj.read(cr, uid, pay_pro_id, ['name','value_reference','res_id'])
rec_res_id = rec_line_data and rec_line_data[0].get('value_reference',False) and int(rec_line_data[0]['value_reference'].split(',')[1]) or False
pay_res_id = pay_line_data and pay_line_data[0].get('value_reference',False) and int(pay_line_data[0]['value_reference'].split(',')[1]) or False
if not rec_res_id and not pay_res_id:
raise osv.except_osv(_('Configuration Error !'),
_('Can not find account chart for this company, Please Create account.'))
@ -529,7 +529,7 @@ class account_invoice(osv.osv):
if company_id and type:
if type in ('out_invoice'):
journal_type = 'sale'
elif type in ('out_refund'):
elif type in ('out_refund'):
journal_type = 'sale_refund'
elif type in ('in_refund'):
journal_type = 'purchase_refund'
@ -802,6 +802,17 @@ class account_invoice(osv.osv):
if inv.type in ('in_invoice', 'in_refund') and abs(inv.check_total - inv.amount_total) >= (inv.currency_id.rounding/2.0):
raise osv.except_osv(_('Bad total !'), _('Please verify the price of the invoice !\nThe real total does not match the computed total.'))
if inv.payment_term:
total_fixed = total_percent = 0
for line in inv.payment_term.line_ids:
if line.value == 'fixed':
total_fixed += line.value_amount
if line.value == 'procent':
total_percent += line.value_amount
total_fixed = (total_fixed * 100) / inv.amount_total
if (total_fixed + total_percent) > 100:
raise osv.except_osv(_('Error !'), _("You cannot create an invoice !\nAs you have defined payment term and so the total of invoice should be greater than the computed amount for journal entries using payment term"))
# one move line per tax line
iml += ait_obj.move_line_get(cr, uid, inv.id)
@ -912,7 +923,6 @@ class account_invoice(osv.osv):
# account move reference when creating the same invoice after a cancelled one:
self.pool.get('account.move').post(cr, uid, [move_id], context={'invoice':inv})
self._log_event(cr, uid, ids)
return True
def line_get_convert(self, cr, uid, x, part, date, context=None):
@ -1202,7 +1212,7 @@ class account_invoice_line(osv.osv):
cur_obj = self.pool.get('res.currency')
for line in self.browse(cr, uid, ids):
price = line.price_unit * (1-(line.discount or 0.0)/100.0)
taxes = tax_obj.compute_all(cr, uid, line.invoice_line_tax_id, price, line.quantity)
taxes = tax_obj.compute_all(cr, uid, line.invoice_line_tax_id, price, line.quantity, product=line.product_id, address_id=line.invoice_id.address_invoice_id, partner=line.invoice_id.partner_id)
res[line.id] = taxes['total']
if line.invoice_id:
cur = line.invoice_id.currency_id
@ -1299,7 +1309,12 @@ class account_invoice_line(osv.osv):
else:
app_acc_in = in_acc_cate
else:
app_acc_in = account_obj.browse(cr, uid, in_pro_id)[0]
# Get the fields from the ir.property record
my_value = property_obj.read(cr,uid,in_pro_id,['name','value_reference','res_id'])
# Parse the value_reference field to get the ID of the account.account record
account_id = int (my_value[0]["value_reference"].split(",")[1])
# Use the ID of the account.account record in the browse for the account.account record
app_acc_in = account_obj.browse(cr, uid, [account_id])[0]
if not exp_pro_id:
ex_acc = res.product_tmpl_id.property_account_expense
ex_acc_cate = res.categ_id.property_account_expense_categ

View File

@ -11,7 +11,5 @@
<report auto="False" id="account_analytic_account_quantity_cost_ledger" menu="False" model="account.analytic.account" name="account.analytic.account.quantity_cost_ledger" rml="account/project/report/quantity_cost_ledger.rml" string="Cost Ledger (Only quantities)"/>
<report auto="False" id="account_analytic_account_analytic_check" menu="False" model="account.account" name="account.analytic.account.analytic.check" rml="account/project/report/analytic_check.rml" string="Analytic Check"/>
</data>
</openerp>

View File

@ -8,7 +8,7 @@
<field name="type">tree</field>
<field eval="8" name="priority"/>
<field name="arch" type="xml">
<tree colors="red:(date&lt;=current_date);black:(date&gt;current_date)" string="Analytic account">
<tree toolbar="1" colors="red:(date&lt;current_date);black:(date&gt;=current_date);black:(date==False)" string="Analytic account">
<field name="code"/>
<field name="complete_name"/>
<field name="quantity"/>
@ -25,8 +25,9 @@
<field name="arch" type="xml">
<search string="Analytic Account">
<group col="8" colspan="4">
<filter icon="terp-check" string="Current" domain="[('state','=','open')]" help="Current Accounts"/>
<filter icon="terp-go-today" string="Overpassed Account" domain="[('date','&lt;',time.strftime('%%Y-%%m-%%d'))]" help="Overpassed Account"/>
<filter icon="terp-gtk-media-pause" string="Pending" domain="[('state','=','pending')]" help="Pending Accounts"/>
<filter icon="terp-camera_test" string="Current" domain="[('state','=','open')]" help="Current Accounts"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="code" select="1"/>
@ -38,7 +39,7 @@
<filter string="Parent" icon="terp-folder-orange" domain="[]" context="{'group_by':'parent_id'}"/>
<filter string="Type" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'type'}"/>
<separator orientation="vertical"/>
<filter string="Associated Partner" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Associated Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Manager" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
</group>
</search>
@ -51,15 +52,16 @@
<field name="type">tree</field>
<field name="field_parent">child_ids</field>
<field name="arch" type="xml">
<tree toolbar="True" string="Analytic Account">
<tree colors="red:(date&lt;current_date);black:(date&gt;=current_date);black:(date==False)" string="Analytic account" toolbar="1">
<field name="name"/>
<field name="code"/>
<field name="partner_id"/>
<field name="quantity"/>
<field name="quantity_max"/>
<field name="debit"/>
<field name="credit"/>
<field name="balance"/>
<field name="company_currency_id"/>
<field name="currency_id"/>
<field name="date" invisible="1"/>
</tree>
</field>
</record>
@ -76,7 +78,6 @@
<field name="parent_id" on_change="on_change_parent(parent_id)" groups="base.group_extended"/>
<field name="company_id" select="2" widget="selection" groups="base.group_multi_company"/>
<field name="type" select="2"/>
<field name="company_currency_id" select="2"/>
</group>
<notebook colspan="4">
<page string="Account Data">
@ -84,7 +85,6 @@
<newline/>
<field name="date_start"/>
<field name="date" select="2"/>
<newline/>
<field name="quantity_max"/>
<field name="user_id"/>
@ -104,10 +104,9 @@
<field name="view_type">form</field>
<field name="view_mode">tree,graph,form</field>
<field name="view_id" ref="view_account_analytic_account_tree"/>
<field name="context">{"search_default_user_id":uid}</field>
<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="base.group_extended"/>
<menuitem action="action_account_analytic_account_form" id="account_analytic_def_account" parent="menu_analytic_accounting" groups="analytic.group_analytic_accounting"/>
<record id="act_account_renew_view" model="ir.actions.act_window">
<field name="name">Accounts to Renew</field>
@ -121,16 +120,14 @@
<record id="action_account_analytic_account_tree2" model="ir.actions.act_window">
<field name="name">Chart of Analytic Accounts</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.analytic.account</field>
<field name="domain">[('parent_id','=',False)]</field>
<field name="view_type">tree</field>
<field name="view_mode">form,graph</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>
</record>
<menuitem id="next_id_40" name="Analytic" parent="account.menu_finance_generic_reporting" sequence="4" groups="base.group_extended"/>
<menuitem groups="analytic.group_analytic_accounting" 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>
@ -138,23 +135,31 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Analytic Entry">
<separator string="General Information" colspan="4"/>
<field colspan="4" name="name" select="1"/>
<field name="amount" select="2"/>
<field name="date" select="1"/>
<field name="account_id" select="1" groups="base.group_extended"/>
<field name="journal_id" select="2"/>
<field name="general_account_id" select="2"/>
<field name="move_id" select="2"/>
<separator string="Optional Information" colspan="4"/>
<field name="unit_amount" select="2"/>
<field name="ref" select="2"/>
<field name="currency_id" select="2"/>
<field name="amount_currency" select="2"/>
<field name="company_id" select="2" groups="base.group_multi_company"/>
<newline/>
<field name="product_id" select="2"/>
<field name="product_uom_id" select="2"/>
<group colspan="4" col="6">
<field name="name"/>
<field name="ref"/>
<field name="account_id"/>
<field name="journal_id"/>
<field name="date"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
<group colspan="2" col="4">
<separator string="Amount" colspan="4"/>
<field name="amount" colspan="4"/>
<field name="amount_currency" colspan="2"/>
<field name="currency_id" colspan="2" nolabel="1"/>
</group>
<group colspan="2" col="4">
<separator string="Product Information" colspan="4"/>
<field name="product_id" colspan="4"/>
<field name="unit_amount" colspan="2"/>
<field name="product_uom_id" colspan="2" nolabel="1"/>
</group>
<group colspan="2" col="2" groups="base.group_extended">
<separator string="General Accounting" colspan="2"/>
<field name="general_account_id"/>
<field name="move_id" readonly="1"/>
</group>
</form>
</field>
</record>
@ -166,13 +171,13 @@
<tree editable="top" string="Analytic Entries">
<field name="date" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/>
<field name="name"/>
<field name="journal_id"/>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" sum="Total quantity"/>
<field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/>
<field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
<field domain="[('type','=','normal')]" name="account_id" groups="base.group_extended"/>
<field invisible="True" name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/>
<field name="amount" sum="Total amount"/>
<field name="general_account_id"/>
<field name="journal_id"/>
<field name="ref"/>
<field name="currency_id" />
<field name="amount_currency" />
@ -187,12 +192,12 @@
<field name="arch" type="xml">
<search string="Search Analytic Lines">
<group col='6' colspan='4'>
<filter string="Sale" domain="[('journal_id.type','=','sale')]" icon="terp-sale"/>
<filter string="Purchase" domain="[('journal_id.type','=','purchase')]" icon="terp-purchase"/>
<separator orientation="vertical"/>
<filter string="Sale" domain="[('journal_id.type','=','sale')]" icon="terp-sale"/>
<filter string="Purchase" domain="[('journal_id.type','=','purchase')]" icon="terp-purchase"/>
<separator orientation="vertical"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="date" select="1"/>
<field name="name" select="1"/>
<field name="account_id" select="1" groups="base.group_extended"/>
<field name="user_id" widget="selection"/>
</group>
@ -207,9 +212,9 @@
</group>
<newline/>
<group expand="0" string="Extended options...">
<field name="journal_id" widget="selection"/>
<field name="product_id" widget="selection"/>
<field name="amount" select="1"/>
<field name="journal_id" widget="selection"/>
<field name="product_id" widget="selection"/>
<field name="amount" select="1"/>
</group>
</search>
</field>
@ -253,7 +258,7 @@
<field name="date" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/>
<field name="journal_id"/>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/>
<field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/>
<field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
<field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/>
<field invisible="True" name="general_account_id"/>
<field name="amount"/>
@ -295,8 +300,8 @@
<field name="arch" type="xml">
<search string="Analytic Journals">
<group>
<field name="name"/>
<field name="code"/>
<field name="name"/>
<field name="type"/>
</group>
<newline/>
@ -328,7 +333,7 @@
<field name="view_mode">tree,form,search</field>
<field name="search_view_id" ref="view_analytic_journal_search" />
</record>
<menuitem action="action_account_analytic_journal_form" id="account_def_analytic_journal" parent="menu_analytic_accounting" groups="base.group_extended"/>
<menuitem groups="analytic.group_analytic_accounting" action="action_account_analytic_journal_form" id="account_def_analytic_journal" parent="menu_analytic_accounting" sequence="5"/>
#
# Open journal entries
@ -340,7 +345,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem action="action_account_analytic_journal_open_form" id="account_analytic_journal_entries" parent="menu_finance_entries" groups="base.group_extended"/>
<menuitem groups="analytic.group_analytic_accounting" action="action_account_analytic_journal_open_form" id="account_analytic_journal_entries" parent="menu_finance_entries"/>
#
# Reporting
@ -352,7 +357,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 action="action_account_analytic_journal_tree" id="account_analytic_journal_print" parent="account.next_id_40" groups="base.group_extended"/>
<menuitem groups="analytic.group_analytic_accounting" action="action_account_analytic_journal_tree" id="account_analytic_journal_print" parent="account.next_id_40"/>
#
# Statistics
@ -422,17 +427,14 @@
</field>
</record>
<record id="report_account_analytic_journal_tree" model="ir.actions.act_window">
<field name="name">Account cost and revenue by journal</field>
<field name="res_model">report.hr.timesheet.invoice.journal</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="search_view_id" ref="report_hr_timesheet_invoice_journal_search"/>
</record>
<act_window domain="[('account_id', '=', active_id)]" id="act_acc_analytic_acc_5_report_hr_timesheet_invoice_journal" name="All Analytic Entries" res_model="account.analytic.line" src_model="account.analytic.account" view_mode="tree,form" view_type="form"/>
<act_window domain="[('account_id', '=', active_id)]" id="act_acc_analytic_acc_2_report_hr_timesheet_invoice_journal" name="Costs &amp; Revenues" res_model="report.hr.timesheet.invoice.journal" src_model="account.analytic.account" view_mode="graph,tree,form" view_type="form"/>
<act_window
context="{'search_default_account_id': [active_id], 'search_default_user_id': False}"
id="act_acc_analytic_acc_5_report_hr_timesheet_invoice_journal"
name="All Analytic Entries"
res_model="account.analytic.line"
src_model="account.analytic.account"
view_mode="tree,form"
view_type="form"/>
<record id="view_account_journal_1" model="ir.ui.view">
<field name="name">account.journal.form.1</field>

View File

@ -1,190 +0,0 @@
<?xml version="1.0"?>
<document filename="test.pdf">
<template pageSize="(595.0,842.0)" title="Analytic Check" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
<header>
<pageGraphics>
<!--logo-->
<!--<fill color="darkblue"/>-->
<!--<stroke color="darkblue"/>-->
<!--TITLE COMPANY-->
<!-- <drawString x="4.6cm" y="28.7cm">[[ company.partner_id.name ]]</drawString> -->
<setFont name="Helvetica-Bold" size="9"/>
<!--COL 1-->
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
<drawRightString x="20cm" y="28.1cm">Analytic Check - [[ company.currency_id.name ]]</drawRightString>
<!-- Header -->
<setFont name="Helvetica" size="9"/>
<drawString x="1.0cm" y="1cm"> [[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]]</drawString>
<drawString x="19.0cm" y="1cm">Page <pageNumber/></drawString>
<!--<drawRightString x="19.8cm" y="28cm">[[ company.rml_header1 ]]</drawRightString>-->
<lineMode width="0.7"/>
<lines>1cm 27.7cm 20cm 27.7cm</lines>
<setFont name="Helvetica" size="8"/>
</pageGraphics>
</header>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table4">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,1" stop="-1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,2" stop="1,2"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,1"/>
</blockTableStyle>
<blockTableStyle id="Table5">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table3">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="Table1">
<blockAlignment value="LEFT"/>
<lineStyle kind="LINEBELOW" colorName="#777777" start="0,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,1" stop="-1,-1"/>
<blockValign value="TOP"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P2" fontName="Times-Roman" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P3" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Standard" fontName="Times-Roman"/>
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Caption" fontName="Times-Roman" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Times-Roman"/>
<paraStyle name="Preformatted Text" fontName="Courier" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_General" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_R" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Footer" fontName="Times-Roman"/>
<paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_1" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_8_Italic" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
</stylesheet>
<images/>
<story>
<blockTable colWidths="46.0,135.0,60.0,59.0,60.0,59.0,59.0,60.0" style="Table4" repeatRows="1">
<tr>
<td>
<para style="terp_tblheader_General">Code</para>
</td>
<td>
<para style="terp_tblheader_General">Account Name</para>
</td>
<td>
<para style="terp_tblheader_General_R">General Debit</para>
</td>
<td>
<para style="terp_tblheader_General_R">General Credit</para>
</td>
<td>
<para style="terp_tblheader_General_R">Analytic Debit</para>
</td>
<td>
<para style="terp_tblheader_General_R">Analytic Credit</para>
</td>
<td>
<para style="terp_tblheader_General_R">Delta Debit</para>
</td>
<td>
<para style="terp_tblheader_General_R">Delta Credit</para>
</td>
</tr>
<tr>
<td>
<para style="terp_tblheader_Details">[[ (lines_p(data['form']['date1'],data['form']['date2']),'acc') == False or removeParentNode('para') ]]</para>
<para style="terp_tblheader_Details">Total</para>
</td>
<td></td>
<td>
<para style="terp_tblheader_General_Right"><u>[[ formatLang( general_debit(data['form']['date1'],data['form']['date2'])) ]]</u></para>
</td>
<td>
<para style="terp_tblheader_General_Right"><u>[[ formatLang( general_credit(data['form']['date1'],data['form']['date2'])) ]]</u></para>
</td>
<td>
<para style="terp_tblheader_General_Right"><u>[[ formatLang( analytic_debit(data['form']['date1'],data['form']['date2'])) ]]</u></para>
</td>
<td>
<para style="terp_tblheader_General_Right"><u>[[ formatLang( analytic_credit(data['form']['date1'],data['form']['date2'])) ]]</u></para>
</td>
<td>
<para style="terp_tblheader_General_Right"><u>[[ formatLang( delta_debit(data['form']['date1'],data['form']['date2'])) ]]</u></para>
</td>
<td>
<para style="terp_tblheader_General_Right"><u>[[ formatLang( delta_credit(data['form']['date1'],data['form']['date2'])) ]]</u></para>
</td>
</tr>
<tr>
<td>
<para style="terp_default_8"><font face="Times-Roman">[[ repeatIn(lines_p(data['form']['date1'],data['form']['date2']),'acc') ]] </font>[[ acc['code'] ]]</para>
</td>
<td>
<para style="terp_default_8">[[ acc['name'] ]]</para>
</td>
<td>
<para style="terp_default_Right_8">[[ formatLang( acc['gen_debit']) ]]</para>
</td>
<td>
<para style="terp_default_Right_8">[[ formatLang( acc['gen_credit']) ]]</para>
</td>
<td>
<para style="terp_default_Right_8">[[ formatLang( acc['ana_debit']) ]]</para>
</td>
<td>
<para style="terp_default_Right_8">[[ formatLang( acc['ana_credit']) ]]</para>
</td>
<td>
<para style="terp_default_Right_8">[[ formatLang( acc['delta_debit']) ]]</para>
</td>
<td>
<para style="terp_default_Right_8">[[ formatLang( acc['delta_credit']) ]]</para>
</td>
</tr>
</blockTable>
</story>
</document>

View File

@ -24,8 +24,7 @@ import account_analytic_balance_report
import account_analytic_inverted_balance_report
import account_analytic_cost_ledger_report
import account_analytic_cost_ledger_for_journal_report
import account_analytic_check
import project_account_analytic_line
import account_analytic_chart
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -39,7 +39,7 @@
action="action_account_analytic_chart"
id="menu_action_analytic_account_tree2"
icon="STOCK_INDENT"
groups="base.group_extended"/>
groups="analytic.group_analytic_accounting"/>
</data>
</openerp>

View File

@ -1,57 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from osv import osv, fields
class account_analytic_check(osv.osv_memory):
_name = 'account.analytic.check'
_description = 'Account Analytic Check'
_columns = {
'date1': fields.date('Start of period', required=True),
'date2': fields.date('End of period', required=True),
}
_defaults = {
'date1':time.strftime('%Y-01-01'),
'date2':time.strftime('%Y-%m-%d')
}
def check_report(self, cr, uid, ids, context=None):
datas = {}
if context is None:
context = {}
data = self.read(cr, uid, ids)[0]
datas = {
'ids': context.get('active_ids',[]),
'model': 'account.account',
'form': data
}
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.analytic.account.analytic.check',
'datas': datas,
}
account_analytic_check()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,46 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="account_analytic_check_view" model="ir.ui.view">
<field name="name">Account Analytic Check</field>
<field name="model">account.analytic.check</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Select Period">
<group colspan="4" col="6">
<field name="date1"/>
<field name="date2"/>
</group>
<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>
<record id="action_account_analytic_check" model="ir.actions.act_window">
<field name="name">Analytic Check</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.analytic.check</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="account_analytic_check_view"/>
<field name="target">new</field>
</record>
<record model="ir.values" id="account_analytic_check_values">
<field name="model_id" ref="account.model_account_account" />
<field name="object" eval="1" />
<field name="name">Account Analytic Check</field>
<field name="key2">client_print_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_analytic_check'))" />
<field name="key">action</field>
<field name="model">account.account</field>
</record>
</data>
</openerp>

View File

@ -34,6 +34,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
self.total_account = []
self.localcontext.update({
'time': time,
'get_lines_with_out_partner': self._get_lines_with_out_partner,
'get_lines': self._get_lines,
'get_total': self._get_total,
'get_direction': self._get_direction,
@ -130,17 +131,28 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
# Each history will contain : history[1] = {'<partner_id>': <partner_debit-credit>}
history = []
for i in range(5):
args_list = (tuple(self.ACCOUNT_TYPE), tuple(partner_ids) ,self.date_from,)
dates_query = '(COALESCE(date_maturity,date)'
if form[str(i)]['start'] and form[str(i)]['stop']:
dates_query += ' BETWEEN %s AND %s)'
args_list += (form[str(i)]['start'], form[str(i)]['stop'])
elif form[str(i)]['start']:
dates_query += ' > %s)'
args_list += (form[str(i)]['start'],)
else:
dates_query += ' < %s)'
args_list += (form[str(i)]['stop'],)
self.cr.execute('SELECT partner_id, SUM(debit-credit)\
FROM account_move_line AS l, account_account\
WHERE (l.account_id = account_account.id)\
AND (account_account.type IN %s)\
AND (COALESCE(date_maturity,date) BETWEEN %s AND %s)\
AND (partner_id IN %s)\
AND ((reconcile_id IS NULL)\
OR (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(self.ACCOUNT_TYPE), form[str(i)]['start'], form[str(i)]['stop'], tuple(partner_ids) ,self.date_from,))
AND ' + dates_query + '\
GROUP BY partner_id' , args_list)
t = self.cr.fetchall()
d = {}
for i in t:
@ -194,6 +206,113 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
totals[str(i)] += float(r[str(i)] or 0.0)
return res
def _get_lines_with_out_partner(self, form):
res = []
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
## mise a 0 du total
for i in range(7):
self.total_account.append(0)
totals = {}
self.cr.execute('SELECT SUM(debit-credit) \
FROM account_move_line AS l, account_account\
WHERE (l.account_id = account_account.id)\
AND (l.partner_id IS NULL)\
AND (account_account.type IN %s)\
AND ((reconcile_id IS NULL) \
OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
AND ' + self.query + '\
AND account_account.active ' ,(tuple(self.ACCOUNT_TYPE), self.date_from, ))
t = self.cr.fetchall()
for i in t:
totals['No Partner Defined'] = i[0]
future_past = {}
if self.direction_selection == 'future':
self.cr.execute('SELECT SUM(debit-credit) \
FROM account_move_line AS l, account_account\
WHERE (l.account_id=account_account.id)\
AND (l.partner_id IS NULL)\
AND (account_account.type IN %s)\
AND (COALESCE(date_maturity, date) < %s)\
AND ((reconcile_id IS NULL)\
OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
AND '+ self.query + '\
AND account_account.active ', (tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from, ))
t = self.cr.fetchall()
for i in t:
future_past['No Partner Defined'] = i[0]
elif self.direction_selection == 'past': # Using elif so people could extend without this breaking
self.cr.execute('SELECT SUM(debit-credit) \
FROM account_move_line AS l, account_account\
WHERE (l.account_id=account_account.id)\
AND (l.partner_id IS NULL)\
AND (account_account.type IN %s)\
AND (COALESCE(date_maturity,date) > %s)\
AND ((reconcile_id IS NULL)\
OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
AND '+ self.query + '\
AND account_account.active ' , (tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from,))
t = self.cr.fetchall()
for i in t:
future_past['No Partner Defined'] = i[0]
history = []
for i in range(5):
self.cr.execute('SELECT SUM(debit-credit)\
FROM account_move_line AS l, account_account\
WHERE (l.account_id = account_account.id)\
AND (l.partner_id IS NULL)\
AND (account_account.type IN %s)\
AND (COALESCE(date_maturity,date) BETWEEN %s AND %s)\
AND ((reconcile_id IS NULL)\
OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
AND '+ self.query + '\
AND account_account.active ' , (tuple(self.ACCOUNT_TYPE), form[str(i)]['start'], form[str(i)]['stop'], self.date_from,))
t = self.cr.fetchall()
d = {}
for i in t:
d['No Partner Defined'] = i[0]
history.append(d)
values = {}
if self.direction_selection == 'future':
before = False
if future_past.has_key('No Partner Defined'):
before = [ future_past['No Partner Defined'] ]
self.total_account[6] = self.total_account[6] + (before and before[0] or 0.0)
values['direction'] = before and before[0] or 0.0
elif self.direction_selection == 'past':
after = False
if future_past.has_key('No Partner Defined'):
after = [ future_past['No Partner Defined'] ]
self.total_account[6] = self.total_account[6] + (after and after[0] or 0.0)
values['direction'] = after and after[0] or ""
for i in range(5):
during = False
if history[i].has_key('No Partner Defined'):
during = [ history[i]['No Partner Defined'] ]
self.total_account[(i)] = self.total_account[(i)] + (during and during[0] or 0)
values[str(i)] = during and during[0] or ""
total = False
if totals.has_key( 'No Partner Defined' ):
total = [ totals['No Partner Defined'] ]
values['total'] = total and total[0] or 0.0
## Add for total
self.total_account[(i+1)] = self.total_account[(i+1)] + (total and total[0] or 0.0)
values['name'] = 'No Partner Defined'
if values['total']:
res.append(values)
total = 0.0
totals = {}
for r in res:
total += float(r['total'] or 0.0)
for i in range(5)+['direction']:
totals.setdefault(str(i), 0.0)
totals[str(i)] += float(r[str(i)] or 0.0)
return res
def _get_total(self,pos):
period = self.total_account[int(pos)]
return period

View File

@ -40,33 +40,10 @@
<blockTableStyle id="Table8">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,1" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,1" stop="0,1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,1" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,1" stop="1,1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,1" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,1" stop="2,1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="3,1" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,1" stop="3,1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="4,1" stop="4,-1"/>
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="4,1" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,1" stop="4,1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="-1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="-1,-1"/>
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="0,0" stop="-1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="Tableau3">
@ -104,10 +81,10 @@
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Helvetica" fontSize="8.0" leading="15" spaceBefore="6.0" spaceAfter="6.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"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
</stylesheet>
<story>
<para style="P9">
@ -121,7 +98,7 @@
<td><para style="terp_header"><font color="white"> </font></para></td>
</tr>
</blockTable>
<blockTable colWidths="200.0,200.0,200.0,219.0,200.0" style="Table8">
<blockTable colWidths="200.0,200.0,100.0,100.0,119.0,100.0,200.0" style="Table8">
<tr>
<td>
<para style="terp_tblheader_General_Centre">Chart of Account</para>
@ -132,14 +109,20 @@
<td>
<para style="terp_tblheader_General_Centre">Start Date</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Period Length(days)</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Partner's</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Analysis Direction</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Printing Date</para>
</td>
</tr>
<tr>
<tr>
<td>
<para style="terp_default_Centre_8">[[ get_account(data) or '' ]]</para>
</td>
@ -149,15 +132,21 @@
<td>
<para style="terp_default_Centre_8">[[ formatLang(data['form']['date_from'],date=True) ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ data['form']['period_length'] ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ get_partners(data) ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ data['form']['direction_selection'] ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'), date_time = True)]]</para>
</td>
</tr>
</blockTable>
<para style="P9">
<para style="P9">
<font color="white"> </font>
</para> <para style="P9">
<font color="white"> </font>
@ -168,7 +157,7 @@
<para style="P2">Partners</para>
</td>
<td>
<para style="P8">[[ data['form']['direction_selection'] == 'future' and 'Due' or 'Not due' ]] [[ formatLang(data['form']['date1'],date=True) ]]</para>
<para style="P8">[[ data['form']['direction_selection'] == 'future' and 'Due' or 'Not due' ]]</para>
</td>
<td>
<para style="P8">[[ data['form']['4']['name'] ]]</para>
@ -194,6 +183,7 @@
<td>
<para style="P3"> <font color="white">[[ (get_lines(data['form']), 'partner') == False or removeParentNode('para') ]]</font></para>
<para style="P3"> <font color="white">[[ (get_lines_with_out_partner(data['form']), 'not_partner') == False or removeParentNode('para') ]]</font></para>
<para style="P9"><font color="white"> </font></para>
<para style="Total">Account Total</para>
</td>
@ -254,6 +244,33 @@
<para style="content">[[ formatLang(partner['total'] or 0.00 ) ]]</para>
</td>
</tr>
<tr>
<td>
<para style="P3">[[ repeatIn(get_lines_with_out_partner(data['form']), 'not_partner') ]]</para>
<para style="P2_content">[[ not_partner['name'] ]]</para>
</td>
<td>
<para style="content">[[ formatLang(not_partner['direction'] or 0.00) ]] </para>
</td>
<td>
<para style="content">[[ formatLang(not_partner['4'] or 0.00)]]</para>
</td>
<td>
<para style="content">[[ formatLang(not_partner['3'] or 0.00)]]</para>
</td>
<td>
<para style="content">[[ formatLang(not_partner['2'] or 0.00) ]]</para>
</td>
<td>
<para style="content">[[ formatLang(not_partner['1'] or 0.00) ]]</para>
</td>
<td>
<para style="content">[[ formatLang(not_partner['0'] or 0.00) ]]</para>
</td>
<td>
<para style="content">[[ formatLang(not_partner['total'] or 0.00 ) ]]</para>
</td>
</tr>
</blockTable>
<para style="P9">

View File

@ -107,7 +107,7 @@
<field name="help">A tool search lets you know statistics on your analytics records that match your needs.</field>
</record>
<menuitem action="action_analytic_entries_report" id="menu_action_analytic_entries_report" parent="account.menu_finance_statistic_report_statement" sequence="4" groups="base.group_extended"/>
<menuitem action="action_analytic_entries_report" id="menu_action_analytic_entries_report" parent="account.menu_finance_statistic_report_statement" sequence="4"/>
</data>
</openerp>

View File

@ -47,10 +47,8 @@ class account_entries_report(osv.osv):
'journal_id': fields.many2one('account.journal', 'Journal', readonly=True),
'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal Year', readonly=True),
'product_id': fields.many2one('product.product', 'Product', readonly=True),
'state': fields.selection([('draft','Draft'), ('posted','Posted')], 'State', readonly=True,
help='When new account move is created the state will be \'Draft\'. When all the payments are done it will be in \'Posted\' state.'),
'state_2': fields.selection([('draft','Draft'), ('valid','Valid')], 'State of Move Line', readonly=True,
help='When new move line is created the state will be \'Draft\'.\n* When all the payments are done it will be in \'Valid\' state.'),
'move_state': fields.selection([('draft','Unposted'), ('posted','Posted')], 'State', readonly=True),
'move_line_state': fields.selection([('draft','Unbalanced'), ('valid','Valid')], 'State of Move Line', readonly=True),
'reconcile_id': fields.many2one('account.move.reconcile', readonly=True),
'partner_id': fields.many2one('res.partner','Partner', readonly=True),
'analytic_account_id' : fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
@ -59,9 +57,10 @@ class account_entries_report(osv.osv):
'type': fields.selection([
('receivable', 'Receivable'),
('payable', 'Payable'),
('cash', 'Cash'),
('view', 'View'),
('consolidation', 'Consolidation'),
('other', 'Others'),
('other', 'Regular'),
('closed', 'Closed'),
], 'Internal Type', readonly=True, help="This type is used to differentiate types with "\
"special effects in OpenERP: view can not have entries, consolidation are accounts that "\
@ -116,8 +115,8 @@ class account_entries_report(osv.osv):
l.date_maturity as date_maturity,
l.date_created as date_created,
am.ref as ref,
am.state as state,
l.state as state_2,
am.state as move_state,
l.state as move_line_state,
l.reconcile_id as reconcile_id,
to_char(am.date, 'YYYY') as year,
to_char(am.date, 'MM') as month,

View File

@ -6,7 +6,7 @@
<field name="model">account.entries.report</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree colors="blue:state in ('draft');black:state in ('posted')" string="Entries Analysis">
<tree colors="blue:move_state in ('draft');black:move_state in ('posted')" string="Entries Analysis">
<field name="date" invisible="1"/>
<field name="date_created" invisible="1"/>
<field name="date_maturity" invisible="1"/>
@ -16,7 +16,7 @@
<field name="debit"/>
<field name="credit"/>
<field name="balance"/>
<field name="state" invisible="1"/>
<field name="move_state" invisible="1"/>
<field name="day" invisible="1"/>
<field name="month" invisible="1"/>
<field name="year" invisible="1"/>
@ -52,20 +52,20 @@
<field name="arch" type="xml">
<search string="Entries Analysis">
<group colspan="10" col="12">
<filter icon="terp-go-year" string="This Year"
name="year"
domain="[('period_id','in','current_year')]"
help="Entries created in current year"/>
<filter icon="terp-go-month" string="This Month"
name="period"
domain="[('period_id','in','current_period')]"
help="Entries created in current period"/>
<filter icon="terp-go-year" string="This F.Year"
name="year"
domain="[('period_id','in','current_year')]"
help="Entries with period in current year"/>
<filter icon="terp-go-month" string="This Period"
name="period"
domain="[('period_id','in','current_period')]"
help="Entries with period in current period"/>
<separator orientation="vertical"/>
<filter string="Draft" icon="terp-document-new" domain="[('state','=','draft')]" help = "Draft entries"/>
<filter string="Posted" icon="terp-camera_test" domain="[('state','=','posted')]" help = "Posted entries"/>
<filter string="Unposted" icon="terp-document-new" domain="[('move_state','=','draft')]" help = "entries"/>
<filter string="Posted" icon="terp-camera_test" domain="[('move_state','=','posted')]" help = "Posted entries"/>
<separator orientation="vertical"/>
<filter string="Reconciled" icon="terp-document-new" domain="[('reconcile_id','!=',False)]" help = "Reconciled entries"/>
<filter string="Unreconciled" icon="terp-stock_symbol-selection" domain="[('reconcile_id','=',False)]" help = "Unreconciled entries"/>
<filter string="Unreconciled" icon="terp-dolar_ok!" domain="[('reconcile_id','=',False)]" help = "Unreconciled entries"/>
<filter string="Reconciled" icon="terp-dolar" domain="[('reconcile_id','!=',False)]" help = "Reconciled entries"/>
<separator orientation="vertical"/>
<field name="account_id"/>
<field name="journal_id"/>
@ -73,16 +73,15 @@
</group>
<newline/>
<group expand="1" string="Group By...">
<filter string="Account" name="group_account" icon="terp-folder-orange" context="{'group_by':'account_id'}"/>
<filter string="Partner" icon="terp-partner" context="{'group_by':'partner_id'}"/>
<separator orientation="vertical"/>
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
<separator orientation="vertical"/>
<filter string="Journal" name="group_journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
<filter string="Account" name="group_account" icon="terp-folder-green" context="{'group_by':'account_id'}"/>
<separator orientation="vertical"/>
<filter string="Type" icon="terp-stock_symbol-selection" context="{'group_by':'user_type'}"/>
<filter string="Int.Type" icon="terp-stock_symbol-selection" context="{'group_by':'type'}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Partner" icon="terp-personal" context="{'group_by':'partner_id'}"/>
<separator orientation="vertical"/>
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
<separator orientation="vertical"/>
<filter string="Period" icon="terp-go-month" name="group_period" context="{'group_by':'period_id'}"/>
<filter string="Fiscal Year" icon="terp-go-month" context="{'group_by':'fiscalyear_id'}"/>
@ -99,14 +98,13 @@
<field name="period_id"/>
<field name="fiscalyear_id"/>
<separator orientation="vertical"/>
<separator orientation="vertical"/>
<field name="product_id"/>
<field name="partner_id"/>
<separator orientation="vertical"/>
<field name="company_id" groups="base.group_multi_company"/>
<newline/>
<field name="date_created"/>
<field name="date"/>
<field name="date"/>
<field name="date_maturity"/>
</group>
</search>

View File

@ -49,6 +49,7 @@ class account_invoice_report(osv.osv):
'price_total': fields.float('Total Without Tax', readonly=True),
'price_total_tax': fields.float('Total With Tax', readonly=True),
'price_average': fields.float('Average Price', readonly=True, group_operator="avg"),
'currency_rate': fields.float('Currency Rate', readonly=True),
'nbr':fields.integer('# of Lines', readonly=True),
'type': fields.selection([
('out_invoice','Customer Invoice'),
@ -110,12 +111,14 @@ class account_invoice_report(osv.osv):
ail.quantity*ail.price_unit * -1
else
ail.quantity*ail.price_unit
end) as price_total,
end) / cr.rate as price_total,
sum(case when ai.type in ('out_refund','in_invoice') then
ai.amount_total * -1
else
ai.amount_total
end) as price_total_tax,
end)/(select count(l.id) from account_invoice_line as l
left join account_invoice as a ON (a.id=l.invoice_id)
where a.id=ai.id) /cr.rate as price_total_tax,
(case when ai.type in ('out_refund','in_invoice') then
sum(ail.quantity*ail.price_unit*-1)
else
@ -124,7 +127,8 @@ class account_invoice_report(osv.osv):
sum(ail.quantity*u.factor*-1)
else
sum(ail.quantity*u.factor)
end) as price_average,
end) / cr.rate as price_average,
cr.rate as currency_rate,
sum((select extract(epoch from avg(date_trunc('day',aml.date_created)-date_trunc('day',l.create_date)))/(24*60*60)::decimal(16,2)
from account_move_line as aml
left join account_invoice as a ON (a.move_id=aml.move_id)
@ -134,16 +138,20 @@ class account_invoice_report(osv.osv):
ai.residual * -1
else
ai.residual
end)/(select count(l.*) from account_invoice_line as l
end)/(select count(l.id) from account_invoice_line as l
left join account_invoice as a ON (a.id=l.invoice_id)
where a.id=ai.id) as residual
where a.id=ai.id) / cr.rate as residual
from account_invoice_line as ail
left join account_invoice as ai ON (ai.id=ail.invoice_id)
left join product_template pt on (pt.id=ail.product_id)
left join product_uom u on (u.id=ail.uos_id)
left join product_uom u on (u.id=ail.uos_id),
res_currency_rate cr
where cr.id in (select id from res_currency_rate cr2 where (cr2.currency_id = ai.currency_id)
and ((ai.date_invoice is not null and cr.name <= ai.date_invoice) or (ai.date_invoice is null and cr.name <= NOW())) limit 1)
group by ail.product_id,
ai.date_invoice,
ai.id,
cr.rate,
to_char(ai.date_invoice, 'YYYY'),
to_char(ai.date_invoice, 'MM'),
to_char(ai.date_invoice, 'YYYY-MM-DD'),
@ -171,4 +179,4 @@ class account_invoice_report(osv.osv):
account_invoice_report()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -59,52 +59,52 @@
<group col="10" colspan="12">
<filter icon="terp-go-year" string=" 365 Days "
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="Invoices of last 365 days"/>
help="Validated invoices of last 365 days"/>
<filter icon="terp-go-month" string=" 30 Days "
name="month"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
help="Invoices of last 30 days"/>
help="Validated invoices of last 30 days"/>
<filter icon="terp-go-week"
string=" 7 Days "
separator="1"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Invoices during last 7 days"/>
help="Validated invoices during last 7 days"/>
<separator orientation="vertical"/>
<filter string="Draft"
icon="terp-check"
icon="terp-document-new"
domain="[('state','=','draft')]"
help = "Draft Invoices"/>
<filter string="Pro-forma"
icon="terp-check"
icon="terp-gtk-media-pause"
domain="['|', ('state','=','proforma'),('state','=','proforma2')]"
help = "Pro-forma Invoices"/>
<separator orientation="vertical"/>
<filter icon="terp-check" string="Customer"
<separator orientation="vertical"/>
<filter icon="terp-sale" string="Customer"
domain="['|', ('type','=','out_invoice'),('type','=','out_refund')]"
help="Customer Invoices And Refunds"/>
<filter icon="terp-check"
<filter icon="terp-purchase"
string="Supplier"
separator="1"
domain="['|', ('type','=','in_invoice'),('type','=','in_refund')]"
help="Supplier Invoices And Refunds"/>
<separator orientation="vertical"/>
<filter icon="terp-check" string="Invoice"
domain="['|', ('type','=','out_invoice'),('type','=','in_invoice')]"
help="Customer And Supplier Invoices"/>
<filter icon="terp-check"
string="Refund"
separator="1"
domain="['|', ('type','=','out_refund'),('type','=','in_refund')]"
help="Customer And Supplier Refunds"/>
<separator orientation="vertical"/>
<field name="partner_id"/>
<field name="user_id" />
<field name="categ_id" />
<separator orientation="vertical"/>
<filter icon="terp-dolar" string="Invoice"
domain="['|', ('type','=','out_invoice'),('type','=','in_invoice')]"
help="Customer And Supplier Invoices"/>
<filter icon="terp-dolar_ok!"
string="Refund"
separator="1"
domain="['|', ('type','=','out_refund'),('type','=','in_refund')]"
help="Customer And Supplier Refunds"/>
<separator orientation="vertical"/>
<field name="partner_id"/>
<field name="user_id" />
<field name="categ_id" />
</group>
<newline/>
<group expand="1" string="Group By...">
<filter string="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'}"/>
<filter string="Partner" icon="terp-personal" context="{'group_by':'partner_id','residual_visible':True}"/>
<separator orientation="vertical"/>
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id','set_visible':True,'residual_invisible':True}"/>
<filter string="Category of Product" icon="terp-stock_symbol-selection" context="{'group_by':'categ_id','residual_invisible':True}"/>
@ -113,9 +113,9 @@
<filter string="Type" icon="terp-stock_symbol-selection" context="{'group_by':'type'}"/>
<separator orientation="vertical"/>
<filter string="Journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
<filter string="Account" icon="terp-folder-orange" context="{'group_by':'account_id'}"/>
<filter string="Account" icon="terp-folder-green" context="{'group_by':'account_id'}"/>
<separator orientation="vertical"/>
<filter string="Force Period" icon="terp-go-month" context="{'group_by':'period_id'}"/>
<filter string="Period" icon="terp-go-month" context="{'group_by':'period_id'}"/>
<separator orientation="vertical"/>
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator orientation="vertical"/>

View File

@ -2,7 +2,7 @@
<document filename="test.pdf">
<template pageSize="(595.0,842.0)" title="Voucher" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
<frame id="first" x1="28.0" y1="42.0" width="525" height="772"/>
</pageTemplate>
</template>
<stylesheet>
@ -10,37 +10,80 @@
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table1">
<blockTableStyle id="Table4">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEAFTER" colorName="#b3b3b3" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="3,-1" stop="3,-1"/>
</blockTableStyle>
<blockTableStyle id="Table5">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="4,0" stop="4,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="4,-1" stop="4,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="5,0" stop="5,-1"/>
<lineStyle kind="LINEAFTER" colorName="#b3b3b3" start="5,0" stop="5,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="5,0" stop="5,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="5,-1" stop="5,-1"/>
</blockTableStyle>
<blockTableStyle id="Heading1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<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="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="2,-1" stop="2,-1"/>
</blockTableStyle>
<blockTableStyle id="Table2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#ffffff" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#ffffff" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#ffffff" start="2,-1" stop="2,-1"/>
</blockTableStyle>
<blockTableStyle id="last_info">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,6" stop="0,6"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,6" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,6" stop="1,6"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,6" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,6" stop="2,6"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
</blockTableStyle>
<blockTableStyle id="Table1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="2,-1" stop="2,-1"/>
</blockTableStyle>
<blockTableStyle id="Table3">
<blockAlignment value="LEFT"/>
@ -50,35 +93,18 @@
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" fontName="Helvetica"/>
<paraStyle name="P2" fontName="Helvetica-Bold" fontSize="13.0" leading="16" alignment="CENTER"/>
<paraStyle name="P2" fontName="Helvetica" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P3" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P4" fontName="Helvetica" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P5" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P6" fontName="Helvetica-Bold" fontSize="22.0" leading="27" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P7" fontName="Helvetica" fontSize="11.0" leading="14" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P8" fontName="Helvetica" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P9" fontName="Helvetica-Bold" fontSize="11.0" leading="14" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P10" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P11" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P12" fontName="Helvetica-Bold" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P13" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P14" fontName="Helvetica-Bold" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P15" fontName="Helvetica" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P16" fontName="Helvetica-Bold" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P17" fontName="Helvetica-Bold" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P18" fontName="Helvetica" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P19" fontName="Helvetica" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P20" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P21" fontName="Helvetica-Bold" fontSize="13.0" leading="16" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P22" rightIndent="0.0" leftIndent="35.0" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P23" rightIndent="0.0" leftIndent="35.0" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P24" rightIndent="0.0" leftIndent="35.0" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P25" rightIndent="0.0" leftIndent="35.0" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P26" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P27" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P28" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P5" fontName="Helvetica-Bold" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P6" fontName="Helvetica-Bold" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P7" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P8" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P9" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P10" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P11" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Standard" fontName="Helvetica"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
@ -130,72 +156,60 @@
<paraStyle name="List Indent" rightIndent="0.0" leftIndent="142.0" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Marginalia" rightIndent="0.0" leftIndent="113.0" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_9_30" rightIndent="0.0" leftIndent="9.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_9_italic" fontName="Helvetica-Oblique" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_9_30_italic" rightIndent="0.0" leftIndent="9.0" fontName="Helvetica-Oblique" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<images/>
</stylesheet>
<story>
<para style="P5">[[ repeatIn(objects,'voucher') ]]</para>
<para style="P6">[[ company.name ]]</para>
<para style="P8">[[ company.partner_id.address and company.partner_id.address[0].street ]]</para>
<para style="P8">[[ company.partner_id.address and company.partner_id.address[0].zip ]] [[ company.partner_id.address and company.partner_id.address[0].city ]] - [[ company.partner_id.address and company.partner_id.address[0].country_id and company.partner_id.address[0].country_id.name ]]</para>
<para style="P8">[[ company.partner_id.address and company.partner_id.address[0].phone ]]</para>
<para style="P8">[[ company.partner_id.address and company.partner_id.address[0].email ]]</para>
<para style="P7">
<font color="white"> </font>
</para>
<para style="P21">[[ voucher.journal_id.name ]]</para>
<para style="P20">
<font color="white"> </font>
</para>
<blockTable colWidths="49.0,143.0,116.0,69.0,106.0" style="Table1">
<para style="P11">[[ repeatIn(objects,'voucher') ]]</para>
<blockTable colWidths="63.0,200.0,52.0,210.0" style="Table4">
<tr>
<td>
<para style="P12">Name:</para>
<para style="terp_tblheader_Details">Journal:</para>
</td>
<td>
<para style="P13">[[ voucher.name ]]</para>
<para style="terp_default_9">[[ voucher.journal_id.name ]]</para>
</td>
<td>
<para style="P4">
<font color="white"> </font>
</para>
<para style="terp_default_Bold_9">Number:</para>
</td>
<td>
<para style="P12">Dated :</para>
</td>
<td>
<para style="P13">[[ formatLang(voucher.date, date=True) or '' ]]</para>
</td>
</tr>
<tr>
<td>
<para style="P12">State :</para>
</td>
<td>
<para style="P3">PRO-FORMA [[ ((voucher.state == 'proforma') or removeParentNode('para')) and '' ]]</para>
<para style="P3">Draft[[ ((voucher.state == 'draft') or removeParentNode('para')) and '' ]]</para>
<para style="P3">Canceled [[ ((voucher.state == 'cancel') or removeParentNode('para')) and '' ]]</para>
<para style="P3">Posted [[ ((voucher.state == 'posted') or removeParentNode('para')) and '' ]]</para>
</td>
<td>
<para style="P4">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P12">Ref. :</para>
</td>
<td>
<para style="P13">[[ voucher.ref]]</para>
<para style="P3">[[ voucher.name ]]</para>
</td>
</tr>
</blockTable>
<para style="P15">
<blockTable colWidths="63.0,72.0,44.0,84.0,52.0,210.0" style="Table5">
<tr>
<td>
<para style="terp_default_Bold_9">State:</para>
</td>
<td>
<para style="P7">PRO-FORMA [[ ((voucher.state == 'proforma') or removeParentNode('para')) and '' ]]</para>
<para style="P7">Draft[[ ((voucher.state == 'draft') or removeParentNode('para')) and '' ]]</para>
<para style="P7">Canceled [[ ((voucher.state == 'cancel') or removeParentNode('para')) and '' ]]</para>
<para style="P7">Posted [[ ((voucher.state == 'posted') or removeParentNode('para')) and '' ]]</para>
</td>
<td>
<para style="terp_default_Bold_9">Ref. :</para>
</td>
<td>
<para style="P7">[[ voucher.ref]]</para>
</td>
<td>
<para style="terp_default_Bold_9">Date:</para>
</td>
<td>
<para style="P3">[[ formatLang(voucher.date , date=True) or '' ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_9">
<font color="white"> </font>
</para>
<para style="P15">
<para style="terp_default_9">
<font color="white"> </font>
</para>
<blockTable colWidths="275.0,106.0,102.0" style="Heading1">
<blockTable colWidths="313.0,107.0,105.0" style="Heading1">
<tr>
<td>
<para style="terp_tblheader_Details">Particulars</para>
@ -213,7 +227,7 @@
</para>
<section>
<para style="terp_default_8">[[ repeatIn(voucher.line_id,'line_id') ]]</para>
<blockTable colWidths="274.0,106.0,102.0" style="Table2">
<blockTable colWidths="313.0,106.0,105.0" style="Table2">
<tr>
<td>
<para style="terp_default_Bold_9">[[ (line_id.partner_id and line_id.partner_id.name) or 'Account']]</para>
@ -242,7 +256,7 @@
</tr>
<tr>
<td>
<para style="terp_default_9_30">[[ line_id.name ]]-[[voucher.ref]]</para>
<para style="terp_default_9_30_italic">[[ line_id.name ]]-[[voucher.ref]]</para>
</td>
<td>
<para style="terp_default_9">
@ -260,13 +274,88 @@
<font color="white"> </font>
</para>
</section>
<para style="terp_default_9">
<para style="terp_default_1">
<font color="white"> </font>
</para>
<blockTable colWidths="275.0,106.0,102.0" style="last_info">
<blockTable colWidths="313.0,106.0,105.0" style="last_info">
<tr>
<td>
<para style="P16">Through : </para>
<para style="P5">Through : </para>
</td>
<td>
<para style="P2">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P2">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="terp_default_9_italic">[[ voucher.narration or '']]</para>
</td>
<td>
<para style="P2">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P2">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P5">On Account of : </para>
</td>
<td>
<para style="P2">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P2">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P9">[[ voucher.line_id and voucher.line_id.name and voucher.line_id.name[1] or removeParentNode('para') ]]</para>
</td>
<td>
<para style="P2">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P2">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P5">Amount (in words) : </para>
</td>
<td>
<para style="P5">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P5">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P9">[[ convert(voucher.amount) ]]</para>
</td>
<td>
<para style="P4">
@ -279,84 +368,14 @@
</para>
</td>
</tr>
</blockTable>
<para style="terp_default_1">
<font color="white"> </font>
</para>
<blockTable colWidths="313.0,106.0,105.0" style="Table1">
<tr>
<td>
<para style="P22">[[ voucher.narration or '']]</para>
</td>
<td>
<para style="P4">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P4">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P16">On Account of : </para>
</td>
<td>
<para style="P4">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P4">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P25">[[ voucher.line_id and voucher.line_id.name and voucher.line_id.name[1] or removeParentNode('para') ]]</para>
</td>
<td>
<para style="P4">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P4">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P16">Amount (in words) : </para>
</td>
<td>
<para style="P16">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P16">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P26">[[ convert(voucher.amount) ]]</para>
</td>
<td>
<para style="P15">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P15">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P17">
<para style="P6">
<font color="white"> </font>
</para>
</td>
@ -368,57 +387,57 @@
</td>
</tr>
</blockTable>
<para style="P18">
<para style="terp_default_1">
<font color="white"> </font>
</para>
<blockTable colWidths="142.0,99.0,105.0,136.0" style="Table3">
<blockTable colWidths="154.0,160.0,63.0,148.0" style="Table3">
<tr>
<td>
<para style="P9">
<para style="terp_default_9">
<font color="white"> </font>
</para>
<para style="P9">
<para style="terp_default_9">
<font color="white"> </font>
</para>
<para style="P9">
<para style="terp_default_9">
<font color="white"> </font>
</para>
<para style="P9">
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P9">
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P10">
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P11">
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P20">Receiver's Signature</para>
<para style="P8">Receiver's Signature</para>
</td>
<td>
<para style="P20">
<para style="P8">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P20">
<para style="P8">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P20">Authorised Signatory</para>
<para style="terp_default_Right_9">Authorised Signatory</para>
</td>
</tr>
</blockTable>

View File

@ -13,7 +13,7 @@
<field name="name">Accounting / Manager</field>
</record>
<record model="res.groups" context="{'noadmin':True}" id="group_accounting_accountant">
<record model="res.groups" id="group_accounting_accountant">
<field name="name">Accounting / Accountant and Manager</field>
</record>

View File

@ -34,7 +34,6 @@
"access_account_bank_statement_line","account.bank.statement.line","model_account_bank_statement_line","account.group_account_user",1,0,0,0
"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_report_hr_timesheet_invoice_journal","report.hr.timesheet.invoice.journal","model_report_hr_timesheet_invoice_journal","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
"access_account_analytic_journal","account.analytic.journal","model_account_analytic_journal","account.group_account_user",1,0,0,0
"access_account_invoice_uinvoice","account.invoice","model_account_invoice","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
34 access_account_bank_statement_line account.bank.statement.line model_account_bank_statement_line account.group_account_user 1 0 0 0
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
access_report_hr_timesheet_invoice_journal report.hr.timesheet.invoice.journal model_report_hr_timesheet_invoice_journal 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
38 access_account_analytic_journal account.analytic.journal model_account_analytic_journal account.group_account_user 1 0 0 0
39 access_account_invoice_uinvoice account.invoice model_account_invoice account.group_account_invoice 1 1 1 1

View File

@ -33,7 +33,6 @@
journal_id: account.sales_journal
period_id: account_period_jan11
report_name: End of Fiscal Year Entry
sure: 1
-
I clicked on create Button

View File

@ -26,7 +26,6 @@
-
!record {model: account.fiscalyear.close.state, id: account_fiscalyear_close_state_0}:
fy_id: account_fiscalyear_fiscalyear0
sure: 1
-
I clicked on Close States Button to close fiscalyear

View File

@ -9,9 +9,8 @@
debit: 0.0
name: test1
sequence: 0.0
date: today
quantity: 0.0
name: My Model on %(year)s
name: My Test Model
-
I create an account use model record
@ -27,18 +26,6 @@
self.create_entries(cr, uid, [ref("account_use_model_0")], {"lang": 'en_US', "active_model":
"account.model", "active_ids": [ref("account_model_mymodelonyears0")], "tz":
False, "active_id": ref("account_model_mymodelonyears0"), })
-
I create an account use model record
-
!record {model: account.use.model, id: account_use_model_1}:
{}
-
I checked that Moves are created successfully
-
!python {model: account.use.model}: |
self.open_moves(cr, uid, [ref("account_use_model_1")], {"lang": 'en_US', "move_ids":
[], "tz": False, "active_model": "account.model", "active_ids": [ref("account_model_mymodelonyears0")],
"active_id": ref("account_model_mymodelonyears0"), })
move_obj = self.pool.get('account.move')
ids = move_obj.search(cr, uid, [('ref', '=', 'My Test Model')])
assert len(ids), "Error:moves not created for model 'My Test Model'"

View File

@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
import netsvc
@ -54,7 +55,7 @@ class account_automatic_reconcile(osv.osv_memory):
'date2': time.strftime('%Y-%m-%d'),
'reconciled': _get_reconciled,
'unreconciled': _get_unreconciled,
'power':2
'power': 2
}
#TODO: cleanup and comment this code... For now, it is awfulllll
@ -143,18 +144,21 @@ class account_automatic_reconcile(osv.osv_memory):
form = self.read(cr, uid, ids, [])[0]
max_amount = form.get('max_amount', 0.0)
power = form['power']
allow_write_off = form['allow_write_off']
reconciled = unreconciled = 0
if not form['account_ids']:
raise osv.except_osv(_('UserError'), _('You must select accounts to reconcile'))
for account_id in form['account_ids']:
if not context.get('allow_write_off', False):
if not allow_write_off:
query = "SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL \
AND state <> 'draft' GROUP BY partner_id \
HAVING ABS(SUM(debit-credit)) <> %s AND count(*)>0"%(account_id, 0.0)
HAVING ABS(SUM(debit-credit)) = %s AND count(*)>0"%(account_id, 0.0)
# HAVING ABS(SUM(debit-credit)) <> %s AND count(*)>0"%(account_id, 0.0)
# HAVING count(*)>0"%(account_id,)
else:
query = "SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL \
AND state <> 'draft' GROUP BY partner_id \
HAVING ABS(SUM(debit-credit)) <= %s AND count(*)>0"%(account_id, max_amount or 0.0)
HAVING ABS(SUM(debit-credit)) < %s AND count(*)>0"%(account_id, max_amount or 0.0)
# reconcile automatically all transactions from partners whose balance is 0
cr.execute(query)
partner_ids = [id for (id,) in cr.fetchall()]
@ -170,10 +174,12 @@ class account_automatic_reconcile(osv.osv_memory):
line_ids = [id for (id,) in cr.fetchall()]
if len(line_ids):
reconciled += len(line_ids)
if not context.get('allow_write_off', False):
move_line_obj.reconcile_partial(cr, uid, line_ids, 'manual', context={})
else:
if allow_write_off:
move_line_obj.reconcile(cr, uid, line_ids, 'auto', form['writeoff_acc_id'], form['period_id'], form['journal_id'], context)
# move_line_obj.reconcile_partial(cr, uid, line_ids, 'manual', context={})
else:
move_line_obj.reconcile_partial(cr, uid, line_ids, 'manual', context={})
# move_line_obj.reconcile(cr, uid, line_ids, 'auto', form['writeoff_acc_id'], form['period_id'], form['journal_id'], context)
# get the list of partners who have more than one unreconciled transaction
cr.execute(
@ -240,9 +246,8 @@ class account_automatic_reconcile(osv.osv_memory):
'type': 'ir.actions.act_window',
'target': 'new',
'context': context,
'nodestroy':True,
}
account_automatic_reconcile()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -34,11 +34,10 @@ class account_fiscalyear_close(osv.osv_memory):
'fy2_id': fields.many2one('account.fiscalyear', \
'New Fiscal Year', required=True),
'journal_id': fields.many2one('account.journal', \
'Opening Entries Journal', required=True),
'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),
'sure': fields.boolean('Check this box'),
}
_defaults = {
'report_name':'End of Fiscal Year Entry',
@ -58,16 +57,14 @@ 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)
if context is None:
context = {}
if not data[0]['sure']:
raise osv.except_osv(_('UserError'), _('Closing of fiscal year cancelled, please check the box !'))
fy_id = data[0]['fy_id']
cr.execute("SELECT id FROM account_period WHERE date_stop < (SELECT date_start FROM account_fiscalyear WHERE id = %s)" , (str(data[0]['fy2_id']),))
fy_period_set = ','.join(map(lambda id: str(id[0]), cr.fetchall()))
cr.execute("SELECT id FROM account_period WHERE date_start > (SELECT date_stop FROM account_fiscalyear WHERE id = %s)" , (str(fy_id),))
@ -88,20 +85,21 @@ class account_fiscalyear_close(osv.osv_memory):
_('The journal must have centralised counterpart'))
move_ids = obj_acc_move_line.search(cr, uid, [
('journal_id','=',new_journal.id),('period_id.fiscalyear_id','=',new_fyear.id)])
('journal_id', '=', new_journal.id), ('period_id.fiscalyear_id', '=', new_fyear.id)])
if move_ids:
raise osv.except_osv(_('UserError'),
_('The opening journal must not have any entry in the new fiscal year !'))
obj_acc_move_line._remove_move_reconcile(cr, uid, move_ids, context=context)
obj_acc_move_line.unlink(cr, uid, move_ids, context=context)
cr.execute("SELECT id FROM account_fiscalyear WHERE date_stop < %s", (str(new_fyear.date_start),))
result = cr.dictfetchall()
fy_ids = ','.join([str(x['id']) for x in result])
query_line = obj_acc_move_line._query_get(cr, uid,
obj='account_move_line', context={'fiscalyear': fy_ids})
cr.execute('select id from account_account WHERE active')
cr.execute('select id from account_account WHERE active AND company_id = %s', (old_fyear.company_id.id,))
ids = map(lambda x: x[0], cr.fetchall())
for account in obj_acc_account.browse(cr, uid, ids,
context={'fiscalyear': fy_id}):
accnt_type_data = account.user_type
if not accnt_type_data:
continue
@ -224,4 +222,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:

View File

@ -32,7 +32,6 @@ class account_fiscalyear_close_state(osv.osv_memory):
_columns = {
'fy_id': fields.many2one('account.fiscalyear', \
'Fiscal Year to close', required=True),
'sure': fields.boolean('Check this box', required=False)
}
def data_save(self, cr, uid, ids, context=None):
@ -44,9 +43,6 @@ class account_fiscalyear_close_state(osv.osv_memory):
"""
for data in self.read(cr, uid, ids, context=context):
if not data['sure']:
raise osv.except_osv(_('UserError'), _('Closing of states \
cancelled, please check the box !'))
fy_id = data['fy_id']
cr.execute('UPDATE account_journal_period ' \

View File

@ -7,16 +7,12 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Close states of Fiscal year and periods">
<group colspan="4" >
<field name="fy_id" domain = "[('state','=','draft')]"/>
<separator string="Are you sure you want to close the fiscal year ?" colspan="4"/>
<field name="sure"/>
</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"/>
<field name="fy_id" domain = "[('state','=','draft')]" 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-close" string="Close states" name="data_save" type="object"/>
<button icon="terp-locked" string="Close Fiscalyear" name="data_save" type="object"/>
</group>
</form>
</field>
@ -33,6 +29,7 @@
<menuitem action="action_account_fiscalyear_close_state"
id="menu_wizard_fy_close_state"
sequence="20"
parent="menu_account_end_year_treatments" />
</data>

View File

@ -6,26 +6,19 @@
<field name="model">account.fiscalyear.close</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Generate Fiscal Year Opening Entries Close a Fiscal Year with new entries">
<group 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)]" />
</group>
<group colspan="4" >
<field name="report_name" />
</group>
<group colspan="4" >
<separator string="Are you sure you want to create entries?" colspan="4"/>
<field name="sure"/>
</group>
<separator string="" colspan="4" />
<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>
<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>

View File

@ -161,7 +161,7 @@ class account_move_journal(osv.osv_memory):
'view_mode': 'tree,graph,form',
'res_model': 'account.move.line',
'view_id': False,
'context': "{'visible_id':%s, 'journal_id': %d, 'search_default_journal_id':%d, 'search_default_period_id':%d}" % (journal_id, journal_id, journal_id, period_id),
'context': "{'visible_id':%s, 'search_default_journal_id':%d, 'search_default_period_id':%d}" % (journal_id, journal_id, period_id),
'type': 'ir.actions.act_window',
'search_view_id': res_id
}

View File

@ -23,20 +23,6 @@ import time
from osv import fields, osv
from tools.translate import _
class account_move_line_reconcile_prompt(osv.osv_memory):
"""
Asks user he wants to reconcile entries or not.
"""
_name = 'account.move.line.reconcile.prompt'
_description = 'Account move line reconcile'
_columns = {
}
def ask_reconcilation(self, cr, uid, ids, context):
return self.pool.get('account.move.line.reconcile').partial_check(cr, uid, ids, context)
account_move_line_reconcile_prompt()
class account_move_line_reconcile(osv.osv_memory):
"""
Account move line reconcile wizard, it checks for the write off the reconcile entry or directly reconcile.
@ -63,38 +49,6 @@ class account_move_line_reconcile(osv.osv_memory):
res.update({'writeoff':data['writeoff']})
return res
def partial_check(self, cr, uid, ids, context=None):
mod_obj = self.pool.get('ir.model.data')
data = self.trans_rec_get(cr, uid, ids, context)
if context is None:
context = {}
if data['writeoff'] == 0:
model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_account_move_line_reconcile_full')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
return {
'name': _('Reconcile'),
'context': context,
'view_type': 'form',
'view_mode': 'form',
'res_model': 'account.move.line.reconcile',
'views': [(resource_id,'form')],
'type': 'ir.actions.act_window',
'target': 'new',
}
else :
model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_account_move_line_reconcile_partial')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
return {
'name': _('Reconcile'),
'context': context,
'view_type': 'form',
'view_mode': 'form',
'res_model': 'account.move.line.reconcile',
'views': [(resource_id,'form')],
'type': 'ir.actions.act_window',
'target': 'new',
}
def trans_rec_get(self, cr, uid, ids, context=None):
account_move_line_obj = self.pool.get('account.move.line')
if context is None:
@ -131,6 +85,7 @@ class account_move_line_reconcile(osv.osv_memory):
ids = self.pool.get('account.period').find(cr, uid, dt=date, context=context)
if len(ids):
period_id = ids[0]
context.update({'stop_reconcile': True})
account_move_line_obj.reconcile(cr, uid, context['active_ids'], 'manual', account_id,
period_id, journal_id, context=context)
return {}
@ -197,10 +152,11 @@ class account_move_line_reconcile_writeoff(osv.osv_memory):
if len(ids):
period_id = ids[0]
context.update({'stop_reconcile': True})
account_move_line_obj.reconcile(cr, uid, context['active_ids'], 'manual', account_id,
period_id, journal_id, context=context)
return {}
account_move_line_reconcile_writeoff()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -75,18 +75,18 @@ class account_aged_trial_balance(osv.osv_memory):
for i in range(5)[::-1]:
stop = start - RelativeDateTime(days=period_length)
res[str(i)] = {
'name' : str((5-(i+1)) * period_length) + '-' + str((5-i) * period_length),
'name': (i!=0 and (str((5-(i+1)) * period_length) + '-' + str((5-i) * period_length)) or ('+'+str(4 * period_length))),
'stop': start.strftime('%Y-%m-%d'),
'start' : stop.strftime('%Y-%m-%d'),
'start': (i!=0 and stop.strftime('%Y-%m-%d') or None),
}
start = stop - RelativeDateTime(days=1)
else:
for i in range(5):
stop = start + RelativeDateTime(days=period_length)
res[str(5-(i+1))] = {
'name' : str((i) * period_length)+'-' + str((i+1) * period_length),
'name' : (i!=4 and str((i) * period_length)+'-' + str((i+1) * period_length) or ('+'+str(4 * period_length))),
'start': start.strftime('%Y-%m-%d'),
'stop': stop.strftime('%Y-%m-%d'),
'stop': (i!=4 and stop.strftime('%Y-%m-%d') or None),
}
start = stop + RelativeDateTime(days=1)
data['form'].update(res)
@ -99,4 +99,4 @@ class account_aged_trial_balance(osv.osv_memory):
account_aged_trial_balance()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -62,18 +62,23 @@ class account_common_report(osv.osv_memory):
res['value'] = {'period_from': False, 'period_to': False, 'date_from': time.strftime('%Y-01-01'), 'date_to': time.strftime('%Y-%m-%d')}
if filter == 'filter_period' and fiscalyear_id:
start_period = end_period = False
cr.execute('SELECT p.id FROM account_fiscalyear AS f \
LEFT JOIN account_period AS p on p.fiscalyear_id=f.id \
WHERE p.id IN \
(SELECT id FROM account_period \
WHERE p.fiscalyear_id = f.id \
AND p.date_start IN \
(SELECT max(date_start) from account_period WHERE p.fiscalyear_id = f.id)\
OR p.date_stop IN \
(SELECT min(date_stop) from account_period WHERE p.fiscalyear_id = f.id)) \
AND f.id = ' + str(fiscalyear_id) + ' order by p.date_start')
cr.execute('''
SELECT * FROM (SELECT p.id
FROM account_period p
LEFT JOIN account_fiscalyear f ON (p.fiscalyear_id = f.id)
WHERE f.id = %s
ORDER BY p.date_start ASC
LIMIT 1) AS period_start
UNION
SELECT * FROM (SELECT p.id
FROM account_period p
LEFT JOIN account_fiscalyear f ON (p.fiscalyear_id = f.id)
WHERE f.id = %s
AND p.date_start < NOW()
ORDER BY p.date_stop DESC
LIMIT 1) AS period_stop''', (fiscalyear_id, fiscalyear_id))
periods = [i[0] for i in cr.fetchall()]
if periods:
if periods and len(periods) > 1:
start_period = periods[0]
end_period = periods[1]
res['value'] = {'period_from': start_period, 'period_to': end_period, 'date_from': False, 'date_to': False}

View File

@ -13,8 +13,8 @@
<label string="(Invoice should be unreconciled if you want to open it)"/>
<separator colspan="4"/>
<group colspan="2" col="4">
<button special="cancel" string="No" icon="gtk-no"/>
<button name="change_inv_state" string="Yes" type="object" icon="gtk-yes"/>
<button special="cancel" string="No" icon="terp-gtk-stop"/>
<button name="change_inv_state" string="Yes" type="object" icon="terp-camera_test"/>
</group>
</form>
</field>

View File

@ -39,8 +39,8 @@ class account_subscription_generate(osv.osv_memory):
moves_created=[]
for data in self.read(cr, uid, ids, context=context):
cr.execute('select id from account_subscription_line where date<%s and move_id is null', (data['date'],))
ids = map(lambda x: x[0], cr.fetchall())
moves = self.pool.get('account.subscription.line').move_create(cr, uid, ids, context=context)
line_ids = map(lambda x: x[0], cr.fetchall())
moves = self.pool.get('account.subscription.line').move_create(cr, uid, line_ids, context=context)
moves_created.extend(moves)
result = mod_obj._get_id(cr, uid, 'account', 'action_move_line_form')
id = mod_obj.read(cr, uid, [result], ['res_id'], context=context)[0]['res_id']

View File

@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
class account_unreconcile(osv.osv_memory):
@ -26,20 +27,10 @@ class account_unreconcile(osv.osv_memory):
def trans_unrec(self, cr, uid, ids, context=None):
obj_move_line = self.pool.get('account.move.line')
obj_move_reconcile = self.pool.get('account.move.reconcile')
if context is None:
context = {}
recs = obj_move_line.read(cr, uid, context['active_ids'], ['reconcile_id','reconcile_partial_id'])
unlink_ids = []
full_recs = filter(lambda x: x['reconcile_id'], recs)
rec_ids = [rec['reconcile_id'][0] for rec in full_recs]
part_recs = filter(lambda x: x['reconcile_partial_id'], recs)
part_rec_ids = [rec['reconcile_partial_id'][0] for rec in part_recs]
unlink_ids += rec_ids
unlink_ids += part_rec_ids
if len(unlink_ids):
self.pool.get('account.move.reconcile').unlink(cr, uid, unlink_ids)
if context.get('active_ids', False):
obj_move_line._remove_move_reconcile(cr, uid, context['active_ids'], context=context)
return {}
account_unreconcile()

View File

@ -32,72 +32,85 @@ class account_use_model(osv.osv_memory):
'model': fields.many2many('account.model', 'account_use_model_relation', 'account_id', 'model_id', 'Account Model'),
}
def view_init(self, cr , uid , fields_list, context=None):
account_model_obj = self.pool.get('account.model')
if context is None:
context = {}
if context.get('active_ids',False):
data_model = account_model_obj.browse(cr, uid, context['active_ids'])
for model in data_model:
for line in model.lines_id:
if line.date_maturity == 'partner':
if not line.partner_id:
raise osv.except_osv(_('Error !'), _("Maturity date of entry line generated by model line '%s' is based on partner payment term! \
\nPlease define partner on it!"%(line.name)))
pass
def create_entries(self, cr, uid, ids, context=None):
account_model_obj = self.pool.get('account.model')
account_period_obj = self.pool.get('account.period')
account_move_obj = self.pool.get('account.move')
account_move_line_obj = self.pool.get('account.move.line')
pt_obj = self.pool.get('account.payment.term')
mod_obj = self.pool.get('ir.model.data')
if context is None:
context = {}
move_ids = []
entry = {}
data = self.read(cr, uid, ids, context=context)[0]
record_id = context and context.get('model_line', False) or False
if record_id:
data_model = account_model_obj.browse(cr, uid, data['model'])
else:
data_model = account_model_obj.browse(cr, uid, context['active_ids'])
move_ids = []
for model in data_model:
period_id = account_period_obj.find(cr, uid, context=context)
if not period_id:
raise osv.except_osv(_('No period found !'), _('Unable to find a valid period !'))
period_id = period_id[0]
move_id = account_move_obj.create(cr, uid, {
'ref': model.ref,
'period_id': period_id,
entry['name'] = model.name%{'year':time.strftime('%Y'), 'month':time.strftime('%m'), 'date':time.strftime('%d')}
period_id = account_period_obj.find(cr, uid, context=context)
if not period_id:
raise osv.except_osv(_('No period found !'), _('Unable to find a valid period !'))
period_id = period_id[0]
move_id = account_move_obj.create(cr, uid, {
'ref': entry['name'],
'period_id': period_id,
'journal_id': model.journal_id.id,
})
move_ids.append(move_id)
for line in model.lines_id:
analytic_account_id = False
if line.analytic_account_id:
if not model.journal_id.analytic_journal_id:
raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (model.journal_id.name,))
analytic_account_id = line.analytic_account_id.id
val = {
'move_id': move_id,
'journal_id': model.journal_id.id,
'period_id': period_id,
'analytic_account_id': analytic_account_id
}
date_maturity = time.strftime('%Y-%m-%d')
if line.date_maturity == 'partner' and line.partner_id and line.partner_id.property_payment_term:
payment_term_id = line.partner_id.property_payment_term.id
pterm_list = pt_obj.compute(cr, uid, payment_term_id, value=1, date_ref=date_maturity)
if pterm_list:
pterm_list = [l[0] for l in pterm_list]
pterm_list.sort()
date_maturity = pterm_list[-1]
val.update({
'name': line.name,
'quantity': line.quantity,
'debit': line.debit,
'credit': line.credit,
'account_id': line.account_id.id,
'move_id': move_id,
'partner_id': line.partner_id.id,
'date': time.strftime('%Y-%m-%d'),
'date_maturity': date_maturity
})
move_ids.append(move_id)
for line in model.lines_id:
val = {
'move_id': move_id,
'journal_id': model.journal_id.id,
'period_id': period_id
}
val.update({
'name': line.name,
'quantity': line.quantity,
'debit': line.debit,
'credit': line.credit,
'account_id': line.account_id.id,
'move_id': move_id,
'ref': line.ref,
'partner_id': line.partner_id.id,
'date': time.strftime('%Y-%m-%d'),
'date_maturity': time.strftime('%Y-%m-%d')
})
c = context.copy()
c.update({'journal_id': model.journal_id.id,'period_id': period_id})
id_line = account_move_line_obj.create(cr, uid, val, context=c)
context.update({'move_ids':move_ids})
model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_account_use_model_open_entry')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
return {
'name': _('Use Model'),
'context': context,
'view_type': 'form',
'view_mode': 'form',
'res_model': 'account.use.model',
'views': [(resource_id,'form')],
'type': 'ir.actions.act_window',
'target': 'new',
}
c = context.copy()
c.update({'journal_id': model.journal_id.id,'period_id': period_id})
id_line = account_move_line_obj.create(cr, uid, val, context=c)
def open_moves(self, cr, uid, ids, context=None):
mod_obj = self.pool.get('ir.model.data')
if context is None:
context = {}
context.update({'move_ids':move_ids})
model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_move_form')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
return {
@ -112,5 +125,4 @@ class account_use_model(osv.osv_memory):
account_use_model()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -32,31 +32,7 @@
<field name="context">{'model_line':'model_line'}</field>
</record>
<record model="ir.values" id="action_account_use_model_values">
<field name="model_id" ref="account.model_account_move_line" />
<field name="object" eval="1" />
<field name="name">Manual Recurring</field>
<field name="key2">client_action_multi</field>
<field name="value" eval="'ir.actions.act_window,' +str(ref('action_view_account_use_model'))" />
<field name="key">action</field>
<field name="model">account.move.line</field>
</record>
<record id="view_account_use_model_open_entry" model="ir.ui.view">
<field name="name">account.use.model.open.entry.form</field>
<field name="model">account.use.model</field>
<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 = "Entry Lines Created." colspan="2"/>
<newline/>
<button icon="gtk-ok" special="cancel" string="Ok"/>
<button icon="terp-gtk-go-back-rtl" string="Open" name="open_moves" type="object" default_focus='1'/>
</group>
</form>
</field>
</record>
<menuitem name="Manual Recurring" action="action_view_account_use_model" id="menu_action_manual_recurring" sequence="10" parent="account.menu_finance_recurrent_entries"/>
<record id="view_account_use_model_create_entry" model="ir.ui.view">
<field name="name">account.use.model.create.entry.form</field>

View File

@ -196,7 +196,7 @@
parent="account.menu_analytic_accounting"
name="Multi Plans"
id="menu_account_analytic_multi_plan_action"
/>
groups="analytic.group_analytic_accounting"/>
<menuitem
parent="menu_account_analytic_multi_plan_action"
id="menu_account_analytic_plan_action"

View File

@ -32,6 +32,7 @@
"demo_xml" : [],
"init_xml" : [],
"update_xml": ["security/ir.model.access.csv",
"security/account_security.xml",
"wizard/account_coda_import.xml",
"account_coda_view.xml"],
"active" : False,

View File

@ -33,10 +33,12 @@ class account_coda(osv.osv):
'journal_id': fields.many2one('account.journal', 'Journal', readonly=True, select=True, help="Bank Journal"),
'date': fields.date('Date', readonly=True, select=True, help="Import Date"),
'user_id': fields.many2one('res.users', 'User', readonly=True, select=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True)
}
_defaults = {
'date': time.strftime('%Y-%m-%d'),
'user_id': lambda self,cr,uid,context: uid,
'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'account.coda', context=c),
}
account_coda()

View File

@ -2,41 +2,42 @@
<openerp>
<data>
<record model="ir.ui.view" id="view_account_coda_form">
<field name="name">account.coda.form</field>
<field name="model">account.coda</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Coda import">
<field name="name" />
<field name="journal_id" />
<field name="date" />
<field name="user_id" />
<notebook colspan="4">
<page string="Log">
<field name="note" colspan="4" nolabel="1"/>
</page>
<page string="Statements">
<field name="statement_ids" colspan="4" nolabel="1"/>
</page>
</notebook>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_account_coda_form">
<field name="name">account.coda.form</field>
<field name="model">account.coda</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Coda import">
<field name="name" />
<field name="journal_id" />
<field name="date" />
<field name="user_id" />
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<notebook colspan="4">
<page string="Log">
<field name="note" colspan="4" nolabel="1"/>
</page>
<page string="Statements">
<field name="statement_ids" colspan="4" nolabel="1"/>
</page>
</notebook>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_account_coda_tree">
<field name="name">account.coda.tree</field>
<field name="model">account.coda</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Coda import">
<field name="journal_id" />
<field name="date" />
<field name="user_id" />
<field name="statement_ids"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_account_coda_tree">
<field name="name">account.coda.tree</field>
<field name="model">account.coda</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Coda import">
<field name="journal_id" />
<field name="date" />
<field name="user_id" />
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<record id="view_aaccount_coda_filter" model="ir.ui.view">
<field name="name">account.coda.select</field>
@ -46,8 +47,9 @@
<search string="Search Coda">
<group col="10" colspan="4">
<field name="journal_id"/>
<field name="user_id" default="uid"/>
<field name="date"/>
<field name="user_id" default="uid"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
<newline/>
<group expand="0" string="Group By...">
@ -55,35 +57,34 @@
<filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
<separator orientation="vertical"/>
<filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Company" icon="terp-personal" domain="[]" context="{'group_by':'company_id'}"/>
</group>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="action_account_coda">
<field name="name">Coda Statements</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.coda</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{"search_default_user_id":uid}</field>
<field name="search_view_id" ref="view_aaccount_coda_filter"/>
</record>
<record model="ir.actions.act_window" id="action_account_coda">
<field name="name">Statements</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.coda</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{}</field>
<field name="search_view_id" ref="view_aaccount_coda_filter"/>
</record>
<menuitem name="Coda Statements" parent="account.menu_finance_periodical_processing" id="menu_account_coda" sequence="12"/>
<menuitem name="Coda Import Logs" parent="account.menu_finance_bank_and_cash" id="menu_account_coda_statement" action="action_account_coda" groups="base.group_extended" sequence="32"/>
<menuitem name="Coda Statements" parent="menu_account_coda" id="menu_account_coda_statement" action="action_account_coda" sequence="15"/>
<menuitem name="Import Coda Statements" action="action_account_coda_import" parent="account.menu_account_coda"
id="menu_account_coda_import" sequence="20"/>
<menuitem name="Import Coda Statements" action="action_account_coda_import" parent="menu_account_coda"
id="menu_account_coda_import" sequence="13"/>
<act_window name="Coda File"
domain="[('statement_ids', 'in', [active_id])]"
res_model="account.coda"
src_model="account.bank.statement"
view_type="form"
view_mode="tree,form"
id="act_account_payment_account_bank_statement"/>
<act_window name="Coda File"
domain="[('statement_ids', 'in', [active_id])]"
res_model="account.coda"
src_model="account.bank.statement"
view_type="form"
view_mode="tree,form"
id="act_account_payment_account_bank_statement"/>
</data>
</data>
</openerp>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp><data>
<record id="account_coda_comp_rule" model="ir.rule">
<field name="name">Account Coda model company rule</field>
<field model="ir.model" name="model_id" ref="model_account_coda"/>
<field eval="True" name="global"/>
<field name="domain_force">[('company_id','=',user.company_id.id)]</field>
</record>
</data></openerp>

View File

@ -85,7 +85,7 @@
<field name="search_view_id" ref="view_account_followup_filter"/>
<field name="view_type">form</field>
</record>
<menuitem action="action_account_followup_definition_form" id="account_followup_menu" parent="account.menu_finance_configuration" groups="base.group_system"/>
<menuitem action="action_account_followup_definition_form" id="account_followup_menu" parent="account.menu_configuration_misc" groups="base.group_system"/>
<report auto="False" id="account_followup_followup_report" menu="False" model="account_followup.followup" name="account_followup.followup.print" rml="account_followup/report/report_followp_print.rml" string="Followup Report"/>

View File

@ -31,20 +31,10 @@
<field name="target">new</field>
</record>
<record model="ir.values" id="account_followup_print_values">
<field name="model_id" ref="model_account_followup_followup" />
<field name="object" eval="1" />
<field name="name">Send followups</field>
<field name="key2">client_action_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_followup_print'))" />
<field name="key">action</field>
<field name="model">account_followup.followup</field>
</record>
<menuitem action="action_account_followup_print"
id="account_followup_print_menu"
parent="account.menu_finance_periodical_processing"
/>
parent="account.menu_finance_periodical_processing_billing"
sequence="10"/>
<!-- Screen2 -->

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,13 +15,14 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
from mx import DateTime
from osv import fields, osv
class Invoice(osv.osv):
_inherit = 'account.invoice'
@ -49,5 +50,4 @@ class Invoice(osv.osv):
Invoice()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -7,9 +7,8 @@
<field name="type">form</field>
<field name="inherit_id" ref="account.invoice_supplier_form"/>
<field name="arch" type="xml">
<field name="period_id" position="before">
<field name="partner_bank_id" position="before">
<field name="amount_to_pay"/>
<newline/>
</field>
</field>
</record>

View File

@ -23,20 +23,6 @@ import time
from osv import osv, fields
import netsvc
class payment_type(osv.osv):
_name= 'payment.type'
_description= 'Payment Type'
_columns= {
'name': fields.char('Name', size=64, required=True, help='Payment Type'),
'code': fields.char('Code', size=64, required=True, help='Specifies the Code for Payment Type'),
'suitable_bank_types': fields.many2many('res.partner.bank.type',
'bank_type_payment_type_rel',
'pay_type_id', 'bank_type_id',
'Suitable bank types')
}
payment_type()
class payment_mode(osv.osv):
_name= 'payment.mode'
_description= 'Payment Mode'
@ -47,21 +33,19 @@ class payment_mode(osv.osv):
'journal': fields.many2one('account.journal', 'Journal', required=True,
domain=[('type', '=', 'cash')], help='Cash Journal for the Payment Mode'),
'company_id': fields.many2one('res.company', 'Company', required=True),
'type': fields.many2one('payment.type', 'Payment type', required=True, help='Select the Payment Type for the Payment Mode.'),
}
_defaults = {
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id
}
def suitable_bank_types(self, cr, uid, payment_code=None, context={}):
"""Return the codes of the bank type that are suitable
for the given payment type code"""
if not payment_code:
return []
cr.execute(""" select t.code
from res_partner_bank_type t
join bank_type_payment_type_rel r on (r.bank_type_id = t.id)
join payment_type pt on (r.pay_type_id = pt.id)
join payment_mode pm on (pm.type = pt.id)
cr.execute(""" select pb.state
from res_partner_bank pb
join payment_mode pm on (pm.bank_id = pb.id)
where pm.id = %s """, [payment_code])
return [x[0] for x in cr.fetchall()]
@ -149,6 +133,29 @@ class payment_order(osv.osv):
})
return super(payment_order, self).copy(cr, uid, id, default, context=context)
def write(self, cr, uid, ids, vals, context=None):
if context is None:
context = {}
payment_line_obj = self.pool.get('payment.line')
payment_line_ids = []
if (vals.get('date_prefered', False) == 'fixed' and not vals.get('date_scheduled', False)) or vals.get('date_scheduled', False):
for order in self.browse(cr, uid, ids, context=context):
for line in order.line_ids:
payment_line_ids.append(line.id)
payment_line_obj.write(cr, uid, payment_line_ids, {'date':vals.get('date_scheduled', False)}, context=context)
elif vals.get('date_prefered', False) == 'due':
vals.update({'date_scheduled':False})
for order in self.browse(cr, uid, ids, context=context):
for line in order.line_ids:
payment_line_obj.write(cr, uid, [line.id], {'date':line.ml_maturity_date}, context=context)
elif vals.get('date_prefered', False) == 'now':
vals.update({'date_scheduled':False})
for order in self.browse(cr, uid, ids, context=context):
for line in order.line_ids:
payment_line_ids.append(line.id)
payment_line_obj.write(cr, uid, payment_line_ids, {'date': False}, context=context)
return super(payment_order, self).write(cr, uid, ids, vals, context=context)
payment_order()
class payment_line(osv.osv):
@ -254,19 +261,6 @@ class payment_line(osv.osv):
line.amount_currency, context=ctx)
return res
def _value_date(self, cursor, user, ids, name, args, context=None):
if not ids:
return {}
res = {}
for line in self.browse(cursor, user, ids, context=context):
if line.order_id.date_prefered == 'fixed':
res[line.id] = line.order_id.date_scheduled
elif line.order_id.date_prefered == 'due':
res[line.id] = line.due_date or time.strftime('%Y-%m-%d')
else:
res[line.id] = time.strftime('%Y-%m-%d')
return res
def _get_currency(self, cr, uid, context):
user = self.pool.get('res.users').browse(cr, uid, uid)
if user.company_id:
@ -375,7 +369,6 @@ class payment_line(osv.osv):
data['date'] = line.date_maturity
elif date_prefered == 'fixed':
data['date'] = date_scheduled
return {'value': data}
def onchange_amount(self, cr, uid, ids, amount, currency, cmpny_currency, context=None):
@ -419,7 +412,6 @@ class payment_line(osv.osv):
if bank.state in bank_type:
data['bank_id'] = bank.id
break
return {'value': data}
def fields_get(self, cr, uid, fields=None, context=None):

View File

@ -40,27 +40,6 @@
<menuitem id="menu_main" name="Payment" parent="account.menu_finance" sequence="6"/>
<record id="view_payment_type_form" model="ir.ui.view">
<field name="name">payment.type.form</field>
<field name="model">payment.type</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Payment Type">
<field name="name"/>
<field name="code"/>
<separator string="Suitable Bank Types" colspan="4"/>
<field name="suitable_bank_types" nolabel="1" colspan="4"/>
</form>
</field>
</record>
<record id="action_payment_type_tree" model="ir.actions.act_window">
<field name="name">Payment Type</field>
<field name="res_model">payment.type</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<record id="view_payment_mode_tree" model="ir.ui.view">
<field name="name">payment.mode.tree</field>
<field name="model">payment.mode</field>
@ -69,7 +48,7 @@
<tree string="Payment Mode">
<field name="name"/>
<field name="journal"/>
<field name="company_id"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
@ -80,10 +59,9 @@
<field name="arch" type="xml">
<form string="Payment Mode">
<field name="name" select="1"/>
<field name="type"/>
<field name="journal"/>
<field name="journal" select="1"/>
<field name="bank_id"/>
<field name="company_id" select="1" widget='selection'/>
<field name="company_id" select="1" widget='selection' groups="base.group_multi_company"/>
</form>
</field>
</record>
@ -94,11 +72,7 @@
<field name="view_mode">tree,form</field>
</record>
<menuitem id="next_id_44" name="Payment" parent="account.menu_finance_configuration" groups="base.group_system"/>
<menuitem action="action_payment_mode_form" id="menu_action_payment_mode_form" parent="next_id_44"/>
<menuitem action="action_payment_type_tree" id="menu_action_paymen_type" parent="next_id_44"/>
<menuitem action="action_payment_mode_form" id="menu_action_payment_mode_form" parent="account.menu_configuration_misc"/>
<record id="view_payment_order_form" model="ir.ui.view">
<field name="name">payment.order.form</field>
@ -106,12 +80,14 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Payment order">
<field name="reference"/>
<field name="mode"/>
<field name="date_prefered"/>
<field name="date_scheduled" select="1" attrs="{'readonly':[('date_prefered','!=','fixed')]}" />
<field name="user_id"/>
<button colspan="2" name="%(action_create_payment_order)d" string="Select Invoices to Pay" type="action" attrs="{'invisible':[('state','=','done')]}" icon="gtk-find"/>
<group col="6" colspan="4">
<field name="reference"/>
<field name="mode" widget='selection'/>
<field name="user_id"/>
<field name="date_prefered"/>
<field name="date_scheduled" select="1" attrs="{'readonly':[('date_prefered','!=','fixed')]}" />
<button colspan="2" name="%(action_create_payment_order)d" string="Select Invoices to Pay" type="action" attrs="{'invisible':[('state','=','done')]}" icon="gtk-find"/>
</group>
<field name="line_ids" colspan="4" widget="one2many_list" nolabel="1">
<form string="Payment Line">
<notebook>
@ -203,7 +179,7 @@
<group col="8" colspan="4">
<filter string="Draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
<filter string="Confirmed" domain="[('state','=','open')]" icon="terp-camera_test"/>
<filter string="Done" domain="[('state','=','done')]" icon="terp-dolar_ok!"/>
<filter string="Done" domain="[('state','=','done')]" icon="terp-dialog-close"/>
<separator orientation="vertical"/>
<field name="reference"/>
<field name="mode" widget='selection'/>
@ -212,7 +188,7 @@
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Payment Mode" context="{'group_by': 'mode'}" icon="terp-dolar_ok!"/>
<filter string="Payment Mode" context="{'group_by': 'mode'}" icon="terp-dolar"/>
<filter string="State" context="{'group_by': 'state'}" icon="terp-stock_effects-object-colorize"/>
</group>
</search>

View File

@ -1,5 +1,4 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_payment_type","payment.type","model_payment_type","group_account_payment",1,1,1,1
"access_payment_mode","payment.mode","model_payment_mode","group_account_payment",1,1,1,1
"access_payment_order","payment.order","model_payment_order","group_account_payment",1,1,1,1
"access_payment_line","payment.line","model_payment_line","group_account_payment",1,1,1,1
@ -10,6 +9,5 @@
"access_payment_order_manager","payment.order manager","model_payment_order","account.group_account_manager",1,0,0,0
"access_payment_order_system","payment.order system","model_payment_order","base.group_system",1,0,0,0
"access_payment_mode_system","payment.mode system","model_payment_mode","base.group_system",1,1,1,1
"access_payment_type_system","payment.type system","model_payment_type","base.group_system",1,1,1,1
"access_payment_order_invoice","payment.order invoice","model_payment_order","account.group_account_invoice",1,1,1,1
"access_payment_line_invoice","payment.line invoice","model_payment_line","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
access_payment_type payment.type model_payment_type group_account_payment 1 1 1 1
2 access_payment_mode payment.mode model_payment_mode group_account_payment 1 1 1 1
3 access_payment_order payment.order model_payment_order group_account_payment 1 1 1 1
4 access_payment_line payment.line model_payment_line group_account_payment 1 1 1 1
9 access_payment_order_manager payment.order manager model_payment_order account.group_account_manager 1 0 0 0
10 access_payment_order_system payment.order system model_payment_order base.group_system 1 0 0 0
11 access_payment_mode_system payment.mode system model_payment_mode base.group_system 1 1 1 1
access_payment_type_system payment.type system model_payment_type base.group_system 1 1 1 1
12 access_payment_order_invoice payment.order invoice model_payment_order account.group_account_invoice 1 1 1 1
13 access_payment_line_invoice payment.line invoice model_payment_line account.group_account_invoice 1 1 1 1

View File

@ -1,12 +1,5 @@
-
In order to test account_payment in OpenERP I create a new record Type.
-
!record {model: payment.type, id: payment_type_t0}:
code: T0
name: TestType
-
I created a new Bank Record
In order to test account_payment in OpenERP I created a new Bank Record
-
Creating a res.partner.bank record
-
@ -26,7 +19,6 @@
bank_id: res_partner_bank_0
journal: account.bank_journal
name: TestMode
type: payment_type_t0
-
I created a Supplier Invoice

View File

@ -66,7 +66,7 @@ class payment_order_create(osv.osv_memory):
if not line_ids: return {}
payment = order_obj.browse(cr, uid, context['active_id'], context=context)
t = payment.mode and payment.mode.type.id or None
t = None
line2bank = line_obj.line2bank(cr, uid, line_ids, t, context)
## Finally populate the current payment with new lines:

View File

@ -30,23 +30,25 @@ class account_payment_make_payment(osv.osv_memory):
If type is manual. just confirm the order.
"""
obj_payment_order = self.pool.get('payment.order')
obj_model = self.pool.get('ir.model.data')
obj_act = self.pool.get('ir.actions.act_window')
order= obj_payment_order.browse(cr, uid, context['active_id'], context)
t = order.mode and order.mode.type.code or 'manual'
if t == 'manual' :
obj_payment_order.set_done(cr,uid,context['active_id'],context)
return {}
gw = obj_payment_order.get_wizard(t)
if not gw:
obj_payment_order.set_done(cr,uid,context['active_id'],context)
return {}
module, wizard= gw
result = obj_model._get_id(cr, uid, module, wizard)
id = obj_model.read(cr, uid, [result], ['res_id'])[0]['res_id']
return obj_act.read(cr, uid, [id])[0]
# obj_model = self.pool.get('ir.model.data')
# obj_act = self.pool.get('ir.actions.act_window')
# order = obj_payment_order.browse(cr, uid, context['active_id'], context)
obj_payment_order.set_done(cr, uid, context['active_id'], context)
return {}
# t = order.mode and order.mode.type.code or 'manual'
# if t == 'manual' :
# obj_payment_order.set_done(cr,uid,context['active_id'],context)
# return {}
#
# gw = obj_payment_order.get_wizard(t)
# if not gw:
# obj_payment_order.set_done(cr,uid,context['active_id'],context)
# return {}
#
# module, wizard= gw
# result = obj_model._get_id(cr, uid, module, wizard)
# id = obj_model.read(cr, uid, [result], ['res_id'])[0]['res_id']
# return obj_act.read(cr, uid, [id])[0]
account_payment_make_payment()

View File

@ -61,5 +61,5 @@ report_sxw.report_sxw(
'report.voucher.cash_receipt.drcr',
'account.voucher',
'addons/account_voucher/report/report_voucher.rml',
parser=report_voucher,header=False
parser=report_voucher,header="external"
)

View File

@ -2,7 +2,7 @@
<document filename="test.pdf">
<template pageSize="(595.0,842.0)" title="Voucher" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
<frame id="first" x1="28.0" y1="42.0" width="525" height="772"/>
</pageTemplate>
</template>
<stylesheet>
@ -10,11 +10,67 @@
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table1">
<blockTableStyle id="Table7">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEAFTER" colorName="#b3b3b3" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="3,-1" stop="3,-1"/>
</blockTableStyle>
<blockTableStyle id="Table8">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="4,0" stop="4,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="4,-1" stop="4,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="5,0" stop="5,-1"/>
<lineStyle kind="LINEAFTER" colorName="#b3b3b3" start="5,0" stop="5,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="5,0" stop="5,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="5,-1" stop="5,-1"/>
</blockTableStyle>
<blockTableStyle id="Heading1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="2,-1" stop="2,-1"/>
</blockTableStyle>
<blockTableStyle id="Table2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Heading1">
<blockTableStyle id="Table6">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
@ -26,22 +82,6 @@
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
</blockTableStyle>
<blockTableStyle id="Table2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="last_info">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,6" stop="0,6"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,6" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,6" stop="1,6"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,6" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,6" stop="2,6"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
</blockTableStyle>
<blockTableStyle id="Table3">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
@ -49,33 +89,14 @@
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" fontName="Helvetica-Bold" fontSize="13.0" leading="16" alignment="CENTER"/>
<paraStyle name="P2" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P3" fontName="Helvetica-Bold" fontSize="22.0" leading="27" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P4" fontName="Helvetica" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P5" fontName="Helvetica" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P6" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P7" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P8" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P9" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P10" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P11" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P12" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P13" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P14" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P15" fontName="Helvetica" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P16" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P17" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P18" fontName="Helvetica-Bold" fontSize="13.0" leading="16" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P19" rightIndent="0.0" leftIndent="35.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P20" rightIndent="0.0" leftIndent="35.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P21" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P22" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P23" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P24" fontName="Helvetica" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P25" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P26" rightIndent="0.0" leftIndent="71.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P27" rightIndent="0.0" leftIndent="35.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P1" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P2" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P3" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P4" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P5" rightIndent="0.0" leftIndent="9.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P6" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P7" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Standard" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Text body" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
@ -92,13 +113,13 @@
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_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"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Footer" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT"/>
<paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" alignment="LEFT" spaceBefore="0.0" spaceAfter="14.0"/>
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
@ -133,81 +154,67 @@
<images/>
</stylesheet>
<story>
<para style="P22">[[ repeatIn(objects,'voucher') ]]</para>
<para style="P3">[[ company.name ]]</para>
<para style="P5">[[ company.partner_id.address and company.partner_id.address[0].street ]]</para>
<para style="P5">[[ company.partner_id.address and company.partner_id.address[0].zip ]] [[ company.partner_id.address and company.partner_id.address[0].city ]] - [[ company.partner_id.address and company.partner_id.address[0].country_id and company.partner_id.address[0].country_id.name ]]</para>
<para style="P5">[[ company.partner_id.address and company.partner_id.address[0].phone ]]</para>
<para style="P5">[[ company.partner_id.address and company.partner_id.address[0].email ]]</para>
<para style="P4">
<para style="P8">[[ repeatIn(objects,'voucher') ]]</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<para style="P18">Cash Receipt Voucher [[ (voucher.type == 'rec_voucher' or removeParentNode('para')) and '' ]]</para>
<para style="P1">Cash Payment Voucher [[ (voucher.type == 'pay_voucher' or removeParentNode('para')) and '' ]]</para>
<para style="P18">Bank Receipt Voucher [[ (voucher.type == 'bank_rec_voucher' or removeParentNode('para')) and '' ]]</para>
<para style="P1">Bank Payment Voucher [[ (voucher.type == 'bank_pay_voucher' or removeParentNode('para')) and '' ]]</para>
<para style="P17">
<para style="terp_default_8">
<font color="white"> </font>
</para>
<blockTable colWidths="49.0,143.0,116.0,69.0,106.0" style="Table1">
<blockTable colWidths="63.0,200.0,52.0,210.0" style="Table7">
<tr>
<td>
<para style="P9">No.</para>
<para style="terp_tblheader_Details">Journal:</para>
</td>
<td>
<para style="P10">[[ voucher.number ]]</para>
<para style="terp_default_9">[[ voucher.type ]]</para>
</td>
<td>
<para style="P2">
<font color="white"> </font>
</para>
<para style="terp_default_Bold_9">Number:</para>
</td>
<td>
<para style="P9">Dated :</para>
</td>
<td>
<para style="P10">[[ formatLang(voucher.date, date=True) or '' ]]</para>
</td>
</tr>
<tr>
<td>
<para style="P9">State :</para>
</td>
<td>
<para style="P16">PRO-FORMA [[ ((voucher.state == 'proforma') or removeParentNode('para')) and '' ]]</para>
<para style="P16">Draft[[ ((voucher.state == 'draft') or removeParentNode('para')) and '' ]]</para>
<para style="P16">Canceled [[ ((voucher.state == 'cancel') or removeParentNode('para')) and '' ]]</para>
<para style="P16">Posted [[ ((voucher.state == 'posted') or removeParentNode('para')) and '' ]]</para>
</td>
<td>
<para style="P2">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P9">Ref. :</para>
</td>
<td>
<para style="P10">[[ voucher.reference ]]</para>
<para style="terp_default_9">[[ voucher.number ]]</para>
</td>
</tr>
</blockTable>
<para style="P11">
<font color="white"> </font>
</para>
<para style="P11">
<font color="white"> </font>
</para>
<blockTable colWidths="255.0,114.0,113.0" style="Heading1">
<blockTable colWidths="63.0,72.0,44.0,84.0,52.0,210.0" style="Table8">
<tr>
<td>
<para style="terp_header">Particulars</para>
<para style="terp_default_Bold_9">State:</para>
</td>
<td>
<para style="terp_header_Right">Debit</para>
<para style="P3">PRO-FORMA [[ ((voucher.state == 'proforma') or removeParentNode('para')) and '' ]]</para>
<para style="P3">Draft[[ ((voucher.state == 'draft') or removeParentNode('para')) and '' ]]</para>
<para style="P3">Canceled [[ ((voucher.state == 'cancel') or removeParentNode('para')) and '' ]]</para>
<para style="P3">Posted [[ ((voucher.state == 'posted') or removeParentNode('para')) and '' ]]</para>
</td>
<td>
<para style="terp_header_Right">Credit</para>
<para style="terp_default_Bold_9">Ref. :</para>
</td>
<td>
<para style="P1">[[ voucher.reference or '' ]]</para>
</td>
<td>
<para style="terp_default_Bold_9">Date:</para>
</td>
<td>
<para style="terp_default_9">[[ formatLang(voucher.date , date=True) or '' ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<blockTable colWidths="277.0,124.0,124.0" style="Heading1">
<tr>
<td>
<para style="terp_tblheader_Details">Particulars</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Debit</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Credit</para>
</td>
</tr>
</blockTable>
@ -216,12 +223,10 @@
</para>
<section>
<para style="terp_default_8">[[ repeatIn(voucher.move_ids,'move_ids') ]] </para>
<blockTable colWidths="254.0,115.0,113.0" style="Table2">
<blockTable colWidths="276.0,126.0,123.0" style="Table2">
<tr>
<td>
<para style="terp_default_Bold_9">
<font face="Helvetica" size="10.0">[[ (move_ids.partner_id and move_ids.partner_id.name) or 'Account']] </font>
</para>
<para style="P4">[[ (move_ids.partner_id and move_ids.partner_id.name) or 'Account']] </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(move_ids.debit) ]]</para>
@ -232,9 +237,7 @@
</tr>
<tr>
<td>
<para style="terp_default_9_with_indent_10">
<font face="Helvetica">[[ move_ids.account_id.name ]] </font>
</para>
<para style="P5">[[ move_ids.account_id.name ]] </para>
</td>
<td>
<para style="terp_default_Right_9">
@ -249,7 +252,7 @@
</tr>
<tr>
<td>
<para style="terp_default_8_Italic">[[ move_ids.name ]] - [[ voucher.reference ]]</para>
<para style="terp_default_8_Italic">[[ move_ids.name ]] - [[ get_ref(voucher.id,move_ids) ]]</para>
</td>
<td>
<para style="terp_default_9_50">
@ -267,165 +270,167 @@
<font color="white"> </font>
</para>
</section>
<para style="terp_default_9">
<para style="terp_default_1">
<font color="white"> </font>
</para>
<blockTable colWidths="253.0,114.0,114.0" style="last_info">
<blockTable colWidths="276.0,126.0,123.0" style="Table6">
<tr>
<td>
<para style="P12">Through : </para>
<para style="terp_tblheader_Details">Through : </para>
</td>
<td>
<para style="P2">
<para style="terp_tblheader_Details">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P2">
<para style="terp_tblheader_Details">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P19">[[ voucher.narration or '']]</para>
<para style="terp_default_9">[[ voucher.narration or '']]</para>
</td>
<td>
<para style="P2">
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P2">
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P12">On Account of : </para>
<para style="terp_tblheader_Details">On Account of : </para>
</td>
<td>
<para style="P2">
<para style="terp_tblheader_Details">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P2">
<para style="terp_tblheader_Details">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P20">[[ voucher.name ]]</para>
<para style="terp_default_9">[[ voucher.name ]]</para>
</td>
<td>
<para style="P2">
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P2">
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P12">Amount (in words) : </para>
<para style="terp_tblheader_Details">Amount (in words) : </para>
</td>
<td>
<para style="P12">
<para style="terp_tblheader_Details">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P12">
<para style="terp_tblheader_Details">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P20">[[ convert(voucher.amount,voucher.currency_id.name) ]]</para>
<para style="terp_default_9">[[ convert(voucher.amount,voucher.currency_id.name) ]]</para>
</td>
<td>
<para style="P11">
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P11">
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P13">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P25">[[ debit(voucher.move_ids)]]</para>
</td>
<td>
<para style="P25">[[ credit(voucher.move_ids) ]]</para>
</td>
</tr>
</blockTable>
<para style="P14">
<para style="terp_default_1">
<font color="white"> </font>
</para>
<blockTable colWidths="142.0,99.0,105.0,136.0" style="Table3">
<blockTable colWidths="276.0,127.0,122.0" style="Table1">
<tr>
<td>
<para style="P6">
<font color="white"> </font>
</para>
<para style="P6">
<font color="white"> </font>
</para>
<para style="P6">
<font color="white"> </font>
</para>
<para style="P6">
<para style="P2">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P6">
<para style="terp_default_Right_9_Bold">[[ debit(voucher.move_ids)]]</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ credit(voucher.move_ids) ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_1">
<font color="white"> </font>
</para>
<blockTable colWidths="157.0,119.0,126.0,123.0" style="Table3">
<tr>
<td>
<para style="terp_default_9">
<font color="white"> </font>
</para>
<para style="terp_default_9">
<font color="white"> </font>
</para>
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P7">
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P8">
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P17">Receiver's Signature</para>
<para style="terp_default_9">Receiver's Signature</para>
</td>
<td>
<para style="P17">
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P17">
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P17">Authorised Signatory</para>
<para style="terp_default_Right_9">Authorised Signatory</para>
</td>
</tr>
</blockTable>

View File

@ -40,5 +40,5 @@ report_sxw.report_sxw(
'report.voucher.cash_amount',
'account.voucher',
'addons/account_voucher/report/report_voucher_amount.rml',
parser=report_voucher_amount,header=False
parser=report_voucher_amount,header="external"
)

View File

@ -2,7 +2,7 @@
<document filename="test.pdf">
<template pageSize="(595.0,842.0)" title="Voucher Amount" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
<frame id="first" x1="28.0" y1="42.0" width="525" height="772"/>
</pageTemplate>
</template>
<stylesheet>
@ -10,9 +10,51 @@
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table1">
<blockTableStyle id="Table2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="4,0" stop="4,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="4,-1" stop="4,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="5,0" stop="5,-1"/>
<lineStyle kind="LINEAFTER" colorName="#b3b3b3" start="5,0" stop="5,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="5,0" stop="5,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="5,-1" stop="5,-1"/>
</blockTableStyle>
<blockTableStyle id="Table4">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="4,0" stop="4,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="4,-1" stop="4,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#b3b3b3" start="5,0" stop="5,-1"/>
<lineStyle kind="LINEAFTER" colorName="#b3b3b3" start="5,0" stop="5,-1"/>
<lineStyle kind="LINEABOVE" colorName="#b3b3b3" start="5,0" stop="5,0"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="5,-1" stop="5,-1"/>
</blockTableStyle>
<blockTableStyle id="Heading1">
<blockAlignment value="LEFT"/>
@ -23,21 +65,21 @@
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
</blockTableStyle>
<blockTableStyle id="voucher_lines">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table3">
<blockTableStyle id="Table1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="last_info">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,6" stop="0,6"/>
</blockTableStyle>
<blockTableStyle id="Table3">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<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,6" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,6" stop="1,6"/>
<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"/>
</blockTableStyle>
<blockTableStyle id="Table5">
@ -48,30 +90,11 @@
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT"/>
<paraStyle name="P2" fontName="Helvetica-Bold" fontSize="13.0" leading="16" alignment="CENTER"/>
<paraStyle name="P2" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P3" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P4" fontName="Helvetica-Bold" fontSize="22.0" leading="27" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P5" fontName="Helvetica" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P6" fontName="Helvetica" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P7" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P8" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P9" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P10" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P11" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P12" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P13" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P14" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P15" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P16" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P17" fontName="Helvetica-Bold" fontSize="13.0" leading="16" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P18" rightIndent="0.0" leftIndent="35.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P19" rightIndent="0.0" leftIndent="35.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P20" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P21" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P22" fontName="Helvetica" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P23" rightIndent="0.0" leftIndent="35.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P24" rightIndent="0.0" leftIndent="71.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P25" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P4" fontName="Helvetica" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P5" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P6" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Standard" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Text body" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
@ -79,7 +102,7 @@
<paraStyle name="Caption" fontName="Helvetica-Oblique" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT"/>
<paraStyle name="Table Contents" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Heading" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Heading" fontName="Helvetica" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
@ -126,98 +149,65 @@
<paraStyle name="Marginalia" rightIndent="0.0" leftIndent="113.0" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_9_30" rightIndent="0.0" leftIndent="9.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_9_50" rightIndent="0.0" leftIndent="14.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_9_50_italic" rightIndent="0.0" leftIndent="14.0" fontName="Helvetica-Oblique" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<images/>
</stylesheet>
<story>
<para style="P20">[[ repeatIn(objects,'voucher') ]]</para>
<para style="P4">[[ company.name ]]</para>
<para style="P6">[[ company.partner_id.address and company.partner_id.address[0].street ]]</para>
<para style="P6">[[ company.partner_id.address and company.partner_id.address[0].zip ]] [[ company.partner_id.address and company.partner_id.address[0].city ]] - [[ company.partner_id.address and company.partner_id.address[0].country_id and company.partner_id.address[0].country_id.name ]]</para>
<para style="P6">[[ company.partner_id.address and company.partner_id.address[0].phone ]]</para>
<para style="P6">[[ company.partner_id.address and company.partner_id.address[0].email ]]</para>
<para style="P5">
<font color="white"> </font>
</para>
<para style="P17">Cash Receipt Voucher [[ (voucher.type == 'rec_voucher' or removeParentNode('para')) and '' ]]</para>
<para style="P2">Cash Payment Voucher [[ (voucher.type == 'pay_voucher' or removeParentNode('para')) and '' ]]</para>
<para style="P17">Bank Receipt Voucher [[ (voucher.type == 'bank_rec_voucher' or removeParentNode('para')) and '' ]]</para>
<para style="P2">Bank Payment Voucher [[ (voucher.type == 'bank_pay_voucher' or removeParentNode('para')) and '' ]]</para>
<para style="P16">
<font color="white"> </font>
</para>
<blockTable colWidths="68.0,124.0,122.0,62.0,106.0" style="Table1">
<para style="P6">[[ repeatIn(objects,'voucher') ]]</para>
<blockTable colWidths="52.0,123.0,50.0,92.0,63.0,144.0" style="Table2">
<tr>
<td>
<para style="P10">No.</para>
<para style="terp_default_Bold_9">Type:</para>
</td>
<td>
<para style="P11">[[ voucher.number ]]</para>
<para style="terp_default_9">[[ voucher.journal_id.nme ]]</para>
</td>
<td>
<para style="P3">
<font color="white"> </font>
</para>
<para style="terp_default_Bold_9">Number:</para>
</td>
<td>
<para style="P10">Dated :</para>
<para style="terp_default_9">[[ voucher.number ]]</para>
</td>
<td>
<para style="P11">[[ formatLang(voucher.date, date=True) or '' ]]</para>
</td>
</tr>
<tr>
<td>
<para style="P10">State :</para>
<para style="terp_default_Bold_9">Date:</para>
</td>
<td>
<para style="P15">PRO-FORMA [[ ((voucher.state == 'proforma') or removeParentNode('para')) and '' ]]</para>
<para style="P15">Draft[[ ((voucher.state == 'draft') or removeParentNode('para')) and '' ]]</para>
<para style="P15">Canceled [[ ((voucher.state == 'cancel') or removeParentNode('para')) and '' ]]</para>
<para style="P15">Posted [[ ((voucher.state == 'posted') or removeParentNode('para')) and '' ]]</para>
</td>
<td>
<para style="P3">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P10">Ref. :</para>
</td>
<td>
<para style="P11">[[ voucher.reference ]]</para>
</td>
</tr>
<tr>
<td>
<para style="P10">Account :</para>
</td>
<td>
<para style="P15">[[ voucher.account_id.name ]]</para>
</td>
<td>
<para style="P3">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P10">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P11">
<font color="white"> </font>
</para>
<para style="terp_default_9">[[ formatLang(voucher.date , date=True) or '' ]]</para>
</td>
</tr>
</blockTable>
<para style="P12">
<blockTable colWidths="52.0,123.0,50.0,92.0,63.0,144.0" style="Table4">
<tr>
<td>
<para style="terp_default_Bold_9">State:</para>
</td>
<td>
<para style="P5">PRO-FORMA [[ ((voucher.state == 'proforma') or removeParentNode('para')) and '' ]]</para>
<para style="P5">Draft[[ ((voucher.state == 'draft') or removeParentNode('para')) and '' ]]</para>
<para style="P5">Canceled [[ ((voucher.state == 'cancel') or removeParentNode('para')) and '' ]]</para>
<para style="P5">Posted [[ ((voucher.state == 'posted') or removeParentNode('para')) and '' ]]</para>
</td>
<td>
<para style="terp_default_Bold_9">Ref:</para>
</td>
<td>
<para style="P2">[[ voucher.reference ]]</para>
</td>
<td>
<para style="terp_default_Bold_9">Account:</para>
</td>
<td>
<para style="terp_default_9">[[ voucher.account_id.name ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_9">
<font color="white"> </font>
</para>
<para style="P12">
<para style="terp_default_9">
<font color="white"> </font>
</para>
<blockTable colWidths="344.0,138.0" style="Heading1">
<blockTable colWidths="381.0,144.0" style="Heading1">
<tr>
<td>
<para style="terp_header">Particulars</para>
@ -227,190 +217,183 @@
</td>
</tr>
</blockTable>
<blockTable colWidths="482.0" style="voucher_lines">
<tr>
<td>
<para style="terp_default_1">
<font color="white"> </font>
</para>
<section>
<para style="terp_default_8">[[ repeatIn(voucher.line_ids,'line_ids') ]] </para>
<blockTable colWidths="342.0,135.0" style="Table3">
<tr>
<td>
<para style="terp_header">[[ line_ids.partner_id and line_ids.partner_id.name or '' ]] </para>
</td>
<td>
<para style="terp_header_Right">[[ line_ids.amount ]]</para>
</td>
</tr>
<tr>
<td>
<para style="terp_default_9_30">[[ line_ids.account_id.name ]] </para>
</td>
<td>
<para style="P22">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="terp_default_9_50">[[ line_ids.ref ]] [[ line_ids.amount ]] </para>
</td>
<td>
<para style="terp_default_9_50">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="terp_default_9_50">[[ line_ids.type ]]</para>
</td>
<td>
<para style="terp_default_9_50">
<font color="white"> </font>
</para>
</td>
</tr>
</blockTable>
<para style="terp_default_9">
<para style="terp_default_1">
<font color="white"> </font>
</para>
<section>
<para style="terp_default_8">[[ repeatIn(voucher.payment_ids,'payment_ids') ]] </para>
<blockTable colWidths="380.0,144.0" style="Table1">
<tr>
<td>
<para style="terp_default_Bold_9">[[ payment_ids.partner_id and payment_ids.partner_id.name or '' ]] </para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ payment_ids.amount ]]</para>
</td>
</tr>
<tr>
<td>
<para style="terp_default_9_30">[[ payment_ids.account_id.name ]] </para>
</td>
<td>
<para style="P4">
<font color="white"> </font>
</para>
</section>
<para style="terp_default_9">
</td>
</tr>
<tr>
<td>
<para style="terp_default_9_50_italic">[[ payment_ids.ref ]] [[ payment_ids.amount ]] </para>
</td>
<td>
<para style="terp_default_9_50">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="terp_default_9_50_italic">[[ payment_ids.type ]]</para>
</td>
<td>
<para style="terp_default_9_50">
<font color="white"> </font>
</para>
</td>
</tr>
</blockTable>
<para style="terp_default_1">
<font color="white"> </font>
</para>
</section>
<para style="terp_default_1">
<font color="white"> </font>
</para>
<blockTable colWidths="380.0,144.0" style="last_info">
<tr>
<td>
<para style="terp_default_Bold_9">Through : </para>
</td>
<td>
<para style="terp_default_Bold_9">
<font color="white"> </font>
</para>
<para style="P25">
</td>
</tr>
<tr>
<td>
<para style="terp_default_9_50_italic">[[ voucher.narration or '' ]] </para>
</td>
<td>
<para style="terp_default_9_50_italic">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="terp_default_Bold_9">On Account of : </para>
</td>
<td>
<para style="terp_default_Bold_9">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="terp_default_9">[[ voucher.name ]]</para>
</td>
<td>
<para style="terp_default_9_30">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="terp_default_Bold_9">Amount (in words) : </para>
</td>
<td>
<para style="terp_default_Bold_9">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="terp_default_9">[[ convert(voucher.amount,voucher.currency_id.name) ]]</para>
</td>
<td>
<para style="P3">
<font color="white"> </font>
</para>
</td>
</tr>
</blockTable>
<blockTable colWidths="344.0,138.0" style="last_info">
<para style="terp_default_1">
<font color="white"> </font>
</para>
<blockTable colWidths="380.0,144.0" style="Table3">
<tr>
<td>
<para style="P13">Through : </para>
</td>
<td>
<para style="P3">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P18">[[ voucher.narration or '' ]] </para>
</td>
<td>
<para style="P11">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P13">On Account of : </para>
</td>
<td>
<para style="P3">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P19">[[ voucher.name ]]</para>
</td>
<td>
<para style="P11">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P13">Amount (in words) : </para>
</td>
<td>
<para style="P13">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P19">[[ convert(voucher.amount,voucher.currency_id.name) ]]</para>
</td>
<td>
<para style="P12">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P12">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_header_Right">[[ voucher.amount ]]</para>
</td>
</tr>
</blockTable>
<para style="P14">
<para style="terp_default_1">
<font color="white"> </font>
</para>
<blockTable colWidths="142.0,99.0,105.0,136.0" style="Table5">
<blockTable colWidths="154.0,108.0,118.0,144.0" style="Table5">
<tr>
<td>
<para style="P7">
<para style="terp_default_9">
<font color="white"> </font>
</para>
<para style="P7">
<para style="terp_default_9">
<font color="white"> </font>
</para>
<para style="P7">
<font color="white"> </font>
</para>
<para style="P7">
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P7">
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P8">
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P9">
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P16">Receiver's Signature</para>
<para style="terp_default_9">Receiver's Signature</para>
</td>
<td>
<para style="P16">
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P16">
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P16">Authorised Signatory</para>
<para style="terp_default_Right_9">Authorised Signatory</para>
</td>
</tr>
</blockTable>

View File

@ -18,7 +18,7 @@
property_account_receivable: account.a_recv
-
Creat an invoice for the partner
Create an invoice for the partner
-
!record {model: account.invoice, id: account_invoice_0}:
account_id: account.a_recv
@ -72,6 +72,8 @@
'period_id': ref('account.period_8'),
'type': 'receipt',
}
if not res['value']['line_cr_ids']:
res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}]
res['value']['line_cr_ids'][0]['amount'] = 450.0
vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']]
id = self.create(cr, uid, vals)

View File

@ -57,6 +57,9 @@ class account_voucher(osv.osv):
journal_pool = self.pool.get('account.journal')
if context.get('journal_id', False):
return context.get('journal_id')
if not context.get('journal_id', False) and context.get('search_default_journal_id', False):
return context.get('search_default_journal_id')
ttype = context.get('type', 'bank')
res = journal_pool.search(cr, uid, [('type', '=', ttype)], limit=1)
return res and res[0] or False
@ -81,7 +84,7 @@ class account_voucher(osv.osv):
def _get_partner(self, cr, uid, context={}):
return context.get('partner_id', False)
_name = 'account.voucher'
_description = 'Accounting Voucher'
_order = "date desc, id desc"
@ -132,7 +135,7 @@ class account_voucher(osv.osv):
'tax_id':fields.many2one('account.tax', 'Tax', readonly=True, states={'draft':[('readonly',False)]}),
'pre_line':fields.boolean('Previous Payments ?', required=False),
'date_due': fields.date('Due Date'),
'term_id':fields.many2one('account.payment.term', 'Term', required=False),
# 'term_id':fields.many2one('account.payment.term', 'Term', required=False),
}
_defaults = {
'period_id': _get_period,
@ -243,7 +246,7 @@ class account_voucher(osv.osv):
})
return {'value':default}
def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id=False, price=0.0, ttype=False, context={}):
def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id=False, price=0.0, currency_id=False, ttype=False, context={}):
"""price
Returns a dict that contains new values and context
@ -255,6 +258,8 @@ class account_voucher(osv.osv):
"""
if not journal_id:
return {}
currency_pool = self.pool.get('res.currency')
move_pool = self.pool.get('account.move')
line_pool = self.pool.get('account.voucher.line')
move_line_pool = self.pool.get('account.move.line')
@ -280,10 +285,6 @@ class account_voucher(osv.osv):
if journal.type in ('sale','sale_refund'):
account_id = partner.property_account_receivable.id
elif journal.type in ('purchase', 'purchase_refund','expense'):
term_id = partner.property_payment_term.id
if term_id:
vals = self.onchange_term_id(cr, uid, ids, term_id, price)
default['value'].update(vals.get('value'))
account_id = partner.property_account_payable.id
else:
account_id = journal.default_credit_account_id.id or journal.default_debit_account_id.id
@ -294,22 +295,33 @@ class account_voucher(osv.osv):
if journal.type not in ('cash', 'bank'):
return default
total_credit = 0.0
total_debit = 0.0
account_type = 'receivable'
if ttype == 'payment':
account_type = 'payable'
total_debit = price or 0.0
else:
total_credit = price or 0.0
account_type = 'receivable'
ids = move_line_pool.search(cr, uid, [('account_id.type','=', account_type), ('reconcile_id','=', False), ('partner_id','=',partner_id)], context=context)
ids.reverse()
moves = move_line_pool.browse(cr, uid, ids)
total_credit = price or 0.0
total_debit = 0.0
company_currency = self.pool.get('res.users').browse(cr, uid, uid).company_id.currency_id.id
if company_currency != currency_id and ttype == 'payment':
total_debit = currency_pool.compute(cr, uid, currency_id, company_currency, total_debit)
elif company_currency != currency_id and ttype == 'receipt':
total_credit = currency_pool.compute(cr, uid, currency_id, company_currency, total_credit)
for line in moves:
if line.credit and line.reconcile_partial_id:
continue
total_credit += line.credit or 0.0
total_debit += line.debit or 0.0
for line in moves:
if line.credit and line.reconcile_partial_id:
continue
@ -324,11 +336,13 @@ class account_voucher(osv.osv):
'amount_unreconciled': line.amount_unreconciled
}
if line.credit:
rs['amount'] = min(line.amount_unreconciled, total_debit)
total_debit -= rs['amount']
amount = min(line.amount_unreconciled, total_debit)
rs['amount'] = currency_pool.compute(cr, uid, company_currency, currency_id, amount)
total_debit -= amount
else:
rs['amount'] = min(line.debit, total_credit)
total_credit -= rs['amount']
amount = min(line.amount_unreconciled, total_credit)
rs['amount'] = currency_pool.compute(cr, uid, company_currency, currency_id, amount)
total_credit -= amount
default['value']['line_ids'].append(rs)
if rs['type'] == 'cr':
@ -361,7 +375,16 @@ class account_voucher(osv.osv):
}
def onchange_journal(self, cr, uid, ids, journal_id):
return {}
if not journal_id:
return False
journal_pool = self.pool.get('account.journal')
journal = journal_pool.browse(cr, uid, journal_id)
account_id = journal.default_credit_account_id or journal.default_debit_account_id
tax_id = False
if account_id and account_id.tax_ids:
tax_id = account_id.tax_ids[0].id
return {'value':{'tax_id':tax_id}}
def proforma_voucher(self, cr, uid, ids):
self.action_move_line_create(cr, uid, ids)
@ -375,9 +398,20 @@ class account_voucher(osv.osv):
return True
def cancel_voucher(self, cr, uid, ids, context={}):
reconcile_pool = self.pool.get('account.move.reconcile')
move_pool = self.pool.get('account.move')
voucher_line_pool = self.pool.get('account.voucher.line')
for voucher in self.browse(cr, uid, ids):
recs = []
for line in voucher.move_ids:
if line.reconcile_id:
recs += [line.reconcile_id.id]
if line.reconcile_partial_id:
recs += [line.reconcile_partial_id.id]
reconcile_pool.unlink(cr, uid, recs)
if voucher.move_id:
move_pool.button_cancel(cr, uid, [voucher.move_id.id])
move_pool.unlink(cr, uid, [voucher.move_id.id])
@ -396,23 +430,23 @@ class account_voucher(osv.osv):
# TODO
def onchange_payment(self, cr, uid, ids, pay_now, journal_id, partner_id, ttype='sale'):
res = {}
if not partner_id:
return {}
partner_pool = self.pool.get('res.partner')
return res
res = {'account_id':False}
partner_pool = self.pool.get('res.partner')
journal_pool = self.pool.get('account.journal')
if pay_now == 'pay_later':
partner = partner_pool.browse(cr, uid, partner_id)
if ttype == 'sale':
res.update({
'account_id':partner.property_account_receivable.id,
})
elif ttype == 'purchase':
res.update({
'account_id':partner.property_account_payable.id,
})
return {
'value':res
}
journal = journal_pool.browse(cr, uid, journal_id)
if journal.type in ('sale','sale_refund'):
account_id = partner.property_account_receivable.id
elif journal.type in ('purchase', 'purchase_refund','expense'):
account_id = partner.property_account_payable.id
else:
account_id = journal.default_credit_account_id.id or journal.default_debit_account_id.id
res['account_id'] = account_id
return {'value':res}
def action_move_line_create(self, cr, uid, ids, *args):
@ -466,54 +500,47 @@ class account_voucher(osv.osv):
if credit < 0:
debit = -credit
credit = 0.0
if inv.type == 'purchase' and inv.term_id and _get_payment_term_lines(inv.term_id.id, credit or debit):
terms = _get_payment_term_lines(inv.term_id.id, credit or debit)
for term in terms:
due_date = term[0]
amount = term[1]
move_line = {
'name':inv.name or '/',
'debit':0.0,
'credit':amount,
'date_maturity':due_date,
'account_id':inv.account_id.id,
'move_id':move_id ,
'journal_id':inv.journal_id.id,
'period_id':inv.period_id.id,
'partner_id':inv.partner_id.id,
'currency_id':inv.currency_id.id,
'date':inv.date
}
master_line = move_line_pool.create(cr, uid, move_line)
else:
move_line = {
'name':inv.name or '/',
'debit':debit,
'credit':credit,
'account_id':inv.account_id.id,
'move_id':move_id ,
'journal_id':inv.journal_id.id,
'period_id':inv.period_id.id,
'partner_id':inv.partner_id.id,
'currency_id':inv.currency_id.id,
'date':inv.date
}
master_line = move_line_pool.create(cr, uid, move_line)
move_line = {
'name':inv.name or '/',
'debit':debit,
'credit':credit,
'account_id':inv.account_id.id,
'move_id':move_id ,
'journal_id':inv.journal_id.id,
'period_id':inv.period_id.id,
'partner_id':inv.partner_id.id,
'currency_id':inv.currency_id.id,
'date':inv.date,
'date_maturity':inv.date_due
}
master_line = move_line_pool.create(cr, uid, move_line)
rec_list_ids = []
line_total = debit - credit
if inv.type == 'sale':
line_total = line_total - inv.tax_amount
elif inv.type == 'purchase':
line_total = line_total + inv.tax_amount
for line in inv.line_ids:
if not line.amount:
continue
amount = currency_pool.compute(cr, uid, inv.currency_id.id, company_currency, line.amount)
move_line = {
'journal_id':inv.journal_id.id,
'period_id':inv.period_id.id,
'name':line.name and line.name or '/',
'account_id':line.account_id.id,
'move_id':move_id,
'partner_id':inv.partner_id.id,
'currency_id':inv.currency_id.id,
'analytic_account_id':line.account_analytic_id and line.account_analytic_id.id or False,
'quantity':1
'quantity':1,
'credit':0.0,
'debit':0.0,
'date':inv.date
}
if amount < 0:
amount = -amount
@ -521,7 +548,7 @@ class account_voucher(osv.osv):
line.type = 'cr'
else:
line.type = 'dr'
if (line.type=='dr'):
line_total += amount
move_line['debit'] = amount
@ -529,43 +556,16 @@ class account_voucher(osv.osv):
line_total -= amount
move_line['credit'] = amount
if inv.tax_id:
move_line.update({
'account_tax_id':inv.tax_id.id,
})
master_line = move_line_pool.create(cr, uid, move_line)
if line.move_line_id.id:
rec_ids = [master_line, line.move_line_id.id]
rec_list_ids.append(rec_ids)
if inv.tax_amount:
amount = currency_pool.compute(cr, uid, inv.currency_id.id, company_currency, inv.tax_amount)
name = inv.tax_id and inv.tax_id.name or '/'
move_line = {
'name':name,
'move_id':move_id ,
'journal_id':inv.journal_id.id,
'period_id':inv.period_id.id,
'partner_id':inv.partner_id.id,
'currency_id':inv.currency_id.id,
}
if inv.journal_id.type in ('sale','purchase_refund') and amount > 0:
line_total -= amount
move_line['credit'] = amount
else:
if amount < 0:
amount = -amount
line_total += amount
move_line['debit'] = amount
account_id = False
if inv.tax_id:
if inv.journal_id.type in ('sale_refund','purchase_refund'):
account_id = inv.tax_id.account_paid_id
else:
account_id = inv.tax_id.account_collected_id.id
if not account_id:
raise osv.except_osv(_('Invalid Error !'), _('No account defined on the related tax !'))
move_line['account_id'] = account_id
move_line_id = move_line_pool.create(cr, uid, move_line)
if not self.pool.get('res.currency').is_zero(cr, uid, inv.currency_id, line_total):
diff = line_total
move_line = {
@ -637,7 +637,17 @@ class account_voucher(osv.osv):
#Restrict the list of journal view in search view
if view_type == 'search':
journal_list = journal_pool.name_search(cr, uid, '', [], context=context)
type_search = {
'bank':[('type','in',['bank','cash'])],
'cash':[('type','in',['bank','cash'])],
'sale':[('type','in',['sale','purchase_refund'])],
'purchase':[('type','in',['purchase','sale_refund'])],
'expense':[('type','in',['purchase'])],
'sale_refund':[('type','in',['sale','purchase_refund'])],
'purchase_refund':[('type','in',['purchase','sale_refund'])]
}
domain = type_search.get(context.get('journal_type'))
journal_list = journal_pool.name_search(cr, uid, '', domain)
res['fields']['journal_id']['selection'] = journal_list
return res
@ -673,7 +683,7 @@ class account_voucher_line(osv.osv):
'date_original': fields.related('move_line_id','date', type='date', relation='account.move.line', string='Date', readonly=1),
'date_due': fields.related('move_line_id','date_maturity', type='date', relation='account.move.line', string='Due Date', readonly=1),
'amount_original': fields.function(_compute_balance, method=True, type='float', string='Originial Amount', store=True),
'amount_unreconciled': fields.related('move_line_id','amount_unreconciled', type='float', relation='account.move.line', string='Open Balance', readonly="1"),
'amount_unreconciled': fields.related('move_line_id','amount_unreconciled', type='float', relation='account.move.line', string='Open Balance', store=True, readonly="1"),
}
_defaults = {
'name': lambda *a: ''

View File

@ -8,13 +8,13 @@
<field name="arch" type="xml">
<form string="Bill Payment">
<group col="6" colspan="4">
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, type)" string="Vendor"/>
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type)" context="{'invoice_currency':currency_id}" string="Vendor"/>
<field name="journal_id"
domain="[('type','in',['bank', 'cash'])]"
widget="selection" select="1"
on_change="onchange_partner_id(partner_id, journal_id, amount)"
on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type)"
string="Payment Method"/>
<field name="amount"/>
<field name="amount" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type)"/>
<field name="reference" select="1" string="Payment Ref"/>
<field name="name" colspan="4"/>
<field name="account_id"
@ -27,7 +27,7 @@
</group>
<notebook colspan="4">
<page string="Payment Information">
<field name="line_dr_ids" on_change="onchange_price(line_dr_ids, False, False)" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140">
<field name="line_dr_ids" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140">
<tree string="Payment Lines" editable="bottom">
<field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
on_change="onchange_move_line_id(move_line_id)"
@ -77,9 +77,9 @@
<group col="10" colspan="4">
<field name="state"/>
<button name="cancel_voucher" string="Cancel" states="draft,proforma" icon="gtk-cancel"/>
<button name="cancel_voucher" string="Unreconcile" type="object" states="posted" icon="terp-stock_effects-object-colorize" confirm="Are you sure to unreconcile this record ?"/>
<button name="proforma_voucher" string="Post" states="draft" icon="terp-camera_test"/>
<button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
<button name="%(action_view_account_voucher_unreconcile)d" string="Unreconcile" type="action" states="posted" icon="terp-stock_effects-object-colorize"/>
</group>
</form>
</field>
@ -104,14 +104,14 @@
<field name="arch" type="xml">
<form string="Sales Payment">
<group col="6" colspan="4">
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, type)" string="Customer"/>
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type)" string="Customer"/>
<field name="journal_id"
domain="[('type','in',['bank', 'cash'])]"
widget="selection" select="1"
on_change="onchange_partner_id(partner_id, journal_id, amount, type)"
on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type)"
string="Payment Method"/>
<field name="amount"
on_change="onchange_partner_id(partner_id, journal_id, amount, type)"/>
on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type)"/>
<field name="reference" select="1" string="Payment Ref"/>
<field name="name" colspan="4"/>
<field name="account_id"
@ -171,9 +171,9 @@
<group col="10" colspan="4">
<field name="state"/>
<button name="cancel_voucher" string="Cancel" states="draft,proforma" icon="gtk-cancel"/>
<button name="cancel_voucher" string="Unreconcile" type="object" states="posted" icon="terp-stock_effects-object-colorize" confirm="Are you sure to unreconcile this record ?"/>
<button name="proforma_voucher" string="Post" states="draft" icon="terp-camera_test"/>
<button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
<button name="%(action_view_account_voucher_unreconcile)d" string="Unreconcile" type="action" states="posted" icon="terp-stock_effects-object-colorize"/>
</group>
</form>
</field>

View File

@ -4,11 +4,11 @@
<record id="act_pay_voucher" model="ir.actions.act_window">
<field name="name">Sales Payment</field>
<field name="res_model">account.voucher.open</field>
<field name="res_model">account.voucher</field>
<field name="view_type">form</field>
<field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','receipt'), ('partner_id','=',partner_id)]</field>
<field name="context">{'journal_type':'bank', 'type':'receipt', 'partner_id': partner_id}</field>
<field name="view_id" ref="account_open_vouchers_view"/>
<field name="view_id" ref="view_vendor_receipt_form"/>
<field name="target">new</field>
</record>
<record model="ir.ui.view" id="view_sale_receipt_form">
@ -45,7 +45,7 @@
<field name="pay_now" on_change="onchange_payment(pay_now, journal_id, partner_id)" required="1"/>
<field name="account_id"
attrs="{'invisible':[('pay_now','!=','pay_now')]}"
domain="[('user_type.report_type','=','asset'), ('type','=','other')]"/>
domain="[('type','=','liquidity')]"/>
<!-- should select income accounts only. Or use the journal for this ? -->
<field name="reference"
attrs="{'invisible':[('pay_now','!=','pay_now')]}"
@ -71,10 +71,10 @@
<group col="10" colspan="4">
<field name="state"/>
<button name="cancel_voucher" string="Cancel" states="draft,proforma" icon="gtk-cancel"/>
<button name="cancel_voucher" string="Cancel" type="object" states="posted" icon="terp-stock_effects-object-colorize" confirm="Are you sure to confirm this record ?"/>
<button name="proforma_voucher" string="Post" states="draft" icon="terp-camera_test"/>
<button icon="terp-dolar_ok!" name="%(act_pay_voucher)d" context="{'title':'Sales Payment', 'journal_type':'bank', 'type':'receipt', 'partner_id': partner_id}" type="action" string="Pay" attrs="{'invisible':[('pay_now','!=','pay_now'),('state','!=','posted')]}"/>
<button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
<button name="%(action_view_account_voucher_unreconcile)d" string="Cancel" type="action" states="posted" icon="terp-stock_effects-object-colorize"/>
</group>
</form>
</field>
@ -94,6 +94,15 @@
action="action_sale_receipt" parent="account.menu_finance_receivables" sequence="10"/>
<!-- Purchase Vouchers -->
<record id="act_pay_bills" model="ir.actions.act_window">
<field name="name">Bill Payment</field>
<field name="res_model">account.voucher</field>
<field name="view_type">form</field>
<field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','payment'), ('partner_id','=',partner_id)]</field>
<field name="context">{'journal_type':'bank', 'type':'payment', 'partner_id': partner_id}</field>
<field name="view_id" ref="view_vendor_payment_form"/>
<field name="target">new</field>
</record>
<record model="ir.ui.view" id="view_purchase_receipt_form">
<field name="name">account.voucher.purchase.form</field>
<field name="model">account.voucher</field>
@ -126,7 +135,6 @@
<group col="2" colspan="1">
<group col="2" colspan="1">
<separator string="Payment Terms" colspan="2"/>
<field name="term_id" widget="selection" on_change="onchange_term_id(term_id, amount)"/>
<field name="date" string="Bill Date" select="1" on_change="onchange_date(date)"/>
<field name="date_due"/>
<field name="amount" required="0" string="Amount Due"/>
@ -151,9 +159,10 @@
<group col="10" colspan="4">
<field name="state"/>
<button name="cancel_voucher" string="Cancel" states="draft,proforma" icon="gtk-cancel"/>
<button name="cancel_voucher" string="Cancel" type="object" states="posted" icon="terp-stock_effects-object-colorize" confirm="Are you sure to confirm this record ?"/>
<button name="proforma_voucher" string="Post" states="draft" icon="terp-camera_test"/>
<button icon="terp-dolar_ok!" name="%(act_pay_bills)d" context="{'title':'Bill Payment', 'journal_type':'bank', 'type':'payment', 'partner_id': partner_id}" type="action" string="Pay Bill" attrs="{'invisible':[('state','!=','posted')]}"/>
<button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
<button name="%(action_view_account_voucher_unreconcile)d" string="Cancel" type="action" states="posted" icon="terp-stock_effects-object-colorize"/>
</group>
</form>
</field>

View File

@ -13,6 +13,7 @@
<field name="partner_id"/>
<field name="journal_id"/>
<field name="period_id" groups="base.group_extended" invisible="context.get('visible', True)"/>
<field name="type" invisible="context.get('visible', True)"/>
<field name="amount" sum="Total Amount"/>
<field name="state"/>
<button name="proforma_voucher" string="Post" states="draft" icon="terp-document-new"/>
@ -27,10 +28,10 @@
<field name="arch" type="xml">
<form string="Accounting Voucher">
<group col="6" colspan="4">
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id)"/>
<field name="name" colspan="4"/>
<field name="type" on_change="onchange_partner_id(partner_id, journal_id)"/>
<field name="reference" select="1"/>
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id)"/>
<field name="type" on_change="onchange_partner_id(partner_id, journal_id)"/>
<field name="journal_id" widget="selection" select="1" on_change="onchange_partner_id(partner_id, journal_id)"/>
<field name="account_id" widget="selection" invisible="True"/>
</group>
@ -138,8 +139,8 @@
</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" context="{'journal_id': self, 'set_visible':False}" />
<field name="period_id" groups="base.group_extended"/>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="12" col="10">

View File

@ -136,7 +136,7 @@ class account_voucher_open(osv.osv_memory):
'view_mode': 'tree,graph,form',
'res_model': 'account.voucher',
'view_id': False,
'context': "{'journal_id': %d, 'search_default_journal_id':%d, 'search_default_period_id':%d, 'partner_id':%s}" % (journal_id, journal_id, period_id, context.get('partner_id',False)),
'context': "{'search_default_journal_id':%d, 'search_default_period_id':%d, 'partner_id':%s}" % (journal_id, period_id, context.get('partner_id',False)),
'type': 'ir.actions.act_window',
'search_view_id': res_id
}

View File

@ -173,22 +173,12 @@ class account_analytic_account(osv.osv):
res = self.name_get(cr, uid, ids)
return dict(res)
def _get_company_currency(self, cr, uid, ids, field_name, arg, context=None):
result = {}
for rec in self.browse(cr, uid, ids, context):
result[rec.id] = (rec.company_id.currency_id.id,rec.company_id.currency_id.code) or False
return result
def _get_account_currency(self, cr, uid, ids, field_name, arg, context=None):
result=self._get_company_currency(cr, uid, ids, field_name, arg, context={})
return result
_columns = {
'name' : fields.char('Account Name', size=128, required=True),
'complete_name': fields.function(_complete_name_calc, method=True, type='char', string='Full Account Name'),
'code' : fields.char('Account Code', size=24),
'type': fields.selection([('view','View'), ('normal','Normal')], 'Account Type'),
'description' : fields.text('Description'),
'code': fields.char('Account Code', size=24),
'type': fields.selection([('view','View'), ('normal','Normal')], 'Account Type', help='If you select the View Type, it means you won\'t allow to create journal entries using that account.'),
'description': fields.text('Description'),
'parent_id': fields.many2one('account.analytic.account', 'Parent Analytic Account', select=2),
'child_ids': fields.one2many('account.analytic.account', 'parent_id', 'Child Accounts'),
'line_ids': fields.one2many('account.analytic.line', 'account_id', 'Analytic Entries'),
@ -203,7 +193,6 @@ class account_analytic_account(osv.osv):
'date_start': fields.date('Date Start'),
'date': fields.date('Date End'),
'company_id': fields.many2one('res.company', 'Company', required=True),
'company_currency_id': fields.function(_get_company_currency, method=True, type='many2one', relation='res.currency', string='Currency'),
'state': fields.selection([('draft','Draft'),('open','Open'), ('pending','Pending'),('cancelled', 'Cancelled'),('close','Closed'),('template', 'Template')], 'State', required=True,
help='* When an account is created its in \'Draft\' state.\
\n* If any associated partner is there, it can be in \'Open\' state.\
@ -211,7 +200,7 @@ class account_analytic_account(osv.osv):
\n* And finally when all the transactions are over, it can be in \'Close\' state. \
\n* The project can be in either if the states \'Template\' and \'Running\'.\n If it is template then we can make projects based on the template projects. If its in \'Running\' state it is a normal project.\
\n If it is to be reviewed then the state is \'Pending\'.\n When the project is completed the state is set to \'Done\'.'),
'currency_id': fields.function(_get_account_currency, method=True, type='many2one', relation='res.currency', string='Account currency', store=True),
'currency_id': fields.related('company_id', 'currency_id', type='many2one', relation='res.currency', string='Account currency', store=True, readonly=True),
}
def _default_company(self, cr, uid, context=None):
@ -233,17 +222,11 @@ class account_analytic_account(osv.osv):
def check_recursion(self, cr, uid, ids, parent=None):
return super(account_analytic_account, self).check_recursion(cr, uid, ids, parent=parent)
_order = 'parent_id desc,code'
_order = 'date_start desc,parent_id desc,code'
_constraints = [
(check_recursion, 'Error! You can not create recursive analytic accounts.', ['parent_id'])
]
def create(self, cr, uid, vals, context=None):
parent_id = vals.get('parent_id', 0)
if ('code' not in vals or not vals['code']) and not parent_id:
vals['code'] = self.pool.get('ir.sequence').get(cr, uid, 'account.analytic.account')
return super(account_analytic_account, self).create(cr, uid, vals, context=context)
def copy(self, cr, uid, id, default=None, context=None):
if not default:
default = {}
@ -286,59 +269,15 @@ account_analytic_account()
class account_analytic_line(osv.osv):
_name = 'account.analytic.line'
_description = 'Analytic Line'
def _amount_currency(self, cr, uid, ids, field_name, arg, context=None):
result = {}
for rec in self.browse(cr, uid, ids, context=context):
cmp_cur_id=rec.company_id.currency_id.id
aa_cur_id=rec.account_id.currency_id.id
# Always provide the amount in currency
if cmp_cur_id != aa_cur_id:
cur_obj = self.pool.get('res.currency')
ctx = {}
if rec.date and rec.amount:
ctx['date'] = rec.date
result[rec.id] = cur_obj.compute(cr, uid, rec.company_id.currency_id.id,
rec.account_id.currency_id.id, rec.amount,
context=ctx)
else:
result[rec.id]=rec.amount
return result
def _get_account_currency(self, cr, uid, ids, field_name, arg, context=None):
result = {}
for rec in self.browse(cr, uid, ids, context):
# Always provide second currency
result[rec.id] = (rec.account_id.currency_id.id,rec.account_id.currency_id.code)
return result
def _get_account_line(self, cr, uid, ids, context=None):
aac_ids = {}
for acc in self.pool.get('account.analytic.account').browse(cr, uid, ids):
aac_ids[acc.id] = True
aal_ids = []
if aac_ids:
aal_ids = self.pool.get('account.analytic.line').search(cr, uid, [('account_id','in',aac_ids.keys())], context=context)
return aal_ids
_columns = {
'name' : fields.char('Description', size=256, required=True),
'date' : fields.date('Date', required=True, select=1),
'amount' : fields.float('Amount', required=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price.'),
'amount' : fields.float('Amount', required=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price. Always expressed in the company main currency.'),
'unit_amount' : fields.float('Quantity', help='Specifies the amount of quantity to count.'),
'account_id' : fields.many2one('account.analytic.account', 'Analytic Account', required=True, ondelete='cascade', select=True),
'user_id' : fields.many2one('res.users', 'User',),
'company_id': fields.many2one('res.company','Company',required=True),
'currency_id': fields.function(_get_account_currency, method=True, type='many2one', relation='res.currency', string='Account currency',
store={
'account.analytic.account': (_get_account_line, ['company_id'], 50),
'account.analytic.line': (lambda self, cr, uid, ids, c={}: ids, ['amount','unit_amount'],10),
},
help="The related account currency if not equal to the company one."),
'amount_currency': fields.function(_amount_currency, method=True, digits_compute= dp.get_precision('Account'), string='Amount currency',
store={
'account.analytic.account': (_get_account_line, ['company_id'], 50),
'account.analytic.line': (lambda self, cr, uid, ids, c={}: ids, ['amount','unit_amount'],10),
},
help="The amount expressed in the related account currency if not equal to the company one."),
'user_id' : fields.many2one('res.users', 'User'),
'company_id': fields.related('account_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
}
_defaults = {
@ -350,4 +289,4 @@ class account_analytic_line(osv.osv):
account_analytic_line()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -2,18 +2,14 @@
<openerp><data>
<record id="analytic_comp_rule" model="ir.rule">
<field name="name">analytic company rule</field>
<field name="name">Analytic multi company rule</field>
<field model="ir.model" name="model_id" ref="model_account_analytic_account"/>
<field eval="True" name="global"/>
<field name="domain_force">[('company_id','=',user.company_id.id)]</field>
</record>
<record id="group_analytic_user" model="res.groups">
<field name="name">Analytic Accounting / User</field>
</record>
<record id="group_analytic_manager" model="res.groups">
<field name="name">Analytic Accounting / Manager</field>
<record id="group_analytic_accounting" model="res.groups">
<field name="name">Analytic Accounting</field>
</record>
</data></openerp>

View File

@ -1,5 +1,8 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_account_analytic_account_manager","account.analytic.account manager","model_account_analytic_account","analytic.group_analytic_manager",1,1,1,1
"access_account_analytic_line_manager","account.analytic.line manager","model_account_analytic_line","analytic.group_analytic_manager",1,1,1,1
"access_account_analytic_account_user","account.analytic.account user","model_account_analytic_account","analytic.group_analytic_user",1,0,0,0
"access_account_analytic_line_user","account.analytic.line user","model_account_analytic_line","analytic.group_analytic_user",1,0,0,0
"access_account_analytic_line_analytic_accounting","account.analytic.line","analytic.model_account_analytic_line","analytic.group_analytic_accounting",1,1,1,1
"access_account_analytic_account_analytic_accounting","account.analytic.account","analytic.model_account_analytic_account","analytic.group_analytic_accounting",1,1,1,1
"access_account_analytic_journal_analytic_accounting","account.analytic.journal","account.model_account_analytic_journal","analytic.group_analytic_accounting",1,1,1,1
"access_account_account_analytic_accounting","account.account","account.model_account_account","analytic.group_analytic_accounting",1,0,0,0
"access_product_template_analytic_accounting","product.template","product.model_product_template","analytic.group_analytic_accounting",1,0,0,0
"access_product_product_analytic_accounting","product.product","product.model_product_product","analytic.group_analytic_accounting",1,0,0,0
"access_product_category_analytic_accounting","product.category","product.model_product_category","analytic.group_analytic_accounting",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_account_analytic_account_manager access_account_analytic_line_analytic_accounting account.analytic.account manager account.analytic.line model_account_analytic_account analytic.model_account_analytic_line analytic.group_analytic_manager analytic.group_analytic_accounting 1 1 1 1
3 access_account_analytic_line_manager access_account_analytic_account_analytic_accounting account.analytic.line manager account.analytic.account model_account_analytic_line analytic.model_account_analytic_account analytic.group_analytic_manager analytic.group_analytic_accounting 1 1 1 1
4 access_account_analytic_account_user access_account_analytic_journal_analytic_accounting account.analytic.account user account.analytic.journal model_account_analytic_account account.model_account_analytic_journal analytic.group_analytic_user analytic.group_analytic_accounting 1 0 1 0 1 0 1
5 access_account_analytic_line_user access_account_account_analytic_accounting account.analytic.line user account.account model_account_analytic_line account.model_account_account analytic.group_analytic_user analytic.group_analytic_accounting 1 0 0 0
6 access_product_template_analytic_accounting product.template product.model_product_template analytic.group_analytic_accounting 1 0 0 0
7 access_product_product_analytic_accounting product.product product.model_product_product analytic.group_analytic_accounting 1 0 0 0
8 access_product_category_analytic_accounting product.category product.model_product_category analytic.group_analytic_accounting 1 0 0 0

View File

@ -369,14 +369,14 @@
</field>
</record>
<record id="view_partners_form_crm2" model="ir.ui.view">
<record id="view_partners_tree_crm2" model="ir.ui.view">
<field name="name">view.res.partner.tree.crm.inherited2</field>
<field name="model">res.partner</field>
<field name="type">tree</field>
<field name="inherit_id" ref="base.view_partner_tree"/>
<field eval="18" name="priority"/>
<field name="arch" type="xml">
<field name="lang" position="after">
<field name="country" position="after">
<field name="section_id" completion="1" widget="selection"
groups="base.group_extended"/>
</field>

View File

@ -2,5 +2,42 @@
<openerp>
<data>
<record id="view_applicants_status_tree" model="ir.ui.view">
<field name="name">applicants.status.tree</field>
<field name="model">hr.applicant</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree colors="blue:state in ('draft');black:state in ('open','pending','done','cancel');" string="Applicants Status">
<field name="create_date"/>
<field name="job_id"/>
<field name="partner_name"/>
<field name="stage_id"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="action_applicants_status" model="ir.actions.act_window">
<field name="name">Applicants Status</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr.applicant</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','in',('draft','open'))]</field>
<field name="view_id" ref="view_applicants_status_tree"/>
</record>
<record id="board_hr_applicants_status_form" model="ir.ui.view">
<field name="name">board.hr.applicants.status.form</field>
<field name="model">board.board</field>
<field name="inherit_id" ref="hr.board_hr_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
<xpath expr="/form/hpaned/child2" position="inside">
<action colspan="4" height="220" name="%(action_applicants_status)d" string="Applicants Status"/>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@ -28,13 +28,50 @@
<record id="board_hr_timesheet_invoice_report_form1" model="ir.ui.view">
<field name="name">board.hr.timesheet.invoice</field>
<field name="model">board.board</field>
<field name="type">form</field>
<field name="type">form</field>
<field name="inherit_id" ref="account.board_account_form"/>
<field name="arch" type="xml">
<xpath expr="/form/hpaned/child2/action[@string='Aged income']" position="after">
<action colspan="4" height="220" name="%(action_account_analytic_line_to_invoice)d" string="Costs to invoice"/>
<xpath expr="/form/hpaned/child2/action[@string='Aged income']" position="after">
<action colspan="4" height="220" name="%(action_account_analytic_line_to_invoice)d" string="Costs to invoice"/>
</xpath>
</field>
</record>
<record id="view_timesheet_uninvoiced_line_tree" model="ir.ui.view">
<field name="name">timesheet.uninvoiced.line.tree</field>
<field name="model">report.timesheet.line</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Uninvoiced line with billing rate">
<field name="date"/>
<field name="account_id"/>
<field name="user_id" />
<field name="name"/>
<field name="cost"/>
</tree>
</field>
</record>
<record id="action_timesheet_uninvoiced_line" model="ir.actions.act_window">
<field name="name">Uninvoice lines with billing rate</field>
<field name="res_model">report.timesheet.line</field>
<field name="view_type">form</field>
<field name="view_mode">form,tree</field>
<field name="domain">[('invoice_id','=',False)]</field>
<field name="view_id" ref="view_timesheet_uninvoiced_line_tree"/>
</record>
<record id="board_hr_timesheet_uninvoiced_form" model="ir.ui.view">
<field name="name">board.hr.timesheet.uninvoiced.form</field>
<field name="model">board.board</field>
<field name="type">form</field>
<field name="inherit_id" ref="hr.board_hr_form"/>
<field name="arch" type="xml">
<xpath expr="/form/hpaned/child1" position="inside">
<action colspan="4" height="220" name="%(action_timesheet_uninvoiced_line)d" string="Uninvoice lines with billing rate" />
</xpath>
</field>
</record>
</data>
</openerp>

View File

@ -109,11 +109,6 @@
</record>
<!-- Menus -->
<menuitem
parent="account.menu_finance_periodical_processing"
id="menu_finance_periodical_processing_billing"
name="Billing"/>
<record id="action_hr_analytic_timesheet_open_tree" model="ir.actions.act_window">
<field name="name">Entries to invoice</field>
<field name="res_model">account.analytic.line</field>
@ -126,7 +121,8 @@
<menuitem
action="action_hr_analytic_timesheet_open_tree"
id="menu_hr_analytic_timesheet_tree"
parent="menu_finance_periodical_processing_billing"/>
parent="account.menu_finance_periodical_processing_billing"
sequence="1"/>
<record id="action_hr_analytic_timesheet_tree_invoiced" model="ir.actions.act_window">
<field name="name">Uninvoiced Entries</field>

View File

@ -11,3 +11,4 @@
"access_report_random_timesheet_lines","random_timesheet_lines","model_random_timesheet_lines","base.group_hr_manager",1,0,0,0
"access_report_analytic_account_close_system","report.analytic.account.close system","model_report_analytic_account_close","base.group_system",1,1,1,1
"access_report_account_analytic_line_to_invoice_system","report.account.analytic.line.to.invoice system","model_report_account_analytic_line_to_invoice","base.group_system",1,1,1,1
"access_report_timesheet_line","report.timesheet.line","model_report_timesheet_line","base.group_hr_manager",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
11 access_report_random_timesheet_lines random_timesheet_lines model_random_timesheet_lines base.group_hr_manager 1 0 0 0
12 access_report_analytic_account_close_system report.analytic.account.close system model_report_analytic_account_close base.group_system 1 1 1 1
13 access_report_account_analytic_line_to_invoice_system report.account.analytic.line.to.invoice system model_report_account_analytic_line_to_invoice base.group_system 1 1 1 1
14 access_report_timesheet_line report.timesheet.line model_report_timesheet_line base.group_hr_manager 1 0 0 0

View File

@ -2,12 +2,13 @@
<openerp>
<data>
<menuitem id="base.menu_hr_dasboard" name="Dashboard" parent="hr.menu_hr_reporting" sequence="0" groups="base.group_system,base.group_hr_manager,base.group_hr_user"/>
<menuitem
<menuitem
action="hr.open_board_hr"
icon="terp-graph"
id="base.menu_hr_project"
parent="base.menu_hr_dasboard"
sequence="4"/>
<record id="action_timesheet_report_all" model="ir.actions.act_window">
<field name="name">Timesheets by Month</field>
<field name="type">ir.actions.act_window</field>
@ -16,9 +17,9 @@
<field name="view_mode">graph,tree</field>
<field name="domain">[('user_id','=',uid), ('month', '=' , time.strftime('%m')), ('year', '=', time.strftime('%Y'))]</field>
<field name="view_id" ref="hr_timesheet_sheet.view_timesheet_report_graph"/>
</record>
</record>
<record id="action_hr_timesheet_sheet_graph" model="ir.actions.act_window">
<record id="action_hr_timesheet_sheet_graph" model="ir.actions.act_window">
<field name="name">Timesheets</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr_timesheet_sheet.sheet</field>
@ -27,17 +28,39 @@
<field name="view_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_graph"/>
</record>
<record id="view_employee_attendance_graph" model="ir.ui.view">
<field name="name">Employee Attendance Graph</field>
<field name="model">timesheet.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Employee Attendances" type="bar">
<field name="user_id" />
<field name="total_attendance" operator="+"/>
<field name="total_timesheet" operator="+"/>
</graph>
</field>
</record>
<record id="action_employee_attendance_graph" model="ir.actions.act_window">
<field name="name">Employee Attendance Graph</field>
<field name="res_model">timesheet.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph</field>
<field name="view_id" ref="view_employee_attendance_graph"/>
</record>
<record id="board_hr_timesheet_form" model="ir.ui.view">
<field name="name">board.hr.timesheet.form</field>
<field name="model">board.board</field>
<field name="inherit_id" ref="hr.board_hr_form"/>
<field name="inherit_id" ref="hr.board_hr_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
<xpath expr="/form/hpaned/child2" position="inside">
<action colspan="4" height="220" name="%(action_hr_timesheet_sheet_graph)d" string="Timesheets by Month" />
</xpath>
<xpath expr="/form/hpaned/child2" position="inside">
<action colspan="4" height="220" name="%(action_employee_attendance_graph)d" string="Employee Attendances" />
</xpath>
</field>
</record>
<record id="hr_timesheet_sheet_tree" model="ir.ui.view">
<field name="name">hr.timesheet.sheet.tree.simplified.board</field>
<field name="model">hr_timesheet_sheet.sheet</field>
@ -54,6 +77,5 @@
</tree>
</field>
</record>
</data>
</openerp>

File diff suppressed because it is too large Load Diff

View File

@ -138,15 +138,5 @@
<field name="readonly" eval="False"/>
</record>
<!-- Define a payment type -->
<record model="payment.type" id="payment_type_dta">
<field name="name">DTA</field>
<field name="code">dta</field>
<field name="suitable_bank_types"
eval="[(6,0,[ref('dta_iban'),ref('bvrbank'),ref('bvrpost'),ref('bvbank'),ref('bvpost')])]"/>
</record>
</data>
</openerp>
</openerp>

View File

@ -12,7 +12,6 @@
</record>
<!-- Balance Sheet -->
<record id="bal" model="account.account.template">
<field name="code">1</field>
<field name="name">Balance Sheet</field>
@ -21,130 +20,129 @@
<field name="user_type" ref="account_type_view"/>
</record>
<record model="account.account.template" id="liabilities_view">
<field name="name">Liabilities</field>
<field name="code">11</field>
<field name="type">view</field>
<field name="user_type" ref="acct_type_liability_view"/>
<field name="reconcile" eval="False"/>
<field name="parent_id" ref="bal"/>
</record>
<record model="account.account.template" id="liabilities_view">
<field name="name">Liabilities</field>
<field name="code">11</field>
<field name="type">view</field>
<field name="user_type" ref="acct_type_liability_view"/>
<field name="reconcile" eval="False"/>
<field name="parent_id" ref="bal"/>
</record>
<record id="cli" model="account.account.template">
<field name="code">110</field>
<field name="name">Current Liabilities</field>
<field ref="liabilities_view" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="acct_type_liability_view"/>
</record>
<record id="a_pay" model="account.account.template">
<field name="code">1111</field>
<field name="name">Creditors</field>
<field ref="cli" name="parent_id"/>
<field name="type">payable</field>
<field eval="True" name="reconcile"/>
<field name="user_type" ref="account_type_liability"/>
</record>
<record id="iva" model="account.account.template">
<field name="code">1112</field>
<field name="name">Input VAT</field>
<field ref="cli" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="account_type_liability"/>
</record>
<record id="cli" model="account.account.template">
<field name="code">110</field>
<field name="name">Current Liabilities</field>
<field ref="liabilities_view" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="acct_type_liability_view"/>
</record>
<record id="a_reserve_and_surplus" model="account.account.template">
<field name="code">1113</field>
<field name="name">Reserve and Surplus Account</field>
<field ref="cli" name="parent_id"/>
<field name="type">payable</field>
<field name="user_type" ref="account_type_liability"/>
</record>
<record id="a_pay" model="account.account.template">
<field name="code">1111</field>
<field name="name">Creditors</field>
<field ref="cli" name="parent_id"/>
<field name="type">payable</field>
<field eval="True" name="reconcile"/>
<field name="user_type" ref="account_type_liability"/>
</record>
<record model="account.account.template" id="assets_view">
<field name="name">Assets</field>
<field name="code">10</field>
<field name="type">view</field>
<field name="user_type" ref="acct_type_asset_view"/>
<field name="reconcile" eval="False"/>
<field name="parent_id" ref="bal"/>
</record>
<record id="fas" model="account.account.template">
<field name="code">100</field>
<field name="name">Fixed Assets</field>
<field ref="assets_view" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="acct_type_asset_view"/>
</record>
<record id="iva" model="account.account.template">
<field name="code">1112</field>
<field name="name">Input VAT</field>
<field ref="cli" name="parent_id"/>
<field name="type">payable</field>
<field name="user_type" ref="account_type_liability"/>
</record>
<record id="xfa" model="account.account.template">
<field name="code">1000</field>
<field name="name">Fixed Asset Account</field>
<field ref="fas" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="account_type_asset"/>
</record>
<record id="nca" model="account.account.template">
<field name="code">101</field>
<field name="name">Net Current Assets</field>
<field ref="assets_view" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="acct_type_asset_view"/>
</record>
<record id="a_reserve_and_surplus" model="account.account.template">
<field name="code">1113</field>
<field name="name">Reserve and Surplus Account</field>
<field ref="cli" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="account_type_liability"/>
</record>
<record id="cas" model="account.account.template">
<field name="code">1100</field>
<field name="name">Current Assets</field>
<field ref="nca" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="acct_type_asset_view"/>
</record>
<record model="account.account.template" id="assets_view">
<field name="name">Assets</field>
<field name="code">10</field>
<field name="type">view</field>
<field name="user_type" ref="acct_type_asset_view"/>
<field name="reconcile" eval="False"/>
<field name="parent_id" ref="bal"/>
</record>
<record id="stk" model="account.account.template">
<field name="code">11001</field>
<field name="name">Purchased Stocks</field>
<field ref="cas" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="account_type_asset"/>
</record>
<record id="fas" model="account.account.template">
<field name="code">100</field>
<field name="name">Fixed Assets</field>
<field ref="assets_view" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="acct_type_asset_view"/>
</record>
<record id="a_recv" model="account.account.template">
<field name="code">11002</field>
<field name="name">Debtors</field>
<field ref="cas" name="parent_id"/>
<field name="type">receivable</field>
<field eval="True" name="reconcile"/>
<field name="user_type" ref="account_type_asset"/>
</record>
<record id="xfa" model="account.account.template">
<field name="code">1000</field>
<field name="name">Fixed Asset Account</field>
<field ref="fas" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="account_type_asset"/>
</record>
<record id="ova" model="account.account.template">
<field name="code">11003</field>
<field name="name">Output VAT</field>
<field ref="cas" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="account_type_asset"/>
</record>
<record id="nca" model="account.account.template">
<field name="code">101</field>
<field name="name">Net Current Assets</field>
<field ref="assets_view" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="acct_type_asset_view"/>
</record>
<record id="bnk" model="account.account.template">
<field name="code">11004</field>
<field name="name">Bank Current Account</field>
<field ref="cas" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="account_type_cash"/>
</record>
<record id="cas" model="account.account.template">
<field name="code">1100</field>
<field name="name">Current Assets</field>
<field ref="nca" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="acct_type_asset_view"/>
</record>
<record id="cash" model="account.account.template">
<field name="code">11005</field>
<field name="name">Cash</field>
<field ref="cas" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="account_type_cash"/>
</record>
<record id="stk" model="account.account.template">
<field name="code">11001</field>
<field name="name">Purchased Stocks</field>
<field ref="cas" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="account_type_asset"/>
</record>
<record id="a_recv" model="account.account.template">
<field name="code">11002</field>
<field name="name">Debtors</field>
<field ref="cas" name="parent_id"/>
<field name="type">receivable</field>
<field eval="True" name="reconcile"/>
<field name="user_type" ref="account_type_asset"/>
</record>
<record id="ova" model="account.account.template">
<field name="code">11003</field>
<field name="name">Output VAT</field>
<field ref="cas" name="parent_id"/>
<field name="type">receivable</field>
<field name="user_type" ref="account_type_asset"/>
</record>
<record id="bnk" model="account.account.template">
<field name="code">11004</field>
<field name="name">Bank Current Account</field>
<field ref="cas" name="parent_id"/>
<field name="type">liquidity</field>
<field name="user_type" ref="account_type_cash"/>
</record>
<record id="cash" model="account.account.template">
<field name="code">11005</field>
<field name="name">Cash</field>
<field ref="cas" name="parent_id"/>
<field name="type">liquidity</field>
<field name="user_type" ref="account_type_cash"/>
</record>
<!-- Profit and Loss -->
@ -155,98 +153,97 @@
<field name="type">view</field>
<field name="user_type" ref="account_type_view"/>
</record>
<record model="account.account.template" id="income_view">
<field name="name">Income</field>
<field name="code">20</field>
<field name="type">view</field>
<field name="user_type" ref="acct_type_income_view"/>
<field name="reconcile" eval="False"/>
<field name="parent_id" ref="gpf"/>
</record>
<record model="account.account.template" id="income_fx_income">
<field name="name">Foreign Exchange Gain</field>
<field name="code">X201</field>
<field name="type">other</field>
<field name="user_type" ref="account_type_income"/>
<field name="reconcile" eval="False"/>
<field name="parent_id" ref="income_view"/>
</record>
<record id="rev" model="account.account.template">
<field name="code">200</field>
<field name="name">Revenue</field>
<field ref="income_view" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="acct_type_income_view"/>
</record>
<record id="a_sale" model="account.account.template">
<field name="code">2001</field>
<field name="name">Product Sales</field>
<field ref="rev" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="account_type_income"/>
</record>
<record model="account.account.template" id="expense_view">
<field name="name">Expense</field>
<field name="code">21</field>
<field name="type">view</field>
<field name="user_type" ref="acct_type_expense_view"/>
<field name="reconcile" eval="False"/>
<field name="parent_id" ref="gpf"/>
</record>
<record id="cos" model="account.account.template">
<field name="code">210</field>
<field name="name">Cost of Sales</field>
<field ref="expense_view" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="acct_type_expense_view"/>
</record>
<record model="account.account.template" id="income_view">
<field name="name">Income</field>
<field name="code">20</field>
<field name="type">view</field>
<field name="user_type" ref="acct_type_income_view"/>
<field name="reconcile" eval="False"/>
<field name="parent_id" ref="gpf"/>
</record>
<record id="cog" model="account.account.template">
<field name="code">2100</field>
<field name="name">Cost of Goods Sold</field>
<field ref="cos" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="account_type_expense"/>
</record>
<record model="account.account.template" id="income_fx_income">
<field name="name">Foreign Exchange Gain</field>
<field name="code">X201</field>
<field name="type">other</field>
<field name="user_type" ref="account_type_income"/>
<field name="reconcile" eval="False"/>
<field name="parent_id" ref="income_view"/>
</record>
<record id="ovr" model="account.account.template">
<field name="code">211</field>
<field name="name">Overheads</field>
<field ref="expense_view" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="acct_type_expense_view"/>
</record>
<record id="rev" model="account.account.template">
<field name="code">200</field>
<field name="name">Revenue</field>
<field ref="income_view" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="acct_type_income_view"/>
</record>
<record id="a_expense" model="account.account.template">
<field name="code">2110</field>
<field name="name">Expenses</field>
<field ref="ovr" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="account_type_expense"/>
</record>
<record model="account.account.template" id="income_fx_expense">
<field name="name">Foreign Exchange Loss</field>
<field name="code">2111</field>
<field name="type">other</field>
<field name="user_type" ref="account_type_expense"/>
<field name="reconcile" eval="False"/>
<field name="parent_id" ref="ovr"/>
</record>
<record id="a_sale" model="account.account.template">
<field name="code">2001</field>
<field name="name">Product Sales</field>
<field ref="rev" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="account_type_income"/>
</record>
<record id="a_salary_expense" model="account.account.template">
<field name="code">2112</field>
<field name="name">Salary Expenses</field>
<field ref="ovr" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="account_type_expense"/>
</record>
<record model="account.account.template" id="expense_view">
<field name="name">Expense</field>
<field name="code">21</field>
<field name="type">view</field>
<field name="user_type" ref="acct_type_expense_view"/>
<field name="reconcile" eval="False"/>
<field name="parent_id" ref="gpf"/>
</record>
<record id="cos" model="account.account.template">
<field name="code">210</field>
<field name="name">Cost of Sales</field>
<field ref="expense_view" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="acct_type_expense_view"/>
</record>
<record id="cog" model="account.account.template">
<field name="code">2100</field>
<field name="name">Cost of Goods Sold</field>
<field ref="cos" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="account_type_expense"/>
</record>
<record id="ovr" model="account.account.template">
<field name="code">211</field>
<field name="name">Overheads</field>
<field ref="expense_view" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="acct_type_expense_view"/>
</record>
<record id="a_expense" model="account.account.template">
<field name="code">2110</field>
<field name="name">Expenses</field>
<field ref="ovr" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="account_type_expense"/>
</record>
<record model="account.account.template" id="income_fx_expense">
<field name="name">Foreign Exchange Loss</field>
<field name="code">2111</field>
<field name="type">other</field>
<field name="user_type" ref="account_type_expense"/>
<field name="reconcile" eval="False"/>
<field name="parent_id" ref="ovr"/>
</record>
<record id="a_salary_expense" model="account.account.template">
<field name="code">2112</field>
<field name="name">Salary Expenses</field>
<field ref="ovr" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="account_type_expense"/>
</record>
</data>
</openerp>

File diff suppressed because it is too large Load Diff

View File

@ -586,10 +586,7 @@
</group>
<label string="" colspan="2"/>
<field name="product_uos_qty" groups="product.group_uos"/>
<group colspan="2" col="3" groups="product.group_uos">
<field name="product_uos"/>
<label string=""/>
</group>
<field name="product_uos" groups="product.group_uos"/>
</group>
<notebook colspan="4">

View File

@ -43,7 +43,7 @@ class project_task(osv.osv):
def do_cancel(self, cr, uid, ids, *args, **kwargs):
res = super(project_task, self).do_cancel(cr, uid, ids, *args, **kwargs)
self._validate_subflows(cr, uid, ids)
return True
return res
project_task()

View File

@ -27,7 +27,7 @@
</record>
<record id="open_board_sales_manager" model="ir.actions.act_window">
<field name="name">Sale Dashboard</field>
<field name="name">Sales Dashboard</field>
<field name="res_model">board.board</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>

View File

@ -107,7 +107,7 @@
<field name="invoiced"/>
</group>
<notebook colspan="5">
<page string="Sale Order">
<page string="Sales Order">
<field name="partner_id" on_change="onchange_partner_id(partner_id)" required="1"/>
<field domain="[('partner_id','=',partner_id)]" name="partner_order_id"/>
<field domain="[('partner_id','=',partner_id)]" name="partner_invoice_id" groups="base.group_extended"/>
@ -255,10 +255,10 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Sales Order">
<filter icon="terp-document-new" string="Quotations" domain="[('state','=','draft')]" help="Sale Orders that haven't yet be confirmed"/>
<filter icon="terp-document-new" string="Quotations" domain="[('state','=','draft')]" help="Sales Order that haven't yet been confirmed"/>
<filter icon="terp-check" string="Sales" domain="[('state','in',('manual','progress'))]"/>
<separator orientation="vertical"/>
<filter icon="terp-dolar_ok!" string="To Invoice" domain="[('state','=','manual')]" help="Sale Orders ready to be invoiced"/>
<filter icon="terp-dolar_ok!" string="To Invoice" domain="[('state','=','manual')]" help="Sales Order ready to be invoiced"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="date_order" select="1" string="Order date" />
@ -286,11 +286,11 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar,graph</field>
<field name="search_view_id" ref="view_sales_order_filter"/>
<field name="help">The sale order manages the invoicing, the product fullfilment and the
<field name="help">The sales order manages the invoicing, the product fullfilment and the
delivery processes. OpenERP can handle products, services and
consumables so that a sale order can trigger tasks, manufacturing
consumables so that a sales order can trigger tasks, manufacturing
orders, purchases, etc. It support several invoicing methods according
to your configuration: from the sale order, from the pickings, etc.
to your configuration: from the sales order, from the pickings, etc.
</field>
</record>
<menuitem action="action_order_form" id="menu_sale_order" parent="base.menu_sales" sequence="3"/>
@ -436,7 +436,7 @@ to your configuration: from the sale order, from the pickings, etc.
<field name="order_partner_id"/>
<field name="product_id"/>
<field name="salesman_id">
<filter icon="terp-personnal" domain="[('salesman_id','=',uid)]" help="Sale Order Lines related to a Sale Order of mine"/>
<filter icon="terp-personnal" domain="[('salesman_id','=',uid)]" help="Sale Order Lines related to a Sales Order of mine"/>
</field>
<newline/>
<group expand="context.get('report',False)" string="Group By..." colspan="9" col="8">
@ -517,7 +517,7 @@ to your configuration: from the sale order, from the pickings, etc.
<!-- configartion view -->
<record id="view_config_picking_policy" model="ir.ui.view">
<field name="name">Configure Picking Policy for Sale Order </field>
<field name="name">Configure Picking Policy for Sales Order </field>
<field name="model">sale.config.picking_policy</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.res_config_view_base"/>
@ -528,7 +528,7 @@ to your configuration: from the sale order, from the pickings, etc.
</form>
<separator string="title" position="attributes">
<attribute name="string"
>Configure Sale Order Logistic</attribute>
>Configure Sales Order Logistic</attribute>
</separator>
<xpath expr="//label[@string='description']" position="attributes">
<attribute name="string">Setup your sales workflow and default values.</attribute>
@ -550,7 +550,7 @@ to your configuration: from the sale order, from the pickings, etc.
</record>
<record id="action_config_picking_policy" model="ir.actions.act_window">
<field name="name">Configure Picking Policy for Sale Order</field>
<field name="name">Configure Picking Policy for Sales Order</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.config.picking_policy</field>
<field name="view_id" ref="view_config_picking_policy"/>

View File

@ -20,15 +20,15 @@
##############################################################################
{
'name': 'Creates Sale orders from Opportunity',
'name': 'Creates Sales order from Opportunity',
'version': '1.0',
'category': 'Generic Modules/Sales & Purchases',
'description': """
This module adds a shortcut on one or several opportunity cases in the CRM.
This shortcut allows you to generate a sale order based on the selected case.
This shortcut allows you to generate a sales order based on the selected case.
If different cases are open (a list), it generates one sale order by
case.
The case is then closed and linked to the generated sale order.
The case is then closed and linked to the generated sales order.
We suggest you to install this module if you installed both the sale and the
crm modules.

View File

@ -33,7 +33,7 @@
<field name="inherit_id" ref="sale.view_sales_order_filter"/>
<field name="arch" type="xml">
<field name="date_order" position="after">
<field name="section_id" default="context.get('section_id', False)" widget="selection" string="Sale Team" groups="base.group_extended">
<field name="section_id" default="context.get('section_id', False)" widget="selection" string="Sales Team" groups="base.group_extended">
<filter icon="terp-personal+"
domain="[('section_id.user_id','=',uid)]"
groups="base.group_extended"

View File

@ -116,11 +116,11 @@
<field name="arch" type="xml">
<search string="Sales by Journal">
<group col="8" colspan="4">
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Sale Journals which are in draft state"/>
<filter icon="gtk-open" string="Open" domain="[('state','=','open')]" help="Open Sale Journals"/>
<filter icon="gtk-cancel" string="Cancel" domain="[('state','=','cancel')]" help="Sale Journals which are cancelled"/>
<filter icon="terp-check" string="Confirm" domain="[('state','=','confirm')]" help="Confirmed Sale Journals"/>
<filter icon="terp-camera_test" string="Close" domain="[('state','=','done')]" help="Sale Journals which are closed"/>
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Sales Journal which are in draft state"/>
<filter icon="gtk-open" string="Open" domain="[('state','=','open')]" help="Open Sales Journal"/>
<filter icon="gtk-cancel" string="Cancel" domain="[('state','=','cancel')]" help="Sales Journal which are cancelled"/>
<filter icon="terp-check" string="Confirm" domain="[('state','=','confirm')]" help="Confirmed Sales Journal"/>
<filter icon="terp-camera_test" string="Close" domain="[('state','=','done')]" help="Sales Journal which are closed"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="code"/>

View File

@ -24,7 +24,7 @@
"depends" : ["sale", "account_invoice_layout"],
"author" : "OpenERP SA",
"description": """
This module provides features to improve the layout of the Sale Order.
This module provides features to improve the layout of the Sales Order.
It gives you the possibility to
* order all the lines of an sale order

View File

@ -19,7 +19,7 @@
##############################################################################
{
"name":"Margins in Sale Orders",
"name":"Margins in Sales Order",
"version":"1.0",
"category" : "Generic Modules/Sales & Purchases",
"description": """

View File

@ -27,8 +27,8 @@
'description': """
This module provides facility to the user to install mrp and sale modules
at a time. It is basically used when we want to keep track of production
orders generated from sale orders.
It adds sale name and sale Reference on production order
orders generated from sales order.
It adds sales name and sales Reference on production order
""",
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',

View File

@ -25,7 +25,7 @@
'version': '1.0',
'category': 'Generic Modules/CRM & SRM',
'description': """
Add commitment, requested and effective dates on the sale order.
Add commitment, requested and effective dates on the sales order.
""",
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',

View File

@ -125,7 +125,8 @@ class survey(osv.osv):
'type': 'ir.actions.report.xml',
'report_name': 'survey.browse.response',
'datas': datas,
'context' : context
'context' : context,
'nodestroy':True,
}
else:
@ -135,7 +136,8 @@ class survey(osv.osv):
'type': 'ir.actions.report.xml',
'report_name': 'survey.form',
'datas': datas,
'context' : context
'context' : context,
'nodestroy':True,
}
return report
survey()