bzr revid: mra@mra-laptop-20100720092509-enlc6u0plzutk97l
This commit is contained in:
Mustufa Rangwala 2010-07-20 14:55:09 +05:30
commit 73bffa7020
30 changed files with 187 additions and 119 deletions

View File

@ -60,6 +60,8 @@
<field name="account_payment"/>
<field name="account_followup"/>
<field name="account_asset"/>
<field name="account_voucher"/>
<field name="account_voucher_payment"/>
</group>
</group>
</group>

View File

@ -44,7 +44,7 @@
<field name="model">account.fiscalyear</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Fiscalyear">
<tree colors="blue:state in ('draft');gray:state in ('done') " string="Fiscalyear">
<field name="code"/>
<field name="name"/>
<field name="state"/>
@ -113,7 +113,7 @@
<field name="model">account.period</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Period">
<tree colors="blue:state in ('draft');gray:state in ('done') " string="Period">
<field name="code"/>
<field name="name"/>
<field name="date_start"/>
@ -203,10 +203,9 @@
<field name="type">tree</field>
<field name="field_parent">child_id</field>
<field name="arch" type="xml">
<tree string="Chart of accounts" toolbar="1" colors="blue:type in ('view');black:type not in ('view')">
<tree colors="blue:type in ('view');black:type in ('other','receivable','payable','consolidation');gray:type in ('closed')" string="Chart of accounts" toolbar="1" >
<field name="code"/>
<field name="name"/>
<field name="parent_id" invisible="1"/>
<field name="user_type" invisible="1"/>
<field name="debit"/>
<field name="credit"/>
@ -234,7 +233,7 @@
<field name="type">tree</field>
<field name="field_parent">child_id</field>
<field name="arch" type="xml">
<tree string="Chart of accounts" toolbar="1" colors="blue:type in ('view');black:type not in ('view')">
<tree colors="blue:type in ('view');black:type in ('other','receivable','payable','consolidation');gray:type in ('closed')" string="Chart of accounts" toolbar="1" >
<field name="code"/>
<field name="name"/>
<field name="debit"/>
@ -484,7 +483,7 @@
<group col="6" colspan="4">
<field name="name" select="1"/>
<field name="date" select="1"/>
<field name="journal_id" on_change="onchange_journal_id(journal_id)" select="1"/>
<field name="journal_id" domain="[('type', '=', 'bank')]" on_change="onchange_journal_id(journal_id)" select="1"/>
<field name="period_id"/>
<field name="balance_start"/>
<field name="balance_end_real"/>
@ -657,7 +656,7 @@
<field name="model">account.move</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Accounting Entries">
<tree colors="blue:state in ('draft');black:state in ('posted')" string="Accounting Entries">
<field name="name"/>
<field name="date"/>
<field name="ref"/>
@ -869,7 +868,7 @@
<field name="type">tree</field>
<field eval="4" name="priority"/>
<field name="arch" type="xml">
<tree string="Account Entry Line" editable="top" on_write="on_create_write">
<tree colors="blue:state in ('draft');black:state in ('valid')" string="Account Entry Line" editable="top" on_write="on_create_write">
<field name="date"/>
<field name="period_id"/>
<field name="move_id"/>
@ -1048,7 +1047,7 @@
<field name="model">account.move</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Account Entry">
<tree colors="blue:state in ('draft');black:state in ('posted')" string="Account Entry">
<field name="name"/>
<field name="date"/>
<field name="ref"/>
@ -1105,7 +1104,7 @@
<field name="statement_id"/>
<field name="state"/>
</form>
<tree editable="top" string="Account Entry Line">
<tree colors="blue:state in ('draft');black:state in ('posted')" editable="top" string="Account Entry Line">
<field name="ref"/>
<field name="invoice"/>
<field name="name"/>
@ -1420,7 +1419,7 @@
<field name="model">account.journal.period</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Journals">
<tree colors="blue:state in ('draft');gray:state in ('done');black:state in ('printed')" string="Journals">
<field icon="icon" name="fiscalyear_id"/>
<field name="period_id"/>
<field name="journal_id"/>
@ -1634,7 +1633,7 @@
<field name="model">account.subscription</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Entry Subscription">
<tree colors="blue:state in ('draft');gray:state in ('done');black:state in ('running')" string="Entry Subscription">
<field name="ref"/>
<field name="name"/>
<field name="date_start"/>
@ -1736,7 +1735,7 @@
<field name="type">tree</field>
<field eval="4" name="priority"/>
<field name="arch" type="xml">
<tree string="Account Entry Line">
<tree colors="blue:state in ('draft');black:state in ('valid')" string="Account Entry Line">
<field name="date"/>
<field name="move_id"/>
<field name="statement_id" string="St."/>
@ -2290,7 +2289,7 @@
<field name="model">account.bank.statement</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree colors="red:balance_end_real!=balance_end;blue:state=='draft' and (balance_end_real==balance_end);black:state in ('open');blue:state in ('draft')" string="Statement">
<tree colors="red:balance_end_real!=balance_end;blue:state=='draft' and (balance_end_real==balance_end);black:state in ('open')" string="Statement">
<field name="date"/>
<field name="name"/>
<field name="journal_id"/>
@ -2298,7 +2297,7 @@
<field name="balance_start"/>
<field name="balance_end_real"/>
<field name="balance_end"/>
<field name="user_id" select="1"/>
<field name="user_id" select="1"/>
<field name="state"/>
<button type="object" string="Open" name="button_open" states="draft" icon="terp-camera_test"/>
<button type="object" string="Confirm" name="button_confirm_cash" states="open" icon="terp-gtk-go-back-rtl"/>

