Merge with addons

bzr revid: vir@tinyerp.com-20100125082136-lufsutb7n1b4jz55
This commit is contained in:
Vir (Open ERP)
2010-01-25 13:51:36 +05:30
233 changed files with 30205 additions and 16556 deletions
-17
View File
@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>sbh_addons</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.python.pydev.PyDevBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.python.pydev.pythonNature</nature>
</natures>
</projectDescription>
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse-pydev version="1.0"?>
<pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.4</pydev_property>
</pydev_project>
+40 -9
View File
@@ -416,15 +416,27 @@ class account_account(osv.osv):
default['child_parent_ids'] = False
return super(account_account, self).copy(cr, uid, id, default, context=context)
def _check_moves(self, cr, uid, ids, method, context):
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!. '))
return True
def write(self, cr, uid, ids, vals, context=None):
if not context:
context = {}
if 'active' in vals and not vals['active']:
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)]):
raise osv.except_osv(_('Error !'), _('You can not deactivate an account that contains Ledger Postings.'))
self._check_moves(cr, uid, ids, "write", context)
return super(account_account, self).write(cr, uid, ids, vals, context=context)
def unlink(self, cr, uid, ids, context={}):
self._check_moves(cr, uid, ids, "unlink", context)
return super(account_account, self).unlink(cr, uid, ids, context)
account_account()
class account_journal_view(osv.osv):
@@ -767,6 +779,23 @@ class account_move(osv.osv):
for id in ids:
result.setdefault(id, 0.0)
return result
def _search_amount(self, cr, uid, obj, name, args, context):
ids = []
cr.execute('select move_id,sum(debit) from account_move_line group by move_id')
result = dict(cr.fetchall())
for item in args:
if item[1] == '>=':
res = [('id', 'in', [k for k,v in result.iteritems() if v >= item[2]])]
else:
res = [('id', 'in', [k for k,v in result.iteritems() if v <= item[2]])]
ids += res
if not ids:
return [('id', '>', '0')]
return ids
_columns = {
'name': fields.char('Number', size=64, required=True),
@@ -778,7 +807,7 @@ class account_move(osv.osv):
'line_id': fields.one2many('account.move.line', 'move_id', 'Entries', states={'posted':[('readonly',True)]}),
'to_check': fields.boolean('To Be Verified'),
'partner_id': fields.related('line_id', 'partner_id', type="many2one", relation="res.partner", string="Partner"),
'amount': fields.function(_amount_compute, method=True, string='Amount', digits=(16,int(config['price_accuracy']))),
'amount': fields.function(_amount_compute, method=True, string='Amount', digits=(16,int(config['price_accuracy'])), type='float', fnct_search=_search_amount),
'date': fields.date('Date', required=True),
'type': fields.selection([
('pay_voucher','Cash Payment'),
@@ -956,7 +985,7 @@ class account_move(osv.osv):
else:
context.update({'journal_id': move.journal_id.id, 'period_id': move.period_id.id})
line_id = self.pool.get('account.move.line').create(cr, uid, {
'name': _t(cr, None, 'selection', context.get('lang'), source=(mode.capitalize()+' Centralisation')) or (mode.capitalize()+' Centralisation'),
'name': _(mode.capitalize()+' Centralisation'),
'centralisation': mode,
'account_id': account_id,
'move_id': move.id,
@@ -1084,8 +1113,8 @@ class account_move_reconcile(osv.osv):
'name': lambda self,cr,uid,ctx={}: self.pool.get('ir.sequence').get(cr, uid, 'account.reconcile') or '/',
}
def reconcile_partial_check(self, cr, uid, ids, type='auto', context={}):
total = 0.0
for rec in self.browse(cr, uid, ids, context):
total = 0.0
for line in rec.line_partial_ids:
total += (line.debit or 0.0) - (line.credit or 0.0)
if not total:
@@ -1546,7 +1575,8 @@ class account_model(osv.osv):
def generate(self, cr, uid, ids, datas={}, context={}):
move_ids = []
for model in self.browse(cr, uid, ids, context):
period_id = self.pool.get('account.period').find(cr,uid, context=context)
context.update({'date':datas['date']})
period_id = self.pool.get('account.period').find(cr, uid, dt=context.get('date',False))
if not period_id:
raise osv.except_osv(_('No period found !'), _('Unable to find a valid period !'))
period_id = period_id[0]
@@ -1554,6 +1584,7 @@ class account_model(osv.osv):
'ref': model.ref,
'period_id': period_id,
'journal_id': model.journal_id.id,
'date': context.get('date',time.strftime('%Y-%m-%d'))
})
move_ids.append(move_id)
for line in model.lines_id:
@@ -1571,7 +1602,7 @@ class account_model(osv.osv):
'move_id': move_id,
'ref': line.ref,
'partner_id': line.partner_id.id,
'date': time.strftime('%Y-%m-%d'),
'date': context.get('date',time.strftime('%Y-%m-%d')),
'date_maturity': time.strftime('%Y-%m-%d')
})
c = context.copy()
+3 -4
View File
@@ -143,8 +143,7 @@ class account_bank_statement(osv.osv):
'period_id': _get_period,
}
def button_confirm(self, cr, uid, ids, context=None):
context = context or {}
def button_confirm(self, cr, uid, ids, context={}):
done = []
res_currency_obj = self.pool.get('res.currency')
res_users_obj = self.pool.get('res.users')
@@ -166,7 +165,7 @@ class account_bank_statement(osv.osv):
_('The expected balance (%.2f) is different than the computed one. (%.2f)') % (st.balance_end_real, st.balance_end))
if (not st.journal_id.default_credit_account_id) \
or (not st.journal_id.default_debit_account_id):
raise osv.except_osv(_('Configration Error !'),
raise osv.except_osv(_('Configuration Error !'),
_('Please verify that an account is defined in the journal.'))
for line in st.move_line_ids:
@@ -178,10 +177,10 @@ class account_bank_statement(osv.osv):
# in bank stat.rec we get line_new_ids on bank.stat.rec.line
for move in st.line_ids:
context.update({'date':move.date})
move_id = account_move_obj.create(cr, uid, {
'journal_id': st.journal_id.id,
'period_id': st.period_id.id,
'date': move.date,
}, context=context)
account_bank_statement_line_obj.write(cr, uid, [move.id], {
'move_ids': [(4,move_id, False)]
+1 -1
View File
@@ -294,7 +294,7 @@ class account_move_line(osv.osv):
return [('id', '=', '0')]
return [('id', 'in', [x[0] for x in res])]
def _invoice_search(self, cursor, user, obj, name, args):
def _invoice_search(self, cursor, user, obj, name, args, context):
if not len(args):
return []
invoice_obj = self.pool.get('account.invoice')
+2
View File
@@ -1582,6 +1582,8 @@
<field name="property_account_payable"/>
<field name="property_account_expense_categ" />
<field name="property_account_income_categ"/>
<field name="property_account_expense"/>
<field name="property_account_income"/>
</form>
</field>
</record>
+302 -298
View File
File diff suppressed because it is too large Load Diff
+16 -7
View File
@@ -153,7 +153,9 @@ class account_invoice(osv.osv):
if not move_lines:
res[id] = []
continue
res[id] = []
data_lines = self.pool.get('account.move.line').browse(cr,uid,move_lines)
partial_ids = []# Keeps the track of ids where partial payments are done with payment terms
for line in data_lines:
ids_line = []
if line.reconcile_id:
@@ -161,7 +163,8 @@ class account_invoice(osv.osv):
elif line.reconcile_partial_id:
ids_line = line.reconcile_partial_id.line_partial_ids
l = map(lambda x: x.id, ids_line)
res[id]=[x for x in l if x <> line.id]
partial_ids.append(line.id)
res[id] =[x for x in l if x <> line.id and x not in partial_ids]
return res
def _get_invoice_line(self, cr, uid, ids, context=None):
@@ -183,11 +186,14 @@ class account_invoice(osv.osv):
src = []
lines = []
for m in self.pool.get('account.move.line').browse(cr, uid, moves, context):
temp_lines = []#Added temp list to avoid duplicate records
if m.reconcile_id:
lines += map(lambda x: x.id, m.reconcile_id.line_id)
temp_lines = map(lambda x: x.id, m.reconcile_id.line_id)
elif m.reconcile_partial_id:
lines += map(lambda x: x.id, m.reconcile_partial_id.line_partial_ids)
temp_lines = map(lambda x: x.id, m.reconcile_partial_id.line_partial_ids)
lines += [x for x in temp_lines if x not in lines]
src.append(m.id)
lines = filter(lambda x: x not in src, lines)
result[invoice.id] = lines
return result
@@ -991,14 +997,17 @@ class account_invoice(osv.osv):
else:
amount_currency = False
currency_id = False
if invoice.type in ('in_invoice', 'in_refund'):
ref = invoice.reference
else:
ref = self._convert_ref(cr, uid, invoice.number)
# Pay attention to the sign for both debit/credit AND amount_currency
l1 = {
'debit': direction * pay_amount>0 and direction * pay_amount,
'credit': direction * pay_amount<0 and - direction * pay_amount,
'account_id': src_account_id,
'partner_id': invoice.partner_id.id,
'ref':invoice.number,
'ref':ref,
'date': date,
'currency_id':currency_id,
'amount_currency':amount_currency and direction * amount_currency or 0.0,
@@ -1009,7 +1018,7 @@ class account_invoice(osv.osv):
'credit': direction * pay_amount>0 and direction * pay_amount,
'account_id': pay_account_id,
'partner_id': invoice.partner_id.id,
'ref':invoice.number,
'ref':ref,
'date': date,
'currency_id':currency_id,
'amount_currency':amount_currency and - direction * amount_currency or 0.0,
@@ -1022,7 +1031,7 @@ class account_invoice(osv.osv):
l2['name'] = name
lines = [(0, 0, l1), (0, 0, l2)]
move = {'ref': invoice.number, 'line_id': lines, 'journal_id': pay_journal_id, 'period_id': period_id, 'date': date}
move = {'ref': ref, 'line_id': lines, 'journal_id': pay_journal_id, 'period_id': period_id, 'date': date}
move_id = self.pool.get('account.move').create(cr, uid, move, context=context)
line_ids = []
+2 -2
View File
@@ -117,7 +117,7 @@ class res_partner(osv.osv):
res[pid][maps[type]] = (type=='receivable') and val or -val
return res
def _credit_search(self, cr, uid, obj, name, args):
def _credit_search(self, cr, uid, obj, name, args, context):
if not len(args):
return []
where = ' and '.join(map(lambda x: '(sum(debit-credit)'+x[1]+str(x[2])+')',args))
@@ -128,7 +128,7 @@ class res_partner(osv.osv):
return [('id','=','0')]
return [('id','in',map(lambda x:x[0], res))]
def _debit_search(self, cr, uid, obj, name, args):
def _debit_search(self, cr, uid, obj, name, args, context):
if not len(args):
return []
query = self.pool.get('account.move.line')._query_get(cr, uid, context={})
@@ -79,10 +79,12 @@ def _data_save(self, cr, uid, data, context):
if move_ids:
raise wizard.except_wizard(_('UserError'),
_('The opening journal must not have any entry in the new fiscal year !'))
query = "SELECT id FROM account_fiscalyear WHERE date_stop < '" + str(new_fyear.date_start) + "'"
cr.execute(query)
result = cr.dictfetchall()
fy_ids = ','.join([str(x['id']) for x in result])
query_line = pool.get('account.move.line')._query_get(cr, uid,
obj='account_move_line', context={'fiscalyear': fy_id})
obj='account_move_line', context={'fiscalyear': fy_ids})
cr.execute('select id from account_account WHERE active')
ids = map(lambda x: x[0], cr.fetchall())
for account in pool.get('account.account').browse(cr, uid, ids,
@@ -58,15 +58,35 @@ def _search_invoices(obj, cr, uid, data, context):
journal_obj = pool.get('account.journal')
statement = statement_obj.browse(cr, uid, data['id'], context=context)
args_move_line = []
repeated_move_line_ids = []
# Creating a group that is unique for importing move lines(move lines, once imported into statement lines, should not appear again)
for st_line in statement.line_ids:
args_move_line = []
args_move_line.append(('name','=', st_line.name))
args_move_line.append(('ref','=',st_line.ref))
if st_line.partner_id:
args_move_line.append(('partner_id','=',st_line.partner_id.id))
args_move_line.append(('account_id','=',st_line.account_id.id))
move_line_id = line_obj.search(cr, uid, args_move_line,context=context)
if move_line_id:
repeated_move_line_ids.append(move_line_id)
journal_ids = data['form']['journal_id'][0][2]
if journal_ids == []:
journal_ids = journal_obj.search(cr, uid, [('type', 'in', ('sale','cash','purchase'))], context=context)
line_ids = line_obj.search(cr, uid, [
args = [
('reconcile_id', '=', False),
('journal_id', 'in', journal_ids),
('account_id.reconcile', '=', True)],
('account_id.reconcile', '=', True)]
if repeated_move_line_ids:
args.append(('id','not in',repeated_move_line_ids))
line_ids = line_obj.search(cr, uid, args,
#order='date DESC, id DESC', #doesn't work
context=context)
@@ -29,7 +29,7 @@ import pooler
_subscription_form = '''<?xml version="1.0"?>
<form string="%s">
<seperator string="Generate entries before:" colspan="4"/>
<separator string="Generate entries before:" colspan="4"/>
<field name="date"/>
</form>''' % ('Subscription Compute',)
@@ -38,7 +38,7 @@ _subscription_fields = {
}
class wiz_subscription(wizard.interface):
def _action_generate(self, cr, uid, data, context):
def _action_generate(self, cr, uid, data, context={}):
cr.execute('select id from account_subscription_line where date<%s and move_id is null', (data['form']['date'],))
ids = map(lambda x: x[0], cr.fetchall())
pooler.get_pool(cr.dbname).get('account.subscription.line').move_create(cr, uid, ids)
+1 -1
View File
@@ -34,7 +34,7 @@ Allows to automatically select analytic accounts based on criterions:
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['account'],
'depends': ['account', 'sale'],
'init_xml': [],
'update_xml': ['security/ir.model.access.csv', 'account_analytic_default_view.xml'],
'demo_xml': [],
@@ -70,12 +70,51 @@ account_analytic_default()
class account_invoice_line(osv.osv):
_inherit = 'account.invoice.line'
_description = 'account 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, context=None):
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, 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, context)
rec = self.pool.get('account.analytic.default').account_get(cr, uid, product, partner_id, uid, time.strftime('%Y-%m-%d'), context)
if rec:
res_prod['value'].update({'account_analytic_id':rec.analytic_id.id})
else:
res_prod['value'].update({'account_analytic_id':False})
return res_prod
account_invoice_line()
class stock_picking(osv.osv):
_inherit = "stock.picking"
def _get_account_analytic_invoice(self, cursor, user, picking, move_line):
partner_id = picking.address_id and picking.address_id.partner_id or False
rec = self.pool.get('account.analytic.default').account_get(cursor, user, move_line.product_id.id, partner_id and partner_id.id, user, time.strftime('%Y-%m-%d'), context={})
if rec:
return rec.analytic_id.id
return super(stock_picking, self)._get_account_analytic_invoice(cursor,
user, picking, move_line)
stock_picking()
class sale_order_line(osv.osv):
_inherit = 'sale.order.line'
# 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)
sale_line_obj = self.browse(cr, uid, ids[0], context)
pool_inv_line = self.pool.get('account.invoice.line')
for line in pool_inv_line.browse(cr, uid, create_ids, context):
rec = self.pool.get('account.analytic.default').account_get(cr, uid, line.product_id.id, sale_line_obj.order_id.partner_id.id, uid, time.strftime('%Y-%m-%d'), context)
if rec:
pool_inv_line.write(cr, uid, [line.id], {'account_analytic_id':rec.analytic_id.id}, context=context)
return create_ids
sale_order_line()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -374,4 +374,25 @@ class analytic_default(osv.osv):
}
analytic_default()
class sale_order_line(osv.osv):
_inherit = 'sale.order.line'
# 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 ids:
sale_line_obj = self.browse(cr, uid, ids[0], context)
pool_inv_line = self.pool.get('account.invoice.line')
for line in pool_inv_line.browse(cr, uid, create_ids, context):
rec = self.pool.get('account.analytic.default').account_get(cr, uid, line.product_id.id, sale_line_obj.order_id.partner_id.id, uid, time.strftime('%Y-%m-%d'), context)
if rec:
pool_inv_line.write(cr, uid, [line.id], {'analytics_id':rec.analytics_id.id}, context=context)
cr.commit()
return create_ids
sale_order_line()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+28 -10
View File
@@ -9,13 +9,13 @@ msgstr ""
"Project-Id-Version: account-balance-es\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 13:38+0000\n"
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
"PO-Revision-Date: 2010-01-22 19:50+0000\n"
"Last-Translator: Miguel Anxo Bouzada <mbouzada@gmail.com>\n"
"Language-Team: Galego <g11n@mancomun.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-12-16 05:14+0000\n"
"X-Launchpad-Export-Date: 2010-01-23 04:45+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_balance
@@ -60,7 +60,7 @@ msgstr "Nome da conta"
#: rml:account.account.balance.landscape:0
#: rml:account.balance.account.balance:0
msgid "Debit"
msgstr ""
msgstr "Débito"
#. module: account_balance
#: wizard_button:account.balance.account.balance.report,init,checkyear:0
@@ -118,6 +118,24 @@ msgid ""
" 5. You have an option to print the desired report in Landscape format.\n"
" "
msgstr ""
"O módulo de balance de contas é unha funcionalidade engadida ao módulo de "
"xestión financieira.\n"
"\n"
" Este módulo ofrece diversas opcións de impresión de balances.\n"
"\n"
" 1. Podese comparar o balance de distintos anos.\n"
"\n"
" 2. Pode establecer a comparación en importe ou porcentual entre dous "
"anos.\n"
"\n"
" 3. Pode establecer a conta de referencia para a comparación porcentual "
"para anos en particular.\n"
"\n"
" 4. Pode seleccionar períodos como unha data real ou períodos como data "
"de creación.\n"
"\n"
" 5. Pode imprimir o informe que desexe en formato apaisado.\n"
" "
#. module: account_balance
#: wizard_view:account.balance.account.balance.report,backtoinit:0
@@ -143,13 +161,13 @@ msgstr "Con balance se non é igual a 0"
#: rml:account.account.balance.landscape:0
#: rml:account.balance.account.balance:0
msgid "Total :"
msgstr ""
msgstr "Total :"
#. module: account_balance
#: rml:account.account.balance.landscape:0
#: rml:account.balance.account.balance:0
msgid "Account Balance -"
msgstr ""
msgstr "Balance de conta -"
#. module: account_balance
#: wizard_field:account.balance.account.balance.report,init,format_perc:0
@@ -196,7 +214,7 @@ msgstr "Mostrar contas"
#: rml:account.account.balance.landscape:0
#: rml:account.balance.account.balance:0
msgid "Credit"
msgstr ""
msgstr "Crédito"
#. module: account_balance
#: wizard_view:account.balance.account.balance.report,backtoinit:0
@@ -206,13 +224,13 @@ msgstr "1. Debe seleccionar máis de 3 exercicios en calquera caso."
#. module: account_balance
#: model:ir.module.module,shortdesc:account_balance.module_meta_information
msgid "Accounting and financial management-Compare Accounts"
msgstr ""
msgstr "Xestión contable e financieira - Comparación de contas"
#. module: account_balance
#: rml:account.account.balance.landscape:0
#: rml:account.balance.account.balance:0
msgid "Year :"
msgstr ""
msgstr "Ano :"
#. module: account_balance
#: wizard_view:account.balance.account.balance.report,backtoinit:0
@@ -224,7 +242,7 @@ msgstr ""
#: rml:account.account.balance.landscape:0
#: rml:account.balance.account.balance:0
msgid "Balance"
msgstr ""
msgstr "Balance"
#. module: account_balance
#: wizard_view:account.balance.account.balance.report,backtoinit:0
+4 -4
View File
@@ -7,19 +7,19 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2009-02-03 06:24+0000\n"
"Last-Translator: <>\n"
"PO-Revision-Date: 2010-01-20 14:02+0000\n"
"Last-Translator: Paulius Sladkevičius <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: 2009-12-16 05:17+0000\n"
"X-Launchpad-Export-Date: 2010-01-22 04:34+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_date_check
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
msgstr "Netinkamas XML peržiūros struktūrai!"
#. module: account_date_check
#: field:account.journal,allow_date:0
@@ -125,12 +125,13 @@ class followup_all_print(wizard.interface):
def _update_partners(self, cr, uid, data, context):
to_update = data['form']['to_update']
for id in to_update.keys():
cr.execute(
"UPDATE account_move_line "\
"SET followup_line_id=%s, followup_date=%s "\
"WHERE id=%s",
(to_update[id],
data['form']['date'], int(id),))
if to_update[id]['partner_id'] in data['form']['partner_ids'][0][2]:
cr.execute(
"UPDATE account_move_line "\
"SET followup_line_id=%s, followup_date=%s "\
"WHERE id=%s",
(to_update[id]['level'],
data['form']['date'], int(id),))
return {}
def _sendmail(self ,cr, uid, data, context):
@@ -263,12 +264,12 @@ class followup_all_print(wizard.interface):
if date_maturity <= fups[followup_line_id][0].strftime('%Y-%m-%d'):
if partner_id not in partner_list:
partner_list.append(partner_id)
to_update[str(id)] = fups[followup_line_id][1]
to_update[str(id)]= {'level': fups[followup_line_id][1], 'partner_id': partner_id}
elif date and date <= fups[followup_line_id][0].strftime('%Y-%m-%d'):
if partner_id not in partner_list:
partner_list.append(partner_id)
to_update[str(id)] = fups[followup_line_id][1]
to_update[str(id)]= {'level': fups[followup_line_id][1], 'partner_id': partner_id}
message = pool.get('res.users').browse(cr, uid, uid, context=context).company_id.follow_up_msg
return {'partner_ids': partner_list, 'to_update': to_update, 'email_body':message}
+1 -1
View File
@@ -46,7 +46,7 @@ class account_move_line(osv.osv):
r=dict(cr.fetchall())
return r
def _to_pay_search(self, cr, uid, obj, name, args):
def _to_pay_search(self, cr, uid, obj, name, args, context):
if not len(args):
return []
line_obj = self.pool.get('account.move.line')
@@ -23,6 +23,7 @@ import time
import netsvc
from osv import fields, osv
import ir
from tools import config
class account_invoice(osv.osv):
_inherit = "account.invoice"
@@ -45,7 +46,9 @@ class account_invoice_line(osv.osv):
"""
res = {}
tax_obj = self.pool.get('account.tax')
cur_obj = self.pool.get('res.currency')
for line in self.browse(cr, uid, ids):
cur = line.invoice_id and line.invoice_id.currency_id or False
res_init = super(account_invoice_line, self)._amount_line(cr, uid, [line.id], name, args, context)
res[line.id] = {
'price_subtotal': 0.0,
@@ -63,13 +66,13 @@ class account_invoice_line(osv.osv):
product_taxes = filter(lambda x: x.price_include, line.product_id.supplier_taxes_id)
if ((set(product_taxes) == set(line.invoice_line_tax_id)) or not product_taxes) and (line.invoice_id.price_type == 'tax_included'):
res[line.id]['price_subtotal_incl'] = res_init[line.id]
res[line.id]['price_subtotal_incl'] = cur and cur_obj.round(cr, uid, cur, res_init[line.id]) or res_init[line.id]
else:
res[line.id]['price_subtotal'] = res_init[line.id]
res[line.id]['price_subtotal'] = cur and cur_obj.round(cr, uid, cur, res_init[line.id]) or res_init[line.id]
for tax in tax_obj.compute_inv(cr, uid, product_taxes, res_init[line.id]/line.quantity, line.quantity):
res[line.id]['price_subtotal'] = res[line.id]['price_subtotal'] - round(tax['amount'], 2)
res[line.id]['price_subtotal'] = res[line.id]['price_subtotal'] - round(tax['amount'], int(config['price_accuracy']))
else:
res[line.id]['price_subtotal'] = res_init[line.id]
res[line.id]['price_subtotal'] = cur and cur_obj.round(cr, uid, cur, res_init[line.id]) or res_init[line.id]
if res[line.id]['price_subtotal']:
res[line.id]['price_subtotal_incl'] = res[line.id]['price_subtotal']
@@ -82,8 +85,8 @@ class account_invoice_line(osv.osv):
res[line.id]['price_subtotal'] = res[line.id]['price_subtotal'] - tax['amount']
res[line.id]['data'].append( tax)
res[line.id]['price_subtotal']= round(res[line.id]['price_subtotal'], 2)
res[line.id]['price_subtotal_incl']= round(res[line.id]['price_subtotal_incl'], 2)
res[line.id]['price_subtotal']= round(res[line.id]['price_subtotal'], int(config['price_accuracy']))
res[line.id]['price_subtotal_incl']= round(res[line.id]['price_subtotal_incl'], int(config['price_accuracy']))
return res
def _price_unit_default(self, cr, uid, context=None):
+6 -6
View File
@@ -28,7 +28,7 @@ import mx.DateTime
from mx.DateTime import RelativeDateTime
from tools import config
class Account(osv.osv):
class account_account(osv.osv):
_inherit = "account.account"
def _get_level(self, cr, uid, ids, field_name, arg, context={}):
@@ -108,7 +108,7 @@ class Account(osv.osv):
vals['type1'] = 'none'
journal_ids=self.pool.get('account.journal').search(cr,uid,[('name','=','Opening Journal')])
vals['journal_id'] = journal_ids and journal_ids[0] or False
account_id = super(Account, self).create(cr, uid, vals, context)
account_id = super(account_account, self).create(cr, uid, vals, context)
if vals.get('type1', False) != False:
journal_id = vals.get('journal_id',False)
if journal_id and vals.has_key('open_bal'):
@@ -157,7 +157,7 @@ class Account(osv.osv):
vals['type1'] = 'cr'
else:
vals['type1'] = 'none'
super(Account, self).write(cr, uid,ids, vals, context)
super(account_account, self).write(cr, uid,ids, vals, context)
if vals.has_key('open_bal'):
self_obj= self.browse(cr,uid,ids)
move_pool=self.pool.get('account.move')
@@ -213,16 +213,16 @@ class Account(osv.osv):
return {
'value' : {'type1' : type1}
}
Account()
account_account()
class AccountMove(osv.osv):
class account_move(osv.osv):
_inherit = "account.move"
_columns = {
'name':fields.char('Name', size=256, required=True, readonly=True, states={'draft':[('readonly',False)]}),
'narration':fields.text('Narration', readonly=True, select=True, states={'draft':[('readonly',False)]}),
}
AccountMove()
account_move()
class res_currency(osv.osv):
_inherit = "res.currency"
+144 -85
View File
@@ -30,7 +30,7 @@
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table2">
<blockTableStyle id="Table4">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
@@ -63,26 +63,29 @@
<paraStyle name="P8" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P9" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P10" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P11" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P12" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P13" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P11" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P12" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P13" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P14" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P15" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P16" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P17" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P18" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P19" fontName="Helvetica" fontSize="5.0" leading="7" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P20" fontName="Helvetica" fontSize="5.0" leading="7" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P21" fontName="Helvetica" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P22" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P23" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P24" fontName="Helvetica-Bold" fontSize="13.0" leading="16" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P25" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P26" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P27" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P28" rightIndent="0.0" leftIndent="15.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P30" rightIndent="0.0" leftIndent="20.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P31" rightIndent="0.0" leftIndent="25.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P15" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P16" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P17" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P18" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P19" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P20" fontName="Helvetica" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P21" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P22" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P23" fontName="Helvetica-Bold" fontSize="13.0" leading="16" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P24" rightIndent="0.0" leftIndent="35.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P25" rightIndent="0.0" leftIndent="35.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P26" rightIndent="0.0" leftIndent="35.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P27" rightIndent="0.0" leftIndent="71.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P28" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P29" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P30" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P31" fontName="Helvetica" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P32" rightIndent="0.0" leftIndent="35.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P33" rightIndent="0.0" leftIndent="71.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="Standard" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Text body" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
@@ -91,27 +94,76 @@
<paraStyle name="Index" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT"/>
<paraStyle name="Table Contents" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Heading" fontName="Times-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Footer" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT"/>
<paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" alignment="LEFT" spaceBefore="0.0" spaceAfter="14.0"/>
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_1" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_8_Italic" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Drawing" fontName="Times-Italic" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Header" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT"/>
<paraStyle name="Endnote" rightIndent="0.0" leftIndent="14.0" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="LEFT"/>
<paraStyle name="Addressee" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="3.0"/>
<paraStyle name="Signature" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT"/>
<paraStyle name="Heading 8" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 7" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 6" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 5" fontName="Helvetica-Bold" fontSize="85%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 4" fontName="Helvetica-BoldOblique" fontSize="85%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 1" fontName="Helvetica-Bold" fontSize="115%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 10" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 2" fontName="Helvetica-BoldOblique" fontSize="14.0" leading="17" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="First line indent" rightIndent="0.0" leftIndent="0.0" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Hanging indent" rightIndent="0.0" leftIndent="28.0" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Salutation" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT"/>
<paraStyle name="Text body indent" rightIndent="0.0" leftIndent="0.0" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Heading 3" fontName="Helvetica-Bold" fontSize="14.0" leading="17" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="List Indent" rightIndent="0.0" leftIndent="142.0" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Marginalia" rightIndent="0.0" leftIndent="113.0" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
</stylesheet>
<images/>
<story>
<para style="P26">[[ repeatIn(objects,'voucher') ]]</para>
<para style="P29">[[ repeatIn(objects,'voucher') ]]</para>
<para style="P4">[[ company.name ]]</para>
<para style="P6">[[ company.partner_id.address and company.partner_id.address[0].street ]], [[ company.partner_id.address and company.partner_id.address[0].street2 ]]</para>
<para style="P6">[[ company.partner_id.address and company.partner_id.address[0].street ]]</para>
<para style="P6">[[ company.partner_id.address and company.partner_id.address[0].zip ]] [[ company.partner_id.address and company.partner_id.address[0].city ]] - [[ company.partner_id.address and company.partner_id.address[0].country_id and company.partner_id.address[0].country_id.name ]]</para>
<para style="P6">[[ company.partner_id.address and company.partner_id.address[0].phone ]]</para>
<para style="P6">[[ company.partner_id.address and company.partner_id.address[0].email ]]</para>
<para style="P24">Cash Receipt Voucher [[ (voucher.type == 'rec_voucher' or removeParentNode('para')) and '' ]]</para>
<para style="P5">
<font color="white"> </font>
</para>
<para style="P23">Cash Receipt Voucher [[ (voucher.type == 'rec_voucher' or removeParentNode('para')) and '' ]]</para>
<para style="P2">Cash Payment Voucher [[ (voucher.type == 'pay_voucher' or removeParentNode('para')) and '' ]]</para>
<para style="P24">Bank Receipt Voucher [[ (voucher.type == 'bank_rec_voucher' or removeParentNode('para')) and '' ]]</para>
<para style="P23">Bank Receipt Voucher [[ (voucher.type == 'bank_rec_voucher' or removeParentNode('para')) and '' ]]</para>
<para style="P2">Bank Payment Voucher [[ (voucher.type == 'bank_pay_voucher' or removeParentNode('para')) and '' ]]</para>
<para style="P22">
<font color="white"> </font>
</para>
<blockTable colWidths="49.0,143.0,116.0,69.0,106.0" style="Table1">
<tr>
<td>
<para style="P10">No.</para>
</td>
<td>
<para style="P27">[[ voucher.number ]]</para>
<para style="P11">[[ voucher.number ]]</para>
</td>
<td>
<para style="P3">
@@ -122,7 +174,7 @@
<para style="P10">Dated :</para>
</td>
<td>
<para style="P27">[[ time.strftime('%d %B,%Y', time.strptime(voucher.date , '%Y-%m-%d')) or '' ]]</para>
<para style="P11">[[ time.strftime('%d %B,%Y', time.strptime(voucher.date , '%Y-%m-%d')) or '' ]]</para>
</td>
</tr>
<tr>
@@ -130,10 +182,10 @@
<para style="P10">State :</para>
</td>
<td>
<para style="P25">PRO-FORMA [[ ((voucher.state == 'proforma') or removeParentNode('para')) and '' ]]</para>
<para style="P25">Draft[[ ((voucher.state == 'draft') or removeParentNode('para')) and '' ]]</para>
<para style="P25">Canceled [[ ((voucher.state == 'cancel') or removeParentNode('para')) and '' ]]</para>
<para style="P25">Posted [[ ((voucher.state == 'posted') or removeParentNode('para')) and '' ]]</para>
<para style="P21">PRO-FORMA [[ ((voucher.state == 'proforma') or removeParentNode('para')) and '' ]]</para>
<para style="P21">Draft[[ ((voucher.state == 'draft') or removeParentNode('para')) and '' ]]</para>
<para style="P21">Canceled [[ ((voucher.state == 'cancel') or removeParentNode('para')) and '' ]]</para>
<para style="P21">Posted [[ ((voucher.state == 'posted') or removeParentNode('para')) and '' ]]</para>
</td>
<td>
<para style="P3">
@@ -144,51 +196,58 @@
<para style="P10">Ref. :</para>
</td>
<td>
<para style="P27">[[ voucher.reference ]]</para>
<para style="P11">[[ voucher.reference ]]</para>
</td>
</tr>
</blockTable>
<para style="P12">
<para style="P13">
<font color="white"> </font>
</para>
<para style="P12">
<para style="P13">
<font color="white"> </font>
</para>
<blockTable colWidths="255.0,114.0,114.0" style="Heading1">
<tr>
<td>
<para style="P14">Particulars</para>
<para style="P15">Particulars</para>
</td>
<td>
<para style="P15">Debit</para>
<para style="P16">Debit</para>
</td>
<td>
<para style="P15">Credit</para>
<para style="P16">Credit</para>
</td>
</tr>
</blockTable>
<para style="P19"/>
<para style="terp_default_1"/>
<blockTable colWidths="482.0" style="voucher_lines">
<tr>
<td>
<para style="P20">[[ repeatIn(voucher.move_ids,'move_ids') ]] </para>
<blockTable colWidths="251.0,110.0,115.0" style="Table2">
<tr>
<td>
<para style="P11">[[ (move_ids.partner_id and move_ids.partner_id.name) or 'Account']] :</para>
<para style="P28">[[ move_ids.account_id.name ]] </para>
<para style="P28"><i>[[ move_ids.name ]] - [[ get_ref(voucher.id,move_ids) ]]</i></para>
<!--para style="P31">[[ get_ref(voucher.id,move_ids) ]]</para-->
</td>
<td>
<para style="P21">[[ move_ids.debit ]]</para>
</td>
<td>
<para style="P21">[[ move_ids.credit ]]</para>
</td>
</tr>
</blockTable>
<para style="P22">
<para style="terp_default_1">
<font color="white"> </font>
</para>
<section>
<para style="terp_default_8">[[ repeatIn(voucher.move_ids,'move_ids') ]] </para>
<blockTable colWidths="251.0,114.0,111.0" style="Table4">
<tr>
<td>
<para style="P12">[[ (move_ids.partner_id and move_ids.partner_id.name) or '']] :</para>
<para style="P24">[[ move_ids.account_id.name ]] </para>
<para style="P27">[[ get_ref(voucher.id,move_ids) ]]</para>
</td>
<td>
<para style="P20">[[ move_ids.debit ]]</para>
</td>
<td>
<para style="P20">[[ move_ids.credit ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_1">
<font color="white"> </font>
</para>
</section>
<para style="P28">
<font color="white"> </font>
</para>
</td>
@@ -197,7 +256,7 @@
<blockTable colWidths="253.0,114.0,114.0" style="last_info">
<tr>
<td>
<para style="P13">
<para style="P14">
<font color="white"> </font>
</para>
</td>
@@ -214,7 +273,7 @@
</tr>
<tr>
<td>
<para style="P13">Through : </para>
<para style="P14">Through : </para>
</td>
<td>
<para style="P3">
@@ -229,7 +288,7 @@
</tr>
<tr>
<td>
<para style="P30">[[ voucher.narration or '']]</para>
<para style="P25">[[ voucher.narration or '']]</para>
</td>
<td>
<para style="P3">
@@ -244,7 +303,7 @@
</tr>
<tr>
<td>
<para style="P13">On Account of : </para>
<para style="P14">On Account of : </para>
</td>
<td>
<para style="P3">
@@ -259,7 +318,7 @@
</tr>
<tr>
<td>
<para style="P30">[[ voucher.name ]]</para>
<para style="P26">[[ voucher.name ]]</para>
</td>
<td>
<para style="P3">
@@ -274,7 +333,22 @@
</tr>
<tr>
<td>
<para style="P13">Amount (in words) : </para>
<para style="P14">Amount (in words) : </para>
</td>
<td>
<para style="P14">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P14">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P26">[[ convert(voucher.amount,voucher.currency_id.name) ]]</para>
</td>
<td>
<para style="P13">
@@ -289,34 +363,19 @@
</tr>
<tr>
<td>
<para style="P30">[[ convert(voucher.amount,voucher.currency_id.name) ]]</para>
</td>
<td>
<para style="P12">
<para style="P17">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P12">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P16">
<font color="white"> </font>
</para>
<para style="P18">[[ debit(voucher.move_ids)]]</para>
</td>
<td>
<para style="P17">[[ debit(voucher.move_ids)]]</para>
</td>
<td>
<para style="P17">[[ credit(voucher.move_ids) ]]</para>
<para style="P18">[[ credit(voucher.move_ids) ]]</para>
</td>
</tr>
</blockTable>
<para style="P18">
<para style="P19">
<font color="white"> </font>
</para>
<blockTable colWidths="142.0,99.0,105.0,136.0" style="Table3">
@@ -353,20 +412,20 @@
</tr>
<tr>
<td>
<para style="P23"><i>Receiver's Signature</i></para>
<para style="P22">Receiver's Signature</para>
</td>
<td>
<para style="P23">
<para style="P22">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P23">
<para style="P22">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P23"><i>Authorised Signatory</i></para>
<para style="P22">Authorised Signatory</para>
</td>
</tr>
</blockTable>
@@ -16,7 +16,7 @@
</blockTableStyle>
<blockTableStyle id="Heading1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>D
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
@@ -27,7 +27,7 @@
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table6">
<blockTableStyle id="Table3">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
@@ -57,25 +57,25 @@
<paraStyle name="P8" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P9" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P10" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P11" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P11" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P12" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P13" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P14" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P15" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P16" fontName="Helvetica" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P17" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P18" fontName="Helvetica" fontSize="5.0" leading="7" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P19" fontName="Helvetica" fontSize="5.0" leading="7" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P20" fontName="Helvetica" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P21" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P22" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P23" fontName="Helvetica-Bold" fontSize="13.0" leading="16" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P24" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P25" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P26" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P27" rightIndent="0.0" leftIndent="15.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P29" rightIndent="0.0" leftIndent="20.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P30" rightIndent="0.0" leftIndent="25.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P18" fontName="Helvetica" fontSize="5.0" leading="7" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P19" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P20" fontName="Helvetica" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P21" fontName="Helvetica-Bold" fontSize="13.0" leading="16" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P22" rightIndent="0.0" leftIndent="35.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P23" rightIndent="0.0" leftIndent="35.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P24" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P25" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P26" fontName="Helvetica" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P27" rightIndent="0.0" leftIndent="35.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P28" rightIndent="0.0" leftIndent="71.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="P29" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#000000"/>
<paraStyle name="Standard" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Text body" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
@@ -84,10 +84,54 @@
<paraStyle name="Index" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT"/>
<paraStyle name="Table Contents" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Heading" fontName="Times-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Footer" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT"/>
<paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" alignment="LEFT" spaceBefore="0.0" spaceAfter="14.0"/>
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_1" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_8_Italic" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Drawing" fontName="Times-Italic" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Header" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT"/>
<paraStyle name="Endnote" rightIndent="0.0" leftIndent="14.0" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="LEFT"/>
<paraStyle name="Addressee" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="3.0"/>
<paraStyle name="Signature" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT"/>
<paraStyle name="Heading 8" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 7" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 6" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 5" fontName="Helvetica-Bold" fontSize="85%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 4" fontName="Helvetica-BoldOblique" fontSize="85%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 1" fontName="Helvetica-Bold" fontSize="115%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 10" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 2" fontName="Helvetica-BoldOblique" fontSize="14.0" leading="17" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="First line indent" rightIndent="0.0" leftIndent="0.0" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Hanging indent" rightIndent="0.0" leftIndent="28.0" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Salutation" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT"/>
<paraStyle name="Text body indent" rightIndent="0.0" leftIndent="0.0" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Heading 3" fontName="Helvetica-Bold" fontSize="14.0" leading="17" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="List Indent" rightIndent="0.0" leftIndent="142.0" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Marginalia" rightIndent="0.0" leftIndent="113.0" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
</stylesheet>
<images/>
<story>
<para style="P25">[[ repeatIn(objects,'voucher') ]]</para>
<para style="P24">[[ repeatIn(objects,'voucher') ]]</para>
<para style="P4">[[ company.name ]]</para>
<para style="P6">[[ company.partner_id.address and company.partner_id.address[0].street ]]</para>
<para style="P6">[[ company.partner_id.address and company.partner_id.address[0].zip ]] [[ company.partner_id.address and company.partner_id.address[0].city ]] - [[ company.partner_id.address and company.partner_id.address[0].country_id and company.partner_id.address[0].country_id.name ]]</para>
@@ -96,11 +140,11 @@
<para style="P5">
<font color="white"> </font>
</para>
<para style="P23">Cash Receipt Voucher [[ (voucher.type == 'rec_voucher' or removeParentNode('para')) and '' ]]</para>
<para style="P21">Cash Receipt Voucher [[ (voucher.type == 'rec_voucher' or removeParentNode('para')) and '' ]]</para>
<para style="P2">Cash Payment Voucher [[ (voucher.type == 'pay_voucher' or removeParentNode('para')) and '' ]]</para>
<para style="P23">Bank Receipt Voucher [[ (voucher.type == 'bank_rec_voucher' or removeParentNode('para')) and '' ]]</para>
<para style="P21">Bank Receipt Voucher [[ (voucher.type == 'bank_rec_voucher' or removeParentNode('para')) and '' ]]</para>
<para style="P2">Bank Payment Voucher [[ (voucher.type == 'bank_pay_voucher' or removeParentNode('para')) and '' ]]</para>
<para style="P22">
<para style="P20">
<font color="white"> </font>
</para>
<blockTable colWidths="68.0,124.0,122.0,62.0,106.0" style="Table1">
@@ -109,7 +153,7 @@
<para style="P10">No.</para>
</td>
<td>
<para style="P26">[[ voucher.number ]]</para>
<para style="P11">[[ voucher.number ]]</para>
</td>
<td>
<para style="P3">
@@ -120,7 +164,7 @@
<para style="P10">Dated :</para>
</td>
<td>
<para style="P26">[[ time.strftime('%d %B,%Y', time.strptime(voucher.date , '%Y-%m-%d')) or '' ]]</para>
<para style="P11">[[ time.strftime('%d %B,%Y', time.strptime(voucher.date , '%Y-%m-%d')) or '' ]]</para>
</td>
</tr>
<tr>
@@ -128,10 +172,10 @@
<para style="P10">State :</para>
</td>
<td>
<para style="P24">PRO-FORMA [[ ((voucher.state == 'proforma') or removeParentNode('para')) and '' ]]</para>
<para style="P24">Draft[[ ((voucher.state == 'draft') or removeParentNode('para')) and '' ]]</para>
<para style="P24">Canceled [[ ((voucher.state == 'cancel') or removeParentNode('para')) and '' ]]</para>
<para style="P24">Posted [[ ((voucher.state == 'posted') or removeParentNode('para')) and '' ]]</para>
<para style="P19">PRO-FORMA [[ ((voucher.state == 'proforma') or removeParentNode('para')) and '' ]]</para>
<para style="P19">Draft[[ ((voucher.state == 'draft') or removeParentNode('para')) and '' ]]</para>
<para style="P19">Canceled [[ ((voucher.state == 'cancel') or removeParentNode('para')) and '' ]]</para>
<para style="P19">Posted [[ ((voucher.state == 'posted') or removeParentNode('para')) and '' ]]</para>
</td>
<td>
<para style="P3">
@@ -142,7 +186,7 @@
<para style="P10">Ref. :</para>
</td>
<td>
<para style="P26">[[ voucher.reference ]]</para>
<para style="P11">[[ voucher.reference ]]</para>
</td>
</tr>
<tr>
@@ -150,7 +194,7 @@
<para style="P10">Account :</para>
</td>
<td>
<para style="P24">[[ voucher.account_id.name ]]</para>
<para style="P19">[[ voucher.account_id.name ]]</para>
</td>
<td>
<para style="P3">
@@ -163,17 +207,19 @@
</para>
</td>
<td>
<para style="P26">
<para style="P11">
<font color="white"> </font>
</para>
</td>
</tr>
</blockTable>
<para style="P12"/>
<para style="P12">
<font color="white"> </font>
</para>
<blockTable colWidths="333.0,149.0" style="Heading1">
<para style="P12">
<font color="white"> </font>
</para>
<blockTable colWidths="344.0,138.0" style="Heading1">
<tr>
<td>
<para style="P14">Particulars</para>
@@ -183,26 +229,31 @@
</td>
</tr>
</blockTable>
<para style="P18">
<font color="white"> </font>
</para>
<blockTable colWidths="482.0" style="voucher_lines">
<tr>
<td>
<para style="P19">[[ repeatIn(voucher.payment_ids,'payment_ids') ]] </para>
<blockTable colWidths="324.0,152.0" style="Table6">
<tr>
<td>
<para style="P11">[[ payment_ids.partner_id.name ]] :</para>
<para style="P27">[[ payment_ids.account_id.name ]] </para>
<para style="P30">[[ payment_ids.ref ]] [[ payment_ids.amount ]] [[ payment_ids.type ]]</para>
</td>
<td>
<para style="P20">[[ payment_ids.amount ]]</para>
</td>
</tr>
</blockTable>
<para style="P21">
<para style="terp_default_1">
<font color="white"> </font>
</para>
<section>
<para style="terp_default_8">[[ repeatIn(voucher.payment_ids,'payment_ids') ]] </para>
<blockTable colWidths="340.0,136.0" style="Table3">
<tr>
<td>
<para style="P25">[[ payment_ids.partner_id.name ]] :</para>
<para style="P27">[[ payment_ids.account_id.name ]] </para>
<para style="P28">[[ payment_ids.ref ]] [[ payment_ids.amount ]] [[ payment_ids.type ]]</para>
</td>
<td>
<para style="P26">[[ payment_ids.amount ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_1">
<font color="white"> </font>
</para>
</section>
<para style="P29">
<font color="white"> </font>
</para>
</td>
@@ -233,10 +284,10 @@
</tr>
<tr>
<td>
<para style="P29">[[ voucher.narration or '' ]] </para>
<para style="P22">[[ voucher.narration or '' ]] </para>
</td>
<td>
<para style="P26">
<para style="P11">
<font color="white"> </font>
</para>
</td>
@@ -253,10 +304,10 @@
</tr>
<tr>
<td>
<para style="P29">[[ voucher.name ]]</para>
<para style="P23">[[ voucher.name ]]</para>
</td>
<td>
<para style="P26">
<para style="P11">
<font color="white"> </font>
</para>
</td>
@@ -273,7 +324,7 @@
</tr>
<tr>
<td>
<para style="P29">[[ convert(voucher.amount,voucher.currency_id.name) ]]</para>
<para style="P23">[[ convert(voucher.amount,voucher.currency_id.name) ]]</para>
</td>
<td>
<para style="P12">
@@ -329,20 +380,20 @@
</tr>
<tr>
<td>
<para style="P22">Receiver's Signature</para>
<para style="P20">Receiver's Signature</para>
</td>
<td>
<para style="P22">
<para style="P20">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P22">
<para style="P20">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P22">Authorised Signatory</para>
<para style="P20">Authorised Signatory</para>
</td>
</tr>
</blockTable>
+1 -1
View File
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-01-20 04:36+0000\n"
"X-Launchpad-Export-Date: 2010-01-22 04:34+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: auction
+21 -21
View File
@@ -7,19 +7,19 @@ 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: 2010-01-18 23:06+0000\n"
"Last-Translator: Holverat <holverat@gmail.com>\n"
"PO-Revision-Date: 2010-01-23 02:16+0000\n"
"Last-Translator: Holverat Bortolossi <holverat@gmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-01-20 04:36+0000\n"
"X-Launchpad-Export-Date: 2010-01-24 04:50+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: auction
#: field:report.deposit.border,total_marge:0
msgid "Total margin"
msgstr ""
msgstr "Margem total"
#. module: auction
#: wizard_view:auction.lots.sms_send,init:0
@@ -29,7 +29,7 @@ msgstr ""
#. module: auction
#: view:auction.lots:0
msgid "Set to draft"
msgstr ""
msgstr "Definir como rascunho"
#. module: auction
#: field:auction.deposit,partner_id:0
@@ -39,12 +39,12 @@ msgstr ""
#: field:report.seller.auction,seller:0
#: field:report.seller.auction2,seller:0
msgid "Seller"
msgstr ""
msgstr "Loja"
#. module: auction
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr ""
msgstr "Nome de modelo inválido na definição da ação."
#. module: auction
#: selection:auction.lots.send.aie,date_ask,numerotation:0
@@ -56,38 +56,38 @@ msgstr "Provisório"
#: selection:auction.lots.send.aie,date_ask,numerotation:0
#: selection:auction.lots.send.aie,init,numerotation:0
msgid "Definitive (ordre catalogue)"
msgstr ""
msgstr "Definitivo (catálogo do ordre)"
#. module: auction
#: model:ir.ui.menu,name:auction.menu_report_auction_object_date_tree1_my
msgid "My Encoded Objects Per Day"
msgstr ""
msgstr "Meus objetos codificados por dia"
#. module: auction
#: model:ir.model,name:auction.model_auction_lot_history
msgid "Lot history"
msgstr ""
msgstr "Histórico de lote"
#. module: auction
#: field:report.seller.auction,avg_estimation:0
msgid "Avg estimation"
msgstr ""
msgstr "Média estimada"
#. module: auction
#: field:report.auction.object.date,obj_num:0
#: field:report.auction.view2,obj_number:0
msgid "# of Objects"
msgstr ""
msgstr "dos Objetos"
#. module: auction
#: model:ir.ui.menu,name:auction.menu_action_bids_form
msgid "Bids line"
msgstr ""
msgstr "Linha de Lances"
#. module: auction
#: xsl:report.auction.deposit:0
msgid "Deposit Form"
msgstr ""
msgstr "Formulário de Depósitos"
#. module: auction
#: rml:auction.bids:0
@@ -108,22 +108,22 @@ msgstr "Comprador"
#: field:report.auction.view,nobjects:0
#: field:report.buyer.auction,object:0
msgid "No of objects"
msgstr ""
msgstr "Nenhum dos objetos"
#. module: auction
#: model:ir.ui.menu,name:auction.menu_report_auction_adjudication_tree
msgid "Adjudication by Auction"
msgstr ""
msgstr "Concedido em Leilão"
#. module: auction
#: rml:auction.total.rml:0
msgid "# of paid items (based on invoices):"
msgstr ""
msgstr "# de itens pagos (com base na faturas):"
#. module: auction
#: model:ir.actions.wizard,name:auction.wizard_numerotate_lot
msgid "Numerotation (per lot)"
msgstr ""
msgstr "Numeração (por lote)"
#. module: auction
#: selection:auction.lot.category,aie_categ:0
@@ -134,18 +134,18 @@ msgstr ""
#: view:auction.deposit:0
#: model:ir.model,name:auction.model_auction_deposit
msgid "Deposit Border"
msgstr ""
msgstr "Limite de Depósito"
#. module: auction
#: wizard_field:auction.lots.make_invoice,init,amount:0
#: wizard_field:auction.lots.make_invoice_buyer,init,amount:0
msgid "Invoiced Amount"
msgstr ""
msgstr "Valor Faturado"
#. module: auction
#: selection:auction.lot.category,aie_categ:0
msgid "Antique/Tin / Copper wares"
msgstr ""
msgstr "Antigo/pequeno produto de cobre ou estanho"
#. module: auction
#: field:auction.lots,paid_ach:0
+1 -1
View File
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-01-20 04:36+0000\n"
"X-Launchpad-Export-Date: 2010-01-22 04:34+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: audittrail
+25
View File
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import base_calendar
import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+52
View File
@@ -0,0 +1,52 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
"name" : "Basic Calendar Functionality",
"version" : "1.0",
"depends" : [
"base",
],
'description': """
Contains basic functionality for caldav system like:
- Maintenance of basic objects needed for caldav calendar
* Event(Meeting)
* Todo(Task)
* Reminder
* Attendee
- Availabilities of synchronisation using WebDAV
""",
"author" : "Tiny",
'category': 'Generic Modules/Others',
'website': 'http://www.openerp.com',
"init_xml" : ["base_calendar_data.xml"],
"demo_xml" : [],
"update_xml" : [
'security/ir.model.access.csv',
'base_calendar_wizard.xml',
'base_calendar_view.xml'
],
"installable" : True,
"active" : False,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -22,8 +22,10 @@
from datetime import datetime, timedelta
from dateutil import parser
from dateutil.rrule import *
from osv import osv
import common
from osv import osv, fields
from tools.translate import _
import base64
import pooler
import re
import vobject
@@ -32,6 +34,51 @@ import vobject
# R-1 Required and can come only once
# R-n Required and can come more than once
def uid2openobjectid(cr, uidval, oomodel, rdate):
__rege = re.compile(r'OpenObject-([\w|\.]+)_([0-9]+)@(\w+)$')
wematch = __rege.match(uidval.encode('utf8'))
if not wematch:
return (False, None)
else:
model, id, dbname = wematch.groups()
model_obj = pooler.get_pool(cr.dbname).get(model)
if (not model == oomodel) or (not dbname == cr.dbname):
return (False, None)
qry = 'select distinct(id) from %s' % model_obj._table
if rdate:
qry += " where recurrent_id='%s'" % (rdate)
cr.execute(qry)
r_id = cr.fetchone()
if r_id:
return (id, r_id[0])
cr.execute(qry)
ids = map(lambda x: str(x[0]), cr.fetchall())
if id in ids:
return (id, None)
return False
def openobjectid2uid(cr, uidval, oomodel):
value = 'OpenObject-%s_%s@%s' % (oomodel, uidval, cr.dbname)
return value
def get_attribute_mapping(cr, uid, calname, context={}):
pool = pooler.get_pool(cr.dbname)
field_obj = pool.get('basic.calendar.fields')
fids = field_obj.search(cr, uid, [('type_id', '=', calname)])
res = {}
for field in field_obj.browse(cr, uid, fids):
attr = field.name.name
res[attr] = {}
res[attr]['field'] = field.field_id.name
res[attr]['type'] = field.field_id.ttype
if field.fn == 'hours':
res[attr]['type'] = "timedelta"
if res[attr]['type'] in ('one2many', 'many2many', 'many2one'):
res[attr]['object'] = field.field_id.relation
elif res[attr]['type'] in ('selection') and field.mapping:
res[attr]['mapping'] = eval(field.mapping)
return res
def map_data(cr, uid, obj):
vals = {}
for map_dict in obj.__attribute__:
@@ -74,8 +121,8 @@ def map_data(cr, uid, obj):
return vals
class CalDAV(object):
__attribute__ = {
}
__attribute__ = {}
def get_recurrent_dates(self, rrulestring, exdate, startdate=None):
if not startdate:
startdate = datetime.now()
@@ -102,8 +149,6 @@ class CalDAV(object):
val = ','.join(map(lambda x: x.strftime('%Y-%m-%d %H:%M:%S'), val))
else:
val = val.strftime('%Y-%m-%d %H:%M:%S')
if valtype and valtype == 'integer' and val:
val = int(val)
return val
else:
return self.__attribute__.get(name, None)
@@ -113,11 +158,32 @@ class CalDAV(object):
if self.__attribute__[name]:
self.__attribute__[name][type] = None
return True
def parse_ics(self, cr, uid, child):
att_data = []
for cal_data in child.getChildren():
if cal_data.name.lower() == 'attendee':
attendee = self.pool.get('basic.calendar.attendee')
att_data.append(attendee.import_cal(cr, uid, cal_data))
self.ical_set(cal_data.name.lower(), att_data, 'value')
continue
if cal_data.name.lower() == 'valarm':
alarm = self.pool.get('basic.calendar.alarm')
vals = alarm.import_cal(cr, uid, cal_data)
self.ical_set(cal_data.name.lower(), vals, 'value')
continue
if cal_data.name.lower() in self.__attribute__:
self.ical_set(cal_data.name.lower(), cal_data.value, 'value')
vals = map_data(cr, uid, self)
return vals
def export_ical(self, cr, uid, datas, vobj=None, context={}):
ical = vobject.iCalendar()
def create_ics(self, cr, uid, datas, name, ical, context=None):
if not datas:
model = context.get('model', None)
war_str = "No data available" + (model and " for " + model) or ""
raise osv.except_osv(_('Warning !'), _(war_str))
for data in datas:
vevent = ical.add(vobj)
vevent = ical.add(name)
for field in self.__attribute__.keys():
map_field = self.ical_get(field, 'field')
map_type = self.ical_get(field, 'type')
@@ -126,26 +192,31 @@ class CalDAV(object):
model = context.get('model', None)
if not model:
continue
uidval = common.openobjectid2uid(cr, data[map_field], model)
uidval = openobjectid2uid(cr, data[map_field], model)
model_obj = self.pool.get(model)
cr.execute('select id from %s where recurrent_uid=%s'
% (model.replace('.', '_'), data[map_field]))
% (model_obj._table, data[map_field]))
r_ids = map(lambda x: x[0], cr.fetchall())
if r_ids:
rdata = self.pool.get(model).read(cr, uid, r_ids)
rcal = self.export_ical(cr, uid, rdata, context=context)
rcal = self.export_cal(cr, uid, rdata, context=context)
for revents in rcal.contents['vevent']:
ical.contents['vevent'].append(revents)
if data.get('recurrent_uid', None):
uidval = common.openobjectid2uid(cr, data['recurrent_uid'], model)
uidval = openobjectid2uid(cr, data['recurrent_uid'], model)
vevent.add('uid').value = uidval
elif field == 'attendee' and data[map_field]:
model = self.__attribute__[field].get('object', False)
attendee_obj = self.pool.get('basic.calendar.attendee')
vevent = attendee_obj.export_ical(cr, uid, data[map_field], vevent, context=context)
vevent = attendee_obj.export_cal(cr, uid, model, \
data[map_field], vevent, context=context)
elif field == 'valarm' and data[map_field]:
model = self.__attribute__[field].get('object', False)
alarm_obj = self.pool.get('basic.calendar.alarm')
vevent = alarm_obj.export_ical(cr, uid, data[map_field][0], vevent, context=context)
vevent = alarm_obj.export_cal(cr, uid, model, \
data[map_field][0], vevent, context=context)
elif data[map_field]:
if map_type == "text":
if map_type in ("char", "text"):
vevent.add(field).value = str(data[map_field])
elif map_type == 'datetime' and data[map_field]:
if field in ('exdate'):
@@ -156,32 +227,32 @@ class CalDAV(object):
vevent.add(field).value = timedelta(hours=data[map_field])
elif map_type == "many2one":
vevent.add(field).value = [data.get(map_field)[1]]
if self.__attribute__.get(field).has_key('mapping'):
for key1, val1 in self.ical_get(field, 'mapping').items():
if val1 == data[map_field]:
vevent.add(field).value = key1
elif map_type in ("float", "integer"):
vevent.add(field).value = str(data.get(map_field))
elif map_type == "selection":
if not self.ical_get(field, 'mapping'):
vevent.add(field).value = (data[map_field]).upper()
else:
for key1, val1 in self.ical_get(field, 'mapping').items():
if val1 == data[map_field]:
vevent.add(field).value = key1
return vevent
def export_cal(self, cr, uid, datas, vobj=None, context={}):
self.__attribute__ = get_attribute_mapping(cr, uid, self._calname, context)
ical = vobject.iCalendar()
self.create_ics(cr, uid, datas, vobj, ical, context=context)
return ical
def import_ical(self, cr, uid, ical_data):
def import_cal(self, cr, uid, content, data_id=None, context=None):
ical_data = base64.decodestring(content)
self.__attribute__ = get_attribute_mapping(cr, uid, self._calname)
parsedCal = vobject.readOne(ical_data)
att_data = []
res = []
for child in parsedCal.getChildren():
for cal_data in child.getChildren():
if cal_data.name.lower() == 'attendee':
attendee = self.pool.get('basic.calendar.attendee')
att_data.append(attendee.import_ical(cr, uid, cal_data))
self.ical_set(cal_data.name.lower(), att_data, 'value')
continue
if cal_data.name.lower() == 'valarm':
alarm = self.pool.get('basic.calendar.alarm')
vals = alarm.import_ical(cr, uid, cal_data)
self.ical_set(cal_data.name.lower(), vals, 'value')
continue
if cal_data.name.lower() in self.__attribute__:
self.ical_set(cal_data.name.lower(), cal_data.value, 'value')
if child.name.lower() in ('vevent', 'vtodo'):
vals = map_data(cr, uid, self)
vals = self.parse_ics(cr, uid, child)
else:
vals = {}
continue
@@ -190,8 +261,11 @@ class CalDAV(object):
return res
class Calendar(CalDAV, osv.osv_memory):
class Calendar(CalDAV, osv.osv):
_name = 'basic.calendar'
_description = 'Calendar'
_calname = 'calendar'
__attribute__ = {
'prodid': None, # Use: R-1, Type: TEXT, Specifies the identifier for the product that created the iCalendar object.
'version': None, # Use: R-1, Type: TEXT, Specifies the identifier corresponding to the highest version number
@@ -204,13 +278,112 @@ class Calendar(CalDAV, osv.osv_memory):
'vjournal': None, # Use: O-n, Type: Collection of Journal class
'vfreebusy': None, # Use: O-n, Type: Collection of FreeBusy class
'vtimezone': None, # Use: O-n, Type: Collection of Timezone class
}
_columns = {
'name': fields.char("Name", size=64),
'line_ids': fields.one2many('basic.calendar.lines', 'calendar_id', 'Calendar Lines'),
'active': fields.boolean('Active'),
}
_defaults = {
'active': lambda *a: True,
}
def export_cal(self, cr, uid, datas, vobj='vevent', context={}):
cal = self.browse(cr, uid, datas[0])
ical = vobject.iCalendar()
for line in cal.line_ids:
if line.name in ('alarm', 'attendee'):
continue
mod_obj = self.pool.get(line.object_id.model)
data_ids = mod_obj.search(cr, uid, eval(line.domain), context=context)
datas = mod_obj.read(cr, uid, data_ids, context=context)
context.update({'model': line.object_id.model})
self.__attribute__ = get_attribute_mapping(cr, uid, line.name, context)
self.create_ics(cr, uid, datas, line.name, ical, context=context)
return ical.serialize()
def import_cal(self, cr, uid, content, data_id=None, context=None):
ical_data = base64.decodestring(content)
parsedCal = vobject.readOne(ical_data)
if not data_id:
data_id = self.search(cr, uid, [])[0]
cal = self.browse(cr, uid, data_id)
cal_children = {}
count = 0
for line in cal.line_ids:
cal_children[line.name] = line.object_id.model
for child in parsedCal.getChildren():
if child.name.lower() in cal_children:
self.__attribute__ = get_attribute_mapping(cr, uid, child.name.lower())
val = self.parse_ics(cr, uid, child)
obj = self.pool.get(cal_children[child.name.lower()])
if hasattr(obj, 'check_import'):
obj.check_import(cr, uid, [val], context={})
return {}
Calendar()
class basic_calendar_line(osv.osv):
_name = 'basic.calendar.lines'
_description = 'Calendar Lines'
_columns = {
'name': fields.selection([('vevent', 'Event'), ('vtodo', 'TODO'), \
('alarm', 'Alarm'), \
('attendee', 'Attendee')], \
string="Type", size=64),
'object_id': fields.many2one('ir.model', 'Object'),
'calendar_id': fields.many2one('basic.calendar', 'Calendar', \
required=True, ondelete='cascade'),
'domain': fields.char('Domain', size=124),
'mapping_ids': fields.one2many('basic.calendar.fields', 'type_id', 'Fields Mapping')
}
_defaults = {
'domain': lambda *a: '[]',
}
basic_calendar_line()
class basic_calendar_attribute(osv.osv):
_name = 'basic.calendar.attributes'
_description = 'Calendar attributes'
_columns = {
'name': fields.char("Name", size=64, required=True),
'type': fields.selection([('vevent', 'Event'), ('vtodo', 'TODO'), \
('alarm', 'Alarm'), \
('attendee', 'Attendee')], \
string="Type", size=64, required=True),
}
basic_calendar_attribute()
class basic_calendar_fields(osv.osv):
_name = 'basic.calendar.fields'
_description = 'Calendar fields'
_columns = {
'field_id': fields.many2one('ir.model.fields', 'OpenObject Field'),
'name': fields.many2one('basic.calendar.attributes', 'Name', required=True),
'type_id': fields.many2one('basic.calendar.lines', 'Type', \
required=True, ondelete='cascade'),
'expr': fields.char("Expression", size=64),
'fn': fields.selection( [('field', 'Use the field'),
('const', 'Expression as constant'),
('hours', 'Interval in hours'),
],'Function'),
'mapping': fields.text('Mapping'),
}
_defaults = {
'fn': lambda *a: 'field',
}
basic_calendar_fields()
class Event(CalDAV, osv.osv_memory):
_name = 'basic.calendar.event'
_calname = 'vevent'
__attribute__ = {
'class': None, # Use: O-1, Type: TEXT, Defines the access classification for a calendar component like "PUBLIC" / "PRIVATE" / "CONFIDENTIAL"
'created': None, # Use: O-1, Type: DATE-TIME, Specifies the date and time that the calendar information was created by the calendar user agent in the calendar store.
@@ -246,13 +419,14 @@ class Event(CalDAV, osv.osv_memory):
'duration': None, # Use: O-1, Type: DURATION, Specifies a positive duration of time.
'dtend': None, # Use: O-1, Type: DATE-TIME, Specifies the date and time that a calendar component ends.
}
def export_ical(self, cr, uid, datas, vobj='vevent', context={}):
return super(Event, self).export_ical(cr, uid, datas, 'vevent', context=context)
def export_cal(self, cr, uid, datas, vobj='vevent', context={}):
return super(Event, self).export_cal(cr, uid, datas, 'vevent', context=context)
Event()
class ToDo(CalDAV, osv.osv_memory):
_name = 'basic.calendar.todo'
_calname = 'vtodo'
__attribute__ = {
'class': None,
@@ -289,8 +463,8 @@ class ToDo(CalDAV, osv.osv_memory):
'rrule': None,
}
def export_ical(self, cr, uid, datas, vobj='vevent', context={}):
return super(ToDo, self).export_ical(cr, uid, datas, 'vtodo', context=context)
def export_cal(self, cr, uid, datas, vobj='vevent', context={}):
return super(ToDo, self).export_cal(cr, uid, datas, 'vtodo', context=context)
ToDo()
@@ -329,6 +503,8 @@ class Timezone(CalDAV):
class Alarm(CalDAV, osv.osv_memory):
_name = 'basic.calendar.alarm'
_calname = 'alarm'
__attribute__ = {
'action': None, # Use: R-1, Type: Text, defines the action to be invoked when an alarm is triggered LIKE "AUDIO" / "DISPLAY" / "EMAIL" / "PROCEDURE"
'description': None, # Type: Text, Provides a more complete description of the calendar component, than that provided by the "SUMMARY" property. Use:- R-1 for DISPLAY,Use:- R-1 for EMAIL,Use:- R-1 for PROCEDURE
@@ -341,9 +517,9 @@ class Alarm(CalDAV, osv.osv_memory):
'x-prop': None,
}
def export_ical(self, cr, uid, alarm_id, vevent, context={}):
def export_cal(self, cr, uid, model, alarm_id, vevent, context={}):
valarm = vevent.add('valarm')
alarm_object = self.pool.get('calendar.alarm')
alarm_object = self.pool.get(model)
alarm_data = alarm_object.read(cr, uid, alarm_id, [])
# Compute trigger data
@@ -365,9 +541,9 @@ class Alarm(CalDAV, osv.osv_memory):
# Compute other details
valarm.add('DESCRIPTION').value = alarm_data['name']
valarm.add('ACTION').value = alarm_data['action']
return vevent
def import_ical(self, cr, uid, ical_data):
def import_cal(self, cr, uid, ical_data):
for child in ical_data.getChildren():
if child.name.lower() == 'trigger':
seconds = child.value.seconds
@@ -401,6 +577,8 @@ Alarm()
class Attendee(CalDAV, osv.osv_memory):
_name = 'basic.calendar.attendee'
_calname = 'attendee'
__attribute__ = {
'cutype': None, # Use: 0-1 Specify the type of calendar user specified by the property like "INDIVIDUAL"/"GROUP"/"RESOURCE"/"ROOM"/"UNKNOWN".
'member': None, # Use: 0-1 Specify the group or list membership of the calendar user specified by the property.
@@ -415,7 +593,7 @@ class Attendee(CalDAV, osv.osv_memory):
'language': None, # Use: 0-1 Specify the language for text values in a property or property parameter.
}
def import_ical(self, cr, uid, ical_data):
def import_cal(self, cr, uid, ical_data):
for para in ical_data.params:
if para.lower() == 'cn':
self.ical_set(para.lower(), ical_data.params[para][0]+':'+ \
@@ -427,11 +605,13 @@ class Attendee(CalDAV, osv.osv_memory):
vals = map_data(cr, uid, self)
return vals
def export_ical(self, cr, uid, attendee_id, vevent, context={}):
attendee_object = self.pool.get('calendar.attendee')
for attendee in attendee_object.read(cr, uid, attendee_id, []):
def export_cal(self, cr, uid, model, attendee_ids, vevent, context={}):
attendee_object = self.pool.get(model)
self.__attribute__ = get_attribute_mapping(cr, uid, self._calname, context)
for attendee in attendee_object.read(cr, uid, attendee_ids, []):
attendee_add = vevent.add('attendee')
for a_key, a_val in attendee_object.__attribute__.items():
cn_val = ''
for a_key, a_val in self.__attribute__.items():
if attendee[a_val['field']] and a_val['field'] != 'cn':
if a_val['type'] == 'text':
attendee_add.params[a_key] = [str(attendee[a_val['field']])]
+369
View File
@@ -0,0 +1,369 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
<record model="basic.calendar" id="basic_calendar1">
<field name="name">OpenERP</field>
</record>
<!-- Event attributes-->
<record model="basic.calendar.attributes" id="field_event_comment">
<field name="name">comment</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_uid">
<field name="name">uid</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_seq">
<field name="name">seq</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_recurrence-id">
<field name="name">recurrence-id</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_transp">
<field name="name">transp</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_attendee">
<field name="name">attendee</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_related">
<field name="name">related</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_rrule">
<field name="name">rrule</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_dtend">
<field name="name">dtend</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_valarm">
<field name="name">valarm</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_priority">
<field name="name">priority</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_location">
<field name="name">location</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_exrule">
<field name="name">exrule</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_resources">
<field name="name">resources</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_rstatus">
<field name="name">rstatus</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_status">
<field name="name">status</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_exdate">
<field name="name">exdate</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_dtstamp">
<field name="name">dtstamp</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_description">
<field name="name">description</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_rdate">
<field name="name">rdate</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_dtstart">
<field name="name">dtstart</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_class">
<field name="name">class</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_x-openobject-model">
<field name="name">x-openobject-model</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_created">
<field name="name">created</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_url">
<field name="name">url</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_summary">
<field name="name">summary</field>
<field name="type">vevent</field>
</record>
<record model="basic.calendar.attributes" id="field_event_contact">
<field name="name">contact</field>
<field name="type">vevent</field>
</record>
<!-- Todo attributes-->
<record model="basic.calendar.attributes" id="field_todo_status">
<field name="name">status</field>
<field name="type">vtodo</field>
</record>
<record model="basic.calendar.attributes" id="field_todo_comment">
<field name="name">comment</field>
<field name="type">vtodo</field>
</record>
<record model="basic.calendar.attributes" id="field_todo_attendee">
<field name="name">attendee</field>
<field name="type">vtodo</field>
</record>
<record model="basic.calendar.attributes" id="field_todo_valarm">
<field name="name">valarm</field>
<field name="type">vtodo</field>
</record>
<record model="basic.calendar.attributes" id="field_todo_description">
<field name="name">description</field>
<field name="type">vtodo</field>
</record>
<record model="basic.calendar.attributes" id="field_todo_seq">
<field name="name">seq</field>
<field name="type">vtodo</field>
</record>
<record model="basic.calendar.attributes" id="field_todo_url">
<field name="name">url</field>
<field name="type">vtodo</field>
</record>
<record model="basic.calendar.attributes" id="field_todo_completed">
<field name="name">completed</field>
<field name="type">vtodo</field>
</record>
<record model="basic.calendar.attributes" id="field_todo_percent">
<field name="name">percent</field>
<field name="type">vtodo</field>
</record>
<record model="basic.calendar.attributes" id="field_todo_due">
<field name="name">due</field>
<field name="type">vtodo</field>
</record>
<record model="basic.calendar.attributes" id="field_todo_summary">
<field name="name">summary</field>
<field name="type">vtodo</field>
</record>
<record model="basic.calendar.attributes" id="field_todo_priority">
<field name="name">priority</field>
<field name="type">vtodo</field>
</record>
<record model="basic.calendar.attributes" id="field_todo_exdate">
<field name="name">exdate</field>
<field name="type">vtodo</field>
</record>
<record model="basic.calendar.attributes" id="field_todo_location">
<field name="name">location</field>
<field name="type">vtodo</field>
</record>
<record model="basic.calendar.attributes" id="field_todo_exrule">
<field name="name">exrule</field>
<field name="type">vtodo</field>
</record>
<record model="basic.calendar.attributes" id="field_todo_duration">
<field name="name">duration</field>
<field name="type">vtodo</field>
</record>
<record model="basic.calendar.attributes" id="field_todo_organizer">
<field name="name">organizer</field>
<field name="type">vtodo</field>
</record>
<record model="basic.calendar.attributes" id="field_todo_dtstart">
<field name="name">dtstart</field>
<field name="type">vtodo</field>
</record>
<record model="basic.calendar.attributes" id="field_todo_rrule">
<field name="name">rrule</field>
<field name="type">vtodo</field>
</record>
<record model="basic.calendar.attributes" id="field_todo_class">
<field name="name">class</field>
<field name="type">vtodo</field>
</record>
<record model="basic.calendar.attributes" id="field_todo_uid">
<field name="name">uid</field>
<field name="type">vtodo</field>
</record>
<!-- Attendee's attributes-->
<record model="basic.calendar.attributes" id="field_attendee_cn">
<field name="name">cn</field>
<field name="type">attendee</field>
</record>
<record model="basic.calendar.attributes" id="field_attendee_sent-by">
<field name="name">sent-by</field>
<field name="type">attendee</field>
</record>
<record model="basic.calendar.attributes" id="field_attendee_language">
<field name="name">language</field>
<field name="type">attendee</field>
</record>
<record model="basic.calendar.attributes" id="field_attendee_delegated-from">
<field name="name">delegated-from</field>
<field name="type">attendee</field>
</record>
<record model="basic.calendar.attributes" id="field_attendee_member">
<field name="name">member</field>
<field name="type">attendee</field>
</record>
<record model="basic.calendar.attributes" id="field_attendee_cutype">
<field name="name">cutype</field>
<field name="type">attendee</field>
</record>
<record model="basic.calendar.attributes" id="field_attendee_role">
<field name="name">role</field>
<field name="type">attendee</field>
</record>
<record model="basic.calendar.attributes" id="field_attendee_partstat">
<field name="name">partstat</field>
<field name="type">attendee</field>
</record>
<record model="basic.calendar.attributes" id="field_attendee_delegated-to">
<field name="name">delegated-to</field>
<field name="type">attendee</field>
</record>
<record model="basic.calendar.attributes" id="field_attendee_dir">
<field name="name">dir</field>
<field name="type">attendee</field>
</record>
<record model="basic.calendar.attributes" id="field_attendee_rsvp">
<field name="name">rsvp</field>
<field name="type">attendee</field>
</record>
<!-- Alarm attributes-->
<record model="basic.calendar.attributes" id="field_alarm_attendee">
<field name="name">attendee</field>
<field name="type">alarm</field>
</record>
<record model="basic.calendar.attributes" id="field_alarm_trigger_duration">
<field name="name">trigger_duration</field>
<field name="type">alarm</field>
</record>
<record model="basic.calendar.attributes" id="field_alarm_description">
<field name="name">description</field>
<field name="type">alarm</field>
</record>
<record model="basic.calendar.attributes" id="field_alarm_attach">
<field name="name">attach</field>
<field name="type">alarm</field>
</record>
<record model="basic.calendar.attributes" id="field_alarm_trigger_occurs">
<field name="name">trigger_occurs</field>
<field name="type">alarm</field>
</record>
<record model="basic.calendar.attributes" id="field_alarm_trigger_interval">
<field name="name">trigger_interval</field>
<field name="type">alarm</field>
</record>
<record model="basic.calendar.attributes" id="field_alarm_summary">
<field name="name">summary</field>
<field name="type">alarm</field>
</record>
<record model="basic.calendar.attributes" id="field_alarm_duration">
<field name="name">duration</field>
<field name="type">alarm</field>
</record>
<record model="basic.calendar.attributes" id="field_alarm_repeat">
<field name="name">repeat</field>
<field name="type">alarm</field>
</record>
<record model="basic.calendar.attributes" id="field_alarm_action">
<field name="name">action</field>
<field name="type">alarm</field>
</record>
<record model="basic.calendar.attributes" id="field_alarm_trigger_related">
<field name="name">trigger_related</field>
<field name="type">alarm</field>
</record>
</data>
</openerp>
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_calendar_form" model="ir.ui.view">
<field name="name">Basic Calendar</field>
<field name="model">basic.calendar</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Basic Calendar">
<field name="name" required="1" select="1" />
<field name="active" select="1" />
<field name="line_ids" mode="form,tree" colspan="4" nolabel="1">
<form string="Calendar Lines">
<field name="name" required="1" select="1" />
<field name="object_id" required="1" select="1" />
<field name="domain" select="1" />
<field name="mapping_ids" select="1" colspan="4" nolabel="1">
<tree string="Attributes Mapping" editable="bottom">
<field name="name" required="1" domain="[('type', '=', parent.name)]"/>
<field name="fn" select="1" />
<field name="field_id" select="1" domain="[('model_id', '=', parent.object_id)]" />
<field name="expr" />
</tree>
<form string="Attributes Mapping">
<field name="name" select="1" required="1" domain="[('type', '=', parent.name)]"/>
<field name="field_id" select="1" domain="[('model_id', '=', parent.object_id)]"
required="1" />
<field name="fn" select="1" required="1" />
<field name="expr" />
<separator string="Value Mapping" colspan="4" />
<field name="mapping" select="1" colspan="4" nolabel="1" />
</form>
</field>
</form>
<tree string="Attributes Mapping" editable="bottom">
<field name="name" select="1" />
<field name="object_id" select="1" />
</tree>
</field>
</form>
</field>
</record>
<record id="action_view_calendar" model="ir.actions.act_window">
<field name="name">Calendar</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">basic.calendar</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem id="menu_calendar_configuration" name="Calendar"
parent="base.menu_base_config" sequence="10" />
<menuitem id="menu_calendar"
name="Calendar" parent="menu_calendar_configuration"
sequence="5" action="action_view_calendar" />
</data>
</openerp>
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<wizard string="Import .ics File" model="basic.calendar"
name="calendar.event.import" id="wizard_cal_event_import" />
<wizard string="Subscribe to a Remote calendar"
model="basic.calendar" name="calendar.event.subscribe"
id="wizard_cal_event_subscribe" multi="True" />
<wizard string="Export .ics File" model="basic.calendar"
name="calendar.event.export" id="wizard_cal_event_export" />
<wizard string="Edit this event" model="basic.calendar.event"
name="calendar.event.edit.this" id="wizard_edit_this_event"
menu="False" />
</data>
</openerp>
@@ -0,0 +1,6 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_basic_calendar_all","basic.calendar","model_basic_calendar",,1,1,1,1
"access_basic_calendar_event_all","basic.calendar.event","model_basic_calendar_event",,1,1,1,1
"access_basic_calendar_attendee_all","basic.calendar.attendee","model_basic_calendar_attendee",,1,1,1,1
"access_calendar_todo_all","basic.calendar.todo","model_basic_calendar_todo",,1,1,1,1
"access_basic_calendar_alarm_all","basic.calendar.alarm","model_basic_calendar_alarm",,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_basic_calendar_all basic.calendar model_basic_calendar 1 1 1 1
3 access_basic_calendar_event_all basic.calendar.event model_basic_calendar_event 1 1 1 1
4 access_basic_calendar_attendee_all basic.calendar.attendee model_basic_calendar_attendee 1 1 1 1
5 access_calendar_todo_all basic.calendar.todo model_basic_calendar_todo 1 1 1 1
6 access_basic_calendar_alarm_all basic.calendar.alarm model_basic_calendar_alarm 1 1 1 1
@@ -45,17 +45,20 @@ class event_edit_this(wizard.interface):
'alarm_id': {'string': 'Reminder', 'type': 'many2one', 'relation': 'res.alarm'},
}
def _default_values(self, cr, uid, data, context):
def _default_values(self, cr, uid, data, context=None):
model = data.get('model')
model_obj = pooler.get_pool(cr.dbname).get(model)
event = model_obj.read(cr, uid, data['id'], ['name', 'location', 'date',\
'date_deadline', 'alarm_id'])
event = model_obj.read(cr, uid, data['id'], ['name', 'location', 'alarm_id'])
event.update({
'date': context.get('date'),
'date_deadline': context.get('date_deadline')
})
return event
def _modify_this(self, cr, uid, datas, *args):
def _modify_this(self, cr, uid, datas, context=None):
model = datas.get('model')
model_obj = pooler.get_pool(cr.dbname).get(model)
new_id = model_obj.modify_this(cr, uid, [datas['id']], datas['form'])
new_id = model_obj.modify_this(cr, uid, [datas['id']], datas['form'], context)
value = {
'name': 'New event',
'view_type': 'form',
@@ -51,15 +51,16 @@ class cal_event_export_wizard(wizard.interface):
model_obj = pooler.get_pool(cr.dbname).get(model)
calendar = model_obj.export_cal(cr, uid, data['ids'], context)
return {'file_path': base64.encodestring(calendar), \
'name': 'OpenERP Events.ics'}
'name': 'OpenERP %s.ics' % (model_obj._description)}
states = {
'init': {
'actions': [_process_export_ics],
'result': {'type': 'form', 'arch':form1, 'fields':form1_fields, \
'state': [('end', '_Cancel', 'gtk-cancel'), ('end', 'Ok', 'gtk-ok')]}},
'state': [('end', '_Cancel', 'gtk-cancel'), \
('end', 'Ok', 'gtk-ok')]}},
}
cal_event_export_wizard('caldav.event.export')
cal_event_export_wizard('calendar.event.export')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -54,7 +54,7 @@ class cal_event_import_wizard(wizard.interface):
def _process_imp_ics(self, cr, uid, data, context=None):
model = data.get('model')
model_obj = pooler.get_pool(cr.dbname).get(model)
vals = model_obj.import_cal(cr, uid, data['form']['file_path'], context)
vals = model_obj.import_cal(cr, uid, data['form']['file_path'], data['id'], context)
global cnt
cnt = 0
if vals:
@@ -81,6 +81,6 @@ class cal_event_import_wizard(wizard.interface):
},
}
cal_event_import_wizard('caldav.event.import')
cal_event_import_wizard('calendar.event.import')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -90,6 +90,6 @@ class cal_event_subscribe_wizard(wizard.interface):
},
}
cal_event_subscribe_wizard('caldav.event.subscribe')
cal_event_subscribe_wizard('calendar.event.subscribe')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+15 -2
View File
@@ -39,6 +39,13 @@ class res_partner_contact(osv.osv):
res = [(r['shortcut'], r['name']) for r in res if r['domain']=='contact']
return res
def _main_job(self, cr, uid, ids, fields, arg, context=None):
res = dict.fromkeys(ids, False)
for contact in self.browse(cr, uid, ids, context):
if contact.job_ids:
res[contact.id] = contact.job_ids[0].name_get()[0]
return res
_columns = {
'name': fields.char('Last Name', size=30,required=True),
'first_name': fields.char('First Name', size=30),
@@ -52,7 +59,7 @@ class res_partner_contact(osv.osv):
'active' : fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the partner contact without removing it."),
'partner_id':fields.related('job_ids','address_id','partner_id',type='many2one', relation='res.partner', string='Main Employer'),
'function_id':fields.related('job_ids','function_id',type='many2one', relation='res.partner.function', string='Main Function'),
'job_id':fields.related('job_ids',type='many2one', relation='res.partner.job', string='Main Job'),
'job_id': fields.function(_main_job, method=True, type='many2one', relation='res.partner.job', string='Main Job'),
'email': fields.char('E-Mail', size=240),
'comment' : fields.text('Notes', translate=True),
'photo' : fields.binary('Image'),
@@ -81,6 +88,12 @@ 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):
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={}):
if not len(ids):
@@ -155,7 +168,7 @@ class res_partner_job(osv.osv):
_defaults = {
'sequence_contact' : lambda *a: 0,
'state' : lambda *a: 'current',
'state' : lambda *a: 'current',
}
res_partner_job()
+8 -11
View File
@@ -48,16 +48,13 @@
<field name="job_ids" colspan="4" nolabel="1" mode="tree,form">
<form string="Functions and Addresses">
<group string="Partner" colspan="2" col="4">
<field name="name" colspan="4"/>
<field name="address_id" colspan="4"/>
<field name="function_id" colspan="4"/>
<field name="fax"/>
<field name="extension"/>
<field name="other"/>
<field name="date_start" />
<field name="date_stop" />
<field name="state" />
<field name="sequence_contact" />
<field name="function_id"/>
<field name="address_id" context="{'address_partner_id': name}"/>
<field name="name"/>
<field name="date_start" />
<field name="date_stop" />
<field name="state" />
<field name="sequence_contact" />
</group>
<group string="Communication" colspan="2" col="2">
<field name="phone"/>
@@ -385,7 +382,7 @@
<notebook>
<page string="General">
<field name="name" select="1"/>
<field name="address_id" 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" select="2" widget="email"/>
+9 -9
View File
@@ -7,30 +7,30 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2009-02-03 17:44+0000\n"
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
"PO-Revision-Date: 2010-01-24 18:48+0000\n"
"Last-Translator: Oktay Altunergil <oktaya@gmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-12-16 05:08+0000\n"
"X-Launchpad-Export-Date: 2010-01-25 04:48+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: base_contact
#: field:res.partner.job,sequence_contact:0
msgid "Contact Seq."
msgstr ""
msgstr "Bağlantı Sırası"
#. module: base_contact
#: model:ir.model,name:base_contact.model_res_partner_contact
msgid "res.partner.contact"
msgstr ""
msgstr "res.partner.contact"
#. module: base_contact
#: constraint:ir.model:0
msgid ""
"The Object name must start with x_ and not contain any special character !"
msgstr ""
msgstr "Nesne adı x_ ile başlamalı ve özel karakterler içermemelidir!"
#. module: base_contact
#: field:res.partner.job,function_id:0
@@ -45,7 +45,7 @@ msgstr ""
#: view:res.partner.address:0
#: field:res.partner.address,job_ids:0
msgid "Contacts"
msgstr "Kişiler"
msgstr "Bağlantılar"
#. module: base_contact
#: field:res.partner.job,sequence_partner:0
@@ -55,7 +55,7 @@ msgstr ""
#. module: base_contact
#: selection:res.partner.job,state:0
msgid "Current"
msgstr ""
msgstr "Güncel"
#. module: base_contact
#: field:res.partner.contact,first_name:0
@@ -70,7 +70,7 @@ msgstr ""
#. module: base_contact
#: field:res.partner.job,other:0
msgid "Other"
msgstr ""
msgstr "Diğer"
#. module: base_contact
#: model:process.transition,name:base_contact.process_transition_contacttofunction0
@@ -56,7 +56,7 @@ def _info_default(self, cr, uid, data, context):
cr.execute('select max(create_date) from ir_model_data')
c=(cr.fetchone())[0].split('.')[0]
c = time.strptime(c,"%Y-%m-%d %H:%M:%S")
sec=c.tm_sec + 1
sec=c.tm_sec!=59 and c.tm_sec + 1
c=(c[0],c[1],c[2],c[3],c[4],sec,c[6],c[7],c[8])
data['form']['check_date']=time.strftime("%Y-%m-%d %H:%M:%S",c)
return data['form']
@@ -108,7 +108,7 @@ class base_module_record_objects(wizard.interface):
('record', 'Record', 'gtk-ok'),
]
}
},
},
'record': {
'actions': [],
'result': {'type':'action','action':_record_objects,'state':'intro'}
@@ -124,7 +124,7 @@ class base_module_record_objects(wizard.interface):
('save', 'Continue', 'gtk-ok'),
]
},
},
},
'save': {
'actions': [inter_call],
'result': {
@@ -64,8 +64,12 @@ class report_creator(osv.osv):
fields = {}
i = 0
for f in report.field_ids:
fields['field'+str(i)] = models[f.field_id.model][f.field_id.name]
i+=1
if f.field_id.model:
fields['field'+str(i)] = models[f.field_id.model][f.field_id.name]
i+=1
else:
fields['column_count'] = {'readonly': True, 'type': 'integer', 'string': 'Count', 'size': 64, 'name': 'column_count'}
return fields
#
@@ -81,8 +85,12 @@ class report_creator(osv.osv):
fields = {}
i = 0
for f in report.field_ids:
fields['field'+str(i)] = models[f.field_id.model][f.field_id.name]
i+=1
if f.field_id.model:
fields['field'+str(i)] = models[f.field_id.model][f.field_id.name]
i+=1
else:
fields['column_count'] = {'readonly': True, 'type': 'integer', 'string': 'Count', 'size': 64, 'name': 'column_count'}
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)
@@ -90,8 +98,12 @@ class report_creator(osv.osv):
i = 0
for f in report.field_ids:
if f.graph_mode==val:
arch += '<field name="%s" select="1"/>' % ('field'+str(i),)
i+=1
if f.field_id.model:
arch += '<field name="%s" select="1"/>' % ('field'+str(i),)
i+=1
else:
arch += '<field name="%s" select="1"/>' % ('column_count',)
elif view_type=='calendar':
required_types = ['date_start','date_delay','color']
set_dict = {'view_type':view_type,'string':report.name}
@@ -99,13 +111,21 @@ class report_creator(osv.osv):
i=0
for f in report.field_ids:
if f.calendar_mode and f.calendar_mode in required_types:
set_dict[f.calendar_mode] = 'field'+str(i)
i+=1
if f.field_id.model:
field_cal = 'field'+str(i)
i+=1
else:
field_cal = 'column_count'
set_dict[f.calendar_mode] = field_cal
del required_types[required_types.index(f.calendar_mode)]
else:
temp_list.append('''<field name="%(name)s" select="1"/>''' % {'name':'field'+str(i)})
i+=1
if f.field_id.model:
temp_list.append('''<field name="%(name)s" select="1"/>''' % {'name':'field'+str(i)})
i+=1
else:
temp_list.append('''<field name="%(name)s" select="1"/>''' % {'name':'column_count'})
arch += '''<%(view_type)s string="%(string)s" date_start="%(date_start)s" ''' %set_dict
if set_dict.get('date_delay',False):
arch +=''' date_delay="%(date_delay)s" '''%set_dict
@@ -121,8 +141,11 @@ class report_creator(osv.osv):
arch += '<%s string="%s">\n' % (view_type, report.name)
i = 0
for f in report.field_ids:
arch += '<field name="%s" select="1"/>' % ('field'+str(i),)
i+=1
if f.field_id.model:
arch += '<field name="%s" select="1"/>' % ('field'+str(i),)
i+=1
else:
arch += '<field name="%s" select="1"/>' % ('column_count',)
arch += '</%s>' % (view_type,)
result = {
'arch': arch,
@@ -166,14 +189,20 @@ class report_creator(osv.osv):
i = 0
fields = {}
for f in report.field_ids:
fields['field'+str(i)] = (f.field_id.model, f.field_id.name)
i+=1
if f.field_id.model:
fields['field'+str(i)] = (f.field_id.model, f.field_id.name)
i+=1
else:
fields['column_count'] = (False, 'Count')
newargs = []
newargs2 = []
for a in args:
res = self.pool.get(fields[a[0]][0])._where_calc(cr, user, [[fields[a[0]][1],a[1],a[2]]], active_test=False, context=context)
newargs+=res[0]
newargs2+=res[1]
if fields[a[0]][0]:
res = self.pool.get(fields[a[0]][0])._where_calc(cr, user, [[fields[a[0]][1],a[1],a[2]]], active_test=False, context=context)
newargs+=res[0]
newargs2+=res[1]
else:
newargs += [("count(*) " + a[1] +" " + str(a[2]))]
ctx = context or {}
ctx['getid'] = True
report = self._sql_query_get(cr, user, [context['report_id']], 'sql_query', None, ctx, where_plus=newargs, limit=limit, offset=offset)
@@ -198,7 +227,7 @@ class report_creator(osv.osv):
filter_list = []
for model in models:
model_dict[model.model] = self.pool.get(model.model)._table
model_list = model_dict.keys()
reference_model_dict = {}
for model in model_dict:
@@ -207,10 +236,22 @@ class report_creator(osv.osv):
rest_list.remove(model)
model_pool = self.pool.get(model)
fields_get = model_pool.fields_get(cr,uid)
fields_filter = dict(filter(lambda x:x[1].get('relation',False)
and x[1].get('relation') in rest_list
and x[1].get('type')=='many2one'
and not (isinstance(model_pool._columns[x[0]],fields.function) or isinstance(model_pool._columns[x[0]],fields.related) or isinstance(model_pool._columns[x[0]],fields.dummy)), fields_get.items()))
model_columns = {}
def _get_inherit_fields(obj):
pool_model = self.pool.get(obj)
#Adding the columns of the model itself
model_columns.update(pool_model._columns)
#Adding the columns of its _inherits
for record in pool_model._inherits.keys():
_get_inherit_fields(record)
_get_inherit_fields(model)
fields_filter = dict(filter(lambda x:x[1].get('relation',False)
and x[1].get('relation') in rest_list
and x[1].get('type')=='many2one'
and not (isinstance(model_columns[x[0]],fields.function) or isinstance(model_columns[x[0]],fields.related)), fields_get.items()))
if fields_filter:
model in model_list and model_list.remove(model)
model_count = reference_model_dict.get(model,False)
@@ -225,9 +266,10 @@ class report_creator(osv.osv):
reference_model_dict[v.get('relation')] = relation_count+1
else:
reference_model_dict[v.get('relation')]=1
str_where = model_dict.get(model)+"."+ k + "=" + model_dict.get(v.get('relation'))+'.id'
where_list.append(str_where)
if k in self.pool.get(model)._columns:
str_where = model_dict.get(model)+"."+ k + "=" + model_dict.get(v.get('relation'))+'.id'
where_list.append(str_where)
if reference_model_dict:
self.model_set_id = model_dict.get(reference_model_dict.keys()[reference_model_dict.values().index(min(reference_model_dict.values()))])
if model_list and not len(model_dict.keys()) == 1:
@@ -250,6 +292,7 @@ class report_creator(osv.osv):
if where_list:
where_list = list(set(where_list))
ret_str+="\n where \n"+" and\n".join(where_list)
ret_str = ret_str.strip()
if filter_list:
@@ -272,12 +315,16 @@ class report_creator(osv.osv):
groupby = []
i = 0
for f in obj.field_ids:
# Allowing to use count(*)
if not f.field_id.model and f.group_method == 'count':
fields.insert(0,('count(*) as column_count'))
continue
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)
@@ -336,6 +383,9 @@ class report_creator(osv.osv):
this_objs = self.browse(cr, uid, ids)
for obj in this_objs:
for fld in obj.field_ids:
# Allowing to use count(*)
if not fld.field_id.model and fld.group_method == 'count':
continue
model_column = self.pool.get(fld.field_id.model)._columns[fld.field_id.name]
if (isinstance(model_column,fields.function) or isinstance(model_column,fields.related)) and not model_column.store:
return False
@@ -347,7 +397,10 @@ class report_creator(osv.osv):
this_objs = self.browse(cr, uid, ids)
for obj in this_objs:
for fld in obj.field_ids:
model_column = self.pool.get(fld.field_id.model)._columns[fld.field_id.name]
# Allowing to use count(*)
if not fld.field_id.model and fld.group_method == 'count':
continue
model_column = self.pool.get(fld.field_id.model)._columns[fld.field_id.name]
if model_column._type not in aggregate_columns and fld.group_method in apply_functions:
return False
return True
@@ -359,6 +412,9 @@ class report_creator(osv.osv):
for obj in this_objs:
if obj.view_type1=='calendar' or obj.view_type2=='calendar' or obj.view_type3=='calendar':
for fld in obj.field_ids:
# Allowing to use count(*)
if not fld.field_id.model and fld.group_method == 'count':
continue
model_column = self.pool.get(fld.field_id.model)._columns[fld.field_id.name]
if fld.calendar_mode in ('date_start','date_end') and model_column._type not in ('date','datetime'):
return False
@@ -67,7 +67,7 @@
</form>
<tree editable="bottom" string="Fields to Display">
<field name="sequence"/>
<field name="field_id" domain="parent.model_ids and [('model_id','in',parent.model_ids[0][2]),('ttype','&lt;&gt;','many2many'),('ttype','&lt;&gt;','one2many')] or []"/>
<field name="field_id" domain="parent.model_ids and [('model_id','in',parent.model_ids[0][2]),('ttype','&lt;&gt;','many2many'),('ttype','&lt;&gt;','one2many')] or []" attrs="{'required':[('group_method','!=','count')]}"/>
<field name="group_method"/>
<field name="graph_mode"/>
<field name="calendar_mode"/>
@@ -25,13 +25,15 @@ import netsvc
import time
import pooler
from osv import osv
from tools.translate import _
class report_creator_open(wizard.interface):
def _open_report(self, cr, uid, data, context):
pool = pooler.get_pool(cr.dbname)
if context.get('report_id',False):
raise wizard.except_wizard(_('UserError'),_('No Wizards available for this object!'))
rep = pool.get('base_report_creator.report').browse(cr, uid, data['id'], context)
view_mode = rep.view_type1
if rep.view_type2:
@@ -22,6 +22,7 @@
import wizard
import netsvc
import pooler
import tools
relation_type=['one2many','many2one','many2many']
char_type = ['char','text','selection']
@@ -121,7 +122,7 @@ def _set_filter_value(self, cr, uid, data, context):
model_pool = pooler.get_pool(cr.dbname).get(model_name)
table_name = model_pool._table
model_name = model_pool._description
if field_type:
if field_type == 'boolean':
if value_data == 1:
@@ -138,12 +139,12 @@ def _set_filter_value(self, cr, uid, data, context):
fields_list = set_field_operator(self,table_name+"."+field_data['name'],field_data['ttype'],form_data['operator'],value_data)
if fields_list:
create_dict = {
'name':model_name + "/" +field_data['field_description'] +" "+ mapping_fields[form_data['operator']] + " " + str(fields_list[2]) + " ",
'expression':' '.join(map(str,fields_list)),
'name':model_name + "/" +field_data['field_description'] +" "+ mapping_fields[form_data['operator']] + " " + tools.ustr(fields_list[2]) + " ",
'expression':' '.join(map(tools.ustr,fields_list)),
'report_id':data['id'],
'condition' : form_data['condition']
}
pooler.get_pool(cr.dbname).get('base_report_creator.report.filter').create(cr,uid,create_dict)
pooler.get_pool(cr.dbname).get('base_report_creator.report.filter').create(cr,uid,create_dict,context)
#end if field_type == 'many2many' and value_data and len(value_data):
# pooler.get_pool(cr.dbname).get('custom.report.filter').create(cr,uid,form_data)
#end if field_type:
+4 -4
View File
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2009-02-03 06:25+0000\n"
"Last-Translator: <>\n"
"PO-Revision-Date: 2010-01-24 18:52+0000\n"
"Last-Translator: Oktay Altunergil <oktaya@gmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-12-16 05:10+0000\n"
"X-Launchpad-Export-Date: 2010-01-25 04:48+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: base_setup
@@ -84,7 +84,7 @@ msgstr ""
#: wizard_field:base_setup.base_setup,init,state_id:0
#: wizard_field:base_setup.base_setup,update,state_id:0
msgid "State"
msgstr ""
msgstr "Eyalet"
#. module: base_setup
#: wizard_view:base_setup.base_setup,finish:0
+1 -1
View File
@@ -37,7 +37,7 @@ This module implements a dashboard for CRM that includes:
'depends': ['board', 'crm', 'report_crm'],
'update_xml': ['board_crm_statistical_view.xml', 'board_crm_view.xml'],
'demo_xml': ['board_crm_demo.xml'],
'installable': False,
'installable': True,
'active': False,
'certificate': '0071599098909',
}
@@ -6,7 +6,7 @@
-->
<record model="ir.ui.view" id="view_crm_lead_stage_graph1">
<field name="name">Leads By Stage - Graph</field>
<field name="model">report.crm.case.section.stage</field>
<field name="model">report.crm.lead.section.stage</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Leads By Stage" type="pie">
@@ -17,12 +17,12 @@
</field>
</record>
<record model="ir.ui.view" id="view_crm_case_categ_graph">
<field name="name">report.crm.case.categ.graph</field>
<field name="model">report.crm.case.categ</field>
<record model="ir.ui.view" id="view_crm_opportunity_categ_graph">
<field name="name">report.crm.opportunity.categ.graph</field>
<field name="model">report.crm.opportunity.categ</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Cases by Sections and Categories" type="bar" orientation="horizontal">
<graph string="Opportunity by Sections and Categories" type="bar" orientation="horizontal">
<field name="categ_id"/>
<field name="nbr" operator="+"/>
<field name="state" group="True"/>
@@ -31,34 +31,27 @@
</record>
<act_window name="Opportunities By Categories"
domain="[('section_id', '=', 'Opportunities'),('state','!=','done'),('state','!=','cancel')]"
res_model="report.crm.case.categ"
domain="[('state','!=','done'),('state','!=','cancel')]"
res_model="report.crm.opportunity.categ"
view_type="form"
view_mode="graph,tree,form"
view_id="view_crm_case_categ_graph"
view_id="view_crm_opportunity_categ_graph"
id="act_oppor_categ"/>
<record model="ir.actions.act_window" id="act_leads_state">
<field name="res_model">report.crm.case.section.stage</field>
<field name="res_model">report.crm.lead.section.stage</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_crm_lead_stage_graph1"/>
<field name="domain">[('section_id', '=', 'Leads'),('state','!=','done'),('state','!=','cancel')]</field>
<field name="domain">[('state','!=','done'),('state','!=','cancel')]</field>
</record>
<act_window name="Jobs Requests Of The Month by Applied Job"
domain="[('section_id', '=', 'Jobs'),('name','=',time.strftime('%Y-%m-01')),('state','!=','done'),('state','!=','cancel')]"
res_model="report.crm.case.categ"
view_type="form"
view_mode="graph,tree,form"
view_id="view_crm_case_categ_graph"
id="act_jobs_categ"/>
<act_window name="Leads Of The Month By User"
domain="[('section_id', '=', 'Leads'),('name','=',time.strftime('%Y-%m-01')),('state','!=','cancel')]"
res_model="report.crm.case.user"
domain="[('month','=',time.strftime('%%m')),('state','!=','cancel')]"
res_model="report.crm.lead.user"
view_type="form"
view_mode="graph,tree,form"
view_id="view_crm_lead_stage_graph1"
id="act_leads_month_user"/>
<record model="ir.ui.view" id="board_crm_statistical_form">
@@ -84,11 +77,6 @@
</child1>
<child2>
<action
string="Jobs Requests Of The Month by Applied Job"
name="%(act_jobs_categ)d"
colspan="4"/>
<action
string="Leads Of The Month By User"
@@ -4,13 +4,13 @@
<record model="board.note.type" id="note_crm_type">
<field name="name">CRM Configuration</field>
</record>
<record model="ir.ui.view" id="view_crm_case_user_graph1">
<field name="name">crm.case.user.graph1</field>
<field name="model">report.crm.case.user</field>
<record model="ir.ui.view" id="view_crm_opportunity_user_graph1">
<field name="name">crm.opportunity.user.graph1</field>
<field name="model">report.crm.opportunity.user</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Cases by User and Section" type="pie">
<graph string="Opportunities by User and Section" type="pie">
<field name="state"/>
<field name="nbr" operator="+"/>
</graph>
@@ -18,21 +18,21 @@
</record>
<record model="ir.actions.act_window" id="act_my_leads">
<field name="res_model">crm.case</field>
<field name="res_model">crm.lead</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="crm.crm_case_tree_view_leads"/>
<field name="domain">[('section_id.name', '=', 'Prospects'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
<field name="domain">[('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
</record>
<record model="ir.actions.act_window" id="act_my_meetings">
<field name="res_model">crm.case</field>
<field name="res_model">crm.meeting</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="crm.crm_case_tree_view_meet"/>
<field name="domain">[('section_id.name', '=', 'Meetings'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
<field name="domain">[('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
</record>
<act_window name="My Cases"
domain="[('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]"
res_model="crm.case"
@@ -41,27 +41,19 @@
id="act_my_cases"/>
<record model="ir.actions.act_window" id="act_my_leads_stage">
<field name="res_model">report.crm.case.section.stage</field>
<field name="res_model">report.crm.lead.section.stage</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_crm_lead_stage_graph1"/>
<field name="domain">[('section_id.name', '=', 'Leads'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
<field name="domain">[('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
</record>
<record model="ir.actions.act_window" id="act_sales_pipeline">
<field name="res_model">report.crm.case.user</field>
<field name="res_model">report.crm.opportunity.user</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_crm_case_user_graph1"/>
<field name="domain">[('section_id.name', '=', 'Opportunities'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
</record>
<record model="ir.actions.act_window" id="act_jobs_requests">
<field name="res_model">report.crm.case.user</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_crm_case_user_graph1"/>
<field name="domain">[('section_id.name','=','Jobs'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
<field name="view_id" ref="view_crm_opportunity_user_graph1"/>
<field name="domain">[('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
</record>
<record model="ir.ui.view" id="board_crm_form">
@@ -86,7 +78,7 @@
name="%(act_my_meetings)d"
height="150"
colspan="4"/>
<action
string="My Cases"
name="%(act_my_cases)d"
-6
View File
@@ -1,6 +0,0 @@
[MOD] Small changes
-------------- This line and the following will be ignored --------------
modified:
account/__init__.py
+1 -3
View File
@@ -19,8 +19,6 @@
#
##############################################################################
import calendar
import common
import wizard
import caldav
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+4 -7
View File
@@ -24,16 +24,14 @@
"name" : "CalDAV",
"version" : "1.0",
"depends" : [
"base",
"base_calendar",
],
'description': """
To develop a full featured caldav system that support:
- access through webdav (based on xrg code)
Full featured caldav system that support:
- alerts (create requests)
- recurring events (*)
- invitations to others people (exactly like sunbird)
- availabilities of users/calendars
- full day events""",
""",
"author" : "Tiny",
'category': 'Generic Modules/Others',
'website': 'http://www.openerp.com',
@@ -43,8 +41,7 @@
"demo_xml" : [],
"update_xml" : [
'security/ir.model.access.csv',
'caldav_view.xml',
'caldav_wizard.xml',
'caldav_view.xml'
],
"installable" : True,
"active" : False,
@@ -19,14 +19,15 @@
#
##############################################################################
from datetime import datetime, timedelta
from datetime import datetime, timedelta
from dateutil import parser
from osv import fields, osv
from base_calendar import base_calendar
from service import web_services
from tools.translate import _
import base64
import pooler
import re
import time
@@ -56,31 +57,6 @@ def real_id2caldav_id(real_id, recurrent_date):
return '%d-%s' % (real_id, recurrent_date)
return real_id
def uid2openobjectid(cr, uidval, oomodel, rdate):
__rege = re.compile(r'OpenObject-([\w|\.]+)_([0-9]+)@(\w+)$')
wematch = __rege.match(uidval.encode('utf8'))
if not wematch:
return (False, None)
else:
model, id, dbname = wematch.groups()
if (not model == oomodel) or (not dbname == cr.dbname):
return (False, None)
qry = 'select distinct(id) from %s' % model.replace('.', '_')
if rdate:
qry += " where recurrent_id='%s'" % (rdate)
cr.execute(qry)
r_id = cr.fetchone()
if r_id:
return (id, r_id[0])
cr.execute(qry)
ids = map(lambda x: str(x[0]), cr.fetchall())
if id in ids:
return (id, None)
return False
def openobjectid2uid(cr, uidval, oomodel):
value = 'OpenObject-%s_%s@%s' % (oomodel, uidval, cr.dbname)
return value
def _links_get(self, cr, uid, context={}):
obj = self.pool.get('res.request.link')
@@ -93,19 +69,7 @@ class calendar_attendee(osv.osv):
_description = 'Attendee information'
_rec_name = 'cutype'
__attribute__ = {
'cutype': {'field':'cutype', 'type':'text'},
'member': {'field':'member', 'type':'text'},
'role': {'field':'role', 'type':'selection'},
'partstat': {'field':'state', 'type':'text'},
'rsvp': {'field':'rsvp', 'type':'boolean'},
'delegated-to': {'field':'delegated_to', 'type':'text'},
'delegated-from': {'field':'delegated_from', 'type':'text'},
'sent-by': {'field':'sent_by', 'type':'text'},
'cn': {'field':'cn', 'type':'text'},
'dir': {'field':'dir', 'type':'text'},
'language': {'field':'language', 'type':'text'},
}
__attribute__ = {}
def _get_address(self, name=None, email=None):
if name and email:
@@ -255,7 +219,7 @@ calendar_attendee()
class res_alarm(osv.osv):
_name = 'res.alarm'
_description = 'basic alarm information'
_description = 'Basic Alarm Information'
_columns = {
'name':fields.char('Name', size=256, required=True),
'trigger_occurs': fields.selection([('before', 'Before'), ('after', 'After')], \
@@ -282,8 +246,8 @@ are both optional, but if one occurs, so MUST the other"""),
def do_alarm_create(self, cr, uid, ids, model, date, context={}):
alarm_obj = self.pool.get('calendar.alarm')
model_obj = self.pool.get('ir.model')
model_id = model_obj.search(cr, uid, [('model', '=', model)])[0]
ir_obj = self.pool.get('ir.model')
model_id = ir_obj.search(cr, uid, [('model', '=', model)])[0]
model_obj = self.pool.get(model)
for data in model_obj.browse(cr, uid, ids):
@@ -309,8 +273,8 @@ are both optional, but if one occurs, so MUST the other"""),
}
alarm_id = alarm_obj.create(cr, uid, vals)
cr.execute('Update %s set caldav_alarm_id=%s, alarm_id=%s \
where id=%s' % (model.replace('.', '_'), \
alarm_id, basic_alarm.id, data.id))
where id=%s' % (model_obj._table, \
alarm_id, basic_alarm.id, data.id))
cr.commit()
return True
@@ -323,8 +287,8 @@ are both optional, but if one occurs, so MUST the other"""),
alarm_ids = alarm_obj.search(cr, uid, [('model_id', '=', model_id), ('res_id', '=', datas.id)])
if alarm_ids and len(alarm_ids):
alarm_obj.unlink(cr, uid, alarm_ids)
cr.execute('Update %s set caldav_alarm_id=NULL, \
alarm_id=NULL where id=%s' % (self._table, datas.id))
cr.execute('Update %s set caldav_alarm_id=NULL, alarm_id=NULL\
where id=%s' % (model_obj._table, datas.id))
cr.commit()
return True
@@ -334,19 +298,7 @@ class calendar_alarm(osv.osv):
_name = 'calendar.alarm'
_description = 'Event alarm information'
_inherits = {'res.alarm': "alarm_id"}
__attribute__ = {
'action': {'field': 'action', 'type': 'text'},
'description': {'field': 'name', 'type': 'text'},
'summary': {'field': 'description', 'type': 'text'},
'attendee': {'field': 'attendee_ids', 'type': 'text'},
'trigger_related': {'field': 'trigger_related', 'type': 'text'},
'trigger_duration': {'field': 'trigger_duration', 'type': 'text'},
'trigger_occurs': {'field': 'trigger_occurs', 'type': 'text'},
'trigger_interval': {'field': 'trigger_interval', 'type': 'text'},
'duration': {'field': 'duration', 'type': 'text'},
'repeat': {'field': 'repeat', 'type': 'text'},
'attach': {'field': 'attach', 'type': 'text'},
}
__attribute__ = {}
_columns = {
'alarm_id': fields.many2one('res.alarm', 'Basic Alarm', ondelete='cascade'),
@@ -458,41 +410,7 @@ calendar_alarm()
class calendar_event(osv.osv):
_name = "calendar.event"
_description = "Calendar Event"
#kept it until fields mapping implemented
__attribute__ = {
'class': {'field': 'class', 'type': 'selection'},
'created': {'field': 'create_date', 'type': 'datetime'},
'description': {'field': 'description', 'type': 'text'},
'dtstart': {'field': 'date', 'type': 'datetime'},
'location': {'field': 'location', 'type': 'text'},
#'organizer': {'field': 'partner_id', 'sub-field': 'name', 'type': 'many2one'},
'priority': {'field': 'priority', 'type': 'int'},
'dtstamp': {'field': 'date', 'type': 'datetime'},
'seq': None,
'status': {'field': 'state', 'type': 'selection', 'mapping': \
{'tentative': 'draft', 'confirmed': 'open', \
'cancelled': 'cancel'}},
'summary': {'field': 'name', 'type': 'text'},
'transp': {'field': 'transparent', 'type': 'text'},
'uid': {'field': 'id', 'type': 'text'},
'url': {'field': 'caldav_url', 'type': 'text'},
'recurrence-id': {'field': 'recurrent_id', 'type': 'datetime'},
'attendee': {'field': 'attendee_ids', 'type': 'many2many', 'object': 'calendar.attendee'},
'categories': {'field': 'categ_id', 'type': 'many2one', 'object': 'crm.meeting.categ'},
'comment': None,
'contact': None,
'exdate': {'field': 'exdate', 'type': 'datetime'},
'exrule': {'field': 'exrule', 'type': 'text'},
'rstatus': None,
'related': None,
'resources': None,
'rdate': None,
'rrule': {'field': 'rrule', 'type': 'text'},
'x-openobject-model': {'value': _name, 'type': 'text'},
'dtend': {'field': 'date_deadline', 'type': 'datetime'},
'valarm': {'field': 'caldav_alarm_id', 'type': 'many2one', 'object': 'calendar.alarm'},
}
__attribute__ = {}
def onchange_rrule_type(self, cr, uid, ids, rtype, *args, **argv):
if rtype == 'none' or not rtype:
@@ -525,9 +443,12 @@ class calendar_event(osv.osv):
return True
_columns = {
'id': fields.integer('ID'),
'sequence': fields.integer('Sequence'),
'name': fields.char('Description', size=64, required=True),
'date': fields.datetime('Date'),
'date_deadline': fields.datetime('Deadline'),
'create_date': fields.datetime('Created' ,readonly=True),
'duration': fields.function(_get_duration, method=True, \
fnct_inv=_set_duration, string='Duration'),
'description': fields.text('Your action'),
@@ -561,31 +482,20 @@ rule or repeating pattern for anexception to a recurrence set"),
ids = map(lambda x: caldav_id2real_id(x), ids)
event_data = self.read(cr, uid, ids)
event_obj = self.pool.get('basic.calendar.event')
event = self.pool.get('calendar.event')
event_obj.__attribute__.update(event.__attribute__)
ical = event_obj.export_ical(cr, uid, event_data, context={'model': self._name})
ical = event_obj.export_cal(cr, uid, event_data, context={'model': self._name})
cal_val = ical.serialize()
cal_val = cal_val.replace('"', '').strip()
return cal_val
def import_cal(self, cr, uid, data, context={}):
file_content = base64.decodestring(data)
def import_cal(self, cr, uid, data, data_id=None, context={}):
event_obj = self.pool.get('basic.calendar.event')
event = self.pool.get('calendar.event')
event_obj.__attribute__.update(event.__attribute__)
attendee_obj = self.pool.get('basic.calendar.attendee')
attendee = self.pool.get('calendar.attendee')
attendee_obj.__attribute__.update(attendee.__attribute__)
alarm_obj = self.pool.get('basic.calendar.alarm')
alarm = self.pool.get('calendar.alarm')
alarm_obj.__attribute__.update(alarm.__attribute__)
vals = event_obj.import_ical(cr, uid, file_content)
vals = event_obj.import_cal(cr, uid, data)
return self.check_import(cr, uid, vals, context=context)
def check_import(self, cr, uid, vals, context={}):
ids = []
for val in vals:
exists, r_id = uid2openobjectid(cr, val['id'], self._name, \
exists, r_id = base_calendar.uid2openobjectid(cr, val['id'], self._name, \
val.get('recurrent_id'))
if val.has_key('create_date'): val.pop('create_date')
val['caldav_url'] = context.get('url') or ''
@@ -601,7 +511,7 @@ rule or repeating pattern for anexception to a recurrence set"),
event_id = self.create(cr, uid, val)
ids.append(event_id)
return ids
def modify_this(self, cr, uid, ids, defaults, context=None, *args):
datas = self.read(cr, uid, ids[0], context=context)
date = datas.get('date')
@@ -716,7 +626,7 @@ rule or repeating pattern for anexception to a recurrence set"),
if not id in new_ids:
new_ids.append(id)
res = super(calendar_event, self).write(cr, uid, new_ids, vals, context=context)
if vals.get('alarm_id'):
if vals.has_key('alarm_id'):
alarm_obj = self.pool.get('res.alarm')
alarm_obj.do_alarm_create(cr, uid, new_ids, self._name, 'date')
return res
@@ -817,65 +727,20 @@ class calendar_todo(osv.osv):
'duration': fields.integer('Duration'),
}
#kept it until fields mapping implemented
__attribute__ = {
'class': {'field': 'class', 'type': 'text'},
'completed': {'field': 'date_close', 'type': 'datetime'},
# 'created': {'field': 'field', 'type': 'text'},
'description': {'field': 'description', 'type': 'text'},
# 'dtstamp': {'field': 'field', 'type': 'text'},
'dtstart': {'field': 'date_start', 'type': 'datetime'},
'duration': {'field': 'planned_hours', 'type': 'timedelta'},
'due': {'field': 'date_deadline', 'type': 'datetime'},
# 'geo': {'field': 'field', 'type': 'text'},
# 'last-mod ': {'field': 'field', 'type': 'text'},
'location': {'field': 'location', 'type': 'text'},
'organizer': {'field': 'partner_id', 'type': 'many2one', 'object': 'res.partner'},
'percent': {'field': 'progress_rate', 'type': 'int'},
'priority': {'field': 'priority', 'type': 'text'},
# 'recurid': {'field': 'field', 'type': 'text'},
'seq': {'field': 'sequence', 'type': 'text'},
'status': {'field': 'state', 'type': 'selection', \
'mapping': {'needs-action': 'draft', \
'completed': 'done', 'in-process': 'open', \
'cancelled': 'cancelled'}},
'summary': {'field': 'name', 'type': 'text'},
'uid': {'field': 'id', 'type': 'int'},
'url': {'field': 'caldav_url', 'type': 'text'},
# 'attach': {'field': 'field', 'type': 'text'},
'attendee': {'field': 'attendee_ids', 'type': 'many2many', 'object': 'calendar.attendee'},
'comment': {'field': 'notes', 'type': 'text'},
# 'contact': {'field': 'field', 'type': 'text'},
'exdate': {'field':'exdate', 'type':'datetime'},
'exrule': {'field':'exrule', 'type':'text'},
# 'rstatus': {'field': 'field', 'type': 'text'},
# 'related': {'field': 'field', 'type': 'text'},
# 'resources': {'field': 'field', 'type': 'text'},
# 'rdate': {'field': 'field', 'type': 'text'},
'rrule': {'field': 'rrule', 'type': 'text'},
'valarm': {'field':'caldav_alarm_id', 'type':'many2one', 'object': 'calendar.alarm'},
}
__attribute__ = {}
def import_cal(self, cr, uid, data, context={}):
file_content = base64.decodestring(data)
def import_cal(self, cr, uid, data, data_id=None, context={}):
todo_obj = self.pool.get('basic.calendar.todo')
todo = self.pool.get('calendar.todo')
todo_obj.__attribute__.update(todo.__attribute__)
attendee_obj = self.pool.get('basic.calendar.attendee')
crm_attendee = self.pool.get('calendar.attendee')
attendee_obj.__attribute__.update(crm_attendee.__attribute__)
alarm_obj = self.pool.get('basic.calendar.alarm')
crm_alarm = self.pool.get('calendar.alarm')
alarm_obj.__attribute__.update(crm_alarm.__attribute__)
vals = todo_obj.import_ical(cr, uid, file_content)
vals = todo_obj.import_cal(cr, uid, data)
return self.check_import(cr, uid, vals, context=context)
def check_import(self, cr, uid, vals, context={}):
ids = []
for val in vals:
obj_tm = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.project_time_mode_id
if not val.has_key('planned_hours'):
# 'Computes duration' in days
start = datetime.strptime(val['date_start'], '%Y-%m-%d %H:%M:%S')
start = datetime.strptime(val['date'], '%Y-%m-%d %H:%M:%S')
end = datetime.strptime(val['date_deadline'], '%Y-%m-%d %H:%M:%S')
diff = end - start
plan = (diff.seconds/float(86400) + diff.days) * obj_tm.factor
@@ -885,14 +750,16 @@ class calendar_todo(osv.osv):
hours = (val['planned_hours'].seconds / float(3600)) + \
(val['planned_hours'].days * 24)
val['planned_hours'] = hours
exists, r_id = uid2openobjectid(cr, val['id'], self._name, val.get('recurrent_id'))
exists, r_id = base_calendar.uid2openobjectid(cr, val['id'], self._name, val.get('recurrent_id'))
val.pop('id')
if exists:
self.write(cr, uid, [exists], val)
ids.append(exists)
else:
task_id = self.create(cr, uid, val)
return {'count': len(vals)}
ids.append(task_id)
return ids
def export_cal(self, cr, uid, ids, context={}):
task_datas = self.read(cr, uid, ids, [], context ={'read': True})
tasks = []
@@ -901,18 +768,7 @@ class calendar_todo(osv.osv):
task.pop('planned_hours')
tasks.append(task)
todo_obj = self.pool.get('basic.calendar.todo')
todo = self.pool.get('calendar.todo')
todo_obj.__attribute__.update(todo.__attribute__)
attendee_obj = self.pool.get('basic.calendar.attendee')
attendee = self.pool.get('calendar.attendee')
attendee_obj.__attribute__.update(attendee.__attribute__)
alarm_obj = self.pool.get('basic.calendar.alarm')
alarm = self.pool.get('calendar.alarm')
alarm_obj.__attribute__.update(alarm.__attribute__)
ical = todo_obj.export_ical(cr, uid, tasks, {'model': 'project.task'})
ical = todo_obj.export_cal(cr, uid, tasks, context={'model': self._name})
calendar_val = ical.serialize()
calendar_val = calendar_val.replace('"', '').strip()
return calendar_val
+431
View File
@@ -130,5 +130,436 @@
<field eval="'(False,)'" name="args" />
</record>
<record model="basic.calendar.lines" id="calendar_lines_event">
<field name="name">vevent</field>
<field name="calendar_id" ref="base_calendar.basic_calendar1" />
<field name="object_id" search="[('model','=','calendar.event')]" />
</record>
<record model="basic.calendar.lines" id="calendar_lines_todo">
<field name="name">vtodo</field>
<field name="calendar_id" ref="base_calendar.basic_calendar1" />
<field name="object_id" search="[('model','=','calendar.todo')]" />
</record>
<record model="basic.calendar.lines" id="calendar_lines_alarm">
<field name="name">alarm</field>
<field name="calendar_id" ref="base_calendar.basic_calendar1" />
<field name="object_id" search="[('model','=','calendar.alarm')]" />
</record>
<record model="basic.calendar.lines" id="calendar_lines_attendee">
<field name="name">attendee</field>
<field name="calendar_id" ref="base_calendar.basic_calendar1" />
<field name="object_id" search="[('model','=','calendar.attendee')]" />
</record>
<record model="basic.calendar.fields" id="map_event_1">
<field name="name" ref="base_calendar.field_event_uid"/>
<field name="type_id" ref="caldav.calendar_lines_event" />
<field name="field_id" search="[('name','=','id'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_2">
<field name="name" ref="base_calendar.field_event_recurrence-id"/>
<field name="type_id" ref="caldav.calendar_lines_event" />
<field name="field_id" search="[('name','=','recurrent_id'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_4">
<field name="name" ref="base_calendar.field_event_attendee"/>
<field name="type_id" ref="caldav.calendar_lines_event" />
<field name="field_id" search="[('name','=','attendee_ids'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_5">
<field name="name" ref="base_calendar.field_event_rrule"/>
<field name="type_id" ref="caldav.calendar_lines_event" />
<field name="field_id" search="[('name','=','rrule'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_6">
<field name="name" ref="base_calendar.field_event_dtend"/>
<field name="type_id" ref="caldav.calendar_lines_event" />
<field name="field_id" search="[('name','=','date_deadline'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_7">
<field name="name" ref="base_calendar.field_event_valarm"/>
<field name="type_id" ref="caldav.calendar_lines_event" />
<field name="field_id" search="[('name','=','caldav_alarm_id'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_8">
<field name="name" ref="base_calendar.field_event_priority"/>
<field name="type_id" ref="caldav.calendar_lines_event" />
<field name="field_id" search="[('name','=','priority'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_9">
<field name="name" ref="base_calendar.field_event_location"/>
<field name="type_id" ref="caldav.calendar_lines_event" />
<field name="field_id" search="[('name','=','location'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_10">
<field name="name" ref="base_calendar.field_event_exrule"/>
<field name="type_id" ref="caldav.calendar_lines_event" />
<field name="field_id" search="[('name','=','exrule'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_11">
<field name="name" ref="base_calendar.field_event_status"/>
<field name="type_id" ref="caldav.calendar_lines_event" />
<field name="field_id" search="[('name','=','state'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_12">
<field name="name" ref="base_calendar.field_event_exdate"/>
<field name="type_id" ref="caldav.calendar_lines_event" />
<field name="field_id" search="[('name','=','exdate'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_13">
<field name="name" ref="base_calendar.field_event_dtstamp"/>
<field name="type_id" ref="caldav.calendar_lines_event" />
<field name="field_id" search="[('name','=','date'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_14">
<field name="name" ref="base_calendar.field_event_description"/>
<field name="type_id" ref="caldav.calendar_lines_event" />
<field name="field_id" search="[('name','=','description'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_15">
<field name="name" ref="base_calendar.field_event_dtstart"/>
<field name="type_id" ref="caldav.calendar_lines_event" />
<field name="field_id" search="[('name','=','date'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_16">
<field name="name" ref="base_calendar.field_event_class"/>
<field name="type_id" ref="caldav.calendar_lines_event" />
<field name="field_id" search="[('name','=','class'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_18">
<field name="name" ref="base_calendar.field_event_created"/>
<field name="type_id" ref="caldav.calendar_lines_event" />
<field name="field_id" search="[('name','=','create_date'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_19">
<field name="name" ref="base_calendar.field_event_url"/>
<field name="type_id" ref="caldav.calendar_lines_event" />
<field name="field_id" search="[('name','=','caldav_url'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_20">
<field name="name" ref="base_calendar.field_event_summary"/>
<field name="type_id" ref="caldav.calendar_lines_event" />
<field name="field_id" search="[('name','=','name'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_1">
<field name="name" ref="base_calendar.field_todo_status"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','state'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_2">
<field name="name" ref="base_calendar.field_todo_exdate"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','exdate'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_3">
<field name="name" ref="base_calendar.field_todo_attendee"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','attendee_ids'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_4">
<field name="name" ref="base_calendar.field_todo_valarm"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','caldav_alarm_id'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_5">
<field name="name" ref="base_calendar.field_todo_description"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','description'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_6">
<field name="name" ref="base_calendar.field_todo_seq"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','sequence'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_7">
<field name="name" ref="base_calendar.field_todo_url"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','caldav_url'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_9">
<field name="name" ref="base_calendar.field_todo_percent"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','progress_rate'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_11">
<field name="name" ref="base_calendar.field_todo_summary"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','name'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_12">
<field name="name" ref="base_calendar.field_todo_priority"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','priority'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_13">
<field name="name" ref="base_calendar.field_todo_location"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','location'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_14">
<field name="name" ref="base_calendar.field_todo_exrule"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','exrule'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_15">
<field name="name" ref="base_calendar.field_todo_duration"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','planned_hours'),('model_id.model','=','calendar.todo')]" />
<field name="fn">hours</field>
</record>
<record model="basic.calendar.fields" id="map_todo_16">
<field name="name" ref="base_calendar.field_todo_dtstart"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','date'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_17">
<field name="name" ref="base_calendar.field_todo_rrule"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','rrule'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_18">
<field name="name" ref="base_calendar.field_todo_class"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','class'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_19">
<field name="name" ref="base_calendar.field_todo_uid"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','id'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_1">
<field name="name" ref="base_calendar.field_alarm_attendee"/>
<field name="type_id" ref="caldav.calendar_lines_alarm" />
<field name="field_id" search="[('name','=','attendee_ids'),('model_id.model','=','calendar.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_2">
<field name="name" ref="base_calendar.field_alarm_trigger_duration"/>
<field name="type_id" ref="caldav.calendar_lines_alarm" />
<field name="field_id" search="[('name','=','trigger_duration'),('model_id.model','=','res.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_3">
<field name="name" ref="base_calendar.field_alarm_description"/>
<field name="type_id" ref="caldav.calendar_lines_alarm" />
<field name="field_id" search="[('name','=','name'),('model_id.model','=','calendar.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_4">
<field name="name" ref="base_calendar.field_alarm_attach"/>
<field name="type_id" ref="caldav.calendar_lines_alarm" />
<field name="field_id" search="[('name','=','attach'),('model_id.model','=','calendar.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_5">
<field name="name" ref="base_calendar.field_alarm_trigger_occurs"/>
<field name="type_id" ref="caldav.calendar_lines_alarm" />
<field name="field_id" search="[('name','=','trigger_occurs'),('model_id.model','=','res.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_6">
<field name="name" ref="base_calendar.field_alarm_trigger_interval"/>
<field name="type_id" ref="caldav.calendar_lines_alarm" />
<field name="field_id" search="[('name','=','trigger_interval'),('model_id.model','=','res.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_7">
<field name="name" ref="base_calendar.field_alarm_summary"/>
<field name="type_id" ref="caldav.calendar_lines_alarm" />
<field name="field_id" search="[('name','=','description'),('model_id.model','=','calendar.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_8">
<field name="name" ref="base_calendar.field_alarm_duration"/>
<field name="type_id" ref="caldav.calendar_lines_alarm" />
<field name="field_id" search="[('name','=','duration'),('model_id.model','=','res.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_9">
<field name="name" ref="base_calendar.field_alarm_repeat"/>
<field name="type_id" ref="caldav.calendar_lines_alarm" />
<field name="field_id" search="[('name','=','repeat'),('model_id.model','=','res.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_10">
<field name="name" ref="base_calendar.field_alarm_action"/>
<field name="type_id" ref="caldav.calendar_lines_alarm" />
<field name="field_id" search="[('name','=','action'),('model_id.model','=','calendar.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_11">
<field name="name" ref="base_calendar.field_alarm_trigger_related"/>
<field name="type_id" ref="caldav.calendar_lines_alarm" />
<field name="field_id" search="[('name','=','trigger_related'),('model_id.model','=','res.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_1">
<field name="name" ref="base_calendar.field_attendee_cn"/>
<field name="type_id" ref="caldav.calendar_lines_attendee" />
<field name="field_id" search="[('name','=','cn'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_2">
<field name="name" ref="base_calendar.field_attendee_sent-by"/>
<field name="type_id" ref="caldav.calendar_lines_attendee" />
<field name="field_id" search="[('name','=','sent_by'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_3">
<field name="name" ref="base_calendar.field_attendee_language"/>
<field name="type_id" ref="caldav.calendar_lines_attendee" />
<field name="field_id" search="[('name','=','language'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_4">
<field name="name" ref="base_calendar.field_attendee_delegated-from"/>
<field name="type_id" ref="caldav.calendar_lines_attendee" />
<field name="field_id" search="[('name','=','delegated_from'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_5">
<field name="name" ref="base_calendar.field_attendee_member"/>
<field name="type_id" ref="caldav.calendar_lines_attendee" />
<field name="field_id" search="[('name','=','member'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_6">
<field name="name" ref="base_calendar.field_attendee_cutype"/>
<field name="type_id" ref="caldav.calendar_lines_attendee" />
<field name="field_id" search="[('name','=','cutype'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_7">
<field name="name" ref="base_calendar.field_attendee_role"/>
<field name="type_id" ref="caldav.calendar_lines_attendee" />
<field name="field_id" search="[('name','=','role'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_8">
<field name="name" ref="base_calendar.field_attendee_partstat"/>
<field name="type_id" ref="caldav.calendar_lines_attendee" />
<field name="field_id" search="[('name','=','state'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_9">
<field name="name" ref="base_calendar.field_attendee_delegated-to"/>
<field name="type_id" ref="caldav.calendar_lines_attendee" />
<field name="field_id" search="[('name','=','delegated_to'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_10">
<field name="name" ref="base_calendar.field_attendee_dir"/>
<field name="type_id" ref="caldav.calendar_lines_attendee" />
<field name="field_id" search="[('name','=','dir'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_11">
<field name="name" ref="base_calendar.field_attendee_rsvp"/>
<field name="type_id" ref="caldav.calendar_lines_attendee" />
<field name="field_id" search="[('name','=','rsvp'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
</data>
</openerp>
-19
View File
@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<wizard string="Import .ics File" model="calendar.event"
name="caldav.event.import" id="wizard_cal_event_import" multi="True" />
<wizard string="Subscribe to a Remote calendar"
model="calendar.event" name="caldav.event.subscribe"
id="wizard_cal_event_subscribe" multi="True" />
<wizard string="Export .ics File" model="calendar.event"
name="caldav.event.export" id="wizard_cal_event_export" multi="True" />
<wizard string="Edit this event" model="calendar.event"
name="calendar.event.edit.this" id="wizard_edit_this_event"
menu="False" />
</data>
</openerp>
@@ -1,9 +1,4 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_basic_calendar_all","basic.calendar","model_basic_calendar",,1,1,1,1
"access_basic_calendar_event_all","basic.calendar.event","model_basic_calendar_event",,1,1,1,1
"access_basic_calendar_attendee_all","basic.calendar.attendee","model_basic_calendar_attendee",,1,1,1,1
"access_calendar_todo_all","basic.calendar.todo","model_basic_calendar_todo",,1,1,1,1
"access_calendar_todo_all","basic.calendar.todo","model_basic_calendar_todo",,1,1,1,1
"access_calendar_attendee","calendar.attendee","model_calendar_attendee",,1,1,1,1
"access_calendar_alarm","calendar.alarm","model_calendar_alarm",,1,1,1,1
"access_res_alarm","res.alarm","model_res_alarm",,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
access_basic_calendar_all basic.calendar model_basic_calendar 1 1 1 1
access_basic_calendar_event_all basic.calendar.event model_basic_calendar_event 1 1 1 1
access_basic_calendar_attendee_all basic.calendar.attendee model_basic_calendar_attendee 1 1 1 1
access_calendar_todo_all basic.calendar.todo model_basic_calendar_todo 1 1 1 1
access_calendar_todo_all basic.calendar.todo model_basic_calendar_todo 1 1 1 1
2 access_calendar_attendee calendar.attendee model_calendar_attendee 1 1 1 1
3 access_calendar_alarm calendar.alarm model_calendar_alarm 1 1 1 1
4 access_res_alarm res.alarm model_res_alarm 1 1 1 1
+1
View File
@@ -53,6 +53,7 @@ class crm_claim(osv.osv):
'partner_mobile': fields.char('Mobile', size=32),
'partner_phone': fields.char('Phone', size=32),
'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.claim')]"),
'probability': fields.float('Probability (%)'),
}
_defaults = {
+2
View File
@@ -38,6 +38,7 @@
<field name="partner_id"/>
<field name="date" string="Date"/>
<field name="categ_id" string="Type" select="1"/>
<field name="probability"/>
<field name="state"/>
</tree>
</field>
@@ -71,6 +72,7 @@
<field name="partner_mobile"/>
<newline/>
<field name="planned_cost" string="Claim Cost"/>
<field name="probability"/>
<newline/>
<field name="priority"/>
<field name="type_id" string="Type of Action" select="1"/>
+4 -3
View File
@@ -58,8 +58,7 @@ class crm_cases(osv.osv):
mailgate_obj = self.pool.get('mail.gateway')
msg_actions, body_data = mailgate_obj.msg_act_get(msg)
data.update({
'description': body_data,
'history_line': [(0, 0, {'description': body_data, 'email': msg['From']})],
'description': body_data,
})
act = 'case_'+default_act
if 'state' in msg_actions:
@@ -79,7 +78,9 @@ class crm_cases(osv.osv):
if 'partner' in msg_actions:
data['email_from'] = msg_actions['partner'][:128]
res = self.write(cr, uid, ids, data)
res = self.write(cr, uid, ids, data)
cases = self.browse(cr, uid, [res])
self.__history(cr, uid, cases, _('Receive'), history=True, email=msg['From'])
getattr(self,act)(cr, uid, ids)
return res
+2 -7
View File
@@ -20,7 +20,7 @@
##############################################################################
from osv import fields, osv
import crm
class crm_meeting(osv.osv):
_name = 'crm.meeting'
@@ -29,12 +29,7 @@ class crm_meeting(osv.osv):
_inherit = ["crm.case", "calendar.event"]
_columns = {
'priority': fields.selection([('5','Lowest'),
('4','Low'),
('3','Normal'),
('2','High'),
('1','Highest')
], 'Priority'),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
'categ_id': fields.many2one('crm.case.categ', 'Category', \
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.meeting')]", \
+55 -23
View File
@@ -1,30 +1,62 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
<data noupdate="1">
<!-- CASE CATEGORY(categ_id) -->
<record model="crm.case.categ" id="categ_meet1">
<field name="name">Customer Meeting</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.fundraising')]" model="ir.model"/>
</record>
<record model="crm.case.categ" id="categ_meet2">
<field name="name">Internal Meeting</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.fundraising')]" model="ir.model"/>
</record>
<record model="crm.case.categ" id="categ_meet3">
<field name="name">Phone Call</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.meeting')]" model="ir.model"/>
</record>
<record model="crm.case.categ" id="categ_meet1">
<field name="name">Customer Meeting</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.meeting')]" model="ir.model"/>
</record>
<record model="res.request.link" id="request_link_meeting">
<field name="name">Case Meeting</field>
<field name="object">crm.meeting</field>
</record>
<record model="crm.case.categ" id="categ_meet2">
<field name="name">Internal Meeting</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.meeting')]" model="ir.model"/>
</record>
</data>
<record model="crm.case.categ" id="categ_meet3">
<field name="name">Phone Call</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.meeting')]" model="ir.model"/>
</record>
<record model="res.request.link" id="request_link_meeting">
<field name="name">Case Meeting</field>
<field name="object">crm.meeting</field>
</record>
<record model="basic.calendar.lines" id="caldav.calendar_lines_event">
<field name="name">vevent</field>
<field name="calendar_id" ref="base_calendar.basic_calendar1" />
<field name="object_id" search="[('model','=','crm.meeting')]" />
</record>
<!-- Event Attribute mapping-->
<record model="basic.calendar.fields" id="caldav.map_event_4">
<field name="name" ref="base_calendar.field_event_attendee" />
<field name="type_id" ref="caldav.calendar_lines_event" />
<field name="field_id" search="[('name','=','attendee_ids'),('model_id.model','=','crm.meeting')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="caldav.map_event_8">
<field name="name" ref="base_calendar.field_event_priority"/>
<field name="type_id" ref="caldav.calendar_lines_event" />
<field name="field_id" search="[('name','=','priority'),('model_id.model','=','crm.meeting')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="caldav.map_event_11">
<field name="name" ref="base_calendar.field_event_status"/>
<field name="type_id" ref="caldav.calendar_lines_event" />
<field name="field_id" search="[('name','=','state'),('model_id.model','=','crm.meeting')]" />
<field name="fn">field</field>
</record>
</data>
</openerp>
+19 -4
View File
@@ -1,6 +1,20 @@
<?xml version="1.0"?>
<openerp>
<data>
# ------------------------------------------------------
# Meetings Categories
# ------------------------------------------------------
<record id="crm_meeting_categ_action" model="ir.actions.act_window">
<field name="name">Meeting Categories</field>
<field name="res_model">crm.case.categ</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm.crm_case_categ_tree-view"/>
<field name="domain">[('object_id.model', '=', 'crm.meeting')]</field>
<field name="context">{'object_id':'crm.meeting'}</field>
</record>
<menuitem action="crm_meeting_categ_action" id="menu_crm_case_meeting-act" parent="crm.menu_crm_case_categ"/>
# ------------------------------------------------------
# Meetings
# ------------------------------------------------------
@@ -22,7 +36,7 @@
<field name="duration" widget="float_time" />
<field name="date_deadline" string="End Date" required="1" />
<field name="location" />
<field name="categ_id" widget="selection" />
<field name="categ_id"/>
<group colspan="2" col="3" attrs="{'readonly':[('recurrent_uid','!=',False)]}">
<field name="rrule_type" string="Recurrency"
on_change="onchange_rrule_type(rrule_type)"
@@ -71,8 +85,9 @@
</field>
</page>
<page string="Other Information">
<field name="alarm_id" string="Reminder" widget="selection" />
<field name="priority"/>
<field name="show_as"/>
<field name="alarm_id" string="Reminder" widget="selection" />
<field name="class"/>
<field name="user_id"/>
<field name="recurrent_id" invisible="1" />
@@ -83,8 +98,8 @@
<group col="3" colspan="4" attrs="{'invisible':[('rrule_type','in', ('none', False))]}">
<label string="" />
<button string="Modify this Occurrence"
name="%(caldav.wizard_edit_this_event)d" icon="gtk-save"
type="action" context="{'model' : 'crm.meeting'}" />
name="%(base_calendar.wizard_edit_this_event)d" icon="gtk-save"
type="action" context="{'model' : 'crm.meeting', 'date': date, 'date_deadline': date_deadline}" />
</group>
</form>
</field>
+5 -5
View File
@@ -2,17 +2,17 @@
<openerp>
<data>
<wizard string="Import .ics File" model="crm.meeting"
name="caldav.event.import" id="caldav.wizard_cal_event_import" multi="True" />
name="calendar.event.import" id="base_calendar.wizard_cal_event_import" multi="True" />
<wizard string="Subscribe to a Remote calendar"
model="crm.meeting" name="caldav.event.subscribe"
id="caldav.wizard_cal_event_subscribe" multi="True" />
model="crm.meeting" name="calendar.event.subscribe"
id="base_calendar.wizard_cal_event_subscribe" multi="True" />
<wizard string="Export .ics File" model="crm.meeting"
name="caldav.event.export" id="caldav.wizard_cal_event_export" multi="True" />
name="calendar.event.export" id="base_calendar.wizard_cal_event_export" multi="True" />
<wizard string="Edit this event" model="crm.meeting"
name="calendar.event.edit.this" id="caldav.wizard_edit_this_event"
name="calendar.event.edit.this" id="base_calendar.wizard_edit_this_event"
menu="False" />
</data>
</openerp>
-1
View File
@@ -19,7 +19,6 @@
#
##############################################################################
from caldav import common
from dateutil.rrule import *
from osv import fields, osv
import datetime
+1 -1
View File
@@ -41,7 +41,7 @@ class crm_segmentation(osv.osv):
'segmentation_line': fields.one2many('crm.segmentation.line', 'segmentation_id', 'Criteria', required=True),
'som_interval': fields.integer('Days per Periode', help="A period is the average number of days between two cycle of sale or purchase for this segmentation. It's mainly used to detect if a partner has not purchased or buy for a too long time, so we suppose that his state of mind has decreased because he probably bought goods to another supplier. Use this functionality for recurring businesses."),
'som_interval_max': fields.integer('Max Interval', help="The computation is made on all events that occured during this interval, the past X periods."),
'som_interval_decrease': fields.float('Decrease (0>1)', help="If the partner has not purchased (or buied) during a period, decrease the state of mind by this factor. It\'s a multiplication"),
'som_interval_decrease': fields.float('Decrease (0>1)', help="If the partner has not purchased (or bought) during a period, decrease the state of mind by this factor. It\'s a multiplication"),
'som_interval_default': fields.float('Default (0=None)', help="Default state of mind for period preceeding the 'Max Interval' computation. This is the starting state of mind by default if the partner has no event."),
'sales_purchase_active': fields.boolean('Use The Sales Purchase Rules', help='Check if you want to use this tab as part of the segmentation rule. If not checked, the criteria beneath will be ignored')
}
+362 -333
View File
File diff suppressed because it is too large Load Diff
+657 -402
View File
File diff suppressed because it is too large Load Diff
+57 -54
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: 2010-01-05 05:59+0000\n"
"PO-Revision-Date: 2010-01-20 01:33+0000\n"
"PO-Revision-Date: 2010-01-23 18:58+0000\n"
"Last-Translator: pedrobom <pedrobomlimeira@gmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-01-20 04:36+0000\n"
"X-Launchpad-Export-Date: 2010-01-24 04:50+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: crm
@@ -308,17 +308,17 @@ msgstr "Data da última ação"
#. module: crm
#: view:crm.job:0
msgid "Appreciation"
msgstr ""
msgstr "Apreciação"
#. module: crm
#: model:crm.case.stage,name:crm.stage_job3
msgid "Second Interview"
msgstr ""
msgstr "Segunda entrevista"
#. module: crm
#: model:ir.actions.wizard,name:crm.wizard_crm_cal_subscribe
msgid "Subscribe to a Remote calendar"
msgstr ""
msgstr "Inscrever-se num calendário Remoto"
#. module: crm
#: model:ir.actions.act_window,name:crm.crm_case_categ-act
@@ -330,7 +330,7 @@ msgstr "Categorias"
#: code:addons/crm/wizard/wizard_crm_new_send_email.py:0
#, python-format
msgid "Warning!"
msgstr ""
msgstr "Atenção!"
#. module: crm
#: view:crm.case:0
@@ -356,18 +356,18 @@ msgstr ""
#: view:crm.fundraising:0
#: view:crm.opportunity:0
msgid "Description Information"
msgstr ""
msgstr "Informação da descrição"
#. module: crm
#: view:crm.lead:0
msgid "Contact Name"
msgstr ""
msgstr "Nome do Contato"
#. module: crm
#: selection:crm.lead.opportunity_set,create_partner,action:0
#: selection:crm.phonecall.opportunity_set,create_partner,action:0
msgid "Link to an existing partner"
msgstr ""
msgstr "Link para um parceiro existente"
#. module: crm
#: field:crm.case.rule,trg_date_range_type:0
@@ -387,7 +387,7 @@ msgstr ""
#. module: crm
#: view:crm.job:0
msgid "Next Interview"
msgstr ""
msgstr "Próxima entrevista"
#. module: crm
#: field:crm.case.rule,regex_history:0
@@ -402,7 +402,7 @@ msgstr ""
#. module: crm
#: model:process.transition,name:crm.process_transition_opportunitymeeting0
msgid "Opportunity Meeting"
msgstr ""
msgstr "Reunindo oportunidades"
#. module: crm
#: help:crm.case,canal_id:0
@@ -411,11 +411,14 @@ msgid ""
"customer. With each commercial opportunity, you can indicate the canall "
"which is this opportunity source."
msgstr ""
"Os canais representam os diferentes modos de comunicação disponíveis com o "
"cliente. A cada oportunidade comercial, você pode indicar o canal que é essa "
"fonte de oportunidade."
#. module: crm
#: view:crm.meeting:0
msgid "Exception Rules"
msgstr ""
msgstr "Regras de exceção"
#. module: crm
#: field:crm.menu.config_wizard,opportunity:0
@@ -426,7 +429,7 @@ msgstr "Oportunidades de negócios"
#. module: crm
#: model:crm.case.stage,name:crm.stage_claim1
msgid "Accepted as Claim"
msgstr ""
msgstr "Aceito como reivindicação"
#. module: crm
#: view:crm.case.rule:0
@@ -455,13 +458,13 @@ msgstr ""
#. module: crm
#: view:crm.meeting:0
msgid "Confirm Meeting"
msgstr ""
msgstr "Confirmar reunião"
#. module: crm
#: model:crm.case.categ,name:crm.categ_lead1
#: model:crm.case.categ,name:crm.categ_oppor1
msgid "Existing Customer"
msgstr ""
msgstr "Cliente existente"
#. module: crm
#: model:crm.case.category2,name:crm.category_meet2
@@ -485,7 +488,7 @@ msgstr "Categoria"
#: model:ir.ui.menu,name:crm.menu_crm_case_section_categ_stage_tree
#: view:report.crm.case.section.categ.stage:0
msgid "Cases by Section, Category and Stage"
msgstr ""
msgstr "Casos por seção, categoria e estágio"
#. module: crm
#: help:crm.case.rule,act_mail_to_watchers:0
@@ -497,7 +500,7 @@ msgstr ""
#. module: crm
#: field:crm.meeting,class:0
msgid "Privacy"
msgstr ""
msgstr "Privacidade"
#. module: crm
#: view:crm.case.rule:0
@@ -565,12 +568,12 @@ msgstr ""
#: selection:report.crm.case.section.categ2,month:0
#: selection:report.crm.case.section.stage,month:0
msgid "August"
msgstr ""
msgstr "Agosto"
#. module: crm
#: view:crm.meeting:0
msgid "Meetings Tree"
msgstr ""
msgstr "Árvore de reuniões"
#. module: crm
#: code:addons/crm/crm.py:0
@@ -587,7 +590,7 @@ msgstr "Escalada"
#. module: crm
#: model:ir.ui.menu,name:crm.menu_crm_case_categ_meet
msgid "All Meetings"
msgstr ""
msgstr "Todas as reuniões"
#. module: crm
#: model:ir.module.module,shortdesc:crm.module_meta_information
@@ -606,7 +609,7 @@ msgstr ""
#: selection:report.crm.case.section.categ2,month:0
#: selection:report.crm.case.section.stage,month:0
msgid "June"
msgstr ""
msgstr "Junho"
#. module: crm
#: field:crm.segmentation,som_interval_default:0
@@ -616,7 +619,7 @@ msgstr "Padrão (0=Nada)"
#. module: crm
#: model:crm.case.stage,name:crm.stage_job7
msgid "Refused by Company"
msgstr ""
msgstr "Recusado pela Empresa"
#. module: crm
#: field:crm.case,planned_revenue:0
@@ -634,12 +637,12 @@ msgstr "Permite exclusão"
#: selection:report.crm.case.section.categ2,month:0
#: selection:report.crm.case.section.stage,month:0
msgid "October"
msgstr ""
msgstr "Outubro"
#. module: crm
#: model:crm.case.stage,name:crm.stage_oppor3
msgid "Value Proposition"
msgstr ""
msgstr "Proposta de valor"
#. module: crm
#: view:crm.case.rule:0
@@ -654,12 +657,12 @@ msgstr ""
#. module: crm
#: help:crm.case,email_from:0
msgid "These people will receive email."
msgstr ""
msgstr "Essas pessoas receberão e-mail."
#. module: crm
#: help:crm.case.section,calendar:0
msgid "Allows to show calendar"
msgstr ""
msgstr "Permite mostrar calendário"
#. module: crm
#: view:crm.job:0
@@ -667,13 +670,13 @@ msgstr ""
#: view:crm.opportunity:0
#: view:crm.phonecall:0
msgid " Today "
msgstr ""
msgstr " Hoje "
#. module: crm
#: wizard_view:crm.job.reschedule_phone_call,init:0
#: wizard_view:crm.opportunity.reschedule_phone_call,init:0
msgid "Phone Call Description"
msgstr ""
msgstr "Descrição da chamada telefônica"
#. module: crm
#: view:crm.case.categ:0
@@ -709,7 +712,7 @@ msgstr ""
#. module: crm
#: view:crm.phonecall:0
msgid "Assigned to"
msgstr ""
msgstr "Atribuído a"
#. module: crm
#: view:res.partner.events:0
@@ -719,7 +722,7 @@ msgstr "Eventos dos parceiros"
#. module: crm
#: model:crm.case.stage,name:crm.stage_job4
msgid "Contract Proposed"
msgstr ""
msgstr "Contrato proposto"
#. module: crm
#: model:ir.ui.menu,name:crm.menu_crm_case_job_req_main
@@ -732,7 +735,7 @@ msgstr ""
#: view:crm.lead:0
#: view:crm.opportunity:0
msgid "Related Cases"
msgstr ""
msgstr "Casos relacionados"
#. module: crm
#: selection:report.crm.case.section.categ.categ2,month:0
@@ -740,7 +743,7 @@ msgstr ""
#: selection:report.crm.case.section.categ2,month:0
#: selection:report.crm.case.section.stage,month:0
msgid "September"
msgstr ""
msgstr "Setembro"
#. module: crm
#: view:crm.case:0
@@ -755,33 +758,33 @@ msgstr "Histórico"
#. module: crm
#: view:crm.claim:0
msgid "New Claims"
msgstr ""
msgstr "Pedidos Novos"
#. module: crm
#: view:crm.meeting:0
msgid "Meetings Form"
msgstr ""
msgstr "Formulario de reuniões"
#. module: crm
#: model:crm.case.stage,name:crm.stage_oppor5
msgid "Negotiation/Review"
msgstr ""
msgstr "Negociação/Revisão"
#. module: crm
#: code:addons/crm/wizard/crm_phonecall_wizard.py:0
#, python-format
msgid "A partner is already defined on this phonecall."
msgstr ""
msgstr "Um parceiro já está definido sobre esta chamada."
#. module: crm
#: model:ir.ui.menu,name:crm.menu_action_report_crm_case_oppor_stage
msgid "Cases by Opportunities and Stage"
msgstr ""
msgstr "Casos por oportunidades e estágios"
#. module: crm
#: view:crm.claim:0
msgid "Date of Claim"
msgstr ""
msgstr "Data da reivindicação"
#. module: crm
#: view:crm.segmentation.line:0
@@ -796,7 +799,7 @@ msgstr ""
#. module: crm
#: view:crm.lead:0
msgid "Leads Form"
msgstr ""
msgstr "Formulário de ligações"
#. module: crm
#: view:crm.segmentation:0
@@ -807,7 +810,7 @@ msgstr "Segmentação de parceiros"
#. module: crm
#: model:crm.case.stage,name:crm.stage_job5
msgid "Contract Signed"
msgstr ""
msgstr "Contrato assinado"
#. module: crm
#: wizard_view:caldav.crm.subscribe,init:0
@@ -817,7 +820,7 @@ msgstr ""
#. module: crm
#: model:crm.case.category2,name:crm.category_oppor1
msgid "Existing Business"
msgstr ""
msgstr "Negócios existentes"
#. module: crm
#: field:crm.case,probability:0
@@ -855,7 +858,7 @@ msgstr "Regra do caso"
#: model:ir.ui.menu,name:crm.menu_action_report_crm_case_oppor
#, python-format
msgid "Opportunity"
msgstr ""
msgstr "Oportunidade"
#. module: crm
#: view:crm.case:0
@@ -870,7 +873,7 @@ msgstr ""
#. module: crm
#: model:crm.case.category2,name:crm.category_lead7
msgid "Television"
msgstr ""
msgstr "Televisão"
#. module: crm
#: view:crm.segmentation:0
@@ -906,13 +909,13 @@ msgstr "Valor"
#. module: crm
#: help:caldav.crm.export,init,name:0
msgid "Save in .ics format"
msgstr ""
msgstr "Salve em formato .ics"
#. module: crm
#: wizard_field:crm.new.send.mail,init,text:0
#: wizard_field:crm.send.mail,init,text:0
msgid "Message"
msgstr ""
msgstr "Mensagem"
#. module: crm
#: help:crm.segmentation,exclusif:0
@@ -946,7 +949,7 @@ msgstr "Definir estado para"
#: code:addons/crm/crm.py:0
#, python-format
msgid "Email!"
msgstr ""
msgstr "Email!"
#. module: crm
#: model:crm.case.category2,name:crm.category_lead6
@@ -984,7 +987,7 @@ msgstr ""
#: model:ir.ui.menu,name:crm.menu_crm_case_opp
#: model:process.node,name:crm.process_node_opportunities0
msgid "Opportunities"
msgstr ""
msgstr "Oportunidades"
#. module: crm
#: help:crm.segmentation,name:0
@@ -1048,13 +1051,13 @@ msgstr ""
#. module: crm
#: wizard_field:crm.new.send.mail,init,state:0
msgid "Set State to"
msgstr ""
msgstr "Define Estado para"
#. module: crm
#: code:addons/crm/wizard/wizard_crm_send_email.py:0
#, python-format
msgid "There is no mail to reply!"
msgstr ""
msgstr "Não há email para resposta!"
#. module: crm
#: wizard_button:crm.job.partner_create,init,confirm:0
@@ -1079,7 +1082,7 @@ msgstr "%(case_description)s = Descrição de Caso"
#. module: crm
#: view:crm.fundraising:0
msgid "My Funds"
msgstr ""
msgstr "Meus Fundos"
#. module: crm
#: field:crm.case,partner_mobile:0
@@ -1105,12 +1108,12 @@ msgstr "Processo Histórico"
#. module: crm
#: model:crm.case.categ,name:crm.categ_job2
msgid "Junior Developer"
msgstr ""
msgstr "Desenvolvedor júnior"
#. module: crm
#: view:crm.meeting:0
msgid "My Meetings"
msgstr ""
msgstr "Minhas Reuniões"
#. module: crm
#: field:crm.case.categ,name:0
@@ -1120,7 +1123,7 @@ msgstr "Nome da Categoria do Case"
#. module: crm
#: model:crm.case.category2,name:crm.category_claim2
msgid "Preventive"
msgstr ""
msgstr "Preventivo"
#. module: crm
#: field:crm.case.rule,act_email_cc:0
@@ -1158,7 +1161,7 @@ msgstr ""
#: view:crm.meeting:0
#, python-format
msgid "Meetings"
msgstr ""
msgstr "Reuniões"
#. module: crm
#: view:crm.case.rule:0
+2
View File
@@ -105,6 +105,8 @@ class lead2opportunity(wizard.interface):
'partner_id': data['form']['partner_id'],
'section_id':lead.section_id.id,
'description':lead.description,
'partner_address_id':lead.partner_address_id.id,
'priority':lead.priority,
})
new_opportunity = opportunity_case_obj.browse(cr, uid, new_opportunity_id)
+3 -1
View File
@@ -139,7 +139,9 @@ class opportunity2meeting(wizard.interface):
new_meeting_id = meeting_case_obj.create(cr, uid, {
'name': opportunity.name,
'date': opportunity.date,
'section_id' : opportunity.section_id and opportunity.section_id.id or False,
'date_deadline': opportunity.date_deadline,
'description':opportunity.description,
})
new_meeting = meeting_case_obj.browse(cr, uid, new_meeting_id)
vals = {}
@@ -164,7 +166,7 @@ class opportunity2meeting(wizard.interface):
'view_mode': 'calendar,form,tree',
'res_model': 'crm.meeting',
'view_id': False,
'views': [(id1,'calendar'),(id2,'form'),(id3,'tree'),(False,'graph')],
'views': [(id1,'calendar'),(id2,'form'),(id3,'tree')],
'type': 'ir.actions.act_window',
'search_view_id': id['res_id']
}
+4 -3
View File
@@ -102,8 +102,7 @@ class phonecall2opportunity(wizard.interface):
'name': data['form']['name'],
'planned_revenue': data['form']['planned_revenue'],
'probability': data['form']['probability'],
'partner_id': data['form']['partner_id'],
'phonecall_id':phonecall.id,
'partner_id': data['form']['partner_id'],
'section_id':phonecall.section_id.id,
'description':phonecall.description,
})
@@ -200,7 +199,9 @@ class phonecall2meeting(wizard.interface):
new_meeting_id = meeting_case_obj.create(cr, uid, {
'name': phonecall.name,
'date': phonecall.date,
'section_id' : phonecall.section_id and phonecall.section_id.id or False,
'duration': phonecall.duration,
'description':phonecall.description,
})
new_meeting = meeting_case_obj.browse(cr, uid, new_meeting_id)
vals = {}
@@ -225,7 +226,7 @@ class phonecall2meeting(wizard.interface):
'view_mode': 'calendar,form,tree',
'res_model': 'crm.meeting',
'view_id': False,
'views': [(id1,'calendar'),(id2,'form'),(id3,'tree'),(False,'graph')],
'views': [(id1,'calendar'),(id2,'form'),(id3,'tree')],
'type': 'ir.actions.act_window',
'search_view_id': id['res_id']
}
+1
View File
@@ -22,5 +22,6 @@
import crm_hr
import report
import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+6 -4
View File
@@ -26,19 +26,21 @@
'version': '1.0',
'category': 'Generic Modules/CRM & SRM',
'description': """
This module provide Store the Job
This module provide Store the Job
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['crm','hr'],
'depends': ['crm','hr','board_crm_configuration','survey'],
'init_xml': [
'crm_hr_data.xml'
],
'update_xml': [
'crm_hr_wizard.xml',
'crm_hr_wizard.xml',
'crm_hr_view.xml',
'crm_hr_menu.xml',
'security/crm_hr_security.xml',
'report_crm_hr_view.xml',
'security/crm_hr_security.xml',
'board_crm_hr_statistical_view.xml',
],
'demo_xml': [
'crm_hr_demo.xml'
@@ -0,0 +1,44 @@
<?xml version="1.0"?>
<openerp>
<data>
<record model="ir.ui.view" id="view_crm_job_categ_graph">
<field name="name">report.crm.job.categ.graph</field>
<field name="model">report.crm.job.categ</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Jobs by Sections and Categories" type="bar" orientation="horizontal">
<field name="categ_id"/>
<field name="nbr" operator="+"/>
<field name="state" group="True"/>
</graph>
</field>
</record>
<act_window name="Jobs Requests Of The Month by Applied Job"
domain="[('month','=',time.strftime('%%m')),('state','!=','done'),('state','!=','cancel')]"
res_model="report.crm.job.categ"
view_type="form"
view_mode="graph,tree,form"
view_id="view_crm_job_categ_graph"
id="act_jobs_categ"/>
<record model="ir.ui.view" id="board_crm_hr_statistical_form">
<field name="name">CRM - Statistical Dashboard Form</field>
<field name="model">board.board</field>
<field name="inherit_id" ref="board_crm_configuration.board_crm_statistical_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Statistics Dashboard">
<hpaned>
<child2>
<action
string="Jobs Requests Of The Month by Applied Job"
name="%(act_jobs_categ)d"
colspan="4"/>
</child2>
</hpaned>
</form>
</field>
</record>
</data>
</openerp>
+425 -21
View File
@@ -1,76 +1,480 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
<!-- CASE CATEGORY(categ_id) -->
<record model="crm.case.categ" id="categ_job1">
<field name="name">Salesman</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
<record model="crm.case.categ" id="categ_job2">
<field name="name">Junior Developer</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
<!-- Resource(type_id) -->
<record model="crm.case.resource.type" id="type_job1">
<field name="name">Graduate</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
<record model="crm.case.resource.type" id="type_job2">
<field name="name">Licenced</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
<record model="crm.case.resource.type" id="type_job3">
<field name="name"> > Bac +5</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
<!-- STAGE(stage_id) -->
<record model="crm.case.stage" id="stage_job1">
<field name="name">Initial Jobs Demand</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
<record model="crm.case.stage" id="stage_job2">
<field name="name">First Interview</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
<record model="crm.case.stage" id="stage_job3">
<field name="name">Second Interview</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
<record model="crm.case.stage" id="stage_job4">
<field name="name">Contract Proposed</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.claim')]" model="ir.model"/>
<field name="object_id" search="[('model','=','crm.claim')]" model="ir.model"/>
</record>
<record model="crm.case.stage" id="stage_job5">
<field name="name">Contract Signed</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
<record model="crm.case.stage" id="stage_job6">
<field name="name">Refused by Employee</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
<record model="crm.case.stage" id="stage_job7">
<field name="name">Refused by Company</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
<field name="object_id" search="[('model','=','crm.job')]" model="ir.model"/>
</record>
</data>
<data>
<record id="survey_job_0" model="survey">
<field name="title">Job Survey</field>
<field name="state">draft</field>
<field name="max_response_limit">20</field>
<field eval="[(6,0,[])]" name="users"/>
</record>
</data>
<data>
<record id="survey_page_job_0" model="survey.page">
<field name="title">Default Section</field>
<field name="survey_id" ref="survey_job_0"/>
<field eval="1" name="sequence"/>
</record>
</data>
<data>
<record id="survey_page_job_1" model="survey.page">
<field name="title">Education &amp; Activities</field>
<field name="survey_id" ref="survey_job_0"/>
<field eval="2" name="sequence"/>
</record>
</data>
<data>
<record id="survey_page_job_2" model="survey.page">
<field name="title">Importance</field>
<field name="survey_id" ref="survey_job_0"/>
<field eval="3" name="sequence"/>
</record>
</data>
<data>
<record id="survey_question_job_0" model="survey.question">
<field name="validation_type">do_not_validate</field>
<field name="comment_valid_type">do_not_validate</field>
<field name="make_comment_field_err_msg">Please enter a comment.</field>
<field name="numeric_required_sum_err_msg">The choices need to add up to [enter sum here].</field>
<field eval="0" name="comment_column"/>
<field name="validation_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="rating_allow_one_column_require"/>
<field name="req_error_msg">This question requires an answer.</field>
<field eval="1" name="sequence"/>
<field name="question">From which university will you graduate?</field>
<field eval="0" name="is_require_answer"/>
<field name="type">single_textbox</field>
<field name="comment_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="make_comment_field"/>
<field eval="1" name="in_visible_menu_choice"/>
<field name="page_id" ref="survey_page_job_0"/>
<field name="comment_label">Other</field>
<field eval="1" name="in_visible_rating_weight"/>
<field eval="0" name="allow_comment"/>
</record>
</data>
<data>
<record id="survey_question_job_1" model="survey.question">
<field name="validation_type">do_not_validate</field>
<field name="comment_valid_type">do_not_validate</field>
<field name="make_comment_field_err_msg">Please enter a comment.</field>
<field name="numeric_required_sum_err_msg">The choices need to add up to [enter sum here].</field>
<field eval="0" name="comment_column"/>
<field name="validation_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="rating_allow_one_column_require"/>
<field name="req_error_msg">This question requires an answer.</field>
<field eval="1" name="sequence"/>
<field name="question">Rate the Importance</field>
<field eval="0" name="is_require_answer"/>
<field name="type">matrix_of_choices_only_one_ans</field>
<field name="comment_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="make_comment_field"/>
<field eval="1" name="in_visible_menu_choice"/>
<field name="page_id" ref="survey_page_job_2"/>
<field name="comment_label">Other</field>
<field eval="1" name="in_visible_rating_weight"/>
<field eval="0" name="allow_comment"/>
</record>
</data>
<data>
<record id="survey_question_job_2" model="survey.question">
<field name="validation_type">do_not_validate</field>
<field name="comment_valid_type">do_not_validate</field>
<field name="make_comment_field_err_msg">Please enter a comment.</field>
<field name="numeric_required_sum_err_msg">The choices need to add up to [enter sum here].</field>
<field eval="0" name="comment_column"/>
<field name="validation_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="rating_allow_one_column_require"/>
<field name="req_error_msg">This question requires an answer.</field>
<field eval="1" name="sequence"/>
<field name="question">Education</field>
<field eval="0" name="is_require_answer"/>
<field name="type">comment</field>
<field name="comment_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="make_comment_field"/>
<field eval="1" name="in_visible_menu_choice"/>
<field name="page_id" ref="survey_page_job_1"/>
<field name="comment_label">Other</field>
<field eval="1" name="in_visible_rating_weight"/>
<field eval="0" name="allow_comment"/>
</record>
</data>
<data>
<record id="survey_question_job_3" model="survey.question">
<field name="validation_type">do_not_validate</field>
<field name="comment_valid_type">do_not_validate</field>
<field name="make_comment_field_err_msg">Please enter a comment.</field>
<field name="numeric_required_sum_err_msg">The choices need to add up to [enter sum here].</field>
<field eval="0" name="comment_column"/>
<field name="validation_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="rating_allow_one_column_require"/>
<field name="req_error_msg">This question requires an answer.</field>
<field eval="2" name="sequence"/>
<field name="question">Knowledge</field>
<field eval="0" name="is_require_answer"/>
<field name="type">comment</field>
<field name="comment_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="make_comment_field"/>
<field eval="1" name="in_visible_menu_choice"/>
<field name="page_id" ref="survey_page_job_1"/>
<field name="comment_label">Other</field>
<field eval="1" name="in_visible_rating_weight"/>
<field eval="0" name="allow_comment"/>
</record>
</data>
<data>
<record id="survey_question_job_4" model="survey.question">
<field name="validation_type">do_not_validate</field>
<field name="comment_valid_type">do_not_validate</field>
<field name="make_comment_field_err_msg">Please enter a comment.</field>
<field name="numeric_required_sum_err_msg">The choices need to add up to [enter sum here].</field>
<field eval="0" name="comment_column"/>
<field name="validation_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="rating_allow_one_column_require"/>
<field name="req_error_msg">This question requires an answer.</field>
<field eval="2" name="sequence"/>
<field name="question">What is your gender?</field>
<field eval="0" name="is_require_answer"/>
<field name="type">multiple_choice_only_one_ans</field>
<field name="comment_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="make_comment_field"/>
<field eval="1" name="in_visible_menu_choice"/>
<field name="page_id" ref="survey_page_job_0"/>
<field name="comment_label">Other</field>
<field eval="1" name="in_visible_rating_weight"/>
<field eval="0" name="allow_comment"/>
</record>
<record id="survey_answer_job_70" model="survey.answer">
<field name="answer">Male</field>
<field name="question_id" ref="crm_hr.survey_question_job_4"/>
<field eval="1" name="sequence"/>
</record>
<record id="survey_answer_job_71" model="survey.answer">
<field name="answer">Female</field>
<field name="question_id" ref="crm_hr.survey_question_job_4"/>
<field eval="2" name="sequence"/>
</record>
</data>
<data>
<record id="survey_question_job_5" model="survey.question">
<field name="validation_type">do_not_validate</field>
<field name="comment_valid_type">do_not_validate</field>
<field name="make_comment_field_err_msg">Please enter a comment.</field>
<field name="numeric_required_sum_err_msg">The choices need to add up to [enter sum here].</field>
<field eval="0" name="comment_column"/>
<field name="validation_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="rating_allow_one_column_require"/>
<field name="req_error_msg">This question requires an answer.</field>
<field eval="3" name="sequence"/>
<field name="question">What age group do you belong to?</field>
<field eval="0" name="is_require_answer"/>
<field name="type">multiple_choice_only_one_ans</field>
<field name="comment_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="make_comment_field"/>
<field eval="1" name="in_visible_menu_choice"/>
<field name="page_id" ref="survey_page_job_0"/>
<field name="comment_label">Other</field>
<field eval="1" name="in_visible_rating_weight"/>
<field eval="0" name="allow_comment"/>
</record>
<record id="survey_answer_job_81" model="survey.answer">
<field name="answer">0 - 15</field>
<field name="question_id" ref="crm_hr.survey_question_job_5"/>
<field eval="1" name="sequence"/>
</record>
<record id="survey_answer_job_82" model="survey.answer">
<field name="answer">16 - 20</field>
<field name="question_id" ref="crm_hr.survey_question_job_5"/>
<field eval="2" name="sequence"/>
</record>
<record id="survey_answer_job_83" model="survey.answer">
<field name="answer">21 - 30</field>
<field name="question_id" ref="crm_hr.survey_question_job_5"/>
<field eval="3" name="sequence"/>
</record>
<record id="survey_answer_job_84" model="survey.answer">
<field name="answer">31 - 40</field>
<field name="question_id" ref="crm_hr.survey_question_job_5"/>
<field eval="4" name="sequence"/>
</record>
<record id="survey_answer_job_85" model="survey.answer">
<field name="answer">41 - 50</field>
<field name="question_id" ref="crm_hr.survey_question_job_5"/>
<field eval="5" name="sequence"/>
</record>
<record id="survey_answer_job_86" model="survey.answer">
<field name="answer">51 - 60</field>
<field name="question_id" ref="crm_hr.survey_question_job_5"/>
<field eval="6" name="sequence"/>
</record>
<record id="survey_answer_job_87" model="survey.answer">
<field name="answer">61 - 70</field>
<field name="question_id" ref="crm_hr.survey_question_job_5"/>
<field eval="7" name="sequence"/>
</record>
<record id="survey_answer_job_88" model="survey.answer">
<field name="answer">71 +</field>
<field name="question_id" ref="crm_hr.survey_question_job_5"/>
<field eval="8" name="sequence"/>
</record>
</data>
<data>
<record id="survey_question_job_6" model="survey.question">
<field name="validation_type">do_not_validate</field>
<field name="comment_valid_type">do_not_validate</field>
<field name="make_comment_field_err_msg">Please enter a comment.</field>
<field name="numeric_required_sum_err_msg">The choices need to add up to [enter sum here].</field>
<field eval="0" name="comment_column"/>
<field name="validation_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="rating_allow_one_column_require"/>
<field name="req_error_msg">This question requires an answer.</field>
<field eval="3" name="sequence"/>
<field name="question">Exprience</field>
<field eval="0" name="is_require_answer"/>
<field name="type">comment</field>
<field name="comment_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="make_comment_field"/>
<field eval="1" name="in_visible_menu_choice"/>
<field name="page_id" ref="survey_page_job_1"/>
<field name="comment_label">Other</field>
<field eval="1" name="in_visible_rating_weight"/>
<field eval="0" name="allow_comment"/>
</record>
</data>
<data>
<record id="survey_question_job_7" model="survey.question">
<field name="validation_type">do_not_validate</field>
<field name="comment_valid_type">do_not_validate</field>
<field name="make_comment_field_err_msg">Please enter a comment.</field>
<field name="numeric_required_sum_err_msg">The choices need to add up to [enter sum here].</field>
<field eval="0" name="comment_column"/>
<field name="validation_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="rating_allow_one_column_require"/>
<field name="req_error_msg">This question requires an answer.</field>
<field eval="4" name="sequence"/>
<field name="question">Activities</field>
<field eval="0" name="is_require_answer"/>
<field name="type">comment</field>
<field name="comment_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="make_comment_field"/>
<field eval="1" name="in_visible_menu_choice"/>
<field name="page_id" ref="survey_page_job_1"/>
<field name="comment_label">Other</field>
<field eval="1" name="in_visible_rating_weight"/>
<field eval="0" name="allow_comment"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_job_0" model="survey.question.column.heading">
<field eval="1" name="in_visible_menu_choice"/>
<field name="title">Not important</field>
<field eval="1" name="in_visible_rating_weight"/>
<field name="question_id" ref="survey_question_job_1"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_job_1" model="survey.question.column.heading">
<field eval="1" name="in_visible_menu_choice"/>
<field name="title">Somewhat important</field>
<field eval="1" name="in_visible_rating_weight"/>
<field name="question_id" ref="survey_question_job_1"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_job_2" model="survey.question.column.heading">
<field eval="1" name="in_visible_menu_choice"/>
<field name="title">Important</field>
<field eval="1" name="in_visible_rating_weight"/>
<field name="question_id" ref="survey_question_job_1"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_job_3" model="survey.question.column.heading">
<field eval="1" name="in_visible_menu_choice"/>
<field name="title">Very important</field>
<field eval="1" name="in_visible_rating_weight"/>
<field name="question_id" ref="survey_question_job_1"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_job_4" model="survey.question.column.heading">
<field eval="1" name="in_visible_menu_choice"/>
<field name="title">Most important</field>
<field eval="1" name="in_visible_rating_weight"/>
<field name="question_id" ref="survey_question_job_1"/>
</record>
</data>
<data>
<record id="survey_answer_job_0" model="survey.answer">
<field name="answer">Good pay</field>
<field name="question_id" ref="crm_hr.survey_question_job_1"/>
<field eval="1" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_job_1" model="survey.answer">
<field name="answer">Getting on with colleagues</field>
<field name="question_id" ref="crm_hr.survey_question_job_1"/>
<field eval="2" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_job_2" model="survey.answer">
<field name="answer">Office environment (décor, light, space etc)</field>
<field name="question_id" ref="crm_hr.survey_question_job_1"/>
<field eval="3" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_job_3" model="survey.answer">
<field name="answer">Desk space</field>
<field name="question_id" ref="crm_hr.survey_question_job_1"/>
<field eval="4" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_job_4" model="survey.answer">
<field name="answer">State of the art technology</field>
<field name="question_id" ref="crm_hr.survey_question_job_1"/>
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_job_5" model="survey.answer">
<field name="answer">Office location (proximity to home)</field>
<field name="question_id" ref="crm_hr.survey_question_job_1"/>
<field eval="6" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_job_6" model="survey.answer">
<field name="answer">Good management/boss</field>
<field name="question_id" ref="crm_hr.survey_question_job_1"/>
<field eval="7" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_job_7" model="survey.answer">
<field name="answer">Freebies such as tea, coffee and stationery</field>
<field name="question_id" ref="crm_hr.survey_question_job_1"/>
<field eval="8" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_job_8" model="survey.answer">
<field name="answer">Perks such as free parking, gym passes etc</field>
<field name="question_id" ref="crm_hr.survey_question_job_1"/>
<field eval="9" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_job_9" model="survey.answer">
<field name="answer">No out of hours working</field>
<field name="question_id" ref="crm_hr.survey_question_job_1"/>
<field eval="10" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_job_10" model="survey.answer">
<field name="answer">Dress code</field>
<field name="question_id" ref="crm_hr.survey_question_job_1"/>
<field eval="11" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_job_11" model="survey.answer">
<field name="answer">Regular meetings</field>
<field name="question_id" ref="crm_hr.survey_question_job_1"/>
<field eval="12" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_job_12" model="survey.answer">
<field name="answer">Good social life (office nights out, good Christmas parties etc)</field>
<field name="question_id" ref="crm_hr.survey_question_job_1"/>
<field eval="13" name="sequence"/>
</record>
</data>
</openerp>
+25
View File
@@ -0,0 +1,25 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import report_crm_hr
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+131
View File
@@ -0,0 +1,131 @@
from osv import fields,osv
import tools
class report_crm_job_user(osv.osv):
_name = "report.crm.job.user"
_description = "Job by user and section"
_auto = False
_inherit = "report.crm.case.user"
_columns = {
'probability': fields.float('Avg. Probability', readonly=True),
'amount_revenue': fields.float('Est.Revenue', readonly=True),
'amount_costs': fields.float('Est.Cost', readonly=True),
'amount_revenue_prob': fields.float('Est. Rev*Prob.', readonly=True),
'delay_close': fields.char('Delay to close', size=20, readonly=True),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_crm_job_user')
cr.execute("""
create or replace view report_crm_job_user as (
select
min(c.id) as id,
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
c.state,
c.user_id,
c.section_id,
count(*) as nbr,
sum(planned_revenue) as amount_revenue,
sum(planned_cost) as amount_costs,
sum(planned_revenue*probability)::decimal(16,2) as amount_revenue_prob,
avg(probability)::decimal(16,2) as probability,
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
from
crm_job c
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id
)""")
report_crm_job_user()
class report_crm_job_categ(osv.osv):
_name = "report.crm.job.categ"
_description = "Jobs by section and category"
_auto = False
_inherit = "report.crm.case.categ"
_columns = {
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.job')]"),
'amount_revenue': fields.float('Est.Revenue', readonly=True),
'amount_costs': fields.float('Est.Cost', readonly=True),
'amount_revenue_prob': fields.float('Est. Rev*Prob.', readonly=True),
'probability': fields.float('Avg. Probability', readonly=True),
'delay_close': fields.char('Delay Close', size=20, readonly=True),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_crm_job_categ')
cr.execute("""
create or replace view report_crm_job_categ as (
select
min(c.id) as id,
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
c.categ_id,
c.state,
c.section_id,
count(*) as nbr,
sum(planned_revenue) as amount_revenue,
sum(planned_cost) as amount_costs,
sum(planned_revenue*probability)::decimal(16,2) as amount_revenue_prob,
avg(probability)::decimal(16,2) as probability,
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
from
crm_job c
group by c.categ_id,to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state,c.section_id
)""")
report_crm_job_categ()
class report_crm_job_section(osv.osv):
_name = "report.crm.job.section"
_description = "job by Section"
_auto = False
_inherit = "report.crm.case.section"
def _get_data(self, cr, uid, ids, field_name, arg, context={}):
res = {}
state_perc = 0.0
avg_ans = 0.0
for case in self.browse(cr, uid, ids, context):
if field_name != 'avg_answers':
state = field_name[5:]
cr.execute("select count(*) from crm_job where section_id =%s and state='%s'"%(case.section_id.id,state))
state_cases = cr.fetchone()[0]
perc_state = (state_cases / float(case.nbr_cases) ) * 100
res[case.id] = perc_state
else:
cr.execute('select count(*) from crm_case_log l where l.section_id=%s'%(case.section_id.id))
logs = cr.fetchone()[0]
avg_ans = logs / case.nbr_cases
res[case.id] = avg_ans
return res
_columns = {
'avg_answers': fields.function(_get_data,string='Avg. Answers', method=True,type="integer"),
'perc_done': fields.function(_get_data,string='%Done', method=True,type="float"),
'perc_cancel': fields.function(_get_data,string='%Cancel', method=True,type="float"),
'delay_close': fields.char('Delay to close', size=20, readonly=True),
}
_order = 'name desc, section_id'
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_crm_job_section')
cr.execute("""
create or replace view report_crm_job_section as (
select
min(c.id) as id,
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
count(*) as nbr_cases,
c.section_id as section_id,
0 as avg_answers,
0.0 as perc_done,
0.0 as perc_cancel,
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
from
crm_job c
group by to_char(c.create_date, 'YYYY'),to_char(c.create_date, 'MM'),c.section_id
)""")
report_crm_job_section()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+197
View File
@@ -0,0 +1,197 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--
jobs by user and section
-->
<record id="view_crm_job_user_tree" model="ir.ui.view">
<field name="name">report.crm.job.user.tree</field>
<field name="model">report.crm.job.user</field>
<field name="inherit_id" ref="report_crm.view_crm_case_user_tree"/>
<field name="type">tree</field>
<field name="arch" type="xml">
<field name="nbr" position="after">
<field name="delay_close"/>
<field name="amount_revenue"/>
<field name="amount_costs"/>
<field name="amount_revenue_prob"/>
<field name="probability"/>
</field>
</field>
</record>
<record id="view_crm_job_user_form" model="ir.ui.view">
<field name="name">report.crm.job.user.form</field>
<field name="model">report.crm.job.user</field>
<field name="inherit_id" ref="report_crm.view_crm_case_user_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="nbr" position="after">
<field name="delay_close"/>
<field name="amount_revenue"/>
<field name="amount_costs"/>
<field name="amount_revenue_prob"/>
<field name="probability"/>
</field>
</field>
</record>
<record id="view_crm_job_user_graph" model="ir.ui.view">
<field name="name">report.crm.job.user.graph</field>
<field name="model">report.crm.job.user</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph orientation="horizontal" string="jobs by User and Section" type="bar">
<field name="state"/>
<field name="nbr" operator="+"/>
<field group="True" name="user_id"/>
</graph>
</field>
</record>
<record id="view_crm_job_user_filter" model="ir.ui.view">
<field name="name">report.crm.job.user.select</field>
<field name="model">report.crm.job.user</field>
<field name="inherit_id" ref="report_crm.view_crm_case_user_filter"/>
<field name="type">search</field>
<field name="arch" type="xml">
<field name="state" position="before">
</field>
</field>
</record>
<record id="action_report_crm_job_user_tree" model="ir.actions.act_window">
<field name="name">Jobs by User and Section</field>
<field name="res_model">report.crm.job.user</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="view_id" ref="view_crm_job_user_graph"/>
<field name="search_view_id" ref="view_crm_job_user_filter"/>
</record>
<menuitem
id="hr.menu_hr_reporting"
name="Reporting"
parent="hr.menu_hr_root"
sequence="40" />
<menuitem name="Jobs" id="menu_crm_jobs_tree" parent="hr.menu_hr_reporting"/>
<menuitem action="action_report_crm_job_user_tree" id="menu_crm_job_user_tree" parent="menu_crm_jobs_tree"/>
<!-- # jobs by section and category of case -->
<record id="view_crm_job_categ_tree" model="ir.ui.view">
<field name="name">report.crm.job.categ.tree</field>
<field name="model">report.crm.job.categ</field>
<field name="inherit_id" ref="report_crm.view_crm_case_categ_tree"/>
<field name="type">tree</field>
<field name="arch" type="xml">
<field name="nbr" position="after">
<field name="delay_close"/>
<field name="amount_revenue"/>
<field name="amount_costs"/>
<field name="amount_revenue_prob"/>
<field name="probability"/>
</field>
</field>
</record>
<record id="view_crm_job_categ_form" model="ir.ui.view">
<field name="name">report.crm.job.categ.form</field>
<field name="model">report.crm.job.categ</field>
<field name="inherit_id" ref="report_crm.view_crm_case_categ_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="nbr" position="after">
<field name="delay_close"/>
<field name="amount_revenue"/>
<field name="amount_costs"/>
<field name="amount_revenue_prob"/>
<field name="probability"/>
</field>
</field>
</record>
<record id="view_crm_job_categ_graph" model="ir.ui.view">
<field name="name">report.crm.job.categ.graph</field>
<field name="model">report.crm.job.categ</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph orientation="horizontal" string="jobs by Section and Categories" type="bar">
<field name="state"/>
<field name="nbr" operator="+"/>
<field group="True" name="categ_id"/>
</graph>
</field>
</record>
<record id="view_crm_job_categ_filter" model="ir.ui.view">
<field name="name">report.crm.job.categ.select</field>
<field name="model">report.crm.job.categ</field>
<field name="inherit_id" ref="report_crm.view_crm_case_categ_filter"/>
<field name="type">search</field>
<field name="arch" type="xml">
<field name="state" position="before">
</field>
</field>
</record>
<record id="action_report_crm_job_categ_tree" model="ir.actions.act_window">
<field name="name">Jobs by Categories and Section</field>
<field name="res_model">report.crm.job.categ</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="view_id" ref="view_crm_job_categ_graph"/>
<field name="search_view_id" ref="view_crm_job_categ_filter"/>
</record>
<menuitem action="action_report_crm_job_categ_tree" id="menu_crm_job_categ_tree" parent="menu_crm_jobs_tree"/>
<!-- jobs by Section -->
<record id="view_report_crm_job_section_tree" model="ir.ui.view">
<field name="name">report.crm.job.section.tree</field>
<field name="model">report.crm.job.section</field>
<field name="inherit_id" ref="report_crm.view_report_crm_case_section_tree"/>
<field name="type">tree</field>
<field name="arch" type="xml">
<field name="nbr_cases" position="after">
<field name="avg_answers"/>
<field name="perc_done" select="2"/>
<field name="perc_cancel" select="2"/>
<field name="delay_close"/>
</field>
</field>
</record>
<record id="view_report_crm_job_section_graph" model="ir.ui.view">
<field name="name">report.crm.job.section.graph</field>
<field name="model">report.crm.job.section</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph orientation="horizontal" string="jobs by Section" type="bar">
<field name="name"/>
<field name="nbr_cases" operator="+"/>
</graph>
</field>
</record>
<record id="view_report_crm_job_section_filter" model="ir.ui.view">
<field name="name">report.crm.job.section.select</field>
<field name="model">report.crm.job.section</field>
<field name="inherit_id" ref="report_crm.view_report_crm_case_section_filter"/>
<field name="type">search</field>
<field name="arch" type="xml">
<field name="nbr_cases" position="before">
</field>
</field>
</record>
<record id="action_report_crm_job_section_tree" model="ir.actions.act_window">
<field name="name">Jobs by Section</field>
<field name="res_model">report.crm.job.section</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="view_id" ref="view_report_crm_job_section_graph"/>
<field name="search_view_id" ref="view_report_crm_job_section_filter"/>
</record>
<menuitem action="action_report_crm_job_section_tree" id="menu_crm_job_section_tree" parent="menu_crm_jobs_tree"/>
</data>
</openerp>
+2 -3
View File
@@ -25,12 +25,11 @@
'version': '1.3',
'category': 'Generic Modules/CRM & SRM',
'description': """
This module allow users to perform segmentation within partners.
It use the profiles criteria from the earlier segmentation module and improve it thanks to the new concept of questionnaire. You can now regroup questions into a questionnaire and directly use it on a partner.
This module allows users to perform segmentation within partners.
It uses the profiles criteria from the earlier segmentation module and improve it. Thanks to the new concept of questionnaire. You can now regroup questions into a questionnaire and directly use it on a partner.
It also has been merged with the earlier CRM & SRM segmentation tool because they were overlapping.
The menu items related are in "CRM & SRM\Configuration\Segmentations"
+1 -1
View File
@@ -172,7 +172,7 @@
</group>
</page>
<page string="Sales Purchase">
<!-- <field name="sales_purchase_active"/> -->
<field name="sales_purchase_active"/>
<separator string="State of Mind Computation" colspan="4"/>
<field name="som_interval"/>
<field name="som_interval_max"/>
+2
View File
@@ -23,4 +23,6 @@
import crm_project_bug
import crm_project_feature
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+1
View File
@@ -39,6 +39,7 @@
'crm_bugs_menu.xml',
'crm_feature_view.xml',
'crm_feature_menu.xml',
'report_crm_project_bug_view.xml',
'security/crm_project_security.xml'
],
'demo_xml': ['crm_bugs_demo.xml'],
+24
View File
@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import report_crm_project_bug
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,131 @@
from osv import fields,osv
import tools
class report_crm_project_bug_user(osv.osv):
_name = "report.crm.project.bug.user"
_description = "Project Bug by user and section"
_auto = False
_inherit = "report.crm.case.user"
_columns = {
'probability': fields.float('Avg. Probability', readonly=True),
'amount_revenue': fields.float('Est.Revenue', readonly=True),
'amount_costs': fields.float('Est.Cost', readonly=True),
'amount_revenue_prob': fields.float('Est. Rev*Prob.', readonly=True),
'delay_close': fields.char('Delay to close', size=20, readonly=True),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_crm_project_bug_user')
cr.execute("""
create or replace view report_crm_project_bug_user as (
select
min(c.id) as id,
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
c.state,
c.user_id,
c.section_id,
count(*) as nbr,
sum(planned_revenue) as amount_revenue,
sum(planned_cost) as amount_costs,
sum(planned_revenue*probability)::decimal(16,2) as amount_revenue_prob,
avg(probability)::decimal(16,2) as probability,
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
from
crm_project_bug c
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state, c.user_id,c.section_id
)""")
report_crm_project_bug_user()
class report_crm_project_bug_categ(osv.osv):
_name = "report.crm.project.bug.categ"
_description = "Project Bug by section and category"
_auto = False
_inherit = "report.crm.case.categ"
_columns = {
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.project.bug')]"),
'amount_revenue': fields.float('Est.Revenue', readonly=True),
'amount_costs': fields.float('Est.Cost', readonly=True),
'amount_revenue_prob': fields.float('Est. Rev*Prob.', readonly=True),
'probability': fields.float('Avg. Probability', readonly=True),
'delay_close': fields.char('Delay Close', size=20, readonly=True),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_crm_project_bug_categ')
cr.execute("""
create or replace view report_crm_project_bug_categ as (
select
min(c.id) as id,
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
c.categ_id,
c.state,
c.section_id,
count(*) as nbr,
sum(planned_revenue) as amount_revenue,
sum(planned_cost) as amount_costs,
sum(planned_revenue*probability)::decimal(16,2) as amount_revenue_prob,
avg(probability)::decimal(16,2) as probability,
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
from
crm_project_bug c
group by c.categ_id,to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state,c.section_id
)""")
report_crm_project_bug_categ()
class report_crm_project_bug_section(osv.osv):
_name = "report.crm.project.bug.section"
_description = "Project bug by Section"
_auto = False
_inherit = "report.crm.case.section"
def _get_data(self, cr, uid, ids, field_name, arg, context={}):
res = {}
state_perc = 0.0
avg_ans = 0.0
for case in self.browse(cr, uid, ids, context):
if field_name != 'avg_answers':
state = field_name[5:]
cr.execute("select count(*) from crm_project_bug where section_id =%s and state='%s'"%(case.section_id.id,state))
state_cases = cr.fetchone()[0]
perc_state = (state_cases / float(case.nbr_cases) ) * 100
res[case.id] = perc_state
else:
cr.execute('select count(*) from crm_case_log l where l.section_id=%s'%(case.section_id.id))
logs = cr.fetchone()[0]
avg_ans = logs / case.nbr_cases
res[case.id] = avg_ans
return res
_columns = {
'avg_answers': fields.function(_get_data,string='Avg. Answers', method=True,type="integer"),
'perc_done': fields.function(_get_data,string='%Done', method=True,type="float"),
'perc_cancel': fields.function(_get_data,string='%Cancel', method=True,type="float"),
'delay_close': fields.char('Delay to close', size=20, readonly=True),
}
_order = 'name desc, section_id'
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_crm_project_bug_section')
cr.execute("""
create or replace view report_crm_project_bug_section as (
select
min(c.id) as id,
to_char(c.create_date, 'YYYY') as name,
to_char(c.create_date, 'MM') as month,
count(*) as nbr_cases,
c.section_id as section_id,
0 as avg_answers,
0.0 as perc_done,
0.0 as perc_cancel,
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
from
crm_project_bug c
group by to_char(c.create_date, 'YYYY'),to_char(c.create_date, 'MM'),c.section_id
)""")
report_crm_project_bug_section()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,193 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--
Project Bug by user and section
-->
<record id="view_crm_project_bug_user_tree" model="ir.ui.view">
<field name="name">report.crm.project.bug.user.tree</field>
<field name="model">report.crm.project.bug.user</field>
<field name="inherit_id" ref="report_crm.view_crm_case_user_tree"/>
<field name="type">tree</field>
<field name="arch" type="xml">
<field name="nbr" position="after">
<field name="delay_close"/>
<field name="amount_revenue"/>
<field name="amount_costs"/>
<field name="amount_revenue_prob"/>
<field name="probability"/>
</field>
</field>
</record>
<record id="view_crm_project_bug_user_form" model="ir.ui.view">
<field name="name">report.crm.project.bug.user.form</field>
<field name="model">report.crm.project.bug.user</field>
<field name="inherit_id" ref="report_crm.view_crm_case_user_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="nbr" position="after">
<field name="delay_close"/>
<field name="amount_revenue"/>
<field name="amount_costs"/>
<field name="amount_revenue_prob"/>
<field name="probability"/>
</field>
</field>
</record>
<record id="view_crm_project_bug_user_graph" model="ir.ui.view">
<field name="name">report.crm.project.bug.user.graph</field>
<field name="model">report.crm.project.bug.user</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph orientation="horizontal" string="Project Bug by User and Section" type="bar">
<field name="state"/>
<field name="nbr" operator="+"/>
<field group="True" name="user_id"/>
</graph>
</field>
</record>
<record id="view_crm_project_bug_user_filter" model="ir.ui.view">
<field name="name">report.crm.project.bug.user.select</field>
<field name="model">report.crm.project.bug.user</field>
<field name="inherit_id" ref="report_crm.view_crm_case_user_filter"/>
<field name="type">search</field>
<field name="arch" type="xml">
<field name="state" position="before">
</field>
</field>
</record>
<record id="action_report_crm_project_bug_user_tree" model="ir.actions.act_window">
<field name="name">Project Bug by User and Section</field>
<field name="res_model">report.crm.project.bug.user</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="view_id" ref="view_crm_project_bug_user_graph"/>
<field name="search_view_id" ref="view_crm_project_bug_user_filter"/>
</record>
<menuitem id="menu_project_report" name="Reporting" parent="project.menu_main" sequence="50"/>
<menuitem name="Project Bug" id="menu_crm_project_bug_tree" parent="menu_project_report"/>
<menuitem action="action_report_crm_project_bug_user_tree" id="menu_crm_project_bug_user_tree" parent="menu_crm_project_bug_tree"/>
<!-- # Project Bug by section and category of case -->
<record id="view_crm_project_bug_categ_tree" model="ir.ui.view">
<field name="name">report.crm.project.bug.categ.tree</field>
<field name="model">report.crm.project.bug.categ</field>
<field name="inherit_id" ref="report_crm.view_crm_case_categ_tree"/>
<field name="type">tree</field>
<field name="arch" type="xml">
<field name="nbr" position="after">
<field name="delay_close"/>
<field name="amount_revenue"/>
<field name="amount_costs"/>
<field name="amount_revenue_prob"/>
<field name="probability"/>
</field>
</field>
</record>
<record id="view_crm_project_bug_categ_form" model="ir.ui.view">
<field name="name">report.crm.project.bug.categ.form</field>
<field name="model">report.crm.project.bug.categ</field>
<field name="inherit_id" ref="report_crm.view_crm_case_categ_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="nbr" position="after">
<field name="delay_close"/>
<field name="amount_revenue"/>
<field name="amount_costs"/>
<field name="amount_revenue_prob"/>
<field name="probability"/>
</field>
</field>
</record>
<record id="view_crm_project_bug_categ_graph" model="ir.ui.view">
<field name="name">report.crm.project.bug.categ.graph</field>
<field name="model">report.crm.project.bug.categ</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph orientation="horizontal" string="project_bugs by Section and Categories" type="bar">
<field name="state"/>
<field name="nbr" operator="+"/>
<field group="True" name="categ_id"/>
</graph>
</field>
</record>
<record id="view_crm_project_bug_categ_filter" model="ir.ui.view">
<field name="name">report.crm.project.bug.categ.select</field>
<field name="model">report.crm.project.bug.categ</field>
<field name="inherit_id" ref="report_crm.view_crm_case_categ_filter"/>
<field name="type">search</field>
<field name="arch" type="xml">
<field name="state" position="before">
</field>
</field>
</record>
<record id="action_report_crm_project_bug_categ_tree" model="ir.actions.act_window">
<field name="name">Project Bugs by Categories and Section</field>
<field name="res_model">report.crm.project.bug.categ</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="view_id" ref="view_crm_project_bug_categ_graph"/>
<field name="search_view_id" ref="view_crm_project_bug_categ_filter"/>
</record>
<menuitem action="action_report_crm_project_bug_categ_tree" id="menu_crm_project_bug_categ_tree" parent="menu_crm_project_bug_tree"/>
<!-- Project Bug by Section -->
<record id="view_report_crm_project_bug_section_tree" model="ir.ui.view">
<field name="name">report.crm.project.bug.section.tree</field>
<field name="model">report.crm.project.bug.section</field>
<field name="inherit_id" ref="report_crm.view_report_crm_case_section_tree"/>
<field name="type">tree</field>
<field name="arch" type="xml">
<field name="nbr_cases" position="after">
<field name="avg_answers"/>
<field name="perc_done" select="2"/>
<field name="perc_cancel" select="2"/>
<field name="delay_close"/>
</field>
</field>
</record>
<record id="view_report_crm_project_bug_section_graph" model="ir.ui.view">
<field name="name">report.crm.project.bug.section.graph</field>
<field name="model">report.crm.project.bug.section</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph orientation="horizontal" string="project_bugs by Section" type="bar">
<field name="name"/>
<field name="nbr_cases" operator="+"/>
</graph>
</field>
</record>
<record id="view_report_crm_project_bug_section_filter" model="ir.ui.view">
<field name="name">report.crm.project.bug.section.select</field>
<field name="model">report.crm.project.bug.section</field>
<field name="inherit_id" ref="report_crm.view_report_crm_case_section_filter"/>
<field name="type">search</field>
<field name="arch" type="xml">
<field name="nbr_cases" position="before">
</field>
</field>
</record>
<record id="action_report_crm_project_bug_section_tree" model="ir.actions.act_window">
<field name="name">Project Bugs by Section</field>
<field name="res_model">report.crm.project.bug.section</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="view_id" ref="view_report_crm_project_bug_section_graph"/>
<field name="search_view_id" ref="view_report_crm_project_bug_section_filter"/>
</record>
<menuitem action="action_report_crm_project_bug_section_tree" id="menu_crm_project_bug_section_tree" parent="menu_crm_project_bug_tree"/>
</data>
</openerp>
+6
View File
@@ -27,6 +27,12 @@
'description': """This is a complete document management system:
* User Authentication
* Document Indexation
ATTENTION:
- When you install this module in a running company that have already PDF files stored into the database,
you will lose them all.
- After installing this module PDF's are not longer stored into the database,
but in the servers rootpad like /server/bin/filestore.
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
+1
View File
@@ -25,6 +25,7 @@ import os
import tools
import base64
from tools.misc import ustr
from tools.translate import _
from osv.orm import except_orm
+2 -1
View File
@@ -36,8 +36,9 @@ class document_directory_content(osv.osv):
return super(document_directory_content, self).process_write(cr, uid, node, data, context)
content = self.browse(cr, uid, node.cnt_id, context)
fobj = self.pool.get(content.object_id.model)
if not context:
context = {}
fobj.import_cal(cr, uid, base64.encodestring(data), context=context)
return True
def process_read(self, cr, uid, node, context=None):
+25
View File
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import document_change
import document_change_mailgate
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+47
View File
@@ -0,0 +1,47 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Integrated Document Management System',
'version': '1.99',
'category': 'Generic Modules/Others',
'description': """The document_change module allows to track and manage process changes to
update documents in directories, and keep track of these updates. You
can define control points, phase of changes.
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['base', 'document_ftp','mail_gateway'],
'init_xml': ['document_change_data.xml'],
'update_xml': ['document_change_view.xml',
'document_change_sequence.xml',
'document_change_workflow.xml',
'document_phase_workflow.xml',
'document_process_workflow.xml',
],
'demo_xml': [ ],
'installable': True,
'active': False,
'certificate': None,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+247
View File
@@ -0,0 +1,247 @@
#-*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import tools
from osv import fields, osv
import os
import pooler
import netsvc
from tools.translate import _
class doucment_change_process_phase_type(osv.osv):
_name = "document.change.process.phase.type"
doucment_change_process_phase_type()
class document_change_type(osv.osv):
_name = "document.change.type"
_description = "Document Change Type"
_columns = {
'name': fields.char("Document Change Type", size=64,required=True),
'phase_type_ids': fields.many2many('document.change.process.phase.type','document_type_phase_type_rel','document_type_id','phase_type_id','Phase Type'),
'directory_id' :fields.many2one('document.directory','Pending Directory'),
'template_document_id':fields.many2one('ir.attachment','Document')
}
document_change_type()
class doucment_change_process_phase_type(osv.osv):
_name = "document.change.process.phase.type"
_description = "Document Change Process Phase Type"
_columns = {
'name': fields.char("Document Changed Process Type", size=64),
'sequence': fields.integer('Sequence'),
'active': fields.boolean('Active'),
'document_type_ids': fields.many2many('document.change.type','phase_type_document_type_rel','phase_type_id','document_type_id','Document Type'),
}
_defaults = {
'active': lambda *a:1,
}
doucment_change_process_phase_type()
class doucment_change_process(osv.osv):
_name = "document.change.process"
doucment_change_process()
class doucment_change_process_phase(osv.osv):
_name = "document.change.process.phase"
_description = "Document Change Process Phase"
_columns = {
'name': fields.char("Name", size=64, required=True),
'process_id':fields.many2one('document.change.process','Process Change'),
'sequence': fields.integer('Sequence'),
'update_document': fields.selection([('at_endPhase', 'End Phase'),('at_endprocess', 'End Process')], 'Update Document', required=True),
'type': fields.selection([('control_required', 'Control Required'),('no_control', 'No Control')], 'Type'),
'date_control': fields.date('Control Date', select=True),
'phase_type_id':fields.many2one('document.change.process.phase.type','Phase Type'),
'state': fields.selection([('draft', 'Draft'),('in_process', 'Started'),('to_validate', 'To Validate'),('done', 'Done')], 'State',readonly=True),
'phase_document_ids':fields.many2many('ir.attachment','phase_document_rel','phase_id','document_id','Document'),
}
_defaults = {
'state': lambda *a: 'draft',
'update_document': lambda *a:'at_endPhase',
'type':lambda *a: 'no_control',
}
def do_draft(self, cr, uid, ids, *args):
self.write(cr, uid, ids, {'state':'draft'})
return True
def do_confirm(self, cr, uid, ids, *args):
self.write(cr, uid, ids, {'state':'to_validate'})
return True
def do_start(self, cr, uid, ids, *args):
self.write(cr, uid, ids, {'state':'in_process'})
return True
def do_done(self, cr, uid, ids, *args):
self.write(cr, uid, ids, {'state':'done'})
return True
doucment_change_process_phase()
class document_change_process_model(osv.osv):
_name = "document.change.process.model"
_description = "Document Change Process model"
_columns = {
'name': fields.char("Changed Process Model", size=64,required=True),
'sequence': fields.integer('Sequence'),
'phase_type_ids':fields.many2many('document.change.process.phase.type','process_model_phase_type_rel','process_model_id','phase_type_id','Phase Type'),
}
document_change_process_model()
class document_change_process_type(osv.osv):
_name = "document.change.process.type"
_description = "Document Change Process Type"
_columns = {
'name': fields.char("Changed Process Type", size=64),
}
document_change_process_type()
class document_change_process_email(osv.osv):
_name = "document.change.process.mail"
_description = "Document Change Process Email Notification"
_columns = {
'name': fields.char("Email", size=64),
'type':fields.selection([('start_end', 'Start/End Process '),('change_all', 'Change in All Document')], 'Notification Type'),
'process_id':fields.many2one('document.change.process','Process Change'),
}
document_change_process_email()
class doucment_change_process(osv.osv):
_name = "document.change.process"
_description = "Document Change Process"
def _latestmodification(self, cr, uid, ids, field_name, arg, context={}):
res = {}
#TODOto calculate latest modified date from all related documents
return res
_columns = {
'name': fields.char("Process Change", size=64, required=True, select=True),
'process_type_id' :fields.many2one('document.change.process.type','Type Change'),
'description': fields.char("Small Description", size=64),
'change_description':fields.text('Changed Description'),
'structure_id' :fields.many2one('document.directory','Structure ID'),
'process_model_id':fields.many2one('document.change.process.model','Process Model'),
'user_id':fields.many2one('res.users','Change Owner'),
'create_date':fields.datetime('Creation',readonly=True),
'latest_modified_date':fields.function(_latestmodification, method=True, type='date', string="Lastest Modification"), #TODO no year!
'date_expected':fields.datetime('Expected Production'),
'state':fields.selection([('draft', 'Draft'),('in_progress', 'In Progress'),('to_validate', 'To Validate'), ('pending', 'Pending'), ('done', 'Done'),('cancel','Cancelled')], 'state', readonly=True),
'process_phase_ids':fields.one2many('document.change.process.phase','process_id','Phase'),
'pending_directory_id' :fields.many2one('document.directory','Pending Directory ID'),
'date_control': fields.date('Control Date'), #TODO: make relate field with current_phase_id.date_control
'progress': fields.float('Progress'), #TODO : functio field: calculate progress
'current_phase_id': fields.many2one('document.change.process.phase','Current Phase'), # TODO: function field. find out in process phase
'process_document_ids': fields.many2many('ir.attachment','document_changed_process_rel','process_id','change_id','Document To Change'),
}
_defaults = {
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'document.change.process'),
'state': lambda *a: 'draft',
}
def do_start(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'in_progress'},context=context)
return True
def do_pending(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'pending'},context=context)
return True
def do_confirm(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'to_validate'},context=context)
return True
def do_done(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'done'},context=context)
return True
def do_cancel(self, cr, uid, ids, context={}):
return self.write(cr, uid, ids, {'state':'cancel'},context=context)
def generate_phases(self, cr, uid, ids, *args):
phase_obj = self.pool.get('document.change.process.phase')
phase_type_obj = self.pool.get('document.change.process.phase.type')
document_type_obj = self.pool.get('document.change.type')
document_obj = self.pool.get('ir.attachment')
for process in self.browse(cr, uid, ids):
if process.process_model_id:
for phase_type_id in process.process_model_id.phase_type_ids:
phase_type = phase_type_obj.browse(cr, uid, phase_type_id.id)
phase_value = {
'name' : '%s-%s' %(phase_type.name, process.name),
'phase_type_id': phase_type_id.id,
'process_id': process.id
}
phase_id = phase_obj.create(cr, uid, phase_value)
cr.execute('select document_type_id from document_type_phase_type_rel where phase_type_id = %s' , phase_type_id.id)
document_type_ids = map(lambda x: x[0], cr.fetchall())
document_ids = document_obj.search(cr, uid, [
('parent_id','=',process.structure_id and process.structure_id.id),
('change_type_id','in',document_type_ids)])
for document_id in document_ids:
vals = {'process_phase_id':phase_id}
if process.pending_directory_id:
vals.update({'parent_id':process.pending_directory_id.id})
document_obj.copy(cr, uid, document_id, vals)
doucment_change_process()
class document_file(osv.osv):
_inherit = 'ir.attachment'
_columns = {
'change_type_id':fields.many2one('document.change.type','Document Type'),
'state': fields.selection([('in_production', 'In Production'), ('change_request', 'Change Request'),('change_propose', 'Change Proposed'), ('to_update', 'To Update'), ('cancel', 'Cancel')], 'State'),
'target_document_id': fields.many2one('ir.attachment', 'Target Document'),
'target':fields.binary('Target'),
'process_phase_id' :fields.many2one('document.change.process.phase','Process Phase'),
'progress': fields.float('Progress'), #TODO : functio field: calculate progress
'change_process_id': fields.related('process_phase_id', 'process_id', type='many2one', relation='document.change.process', string='Change Process'),
}
_defaults = {
'state': lambda *a: 'in_production',
}
def do_change_request(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'change_request'},context=context)
return True
def do_change_propose(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'change_propose'},context=context)
return True
def do_to_update(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'to_update'},context=context)
return True
def do_production(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'in_production'},context=context)
return True
def do_cancel(self, cr, uid, ids, context={}):
return self.write(cr, uid, ids, {'state':'cancel'},context=context)
document_file()
@@ -0,0 +1,175 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
<!-- Structure Data -->
<record model="document.directory" id="dir_root">
<field name="name">Gosselies</field>
</record>
<record model="document.directory" id="dir_bat_e">
<field name="name">Bat E</field>
<field name="parent_id" ref="dir_root"/>
</record>
<record model="document.directory" id="dir_bat_z">
<field name="name">Bat Z</field>
<field name="parent_id" ref="dir_root"/>
</record>
<record model="document.directory" id="dir_mq_section">
<field name="name">MQ Section</field>
<field name="parent_id" ref="dir_bat_e"/>
</record>
<record model="document.directory" id="dir_section_x">
<field name="name">Section X</field>
<field name="parent_id" ref="dir_mq_section"/>
</record>
<record model="document.directory" id="dir_section_y">
<field name="name">Section Y</field>
<field name="parent_id" ref="dir_mq_section"/>
</record>
<record model="document.directory" id="dir_ws_1bc">
<field name="name">Work Station 1BC</field>
<field name="parent_id" ref="dir_section_x"/>
</record>
<record model="document.directory" id="dir_ws_2bc">
<field name="name">Work Station 2BC</field>
<field name="parent_id" ref="dir_section_x"/>
</record>
<record model="document.directory" id="dir_ws_3bc">
<field name="name">Work Station 3BC</field>
<field name="parent_id" ref="dir_section_y"/>
</record>
<record model="document.directory" id="dir_family1">
<field name="name">Family 1</field>
<field name="parent_id" ref="dir_ws_1bc"/>
</record>
<record model="document.directory" id="dir_family2">
<field name="name">Family 2</field>
<field name="parent_id" ref="dir_ws_1bc"/>
</record>
<record model="document.directory" id="dir_family3">
<field name="name">Family 3</field>
<field name="parent_id" ref="dir_ws_2bc"/>
</record>
<record model="document.directory" id="dir_family4">
<field name="name">Family 4</field>
<field name="parent_id" ref="dir_ws_3bc"/>
</record>
<record model="document.directory" id="dir_vsm">
<field name="name">VSM</field>
<field name="parent_id" ref="dir_bat_z"/>
</record>
<record model="document.directory" id="dir_takt_time">
<field name="name">Takt Time</field>
<field name="parent_id" ref="dir_bat_z"/>
</record>
<!-- Documents -->
<record model="ir.attachment" id="doc_FIE_template">
<field name="name">FIE_template</field>
<field name="datas_fname">FIE_template.xls</field>
<field name="parent_id" ref="dir_root"/>
</record>
<record model="ir.attachment" id="doc_SFMEA_template">
<field name="name">SFMEA_template</field>
<field name="datas_fname">SFMEA_template.xls</field>
<field name="parent_id" ref="dir_root"/>
</record>
<record model="ir.attachment" id="doc_ProjectCharter_Template">
<field name="name">ProjectCharter_Template</field>
<field name="datas_fname">ProjectCharter_Template.ppt</field>
<field name="parent_id" ref="dir_root"/>
</record>
<record model="ir.attachment" id="doc_TaktTime_template">
<field name="name">TaktTime_template</field>
<field name="datas_fname">TaktTime_template.xls</field>
<field name="parent_id" ref="dir_takt_time"/>
</record>
<record model="ir.attachment" id="doc_FIE_05466_001">
<field name="name">FIE_05466_001</field>
<field name="datas_fname">FIE_05466_001.xls</field>
<field name="parent_id" ref="dir_root"/>
</record>
<record model="ir.attachment" id="doc_SFMEA_0581_001">
<field name="name">SFMEA_0581_001</field>
<field name="datas_fname">SFMEA_0581_001.xls</field>
<field name="parent_id" ref="dir_root"/>
</record>
<record model="ir.attachment" id="doc_SFMEA_0581_002">
<field name="name">SFMEA_0581_002</field>
<field name="datas_fname">SFMEA_0581_002.xls</field>
<field name="parent_id" ref="dir_root"/>
</record>
<record model="ir.attachment" id="doc_TaktTime_0549">
<field name="name">TaktTime_0549</field>
<field name="datas_fname">TaktTime_0549.xls</field>
<field name="parent_id" ref="dir_takt_time"/>
</record>
<!-- Document Change Types -->
<record model="document.change.type" id="type_project_charter">
<field name="name">Project Charter</field>
<field name="template_document_id" ref="doc_ProjectCharter_Template"/>
</record>
<record model="document.change.type" id="type_vsm">
<field name="name">VSM</field>
</record>
<record model="document.change.type" id="type_takt_time">
<field name="name">Takt Time</field>
<field name="template_document_id" ref="doc_TaktTime_template"/>
</record>
<record model="document.change.type" id="type_FIE">
<field name="name">FIE</field>
<field name="template_document_id" ref="doc_FIE_template"/>
</record>
<record model="document.change.type" id="type_SFMEA">
<field name="name">SFMEA</field>
<field name="template_document_id" ref="doc_SFMEA_template"/>
</record>
<!-- Phase Types -->
<record model="document.change.process.phase.type" id="phase_type_concept">
<field name="name">Concept</field>
<field name="sequence">1</field>
<field eval="[(6, 0, [ref('type_project_charter'),ref('type_vsm'),ref('type_takt_time')])]" name="document_type_ids"/>
</record>
<record model="document.change.process.phase.type" id="phase_type_development">
<field name="name">Development</field>
<field name="sequence">2</field>
<field eval="[(6, 0, [ref('type_FIE'),ref('type_SFMEA')])]" name="document_type_ids"/>
</record>
<record model="document.change.process.phase.type" id="phase_type_validation">
<field name="name">Validation</field>
<field name="sequence">3</field>
<field eval="[(6, 0, [ref('type_FIE'),ref('type_SFMEA')])]" name="document_type_ids"/>
</record>
<!-- Change of Models Data -->
<record model="document.change.process.model" id="model_NPI">
<field name="name">NPI</field>
<field eval="[(6, 0, [ref('phase_type_concept'),ref('phase_type_development'),ref('phase_type_validation')])]" name="phase_type_ids"/>
</record>
<record model="document.change.process.model" id="model_minor_change">
<field name="name">Minor_change</field>
<field eval="[(6, 0, [ref('phase_type_development')])]" name="phase_type_ids"/>
</record>
<!-- Process Types -->
<record model="document.change.process.type" id="process_quality_alert">
<field name="name">Quality Alert</field>
</record>
<record model="document.change.process.type" id="process_new_product">
<field name="name">New Product</field>
</record>
<record model="document.change.process.type" id="process_red_risk">
<field name="name">Red Risk</field>
</record>
<record model="document.change.process.type" id="process_ci_card">
<field name="name">CI Card</field>
</record>
</data>
</openerp>
@@ -0,0 +1,99 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
import re
import os
import mx.DateTime
import base64
from tools.translate import _
import tools
from osv import fields,osv,orm
from osv.orm import except_orm
class document_file(osv.osv):
_inherit = "ir.attachment"
_columns = {
'email_notification_ids':fields.one2many('document.email.notes','document_id','Phase', readonly=True),
}
def msg_new(self, cr, uid, msg):
raise Exception(_('Sorry, Not Allowed to create document'))
return False
def msg_update(self, cr, uid, id, msg, data={}, default_act='pending'):
mailgate_obj = self.pool.get('mail.gateway')
msg_actions, body_data = mailgate_obj.msg_act_get(msg)
email_notify_data = {
'name' : msg['Subject'],
'description' : body_data,
'email' : msg['From'],
}
data.update({
'email_notification_ids': [(0, 0, email_notify_data)],
})
res = self.write(cr, uid, [id], data)
return res
def emails_get(self, cr, uid, ids, context={}):
res = []
if isinstance(ids, (str, int, long)):
select = [ids]
else:
select = ids
for document in self.browse(cr, uid, select):
user_email = (document.user_id and document.user_id.address_id and document.user_id.address_id.email) or False
res += [(user_email, False, False, False)]
if isinstance(ids, (str, int, long)):
return len(res) and res[0] or False
return res
def msg_send(self, cr, uid, id, *args, **argv):
return True
document_file()
class document_email_notes(osv.osv):
_name = "document.email.notes"
_description = "EMail Conversation Detail"
def _note_get(self, cursor, user, ids, name, arg, context=None):
res = {}
for hist in self.browse(cursor, user, ids, context or {}):
res[hist.id] = (hist.email or '/') + ' (' + str(hist.create_date) + ')\n'
res[hist.id] += (hist.description or '')
return res
_columns = {
'name': fields.char("Name", size=64, required=True, select=True),
'description': fields.text('Description'),
'note': fields.function(_note_get, method=True, string="Description", type="text"),
'email': fields.char('Email', size=84),
'create_date': fields.datetime('Created Date'),
'action': fields.char('Action', size=64),
'document_id': fields.many2one('ir.attachment','Document', required=True),
}
document_email_notes()
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<openerp>
<data>
<record id="seq_type_document_change_process" model="ir.sequence.type">
<field name="name">Document Change Process</field>
<field name="code">document.change.process</field>
</record>
<record model="ir.sequence" id="seq_document_change_process">
<field name="name">Document Change Process</field>
<field name="code">document.change.process</field>
<field name="prefix">PC</field>
<field name="padding">5</field>
</record>
</data>
</openerp>
@@ -0,0 +1,611 @@
<?xml version="1.0"?>
<openerp>
<data>
<menuitem name="Process Changes" icon="terp-stock" id="menu_process_changes"/>
<menuitem name="Process Changes" id="menu_document_process_changes" parent="menu_process_changes"/>
<menuitem name="Change Control" id="menu_change_control" parent="menu_process_changes"/>
<menuitem name="Reporting" id="menu_reporting" parent="menu_process_changes"/>
<menuitem name="Configuration" id="menu_configuration" parent="menu_process_changes"/>
<!--
Structure
-->
<record model="ir.ui.view" id="view_document_structure_form">
<field name="name">document.directory</field>
<field name="model">document.directory</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Structure">
<field name="name"/>
<field name="parent_id"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_document_structure_tree">
<field name="name">document.directory</field>
<field name="model">document.directory</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Structure">
<field name="name"/>
<field name="parent_id"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_document_structure_form">
<field name="type">ir.actions.act_window</field>
<field name="res_model">document.directory</field>
<field name="name">Structure</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_document_structure_tree"/>
</record>
<record id="action_document_structure_tree_view" model="ir.actions.act_window.view">
<field eval="1" name="sequence"/>
<field name="view_mode">tree</field>
<field name="act_window_id" ref="action_document_structure_form"/>
</record>
<record id="action_document_structure_form_view" model="ir.actions.act_window.view">
<field eval="2" name="sequence"/>
<field name="view_mode">form</field>
<field name="view_id" ref="view_document_structure_form"/>
<field name="act_window_id" ref="action_document_structure_form"/>
</record>
<menuitem name="Structure" id="menu_document_structure_config" parent="menu_configuration"/>
<menuitem action="action_document_structure_form" id="menu_structure_form" parent="menu_document_structure_config"/>
<act_window domain="[('structure_id', '=', active_id)]"
id="act_structure_process_changes"
name="Process Changes"
res_model="document.change.process"
src_model="document.directory"/>
<!--
Document Types
-->
<record model="ir.ui.view" id="view_document_type_form">
<field name="name">document.change.type.form</field>
<field name="model">document.change.type</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Document Types">
<field name="name" select="1"/>
<field name="directory_id"/>
<field name ="template_document_id"/>
<separator string="Associated Phase Types" colspan="4"/>
<field name="phase_type_ids" colspan="4" nolabel="1"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_document_type_tree">
<field name="name">document.change.type.tree</field>
<field name="model">document.change.type</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Document Types">
<field name="name"/>
<field name="directory_id"/>
<field name ="template_document_id"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_document_type_form">
<field name="type">ir.actions.act_window</field>
<field name="res_model">document.change.type</field>
<field name="name">Document Types</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="Documents" id="menu_document_type_config" parent="menu_configuration"/>
<menuitem action="action_document_type_form" id="menu_document_type_form" parent="menu_document_type_config"/>
<!--
Phase Types
-->
<record model="ir.ui.view" id="view_process_phase_type_form">
<field name="name">document.change.process.phase.type.form</field>
<field name="model">document.change.process.phase.type</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Phase Types">
<group colspan="4" col="6">
<field name="name" select="1" string="Phase Type"/>
<field name="sequence"/>
<field name="active"/>
</group>
<separator string="Associated Document Types" colspan="4"/>
<field name="document_type_ids" colspan="4" nolabel="1"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_process_phase_type_tree">
<field name="name">document.change.process.phase.type.tree</field>
<field name="model">document.change.process.phase.type</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Phase Types">
<field name="sequence"/>
<field name="name" string="Phase Type"/>
<field name="document_type_ids"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_process_phase_type_form">
<field name="type">ir.actions.act_window</field>
<field name="res_model">document.change.process.phase.type</field>
<field name="name">Types of Phases</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="Process Changes" id="menu_process_changes_config" parent="menu_configuration"/>
<menuitem action="action_process_phase_type_form" id="menu_phase_type_form" parent="menu_process_changes_config"/>
<!-- Document Change Process Type -->
<record model="ir.ui.view" id="view_change_process_type_form">
<field name="name">document.change.process.type.form</field>
<field name="model">document.change.process.type</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Phase Types">
<field name="name" select="1" string="Phase Type"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_change_processe_type_tree">
<field name="name">document.change.process.type.tree</field>
<field name="model">document.change.process.type</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Phase Types">
<field name="name" string="Phase Type"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_change_process_type_form">
<field name="type">ir.actions.act_window</field>
<field name="res_model">document.change.process.type</field>
<field name="name">Type Process</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem action="action_change_process_type_form" id="menu_change_process_type_form" parent="menu_process_changes_config"/>
<!--
Model of Changes
-->
<record model="ir.ui.view" id="view_model_change_form">
<field name="name">document.change.process.model.form</field>
<field name="model">document.change.process.model</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Model of Changes">
<field name="name" select="1"/>
<field name="sequence"/>
<separator string="Phase Type" colspan="4"/>
<field name="phase_type_ids" colspan="4" nolabel="1"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_model_change_tree">
<field name="name">document.change.process.model.tree</field>
<field name="model">document.change.process.model</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Model of Changes">
<field name="sequence"/>
<field name="name"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_model_change_form">
<field name="type">ir.actions.act_window</field>
<field name="res_model">document.change.process.model</field>
<field name="name">Model of Changes</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem action="action_model_change_form" id="menu_model_change_form" parent="menu_process_changes_config"/>
<!--
Documents
-->
<record model="ir.ui.view" id="view_document_form">
<field name="name">ir.attachment.form</field>
<field name="model">ir.attachment</field>
<field name="priority" eval="1"/>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Documents">
<group colspan="4" col="6">
<field name="name" select="1" string="Document Name" colspan="4"/>
<field name="parent_id"/>
<newline/>
<field name="datas_fname"/>
<field name="datas" filename="datas_fname" string="Content"/>
<field name="change_type_id"/>
</group>
<separator string="Change Control" colspan="4"/>
<group col="7" colspan="4">
<field name="state" readonly="1"/>
<button name="button_propose" states="change_request" string="Propose Change" icon="gtk-apply"/>
<button name="button_confirm" states="change_propose" string="To Validate" icon="gtk-apply"/>
<button name="button_validate" states="to_update" string="In Production" icon="gtk-apply"/>
<button name="button_request" states="cancel,in_production" string="Request Change" icon="gtk-media-play"/>
<button name="button_cancel" states="change_request,change_propose" string="Cancel" icon="gtk-cancel"/>
</group>
<newline/>
<field name="target_document_id"/>
<field name="target"/>
<newline/>
<separator string="Change Note" colspan="4"/>
<field colspan="4" name="description" nolabel="1"/>
<group colspan="2" col="2">
<separator string="Creation" colspan="2"/>
<field name="create_uid" readonly="1"/>
<field name="create_date" readonly="1"/>
</group>
<group colspan="2" col="2">
<separator string="Latest Modification" colspan="2"/>
<field name="write_date" readonly="1"/>
<field name="write_uid" readonly="1"/>
</group>
<field name="email_notification_ids" colspan="4" mode="tree, form" readonly="1" widget="one2many_list" nolabel="1">
<tree string="Notifications">
<field name="email"/>
<field name="create_date"/>
</tree>
<form string="Notifications">
<field name="email"/>
<field name="create_date"/>
<field name="name" string="Subject" colspan="4"/>
<separator string="Description" colspan="4"/>
<field colspan="4" name="description" nolabel="1"/>
</form>
</field>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_document_tree">
<field name="name">ir.attachment.tree</field>
<field name="model">ir.attachment</field>
<field name="type">tree</field>
<field name="priority" eval="1"/>
<field name="arch" type="xml">
<tree string="Documents">
<field name="name" string="Document"/>
<field name="parent_id" string="Directory"/>
<field name="change_type_id" string="Type"/>
<field name="state"/>
<field name="change_process_id" string="Proc Chg #"/>
<field name="user_id" string="Owner"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_document_graph">
<field name="name">ir.attachment.graph</field>
<field name="model">ir.attachment</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Documents by type" type="bar" orientation="vertical">
<field name="change_type_id"/>
<field name="name" operator="+"/>
</graph>
</field>
</record>
<record model="ir.ui.view" id="view_document_search">
<field name="name">ir.attachment.search</field>
<field name="model">ir.attachment</field>
<field name="type">search</field>
<field name="priority" eval="1"/>
<field name="arch" type="xml">
<search string="Documents">
<group col="7" colspan="4">
<filter domain="[('state','=','change_request')]" string="To Change" icon="gtk-apply"/>
<filter domain="[('state','=','to_update')]" string="To Validate" icon="gtk-execute"/>
<field name="change_type_id" string="Type of Documents" select="1"/>
<field name="parent_id" select="1"/>
<field name="create_uid" string="Owner" select="1"/>
</group>
<group expand="1" string="Group By..." col="20" colspan="4">
<filter domain="[]" string="By Owner" icon="terp-hr" context="{'group_by':'create_uid'}" help="Documents by owner"/>
<filter domain="[]" string="By Directory" icon="terp-hr" context="{'group_by':'parent_id'}" help="Documents by directory"/>
<filter domain="[]" string="By Type of Documents" icon="terp-hr" context="{'group_by':'change_type_id'}" help="Documents by type"/>
</group>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="action_document_form">
<field name="type">ir.actions.act_window</field>
<field name="res_model">ir.attachment</field>
<field name="name">Documents</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_document_search"/>
</record>
<record id="action_document_tree_view" model="ir.actions.act_window.view">
<field eval="1" name="sequence"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_document_tree"/>
<field name="act_window_id" ref="action_document_form"/>
</record>
<record id="action_document_form_view" model="ir.actions.act_window.view">
<field eval="2" name="sequence"/>
<field name="view_mode">form</field>
<field name="view_id" ref="view_document_form"/>
<field name="act_window_id" ref="action_document_form"/>
</record>
<record id="action_document_graph_view" model="ir.actions.act_window.view">
<field eval="3" name="sequence"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="view_document_graph"/>
<field name="act_window_id" ref="action_document_form"/>
</record>
<menuitem action="action_document_form" id="menu_documents_form" parent="menu_document_process_changes"/>
<record model="ir.actions.act_window" id="action_document_without_type_form">
<field name="type">ir.actions.act_window</field>
<field name="res_model">ir.attachment</field>
<field name="name">Documents Without Type</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_document_tree"/>
<field name="domain">[('change_type_id','=',',False)]</field>
</record>
<menuitem action="action_document_without_type_form" id="menu_documents_without_type_form" parent="menu_change_control"/>
<record model="ir.actions.act_window" id="action_document_to_update_form">
<field name="type">ir.actions.act_window</field>
<field name="res_model">ir.attachment</field>
<field name="name">Documents to Update</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_document_tree"/>
<field name="domain">[('state','=','to_update')]</field>
</record>
<menuitem action="action_document_to_update_form" id="menu_documents_to_update_form" parent="menu_change_control"/>
<!--
Phases
-->
<record model="ir.ui.view" id="view_process_phase_form">
<field name="name">document.change.process.phase.form</field>
<field name="model">document.change.process.phase</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Phases">
<group colspan="4" col="6">
<field name="name" select="1"/>
<field name="process_id" string="Process Change"/>
<field name="sequence"/>
<newline/>
<field name="update_document" string="Update documents"/>
<field name="type" string="Type"/>
<field name="date_control" string="Control date" attrs="{'required':[('type','=','control_required')], 'invisible': [('type','!=','control_required')]}"/>
<field name="phase_type_id" string="Phase Type"/>
</group>
<separator colspan="4" string="Documents"/>
<field name="phase_document_ids" colspan="4" nolabel="1"/>
<newline/>
<group col="5" colspan="4">
<field name="state"/>
<button name="button_start" states="draft" string="Start" icon="gtk-go-forward"/>
<button name="button_confirm" states="in_process" string="To Validate" icon="gtk-execute"/>
<button name="button_end" states="to_validate" string="Done" icon="gtk-jump-to"/>
</group>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_process_phase_tree">
<field name="name">document.change.process.phase.tree</field>
<field name="model">document.change.process.phase</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Phases">
<field name="sequence"/>
<field name="name"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_process_phase_form">
<field name="type">ir.actions.act_window</field>
<field name="res_model">document.change.process.phase</field>
<field name="name">Phases</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem action="action_process_phase_form" id="menu_phases_form" parent="menu_document_process_changes"/>
<record model="ir.actions.act_window" id="action_process_phase_form_validate">
<field name="type">ir.actions.act_window</field>
<field name="res_model">document.change.process.phase</field>
<field name="name">Phases to Validate</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','=','to_validate')]</field>
</record>
<menuitem action="action_process_phase_form_validate" id="menu_phases_to_validate_form" parent="menu_change_control"/>
<act_window domain="[('change_type_id', '=', active_id)]"
id="act_documents_phases"
name="Documents"
res_model="ir.attachment"
src_model="document.change.process.phase"/>
<!--
Process Change
-->
<record model="ir.ui.view" id="view_process_form">
<field name="name">document.change.process.form</field>
<field name="model">document.change.process</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Process Change">
<group colspan="4" col="6">
<field name="name" select="1"/>
<field name="process_type_id" widget="selection" select="1"/>
<field name="structure_id" select="1"/>
<newline/>
<field name="description"/>
<group colspan="2" col="3">
<field name="process_model_id" widget="selection"/>
<button name="generate_phases" string="Generate Phases" type="object" icon="gtk-convert"/>
</group>
<field name="pending_directory_id"/>
</group>
<notebook colspan="4">
<page string="Process Definition">
<group col="2" colspan="2">
<separator string="Responsibles" colspan="2"/>
<field name="user_id"/>
</group>
<group col="2" colspan="2">
<separator string="Dates" colspan="2"/>
<field name="create_date"/>
<field name="latest_modified_date"/>
<field name="date_expected"/>
</group>
<newline />
<separator colspan="4" string="Change Description"/>
<field name="change_description" colspan="4" nolabel="1"/>
<newline/>
<group col="6" colspan="4">
<field name="state"/>
<button name="button_start" states="draft,pending" string="Start" icon="gtk-go-forward"/>
<button name="button_confirm" states="in_progress" string="Validate" icon="gtk-execute"/>
<button name="button_pending" states="in_progress" string="Pending" icon="gtk-media-pause"/>
<button name="button_done" states="to_validate" string="Done" icon="gtk-jump-to"/>
</group>
</page>
<page string="Phases">
<field name="process_phase_ids" mode="tree,form" widget="one2many_list" nolabel="1">
<tree string="Process Phases" editable="True">
<field name="name"/>
<field name="type"/>
<field name="phase_document_ids"/>
<field name="state"/>
</tree>
<form string="Process Phases">
<field name="name"/>
<field name="type"/>
<field name="phase_document_ids" colspan="4"/>
<field name="state"/>
</form>
</field>
</page>
<page string="Documents">
<field name="process_document_ids">
</field>
</page>
</notebook>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_process_tree">
<field name="name">document.change.process.tree</field>
<field name="model">document.change.process</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Process Change">
<field name="structure_id"/>
<field name="name" string="Proc Chg #"/>
<field name="description" string="Proc Chg Title"/>
<field name="user_id" string="Owner"/>
<field name="current_phase_id" string="Current Phase"/>
<field name="date_control" string="Date Control Point"/>
<field name="process_model_id"/>
<field name="progress" string="Progress"/>
<field name="process_document_ids" string="# Documents"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_process_graph">
<field name="name">document.change.process.graph</field>
<field name="model">document.change.process</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Process changes by month" type="bar" orientation="vertical">
<field name="create_date"/>
<field name="process_document_ids" operator="+"/>
</graph>
</field>
</record>
<record model="ir.ui.view" id="view_process_serach">
<field name="name">document.change.process.search</field>
<field name="model">document.change.process</field>
<field name="type">search</field>
<field name="priority" eval="1"/>
<field name="arch" type="xml">
<search string="Process Changes">
<group col="8" colspan="4">
<filter domain="[('user_id','=',uid)]" string="My Process Changes" icon="gtk-execute" help="My Process Changes"/>
<filter domain="[('state','=','to_validate')]" string="To Validate" icon="gtk-apply" help="Process Changes to be validated"/>
<filter domain="[('state','=','in_progress')]" string="Late" icon="gtk-execute" help="Process changes having the next Phase to validate that is late"/>
<field name="name" string="Process Change Title" select="1"/>
<field name="process_type_id" select="1"/>
<field name="structure_id" select="1"/>
<field name="user_id" string="Owner" select="1"/>
</group>
<group expand="1" string="Group By..." col="20" colspan="4">
<filter domain="[]" string="By Owner" icon="terp-hr" context="{'group_by':'user_id'}" help="Process Changes by owner"/>
<filter domain="[]" string="By Directory" icon="terp-hr" context="{'group_by':'structure_id'}" help="Process Changes by directory"/>
</group>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="action_process_form">
<field name="type">ir.actions.act_window</field>
<field name="res_model">document.change.process</field>
<field name="name">Process Changes</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph</field>
<field name="search_view_id" ref="view_process_serach"/>
</record>
<menuitem action="action_process_form" id="menu_process_changes_form" parent="menu_document_process_changes"/>
<record model="ir.actions.act_window" id="action_process_change_form_validate">
<field name="type">ir.actions.act_window</field>
<field name="res_model">document.change.process</field>
<field name="name">Process Changes to Validate</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','=','to_validate')]</field>
</record>
<menuitem action="action_process_change_form_validate" id="menu_process_to_validate_form" parent="menu_change_control"/>
<act_window domain="[('phase_ids', '=', active_id)]"
id="act_phase_change_process"
name="Phases"
res_model="document.change.process.phase"
src_model="document.change.process"/>
<act_window domain="[('change_type_id', '=', active_id)]"
id="act_documents_change_process"
name="Documents"
res_model="ir.attachment"
src_model="document.change.process"/>
</data>
</openerp>
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="wkf_attachment" model="workflow">
<field name="name">ir.attachment.basic</field>
<field name="osv">ir.attachment</field>
<field name="on_create">True</field>
</record>
<!-- States -->
<record id="act_document_production" model="workflow.activity">
<field name="wkf_id" ref="wkf_attachment"/>
<field name="flow_start">True</field>
<field name="name">in_production</field>
<field name="action">do_production()</field>
<field name="kind">function</field>
</record>
<record id="act_document_request" model="workflow.activity">
<field name="wkf_id" ref="wkf_attachment"/>
<field name="name">change_request</field>
<field name="action">do_change_request()</field>
<field name="kind">function</field>
</record>
<record id="act_document_propose" model="workflow.activity">
<field name="wkf_id" ref="wkf_attachment"/>
<field name="name">change_propose</field>
<field name="action">do_change_propose()</field>
<field name="kind">function</field>
</record>
<record id="act_document_confirm" model="workflow.activity">
<field name="wkf_id" ref="wkf_attachment"/>
<field name="name">to_update</field>
<field name="action">do_to_update()</field>
<field name="kind">function</field>
</record>
<record id="act_document_cancel" model="workflow.activity">
<field name="wkf_id" ref="wkf_attachment"/>
<field name="name">cancel</field>
<field name="action">do_cancel()</field>
<field name="kind">function</field>
</record>
<!-- Transitions -->
<record id="tran_document_production_to_request" model="workflow.transition">
<field name="act_from" ref="act_document_production"/>
<field name="act_to" ref="act_document_request"/>
<field name="signal">button_request</field>
</record>
<record id="tran_document_request_to_propose" model="workflow.transition">
<field name="act_from" ref="act_document_request"/>
<field name="act_to" ref="act_document_propose"/>
<field name="signal">button_propose</field>
<field name="condition">(target_document_id != False)</field>
</record>
<record id="tran_document_request_to_cancel" model="workflow.transition">
<field name="act_from" ref="act_document_request"/>
<field name="act_to" ref="act_document_cancel"/>
<field name="signal">button_cancel</field>
</record>
<record id="tran_document_propose_to_confirm" model="workflow.transition">
<field name="act_from" ref="act_document_propose"/>
<field name="act_to" ref="act_document_confirm"/>
<field name="signal">button_confirm</field>
</record>
<record id="tran_document_propose_to_cancel" model="workflow.transition">
<field name="act_from" ref="act_document_propose"/>
<field name="act_to" ref="act_document_cancel"/>
<field name="signal">button_cancel</field>
</record>
<record id="tran_document_cancel_to_request" model="workflow.transition">
<field name="act_from" ref="act_document_cancel"/>
<field name="act_to" ref="act_document_request"/>
<field name="signal">button_request</field>
</record>
<record id="tran_document_confirm_to_production" model="workflow.transition">
<field name="act_from" ref="act_document_confirm"/>
<field name="act_to" ref="act_document_production"/>
<field name="signal">button_validate</field>
</record>
</data>
</openerp>
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="wkf_change_process_phase" model="workflow">
<field name="name">document.change.process.phase.basic</field>
<field name="osv">document.change.process.phase</field>
<field name="on_create">True</field>
</record>
<!-- States -->
<record id="act_phase_draft" model="workflow.activity">
<field name="wkf_id" ref="wkf_change_process_phase"/>
<field name="flow_start">True</field>
<field name="name">draft</field>
</record>
<record id="act_phase_start" model="workflow.activity">
<field name="wkf_id" ref="wkf_change_process_phase"/>
<field name="name">in_process</field>
<field name="action">do_start()</field>
<field name="kind">function</field>
</record>
<record id="act_phase_confirm" model="workflow.activity">
<field name="wkf_id" ref="wkf_change_process_phase"/>
<field name="name">to_validate</field>
<field name="action">do_confirm()</field>
<field name="kind">function</field>
</record>
<record id="act_phase_end" model="workflow.activity">
<field name="wkf_id" ref="wkf_change_process_phase"/>
<field name="name">done</field>
<field name="action">do_done()</field>
<field name="kind">function</field>
</record>
<!-- Transitions -->
<record id="tran_phase_draft_to_start" model="workflow.transition">
<field name="act_from" ref="act_phase_draft"/>
<field name="act_to" ref="act_phase_start"/>
<field name="signal">button_start</field>
</record>
<record id="tran_phase_start_to_confirm" model="workflow.transition">
<field name="act_from" ref="act_phase_start"/>
<field name="act_to" ref="act_phase_confirm"/>
<field name="signal">button_confirm</field>
</record>
<record id="tran_phase_confirm_to_end" model="workflow.transition">
<field name="act_from" ref="act_phase_confirm"/>
<field name="act_to" ref="act_phase_end"/>
<field name="signal">button_end</field>
</record>
</data>
</openerp>
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="wkf_change_process" model="workflow">
<field name="name">document.change.process.basic</field>
<field name="osv">document.change.process</field>
<field name="on_create">True</field>
</record>
<!-- States -->
<record id="act_process_draft" model="workflow.activity">
<field name="wkf_id" ref="wkf_change_process"/>
<field name="flow_start">True</field>
<field name="name">draft</field>
</record>
<record id="act_process_in_progress" model="workflow.activity">
<field name="wkf_id" ref="wkf_change_process"/>
<field name="name">in_progress</field>
<field name="action">do_start()</field>
<field name="kind">function</field>
</record>
<record id="act_process_pending" model="workflow.activity">
<field name="wkf_id" ref="wkf_change_process"/>
<field name="name">pending</field>
<field name="action">do_pending()</field>
<field name="kind">function</field>
</record>
<record id="act_process_confirm" model="workflow.activity">
<field name="wkf_id" ref="wkf_change_process"/>
<field name="name">to_validate</field>
<field name="action">do_confirm()</field>
<field name="kind">function</field>
</record>
<record id="act_process_done" model="workflow.activity">
<field name="wkf_id" ref="wkf_change_process"/>
<field name="name">done</field>
<field name="action">do_done()</field>
<field name="kind">function</field>
</record>
<!-- Transitions -->
<record id="tran_process_draft_to_progress" model="workflow.transition">
<field name="act_from" ref="act_process_draft"/>
<field name="act_to" ref="act_process_in_progress"/>
<field name="signal">button_start</field>
</record>
<record id="tran_process_progress_to_pending" model="workflow.transition">
<field name="act_from" ref="act_process_in_progress"/>
<field name="act_to" ref="act_process_pending"/>
<field name="signal">button_pending</field>
</record>
<record id="tran_process_pending_to_progress" model="workflow.transition">
<field name="act_from" ref="act_process_pending"/>
<field name="act_to" ref="act_process_in_progress"/>
<field name="signal">button_start</field>
</record>
<record id="tran_process_progress_to_confirm" model="workflow.transition">
<field name="act_from" ref="act_process_in_progress"/>
<field name="act_to" ref="act_process_confirm"/>
<field name="signal">button_confirm</field>
</record>
<record id="tran_process_confirm_to_end" model="workflow.transition">
<field name="act_from" ref="act_process_confirm"/>
<field name="act_to" ref="act_process_done"/>
<field name="signal">button_done</field>
</record>
</data>
</openerp>
+1
View File
@@ -30,6 +30,7 @@ import random
import tools
import re
from tools.translate import _
from document.nodes import node_content
from tools.safe_eval import safe_eval

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