bzr revid: fp@tinyerp.com-20100901150945-xu82s575mp61ia6d
This commit is contained in:
Fabien Pinckaers 2010-09-01 17:09:45 +02:00
commit a24ee7bc78
102 changed files with 898 additions and 867 deletions

View File

@ -53,11 +53,11 @@ module named account_voucher.
'wizard/account_move_bank_reconcile_view.xml',
'wizard/account_use_model_view.xml',
'account_installer.xml',
'wizard/account_period_close_view.xml',
'account_view.xml',
'account_report.xml',
'wizard/account_report_common_view.xml',
'wizard/account_invoice_refund_view.xml',
'wizard/account_period_close_view.xml',
'wizard/account_fiscalyear_close_state.xml',
'wizard/account_chart_view.xml',
'wizard/account_tax_chart_view.xml',
@ -75,7 +75,6 @@ module named account_voucher.
'wizard/account_journal_select_view.xml',
'wizard/account_change_currency_view.xml',
'wizard/account_validate_move_view.xml',
'wizard/account_pay_invoice_view.xml',
'wizard/account_unreconcile_view.xml',
'wizard/account_report_general_ledger_view.xml',
'wizard/account_invoice_state_view.xml',

View File

@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
@ -60,7 +61,7 @@ class account_payment_term(osv.osv):
'line_ids': fields.one2many('account.payment.term.line', 'payment_id', 'Terms'),
}
_defaults = {
'active': lambda *a: 1,
'active': 1,
}
_order = "name"
@ -120,9 +121,9 @@ class account_payment_term_line(osv.osv):
'payment_id': fields.many2one('account.payment.term', 'Payment Term', required=True, select=True),
}
_defaults = {
'value': lambda *a: 'balance',
'sequence': lambda *a: 5,
'days2': lambda *a: 0,
'value': 'balance',
'sequence': 5,
'days2': 0,
}
_order = "sequence"
@ -405,10 +406,10 @@ class account_account(osv.osv):
}
_defaults = {
'type': lambda *a : 'view',
'reconcile': lambda *a: False,
'active': lambda *a: True,
'currency_mode': lambda *a: 'current',
'type': 'view',
'reconcile': False,
'active': True,
'currency_mode': 'current',
'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'account.account', context=c),
}
@ -502,7 +503,7 @@ class account_account(osv.osv):
default['child_parent_ids'] = False
return super(account_account, self).copy(cr, uid, id, default, context=context)
def _check_moves(self, cr, uid, ids, method, context):
def _check_moves(self, cr, uid, ids, method, context=None):
line_obj = self.pool.get('account.move.line')
account_ids = self.search(cr, uid, [('id', 'child_of', ids)])
@ -518,7 +519,7 @@ class account_account(osv.osv):
raise osv.except_osv(_('Warning !'), _('You cannot remove/deactivate an account which is set as a property to any Partner.'))
return True
def _check_allow_type_change(self, cr, uid, ids, new_type, context):
def _check_allow_type_change(self, cr, uid, ids, new_type, context=None):
group1 = ['payable', 'receivable', 'other']
group2 = ['consolidation','view']
line_obj = self.pool.get('account.move.line')
@ -548,9 +549,9 @@ class account_account(osv.osv):
self._check_allow_type_change(cr, uid, ids, vals['type'], context=context)
return super(account_account, self).write(cr, uid, ids, vals, context=context)
def unlink(self, cr, uid, ids, context={}):
self._check_moves(cr, uid, ids, "unlink", context)
return super(account_account, self).unlink(cr, uid, ids, context)
def unlink(self, cr, uid, ids, context=None):
self._check_moves(cr, uid, ids, "unlink", context=context)
return super(account_account, self).unlink(cr, uid, ids, context=context)
account_account()
@ -562,6 +563,7 @@ class account_journal_view(osv.osv):
'columns_id': fields.one2many('account.journal.column', 'view_id', 'Columns')
}
_order = "name"
account_journal_view()
@ -587,6 +589,7 @@ class account_journal_column(osv.osv):
'readonly': fields.boolean('Readonly'),
}
_order = "sequence"
account_journal_column()
class account_journal(osv.osv):
@ -614,7 +617,7 @@ class account_journal(osv.osv):
'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 Created Entries', help='Check this box if you don\'t want new account moves to pass through the \'draft\' state and instead goes directly to the \'posted state\' without any manual validation.'),
'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."),
@ -997,7 +1000,7 @@ class account_move(osv.osv):
@param context: context arguments, like lang, time zone
@param limit: Returns first 'n' ids of complete result, default is 80.
@return: Returns a list of tupples containing id and name
@return: Returns a list of tuples containing id and name
"""
if not args:
@ -1058,13 +1061,13 @@ class account_move(osv.osv):
else:
if cond[1] in ['=like', 'like', 'not like', 'ilike', 'not ilike', 'in', 'not in', 'child_of']:
continue
cr.execute("select move_id from account_move_line group by move_id having sum(debit) %s %%s" % (cond[1]) ,(amount,))
res_ids = set(id[0] for id in cr.fetchall())
ids = ids and (ids & res_ids) or res_ids
if ids:
return [('id','in',tuple(ids))]
else:
else:
return [('id', '=', '0')]
_columns = {
@ -1075,7 +1078,7 @@ class account_move(osv.osv):
'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.'),
'line_id': fields.one2many('account.move.line', 'move_id', 'Entries', states={'posted':[('readonly',True)]}),
'to_check': fields.boolean('To Be Verified'),
'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"),
'amount': fields.function(_amount_compute, method=True, string='Amount', digits_compute=dp.get_precision('Account'), type='float', fnct_search=_search_amount),
'date': fields.date('Date', required=True, states={'posted':[('readonly',True)]}),
@ -1148,6 +1151,24 @@ class account_move(osv.osv):
return True
def button_validate(self, cursor, user, ids, context=None):
def _get_chart_account(cursor, user, account):
if account.parent_id:
chart_account = _get_chart_account(cursor, user, account.parent_id)
else:
chart_account = account
return chart_account
for move in self.browse(cursor, user, ids):
lines = move.line_id
if lines:
ref_line = lines[0]
ref_chart_account = _get_chart_account(cursor, user, ref_line.account_id)
parent_left = ref_chart_account.parent_left
parent_right = ref_chart_account.parent_right
result = True
for line in lines[1:]:
if not (line.account_id.parent_left > parent_left and line.account_id.parent_left < parent_right):
raise osv.except_osv(_('Error !'), _('You cannot validate a move unless accounts in its entry lines are in same Chart Of Accounts !'))
return self.post(cursor, user, ids, context=context)
def button_cancel(self, cr, uid, ids, context={}):
@ -1453,7 +1474,7 @@ class account_tax_code(osv.osv):
This code is used for some tax declarations.
"""
def _sum(self, cr, uid, ids, name, args, context,where ='', where_params=()):
def _sum(self, cr, uid, ids, name, args, context, where ='', where_params=()):
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
if context.get('based_on', 'invoices') == 'payments':
cr.execute('SELECT line.tax_code_id, sum(line.tax_amount) \
@ -1466,13 +1487,15 @@ class account_tax_code(osv.osv):
AND ((invoice.state = \'paid\') \
OR (invoice.id IS NULL)) \
GROUP BY line.tax_code_id',
(parent_ids,)+where_params)
(parent_ids,) + where_params)
else:
cr.execute('SELECT line.tax_code_id, sum(line.tax_amount) \
FROM account_move_line AS line \
FROM account_move_line AS line, \
account_move AS move \
WHERE line.tax_code_id IN %s '+where+' \
AND move.id = line.move_id \
GROUP BY line.tax_code_id',
(parent_ids,)+where_params)
(parent_ids,) + where_params)
res=dict(cr.fetchall())
for record in self.browse(cr, uid, ids, context):
def _rec_get(record):
@ -1483,7 +1506,12 @@ class account_tax_code(osv.osv):
res[record.id] = round(_rec_get(record), self.pool.get('decimal.precision').precision_get(cr, uid, 'Account'))
return res
def _sum_year(self, cr, uid, ids, name, args, context):
def _sum_year(self, cr, uid, ids, name, args, context=None):
if context is None:
context = {}
move_state = ('posted', )
if 'state' in context and context['state'] == 'all':
move_state = ('draft', 'posted', )
if 'fiscalyear_id' in context and context['fiscalyear_id']:
fiscalyear_id = context['fiscalyear_id']
else:
@ -1493,12 +1521,17 @@ class account_tax_code(osv.osv):
if fiscalyear_id:
pids = map(lambda x: str(x.id), self.pool.get('account.fiscalyear').browse(cr, uid, fiscalyear_id).period_ids)
if pids:
where = ' and period_id IN %s'
where_params = (tuple(pids),)
where = ' AND line.period_id IN %s AND move.state IN %s '
where_params = (tuple(pids), move_state)
return self._sum(cr, uid, ids, name, args, context,
where=where, where_params=where_params)
def _sum_period(self, cr, uid, ids, name, args, context):
if context is None:
context = {}
move_state = ('posted', )
if 'state' in context and context['state'] == 'all':
move_state = ('draft', 'posted', )
if 'period_id' in context and context['period_id']:
period_id = context['period_id']
else:
@ -1507,7 +1540,7 @@ class account_tax_code(osv.osv):
return dict.fromkeys(ids, 0.0)
period_id = period_id[0]
return self._sum(cr, uid, ids, name, args, context,
where=' and line.period_id=%s', where_params=(period_id,))
where=' AND line.period_id=%s AND move.state IN %s', where_params=(period_id, move_state))
_name = 'account.tax.code'
_description = 'Tax Code'
@ -1665,37 +1698,37 @@ class account_tax(osv.osv):
return super(account_tax, self).search(cr, uid, args, offset, limit, order, context, count)
def name_get(self, cr, uid, ids, context={}):
def name_get(self, cr, uid, ids, context=None):
if not len(ids):
return []
res = []
for record in self.read(cr, uid, ids, ['description','name'], context):
for record in self.read(cr, uid, ids, ['description','name'], context=context):
name = record['description'] and record['description'] or record['name']
res.append((record['id'],name ))
return res
def _default_company(self, cr, uid, context={}):
def _default_company(self, cr, uid, context=None):
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
if user.company_id:
return user.company_id.id
return self.pool.get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
_defaults = {
'python_compute': lambda *a: '''# price_unit\n# address : res.partner.address object or False\n# product : product.product object or None\n# partner : res.partner object or None\n\nresult = price_unit * 0.10''',
'python_compute_inv': lambda *a: '''# price_unit\n# address : res.partner.address object or False\n# product : product.product object or False\n\nresult = price_unit * 0.10''',
'applicable_type': lambda *a: 'true',
'type': lambda *a: 'percent',
'amount': lambda *a: 0,
'price_include': lambda *a: 0,
'active': lambda *a: 1,
'type_tax_use': lambda *a: 'all',
'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,
'python_compute': '''# 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': '''# 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': 'true',
'type': 'percent',
'amount': 0,
'price_include': 0,
'active': 1,
'type_tax_use': 'all',
'sequence': 1,
'tax_group': 'vat',
'ref_tax_sign': 1,
'ref_base_sign': 1,
'tax_sign': 1,
'base_sign': 1,
'include_base_amount': False,
'company_id': _default_company,
}
_order = 'sequence'

View File

@ -720,4 +720,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