View File

@ -67,6 +67,12 @@ class account_installer(osv.osv_memory):
'account_asset':fields.boolean('Assets Management',
help="Enables asset management in the accounting application, "
"including asset categories and usage periods."),
'account_voucher':fields.boolean('Voucher Management',
help="Account Voucher module includes all the basic requirements of "
"Voucher Entries for Bank, Cash, Sales, Purchase, Expanse, Contra, etc... "),
'account_voucher_payment':fields.boolean('Voucher and Reconcile Management',
help="Extension Account Voucher module includes allows to link payment / receipt "
"entries with voucher, also automatically reconcile during the payment and receipt entries."),
'date_start': fields.date('Start Date', required=True),
'date_stop': fields.date('End Date', required=True),
'period':fields.selection([('month','Monthly'), ('3months','3 Monthly')],

View File

@ -242,13 +242,13 @@ class account_invoice(osv.osv):
('proforma','Pro-forma'),
('proforma2','Pro-forma'),
('open','Open'),
('paid','Done'),
('paid','Paid'),
('cancel','Cancelled')
],'State', select=True, readonly=True,
help=' * The \'Draft\' state is used when a user is encoding a new and unconfirmed Invoice. \
\n* The \'Pro-forma\' when invoice is in Pro-forma state,invoice does not have an invoice number. \
\n* The \'Open\' state is used when user create invoice,a invoice number is generated.Its in open state till user does not pay invoice. \
\n* The \'Done\' state is set automatically when invoice is paid.\
\n* The \'Paid\' state is set automatically when invoice is paid.\
\n* The \'Cancelled\' state is used when user cancel invoice.'),
'date_invoice': fields.date('Date Invoiced', states={'paid':[('readonly',True)], 'open':[('readonly',True)], 'close':[('readonly',True)]}, help="Keep empty to use the current date"),
'date_due': fields.date('Due Date', states={'paid':[('readonly',True)], 'open':[('readonly',True)], 'close':[('readonly',True)]},

View File

@ -6,7 +6,7 @@
<field name="model">account.entries.report</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Entries Analysis">
<tree colors="blue:state in ('draft');black:state in ('posted')" string="Entries Analysis">
<field name="date" invisible="1"/>
<field name="date_created" invisible="1"/>
<field name="date_maturity" invisible="1"/>

View File

@ -6,7 +6,7 @@
<field name="model">account.invoice.report</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Invoices Analysis">
<tree colors="blue:state in ('draft');gray:state in ('cancel','paid');black:state in ('proforma','proforma2')" string="Invoices Analysis">
<field name="date" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="year" invisible="1"/>

View File

@ -89,7 +89,7 @@
<field name="model">report.invoice.created</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree colors="blue:state in ('draft');black:state not in ('draft') " string="Invoices">
<tree colors="blue:state in ('draft');black:state in ('proforma','proforma2','open');gray:state in('paid','cancel') " string="Invoices">
<field name="create_date" select="1"/>
<field name="name" select="1"/>
<field name="type"/>

View File

@ -163,7 +163,7 @@
<field name="model">crossovered.budget</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Budget">
<tree colors="blue:state in ('draft');gray:state in ('done','cancel');black:state in ('confirm','validate')" string="Budget">
<field name="name" colspan="1" select="1"/>
<field name="code" colspan="1" select="1" />
<field name="state"/>

View File

@ -95,7 +95,7 @@
<field name="type">tree</field>
<field eval="32" name="priority"/>
<field name="arch" type="xml">
<tree editable="bottom" string="Partner entries">
<tree colors="blue:state in ('draft');black:state in ('validate')" editable="bottom" string="Partner entries">
<field name="date"/>
<field name="move_id"/>
<field name="ref"/>

View File

@ -177,7 +177,7 @@
<field name="type">tree</field>
<field eval="4" name="priority"/>
<field name="arch" type="xml">
<tree string="Payment order">
<tree colors="blue:state in ('draft');gray:state in ('cancel','done');black:state in ('open')" editable="bottom" string="Payment order">
<field name="reference"/>
<field name="mode"/>
<field name="date_planned"/>

View File

@ -6,7 +6,7 @@
<field name="model">account.voucher</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Accounting Vouchers">
<tree colors="blue:state in ('draft');gray:state in ('cancel','done');black:state in ('open','proforma','posted','recheck','audit')" string="Accounting Vouchers">
<field name="date"/>
<field name="number"/>
<field name="name"/>

View File

@ -23,18 +23,18 @@
<attribute name="string">Install Generic Modules</attribute>
</separator>
<group colspan="8">
<field name="crm" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/> <field name="sale" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/>
<field name="project" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/> <field name="knowledge" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/>
<field name="stock" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/> <field name="mrp" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/>
<field name="account" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/> <field name="purchase" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/>
<field name="hr" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/> <field name="point_of_sale" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/>
<field name="marketing" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/> <field name="misc_tools" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/>
<field name="report_designer" groups="base.group_extended" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/>
<field name="crm" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,profile_auction,profile_bookstore)"/> <field name="sale" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,profile_auction,profile_bookstore)"/>
<field name="project" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,profile_auction,profile_bookstore)"/> <field name="knowledge" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,profile_auction,profile_bookstore)"/>
<field name="stock" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,profile_auction,profile_bookstore)"/> <field name="mrp" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,profile_auction,profile_bookstore)"/>
<field name="account" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,profile_auction,profile_bookstore)"/> <field name="purchase" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,profile_auction,profile_bookstore)"/>
<field name="hr" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,profile_auction,profile_bookstore)"/> <field name="point_of_sale" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,profile_auction,profile_bookstore)"/>
<field name="marketing" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,profile_auction,profile_bookstore)"/> <field name="misc_tools" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,profile_auction,profile_bookstore)"/>
<field name="report_designer" groups="base.group_extended" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,profile_auction,profile_bookstore)"/>
<separator string="Install Specific Business Modules" colspan="4"/>
<field name="association" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/>
<field name="profile_auction" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/>
<field name="profile_bookstore" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/>
<field name="product_expiry" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,profile_association,profile_auction,profile_bookstore)"/>
<field name="association" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,profile_auction,profile_bookstore)"/>
<field name="profile_auction" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,profile_auction,profile_bookstore)"/>
<field name="profile_bookstore" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,profile_auction,profile_bookstore)"/>
<field name="product_expiry" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account,purchase,hr,point_of_sale,marketing,misc_tools,report_designer,association,profile_auction,profile_bookstore)"/>
</group>
</data>
</field>

