[MERGE] from trunk addons

bzr revid: nel@tinyerp.com-20100520133040-g1ylbrdwfju4r1sz
This commit is contained in:
nel@tinyerp.com 2010-05-20 15:30:40 +02:00
commit 8ec9a7a780
207 changed files with 2136 additions and 1197 deletions

View File

@ -231,9 +231,9 @@ class account_account(osv.osv):
aml_query = self.pool.get('account.move.line')._query_get(cr, uid, context=context)
wheres = [""]
if query:
if query.strip():
wheres.append(query.strip())
if aml_query:
if aml_query.strip():
wheres.append(aml_query.strip())
query = " AND ".join(wheres)
@ -251,6 +251,7 @@ class account_account(osv.osv):
# consolidate accounts with direct children
ids2.reverse()
brs = list(self.browse(cr, uid, ids2, context=context))
sums = {}
while brs:
@ -270,8 +271,9 @@ class account_account(osv.osv):
if current.child_id:
sums[current.id][fn] += sum(sums[child.id][fn] for child in current.child_id)
res = {}
null_result = dict((fn, 0.0) for fn in field_names)
for id in ids:
res[id] = sums[id]
res[id] = sums.get(id, null_result)
return res
def _get_company_currency(self, cr, uid, ids, field_name, arg, context={}):
@ -313,7 +315,7 @@ class account_account(osv.osv):
'user_type': fields.many2one('account.account.type', 'Account Type', required=True,
help="These types are defined according to your country. The type contains more information "\
"about the account and its specificities."),
'parent_id': fields.many2one('account.account', 'Parent', ondelete='cascade'),
'parent_id': fields.many2one('account.account', 'Parent', ondelete='cascade', domain=[('type','=','view')]),
'child_parent_ids': fields.one2many('account.account','parent_id','Children'),
'child_consol_ids': fields.many2many('account.account', 'account_account_consol_rel', 'child_id', 'parent_id', 'Consolidated Children'),
'child_id': fields.function(_get_child_ids, method=True, type='many2many', relation="account.account", string="Child Accounts"),
@ -450,18 +452,42 @@ class account_account(osv.osv):
def _check_moves(self, cr, uid, ids, method, context):
line_obj = self.pool.get('account.move.line')
account_ids = self.search(cr, uid, [('id', 'child_of', ids)])
if line_obj.search(cr, uid, [('account_id', 'in', account_ids)]):
if method == 'write':
raise osv.except_osv(_('Error !'), _('You cannot deactivate an account that contains account moves.'))
elif method == 'unlink':
raise osv.except_osv(_('Error !'), _('You cannot remove an account which has account entries!. '))
#Checking whether the account is set as a property to any Partner or not
value = 'account.account,' + str(ids[0])
partner_prop_acc = self.pool.get('ir.property').search(cr, uid, [('value_reference','=',value)], context=context)
if partner_prop_acc:
raise osv.except_osv(_('Warning !'), _('You cannot remove/deactivate an account which is set as a property to any Partner.'))
return True
def _check_allow_type_change(self, cr, uid, ids, new_type, context):
group1 = ['payable', 'receivable', 'other']
group2 = ['consolidation','view']
line_obj = self.pool.get('account.move.line')
for account in self.browse(cr, uid, ids, context=context):
old_type = account.type
account_ids = self.search(cr, uid, [('id', 'child_of', [account.id])])
if line_obj.search(cr, uid, [('account_id', 'in', account_ids)]):
#Check for 'Closed' type
if old_type == 'closed' and new_type !='closed':
raise osv.except_osv(_('Warning !'), _("You cannot change the type of account from 'Closed' to any other type which contains account entries!"))
#Check for change From group1 to group2 and vice versa
if (old_type in group1 and new_type in group2) or (old_type in group2 and new_type in group1):
raise osv.except_osv(_('Warning !'), _("You cannot change the type of account from '%s' to '%s' type as it contains account entries!") % (old_type,new_type,))
return True
def write(self, cr, uid, ids, vals, context=None):
if not context:
if context is None:
context = {}
if 'active' in vals and not vals['active']:
self._check_moves(cr, uid, ids, "write", context)
if 'type' in vals.keys():
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={}):
@ -557,15 +583,16 @@ class account_journal(osv.osv):
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
if not args:
args=[]
if not context:
context={}
args = []
if context is None:
context = {}
ids = []
if name:
ids = self.search(cr, user, [('code','ilike',name)]+ args, limit=limit)
ids = self.search(cr, user, [('code','ilike',name)]+ args, limit=limit, context=context)
if not ids:
ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit)
ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit, context=context)
return self.name_get(cr, user, ids, context=context)
account_journal()
class account_fiscalyear(osv.osv):
@ -631,6 +658,19 @@ class account_fiscalyear(osv.osv):
else:
return False
return ids[0]
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80):
if args is None:
args = []
if context is None:
context = {}
ids = []
if name:
ids = self.search(cr, user, [('code','ilike',name)]+ args, limit=limit)
if not ids:
ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit)
return self.name_get(cr, user, ids, context=context)
account_fiscalyear()
class account_period(osv.osv):
@ -706,12 +746,24 @@ class account_period(osv.osv):
cr.execute('update account_journal_period set state=%s where period_id=%s', (mode, id))
cr.execute('update account_period set state=%s where id=%s', (mode, id))
return True
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80):
if args is None:
args = []
if context is None:
context = {}
ids = []
if name:
ids = self.search(cr, user, [('code','ilike',name)]+ args, limit=limit)
if not ids:
ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit)
return self.name_get(cr, user, ids, context=context)
account_period()
class account_journal_period(osv.osv):
_name = "account.journal.period"
_description = "Journal - Period"
_description = "Journal Period"
def _icon_get(self, cr, uid, ids, field_name, arg=None, context={}):
result = {}.fromkeys(ids, 'STOCK_NEW')
@ -950,7 +1002,6 @@ class account_move(osv.osv):
l[2]['period_id'] = default_period
context['period_id'] = default_period
accnt_journal = self.pool.get('account.journal').browse(cr, uid, vals['journal_id'])
if 'line_id' in vals:
c = context.copy()
c['novalidate'] = True
@ -1248,7 +1299,7 @@ class account_tax_code(osv.osv):
_description = 'Tax Code'
_rec_name = 'code'
_columns = {
'name': fields.char('Tax Case Name', size=64, required=True),
'name': fields.char('Tax Case Name', size=64, required=True, translate=True),
'code': fields.char('Case Code', size=64),
'info': fields.text('Description'),
'sum': fields.function(_sum_year, method=True, string="Year Sum"),
@ -1262,6 +1313,15 @@ class account_tax_code(osv.osv):
}
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80):
if not args:
args = []
if context is None:
context = {}
ids = self.search(cr, user, ['|',('name',operator,name),('code',operator,name)] + args, limit=limit, context=context)
return self.name_get(cr, user, ids, context)
def name_get(self, cr, uid, ids, context=None):
if not len(ids):
return []
@ -1290,7 +1350,15 @@ class account_tax_code(osv.osv):
return False
level -= 1
return True
def copy(self, cr, uid, id, default=None, context=None):
if default is None:
default = {}
default = default.copy()
default.update({'line_ids': []})
return super(account_tax_code, self).copy(cr, uid, id, default, context)
_constraints = [
(_check_recursion, 'Error ! You can not create recursive accounts.', ['parent_id'])
]

View File