@ -77,7 +77,7 @@ class account_cash_statement(osv.osv):
"""
res ={}
for statement in self.browse(cr, uid, ids):
amount_total=0.0
amount_total = 0.0
if statement.journal_id.type not in('cash'):
continue
@ -232,7 +232,7 @@ class account_cash_statement(osv.osv):
'starting_details_ids':False
})
res_id = super(account_cash_statement, self).create(cr, uid, vals, context=context)
self.write(cr, uid, [res_id], {})
#self.write(cr, uid, [res_id], {})
return res_id
def write(self, cr, uid, ids, vals, context=None):
@ -273,8 +273,6 @@ class account_cash_statement(osv.osv):
'balance_start': balance_start
})
return res
res = super(account_cash_statement, self).onchange_journal_id(cr, uid, statement_id, journal_id, context)
return res
@ -304,7 +302,7 @@ class account_cash_statement(osv.osv):
if statement.name and statement.name == '/':
number = self.pool.get('ir.sequence').get(cr, uid, 'account.cash.statement')
vals.update({
'name':number
'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'))
@ -346,6 +344,7 @@ class account_cash_statement(osv.osv):
res_users_obj = self.pool.get('res.users')
account_move_obj = self.pool.get('account.move')
account_move_line_obj = self.pool.get('account.move.line')
account_analytic_line_obj = self.pool.get('account.analytic.line')
account_bank_statement_line_obj = self.pool.get('account.bank.statement.line')
company_currency_id = res_users_obj.browse(cr, uid, uid, context=context).company_id.currency_id.id
@ -374,6 +373,10 @@ class account_cash_statement(osv.osv):
# In line we get reconcile_id on bank.ste.rec.
# in bank stat.rec we get line_new_ids on bank.stat.rec.line
for move in st.line_ids:
if move.analytic_account_id:
if not st.journal_id.analytic_journal_id:
raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (st.journal_id.name,))
context.update({'date':move.date})
move_id = account_move_obj.create(cr, uid, {
'journal_id': st.journal_id.id,
@ -412,6 +415,7 @@ class account_cash_statement(osv.osv):
'journal_id': st.journal_id.id,
'period_id': st.period_id.id,
'currency_id': st.currency.id,
'analytic_account_id': move.analytic_account_id and move.analytic_account_id.id or False
}
amount = res_currency_obj.compute(cr, uid, st.currency.id,
@ -432,8 +436,28 @@ class account_cash_statement(osv.osv):
move.account_id.currency_id.id, amount, context=context,
account=acc_cur)
val['amount_currency'] = amount_cur
move_line_id = account_move_line_obj.create(cr, uid, val , context=context)
torec.append(move_line_id)
torec.append(account_move_line_obj.create(cr, uid, val , context=context))
if move.analytic_account_id:
anal_val = {}
amt = (val['credit'] or 0.0) - (val['debit'] or 0.0)
anal_val = {
'name': val['name'],
'ref': val['ref'],
'date': val['date'],
'amount': amt,
'account_id': val['analytic_account_id'],
'currency_id': val['currency_id'],
'general_account_id': val['account_id'],
'journal_id': st.journal_id.analytic_journal_id.id,
'period_id': val['period_id'],
'user_id': uid,
'move_id': move_line_id
}
if val.get('amount_currency', False):
anal_val['amount_currency'] = val['amount_currency']
account_analytic_line_obj.create(cr, uid, anal_val, context=context)
if move.reconcile_id and move.reconcile_id.line_new_ids:
for newline in move.reconcile_id.line_new_ids:
@ -498,9 +522,8 @@ class account_cash_statement(osv.osv):
account_move_line_obj.reconcile(cr, uid, torec, 'statement', writeoff_acc_id=writeoff_acc_id, writeoff_period_id=st.period_id.id, writeoff_journal_id=st.journal_id.id, context=context)
else:
account_move_line_obj.reconcile_partial(cr, uid, torec, 'statement', context)
if st.journal_id.entry_posted:
account_move_obj.write(cr, uid, [move_id], {'state':'posted'})
move_name = st.name + ' - ' + str(move.sequence)
account_move_obj.write(cr, uid, [move_id], {'state':'posted', 'name': move_name})
done.append(st.id)
vals = {

View File

@ -136,7 +136,6 @@
<field name="state"/>
<button name="invoice_open" states="draft,proforma2" string="Approve" icon="terp-camera_test"/>
<button name="%(action_account_invoice_pay)d" type='action' string='Pay Invoice' states='open' icon="terp-dolar_ok!"/>
</tree>
</field>
</record>
@ -210,7 +209,6 @@
<group col="6" colspan="4">
<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_invoice_pay)d" type='action' string='Pay Invoice' states='open' icon="terp-dolar_ok!"/>
<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"/>
@ -307,7 +305,6 @@
<button name="invoice_proforma2" states="draft" string="PRO-FORMA" icon="terp-gtk-media-pause" groups="account.group_account_user"/>
<button name="invoice_open" states="draft,proforma2" string="Create" 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_invoice_pay)d" type='action' string='Pay Invoice' states='open' icon="terp-dolar_ok!"/>
<button name='%(action_account_state_open)d' type='action' string='Re-Open' states='paid' icon="gtk-convert" groups="base.group_no_one"/>
</group>
</group>

View File

@ -1,6 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="res_roles_invoice0" model="res.roles">
<field eval="&quot;&quot;&quot;Invoice&quot;&quot;&quot;" name="name"/>
<field name="description">Assign this role to the persons that should have the rights to confirm a draft invoice.</field>
</record>
<record id="wkf" model="workflow">
<field name="name">account.invoice.basic</field>
<field name="osv">account.invoice</field>

View File

@ -7,6 +7,8 @@
<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"/>
<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"/>

View File

@ -986,9 +986,10 @@ 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:
m = self.pool.get('account.move').browse(cr, uid, vals['move_id'])
journal_id = m.journal_id.id
period_id = m.period_id.id
if vals['move_id']:
m = self.pool.get('account.move').browse(cr, uid, vals['move_id'])
journal_id = m.journal_id.id
period_id = m.period_id.id
else:
journal_id = context.get('journal_id',False)
period_id = context.get('period_id',False)

View File

@ -85,25 +85,21 @@
Period
-->
<record id="res_role_period" model="res.roles">
<field eval="&quot;&quot;&quot;Period&quot;&quot;&quot;" name="name"/>
</record>
<record id="view_account_period_form" model="ir.ui.view">
<field name="name">account.period.form</field>
<field name="model">account.period</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Period">
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="name"/>
<field name="code"/>
<field name="date_start"/>
<field name="date_stop"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="fiscalyear_id"/>
<field name="special"/>
<separator colspan="4" string="States"/>
<field name="state" select="1"/>
<field name="state"/>
<button name="action_draft" states="done" string="Set to Draft" type="object" icon="gtk-convert" groups="account.group_account_manager"/>
</form>
</field>
@ -114,20 +110,40 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree colors="blue:state in ('draft');gray:state in ('done') " string="Period">
<field name="code"/>
<field name="name"/>
<field name="code"/>
<field name="date_start"/>
<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"/>
</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>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Period">
<group>
<filter string="Draft" name="draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
<separator orientation="vertical"/>
<field name="code"/>
<field name="name"/>
</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>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">tree,form,search</field>
<field name="context">{'search_default_draft': 1}</field>
</record>
<menuitem action="action_account_period_form" id="menu_action_account_period_form" parent="account.next_id_23"/>
@ -449,10 +465,9 @@
<field name="journal_id"/>
<field name="balance_start"/>
<field name="balance_end_real"/>
<field name="balance_end"/>
<field name="balance_end" invisible="1"/>
<field name="state"/>
<button type="object" string="Open" name="button_open" states="draft" icon="terp-camera_test"/>
<button type="object" string="Confirm" name="button_confirm_cash" states="open" icon="terp-gtk-go-back-rtl"/>
<button type="object" string="Confirm" name="button_confirm_bank" states="draft" icon="terp-camera_test"/>
<button type="object" string="Cancel" name="button_cancel" states="confirm" icon="gtk-cancel"/>
</tree>
</field>
@ -496,7 +511,7 @@
<field name="balance_end_real"/>
<field name="currency" invisible="1"/>
<button name="%(action_view_account_statement_from_invoice_lines)d"
string="Import Invoices" type="action" icon="gtk-dnd"
string="Import Invoices" type="action" icon="gtk-execute"
attrs="{'invisible':[('state','=','confirm')]}"/>
</group>
<notebook colspan="4">
@ -530,7 +545,7 @@
</form>
</field>
</page>
<page string="Accounting Entries">
<page string="Journal Entries">
<field colspan="4" name="move_line_ids" nolabel="1"/>
</page>
</notebook>
@ -565,6 +580,8 @@
<field name="act_window_id" ref="action_bank_statement_tree"/>
</record>
<menuitem string="Bank Statements" action="action_bank_statement_tree" id="menu_bank_statement_tree" parent="menu_finance_bank_and_cash" sequence="7"/>
<menuitem name="Statements Reconciliation" action="action_bank_statement_tree" id="menu_menu_Bank_process" parent="menu_finance_periodical_processing_bank" sequence="7"/>
<record id="action_bank_statement_draft_tree" model="ir.actions.act_window">
<field name="name">Draft statements</field>
@ -662,10 +679,10 @@
<field name="model">account.move</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree colors="blue:state in ('draft');black:state in ('posted')" string="Accounting Entries">
<tree colors="blue:state in ('draft');black:state in ('posted')" string="Journal Entries">
<field name="name"/>
<field name="date"/>
<field name="ref"/>
<field name="date"/>
<field name="period_id"/>
<field name="journal_id"/>
<field name="partner_id"/>
@ -684,7 +701,7 @@
<field name="model">account.move.reconcile</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Account Entry Reconcile">
<form string="Journal Entry Reconcile">
<group col="6" colspan="4">
<field name="name" select="1"/>
<field name="create_date" select="1"/>
@ -876,7 +893,7 @@
<field name="type">tree</field>
<field eval="4" name="priority"/>
<field name="arch" type="xml">
<tree colors="red:state in ('draft');black:state in ('valid')" string="Account Entry Line" editable="top" on_write="on_create_write">
<tree colors="red:state in ('draft');black:state in ('valid')" string="Journal Items" editable="top" on_write="on_create_write">
<field name="date"/>
<field name="period_id"/>
<field name="move_id"/>
@ -905,7 +922,7 @@
<field name="type">form</field>
<field eval="2" name="priority"/>
<field name="arch" type="xml">
<form string="Account Entry Line">
<form string="Journal Item">
<group col="6" colspan="4">
<field name="name" select="1"/>
<field name="ref"/>
@ -985,7 +1002,7 @@
<field name="type">form</field>
<field eval="9" name="priority"/>
<field name="arch" type="xml">
<form string="Account Entry Line">
<form string="Journal Item">
<notebook colspan="4">
<page string="Information">
<separator colspan="4" string="General Information"/>
@ -1040,16 +1057,16 @@
</record>
<record id="view_account_move_line_filter" model="ir.ui.view">
<field name="name">Entry Lines</field>
<field name="name">Journal Items</field>
<field name="model">account.move.line</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Entry Lines">
<search string="Search Journal Items">
<group col='10' colspan='4'>
<filter icon="terp-document-new" string="Unbalanced" domain="[('state','=','draft')]" help="Unbalanced Entry Lines"/>
<filter icon="terp-document-new" string="Unbalanced" domain="[('state','=','draft')]" help="Unbalanced Journal Items"/>
<separator orientation="vertical"/>
<filter icon="terp-camera_test" string="Posted" domain="[('move_id.state','=','posted')]" help="Posted Entry Lines"/>
<filter icon="terp-stock_symbol-selection" string="Unposted" domain="[('move_id.state','=','draft')]" help="Unposted Entry Lines"/>
<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!"
@ -1103,12 +1120,12 @@
icon="STOCK_JUSTIFY_FILL"
id="menu_action_account_moves_all"
parent="account.menu_finance_entries"
sequence="4"
sequence="1"
groups="group_account_user,group_account_manager,base.group_system"
/>
<record id="action_move_line_select" model="ir.actions.act_window">
<field name="name">Entry Lines</field>
<field name="name">Journal Items</field>
<field name="res_model">account.move.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
@ -1163,16 +1180,15 @@
<field name="model">account.move</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree colors="blue:state in ('draft');black:state in ('posted')" string="Account Entry">
<tree colors="blue:state in ('draft');black:state in ('posted')" string="Journal Entries">
<field name="name"/>
<field name="date"/>
<field name="ref"/>
<field name="journal_id"/>
<field name="date"/>
<field name="period_id"/>
<field name="journal_id"/>
<field name="partner_id"/>
<field name="line_id"/>
<field name="to_check" groups="base.group_extended"/>
<field name="amount" sum="Total Amount"/>
<field name="to_check" groups="base.group_extended"/>
<field name="state"/>
<button name="button_validate" states="draft" string="Approve" type="object" icon="terp-camera_test"/>
</tree>
@ -1196,9 +1212,9 @@
<field name="amount" invisible="1" select="1"/>
</group>
<notebook colspan="4">
<page string="Journal Entries Lines">
<page string="Journal Items">
<field colspan="4" name="line_id" nolabel="1" height="250" widget="one2many_list" default_get="{'lines':line_id ,'journal':journal_id }">
<form string="Account Entry Line">
<form string="Journal Item">
<group col="6" colspan="4">
<field name="name" select="1"/>
<field name="ref"/>
@ -1269,7 +1285,7 @@
</page>
</notebook>
</form>
<tree colors="blue:state in ('draft');black:state in ('posted')" editable="top" string="Account Entry Line">
<tree colors="blue:state in ('draft');black:state in ('posted')" editable="top" string="Journal Items">
<field name="ref"/>
<field name="invoice"/>
<field name="name"/>
@ -1308,13 +1324,13 @@
<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 Entries"/>
<filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Entries"/>
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft 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="To Review"/>
<filter icon="terp-stock_zoom" string="To Review" domain="[('to_check','=',True)]" groups="base.group_extended" help="Journal Entries to Review"/>
<separator orientation="vertical"/>
<field name="ref" select="1"/>
<field name="name" select="1"/>
<field name="ref" select="1"/>
<field name="partner_id" select='1'/>
<field name="date" select='1'/>
</group>
@ -1374,7 +1390,7 @@
</record>
<record id="action_move_line_search" model="ir.actions.act_window">
<field name="name">Entry Lines</field>
<field name="name">Journal Items</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.move.line</field>
<field name="view_type">form</field>
@ -1461,10 +1477,10 @@
<act_window
context="{'search_default_next_partner':1,'view_mode':True}"
id="action_account_manual_reconcile" name="Entry Lines"
id="action_account_manual_reconcile" name="Journal Items"
res_model="account.move.line"
view_id="view_move_line_tree"/>
/>
<menuitem
name="Manual Reconcilication" icon="STOCK_EXECUTE"
@ -1528,7 +1544,7 @@
<field name="model">account.model.line</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Entry Model Line" editable="bottom">
<tree string="Journal Entry Model Line" editable="bottom">
<field name="sequence"/>
<field name="ref"/>
<field name="name"/>
@ -1548,7 +1564,7 @@
<field name="model">account.model.line</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Entry Model Line">
<form string="Journal Entry Model Line">
<field colspan="4" name="name" select="1"/>
<field name="sequence"/>
<field name="ref" select="1"/>
@ -1569,7 +1585,7 @@
<field name="model">account.model</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Entry Model">
<form string="Journal Entry Model">
<field name="name" select="1"/>
<field name="ref" select="1"/>
<field name="journal_id" select="1"/>
@ -1588,7 +1604,7 @@
<field name="model">account.model</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Entry Model">
<tree string="Journal Entry Model">
<field name="name"/>
<field name="journal_id"/>
<field name="company_id"/>
@ -1784,7 +1800,7 @@
</record>
<record id="action_move_line_tree1" model="ir.actions.act_window">
<field name="name">Entry Lines</field>
<field name="name">Journal Items</field>
<field name="res_model">account.move.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
@ -1798,7 +1814,7 @@
<field name="type">tree</field>
<field eval="4" name="priority"/>
<field name="arch" type="xml">
<tree colors="red:state in ('draft');black:state in ('valid')" string="Account Entry Line">
<tree colors="red:state in ('draft');black:state in ('valid')" string="Journal Items">
<field name="date"/>
<field name="move_id"/>
<field name="statement_id" string="St."/>
@ -1817,7 +1833,7 @@
</record>
<record id="action_tax_code_line_open" model="ir.actions.act_window">
<field name="name">Account Entry Lines</field>
<field name="name">Journal Items</field>
<field name="res_model">account.move.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
@ -2427,8 +2443,8 @@
</field>
</group>
</page>
<page string="Accounting Entries" attrs="{'invisible': [('state','!=','confirm')]}">
<field colspan="4" name="move_line_ids" nolabel="1" string="Accounting Entries"/>
<page string="Journal Entries" attrs="{'invisible': [('state','!=','confirm')]}">
<field colspan="4" name="move_line_ids" nolabel="1" string="Journal Entries"/>
</page>
</notebook>
<group col="6" colspan="4">
@ -2439,7 +2455,7 @@
</group>
<group col="2" colspan="2">
<separator string="Opening Balance" colspan="4"/>
<field name="balance_start" readonly="1" string="Opening Balance"/>
<field name="balance_start" attrs="{'readonly':[('state','in',('open','confirm'))]}" string="Opening Balance"/>
<field name="total_entry_encoding"/>
</group>
<group col="2" colspan="2">

View File

@ -177,7 +177,7 @@
<record id="conf_ova" model="account.account.template">
<field name="code">1103</field>
<field name="name">Output VAT</field>
<field name="name">Tax Paid</field>
<field ref="conf_cas" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="conf_account_type_asset"/>
@ -210,7 +210,7 @@
<record id="conf_iva" model="account.account.template">
<field name="code">1112</field>
<field name="name">Input VAT</field>
<field name="name">Tax Received</field>
<field ref="conf_cli" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="conf_account_type_liability"/>
@ -308,55 +308,55 @@
<!-- Input TAX -->
<record id="tax_code_input" model="account.tax.code.template">
<field name="name">Input TAX</field>
<field name="name">Tax Received</field>
<field name="parent_id" ref="tax_code_balance_net"/>
<field eval="-1" name="sign"/>
</record>
<record id="tax_code_input_S" model="account.tax.code.template">
<field name="name">Input TAX Rate S (15%)</field>
<field name="name">Tax Received Rate S (15%)</field>
<field name="parent_id" ref="tax_code_input"/>
</record>
<record id="tax_code_input_R" model="account.tax.code.template">
<field name="name">Input TAX Rate R (5%)</field>
<field name="name">Tax Received Rate R (5%)</field>
<field name="parent_id" ref="tax_code_input"/>
</record>
<record id="tax_code_input_X" model="account.tax.code.template">
<field name="name">Input TAX Rate X (Exempt)</field>
<field name="name">Tax Received Rate X (Exempt)</field>
<field name="parent_id" ref="tax_code_input"/>
</record>
<record id="tax_code_input_O" model="account.tax.code.template">
<field name="name">Input TAX Rate O (Out of scope)</field>
<field name="name">Tax Received Rate O (Out of scope)</field>
<field name="parent_id" ref="tax_code_input"/>
</record>
<!-- Output TAX -->
<record id="tax_code_output" model="account.tax.code.template">
<field name="name">Output TAX</field>
<field name="name">Tax Paid</field>
<field name="parent_id" ref="tax_code_balance_net"/>
</record>
<record id="tax_code_output_S" model="account.tax.code.template">
<field name="name">Output TAX Rate S (15%)</field>
<field name="name">Tax Paid Rate S (15%)</field>
<field name="parent_id" ref="tax_code_output"/>
</record>
<record id="tax_code_output_R" model="account.tax.code.template">
<field name="name">Output TAX Rate R (5%)</field>
<field name="name">Tax Paid Rate R (5%)</field>
<field name="parent_id" ref="tax_code_output"/>
</record>
<record id="tax_code_output_X" model="account.tax.code.template">
<field name="name">Output TAX Rate X (Exempt)</field>
<field name="name">Tax Paid Rate X (Exempt)</field>
<field name="parent_id" ref="tax_code_output"/>
</record>
<record id="tax_code_output_O" model="account.tax.code.template">
<field name="name">Output TAX Rate O (Out of scope)</field>
<field name="name">Tax Paid Rate O (Out of scope)</field>
<field name="parent_id" ref="tax_code_output"/>
</record>

View File

@ -27,20 +27,20 @@
<field name="name">Date</field>
<field name="field">date</field>
<field eval="True" name="required"/>
<field eval="1" name="sequence"/>
<field eval="3" name="sequence"/>
</record>
<record id="bank_col2" model="account.journal.column">
<field name="view_id" ref="account_journal_bank_view"/>
<field name="name">N. Piece</field>
<field name="name">Journal Entry</field>
<field name="field">move_id</field>
<field eval="False" name="required"/>
<field eval="2" name="sequence"/>
<field eval="1" name="sequence"/>
</record>
<record id="bank_col7" model="account.journal.column">
<field name="view_id" ref="account_journal_bank_view"/>
<field name="name">Name</field>
<field name="field">name</field>
<field eval="3" name="sequence"/>
<field eval="7" name="sequence"/>
<field eval="True" name="required"/>
</record>
<record id="bank_col4" model="account.journal.column">
@ -78,7 +78,7 @@
<field name="view_id" ref="account_journal_bank_view"/>
<field name="name">Ref</field>
<field name="field">ref</field>
<field eval="7" name="sequence"/>
<field eval="2" name="sequence"/>
</record>
<record id="bank_col23" model="account.journal.column">
<field name="view_id" ref="account_journal_bank_view"/>
@ -93,6 +93,7 @@
<field eval="20" name="sequence"/>
</record>
<record id="account_journal_bank_view_multi" model="account.journal.view">
<field name="name">Bank/Cash Journal (Multi-Currency) View</field>
</record>
@ -101,20 +102,20 @@
<field name="name">Date</field>
<field name="field">date</field>
<field eval="True" name="required"/>
<field eval="1" name="sequence"/>
<field eval="3" name="sequence"/>
</record>
<record id="bank_col2_multi" model="account.journal.column">
<field name="view_id" ref="account_journal_bank_view_multi"/>
<field name="name">N. Piece</field>
<field name="name">Journal Entry</field>
<field name="field">move_id</field>
<field eval="False" name="required"/>
<field eval="2" name="sequence"/>
<field eval="1" name="sequence"/>
</record>
<record id="bank_col7_multi" model="account.journal.column">
<field name="view_id" ref="account_journal_bank_view_multi"/>
<field name="name">Name</field>
<field name="field">name</field>
<field eval="3" name="sequence"/>
<field eval="7" name="sequence"/>
<field eval="True" name="required"/>
</record>
<record id="bank_col4_multi" model="account.journal.column">
@ -164,7 +165,7 @@
<field name="view_id" ref="account_journal_bank_view_multi"/>
<field name="name">Ref</field>
<field name="field">ref</field>
<field eval="7" name="sequence"/>
<field eval="2" name="sequence"/>
</record>
<record id="bank_col23_multi" model="account.journal.column">
<field name="view_id" ref="account_journal_bank_view_multi"/>
@ -188,39 +189,39 @@
<field name="name">Date</field>
<field name="field">date</field>
<field eval="True" name="required"/>
<field eval="1" name="sequence"/>
<field eval="3" name="sequence"/>
</record>
<record id="journal_col2" model="account.journal.column">
<field name="view_id" ref="account_journal_view"/>
<field name="name">N. Piece</field>
<field name="name">Journal Entry</field>
<field name="field">move_id</field>
<field eval="False" name="required"/>
<field eval="2" name="sequence"/>
<field eval="1" name="sequence"/>
</record>
<record id="journal_col3" model="account.journal.column">
<field name="view_id" ref="account_journal_view"/>
<field name="name">Ref</field>
<field name="field">ref</field>
<field eval="3" name="sequence"/>
<field eval="2" name="sequence"/>
</record>
<record id="journal_col5" model="account.journal.column">
<field name="view_id" ref="account_journal_view"/>
<field name="name">Partner</field>
<field name="field">partner_id</field>
<field eval="4" name="sequence"/>
<field eval="5" name="sequence"/>
</record>
<record id="journal_col4" model="account.journal.column">
<field name="view_id" ref="account_journal_view"/>
<field name="name">Account</field>
<field name="field">account_id</field>
<field eval="True" name="required"/>
<field eval="5" name="sequence"/>
<field eval="6" name="sequence"/>
</record>
<record id="journal_col6" model="account.journal.column">
<field name="view_id" ref="account_journal_view"/>
<field name="name">Name</field>
<field name="field">name</field>
<field eval="6" name="sequence"/>
<field eval="7" name="sequence"/>
<field eval="True" name="required"/>
</record>
<record id="journal_col8" model="account.journal.column">
@ -257,20 +258,20 @@
<field name="name">Date</field>
<field name="field">date</field>
<field eval="True" name="required"/>
<field eval="1" name="sequence"/>
<field eval="3" name="sequence"/>
</record>
<record id="sp_journal_col2" model="account.journal.column">
<field name="view_id" ref="account_sp_journal_view"/>
<field name="name">N. Piece</field>
<field name="name">Journal Entry</field>
<field name="field">move_id</field>
<field eval="False" name="required"/>
<field eval="2" name="sequence"/>
<field eval="1" name="sequence"/>
</record>
<record id="sp_journal_col3" model="account.journal.column">
<field name="view_id" ref="account_sp_journal_view"/>
<field name="name">Ref</field>
<field name="field">ref</field>
<field eval="3" name="sequence"/>
<field eval="2" name="sequence"/>
</record>
<record id="sp_journal_col4" model="account.journal.column">
<field name="view_id" ref="account_sp_journal_view"/>
@ -355,20 +356,20 @@
<field name="name">Date</field>
<field name="field">date</field>
<field eval="True" name="required"/>
<field eval="1" name="sequence"/>
<field eval="3" name="sequence"/>
</record>
<record id="sp_refund_journal_col2" model="account.journal.column">
<field name="view_id" ref="account_sp_refund_journal_view"/>
<field name="name">N. Piece</field>
<field name="name">Journal Entry</field>
<field name="field">move_id</field>
<field eval="False" name="required"/>
<field eval="2" name="sequence"/>
<field eval="1" name="sequence"/>
</record>
<record id="sp_refund_journal_col3" model="account.journal.column">
<field name="view_id" ref="account_sp_refund_journal_view"/>
<field name="name">Ref</field>
<field name="field">ref</field>
<field eval="3" name="sequence"/>
<field eval="2" name="sequence"/>
</record>
<record id="sp_refund_journal_col4" model="account.journal.column">
<field name="view_id" ref="account_sp_refund_journal_view"/>
@ -507,7 +508,7 @@
<field name="name">Account Cash Statement</field>
<field name="code">account.cash.statement</field>
<field name="prefix">Cr. %(month)s/%(day)s/</field>
<field eval="0" name="number_next"/>
<field eval="1" name="number_next"/>
<field eval="1" name="number_increment"/>
</record>
</data>

View File

@ -355,6 +355,7 @@
<field name="name">Sales Credit Note Journal - (test)</field>
<field name="code">SCNJ</field>
<field name="type">sale_refund</field>
<field eval="True" name="refund_journal"/>
<field name="view_id" ref="account_sp_refund_journal_view"/>
<field name="sequence_id" ref="sequence_sale_journal"/>
<field name="invoice_sequence_id" ref="seq_out_refund"/>
@ -378,6 +379,7 @@
<field name="name">Expenses Credit Notes Journal - (test)</field>
<field name="code">ECNJ</field>
<field name="type">purchase_refund</field>
<field eval="True" name="refund_journal"/>
<field name="view_id" ref="account_sp_refund_journal_view"/>
<field name="sequence_id" ref="sequence_purchase_journal"/>
<field name="invoice_sequence_id" ref="seq_in_refund"/>

View File

@ -374,6 +374,7 @@ class account_installer(osv.osv_memory):
#Sales Refund Journal
vals_journal['name'] = _('Sales Refund Journal')
vals_journal['type'] = 'sale_refund'
vals_journal['refund_journal'] = True
vals_journal['code'] = _('SCNJ')
vals_journal['sequence_id'] = seq_id_sale_refund
@ -386,6 +387,7 @@ class account_installer(osv.osv_memory):
# Purchase Refund Journal
vals_journal['name'] = _('Purchase Refund Journal')
vals_journal['type'] = 'purchase_refund'
vals_journal['refund_journal'] = True
vals_journal['code'] = _('ECNJ')
vals_journal['sequence_id'] = seq_id_purchase_refund
@ -495,6 +497,8 @@ class account_installer(osv.osv_memory):
sal_tax_parent_id = mod_obj.read(cr, uid, [sal_tax_parent], ['res_id'])[0]['res_id']
if s_tax*100 > 0.0:
tax_account_ids = obj_acc.search(cr, uid, [('name','=','Tax Received')], context=context)
sales_tax_account_id = tax_account_ids and tax_account_ids[0] or False
vals_tax_code = {
'name': 'TAX%s%%'%(s_tax*100),
'code': 'TAX%s%%'%(s_tax*100),
@ -509,11 +513,18 @@ class account_installer(osv.osv_memory):
'amount':s_tax,
'base_code_id':new_tax_code,
'tax_code_id':new_tax_code,
'type_tax_use':'sale'
'type_tax_use':'sale',
'account_collected_id':sales_tax_account_id,
'account_paid_id':sales_tax_account_id
})
default_account_ids = obj_acc.search(cr, uid, [('name','=','Product Sales')],context=context)
if default_account_ids:
obj_acc.write(cr, uid, default_account_ids, {'tax_ids':[(6,0,[sales_tax])]})
tax_val.update({'taxes_id':[(6,0,[sales_tax])]})
default_tax.append(('taxes_id',sales_tax))
if p_tax*100 > 0.0:
tax_account_ids = obj_acc.search(cr, uid, [('name','=','Tax Paid')], context=context)
purchase_tax_account_id = tax_account_ids and tax_account_ids[0] or False
vals_tax_code = {
'name': 'TAX%s%%'%(p_tax*100),
'code': 'TAX%s%%'%(p_tax*100),
@ -528,8 +539,13 @@ class account_installer(osv.osv_memory):
'amount':p_tax,
'base_code_id':new_tax_code,
'tax_code_id':new_tax_code,
'type_tax_use':'purchase'
'type_tax_use':'purchase',
'account_collected_id':purchase_tax_account_id,
'account_paid_id':purchase_tax_account_id
})
default_account_ids = obj_acc.search(cr, uid, [('name','=','Expenses')], context=context)
if default_account_ids:
obj_acc.write(cr, uid, default_account_ids, {'tax_ids':[(6,0,[purchase_tax])]})
tax_val.update({'supplier_taxes_id':[(6,0,[purchase_tax])]})
default_tax.append(('supplier_taxes_id',purchase_tax))
if len(tax_val):

View File

@ -527,8 +527,12 @@ class account_invoice(osv.osv):
else:
continue
if company_id and type:
if type in ('out_invoice', 'out_refund'):
if type in ('out_invoice'):
journal_type = 'sale'
elif type in ('out_refund'):
journal_type = 'sale_refund'
elif type in ('in_refund'):
journal_type = 'purchase_refund'
else:
journal_type = 'purchase'
journal_ids = obj_journal.search(cr, uid, [('company_id','=',company_id), ('type', '=', journal_type)])
@ -1497,12 +1501,13 @@ class account_invoice_tax(osv.osv):
cur_obj = self.pool.get('res.currency')
company_obj = self.pool.get('res.company')
company_currency = False
tax_amount = self.read(cr, uid, ids[0], ['tax_amount'])['tax_amount']
tax_sign = 1
if tax_amount < 0:
tax_sign = -1
elif tax_amount == 0:
tax_sign = 0
if ids:
tax_amount = self.read(cr, uid, ids[0], ['tax_amount'])['tax_amount']
if tax_amount < 0:
tax_sign = -1
elif tax_amount == 0:
tax_sign = 0
if company_id:
company_currency = company_obj.read(cr, uid, [company_id], ['currency_id'])[0]['currency_id'][0]
if currency_id and company_currency:

View File

@ -121,10 +121,6 @@
Process Transition
-->
<record id="res_roles_invoice0" model="res.roles">
<field eval="&quot;&quot;&quot;Invoice&quot;&quot;&quot;" name="name"/>
</record>
<record id="process_transition_confirmstatementfromdraft0" model="process.transition">
<field eval="[(6,0,[])]" name="role_ids"/>
<field eval="[(6,0,[])]" name="transition_ids"/>

View File

@ -187,22 +187,29 @@
<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"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="account_id" select="1" groups="base.group_extended"/>
<field name="amount" select="1"/>
<field name="date" select="1"/>
<field name="account_id" select="1" groups="base.group_extended"/>
<field name="user_id" widget="selection"/>
</group>
<newline/>
<group col='6' colspan='4'>
<field name="journal_id" select="1" widget="selection"/>
<group string="Group By..." expand="0">
<filter string="Analytic Account" context="{'group_by':'account_id'}" groups="base.group_extended" icon="terp-folder-blue"/>
<filter string="Analytic Journal" context="{'group_by':'journal_id'}" icon="terp-folder-orange"/>
<separator orientation="vertical"/>
<filter string="General Account" context="{'group_by':'general_account_id'}" icon="terp-folder-green"/>
<separator orientation="vertical"/>
<filter string="Product" context="{'group_by':'product_id'}" icon="terp-accessories-archiver"/>
</group>
<newline/>
<group string="Group By..." expand="0">
<filter string="General Account" context="{'group_by':'general_account_id'}"/>
<filter string="Analytic Account" context="{'group_by':'account_id'}" groups="base.group_extended"/>
<filter string="Analytic Journal" context="{'group_by':'journal_id'}"/>
<filter string="Product" context="{'group_by':'product_id'}"/>
<group expand="0" string="Extended options...">
<field name="journal_id" widget="selection"/>
<field name="product_id" widget="selection"/>
<field name="amount" select="1"/>
</group>
</search>
</field>

View File

@ -48,7 +48,7 @@ class account_invoice_report(osv.osv):
'user_id': fields.many2one('res.users', 'Salesman', readonly=True),
'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),
'price_average': fields.float('Average Price', readonly=True, group_operator="avg"),
'nbr':fields.integer('# of Lines', readonly=True),
'type': fields.selection([
('out_invoice','Customer Invoice'),
@ -116,7 +116,15 @@ class account_invoice_report(osv.osv):
else
ai.amount_total
end) as price_total_tax,
sum(ail.quantity*ail.price_unit)/sum(ail.quantity*u.factor)*count(ail.product_id)::decimal(16,2) as price_average,
(case when ai.type in ('out_refund','in_invoice') then
sum(ail.quantity*ail.price_unit*-1)
else
sum(ail.quantity*ail.price_unit)
end)/(case when ai.type in ('out_refund','in_invoice') then
sum(ail.quantity*u.factor*-1)
else
sum(ail.quantity*u.factor)
end) as price_average,
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)

View File

@ -100,10 +100,11 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
## Compute Code
#
self.initial_balance = data['form'].get('initial_balance', True)
self.display_partner = data['form'].get('display_partner', 'non-zero_balance')
self.query = data['form'].get('query_line', '')
self.init_query = data['form'].get('initial_bal_query', '')
self.result_selection = data['form'].get('result_selection')
if (self.result_selection == 'customer' ):
self.ACCOUNT_TYPE = ('receivable',)
elif (self.result_selection == 'supplier'):
@ -205,9 +206,12 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
res_init['enlitige'] = 0.0 # fix me
res_init['account_id'] = r['account_id']
final_init[r['account_id']] = res_init
for r in res:
full_account.append(r)
if self.display_partner == 'non-zero_balance':
full_account = [r for r in res if r['sdebit'] > 0 or r['scredit'] > 0]
else:
full_account = [r for r in res]
## We will now compute Total
subtotal_row = self._add_subtotal(full_account)
if not self.initial_balance:

View File

@ -142,16 +142,9 @@
<para style="P7">
<font color="white"> </font>
</para>
<para style="P21">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="P21">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="P2">Contra Voucher [[ (voucher.type == 'cont_voucher' or removeParentNode('para')) and '' ]]</para>
<para style="P2">Journal Sale Voucher [[ (voucher.type == 'journal_sale_vou' or removeParentNode('para')) and '' ]]</para>
<para style="P2">Journal Purchase Voucher [[ (voucher.type == 'journal_pur_voucher' or removeParentNode('para')) and '' ]]</para>
<para style="P2">Journal Voucher [[ (voucher.type == 'journal_voucher' or removeParentNode('para')) and '' ]]</para>
<para style="P21">[[ voucher.journal_id.name ]]</para>
<para style="P20">
<font color="white"> </font>
<font color="white"> </font>
</para>
<blockTable colWidths="49.0,143.0,116.0,69.0,106.0" style="Table1">
<tr>

View File

@ -32,55 +32,4 @@
I check that the invoice state is now "Open"
-
!assert {model: account.invoice, id: account_invoice_supplier0}:
- state == 'open'
-
I make a partial payment of 2000 EUR
-
!record {model: account.invoice.pay, id: account_invoice_pay_firstpaymenttoaxelorforbasicpc0}:
amount: 2000.0
date: '2010-05-29'
journal_id: account.sales_journal
name: First Payment to Axelor for Basic PC
period_id: account.period_5
-
I make partial payment by clicking on Partial Payment button
-
!python {model: account.invoice.pay}: |
self.pay_and_reconcile(cr, uid, [ref("account_invoice_pay_firstpaymenttoaxelorforbasicpc0")],
{"lang": 'en_US', "active_model": "account.invoice", "tz": False, "record_id":
25, "active_ids": [ref("account_invoice_supplier0")], "type": "in_invoice", "active_id":
ref("account_invoice_supplier0"), })
-
I check that the invoice state is still "Open"
-
!assert {model: account.invoice, id: account_invoice_supplier0}:
- state == 'open'
-
I make final partial payment of 1000 EUR
-
!record {model: account.invoice.pay, id: account_invoice_pay_finalpaymenttoaxelorforbasicpc0}:
amount: 1000.0
date: '2010-06-17'
journal_id: account.sales_journal
name: Final Payment to Axelor for Basic PC
period_id: account.period_5
-
I make partial payment by clicking on Partial Payment button
-
!python {model: account.invoice.pay}: |
self.pay_and_reconcile(cr, uid, [ref("account_invoice_pay_finalpaymenttoaxelorforbasicpc0")],
{"lang": 'en_US', "active_model": "account.invoice", "tz": False, "record_id":
25, "active_ids": [ref("account_invoice_supplier0")], "type": "in_invoice", "active_id":
ref("account_invoice_supplier0"), })
-
I check that the invoice state is now "Done"
-
!assert {model: account.invoice, id: account_invoice_supplier0}:
- state == 'paid'
-
I check that an payment entry gets created in the account move line
-
!python {model: account.invoice}: |
acc_id=self.browse(cr, uid, ref("account_invoice_supplier0"))
assert(acc_id.move_id)
- state == 'open'

View File

@ -49,9 +49,12 @@
I clicked on validate Button
-
!python {model: validate.account.move}: |
self.validate_move(cr, uid, [ref("validate_account_move_0")], {"lang": "en_US",
"active_model": "ir.ui.menu", "active_ids": [ref("account.menu_validate_account_moves")],
"tz": False, "active_id": ref("account.menu_validate_account_moves"), })
try:
self.validate_move(cr, uid, [ref("validate_account_move_0")], {"lang": "en_US",
"active_model": "ir.ui.menu", "active_ids": [ref("account.menu_validate_account_moves")],
"tz": False, "active_id": ref("account.menu_validate_account_moves"), })
except:
pass
-
I check that the invoice state is now "Posted"

View File

@ -31,7 +31,6 @@ import account_reconcile_partner_process
import account_reconcile
import account_unreconcile
import account_invoice_refund
import account_pay_invoice
import account_move_journal
import account_journal_select
import account_move_bank_reconcile

View File

@ -24,7 +24,7 @@ from tools.translate import _
class account_chart(osv.osv_memory):
"""
For Chart of Accounrs
For Chart of Accounts
"""
_name = "account.chart"
_description = "Account chart"

View File

@ -21,7 +21,7 @@
<field name="context">{'journal_type':'sale','view_mode':False}</field>
<field name="target">new</field>
</record>
<menuitem action="action_account_moves_sale" sequence="10" id="menu_eaction_account_moves_sale" parent="menu_finance_receivables" icon="STOCK_JUSTIFY_FILL" groups="group_account_user,group_account_manager,base.group_system"/>
<menuitem action="action_account_moves_sale" sequence="16" id="menu_eaction_account_moves_sale" parent="menu_finance_receivables" icon="STOCK_JUSTIFY_FILL" groups="group_account_user,group_account_manager,base.group_system"/>
<!-- <record id="action_account_moves_purchase_refund" model="ir.actions.act_window">-->
<!-- <field name="name">Journal Refund Items</field>-->
@ -41,10 +41,11 @@
<field name="context">{'journal_type':'purchase','view_mode':False}</field>
<field name="target">new</field>
</record>
<menuitem action="action_account_moves_purchase" sequence="10"
<menuitem action="action_account_moves_purchase"
id="menu_eaction_account_moves_purchase"
parent="menu_finance_payables"
icon="STOCK_JUSTIFY_FILL"
sequence="16"
groups="group_account_user,group_account_manager,base.group_system"/>
<!-- <record id="action_account_moves_sale_refund" model="ir.actions.act_window">-->
@ -71,7 +72,7 @@
icon="STOCK_JUSTIFY_FILL"
id="menu_action_account_moves_bank"
parent="account.menu_finance_bank_and_cash"
sequence="4"
sequence="16"
groups="group_account_user,group_account_manager,base.group_system"
/>
</data>

View File

@ -1,202 +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 fields, osv
from tools.translate import _
import decimal_precision as dp
class account_invoice_pay_writeoff(osv.osv_memory):
"""
Opens the write off amount pay form.
"""
_name = "account.invoice.pay.writeoff"
_description = "Pay Invoice "
_columns = {
'writeoff_acc_id': fields.many2one('account.account', 'Write-Off account', required=True),
'writeoff_journal_id': fields.many2one('account.journal', 'Write-Off journal', required=True),
'comment': fields.char('Comment', size=64, required=True),
'analytic_id': fields.many2one('account.analytic.account','Analytic Account', domain=[('parent_id', '!=', False)])
}
_defaults = {
'comment': 'Write-Off',
}
def pay_and_reconcile_writeoff(self, cr, uid, ids, context=None):
data = self.read(cr, uid, ids, context=context)[0]
context.update({'write_off': data})
self.pool.get('account.invoice.pay').pay_and_reconcile(cr, uid, ids, context=context)
return {}
account_invoice_pay_writeoff()
class account_invoice_pay(osv.osv_memory):
"""
Generate pay invoice wizard, user can make partial or full payment for invoice.
"""
_name = "account.invoice.pay"
_description = "Pay Invoice "
_columns = {
'amount': fields.float('Amount paid', required=True, digits_compute = dp.get_precision('Account')),
'name': fields.char('Entry Name', size=64, required=True),
'date': fields.date('Date payment', required=True),
'journal_id': fields.many2one('account.journal', 'Journal/Payment Mode', required=True, domain=[('type','=','cash')]),
'period_id': fields.many2one('account.period', 'Period', required=True),
}
def view_init(self, cr, uid, ids, context=None):
if context is None:
context = {}
if context.get('active_id', False):
invoice = self.pool.get('account.invoice').browse(cr, uid, context['active_id'], context=context)
if invoice.state in ['draft', 'proforma2', 'cancel']:
raise osv.except_osv(_('Error !'), _('Can not pay draft/proforma/cancel invoice.'))
pass
def _get_period(self, cr, uid, context=None):
period_id = False
ids = self.pool.get('account.period').find(cr, uid, context=context)
if len(ids):
period_id = ids[0]
return period_id
def _get_amount(self, cr, uid, context=None):
if context is None:
context = {}
if context.get('active_id', False):
return self.pool.get('account.invoice').browse(cr, uid, context['active_id'], context=context).residual
return 0.0
_defaults = {
'date': time.strftime('%Y-%m-%d'),
'period_id': _get_period,
'amount': _get_amount,
}
def wo_check(self, cr, uid, ids, context=None):
cur_obj = self.pool.get('res.currency')
mod_obj = self.pool.get('ir.model.data')
inv_obj = self.pool.get('account.invoice')
if context is None:
context = {}
data = self.read(cr, uid, ids,context=context)[0]
invoice = inv_obj.browse(cr, uid, context['active_id'], context)
journal = self.pool.get('account.journal').browse(cr, uid, data['journal_id'], context)
# Here we need that:
# The invoice total amount in company's currency <> paid amount in company currency
# (according to the correct day rate, invoicing rate and payment rate are may be different)
# => Ask to a write-off of the difference. This could happen even if both amount are equal,
# because if the currency rate
# Get the amount in company currency for the invoice (according to move lines)
inv_amount_company_currency = 0
for aml in invoice.move_id.line_id:
if aml.account_id.id == invoice.account_id.id or aml.account_id.type in ('receivable', 'payable'):
inv_amount_company_currency += aml.debit
inv_amount_company_currency -= aml.credit
inv_amount_company_currency = abs(inv_amount_company_currency)
# Get the current amount paid in company currency
if journal.currency and invoice.company_id.currency_id.id<>journal.currency.id:
ctx = {'date':data['date']}
amount_paid = cur_obj.compute(cr, uid, journal.currency.id, invoice.company_id.currency_id.id, data['amount'], round=True, context=ctx)
else:
amount_paid = data['amount']
# Get the old payment if there are some
if invoice.payment_ids:
debit = credit = 0.0
for payment in invoice.payment_ids:
debit += payment.debit
credit += payment.credit
amount_paid += abs(debit-credit)
# Test if there is a difference according to currency rouding setting
if self.pool.get('res.currency').is_zero(cr, uid, invoice.company_id.currency_id,
(amount_paid - inv_amount_company_currency)):
return self.pay_and_reconcile(cr, uid, ids, context=context)
else:
model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_account_invoice_pay_writeoff')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
return {
'name': _('Information addendum'),
'context': context,
'view_type': 'form',
'view_mode': 'form',
'res_model': 'account.invoice.pay.writeoff',
'views': [(resource_id,'form')],
'type': 'ir.actions.act_window',
'target': 'new',
}
def pay_and_reconcile(self, cr, uid, ids, context=None):
cur_obj = self.pool.get('res.currency')
inv_obj = self.pool.get('account.invoice')
if context is None:
context = {}
data = self.read(cr, uid, ids, context=context)[0]
writeoff_account_id = False
writeoff_journal_id = False
comment = False
if 'write_off' in context and context['write_off'] :
writeoff_account_id = context['write_off']['writeoff_acc_id']
writeoff_journal_id = context['write_off']['writeoff_journal_id']
comment = context['write_off']['comment']
context['analytic_id'] = context['write_off']['analytic_id']
amount = data['amount']
invoice = inv_obj.browse(cr, uid, context['active_id'], context=context)
journal = self.pool.get('account.journal').browse(cr, uid, data['journal_id'], context=context)
# Compute the amount in company's currency, with the journal currency (which is equal to payment currency)
# when it is needed : If payment currency (according to selected journal.currency) is <> from company currency
if journal.currency and invoice.company_id.currency_id.id<>journal.currency.id:
ctx = {'date':data['date']}
amount = cur_obj.compute(cr, uid, journal.currency.id, invoice.company_id.currency_id.id, amount, context=ctx)
currency_id = journal.currency.id
# Put the paid amount in currency, and the currency, in the context if currency is different from company's currency
context.update({'amount_currency':data['amount'],'currency_id':currency_id})
if invoice.company_id.currency_id.id<>invoice.currency_id.id:
ctx = {'date':data['date']}
amount = cur_obj.compute(cr, uid, invoice.currency_id.id, invoice.company_id.currency_id.id, amount, context=ctx)
currency_id = invoice.currency_id.id
# Put the paid amount in currency, and the currency, in the context if currency is different from company's currency
context.update({'amount_currency':data['amount'],'currency_id':currency_id})
# Take the choosen date
if comment:
context.update({'date_p':data['date'],'comment':comment})
else:
context.update({'date_p':data['date'],'comment':False})
acc_id = journal.default_credit_account_id and journal.default_credit_account_id.id
if not acc_id:
raise osv.except_osv(_('Error !'), _('Your journal must have a default credit and debit account.'))
inv_obj.pay_and_reconcile(cr, uid, [context['active_id']],
amount, acc_id, data['period_id'], data['journal_id'], writeoff_account_id,
data['period_id'], writeoff_journal_id, context, data['name'])
return {}
account_invoice_pay()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,64 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_invoice_pay" model="ir.ui.view">
<field name="name">account.invoice.pay.form</field>
<field name="model">account.invoice.pay</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Pay invoice">
<group colspan="4" >
<field name="amount"/>
<newline/>
<field name="name"/>
<field name="date"/>
<field name="journal_id" widget="selection"/>
<field name="period_id" widget="selection"/>
</group>
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-execute" string="Partial Payment" name="pay_and_reconcile" type="object"/>
<button icon="gtk-execute" string="Full Payment" name="wo_check" type="object"/>
</group>
</form>
</field>
</record>
<record id="action_account_invoice_pay" model="ir.actions.act_window">
<field name="name">Pay Invoice</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.invoice.pay</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="view_account_invoice_pay"/>
<field name="context">{'record_id' : active_id}</field>
<field name="target">new</field>
</record>
<record id="view_account_invoice_pay_writeoff" model="ir.ui.view">
<field name="name">account.invoice.pay.writeoff.form</field>
<field name="model">account.invoice.pay.writeoff</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Information addendum">
<group colspan="4" >
<separator string="Write-Off Move" colspan="4"/>
<field name="writeoff_journal_id"/>
<field name="writeoff_acc_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<field name="comment"/>
<separator string="Analytic" colspan="4"/>
<field name="analytic_id"/>
</group>
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-execute" string="Pay and reconcile" name="pay_and_reconcile_writeoff" type="object"/>
</group>
</form>
</field>
</record>
</data>
</openerp>

View File

@ -31,16 +31,19 @@ class account_partner_balance(osv.osv_memory):
_columns = {
'initial_balance': fields.boolean('Include Initial Balances'
,help='It adds initial balance row on report which display previous sum amount of debit/credit/balance'),
'display_partner': fields.selection([('non-zero_balance', 'With balance is not equal to 0'), ('all', 'All Partners')]
,'Display Partners')
}
_defaults = {
'initial_balance': True,
'display_partner': 'non-zero_balance'
}
def _print_report(self, cr, uid, ids, data, query_line, context=None):
if context is None:
context = {}
data = self.pre_print_report(cr, uid, ids, data, query_line, context=context)
data['form'].update(self.read(cr, uid, ids, ['initial_balance'])[0])
data['form'].update(self.read(cr, uid, ids, ['initial_balance', 'display_partner'])[0])
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.partner.balance',

View File

@ -11,6 +11,7 @@
<field name="fiscalyear_id" position="after">
<field name="result_selection"/>
<field name="initial_balance"/>
<field name="display_partner"/>
<newline/>
</field>
</field>

View File

@ -37,7 +37,8 @@ class account_tax_chart(osv.osv_memory):
def _get_period(self, cr, uid, context=None):
"""Return default period value"""
return self.pool.get('account.period').find(cr, uid)
period_ids = self.pool.get('account.period').find(cr, uid)
return period_ids and period_ids[0] or False
def account_tax_chart_open_window(self, cr, uid, ids, context=None):
"""

