[MERGE] branch merged with lp:~openerp-dev/openobject-addons/trunk-dev-addons3
bzr revid: mtr@mtr-20101214041127-33gsbd7c9yqwgpoo
This commit is contained in:
@@ -2678,7 +2678,8 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
tax_template_ref[tax.id] = new_tax
|
||||
|
||||
#deactivate the parent_store functionnality on account_account for rapidity purpose
|
||||
self.pool._init = True
|
||||
ctx = context and context.copy() or {}
|
||||
ctx['defer_parent_store_computation'] = True
|
||||
|
||||
children_acc_template = obj_acc_template.search(cr, uid, [('parent_id','child_of',[obj_acc_root.id]),('nocreate','!=',True)])
|
||||
children_acc_template.sort()
|
||||
@@ -2706,10 +2707,9 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
'tax_ids': [(6,0,tax_ids)],
|
||||
'company_id': company_id,
|
||||
}
|
||||
new_account = obj_acc.create(cr, uid, vals)
|
||||
new_account = obj_acc.create(cr, uid, vals, context=ctx)
|
||||
acc_template_ref[account_template.id] = new_account
|
||||
#reactivate the parent_store functionnality on account_account
|
||||
self.pool._init = False
|
||||
self.pool.get('account.account')._parent_store_compute(cr)
|
||||
|
||||
for key,value in todo_dict.items():
|
||||
@@ -2857,7 +2857,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
'name': tmp,
|
||||
'currency_id': line.currency_id and line.currency_id.id or False,
|
||||
'code': new_code,
|
||||
'type': 'other',
|
||||
'type': 'liquidity',
|
||||
'user_type': account_template.user_type and account_template.user_type.id or False,
|
||||
'reconcile': True,
|
||||
'parent_id': acc_template_ref[ref_acc_bank.id] or False,
|
||||
@@ -2879,7 +2879,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
vals_journal['name']= vals['name']
|
||||
vals_journal['code']= _('BNK') + str(current_num)
|
||||
vals_journal['sequence_id'] = seq_id
|
||||
vals_journal['type'] = 'cash'
|
||||
vals_journal['type'] = line.account_type == 'cash' and 'cash' or 'bank'
|
||||
vals_journal['company_id'] = company_id
|
||||
vals_journal['analytic_journal_id'] = analitical_journal_bank
|
||||
|
||||
|
||||
@@ -757,7 +757,7 @@ class account_move_line(osv.osv):
|
||||
if 'comment' in context and context['comment']:
|
||||
libelle = context['comment']
|
||||
else:
|
||||
libelle = 'Write-Off'
|
||||
libelle = _('Write-Off')
|
||||
writeoff_lines = [
|
||||
(0, 0, {
|
||||
'name': libelle,
|
||||
|
||||
@@ -219,7 +219,8 @@ class account_installer(osv.osv_memory):
|
||||
tax_template_ref[tax.id] = new_tax
|
||||
|
||||
#deactivate the parent_store functionnality on account_account for rapidity purpose
|
||||
self.pool._init = True
|
||||
ctx = context and context.copy() or {}
|
||||
ctx['defer_parent_store_computation'] = True
|
||||
|
||||
children_acc_template = obj_acc_template.search(cr, uid, [('parent_id', 'child_of', [obj_acc_root.id]), ('nocreate', '!=', True)], context=context)
|
||||
children_acc_template.sort()
|
||||
@@ -248,7 +249,7 @@ class account_installer(osv.osv_memory):
|
||||
'tax_ids': [(6, 0, tax_ids)],
|
||||
'company_id': company_id.id,
|
||||
}
|
||||
new_account = obj_acc.create(cr, uid, vals, context=context)
|
||||
new_account = obj_acc.create(cr, uid, vals, context=ctx)
|
||||
acc_template_ref[account_template.id] = new_account
|
||||
if account_template.name == 'Bank Current Account':
|
||||
b_vals = {
|
||||
@@ -262,8 +263,7 @@ class account_installer(osv.osv_memory):
|
||||
'tax_ids': [(6,0,tax_ids)],
|
||||
'company_id': company_id.id,
|
||||
}
|
||||
bank_account = obj_acc.create(cr, uid, b_vals, context=context)
|
||||
|
||||
bank_account = obj_acc.create(cr, uid, b_vals, context=ctx)
|
||||
|
||||
view_id_cash = obj_acc_journal_view.search(cr, uid, [('name', '=', 'Bank/Cash Journal View')], context=context)[0] #why fixed name here?
|
||||
view_id_cur = obj_acc_journal_view.search(cr, uid, [('name', '=', 'Bank/Cash Journal (Multi-Currency) View')], context=context)[0] #Why Fixed name here?
|
||||
@@ -333,7 +333,7 @@ class account_installer(osv.osv_memory):
|
||||
'parent_id': bank_account,
|
||||
'company_id': company_id.id
|
||||
}
|
||||
child_bnk_acc = obj_acc.create(cr, uid, vals_bnk, context=context)
|
||||
child_bnk_acc = obj_acc.create(cr, uid, vals_bnk, context=ctx)
|
||||
vals_seq_child = {
|
||||
'name': _(vals_bnk['name'] + ' ' + 'Journal'),
|
||||
'code': 'account.journal',
|
||||
@@ -367,7 +367,6 @@ class account_installer(osv.osv_memory):
|
||||
code_cnt += 1
|
||||
|
||||
#reactivate the parent_store functionality on account_account
|
||||
self.pool._init = False
|
||||
obj_acc._parent_store_compute(cr)
|
||||
|
||||
for key, value in todo_dict.items():
|
||||
|
||||
@@ -23,10 +23,11 @@ import time
|
||||
from lxml import etree
|
||||
|
||||
import netsvc
|
||||
from osv import fields
|
||||
from osv import osv
|
||||
from osv import osv, fields
|
||||
import decimal_precision as dp
|
||||
from tools.translate import _
|
||||
|
||||
|
||||
class account_move_line(osv.osv):
|
||||
_inherit = 'account.move.line'
|
||||
|
||||
@@ -145,18 +146,29 @@ class account_voucher(osv.osv):
|
||||
res['arch'] = etree.tostring(doc)
|
||||
return res
|
||||
|
||||
def _compute_writeoff_amount(self, cr, uid, line_dr_ids, line_cr_ids, amount):
|
||||
debit = credit = 0.0
|
||||
for l in line_dr_ids:
|
||||
debit += l['amount']
|
||||
for l in line_cr_ids:
|
||||
credit += l['amount']
|
||||
return abs(amount - abs(credit - debit))
|
||||
|
||||
def onchange_line_ids(self, cr, uid, ids, line_dr_ids, line_cr_ids, amount):
|
||||
line_dr_ids = [x[2] for x in line_dr_ids]
|
||||
line_cr_ids = [x[2] for x in line_cr_ids]
|
||||
return {'value': {'writeoff_amount': self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount)}}
|
||||
|
||||
def _get_writeoff_amount(self, cr, uid, ids, name, args, context=None):
|
||||
if not ids: return {}
|
||||
res = {}
|
||||
debit = credit = 0.0
|
||||
for voucher in self.browse(cr, uid, ids, context=context):
|
||||
debit= credit = 0.0
|
||||
if voucher.line_dr_ids:
|
||||
for line in voucher.line_dr_ids:
|
||||
debit += line.amount_unreconciled
|
||||
if voucher.line_cr_ids:
|
||||
for line in voucher.line_cr_ids:
|
||||
credit += line.amount_unreconciled
|
||||
res[voucher.id] = abs(voucher.amount - abs(credit - debit))
|
||||
for l in voucher.line_dr_ids:
|
||||
debit += l.amount
|
||||
for l in voucher.line_cr_ids:
|
||||
credit += l.amount
|
||||
res[voucher.id] = abs(voucher.amount - abs(credit - debit))
|
||||
return res
|
||||
|
||||
_name = 'account.voucher'
|
||||
@@ -194,8 +206,8 @@ class account_voucher(osv.osv):
|
||||
\n* The \'Pro-forma\' when voucher is in Pro-forma state,voucher does not have an voucher number. \
|
||||
\n* The \'Posted\' state is used when user create voucher,a voucher number is generated and voucher entries are created in account \
|
||||
\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)]}),
|
||||
'amount': fields.float('Total', digits_compute=dp.get_precision('Account'), required=True, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'tax_amount':fields.float('Tax Amount', digits_compute=dp.get_precision('Account'), readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'reference': fields.char('Ref #', size=64, readonly=True, states={'draft':[('readonly',False)]}, help="Transaction reference number."),
|
||||
'number': fields.char('Number', size=32, readonly=True,),
|
||||
'move_id':fields.many2one('account.move', 'Account Entry'),
|
||||
@@ -210,14 +222,13 @@ class account_voucher(osv.osv):
|
||||
'pre_line':fields.boolean('Previous Payments ?', required=False),
|
||||
'date_due': fields.date('Due Date', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'payment_option':fields.selection([
|
||||
('without_writeoff', 'Without Write-off'),
|
||||
('with_writeoff', 'With Write-off'),
|
||||
], 'Payment Option', required=True, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
('without_writeoff', 'Keep Open'),
|
||||
('with_writeoff', 'Reconcile with Write-Off'),
|
||||
], 'Payment Difference', required=True, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'writeoff_acc_id': fields.many2one('account.account', 'Write-Off account', readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'writeoff_journal_id': fields.many2one('account.journal', 'Write-Off journal', readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'comment': fields.char('Comment', size=64, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'analytic_id': fields.many2one('account.analytic.account','Analytic Account', readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'writeoff_amount': fields.function(_get_writeoff_amount, method=True, string='Writeoff Amount', type='float', readonly=True),
|
||||
'comment': fields.char('Write-Off Comment', size=64, required=True, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'analytic_id': fields.many2one('account.analytic.account','Write-Off Analytic Account', readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'writeoff_amount': fields.function(_get_writeoff_amount, method=True, string='Write-Off Amount', type='float', readonly=True),
|
||||
}
|
||||
_defaults = {
|
||||
'period_id': _get_period,
|
||||
@@ -235,7 +246,7 @@ 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,
|
||||
'payment_option': 'without_writeoff',
|
||||
'comment': 'Write-Off',
|
||||
'comment': _('Write-Off'),
|
||||
}
|
||||
|
||||
def compute_tax(self, cr, uid, ids, context={}):
|
||||
@@ -390,13 +401,17 @@ class account_voucher(osv.osv):
|
||||
|
||||
@return: Returns a dict which contains new values, and context
|
||||
"""
|
||||
if context is None:
|
||||
context = {}
|
||||
if not journal_id:
|
||||
return {}
|
||||
|
||||
if context is None:
|
||||
context = {}
|
||||
currency_pool = self.pool.get('res.currency')
|
||||
line_pool = self.pool.get('account.voucher.line')
|
||||
line_ids = ids and line_pool.search(cr, uid, [('voucher_id', '=', ids[0])]) or False
|
||||
if line_ids:
|
||||
line_pool.unlink(cr, uid, line_ids)
|
||||
|
||||
currency_pool = self.pool.get('res.currency')
|
||||
move_line_pool = self.pool.get('account.move.line')
|
||||
partner_pool = self.pool.get('res.partner')
|
||||
journal_pool = self.pool.get('account.journal')
|
||||
@@ -410,13 +425,6 @@ class account_voucher(osv.osv):
|
||||
|
||||
if not partner_id:
|
||||
return default
|
||||
|
||||
if not partner_id and ids:
|
||||
line_ids = line_pool.search(cr, uid, [('voucher_id', '=', ids[0])])
|
||||
if line_ids:
|
||||
line_pool.unlink(cr, uid, line_ids)
|
||||
return default
|
||||
|
||||
journal = journal_pool.browse(cr, uid, journal_id)
|
||||
partner = partner_pool.browse(cr, uid, partner_id)
|
||||
account_id = False
|
||||
@@ -449,16 +457,6 @@ class account_voucher(osv.osv):
|
||||
ids.reverse()
|
||||
moves = move_line_pool.browse(cr, uid, ids)
|
||||
|
||||
priority_moves = []
|
||||
unpriority_moves = []
|
||||
for line in moves:
|
||||
original_amount = line.credit or line.debit or 0.0
|
||||
if original_amount == price:
|
||||
priority_moves.append(line)
|
||||
else:
|
||||
unpriority_moves.append(line)
|
||||
moves = priority_moves + unpriority_moves
|
||||
|
||||
company_currency = journal.company_id.currency_id.id
|
||||
if company_currency != currency_id and ttype == 'payment':
|
||||
total_debit = currency_pool.compute(cr, uid, currency_id, company_currency, total_debit)
|
||||
@@ -509,6 +507,8 @@ 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
|
||||
default['value']['writeoff_amount'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price)
|
||||
|
||||
return default
|
||||
|
||||
def onchange_date(self, cr, user, ids, date, context={}):
|
||||
@@ -734,16 +734,20 @@ class account_voucher(osv.osv):
|
||||
if line.move_line_id.id:
|
||||
rec_ids = [master_line, line.move_line_id.id]
|
||||
rec_list_ids.append(rec_ids)
|
||||
writeoff_account_id = False
|
||||
writeoff_journal_id = False
|
||||
writeoff_period_id = inv.period_id.id,
|
||||
comment = False
|
||||
|
||||
if not currency_pool.is_zero(cr, uid, inv.currency_id, line_total):
|
||||
diff = line_total
|
||||
account_id = False
|
||||
if inv.payment_option == 'with_writeoff':
|
||||
account_id = inv.writeoff_acc_id.id
|
||||
elif inv.type in ('sale', 'receipt'):
|
||||
# if inv.journal_id.type in ('sale','sale_refund', 'cash', 'bank'):
|
||||
account_id = inv.partner_id.property_account_receivable.id
|
||||
else:
|
||||
account_id = inv.partner_id.property_account_payable.id
|
||||
move_line = {
|
||||
'name': name,
|
||||
'account_id': False,
|
||||
'account_id': account_id,
|
||||
'move_id': move_id,
|
||||
'partner_id': inv.partner_id.id,
|
||||
'date': inv.date,
|
||||
@@ -752,24 +756,8 @@ class account_voucher(osv.osv):
|
||||
'amount_currency': company_currency <> current_currency and currency_pool.compute(cr, uid, company_currency, current_currency, diff * -1) or 0.0,
|
||||
'currency_id': company_currency <> current_currency and current_currency or False,
|
||||
}
|
||||
account_id = False
|
||||
if inv.type in ('sale', 'receipt'):
|
||||
# if inv.journal_id.type in ('sale','sale_refund', 'cash', 'bank'):
|
||||
account_id = inv.partner_id.property_account_receivable.id
|
||||
else:
|
||||
account_id = inv.partner_id.property_account_payable.id
|
||||
move_line['account_id'] = account_id
|
||||
|
||||
move_line_pool.create(cr, uid, move_line)
|
||||
for rec_ids in rec_list_ids:
|
||||
if len(rec_ids) >= 2:
|
||||
if inv.payment_option == 'with_writeoff':
|
||||
writeoff_account_id = inv.writeoff_acc_id.id
|
||||
writeoff_journal_id = inv.writeoff_journal_id.id
|
||||
comment = inv.comment
|
||||
move_line_pool.reconcile(cr, uid, rec_ids, 'manual', writeoff_account_id, writeoff_period_id, writeoff_journal_id, context)
|
||||
else:
|
||||
move_line_pool.reconcile_partial(cr, uid, rec_ids)
|
||||
|
||||
self.write(cr, uid, [inv.id], {
|
||||
'move_id': move_id,
|
||||
@@ -777,6 +765,9 @@ class account_voucher(osv.osv):
|
||||
'number': name,
|
||||
})
|
||||
move_pool.post(cr, uid, [move_id], context={})
|
||||
for rec_ids in rec_list_ids:
|
||||
if len(rec_ids) >= 2:
|
||||
move_line_pool.reconcile_partial(cr, uid, rec_ids)
|
||||
return True
|
||||
|
||||
def copy(self, cr, uid, id, default={}, context=None):
|
||||
@@ -828,7 +819,7 @@ class account_voucher_line(osv.osv):
|
||||
'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', digits=(14,2)),
|
||||
'amount':fields.float('Amount', digits_compute=dp.get_precision('Account')),
|
||||
'type':fields.selection([('dr','Debit'),('cr','Credit')], 'Cr/Dr'),
|
||||
'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account'),
|
||||
'move_line_id': fields.many2one('account.move.line', 'Journal Item'),
|
||||
@@ -993,4 +984,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:
|
||||
|
||||
@@ -70,8 +70,21 @@
|
||||
<field name="period_id"/>
|
||||
<field name="audit"/>
|
||||
</group>
|
||||
<separator string="Journal Items" colspan="4"/>
|
||||
<field name="move_ids" colspan="4" nolabel="1" readonly="1"/>
|
||||
<field name="move_ids" colspan="4" nolabel="1" readonly="1">
|
||||
<tree string="Journal Items">
|
||||
<field name="move_id"/>
|
||||
<field name="ref"/>
|
||||
<field name="date"/>
|
||||
<field name="statement_id"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="account_id"/>
|
||||
<field name="name"/>
|
||||
<field name="debit"/>
|
||||
<field name="credit"/>
|
||||
<field name="state"/>
|
||||
<field name="reconcile_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
<group col="10" colspan="4">
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Payment Information">
|
||||
<field name="line_dr_ids" attrs="{'invisible': [('type', '=', 'receipt')]}" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140">
|
||||
<field name="line_dr_ids" attrs="{'invisible': [('type', '=', 'receipt')]}" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount)">
|
||||
<tree string="Open Supplier Journal Entries" editable="bottom">
|
||||
<field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
|
||||
on_change="onchange_move_line_id(move_line_id)"
|
||||
@@ -119,7 +119,7 @@
|
||||
<field name="amount" sum="Payment"/>
|
||||
</tree>
|
||||
</field>
|
||||
<field name="line_cr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('type', '=', 'payment')]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}">
|
||||
<field name="line_cr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('type', '=', 'payment')]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount)">
|
||||
<tree string="Open Customer Journal Entries" editable="bottom">
|
||||
<field name="move_line_id"/>
|
||||
<field name="account_id" groups="base.group_extended" domain="[('type','=','receivable')]"/>
|
||||
@@ -198,22 +198,18 @@
|
||||
<group col="2" colspan="1">
|
||||
<group col="2" colspan="1">
|
||||
<separator string="Payment Options" colspan="2"/>
|
||||
<field name="payment_option" required="1"/>
|
||||
<field name="writeoff_amount"
|
||||
attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
|
||||
<field name="payment_option" required="1"/>
|
||||
<field name="writeoff_acc_id"
|
||||
attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"
|
||||
domain="[('type','=','liquidity')]"/>
|
||||
<!-- should select income accounts only. Or use the journal for this ? -->
|
||||
<field name="writeoff_journal_id"
|
||||
attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"/>
|
||||
domain="[('type','=','other')]"/>
|
||||
<field name="comment"
|
||||
attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
|
||||
<field name="analytic_id"
|
||||
attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"
|
||||
groups="analytic.group_analytic_accounting"/>
|
||||
</group>
|
||||
<separator string="Other Information" colspan="2"/>
|
||||
<group col="4" colspan="1">
|
||||
<field name="date" select="1" on_change="onchange_date(date)"/>
|
||||
<field name="currency_id" invisible="True"/>
|
||||
@@ -227,8 +223,21 @@
|
||||
<field name="period_id"/>
|
||||
<field name="audit"/>
|
||||
</group>
|
||||
<separator string="Journal Items" colspan="4"/>
|
||||
<field name="move_ids" colspan="4" nolabel="1" readonly="1"/>
|
||||
<field name="move_ids" colspan="4" nolabel="1" readonly="1">
|
||||
<tree string="Journal Items">
|
||||
<field name="move_id"/>
|
||||
<field name="ref"/>
|
||||
<field name="date"/>
|
||||
<field name="statement_id"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="account_id"/>
|
||||
<field name="name"/>
|
||||
<field name="debit"/>
|
||||
<field name="credit"/>
|
||||
<field name="state"/>
|
||||
<field name="reconcile_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
<group col="10" colspan="4">
|
||||
@@ -295,7 +304,7 @@
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Payment Information">
|
||||
<field name="line_cr_ids" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140">
|
||||
<field name="line_cr_ids" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount)">
|
||||
<tree string="Invoices and outstanding transactions" editable="bottom">
|
||||
<field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
|
||||
on_change="onchange_move_line_id(move_line_id)"
|
||||
@@ -309,7 +318,7 @@
|
||||
<field name="amount" sum="Payment"/>
|
||||
</tree>
|
||||
</field>
|
||||
<field name="line_dr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('pre_line','=',False)]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}">
|
||||
<field name="line_dr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('pre_line','=',False)]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount)">
|
||||
<tree string="Credits" editable="bottom">
|
||||
<field name="move_line_id"/>
|
||||
<field name="account_id" groups="base.group_extended" domain="[('type','=','receivable')]"/>
|
||||
@@ -330,10 +339,7 @@
|
||||
attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
|
||||
<field name="writeoff_acc_id"
|
||||
attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"
|
||||
domain="[('type','=','liquidity')]"/>
|
||||
<!-- should select income accounts only. Or use the journal for this ? -->
|
||||
<field name="writeoff_journal_id"
|
||||
attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"/>
|
||||
domain="[('type','=','other')]"/>
|
||||
<field name="comment"
|
||||
attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
|
||||
<field name="analytic_id"
|
||||
@@ -354,8 +360,21 @@
|
||||
<field name="period_id"/>
|
||||
<field name="audit"/>
|
||||
</group>
|
||||
<separator string="Journal Items" colspan="4"/>
|
||||
<field name="move_ids" colspan="4" nolabel="1" readonly="1"/>
|
||||
<field name="move_ids" colspan="4" nolabel="1" readonly="1">
|
||||
<tree string="Journal Items">
|
||||
<field name="move_id"/>
|
||||
<field name="ref"/>
|
||||
<field name="date"/>
|
||||
<field name="statement_id"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="account_id"/>
|
||||
<field name="name"/>
|
||||
<field name="debit"/>
|
||||
<field name="credit"/>
|
||||
<field name="state"/>
|
||||
<field name="reconcile_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
<group col="10" colspan="4">
|
||||
|
||||
@@ -144,8 +144,21 @@
|
||||
<field name="period_id"/>
|
||||
<field name="audit"/>
|
||||
</group>
|
||||
<separator string="Journal Items" colspan="4"/>
|
||||
<field name="move_ids" colspan="4" nolabel="1" readonly="1"/>
|
||||
<field name="move_ids" colspan="4" nolabel="1" readonly="1">
|
||||
<tree string="Journal Items">
|
||||
<field name="move_id"/>
|
||||
<field name="ref"/>
|
||||
<field name="date"/>
|
||||
<field name="statement_id"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="account_id"/>
|
||||
<field name="name"/>
|
||||
<field name="debit"/>
|
||||
<field name="credit"/>
|
||||
<field name="state"/>
|
||||
<field name="reconcile_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
<group col="8" colspan="4">
|
||||
@@ -251,8 +264,21 @@
|
||||
<field name="period_id"/>
|
||||
<field name="audit"/>
|
||||
</group>
|
||||
<separator string="Journal Items" colspan="4"/>
|
||||
<field name="move_ids" colspan="4" nolabel="1" readonly="1"/>
|
||||
<field name="move_ids" colspan="4" nolabel="1" readonly="1">
|
||||
<tree string="Journal Items">
|
||||
<field name="move_id"/>
|
||||
<field name="ref"/>
|
||||
<field name="date"/>
|
||||
<field name="statement_id"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="account_id"/>
|
||||
<field name="name"/>
|
||||
<field name="debit"/>
|
||||
<field name="credit"/>
|
||||
<field name="state"/>
|
||||
<field name="reconcile_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
<group col="10" colspan="4">
|
||||
|
||||
+1
-1
@@ -532,7 +532,7 @@ class crm_case_section(osv.osv):
|
||||
'reply_to': fields.char('Reply-To', size=64, help="The email address put in the 'Reply-To' of all emails sent by OpenERP about cases in this sales team"),
|
||||
'parent_id': fields.many2one('crm.case.section', 'Parent Team'),
|
||||
'child_ids': fields.one2many('crm.case.section', 'parent_id', 'Child Teams'),
|
||||
'resource_calendar_id': fields.many2one('resource.calendar', "Resource's Calendar"),
|
||||
'resource_calendar_id': fields.many2one('resource.calendar', "Working Time"),
|
||||
'note': fields.text('Description'),
|
||||
'working_hours': fields.float('Working Hours', digits=(16,2 )),
|
||||
'stage_ids': fields.many2many('crm.case.stage', 'section_stage_rel', 'section_id', 'stage_id', 'Stages'),
|
||||
|
||||
@@ -34,8 +34,8 @@ class hr_evaluation_plan(osv.osv):
|
||||
'name': fields.char("Evaluation Plan", size=64, required=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True),
|
||||
'phase_ids': fields.one2many('hr_evaluation.plan.phase', 'plan_id', 'Evaluation Phases'),
|
||||
'month_first': fields.integer('Next Evaluation After'),
|
||||
'month_next': fields.integer('After the Date of Start'),
|
||||
'month_first': fields.integer('First Evaluation in (months)', help="This number of months will be used to schedule the first evaluation date of the employee when selecting an evaluation plan. "),
|
||||
'month_next': fields.integer('Periodicity of Evaluations (months)', help="The number of month that depicts the delay between each evaluation of this plan (after the first one)."),
|
||||
'active': fields.boolean('Active')
|
||||
}
|
||||
_defaults = {
|
||||
@@ -101,7 +101,7 @@ class hr_employee(osv.osv):
|
||||
_inherit="hr.employee"
|
||||
_columns = {
|
||||
'evaluation_plan_id': fields.many2one('hr_evaluation.plan', 'Evaluation Plan'),
|
||||
'evaluation_date': fields.date('Next Evaluation', help="Date of the next evaluation"),
|
||||
'evaluation_date': fields.date('Next Evaluation Date', help="The date of the next evaluation is computed by the evaluation plan's dates (first evaluation + periodicity)."),
|
||||
}
|
||||
|
||||
def run_employee_evaluation(self, cr, uid, automatic=False, use_new_cursor=False, context=None):
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -113,7 +113,7 @@ class sale_order_line(osv.osv):
|
||||
('line', 'Separator Line'),
|
||||
('break', 'Page Break'),]
|
||||
,'Layout Type', select=True, required=True),
|
||||
'sequence': fields.integer('Sequence Number'),
|
||||
'sequence': fields.integer('Layout Sequence'),
|
||||
'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Sale Price'), readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'product_uom_qty': fields.float('Quantity (UoM)', digits=(16,2)),
|
||||
'product_uom': fields.many2one('product.uom', 'Product UoM'),
|
||||
@@ -156,4 +156,4 @@ class sale_order(osv.osv):
|
||||
|
||||
sale_order()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -4,18 +4,6 @@
|
||||
<record id="sale.action_order_line_tree2" model="ir.actions.act_window">
|
||||
<field name="domain">[('layout_type','=', 'article')]</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_order_line_form2_inherit_1">
|
||||
<field name="name">sale.order.line.form2.inherit_1</field>
|
||||
<field name="model">sale.order.line</field>
|
||||
<field name="inherit_id" ref="sale.view_order_line_form2"/>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/group/field[@name='name']" position="before">
|
||||
<field name="layout_type" select="1" on_change="onchange_sale_order_line_view(layout_type)" />
|
||||
<field name="sequence"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_order_form_inherit_1">
|
||||
<field name="name">sale.order.form.inherit_1</field>
|
||||
@@ -26,7 +14,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/notebook/page/field[@name='order_line']" position="replace">
|
||||
<field name="abstract_line_ids" colspan="4" nolabel="1" widget="one2many_list">
|
||||
<form string="Sales Order Lines">
|
||||
<form string="Sale Order Lines">
|
||||
<notebook>
|
||||
<page string="Order Line">
|
||||
<separator colspan="4" string="Automatic Declaration"/>
|
||||
|
||||
Reference in New Issue
Block a user