View File

@ -187,12 +187,14 @@ class crm_lead_forward_to_partner(osv.osv_memory):
email_re = r'([^ ,<@]+@[^> ,]+)'
email_cc = re.findall(email_re, case.email_cc or '')
new_cc = []
if case.email_cc:
new_cc.append(case.email_cc)
for to in this.email_to.split(','):
email_to = re.findall(email_re, to)
email_to = email_to and email_to[0] or ''
if email_to not in email_cc:
new_cc.append(to)
to_write.update({'email_cc' : case.email_cc or '' + ','.join(new_cc)})
to_write.update({'email_cc' : ', '.join(new_cc) })
case_pool.write(cr, uid, case.id, to_write, context=context)
return {}

View File

@ -226,7 +226,7 @@ class event_event(osv.osv):
'note': fields.text('Notes', help="Description or Summary of Event", readonly=False, states={'done': [('readonly', True)]}),
'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', readonly=True, states={'draft': [('readonly', False)]}, help="Pricelist version for current event."),
'unit_price': fields.related('product_id', 'list_price', type='float', string='Registration Cost', readonly=True, states={'draft':[('readonly',False)]}, help="This will be the default price used as registration cost when invoicing this event. Note that you can specify for each registration a specific amount if you want to"),
'main_speaker_id': fields.many2one('res.partner','Main Speaker', readonly=False, states={'done': [('readonly', True)]}),
'main_speaker_id': fields.many2one('res.partner','Main Speaker', readonly=False, states={'done': [('readonly', True)]}, help="Speaker who are giving speech on event."),
'speaker_ids':fields.many2many('res.partner', 'event_speaker_rel', 'speaker_id', 'partner_id', 'Other Speakers', readonly=False, states={'done': [('readonly', True)]}),
'address_id': fields.many2one('res.partner.address','Location Address', readonly=False, states={'done': [('readonly', True)]}),
'speaker_confirmed': fields.boolean('Speaker Confirmed', readonly=False, states={'done': [('readonly', True)]}),
@ -285,7 +285,7 @@ class event_registration(osv.osv):
"""Event Registration"""
_name= 'event.registration'
_description = __doc__
_inherit = 'crm.meeting'
_inherit = 'mailgate.thread'
def _amount_line(self, cr, uid, ids, field_name, arg, context=None):
cur_obj = self.pool.get('res.currency')
@ -303,6 +303,7 @@ class event_registration(osv.osv):
'email_cc': fields.text('CC', size=252 , readonly=False, states={'done': [('readonly', True)]}, help="These email addresses will be added to the CC field of all inbound and outbound emails for this record before being sent. Separate multiple email addresses with a comma"),
'nb_register': fields.integer('Quantity', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="Number of Registrations or Tickets"),
'event_id': fields.many2one('event.event', 'Event Related', required=True, readonly=True, states={'draft': [('readonly', False)]}),
'partner_id': fields.many2one('res.partner', 'Partner', states={'done': [('readonly', True)]}),
"partner_invoice_id": fields.many2one('res.partner', 'Partner Invoiced', readonly=True, states={'draft': [('readonly', False)]}),
"contact_id": fields.many2one('res.partner.contact', 'Partner Contact', readonly=False, states={'done': [('readonly', True)]}), #TODO: filter only the contacts that have a function into the selected partner_id
"unit_price": fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Event Price'), readonly=True, states={'draft': [('readonly', False)]}),
@ -314,16 +315,30 @@ class event_registration(osv.osv):
'date_closed': fields.datetime('Closed', readonly=True),
'ref': fields.reference('Reference', selection=crm._links_get, size=128),
'ref2': fields.reference('Reference 2', selection=crm._links_get, size=128),
'email_from': fields.char('Email', size=128, states={'done': [('readonly', True)]}, help="These people will receive email."),
'create_date': fields.datetime('Creation Date' , readonly=True),
'write_date': fields.datetime('Write Date' , readonly=True),
'description': fields.text('Description', states={'done': [('readonly', True)]}),
'message_ids': fields.one2many('mailgate.message', 'res_id', 'Messages', domain=[('model','=',_name)]),
'log_ids': fields.one2many('mailgate.message', 'res_id', 'Logs', domain=[('history', '=', False),('model','=',_name)]),
'date_deadline': fields.related('event_id','date_end', type='datetime', string="End Date", readonly=True, store=True),
'date': fields.related('event_id', 'date_begin', type='datetime', string="Start Date", readonly=True, store=True),
'section_id': fields.related('event_id', 'section_id', type='many2one', relation='crm.case.section', string='Sale Team', store=True, readonly=True, states={'draft':[('readonly',False)]}),
'date_deadline': fields.related('event_id','date_end', type='datetime', string="End Date", readonly=True),
'date': fields.related('event_id', 'date_begin', type='datetime', string="Start Date", readonly=True),
'user_id': fields.many2one('res.users', 'Responsible', states={'done': [('readonly', True)]}),
'active': fields.boolean('Active'),
'section_id': fields.related('event_id', 'section_id', type='many2one', relation='crm.case.section', string='Sale Team', store=True, readonly=True),
'company_id': fields.related('event_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True, states={'draft':[('readonly',False)]}),
'state': fields.selection([('open', 'Confirmed'),
('draft', 'Unconfirmed'),
('cancel', 'Cancelled'),
('done', 'Done')], 'State', \
size=16, readonly=True)
}
_defaults = {
'nb_register': 1,
'tobe_invoiced': True,
'state': lambda *a: 'draft',
'active': lambda *a: 1,
'user_id': lambda self, cr, uid, ctx: uid,
}
def _make_invoice(self, cr, uid, reg, lines, context=None):
@ -353,7 +368,7 @@ class event_registration(osv.osv):
})
inv_id = inv_pool.create(cr, uid, val_invoice['value'])
inv_pool.button_compute(cr, uid, [inv_id])
self._history(cr, uid, [reg], _('Invoiced'))
self.history(cr, uid, [reg], _('Invoiced'))
return inv_id
def action_invoice_create(self, cr, uid, ids, grouped=False, date_inv = False, context=None):
@ -422,7 +437,7 @@ class event_registration(osv.osv):
"""
res = self.write(cr, uid, ids, {'state': 'open'}, context=context)
self.mail_user(cr, uid, ids)
self._history(cr, uid, ids, _('Open'))
self.history(cr, uid, ids, _('Open'))
return res
def do_close(self, cr, uid, ids, context=None):
@ -436,7 +451,7 @@ class event_registration(osv.osv):
if invoice_id:
values['invoice_id'] = invoice_id
res = self.write(cr, uid, ids, values)
self._history(cr, uid, ids, msg)
self.history(cr, uid, ids, msg)
return res
def check_confirm(self, cr, uid, ids, context=None):
@ -509,7 +524,7 @@ class event_registration(osv.osv):
"""This Function Cancel Event Registration.
"""
registrations = self.browse(cr, uid, ids)
self._history(cr, uid, registrations, _('Cancel'))
self.history(cr, uid, registrations, _('Cancel'))
self.write(cr, uid, ids, {'state': 'cancel'})
return True
@ -606,7 +621,9 @@ class event_registration(osv.osv):
data_event = event_obj.browse(cr, uid, event_id)
res = {'value': {'unit_price': False, 'event_product': False, 'user_id': False,
'date': data_event.date_begin, 'date_deadline': data_event.date_end, 'description': data_event.note, 'name': data_event.name}}
'date': data_event.date_begin, 'date_deadline': data_event.date_end, 'description': data_event.note, 'name': data_event.name,
'section_id': data_event.section_id and data_event.section_id.id or False,
}}
if data_event.user_id.id:
res['value'].update({'user_id':data_event.user_id.id})
if data_event.product_id:
@ -615,6 +632,8 @@ class event_registration(osv.osv):
partner = res_obj.browse(cr, uid, partner_invoice_id, context=context)
pricelist_id = pricelist_id or partner.property_product_pricelist.id
unit_price = prod_obj._product_price(cr, uid, [data_event.product_id.id], False, False, {'pricelist': pricelist_id})[data_event.product_id.id]
if not unit_price:
unit_price = data_event.unit_price
res['value'].update({'unit_price': unit_price, 'event_product': data_event.product_id.name})
return res
@ -675,7 +694,10 @@ class event_registration(osv.osv):
if partner_invoice_id:
partner = res_obj.browse(cr, uid, partner_invoice_id, context=context)
pricelist_id = pricelist_id or partner.property_product_pricelist.id
data['unit_price'] = prod_obj._product_price(cr, uid, [data_event.product_id.id], False, False, {'pricelist': pricelist_id})[data_event.product_id.id]
unit_price = prod_obj._product_price(cr, uid, [data_event.product_id.id], False, False, {'pricelist': pricelist_id})[data_event.product_id.id]
if not unit_price:
unit_price = data_event.unit_price
data['unit_price'] = unit_price
return {'value': data}
event_registration()

View File

@ -131,21 +131,23 @@
<page string="Mailing">
<field name="reply_to" />
<newline/>
<group col="3" colspan="2" expand="1">
<separator string="Auto Registration Email" colspan="2"/>
<newline/>
<field name="mail_auto_registr"/>
<separator string="Registration Email Body" colspan="2"/>
<newline/>
<field name="mail_registr" colspan="2" nolabel="1" attrs="{'readonly':[('mail_auto_registr','=',False)]}"/>
</group>
<group col="2" colspan="2" >
<separator string="Auto Confirmation Email" colspan="2"/>
<field name="mail_auto_confirm"/>
<newline/>
<separator string="Confirmation Email Body" colspan="2"/>
<field name="mail_confirm" colspan="2" nolabel="1" attrs="{'readonly':[('mail_auto_confirm','=',False)]}"/>
<group col="4" colspan="4">
<group col="2" colspan="2">
<separator string="Auto Registration Email" colspan="4"/>
<field name="mail_auto_registr" colspan="4"/>
<group colspan="4" attrs="{'readonly':[('mail_auto_registr','=',False)]}">
<separator string="Registration Email Body" colspan="4"/>
<field name="mail_registr" colspan="4" nolabel="1" />
</group>
</group>
<group col="2" colspan="2">
<separator string="Auto Confirmation Email" colspan="4"/>
<field name="mail_auto_confirm" colspan="4"/>
<group colspan="4" attrs="{'readonly':[('mail_auto_confirm','=',False)]}">
<separator string="Confirmation Email Body" colspan="4"/>
<field name="mail_confirm" nolabel="1" colspan="4"/>
</group>
</group>
</group>
</page>
</notebook>
@ -330,9 +332,8 @@
</group>
<separator string="Description" colspan="4"/>
<field name="description" colspan="4" nolabel="1"/>
<group col="8" colspan="4">
<separator string="" colspan="4"/>
<newline/>
<separator string="" colspan="4"/>
<group col="8" colspan="4">
<field name="state" select="1" colspan="2"/>
<button name="button_reg_close" string="Close Registration" states="open" type="object" icon="gtk-close"/>
<button name="check_confirm" string="Confirm Registration" states="draft" type="object" icon="gtk-apply"/>

View File

@ -27,7 +27,8 @@
from osv import fields, osv
from tools.translate import _
import time
from datetime import date, datetime
class event_project(osv.osv_memory):
"""
Event Project
@ -36,23 +37,46 @@ class event_project(osv.osv_memory):
_description = "Event Project"
_columns = {
'project_id': fields.many2one('project.project', 'Template of Project', domain = [('active', '<>', False), ('state', '=', 'template')], required =True, help="This is Template Project. Project of event is a duplicate of this Template. After click on 'Create Retro-planning', New Project will be duplicated from this template project.")
'project_id': fields.many2one('project.project', 'Template of Project',
domain = [('active', '<>', False), ('state', '=', 'template')],
required =True,
help="This is Template Project. Project of event is a duplicate of this Template. After click on 'Create Retro-planning', New Project will be duplicated from this template project."),
'date_start': fields.date('Date Start'),
'date': fields.date('Date End'),
}
def default_get(self, cr, uid, fields, context=None):
"""
This function gets default values
@param fields: List of fields for default value
@param context: A standard dictionary for contextual values
@return : default values of fields.
"""
event_obj=self.pool.get('event.event')
project_obj = self.pool.get('project.project')
event = event_obj.browse(cr, uid, context.get('active_id', False))
res = super(event_project, self).default_get(cr, uid, fields, context=context)
if 'date_start' in fields:
res.update({'date_start': time.strftime('%Y-%m-%d')})
if 'date' in fields:
res.update({'date': datetime.strptime(event.date_end, "%Y-%m-%d %H:%M:%S").strftime("%Y-%m-%d")})
return res
def create_duplicate(self, cr, uid, ids, context):
event_obj=self.pool.get('event.event')
project_obj = self.pool.get('project.project')
event = event_obj.browse(cr, uid, context.get('active_id', False))
for current in self.browse(cr, uid, ids):
duplicate_project_id = project_obj.copy(cr, uid, current.project_id.id, {'active': True})
duplicate_project = project_obj.browse(cr, uid, duplicate_project_id, context)
project_obj.write(cr, uid, [duplicate_project_id], {
'name': duplicate_project.name ,
'date_start':time.strftime('%Y-%m-%d'),
'date': event.date_begin[0:10] })
for current in self.browse(cr, uid, ids):
duplicate_project_id = project_obj.copy(cr, uid, current.project_id.id, {
'active': True,
'date_start':current.date_start,
'date': current.date,
})
event_obj.write(cr, uid, [event.id], {'project_id': duplicate_project_id })
return {}
event_project()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -8,7 +8,9 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Retro-Planning">
<field name="project_id" />
<field name="project_id" colspan="4"/>
<field name="date_start"/>
<field name="date"/>
<separator string="" colspan="4"/>
<group colspan="4" col="6">
<button icon="gtk-close" special="cancel" string="Close"/>