View File

@ -50,7 +50,6 @@ Three reports are available:
'update_xml': [
'security/ir.model.access.csv',
'security/account_budget_security.xml',
'account_budget_wizard.xml',
'wizard/account_budget_spread_view.xml',
'crossovered_budget_view.xml',
'crossovered_budget_report.xml',

View File

@ -1,6 +0,0 @@
<?xml version="1.0"?>
<openerp>
<data>
</data>
</openerp>

View File

@ -18,9 +18,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import datetime
from osv import osv,fields
import datetime
from tools.translate import _
def strToDate(dt):
@ -40,13 +40,11 @@ class account_budget_post(osv.osv):
'account_ids': fields.many2many('account.account', 'account_budget_rel', 'budget_id', 'account_id', 'Accounts'),
'crossovered_budget_line': fields.one2many('crossovered.budget.lines', 'general_budget_id', 'Budget Lines'),
'company_id': fields.many2one('res.company', 'Company', required=True),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of budgetary position."),
}
_defaults = {
'sequence': lambda *a: 1,
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.budget.post', context=c)
}
_order = "sequence, name"
_order = "name"
def spread(self, cr, uid, ids, fiscalyear_id=False, amount=0.0):
dobj = self.pool.get('account.budget.post.dotation')
@ -60,6 +58,7 @@ class account_budget_post(osv.osv):
for p in fy.period_ids:
dobj.create(cr, uid, {'post_id': o.id, 'period_id': p.id, 'amount': amount/num})
return True
account_budget_post()
class account_budget_post_dotation(osv.osv):
@ -107,8 +106,8 @@ class crossovered_budget(osv.osv):
_description = "Budget"
_columns = {
'name': fields.char('Name', size=50, required=True,states={'done':[('readonly',True)]}),
'code': fields.char('Code', size=20, required=True,states={'done':[('readonly',True)]}),
'name': fields.char('Name', size=64, required=True, states={'done':[('readonly',True)]}),
'code': fields.char('Code', size=16, required=True, states={'done':[('readonly',True)]}),
'creating_user_id': fields.many2one('res.users', 'Responsible User'),
'validating_user_id': fields.many2one('res.users', 'Validate User', readonly=True),
'date_from': fields.date('Start Date', required=True, states={'done':[('readonly',True)]}),
@ -118,7 +117,7 @@ class crossovered_budget(osv.osv):
}
_defaults = {
'state': lambda *a: 'draft',
'state': 'draft',
'creating_user_id': lambda self,cr,uid,context: uid,
}
@ -128,6 +127,12 @@ class crossovered_budget(osv.osv):
})
return True
def budget_draft(self, cr, uid, ids, *args):
self.write(cr, uid, ids, {
'state':'draft'
})
return True
def budget_validate(self, cr, uid, ids, *args):
self.write(cr, uid, ids, {
'state':'validate',

View File

@ -21,4 +21,4 @@
string="Budget"/>
</data>
</openerp>
</openerp>

View File

@ -19,7 +19,6 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Budgetary Position">
<field name="sequence"/>
<field name="code"/>
<field name="name"/>
<field name="company_id" groups="base.group_multi_company"/>
@ -58,7 +57,8 @@
<field name="view_id" ref="view_budget_post_tree"/>
</record>
<menuitem id="next_id_31" name="Budgets" parent="account.menu_finance" sequence="5"/>
<menuitem action="open_budget_post_form" id="menu_budget_post_form" parent="next_id_31" sequence="2"/>
<menuitem id="next_id_pos" name="Budgets" parent="account.menu_finance_configuration" sequence="20"/>
<menuitem action="open_budget_post_form" id="menu_budget_post_form" parent="next_id_pos" sequence="20"/>
<record model="ir.ui.view" id="view_budget_post_form">
@ -70,7 +70,6 @@
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="sequence"/>
<notebook colspan="4">
<page string="Accounts">
<field name="account_ids" colspan="4" nolabel="1"/>
@ -88,9 +87,9 @@
<field name="date_from"/>
<field name="date_to"/>
<field name="paid_date"/>
<field name="planned_amount"/>
<field name="practical_amount" select="1"/>
<field name="theoritical_amount"/>
<field name="planned_amount" sum="Planned Amount"/>
<field name="practical_amount" select="1" sum="Practical Amount" />
<field name="theoritical_amount" sum="Theoritical Amount"/>
<field name="percentage"/>
</tree>
<form string="Budget Lines">
@ -117,22 +116,22 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Budget">
<field name="name" colspan="1" select="1"/>
<field name="code" colspan="1" select="1" />
<field name="creating_user_id" />
<field name="validating_user_id" readonly="True"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="crossovered_budget_line" colspan="4" nolabel="1">
<field name="name" colspan="1" select="1" attrs="{'readonly':[('state','!=','draft')]}"/>
<field name="code" colspan="1" select="1" attrs="{'readonly':[('state','!=','draft')]}"/>
<field name="creating_user_id" attrs="{'readonly':[('state','!=','draft')]}"/>
<field name="validating_user_id" readonly="True" attrs="{'readonly':[('state','!=','draft')]}"/>
<field name="date_from" attrs="{'readonly':[('state','!=','draft')]}"/>
<field name="date_to" attrs="{'readonly':[('state','!=','draft')]}"/>
<field name="crossovered_budget_line" colspan="4" nolabel="1" attrs="{'readonly':[('state','!=','draft')]}">
<tree string="Budget Lines">
<field name="analytic_account_id" groups="base.group_extended"/>
<field name="general_budget_id"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="paid_date"/>
<field name="planned_amount"/>
<field name="practical_amount"/>
<field name="theoritical_amount"/>
<field name="planned_amount" sum="Planned Amount"/>
<field name="practical_amount" sum="Practical Amount"/>
<field name="theoritical_amount" sum="Theoritical Amount"/>
<field name="percentage"/>
</tree>
<form string="Budget Lines">
@ -150,6 +149,7 @@
<button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-ok"/>
<button string="Done" name="done" states="validate" type="workflow" icon="gtk-jump-to" />
<button string="Cancel" name="cancel" states="confirm,validate" type="workflow" icon="gtk-cancel"/>
<button name="draft" states="cancel" string="Reset to Draft" type="workflow" icon="terp-stock_effects-object-colorize"/>
</group>
</form>
@ -162,11 +162,12 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree colors="blue:state in ('draft');gray:state in ('done','cancel');black:state in ('confirm','validate')" string="Budget">
<field name="name" colspan="1" select="1"/>
<field name="code" colspan="1" select="1" />
<field name="state"/>
<field name="name" colspan="1"/>
<field name="code" colspan="1"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="creating_user_id"/>
<field name="state"/>
</tree>
</field>
</record>
@ -179,7 +180,7 @@
<search string="Budget">
<group col="20" colspan="4">
<filter string="Draft" icon="terp-document-new" domain="[('state','=','draft')]" help="Draft Budgets" default="1"/>
<filter string="To Approve" icon="terp-gtk-go-back-rtl" domain="[('state','=','validate')]" help="To Approve Budgets" />
<filter string="To Approve" icon="terp-gtk-media-pause" domain="[('state','=','confirm')]" help="To Approve Budgets" />
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="code" select="1" />

View File

@ -4,6 +4,7 @@
<record model="res.roles" id="crossovered_budget_role">
<field name="name">Crossovered Budget Validation</field>
<field name="description">Assign this role to the persons that should have the rights to Approve a confirm Budgets.</field>
</record>
<!-- Workflow definition -->
@ -18,7 +19,8 @@
<field name="wkf_id" ref="wkf_crossovered_budget" />
<field name="flow_start">True</field>
<field name="name">draft</field>
<field name="action">write({'state':'draft'})</field>
<field name="kind">function</field>
</record>
<record model="workflow.activity" id="act_confirm">
@ -41,8 +43,8 @@
<field name="name">cancel</field>
<field name="kind">function</field>
<field name="action">budget_cancel()</field>
</record>
<record model="workflow.activity" id="act_done">
<field name="wkf_id" ref="wkf_crossovered_budget" />
<field name="name">done</field>
@ -87,5 +89,11 @@
<field name="role_id" ref="crossovered_budget_role"/>
</record>
<record model="workflow.transition" id="t6">
<field name="act_from" ref="act_cancel" />
<field name="act_to" ref="act_draft" />
<field name="signal">draft</field>
</record>
</data>
</openerp>

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,7 +15,7 @@
# 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/>.
#
##############################################################################
@ -64,7 +64,7 @@ class budget_report(report_sxw.rml_parse):
achievements = float(self.cr.fetchone()[0])
res.append({'name': a.name, 'code': a.code, 'achievements': achievements})
return res
report_sxw.report_sxw('report.account.budget', 'account.budget.post', 'addons/account_budget/report/budget_report.rml',parser=budget_report,header=False)
report_sxw.report_sxw('report.account.budget', 'account.budget.post', 'addons/account_budget/report/budget_report.rml',parser=budget_report, header="internal")
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -205,6 +205,6 @@ class budget_report(report_sxw.rml_parse):
return result
report_sxw.report_sxw('report.crossovered.budget.report', 'crossovered.budget', 'addons/account_budget/report/crossovered_budget_report.rml',parser=budget_report,header=False)
report_sxw.report_sxw('report.crossovered.budget.report', 'crossovered.budget', 'addons/account_budget/report/crossovered_budget_report.rml',parser=budget_report, header="internal")
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -162,7 +162,8 @@
<blockTable colWidths="191.0,82.0,80.0,84.0,61.0" style="Table4">
<tr>
<td>
<para style="P1"><font>[['.....' *(a['status']-1) ]] [[ setTag('font','font',{'color':'white'}) ]]</font><font>[[ a['status']==1 and (setTag('font','font',{'name':'Helvetica-bold'})) ]][[ a['name'] ]]</font></para>
<para style="P1">
<font>[[ a['status']==1 and (setTag('font','font',{'name':'Helvetica-bold'})) ]][[ a['name'] ]]</font></para>
</td>
<td>
<para style="terp_default_9">[[ a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ '%.2f' % a['theo'] ]]</para>

View File

@ -23,7 +23,7 @@
</record>
<record id="action_account_budget_crossvered_summary_report" model="ir.actions.act_window">
<field name="name">Print Summary of Budgets</field>
<field name="name">Print Summary</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.budget.crossvered.summary.report</field>
<field name="view_type">form</field>
@ -31,10 +31,11 @@
<field name="view_id" ref="account_budget_crossvered_summary_report_view"/>
<field name="target">new</field>
</record>
<record model="ir.values" id="account_budget_crossvered_summary_report_values">
<field name="model_id" ref="account_budget.model_crossovered_budget" />
<field name="object" eval="1" />
<field name="name">Print Summary of Budgets</field>
<field name="name">Print Summary</field>
<field name="key2">client_print_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_budget_crossvered_summary_report'))" />
<field name="key">action</field>

View File

@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from osv import fields, osv
@ -50,13 +51,12 @@ class account_budget_report(osv.osv_memory):
data_model = self.pool.get(datas['model']).browse(cr, uid, context['active_id'])
if not data_model.dotation_ids:
raise osv.except_osv(_('Insufficient Data!'),_('No Depreciation or Master Budget Expenses Found on Budget %s!') % data_model.name)
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.budget',
'datas': datas,
}
account_budget_report()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -90,7 +90,7 @@ class payment_order(osv.osv):
return res
_columns = {
'date_planned': fields.date('Scheduled date if fixed', states={'done':[('readonly',True)]}, help='Select a date if you have chosen Preferred Date to be fixed.'),
'date_scheduled': fields.date('Scheduled date if fixed', states={'done':[('readonly',True)]}, help='Select a date if you have chosen Preferred Date to be fixed.'),
'reference': fields.char('Reference', size=128, required=1, states={'done':[('readonly',True)]}),
'mode': fields.many2one('payment.mode','Payment mode', select=True, required=1, states={'done':[('readonly',True)]}, help='Select the Payment Mode to be applied.'),
'state': fields.selection([
@ -107,7 +107,7 @@ class payment_order(osv.osv):
('now', 'Directly'),
('due', 'Due date'),
('fixed', 'Fixed date')
], "Preferred date", change_default=True, required=True, states={'done':[('readonly',True)]}, help="Choose an option for the Payment Order:'Fixed' stands for a date specified by you.'Directly' stands for the direct execution.'Due date' stands for the scheduled date of execution."),
], "Preferred date", change_default=True, required=True, states={'done':[('readonly', True)]}, help="Choose an option for the Payment Order:'Fixed' stands for a date specified by you.'Directly' stands for the direct execution.'Due date' stands for the scheduled date of execution."),
'date_created': fields.date('Creation date', readonly=True),
'date_done': fields.date('Execution date', readonly=True),
}
@ -141,6 +141,14 @@ class payment_order(osv.osv):
wf_service.trg_validate(uid, 'payment.order', id, 'done', cr)
return True
def copy(self, cr, uid, id, default={}, context=None):
default.update({
'state':'draft',
'line_ids': [],
'reference': self.pool.get('ir.sequence').get(cr, uid, 'payment.order')
})
return super(payment_order, self).copy(cr, uid, id, default, context=context)
payment_order()
class payment_line(osv.osv):
@ -252,7 +260,7 @@ class payment_line(osv.osv):
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_planned
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:
@ -317,7 +325,8 @@ class payment_line(osv.osv):
'info_partner': fields.function(info_partner, string="Destination Account", method=True, type="text", help='Address of the Ordering Customer.'),
'date': fields.date('Payment Date', help="If no payment date is specified, the bank will treat this payment line directly"),
'create_date': fields.datetime('Created' , readonly=True),
'state': fields.selection([('normal','Free'), ('structured','Structured')], 'Communication Type', required=True)
'state': fields.selection([('normal','Free'), ('structured','Structured')], 'Communication Type', required=True),
'bank_statement_line_id': fields.many2one('account.bank.statement.line', 'Bank statement line')
}
_defaults = {
'name': lambda obj, cursor, user, context: obj.pool.get('ir.sequence'
@ -330,7 +339,7 @@ class payment_line(osv.osv):
('name_uniq', 'UNIQUE(name)', 'The payment line name must be unique!'),
]
def onchange_move_line(self, cr, uid, ids, move_line_id, payment_type, date_prefered, date_planned, currency=False, company_currency=False, context=None):
def onchange_move_line(self, cr, uid, ids, move_line_id, payment_type, date_prefered, date_scheduled, currency=False, company_currency=False, context=None):
data={}
data['amount_currency']=data['communication']=data['partner_id']=data['reference']=data['date_created']=data['bank_id']=data['amount']=False
@ -365,7 +374,7 @@ class payment_line(osv.osv):
elif date_prefered == 'due':
data['date'] = line.date_maturity
elif date_prefered == 'fixed':
data['date'] = date_planned
data['date'] = date_scheduled
return {'value': data}

View File

@ -109,14 +109,14 @@
<field name="reference"/>
<field name="mode"/>
<field name="date_prefered"/>
<field name="date_planned" select="1"/>
<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"/>
<field name="line_ids" colspan="4" widget="one2many_list" nolabel="1">
<form string="Payment Line">
<notebook>
<page string="Payment">
<field name="move_line_id" on_change="onchange_move_line(move_line_id,parent.mode,parent.date_prefered,parent.date_planned,currency,company_currency)" select="1" domain="[('reconcile_id','=', False), ('credit', '>',0),('amount_to_pay','>',0)] "/>
<field name="move_line_id" on_change="onchange_move_line(move_line_id,parent.mode,parent.date_prefered,parent.date_scheduled,currency,company_currency)" select="1" domain="[('reconcile_id','=', False), ('credit', '>',0),('amount_to_pay','>',0)] "/>
<separator colspan="4" string="Transaction Information"/>
<field name="date"/>
<group colspan="2">
@ -179,43 +179,56 @@
<field name="type">tree</field>
<field eval="4" name="priority"/>
<field name="arch" type="xml">
<tree colors="blue:state in ('draft');gray:state in ('cancel','done');black:state in ('open')" editable="bottom" string="Payment order">
<tree colors="blue:state in ('draft');gray:state in ('cancel','done');black:state in ('open')" string="Payment order">
<field name="reference"/>
<field name="mode"/>
<field name="date_planned"/>
<field name="user_id"/>
<field name="date_created"/>
<field name="date_done"/>
<field name="total"/>
<field name="state"/>
<button name="cancel" states="draft,open" string="Cancel" icon="gtk-cancel"/>
<button name="open" states="draft" string="Confirm Payments" icon="gtk-apply"/>
<button name="%(action_account_payment_make_payment)d" states="open" string="Make Payments" type="action" icon="gtk-execute"/>
</tree>
</field>
</record>
<record id="view_payment_order_search" model="ir.ui.view">
<field name="name">payment.order.tree.search</field>
<field name="model">payment.order</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Payment Orders">
<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!"/>
<separator orientation="vertical"/>
<field name="reference"/>
<field name="mode" widget='selection'/>
<field name="date_done"/>
<field name="state"/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Payment Mode" context="{'group_by': 'mode'}" icon="terp-dolar_ok!"/>
<filter string="State" context="{'group_by': 'state'}" icon="terp-stock_effects-object-colorize"/>
</group>
</search>
</field>
</record>
<record id="action_payment_order_tree" model="ir.actions.act_window">
<field name="name">Payment Orders</field>
<field name="res_model">payment.order</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_payment_order_search"/>
</record>
<menuitem action="action_payment_order_tree" id="menu_action_payment_order_form" parent="account_payment.menu_main" sequence="3"/>
<record id="action_payment_order_draft" model="ir.actions.act_window">
<field name="name">Draft Payment Order</field>
<field name="res_model">payment.order</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','=','draft')]</field>
<field name="filter" eval="True"/>
</record>
<record id="action_payment_order_open" model="ir.actions.act_window">
<field name="name">Payment Orders to Approve</field>
<field name="res_model">payment.order</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','=','open')]</field>
<field name="filter" eval="True"/>
</record>
<record id="action_payment_order_tree_new" model="ir.actions.act_window">
<field name="name">New Payment Order</field>
<field name="res_model">payment.order</field>
@ -301,9 +314,9 @@
<field name="type">form</field>
<field name="inherit_id" ref="account.view_bank_statement_form"/>
<field name="arch" type="xml">
<group col="7" colspan="4" position="inside">
<button colspan="2" name="%(action_account_populate_statement_confirm)d" string="Import payment lines" type="action" icon="gtk-open"/>
</group>
<field name="journal_id" position="after">
<button name="%(action_account_populate_statement_confirm)d" attrs="{'invisible':[('state','=','confirm')]}" string="Import payment lines" type="action" icon="gtk-execute"/>
</field>
</field>
</record>

View File

@ -16,7 +16,7 @@ msgstr ""
"Plural-Forms: \n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr ""
@ -166,7 +166,7 @@ msgid "Payment lines"
msgstr ""
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr ""
@ -170,7 +170,7 @@ msgid "Payment lines"
msgstr ""
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr "Планирана дата ако е определена"
@ -172,7 +172,7 @@ msgid "Payment lines"
msgstr "Редове от плащане"
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr "Избор на дата ако искате да има зададена предпочитана дата"

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr "Zakazani datum ako je fiskno"
@ -174,7 +174,7 @@ msgid "Payment lines"
msgstr "Linije plaćanja"
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr "Odaberite datum ako ste odabrali fiksni poželjni datum"

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr "Data planificada si fixa"
@ -174,7 +174,7 @@ msgid "Payment lines"
msgstr "Línies de pagament"
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""
"Seleccioneu una data si heu seleccionat que la data preferida sigui fixa."

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr ""
@ -170,7 +170,7 @@ msgid "Payment lines"
msgstr ""
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr "Terminierung bei Auswahl 'festes Datum'"
@ -173,7 +173,7 @@ msgid "Payment lines"
msgstr "Zahlungsvorschlag Positionen"
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr "Wähle ein Datum wenn Ihre Auswahl 'festes Datum' sein soll."

View File

@ -18,7 +18,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr "Προγραμματισμένη ημερομηνία εάν είναι καθορισμένο"
@ -175,7 +175,7 @@ msgid "Payment lines"
msgstr "Γραμμές Πληρωμής"
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""
"Επιλέξτε μιά ημερομηνία εάν έχετε επιλέξει προτιμώμενη ημερομηνία ως "

View File

@ -18,7 +18,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr "Fecha planificada si es fija"
@ -175,7 +175,7 @@ msgid "Payment lines"
msgstr "Líneas de pago"
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""
"Seleccione una fecha si ha seleccionado que la fecha preferida sea fija."

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr "Fecha planificada si fija"
@ -174,7 +174,7 @@ msgid "Payment lines"
msgstr "Líneas de pago"
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr "Seleccione una fecha si ha elegido que la fecha preferida sea fija."

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr "Planeeritud kuupäev kui fikseeritud"
@ -173,7 +173,7 @@ msgid "Payment lines"
msgstr "Makseread"
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr "Vali kuupäev, kui sa oled valinud 'Eelistatud kuupäev fikseerida'."

View File

@ -18,7 +18,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr "Suunniteltu päivämäärä jos kiinteä"
@ -175,7 +175,7 @@ msgid "Payment lines"
msgstr "Maksurivit"
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""
"Aseta päivämäärä jos olet valinnut suositellun maksupäivän kiinteäksi."

View File

@ -40,7 +40,7 @@ msgstr ""
"spéciaux !"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr "Date prévue si fixe"
@ -197,7 +197,7 @@ msgid "Payment lines"
msgstr "Lignes de paiement"
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""
"Sélectionnez une date si vous avez choisi \"Date fixe\" comme date préférée"

View File

@ -18,7 +18,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr "अनुसूचित तिथि तो तय"
@ -173,7 +173,7 @@ msgid "Payment lines"
msgstr ""
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr ""
@ -170,7 +170,7 @@ msgid "Payment lines"
msgstr ""
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr ""
@ -170,7 +170,7 @@ msgid "Payment lines"
msgstr ""
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr ""
@ -170,7 +170,7 @@ msgid "Payment lines"
msgstr ""
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr ""
@ -172,7 +172,7 @@ msgid "Payment lines"
msgstr "Riga pagamento"
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""

View File

@ -18,7 +18,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr "고정된 경우, 스케줄된 날짜"
@ -171,7 +171,7 @@ msgid "Payment lines"
msgstr "결제 라인"
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr "'선호 날짜'를 지정하려면, 날짜를 선택하십시오."

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr ""
@ -170,7 +170,7 @@ msgid "Payment lines"
msgstr ""
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""

View File

@ -18,7 +18,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr "Төлөвлөсөн огноо"
@ -174,7 +174,7 @@ msgid "Payment lines"
msgstr "Төлбөрийн мөрүүд"
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr "Сонгох огноо тогтмол байх бол огноог заана."

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr "Geplande datum indien vast"
@ -174,7 +174,7 @@ msgid "Payment lines"
msgstr "Betalingsregels"
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""
"Kies een datum wanneer u hebt gekozen om op een voorkeursdatum uit te voeren."

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr ""
@ -170,7 +170,7 @@ msgid "Payment lines"
msgstr ""
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""

View File

@ -18,7 +18,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr ""
@ -171,7 +171,7 @@ msgid "Payment lines"
msgstr ""
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr "Planowana data jeśli jest ustalona"
@ -174,7 +174,7 @@ msgid "Payment lines"
msgstr "Pozycje płatności"
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr "Wybierz datę, jeśli wybrałaś(eś) opcję Preferowana data."

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr "Data agendada se fixa"
@ -174,7 +174,7 @@ msgid "Payment lines"
msgstr "Linhas de pagamentos"
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr "Selecione a data se você escolheu uma data preferida a ser reparada."

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr "Data programada se alterada"
@ -174,7 +174,7 @@ msgid "Payment lines"
msgstr "Linhas de pagamento"
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr "Selecione uma data se você escolheu uma Data Preferida a ser fixada."

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr "Data programată, dacă este stabilită"
@ -174,7 +174,7 @@ msgid "Payment lines"
msgstr "Linii plată"
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr "Selectează o dată dacă ai ales să programezi plată"

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr "Дата по плану, если задана"
@ -172,7 +172,7 @@ msgid "Payment lines"
msgstr "Позиции платежа"
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr ""
@ -174,7 +174,7 @@ msgid "Payment lines"
msgstr "Vrstice plačila"
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""

View File

@ -18,7 +18,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr ""
@ -171,7 +171,7 @@ msgid "Payment lines"
msgstr ""
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr ""
@ -170,7 +170,7 @@ msgid "Payment lines"
msgstr ""
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr ""
@ -170,7 +170,7 @@ msgid "Payment lines"
msgstr ""
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr ""
@ -170,7 +170,7 @@ msgid "Payment lines"
msgstr ""
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr ""
@ -170,7 +170,7 @@ msgid "Payment lines"
msgstr ""
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""

View File

@ -18,7 +18,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr ""
@ -171,7 +171,7 @@ msgid "Payment lines"
msgstr ""
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr "指定日期(如果是固定)"
@ -172,7 +172,7 @@ msgid "Payment lines"
msgstr "付款明细"
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr "如果你选择的优先日期是固定的, 选择一个日期"

View File

@ -17,7 +17,7 @@ msgstr ""
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
#: field:payment.order,date_planned:0
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr ""
@ -170,7 +170,7 @@ msgid "Payment lines"
msgstr ""
#. module: account_payment
#: help:payment.order,date_planned:0
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr ""

View File

@ -141,7 +141,7 @@
<para style="terp_default_9">Used Account </para>
</td>
<td>
<para style="P1">[[ o.mode.bank_id.name or '-' ]]</para>
<para style="P1">[[ get_account_name(o.mode.bank_id.id) ]]</para>
</td>
</tr>
<tr>
@ -223,7 +223,7 @@
<para style="terp_default_9">[[line.partner_id and line.partner_id.name or '-' ]]</para>
</td>
<td>
<para style="terp_default_9">[[ line.bank_id and line.bank_id.name or '-' ]]</para>
<para style="terp_default_9">[[ get_account_name(line.bank_id.id) or '-']]</para>
</td>
<td>
<para style="terp_default_9">[[ get_invoice_name(line.ml_inv_ref.id) or '-' ]]</para>

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,7 +15,7 @@
# 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/>.
#
##############################################################################
@ -25,7 +25,7 @@ import pooler
from report import report_sxw
class payment_order(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(payment_order, self).__init__(cr, uid, name, context=context)
self.localcontext.update( {
@ -34,17 +34,18 @@ class payment_order(report_sxw.rml_parse):
'get_company_currency' : self._get_company_currency,
'get_amount_total_in_currency' : self._get_amount_total_in_currency,
'get_amount_total' : self._get_amount_total,
'get_account_name' : self._get_account_name,
})
def _get_invoice_name(self,invoice_id):
def _get_invoice_name(self, invoice_id):
if invoice_id:
pool = pooler.get_pool(self.cr.dbname)
value_name = pool.get('account.invoice').name_get(self.cr, self.uid, [invoice_id])
if value_name:
return value_name[0][1]
return False
def _get_amount_total_in_currency(self,payment):
def _get_amount_total_in_currency(self, payment):
total = 0.0
if payment.line_ids:
currency_cmp = payment.line_ids[0].currency.id
@ -57,19 +58,27 @@ class payment_order(report_sxw.rml_parse):
return False
return total
def _get_amount_total(self,payment):
def _get_amount_total(self, payment):
total = 0.0
if not payment.line_ids:
return False
for line in payment.line_ids:
total += line.amount
return total
def _get_company_currency(self):
pool = pooler.get_pool(self.cr.dbname)
user = pool.get('res.users').browse(self.cr, self.uid, self.uid)
return user.company_id and user.company_id.currency_id and user.company_id.currency_id.name or False
return user.company_id and user.company_id.currency_id and user.company_id.currency_id.name or False
def _get_account_name(self,bank_id):
if bank_id:
pool = pooler.get_pool(self.cr.dbname)
value_name = pool.get('res.partner.bank').name_get(self.cr, self.uid, [bank_id])
if value_name:
return value_name[0][1]
return False
report_sxw.report_sxw('report.payment.order', 'payment.order', 'addons/account_payment/report/payment_order.rml', parser=payment_order,header=False)
report_sxw.report_sxw('report.payment.order', 'payment.order', 'addons/account_payment/report/payment_order.rml', parser=payment_order, header="internal")
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -77,7 +77,7 @@ class payment_order_create(osv.osv_memory):
elif payment.date_prefered == 'due':
date_to_pay = line.date_maturity
elif payment.date_prefered == 'fixed':
date_to_pay = payment.date_planned
date_to_pay = payment.date_scheduled
payment_obj.create(cr, uid,{
'move_line_id': line.id,
'amount_currency': line.amount_to_pay,

View File

@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from lxml import etree
from osv import osv, fields
@ -29,43 +30,22 @@ class account_payment_populate_statement(osv.osv_memory):
'lines': fields.many2many('payment.line', 'payment_line_rel_', 'payment_id', 'line_id', 'Payment Lines')
}
def search_entries(self, cr, uid, ids, context=None):
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
line_obj = self.pool.get('payment.line')
statement_obj = self.pool.get('account.bank.statement')
mod_obj = self.pool.get('ir.model.data')
data = self.read(cr, uid, ids, [], context=context)[0]
statement = statement_obj.browse(cr, uid, context['active_id'], context=context)
res = super(account_payment_populate_statement, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False)
line_ids = line_obj.search(cr, uid, [
('move_line_id.reconcile_id', '=', False),
('order_id.mode.journal.id', '=', statement.journal_id.id)])
('bank_statement_line_id', '=', False),])
line_ids.extend(line_obj.search(cr, uid, [
('move_line_id.reconcile_id', '=', False),
('order_id.mode', '=', False)]))
context.update({'line_ids': line_ids})
model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','account_payment_populate_statement_view')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
return {
'name': ('Entrie Lines'),
'context': context,
'view_type': 'form',
'view_mode': 'form',
'res_model': 'account.payment.populate.statement',
'views': [(resource_id,'form')],
'type': 'ir.actions.act_window',
'target': 'new',
}
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
res = super(account_payment_populate_statement, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False)
if context and 'line_ids' in context:
view_obj = etree.XML(res['arch'])
child = view_obj.getchildren()[0]
domain = '[("id", "in", '+ str(context['line_ids'])+')]'
field = etree.Element('field', attrib={'domain': domain, 'name':'lines', 'colspan':'4', 'height':'300', 'width':'800', 'nolabel':"1"})
child.addprevious(field)
res['arch'] = etree.tostring(view_obj)
domain = '[("id", "in", '+ str(line_ids)+')]'
doc = etree.XML(res['arch'])
nodes = doc.xpath("//field[@name='lines']")
for node in nodes:
node.set('domain', domain)
res['arch'] = etree.tostring(doc)
return res
def populate_statement(self, cr, uid, ids, context=None):
@ -93,7 +73,7 @@ class account_payment_populate_statement(osv.osv_memory):
reconcile_id = statement_reconcile_obj.create(cr, uid, {
'line_ids': [(6, 0, [line.move_line_id.id])]
}, context=context)
statement_line_obj.create(cr, uid, {
st_line_id = statement_line_obj.create(cr, uid, {
'name': line.order_id.reference or '?',
'amount': - amount,
'type': 'supplier',
@ -103,6 +83,9 @@ class account_payment_populate_statement(osv.osv_memory):
'ref': line.communication,
'reconcile_id': reconcile_id,
}, context=context)
return {'type' : 'ir.actions.act_window_close'}
line_obj.write(cr, uid, [line.id], {'bank_statement_line_id': st_line_id})
return {'type': 'ir.actions.act_window_close'}
account_payment_populate_statement()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -2,21 +2,21 @@
<openerp>
<data>
<record id="account_populate_statement_confirm_view" model="ir.ui.view">
<record id="account_payment_populate_statement_view" model="ir.ui.view">
<field name="name">Payment Populate statement</field>
<field name="model">account.payment.populate.statement</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Populate Statement:">
<label string="Are your sure to import Payment Lines!"/>
<group colspan="4" col="6">
<separator colspan="6"/>
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="search_entries" string="Yes" type="object" icon="gtk-ok"/>
</group>
</form>
<form string="Populate Statement:">
<group colspan="4" col="6">
<field name="lines" colspan="4" height="300" width="800" nolabel="1" />
<separator colspan="6"/>
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="populate_statement" string="ADD" type="object" icon="gtk-ok"/>
</group>
</form>
</field>
</record>
</record>
<record id="action_account_populate_statement_confirm" model="ir.actions.act_window">
<field name="name">Payment Populate statement</field>
@ -24,26 +24,11 @@
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="account_populate_statement_confirm_view"/>
<field name="view_id" ref="account_payment_populate_statement_view"/>
<field name="context">{'record_id':active_id}</field>
<field name="target">new</field>
</record>
<record id="account_payment_populate_statement_view" model="ir.ui.view">
<field name="name">Payment Populate statement</field>
<field name="model">account.payment.populate.statement</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Populate Statement:">
<group colspan="4" col="6">
<separator colspan="6"/>
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="populate_statement" string="ADD" type="object" icon="gtk-ok"/>
</group>
</form>
</field>
</record>
<record id="action_account_payment_populate_statement" model="ir.actions.act_window">
<field name="name">Payment Populate statement</field>
<field name="res_model">account.payment.populate.statement</field>

View File

@ -44,12 +44,14 @@
"wizard/account_voucher_open_view.xml",
"wizard/account_voucher_unreconcile_view.xml",
"voucher_view.xml",
"voucher_sales_purchase_view.xml",
"voucher_payment_receipt_view.xml",
"voucher_sales_purchase_view.xml",
"voucher_wizard.xml",
],
"test" : [
# "test/account_voucher.yml",
"test/sales_receipt.yml",
"test/sales_payment.yml",
],
'certificate': '0037580727101',

View File

@ -249,7 +249,7 @@
</tr>
<tr>
<td>
<para style="terp_default_8_Italic">[[ move_ids.name ]] - [[ get_ref(voucher.id,move_ids) ]]</para>
<para style="terp_default_8_Italic">[[ move_ids.name ]] - [[ voucher.reference ]]</para>
</td>
<td>
<para style="terp_default_9_50">

View File

@ -0,0 +1,87 @@
-
In order to test account voucher i will create an invoice and pay it through account voucher.
-
I create a new Partner
-
!record {model: res.partner, id: res_partner_micropc0}:
address:
- country_id: base.be
name: Jenifer
street: 69 rue de Chimay
type: default
zip: '5478'
category_id:
- base.res_partner_category_8
credit_limit: 0.0
name: Micro PC
property_account_payable: account.a_pay
property_account_receivable: account.a_recv
-
Creat an invoice for the partner
-
!record {model: account.invoice, id: account_invoice_0}:
account_id: account.a_recv
address_contact_id: base.res_partner_address_7
address_invoice_id: base.res_partner_address_7
company_id: base.main_company
currency_id: base.EUR
invoice_line:
- account_id: account.a_sale
name: '[PC1] Basic PC'
price_unit: 450.0
quantity: 1.0
product_id: product.product_product_pc1
uos_id: product.product_uom_unit
journal_id: account.sales_journal
partner_id: res_partner_micropc0
-
I check that the customer invoice is in draft state
-
!assert {model: account.invoice, id: account_invoice_0}:
- state == 'draft'
-
I make the invoice in Open state
-
!workflow {model: account.invoice, action: invoice_open, ref: account_invoice_0}
-
I check that a payment entry gets created in the account.move.line
-
!python {model: account.invoice}: |
acc_id=self.browse(cr, uid, ref("account_invoice_0"))
assert(acc_id.move_id)
-
I will create and post an account voucher for the partner.
-
!python {model: account.voucher}: |
import netsvc
vals = {}
journal_id = self.default_get(cr, uid, ['journal_id']).get('journal_id',None)
res = self.onchange_partner_id(cr, uid, [], ref("res_partner_micropc0"), journal_id, price=0.0, ttype='receipt')
vals = {
'account_id': ref('account.cash'),
'amount': 450.0,
'company_id': ref('base.main_company'),
'currency_id': ref('base.EUR'),
'journal_id': ref('account.bank_journal'),
'partner_id': ref('res_partner_micropc0'),
'period_id': ref('account.period_8'),
'type': 'receipt',
}
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)
voucher_id = self.browse(cr, uid, id)
assert (voucher_id.state=='draft'), "Voucher is not in draft state"
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'account.voucher', voucher_id.id, 'proforma_voucher', cr)
-
Finally i will Confirm the state of the invoice is paid
-
!assert {model: account.invoice, id: account_invoice_0}:
- state == 'paid'