@ -30,7 +30,7 @@ from tools import config
class account_analytic_line(osv.osv):
_inherit = 'account.analytic.line'
_description = 'Analytic lines'
_description = 'Analytic Line'
_columns = {
'product_uom_id' : fields.many2one('product.uom', 'UoM'),
'product_id' : fields.many2one('product.product', 'Product'),
@ -42,7 +42,7 @@ class account_analytic_line(osv.osv):
}
_defaults = {
'date': lambda *a: time.strftime('%Y-%m-%d'),
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', c),
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=c),
}
_order = 'date'
@ -118,7 +118,7 @@ account_analytic_line()
class timesheet_invoice(osv.osv):
_name = "report.hr.timesheet.invoice.journal"
_description = "Analytic account costs and revenues"
_description = "Analytic Account Costs and Revenues"
_auto = False
_columns = {
'name': fields.char('Year',size=64,required=False, readonly=True),

View File

@ -387,7 +387,7 @@ account_bank_statement()
class account_bank_statement_reconcile(osv.osv):
_name = "account.bank.statement.reconcile"
_description = "Statement reconcile"
_description = "Statement Reconcile"
def _total_entry(self, cursor, user, ids, name, attr, context=None):
result = {}
@ -558,35 +558,40 @@ class account_bank_statement_line(osv.osv):
def onchange_partner_id(self, cursor, user, line_id, partner_id, type, currency_id,
context={}):
res = {'value': {}}
if not partner_id:
return {}
res_currency_obj = self.pool.get('res.currency')
res_users_obj = self.pool.get('res.users')
company_currency_id = res_users_obj.browse(cursor, user, user,
context=context).company_id.currency_id.id
if not currency_id:
currency_id = company_currency_id
part = self.pool.get('res.partner').browse(cursor, user, partner_id,
return res
line = self.browse(cursor, user, line_id)
if not line or (line and not line[0].account_id):
part = self.pool.get('res.partner').browse(cursor, user, partner_id,
context=context)
if type == 'supplier':
account_id = part.property_account_payable.id
else:
account_id = part.property_account_receivable.id
if type == 'supplier':
account_id = part.property_account_payable.id
else:
account_id = part.property_account_receivable.id
res['value']['account_id'] = account_id
cursor.execute('SELECT sum(debit-credit) \
if not line or (line and not line[0].amount):
res_users_obj = self.pool.get('res.users')
res_currency_obj = self.pool.get('res.currency')
company_currency_id = res_users_obj.browse(cursor, user, user,
context=context).company_id.currency_id.id
if not currency_id:
currency_id = company_currency_id
cursor.execute('SELECT sum(debit-credit) \
FROM account_move_line \
WHERE (reconcile_id is null) \
AND partner_id = %s \
AND account_id=%s', (partner_id, account_id))
res = cursor.fetchone()
balance = res and res[0] or 0.0
pgres = cursor.fetchone()
balance = pgres and pgres[0] or 0.0
balance = res_currency_obj.compute(cursor, user, company_currency_id,
balance = res_currency_obj.compute(cursor, user, company_currency_id,
currency_id, balance, context=context)
return {'value': {'amount': balance, 'account_id': account_id}}
res['value']['amount'] = balance
return res
def _reconcile_amount(self, cursor, user, ids, name, args, context=None):
if not ids:
@ -625,7 +630,7 @@ class account_bank_statement_line(osv.osv):
'statement_id': fields.many2one('account.bank.statement', 'Statement',
select=True, required=True, ondelete='cascade'),
'reconcile_id': fields.many2one('account.bank.statement.reconcile',
'Reconcile', states={'confirm':[('readonly',True)]}),
'Reconcile'),
'move_ids': fields.many2many('account.move',
'account_bank_statement_line_move_rel', 'move_id','statement_id',
'Moves'),
@ -633,7 +638,7 @@ class account_bank_statement_line(osv.osv):
'note': fields.text('Notes'),
'reconcile_amount': fields.function(_reconcile_amount,
string='Amount reconciled', method=True, type='float'),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of bank statement line."),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of bank statement lines."),
}
_defaults = {
'name': lambda self,cr,uid,context={}: self.pool.get('ir.sequence').get(cr, uid, 'account.bank.statement.line'),

View File

@ -478,9 +478,11 @@
<act_window domain="[('journal_id','=',active_id),('state','!=','draft'),('reconciled','=',False)]" id="act_account_journal_2_account_invoice_opened" name="Unpaid invoices" res_model="account.invoice" src_model="account.journal"/>
<act_window domain="[('account_analytic_id', '=', active_id)]" id="act_account_analytic_account_2_account_invoice_line" name="Invoice lines" res_model="account.invoice.line" src_model="account.analytic.account"/>
<!-- Partners inherited form -->
<act_window domain="[('partner_id', '=', partner_id), ('account_id.type', 'in', ['receivable', 'payable']), ('reconcile_id','=',False)]" id="act_account_invoice_account_move_unreconciled" name="Unreconciled Receivables &amp; Payables" res_model="account.move.line" src_model="account.invoice"/>
<!-- Partners inherited form -->
<record id="view_invoice_partner_info_form" model="ir.ui.view">
<field name="name">res.partner.invoice.info.inherit</field>
<field name="model">res.partner</field>

View File

@ -50,7 +50,7 @@ write({'state':'open'})</field>
<field name="wkf_id" ref="wkf"/>
<field name="name">paid</field>
<!--<field name="flow_stop">True</field>-->
<field name="action">write({'state':'paid'})</field>
<field name="action">confirm_paid()</field>
<field name="kind">function</field>
<field name="signal_send">subflow.paid</field>
</record>

View File

@ -30,7 +30,7 @@ import tools
class account_move_line(osv.osv):
_name = "account.move.line"
_description = "Entry lines"
_description = "Entry Lines"
def _query_get(self, cr, uid, obj='l', context={}):
fiscalyear_obj = self.pool.get('account.fiscalyear')
@ -577,11 +577,12 @@ class account_move_line(osv.osv):
merges_rec = []
for line in self.browse(cr, uid, ids, context):
if line.reconcile_id:
raise osv.except_osv(_('Already Reconciled'), _('Already Reconciled'))
raise osv.except_osv(_('Warning'), _('Already Reconciled!'))
if line.reconcile_partial_id:
for line2 in line.reconcile_partial_id.line_partial_ids:
if not line2.reconcile_id:
merges.append(line2.id)
if line2.id not in merges:
merges.append(line2.id)
total += (line2.debit or 0.0) - (line2.credit or 0.0)
merges_rec.append(line.reconcile_partial_id.id)
else:
@ -774,6 +775,17 @@ class account_move_line(osv.osv):
result['fields'] = self.fields_get(cr, uid, fields, context)
return result
def _check_moves(self, cr, uid, context):
# use the first move ever created for this journal and period
cr.execute('select id, state, name from account_move where journal_id=%s and period_id=%s order by id limit 1', (context['journal_id'],context['period_id']))
res = cr.fetchone()
if res:
if res[1] != 'draft':
raise osv.except_osv(_('UserError'),
_('The account move (%s) for centralisation ' \
'has been confirmed!') % res[2])
return res
def unlink(self, cr, uid, ids, context={}, check=True):
self._update_check(cr, uid, ids, context)
result = False
@ -809,7 +821,7 @@ class account_move_line(osv.osv):
return True
def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True):
if not context:
if context is None:
context={}
if vals.get('account_tax_id', False):
raise osv.except_osv(_('Unable to change tax !'), _('You can not change the tax, you should remove and recreate lines !'))
@ -825,6 +837,24 @@ class account_move_line(osv.osv):
if vals.get('date', False):
todo_date = vals['date']
del vals['date']
for line in self.browse(cr, uid, ids,context=context):
ctx = context.copy()
if ('journal_id' not in ctx):
if line.move_id:
ctx['journal_id'] = line.move_id.journal_id.id
else:
ctx['journal_id'] = line.journal_id.id
if ('period_id' not in ctx):
if line.move_id:
ctx['period_id'] = line.move_id.period_id.id
else:
ctx['period_id'] = line.period_id.id
#Check for centralisation
journal = self.pool.get('account.journal').browse(cr, uid, ctx['journal_id'], context=ctx)
if journal.centralisation:
self._check_moves(cr, uid, context=ctx)
result = super(account_move_line, self).write(cr, uid, ids, vals, context)
if check:
@ -891,14 +921,9 @@ class account_move_line(osv.osv):
is_new_move = False
if not move_id:
if journal.centralisation:
# use the first move ever created for this journal and period
cr.execute('select id, state, name from account_move where journal_id=%s and period_id=%s order by id limit 1', (context['journal_id'],context['period_id']))
res = cr.fetchone()
#Check for centralisation
res = self._check_moves(cr, uid, context)
if res:
if res[1] != 'draft':
raise osv.except_osv(_('UserError'),
_('The Ledger Posting (%s) for centralisation ' \
'has been confirmed!') % res[2])
vals['move_id'] = res[0]
if not vals.get('move_id', False):
@ -926,7 +951,7 @@ class account_move_line(osv.osv):
break
if journal.account_control_ids and not ok:
for a in journal.account_control_ids:
if a.id==vals['account_id']:
if a.id == vals['account_id']:
ok = True
break
if (account.currency_id) and 'amount_currency' not in vals and account.currency_id.id <> company_currency:
@ -941,7 +966,7 @@ class account_move_line(osv.osv):
if not ok:
raise osv.except_osv(_('Bad account !'), _('You can not use this general account in this journal !'))
if 'analytic_account_id' in vals and vals['analytic_account_id']:
if vals.get('analytic_account_id',False):
if journal.analytic_journal_id:
vals['analytic_lines'] = [(0,0, {
'name': vals['name'],
@ -961,8 +986,8 @@ class account_move_line(osv.osv):
result = super(osv.osv, self).create(cr, uid, vals, context)
# CREATE Taxes
if 'account_tax_id' in vals and vals['account_tax_id']:
tax_id=tax_obj.browse(cr,uid,vals['account_tax_id'])
if vals.get('account_tax_id',False):
tax_id = tax_obj.browse(cr, uid, vals['account_tax_id'])
total = vals['debit'] - vals['credit']
if journal.refund_journal:
base_code = 'ref_base_code_id'
@ -978,7 +1003,7 @@ class account_move_line(osv.osv):
tax_sign = 'tax_sign'
tmp_cnt = 0
for tax in tax_obj.compute(cr,uid,[tax_id],total,1.00):
for tax in tax_obj.compute(cr, uid, [tax_id], total, 1.00):
#create the base movement
if tmp_cnt == 0:
if tax[base_code]:
@ -1031,7 +1056,7 @@ class account_move_line(osv.osv):
# if context and ('__last_update' in context):
# del context['__last_update']
# self.pool.get('account.move').write(cr, uid, [move_id], {'date':vals['date']}, context=context)
if check and not context.get('no_store_function'):
if check and ((not context.get('no_store_function')) or journal.entry_posted):
tmp = self.pool.get('account.move').validate(cr, uid, [vals['move_id']], context)
if journal.entry_posted and tmp:
self.pool.get('account.move').button_validate(cr,uid, [vals['move_id']],context)

View File

@ -531,7 +531,10 @@
<field name="create_date" select="1"/>
<field name="type" select="1"/>
</group>
<separator colspan="4" string="Reconcile Entries"/>
<field colspan="4" name="line_id" nolabel="1"/>
<separator colspan="4" string="Partial Reconcile Entries"/>
<field colspan="4" name="line_partial_ids" nolabel="1"/>
</form>
</field>
</record>
@ -551,6 +554,7 @@
<field name="code"/>
<field name="sum"/>
<field name="sum_period"/>
<field name="company_id"/>
</tree>
</field>
</record>
@ -562,7 +566,7 @@
<form string="Account Tax Code">
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="company_id" select="1"/>
<field name="notprintable"/>
<field name="parent_id" select="1"/>
<field name="sign"/>
@ -648,9 +652,9 @@
</page>
<page groups="base.group_extended" string="Special Computation">
<separator colspan="4" string="Compute Code (if type=code)"/>
<field colspan="4" name="python_compute" nolabel="1" attrs="{'readonly':[('type','!=','code')]}"/>
<field colspan="4" name="python_compute" nolabel="1" attrs="{'readonly':[('type','!=','code')],'required':[('type','=','code')]}"/>
<separator colspan="4" string="Applicable Code (if type=code)"/>
<field colspan="4" name="python_applicable" nolabel="1" attrs="{'readonly':[('applicable_type','=','true')]}"/>
<field colspan="4" name="python_applicable" nolabel="1" attrs="{'readonly':[('applicable_type','=','true')], 'required':[('applicable_type','=','code')]}"/>
</page>
</notebook>
</form>
@ -1453,9 +1457,11 @@
<act_window domain="[('journal_id', '=', active_id)]" id="act_account_journal_2_account_move_line" name="Entry lines" res_model="account.move.line" src_model="account.journal"/>
<act_window domain="[('partner_id', '=', active_id), ('account_id.type', 'in', ['receivable', 'payable']), ('reconcile_id','=',False)]" id="act_account_partner_account_move_unreconciled" name="Receivables &amp; Payables" res_model="account.move.line" src_model="res.partner"/>
<act_window domain="[('partner_id', '=', active_id), ('account_id.type', 'in', ['receivable', 'payable']), ('reconcile_id','=',False)]" id="act_account_partner_account_move_unreconciled" name="Unreconciled Receivables &amp; Payables" res_model="account.move.line" src_model="res.partner"/>
<act_window domain="[('partner_id', '=', active_id)]" id="act_account_partner_account_move" name="All account entries" res_model="account.move.line" src_model="res.partner"/>
<act_window domain="[('partner_id', '=', active_id), ('account_id.type', 'in', ['receivable', 'payable'])]" id="act_account_partner_account_move_all" name="Receivables &amp; Payables" res_model="account.move.line" src_model="res.partner"/>
<act_window domain="[('partner_id', '=', active_id)]" id="act_account_partner_account_move" name="All Account Entries" res_model="account.move.line" src_model="res.partner"/>
<record id="view_account_addtmpl_wizard_form" model="ir.ui.view">
<field name="name">Account Add wizard</field>

View File

@ -23,8 +23,8 @@ import time
import decimal_precision as dp
import netsvc
from osv import fields, osv, orm
import ir
import pooler
from tools import config
from tools.translate import _
@ -217,6 +217,7 @@ class account_invoice(osv.osv):
_name = "account.invoice"
_description = 'Invoice'
_order = "number"
_log_create = True
_columns = {
'name': fields.char('Description', size=64, select=True,readonly=True, states={'draft':[('readonly',False)]}),
'origin': fields.char('Source Document', size=64, help="Reference of the document that produced this invoice."),
@ -333,7 +334,14 @@ class account_invoice(osv.osv):
raise orm.except_orm(_('Configuration Error!'),
_('There is no Accounting Journal of type Sale/Purchase defined!'))
else:
raise
raise orm.except_orm(_('UnknownError'), str(e))
def confirm_paid(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state':'paid'}, context=context)
for (id,name) in self.name_get(cr, uid, ids):
message = _('Document ') + " '" + name + "' "+ _("has been paid.")
self.log(cr, uid, id, message)
return True
def unlink(self, cr, uid, ids, context=None):
invoices = self.read(cr, uid, ids, ['state'])
@ -350,7 +358,7 @@ class account_invoice(osv.osv):
# res = self.pool.get('res.partner').address_get(cr, uid, [part], ['invoice'])
# return [{}]
def onchange_partner_id(self, cr, uid, ids, type, partner_id,
date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False):
date_invoice=False, payment_term=False, partner_bank=False, company_id=False):
invoice_addr_id = False
contact_addr_id = False
partner_payment_term = False
@ -415,7 +423,7 @@ class account_invoice(osv.osv):
else:
result['value']['date_due'] = False
if partner_bank_id != bank_id:
if partner_bank != bank_id:
to_update = self.onchange_partner_bank(cr, uid, ids, bank_id)
result['value'].update(to_update['value'])
return result
@ -450,7 +458,7 @@ class account_invoice(osv.osv):
def onchange_invoice_line(self, cr, uid, ids, lines):
return {}
def onchange_partner_bank(self, cursor, user, ids, partner_bank_id):
def onchange_partner_bank(self, cursor, user, ids, partner_bank):
return {'value': {}}
def onchange_company_id(self, cr, uid, ids, company_id, part_id, type, invoice_line, currency_id):
@ -650,6 +658,16 @@ class account_invoice(osv.osv):
self.write(cr, uid, [inv.id], res['value'])
return True
def finalize_invoice_move_lines(self, cr, uid, invoice_browse, move_lines):
"""finalize_invoice_move_lines(cr, uid, invoice, move_lines) -> move_lines
Hook method to be overridden in additional modules to verify and possibly alter the
move lines to be created by an invoice, for special cases.
:param invoice_browse: browsable record of the invoice that is generating the move lines
:param move_lines: list of dictionaries with the account.move.lines (as for create())
:return: the (possibly updated) final move_lines to create for this invoice
"""
return move_lines
def check_tax_lines(self, cr, uid, inv, compute_taxes, ait_obj):
if not inv.tax_line:
for tax in compute_taxes.values():
@ -912,7 +930,12 @@ class account_invoice(osv.osv):
# will be automatically deleted too
account_move_obj.unlink(cr, uid, [i['move_id'][0]])
if i['payment_ids']:
self.pool.get('account.move.line').write(cr, uid, i['payment_ids'], {'reconcile_partial_id': False})
account_move_line_obj = self.pool.get('account.move.line')
pay_ids = account_move_line_obj.browse(cr, uid , i['payment_ids'])
for move_line in pay_ids:
if move_line.reconcile_partial_id and move_line.reconcile_partial_id.line_partial_ids:
raise osv.except_osv(_('Error !'), _('You cannot cancel the Invoice which is Partially Paid! You need to unreconcile concerned payment entries!'))
self.write(cr, uid, ids, {'state':'cancel', 'move_id':False})
self._log_event(cr, uid, ids,-1.0, 'Cancel Invoice')
return True
@ -1147,14 +1170,14 @@ class account_invoice_line(osv.osv):
t = t - (p * l[2].get('quantity'))
taxes = l[2].get('invoice_line_tax_id')
if len(taxes[0]) >= 3 and taxes[0][2]:
taxes=tax_obj.browse(cr, uid, taxes[0][2])
taxes = tax_obj.browse(cr, uid, taxes[0][2])
for tax in tax_obj.compute(cr, uid, taxes, p,l[2].get('quantity'), context.get('address_invoice_id', False), l[2].get('product_id', False), context.get('partner_id', False)):
t = t - tax['amount']
return t
return 0
_name = "account.invoice.line"
_description = "Invoice line"
_description = "Invoice Line"
_columns = {
'name': fields.char('Description', size=256, required=True),
'origin': fields.char('Origin', size=256, help="Reference of the document that produced this invoice."),
@ -1200,8 +1223,8 @@ class account_invoice_line(osv.osv):
part = self.pool.get('res.partner').browse(cr, uid, partner_id)
fpos = fposition_id and self.pool.get('account.fiscal.position').browse(cr, uid, fposition_id) or False
lang=part.lang
context.update({'lang': lang})
if part.lang:
context.update({'lang': part.lang})
result = {}
res = self.pool.get('product.product').browse(cr, uid, product, context=context)

View File

@ -113,6 +113,7 @@
</form>
<tree string="Bank Details">
<field name="state"/>
<field name="bank"/>
<field name="owner_name"/>
<field name="acc_number"/>
</tree>

View File

@ -25,13 +25,13 @@
<field name="arch" type="xml">
<search string="Analytic Account">
<group col="8" colspan="4">
<filter icon="gtk-execute" string="My Accounts" domain="[('user_id','=',uid)]" help="My Analytic Accounts"/>
<filter icon="gtk-execute" string="Current" domain="[('state','=','open')]" help="Current Accounts"/>
<filter icon="gtk-execute" string="Pending" domain="[('state','=','pending')]" help="Pending Accounts"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="partner_id" select="1"/>
<field name="user_id" widget="selection"/>
</group>
</search>
</field>
@ -97,6 +97,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,graph,form</field>
<field name="view_id" ref="view_account_analytic_account_tree"/>
<field name="context">{"search_default_user_id":uid}</field>
<field name="search_view_id" ref="account.view_account_analytic_account_search"/>
</record>
<!--<menuitem id="menu_analytic_account" name="Analytic Accounts" parent="account.menu_analytic_accounting"/>-->
@ -188,11 +189,11 @@
<field name="arch" type="xml">
<search string="Search Analytic Lines">
<group col='6' colspan='4'>
<filter icon="gtk-execute" string="My" domain="[('user_id','=',uid)]" help="My Analytic Entries"/>
<field name="name" select="1"/>
<field name="journal_id" select="1"/>
<field name="account_id" select="1"/>
<field name="date" select="1"/>
<field name="user_id" widget="selection"/>
</group>
</search>
</field>
@ -202,6 +203,7 @@
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.analytic.line</field>
<field name="view_type">form</field>
<field name="context">{"search_default_user_id":uid}</field>
<field name="view_id" ref="view_account_analytic_line_tree"/>
</record>
<wizard id="action_account_analytic_line" menu="False" model="account.analytic.line" name="account.analytic.line" string="Entries by Line"/>

View File

@ -54,12 +54,12 @@ class account_analytic_analytic_check(report_sxw.rml_parse):
self.cr.execute("SELECT abs(sum(amount)) AS balance \
FROM account_analytic_line \
WHERE date>=%s AND date<=%s AND amount>0 AND general_account_id = %s", (date1, date2, a['id']))
WHERE date>=%s AND date<=%s AND amount<0 AND general_account_id = %s", (date1, date2, a['id']))
(ad,) = self.cr.fetchone()
ad = ad or 0.0
self.cr.execute("SELECT abs(sum(amount)) AS balance \
FROM account_analytic_line \
WHERE date>=%s AND date<=%s AND amount<0 AND general_account_id = %s", (date1, date2, a['id']))
WHERE date>=%s AND date<=%s AND amount>0 AND general_account_id = %s", (date1, date2, a['id']))
(ac,) = self.cr.fetchone()
ac = ac or 0.0

View File

@ -85,10 +85,6 @@
<separator orientation="vertical"/>
<field name="user_id" widget="selection">
<filter icon="terp-account"
string="My Invoices"
help = "My Invoices"
domain="[('user_id','=',uid)]" />
<filter icon="terp-account"
string="Invoices Non Users"
help="Invoices Non Users"
@ -164,7 +160,7 @@
<field name="res_model">account.invoice.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="context">{'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[],'search_default_user_id':uid}</field>
<field name="search_view_id" ref="view_account_invoice_report_search"/>
</record>

View File

@ -84,8 +84,8 @@
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<images/>
</stylesheet>
<images/>
<story>
<para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
<para style="terp_default_8">[[ setLang(o.lang) ]]</para>
@ -177,16 +177,16 @@
<para style="terp_default_Centre_9">[[ line['ref'] ]]</para>
</td>
<td>
<para style="terp_default_Centre_9">[[ line['date_maturity'] ]]</para>
<para style="terp_default_Centre_9">[[ line['date_maturity'] and formatLang(line['date_maturity'],date=True) or '' ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(line['debit']) and formatLang(line['debit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) ]]</para>
<para style="terp_default_Right_9">[[ (line['account_id']['type'] == 'receivable' and formatLang(line['debit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['credit'] * -1) or ' ') ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(line['credit']) and formatLang(line['credit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) ]]</para>
<para style="terp_default_Right_9">[[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((line['date_maturity'] &lt; time.strftime('%Y-%m-%d')) and ((line['debit'] - line['credit']) * (line['account_id']['type'] == 'payable' and -1 or 1))) ]]</para>
<para style="terp_default_Right_9">[[ formatLang((line['date_maturity'] &lt; time.strftime('%Y-%m-%d'))) and (line['debit'] - line['credit']) ]]</para>
</td>
<td>
<para style="terp_default_Centre_9">[[ line['blocked'] and 'X' or '' ]]</para>
@ -205,13 +205,13 @@
<para style="terp_default_Bold_9">Sub-Total : </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + (y['debit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0))) ]]</para>
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x ,y: x + (y['credit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0))) ]] </para>
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['credit'] or 0) or (y['account_id']['type'] == 'payable' and y['debit'] * -1 or 0)), getLines(o), 0))) ]] </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), filter(lambda x: x['date_maturity'] &lt; time.strftime('%Y-%m-%d'), getLines(o)), 0))) ]]</para>
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] &lt; time.strftime('%Y-%m-%d'), getLines(o)), 0))) ]]</para>
</td>
<td>
<para style="terp_default_9">
@ -229,7 +229,7 @@
<para style="terp_default_Bold_9">Balance : </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x +((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0))) ]]</para>
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x +(y['debit'] - y['credit']), getLines(o), 0))) ]]</para>
</td>
<td>
<para style="terp_default_9">
@ -248,9 +248,9 @@
</td>
</tr>
</blockTable>
<para style="terp_default_9">Total amount due: [[ formatLang((reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0))) ]] [[ company.currency_id.name ]].</para>
<para style="terp_default_9">Total amount due: [[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), getLines(o), 0))) ]] [[ company.currency_id.name ]].</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
</story>
</document>
</document>