View File

@ -72,6 +72,7 @@
<field name="res_model">hr.department</field>
<field name="view_type">form</field>
<field name="search_view_id" ref="view_department_filter"/>
<field name="help">Your Company's Departments Structure is used to manage all documents related to employees by departments: expenses and timesheet validation, leaves management, recruitements, etc.</field>
</record>
<menuitem action="open_module_tree_department" id="menu_department_def" parent="hr.menu_department_tree"/>

View File

@ -29,6 +29,8 @@
<field name="hr_contract"/>
<field name="hr_evaluation"/>
<field name="hr_attendance"/>
<field name="hr_payroll"/>
<field name="hr_payroll_account"/>
</group>
<xpath expr="//button[@string='Install Modules']" position="attributes">
<attribute name="string">Configure</attribute>

View File

@ -147,6 +147,7 @@
<field name="domain">[]</field>
<field name="view_id" ref="view_employee_tree"/>
<field name="search_view_id" ref="view_employee_filter"/>
<field name="help">The employee directory contains all data related to your employees: from their photo up to their hourly estimated costs for the timesheets. Employees are managed by departments and can be linked to users to manage their access rights.</field>
</record>
<menuitem action="open_view_employee_list_my" id="menu_open_view_employee_list_my" sequence="3" parent="menu_hr_main"/>
@ -386,6 +387,7 @@
<field name="res_model">hr.job</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="help">Job Positions are used to define the jobs, the requirements. You can attach a survey to a job position. This survey will be used in the recruitement process to evaluate the applicants for this job position.</field>
</record>
<menuitem name="Recruitment" id="base.menu_crm_case_job_req_main" parent="menu_hr_root"/>