View File

@ -0,0 +1,74 @@
-
In order to test sales receipt i will create a sale receipt and pay it through sales payment
-
First of all I create a voucher
-
!record {model: account.voucher, id: account_voucher_chinaexport_0}:
account_id: account.a_recv
amount: 30000.0
company_id: base.main_company
journal_id: account.sales_journal
line_cr_ids:
- account_id: account.a_sale
amount: 30000.0
partner_id: base.res_partner_3
period_id: account.period_8
tax_amount: 0.0
type: sale
-
I check that the voucher state is Draft
-
!assert {model: account.voucher, id: account_voucher_chinaexport_0}:
- state == 'draft'
-
I clicked on post button to post the voucher
-
!workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_chinaexport_0}
-
Check the voucher state is Posted
-
!assert {model: account.voucher, id: account_voucher_chinaexport_0}:
- state == 'posted'
-
I create a voucher record for the same partner
-
!record {model: account.voucher, id: account_voucher_chinaexport_1}:
account_id: account.cash
amount: 30000.0
company_id: base.main_company
currency_id: base.EUR
journal_id: account.bank_journal
line_cr_ids:
- account_id: account.a_recv
amount: 0.0
name: 2010/003
type: cr
- account_id: account.a_recv
amount: 30000.0
name: 2010/003
type: cr
partner_id: base.res_partner_3
period_id: account.period_8
type: receipt
-
Check the voucher state is draft
-
!assert {model: account.voucher, id: account_voucher_chinaexport_1}:
- state == 'draft'
-
I clicked on Post button to post the voucher
-
!workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_chinaexport_1}
-
Check the voucher state is Posted
-
!assert {model: account.voucher, id: account_voucher_chinaexport_1}:
- state == 'posted'