View File

@ -15,8 +15,8 @@
"access_account_move","account.move","model_account_move","account.group_account_user",1,1,1,1
"access_account_move_line","account.move.line","model_account_move_line","account.group_account_user",1,1,1,1
"access_account_move_reconcile","account.move.reconcile","model_account_move_reconcile","account.group_account_user",1,1,1,1
"access_account_tax_code","account.tax.code","model_account_tax_code",,1,0,0,0
"access_account_tax","account.tax","model_account_tax",,1,0,0,0
"access_account_tax_code","account.tax.code","model_account_tax_code","account.group_account_invoice",1,0,0,0
"access_account_tax","account.tax","model_account_tax","account.group_account_invoice",1,0,0,0
"access_account_model","account.model","model_account_model","account.group_account_user",1,1,1,1
"access_account_model_line","account.model.line","model_account_model_line","account.group_account_user",1,1,1,1
"access_account_subscription","account.subscription","model_account_subscription","account.group_account_user",1,1,1,1
@ -93,3 +93,13 @@
"access_report_account_type_sales","report.account_type.sales","model_report_account_type_sales","account.group_account_manager",1,0,0,0
"access_report_account_sales","report.account.sales","model_report_account_sales","account.group_account_manager",1,0,0,0
"access_account_invoice_report","account.invoice.report","model_account_invoice_report","account.group_account_manager",1,0,0,0
"access_project_account_analytic_line","project.account.analytic.line","model_project_account_analytic_line","account.group_account_manager",1,1,1,1
"access_account_move_line_reconcile_select","account.move.line.reconcile.select","model_account_move_line_reconcile_select","account.group_account_manager",1,1,1,1
"access_account_move_line_unreconcile_select","account.move.line.unreconcile.select","model_account_move_line_unreconcile_select","account.group_account_manager",1,1,1,1
"access_account_invoice_refund","account.invoice.refund","model_account_invoice_refund","account.group_account_manager",1,1,1,1
"access_account_move_journal","account.move.journal","model_account_move_journal","account.group_account_manager",1,1,1,1
"access_account_move_bank_reconcile","account.move.bank.reconcile","model_account_move_bank_reconcile","account.group_account_manager",1,1,1,1
"access_account_subscription_generate","account.subscription.generate","model_account_subscription_generate","account.group_account_manager",1,1,1,1
"access_account_period_close","account.period.close","model_account_period_close","account.group_account_manager",1,1,1,1
"access_account_fiscalyear_close_state","account.fiscalyear.close.state","model_account_fiscalyear_close_state","account.group_account_manager",1,1,1,1
"access_account_chart","account.chart","model_account_chart","account.group_account_manager",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
15 access_account_move account.move model_account_move account.group_account_user 1 1 1 1
16 access_account_move_line account.move.line model_account_move_line account.group_account_user 1 1 1 1
17 access_account_move_reconcile account.move.reconcile model_account_move_reconcile account.group_account_user 1 1 1 1
18 access_account_tax_code account.tax.code model_account_tax_code account.group_account_invoice 1 0 0 0
19 access_account_tax account.tax model_account_tax account.group_account_invoice 1 0 0 0
20 access_account_model account.model model_account_model account.group_account_user 1 1 1 1
21 access_account_model_line account.model.line model_account_model_line account.group_account_user 1 1 1 1
22 access_account_subscription account.subscription model_account_subscription account.group_account_user 1 1 1 1
93 access_report_account_type_sales report.account_type.sales model_report_account_type_sales account.group_account_manager 1 0 0 0
94 access_report_account_sales report.account.sales model_report_account_sales account.group_account_manager 1 0 0 0
95 access_account_invoice_report account.invoice.report model_account_invoice_report account.group_account_manager 1 0 0 0
96 access_project_account_analytic_line project.account.analytic.line model_project_account_analytic_line account.group_account_manager 1 1 1 1
97 access_account_move_line_reconcile_select account.move.line.reconcile.select model_account_move_line_reconcile_select account.group_account_manager 1 1 1 1
98 access_account_move_line_unreconcile_select account.move.line.unreconcile.select model_account_move_line_unreconcile_select account.group_account_manager 1 1 1 1
99 access_account_invoice_refund account.invoice.refund model_account_invoice_refund account.group_account_manager 1 1 1 1
100 access_account_move_journal account.move.journal model_account_move_journal account.group_account_manager 1 1 1 1
101 access_account_move_bank_reconcile account.move.bank.reconcile model_account_move_bank_reconcile account.group_account_manager 1 1 1 1
102 access_account_subscription_generate account.subscription.generate model_account_subscription_generate account.group_account_manager 1 1 1 1
103 access_account_period_close account.period.close model_account_period_close account.group_account_manager 1 1 1 1
104 access_account_fiscalyear_close_state account.fiscalyear.close.state model_account_fiscalyear_close_state account.group_account_manager 1 1 1 1
105 access_account_chart account.chart model_account_chart account.group_account_manager 1 1 1 1

View File

@ -42,7 +42,7 @@ class ir_sequence(osv.osv):
_columns = {
'fiscal_ids' : fields.one2many('account.sequence.fiscalyear', 'sequence_main_id', 'Sequences')
}
def get_id(self, cr, uid, sequence_id, test='id', context={}):
def get_id(self, cr, uid, sequence_id, test='id', context={}):
cr.execute('select id from ir_sequence where '+test+'=%s and active=%s', (sequence_id, True,))
res = cr.dictfetchone()
if res:

View File