View File

@ -46,6 +46,10 @@ class hr_installer(osv.osv_memory):
"performance review of employees."),
'hr_attendance': fields.boolean('Attendances (Sign In/Out)',
help="Simplifies the management of employee attendances."),
'hr_payroll': fields.boolean('Payroll' ,
help="Generic Payroll system"),
'hr_payroll_account': fields.boolean('Payroll with Accounting',
help="Generic Payroll system Integrated with Accountings."),
}
_defaults = {
'hr_holidays': True,

View File

@ -71,6 +71,7 @@
<field name="view_mode">tree,form</field>
<field name="context">{"search_default_employee":1}</field>
<field name="search_view_id" ref="view_hr_attendance_filter" />
<field name="help">Time Tracking functionality aims to manage employee's attendances on the basis of the actions (Sign in/Sign out) performed by them. You can also link this to an attndance machine using OpenERP's webservices features.</field>
</record>
<!--<menuitem id="menu_hr_attendance" name="Attendances" parent="hr.menu_hr_root"

View File

@ -43,6 +43,7 @@
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_hr_attendance_sigh_in_out"/>
<field name="target">new</field>
<field name="help">Sign in / Sign out. In some companies, staff have to sign in when they arrive at work and sign out again at the end of the day. If each employee has been linked to a system user, then they can encode their time with this action button.</field>
</record>
<menuitem action="action_hr_attendance_sigh_in_out" id="menu_hr_attendance_sigh_in_out"

View File

@ -256,10 +256,12 @@
</record>
<record model="ir.actions.act_window" id="open_view_hr_evaluation_tree">
<field name="name">Evaluation</field>
<field name="res_model">hr_evaluation.evaluation</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph</field>
<field name="search_view_id" ref="hr_evaluation.evaluation_search"/>
<field name="help">Each employee can be assigned to an evaluation plan. These plans define the frequency and the way you manage your periodic personnal evalautions. You will be able to define steps and attach interview forms to each step. OpenERP manages all kind of evaluations: bottom-up, top-down, self evaluation and final evaluation by the manager.</field>
</record>
<menuitem name="Evaluation" parent="menu_eval_hr" id="menu_open_view_hr_evaluation_tree"
@ -339,12 +341,14 @@
</record>
<record model="ir.actions.act_window" id="action_hr_evaluation_interview_tree">
<field name="name">Interview Requests</field>
<field name="res_model">hr.evaluation.interview</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('is_evaluation' ,'=', True)]</field>
<field name="context">{"search_default_todo":1,"search_default_user_id":uid}</field>
<field name="search_view_id" ref="view_hr_evaluation_interview_search"/>
<field name="help">Interview Requests are generated automatically by OpenERP according to employees evaluation plan. Each user receives automatic emails and requests to perform evaluation of their collegues periodically.</field>
</record>
<menuitem name="Interview Requests" parent="menu_eval_hr" id="menu_open_hr_evaluation_interview_requests"