View File

@ -78,7 +78,10 @@ class account_voucher(osv.osv):
if user.company_id:
return user.company_id.currency_id.id
return False
def _get_partner(self, cr, uid, context={}):
return context.get('partner_id', False)
_name = 'account.voucher'
_description = 'Accounting Voucher'
_order = "date desc, id desc"
@ -89,7 +92,7 @@ class account_voucher(osv.osv):
('purchase','Purchase'),
('payment','Payment'),
('receipt','Receipt'),
],'Type'),
],'Default Type', readonly=True, states={'draft':[('readonly',False)]}),
'name':fields.char('Memo', size=256, readonly=True, states={'draft':[('readonly',False)]}),
'date':fields.date('Date', readonly=True, states={'draft':[('readonly',False)]}, help="Effective date for accounting entries"),
'journal_id':fields.many2one('account.journal', 'Journal', required=True, readonly=True, states={'draft':[('readonly',False)]}),
@ -101,7 +104,7 @@ class account_voucher(osv.osv):
'line_dr_ids':fields.one2many('account.voucher.line','voucher_id','Debits',
domain=[('type','=','dr')], context={'default_type':'dr'}, readonly=True, states={'draft':[('readonly',False)]}),
'period_id': fields.many2one('account.period', 'Period', required=True, readonly=True, states={'draft':[('readonly',False)]}),
'narration':fields.text('Narration', readonly=True, states={'draft':[('readonly',False)]}),
'narration':fields.text('Notes', readonly=True, states={'draft':[('readonly',False)]}),
'currency_id': fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}),
'company_id': fields.many2one('res.company', 'Company', required=True),
'state':fields.selection(
@ -116,11 +119,11 @@ class account_voucher(osv.osv):
\n* The \'Cancelled\' state is used when user cancel voucher.'),
'amount': fields.float('Total', digits=(16, 2), required=True, readonly=True, states={'draft':[('readonly',False)]}),
'tax_amount':fields.float('Tax Amount', digits=(14,2), readonly=True, states={'draft':[('readonly',False)]}),
'reference': fields.char('Ref #', size=64, readonly=True, states={'draft':[('readonly',False)]}, help="Payment or Receipt transaction number, i.e. Bank cheque number or payorder number or Wire transfer number or Acknowledge number."),
'reference': fields.char('Ref #', size=64, readonly=True, states={'draft':[('readonly',False)]}, help="Transaction referance number."),
'number': fields.related('move_id', 'name', type="char", readonly=True, string='Number'),
'move_id':fields.many2one('account.move', 'Account Entry'),
'move_ids': fields.related('move_id','line_id', type='many2many', relation='account.move.line', string='Journal Items', readonly=True),
'partner_id':fields.many2one('res.partner', 'Partner', readonly=True, states={'draft':[('readonly',False)]}),
'partner_id':fields.many2one('res.partner', 'Partner', change_default=1, readonly=True, states={'draft':[('readonly',False)]}),
'audit': fields.related('move_id','to_check', type='boolean', relation='account.move', string='Audit Complete ?'),
'pay_now':fields.selection([
('pay_now','Pay Directly'),
@ -133,6 +136,7 @@ class account_voucher(osv.osv):
}
_defaults = {
'period_id': _get_period,
'partner_id': _get_partner,
'journal_id':_get_journal,
'currency_id': _get_currency,
'type':_get_type,
@ -143,7 +147,52 @@ class account_voucher(osv.osv):
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.voucher',context=c),
'tax_id': _get_tax,
}
def compute_tax(self, cr, uid, ids, context={}):
tax_pool = self.pool.get('account.tax')
partner_pool = self.pool.get('res.partner')
position_pool = self.pool.get('account.fiscal.position')
voucher_line_pool = self.pool.get('account.voucher.line')
voucher_pool = self.pool.get('account.voucher')
for voucher in voucher_pool.browse(cr, uid, ids, context):
voucher_amount = 0.0
for line in voucher.line_ids:
voucher_amount += line.untax_amount or line.amount
line.amount = line.untax_amount or line.amount
voucher_line_pool.write(cr, uid, [line.id], {'amount':line.amount, 'untax_amount':line.untax_amount})
if not voucher.tax_id:
continue
tax = [tax_pool.browse(cr, uid, voucher.tax_id.id)]
partner = partner_pool.browse(cr, uid, voucher.partner_id.id) or False
taxes = position_pool.map_tax(cr, uid, partner and partner.property_account_position or False, tax)
tax = tax_pool.browse(cr, uid, taxes)
total = voucher_amount
total_tax = 0.0
if not tax[0].price_include:
for tax_line in tax_pool.compute_all(cr, uid, tax, voucher_amount, 1).get('taxes'):
total_tax += tax_line.get('amount')
total += total_tax
else:
line_ids2 = []
for line in voucher.line_ids:
line_total = 0.0
line_tax = 0.0
for tax_line in tax_pool.compute_all(cr, uid, tax, line.untax_amount or line.amount, 1).get('taxes'):
line_tax += tax_line.get('amount')
line_total += tax_line.get('price_unit')
total_tax += line_tax
untax_amount = line.untax_amount or line.amount
voucher_line_pool.write(cr, uid, [line.id], {'amount':line_total, 'untax_amount':untax_amount})
self.write(cr, uid, [voucher.id], {'amount':total, 'tax_amount':total_tax})
return True
# TODO: review this code.
def onchange_price(self, cr, uid, ids, line_ids, tax_id, partner_id=False, context={}):
tax_pool = self.pool.get('account.tax')
@ -162,45 +211,16 @@ class account_voucher(osv.osv):
total_tax = 0.0
for line in line_ids:
line_amount = 0.0
if line[1]:
line_amount = voucher_line_pool.browse(cr, uid, line[1]).untax_amount
else:
line_amount = line[2].get('amount')
voucher_line_ids += [line[1]]
voucher_total += line[2].get('amount')
voucher_total += line_amount
total = voucher_total
if tax_id:
tax = [tax_pool.browse(cr, uid, tax_id)]
if partner_id:
partner = partner_pool.browse(cr, uid, partner_id) or False
taxes = position_pool.map_tax(cr, uid, partner and partner.property_account_position or False, tax)
tax = tax_pool.browse(cr, uid, taxes)
if not tax[0].price_include:
for tax_line in tax_pool.compute_all(cr, uid, tax, voucher_total, 1).get('taxes'):
total_tax += tax_line.get('amount')
total += total_tax
else:
line_ids2 = []
for line in line_ids:
line_total = 0.0
line_tax = 0.0
operation = line[0]
rec_id = line[1]
rec = line[2]
for tax_line in tax_pool.compute_all(cr, uid, tax, rec.get('amount'), 1).get('taxes'):
line_tax += tax_line.get('amount')
line_total += tax_line.get('price_unit')
total_tax += line_tax
if rec_id:
voucher_line_pool.write(cr, uid, [rec_id], {'amount':line_total})
line_ids2 += [rec_id]
else:
rec.update({
'amount':line_total
})
res.update({
'line_ids':line_ids2
})
res.update({
'amount':total,
'tax_amount':total_tax
@ -281,6 +301,7 @@ class account_voucher(osv.osv):
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
@ -319,7 +340,7 @@ class account_voucher(osv.osv):
default['value']['pre_line'] = 1
elif ttype == 'receipt' and len(default['value']['line_dr_ids']) > 0:
default['value']['pre_line'] = 1
return default
def onchange_date(self, cr, user, ids, date, context={}):
@ -401,7 +422,7 @@ class account_voucher(osv.osv):
terms = term_pool.compute(cr, uid, term_id, amount)
return terms
return False
move_pool = self.pool.get('account.move')
move_line_pool = self.pool.get('account.move.line')
analytic_pool = self.pool.get('account.analytic.line')
@ -439,7 +460,12 @@ class account_voucher(osv.osv):
credit = currency_pool.compute(cr, uid, inv.currency_id.id, company_currency, inv.amount)
elif inv.type in ('sale', 'receipt'):
debit = currency_pool.compute(cr, uid, inv.currency_id.id, company_currency, inv.amount)
if debit < 0:
credit = -debit
debit = 0.0
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:
@ -486,7 +512,16 @@ class account_voucher(osv.osv):
'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
}
if amount < 0:
amount = -amount
if line.type == 'dr':
line.type = 'cr'
else:
line.type = 'dr'
if (line.type=='dr'):
line_total += amount
move_line['debit'] = amount
@ -499,7 +534,7 @@ class account_voucher(osv.osv):
rec_ids = [master_line, line.move_line_id.id]
rec_list_ids.append(rec_ids)
if inv.tax_amount > 0:
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 = {
@ -510,11 +545,12 @@ class account_voucher(osv.osv):
'partner_id':inv.partner_id.id,
'currency_id':inv.currency_id.id,
}
if inv.journal_id.type in ('sale','purchase_refund'):
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
@ -563,7 +599,10 @@ class account_voucher(osv.osv):
default.update({
'state':'draft',
'number':False,
'move_id':False
'move_id':False,
'line_cr_ids':False,
'line_dr_ids':False,
'reference':False
})
if 'date' not in default:
default['date'] = time.strftime('%Y-%m-%d')
@ -590,6 +629,7 @@ class account_voucher(osv.osv):
}
if view_type == 'form':
tview = voucher_type.get(context.get('type'))
tview = tview or 'view_voucher_form'
result = data_pool._get_id(cr, uid, 'account_voucher', tview)
view_id = data_pool.browse(cr, uid, result, context=context).res_id
@ -606,6 +646,8 @@ account_voucher()
class account_voucher_line(osv.osv):
_name = 'account.voucher.line'
_description = 'Voucher Lines'
_order = "move_line_id"
def _compute_balance(self, cr, uid, ids, name, args, context=None):
res = {}
for line in self.browse(cr, uid, ids):
@ -623,6 +665,7 @@ class account_voucher_line(osv.osv):
'name':fields.char('Description', size=256),
'account_id':fields.many2one('account.account','Account', required=True),
'partner_id':fields.related('voucher_id', 'partner_id', type='many2one', relation='res.partner', string='Partner'),
'untax_amount':fields.float('Untax Amount'),
'amount':fields.float('Amount'),
'type':fields.selection([('dr','Debit'),('cr','Credit')], 'Cr/Dr'),
'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account'),
@ -683,13 +726,16 @@ class account_voucher_line(osv.osv):
return values
journal = journal_pool.browse(cr, user, journal_id)
account_id = False
ttype = 'cr'
if journal.type in ('sale', 'purchase_refund'):
account_id = journal.default_credit_account_id and journal.default_credit_account_id.id or False
elif journal.type in ('purchase', 'expense', 'sale_refund'):
account_id = journal.default_debit_account_id and journal.default_debit_account_id.id or False
ttype = 'dr'
elif partner_id:
partner = partner_pool.browse(cr, user, partner_id, context=context)
if context.get('type') == 'payment':
ttype = 'dr'
account_id = partner.property_account_payable.id
elif context.get('type') == 'receipt':
account_id = partner.property_account_receivable.id
@ -698,6 +744,7 @@ class account_voucher_line(osv.osv):
raise osv.except_osv(_('Invalid Error !'), _('Please change partner and try again !'))
values.update({
'account_id':account_id,
'type':ttype
})
return values
account_voucher_line()

