[MERGE] : Merge with lp:~openerp-dev/openobject-addons/trunk-dev-addons3

bzr revid: sbh@tinyerp.com-20100611061941-h8ei7ncpbf7nd9e3
This commit is contained in:
sbh (Open ERP)
2010-06-11 11:49:41 +05:30
282 changed files with 8399 additions and 2525 deletions
+42 -15
View File
@@ -509,8 +509,13 @@ class account_account(osv.osv):
def write(self, cr, uid, ids, vals, context=None):
if context is None:
context = {}
if 'company_id' in vals:
move_lines = self.pool.get('account.move.line').search(cr, uid, [('account_id', 'in', ids)])
if move_lines:
raise osv.except_osv(_('Warning !'), _('You cannot modify Company of account as its related record exist in Entry Lines'))
if 'active' in vals and not vals['active']:
self._check_moves(cr, uid, ids, "write", context)
self._check_moves(cr, uid, ids, "write", context=context)
if 'type' in vals.keys():
self._check_allow_type_change(cr, uid, ids, vals['type'], context=context)
return super(account_account, self).write(cr, uid, ids, vals, context=context)
@@ -557,42 +562,46 @@ class account_journal(osv.osv):
_name = "account.journal"
_description = "Journal"
_columns = {
'name': fields.char('Journal Name', size=64, required=True, translate=True),
'code': fields.char('Code', size=16),
'type': fields.selection([('sale', 'Sale'), ('purchase', 'Purchase'), ('expense', 'Expense'), ('cash', 'Cash'), ('bank', 'Bank'), ('general', 'General'), ('situation', 'Situation')], 'Type', size=32, required=True,
'name': fields.char('Journal Name', size=64, required=True, translate=True,help="Name of the journal"),
'code': fields.char('Code', size=16,required=True,help="Code of the journal"),
'type': fields.selection([('sale', 'Sale'),('sale_refund','Sale Refund'), ('purchase', 'Purchase'), ('purchase_refund','Purchase Refund'),('expense', 'Expense'), ('cash', 'Cash'), ('bank', 'Bank'), ('general', 'General'), ('situation', 'Situation')], 'Type', size=32, required=True,
help="Select 'Sale' for Sale journal to be used at the time of making invoice."\
" Select 'Purchase' for Purchase Journal to be used at the time of approving purchase order."\
" Select 'Cash' to be used at the time of making payment."\
" Select 'General' to be used at the time of stock input/output."\
" Select 'Situation' to be used at the time of making vouchers."),
'refund_journal': fields.boolean('Refund Journal', help='Fill this if the journal is to be used for refunds of invoices.'),
'type_control_ids': fields.many2many('account.account.type', 'account_journal_type_rel', 'journal_id','type_id', 'Type Controls', domain=[('code','<>','view'), ('code', '<>', 'closed')]),
'account_control_ids': fields.many2many('account.account', 'account_account_type_rel', 'journal_id','account_id', 'Account', domain=[('type','<>','view'), ('type', '<>', 'closed')]),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the journal without removing it."),
'view_id': fields.many2one('account.journal.view', 'View', required=True, help="Gives the view used when writing or browsing entries in this journal. The view tells Open ERP which fields should be visible, required or readonly and in which order. You can create your own view for a faster encoding in each journal."),
'default_credit_account_id': fields.many2one('account.account', 'Default Credit Account', domain="[('type','!=','view')]"),
'default_debit_account_id': fields.many2one('account.account', 'Default Debit Account', domain="[('type','!=','view')]"),
'view_id': fields.many2one('account.journal.view', 'Display Mode', required=True, help="Gives the view used when writing or browsing entries in this journal. The view tells Open ERP which fields should be visible, required or readonly and in which order. You can create your own view for a faster encoding in each journal."),
'default_credit_account_id': fields.many2one('account.account', 'Default Credit Account', domain="[('type','!=','view')]",help="It acts as a default account for credit amount"),
'default_debit_account_id': fields.many2one('account.account', 'Default Debit Account', domain="[('type','!=','view')]",help="It acts as a default account for debit amount"),
'centralisation': fields.boolean('Centralised counterpart', help="Check this box to determine that each entry of this journal won't create a new counterpart but will share the same counterpart. This is used in fiscal year closing."),
'update_posted': fields.boolean('Allow Cancelling Entries'),
'update_posted': fields.boolean('Allow Cancelling Entries',help="Check this box if you want to cancel the entries related to this journal or want to cancel the invoice related to this journal"),
'group_invoice_lines': fields.boolean('Group invoice lines', help="If this box is checked, the system will try to group the accounting lines when generating them from invoices."),
'sequence_id': fields.many2one('ir.sequence', 'Entry Sequence', help="The sequence gives the display order for a list of journals", required=True),
'user_id': fields.many2one('res.users', 'User', help="The user responsible for this journal"),
'groups_id': fields.many2many('res.groups', 'account_journal_group_rel', 'journal_id', 'group_id', 'Groups'),
'currency': fields.many2one('res.currency', 'Currency', help='The currency used to enter statement'),
'entry_posted': fields.boolean('Skip \'Draft\' State for Created Entries', help='Check this box if you don\'t want new account moves to pass through the \'draft\' state and instead goes directly to the \'posted state\' without any manual validation.'),
'company_id': fields.many2one('res.company', 'Company', required=True,select=1),
'company_id': fields.many2one('res.company', 'Company', required=True,select=1,help="Company associated with a journal"),
'invoice_sequence_id': fields.many2one('ir.sequence', 'Invoice Sequence', \
help="The sequence used for invoice numbers in this journal."),
'allow_date':fields.boolean('Check Date not in the Period', help= 'If set to True then do not accept the entry if the entry date is not into the period dates'),
}
_defaults = {
'active': lambda *a: 1,
'user_id': lambda self,cr,uid,context: uid,
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
}
def write(self, cr, uid, ids, vals, context=None):
obj=[]
if 'company_id' in vals:
move_lines = self.pool.get('account.move.line').search(cr, uid, [('journal_id', 'in', ids)])
if move_lines:
raise osv.except_osv(_('Warning !'), _('You cannot modify company of this journal as its related record exist in Entry Lines'))
return super(account_journal, self).write(cr, uid, ids, vals, context=context)
def create(self, cr, uid, vals, context={}):
journal_id = super(account_journal, self).create(cr, uid, vals, context)
# journal_name = self.browse(cr, uid, [journal_id])[0].code
@@ -618,6 +627,16 @@ class account_journal(osv.osv):
ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit, context=context)
return self.name_get(cr, user, ids, context=context)
def onchange_type(self, cr, uid, ids, type):
res={}
for line in self.browse(cr, uid, ids):
if type == 'situation':
res= {'value':{'centralisation': True}}
else:
res= {'value':{'centralisation': False}}
return res
account_journal()
class account_fiscalyear(osv.osv):
@@ -711,7 +730,7 @@ class account_period(osv.osv):
'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal Year', required=True, states={'done':[('readonly',True)]}, select=True),
'state': fields.selection([('draft','Draft'), ('done','Done')], 'State', readonly=True,
help='When monthly periods are created. The state is \'Draft\'. At the end of monthly period it is in \'Done\' state.'),
'company_id': fields.many2one('res.company', 'Company', required=True)
'company_id': fields.related('fiscalyear_id','company_id',type='many2one',relation='res.company',string='Company',store=True)
}
_defaults = {
'state': lambda *a: 'draft',
@@ -784,6 +803,14 @@ class account_period(osv.osv):
ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit)
return self.name_get(cr, user, ids, context=context)
def write(self, cr, uid, ids, vals, context=None):
obj=[]
if 'company_id' in vals:
move_lines = self.pool.get('account.move.line').search(cr, uid, [('period_id', 'in', ids)])
if move_lines:
raise osv.except_osv(_('Warning !'), _('You cannot modify company of this period as its related record exist in Entry Lines'))
return super(account_period, self).write(cr, uid, ids, vals, context=context)
account_period()
class account_journal_period(osv.osv):
@@ -809,7 +836,7 @@ class account_journal_period(osv.osv):
'state': fields.selection([('draft','Draft'), ('printed','Printed'), ('done','Done')], 'State', required=True, readonly=True,
help='When journal period is created. The state is \'Draft\'. If a report is printed it comes to \'Printed\' state. When all transactions are done, it comes in \'Done\' state.'),
'fiscalyear_id': fields.related('period_id', 'fiscalyear_id', string='Fiscal Year', type='many2one', relation='account.fiscalyear'),
'company_id' : fields.many2one('res.company', 'Company')
'company_id': fields.related('journal_id','company_id',type='many2one',relation='res.company',string='Company')
}
def _check(self, cr, uid, ids, context={}):
+2 -1
View File
@@ -220,7 +220,8 @@
<field name="name"/>
<newline/>
<field name="origin" groups="base.group_extended"/>
<field colspan="4" domain="[('partner_id','=',partner_id)]" name="address_contact_id" groups="base.group_extended"/>
<field domain="[('partner_id','=',partner_id)]" name="address_contact_id" groups="base.group_extended"/>
<field name="user_id"/>
<field name="move_id"/>
<separator colspan="4" string="Additional Information"/>
<field colspan="4" name="comment" nolabel="1"/>
+26 -3
View File
@@ -498,9 +498,17 @@ class account_move_line(osv.osv):
return False
return True
def _check_company_id(self, cr, uid, ids):
lines = self.browse(cr, uid, ids)
for l in lines:
if l.company_id != l.account_id.company_id or l.company_id != l.period_id.company_id:
return False
return True
_constraints = [
(_check_no_view, 'You can not create move line on view account.', ['account_id']),
(_check_no_closed, 'You can not create move line on closed account.', ['account_id']),
(_check_company_id,'Company must be same for its related account and period.',['company_id'] ),
]
#TODO: ONCHANGE_ACCOUNT_ID: set account_tax_id
@@ -574,6 +582,13 @@ class account_move_line(osv.osv):
unmerge = []
total = 0.0
merges_rec = []
company_list = []
for line in self.browse(cr, uid, ids, context=context):
if company_list and not line.company_id.id in company_list:
raise osv.except_osv(_('Warning !'), _('To reconcile the entries company should be the same for all entries'))
company_list.append(line.company_id.id)
for line in self.browse(cr, uid, ids, context):
if line.reconcile_id:
raise osv.except_osv(_('Warning'), _('Already Reconciled!'))
@@ -587,6 +602,7 @@ class account_move_line(osv.osv):
else:
unmerge.append(line.id)
total += (line.debit or 0.0) - (line.credit or 0.0)
if not total:
res = self.reconcile(cr, uid, merges+unmerge, context=context)
return res
@@ -604,6 +620,13 @@ class account_move_line(osv.osv):
currency = 0.0
account_id = False
partner_id = False
company_list = []
for line in self.browse(cr, uid, ids, context=context):
if company_list and not line.company_id.id in company_list:
raise osv.except_osv(_('Warning !'), _('To reconcile the entries company should be the same for all entries'))
company_list.append(line.company_id.id)
for line in unrec_lines:
if line.state <> 'valid':
raise osv.except_osv(_('Error'),
@@ -836,7 +859,7 @@ class account_move_line(osv.osv):
if vals.get('date', False):
todo_date = vals['date']
del vals['date']
for line in self.browse(cr, uid, ids,context=context):
ctx = context.copy()
if ('journal_id' not in ctx):
@@ -848,8 +871,8 @@ class account_move_line(osv.osv):
if line.move_id:
ctx['period_id'] = line.move_id.period_id.id
else:
ctx['period_id'] = line.period_id.id
#Check for centralisation
ctx['period_id'] = line.period_id.id
#Check for centralisation
journal = self.pool.get('account.journal').browse(cr, uid, ctx['journal_id'], context=ctx)
if journal.centralisation:
self._check_moves(cr, uid, context=ctx)
+12 -12
View File
@@ -272,22 +272,19 @@
<group colspan="4" col="6">
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="active" select="1"/>
<field name="type"/>
<field name="type" on_change="onchange_type(type)"/>
<field name="refund_journal" attrs="{'readonly':[('type','=','general'),('type','=','cash'),('type','=','situation')]}"/>
</group>
<notebook colspan="4">
<notebook colspan="4">
<page string="General Information">
<group colspan="2" col="2">
<separator string="Journal View" colspan="4"/>
<field name="view_id"/>
<field name="view_id" widget="selection"/>
</group>
<group colspan="2" col="2">
<separator string="Sequence" colspan="4"/>
<field name="sequence_id"/>
<field name="invoice_sequence_id"/>
</group>
<group colspan="2" col="2">
@@ -296,7 +293,7 @@
<field name="default_credit_account_id" attrs="{'required':[('type','=','cash')]}" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
</group>
<group colspan="2" col="2">
<group colspan="2" col="2">
<separator string="Validations" colspan="4"/>
<field name="allow_date" groups="base.group_extended"/>
</group>
@@ -307,15 +304,19 @@
<field name="user_id" groups="base.group_extended"/>
<field name="currency"/>
</group>
<group colspan="2" col="2">
<separator string="Other Configuration" colspan="4"/>
<field name="centralisation"/>
<field name="group_invoice_lines"/>
<field name="update_posted"/>
<field name="centralisation" groups="base.group_extended"/>
<field name="entry_posted"/>
<group colspan="2" col="2">
<separator string="Invoicing Data" colspan="4"/>
<field name="invoice_sequence_id"/>
<field name="group_invoice_lines"/>
</group>
</group>
</page>
<page string="Entry Controls">
<page string="Entry Controls" groups="base.group_extended">
<separator colspan="4" string="Accounts Type Allowed (empty for no control)"/>
<field colspan="4" name="type_control_ids" nolabel="1"/>
<separator colspan="4" string="Accounts Allowed (empty for no control)"/>
@@ -957,7 +958,6 @@
<field name="state" select="1"/>
<group col="2" colspan="2">
<button name="button_validate" states="draft" string="Validate" type="object" icon="gtk-execute"/>
<button name="button_cancel" states="posted" string="Cancel" type="object" icon="gtk-cancel"/>
</group>
</page>
<page string="Other Information">
+1 -1
View File
@@ -14,7 +14,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-06-09 03:35+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
+3 -3
View File
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-06-03 20:09+0000\n"
"PO-Revision-Date: 2010-06-09 15:10+0000\n"
"Last-Translator: Ferdinand @ ChriCar <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-06-04 03:45+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
@@ -4904,7 +4904,7 @@ msgstr "Details Finanzkonto"
#. module: account
#: rml:account.overdue:0
msgid "VAT:"
msgstr "USt.:"
msgstr "UID:"
#. module: account
#: rml:account.analytic.account.cost_ledger: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-06-09 03:35+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
+4 -4
View File
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.6\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-05-29 11:45+0000\n"
"Last-Translator: digitalsatori <Unknown>\n"
"PO-Revision-Date: 2010-06-09 16:41+0000\n"
"Last-Translator: Wei \"oldrev\" Li <oldrev@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-05-30 03:44+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
@@ -712,7 +712,7 @@ msgstr "客户欠款金额合计"
#. module: account
#: view:account.move.line:0
msgid "St."
msgstr ""
msgstr "结单编码"
#. module: account
#: model:ir.actions.act_window,name:account.action_tax_code_line_open
+2 -2
View File
@@ -923,13 +923,13 @@ class account_invoice(osv.osv):
account_move_obj = self.pool.get('account.move')
invoices = self.read(cr, uid, ids, ['move_id', 'payment_ids'])
for i in invoices:
if i['move_id']:
if i['move_id']:
account_move_obj.button_cancel(cr, uid, [i['move_id'][0]])
# delete the move this invoice was pointing to
# Note that the corresponding move_lines and move_reconciles
# will be automatically deleted too
account_move_obj.unlink(cr, uid, [i['move_id'][0]])
if i['payment_ids']:
if i['payment_ids']:
account_move_line_obj = self.pool.get('account.move.line')
pay_ids = account_move_line_obj.browse(cr, uid , i['payment_ids'])
for move_line in pay_ids:
+1 -1
View File
@@ -46,7 +46,7 @@ class account_journal(osv.osv):
_inherit="account.journal"
_columns = {
'analytic_journal_id':fields.many2one('account.analytic.journal','Analytic Journal'),
'analytic_journal_id':fields.many2one('account.analytic.journal','Analytic Journal',help="Journal for analytic entries"),
}
account_journal()
+14 -14
View File
@@ -2,27 +2,27 @@
<openerp>
<data>
<record id="view_account_chart" model="ir.ui.view">
<record id="view_account_chart" model="ir.ui.view">
<field name="name">account.chart.form</field>
<field name="model">account.chart</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Account charts">
<group colspan="4" >
<field name="fiscalyear"/>
<label align="0.7" colspan="6" string="(If you do not select Fiscal year it will take all open fiscal years)"/>
<field name="target_move"/>
<group colspan="4" >
<field name="fiscalyear"/>
<label align="0.7" colspan="6" string="(If you do not select Fiscal year it will take all open fiscal years)"/>
<field name="target_move"/>
</group>
<separator string="" colspan="4" />
<separator string="" colspan="4" />
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel" />
<button icon="gtk-open" string="Open Charts"
name="account_chart_open_window" type="object" />
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel" />
<button icon="gtk-open" string="Open Charts"
name="account_chart_open_window" type="object" />
</group>
</form>
</field>
</record>
</record>
<record id="action_account_chart" model="ir.actions.act_window">
<field name="name">Chart of Accounts</field>
@@ -34,7 +34,7 @@
</record>
<menuitem icon="STOCK_INDENT" action="action_account_chart"
id="menu_action_account_tree2"
parent="account.menu_finance_charts" />
id="menu_action_account_tree2"
parent="account.menu_finance_charts" />
</data>
</openerp>
</openerp>
@@ -1,22 +1,22 @@
<openerp>
<data>
<record id="account_invoice_confirm_view" model="ir.ui.view">
<record id="account_invoice_confirm_view" model="ir.ui.view">
<field name="name">account.invoice.confirm.form</field>
<field name="model">account.invoice.confirm</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Confirm Draft Invoices">
<separator string="Confirm Draft Invoices" colspan="4"/>
<form string="Confirm Draft Invoices">
<separator string="Confirm Draft Invoices" colspan="4"/>
<group colspan="4" col="6">
<button icon="gtk-cancel" special="cancel" string="Close"/>
<button icon="gtk-execute" string="Confirm Invoices" name="invoice_confirm" type="object" default_focus="1"/>
<button icon="gtk-cancel" special="cancel" string="Close"/>
<button icon="gtk-execute" string="Confirm Invoices" name="invoice_confirm" type="object" default_focus="1"/>
</group>
</form>
</field>
</record>
</record>
<record id="action_account_invoice_confirm" model="ir.actions.act_window">
<record id="action_account_invoice_confirm" model="ir.actions.act_window">
<field name="name">Confirm Draft Invoices</field>
<field name="res_model">account.invoice.confirm</field>
<field name="view_type">form</field>
@@ -25,7 +25,7 @@
<field name="target">new</field>
</record>
<record model="ir.values" id="action_account_invoice_confirm_values">
<record model="ir.values" id="action_account_invoice_confirm_values">
<field name="model_id" ref="account.model_account_invoice" />
<field name="object" eval="1" />
<field name="name">Confirm Draft Invoices</field>
@@ -33,24 +33,24 @@
<field name="value" eval="'ir.actions.act_window,' +str(ref('action_account_invoice_confirm'))" />
<field name="key">action</field>
<field name="model">account.invoice</field>
</record>
</record>
<record id="account_invoice_cancel_view" model="ir.ui.view">
<record id="account_invoice_cancel_view" model="ir.ui.view">
<field name="name">account.invoice.cancel.form</field>
<field name="model">account.invoice.cancel</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Cancel Selected Invoices">
<separator string="Cancel Selected Invoices" colspan="4"/>
<form string="Cancel Selected Invoices">
<separator string="Cancel Selected Invoices" colspan="4"/>
<group colspan="4" col="6">
<button icon="gtk-cancel" special="cancel" string="Close"/>
<button icon="gtk-execute" string="Cancel Invoices" name="invoice_cancel" type="object" default_focus="1"/>
<button icon="gtk-cancel" special="cancel" string="Close"/>
<button icon="gtk-execute" string="Cancel Invoices" name="invoice_cancel" type="object" default_focus="1"/>
</group>
</form>
</field>
</record>
</record>
<record id="action_account_invoice_cancel" model="ir.actions.act_window">
<record id="action_account_invoice_cancel" model="ir.actions.act_window">
<field name="name">Cancel Selected Invoices</field>
<field name="res_model">account.invoice.cancel</field>
<field name="view_type">form</field>
@@ -59,7 +59,7 @@
<field name="target">new</field>
</record>
<record model="ir.values" id="action_account_invoice_cancel_values">
<record model="ir.values" id="action_account_invoice_cancel_values">
<field name="model_id" ref="account.model_account_invoice" />
<field name="object" eval="1" />
<field name="name">Cancel Selected Invoices</field>
@@ -67,7 +67,7 @@
<field name="value" eval="'ir.actions.act_window,' +str(ref('action_account_invoice_cancel'))" />
<field name="key">action</field>
<field name="model">account.invoice</field>
</record>
</record>
</data>
</openerp>
</data>
</openerp>
@@ -8,11 +8,11 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Journal Select">
<label string="Are you sure you want to open Journal Entries!" colspan="4"/>
<separator string="" colspan="4" />
<label string="Are you sure you want to open Journal Entries!" colspan="4"/>
<separator string="" colspan="4" />
<group colspan="4" col="6">
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-open" string="Open Entries" name="action_open_window" type="object"/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-open" string="Open Entries" name="action_open_window" type="object"/>
</group>
</form>
</field>
+1 -1
View File
@@ -14,7 +14,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-06-09 03:35+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_analytic_analysis
+1 -1
View File
@@ -14,7 +14,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-06-09 03:36+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_anglo_saxon
+22 -3
View File
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-06-09 03:21+0000\n"
"PO-Revision-Date: 2010-06-09 03:36+0000\n"
"Last-Translator: Panayiotis Konstantinidis <Unknown>\n"
"Language-Team: Greek <el@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_balance
@@ -117,6 +117,25 @@ msgid ""
" 5. You have an option to print the desired report in Landscape format.\n"
" "
msgstr ""
"Το κομμάτι Ισολογισμών είναι ένα επιπρόσθετο λειτουργικό κομμάτι στο κομμάτι "
"της Οικονομικής Διαχείρισης\n"
"\n"
" Αυτό το κομμάτι σου δίνει διάφορες επιλογές για εκτύπωση ισολογισμών.\n"
"\n"
" 1. Μπορείς να συγκρίνεις τους ισολογισμούς διαφόρων ετών.\n"
"\n"
" 2. Μπορείς να ορίσεις την απόλυτη ή επί τοις εκατό σύγκριση μεταξύ δύο "
"ετών.\n"
"\n"
" 3. Μπορείς να ορίσεις το ισολογισμό αναφοράς για την επί τοις εκατό "
"σύγκριση συγκεκριμένων ετών.\n"
"\n"
" 4. Μπορείς να επιλέξεις περιόδους ως πραγματική ημερομηνία ή περιόδους "
"ως ημέρα δημιουργίας.\n"
"\n"
" 5. Έχεις δυνατότητα να εκτυπώσεις την επιθυμητή αναφορά σε μορφή "
"Landscape.\n"
" "
#. module: account_balance
#: wizard_view:account.balance.account.balance.report,backtoinit:0
@@ -149,7 +168,7 @@ msgstr "Σύνολο:"
#: rml:account.account.balance.landscape:0
#: rml:account.balance.account.balance:0
msgid "Account Balance -"
msgstr ""
msgstr "Ισολογισμός"
#. module: account_balance
#: wizard_field:account.balance.account.balance.report,init,format_perc:0
+23
View File
@@ -0,0 +1,23 @@
# -*- 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/>.
#
##############################################################################
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+40
View File
@@ -0,0 +1,40 @@
# -*- 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" : "Account Cancel",
"version" : "1.1",
"depends" : ["account"],
"author" : "Tiny",
"category": 'Generic Modules/Accounting',
"description": """
Module Add Allow cancelling entries field on form view of account journal if it set to true it allows user to cancel entries & invoices.
""",
'website': 'http://www.openerp.com',
'init_xml': [],
'update_xml': ['account_cancel_view.xml' ],
'demo_xml': [],
'installable': True,
'active': False,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<openerp>
<data>
<record id="view_account_journal_form_inherit" model="ir.ui.view">
<field name="name">account.journal.form</field>
<field name="model">account.journal</field>
<field name="type">form</field>
<field name="inherit_id" ref="account.view_account_journal_form"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page[@string='General Information']/group/field[@name='centralisation']" position="after">
<field name="update_posted"/>
</xpath>
</field>
</record>
</data>
</openerp>
+1 -1
View File
@@ -14,7 +14,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-06-09 03:36+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_coda
+1 -1
View File
@@ -14,7 +14,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-06-09 03:36+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_coda
+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-06-09 03:35+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_followup
+1 -1
View File
@@ -14,7 +14,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-06-09 03:35+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_invoice_layout
+4 -4
View File
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2009-09-08 15:11+0000\n"
"Last-Translator: Makis Nicolaou <mark.nicolaou@gmail.com>\n"
"PO-Revision-Date: 2010-06-09 06:03+0000\n"
"Last-Translator: Panayiotis Konstantinidis <Unknown>\n"
"Language-Team: Greek <el@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-04-17 04:11+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
@@ -40,7 +40,7 @@ msgstr "Επιλέξτε την Κατάσταση Πληρωμής που θα
#. module: account_payment
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr ""
msgstr "Λανθασμένο όνομα μοντέλου στον ορισμό ενέργειας"
#. module: account_payment
#: view:payment.line: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-06-09 03:35+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
@@ -35,6 +35,7 @@ This module implement the modification on the invoice form.
'init_xml': [],
'update_xml': ['account_tax_include_view.xml'],
'demo_xml': [],
'test': ['test/account_tax_include.yml'],
'installable': True,
'active': False,
'certificate': '0070514190381',
+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-06-09 03:35+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_tax_include
@@ -0,0 +1,93 @@
-
Creating a tax record
-
!record {model: account.tax, id: account_tax_a0}:
amount: 0.10000000000000001
applicable_type: 'true'
company_id: base.main_company
description: a
name: a
sequence: 1
type: percent
type_tax_use: all
-
Creating a account invoice record with tax excluded
-
!record {model: account.invoice, id: account_invoice_tax_exclude}:
account_id: account.a_recv
address_contact_id: base.res_partner_address_3000
address_invoice_id: base.res_partner_address_3000
company_id: base.main_company
currency_id: base.EUR
invoice_line:
- account_id: account.a_sale
name: '[PC1] Basic PC'
price_unit: 100.0
quantity: 1.0
invoice_line_tax_id:
- account_tax_a0
product_id: product.product_product_pc1
uos_id: product.product_uom_unit
journal_id: account.sales_journal
partner_id: base.res_partner_desertic_hispafuentes
price_type: tax_excluded
reference_type: none
-
Performing an osv_memory action button_reset_taxes on module account.invoice
-
!python {model: account.invoice}: |
self.button_reset_taxes(cr, uid, [ref("account_invoice_tax_exclude")], {"lang": "en_US", "tz": False,
"active_model": "ir.ui.menu", "active_ids": [ref("account.menu_action_invoice_tree1")],
"type": "out_invoice", "active_id": ref("account.menu_action_invoice_tree1"),
})
-
Check if tax is excluded in invoice
-
!assert {model: account.invoice, id: account_invoice_tax_exclude, severity: error, string: price type is tax excluded}:
- state == "draft"
- amount_untaxed == 100.0
- amount_tax == 10.0
- amount_total == 110.0
-
Creating a account invoice record with tax include
-
!record {model: account.invoice, id: account_invoice_tax_include}:
account_id: account.a_recv
address_contact_id: base.res_partner_address_3000
address_invoice_id: base.res_partner_address_3000
company_id: base.main_company
currency_id: base.EUR
invoice_line:
- account_id: account.a_sale
name: '[PC1] Basic PC'
price_unit: 100.0
quantity: 1.0
invoice_line_tax_id:
- account_tax_a0
product_id: product.product_product_pc1
uos_id: product.product_uom_unit
journal_id: account.sales_journal
partner_id: base.res_partner_desertic_hispafuentes
price_type: tax_included
reference_type: none
-
Performing an osv_memory action button_reset_taxes on module account.invoice
-
!python {model: account.invoice}: |
self.button_reset_taxes(cr, uid, [ref("account_invoice_tax_include")], {"lang": "en_US", "tz": False,
"active_model": "ir.ui.menu", "active_ids": [ref("account.menu_action_invoice_tree1")],
"type": "out_invoice", "active_id": ref("account.menu_action_invoice_tree1"),
})
-
Check if tax is included in invoice
-
!assert {model: account.invoice, id: account_invoice_tax_include, severity: error, string: price type is tax included}:
- state == "draft"
- amount_untaxed == 90.91
- amount_tax == 9.09
- amount_total == 100.00
+1 -1
View File
@@ -14,7 +14,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-06-09 03:36+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_voucher_payment
+1 -1
View File
@@ -14,7 +14,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-06-09 03:36+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_voucher_payment
+1 -1
View File
@@ -14,7 +14,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-06-09 03:36+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_voucher_payment
+3 -3
View File
@@ -36,7 +36,7 @@
* My Latest Objects (list)
* My Latest Deposits (list)
* Objects Statistics (list)
* My Objects By Day (list)
* My Objects By Day (list)
""",
'author': 'Tiny',
'depends': ['base', 'account', 'hr_attendance'],
@@ -59,13 +59,13 @@
# 'wizard/auction_aie_send_result_view.xml',
'wizard/auction_lots_buyer_map_view.xml',
# 'wizard/auction_lots_numerotate_view.xml',
'auction_view.xml',
'auction_report.xml',
'auction_wizard.xml',
'board_auction_view.xml',
'board_auction_manager_view.xml',
],
'demo_xml': ['auction_demo.xml','board_auction_demo.xml'],
'installable': True,
+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-06-09 03:35+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: auction
+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-06-09 03:36+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: auction
+204
View File
@@ -0,0 +1,204 @@
-
In order to test the auction module in the Open-ERP I start the process by creating a product.
-
I create a new product furniture.
-
!record {model: product.product, id: product_product_furniture0}:
categ_id: product.cat1
cost_method: standard
mes_type: fixed
name: Furniture
procure_method: make_to_stock
standard_price: 1.0
supply_method: buy
type: product
uom_id: product.product_uom_unit
uom_po_id: product.product_uom_unit
volume: 0.0
warranty: 0.0
weight: 0.0
weight_net: 0.0
-
I create a new artist for an object.
-
!record {model: auction.artists, id: auction_artists_vincentvangogh0}:
birth_death_dates: 1853-1900
name: Vincent van Gogh
-
Now I want to associate an object with the auction so for that I create an auction "Antique furniture exhibition"
-
!record {model: auction.dates, id: auction_dates_antiquefurnitureexhibition0}:
acc_expense: account.a_pay
acc_income: account.a_recv
account_analytic_id: account.analytic_root
auction1: '2010-05-20'
auction2: '2010-05-21'
expo1: '2010-05-18'
expo2: '2010-05-19'
journal_id: account.expenses_journal
journal_seller_id: account.sales_journal
name: Antique furniture exhibition
-
An object is being deposited for an auction,I create a seller's deposit record.
-
!record {model: auction.deposit, id: auction_deposit_ad0}:
date_dep: '2010-05-18'
method: keep
name: AD/006
partner_id: base.res_partner_4
-
I create a new object wooden-chair which is to be auctioned.
-
!record {model: auction.lots, id: auction_lots_woodenchair0}:
ach_uid: base.res_partner_2
artist_id: auction_artists_vincentvangogh0
auction_id: auction_dates_antiquefurnitureexhibition0
bord_vnd_id: auction_deposit_ad0
lot_est1: 3000.0
lot_est2: 5000.0
lot_num: 1
name: wooden-chair
name2: antique wooden chair
obj_num: 1
obj_price: 4000.0
obj_ret: 5000.0
product_id: 'product_product_furniture0'
state: draft
vnd_lim: 5000.0
-
I create a bid for an object "wooden-chair" which is to be auctioned in Antique furniture exhibition.
-
!record {model: auction.bid, id: auction_bid_bid0}:
auction_id: auction_dates_antiquefurnitureexhibition0
contact_tel: (+32)2 211 34 83
name: bid/001
partner_id: auction.partner_record1
-
I create a bid line.
-
!record {model: auction.bid_line, id: auction_bid_line_0}:
auction: Antique furniture exhibition
bid_id: auction_bid_bid0
lot_id: auction.auction_lots_woodenchair0
price: 3500.0
-
I create another bid for an object "wooden-chair" bided by a different partner
-
!record {model: auction.bid, id: auction_bid_bid1}:
auction_id: auction_dates_antiquefurnitureexhibition0
name: bid/002
partner_id: base.res_partner_2
-
I create a bid line.
-
!record {model: auction.bid_line, id: auction_bid_line_1}:
auction: Antique furniture exhibition
bid_id: 'auction_bid_bid1'
call: 1
lot_id: auction.auction_lots_woodenchair0
price: 4000.0
-
I check that buyer price and seller price gets bind with the value
-
!python {model: auction.lots}: |
from tools.translate import _
auc_id=self.browse(cr, uid, ref("auction_lots_woodenchair0"))
assert(auc_id.buyer_price,auc_id.seller_price), _('Buyer price and seller price are not available!')
-
I check that a record gets created in the Seller's Summary.
-
!python {model: auction.lots}: |
from tools.translate import _
auc_id=self.browse(cr, uid, ref("auction_lots_woodenchair0"))
auc_deposit_obj=self.pool.get('auction.deposit')
rep_sell_obj = self.pool.get('report.seller.auction')
ids =rep_sell_obj.search(cr, uid, [('auction', '=', auc_id.auction_id.id),('seller', '=',auc_id.bord_vnd_id.partner_id.id)])
assert ids, _('No record found!')
-
I check that a record gets created in the Seller's Revenues.
-
!python {model: auction.lots}: |
from tools.translate import _
auc_id=self.browse(cr, uid, ref("auction_lots_woodenchair0"))
auc_deposit_obj=self.pool.get('auction.deposit')
rep_sell_obj = self.pool.get('report.seller.auction2')
ids =rep_sell_obj.search(cr, uid, [('auction', '=', auc_id.auction_id.id),('seller', '=',auc_id.bord_vnd_id.partner_id.id)])
assert ids, _('No record found!')
-
I check that a record gets created in the Buyer's Summary.
-
!python {model: auction.lots}: |
from tools.translate import _
auc_id1=self.browse(cr, uid, ref("auction_lots_woodenchair0"))
rep_buy_obj1 = self.pool.get('report.buyer.auction')
ids1=rep_buy_obj1.search(cr, uid, [('auction', '=', auc_id1.auction_id.id),('buyer', '=',auc_id1.ach_uid.id)])
assert ids1, _('No record found!')
-
I check that a record gets created in the Buyer's Revenue.
-
!python {model: auction.lots}: |
from tools.translate import _
auc_id1=self.browse(cr, uid, ref("auction_lots_woodenchair0"))
rep_buy_obj1 = self.pool.get('report.buyer.auction2')
ids1=rep_buy_obj1.search(cr, uid, [('auction', '=', auc_id1.auction_id.id),('buyer', '=',auc_id1.ach_uid.id)])
assert ids1, _('No record found!')
-
I check that a record gets created in the Auction's Summary.
-
!python {model: auction.lots}: |
from tools.translate import _
auc_id2=self.browse(cr, uid, ref("auction_lots_woodenchair0"))
rep_auc_obj1 = self.pool.get('report.auction.view')
ids2=rep_auc_obj1.search(cr, uid, [('auction_id', '=', auc_id2.auction_id.id)])
assert ids2, _('No record found!')
-
I check that a record gets created in the Auction's Revenues.
-
!python {model: auction.lots}: |
from tools.translate import _
auc_id3=self.browse(cr, uid, ref("auction_lots_woodenchair0"))
rep_auc_obj1 = self.pool.get('report.auction.view2')
ids3=rep_auc_obj1.search(cr, uid, [('auction', '=', auc_id3.auction_id.id)])
assert ids3, _('No record found!')
-
An object has been sold,so I click on the "Sold" button.
-
!python {model: auction.lots}: |
self.button_bought(cr, uid, [ref("auction_lots_woodenchair0")], {"lang": "en_US", "tz":
False, "active_model": "ir.ui.menu", "active_ids": [ref("auction.auction_lots_woodenchair0")],
"active_id": ref("auction.auction_lots_woodenchair0")})
-
I check that the order which was initially in the draft state has transit to sold state.
-
!python {model: auction.lots}: |
from tools.translate import _
auc_id=self.browse(cr, uid, ref("auction_lots_woodenchair0"))
assert(auc_id.state == 'sold'), _('State not changed!')
-
Then I click on the Taken Away button.
-
!python {model: auction.lots}: |
self.button_taken_away(cr, uid, [ref("auction_lots_woodenchair0")], {"lang":
"en_US", "tz": False, "active_model": "ir.ui.menu", "active_ids": [ref("auction.auction_all_objects_menu")],
"active_id": ref("auction.auction_all_objects_menu")})
-
I check that the order which was initially in the sold state has transit to taken away state.
-
!python {model: auction.lots}: |
from tools.translate import _
auc_id=self.browse(cr, uid, ref("auction_lots_woodenchair0"))
assert(auc_id.state == 'taken_away'), _('State not changed!')
-
I click on the "Close + Create all invoices" button
-
!python {model: auction.dates}: |
self.close(cr, uid, [ref("auction.auction_dates_antiquefurnitureexhibition0")],
{"lang": "en_US", "tz": False, "active_model": "ir.ui.menu", "active_ids":
[ref("auction.menu_auction_dates_next1")], "active_id": ref("auction.menu_auction_dates_next1")})
-
I check that a record gets created in the "Supplier Invoices".
-
!python {model: auction.lots}: |
from tools.translate import _
auc_id=self.browse(cr, uid, ref("auction_lots_woodenchair0"))
assert(auc_id.sel_inv_id), _('Seller Invoice has not been created!')
+248
View File
@@ -0,0 +1,248 @@
-
In order to test the wizards of auction module I create a new record.
-
I start the process by creating a new product Paintings.
-
!record {model: product.product, id: product_product_paintings0}:
categ_id: product.cat1
cost_method: standard
mes_type: fixed
name: Paintings
procure_method: make_to_stock
standard_price: 1.0
supply_method: buy
type: product
uom_id: product.product_uom_unit
uom_po_id: product.product_uom_unit
volume: 0.0
warranty: 0.0
weight: 0.0
weight_net: 0.0
-
I create a new artist-Picasso's record.
-
!record {model: auction.artists, id: auction_artists_picasso0}:
birth_death_dates: 1881-1973
name: Picasso
-
Now I want to associate an object with the auction so for that I create an auction "Picasso's painting exhibition"
-
!record {model: auction.dates, id: auction_dates_picassospaintingexhibition0}:
acc_expense: account.a_pay
acc_income: account.a_recv
account_analytic_id: account.analytic_root
auction1: '2010-05-24'
auction2: '2010-05-25'
expo1: '2010-05-21'
expo2: '2010-05-22'
journal_id: account.expenses_journal
journal_seller_id: account.sales_journal
name: Picasso's painting exhibition
-
An object is being deposited for an auction,I create a seller's deposit record.
-
!record {model: auction.deposit, id: auction_deposit_ad1}:
date_dep: '2010-05-18'
method: keep
name: AD/007
partner_id: base.res_partner_9
-
I create a new object painting which is to be auctioned.
-
!record {model: auction.lots, id: auction_lots_painting0}:
ach_login: 'Mr.Chang'
artist_id: auction.auction_artists_picasso0
auction_id: auction_dates_picassospaintingexhibition0
bord_vnd_id: auction_deposit_ad1
lot_est1: 2000.0
lot_est2: 4000.0
lot_num: 2
name: painting
name2: picasso_painting
obj_num: 2
obj_price: 3500.0
obj_ret: 4000.0
product_id: auction.product_product_paintings0
state: draft
vnd_lim: 4000.0
-
I assign the buyer through "Map buyer user name to Partners" wizard.
-
!record {model: auction.lots.buyer_map, id: auction_lots_buyer_map_0}:
ach_login: 'Mr.Chang'
ach_uid: base.res_partner_3
-
I click on the "Update" button.
-
!python {model: auction.lots.buyer_map}: |
auc_obj=self.pool.get('auction.lots')
ids=self.browse(cr, uid, ref("auction_lots_painting0"))
self.buyer_map_set(cr, uid, [ref("auction_lots_buyer_map_0")], {"lang": "en_US",
"tz": False, "active_model": "auction.lots", "active_ids": [ref("auction_lots_painting0")],
"active_id": ref("auction_lots_painting0")})
-
I check that the buyer field gets bind with the value.
-
!python {model: auction.lots}: |
from tools.translate import _
auc_id=self.browse(cr, uid, ref("auction_lots_painting0"))
assert(auc_id.ach_uid), _('Buyer not assigned!')
-
I mark that a seller has been paid by using the "Mark as paid for seller" wizard.
-
!record {model: auction.payer.sel, id: auction_payer_sel_0}:
{}
-
I click on the "Pay" button.
-
!python {model: auction.payer.sel}: |
self.payer_sel(cr, uid, [ref("auction_payer_sel_0")], {"lang": "en_US", "tz":
False, "active_model": "auction.lots", "active_ids": [ref("auction_lots_painting0")], "active_id": ref("auction_lots_painting0")})
-
I check that the Seller paid field is set to True.
-
!python {model: auction.lots}: |
from tools.translate import _
auc_id=self.browse(cr, uid, ref("auction_lots_painting0"))
assert(auc_id.paid_vnd == True), _('Seller paid is not marked!')
-
I use the "Mark as taken away" wizard to indicate that an object is taken away.
-
!record {model: auction.lots.able, id: auction_lots_able_0}:
{}
-
Then I click on the "Able Taken away" wizard.
-
!python {model: auction.lots.able}: |
self.confirm_able(cr, uid, [ref("auction_lots_able_0")], {"lang":"en_US", "tz":
False, "active_model": "auction.lots", "active_ids": [ref("auction_lots_painting0")],
"active_id": ref("auction_lots_painting0")})
-
I check that Taken away field is set to True.
-
!python {model: auction.lots}: |
from tools.translate import _
auc_id=self.browse(cr, uid, ref("auction_lots_painting0"))
assert(auc_id.ach_emp == True), _('Taken away is not marked!')
-
I use the "Unmark as taken away" wizard to unmark the Taken Away field.
-
!record {model: auction.lots.enable, id: auction_lots_enable_0}:
confirm_en: 0.0
-
Then I click on the "Enable Taken away" button.
-
!python {model: auction.lots.enable}: |
self.confirm_enable(cr, uid, [ref("auction_lots_enable_0")], {"lang": "en_US",
"tz": False, "active_model": "auction.lots", "active_ids": [ref("auction_lots_painting0")],
"active_id": ref("auction_lots_painting0"),})
-
I check that Taken away field is set to False.
-
!python {model: auction.lots}: |
from tools.translate import _
auc_id=self.browse(cr, uid, ref("auction_lots_painting0"))
assert(auc_id.ach_emp == False), _('Taken away is marked!')
-
I create statement lines for an object's payment by using the "Pay objects of the buyer" wizard
-
I create a bank statement.
-
!record {model: account.bank.statement, id: account_bank_statement_st0}:
balance_end_real: 0.0
date: '2010-05-19'
journal_id: account.bank_journal
name: St. 05/19
period_id: account.period_5
state: draft
-
I create auction payment record.
-
!record {model: auction.pay.buy, id: auction_pay_buy_0}:
amount: 2000.0
amount2: 1000.0
amount3: 1000.0
buyer_id: base.res_partner_2
statement_id1: account_bank_statement_st0
statement_id2: account_bank_statement_st0
statement_id3: account_bank_statement_st0
total: 4000.0
-
Then I click "Pay" button.
-
!python {model: auction.pay.buy}: |
self.pay_and_reconcile(cr, uid, [ref("auction_pay_buy_0")], {"lang": "en_US", "tz":
False, "active_model": "auction.lots", "active_ids": [ref("auction_lots_painting0")],
"active_id": ref("auction_lots_painting0"),})
-
I check that a record gets created in the 'auction_statement_line_rel' table
-
!python {model: auction.lots}: |
from tools.translate import _
cr.execute("select statement from auction_statement_line_rel,auction_lots where auction_lots.id=auction_statement_line_rel.auction_id AND auction_lots.name='painting'")
ans=cr.fetchall()
assert ans, _('statement_id not found!')
-
I create the seller's invoice by using the "Invoice Seller objects" wizard.
-
!record {model: auction.lots.make.invoice, id: auction_lots_make_invoice_0}:
amount: 3500.0
number: 2010/002
objects: 1
-
Then I click on the "Create Invoices" button.
-
!python {model: auction.lots.make.invoice}: |
self.makeInvoices(cr, uid, [ref("auction_lots_make_invoice_0")], {"lang": "en_US",
"active_model": "auction.lots", "active_ids": [ref("auction_lots_painting0")],
"tz": False, "active_id": ref("auction_lots_painting0"),})
-
I check that a "Seller Invoice" field gets bind with the value.
-
!python {model: auction.lots}: |
from tools.translate import _
auc_id=self.browse(cr, uid, ref("auction_lots_painting0"))
assert(auc_id.sel_inv_id), _('Seller Invoice has not been created!')
-
I create a buyer's invoice by using the "Invoice Buyer objects" wizard.
-
!record {model: auction.lots.make.invoice.buyer, id: auction_lots_make_invoice_buyer_0}:
amount: 3500.0
buyer_id: base.res_partner_3
number: 2010/003
objects: 1
-
Then I click on the "Create Invoices" button.
-
!python {model: auction.lots.make.invoice.buyer}: |
self.makeInvoices(cr, uid, [ref("auction_lots_make_invoice_buyer_0")], {"lang":
"en_US", "active_model": "auction.lots", "active_ids": [ref("auction_lots_painting0")],
"tz": False, "active_id": ref("auction_lots_painting0"), })
-
I check that a "Buyer Invoice" field gets bind with the value.
-
!python {model: auction.lots}: |
from tools.translate import _
auc_id=self.browse(cr, uid, ref("auction_lots_painting0"))
assert(auc_id.ach_inv_id), _('Seller Invoice has not been created!')
-
In order to change the auction for an object I use the "Change auction date" wizard.
-
!record {model: auction.lots.auction.move, id: auction_lots_auction_move_0}:
auction_id: auction.auction_date_2
-
Then I click on the "Move to Auction date" button.
-
!python {model: auction.lots.auction.move}: |
self.auction_move_set(cr, uid, [ref("auction_lots_auction_move_0")], {"lang":
"en_US", "tz": False, "active_model": "auction.lots", "active_ids": [ref("auction_lots_painting0")],
"active_id": ref("auction_lots_painting0"), })
-
I check that a record gets created in the lot history.
-
!python {model: auction.lots}: |
from tools.translate import _
auc_id=self.browse(cr, uid, ref("auction_lots_painting0"))
auc_lot_his=self.pool.get('auction.lot.history')
ids=auc_lot_his.search(cr, uid, [('lot_id', '=', auc_id.id)])
assert ids, _('Auction history does not exists!')
+1 -1
View File
@@ -138,7 +138,7 @@
<!-- Calenadar's menu -->
<menuitem id="base.menu_calendar_configuration" name="Calendar"
parent="base.menu_config_address_book" sequence="15" />
parent="base.menu_address_book" sequence="15" />
<!-- Invitation menu -->
+4 -4
View File
@@ -8,19 +8,19 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-03-17 14:08+0000\n"
"Last-Translator: 英华 <wantinghard@gmail.com>\n"
"PO-Revision-Date: 2010-06-09 16:41+0000\n"
"Last-Translator: Wei \"oldrev\" Li <oldrev@gmail.com>\n"
"Language-Team: Simplified Chinese <zh_CN@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-04-17 04:20+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: base_module_quality
#: field:module.quality.check,final_score:0
msgid "Final Score (%)"
msgstr ""
msgstr "最终评分(%)"
#. module: base_module_quality
#: constraint:ir.model: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-06-09 03:35+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
+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-06-09 03:35+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
+22
View File
@@ -0,0 +1,22 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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/>.
#
##############################################################################
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+35
View File
@@ -0,0 +1,35 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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" : "Claim from delivery",
"version" : "1.0",
"author" : "Tiny",
"category" : "Enterprise Specific Modules/Food Industries",
"depends" : ["base", "crm_claim", "stock"],
"init_xml" : [],
"demo_xml" : [],
"description": '''Create Claim from delivery order:
''',
"update_xml" : ["claim_delivery_view.xml"],
"active": False,
"installable": True
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,12 @@
<openerp>
<data>
<act_window
id="act_claim_from_delivery"
name="Claim"
target="current"
view_mode="form"
res_model="crm.claim"
src_model="stock.picking"/>
</data>
</openerp>
+45 -45
View File
@@ -30,19 +30,19 @@ from tools.translate import _
MAX_LEVEL = 15
AVAILABLE_STATES = [
('draft', 'Draft'),
('open', 'Open'),
('cancel', 'Cancelled'),
('done', 'Closed'),
('draft', 'Draft'),
('open', 'Open'),
('cancel', 'Cancelled'),
('done', 'Closed'),
('pending', 'Pending'),
]
AVAILABLE_PRIORITIES = [
('1', 'Highest'),
('2', 'High'),
('3', 'Normal'),
('4', 'Low'),
('5', 'Lowest'),
('2', 'High'),
('3', 'Normal'),
('4', 'Low'),
('5', 'Lowest'),
]
class crm_case(object):
@@ -107,10 +107,10 @@ class crm_case(object):
"""
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
return user.context_section_id.id or False
def stage_next(self, cr, uid, ids, context=None):
"""This function computes next stage for case from its current stage
using available stage for that case type
using available stage for that case type
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@@ -151,7 +151,7 @@ class crm_case(object):
def stage_previous(self, cr, uid, ids, context=None):
"""This function computes previous stage for case from its current stage
using available stage for that case type
using available stage for that case type
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@@ -177,11 +177,11 @@ class crm_case(object):
@param uid: the current user’s ID for security checks,
@param ids: List of case IDs
@param part: Partner's id
@email: Partner's email ID
@email: Partner's email ID
"""
if not part:
return {'value': {'partner_address_id': False,
'email_from': False,
return {'value': {'partner_address_id': False,
'email_from': False,
}}
addr = self.pool.get('res.partner').address_get(cr, uid, [part], ['contact'])
data = {'partner_address_id': addr['contact']}
@@ -195,13 +195,13 @@ class crm_case(object):
@param uid: the current user’s ID for security checks,
@param ids: List of case IDs
@param add: Id of Partner's address
@email: Partner's email ID
@email: Partner's email ID
"""
if not add:
return {'value': {'email_from': False}}
address = self.pool.get('res.partner.address').browse(cr, uid, add)
return {'value': {'email_from': address.email}}
def _history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, email_from=False, message_id=False, attach=[], context={}):
mailgate_pool = self.pool.get('mailgate.thread')
return mailgate_pool._history(cr, uid, cases, keyword, history=history,\
@@ -209,7 +209,7 @@ class crm_case(object):
details=details, email_from=email_from,\
message_id=message_id, attach=attach, \
context=context)
def case_open(self, cr, uid, ids, *args):
"""Opens Case
@param self: The object pointer
@@ -265,7 +265,7 @@ class crm_case(object):
if case.section_id.parent_id.user_id:
data['user_id'] = case.section_id.parent_id.user_id.id
else:
raise osv.except_osv(_('Error !'), _('You can not escalate this case.\nYou are already at the top level.'))
raise osv.except_osv(_('Error !'), _('You can not escalate, You are already at the top level regarding your sales-team category.'))
self.write(cr, uid, [case.id], data)
cases = self.browse(cr, uid, ids)
self._history(cr, uid, cases, _('Escalate'))
@@ -317,7 +317,7 @@ class crm_case(object):
self.write(cr, uid, ids, {'state': 'draft', 'active': True})
self._action(cr, uid, cases, 'draft')
return True
def remind_partner(self, cr, uid, ids, context={}, attach=False):
"""
@@ -350,7 +350,7 @@ class crm_case(object):
src = case.email_from
dest = case.section_id.reply_to
body = ""
body = case.email_last or case.description
body = case.email_last or case.description
if not destination:
src, dest = dest, src
if body and case.user_id.signature:
@@ -381,7 +381,7 @@ class crm_case(object):
# raise osv.except_osv(_('Email!'),("Email Successfully Sent"))
#else:
# raise osv.except_osv(_('Email Fail!'),("Email is not sent successfully"))
return True
return True
def _check(self, cr, uid, ids=False, context={}):
"""
@@ -428,12 +428,12 @@ class crm_case_section(osv.osv):
_order = "name"
_columns = {
'name': fields.char('Sales Team', size=64, required=True, translate=True),
'code': fields.char('Code', size=8),
'name': fields.char('Sales Team', size=64, required=True, translate=True),
'code': fields.char('Code', size=8),
'active': fields.boolean('Active', help="If the active field is set to \
true, it will allow you to hide the sales team without removing it."),
'allow_unlink': fields.boolean('Allow Delete', help="Allows to delete non draft cases"),
'user_id': fields.many2one('res.users', 'Responsible User'),
true, it will allow you to hide the sales team without removing it."),
'allow_unlink': fields.boolean('Allow Delete', help="Allows to delete non draft cases"),
'user_id': fields.many2one('res.users', 'Responsible User'),
'member_ids':fields.many2many('res.users', 'sale_member_rel', 'section_id', 'member_id', 'Team Members'),
'reply_to': fields.char('Reply-To', size=64, help="The email address put \
in the 'Reply-To' of all emails sent by Open ERP about cases in this sales team"),
@@ -445,8 +445,8 @@ class crm_case_section(osv.osv):
}
_defaults = {
'active': lambda *a: 1,
'allow_unlink': lambda *a: 1,
'active': lambda *a: 1,
'allow_unlink': lambda *a: 1,
}
_sql_constraints = [
@@ -463,7 +463,7 @@ class crm_case_section(osv.osv):
@param ids: List of Sales team ids
"""
level = 100
while len(ids):
cr.execute('select distinct parent_id from crm_case_section where id =ANY(%s)', (ids,))
ids = filter(None, map(lambda x: x[0], cr.fetchall()))
@@ -509,9 +509,9 @@ class crm_case_categ(osv.osv):
_description = "Category of case"
_columns = {
'name': fields.char('Case Category Name', size=64, required=True, translate=True),
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
'object_id': fields.many2one('ir.model', 'Object Name'),
'name': fields.char('Case Category Name', size=64, required=True, translate=True),
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
'object_id': fields.many2one('ir.model', 'Object Name'),
}
def _find_object_id(self, cr, uid, context=None):
@@ -541,9 +541,9 @@ class crm_case_resource_type(osv.osv):
_rec_name = "name"
_columns = {
'name': fields.char('Case Resource Type', size=64, required=True, translate=True),
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
'object_id': fields.many2one('ir.model', 'Object Name'),
'name': fields.char('Case Resource Type', size=64, required=True, translate=True),
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
'object_id': fields.many2one('ir.model', 'Object Name'),
}
def _find_object_id(self, cr, uid, context=None):
"""Finds id for case object
@@ -572,14 +572,14 @@ class crm_case_stage(osv.osv):
_order = "sequence"
_columns = {
'name': fields.char('Stage Name', size=64, required=True, translate=True),
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
'name': fields.char('Stage Name', size=64, required=True, translate=True),
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
'sequence': fields.integer('Sequence', help="Gives the sequence order \
when displaying a list of case stages."),
'object_id': fields.many2one('ir.model', 'Object Name'),
'probability': fields.float('Probability (%)', required=True),
when displaying a list of case stages."),
'object_id': fields.many2one('ir.model', 'Object Name'),
'probability': fields.float('Probability (%)', required=True),
'on_change': fields.boolean('Change Probability Automatically', \
help="Change Probability on next and previous stages."),
help="Change Probability on next and previous stages."),
'requirements': fields.text('Requirements')
}
def _find_object_id(self, cr, uid, context=None):
@@ -594,8 +594,8 @@ class crm_case_stage(osv.osv):
return ids and ids[0]
_defaults = {
'sequence': lambda *args: 1,
'probability': lambda *args: 0.0,
'sequence': lambda *args: 1,
'probability': lambda *args: 0.0,
'object_id' : _find_object_id
}
@@ -619,7 +619,7 @@ class users(osv.osv):
_inherit = 'res.users'
_description = "Users"
_columns = {
'context_section_id': fields.many2one('crm.case.section', 'Sales Team'),
'context_section_id': fields.many2one('crm.case.section', 'Sales Team'),
}
users()
@@ -627,7 +627,7 @@ users()
class res_partner(osv.osv):
_inherit = 'res.partner'
_columns = {
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
}
res_partner()
+2 -1
View File
@@ -48,7 +48,7 @@
<field name="date_deadline"/>
<button
name="convert_opportunity"
string="Convert"
string="Convert to Opportunity"
help="Convert to Opportunity"
icon="gtk-index"
type="object"/>
@@ -66,6 +66,7 @@
states="open,pending" type="object"
icon="gtk-go-forward" />
</group>
<field name="type" readonly="1"/>
</group>
<notebook colspan="4">
<page string="Lead">
+3 -3
View File
@@ -26,10 +26,10 @@
<field name="name">Opportunities</field>
<field name="res_model">crm.lead</field>
<field name="view_mode">tree,form,graph</field>
<field name="domain">[('type','=','opportunity')]</field>
<field name="context">{'search_default_current':1, 'default_type': 'opportunity'}</field>
<field name="domain">['|',('type','=','opportunity'),('state','=','draft')]</field>
<field name="context">{'search_default_user_id':uid,'search_default_current':1}</field>
<field name="view_id" ref="crm_case_tree_view_oppor"/>
<field name="context">{"search_default_user_id":uid}</field>
<field name="context">{'search_default_current':1, 'default_type': 'opportunity'}</field>
<field name="search_view_id" ref="crm.view_crm_case_opportunities_filter"/>
</record>
+1
View File
@@ -82,6 +82,7 @@
<newline/>
<field name="date_action"/>
<field name="priority" string="Priority"/>
<field name="type" readonly="1"/>
</group>
<notebook colspan="4">
<page string="Opportunity">
+158 -153
View File
File diff suppressed because it is too large Load Diff
+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-06-09 03:36+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: crm_vertical
+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-06-09 03:36+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: document_ics
+10 -22
View File
@@ -102,9 +102,15 @@ class email_template(osv.osv):
}
_columns = {
'name' : fields.char('Name of Template', size=100, required=True),
'name' : fields.char('Name', size=100, required=True),
'object_name':fields.many2one('ir.model', 'Model'),
'model_int_name':fields.char('Model Internal Name', size=200,),
'enforce_from_account':fields.many2one(
'email_template.account',
string="Enforce From Account",
help="Emails will be sent only from this account."),
'from_email' : fields.related('enforce_from_account', 'email_id',
type='char', string='From',),
'def_to':fields.char(
'Recepient (To)',
size=250,
@@ -141,7 +147,7 @@ class email_template(osv.osv):
help="The text version of the mail",
translate=True),
'use_sign':fields.boolean(
'Use Signature',
'Signature',
help="the signature from the User details"
"will be appened to the mail"),
'file_name':fields.char(
@@ -168,11 +174,6 @@ class email_template(osv.osv):
string="Allowed User Groups",
help="Only users from these groups will be"
" allowed to send mails from this Template"),
'enforce_from_account':fields.many2one(
'email_template.account',
string="Enforce From Account",
help="Emails will be sent only from this account.",
domain="[('company','=','yes')]"),
'model_object_field':fields.many2one(
'ir.model.fields',
string="Field",
@@ -218,6 +219,7 @@ class email_template(osv.osv):
}
_defaults = {
'template_language' : lambda *a:'mako',
}
_sql_constraints = [
@@ -623,19 +625,6 @@ class email_template_preview(osv.osv_memory):
_name = "email_template.preview"
_description = "Email Template Preview"
def _get_model_recs(self, cr, uid, context=None):
if context is None:
context = {}
#Fills up the selection box which allows records from the selected object to be displayed
self.context = context
if 'active_id' in context.keys():
# context['active_id'] = 5
ref_obj_id = self.pool.get('email.template').read(cr, uid, context['active_id'], ['object_name'], context)
ref_obj_name = self.pool.get('ir.model').read(cr, uid, ref_obj_id[0], ['model'], context)['model']
ref_obj_ids = self.pool.get(ref_obj_name).search(cr, uid, [], context=context)
ref_obj_recs = self.pool.get(ref_obj_name).name_get(cr, uid, ref_obj_ids, context)
return ref_obj_recs
def _default_model(self, cursor, user, context=None):
"""
Returns the default value for model field
@@ -655,7 +644,6 @@ class email_template_preview(osv.osv_memory):
'email.template',
'Template', readonly=True),
'rel_model':fields.many2one('ir.model', 'Model', readonly=True),
'rel_model_ref':fields.selection(_get_model_recs, 'Referred Document'),
'to':fields.char('To', size=250, readonly=True),
'cc':fields.char('CC', size=250, readonly=True),
'bcc':fields.char('BCC', size=250, readonly=True),
@@ -668,7 +656,7 @@ class email_template_preview(osv.osv_memory):
'ref_template': lambda self, cr, uid, ctx:ctx['active_id'],
'rel_model': _default_model
}
# Need to check
def on_change_ref(self, cr, uid, ids, rel_model_ref, context=None):
if context is None:
context = {}
@@ -30,7 +30,7 @@ class email_template_account(osv.osv):
'text/html'
]
_columns = {
'name': fields.char('Email Account Desc',
'name': fields.char('Description',
size=64, required=True,
readonly=True, select=True,
states={'draft':[('readonly', False)]}),
@@ -56,22 +56,16 @@ class email_template_account(osv.osv):
size=120, invisible=True,
required=False, readonly=True,
states={'draft':[('readonly', False)]}),
'smtptls':fields.boolean('Use TLS',
'smtptls':fields.boolean('TLS',
states={'draft':[('readonly', False)]}, readonly=True),
'smtpssl':fields.boolean('Use SSL/TLS (only in python 2.6)',
'smtpssl':fields.boolean('SSL/TLS (only in python 2.6)',
states={'draft':[('readonly', False)]}, readonly=True),
'send_pref':fields.selection([
('html', 'HTML otherwise Text'),
('text', 'Text otherwise HTML'),
('both', 'Both HTML & Text')
], 'Mail Format', required=True),
'allowed_groups':fields.many2many(
'res.groups',
'account_group_rel', 'templ_id', 'group_id',
string="Allowed User Groups",
help="Only users from these groups will be" \
"allowed to send mails from this ID"),
'company':fields.selection([
('yes', 'Yes'),
('no', 'No')
@@ -89,7 +83,7 @@ class email_template_account(osv.osv):
('suspended', 'Suspended'),
('approved', 'Approved')
],
'Account Status', required=True, readonly=True),
'Status', required=True, readonly=True),
}
_defaults = {
@@ -102,7 +96,6 @@ class email_template_account(osv.osv):
['name'],
context
)['name'],
'smtpssl':lambda * a:True,
'state':lambda * a:'draft',
'user':lambda self, cursor, user, context:user,
'send_pref':lambda * a: 'html',
@@ -36,9 +36,6 @@
<field name="send_pref" colspan="2" />
</group>
</page>
<page string="security" attrs="{'invisible':[('company','!=','yes')]}">
<field name="allowed_groups" attrs="{'required':[('company','=','yes')]}" nolabel="1"/>
</page>
</notebook>
<group colspan="4" col="10">
<field name="state" select="1"/>
@@ -52,7 +52,6 @@ class email_template_mailbox(osv.osv):
for attid in values['attachments_ids']:
attachment = self.pool.get('ir.attachment').browse(cr, uid, attid, context)#,['datas_fname','datas'])
payload[attachment.datas_fname] = attachment.datas
print "233333333333333"
result = account_obj.send_mail(cr, uid,
[values['account_id'][0]],
{'To':values.get('email_to', u'') or u'', 'CC':values.get('email_cc', u'') or u'', 'BCC':values.get('email_bcc', u'') or u''},
@@ -153,30 +152,6 @@ class email_template_mailbox(osv.osv):
'folder': lambda * a: 'outbox',
}
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
if context is None:
context = {}
if context.get('company', False):
users_groups = self.pool.get('res.users').browse(cr, uid, uid, context).groups_id
group_acc_rel = {}
#get all accounts and get a table of {group1:[account1,account2],group2:[account1]}
for each_account_id in self.pool.get('email_template.account').search(cr, uid, [('state', '=', 'approved'), ('company', '=', 'yes')], context=context):
account = self.pool.get('email_template.account').browse(cr, uid, each_account_id, context)
for each_group in account.allowed_groups:
if not account.id in group_acc_rel.get(each_group, []):
groups = group_acc_rel.get(each_group, [])
groups.append(account.id)
group_acc_rel[each_group] = groups
users_company_accounts = []
for each_group in group_acc_rel.keys():
if each_group in users_groups:
for each_account in group_acc_rel[each_group]:
if not each_account in users_company_accounts:
users_company_accounts.append(each_account)
args.append(('account_id', 'in', users_company_accounts))
return super(osv.osv, self).search(cr, uid, args, offset, limit,
order, context=context, count=count)
email_template_mailbox()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -53,8 +53,8 @@
</notebook>
<separator colspan="4" string="" />
<group col="4" colspan="4">
<field name="state" colspan="2" readonly="1" />
<button name="complete_mail" type="object" string="Download Full Mail" colspan="2" states="read,unread" />
<field name="state" readonly="1" />
<button name="complete_mail" type="object" string="Download Full Mail" states="read,unread" />
<button name="send_this_mail" type="object" string="Send Mail" />
</group>
</form>
@@ -62,9 +62,8 @@
</record>
<!--============================================= TREE VIEWS =============================================-->
<!--DRAFTS-->
<record model="ir.ui.view" id="email_template_drafts_tree">
<field name="name">email_template.mailbox.draftstree</field>
<record id="view_email_template_mailbox_tree" model="ir.ui.view">
<field name="name">email_template.mailbox.tree</field>
<field name="model">email_template.mailbox</field>
<field name="type">tree</field>
<field name="arch" type="xml">
@@ -77,51 +76,6 @@
</tree>
</field>
</record>
<!--OUTBOX-->
<record model="ir.ui.view" id="email_template_outbox_tree">
<field name="name">email_template.mailbox.outboxtree</field>
<field name="model">email_template.mailbox</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Outbox">
<field name="user" />
<field name="email_from" select="1" />
<field name="subject" select="1" />
<field name="attachments_ids" select="2" />
<field name="date_mail" select="2" />
</tree>
</field>
</record>
<!--SENT-->
<record model="ir.ui.view" id="email_template_sentbox_tree">
<field name="name">email_template.mailbox.sentboxtree</field>
<field name="model">email_template.mailbox</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Sent">
<field name="user" />
<field name="email_from" select="1" />
<field name="subject" select="1" />
<field name="attachments_ids" select="2" />
<field name="date_mail" select="2" />
</tree>
</field>
</record>
<!--TRASH-->
<record model="ir.ui.view" id="email_template_trashbox_tree">
<field name="name">email_template.mailbox.trashboxtree</field>
<field name="model">email_template.mailbox</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Trash">
<field name="user" />
<field name="email_from" select="1" />
<field name="subject" select="1" />
<field name="attachments_ids" select="2" />
<field name="date_mail" select="2" />
</tree>
</field>
</record>
<record id="view_email_template_mailbox_search" model="ir.ui.view">
<field name="name">email_template.mailbox.search</field>
@@ -150,7 +104,7 @@
<field name="res_model">email_template.mailbox</field>
<field name="view_type">form</field>
<field name="view_mode">form,tree</field>
<field name="view_id" ref="email_template_outbox_tree" />
<field name="view_id" ref="view_email_template_mailbox_tree" />
<field name="context">{'group_by': [], 'search_default_draft': 1, 'search_default_outbox': 1}</field>
<field name="search_view_id" ref="view_email_template_mailbox_search"/>
</record>
@@ -62,7 +62,9 @@
<field name="model_int_name" invisible="1" />
<notebook colspan="4">
<page string="Mail Details">
<field name="enforce_from_account" required= "1"/>
<group col="4" colspan="2">
<field name="from_email"/>
<field name="def_to" colspan="4" required="1" />
<field name="def_cc" colspan="4" />
<field name="def_bcc" colspan="4" />
@@ -109,15 +111,7 @@
type="action" colspan="4" target="new" />
</group>
</page>
<page string="Security">
<separator colspan="4" string="Allowed User Groups" />
<field name="allowed_groups" string="Allowed User Groups"
nolabel="1" />
</page>
<page string="Advanced">
<separator string="Automatic Email" colspan="4" />
<field name="enforce_from_account" attrs="{'required':[('auto_email','=',True)]}" />
<newline/>
<field name="ref_ir_act_window" />
<field name="ref_ir_value" />
<separator string="Attachments (Report to attach)" colspan="4"/>
+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-06-09 03:35+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: event
+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-06-09 03:36+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
+11 -11
View File
@@ -1,15 +1,15 @@
- |
In order to test the hr module in OpenERP, I will create new Employee , Department and Job Position.
In order to test hr module in OpenERP, I will create new Employee , Department and Job Position.
-
|
First I create Department "R & D" in Department form.
I create "R & D" Department in Department form.
-
!record {model: hr.department, id: hr_department_rd0}:
manager_id: base.user_root
name: 'R & D '
-
|
Now, I create a new employee “employee1”.
Now, I create a new employee “Mark Johnson”.
select "R & D" Department which I had created.
-
!record {model: hr.employee, id: hr_employee_employee0}:
@@ -22,7 +22,7 @@
department_id: 'hr_department_rd0'
- |
In order to check the wizard “Employee Hierarchy” I will create new employee “employee2” and select "employee1" as
In order to check the wizard “Employee Hierarchy” , I will create new employee “Phil Graves ” and select "Mark Johnson" as
Manager.
-
!record {model: hr.employee, id: hr_employee_employee1}:
@@ -33,11 +33,11 @@
user_id: base.user_demo
parent_id: 'hr_employee_employee0'
- |
Now I will open up form view of “employee1” and test the wizard “Employee Hierarchy” so it display the employee
hierarchy starting from “employee1”.
I will open up form view of “Mark Johnson” and test the wizard “Employee Hierarchy” so it display the employee
hierarchy starting from “Mark Johnson”.
- |
Now I will create new Job Position. I will check successfull creation of new Job Position by adding the information.
I will create new Job Position. I will check successfull creation of new Job Position by adding the information.
-
!record {model: hr.job, id: hr_job_jea0}:
department_id: 'hr_department_rd0'
@@ -51,17 +51,17 @@
- state == 'open'
- |
I create Employee for this position in this Job Position form.
I create Employee for job position.
-
!record {model: hr.job, id: hr_job_jea0}:
employee_ids:
- address_home_id: base.res_partner_address_1
name: employee3
name: Manuel Lehba
department_id: 'hr_department_rd0'
gender: male
parent_id: 'hr_employee_employee0'
-
I check that "NO of Employee" is "1"
- |
I check that "Number of Employees" field have some value.
-
!assert {model: hr.job, id: hr_job_jea0}:
- no_of_employee != False
+1
View File
@@ -44,6 +44,7 @@
'wizard/hr_attendance_sign_in_out_view.xml',
],
'demo_xml': ['hr_attendance_demo.xml'],
'test': ['test/test_hr_attendance.yml'],
'installable': True,
'active': False,
'certificate': '0063495605613',
@@ -0,0 +1,109 @@
- |
In order to test hr_attendance module in OpenERP, I create new attendance and perform Sign In/Sign Out operation.
- |
First I create Employee "Mark Johnson".
-
!record {model: hr.employee, id: hr_employee_employee0}:
address_home_id: base.res_partner_address_1
company_id: base.main_company
gender: male
name: Mark Johnson
user_id: base.user_root
- |
Given that I have Attendance Reason "Good Morning" for Sign In.
-
!record {model: hr.action.reason, id: hr_action_reason_goodmorning0}:
name: Good Morning
action_type: sign_in
- |
I also create another Attendance Reason for Sign Out.
-
!record {model: hr.action.reason, id: hr_action_reason_goodnight0}:
name: Good Night
action_type: sign_out
- |
Now , When I came in office , I create Atendances and perform "Sign In" action with proper reason.
-
!record {model: hr.attendance, id: hr_attendance_0}:
action: sign_in
action_desc: 'hr_action_reason_goodmorning0'
employee_id: 'hr_employee_employee0'
name: '2010-05-18 19:08:08'
- |
I check that Employee is in "Present" state.
-
!assert {model: hr.employee, id: hr_employee_employee0}:
- state == 'present'
- |
When I left office , I create attendance and perform "Sign Out".
-
!record {model: hr.attendance, id: hr_attendance_1}:
action: sign_out
employee_id: 'hr_employee_employee0'
name: '2010-05-18 19:10:55'
- |
I check that Employee is in "Absent" state.
-
!assert {model: hr.employee, id: hr_employee_employee0}:
- state == 'absent'
- |
I can also fill my attendance using "Sign In/Sign Out" wizard.
-
!record {model: hr.sign.in.out, id: hr_sign_in_out_markjohnson0}:
name: Mark Johnson
state: absent
- |
I click on "Sign In" button of this wizard to perform present action.
-
!python {model: hr.sign.in.out}: |
obj_attendance = self.pool.get('hr.employee')
emp_id = obj_attendance.search(cr, uid, [('user_id', '=', uid), ('name', '=', "Mark Johnson")])
if emp_id:
employee = obj_attendance.read(cr, uid, emp_id)[0]
self.write(cr, uid, [ref('hr_sign_in_out_markjohnson0')], {'name': employee['name'], 'state': employee['state'], 'emp_id': emp_id[0]})
self.si_check(cr, uid, [ref("hr_sign_in_out_markjohnson0")], {"active_id": ref("hr_employee_employee0")})
- |
I check that Employee is in "Present" state.
-
!assert {model: hr.employee, id: hr_employee_employee0}:
- state == 'present'
- |
I forgot to "Sign Out" in Yesterday and want to sign in Today using This wizard.
-
!record {model: hr.sign.in.out, id: hr_sign_in_out_markjohnson0}:
name: Mark Johnson
state: present
- |
I click on "Sign In" button of this wizard. that will Open new form which ask for Last Sign Out date.
-
!python {model: hr.sign.in.out}: |
obj_attendance = self.pool.get('hr.employee')
emp_id = obj_attendance.search(cr, uid, [('user_id', '=', uid), ('name', '=', "Mark Johnson")])
if emp_id:
employee = obj_attendance.read(cr, uid, emp_id)[0]
self.write(cr, uid, [ref('hr_sign_in_out_markjohnson0')], {'name': employee['name'], 'state': employee['state'], 'emp_id': emp_id[0]})
self.si_check(cr, uid, [ref("hr_sign_in_out_markjohnson0")])
- |
I select Last Sign Out date in "hr sign out ask" wizard.
-
!record {model: hr.sign.in.out.ask, id: hr_sign_in_out_ask_markjohnson0}:
last_time: !eval time.strftime('%Y-%m-%d %H:%M:%S')
name: Mark Johnson
- |
Now I click on "Sign In" button of this wizard.
-
!python {model: hr.sign.in.out.ask}: |
obj_attendance = self.pool.get('hr.employee')
emp_id = obj_attendance.search(cr, uid, [('user_id', '=', uid), ('name', '=', "Mark Johnson")])
if emp_id:
employee = obj_attendance.read(cr, uid, emp_id)[0]
self.write(cr, uid, [ref('hr_sign_in_out_ask_markjohnson0')], {'emp_id': emp_id[0]})
#self.sign_in(cr, uid, [ref("hr_sign_in_out_ask_markjohnson0")], {"active_ids": [ref("hr_attendance.menu_hr_attendance_sigh_in_out")]})
@@ -33,16 +33,16 @@ class hr_si_so_ask(osv.osv_memory):
'emp_id': fields.char('Empoyee ID', size=32, required=True, readonly=True),
}
def _get_empname(self, cr, uid, context=None):
service = netsvc.LocalService('object_proxy')
emp_id = service.execute(cr.dbname, uid, 'hr.employee', 'search', [('user_id', '=', uid)])
emp_obj = self.pool.get('hr.employee')
emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid)])
if emp_id:
employee = service.execute(cr.dbname, uid, 'hr.employee', 'read', emp_id)[0]
employee = emp_obj.read(cr, uid, emp_id)[0]
return employee['name']
return ''
def _get_empid(self, cr, uid, context=None):
service = netsvc.LocalService('object_proxy')
emp_id = service.execute(cr.dbname, uid, 'hr.employee', 'search', [('user_id', '=', uid)])
emp_obj = self.pool.get('hr.employee')
emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid)])
if emp_id:
return emp_id[0]
return False
@@ -74,10 +74,10 @@ class hr_sign_in_out(osv.osv_memory):
}
def _get_empid(self, cr, uid, context=None):
service = netsvc.LocalService('object_proxy')
emp_id = service.execute(cr.dbname, uid, 'hr.employee', 'search', [('user_id', '=', uid)])
emp_obj = self.pool.get('hr.employee')
emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid)])
if emp_id:
employee = service.execute(cr.dbname, uid, 'hr.employee', 'read', emp_id)[0]
employee = emp_obj.read(cr, uid, emp_id)[0]
return {'name': employee['name'], 'state': employee['state'], 'emp_id': emp_id[0]}
return {}
@@ -88,12 +88,13 @@ class hr_sign_in_out(osv.osv_memory):
return res
def si_check(self, cr, uid, ids, context=None):
service = netsvc.LocalService('object_proxy')
att_obj = self.pool.get('hr.attendance')
obj_model = self.pool.get('ir.model.data')
data = self.read(cr, uid, ids, [])[0]
emp_id = data['emp_id']
att_id = service.execute(cr.dbname, uid, 'hr.attendance', 'search', [('employee_id', '=', emp_id)], limit=1, order='name desc')
last_att = service.execute(cr.dbname, uid, 'hr.attendance', 'read', att_id)
att_id = att_obj.search(cr, uid, [('employee_id', '=', emp_id)], limit=1, order='name desc')
last_att = att_obj.read(cr, uid, att_id)
if last_att:
last_att = last_att[0]
cond = not last_att or last_att['action'] == 'sign_out'
@@ -113,12 +114,13 @@ class hr_sign_in_out(osv.osv_memory):
}
def so_check(self, cr, uid, ids, context=None):
service = netsvc.LocalService('object_proxy')
att_obj = self.pool.get('hr.attendance')
obj_model = self.pool.get('ir.model.data')
data = self.read(cr, uid, ids, [])[0]
emp_id = data['emp_id']
att_id = service.execute(cr.dbname, uid, 'hr.attendance', 'search', [('employee_id', '=', emp_id),('action','!=','action')], limit=1, order='name desc')
last_att = service.execute(cr.dbname, uid, 'hr.attendance', 'read', att_id)
att_id = att_obj.search(cr, uid, [('employee_id', '=', emp_id),('action','!=','action')], limit=1, order='name desc')
last_att = att_obj.read(cr, uid, att_id)
if last_att:
last_att = last_att[0]
if not att_id and not last_att:
@@ -151,31 +153,31 @@ class hr_sign_in_out(osv.osv_memory):
}
def sign_in(self, cr, uid, data, context=None):
service = netsvc.LocalService('object_proxy')
att_obj = self.pool.get('hr.attendance')
emp_id = data['emp_id']
if 'last_time' in data:
if data['last_time'] > time.strftime('%Y-%m-%d %H:%M:%S'):
raise osv.except_osv(_('UserError'), _('The sign-out date must be in the past'))
service.execute(cr.dbname, uid, 'hr.attendance', 'create', {
att_obj.create(cr, uid, {
'name': data['last_time'],
'action': 'sign_out',
'employee_id': emp_id
})
try:
success = service.execute(cr.dbname, uid, 'hr.employee', 'attendance_action_change', [emp_id], 'sign_in')
success = self.pool.get('hr.employee').attendance_action_change(cr, uid, [emp_id], 'sign_in')
except:
raise osv.except_osv(_('UserError'), _('A sign-in must be right after a sign-out !'))
return {} # To do: Return Success message
def sign_out(self, cr, uid, data, context=None):
service = netsvc.LocalService('object_proxy')
att_obj = self.pool.get('hr_attendance')
emp_id = data['emp_id']
if 'last_time' in data:
if data['last_time'] > time.strftime('%Y-%m-%d %H:%M:%S'):
raise osv.except_osv(_('UserError'), _('The Sign-in date must be in the past'))
service.execute(cr.dbname, uid, 'hr.attendance', 'create', {'name':data['last_time'], 'action':'sign_in', 'employee_id':emp_id})
att_obj.create(cr, uid, {'name':data['last_time'], 'action':'sign_in', 'employee_id':emp_id})
try:
success = service.execute(cr.dbname, uid, 'hr.employee', 'attendance_action_change', [emp_id], 'sign_out')
success = self.pool.get('hr.employee').attendance_action_change(cr, uid, [emp_id], 'sign_out')
except:
raise osv.except_osv(_('UserError'), _('A sign-out must be right after a sign-in !'))
return {} # To do: Return Success message
+3 -3
View File
@@ -3,7 +3,7 @@
I will create contract for "Mark Johnson" employee.
- |
First I create Employee "Mark Johnson"
I create Employee "Mark Johnson" to assign contract.
-
!record {model: hr.employee, id: hr_employee_employee0}:
address_home_id: base.res_partner_address_1
@@ -30,9 +30,9 @@
type: gross
- |
Now I start by create contract for "Mark Johnson".
Now I start by creating contract for "Mark Johnson".
Select wage type "Monthly Gross Wage" and Wage period "monthly"
which I have given.
which I had given.
-
!record {model: hr.contract, id: hr_contract_contract0}:
advantages_gross: 0.0
+4 -3
View File
@@ -35,13 +35,14 @@
is done by the manager.Every evaluation filled by the employees can be viewed
in the form of.Implements a dashboard for My Current Evaluations """,
"init_xml" : [],
"demo_xml" : ["hr_evaluation_demo.xml"],
"demo_xml" : ["hr_evaluation_demo.xml",
],
"update_xml" : [
"security/ir.model.access.csv",
"wizard/hr_evaluation_mail_view.xml",
"hr_evaluation_view.xml",
"report/hr_evaluation_report_view.xml",
'board_hr_evaluation_view.xml',],
"report/hr_evaluation_report_view.xml"],
"test": ["test/test_hr_evaluation.yml"],
"active": False,
"installable": True
}
+1 -1
View File
@@ -14,7 +14,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-06-09 03:36+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_evaluation
@@ -0,0 +1,152 @@
- |
In order to test hr_evaluation module for OpenERP, I will create plan then create evaluation under that plan.
-
|
Given that I have "R & D" Department for employee.
-
!record {model: hr.department, id: hr_department_rd0}:
manager_id: base.user_root
name: 'R & D '
-
|
Given that I have Employee “Mark Johnson” which take Interview.
select "R & D" Department.
-
!record {model: hr.employee, id: hr_employee_employee0}:
address_home_id: base.res_partner_address_1
company_id: base.main_company
gender: male
marital: hr.hr_employee_marital_status_single
name: Mark Johnson
user_id: base.user_root
department_id: 'hr_department_rd0'
- |
I create new employee “Phil Graves ” and select "Mark Johnson" as
Manager.
-
!record {model: hr.employee, id: hr_employee_employee1}:
address_home_id: base.res_partner_address_3000
company_id: base.main_company
gender: male
name: Phil Graves
user_id: base.user_demo
parent_id: 'hr_employee_employee0'
- |
I Create "Employee Evaluation" survey for Manager's Evaluation Plan.
-
!record {model: 'survey', id: survey_0}:
title: 'Employee Evaluation'
max_response_limit: 20
response_user: 2
- |
I Create "Employee Evaluation" page in "Employee Evaluation" survey.
-
!record {model: 'survey.page', id: survey_employee_page_0}:
title: 'Employee Evaluation'
survey_id: survey_0
- |
I Create "What is your Name" question in "Employee Evaluation" survey page.
-
!record {model: 'survey.question', id: survey_p_question_0}:
question: 'What is your Name?'
type: 'single_textbox'
sequence: 1
page_id: survey_employee_page_0
- |
I Create "What is your gender" Question in "Employee Evaluation" survey page.
-
!record {model: 'survey.question', id: survey_p_question_1}:
question: 'What is your gender?'
type: multiple_choice_only_one_ans
sequence: 2
is_require_answer: true
page_id: survey_employee_page_0
- |
I Create "Male" answer in question "What is your gender?"
-
!record {model: 'survey.answer', id: survey_p_1_1}:
answer: 'Male'
sequence: 1
question_id : survey_p_question_1
- |
I Create "Female" answer in question "What is your gender?"
-
!record {model: 'survey.answer', id: survey_p_1_2}:
answer: 'Female'
sequence: 2
question_id : survey_p_question_1
- |
Now Survey set in open state.
-
!python {model: survey}: |
self.survey_open(cr, uid, [ref("survey_0")], context)
- |
I creating a Evaluation plan and select "Employee Evaluation" survey for "Send to Subordinates" and "Final interview with Manager" Phase.
-
!record {model: hr_evaluation.plan, id: hr_evaluation_plan_managersplan0}:
company_id: base.main_company
month_first: 3
month_next: 6
name: Manager's Plan
phase_ids:
- action: bottom-up
name: Send to Subordinates
survey_id: 'survey_0'
- action: top-down
name: Final Interview with manager
sequence: 2
survey_id: 'survey_0'
- |
Now I create Evaluation for "Phil Graves" Employee under "Manager Evaluation Plan".
-
!record {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0}:
date: '2010-06-28'
employee_id: 'hr_employee_employee1'
plan_id: 'hr_evaluation_plan_managersplan0'
progress: 0.0
state: draft
- |
I check that Evaluation is in "Draft" state.
-
!assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0}:
- state == 'draft'
- |
I start Evaluation process by click on "Start Evaluation" button.
-
!python {model: hr_evaluation.evaluation}: |
self.button_plan_in_progress(cr, uid, [ref('hr_evaluation_evaluation_0')])
- |
After that Manager Evaluation plan is In Progress.
I close this servey request by giving answer of survey question.
-
!python {model: hr.evaluation.interview}: |
self.survey_req_done(cr, uid, [ref('hr_evaluation_evaluation_0')])
- |
I click on "Final Validation" button to finalize Evaluation.
-
!python {model: hr_evaluation.evaluation}: |
self.button_final_validation(cr, uid, [ref("hr_evaluation.hr_evaluation_evaluation_0")],
{"active_ids": [ref("hr_evaluation.menu_open_view_hr_evaluation_tree")]})
- |
I check that state is "Final Validation".
-
!assert {model: hr_evaluation.evaluation, id: hr_evaluation_evaluation_0}:
- state == 'progress'
- |
Give Rating "Meet expectations" by selecting overall Rating.
-
!record {model: hr_evaluation.evaluation, id: hr_evaluation.hr_evaluation_evaluation_0}:
rating: '2'
- |
I close this Evaluation by click on "Done" button of this wizard.
-
!python {model: hr_evaluation.evaluation}: |
self.button_done(cr, uid, [ref("hr_evaluation.hr_evaluation_evaluation_0")], {"active_ids": [ref("hr_evaluation.menu_open_view_hr_evaluation_tree")]})
+4 -8
View File
@@ -34,23 +34,19 @@
<field name="color_name">red</field>
</record>
<record model="hr.holidays" id="hr_holidays_employee1_allocation_sl">
<field name="name">Sick Leave for Fabien Pinckaers</field>
<field name="holiday_status_id" ref="holiday_status_sl"/>
<field name="type">add</field>
<field name="number_of_days_temp">7</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record model="hr.holidays" id="hr_holidays_employee1_sl">
<field name="name">Doctor Appointment</field>
<field name="holiday_status_id" ref="holiday_status_sl"/>
<field name="date_from">2010-02-01 00:00</field>
<field name="date_to">2010-02-03 08:00</field>
<field name="type">remove</field>
<field name="state">draft</field>
<field name="number_of_days_temp">3</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<workflow action="confirm" model="hr.holidays" ref="hr_holidays_employee1_sl"/>
<workflow action="validate" model="hr.holidays" ref="hr_holidays_employee1_sl"/>
</data>
</openerp>
+11 -12
View File
@@ -1,6 +1,5 @@
- |
In order to test the hr_holiday in OpenERP, I will Manage leaves for employee,
Leave requests.
In order to test the hr_holiday in OpenERP, I will Allocate leaves for Employee and manage leaves and leaves requests.
- |
For that First I create new user "user1" to make leave request.
-
@@ -15,7 +14,7 @@
name: user1
password: user1
- |
Now, I create a new employee “Mark Johnshon” as Manager to validate employee leave.
I create a new employee “Mark Johnshon” as Manager to validate employee leave.
-
!record {model: hr.employee, id: hr_employee_employee0}:
address_home_id: base.res_partner_address_1
@@ -24,11 +23,11 @@
name: Mark Johnson
user_id: base.user_root
- |
create another employee "Brijesh Patel" as "user1" who make leave request.
Create another employee "Phil Graves" as "user1" who make leave request.
-
!record {model: hr.employee, id: hr_employee_brijeshpatel0}:
!record {model: hr.employee, id: hr_employee_philgraves0}:
address_home_id: base.res_partner_address_8
name: Brijesh Patel
name: Phil Graves
parent_id: 'hr_employee_employee0'
user_id: 'res_users_user0'
- |
@@ -40,11 +39,11 @@
limit: 1
- |
After that I allocate leave request for employee "Brijesh Patel".
After that I allocate leave request for employee "Phil Graves".
-
!record {model: hr.holidays, id: hr_holidays_allocateleaveforuser0}:
allocation_type: employee
employee_id: 'hr_employee_brijeshpatel0'
employee_id: 'hr_employee_philgraves0'
holiday_status_id: hr_holidays_status_fullleave0
name: Allocate leave for user1
number_of_days_temp: 12.0
@@ -62,13 +61,13 @@
!workflow {model: hr.holidays, action: validate, ref: hr_holidays_allocateleaveforuser0}
- |
Now employee "Brijesh Patel" want to leave. so, I connect as user1 which is username of this employee and want to make leave request.
Now employee "Phil Graves" want to leave. so, I connect as user1 which is username of this employee and want to make leave request.
-
!record {model: hr.holidays, id: hr_holidays_iwanttoleaveforgotohospital0}:
allocation_type: employee
date_from: '2010-05-20 11:48:00'
date_to: '2010-05-21 11:48:00'
employee_id: 'hr_employee_brijeshpatel0'
employee_id: 'hr_employee_philgraves0'
holiday_status_id: 'hr_holidays_status_fullleave0'
name: I want to leave for go to hospital
notes: I want to leave for go to hospital. so please accept my leave.
@@ -82,12 +81,12 @@
- state == 'draft'
- |
Now I confirm my leave Request by click on "Confirm" button.
I confirm my leave Request by click on "Confirm" button.
-
!workflow {model: hr.holidays, action: confirm, ref: hr_holidays_iwanttoleaveforgotohospital0}
- |
Now I connect as Admin user and Open Leave request of "Brijesh Patel".
I connect as Admin user and Open Leave request of "Phil Graves".
and "validate" it by click on "validate" button.
-
!workflow {model: hr.holidays, action: validate, ref: hr_holidays_iwanttoleaveforgotohospital0}
+60 -32
View File
@@ -65,9 +65,9 @@ hr_passport()
class hr_payroll_structure(osv.osv):
"""
Salary structure used to defined
* Basic
* Allowlance
* Deductions
- Basic
- Allowlance
- Deductions
"""
_name = 'hr.payroll.structure'
@@ -127,9 +127,9 @@ class hr_contract(osv.osv):
hr_contract()
class payroll_register(osv.osv):
'''
"""
Payroll Register
'''
"""
_name = 'hr.payroll.register'
_description = 'Payroll Register'
@@ -514,11 +514,14 @@ class contrib_register_line(osv.osv):
contrib_register_line()
class payment_category(osv.osv):
'''
Open ERP Model
'''
"""
Allowance, Deduction Heads
House Rent Allowance, Medical Allowance, Food Allowance
Professional Tax, Advance TDS, Providend Funds, etc
"""
_name = 'hr.allounce.deduction.categoty'
_description = 'Allowance Deduction Categoty'
_description = 'Allowance Deduction Heads'
_columns = {
'name':fields.char('Categoty Name', size=64, required=True, readonly=False),
@@ -528,14 +531,40 @@ class payment_category(osv.osv):
('deduct','Deduction'),
('other','Others'),
],'Type', select=True),
'contribute_per':fields.float('Contribution', digits=(16, int(config['price_accuracy'])), help='Define Company contribution ratio 1.00=100% contribution, If Employee Contribute 5% then company will and here 0.50 defined then company will contribute 50% on employee 5% contribution'),
'contribute':fields.boolean('Contribe by Company ?', help='Is company contribute on this deduction, like Provident Fund'),
'include_in_salary':fields.boolean('Included in Salary ?', help='If company contribute on this deduction then should company contribution is also deducted from Employee Salary'),
'gratuity':fields.boolean('Use for Gratuity ?', required=False),
'line_ids':fields.one2many('hr.allounce.deduction.categoty.line', 'category_id', 'Calculations', required=False),
'base':fields.char('Based on', size=64, required=True, readonly=False, help='This will use to computer the % fields values, in general its on basic, but You can use all heads code field in small letter as a variable name i.e. hra, ma, lta, etc...., also you can use, static varible basic'),
'condition':fields.char('Condition', size=1024, required=True, readonly=False, help='Applied this head for calculation if condition is true'),
'sequence': fields.integer('Sequence', required=True, help='Use to arrange calculation sequence'),
'note': fields.text('Description'),
'user_id':fields.char('User', size=64, required=False, readonly=False),
'state':fields.char('Label', size=64, required=False, readonly=False),
'company_id':fields.many2one('res.company', 'Company', required=False),
}
_defaults = {
'condition': lambda *a: 'True',
'base': lambda *a:'basic',
'sequence': lambda *a:5,
'company_id': lambda self, cr, uid, context: \
self.pool.get('res.users').browse(cr, uid, uid,
context=context).company_id.id,
}
payment_category()
class company_contribution(osv.osv):
"""
Company contribution
Allows to configure company contribution for some taxes
"""
_name = 'company.contribution'
_description = "Company Contribution"
_columns = {
'category_id':fields.many2one('hr.allounce.deduction.categoty', 'Heads', required=False),
'name':fields.char('Name', size=256, required=True, readonly=False),
'code':fields.char('Code', size=64, required=True, readonly=False),
'include_in_salary':fields.boolean('Included in Salary ?', help='If company contribute on this deduction then should company contribution is also deducted from Employee Salary'),
'gratuity':fields.boolean('Use for Gratuity ?', required=False),
'line_ids':fields.one2many('company.contribution.line', 'contribution_id', 'Calculations', required=False),
'register_id':fields.property(
'hr.contibution.register',
type='many2one',
@@ -546,15 +575,11 @@ class payment_category(osv.osv):
help="Contribution register based on company",
required=False
),
'note': fields.text('Description'),
'user_id':fields.char('User', size=64, required=False, readonly=False),
'state':fields.char('Label', size=64, required=False, readonly=False),
'company_id':fields.many2one('res.company', 'Company', required=False),
'amount_type':fields.selection([
# ('per','Percentage (%)'),
('fix','Fixed Amount'),
('func','Function Calculation'),
],'Amount Type', select=True),
'contribute_per':fields.float('Contribution', digits=(16, int(config['price_accuracy'])), help='Define Company contribution ratio 1.00=100% contribution, If Employee Contribute 5% then company will and here 0.50 defined then company will contribute 50% on employee 5% contribution'),
'account_id':fields.property(
'account.account',
type='many2one',
@@ -565,12 +590,14 @@ class payment_category(osv.osv):
help="Expanse account where company expanse will be encoded",
required=False
),
'company_id':fields.many2one('res.company', 'Company', required=False),
'active':fields.boolean('Active', required=False),
'note': fields.text('Description'),
}
_defaults = {
'condition': lambda *a: 'True',
'base': lambda *a:'basic',
'sequence': lambda *a:5,
'amount_type': lambda *a:'fix',
'active': lambda *a:True,
'company_id': lambda self, cr, uid, context: \
self.pool.get('res.users').browse(cr, uid, uid,
context=context).company_id.id,
@@ -583,7 +610,7 @@ class payment_category(osv.osv):
uid: user id of current executer
"""
line_pool = self.pool.get('hr.allounce.deduction.categoty.line')
line_pool = self.pool.get('company.contribution.line')
res = 0
ids = line_pool.search(cr, uid, [('category_id','=',id), ('to_val','>=',value),('from_val','<=',value)])
if not ids:
@@ -593,19 +620,20 @@ class payment_category(osv.osv):
else:
res = line_pool.browse(cr, uid, ids)[0].value
return res
payment_category()
company_contribution()
class payment_category_line(osv.osv):
'''
Allowance Deduction Categoty
'''
_name = 'hr.allounce.deduction.categoty.line'
class company_contribution_line(osv.osv):
"""
Company contribution lines
"""
_name = 'company.contribution.line'
_description = 'Allowance Deduction Categoty'
_order = 'sequence'
_columns = {
'category_id':fields.many2one('hr.allounce.deduction.categoty', 'Category', required=False),
'contribution_id':fields.many2one('company.contribution', 'Contribution', required=False),
'name':fields.char('Name', size=64, required=False, readonly=False),
'umo_id':fields.many2one('product.uom', 'Unite', required=False),
'from_val': fields.float('From', digits=(16, int(config['price_accuracy']))),
@@ -616,7 +644,7 @@ class payment_category_line(osv.osv):
'sequence':fields.integer('Sequence'),
'value': fields.float('Value', digits=(16, int(config['price_accuracy']))),
}
payment_category_line()
company_contribution_line()
class hr_holidays_status(osv.osv):
_inherit = "hr.holidays.status"
+95 -169
View File
@@ -243,133 +243,9 @@
</form>
</field>
</record>
<menuitem action="hr_contract.action_hr_contract" id="hr_menu_contract" parent="payroll_configure" name="Contracts" sequence="4"/>
<!-- End Contract View-->
<!--
<record id="hr_hr_employee_view_form3" model="ir.ui.view">
<field name="name">hr.hr.employee.view.form3</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr_contract.hr_hr_employee_view_form2"/>
<field name="arch" type="xml">
<field name="contract_ids" position="replace">
<field colspan="4" name="contract_ids" nolabel="1">
<tree string="Contracts">
<field name="name"/>
<field name="function"/>
<field name="date_start"/>
<field name="date_end"/>
<field name="working_hours_per_day"/>
<field name="wage_type_id"/>
<field name="wage"/>
</tree>
<form string="Contract">
<separator colspan="4" string="Generalities"/>
<field colspan="4" name="name" select="1"/>
<newline/>
<separator colspan="4" string="Contract Duration"/>
<field name="function"/>
<field name="working_hours_per_day"/>
<field name="working_days_per_week"/>
<newline/>
<field name="date_start" select="1"/>
<field name="date_end" select="1"/>
<separator colspan="4" string="Salary"/>
<field name="wage_type_id"/>
<field name="wage"/>
<separator colspan="4" string="Notes"/>
<field colspan="4" name="notes" nolabel="1"/>
<separator colspan="4" string="Passport and Visa"/>
<field name="permit_no"/>
<field name="passport_id"/>
<field name="visa_no"/>
<field name="visa_expire"/>
</form>
</field>
</field>
</field>
</record>
<record id="hr_hr_employee_view_form4" model="ir.ui.view">
<field name="name">hr.hr.employee.view.form4</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr_hr_employee_view_form3"/>
<field name="arch" type="xml">
<page string="Miscelleanous" position="replace">
<page string="Miscelleanous / Statutory" position="replace">
<group col="2" colspan="2">
<separator colspan="2" string="Miscelleanous"/>
<field name="manager" select="1"/>
<field name="medic_exam" select="1"/>
<field name="audiens_num"/>
<field name="place_of_birth"/>
<field name="marital_status"/>
<field name="children"/>
</group>
<group col="2" colspan="2">
<separator colspan="2" string="Statutory Information"/>
<field name="pan_no" select="1"/>
<field name="esp_account" select="1"/>
<field name="pf_account"/>
<field name="pg_joining"/>
<field name="esi_account"/>
<field name="hospital_id"/>
</group>
<separator colspan="4" string="Special Allowance and Deductions for Employee"/>
<field name="line_ids" nolabel="1" colspan="4">
<tree string="Salary Structure" editable="bottom">
<field name="sequence"/>
<field name="analytic_account_id"/>
<field name="name"/>
<field name="code"/>
<field name="amount_type"/>
<field name="amount" on_change="onchange_amount(amount, amount_type)"/>
<field name="condition_id">
<form string="Condition">
<field name="name"/>
<field name="date_start"/>
<field name="date_end"/>
<field name="state"/>
</form>
</field>
<field name="type"/>
<field name="category_id" on_change="onchange_category(category_id)"/>
<field name="account_id"/>
</tree>
</field>
</page>
</page>
</field>
</record>
<record id="hr_hr_employee_view_form5" model="ir.ui.view">
<field name="name">hr.hr.employee.view.form5</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr_hr_employee_view_form4"/>
<field name="arch" type="xml">
<page string="Miscelleanous / Statutory" position="after">
<page string="Accounting Information">
<field name="property_bank_account"/>
<field name="salary_account"/>
<field name="employee_account"/>
<field name="analytic_account"/>
<field name="slip_ids" colspan="4" nolabel="1"/>
</page>
</page>
</field>
</record>
<record id="view_employee_form5" model="ir.ui.view">
<field name="name">hr.employee.form5</field>
<field name="model">hr.employee</field>
<field name="type">form</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<field name="otherid" position="after">
<field name="passport_id"/>
</field>
</field>
</record>
-->
<!--
Holiday Status inheritancy
-->
@@ -382,7 +258,7 @@
<field name="color_name" position="after">
<group col="2" colspan="2">
<separator colspan="4" string="Payroll Accounting"/>
<field name="company_id" select="2"/>
<field name="company_id" widget="selection" select="2"/>
<field name="code"/>
<field name="analytic_account_id"/>
<field name="account_id"/>
@@ -395,21 +271,22 @@
</field>
</field>
</record>
<!--
Employee Expanse
-->
<record id="view_expenses_form" model="ir.ui.view">
<field name="name">hr.expense.form</field>
<field name="type">form</field>
<field name="inherit_id" ref="hr_expense.view_expenses_form"/>
<field name="model">hr.expense.expense</field>
<field name="arch" type="xml">
<field name="ref" position="after">
<field name="category_id"/>
</field>
</field>
</record>
<!-- Employee Expanse-->
<!-- -->
<!-- <record id="view_expenses_form" model="ir.ui.view">-->
<!-- <field name="name">hr.expense.form</field>-->
<!-- <field name="type">form</field>-->
<!-- <field name="inherit_id" ref="hr_expense.view_expenses_form"/>-->
<!-- <field name="model">hr.expense.expense</field>-->
<!-- <field name="arch" type="xml">-->
<!-- <field name="ref" position="after">-->
<!-- <field name="category_id"/>-->
<!-- </field>-->
<!-- </field>-->
<!-- </record>-->
<!-- -->
<record id="view_hr_payslip_line_tree" model="ir.ui.view">
<field name="name">hr.payslip.line.tree</field>
<field name="model">hr.payslip.line</field>
@@ -586,11 +463,8 @@
<field name="view_type">form</field>
<field name="view_id" ref="view_hr_payslip_tree"/>
</record>
<menuitem action="action_view_hr_payslip_form" id="menu_department_tree" parent="menu_hr_root_payroll"/>
<record id="view_hr_employee_grade_tree" model="ir.ui.view">
<field name="name">hr.payroll.structure.tree</field>
<field name="model">hr.payroll.structure</field>
@@ -631,7 +505,7 @@
</record>
<record id="action_view_hr_employee_grade_form" model="ir.actions.act_window">
<field name="name">Employee Functions</field>
<field name="name">Salary Structure</field>
<field name="res_model">hr.payroll.structure</field>
<field name="view_type">form</field>
<field name="view_id" ref="view_hr_employee_grade_tree"/>
@@ -642,12 +516,13 @@
parent="payroll_configure"
/>
<!-- Payment Heads -->
<record id="hr_allounce_deduction_categoty_form" model="ir.ui.view">
<field name="name">hr.allounce.deduction.categoty.form</field>
<field name="model">hr.allounce.deduction.categoty</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Allowance / Deduction Category">
<form string="Allowance / Deduction Heads">
<group col="6" colspan="6">
<field name="name" select="1"/>
<field name="code" select="1"/>
@@ -658,38 +533,16 @@
<field name="condition"/>
<field name="sequence"/>
</group>
<group col="2" colspan="2">
<separator colspan="2" string="Contributions Configuration"/>
<field name="contribute"/>
<field name="amount_type" attrs="{'required': [('contribute','=',True)]}"/>
<field name="contribute_per" attrs="{'required': [('contribute','=',True)], 'readonly':[(('amount_type','=','func'))]}"/>
<field name="register_id" attrs="{'required': [('contribute','=',True)]}"/>
<field name="include_in_salary" />
<field name="account_id" attrs="{'required': [('contribute','=',True), ('include_in_salary','=',True)]}"/>
</group>
</group>
<notebook colspan="4">
<page string="Function" attrs="{'invisible': [('amount_type','!=','func')]}">
<field name="line_ids" colspan="4" nolabel="1">
<tree string="Function Arguments" editable="bottom">
<field name="name"/>
<field name="sequence"/>
<field name="from_val"/>
<field name="to_val"/>
<field name="amount_type"/>
<field name="value"/>
</tree>
</field>
</page>
<page string="Description">
<separator colspan="4" string="Description"/>
<field name="note" colspan="4" nolabel="1"/>
</page>
</notebook>
</form>
</field>
</record>
<record id="hr_allounce_deduction_categoty_tree" model="ir.ui.view">
<record id="hr_allounce_deduction_categoty_tree" model="ir.ui.view">
<field name="name">hr.allounce.deduction.categoty.tree</field>
<field name="model">hr.allounce.deduction.categoty</field>
<field name="type">tree</field>
@@ -712,6 +565,79 @@
action="hr_allounce_deduction_tree"
parent="payroll_configure"
/>
<!-- End Payment Heads -->
<!-- Company Contribution -->
<record id="hr_company_contribution_form" model="ir.ui.view">
<field name="name">company.contribution.form</field>
<field name="model">company.contribution</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Company Contribution">
<group col="6" colspan="6">
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="category_id"/>
<field name="company_id" select="1"/>
<field name="active" select="1"/>
</group>
<group col="2" colspan="2">
<separator colspan="2" string="Contributions"/>
<field name="amount_type" attrs="{'required': [('contribute','=',True)]}"/>
<field name="contribute_per" attrs="{'required': [('contribute','=',True)], 'readonly':[(('amount_type','=','func'))]}"/>
<field name="register_id" attrs="{'required': [('contribute','=',True)]}"/>
</group>
<group col="2" colspan="2">
<separator colspan="2" string="Accounts"/>
<field name="include_in_salary" />
<field name="account_id" attrs="{'required': [('contribute','=',True), ('include_in_salary','=',True)]}"/>
</group>
<notebook colspan="4">
<page string="Function" attrs="{'readonly': [('amount_type','!=','func')]}">
<field name="line_ids" colspan="4" nolabel="1">
<tree string="Function Arguments" editable="bottom">
<field name="name"/>
<field name="sequence"/>
<field name="from_val"/>
<field name="to_val"/>
<field name="amount_type"/>
<field name="value"/>
</tree>
</field>
</page>
<page string="Description">
<field name="note" colspan="4" nolabel="1"/>
</page>
</notebook>
</form>
</field>
</record>
<record id="hr_company_contribution_tree" model="ir.ui.view">
<field name="name">company.contribution.tree</field>
<field name="model">company.contribution</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Company Contribution">
<field name="name"/>
<field name="code"/>
<field name="contribute_per"/>
<field name="amount_type"/>
<field name="register_id"/>
</tree>
</field>
</record>
<record id="action_hr_company_contribution_tree" model="ir.actions.act_window">
<field name="name">Company Contributions</field>
<field name="res_model">company.contribution</field>
<field name="view_type">form</field>
<field name="view_id" ref="hr_company_contribution_tree"/>
</record>
<menuitem
id="menu_hr_company_contribution_tree"
action="action_hr_company_contribution_tree"
parent="payroll_configure"
/>
<!-- End Company Contribution -->
<!-- Contract Form-->
<!-- <record id="hr_contract.hr_contract_view_form" model="ir.ui.view">-->
+26 -16
View File
@@ -61,9 +61,9 @@ class hr_applicant(osv.osv, crm.crm_case):
_columns = {
'thread_id': fields.many2one('mailgate.thread', 'Thread', required=False),
'name': fields.char('Name', size=128, required=True),
'active': fields.boolean('Active', help="If the active field is set to false, it will allow you to hide the case without removing it."),
'description': fields.text('Description'),
'name': fields.char('Name', size=128, required=True),
'active': fields.boolean('Active', help="If the active field is set to false, it will allow you to hide the case without removing it."),
'description': fields.text('Description'),
'section_id': fields.many2one('crm.case.section', 'Sales Team', \
select=True, help='Sales team to which Case belongs to.\
Define Responsible user and Email account for mail gateway.'),
@@ -77,9 +77,9 @@ class hr_applicant(osv.osv, crm.crm_case):
domain="[('partner_id','=',partner_id)]"),
'create_date': fields.datetime('Creation Date' , readonly=True),
'write_date': fields.datetime('Update Date' , readonly=True),
'stage_id': fields.many2one ('crm.case.stage', 'Stage', \
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.opportunity')]"),
# 'stage_id': fields.many2one ('crm.case.stage', 'Stage', \
# domain="[('section_id','=',section_id),\
# ('object_id.model', '=', 'crm.opportunity')]"),
'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True,
help='The state is set to \'Draft\', when a case is created.\
\nIf the case is in progress the state is set to \'Open\'.\
@@ -92,28 +92,38 @@ class hr_applicant(osv.osv, crm.crm_case):
'date': fields.datetime('Date'),
'priority': fields.selection(AVAILABLE_PRIORITIES, 'Appreciation'),
'job_id': fields.many2one('hr.job', 'Applied Job'),
'salary_proposed': fields.float('Proposed Salary'),
'salary_expected': fields.float('Expected Salary'),
'salary_proposed': fields.float('Proposed Salary', help="Salary Proposed by the Organisation"),
'salary_expected': fields.float('Expected Salary', help="Salary Expected by Applicant"),
'availability': fields.integer('Availability (Days)'),
'partner_name': fields.char("Applicant's Name", size=64),
'partner_phone': fields.char('Phone', size=32),
'partner_mobile': fields.char('Mobile', size=32),
'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'hr.applicant')]"),
# 'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'hr.applicant')]"),
'stage_id': fields.many2one ('hr.recruitment.stage', 'Stage'),
'type_id': fields.many2one('crm.case.resource.type', 'Degree', domain="[('section_id','=',section_id),('object_id.model', '=', 'hr.applicant')]"),
'department_id':fields.many2one('hr.department', 'Department'),
'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True),
'survey' : fields.related('job_id', 'survey_id', type='many2one', relation='survey', string='Survey'),
'response' : fields.integer("Response"),
'reference': fields.char('Reference', size=128),
}
def _get_stage(self, cr, uid, context=None):
if context is None:
context = {}
ids = self.pool.get('hr.recruitment.stage').search(cr, uid, [], context=context)
return ids and ids[0] or False
_defaults = {
'active': lambda *a: 1,
'user_id': crm.crm_case._get_default_user,
'email_from': crm.crm_case. _get_default_email,
'active': lambda *a: 1,
'stage_id': _get_stage,
'user_id': lambda self, cr, uid, context: uid,
# 'user_id': crm.crm_case._get_default_user,
'email_from': crm.crm_case. _get_default_email,
'state': lambda *a: 'draft',
'section_id': crm.crm_case. _get_section,
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.helpdesk', context=c),
'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
'section_id': crm.crm_case. _get_section,
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.helpdesk', context=c),
'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
}
def onchange_job(self,cr, uid, ids, job, context={}):
@@ -34,31 +34,44 @@
<record model="hr.recruitment.stage" id="stage_job1">
<field name="name">Initial Jobs Demand</field>
<field name="sequence">1</field>
<field name="object_id" search="[('model','=','hr.applicant')]" model="ir.model"/>
</record>
<record model="hr.recruitment.stage" id="stage_job2">
<field name="name">First Interview</field>
<field name="sequence">2</field>
<field name="object_id" search="[('model','=','hr.applicant')]" model="ir.model"/>
</record>
<record model="hr.recruitment.stage" id="stage_job3">
<field name="name">Second Interview</field>
<field name="sequence">3</field>
<field name="object_id" search="[('model','=','hr.applicant')]" model="ir.model"/>
</record>
<record model="hr.recruitment.stage" id="stage_job4">
<field name="name">Contract Proposed</field>
<field name="sequence">4</field>
<field name="object_id" search="[('model','=','hr.claim')]" model="ir.model"/>
</record>
<record model="hr.recruitment.stage" id="stage_job5">
<field name="name">Contract Signed</field>
<field name="sequence">5</field>
<field name="object_id" search="[('model','=','hr.applicant')]" model="ir.model"/>
</record>
<record model="hr.recruitment.stage" id="stage_job6">
<field name="name">Refused by Employee</field>
<field name="sequence">6</field>
<field name="object_id" search="[('model','=','hr.applicant')]" model="ir.model"/>
</record>
<record model="hr.recruitment.stage" id="stage_job7">
<field name="name">Refused by Company</field>
<field name="sequence">7</field>
<field name="object_id" search="[('model','=','hr.applicant')]" model="ir.model"/>
</record>
<!-- Department(section_id) -->
<record model="crm.case.section" id="section_hr_department">
<field name="name">HR Department</field>
<field name="code">HR</field>
</record>
</data>
</openerp>
+9 -13
View File
@@ -76,26 +76,21 @@
<field name="arch" type="xml">
<form string="Jobs - Recruitment Form">
<group colspan="4" col="8">
<group colspan="3" col="6">
<field name="name" string="Subject"/>
<field name="partner_name"/>
<field name="job_id" on_change="onchange_job(job_id)"/>
<button string="Schedule a Phone Call" name="%(action_hr_recruitment_phonecall)d" icon="gtk-redo" type="action"/>
<button name="action_makeMeeting" type="object" string="Schedule Meeting" icon="terp-hr"/>
<newline/>
<group colspan="2" col="4">
<field name="stage_id"/>
<button name="stage_previous" string="" type="object" icon="gtk-go-back"/>
<button icon="gtk-go-forward" string="" name="stage_next" type="object"/>
</group>
<newline/>
<group colspan="3" col="6">
<field name="partner_name"/>
<field name="job_id" on_change="onchange_job(job_id)"/>
<button string="Schedule a Phone Call" name="%(action_hr_recruitment_phonecall)d" icon="gtk-redo" type="action"/>
</group>
<newline/>
<group colspan="3" col="6">
<field name="user_id"/>
<field name="department_id" widget="selection"/>
<button name="action_makeMeeting" type="object" string="Schedule Meeting" icon="terp-hr"/>
</group>
<button name="action_print_survey" string="Print Interview" type="object" icon="gtk-print" attrs="{'readonly':[('survey','=',False)]}" groups="base.group_extended"/>
<button name="%(survey.action_view_survey_question_message)d" string="Interview Question" type="action" icon="gtk-execute" context="{'survey_id': survey, 'response_id': [response], 'response_no':0 ,'active' : response, 'object' : 'hr.applicant', 'cur_id' :active_id}" attrs="{'readonly':[('survey','=',False)]}" groups="base.group_extended"/>
<button name="action_print_survey" string="Print Interview" type="object" icon="gtk-print" attrs="{'readonly':[('survey','=',False)]}"/>
<button name="%(survey.action_view_survey_question_message)d" string="Interview Question" type="action" icon="gtk-execute" context="{'survey_id': survey, 'response_id': [response], 'response_no':0 ,'active' : response, 'object' : 'hr.applicant', 'cur_id' :active_id}" attrs="{'readonly':[('survey','=',False)]}" groups="base.group_extended"/>
</group>
<notebook colspan="4">
<page string="Job Info">
@@ -117,6 +112,7 @@
<separator colspan="2" string="Qualification"/>
<field name="type_id" domain="[('object_id.model', '=', 'hr.applicant')]"/>
<field name="priority" string="Appreciation"/>
<field name="reference"/>
</group>
<group col="2" colspan="2">
<separator colspan="2" string="Dates"/>
@@ -125,7 +125,7 @@
<field name="res_model">hr.recruitment.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="context">{'search_default_month':1,'search_default_User':1,'search_default_user_id':uid,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="search_view_id" ref="view_hr_recruitment_report_search"/>
</record>
<menuitem id="hr.menu_hr_reporting" name="Reporting" parent="hr.menu_hr_root" sequence="10"/>
@@ -1,10 +1,10 @@
- |
In order to test hr_recruitment module for OpenERP object, I create applicants form and Manages job positions and the recruitement process.
In order to test hr_recruitment module for OpenERP, I will create applicants form, Manages job positions and the recruitement process.
- |
I create job possition for employee to manage job position.
I create job position for employee to manage job position.
-
|
First I create Department "R & D" in Department form for which I make recruitment.
For that First I create Department "R & D" in Department form for which I make recruitment.
-
!record {model: hr.department, id: hr_department_rd0}:
manager_id: base.user_root
+1
View File
@@ -51,6 +51,7 @@ to set up a management by affair.
],
'demo_xml': ['hr_timesheet_demo.xml'],
'test': ['test/test_hr_timesheet.yml'],
'installable': True,
'active': False,
'certificate': '0071405533469',
+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-06-09 03:35+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
@@ -0,0 +1,96 @@
- |
In order to test hr_timesheet Module in OpenERP, I make "Sign In or Sign Out for Project" to encode and
track time spent on the different projects.
- |
Now, I create a new employee “Mark Johnson” to test Timesheet.
-
!record {model: hr.employee, id: hr_employee_employee0}:
address_home_id: base.res_partner_address_1
company_id: base.main_company
gender: male
marital: hr.hr_employee_marital_status_single
name: Mark Johnson
user_id: base.user_root
- |
I start by "Sign In/Sign Out by Project" wizard and click on "Sign In/Sign Out" button of this wizard.
-
!python {model: hr.sign.in.project}: |
self.check_state(cr, uid, [ref("hr_employee_employee0")])
- |
I select start date and Perform start work on project.
-
!record {model: hr.sign.in.project, id: hr_employee_employee0}:
name: employee1
server_date: '2010-05-20 16:10:59'
state: absent
- |
I click on "Start Working" button of this wizard to start work on Project.
-
!python {model: hr.sign.in.project}: |
self.sign_in_result(cr, uid, [ref("hr_employee_employee0")], context)
- |
My work is done and I want to stop work.for that I click on "Sign In/Sign Out" button of "Sign In/Sign Out by Project" wizard.
Which check state in hr attendace form for user.
-
!python {model: hr.sign.in.project}: |
obj_attendance = self.pool.get('hr.employee')
emp_id = obj_attendance.search(cr, uid, [('user_id', '=', uid), ('name', '=', "employee1")])
if emp_id:
employee = obj_attendance.read(cr, uid, emp_id)[0]
self.write(cr, uid, [ref('hr_employee_employee0')], {'name': employee['name'], 'state': employee['state'], 'emp_id': emp_id[0]})
self.check_state(cr, uid, [ref("hr_employee_employee0")], {"active_ids": [ref("hr_timesheet.menu_hr_timesheet_sign_in")]
})
- |
Given that I have product for "Consultancy - Senior Developer".
-
!record {model: product.product, id: product_consultant}:
categ_id: product.product_category_10
default_code: DEV
list_price: 75.0
name: Consultancy - Senior Developer
procure_method: make_to_order
purchase_ok: False
standard_price: 30.0
supply_method: produce
type: service
uom_id: product.uom_hour
uom_po_id: product.uom_hour
- |
I assing product and journal to "Mark Johnson"
-
!record {model: hr.employee, id: hr_employee_employee0}:
journal_id: analytic_journal
product_id: product_consultant
- |
This will Open "hr sign out project" form. I select analytical project2 development account.
-
!record {model: hr.sign.out.project, id: hr_employee_employee0}:
account_id: account.analytic_project_2_development
analytic_amount: 7.0
date: '2010-05-21 16:40:00'
date_start: '2010-05-19 16:37:00'
info: Create Yaml for hr module
name: Mark Johnson
server_date: '2010-05-19 16:40:15'
state: present
- |
My work for this project is over and I stop work by click on "Stop Work" button of this wizard.
-
!python {model: hr.sign.out.project}: |
emp_obj = self.pool.get('hr.employee')
emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid), ('name', '=', 'employee1')])
if emp_id:
employee = emp_obj.read(cr, uid, emp_id)[0]
self.write(cr, uid, [ref('hr_employee_employee0')], {'emp_id': emp_id[0] })
#self.sign_out_result(cr, uid, [ref('hr_employee_employee0')])
- |
I can see employee timesheet for particular month using "Employee Timesheet" report.
+3 -1
View File
@@ -45,7 +45,9 @@ reports, eso.""",
'wizard/hr_timesheet_invoice_create_final_view.xml',
'board_hr_timesheet_invoice.xml',
],
'demo_xml': ['hr_timesheet_invoice_demo.xml'],
'demo_xml': ['hr_timesheet_invoice_demo.xml',
],
'test': ['test/test_hr_timesheet_invoice.yml'],
'installable': True,
'active': False,
'certificate': '0056091842381',
+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-06-09 03:35+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet_invoice
@@ -0,0 +1,89 @@
- |
In order to test hr_timesheet_invoice in OpenERP, I create account line to manage invoice based on costs.
- |
In order to test flow, I create analytic line for sednacom analytic account.
-
!record {model: account.analytic.line, id: account_analytic_line_developyamlforhrmodule0}:
account_id: account.analytic_sednacom
amount: -1.0
company_id: base.main_company
date: '2010-05-30'
general_account_id: account.a_expense
journal_id: hr_timesheet.analytic_journal
name: develop yaml for hr module
product_id: hr_timesheet.product_consultant
product_uom_id: product.uom_hour
to_invoice: hr_timesheet_invoice.timesheet_invoice_factor2
unit_amount: 5.00
user_id: base.user_root
- |
Give partner name and price list in analytic account.
-
!record {model: account.analytic.account, id: account.analytic_sednacom}:
partner_id: base.res_partner_9
pricelist_id: product.list0
- |
I create invoice on analytic Line using "Invoice analytic Line" wizard.
Give date , detail of each work , time spend on that work on this wizard.
-
!record {model: hr.timesheet.invoice.create, id: hr_timesheet_invoice_create_0}:
accounts:
- account.analytic_sednacom
date: 1
name: 1
price: 1
product: hr_timesheet.product_consultant
time: 1
- |
I click on "Create Invoice" button of "Invoice analytic Line" wizard to create invoice.
-
!python {model: hr.timesheet.invoice.create}: |
self.do_create(cr, uid, [ref("hr_timesheet_invoice_create_0")], {"active_ids": [ref("hr_timesheet_invoice.account_analytic_line_developyamlforhrmodule0")]})
- |
I check that Invoice is create for this timesheet.
-
!python {model: account.analytic.line}: |
exp = self.browse(cr, uid, [ref('account_analytic_line_developyamlforhrmodule0')])[0]
analytic_account_obj = self.pool.get('account.analytic.account')
data = self.pool.get('hr.timesheet.invoice.create').read(cr, uid, [ref("hr_timesheet_invoice_create_0")], [], context)[0]
account_ids = data['accounts']
for account in analytic_account_obj.browse(cr, uid, account_ids, context):
partner = account.partner_id.id
invoice_obj = self.pool.get('account.invoice')
invoice_ids = invoice_obj.search(cr, uid, [('partner_id', '=', partner)])
invoice_id = invoice_obj.browse(cr, uid, invoice_ids)[0]
for invoice in invoice_id.invoice_line:
product = invoice.product_id.id
product_exp = data['product']
assert product == product_exp
- |
I creating a final invoice for "Sednacom" analytic account.
-
!record {model: hr.timesheet.invoice.create.final, id: hr_timesheet_invoice_create_final_0}:
balance_product: hr_timesheet.product_consultant
date: 1
name: 1
price: 1
time: 1
- |
I click on "Create Invoice" button to create Invoice.
-
!python {model: hr.timesheet.invoice.create.final}: |
self.do_create(cr, uid, [ref("hr_timesheet_invoice_create_final_0")], {"active_ids": [ref("account.analytic_sednacom")]})
- |
I can also make some theoretical revenue reports.
- |
I can also see timesheet profit using Timesheet profit report.
@@ -71,8 +71,8 @@ class hr_timesheet_invoice_create(osv.osv_memory):
result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
res = mod_obj.read(cr, uid, result, ['res_id'])
data = self.read(cr, uid, ids, [], context)[0]
account_ids = data['accounts']
for account in analytic_account_obj.browse(cr, uid, account_ids, context):
partner = account.partner_id
@@ -119,11 +119,11 @@ class hr_timesheet_invoice_create(osv.osv_memory):
"GROUP BY product_id,to_invoice", (account.id,context['active_ids'],))
for product_id,factor_id,qty in cr.fetchall():
product = pool.get('product.product').browse(cr, uid, product_id, context2)
product = self.pool.get('product.product').browse(cr, uid, product_id, context2)
if not product:
raise osv.except_osv(_('Error'), _('At least one line has no product !'))
factor_name = ''
factor = pool.get('hr_timesheet_invoice.factor').browse(cr, uid, factor_id, context2)
factor = self.pool.get('hr_timesheet_invoice.factor').browse(cr, uid, factor_id, context2)
if not data['product']:
if factor.customer_name:
@@ -131,16 +131,16 @@ class hr_timesheet_invoice_create(osv.osv_memory):
else:
factor_name = product.name
else:
factor_name = pool.get('product.product').name_get(cr, uid, [data['product']], context=context)[0][1]
factor_name = self.pool.get('product.product').name_get(cr, uid, [data['product']], context=context)[0][1]
if account.pricelist_id:
pl = account.pricelist_id.id
price = pool.get('product.pricelist').price_get(cr,uid,[pl], data['product'] or product_id, qty or 1.0, account.partner_id.id)[pl]
price = self.pool.get('product.pricelist').price_get(cr,uid,[pl], data['product'] or product_id, qty or 1.0, account.partner_id.id)[pl]
else:
price = 0.0
taxes = product.taxes_id
tax = pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id.property_account_position, taxes)
tax = self.pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id.property_account_position, taxes)
account_id = product.product_tmpl_id.property_account_income.id or product.categ_id.property_account_income_categ.id
curr_line = {
'price_unit': price,
@@ -159,7 +159,7 @@ class hr_timesheet_invoice_create(osv.osv_memory):
#
# Compute for lines
#
cr.execute("SELECT * FROM account_analytic_line WHERE account_id = %s and id = ANY (%s) AND product_id=%s and to_invoice=%s", (account.id, data['ids'], product_id, factor_id))
cr.execute("SELECT * FROM account_analytic_line WHERE account_id = %s and id = %s AND product_id=%s and to_invoice=%s", (account.id, data['id'], product_id, factor_id))
line_ids = cr.dictfetchall()
note = []
@@ -170,7 +170,7 @@ class hr_timesheet_invoice_create(osv.osv_memory):
details.append(line['date'])
if data['time']:
if line['product_uom_id']:
details.append("%s %s" % (line['unit_amount'], pool.get('product.uom').browse(cr, uid, [line['product_uom_id']])[0].name))
details.append("%s %s" % (line['unit_amount'], self.pool.get('product.uom').browse(cr, uid, [line['product_uom_id']])[0].name))
else:
details.append("%s" % (line['unit_amount'], ))
if data['name']:
@@ -180,8 +180,8 @@ class hr_timesheet_invoice_create(osv.osv_memory):
note.append(u' - '.join(map(lambda x: unicode(x) or '',details)))
curr_line['note'] = "\n".join(map(lambda x: unicode(x) or '',note))
pool.get('account.invoice.line').create(cr, uid, curr_line)
cr.execute("update account_analytic_line set invoice_id=%s WHERE account_id = %s and id =ANY(%s)" ,(last_invoice, account.id,data['ids']))
self.pool.get('account.invoice.line').create(cr, uid, curr_line)
cr.execute("update account_analytic_line set invoice_id=%s WHERE account_id = %s and id =%s" ,(last_invoice, account.id,data['id']))
self.pool.get('account.invoice').button_reset_taxes(cr, uid, [last_invoice], context)
+4 -1
View File
@@ -56,7 +56,10 @@ The validation can be configured in the company:
'report/timesheet_report_view.xml',
'board_hr_timesheet_view.xml',
],
'demo_xml': ['hr_timesheet_sheet_demo.xml'],
'demo_xml': ['hr_timesheet_sheet_demo.xml',
],
'test':['test/test_hr_timesheet_sheet.yml'],
'installable': True,
'active': False,
'certificate': '0073297700829',
@@ -151,13 +151,16 @@ class hr_timesheet_sheet(osv.osv):
raise osv.except_osv(_('Error !'), _('You can not duplicate a timesheet !'))
def button_confirm(self, cr, uid, ids, context=None):
if context is None:
context = {}
for sheet in self.browse(cr, uid, ids, context=context):
di = sheet.user_id.company_id.timesheet_max_difference
if (abs(sheet.total_difference) < di) or not di:
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'hr_timesheet_sheet.sheet', sheet.id, 'confirm', cr)
else:
raise osv.except_osv(_('Warning !'), _('Please verify that the total difference of the sheet is lower than %.2f !') %(di,))
return True
@@ -0,0 +1,139 @@
- |
In order, to test hr_timesheet_sheet module in OpenERP, I create timesheet and check validation process done by
manager.
- |
Now, I create a new employee “Mark Johnson” to test Timesheet.
-
!record {model: hr.employee, id: hr_employee_employee0}:
address_home_id: base.res_partner_address_1
company_id: base.main_company
gender: male
marital: hr.hr_employee_marital_status_single
name: Mark Johnson
user_id: base.user_root
- |
I create new user "user1".
-
!record {model: res.users, id: res_users_user0}:
company_id: base.main_company
context_lang: en_US
groups_id:
- hr.group_hr_user
- hr_attendance.group_hr_attendance
- base.group_user
- base.group_extended
- hr.group_hr_manager
login: user1
name: user1
password: user1
- |
create another employee "Francline" as "user1".
-
!record {model: hr.employee, id: hr_employee_fracline0}:
address_home_id: base.res_partner_address_8
name: Francline
parent_id: 'hr_employee_employee0'
user_id: 'res_users_user0'
- |
Given that I have Timesheet journal for employee.
-
!record {model: account.analytic.journal, id: analytic_journal}:
code: TS
name: Timesheet Journal
type: general
- |
Given that I have product for "Consultancy - Senior Developer".
-
!record {model: product.product, id: product_consultant}:
categ_id: product.product_category_10
default_code: DEV
list_price: 75.0
name: Consultancy - Senior Developer
procure_method: make_to_order
purchase_ok: False
standard_price: 30.0
supply_method: produce
type: service
uom_id: product.uom_hour
uom_po_id: product.uom_hour
- |
I assing product and journal to "Mark Johnson"
-
!record {model: hr.employee, id: hr_employee_employee0}:
product_id: product_consultant
journal_id: analytic_journal
- |
And also assing product and journal to "francline" employee.
-
!record {model: hr.employee, id: hr_employee_fracline0}:
product_id: product_consultant
journal_id: analytic_journal
- |
I connect as "francline" and create my current timesheet.
-
!record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_deddk0}:
date_current: '2010-05-26'
date_from: '2010-05-01'
date_to: '2010-05-31'
name: Week-22(2010)
state: new
user_id: 'res_users_user0'
- |
Now , When I came in office , I create Attendances and perform "Sign In" action with proper reason.
-
!record {model: hr.attendance, id: hr_attendance_0}:
action: sign_in
employee_id: 'hr_employee_fracline0'
name: '2010-05-26 10:08:08'
- |
When I left office , I create attendance and perform "Sign Out".
-
!record {model: hr.attendance, id: hr_attendance_1}:
action: sign_out
employee_id: 'hr_employee_fracline0'
name: '2010-05-26 15:10:55'
-
I create Timesheet Entry for time spend on today work.
-
!record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet.sheet1}:
timesheet_ids:
- account_id: account.analytic_sednacom
date: '05/26/2010'
name: 'Develop yaml for hr module'
unit_amount: 5.00
amount: -90.00
product_id: hr_timesheet.product_consultant
general_account_id: account.a_expense
user_id: res_users_user0
journal_id: hr_timesheet.analytic_journal
- |
I confirm my timesheet at end of period by click on "Confirm" button which is signal of workflow.
-
!python {model: hr_timesheet_sheet.sheet}: |
uid = ref('res_users_user0')
self.button_confirm(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')])
- |
I check that state is "Confirmed".
-
!assert {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_deddk0}:
- state == 'confirm'
- |
"Mark Johnson" check timesheet and time spend on project by "francline" employee.
And then accept it request by click on "Accept" button.
If "Maximal difference between timesheet and attendances" is more than 1 then manage can "Refuse" his request.
-
!python {model: hr_timesheet_sheet.sheet}: |
#self.write(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], {'state': 'done'})
+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-06-09 03:35+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
+60 -24
View File
@@ -21,17 +21,35 @@
<field name="type">view</field>
<field name="user_type" ref="account_type_view"/>
</record>
<record model="account.account.template" id="assets_view">
<field name="name">Assets</field>
<field name="code">10</field>
<field name="type">view</field>
<field name="user_type" ref="acct_type_asset_view"/>
<field name="reconcile" eval="False"/>
<field name="parent_id" ref="bal"/>
</record>
<record model="account.account.template" id="liabilities_view">
<field name="name">Liabilities</field>
<field name="code">11</field>
<field name="type">view</field>
<field name="user_type" ref="acct_type_liability_view"/>
<field name="reconcile" eval="False"/>
<field name="parent_id" ref="bal"/>
</record>
<record id="fas" model="account.account.template">
<field name="code">10</field>
<field name="code">100</field>
<field name="name">Fixed Assets</field>
<field ref="bal" name="parent_id"/>
<field ref="assets_view" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="account_type_view"/>
</record>
<record id="xfa" model="account.account.template">
<field name="code">100</field>
<field name="code">1000</field>
<field name="name">Fixed Asset Account</field>
<field ref="fas" name="parent_id"/>
<field name="type">other</field>
@@ -39,15 +57,15 @@
</record>
<record id="nca" model="account.account.template">
<field name="code">11</field>
<field name="code">101</field>
<field name="name">Net Current Assets</field>
<field ref="bal" name="parent_id"/>
<field ref="assets_view" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="account_type_view"/>
</record>
<record id="cas" model="account.account.template">
<field name="code">110</field>
<field name="code">1100</field>
<field name="name">Current Assets</field>
<field ref="nca" name="parent_id"/>
<field name="type">view</field>
@@ -55,7 +73,7 @@
</record>
<record id="stk" model="account.account.template">
<field name="code">1101</field>
<field name="code">11001</field>
<field name="name">Purchased Stocks</field>
<field ref="cas" name="parent_id"/>
<field name="type">other</field>
@@ -63,7 +81,7 @@
</record>
<record id="a_recv" model="account.account.template">
<field name="code">1102</field>
<field name="code">11002</field>
<field name="name">Debtors</field>
<field ref="cas" name="parent_id"/>
<field name="type">receivable</field>
@@ -76,7 +94,7 @@
</record> -->
<record id="ova" model="account.account.template">
<field name="code">1103</field>
<field name="code">11003</field>
<field name="name">Output VAT</field>
<field ref="cas" name="parent_id"/>
<field name="type">other</field>
@@ -84,7 +102,7 @@
</record>
<record id="bnk" model="account.account.template">
<field name="code">1104</field>
<field name="code">11004</field>
<field name="name">Bank Current Account</field>
<field ref="cas" name="parent_id"/>
<field name="type">other</field>
@@ -92,7 +110,7 @@
</record>
<record id="cash" model="account.account.template">
<field name="code">1105</field>
<field name="code">11005</field>
<field name="name">Cash</field>
<field ref="cas" name="parent_id"/>
<field name="type">other</field>
@@ -100,9 +118,9 @@
</record>
<record id="cli" model="account.account.template">
<field name="code">111</field>
<field name="code">110</field>
<field name="name">Current Liabilities</field>
<field ref="nca" name="parent_id"/>
<field ref="liabilities_view" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="account_type_view"/>
</record>
@@ -137,17 +155,35 @@
<field name="type">view</field>
<field name="user_type" ref="account_type_view"/>
</record>
<record model="account.account.template" id="income_view">
<field name="name">Income</field>
<field name="code">20</field>
<field name="type">view</field>
<field name="user_type" ref="acct_type_income_view"/>
<field name="reconcile" eval="False"/>
<field name="parent_id" ref="gpf"/>
</record>
<record model="account.account.template" id="expense_view">
<field name="name">Expense</field>
<field name="code">21</field>
<field name="type">view</field>
<field name="user_type" ref="acct_type_expense_view"/>
<field name="reconcile" eval="False"/>
<field name="parent_id" ref="gpf"/>
</record>
<record id="rev" model="account.account.template">
<field name="code">20</field>
<field name="code">200</field>
<field name="name">Revenue</field>
<field ref="gpf" name="parent_id"/>
<field ref="income_view" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="account_type_view"/>
</record>
<record id="a_sale" model="account.account.template">
<field name="code">200</field>
<field name="code">2001</field>
<field name="name">Product Sales</field>
<field ref="rev" name="parent_id"/>
<field name="type">other</field>
@@ -159,15 +195,15 @@
</record> -->
<record id="cos" model="account.account.template">
<field name="code">21</field>
<field name="code">210</field>
<field name="name">Cost of Sales</field>
<field ref="gpf" name="parent_id"/>
<field ref="expense_view" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="account_type_view"/>
</record>
<record id="cog" model="account.account.template">
<field name="code">210</field>
<field name="code">2100</field>
<field name="name">Cost of Goods Sold</field>
<field ref="cos" name="parent_id"/>
<field name="type">other</field>
@@ -175,15 +211,15 @@
</record>
<record id="ovr" model="account.account.template">
<field name="code">22</field>
<field name="code">211</field>
<field name="name">Overheads</field>
<field ref="gpf" name="parent_id"/>
<field ref="expense_view" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="account_type_view"/>
</record>
<record id="a_expense" model="account.account.template">
<field name="code">220</field>
<field name="code">2110</field>
<field name="name">Expenses</field>
<field ref="ovr" name="parent_id"/>
<field name="type">other</field>
+24 -1
View File
@@ -19,17 +19,39 @@
<field name="code">view</field>
<field name="close_method">none</field>
</record>
<record model="account.account.type" id="acct_type_income_view">
<field name="name">Income View</field>
<field name="code">view</field>
<field name="report_type">income</field>
</record>
<record model="account.account.type" id="acct_type_expense_view">
<field name="name">Expense View</field>
<field name="code">expense</field>
<field name="report_type">expense</field>
</record>
<record model="account.account.type" id="acct_type_asset_view">
<field name="name">Asset View</field>
<field name="code">asset</field>
<field name="report_type">asset</field>
</record>
<record model="account.account.type" id="acct_type_liability_view">
<field name="name">Liability View</field>
<field name="code">liability</field>
<field name="report_type">liability</field>
</record>
<record model="account.account.type" id="account_type_income" >
<field name="name">Income</field>
<field name="code">income</field>
<field name="close_method">none</field>
<field name="report_type">income</field>
</record>
<record model="account.account.type" id="account_type_expense">
<field name="name">Expense</field>
<field name="code">expense</field>
<field name="close_method">none</field>
<field name="report_type">expense</field>
</record>
<record model="account.account.type" id="account_type_tax">
@@ -48,6 +70,7 @@
<field name="name">Asset</field>
<field name="code">asset</field>
<field name="close_method">balance</field>
<field name="report_type">asset</field>
</record>
<record model="account.account.type" id="account_type_equity">
+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-06-09 03:35+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: l10n_fr
+1
View File
@@ -31,6 +31,7 @@
<group colspan="8">
<field name="marketing_campaign" />
<field name="crm_profiling" />
<field name="marketing_campaign_mailchimp" />
</group>
</data>
</field>
+2
View File
@@ -28,6 +28,8 @@ class marketing_installer(osv.osv_memory):
# Generic modules
'marketing_campaign':fields.boolean('Marketing Campaigns',
help="Helps you to manage marketing campaigns and automate actions and communication steps."),
'marketing_campaign_mailchimp':fields.boolean('Mailchimp Integration',
help="This modules integrate mailchimp.com's service with OpenERP to automate mass mailings."),
'crm_profiling':fields.boolean('Profiling Tools',
help="Helps you to perform segmentation within partners and design questionaires.")
}
+235 -197
View File
@@ -2,7 +2,7 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
import base64
from datetime import datetime
@@ -25,7 +26,7 @@ from dateutil.relativedelta import relativedelta
from osv import fields, osv
import netsvc
import tools
import tools
_intervalTypes = {
'hours': lambda interval: relativedelta(hours=interval),
@@ -34,184 +35,186 @@ _intervalTypes = {
'years': lambda interval: relativedelta(years=interval),
}
class marketing_campaign(osv.osv): #{{{
class marketing_campaign(osv.osv):
_name = "marketing.campaign"
_description = "Marketing Campaign"
_columns = {
'name': fields.char('Name', size=64, required=True),
'object_id': fields.many2one('ir.model', 'Objects', required=True,
'object_id': fields.many2one('ir.model', 'Object', required=True,
help="Choose the Object on which you want \
this campaign to be run"),
'mode':fields.selection([('test', 'Test'),
('test_realtime', 'Realtime'),
('manual', 'Manual'),
('active', 'Active')],
'Mode', required=True),
this campaign to be run"),
'mode':fields.selection([('test', 'Test Directly'),
('test_realtime', 'Test in Realtime'),
('manual', 'With Manual Confirmation'),
('active', 'Normal')],
'Mode', required=True, help= \
"""Test - It creates and process all the workitems directly (without waiting for the delay on transitions) but do not send emails or produce reports.
Test in Realtime - It creates and process all the workitems directly but do not send emails or produce reports.
With Manual Confirmation - the campaigns runs normally, but the user has to validate all workitem manually.
Normal - the campaign runs normally and automatically sends all emails and reports"""),
'state': fields.selection([('draft', 'Draft'),
('running', 'Running'),
('done', 'Done'),
('cancelled', 'Cancelled'),],
'State',),
'activity_ids': fields.one2many('marketing.campaign.activity',
'State',),
'activity_ids': fields.one2many('marketing.campaign.activity',
'campaign_id', 'Activities'),
'fixed_cost': fields.float('Fixed Cost', help="The fixed cost is cost\
you required for the campaign"),
you required for the campaign"),
}
_defaults = {
'state': lambda *a: 'draft',
'mode': lambda *a: 'test',
'mode': lambda *a: 'test',
}
def state_running_set(self, cr, uid, ids, *args):
campaign = self.browse(cr, uid, ids[0])
if not campaign.activity_ids :
raise osv.except_osv("Error", "There is no associate activitity for the campaign")
raise osv.except_osv("Error", "There is no activitity in the campaign")
act_ids = [ act_id.id for act_id in campaign.activity_ids]
act_ids = self.pool.get('marketing.campaign.activity').search(cr, uid,
[('id', 'in', act_ids), ('start', '=', True)])
if not act_ids :
raise osv.except_osv("Error", "There is no associate activitity for the campaign")
segment_ids = self.pool.get('marketing.campaign.segment').search(cr, uid,
[('campaign_id', '=', campaign.id),
('state', '=', 'draft')])
raise osv.except_osv("Error", "There is no starting activitity in the campaign")
self.write(cr, uid, ids, {'state': 'running'})
return True
def state_done_set(self, cr, uid, ids, *args):
segment_ids = self.pool.get('marketing.campaign.segment').search(cr, uid,
[('campaign_id', 'in', ids),
('state', '=', 'running')])
if segment_ids :
raise osv.except_osv("Error", "Camapign cannot be done before all segments are done")
raise osv.except_osv("Error", "Campaign cannot be marked as done before all segments are done")
self.write(cr, uid, ids, {'state': 'done'})
return True
def state_cancel_set(self, cr, uid, ids, *args):
self.write(cr, uid, ids, {'state': 'cancelled'})
return True
marketing_campaign()#}}}
marketing_campaign()
class marketing_campaign_segment(osv.osv): #{{{
class marketing_campaign_segment(osv.osv):
_name = "marketing.campaign.segment"
_description = "Campaign Segment"
_columns = {
'name': fields.char('Name', size=64,required=True),
'campaign_id': fields.many2one('marketing.campaign', 'Campaign',
'campaign_id': fields.many2one('marketing.campaign', 'Campaign',
required=True),
'object_id': fields.related('campaign_id','object_id',
type='many2one', relation='ir.model',
string='Object'),
'ir_filter_id': fields.many2one('ir.filters', 'Filter', help=""),
'sync_last_date': fields.datetime('Date'),
'sync_mode': fields.selection([('create_date', 'Create'),
('write_date', 'Write')],
'Mode'),
'sync_last_date': fields.datetime('Latest Synchronization'),
'sync_mode': fields.selection([('create_date', 'Sync only on creation'),
('write_date', 'Sync at each modification')],
'Synchronization Mode'),
'state': fields.selection([('draft', 'Draft'),
('running', 'Running'),
('done', 'Done'),
('cancelled', 'Cancelled')],
'State',),
'date_run': fields.datetime('Running'),
'date_done': fields.datetime('Done'),
'State',),
'date_run': fields.datetime('Launching Date'),
'date_done': fields.datetime('End Date'),
}
_defaults = {
'state': lambda *a: 'draft',
'sync_mode': lambda *a: 'create_date',
}
def state_running_set(self, cr, uid, ids, *args):
segment = self.browse(cr, uid, ids[0])
curr_date = time.strftime('%Y-%m-%d %H:%M:%S')
vals = {'state': 'running'}
if not segment.date_run:
vals['date_run'] = time.strftime('%Y-%m-%d %H:%M:%S')
if not segment.sync_last_date:
vals['sync_last_date']=curr_date
if not segment.date_done:
vals['date_done']= (datetime.now() + _intervalTypes['years'](1) \
).strftime('%Y-%m-%d %H:%M:%S')
vals['date_run'] = time.strftime('%Y-%m-%d %H:%M:%S')
self.write(cr, uid, ids, vals)
return True
def state_done_set(self, cr, uid, ids, *args):
date_done = self.browse(cr, uid, ids[0]).date_done
if (date_done > time.strftime('%Y-%m-%d %H:%M:%S')):
raise osv.except_osv("Error", "Segment cannot be closed before end date")
wi_ids = self.pool.get("marketing.campaign.workitem").search(cr, uid,
[('state', 'in', ['inprogress', 'todo']),
('segment_id', '=', ids[0])])
if wi_ids :
raise osv.except_osv("Error", "Segment cannot be done before all workitems are processed")
self.write(cr, uid, ids, {'state': 'done'})
[('state', '=', 'todo'), ('segment_id', 'in', ids)])
self.pool.get("marketing.campaign.workitem").write(cr, uid, wi_ids, {'state':'cancelled'})
self.write(cr, uid, ids, {'state': 'done','date_done': time.strftime('%Y-%m-%d %H:%M:%S')})
return True
def state_cancel_set(self, cr, uid, ids, *args):
self.write(cr, uid, ids, {'state': 'cancelled'})
wi_ids = self.pool.get("marketing.campaign.workitem").search(cr, uid,
[('state', '=', 'todo'), ('segment_id', 'in', ids)])
self.pool.get("marketing.campaign.workitem").write(cr, uid, wi_ids, {'state':'cancelled'})
self.write(cr, uid, ids, {'state': 'cancelled','date_done': time.strftime('%Y-%m-%d %H:%M:%S')})
return True
def process_segment(self, cr, uid, context={}):
segment_ids = self.search(cr, uid, [('state', '=', 'running')])
def synchroniz(self, cr, uid, ids, *args):
self.process_segment(cr, uid, ids)
return True
def process_segment(self, cr, uid, segment_ids=None, context={}):
if not segment_ids:
segment_ids = self.search(cr, uid, [('state', '=', 'running')], context=context)
action_date = time.strftime('%Y-%m-%d %H:%M:%S')
last_action_date = (datetime.now() + _intervalTypes['days'](-1) \
).strftime('%Y-%m-%d %H:%M:%S')
for segment in self.browse(cr, uid, segment_ids):
act_ids = self.pool.get('marketing.campaign.activity').search(cr,
uid, [('start', '=', True),
('campaign_id', '=', segment.campaign_id.id)])
if (segment.sync_last_date and \
segment.sync_last_date <= action_date )\
or not segment.sync_last_date :
model_obj = self.pool.get(segment.object_id.model)
object_ids = model_obj.search(cr, uid, [
(segment.sync_mode, '<=', action_date),
(segment.sync_mode, '>=', last_action_date)])
for o_ids in model_obj.read(cr, uid, object_ids) :
partner_id = 'partner_id' in o_ids and o_ids['partner_id'] \
or False
if partner_id:
for act_id in act_ids:
wi_vals = {'segment_id': segment.id,
'activity_id': act_id,
'date': action_date,
'partner_id': partner_id[0],
'state': 'todo',
}
self.pool.get('marketing.campaign.workitem').create(
cr, uid, wi_vals)
self.write(cr, uid, segment.id, {'sync_last_date':action_date})
campaigns = {}
for segment in self.browse(cr, uid, segment_ids, context=context):
campaigns[segment.campaign_id.id] = True
act_ids = self.pool.get('marketing.campaign.activity').search(cr,
uid, [('start', '=', True), ('campaign_id', '=', segment.campaign_id.id)])
model_obj = self.pool.get(segment.object_id.model)
criteria = []
if segment.sync_last_date:
criteria += [(segment.sync_mode, '>', segment.sync_last_date)]
if segment.ir_filter_id:
criteria += eval(segment.ir_filter_id.domain)
object_ids = model_obj.search(cr, uid, criteria, context=context)
for o_ids in model_obj.browse(cr, uid, object_ids, context=context) :
# avoid duplicated workitem for the same resource
if segment.sync_mode == 'write_date':
segids = self.pool.get('marketing.campaign.workitem').search(cr, uid, [('res_id','=',o_ids.id),('segment_id','=',segment.id)])
if segids:
continue
for act_id in act_ids:
wi_vals = {
'segment_id': segment.id,
'activity_id': act_id,
'date': action_date,
'partner_id': o_ids.partner_id and o_ids.partner_id.id or False,
'state': 'todo',
'res_id': o_ids.id
}
self.pool.get('marketing.campaign.workitem').create(cr, uid, wi_vals)
self.write(cr, uid, segment.id, {'sync_last_date':action_date})
self.pool.get('marketing.campaign.workitem').process_all(cr, uid, campaigns.keys(), context=context)
return True
marketing_campaign_segment()#}}}
marketing_campaign_segment()
class marketing_campaign_activity(osv.osv): #{{{
class marketing_campaign_activity(osv.osv):
_name = "marketing.campaign.activity"
_description = "Campaign Activity"
_actions_type = [('email', 'E-mail'), ('paper', 'Paper'), ('action', 'Action'),
('subcampaign', 'Sub-Campaign')]
_columns = {
'name': fields.char('Name', size=128, required=True),
'campaign_id': fields.many2one('marketing.campaign', 'Campaign',
'campaign_id': fields.many2one('marketing.campaign', 'Campaign',
required = True, ondelete='cascade'),
'object_id': fields.related('campaign_id','object_id',
type='many2one', relation='ir.model',
string='Object'),
'start': fields.boolean('Start',help= "Its necessary to start activity \
before running campaign"),
'condition': fields.char('Condition', size=256, required=True,
help="Condition that is to be tested before \
action is executed"),
'start': fields.boolean('Start',help= "This activity is launched when the campaign starts."),
'condition': fields.char('Condition', size=256, required=True,
help="Python condition to know if the activity can be launched"),
'type': fields.selection([('email', 'E-mail'),
('paper', 'Paper'),
('action', 'Action'),
('subcampaign', 'Sub-Campaign')],
'Type', required=True),
'Type', required=True,
help="Describe type of action to be performed on the Activity.Eg : Send email,Send paper.."),
'email_template_id': fields.many2one('email.template','Email Template'),
'report_id': fields.many2one('ir.actions.report.xml', 'Reports', ),
'report_id': fields.many2one('ir.actions.report.xml', 'Reports', ),
'report_directory_id': fields.many2one('document.directory','Directory',
help="Folder is used to store the generated reports"),
'server_action_id': fields.many2one('ir.actions.server', string='Action',
@@ -222,21 +225,27 @@ class marketing_campaign_activity(osv.osv): #{{{
'Next Activities'),
'from_ids': fields.one2many('marketing.campaign.transition',
'activity_to_id',
'Previous Activities'),
'Previous Activities'),
'subcampaign_id': fields.many2one('marketing.campaign', 'Sub-Campaign'),
'subcampaign_segment_id': fields.many2one('marketing.campaign.segment',
'Sub Campaign Segment'),
'variable_cost': fields.float('Variable Cost'),
'revenue': fields.float('Revenue')
}
}
_defaults = {
'type': lambda *a: 'email',
'condition': lambda *a: 'True',
'object_id' : lambda obj, cr, uid, context : context.get('object_id',False),
}
def __init__(self, *args):
self._actions = {'paper' : self.process_wi_report,
'email' : self.process_wi_email,
'server_action' : self.process_wi_action,
}
return super(marketing_campaign_activity, self).__init__(*args)
def search(self, cr, uid, args, offset=0, limit=None, order=None,
def search(self, cr, uid, args, offset=0, limit=None, order=None,
context=None, count=False):
if context == None:
context = {}
@@ -247,61 +256,68 @@ class marketing_campaign_activity(osv.osv): #{{{
for activity in segment_obj.campaign_id.activity_ids:
act_ids.append(activity.id)
return act_ids
return super(marketing_campaign_activity, self).search(cr, uid, args,
return super(marketing_campaign_activity, self).search(cr, uid, args,
offset, limit, order, context, count)
def process(self, cr, uid, act_id, wi_id, context={}):
activity = self.browse(cr, uid, act_id)
workitem_obj = self.pool.get('marketing.campaign.workitem')
workitem = workitem_obj.browse(cr, uid, wi_id)
if activity.type == 'paper' :
service = netsvc.LocalService('report.%s'%activity.report_id.report_name)
(report_data, format) = service.create(cr, uid, [], {}, {})
attach_vals = {
'name': '%s_%s_%s'%(activity.report_id.report_name,
activity.name,workitem.partner_id.name),
'datas_fname': '%s.%s'%(activity.report_id.report_name,
activity.report_id.report_type),
'parent_id': activity.report_directory_id.id,
'datas': base64.encodestring(report_data),
'file_type': format
}
self.pool.get('ir.attachment').create(cr, uid, attach_vals)
elif activity.type == 'email' :
context = {}
template = activity.email_template_id
accounts = template.enforce_from_account
if not template.enforce_from_account:
return {'error_msg' : "There is no account defined for the email"}
if not workitem.partner_id.email:
return {'error_msg' : "There is no email defined for the partner"}
vals = {
'email_from': tools.ustr(accounts.name) + "<" + tools.ustr(accounts.email_id) + ">",
'email_to': workitem.partner_id.email,
'subject': template.def_subject,
'body_text': template.def_body_text,
'body_html': template.def_body_html,
'account_id':accounts.id,
'state':'na',
'mail_type':'multipart/alternative' #Options:'multipart/mixed','multipart/alternative','text/plain','text/html'
}
def process_wi_report(self, cr, uid, activity, workitem):
service = netsvc.LocalService('report.%s'%activity.report_id.report_name)
(report_data, format) = service.create(cr, uid, [], {}, {})
attach_vals = {
'name': '%s_%s_%s'%(activity.report_id.report_name,
activity.name,workitem.partner_id.name),
'datas_fname': '%s.%s'%(activity.report_id.report_name,
activity.report_id.report_type),
'parent_id': activity.report_directory_id.id,
'datas': base64.encodestring(report_data),
'file_type': format
}
self.pool.get('ir.attachment').create(cr, uid, attach_vals)
return True
def process_wi_email(self, cr, uid, activity, workitem):
template = activity.email_template_id
accounts = template.enforce_from_account
if not template.enforce_from_account:
return {'error_msg' : "There is no account defined for the email"}
if not workitem.partner_id.email:
return {'error_msg' : "There is no email defined for the partner"}
vals = {
'email_from': tools.ustr(accounts.name) + "<" + tools.ustr(accounts.email_id) + ">",
'email_to': workitem.partner_id.email,
'subject': template.def_subject,
'body_text': template.def_body_text,
'body_html': template.def_body_html,
'account_id':accounts.id,
'state':'na',
'mail_type':'multipart/alternative' #Options:'multipart/mixed','multipart/alternative','text/plain','text/html'
}
# if accounts.use_sign:
# signature = self.pool.get('res.users').read(cr, uid, uid, ['signature'], context)['signature']
# if signature:
# vals['pem_body_text'] = tools.ustr(vals['pem_body_text'] or '') + signature
# vals['pem_body_html'] = tools.ustr(vals['pem_body_html'] or '') + signature
#Create partly the mail and later update attachments
mail_id = self.pool.get('email_template.mailbox').create(cr, uid, vals, context)
elif activity.type == 'action' :
server_obj = self.pool.get('ir.actions.server')
server_obj.run(cr, uid, [activity.server_action_id.id], context)
#???
return True
marketing_campaign_activity()#}}}
#Create partly the mail and later update attachments
mail_id = self.pool.get('email_template.mailbox').create(cr, uid, vals, context)
return True
def process_wi_action(self, cr, uid, activity, workitem):
context = {}
server_obj = self.pool.get('ir.actions.server')
server_obj.run(cr, uid, [activity.server_action_id.id], context)
return True
class marketing_campaign_transition(osv.osv): #{{{
def process(self, cr, uid, act_id, wi_id, context={}):
activity = self.browse(cr, uid, act_id)
workitem_obj = self.pool.get('marketing.campaign.workitem')
workitem = workitem_obj.browse(cr, uid, wi_id)
self._actions[activity.type](cr, uid, activity, workitem)
return True
marketing_campaign_activity()
class marketing_campaign_transition(osv.osv):
_name = "marketing.campaign.transition"
_description = "Campaign Transition"
_rec_name = "interval_type"
@@ -309,13 +325,13 @@ class marketing_campaign_transition(osv.osv): #{{{
_columns = {
'activity_from_id': fields.many2one('marketing.campaign.activity',
'Source Activity'),
'activity_to_id': fields.many2one('marketing.campaign.activity',
'activity_to_id': fields.many2one('marketing.campaign.activity',
'Destination Activity'),
'interval_nbr': fields.integer('Interval No.'),
'interval_type': fields.selection([('hours', 'Hours'), ('days', 'Days'),
'interval_type': fields.selection([('hours', 'Hours'), ('days', 'Days'),
('months', 'Months'),
('years','Years')],'Interval Type')
}
}
def default_get(self, cr, uid, fields, context={}):
value = super(marketing_campaign_transition, self).default_get(cr, uid,
@@ -323,57 +339,76 @@ class marketing_campaign_transition(osv.osv): #{{{
if context.has_key('type_id'):
value[context['type_id']] = context['activity_id']
return value
marketing_campaign_transition() #}}}
class marketing_campaign_workitem(osv.osv): #{{{
marketing_campaign_transition()
class marketing_campaign_workitem(osv.osv):
_name = "marketing.campaign.workitem"
_description = "Campaign Workitem"
def _res_name_get(self, cr, uid, ids, field_name, arg, context=None):
res = {}
for obj in self.browse(cr, uid, ids, context=context):
if obj.res_id:
try:
res[obj.id] = self.pool.get(obj.object_id.model).name_get(cr, uid, [obj.res_id], context=context)[0][1]
except:
res[obj.id] = '/'
else:
res[obj.id] = '/'
return res
_columns = {
'segment_id': fields.many2one('marketing.campaign.segment', 'Segment',
required=True),
required=True),
'activity_id': fields.many2one('marketing.campaign.activity','Activity',
required=True),
'object_id': fields.related('segment_id', 'campaign_id', 'object_id',
type='many2one', relation='ir.model',
string='Object'),
'res_id': fields.integer('Results'),
required=True),
'campaign_id': fields.related('segment_id', 'campaign_id',
type='many2one', relation='marketing.campaign', string='Campaign', readonly=True),
'object_id': fields.related('segment_id', 'campaign_id', 'object_id',
type='many2one', relation='ir.model', string='Object'),
'res_id': fields.integer('Resource ID'),
'res_name': fields.function(_res_name_get, method=True, string='Resource Name', type="char", size=64),
'date': fields.datetime('Execution Date'),
'partner_id': fields.many2one('res.partner', 'Partner',required=True),
'state': fields.selection([('todo', 'ToDo'), ('inprogress', 'In Progress'),
'partner_id': fields.many2one('res.partner', 'Partner'),
'state': fields.selection([('todo', 'ToDo'), ('inprogress', 'In Progress'),
('exception', 'Exception'), ('done', 'Done'),
('cancelled', 'Cancelled')], 'State'),
'error_msg' : fields.text('Error Message')
}
}
_defaults = {
'state': lambda *a: 'draft',
'state': lambda *a: 'todo',
}
def process_chain(self, cr, uid, workitem_id, context={}):
workitem = self.browse(cr, uid, workitem_id)
mct_obj = self.pool.get('marketing.campaign.transition')
process_to_id = mct_obj.search(cr,uid, [
('activity_from_id','=', workitem.activity_id.id)])
for mct_id in mct_obj.browse(cr, uid, process_to_id):
for mct_id in workitem.activity_id.to_ids:
launch_date = time.strftime('%Y-%m-%d %H:%M:%S')
if mct_id.interval_type and mct_id.interval_nbr :
launch_date = (datetime.now() + _intervalTypes[ \
mct_id.interval_type](mct_id.interval_nbr) \
).strftime('%Y-%m-%d %H:%M:%S')
launch_date = time.strftime('%Y-%m-%d %H:%M:%S')
workitem_vals = {'segment_id': workitem.segment_id.id,
'activity_id': mct_id.activity_to_id.id,
'date': launch_date,
'partner_id': workitem.partner_id.id,
'state': 'todo',
}
workitem_vals = {
'segment_id': workitem.segment_id.id,
'activity_id': mct_id.activity_to_id.id,
'date': launch_date,
'partner_id': workitem.partner_id.id,
'res_id': workitem.res_id,
'state': 'todo',
}
self.create(cr, uid, workitem_vals)
return True
def button_cancel(self, cr, uid, workitem_ids, context={}):
for wi in self.browse(cr, uid, workitem_ids):
if wi.state in ('todo','exception'):
self.write(cr, uid, [wi.id], {'state':'cancelled'}, context=context)
return True
def process(self, cr, uid, workitem_ids, context={}):
for wi in self.browse(cr, uid, workitem_ids):
if wi.state == 'todo':# we searched the wi which are in todo state
#then y v keep this filter again
if wi.state == 'todo':
eval_context = {
'pool': self.pool,
'cr': cr,
@@ -385,50 +420,53 @@ class marketing_campaign_workitem(osv.osv): #{{{
expr = eval(str(wi.activity_id.condition), eval_context)
if expr:
try :
res = self.pool.get('marketing.campaign.activity').process(
cr, uid, wi.activity_id.id, wi.id, context)
if res :
self.write(cr, uid, wi.id, {'state': 'done'})
self.process_chain(cr, uid, wi.id, context)
else :
self.write(cr, uid, wi.id, {'state': 'exception',
'error_msg': res['error_msg']})
if wi.campaign_id.mode in ('manual','active'):
self.pool.get('marketing.campaign.activity').process(
cr, uid, wi.activity_id.id, wi.id, context)
self.write(cr, uid, wi.id, {'state': 'done'})
self.process_chain(cr, uid, wi.id, context)
except Exception,e:
self.write(cr, uid, wi.id, {'state': 'exception'})
else :
self.write(cr, uid, wi.id, {'state': 'cancelled'})
return True
def process_all(self, cr, uid, context={}):
workitem_ids = self.search(cr, uid, [('state', '=', 'todo'),
def process_all(self, cr, uid, camp_ids=None, context={}):
camp_obj = self.pool.get('marketing.campaign')
if not camp_ids:
camp_ids = camp_obj.search(cr, uid, [('state','=','running')], context=context)
for camp in camp_obj.browse(cr, uid, camp_ids, context=context):
if camp.mode in ('test_realtime','active'):
workitem_ids = self.search(cr, uid, [('state', '=', 'todo'),
('date','<=', time.strftime('%Y-%m-%d %H:%M:%S'))])
elif camp.mode == 'test':
workitem_ids = self.search(cr, uid, [('state', '=', 'todo')])
else:
# manual states are not processed automatically
pass
if workitem_ids:
self.process(cr, uid, workitem_ids, context)
marketing_campaign_workitem() #}}}
marketing_campaign_workitem()
class email_template(osv.osv):
_inherit = "email.template"
_defaults = {
'object_name': lambda obj, cr, uid, context: context.get('object_id',False),
}
email_template()
email_template()
class report_xml(osv.osv):
_inherit = 'ir.actions.report.xml'
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
if not context:
context = {}
if context and 'object_id' in context and context['object_id']:
model = self.pool.get('ir.model').browse(cr, uid,
model = self.pool.get('ir.model').browse(cr, uid,
context['object_id']).model
args.append(('model', '=', model))
return super(report_xml, self).search(cr, uid, args, offset, limit, order, context, count)
report_xml()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
report_xml()
@@ -1,7 +1,7 @@
<?xml version="1.0" ?>
<openerp>
<data>
<data>
<!-- Document directory -->
<record id="document_directory_marketingcampaign" model="document.directory">
<field eval="0" name="ressource_tree"/>
@@ -20,33 +20,27 @@
<field name="parent_id" ref="document_directory_marketingcampaign"/>
<field eval="&quot;&quot;&quot;ressource&quot;&quot;&quot;" name="type"/>
<field name="ressource_type_id" ref="model_marketing_campaign"/>
</record>
<!-- Email tempalte -->
<record id="email_template_1" model="email.template">
<field name="def_subject">Thanks for showing interest in OpenERP</field>
<field name="def_to">info@tinyerp.com</field>
<field eval="[(6,0,[])]" name="allowed_groups"/>
<field eval="0" name="auto_email"/>
<field model="ir.actions.act_window" name="ref_ir_act_window" search="[('name', '=', u'For OpenERP OnDemand Free Trial 2010 Mail Form')]"/>
<field eval="[(6,0,[])]" name="table_required_fields"/>
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
<field name="object_name" ref="crm.model_crm_lead"/>
<field eval="0" name="use_sign"/>
<field name="def_body_text">Hello,Thanks for generous interest you have shown in the open ERP.Regards,OpenERP Team,</field>
<field name="template_language">mako</field>
<field eval="0" name="send_on_create"/>
<field name="name">For OpenERP OnDemand Free Trial 2010</field>
<field name="model_int_name">crm.lead</field>
<field eval="0" name="send_on_write"/>
</record>
<record id="email_template_2" model="email.template">
</record>
<!-- Email tempalte -->
<record id="email_template_1" model="email.template">
<field name="def_subject">Thanks for showing interest in OpenERP</field>
<field name="def_to">info@tinyerp.com</field>
<field eval="[(6,0,[])]" name="allowed_groups"/>
<field model="ir.actions.act_window" name="ref_ir_act_window" search="[('name', '=', u'For OpenERP OnDemand Free Trial 2010 Mail Form')]"/>
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
<field name="object_name" ref="crm.model_crm_lead"/>
<field eval="0" name="use_sign"/>
<field name="def_body_text">Hello,Thanks for generous interest you have shown in the open ERP.Regards,OpenERP Team,</field>
<field name="template_language">mako</field>
<field name="name">For OpenERP OnDemand Free Trial 2010</field>
<field name="model_int_name">crm.lead</field>
</record>
<record id="email_template_2" model="email.template">
<field name="def_subject">Propose to subscribe to the Open ERP Discovery Day on May 2010</field>
<field name="def_to">info@tinyerp.com</field>
<field eval="[(6,0,[])]" name="allowed_groups"/>
<field eval="0" name="auto_email"/>
<field model="ir.actions.act_window" name="ref_ir_act_window" search="[('name', '=', u'For OpenERP OnDemand Free Trial 2010 Mail Form')]"/>
<field eval="[(6,0,[])]" name="table_required_fields"/>
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
<field name="object_name" ref="crm.model_crm_lead"/>
<field eval="0" name="use_sign"/>
@@ -56,19 +50,15 @@
We really appreciate your co-operation on this.
Regards,OpenERP Team,</field>
<field name="template_language">mako</field>
<field eval="0" name="send_on_create"/>
<field name="name">For Open ERP Discovery Day on May 2010</field>
<field name="model_int_name">crm.lead</field>
<field eval="0" name="send_on_write"/>
</record>
</record>
<record id="email_template_3" model="email.template">
<field name="def_subject">Thanks for subscribing to the Open ERP Discovery Day</field>
<field name="def_to">info@tinyerp.com</field>
<field eval="[(6,0,[])]" name="allowed_groups"/>
<field eval="0" name="auto_email"/>
<field model="ir.actions.act_window" name="ref_ir_act_window" search="[('name', '=', u'For OpenERP OnDemand Free Trial 2010 Mail Form')]"/>
<field eval="[(6,0,[])]" name="table_required_fields"/>
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
<field name="object_name" ref="crm.model_crm_lead"/>
<field eval="0" name="use_sign"/>
@@ -77,19 +67,15 @@
I really appreciate your co-operation on this.
Regards,OpenERP Team,</field>
<field name="template_language">mako</field>
<field eval="0" name="send_on_create"/>
<field name="name">For Open ERP Discovery Day</field>
<field name="model_int_name">crm.lead</field>
<field eval="0" name="send_on_write"/>
</record>
</record>
<record id="email_template_4" model="email.template">
<field name="def_subject">Thanks for buying the Open ERP book</field>
<field name="def_to">info@tinyerp.com</field>
<field eval="[(6,0,[])]" name="allowed_groups"/>
<field eval="0" name="auto_email"/>
<field model="ir.actions.act_window" name="ref_ir_act_window" search="[('name', '=', u'For OpenERP OnDemand Free Trial 2010 Mail Form')]"/>
<field eval="[(6,0,[])]" name="table_required_fields"/>
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
<field name="object_name" ref="crm.model_crm_lead"/>
<field eval="0" name="use_sign"/>
@@ -98,19 +84,15 @@
I really appreciate your co-operation on this.
Regards,OpenERP Team,</field>
<field name="template_language">mako</field>
<field eval="0" name="send_on_create"/>
<field name="name">For Open ERP book</field>
<field name="model_int_name">crm.lead</field>
<field eval="0" name="send_on_write"/>
</record>
<record id="email_template_5" model="email.template">
<field name="def_subject">Propose a free technical training to Gold partners</field>
<field name="def_to">info@tinyerp.com</field>
<field eval="[(6,0,[])]" name="allowed_groups"/>
<field eval="0" name="auto_email"/>
<field model="ir.actions.act_window" name="ref_ir_act_window" search="[('name', '=', u'For OpenERP OnDemand Free Trial 2010 Mail Form')]"/>
<field eval="[(6,0,[])]" name="table_required_fields"/>
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
<field name="object_name" ref="crm.model_crm_lead"/>
<field eval="0" name="use_sign"/>
@@ -120,19 +102,15 @@
I really appreciate your co-operation on this.
Regards,OpenERP Team,</field>
<field name="template_language">mako</field>
<field eval="0" name="send_on_create"/>
<field name="name">For technical training to Gold partners</field>
<field name="model_int_name">crm.lead</field>
<field eval="0" name="send_on_write"/>
</record>
<record id="email_template_6" model="email.template">
<field name="def_subject">Propose paid training to Silver partners</field>
<field name="def_to">info@tinyerp.com</field>
<field eval="[(6,0,[])]" name="allowed_groups"/>
<field eval="0" name="auto_email"/>
<field model="ir.actions.act_window" name="ref_ir_act_window" search="[('name', '=', u'For OpenERP OnDemand Free Trial 2010 Mail Form')]"/>
<field eval="[(6,0,[])]" name="table_required_fields"/>
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
<field name="object_name" ref="crm.model_crm_lead"/>
<field eval="0" name="use_sign"/>
@@ -142,19 +120,15 @@
I really appreciate your co-operation on this.
Regards,OpenERP Team,</field>
<field name="template_language">mako</field>
<field eval="0" name="send_on_create"/>
<field name="name">For training to Silver partners</field>
<field name="model_int_name">crm.lead</field>
<field eval="0" name="send_on_write"/>
</record>
<record id="email_template_7" model="email.template">
<field name="def_subject">Propose gold partnership to silver partners</field>
<field name="def_to">info@tinyerp.com</field>
<field eval="[(6,0,[])]" name="allowed_groups"/>
<field eval="0" name="auto_email"/>
<field model="ir.actions.act_window" name="ref_ir_act_window" search="[('name', '=', u'For OpenERP OnDemand Free Trial 2010 Mail Form')]"/>
<field eval="[(6,0,[])]" name="table_required_fields"/>
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
<field name="object_name" ref="crm.model_crm_lead"/>
<field eval="0" name="use_sign"/>
@@ -164,73 +138,67 @@
I really appreciate your co-operation on this.
Regards,OpenERP Team,</field>
<field name="template_language">mako</field>
<field eval="0" name="send_on_create"/>
<field name="name">For gold partnership to silver partners</field>
<field name="model_int_name">crm.lead</field>
<field eval="0" name="send_on_write"/>
</record>
<record id="email_template_8" model="email.template">
<field name="def_subject">Thanks for subscribing to technical training</field>
<field name="def_to">info@tinyerp.com</field>
<field eval="[(6,0,[])]" name="allowed_groups"/>
<field eval="0" name="auto_email"/>
<field model="ir.actions.act_window" name="ref_ir_act_window" search="[('name', '=', u'For OpenERP OnDemand Free Trial 2010 Mail Form')]"/>
<field eval="[(6,0,[])]" name="table_required_fields"/>
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
<field name="object_name" ref="crm.model_crm_lead"/>
<field eval="0" name="use_sign"/>
<field name="def_body_text">Hello, Thanks for showing intrest and for subscribing to technical training.If any further information required kindly revert back.I really appreciate your co-operation on this.
Regards,OpenERP Team,</field>
<field name="template_language">mako</field>
<field eval="0" name="send_on_create"/>
<field name="name">For subscribing to technical training</field>
<field name="model_int_name">crm.lead</field>
<field eval="0" name="send_on_write"/>
</record>
<!-- Report -->
<record id="mc_crm_lead_demo_report" model="ir.actions.report.xml">
<field name="name">Marketing campaign demo report</field>
<field name="type">ir.actions.report.xml</field>
<field name="model">crm.lead</field>
<field name="report_name">crm.lead.demo</field>
<field name="report_rml">marketing_campaign/report/crm_lead_mc_demo_report.rml</field>
<field name="report_type">pdf</field>
</record>
<!-- Campaign -->
<record id="marketing_campaign_openerpondemandfreetrial0" model="marketing.campaign">
<field name="name">OpenERP OnDemand Free Trial 2010</field>
<field name="object_id" ref="crm.model_crm_lead"/>
</record>
<!-- Activity -->
<record id="marketing_campaign_activity_0" model="marketing.campaign.activity">
<field name="name">Propose a 1 month free trial for an OnDemand offer</field>
<field name="server_action_id" ref="base.action_start_configurator"/>
<field model="marketing.campaign" name="campaign_id" ref="marketing_campaign_openerpondemandfreetrial0"/>
<field name="report_directory_id" ref="document_directory_campaign1"/>
<field name="type">paper</field>
<field eval="1" name="start"/>
<field name="report_id" ref="mc_crm_lead_demo_report"/>
</record>
<record id="marketing_campaign_activity_1" model="marketing.campaign.activity">
<field name="name">Thanks for showing interest</field>
<field name="server_action_id" ref="base.action_start_configurator"/>
<field model="marketing.campaign" name="campaign_id" ref="marketing_campaign_openerpondemandfreetrial0"/>
<field name="email_template_id" ref="email_template_1"/>
</record>
<record id="marketing_campaign_activity_2" model="marketing.campaign.activity">
<!-- Report -->
<record id="mc_crm_lead_demo_report" model="ir.actions.report.xml">
<field name="name">Marketing campaign demo report</field>
<field name="type">ir.actions.report.xml</field>
<field name="model">crm.lead</field>
<field name="report_name">crm.lead.demo</field>
<field name="report_rml">marketing_campaign/report/crm_lead_mc_demo_report.rml</field>
<field name="report_type">pdf</field>
</record>
<!-- Campaign -->
<record id="marketing_campaign_openerpondemandfreetrial0" model="marketing.campaign">
<field name="name">OpenERP OnDemand Free Trial 2010</field>
<field name="object_id" ref="crm.model_crm_lead"/>
</record>
<!-- Activity -->
<record id="marketing_campaign_activity_0" model="marketing.campaign.activity">
<field name="name">Propose a 1 month free trial for an OnDemand offer</field>
<field name="server_action_id" ref="base.action_start_configurator"/>
<field model="marketing.campaign" name="campaign_id" ref="marketing_campaign_openerpondemandfreetrial0"/>
<field name="report_directory_id" ref="document_directory_campaign1"/>
<field name="type">paper</field>
<field eval="1" name="start"/>
<field name="report_id" ref="mc_crm_lead_demo_report"/>
</record>
<record id="marketing_campaign_activity_1" model="marketing.campaign.activity">
<field name="name">Thanks for showing interest</field>
<field name="server_action_id" ref="base.action_start_configurator"/>
<field model="marketing.campaign" name="campaign_id" ref="marketing_campaign_openerpondemandfreetrial0"/>
<field name="email_template_id" ref="email_template_1"/>
</record>
<record id="marketing_campaign_activity_2" model="marketing.campaign.activity">
<field name="name">Propose to subscribe to the Open ERP Discovery Day on May 2010</field>
<field name="server_action_id" ref="base.action_start_configurator"/>
<field model="marketing.campaign" name="campaign_id" ref="marketing_campaign_openerpondemandfreetrial0"/>
<field name="email_template_id" ref="email_template_2"/>
</record>
<record id="marketing_campaign_activity_3" model="marketing.campaign.activity">
<record id="marketing_campaign_activity_3" model="marketing.campaign.activity">
<field name="name">Thanks for subscribing to the Open ERP Discovery Day</field>
<field name="server_action_id" ref="base.action_start_configurator"/>
<field model="marketing.campaign" name="campaign_id" ref="marketing_campaign_openerpondemandfreetrial0"/>
@@ -244,7 +212,7 @@
<field name="type">paper</field>
<field name="report_id" ref="mc_crm_lead_demo_report"/>
</record>
<record id="marketing_campaign_activity_5" model="marketing.campaign.activity">
<field name="name">Thanks for buying the Open ERP book</field>
<field name="server_action_id" ref="base.action_start_configurator"/>
@@ -263,28 +231,28 @@
<field model="marketing.campaign" name="campaign_id" ref="marketing_campaign_openerpondemandfreetrial0"/>
<field name="email_template_id" ref="email_template_6"/>
</record>
<record id="marketing_campaign_activity_8" model="marketing.campaign.activity">
<field name="name">Propose gold partnership to silver partners</field>
<field name="server_action_id" ref="base.action_start_configurator"/>
<field model="marketing.campaign" name="campaign_id" ref="marketing_campaign_openerpondemandfreetrial0"/>
<field name="email_template_id" ref="email_template_7"/>
</record>
<record id="marketing_campaign_activity_9" model="marketing.campaign.activity">
<field name="name">Thanks for subscribing to technical training</field>
<field name="server_action_id" ref="base.action_start_configurator"/>
<field model="marketing.campaign" name="campaign_id" ref="marketing_campaign_openerpondemandfreetrial0"/>
<field name="email_template_id" ref="email_template_8"/>
</record>
<!-- Tranisition -->
<record id="marketing_campaign_transition_0" model="marketing.campaign.transition">
<field model="marketing.campaign.activity" name="activity_from_id" ref = "marketing_campaign_activity_0"/>
<field model="marketing.campaign.activity" name="activity_to_id" ref = "marketing_campaign_activity_1"/>
</record>
<record id="marketing_campaign_transition_1" model="marketing.campaign.transition">
<!-- Tranisition -->
<record id="marketing_campaign_transition_0" model="marketing.campaign.transition">
<field model="marketing.campaign.activity" name="activity_from_id" ref = "marketing_campaign_activity_0"/>
<field model="marketing.campaign.activity" name="activity_to_id" ref = "marketing_campaign_activity_1"/>
</record>
<record id="marketing_campaign_transition_1" model="marketing.campaign.transition">
<field model="marketing.campaign.activity" name="activity_from_id" ref = "marketing_campaign_activity_0"/>
<field model="marketing.campaign.activity" name="activity_to_id" ref = "marketing_campaign_activity_2"/>
</record>
@@ -324,15 +292,15 @@
<field model="marketing.campaign.activity" name="activity_from_id" ref = "marketing_campaign_activity_9"/>
<field model="marketing.campaign.activity" name="activity_to_id" ref = "marketing_campaign_activity_1"/>
</record>
<!-- Segment -->
<record id="marketing_campaign_segment_bosslistusassociationslist0" model="marketing.campaign.segment">
<field eval="time.strftime('%Y-%m-%d %H:%M:%S')" name="date_run"/>
<field name="name">BossList US Associations List-0/90</field>
<field name="sync_mode">create_date</field>
<field name="campaign_id" ref="marketing_campaign_openerpondemandfreetrial0"/>
<field name="state">draft</field>
</record>
</data>
</openerp>
<!-- Segment -->
<record id="marketing_campaign_segment_bosslistusassociationslist0" model="marketing.campaign.segment">
<field eval="time.strftime('%Y-%m-%d %H:%M:%S')" name="date_run"/>
<field name="name">BossList US Associations List-0/90</field>
<field name="sync_mode">create_date</field>
<field name="campaign_id" ref="marketing_campaign_openerpondemandfreetrial0"/>
<field name="state">draft</field>
</record>
</data>
</openerp>
@@ -14,75 +14,67 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Campaign">
<group colspan="4">
<group colspan="4" col="6">
<field name="name" select="1"/>
<field name="object_id" select="1"/>
<field name="mode"/>
<field name="fixed_cost"/>
</group>
<field name="activity_ids" nolabel = "1" colspan="4" default_get="{'object_id':object_id}">
<form string="Activities">
<field name="name" select="1" />
<field name="object_id" readonly="True"/>
<field name="variable_cost" select="1"/>
<field name="start"/>
<field name="condition" colspan="4"/>
<form string="Activities">
<group colspan="4" col="6">
<separator string="Activity Definition" colspan="4"/>
<separator string="Cost Control" colspan="2"/>
<field name="name" select="1" />
<field name="start"/>
<field name="variable_cost" select="1"/>
</group>
<group colspan="2" col="2">
<separator string="Condition" colspan="2"/>
<field name="condition"/>
</group>
<group colspan="2" col="2">
<separator string="Action" colspan="2"/>
<field name="type" colspan="4"/>
<group colspan="4" attrs="{'invisible':[('type','!=','email')]}" >
<field name="email_template_id" attrs="{'required':[('type','=','email')]}" />
</group>
<group colspan="4" attrs="{'invisible':[('type','!=','paper')]}" >
<field name="report_id" attrs="{'required':[('type','=','paper')]}"/>
<field name="report_directory_id" attrs="{'required':[('type','=','paper')]}" />
</group>
<group colspan="4" attrs="{'invisible':[('type','!=','action')]}" >
<field name="server_action_id" attrs="{'required':[('type','=','action')]}" />
</group>
<group colspan="4" attrs="{'invisible':[('type','!=','subcampaign')]}" >
<field name="subcampaign_id" attrs="{'required':[('type','=','subcampaign')]}" />
<field name="subcampaign_segment_id" attrs="{'required':[('type','=','subcampaign')]}" />
</group>
</group>
<newline/>
<field name="type" colspan="4"/>
<group colspan="4" attrs="{'invisible':[('type','!=','email')]}" >
<field name="email_template_id" attrs="{'required':[('type','=','email')]}" />
</group>
<group colspan="4" attrs="{'invisible':[('type','!=','paper')]}" >
<field name="report_id" attrs="{'required':[('type','=','paper')]}"/>
<field name="report_directory_id" attrs="{'required':[('type','=','paper')]}" />
</group>
<group colspan="4" attrs="{'invisible':[('type','!=','action')]}" >
<field name="server_action_id" attrs="{'required':[('type','=','action')]}" />
</group>
<group colspan="4" attrs="{'invisible':[('type','!=','subcampaign')]}" >
<field name="subcampaign_id" attrs="{'required':[('type','=','subcampaign')]}" />
<field name="subcampaign_segment_id" attrs="{'required':[('type','=','subcampaign')]}" />
</group>
<field name="to_ids" nolabel="1" colspan="4" mode="tree" default_get="{'type_id':'activity_from_id','activity_id':active_id or False}">
<form string="Out Transitions" >
<field name="activity_from_id" readonly="True"/>
<field name="activity_to_id"/>
<field name="interval_nbr"/>
<field name="interval_type"/>
</form>
<tree string="Out Transitions" editable="bottom">
<field name="activity_from_id"/>
<field name="activity_to_id"/>
<field name="interval_nbr"/>
<field name="interval_type"/>
</tree>
</field>
<field name="from_ids" nolabel="1" colspan="4" mode="tree" default_get="{'type_id':'activity_to_id','activity_id':active_id or False}">
<form string="In Transitions" >
<field name="activity_from_id"/>
<field name="activity_to_id" readonly="True"/>
<field name="interval_nbr"/>
<field name="interval_type"/>
</form>
<tree string="In Transitions" editable="bottom">
<field name="activity_from_id"/>
<field name="activity_to_id"/>
<field name="interval_nbr"/>
<field name="interval_type"/>
</tree>
</field>
<group colspan="4" col="4">
<separator string="Transitions" colspan="4"/>
<field name="to_ids" nolabel="1" colspan="2" mode="tree" default_get="{'type_id':'activity_from_id','activity_id':active_id or False}">
<tree string="Outgoing Transitions" editable="bottom">
<field name="activity_to_id"/>
<field name="interval_nbr"/>
<field name="interval_type"/>
</tree>
</field>
<field name="from_ids" nolabel="1" colspan="2" mode="tree" default_get="{'type_id':'activity_to_id','activity_id':active_id or False}">
<tree string="Incoming Transitions" editable="bottom">
<field name="activity_from_id"/>
<field name="interval_nbr"/>
<field name="interval_type"/>
</tree>
</field>
</group>
</form>
<tree string="Activities">
<field name="name" select="1"/>
<field name="object_id"/>
<field name="name"/>
<field name="start"/>
<field name="condition"/>
<field name="variable_cost" select="1"/>
<field name="type"/>
<field name="report_id"/>
<field name="to_ids"/>
<field name="subcampaign_id"/>
<field name="subcampaign_segment_id"/>
</tree>
</field>
<separator string="Status" colspan="4" />
@@ -105,7 +97,6 @@
<field name="name" select="1"/>
<field name="object_id" select="1"/>
<field name="mode"/>
<field name="fixed_cost"/>
<field name="state"/>
</tree>
</field>
@@ -122,13 +113,13 @@
<field name="type"/>
<field name="start" invisible="1"/>
<field name="condition"/>
</node>
<arrow object="marketing.campaign.transition" source="activity_from_id" destination="activity_to_id" label="['interval_type']">
</node>
<arrow object="marketing.campaign.transition" source="activity_from_id" destination="activity_to_id" label="['interval_type']">
<field name="activity_from_id"/>
<field name="activity_to_id"/>
<field name="interval_nbr"/>
<field name="interval_type"/>
</arrow>
<field name="interval_type"/>
</arrow>
</diagram>
</field>
</record>
@@ -163,12 +154,12 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form,diagram</field>
<field name="view_id" ref="view_marketing_campaign_tree"/>
<field name="context">{'group_by': [], 'search_default_draft': 1, 'search_default_test': 1}</field>
<field name="context">{'group_by': []}</field>
<field name="search_view_id" ref="view_marketing_campaign_search"/>
</record>
<menuitem name="Campaigns" id="menu_marketing_campaign" parent="marketing.marketing_menu"/>
<menuitem name="Campaigns" id="menu_marketing_campaign" parent="marketing.marketing_menu"/>
<menuitem id="menu_marketing_campaign_form" parent="menu_marketing_campaign" action="action_marketing_campaign_form" sequence="10" />
<!--
@@ -183,26 +174,30 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Segments">
<group colspan="4">
<field name="name" select="1" colspan="4"/>
<newline/>
<group colspan="4" col="6">
<field name="name"/>
<field name="campaign_id" select="1"/>
<field name="object_id" select="1" readonly="True"/>
<newline/>
<field name="ir_filter_id" select="1"/>
<newline/>
<field name="object_id" invisible="1" readonly="True"/>
</group>
<group colspan="2" col="2">
<separator string="Synchronization" colspan="2"/>
<field name="sync_last_date"/>
<field name="sync_mode" required="True"/>
<label string="" colspan="1"/>
<button string="Synchronize" states="running" name="synchroniz" icon="gtk-apply" type="object"/>
</group>
<group colspan="2" col="2">
<separator string="Dates" colspan="2"/>
<field name="date_run" attrs="{'readonly':[('date_run','!=',False),('state','=','running')]}"/>
<field name="date_done"/>
<separator string="Synchronization" colspan="4" />
<field name="sync_last_date"/>
<field name="sync_mode" required="True"/>
</group>
<separator string="Status" colspan="4" />
<separator string="Status" colspan="4"/>
<group col="10" colspan="4">
<field name="state" readonly="1" select="2" nolabel="1"/>
<button name="state_running_set" string="Run" states="draft" icon="gtk-apply"/>
<button name="state_done_set" string="Done" states="running" icon="gtk-ok"/>
<button name="state_cancel_set" string="Cancelled" states="running" icon="gtk-cancel"/>
<button name="state_done_set" string="Close" states="running" icon="gtk-ok"/>
<button name="state_cancel_set" string="Cancel" states="running" icon="gtk-cancel"/>
</group>
</form>
</field>
@@ -214,13 +209,10 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Segments">
<field name="name" select="1"/>
<field name="campaign_id" select="1"/>
<field name="object_id" select="1" />
<field name="name"/>
<field name="campaign_id"/>
<field name="date_run"/>
<field name="date_done"/>
<field name="sync_last_date" string="Sync Date"/>
<field name="sync_mode" string="Sync Mode"/>
<field name="sync_last_date"/>
<field name="state" />
</tree>
</field>
@@ -232,10 +224,10 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Segments">
<filter icon="terp-document-new" string="Draft" name="draft" domain="[('state','=','draft')]"/>
<filter icon="terp-check" string="Running" domain="[('state','=','running')]"/>
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]"/>
<filter icon="terp-check" string="Running" name="running" domain="[('state','=','running')]"/>
<separator orientation="vertical"/>
<filter icon="terp-go-month" string="Create Date" name="create_date" domain="[('sync_mode','=','create_date')]"/>
<filter icon="terp-go-month" string="Create Date" domain="[('sync_mode','=','create_date')]"/>
<filter icon="terp-go-month" string="Write Date" domain="[('sync_mode','=','write_date')]"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
@@ -251,7 +243,7 @@
</search>
</field>
</record>
+
<record model="ir.actions.act_window" id="action_marketing_campaign_segment_form">
<field name="name">Segments</field>
<field name="type">ir.actions.act_window</field>
@@ -259,8 +251,8 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_marketing_campaign_segment_tree"/>
<field name="search_view_id" ref="view_marketing_campaign_segment_search"/>
<field name="context">{'group_by': [], 'search_default_draft': 1, 'search_default_create_date': 1}</field>
<field name="search_view_id" ref="view_marketing_campaign_segment_search"/>
<field name="context">{'group_by': [], 'search_default_running': 1}</field>
</record>
<menuitem id="menu_marketing_campaign_segment_form" parent="menu_marketing_campaign" action="action_marketing_campaign_segment_form" sequence="20" />
@@ -277,54 +269,55 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Activities">
<field name="name" select="1" />
<field name="start"/>
<field name="campaign_id" select="1"/>
<field name="object_id" readonly="True"/>
<group colspan="4" col="6">
<separator string="Activity Definition" colspan="4"/>
<separator string="Cost Control" colspan="2"/>
<field name="name" select="1" />
<field name="start"/>
<field name="variable_cost" select="1"/>
<field name="object_id" invisible="1"/>
</group>
<group colspan="2" col="2">
<separator string="Condition" colspan="2"/>
<field name="condition"/>
</group>
<group colspan="2" col="2">
<separator string="Action"/>
<field name="type" colspan="4"/>
<group colspan="4" attrs="{'invisible':[('type','!=','email')]}" >
<field name="email_template_id" attrs="{'required':[('type','=','email')]}" />
</group>
<group colspan="4" attrs="{'invisible':[('type','!=','paper')]}" >
<field name="report_id" attrs="{'required':[('type','=','paper')]}"/>
<field name="report_directory_id" attrs="{'required':[('type','=','paper')]}" />
</group>
<group colspan="4" attrs="{'invisible':[('type','!=','action')]}" >
<field name="server_action_id" attrs="{'required':[('type','=','action')]}" />
</group>
<group colspan="4" attrs="{'invisible':[('type','!=','subcampaign')]}" >
<field name="subcampaign_id" attrs="{'required':[('type','=','subcampaign')]}" />
<field name="subcampaign_segment_id" attrs="{'required':[('type','=','subcampaign')]}" />
</group>
</group>
<newline/>
<field name="type"/>
<group colspan="4" attrs="{'invisible':[('type','!=','email')]}" >
<field name="email_template_id" attrs="{'required':[('type','=','email')]}" />
<group colspan="4" col="4">
<separator string="Transitions" colspan="4"/>
<field name="to_ids" nolabel="1" colspan="2" mode="tree" default_get="{'type_id':'activity_from_id','activity_id':active_id or False}">
<tree string="Outgoing Transitions" editable="bottom">
<field name="activity_to_id"/>
<field name="interval_nbr"/>
<field name="interval_type"/>
</tree>
</field>
<field name="from_ids" nolabel="1" colspan="2" mode="tree" default_get="{'type_id':'activity_to_id','activity_id':active_id or False}">
<tree string="Incoming Transitions" editable="bottom">
<field name="activity_from_id"/>
<field name="interval_nbr"/>
<field name="interval_type"/>
</tree>
</field>
</group>
<group colspan="4" attrs="{'invisible':[('type','!=','paper')]}" >
<field name="report_id" attrs="{'required':[('type','=','paper')]}" />
<field name="report_directory_id" attrs="{'required':[('type','=','paper')]}" />
</group>
<group colspan="4" attrs="{'invisible':[('type','!=','action')]}" >
<field name="server_action_id" attrs="{'required':[('type','=','action')]}" />
</group>
<group colspan="4" attrs="{'invisible':[('type','!=','subcampaign')]}" >
<field name="subcampaign_id" attrs="{'required':[('type','=','subcampaign')]}" />
<field name="subcampaign_segment_id" attrs="{'required':[('type','=','subcampaign')]}" />
</group>
<field name="to_ids" nolabel="1" colspan="4" mode="tree" default_get="{'type_id':'activity_from_id','activity_id':active_id or False}">
<form string="Out Transitions" >
<field name="activity_from_id" readonly="True"/>
<field name="activity_to_id"/>
<field name="interval_nbr"/>
<field name="interval_type"/>
</form>
<tree string="Out Transitions" editable="bottom">
<field name="activity_from_id"/>
<field name="activity_to_id"/>
<field name="interval_nbr"/>
<field name="interval_type"/>
</tree>
</field>
<field name="from_ids" nolabel="1" colspan="4" mode="tree" default_get="{'type_id':'activity_to_id','activity_id':active_id or False}">
<form string="In Transitions" >
<field name="activity_from_id"/>
<field name="activity_to_id" readonly="True"/>
<field name="interval_nbr"/>
<field name="interval_type"/>
</form>
<tree string="In Transitions" editable="bottom">
<field name="activity_from_id"/>
<field name="activity_to_id"/>
<field name="interval_nbr"/>
<field name="interval_type"/>
</tree>
</field>
</form>
</field>
</record>
@@ -338,13 +331,8 @@
<field name="name" select="1"/>
<field name="campaign_id" select="1"/>
<field name="start"/>
<field name="object_id"/>
<field name="condition"/>
<field name="type"/>
<field name="report_id"/>
<field name="to_ids" />
<field name="subcampaign_id"/>
<field name="subcampaign_segment_id"/>
</tree>
</field>
</record>
@@ -374,11 +362,12 @@
<tree string="Workitems">
<field name="segment_id"/>
<field name="activity_id" />
<field name="object_id"/>
<field name="partner_id" select="1"/>
<field name="res_id" />
<field name="res_name" />
<field name="partner_id"/>
<field name="date"/>
<field name="state"/>
<button string="Process" states="todo" name="process" type="object" icon="gtk-ok"/>
<button string="Cancel" states="todo" name="button_cancel" type="object" icon="gtk-cancel"/>
</tree>
</field>
</record>
@@ -389,14 +378,31 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Workitem">
<field name="segment_id" select="1"/>
<field name="activity_id" context="{'segment_id':segment_id}" select="1"/>
<field name="object_id" readonly="True"/>
<field name="partner_id" select="1"/>
<field name="res_id"/>
<field name="date" select="1"/>
<group colspan="4" col="6">
<group colspan="2" col="2">
<separator string="Campaign Step" colspan="2"/>
<field name="campaign_id" select="1"/>
<field name="segment_id" select="1"/>
<field name="activity_id" context="{'segment_id':segment_id}" select="1"/>
</group><group colspan="2" col="2">
<separator string="Related Resource" colspan="2"/>
<field name="object_id" readonly="True"/>
<field name="res_name"/>
<field name="res_id"/>
<field name="partner_id" select="1"/>
</group><group colspan="2" col="2">
<separator string="Date" colspan="2"/>
<field name="date"/>
<label string="" colspan="1"/>
<button string="Preview" states="todo" name="preview" icon="gtk-apply" type="object"/>
</group>
</group>
<separator string="Status" colspan="4"/>
<field name="state" nolabel="1" colspan="4" readonly="True" select="1"/>
<group colspan="4" col="11">
<field name="state" nolabel="1" readonly="True" select="1"/>
<button string="Process" states="todo" name="process" type="object" icon="gtk-ok"/>
<button string="Cancel" states="todo" name="button_cancel" type="object" icon="gtk-cancel"/>
</group>
</form>
</field>
</record>
@@ -440,5 +446,14 @@
<menuitem id="menu_action_marketing_campaign_workitem" parent="menu_marketing_campaign" action="action_marketing_campaign_workitem" sequence="30" groups="base.group_extended"/>
<act_window name="All Segments"
res_model="marketing.campaign.segment"
src_model="marketing.campaign"
view_type="form"
view_mode="tree,form"
id="act_marketing_campaing_segment_opened"
domain="[('campaign_id','=',active_id)]"
/>
</data>
</openerp>
+6 -5
View File
@@ -358,10 +358,11 @@ class Partner(osv.osv):
def __get_membership_state(self, *args, **kwargs):
return self._membership_state(*args, **kwargs)
_columns = {
'associate_member': fields.many2one('res.partner', 'Associate member'),
'member_lines': fields.one2many('membership.membership_line', 'partner', 'Membership'),
'member': fields.boolean('Member'),
'free_member': fields.boolean('Free member'),
'membership_amount': fields.float(
'Membership amount', digits=(16, 2),
@@ -422,16 +423,16 @@ class Partner(osv.osv):
_constraints = [
(_check_recursion, 'Error ! You can not create recursive associated members.', ['associate_member'])
]
def copy(self, cr, uid, id, default=None, context=None):
if default is None:
default = {}
if context is None:
context = {}
context = {}
default = default.copy()
default['member_lines'] = []
return super(Partner, self).copy(cr, uid, id, default, context)
Partner()
class product_template(osv.osv):
@@ -646,7 +647,7 @@ ReportPartnerMemberYearNew()
class account_invoice_line(osv.osv):
_inherit='account.invoice.line'
def write(self, cr, uid, ids, vals, context=None):
if not context:
context={}
+31 -1
View File
@@ -103,13 +103,14 @@
<field name="arch" type="xml">
<tree string="Members">
<field name="name"/>
<field name="associate_member" attrs="{'invisible':[('membership_state', '!=', 'none')]}"/>
<field name="membership_start"/>
<field name="membership_stop"/>
<field name="membership_state"/>
<field name="associate_member" attrs="{'invisible':[('membership_state', '!=', 'none')]}"/>
</tree>
</field>
</record>
<record id="view_res_partner_member_filter" model="ir.ui.view">
<field name="name">res.partner.select</field>
<field name="model">res.partner</field>
@@ -125,6 +126,24 @@
</field>
</record>
<record id="view_res_partner_member_filter2" model="ir.ui.view">
<field name="name">res.partner.select2</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="view_res_partner_member_filter"/>
<field name="type">search</field>
<field name="arch" type="xml">
<field name="membership_state" position="after">
<group expand="1" string="Group By" colspan="10" col="8">
<separator orientation="vertical"/>
<filter string="Start Date" icon="terp-go-month" domain="[]" context="{'group_by':'membership_start'}"/>
<filter string="End Date" icon="terp-go-month" domain="[]" context="{'group_by':'membership_stop'}"/>
<filter string="Associate Member" icon="terp-personal" domain="[]" context="{'group_by':'associate_member'}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'membership_state'}"/>
</group>
</field>
</field>
</record>
<record model="ir.actions.act_window" id="action_membership_members">
<field name="name">Members</field>
<field name="res_model">res.partner</field>
@@ -157,6 +176,17 @@
/>
-->
<record id="view_res_partner_member_form2" model="ir.ui.view">
<field name="name">res.partner.form2</field>
<field name="model">res.partner</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<field name="supplier" position="after">
<field name="member"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="view_partner_tree">
<field name="name">res.partner.tree.form.inherit</field>
+1 -1
View File
@@ -26,6 +26,6 @@ import installer
import wizard
import report
import company
import mrp_procurement
import procurement
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+2 -2
View File
@@ -26,7 +26,7 @@
"author" : "Tiny",
"website" : "http://www.openerp.com",
"category" : "Generic Modules/Production",
"depends" : ["mrp_procurement", "stock", "resource", "purchase", "product","process"],
"depends" : ["procurement", "stock", "resource", "purchase", "product","process"],
"description": """
This is the base module to manage the manufacturing process in Open ERP.
@@ -82,7 +82,7 @@
'report/mrp_production_order_view.xml',
'board_manufacturing_view.xml',
],
'demo_xml': ['mrp_demo.xml', 'mrp_order_point.xml','board_manufacturing_demo.xml'],
'test': [
+1
View File
@@ -16,6 +16,7 @@
<action colspan="4" height="200" name="%(mrp.mrp_production_action2)d" string="Next production orders" width="510"/>
<action colspan="4" name="%(mrp_procurement.mrp_procurement_action4)d" string="Procurements in Exception"/>
<action colspan="4" name="%(stock.action_picking_tree)d" string="Deliveries (Out picking)" domain="[('state','=','assigned'),('type','=','out')]"/>
<action colspan="4" name="%(procurement.procurement_action4)d" string="Procurements in Exception"/>
</child1>
<child2>
<action colspan="4" name="%(mrp.action_report_workcenter_load_tree)d" string="Work Center future load"/>
+11 -11
View File
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-06-08 13:08+0000\n"
"PO-Revision-Date: 2010-06-10 09:51+0000\n"
"Last-Translator: vir (Open ERP) <vir@tinyerp.com>\n"
"Language-Team: Hindi <hi@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
"X-Launchpad-Export-Date: 2010-06-11 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
@@ -81,7 +81,7 @@ msgstr ""
#. module: mrp
#: field:mrp.production,picking_id:0
msgid "Packing list"
msgstr ""
msgstr "पैकिंग सूची"
#. module: mrp
#: model:process.node,name:mrp.process_node_stock0
@@ -347,23 +347,23 @@ msgstr ""
#. module: mrp
#: view:mrp.procurement:0
msgid "Details"
msgstr ""
msgstr "विवरण"
#. module: mrp
#: model:process.process,name:mrp.process_process_procurementprocess0
msgid "Procurement Process"
msgstr ""
msgstr "खरीद प्रक्रिया"
#. module: mrp
#: field:mrp.production,date_planned_date:0
msgid "Scheduled Date"
msgstr ""
msgstr "अनुसूचित तिथि"
#. module: mrp
#: selection:mrp.procurement,priority:0
#: selection:mrp.production,priority:0
msgid "Urgent"
msgstr ""
msgstr "तत्काल"
#. module: mrp
#: help:mrp.bom,product_rounding:0
@@ -387,7 +387,7 @@ msgstr ""
#. module: mrp
#: field:mrp.procurement,move_id:0
msgid "Reservation"
msgstr ""
msgstr "आरक्षण"
#. module: mrp
#: model:ir.actions.act_window,name:mrp.action2
@@ -397,12 +397,12 @@ msgstr ""
#. module: mrp
#: wizard_field:product.product.procurement,init,product_id:0
msgid "product"
msgstr ""
msgstr "उत्पाद"
#. module: mrp
#: selection:mrp.property,composition:0
msgid "max"
msgstr ""
msgstr "अधिकतम"
#. module: mrp
#: model:process.transition,name:mrp.process_transition_producttostockrules0
@@ -412,7 +412,7 @@ msgstr ""
#. module: mrp
#: wizard_button:product_price,init,price:0
msgid "Print product price"
msgstr ""
msgstr "प्रिंट उत्पाद मूल्य"
#. module: mrp
#: wizard_view:product.product.procurement,done:0

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