View File

@ -158,6 +158,7 @@
<field name="view_type">form</field>
<field name="context">{"search_default_user_id":uid}</field>
<field name="search_view_id" ref="view_hr_expense_filter"/>
<field name="help">The OpenERP expenses management module allows you to track the full flow. Every month, the employees record their expenses. At the end of the month, their managers validates the expenses sheets which creates costs on projects/analytic accounts. The accountant validates the proposed entries and the employee can be reimbursed. You can also reinvoice the customer at the end of the flow.</field>
</record>
<menuitem id="next_id_49" name="Expenses" sequence="4" parent="hr.menu_hr_root"/>

View File

@ -253,6 +253,7 @@
<field name="domain">[('type','=','remove')]</field>
<field name="context">{'search_default_user_id':uid}</field>
<field name="search_view_id" ref="view_hr_holidays_filter"/>
<field name="help">Leaves requests can be recorded by employees and validated by their managers. Once a leave request is validated it appears automatically in the agenda of the employee. You can define several allowance types (paid holidays, sickness, etc) and manage allowances per type.</field>
</record>
<record model="ir.actions.act_window.view" id="action_open_ask_holidays_tree">

View File

@ -45,12 +45,13 @@ AVAILABLE_PRIORITIES = [
class hr_recruitment_stage(osv.osv):
""" Stage of HR Recruitment """
_name = "hr.recruitment.stage"
_description = "Stage of Recruitment"
_order = 'sequence'
_columns = {
'name': fields.char('Name', size=64, required=True, translate=True),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of stages."),
'department_id':fields.many2one('hr.department', 'Department'),
'requirements': fields.text('Requirements')
}
_defaults = {
@ -68,9 +69,6 @@ class hr_applicant(osv.osv, crm.crm_case):
'message_ids': fields.one2many('mailgate.message', 'res_id', 'Messages', domain=[('model','=',_name)]),
'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.'),
'email_from': fields.char('Email', size=128, help="These people will receive email."),
'email_cc': fields.text('Watchers Emails', size=252 , help="These email addresses will be added to the CC field of all inbound and outbound emails for this record before being sent. Separate multiple email addresses with a comma"),
'probability': fields.float('Probability'),
@ -79,12 +77,7 @@ 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 ('hr.recruitment.stage', 'Stage', \
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.opportunity')]"),
'stage_id': fields.many2one ('hr.recruitment.stage', 'Stage'),
'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\'.\
@ -103,7 +96,7 @@ class hr_applicant(osv.osv, crm.crm_case):
'partner_name': fields.char("Applicant's Name", size=64),
'partner_phone': fields.char('Phone', size=32),
'partner_mobile': fields.char('Mobile', size=32),
'type_id': fields.many2one('crm.case.resource.type', 'Degree', domain="[('section_id','=',section_id),('object_id.model', '=', 'hr.applicant')]"),
'type_id': fields.many2one('crm.case.resource.type', 'Degree', domain="[('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'),
@ -124,7 +117,6 @@ class hr_applicant(osv.osv, crm.crm_case):
# '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],
}
@ -148,9 +140,9 @@ class hr_applicant(osv.osv, crm.crm_case):
if not context:
context = {}
for case in self.browse(cr, uid, ids, context):
section = (case.section_id.id or False)
department = (case.department_id.id or False)
st = case.stage_id.id or False
stage_ids = self.pool.get('hr.recruitment.stage').search(cr, uid, [])
stage_ids = self.pool.get('hr.recruitment.stage').search(cr, uid, ['|',('department_id','=',department),('department_id','=',False)])
if st and stage_ids.index(st):
self.write(cr, uid, [case.id], {'stage_id': stage_ids[stage_ids.index(st)-1]})
return True
@ -166,9 +158,9 @@ class hr_applicant(osv.osv, crm.crm_case):
if not context:
context = {}
for case in self.browse(cr, uid, ids, context):
section = (case.section_id.id or False)
department = (case.department_id.id or False)
st = case.stage_id.id or False
stage_ids = self.pool.get('hr.recruitment.stage').search(cr, uid, [])
stage_ids = self.pool.get('hr.recruitment.stage').search(cr, uid, ['|',('department_id','=',department),('department_id','=',False)])
if st and len(stage_ids) != stage_ids.index(st)+1:
self.write(cr, uid, [case.id], {'stage_id': stage_ids[stage_ids.index(st)+1]})
return True
@ -204,7 +196,6 @@ class hr_applicant(osv.osv, crm.crm_case):
context = {
'default_opportunity_id': opp.id,
'default_partner_id': opp.partner_id and opp.partner_id.id or False,
'default_section_id': opp.section_id and opp.section_id.id or False,
'default_email_from': opp.email_from,
'default_state': 'open',
'default_name': opp.name
@ -374,7 +365,6 @@ class hr_job(osv.osv):
_columns = {
'survey_id': fields.many2one('survey', 'Survey'),
}
hr_job()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,16 +1,16 @@
<?xml version="1.0"?>
<openerp>
<data>
<menuitem
id="menu_hr_recruitment_recruitment"
name="Recruitment"
parent="hr.menu_hr_configuration"
sequence="2"/>
<menuitem
id="menu_hr_config_applicant"
name="Applicant"
parent="menu_hr_recruitment_recruitment"
sequence="2"/>
<menuitem
id="menu_hr_recruitment_recruitment"
name="Recruitment"
parent="hr.menu_hr_configuration"
sequence="2"/>
<menuitem
id="menu_hr_config_applicant"
name="Applicant"
parent="menu_hr_recruitment_recruitment"
sequence="2"/>
# ------------------------------------------------------
# Job Categories
@ -85,16 +85,15 @@
<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/>
<field name="department_id" widget="selection"/>
<group colspan="2" col="4">
<field name="stage_id"/>
<field name="stage_id" domain="[('department_id','=',department_id)]"/>
<button name="stage_previous" string="" type="object" icon="gtk-go-back"/>
<button icon="gtk-go-forward" string="" name="stage_next" type="object"/>
</group>
<field name="user_id"/>
<field name="department_id" widget="selection"/>
<button name="action_makeMeeting" type="object" string="Schedule Meeting" icon="terp-hr"/>
<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"/>
<field name="user_id"/>
<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">
@ -279,8 +278,9 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Stages">
<field name="sequence"/>
<field name="sequence" invisible="1"/>
<field name="name"/>
<field name="department_id"/>
</tree>
</field>
</record>
@ -293,9 +293,12 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Stage">
<separator string="Stage Definition" colspan="4"/>
<field name="name" select="1"/>
<field name="sequence"/>
<group colspan="4" col="6">
<separator string="Stage Definition" colspan="6"/>
<field name="name" select="1"/>
<field name="department_id"/>
<field name="sequence"/>
</group>
<separator string="Requirements" colspan="4"/>
<field name="requirements" nolabel="1" colspan="4"/>
</form>

View File

@ -46,8 +46,9 @@
<field name="res_model">hr.sign.in.project</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_hr_timesheet_sign_in_message"/>
<field name="target">new</field>
<field name="view_id" ref="view_hr_timesheet_sign_in_message"/>
<field name="target">new</field>
<field name="help">Employees can encode their time spent on the different projects. A project is an analytic account and the time spent on a project generate costs on the analytic account. This feature allows to record at the same time the attendance and the timesheet.</field>
</record>
<menuitem action="action_hr_timesheet_sign_in"

View File

@ -100,7 +100,6 @@ class StockMove(osv.osv):
'location_id': move.location_dest_id.id,
'auto_validate': True,
'picking_id': False,
'location_id': dest,
'state': 'waiting'
})
for m in procurement_obj.search(cr, uid, [('move_id','=',move.id)], context):