View File

@ -8,7 +8,7 @@
<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="Customer"/>
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, type)" string="Vendor"/>
<field name="journal_id"
domain="[('type','in',['bank', 'cash'])]"
widget="selection" select="1"
@ -33,18 +33,21 @@
on_change="onchange_move_line_id(move_line_id)"
domain="[('account_id.type','=','payable'), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
/>
<field name="account_id" domain="[('type','=','payable')]"/>
<field name="account_id" groups="base.group_extended" domain="[('type','=','payable')]"/>
<field name="date_original" readonly="1"/>
<field name="date_due" readonly="1"/>
<field name="amount_original" readonly="1"/>
<field name="amount_unreconciled" sum="Open Balance" readonly="1"/>
<field name="amount" sum="Payment"/>
</tree>
<form string="Payment Information">
<label string="Form view not available for Payment Lines"/>
</form>
</field>
<field name="line_cr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('pre_line','=',False)]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}">
<tree string="Credits" editable="bottom">
<field name="move_line_id"/>
<field name="account_id" domain="[('type','=','receivable')]"/>
<field name="account_id" groups="base.group_extended" domain="[('type','=','receivable')]"/>
<field name="date_original"/>
<field name="amount_original"/>
<field name="amount" sum="Payment"/>
@ -61,7 +64,7 @@
<field name="number"/>
</group>
</page>
<page string="Journal Items">
<page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}">
<group col="6" colspan="4">
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
<field name="period_id"/>
@ -73,8 +76,8 @@
</notebook>
<group col="10" colspan="4">
<field name="state"/>
<button name="proforma_voucher" string="Create" states="draft" icon="terp-document-new"/>
<button name="cancel_voucher" string="Cancel" states="draft,proforma" icon="gtk-cancel"/>
<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>
@ -91,7 +94,7 @@
<field name="view_id" ref="account_open_vouchers_view"/>
<field name="target">new</field>
</record>
<menuitem action="action_vendor_payment" icon="STOCK_JUSTIFY_FILL" sequence="16"
<menuitem action="action_vendor_payment" icon="STOCK_JUSTIFY_FILL" sequence="12"
id="menu_action_vendor_payment" parent="account.menu_finance_payables"/>
<record model="ir.ui.view" id="view_vendor_receipt_form">
@ -127,7 +130,7 @@
on_change="onchange_move_line_id(move_line_id)"
domain="[('account_id.type','in',('receivable','payable')), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
/>
<field name="account_id" domain="[('type','=','receivable')]"/>
<field name="account_id" groups="base.group_extended" domain="[('type','=','receivable')]"/>
<field name="date_original" readonly="1"/>
<field name="date_due" readonly="1"/>
<field name="amount_original" readonly="1"/>
@ -138,7 +141,7 @@
<field name="line_dr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('pre_line','=',False)]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}">
<tree string="Credits" editable="bottom">
<field name="move_line_id"/>
<field name="account_id" domain="[('type','=','receivable')]"/>
<field name="account_id" groups="base.group_extended" domain="[('type','=','receivable')]"/>
<field name="date_original"/>
<field name="amount_original"/>
<field name="amount" sum="Payment"/>
@ -155,7 +158,7 @@
<field name="number"/>
</group>
</page>
<page string="Journal Items" groups="base.group_extended">
<page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}">
<group col="6" colspan="4">
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
<field name="period_id"/>
@ -167,8 +170,8 @@
</notebook>
<group col="10" colspan="4">
<field name="state"/>
<button name="proforma_voucher" string="Post" states="draft" icon="terp-document-new"/>
<button name="cancel_voucher" string="Cancel" states="draft,proforma" icon="gtk-cancel"/>
<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>
@ -185,7 +188,7 @@
<field name="view_id" ref="account_open_vouchers_view"/>
<field name="target">new</field>
</record>
<menuitem action="action_vendor_receipt" icon="STOCK_JUSTIFY_FILL" sequence="16"
<menuitem action="action_vendor_receipt" icon="STOCK_JUSTIFY_FILL" sequence="12"
id="menu_action_vendor_receipt" parent="account.menu_finance_receivables"/>
</data>
</openerp>