@ -21,6 +21,7 @@
from osv import fields, osv
from tools.translate import _
import netsvc
import time
class account_invoice_refund(osv.osv_memory):
@ -29,10 +30,14 @@ class account_invoice_refund(osv.osv_memory):
_name = "account.invoice.refund"
_description = "Invoice Refund"
_columns = {
'date': fields.date('Operation date', required=False),
'date': fields.date('Operation date', required=False, help='This date will be used as the invoice date for Refund Invoice and Period will be chosen accordingly!'),
'period': fields.many2one('account.period', 'Force period', required=False),
'description': fields.char('Description', size=150, required=True),
}
}
_defaults = {
'date': time.strftime('%Y-%m-%d'),
}
def compute_refund(self, cr, uid, ids, mode, context=None):
"""
@ -167,7 +172,7 @@ class account_invoice_refund(osv.osv_memory):
xml_id = 'action_invoice_tree1'
elif inv.type == 'in_invoice':
xml_id = 'action_invoice_tree2'
elif type == 'out_refund':
elif inv.type == 'out_refund':
xml_id = 'action_invoice_tree3'
else:
xml_id = 'action_invoice_tree4'

View File

@ -19,7 +19,6 @@
#
##############################################################################
import time
import datetime
from osv import fields, osv
from tools.translate import _

View File

@ -29,11 +29,17 @@ class account_unreconcile(osv.osv_memory):
obj_move_reconcile = self.pool.get('account.move.reconcile')
if context is None:
context = {}
recs = obj_move_line.read(cr, uid, context['active_ids'], ['reconcile_id',])
recs = filter(lambda x: x['reconcile_id'], recs)
rec_ids = [rec['reconcile_id'][0] for rec in recs]
if len(rec_ids):
obj_move_reconcile.unlink(cr, uid, rec_ids)
recs = pool.get('account.move.line').read(cr, uid, data['ids'], ['reconcile_id','reconcile_partial_id'])
unlink_ids = []
full_recs = filter(lambda x: x['reconcile_id'], recs)
rec_ids = [rec['reconcile_id'][0] for rec in full_recs]
part_recs = filter(lambda x: x['reconcile_partial_id'], recs)
part_rec_ids = [rec['reconcile_partial_id'][0] for rec in part_recs]
unlink_ids += rec_ids
unlink_ids += part_rec_ids
if len(unlink_ids):
pooler.get_pool(cr.dbname).get('account.move.reconcile').unlink(cr, uid, unlink_ids)
return {}
account_unreconcile()
@ -44,10 +50,11 @@ class account_unreconcile_reconcile(osv.osv_memory):
def trans_unrec_reconcile(self, cr, uid, ids, context=None):
obj_move_reconcile = self.pool.get('account.move.reconcile')
rec_ids = context['active_ids']
if context is None:
context = {}
if len(rec_ids):
obj_move_reconcile.unlink(cr, uid, context['active_ids'])
obj_move_reconcile.unlink(cr, uid, rec_ids)
return {}
account_unreconcile_reconcile()

View File

@ -393,7 +393,7 @@ account_analytic_account()
class account_analytic_account_summary_user(osv.osv):
_name = "account_analytic_analysis.summary.user"
_description = "Hours summary by user"
_description = "Hours Summary by User"
_order='user'
_auto = False
_rec_name = 'user'

View File

@ -25,7 +25,7 @@ import time
class account_analytic_default(osv.osv):
_name = 'account.analytic.default'
_description = 'Analytic Distributions'
_description = 'Analytic Distribution'
_rec_name = 'analytic_id'
_order = 'sequence'
_columns = {
@ -69,7 +69,7 @@ account_analytic_default()
class account_invoice_line(osv.osv):
_inherit = 'account.invoice.line'
_description = 'account invoice line'
_description = 'Invoice Line'
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition=False, price_unit=False, address_invoice_id=False, currency_id=False, context={}):
res_prod = super(account_invoice_line,self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition, price_unit, address_invoice_id, currency_id=currency_id, context=context)
@ -103,6 +103,8 @@ class sale_order_line(osv.osv):
# Method overridden to set the analytic account by default on criterion match
def invoice_line_create(self, cr, uid, ids, context={}):
create_ids = super(sale_order_line,self).invoice_line_create(cr, uid, ids, context)
if not ids:
return create_ids
sale_line_obj = self.browse(cr, uid, ids[0], context)
pool_inv_line = self.pool.get('account.invoice.line')

View File

@ -54,7 +54,7 @@ class one2many_mod2(fields.one2many):
class account_analytic_plan(osv.osv):
_name = "account.analytic.plan"
_description = "Analytic Plans"
_description = "Analytic Plan"
_columns = {
'name': fields.char('Analytic Plan', size=64, required=True, select=True,),
'plan_ids': fields.one2many('account.analytic.plan.line','plan_id','Analytic Plans'),
@ -63,7 +63,7 @@ account_analytic_plan()
class account_analytic_plan_line(osv.osv):
_name = "account.analytic.plan.line"
_description = "Analytic Plan Lines"
_description = "Analytic Plan Line"
_columns = {
'plan_id':fields.many2one('account.analytic.plan','Analytic Plan'),
'name': fields.char('Plan Name', size=64, required=True, select=True),
@ -297,14 +297,15 @@ class account_move_line(osv.osv):
def create_analytic_lines(self, cr, uid, ids, context={}):
super(account_move_line, self).create_analytic_lines(cr, uid, ids, context)
analytic_line_obj = self.pool.get('account.analytic.line')
for line in self.browse(cr, uid, ids, context):
if line.analytics_id:
if not line.journal_id.analytic_journal_id:
raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (line.journal_id.name,))
toremove = self.pool.get('account.analytic.line').search(cr, uid, [('move_id','=',line.id)], context=context)
toremove = analytic_line_obj.search(cr, uid, [('move_id','=',line.id)], context=context)
if toremove:
line.unlink(cr, uid, toremove, context=context)
analytic_line_obj.unlink(cr, uid, toremove, context=context)
for line2 in line.analytics_id.account_ids:
val = (line.credit or 0.0) - (line.debit or 0.0)
amt=val * (line2.rate/100)
@ -321,7 +322,7 @@ class account_move_line(osv.osv):
'journal_id': line.journal_id.analytic_journal_id.id,
'ref': line.ref,
}
ali_id=self.pool.get('account.analytic.line').create(cr,uid,al_vals)
ali_id=analytic_line_obj.create(cr, uid, al_vals, context=context)
return True
account_move_line()

View File

@ -24,7 +24,7 @@ from osv import fields, osv
class purchase_order(osv.osv):
_name = "purchase.order"
_inherit = "purchase.order"
_description = "Purchase order"
_description = "Purchase Order"
def inv_line_create(self, cr, uid, a, ol):
line = super(purchase_order, self).inv_line_create(cr, uid, a, ol)
@ -37,5 +37,4 @@ class purchase_order(osv.osv):
a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa)
line[2].update({'account_id': a})
return line
purchase_order()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
purchase_order()

View File

@ -239,7 +239,7 @@ class crossovered_budget_lines(osv.osv):
res[line.id]=0.00
return res
_name="crossovered.budget.lines"
_description = "Budget Lines"
_description = "Budget Line"
_columns = {
'crossovered_budget_id': fields.many2one('crossovered.budget', 'Budget', ondelete='cascade', select=True, required=True),
'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account',required=True),

View File

@ -0,0 +1,23 @@
# Thai translation for openobject-addons
# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-05-20 04:33+0000\n"
"Last-Translator: Songpon Phusing <p.songpon@gmail.com>\n"
"Language-Team: Thai <th@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-05-20 05:23+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_chart
#: model:ir.module.module,description:account_chart.module_meta_information
msgid "Remove minimal account chart"
msgstr "ทำการลบตัวอย่างผังบัญชีแบบง่าย"

View File

@ -23,7 +23,7 @@ from osv import fields, osv
class followup(osv.osv):
_name = 'account_followup.followup'
_description = 'Follow-Ups'
_description = 'Follow-Up'
_columns = {
'name': fields.char('Name', size=64, required=True),
'description': fields.text('Description'),
@ -34,7 +34,7 @@ followup()
class followup_line(osv.osv):
_name = 'account_followup.followup.line'
_description = 'Follow-Ups Criteria'
_description = 'Follow-Up Criteria'
_columns = {
'name': fields.char('Name', size=64, required=True),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of follow-up lines."),

View File

@ -30,7 +30,7 @@ def _code_get(self, cr, uid, context={}):
class account_followup_stat(osv.osv):
_name = "account_followup.stat"
_description = "Followup statistics"
_description = "Followup Statistics"
_auto = False
_columns = {
'name': fields.many2one('res.partner', 'Partner', readonly=True),

View File

@ -124,7 +124,7 @@
</field>
</record>
<act_window domain="[('partner_id', '=', active_id),('reconcile_id','=',False),('account_id.reconcile', '=', True)]" id="account.act_account_partner_account_move_unreconciled" name="Receivables &amp; Payables" res_model="account.move.line" view="account_move_line_partner_tree"/>
<act_window domain="[('partner_id', '=', active_id),('reconcile_id','=',False),('account_id.reconcile', '=', True),('account_id.type', 'in', ['receivable', 'payable'])]" id="account.act_account_partner_account_move_unreconciled" name="Receivables &amp; Payables" res_model="account.move.line" view="account_move_line_partner_tree"/>
<act_window domain="[('reconcile_id', '=', False),('account_id.type','=','receivable')]" id="act_account_partner_account_move_all" name="All receivable entries" res_model="account.move.line" src_model="" view="account_move_line_partner_tree"/>

View File

@ -28,7 +28,7 @@ import pooler
class payment_type(osv.osv):
_name= 'payment.type'
_description= 'Payment type'
_description= 'Payment Type'
_columns= {
'name': fields.char('Name', size=64, required=True,help='Payment Type'),
'code': fields.char('Code', size=64, required=True,help='Specifies the Code for Payment Type'),
@ -43,7 +43,7 @@ payment_type()
class payment_mode(osv.osv):
_name= 'payment.mode'
_description= 'Payment mode'
_description= 'Payment Mode'
_columns= {
'name': fields.char('Name', size=64, required=True,help='Mode of Payment'),
'bank_id': fields.many2one('res.partner.bank', "Bank account",

View File

@ -25,6 +25,8 @@
<field name="partner_id"/>
<field name="ref"/>
<field name="name"/>
<field name="journal_id"/>
<field name="account_id"/>
<field name="date_maturity"/>
<field name="date"/>
<field name="debit" sum="Total debit"/>
@ -279,7 +281,6 @@
<field name="currency"/>
<field name="bank_id" domain="[('partner_id', '=', partner_id)]"/>
<field name="move_line_id" on_change="onchange_move_line(move_line_id,parent.mode)"/>
<field domain="[('partner_id', '=', partner_id)]" name="bank_id"/>
<field name="create_date"/>
<field name="name"/>
</tree>

View File

@ -104,7 +104,7 @@ class payment_order_create(osv.osv_memory):
# Search for move line to pay:
domain = [('reconcile_id', '=', False),('account_id.type', '=', 'payable'),('amount_to_pay', '>', 0)]
domain = domain + ['|',('date_maturity','<',search_due_date),('date_maturity','=',False)]
domain = domain + ['|',('date_maturity','<=',search_due_date),('date_maturity','=',False)]
line_ids = line_obj.search(cr, uid, domain, context=context)
context.update({'line_ids': line_ids})
model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_create_payment_order_lines')], context=context)

View File

@ -106,5 +106,3 @@ class account_payment_populate_statement(osv.osv_memory):
return {'type' : 'ir.actions.act_window_close'}
account_payment_populate_statement()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -32,7 +32,7 @@ from mx.DateTime import RelativeDateTime, now, DateTime, localtime
class account_report(osv.osv):
_name = "account.report.report"
_description = "Account reporting"
_description = "Account Reporting"
# _color = [
# ('', ''),
# ('green','Green'),

View File

@ -30,7 +30,7 @@ from mx.DateTime import RelativeDateTime, now, DateTime, localtime
class color_rml(osv.osv):
_name = "color.rml"
_description = "Rml Colors"
_description = "Rml Color"
_columns = {
'name': fields.char('Name', size=64, required=True),
'code': fields.char('code',size=64,required=True),

View File

@ -103,7 +103,7 @@ class account_voucher(osv.osv):
],'Type', readonly=True, select=True , size=128),
'date':fields.date('Date', readonly=True, states={'draft':[('readonly',False)]}),
'journal_id':fields.many2one('account.journal', 'Journal', required=True, readonly=True, states={'draft':[('readonly',False)]}),
'account_id':fields.many2one('account.account', 'Account', required=True, readonly=True, states={'draft':[('readonly',False)]}),
'account_id':fields.many2one('account.account', 'Account', required=True, readonly=True, states={'draft':[('readonly',False)]}, domain=[('type','<>','view')]),
'payment_ids':fields.one2many('account.voucher.line','voucher_id','Voucher Lines', readonly=False, states={'proforma':[('readonly',True)]}),
'period_id': fields.many2one('account.period', 'Period', required=True, states={'posted':[('readonly',True)]}),
'narration':fields.text('Narration', readonly=True, states={'draft':[('readonly',False)]}, required=True),
@ -167,15 +167,14 @@ class account_voucher(osv.osv):
return {'value':{'account_id':account_id.id}}
def open_voucher(self, cr, uid, ids, context={}):
obj=self.pool.get('account.voucher').browse(cr,uid,ids)
total=0
obj = self.pool.get('account.voucher').browse(cr,uid,ids)
total = 0
for i in obj[0].payment_ids:
total+=i.amount
if total!=0:
self.write(cr,uid,ids,{'amount':total})
self.write(cr, uid, ids, {'state':'proforma'})
total += i.amount
if total != 0:
self.write(cr, uid, ids, {'amount':total, 'state':'proforma'})
else:
raise osv.except_osv('Invalid action !', 'You can not post to Pro-Forma a voucher with Total amount = 0')
raise osv.except_osv('Invalid action !', 'You cannot post to Pro-Forma a voucher with Total amount = 0 !')
return True
def proforma_voucher(self, cr, uid, ids, context={}):
@ -302,9 +301,9 @@ class account_voucher(osv.osv):
name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id)
move = {
'name': name,
'name' : name,
'journal_id': journal_id,
'voucher_type':inv.type,
'type' : inv.type,
'narration' : inv.narration
}
if inv.period_id:
@ -487,7 +486,7 @@ class account_voucher_line(osv.osv):
_columns = {
'voucher_id':fields.many2one('account.voucher', 'Voucher'),
'name':fields.char('Description', size=256, required=True),
'account_id':fields.many2one('account.account','Account', required=True),
'account_id':fields.many2one('account.account','Account', required=True, domain=[('type','<>','view')]),
'partner_id': fields.many2one('res.partner', 'Partner', change_default=True),
'amount':fields.float('Amount'),
'type':fields.selection([('dr','Debit'),('cr','Credit')], 'Type'),

View File

@ -31,7 +31,7 @@ import decimal_precision as dp
class account_analytic_account(osv.osv):
_name = 'account.analytic.account'
_description = 'Analytic Accounts'
_description = 'Analytic Account'
def _compute_currency_for_level_tree(self, cr, uid, ids, ids2, res, acc_set, context={}):
# Handle multi-currency on each level of analytic account
@ -285,7 +285,7 @@ account_analytic_account()
class account_analytic_line(osv.osv):
_name = 'account.analytic.line'
_description = 'Analytic lines'
_description = 'Analytic Line'
def _amount_currency(self, cr, uid, ids, field_name, arg, context={}):
result = {}
for rec in self.browse(cr, uid, ids, context):
@ -343,7 +343,7 @@ class account_analytic_line(osv.osv):
}
_defaults = {
'date': lambda *a: time.strftime('%Y-%m-%d'),
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', c),
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=c),
}
_order = 'date'
account_analytic_line()

View File

@ -100,7 +100,7 @@ class hr_analytic_timesheet(osv.osv):
'for this product: "%s" (id:%d)') % \
(r.product_id.name, r.product_id.id,))
# Compute based on pricetype
amount_unit=self.on_change_unit_amount(cr, uid, ids,
amount_unit = self.on_change_unit_amount(cr, uid, ids,
r.product_id.id, unit_amount, r.product_id.uom_id.id)['value']['amount']
amount = unit_amount * amount_unit
@ -136,7 +136,7 @@ class hr_analytic_timesheet(osv.osv):
'for this product: "%s" (id:%d)') % \
(r.product_id.name, r.product_id.id,))
# Compute based on pricetype
amount_unit=self.on_change_unit_amount(cr, uid, ids,
amount_unit = self.on_change_unit_amount(cr, uid, ids,
r.product_id.id, unit_amount, r.product_id.uom_id.id)['value']['amount']
amount = unit_amount * amount_unit

View File

@ -32,3 +32,5 @@
"acess_auction_payer","auction.payer","model_auction_payer","base.group_user",1,0,0,0
"access_auction_pay_sel","auction.pay.sel","model_auction_payer_sel","base.group_user",1,0,0,0
"acess_auction_taken","auction.taken","model_auction_taken","base.group_user",1,0,0,0
"access_auction_catalog_flagey","auction.catalog.flagey","model_auction_catalog_flagey","base.group_user",1,0,0,0
"access_auction_lots_buyer_map_user","auction_lots_buyer_map_user","model_auction_lots_buyer_map","base.group_user",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
32 acess_auction_payer auction.payer model_auction_payer base.group_user 1 0 0 0
33 access_auction_pay_sel auction.pay.sel model_auction_payer_sel base.group_user 1 0 0 0
34 acess_auction_taken auction.taken model_auction_taken base.group_user 1 0 0 0
35 access_auction_catalog_flagey auction.catalog.flagey model_auction_catalog_flagey base.group_user 1 0 0 0
36 access_auction_lots_buyer_map_user auction_lots_buyer_map_user model_auction_lots_buyer_map base.group_user 1 0 0 0

View File

@ -1618,15 +1618,14 @@ class ir_model(osv.osv):
@param context: A standard dictionary for contextual values
"""
if isinstance(ids, (str, int, long)):
ids = [ids]
new_ids = isinstance(ids, (str, int, long)) and [ids] or ids
data = super(ir_model, self).read(cr, uid, ids, fields=fields, \
data = super(ir_model, self).read(cr, uid, new_ids, fields=fields, \
context=context, load=load)
if data:
for val in data:
val['id'] = base_calendar_id2real_id(val['id'])
return data
return isinstance(ids, (str, int, long)) and data[0] or data
ir_model()

View File

@ -19,14 +19,13 @@
#
##############################################################################
import netsvc
from osv import fields, osv
class res_partner_contact(osv.osv):
""" Partner Contact """
_name = "res.partner.contact"
_description = "res.partner.contact"
_description = "Contact"
def _title_get(self,cr, user, context={}):
"""
@ -116,22 +115,6 @@ res_partner_contact()
class res_partner_address(osv.osv):
def search(self, cr, user, args, offset=0, limit=None, order=None,
context=None, count=False):
""" search parnter address
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param user: the current user
@param args: list of tuples of form [(name_of_the_field, operator, value), ...].
@param offset: The Number of Results to Pass
@param limit: The Number of Results to Return
@param context: A standard dictionary for contextual values
"""
if context and context.has_key('address_partner_id' ) and context['address_partner_id']:
args.append(('partner_id', '=', context['address_partner_id']))
return super(res_partner_address, self).search(cr, user, args, offset, limit, order, context, count)
#overriding of the name_get defined in base in order to remove the old contact name
def name_get(self, cr, user, ids, context={}):
"""
@ -208,6 +191,8 @@ class res_partner_job(osv.osv):
if arg[2] and not count:
search_arg = ['|', ('first_name', 'ilike', arg[2]), ('name', 'ilike', arg[2])]
contact_ids = contact_obj.search(cr, user, search_arg, offset=offset, limit=limit, order=order, context=context, count=count)
if not contact_ids:
continue
contacts = contact_obj.browse(cr, user, contact_ids, context=context)
for contact in contacts:
job_ids.extend([item.id for item in contact.job_ids])
@ -224,10 +209,10 @@ class res_partner_job(osv.osv):
_order = 'sequence_contact'
_columns = {
'name': fields.related('address_id','partner_id', type='many2one',\
'name': fields.related('address_id', 'partner_id', type='many2one',\
relation='res.partner', string='Partner', help="You may\
enter Address first,Partner will be linked automatically if any."),
'address_id': fields.many2one('res.partner.address','Address', \
'address_id': fields.many2one('res.partner.address', 'Address', domain=[('partner_id', '=', name)], \
help='Address which is linked to the Partner'),
'contact_id': fields.many2one('res.partner.contact','Contact', required=True, ondelete='cascade'),
'function_id': fields.many2one('res.partner.function','Partner Function', \
@ -251,7 +236,34 @@ class res_partner_job(osv.osv):
'sequence_contact' : lambda *a: 0,
'state': lambda *a: 'current',
}
def onchange_partner(self, cr, uid, _, partner_id, context=None):
"""
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current user,
@param _: List of IDs,
@partner_id : ID of the Partner selected,
@param context: A standard dictionary for contextual values
"""
return {'value': {'address_id': False}}
def onchange_address(self, cr, uid, _, address_id, context=None):
"""
@@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current user,
@param _: List of IDs,
@address_id : ID of the Address selected,
@param context: A standard dictionary for contextual values
"""
partner_id = False
if address_id:
address = self.pool.get('res.partner.address')\
.browse(cr, uid, address_id, context)
partner_id = address.partner_id.id
return {'value': {'name': partner_id}}
res_partner_job()

View File

@ -52,7 +52,7 @@
<form string="Functions and Addresses">
<group string="Partner" colspan="2" col="4">
<field name="function_id"/>
<field name="address_id" context="{'address_partner_id': name}"/>
<field name="address_id"/>
<field name="name"/>
<field name="date_start" />
<field name="date_stop" />
@ -357,23 +357,19 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Contact Functions">
<notebook>
<page string="General">
<field name="name" select="1"/>
<field name="address_id" select="1" context="{'address_partner_id': name}"/>
<field name="contact_id" select="1"/>
<field name="function_id" select="1"/>
<field name="email" widget="email"/>
<field name="phone"/>
<field name="fax"/>
<field name="extension"/>
<field name="sequence_contact" groups="base.group_user"/>
<field name="sequence_partner" groups="base.group_user"/>
<field name="date_start" groups="base.group_user"/>
<field name="date_stop" groups="base.group_user"/>
<field name="state" />
</page>
</notebook>
<field name="name" select="1" on_change="onchange_partner(name)"/>
<field name="address_id" select="1" attrs="{'required': [('name', '!=', False)]}" on_change="onchange_address(address_id)"/>
<field name="contact_id" select="1"/>
<field name="function_id" select="1"/>
<field name="email" widget="email"/>
<field name="phone"/>
<field name="fax"/>
<field name="extension"/>
<field name="sequence_contact" groups="base.group_user"/>
<field name="sequence_partner" groups="base.group_user"/>
<field name="date_start" groups="base.group_user"/>
<field name="date_stop" groups="base.group_user"/>
<field name="state" />
</form>
</field>
</record>

View File

@ -42,6 +42,17 @@
</field>
</field>
</record>
<record id="view_partner_iban_list" model="ir.ui.view">
<field name="name">res.partner.form.iban.inherit.list</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='bank_ids']/tree/field[@name='acc_number']" position="after">
<field name="iban"/>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@ -19,12 +19,28 @@
#
##############################################################################
from osv import fields, osv
from tools.translate import _
import pooler
from base_module_quality import base_module_quality
class CounterCursor(object):
def __init__(self, real_cursor):
self.cr = real_cursor
self.count = 0
def reset(self):
self.count = 0
def execute(self, query, params=None):
if query.lower().startswith('select '):
self.count += 1
return self.cr.execute(query, params)
def __getattr__(self, attr):
return getattr(self.cr, attr)
class quality_test(base_module_quality.abstract_quality_check):
def __init__(self):
@ -63,6 +79,7 @@ This test checks the speed of the module. Note that at least 5 demo data is need
result_dict = {}
result_dict2 = {}
self.result_details += _("<html>O(1) means that the number of SQL requests to read the object does not depand on the number of objects we are reading. This feature is hardly wished.\n</html>")
ccr = CounterCursor(cr)
for obj, ids in obj_ids.items():
code_base_complexity = 0
code_half_complexity = 0
@ -73,22 +90,22 @@ This test checks the speed of the module. Note that at least 5 demo data is need
list2 = []
if size:
speed_list = []
#we perform the operation twice, and count the number of queries in the second run. This allows to avoid the cache effect. (like translated terms that asks for more queries)
try:
pool.get(obj).read(cr, uid, [ids[0]])
cnt = cr.count
pool.get(obj).read(cr, uid, [ids[0]])
code_base_complexity = cr.count - cnt
pool.get(obj).read(cr, uid, ids[:size/2])
cnt = cr.count
pool.get(obj).read(cr, uid, ids[:size/2])
code_half_complexity = cr.count - cnt
# perform the operation once to put data in cache
pool.get(obj).read(cr, uid, ids)
cnt = cr.count
pool.get(obj).read(cr, uid, ids)
code_size_complexity = cr.count - cnt
ccr.reset()
pool.get(obj).read(ccr, uid, [ids[0]])
code_base_complexity = ccr.count
ccr.reset()
pool.get(obj).read(ccr, uid, ids[:size/2])
code_half_complexity = ccr.count
ccr.reset()
pool.get(obj).read(ccr, uid, ids)
code_size_complexity = ccr.count
except Exception, e:
list2 = [obj, _("Error in Read method")]
speed_list = [obj, size, code_base_complexity, code_half_complexity, code_size_complexity, _("Error in Read method:" + str(e))]

View File

@ -35,7 +35,7 @@ class report_creator(osv.osv):
#
def export_data(self, cr, uid, ids, fields_to_export, context=None):
if not context:
if context is None:
context = {}
data_l = self.read(cr, uid, ids, ['sql_query'], context)
final_datas = []
@ -61,7 +61,7 @@ class report_creator(osv.osv):
@param Fields: List of field of customer reports form.
@return: Dictionary of Fields
"""
if not context:
if context is None:
context = {}
data = context and context.get('report_id', False) or False
@ -95,7 +95,7 @@ class report_creator(osv.osv):
@param user: the current users ID for security checks,
@return: Dictionary of Fields, arch and toolbar.
"""
if not context:
if context is None:
context = {}
data = context and context.get('report_id', False) or False
@ -116,9 +116,11 @@ class report_creator(osv.osv):
arch = '<?xml version="1.0" encoding="utf-8"?>\n'
if view_type == 'graph':
arch += '<graph string="%s" type="%s" orientation="%s">' % (report.name, report.view_graph_type, report.view_graph_orientation)
orientation_eval = {'horz':'horizontal','vert' :'vertical'}
orientation = eval(report.view_graph_orientation,orientation_eval)
arch +='<graph string="%s" type="%s" orientation="%s">' % (report.name, report.view_graph_type, orientation)
i = 0
for val in ('x','y'):
i = 0
for f in report.field_ids:
if f.graph_mode == val:
if f.field_id.model:
@ -191,7 +193,9 @@ class report_creator(osv.osv):
@param fields: List of fields.
@return: List of Dictionary of form [{name_of_the_field: value, ...}, ...]
"""
data = context and context.get('report_id', False) or False
if context is None:
context = {}
data = context.get('report_id', False)
if (not context) or 'report_id' not in context:
return super(report_creator, self).read(cr, user, ids, fields, context, load)
ctx = context or {}
@ -225,8 +229,9 @@ class report_creator(osv.osv):
@param args: list of tuples of form [(name_of_the_field, operator, value), ...].
@return: List of id
"""
context_id = context and context.get('report_id', False) or False
if context is None:
context = {}
context_id = context.get('report_id', False)
if (not context) or 'report_id' not in context:
return super(report_creator, self).search(cr, user, args, offset, limit, order, context, count)
@ -372,9 +377,10 @@ class report_creator(osv.osv):
t = self.pool.get(f.field_id.model_id.model)._table
if f.group_method == 'group':
fields.append('\t'+t+'.'+f.field_id.name+' as field'+str(i))
groupby.append(t+'.'+f.field_id.name)
else:
fields.append('\t'+f.group_method+'('+t+'.'+f.field_id.name+')'+' as field'+str(i))
groupby.append(t+'.'+f.field_id.name)
i += 1
models = self._path_get(cr, uid, obj.model_ids, obj.filter_ids)
check = self._id_get(cr, uid, ids[0], context)

View File

@ -309,27 +309,32 @@ class PyOpenOffice(object):
return new_c
def sxw2rml(sxw_file, xsl, output='.', save_pict=False):
import libxslt
import libxml2
from lxml import etree
from StringIO import StringIO
tool = PyOpenOffice(output, save_pict = save_pict)
res = tool.unpackNormalize(sxw_file)
styledoc = libxml2.parseDoc(xsl)
style = libxslt.parseStylesheetDoc(styledoc)
doc = libxml2.parseMemory(res,len(res))
result = style.applyStylesheet(doc, None)
root = result.xpathEval("/document/stylesheet")
f = StringIO(xsl)
styledoc = etree.parse(f)
style = etree.XSLT(styledoc)
f = StringIO(res)
doc = etree.parse(f)
result = style(doc)
root = etree.XPathEvaluator(result)("/document/stylesheet")
if root:
root=root[0]
images = libxml2.newNode("images")
images = etree.Element("images")
for img in tool.images:
node = libxml2.newNode('image')
node.setProp('name', img)
node.setContent( base64.encodestring(tool.images[img]))
images.addChild(node)
root.addNextSibling(images)
node = etree.Element('image', name=img)
node.text = base64.encodestring(tool.images[img])
images.append(node)
root.append(images)
try:
xml = style.saveResultToString(result)
xml = str(result)
return xml
except:
return result
@ -349,7 +354,7 @@ if __name__ == "__main__":
import StringIO
fname = sys.argv[1]
f = StringIO.StringIO(file(fname).read())
f = fname
xsl_file = 'normalized_oo2rml.xsl'
z = zipfile.ZipFile(fname,"r")
mimetype = z.read('mimetype')

View File

@ -74,21 +74,26 @@ class base_gtkcontactform(osv.osv_memory):
'contact_me':fields.boolean('Contact Me'),
}
def execute(self, cr, uid, ids, context=None):
company_id = self.pool.get('base.setup.company').search(cr, uid, [])
company_data = self.pool.get('base.setup.company').read(cr, uid, company_id)
company_data = company_data and company_data[0] or False
if context is None:
context = {}
company_id = self.pool.get('base.setup.company').search(cr, uid, [], context=context)
company_data = self.pool.get('base.setup.company').read(cr, uid, company_id, context=context)
company_data = company_data and company_data[0] or {}
country = ''
if company_data and company_data.get('country_id', False):
country = self.pool.get('res.country').read(cr, uid, company_data['country_id'],['name'])['name']
for res in self.read(cr, uid, ids):
if company_data.get('country_id', False):
country = self.pool.get('res.country').read(cr, uid, company_data['country_id'],['name'], context=context)['name']
for res in self.read(cr, uid, ids, context=context):
email = res.get('email','')
result = "\ncompany: "+ str(company_data.get('name',''))
result += "\nname: " + str(res.get('name',''))
result += "\njob: " + str(res.get('job',''))
result = "\ncompany: "+ tools.ustr(company_data.get('name',''))
result += "\nname: " + tools.ustr(res.get('name',''))
result += "\njob: " + tools.ustr(res.get('job',''))
result += "\nphone: " + str(res.get('phone',''))
result += "\ncity: " + str(company_data.get('city',''))
result += "\ncity: " + tools.ustr(company_data.get('city',''))
result += "\ncountry: " + str(country)
result += "\nindustry: " + str(res.get('industry', ''))
result += "\nindustry: " + tools.ustr(res.get('industry', ''))
result += "\ntotal_employees: " + str(res.get('total_employees', ''))
result += "\nplan_use: " + str(res.get('use_openerp', False))
result += "\nalready_using_openerp: " + str(res.get('already_using_openerp', False))

View File

@ -0,0 +1,277 @@
# Thai translation for openobject-addons
# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-05-20 04:32+0000\n"
"Last-Translator: Songpon Phusing <p.songpon@gmail.com>\n"
"Language-Team: Thai <th@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-05-20 05:23+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,city:0
#: wizard_field:base_setup.base_setup,init,city:0
#: wizard_field:base_setup.base_setup,update,city:0
msgid "City"
msgstr "อำเภอ"
#. module: base_setup
#: wizard_view:base_setup.base_setup,finish:0
msgid ""
"You can start configuring the system or connect directly to the database "
"using the default setup."
msgstr "คุณอาจจะเริ่มตั้งค่าหรือใช้ค่าพื้นฐานเบื้องต้น"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,zip:0
#: wizard_field:base_setup.base_setup,init,zip:0
#: wizard_field:base_setup.base_setup,update,zip:0
msgid "Zip code"
msgstr "รหัสไปรษณีย์"
#. module: base_setup
#: wizard_view:base_setup.base_setup,init:0
msgid "Select a Profile"
msgstr "เลือกแบบ"
#. module: base_setup
#: wizard_view:base_setup.base_setup,company:0
msgid "Report header"
msgstr "หัวรายงาน"
#. module: base_setup
#: wizard_button:base_setup.base_setup,finish,config:0
msgid "Start Configuration"
msgstr "เริ่มการตั้งค่า"
#. module: base_setup
#: wizard_view:base_setup.base_setup,init:0
msgid ""
"You'll be able to install more modules later through the Administration menu."
msgstr "คุณสามารถลงโมดูลใหม่ๆได้ในเมนูการบริหารระบบ"
#. module: base_setup
#: wizard_view:base_setup.base_setup,init:0
msgid ""
"A profile sets a pre-selection of modules for specific needs. These profiles "
"have been setup to help you discover the different aspects of OpenERP. This "
"is just an overview, we have 300+ available modules."
msgstr ""
"รูปแบบโมดูลเป็นเพียงการตั้งค่าแนะนำในการใช้งานเพื่อตั้งค่าได้ง่ายขึ้น "
"แต่เรามีโมดูลที่สามารถหาติดตั้งได้มากกว่า 500 โมดูล"
#. module: base_setup
#: wizard_button:base_setup.base_setup,company,update:0
#: wizard_button:base_setup.base_setup,init,company:0
msgid "Next"
msgstr "ถัดไป"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,email:0
#: wizard_field:base_setup.base_setup,init,email:0
#: wizard_field:base_setup.base_setup,update,email:0
msgid "E-mail"
msgstr "อีเมล์"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,state_id:0
#: wizard_field:base_setup.base_setup,init,state_id:0
#: wizard_field:base_setup.base_setup,update,state_id:0
msgid "State"
msgstr "จังหวัด"
#. module: base_setup
#: wizard_view:base_setup.base_setup,finish:0
msgid "Your new database is now fully installed."
msgstr "ฐานข้อมูลใหม่ตั้งตั้งเสร็จสิ้น"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,profile:0
#: wizard_field:base_setup.base_setup,init,profile:0
#: wizard_field:base_setup.base_setup,update,profile:0
msgid "Profile"
msgstr "รูปแบบ"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,rml_footer1:0
#: wizard_field:base_setup.base_setup,init,rml_footer1:0
#: wizard_field:base_setup.base_setup,update,rml_footer1:0
msgid "Report Footer 1"
msgstr "หัวรายงาน 1"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,rml_footer2:0
#: wizard_field:base_setup.base_setup,init,rml_footer2:0
#: wizard_field:base_setup.base_setup,update,rml_footer2:0
msgid "Report Footer 2"
msgstr "ท้ายรายงาน 2"
#. module: base_setup
#: wizard_view:base_setup.base_setup,company:0
msgid "General Information"
msgstr "ข้อมูลทั่วไป"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,street2:0
#: wizard_field:base_setup.base_setup,init,street2:0
#: wizard_field:base_setup.base_setup,update,street2:0
msgid "Street2"
msgstr "ตำบล"
#. module: base_setup
#: wizard_view:base_setup.base_setup,company:0
msgid "Report Information"
msgstr "ข้อมูลรายงาน"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,phone:0
#: wizard_field:base_setup.base_setup,init,phone:0
#: wizard_field:base_setup.base_setup,update,phone:0
msgid "Phone"
msgstr "โทรศัพท์"
#. module: base_setup
#: wizard_view:base_setup.base_setup,company:0
msgid "Define Main Company"
msgstr "ตั้งบริษัทหลัก"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,name:0
#: wizard_field:base_setup.base_setup,init,name:0
#: wizard_field:base_setup.base_setup,update,name:0
msgid "Company Name"
msgstr "ชื่อบริษัท"
#. module: base_setup
#: help:base_setup.base_setup,company,rml_footer2:0
#: help:base_setup.base_setup,init,rml_footer2:0
#: help:base_setup.base_setup,update,rml_footer2:0
msgid ""
"This sentence will appear at the bottom of your reports.\n"
"We suggest you to put bank information here:\n"
"IBAN: BE74 1262 0121 6907 - SWIFT: CPDF BE71 - VAT: BE0477.472.701"
msgstr ""
"ข้อมูลนี่จะอยู่ในท้ายกระดาษของรายงาน\n"
"เราแนะนำให้เปลี่ยนโดยใส่ข้อมูลของธนาคาร\n"
"IBAN: BE74 1262 0121 6907 - SWIFT: CPDF BE71 - VAT: BE0477.472.701"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,country_id:0
#: wizard_field:base_setup.base_setup,init,country_id:0
#: wizard_field:base_setup.base_setup,update,country_id:0
msgid "Country"
msgstr "ประเทศ"
#. module: base_setup
#: wizard_view:base_setup.base_setup,company:0
#: wizard_view:base_setup.base_setup,finish:0
#: wizard_view:base_setup.base_setup,init:0
#: wizard_view:base_setup.base_setup,update:0
#: model:ir.actions.wizard,name:base_setup.action_wizard_setup
#: model:ir.actions.wizard,name:base_setup.wizard_base_setup
msgid "Setup"
msgstr "ตั้งค่า"
#. module: base_setup
#: help:base_setup.base_setup,company,rml_footer1:0
#: help:base_setup.base_setup,init,rml_footer1:0
#: help:base_setup.base_setup,update,rml_footer1:0
msgid ""
"This sentence will appear at the bottom of your reports.\n"
"We suggest you to write legal sentences here:\n"
"Web: http://openerp.com - Fax: +32.81.73.35.01 - Fortis Bank: 126-2013269-07"
msgstr ""
"ข้อมูลนี่จะอยู่ในท้ายกระดาษของรายงาน\n"
"เราแนะนำให้ท่านนำข้อมูลเกี่ยวกับทางกฏหมาย\n"
"Web: http://openerp.com - Fax: +32.81.73.35.01 - Fortis Bank: 126-2013269-07"
#. module: base_setup
#: wizard_view:base_setup.base_setup,update:0
msgid "Summary"
msgstr "สรุป"
#. module: base_setup
#: wizard_button:base_setup.base_setup,update,finish:0
msgid "Install"
msgstr "ติดตั้ง"
#. module: base_setup
#: wizard_view:base_setup.base_setup,finish:0
msgid "Installation Done"
msgstr "ติดตั้งเสร็จสิ้น"
#. module: base_setup
#: help:base_setup.base_setup,company,rml_header1:0
#: help:base_setup.base_setup,init,rml_header1:0
#: help:base_setup.base_setup,update,rml_header1:0
msgid ""
"This sentence will appear at the top right corner of your reports.\n"
"We suggest you to put a slogan here:\n"
"\"Open Source Business Solutions\"."
msgstr ""
"ข้อมูลนี่จะอยู่ในด้านบนขวาของรายงานท่าน\n"
"กรุณาใส่ สโลแกน\n"
"\"Open Source Business Solutions\"."
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,rml_header1:0
#: wizard_field:base_setup.base_setup,init,rml_header1:0
#: wizard_field:base_setup.base_setup,update,rml_header1:0
msgid "Report Header"
msgstr "หัวรายงาน"
#. module: base_setup
#: wizard_view:base_setup.base_setup,company:0
msgid "Your Logo - Use a size of about 450x150 pixels."
msgstr "กรุณาใช้โลโก้ขนาด 450X150 px"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,currency:0
#: wizard_field:base_setup.base_setup,init,currency:0
#: wizard_field:base_setup.base_setup,update,currency:0
msgid "Currency"
msgstr "อัตราแลกเปลี่ยน"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,street:0
#: wizard_field:base_setup.base_setup,init,street:0
#: wizard_field:base_setup.base_setup,update,street:0
msgid "Street"
msgstr "ที่อยู่"
#. module: base_setup
#: wizard_button:base_setup.base_setup,finish,menu:0
msgid "Use Directly"
msgstr "ใช้ทันที"
#. module: base_setup
#: wizard_button:base_setup.base_setup,init,menu:0
msgid "Cancel"
msgstr "ยกเลิก"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,logo:0
#: wizard_field:base_setup.base_setup,init,logo:0
#: wizard_field:base_setup.base_setup,update,logo:0
msgid "Logo"
msgstr "โลโก้"
#. module: base_setup
#: model:ir.module.module,shortdesc:base_setup.module_meta_information
msgid "Base Setup"
msgstr "โครงสร้าง ตั้งค่า"
#. module: base_setup
#: wizard_button:base_setup.base_setup,company,init:0
#: wizard_button:base_setup.base_setup,update,company:0
msgid "Previous"
msgstr "ก่อนหน้า"

View File

@ -152,5 +152,23 @@ IBAN: BE74 1262 0121 6907 - SWIFT: CPDF BE71 - VAT: BE0477.472.701'''),
context=context)
base_setup_company()
class res_currency(osv.osv):
_inherit = 'res.currency'
def name_get(self, cr, uid, ids, context=None):
if context is None:
context = {}
# We can use the following line,if we want to restrict this name_get for company setup only
# But, its better to show currencies as name(Code).
# if not (context.get('active_model','') == 'ir.actions.todo'):
# return super(res_currency,self).name_get(cr, uid, ids, context=context)
if not len(ids):
return []
if isinstance(ids, (int, long)):
ids = [ids]
reads = self.read(cr, uid, ids, ['name','code'], context, load='_classic_write')
return [(x['id'], tools.ustr(x['name']) + ' (' + tools.ustr(x['code']) + ')') for x in reads]
res_currency()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2009-09-08 15:20+0000\n"
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
"PO-Revision-Date: 2010-05-19 09:15+0000\n"
"Last-Translator: Rytis Ūsalis <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-04-17 03:57+0000\n"
"X-Launchpad-Export-Date: 2010-05-20 05:23+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: board_association
@ -40,7 +40,7 @@ msgstr ""
#. module: board_association
#: view:board.board:0
msgid "My tasks"
msgstr ""
msgstr "Mano užduotys"
#. module: board_association
#: view:board.board:0

View File

@ -32,7 +32,7 @@ class crm_lead(osv.osv, crm_case):
""" CRM Lead Case """
_name = "crm.lead"
_description = "Leads Cases"
_description = "Lead"
_order = "priority, id desc"
_inherit = ['res.partner.address', 'mailgate.thread']

View File

@ -8,6 +8,7 @@
<field name="view_mode">tree,form</field>
<field name="domain">['|', ('type','=','lead'), ('type','=',False)]</field>
<field name="view_id" ref="crm_case_tree_view_leads"/>
<field name="context">{"search_default_user_id":uid,'search_default_current':1}</field>
<field name="search_view_id" ref="crm.view_crm_case_leads_filter"/>
<field name="context">{'search_default_current':1}</field>
</record>

View File

@ -48,7 +48,8 @@
string="Convert"
help="Convert to Opportunity"
icon="gtk-index"
type="object"/>
type="object"
attrs="{'invisible':[('opportunity_id','!=',False)]}"/>
<newline />
<field name="section_id" colspan="1"
widget="selection" />
@ -102,18 +103,18 @@
<separator colspan="4"/>
<group col="8" colspan="4">
<field name="state"/>
<button name="case_close" string="Close"
states="open,draft,pending" type="object"
icon="gtk-close" />
<button name="case_open" string="Open"
states="draft,pending" type="object"
icon="gtk-go-forward" />
<button name="case_cancel" string="Cancel"
states="draft,open,pending" type="object"
icon="gtk-cancel" />
<button name="case_close" string="Close"
states="open,draft,pending" type="object"
icon="gtk-close" />
<button name="case_pending" string="Pending"
states="draft,open" type="object"
icon="gtk-media-pause" />
<button name="case_cancel" string="Cancel"
states="draft,open,pending" type="object"
icon="gtk-cancel" />
<button name="case_escalate" string="Escalate"
states="open,draft,pending" type="object"
groups="base.group_extended"
@ -125,7 +126,7 @@
</page>
<page string="Extra Info" groups="base.group_extended">
<group colspan="2" col="2">
<separator string="Categories" colspan="2" col="2"/>
<separator string="Categorization" colspan="2" col="2"/>
<field name="company_id"
groups="base.group_multi_company"
widget="selection" colspan="2" />
@ -197,7 +198,8 @@
<field name="model">crm.lead</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Leads Tree" colors="blue:state=='pending';grey:state in ('cancel', 'done')">
<tree string="Leads Tree" colors="blue:state=='pending';grey:state in ('cancel', 'done');red:date_deadline &lt; current_date">
<field name="date_deadline" invisible="1"/>
<field name="create_date"/>
<field name="partner_name"/>
<field name="name"/>
@ -289,10 +291,6 @@
<field name="partner_name"/>
<field name="email_from"/>
<field name="user_id" widget="selection">
<filter icon="terp-partner"
domain="[('user_id','=',uid)]"
help="My Leads" default="1"
/>
<filter icon="terp-partner"
domain="[('user_id','=', False)]"
help="Unassigned Leads" />
@ -302,7 +300,7 @@
<filter icon="terp-crm"
context="{'invisible_section': False}"
domain="[('section_id.user_id','=',uid)]"
help="My section"/>
help="My Sale Team"/>
<filter icon="terp-crm"
context="{'invisible_section': False}"
domain="[]"
@ -313,7 +311,6 @@
<filter string="Stage" icon="terp-crm" domain="[]" context="{'group_by':'stage_id'}"/>
<filter string="State" icon="terp-crm" domain="[]" context="{'group_by':'state'}"/>
<filter string="Source" icon="terp-crm" domain="[]" context="{'group_by':'categ_id'}"/>
<filter string="Type" icon="terp-crm" domain="[]" context="{'group_by':'type'}"/>
<separator orientation="vertical"/>
<filter string="Team" icon="terp-crm" domain="[]" context="{'group_by':'section_id'}"/>
<filter string="Salesman" icon="terp-crm" domain="[]" context="{'group_by':'user_id'}"/>

View File

@ -41,7 +41,7 @@ class crm_meeting(osv.osv, crm_case):
""" CRM Meeting Cases """
_name = 'crm.meeting'
_description = "Meeting Cases"
_description = "Meeting"
_order = "id desc"
_inherit = ["mailgate.thread", "calendar.event"]

View File

@ -50,7 +50,7 @@
<field name="res_model">crm.meeting</field>
<field name="view_mode">calendar,tree,form,gantt</field>
<field name="view_id" ref="crm_case_calendar_view_meet"/>
<field name="context">{'search_default_current':1}</field>
<field name="context">{"search_default_user_id":uid}</field>
<field name="search_view_id" ref="view_crm_case_meetings_filter"/>
</record>

View File

@ -260,25 +260,21 @@
<field name="arch" type="xml">
<search string="Search Meetings">
<group col="12" colspan="4">
<filter icon="terp-project" name="current" string="Current"
domain="[('state','in',('draft', 'open'))]"
help="Current Meetings"/>
<filter icon="terp-partner" string="My Meetings"
domain="[('user_id','=',uid)]"
help="My Meetings" />
<filter icon="terp-project" name="current" string="Current"
domain="[('state','in',('draft', 'open'))]"
help="Current Meetings"/>
<separator orientation="vertical"/>
<field name="name" select="1" string="Subject"/>
<field name="partner_id" select="1" />
<field name="section_id"
select="1" widget="selection">
<field name="section_id" select="1" widget="selection">
<filter icon="terp-crm"
domain="[('section_id','=',context.get('section_id',False))]"
help="My section" />
help="My Sale Team" />
</field>
<field name="user_id" select="1" widget="selection"/>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="16">
<group expand="0" string="Group By..." colspan="16">
<filter string="Date" icon="terp-project"
domain="[]" context="{'group_by':'date'}" />
<filter string="Privacy" icon="terp-crm"

View File

@ -36,12 +36,10 @@ AVAILABLE_STATES = [
class crm_opportunity(osv.osv):
""" Opportunity Cases """
_name = "crm.lead"
_description = "Opportunity Cases"
_description = "Opportunity"
_order = "priority,date_action,id desc"
_inherit = 'crm.lead'
_columns = {
# From crm.case
'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact', \
@ -56,7 +54,6 @@ class crm_opportunity(osv.osv):
'date_deadline': fields.date('Expected Closing'),
'date_action': fields.date('Next Action'),
}
def case_close(self, cr, uid, ids, *args):
"""Overrides close for crm_case for setting probability and close date
@param self: The object pointer

View File

@ -29,6 +29,7 @@
<field name="domain">[('type','=','opportunity')]</field>
<field name="context">{'search_default_current':1}</field>
<field name="view_id" ref="crm_case_tree_view_oppor"/>
<field name="context">{"search_default_user_id":uid}</field>
<field name="search_view_id" ref="crm.view_crm_case_opportunities_filter"/>
</record>

View File

@ -115,57 +115,25 @@
<button name="case_open" string="Open"
states="draft,pending" type="object"
icon="gtk-go-forward" />
<button name="case_pending" string="Pending"
states="draft,open" type="object"
icon="gtk-media-pause" />
<button name="case_escalate" string="Escalate"
states="open,draft,pending" type="object"
groups="base.group_extended"
icon="gtk-go-up" />
<button name="case_pending" string="Pending"
states="draft,open" type="object"
icon="gtk-media-pause" />
<button name="case_cancel" string="Mark Lost"
states="draft,open,pending" type="object"
icon="gtk-close" />
<button name="case_close" string="Mark Won"
states="open,draft,pending" type="object"
icon="gtk-apply" />
<button name="case_cancel" string="Mark Lost"
states="draft,open,pending" type="object"
icon="gtk-cancel" />
<button name="case_reset" string="Reset to New"
states="done,cancel" type="object"
icon="gtk-convert" />
</group>
</page>
<page string="History" groups="base.group_extended">
<group col="2" colspan="2">
<separator string="Dates" colspan="2"/>
<field name="create_date"/>
<field name="write_date"/>
<field name="date_closed"/>
<field name="date_open"/>
</group>
<group col="2" colspan="2">
<separator string="Misc" colspan="2"/>
<field name="active"/>
<field name="day_open"/>
<field name="day_close"/>
<field name="referred"/>
</group>
<separator colspan="4" string="References"/>
<field name="ref"/>
<field name="ref2"/>
<field name="log_ids" nolabel="1" colspan="4">
<tree string="Logs">
<field name="name" colspan="4"/>
<field name="date"/>
<field name="user_id"/>
</tree>
<form string="Logs">
<separator string="Action Information" colspan="4"/>
<field name="name" colspan="4"/>
<field name="date"/>
<field name="user_id"/>
</form>
</field>
</page>
<page string="Emails" groups="base.group_extended">
<group colspan="4">
<field colspan="4" name="email_cc" string="CC"/>
@ -199,6 +167,38 @@
name="%(crm_lead_forward_to_partner_act)d"
icon="gtk-go-forward" type="action" />
</page>
<page string="History" groups="base.group_extended">
<group col="2" colspan="2">
<separator string="Dates" colspan="2"/>
<field name="create_date"/>
<field name="write_date"/>
<field name="date_closed"/>
<field name="date_open"/>
</group>
<group col="2" colspan="2">
<separator string="Misc" colspan="2"/>
<field name="active"/>
<field name="day_open"/>
<field name="day_close"/>
<field name="referred"/>
</group>
<separator colspan="4" string="References"/>
<field name="ref"/>
<field name="ref2"/>
<field name="log_ids" nolabel="1" colspan="4">
<tree string="Logs">
<field name="name" colspan="4"/>
<field name="date"/>
<field name="user_id"/>
</tree>
<form string="Logs">
<separator string="Action Information" colspan="4"/>
<field name="name" colspan="4"/>
<field name="date"/>
<field name="user_id"/>
</form>
</field>
</page>
</notebook>
</form>
</field>
@ -211,7 +211,8 @@
<field name="model">crm.lead</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Opportunities" colors="blue:state=='pending';grey:state in ('cancel','done')">
<tree string="Opportunities" colors="blue:state=='pending';grey:state in ('cancel', 'done');red:date_deadline &lt; current_date">
<field name="date_deadline" invisible="1"/>
<field name="create_date"/>
<field name="name" string="Opportunity"/>
<field name="partner_id"/>
@ -234,7 +235,7 @@
icon="gtk-go-forward" />
<button name="case_close" string="Won"
states="open,draft,pending" type="object"
icon="gtk-close" />
icon="gtk-apply" />
<button name="case_pending" string="Pending"
states="open,draft" type="object"
icon="gtk-media-pause" />
@ -290,10 +291,6 @@
<separator orientation="vertical"/>
<field name="name" string="Opportunity"/>
<field name="user_id" widget="selection">
<filter icon="terp-partner"
domain="[('user_id','=',uid)]"
help="My Opportunities" default="1"
/>
<filter icon="terp-partner"
domain="[('user_id','=', False)]"
help="Unassigned Opportunities" />
@ -303,7 +300,7 @@
widget="selection">
<filter icon="terp-crm"
domain="[('section_id','=',context.get('section_id',False))]"
help="My section" />
help="My Sale Team" />
</field>
<newline/>
<group expand="0" string="Group By..." colspan="16">

View File

@ -29,7 +29,7 @@ class crm_phonecall(osv.osv, crm_case):
""" Phonecall Cases """
_name = "crm.phonecall"
_description = "Phonecall Cases"
_description = "Phonecall"
_order = "id desc"
_inherit = 'mailgate.thread'

View File

@ -20,6 +20,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,calendar</field>
<field name="view_id" ref="crm_case_phone_tree_view"/>
<field name="context">{"search_default_user_id":uid}</field>
<field name="search_view_id" ref="crm.view_crm_case_phonecalls_filter"/>
</record>

View File

@ -263,9 +263,6 @@
<field name="name" string="Call Summary"/>
<field name="partner_id"/>
<field name="user_id" widget="selection">
<filter icon="terp-partner"
domain="[('user_id','=',uid)]" help="My Phonecalls"
default="1" />
<filter icon="terp-partner"
domain="[('user_id','=',False)]"
help="Unassigned Phonecalls" />
@ -274,7 +271,7 @@
select="1" widget="selection" string="Sales Team">
<filter icon="terp-crm"
domain="[('section_id','=',context.get('section_id',False))]"
help="My section" />
help="My Sale Team" />
</field>
<newline/>
<group expand="0" string="Group By..." colspan="4">

View File

@ -18,7 +18,6 @@
<group col="6" colspan="4">
<field name="name" select="1" colspan="4"/>
<field name="code" select="1"/>
<newline/>
<field name="resource_calendar_id" select="2"/>
</group>
<notebook colspan="4">
@ -39,8 +38,8 @@
</group>
<separator string="Members List" colspan="4"/>
<field name="member_ids" nolabel="1" colspan="4"/>
<separator string="Note" colspan="4"/>
<field name="note" select="1" colspan="4" nolabel="1"/>
</page><page string="Notes">
<field name="note" colspan="4" nolabel="1"/>
</page>
</notebook>
</form>
@ -435,9 +434,6 @@
<field name="arch" type="xml">
<search string="Search Case">
<group col='6' colspan='4'>
<filter icon="terp-partner" string="My Cases"
domain="[('user_id','=',uid)]" separator="1"
default="1" help="Cases Related to Current User" />
<field name="state" select="1">
<filter icon="gtk-new"
domain="[('state','in',('draft', 'open'))]"
@ -465,6 +461,7 @@
<field name="res_model">mailgate.thread</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_case_tree-view"/>
<field name="context">{"search_default_user_id":uid}</field>
<field name="search_view_id" ref="view_crm_case_filter"/>
</record>
@ -522,10 +519,6 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Histories">
<filter icon="terp-crm" string="My Histories"
domain="[('user_id','=',uid)]"
help="My Histories" />
<separator orientation="vertical"/>
<group col="6" colspan="2">
<field name="date" select="1"/>
<field name="user_id" select="1" widget="selection"/>
@ -545,6 +538,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="crm_case_history_tree-view"/>
<field name="context">{"search_default_user_id":uid}</field>
<field name="search_view_id" ref="crm_case_history_search"/>
</record>

View File

@ -14,7 +14,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,calendar,form,graph</field>
<field name="view_id" ref="crm_case_claims_tree_view"/>
<field name="context">{"search_default_section_id":section_id,"search_default_current":1,"search_default_my_claims":1}</field>
<field name="context">{"search_default_section_id":section_id,"search_default_current":1,"search_default_user_id":uid}</field>
<field name="search_view_id" ref="crm_claim.view_crm_case_claims_filter"/>
</record>

View File

@ -246,8 +246,8 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Claims">
<filter icon="gtk-new" string="Current"
domain="[('state','in',('draft', 'open'))]" name="current"
<filter icon="gtk-new" string="Current" name="current"
domain="[('state','in',('draft', 'open'))]"
separator="1" help="Current Claims" default="1"
/>
<filter icon="gtk-execute"
@ -264,20 +264,12 @@
<field name="name" select='1'/>
<field name="partner_id" select="1"/>
<field name="user_id" select="1" widget="selection">
<filter icon="terp-partner"
domain="[('user_id','=',uid)]" help="My Claims"
default="1" />
<filter icon="terp-partner"
domain="[('user_id','=', False)]"
help="Unassigned Claims" />
</field>
<field name="section_id" select="1"
widget="selection"
default="context.get('section_id', False)">
<filter icon="terp-crm"
domain="[('section_id','=',context.get('section_id',False))]"
help="My section" />
</field>
widget="selection"/>
<newline/>
<group expand="0" string="Group By..." colspan="10" col="20">
<filter string="Deadline" icon="terp-crm"

View File

@ -12,8 +12,8 @@
<field name="name">Funds</field>
<field name="res_model">crm.fundraising</field>
<field name="view_mode">tree,form,graph</field>
<field name="context">{"search_default_current":1}</field>
<field name="view_id" ref="crm_fundraising.crm_case_tree_view_fund"/>
<field name="context">{"search_default_user_id":uid,"search_default_current":1}</field>
<field name="search_view_id" ref="crm_fundraising.view_crm_case_fund_filter"/>
</record>

View File

@ -249,8 +249,7 @@
</field>
</record>
<!-- Fund Raising Search View -->
<!-- Fund Raising Search View -->
<record id="view_crm_case_fund_filter" model="ir.ui.view">
<field name="name">CRM - Funds Search</field>
<field name="model">crm.fundraising</field>
@ -269,12 +268,6 @@
domain="[('state','=','pending')]"
help="Pending Funds" />
<separator orientation="vertical" />
<filter icon="terp-partner" string="My Funds"
default="1" domain="[('user_id','=',uid)]"
separator="1"
help="Funds Related to Current User"
/>
<separator orientation="vertical" />
<field name="state" select="1" />
<field name="name" select='1'
string="Fund Description" />
@ -306,6 +299,5 @@
</search>
</field>
</record>
</data>
</openerp>

View File

@ -11,6 +11,7 @@
<field name="res_model">crm.helpdesk</field>
<field name="view_mode">tree,calendar,form</field>
<field name="view_id" ref="crm_case_tree_view_helpdesk"/>
<field name="context">{"search_default_user_id":uid}</field>
<field name="search_view_id" ref="view_crm_case_helpdesk_filter"/>
</record>

View File

@ -236,11 +236,7 @@
<separator orientation="vertical"/>
<field name="name" select='1' string="Query"/>
<field name="partner_id" />
<field name="user_id" select="1" widget="selection">
<filter icon="terp-partner"
domain="[('user_id','=',uid)]"
help="My Helpdesk Requests" default="1" />
</field>
<field name="user_id" select="1" widget="selection"/>
<field name="section_id" select="1" widget="selection" string="Sales Team">
<filter icon="terp-crm"
domain="[('section_id','=',context.get('section_id',False))]"

View File

@ -26,7 +26,7 @@ from tools.translate import _
class delivery_carrier(osv.osv):
_name = "delivery.carrier"
_description = "Carrier and delivery grids"
_description = "Carrier"
def name_get(self, cr, uid, ids, context={}):
if not len(ids):
@ -144,7 +144,7 @@ delivery_grid()
class delivery_grid_line(osv.osv):
_name = "delivery.grid.line"
_description = "Delivery line of grid"
_description = "Delivery Grid Line"
_columns = {
'name': fields.char('Name', size=32, required=True),
'grid_id': fields.many2one('delivery.grid', 'Grid',required=True),

View File

@ -128,7 +128,7 @@
<field name="arch" type="xml">
<group name="logistic" position="inside">
<field name="id" invisible="True"/>
<field name="carrier_id" context="{'order_id':id}"/>
<field name="carrier_id" context="{'order_id':active_id}"/>
</group>
</field>
</record>

View File

@ -7,3 +7,5 @@
"access_delivery_grid_line_manager","delivery.grid.line","model_delivery_grid_line","sale.group_sale_manager",1,1,1,1
"access_delivery_carrier_partner_manager","delivery.carrier partner_manager","model_delivery_carrier","base.group_partner_manager",1,0,0,0
"access_delivery_carrier_stock_worker","delivery.carrier stock_worker","model_delivery_carrier","stock.group_stock_user",1,0,0,0
"access_delivery_sale_order_manager","delivery.sale.order","model_delivery_sale_order","sale.group_sale_manager",1,1,1,1
"access_delivery_sale_order","delivery.sale.order","model_delivery_sale_order","sale.group_sale_user",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
7 access_delivery_grid_line_manager delivery.grid.line model_delivery_grid_line sale.group_sale_manager 1 1 1 1
8 access_delivery_carrier_partner_manager delivery.carrier partner_manager model_delivery_carrier base.group_partner_manager 1 0 0 0
9 access_delivery_carrier_stock_worker delivery.carrier stock_worker model_delivery_carrier stock.group_stock_user 1 0 0 0
10 access_delivery_sale_order_manager delivery.sale.order model_delivery_sale_order sale.group_sale_manager 1 1 1 1
11 access_delivery_sale_order delivery.sale.order model_delivery_sale_order sale.group_sale_user 1 0 0 0

View File

@ -29,7 +29,7 @@ import decimal_precision as dp
# Overloaded stock_picking to manage carriers :
class stock_picking(osv.osv):
_name = "stock.picking"
_description = "Picking list"
_description = "Packing List"
_inherit = 'stock.picking'
def _cal_weight(self, cr, uid, ids, name, args, context=None):
@ -55,7 +55,7 @@ class stock_picking(osv.osv):
'weight': fields.function(_cal_weight, method=True, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'),
store={
'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20),
'stock.move': (_get_picking_line, ['product_id','product_uos_qty'], 20),
'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20),
}),
}

View File

@ -31,7 +31,7 @@ from tools.translate import _
class document_directory(osv.osv):
_name = 'document.directory'
_description = 'Document directory'
_description = 'Directory'
_order = 'name desc'
_columns = {
'name': fields.char('Name', size=64, required=True, select=1),
@ -286,7 +286,7 @@ class document_directory_dctx(osv.osv):
appended to all children down the tree.
"""
_name = 'document.directory.dctx'
_description = 'Directory dynamic context'
_description = 'Directory Dynamic Context'
_columns = {
'dir_id': fields.many2one('document.directory', 'Directory', required=True),
'field': fields.char('Field', size=20, required=True, select=1, help="The name of the field. Note that the prefix \"dctx_\" will be prepended to what is typed here."),

View File

@ -95,7 +95,7 @@ class document_storage(osv.osv):
the same tree of filesystem storage.
"""
_name = 'document.storage'
_description = 'Document storage media'
_description = 'Storage Media'
_columns = {
'name': fields.char('Name', size=64, required=True, select=1),
'write_date': fields.datetime('Date Modified', readonly=True),

View File

@ -42,7 +42,6 @@
<field name="arch" type="xml">
<search string="All users files">
<group col="12" colspan="4">
<filter icon="terp-stock" string="My" domain="[('user','=',uid)]" help="My Files"/>
<separator orientation="vertical"/>
<filter icon="terp-stock" string="This Year" domain="[('name','=',time.localtime()[0])]" help="All Months Files"/>
<filter icon="terp-stock" string="This Month" domain="[('month','=',time.localtime()[1])]" help="This Months Files"/>
@ -65,6 +64,7 @@
<field name="res_model">report.document.user</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
<field name="context">{"search_default_user":uid}</field>
<field name="search_view_id" ref="view_report_document_user_search"/>
</record>

View File

@ -30,7 +30,7 @@ import os
class document_configuration_wizard(osv.osv_memory):
_name='document.configuration.wizard'
_description = 'Auto Directory configuration'
_description = 'Auto Directory Configuration'
_inherit = 'res.config'
_rec_name = 'host'
_columns = {

View File

@ -123,7 +123,7 @@ class abstracted_fs:
def db_list(self):
#return pooler.pool_dic.keys()
s = netsvc.ExportService.getService('db')
result = s.exp_list()
result = s.exp_list(document=True)
self.db_name_list = []
for db_name in result:
db, cr = None, None

View File

@ -177,7 +177,6 @@ class document_directory_content(osv.osv):
fexprs[n.name] = n.expr
if 'uid' not in fields:
print "uid not in ", fields
# FIXME: should pass
return True
for child in parsedCal.getChildren():
@ -189,7 +188,6 @@ class document_directory_content(osv.osv):
if enl =='uid':
uuid = event.value
if not enl in fields:
# print "skip", enl
continue
if fields[enl] and funcs[enl] == 'field':
if ICS_TAGS[enl]=='normal':
@ -216,7 +214,6 @@ class document_directory_content(osv.osv):
# end for
if not uuid:
print "Skipping cal", child
# FIXME: should pass
continue

View File

@ -218,11 +218,13 @@ class event_registration(osv.osv):
args[1]['description']= event.mail_confirm
return super(event_registration, self).write(cr, uid, *args, **argv)
def mail_user_confirm(self,cr,uid,ids):
reg_ids=self.browse(cr,uid,ids)
def mail_user_confirm(self, cr, uid, ids):
reg_ids = self.browse(cr,uid,ids)
for reg_id in reg_ids:
src = reg_id.event_id.reply_to or False
dest = [reg_id.email_from]
dest = []
if reg_id.email_from:
dest += [reg_id.email_from]
if reg_id.email_cc:
dest += [reg_id.email_cc]
if dest and src:
@ -231,11 +233,13 @@ class event_registration(osv.osv):
raise osv.except_osv(_('Error!'), _('You must define a reply-to address in order to mail the participant. You can do this in the Mailing tab of your event. Note that this is also the place where you can configure your event to not send emails automaticly while registering'))
return False
def mail_user(self,cr,uid,ids):
reg_ids=self.browse(cr,uid,ids)
def mail_user(self, cr, uid, ids):
reg_ids = self.browse(cr, uid, ids)
for reg_id in reg_ids:
src = reg_id.event_id.reply_to or False
dest = [reg_id.email_from]
dest = []
if reg_id.email_from:
dest += [reg_id.email_from]
if reg_id.email_cc:
dest += [reg_id.email_cc]
if reg_id.event_id.mail_auto_confirm or reg_id.event_id.mail_auto_registr:

View File

@ -126,7 +126,6 @@
<field name="arch" type="xml">
<search string="Events">
<group col="10" colspan="4">
<filter icon="gtk-execute" string="My Events" domain="[('user_id','=',uid)]" help="My Events"/>
<separator orientation="vertical"/>
<filter icon="terp-calendar" string="Draft" domain="[('state','=','draft')]" help="Draft Events"/>
<filter icon="terp-calendar" string="Confirmed" domain="[('state','=','confirm')]" help="Confirmed Events"/>
@ -147,6 +146,7 @@
<field name="res_model">event.event</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{"search_default_user_id":uid}</field>
<field name="search_view_id" ref="view_event_search"/>
</record>
@ -271,7 +271,6 @@
<field name="arch" type="xml">
<search string="Event Registration">
<group col="12" colspan="4">
<filter icon="gtk-execute" string="My" domain="[('user_id','=',uid)]" help="My Registrations"/>
<separator orientation="vertical"/>
<filter icon="terp-calendar" string="Draft" domain="[('state','=','draft')]" help="Draft Registrations"/>
<filter icon="terp-calendar" string="Confirmed" domain="[('state','in',('open','done'))]" help="Confirmed Registrations"/>
@ -292,6 +291,7 @@
<field name="view_type">form</field>
<field name="domain"></field>
<field name="view_mode">tree,form</field>
<field name="context">{"search_default_user_id":uid}</field>
<field name="search_view_id" ref="view_registration_search"/>
</record>
<menuitem

View File

@ -5,3 +5,8 @@
"access_event_registration","event.registration","model_event_registration","crm.group_crm_user",1,1,1,1
"access_report_event_registration","report.event.registration","model_report_event_registration","crm.group_crm_user",1,0,0,0
"access_report_event_type_registration","report.event.type.registration","model_report_event_type_registration","crm.group_crm_user",1,0,0,0
"access_event_confirm_registration","event.confirm.registration","model_event_confirm_registration","crm.group_crm_user",1,0,0,0
"access_event_confirm_registration_manager","event.confirm.registration manager","model_event_confirm_registration","crm.group_crm_manager",1,1,1,1
"access_event_make_invoice","event.make.invoice","model_event_make_invoice","crm.group_crm_user",1,1,1,1
"access_event_partners_list","event.partners.list","model_event_partners_list","crm.group_crm_user",1,0,0,0
"access_event_registration_list","event.registration.list","model_event_registration_list","crm.group_crm_user",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
5 access_event_registration event.registration model_event_registration crm.group_crm_user 1 1 1 1
6 access_report_event_registration report.event.registration model_report_event_registration crm.group_crm_user 1 0 0 0
7 access_report_event_type_registration report.event.type.registration model_report_event_type_registration crm.group_crm_user 1 0 0 0
8 access_event_confirm_registration event.confirm.registration model_event_confirm_registration crm.group_crm_user 1 0 0 0
9 access_event_confirm_registration_manager event.confirm.registration manager model_event_confirm_registration crm.group_crm_manager 1 1 1 1
10 access_event_make_invoice event.make.invoice model_event_make_invoice crm.group_crm_user 1 1 1 1
11 access_event_partners_list event.partners.list model_event_partners_list crm.group_crm_user 1 0 0 0
12 access_event_registration_list event.registration.list model_event_registration_list crm.group_crm_user 1 0 0 0

View File

@ -68,8 +68,11 @@ class event_make_invoice(osv.osv_memory):
inv_reject = inv_reject + 1
inv_rej_reason += "ID "+str(reg.id)+": Registration doesn't have any partner to invoice. \n"
continue
partner_address_list = reg.partner_invoice_id and self.pool.get('res.partner').address_get(cr, uid, [reg.partner_invoice_id.id], adr_pref=['invoice'])
partner_address_id = partner_address_list['invoice']
else:
val_invoice = pool_obj.get('account.invoice').onchange_partner_id(cr, uid, [], 'out_invoice', reg.partner_invoice_id.id, False, False)
val_invoice['value'].update({'partner_id': reg.partner_invoice_id.id})
partner_address_id = val_invoice['value']['address_invoice_id']
if not partner_address_id:
inv_reject = inv_reject + 1
inv_rej_reason += "ID "+str(reg.id)+": Registered partner doesn't have an address to make the invoice. \n"
@ -82,8 +85,9 @@ class event_make_invoice(osv.osv_memory):
tax_ids.append(tax.id)
vals = value['value']
c_name = reg.contact_id and ('-' + self.pool.get('res.partner.contact').name_get(cr, uid, [reg.contact_id.id])[0][1]) or ''
vals.update({
'name': reg.name,
'name': reg.invoice_label + '-' + c_name,
'price_unit': reg.unit_price,
'quantity': reg.nb_register,
'product_id':reg.event_id.product_id.id,
@ -91,23 +95,14 @@ class event_make_invoice(osv.osv_memory):
})
inv_line_ids = obj_event_reg._create_invoice_lines(cr, uid, [reg.id], vals)
inv = {
'name': reg.invoice_label,
val_invoice['value'].update({
'origin': reg.invoice_label,
'type': 'out_invoice',
'reference': False,
'account_id': reg.partner_invoice_id.property_account_receivable.id,
'partner_id': reg.partner_invoice_id.id,
'address_invoice_id':partner_address_id,
'address_contact_id':partner_address_id,
'invoice_line': [(6,0,[inv_line_ids])],
'currency_id' :reg.partner_invoice_id.property_product_pricelist.currency_id.id,
'comment': "",
'payment_term':reg.partner_invoice_id.property_payment_term.id,
'fiscal_position': reg.partner_invoice_id.property_account_position.id
}
})
inv_id = inv_obj.create(cr, uid, inv)
inv_id = inv_obj.create(cr, uid, val_invoice['value'])
list_inv.append(inv_id)
obj_event_reg.write(cr, uid, reg.id, {'invoice_id': inv_id, 'state': 'done'})
obj_event_reg._history(cr, uid, [reg.id], 'Invoiced', history=True)

View File

@ -38,7 +38,8 @@
'init_xml': [],
'update_xml': [
"fetchmail_view.xml",
"fetchmail_data.xml"
"fetchmail_data.xml",
'security/ir.model.access.csv',
],
'demo_xml': [

View File

@ -0,0 +1,4 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_email_server","email.server","model_email_server",,1,1,1,1
"access_mail_server_history","mail.server.history","model_mail_server_history",,1,1,1,1
"access_email_server_tools","email.server.tools","model_email_server_tools",,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_email_server email.server model_email_server 1 1 1 1
3 access_mail_server_history mail.server.history model_mail_server_history 1 1 1 1
4 access_email_server_tools email.server.tools model_email_server_tools 1 1 1 1

View File

@ -101,7 +101,7 @@ ir_action_window()
class res_users(osv.osv):
_inherit = 'res.users'
_description = 'res.users'
_description = 'User'
def _parent_compute(self, cr, uid, ids, name, args, context={}):
result = {}

View File

@ -360,7 +360,7 @@
<separator orientation="vertical"/>
<field name="name"/>
<field name="department_id" widget="selection">
<field name="department_id" widget="selection">
<filter icon="terp-crm"
domain="[('department_id','=',context.get('department_id',False))]"
help="My Departments Jobs"/>

View File

@ -27,7 +27,7 @@ from tools.translate import _
class hr_action_reason(osv.osv):
_name = "hr.action.reason"
_description = "Action reason"
_description = "Action Reason"
_columns = {
'name' : fields.char('Reason', size=64, required=True, help='Specifies the reason for Signing In/Signing Out.'),
'action_type' : fields.selection([('sign_in', 'Sign in'), ('sign_out', 'Sign out')], "Action's type"),

View File

@ -153,7 +153,7 @@
</search>
</field>
</record>
<record id="hr_contract_view_form" model="ir.ui.view">
<field name="name">hr.contract.view.form</field>
<field name="model">hr.contract</field>

View File

@ -346,7 +346,6 @@
<group col='10' colspan='4'>
<filter icon="terp-crm" string="To Do" name="todo" domain="[('state','=','waiting_answer')]"/>
<separator orientation="vertical"/>
<filter string="My" icon="terp-partner" name="my" domain="[('user_id','=',uid)]"/>
<separator orientation="vertical"/>
<filter icon="terp-stock" string="Late" domain="[('date_deadline','&lt;',current_date)]"/>
<separator orientation="vertical"/>
@ -362,7 +361,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('is_evaluation' ,'=', True)]</field>
<field name="context">{"search_default_todo":1,"search_default_my":1}</field>
<field name="context">{"search_default_todo":1,"search_default_user_id":uid}</field>
<field name="search_view_id" ref="view_hr_evaluation_interview_search"/>
</record>

View File

@ -8,3 +8,5 @@
"access_hr_evaluation_interview","hr.evaluation.interview","model_hr_evaluation_interview","hr.group_hr_user",1,0,0,0
"access_hr_evaluation_interview_manager","hr.evaluation.interview","model_hr_evaluation_interview","hr.group_hr_manager",1,1,1,1
"access_hr_evaluation_report","hr.evaluation.report","model_hr_evaluation_report",,1,0,0,0
"access_hr_evaluation_reminder_manager","hr.evaluation.reminder","model_hr_evaluation_reminder","hr.group_hr_manager",1,1,1,1
"access_hr_evaluation_reminder","hr.evaluation.reminder","model_hr_evaluation_reminder","hr.group_hr_user",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
8 access_hr_evaluation_interview hr.evaluation.interview model_hr_evaluation_interview hr.group_hr_user 1 0 0 0
9 access_hr_evaluation_interview_manager hr.evaluation.interview model_hr_evaluation_interview hr.group_hr_manager 1 1 1 1
10 access_hr_evaluation_report hr.evaluation.report model_hr_evaluation_report 1 0 0 0
11 access_hr_evaluation_reminder_manager hr.evaluation.reminder model_hr_evaluation_reminder hr.group_hr_manager 1 1 1 1
12 access_hr_evaluation_reminder hr.evaluation.reminder model_hr_evaluation_reminder hr.group_hr_user 1 0 0 0

View File

@ -50,7 +50,7 @@ class hr_expense_expense(osv.osv):
return self.pool.get('res.currency').search(cr, uid, [('rate','=',1.0)])[0]
_name = "hr.expense.expense"
_description = "HR Expense"
_description = "Expense"
_columns = {
'name': fields.char('Expense Sheet', size=128, required=True),
'id': fields.integer('Sheet ID', readonly=True),

View File

@ -131,11 +131,6 @@
domain="[('state','=','draft')]"
string="Draft"
help="Draft Expense"/>
<filter
icon="terp-hr"
string="My Expenses"
default="1"
domain="[('user_id','=',uid)]"/>
<separator orientation="vertical"/>
<filter
icon="terp-hr"
@ -151,7 +146,7 @@
<field name="name" select='1'/>
<field name="date" select='1'/>
<field name="user_id" select="1" widget="selection" string="User">
<filter icon="terp-hr"
<filter icon="terp-hr"
domain="[('department_id','=',context.get('department_id',False))]"
string="Expenses of My Department"/>
</field>
@ -172,6 +167,7 @@
<field name="name">Expenses</field>
<field name="res_model">hr.expense.expense</field>
<field name="view_type">form</field>
<field name="context">{"search_default_user_id":uid}</field>
<field name="search_view_id" ref="view_hr_expense_filter"/>
</record>

View File

@ -78,10 +78,6 @@
help = "Accepted Expenses"/>
<separator orientation="vertical"/>
<field name="user_id" widget="selection">
<filter icon="terp-hr"
string="My Expenses"
help = "My Expenses"
domain="[('user_id','=',uid)]" />
<filter icon="terp-hr"
string="Expenses Non Assigned User"
help="Expenses Non Assigned User"
@ -140,7 +136,7 @@
<field name="res_model">hr.expense.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="context">{'search_default_month':1,'search_default_User':1,'search_default_user_id':uid,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="search_view_id" ref="view_hr_expense_report_search"/>
</record>

View File

@ -1,3 +1,4 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_expense_expense","hr.expense.expense","model_hr_expense_expense","hr.group_hr_user",1,1,1,1
"access_hr_expense_line","hr.expense.line","model_hr_expense_line","hr.group_hr_user",1,1,1,1
"access_hr_expense_report","hr.expense.report","model_hr_expense_report","hr.group_hr_user",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_expense_expense hr.expense.expense model_hr_expense_expense hr.group_hr_user 1 1 1 1
3 access_hr_expense_line hr.expense.line model_hr_expense_line hr.group_hr_user 1 1 1 1
4 access_hr_expense_report hr.expense.report model_hr_expense_report hr.group_hr_user 1 0 0 0

View File

@ -21,7 +21,7 @@
#
##############################################################################
import time
import datetime
import pooler
import netsvc
from osv import fields, osv
@ -29,7 +29,7 @@ from tools.translate import _
class hr_holidays_status(osv.osv):
_name = "hr.holidays.status"
_description = "Leave Types"
_description = "Leave Type"
def get_days_cat(self, cr, uid, ids, category_id, return_false, context={}):
res = {}
@ -106,7 +106,7 @@ hr_holidays_status()
class hr_holidays(osv.osv):
_name = "hr.holidays"
_description = "Holidays"
_description = "Leave"
_order = "type desc, date_from asc"
def _employee_get(obj, cr, uid, context=None):
@ -182,14 +182,14 @@ class hr_holidays(osv.osv):
}
return result
def _get_number_of_days(date_from, date_to):
def _get_number_of_days(self, date_from, date_to):
"""Returns a float equals to the timedelta between two dates given as string."""
DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S"
from_dt = datetime.datetime.strptime(date_from, DATETIME_FORMAT)
to_dt = datetime.datetime.strptime(date_to, DATETIME_FORMAT)
timedelta = to_dt - from_dt
diff_day = timedelta.days + float(timedelata.seconds) / 86400
diff_day = timedelta.days + float(timedelta.seconds) / 86400
return diff_day
def _update_user_holidays(self, cr, uid, ids):
@ -204,14 +204,16 @@ class hr_holidays(osv.osv):
self.unlink(cr, uid, list_ids)
def _check_date(self, cr, uid, ids):
if ids:
cr.execute('select number_of_days_temp from hr_holidays where id in ('+','.join(map(str, ids))+')')
res = cr.fetchall()
if res and res[0][0] and res[0][0] < 0:
for rec in self.read(cr, uid, ids, ['number_of_days_temp','date_from','date_to']):
if rec['number_of_days_temp'] < 0:
return False
date_from = time.strptime(rec['date_from'], '%Y-%m-%d %H:%M:%S')
date_to = time.strptime(rec['date_to'], '%Y-%m-%d %H:%M:%S')
if date_from > date_to:
return False
return True
_constraints = [(_check_date, 'Start date should not be larger than end date! ', ['number_of_days'])]
_constraints = [(_check_date, 'Start date should not be larger than end date!\nNumber of Days should be greater than 1!', ['number_of_days_temp'])]
def unlink(self, cr, uid, ids, context={}):
leave_obj = self.pool.get('resource.calendar.leaves')
@ -235,7 +237,7 @@ class hr_holidays(osv.osv):
return result
def onchange_date_to(self, cr, uid, ids, date_from, date_to):
return onchange_date_from(cr, uid, ids, date_to, date_from)
return self.onchange_date_from(cr, uid, ids, date_to, date_from)
def onchange_sec_id(self, cr, uid, ids, status, context={}):
warning = {}
@ -430,7 +432,7 @@ class resource_calendar_leaves(osv.osv):
_description = "Leave Detail"
_columns = {
'holiday_id': fields.many2one("hr.holidays", "Holiday"),
}
}
resource_calendar_leaves()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -60,6 +60,7 @@
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Leaves during last 7 days"/>
<separator orientation="vertical"/>
<<<<<<< TREE
<field name="employee_id"/>
<field name="user_id" widget="selection">
<filter icon="terp-hr"
@ -71,6 +72,10 @@
<group expand="0" string="Extended options..." colspan="10" col="12">
<field name="holiday_status_id" widget="selection"/>
<field name="department_id" widget="selection"/>
=======
<field name="employee_id"/>
<field name="user_id" widget="selection"/>
>>>>>>> MERGE-SOURCE
</group>
<newline/>
<group expand="1" string="Group By..." colspan="10" col="12">

View File

@ -55,7 +55,7 @@ hr_recruitment_stage()
class hr_applicant(osv.osv, crm.crm_case):
_name = "hr.applicant"
_description = "Applicant Cases"
_description = "Applicant"
_order = "id desc"
_inherit ='mailgate.thread'

View File

@ -9,6 +9,7 @@
<field name="res_model">hr.applicant</field>
<field name="view_mode">tree,form,graph</field>
<field name="view_id" ref="crm_case_tree_view_job"/>
<field name="context">{"search_default_user_id":uid}</field>
<field name="search_view_id" ref="view_crm_case_jobs_filter"/>
</record>

View File

@ -224,7 +224,6 @@
<field name="email_from"/>
<field name="job_id" widget="selection"/>
<field name="user_id" widget="selection">
<filter domain="[('user_id','=',uid)]" help="My Recruitements" icon="gtk-execute" default="1"/>
<filter domain="[('user_id','=',False)]" help="Unassigned Recruitements" icon="gtk-execute" separator="1"/>
</field>
<field name="department_id" widget="selection" string="Department" context="{'invisible_department': False}">

View File

@ -74,7 +74,7 @@
help = "Pending tasks"/>
<separator orientation="vertical"/>
<field name="department_id" widget="selection">
<filter icon="terp-hr"
<filter icon="terp-hr"
string="My Recruitments "
help="My Department Recruitments"
domain="[('user_id','=',uid)]"/>
@ -86,10 +86,6 @@
<separator orientation="vertical"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="user_id" widget="selection">
<filter icon="terp-hr"
string="My Recruitments"
help="My Recruitments"
domain="[('user_id','=',uid)]"/>
<filter icon="terp-hr"
string="Recruitments non assigned"
help="Recruitments non assigned"
@ -145,7 +141,11 @@
<field name="res_model">hr.recruitment.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<<<<<<< TREE
<field name="context">{'search_default_month':1,'search_default_degree':1,'search_default_job':1,'group_by_no_leaf':1,'group_by':[]}</field>
=======
<field name="context">{'search_default_month':1,'search_default_User':1,'search_default_user_id':uid,'group_by_no_leaf':1,'group_by':[]}</field>
>>>>>>> MERGE-SOURCE
<field name="search_view_id" ref="view_hr_recruitment_report_search"/>
</record>
<menuitem id="hr.menu_hr_reporting" name="Reporting" parent="hr.menu_hr_root" sequence="10"/>

View File

@ -1,2 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_applicant","hr.applicant","model_hr_applicant","hr.group_hr_manager",1,1,1,1
"access_hr_recruitment_report","hr.recruitment.report","model_hr_recruitment_report",,1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_applicant hr.applicant model_hr_applicant hr.group_hr_manager 1 1 1 1
3 access_hr_recruitment_report hr.recruitment.report model_hr_recruitment_report 1 0 0 0

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