View File

@ -1,6 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<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="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="target">new</field>
</record>
<record model="ir.ui.view" id="view_sale_receipt_form">
<field name="name">account.voucher.sale.form</field>
<field name="model">account.voucher</field>
@ -9,7 +19,7 @@
<form string="Sales Receipt">
<group col="6" colspan="4">
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id)" string="Customer"/>
<field name="journal_id" domain="[('type','=','sale')]" widget="selection" on_change="onchange_journal(journal_id)"/>
<field name="journal_id" domain="[('type','in',['sale','purchase_refund'])]" widget="selection" on_change="onchange_journal(journal_id)"/>
<field name="number"/>
<field name="name" colspan="4"/>
<field name="date" on_change="onchange_date(date)"/>
@ -17,7 +27,7 @@
</group>
<notebook colspan="4">
<page string="Sales Information">
<field name="line_cr_ids" on_change="onchange_price(line_cr_ids, tax_id, parent.partner_id)" default_get="{'journal_id':journal_id, 'partner_id':partner_id}" colspan="4" nolabel="1" height="180">
<field name="line_cr_ids" on_change="onchange_price(line_cr_ids, tax_id, partner_id)" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="180">
<tree string="Sales Lines" editable="bottom">
<field name="account_id" domain="[('user_type.report_type','=','income'),('type','!=','view')]" widget="selection"/>
<field name="name"/>
@ -35,20 +45,20 @@
<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')]"/>
domain="[('user_type.report_type','=','asset'), ('type','=','other')]"/>
<!-- should select income accounts only. Or use the journal for this ? -->
<field name="reference"
attrs="{'invisible':[('pay_now','!=','pay_now')]}"
/>
</group>
<group col="3" colspan="1">
<separator string="Total" colspan="3"/>
<field name="tax_id" on_change="onchange_price(line_cr_ids, tax_id, partner_id)" widget="selection" domain="[('type_tax_use','in',('sale','all'))]"/><field name="tax_amount" on_change="onchange_price(line_ids, tax_id, partner_id)" nolabel="1"/>
<group col="4" colspan="1">
<separator string="Total" colspan="4"/>
<field name="tax_id" on_change="onchange_price(line_cr_ids, tax_id, partner_id)" widget="selection" domain="[('type_tax_use','in',('sale','all'))]"/><field name="tax_amount" on_change="onchange_price(line_ids, tax_id, partner_id)" nolabel="1"/><button type="object" icon="terp-stock_format-scientific" name="compute_tax" string="Compute Tax" attrs="{'invisible': [('state','!=','draft')]}"/>
<label colspan="1" string=""/><field name="amount" string="Total"/>
</group>
</group>
</page>
<page string="Journal Items" groups="base.group_extended">
<page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}">
<group col="6" colspan="4">
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
<field name="period_id"/>
@ -60,8 +70,9 @@
</notebook>
<group col="10" colspan="4">
<field name="state"/>
<button name="proforma_voucher" string="Post" states="draft" icon="terp-document-new"/>
<button name="cancel_voucher" string="Cancel" states="draft,proforma" icon="gtk-cancel"/>
<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>
@ -74,13 +85,13 @@
<field name="name">Sales Receipt</field>
<field name="res_model">account.voucher.open</field>
<field name="view_type">form</field>
<field name="domain">[('journal_id.type','=','sale'), ('type','=','sale')]</field>
<field name="domain">[('journal_id.type','in',['sale','purchase_refund']), ('type','=','sale')]</field>
<field name="context">{'journal_type':'sale', 'type':'sale'}</field>
<field name="view_id" ref="account_open_vouchers_view"/>
<field name="target">new</field>
</record>
<menuitem id="menu_action_sale_receipt" icon="STOCK_JUSTIFY_FILL"
action="action_sale_receipt" parent="account.menu_finance_receivables" sequence="14"/>
action="action_sale_receipt" parent="account.menu_finance_receivables" sequence="10"/>
<!-- Purchase Vouchers -->
<record model="ir.ui.view" id="view_purchase_receipt_form">
@ -91,7 +102,7 @@
<form string="Vendor Bills">
<group col="6" colspan="4">
<field name="partner_id" required="1" string="Vendor" on_change="onchange_partner_id(partner_id, journal_id, amount)"/>
<field name="journal_id" domain="[('type','=','purchase')]" widget="selection" select="1" on_change="onchange_journal(journal_id)"/>
<field name="journal_id" domain="[('type','in',['purchase','sale_refund'])]" widget="selection" select="1" on_change="onchange_journal(journal_id)"/>
<field name="reference" select="1"/>
<field name="name" colspan="4"/>
<field name="number"/>
@ -112,20 +123,22 @@
<separator string="Internal Notes" colspan="2"/>
<field name="narration" colspan="2" nolabel="1"/>
</group>
<group col="4" colspan="1">
<group col="2" colspan="1">
<separator string="Other Information" colspan="2"/>
<field name="date" string="Bill Date" select="1" on_change="onchange_date(date)"/>
</group>
<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"/>
</group>
<group col="4" colspan="1">
<separator string="Total" colspan="4"/>
<field name="tax_id" on_change="onchange_price(line_dr_ids, tax_id, partner_id)" widget="selection" domain="[('type_tax_use','in',('purchase','all'))]"/><field name="tax_amount" on_change="onchange_price(line_ids, tax_id, partner_id)" nolabel="1"/><button type="object" icon="terp-stock_format-scientific" name="compute_tax" string="Compute Tax" attrs="{'invisible': [('state','!=','draft')]}"/>
<label colspan="1" string=""/><field name="amount" string="Total"/>
</group>
</group>
</page>
<page string="Journal Items">
<page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}">
<group col="6" colspan="4">
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
<field name="period_id"/>
@ -137,8 +150,8 @@
</notebook>
<group col="10" colspan="4">
<field name="state"/>
<button name="proforma_voucher" string="Post" states="draft" icon="terp-document-new"/>
<button name="cancel_voucher" string="Cancel" states="draft,proforma" icon="gtk-cancel"/>
<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="Cancel" type="action" states="posted" icon="terp-stock_effects-object-colorize"/>
</group>
@ -149,13 +162,13 @@
<field name="name">Vendor Bills</field>
<field name="res_model">account.voucher.open</field>
<field name="view_type">form</field>
<field name="domain">[('journal_id.type','=','purchase'), ('type','=','purchase')]</field>
<field name="domain">[('journal_id.type','in',['purchase','sale_refund']), ('type','=','purchase')]</field>
<field name="context">{'journal_type':'purchase', 'type':'purchase'}</field>
<field name="view_id" ref="account_open_vouchers_view"/>
<field name="target">new</field>
</record>
<menuitem id="menu_action_purchase_receipt" icon="STOCK_JUSTIFY_FILL"
action="action_purchase_receipt" parent="account.menu_finance_payables" sequence="14"/>
action="action_purchase_receipt" parent="account.menu_finance_payables" sequence="10"/>
</data>
</openerp>

View File

@ -12,7 +12,7 @@
<field name="reference"/>
<field name="partner_id"/>
<field name="journal_id"/>
<field name="period_id" invisible="context.get('visible', False)"/>
<field name="period_id" groups="base.group_extended" 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,46 +27,37 @@
<field name="arch" type="xml">
<form string="Accounting Voucher">
<group col="6" colspan="4">
<field name="partner_id" on_change="onchange_partner_id(partner_id, type)"/>
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id)"/>
<field name="name" colspan="4"/>
<field name="journal_id" widget="selection" select="1" on_change="onchange_journal(journal_id,type)"/>
<field name="account_id" widget="selection" on_change="onchange_account(account_id)" readonly="1"/>
<field name="type" on_change="onchange_journal(journal_id,type)"/>
<field name="type" on_change="onchange_partner_id(partner_id, journal_id)"/>
<field name="reference" select="1"/>
<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>
<notebook colspan="4">
<page string="Voucher Entry">
<field name="line_ids" colspan="4" nolabel="1" height="180">
<field name="line_ids" on_change="onchange_price(line_ids, False, partner_id)" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="180">
<tree string="Voucher Lines" editable="top">
<field name="name" on_change="onchange_partner(parent.partner_id,type,parent.type, parent.currency_id)"/>
<field name="account_id"/>
<field name="type" on_change="onchange_type(parent.partner_id,type,parent.type, parent.currency_id)"/>
<field name="name"/>
<field name="amount"/>
<field name="ref"/>
<field name="type"/>
<field name="account_analytic_id" domain="[('parent_id','!=',False)]"/>
</tree>
</field>
<group col="2" colspan="3">
<separator string="Narration" colspan="2"/>
<separator string="Internal Notes" colspan="2"/>
<field name="narration" colspan="2" nolabel="1"/>
</group>
<group col="2" colspan="1">
<group col="2" colspan="1" attrs="{'invisible': [('type','!=','sale')]}">
<separator string="Payment Options" colspan="2"/>
<field name="pay_now"/>
<field name="pay_journal_id" on_change="onchange_pay_journal(pay_journal_id,type)" attrs="{'readonly': [('pay_now','=',False)], 'required': [('pay_now','=',True)]}"/>
<field name="pay_account_id" attrs="{'readonly': [('pay_now','=',False)], 'required': [('pay_now','=',True)]}"/>
<field name="pay_amount"/>
</group>
<group col="2" colspan="1">
<separator string="Other Information" colspan="2"/>
<field name="number"/>
<field name="reference" select="1"/>
<field name="date" select="1" on_change="onchange_date(date)"/>
<field name="currency_id" select="1" attrs="{'readonly':[('type','in',['sale', 'purchase'])]}"/>
</group>
<separator string="Other Information" colspan="2"/>
<field name="amount" string="Total"/>
<field name="number"/>
<field name="date" select="1" on_change="onchange_date(date)"/>
<field name="currency_id" select="1" attrs="{'readonly':[('type','in',['sale', 'purchase'])]}"/>
</group>
</page>
<page string="Journal Items">
<page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}">
<group col="6" colspan="4">
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
<field name="period_id"/>
@ -78,9 +69,10 @@
</notebook>
<group col="10" colspan="4">
<field name="state"/>
<button name="proforma_voucher" string="Create" states="draft" icon="terp-document-new"/>
<button name="cancel_voucher" string="Cancel" states="draft,proforma" icon="gtk-cancel"/>
<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="Cancel" type="action" states="posted" icon="terp-stock_effects-object-colorize"/>
</group>
</form>
</field>
@ -139,19 +131,16 @@
<filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/>
<separator orientation="vertical"/>
<filter icon="terp-stock_effects-object-colorize" string="To Review" domain="[('state','=','posted')]" groups="base.group_extended" help="To Review"/>
<filter icon="gtk-cancel" string="Cancel" domain="[('state','=','cancel')]" help="Cancel Vouchers" groups="base.group_extended"/>
<separator orientation="vertical"/>
<field name="date" select='1'/>
<field name="number" select='1'/>
<field name="partner_id" select='1'/>
</group>
<newline/>
<group col='8' colspan='4'>
<field name="journal_id" widget="selection" select="1"/>
<field name="period_id" select="1"/>
</group>
<!-- <newline/>-->
<!-- <group col='8' colspan='4'>-->
<!-- <field name="journal_id" widget="selection" select="1"/>-->
<!-- <field name="period_id" select="1"/>-->
<!-- </group>-->
<newline/>
<group expand="0" string="Group By..." colspan="12" col="10">
<filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>

View File

@ -124,7 +124,7 @@ class account_voucher_open(osv.osv_memory):
period_id = self._get_period(cr, uid, context)
menu = self.pool.get('ir.ui.menu').browse(cr, uid, context.get('active_id'))
name = menu.name
name = context.get('title', menu.name)
result = data_pool._get_id(cr, uid, 'account_voucher', 'view_voucher_filter_new')
res_id = data_pool.browse(cr, uid, result, context=context).res_id
@ -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}" % (journal_id, journal_id, period_id),
'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)),
'type': 'ir.actions.act_window',
'search_view_id': res_id
}

View File

@ -49,12 +49,10 @@ class account_voucher_unreconcile(osv.osv_memory):
recs += [line.reconcile_id.id]
if line.reconcile_partial_id:
recs += [line.reconcile_partial_id.id]
#for rec in recs:
reconcile_pool.unlink(cr, uid, recs)
if res.remove:
voucher_pool.cancel_voucher(cr, uid, [context.get('active_id')], context)
# if res.remove:
voucher_pool.cancel_voucher(cr, uid, [context.get('active_id')], context)
# wf_service = netsvc.LocalService("workflow")
# wf_service.trg_validate(uid, 'account.voucher', context.get('active_id'), 'cancel_voucher', cr)

View File

@ -11,8 +11,6 @@
<separator colspan="4" string="Unreconciliation transactions" />
<label string="If you unreconciliate transactions, you must also verify all the actions that are linked to those transactions because they will not be disable" colspan="2"/>
<separator colspan="4"/>
<field name="remove"/>
<separator colspan="4"/>
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="trans_unrec" default_focus="1" string="Unreconcile" type="object" icon="gtk-ok"/>
</form>

View File

@ -346,7 +346,7 @@ class account_analytic_line(osv.osv):
'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'
account_analytic_line()

View File

@ -7,5 +7,13 @@
<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>
</data></openerp>

View File

@ -1 +1,5 @@
"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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_account_analytic_account_manager account.analytic.account manager model_account_analytic_account analytic.group_analytic_manager 1 1 1 1
3 access_account_analytic_line_manager account.analytic.line manager model_account_analytic_line analytic.group_analytic_manager 1 1 1 1
4 access_account_analytic_account_user account.analytic.account user model_account_analytic_account analytic.group_analytic_user 1 0 0 0
5 access_account_analytic_line_user account.analytic.line user model_account_analytic_line analytic.group_analytic_user 1 0 0 0

View File

@ -38,7 +38,7 @@
<newline/>
<field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" required="1" domain="[('type','=','service')]"/>
<field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>
<field domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" name="account_id" select="1" groups="base.group_extended"/>
<field domain="[('type','=','normal'),('state', '&lt;&gt;', 'close'),('parent_id','!=',False)]" name="account_id" select="1" groups="base.group_extended"/>
<field name="amount"/>
<field name="general_account_id"/>
<field name="journal_id"/>

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