bzr revid: vir@tinyerp.com-20100728050959-szw5cit2d4ancsh4
This commit is contained in:
Vir (Open ERP) 2010-07-28 10:39:59 +05:30
commit 425e5b5faa
83 changed files with 2476 additions and 1440 deletions

View File

@ -79,7 +79,7 @@ module named account_vouchers
'wizard/account_invoice_state_view.xml',
'wizard/account_partner_balance_report_view.xml',
'wizard/account_balance_report_view.xml',
'wizard/account_move_line_select_view.xml',
# 'wizard/account_move_line_select_view.xml',
'wizard/account_aged_trial_balance_view.xml',
'wizard/account_compare_account_balance_report_view.xml',
'wizard/account_third_party_ledger.xml',
@ -127,7 +127,6 @@ module named account_vouchers
'board_account_demo.xml',
],
'test': [
'test/account_sequence_test.yml',
'test/account_customer_invoice.yml',
'test/account_supplier_invoice.yml',
'test/account_change_currency.yml',
@ -137,7 +136,7 @@ module named account_vouchers
'test/account_invoice_state.yml',
'test/account_use_model.yml',
'test/account_validate_account_move.yml',
# 'test/account_fiscalyear_close.yml',
'test/account_fiscalyear_close.yml',
],
'installable': True,
'active': False,

View File

@ -629,8 +629,8 @@ class account_journal(osv.osv):
'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, help="Company related to this journal"),
'invoice_sequence_id': fields.many2one('ir.sequence', 'Invoice Sequence', \
help="The sequence used for invoice numbers in this 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'),
}
@ -695,13 +695,13 @@ class account_journal(osv.osv):
'sequence_id':seq_id
})
if journal.type in journal_type and not journal.invoice_sequence_id:
res_ids = date_pool.search(cr, uid, [('model','=','ir.sequence'), ('name','=',journal_seq.get(journal.type, 'sale'))])
inv_seq_id = date_pool.browse(cr, uid, res_ids[0]).res_id
inv_seq_id
res.update({
'invoice_sequence_id':inv_seq_id
})
# if journal.type in journal_type and not journal.invoice_sequence_id:
# res_ids = date_pool.search(cr, uid, [('model','=','ir.sequence'), ('name','=',journal_seq.get(journal.type, 'sale'))])
# inv_seq_id = date_pool.browse(cr, uid, res_ids[0]).res_id
# inv_seq_id
# res.update({
# 'invoice_sequence_id':inv_seq_id
# })
result = self.write(cr, uid, [journal.id], res)

View File

@ -182,7 +182,7 @@ class account_cash_statement(osv.osv):
'pieces':rs,
'number':0
}
res.append(dct)
res.append((0,0,dct))
return res
_columns = {

View File

@ -400,7 +400,7 @@ class account_move_line(osv.osv):
'credit': fields.float('Credit', digits_compute=dp.get_precision('Account')),
'account_id': fields.many2one('account.account', 'Account', required=True, ondelete="cascade", domain=[('type','<>','view'), ('type', '<>', 'closed')], select=2),
'move_id': fields.many2one('account.move', 'Move', ondelete="cascade", states={'valid':[('readonly',True)]}, help="The move of this entry line.", select=2),
'narration': fields.related('move_id','narration', type='text', relation='account.move', string='Narration'),
'ref': fields.char('Ref.', size=64),
'statement_id': fields.many2one('account.bank.statement', 'Statement', help="The bank statement used for bank reconciliation", select=1),
'reconcile_id': fields.many2one('account.move.reconcile', 'Reconcile', readonly=True, ondelete='set null', select=2),

View File

@ -395,15 +395,14 @@
<field name="centralisation" groups="base.group_extended"/>
<field name="entry_posted"/>
</group>
<group colspan="2" col="2">
<separator string="Invoicing Data" colspan="4"/>
<field name="invoice_sequence_id" groups="base.group_extended"/>
<field name="group_invoice_lines"/>
</group>
<group colspan="2" col="2" groups="base.group_extended">
<separator string="Sequence" colspan="4"/>
<field name="sequence_id"/>
</group>
<group colspan="2" col="2">
<separator string="Invoicing Data" colspan="4"/>
<field name="group_invoice_lines"/>
</group>
</page>
<page string="Entry Controls" groups="base.group_extended">
<separator colspan="4" string="Accounts Type Allowed (empty for no control)"/>
@ -977,7 +976,8 @@
<separator colspan="2" string="Analytic"/>
<field name="analytic_account_id"/>
</group>
<separator string="Narration" colspan="4"/>
<field name="narration" colspan="4" nolabel="1"/>
</page>
<page string="Analytic Lines">
<field colspan="4" name="analytic_lines" nolabel="1" context="{'default_general_account_id':account_id, 'default_name': name, 'default_date':date, 'amount': (debit or 0.0)-(credit or 0.0)}"/>
@ -1055,22 +1055,27 @@
<search string="Search Entry Lines">
<group col='10' colspan='4'>
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Entry Lines"/>
<separator orientation="vertical"/>
<filter icon="terp-camera_test" string="Posted" domain="[('state','=','valid')]" help="Posted Entry Lines"/>
<filter icon="terp-stock_symbol-selection" string="Unposted" domain="[('move_id.state','=','draft')]" help="Unposted Entry Lines"/>
<separator orientation="vertical"/>
<filter icon="terp-stock_symbol-selection" string="Unposted" domain="[('move_id.state','=','draft')]" help="Unposted Entry Lines"/>
<filter icon="terp-stock_symbol-selection" string="Unreconciled" domain="[('reconcile_id','=',False), ('account_id.type','in',['receivable', 'payable'])]" help="Unreconciled Entry Lines"/>
<field name="date" select='1'/>
<separator orientation="vertical"/>
<field name="ref" select="1" string="Reference"/>
<field name="move_id" select="1" string="Number (Move)"/>
<field name="name" select="1"/>
<field name="account_id" select='1'/>
<field name="partner_id" select='1'>
<filter help="Next Partner Entries to reconcile" name="next_partner" string="Next Partner to reconcile" context="{'next_partner_only': 1}" icon="terp-partner" domain="[('account_id.reconcile','=',True),('reconcile_id','=',False)]"/>
</field>
<field name="balance" string="Debit/Credit" select='1'/>
</group>
<newline/>
<group col="10" colspan="4">
<field name="journal_id" required="1" widget="selection" context="{'journal_id':self, 'visible_id':self or 0, 'normal_view':False}"/>
<field name="period_id" required="1" widget="selection" context="{'period_id':self}"/>
<separator orientation="vertical"/>
<field name="narration" select="1"/>
<field name="date" select='1'/>
<field name="balance" string="Debit/Credit" select='1'/>
</group>
</search>
</field>
@ -1096,6 +1101,23 @@
<field name="search_view_id" ref="view_account_move_line_filter"/>
</record>
<record id="action_move_line_select" model="ir.actions.act_window">
<field name="name">Journal Items</field>
<field name="res_model">account.move.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_move_line_tree"/>
<field name="search_view_id" ref="view_account_move_line_filter"/>
<field name="domain">[('account_id', 'child_of', active_id)]</field>
</record>
<record id="ir_account_move_line_select" model="ir.values">
<field name="key2">tree_but_open</field>
<field name="model">account.account</field>
<field name="name">Open Journal Items</field>
<field eval="'ir.actions.act_window,%d'%action_move_line_select" name="value"/>
<field eval="True" name="object"/>
</record>
<!--
Account.Entry Edition
-->
@ -1152,28 +1174,75 @@
<page string="Journal Entries Lines">
<field colspan="4" name="line_id" nolabel="1" height="250" widget="one2many_list" default_get="{'lines':line_id ,'journal':journal_id }">
<form string="Account Entry Line">
<separator colspan="4" string="General Information"/>
<field name="name" select="1"/>
<field name="account_id" domain="[('journal_id','=',parent.journal_id)]"/>
<field name="partner_id" on_change="onchange_partner_id(False,partner_id,account_id,debit,credit,parent.date,parent.journal_id)"/>
<group col="6" colspan="4">
<field name="name" select="1"/>
<field name="ref"/>
<field name="partner_id" select="1" on_change="onchange_partner_id(False,partner_id,account_id,debit,credit,date)"/>
<field name="journal_id"/>
<field name="period_id"/>
<field name="company_id" required="1" groups="base.group_multi_company"/>
</group>
<notebook colspan="4">
<page string="Information">
<group col="2" colspan="2">
<separator colspan="2" string="Amount"/>
<field name="account_id" select="1" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<field name="debit"/>
<field name="credit"/>
<field name="quantity"/>
</group>
<group col="2" colspan="2">
<separator colspan="2" string="Accounting Documents"/>
<field name="invoice"/>
<field name="move_id" required="False"/>
<field name="statement_id"/>
</group>
<field name="debit" select="1"/>
<field name="credit" select="1"/>
<field name="date" select="1"/>
<group col="2" colspan="2">
<separator colspan="2" string="Dates"/>
<field name="date" select="1"/>
<field name="date_maturity"/>
<field name="date_created"/>
</group>
<group col="2" colspan="2">
<separator colspan="2" string="Taxes"/>
<field name="tax_code_id"/>
<field name="tax_amount"/>
<field name="account_tax_id" domain="[('parent_id','=',False)]"/>
</group>
<group col="2" colspan="2">
<separator colspan="2" string="Currency"/>
<field name="currency_id"/>
<field name="amount_currency"/>
</group>
<separator colspan="4" string="Optional Information"/>
<field name="currency_id"/>
<field name="amount_currency"/>
<field name="quantity" select="1"/>
<newline/>
<field name="date_maturity"/>
<field name="date_created"/>
<group col="2" colspan="2">
<separator colspan="2" string="Reconciliation"/>
<field name="reconcile_id"/>
<field name="reconcile_partial_id"/>
</group>
<separator colspan="4" string="State"/>
<field name="reconcile_id"/>
<field name="reconcile_partial_id"/>
<field name="statement_id"/>
<field name="state"/>
<group col="2" colspan="2">
<separator colspan="2" string="States"/>
<field name="state"/>
<field name="blocked"/>
</group>
<group col="2" colspan="2">
<separator colspan="2" string="Analytic"/>
<field name="analytic_account_id"/>
</group>
<separator string="Narration" colspan="4"/>
<field name="narration" colspan="4" nolabel="1"/>
</page>
<page string="Analytic Lines">
<field colspan="4" name="analytic_lines" nolabel="1" context="{'default_general_account_id':account_id, 'default_name': name, 'default_date':date, 'amount': (debit or 0.0)-(credit or 0.0)}"/>
</page>
</notebook>
</form>
<tree colors="blue:state in ('draft');black:state in ('posted')" editable="top" string="Account Entry Line">
<field name="ref"/>
@ -1217,11 +1286,13 @@
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Entries"/>
<filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Entries"/>
<separator orientation="vertical"/>
<filter icon="terp-camera_test" string="To Review" domain="[('to_check','=',True)]" groups="base.group_extended" help="To Review"/>
<filter icon="terp-stock_effects-object-colorize" string="To Review" domain="[('to_check','=',True)]" groups="base.group_extended" help="To Review"/>
<separator orientation="vertical"/>
<field name="date" select='1'/>
<field name="name" select='1'/>
<field name="partner_id" select='1'/>
<field name="ref" select="1"/>
<field name="name" select="1"/>
<field name="partner_id" select='1'/>
<field name="date" select='1'/>
<field name="narration" select="1"/>
</group>
<newline/>
<group col='8' colspan='4'>
@ -1828,7 +1899,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_move_line_tax_tree"/>
<field name="domain">[('tax_code_id','=',active_id),('state','&lt;&gt;','draft')]</field>
<field name="domain">[('tax_code_id','child_of',active_id),('state','&lt;&gt;','draft')]</field>
</record>
<record id="ir_open_tax_move_line" model="ir.values">
<field name="key2">tree_but_open</field>

File diff suppressed because it is too large Load Diff

View File

@ -219,7 +219,7 @@ class account_invoice(osv.osv):
_name = "account.invoice"
_description = 'Invoice'
_order = "number"
_order = "id"
_columns = {
'name': fields.char('Description', size=64, select=True, readonly=True, states={'draft':[('readonly',False)]}),
@ -231,7 +231,8 @@ class account_invoice(osv.osv):
('in_refund','Supplier Refund'),
],'Type', readonly=True, select=True, change_default=True),
'number': fields.char('Invoice Number', size=32, readonly=True, help="Unique number of the invoice, computed automatically when the invoice is created."),
'number': fields.related('move_id','name', type='char', readonly=True, size=64, relation='account.move', store=True, string='Number'),
#'number': fields.char('Invoice Number', size=32, readonly=True, help="Unique number of the invoice, computed automatically when the invoice is created."),
'reference': fields.char('Invoice Reference', size=64, help="The partner reference of this invoice."),
'reference_type': fields.selection(_get_reference_type, 'Reference Type',
required=True, readonly=True, states={'draft':[('readonly',False)]}),
@ -768,8 +769,8 @@ class account_invoice(osv.osv):
cur_obj = self.pool.get('res.currency')
context = {}
for inv in self.browse(cr, uid, ids):
if not inv.journal_id.invoice_sequence_id:
raise osv.except_osv(_('Error !'), _('Please define invoice sequence on invoice journal'))
if not inv.journal_id.sequence_id:
raise osv.except_osv(_('Error !'), _('Please define sequence on invoice journal'))
if not inv.invoice_line:
raise osv.except_osv(_('No Invoice Lines !'), _('Please create some invoice lines.'))
if inv.move_id:
@ -875,7 +876,14 @@ class account_invoice(osv.osv):
line = self.finalize_invoice_move_lines(cr, uid, inv, line)
move = {'ref': inv.number, 'line_id': line, 'journal_id': journal_id, 'date': date, 'type': entry_type}
move = {
'ref': inv.number,
'line_id': line,
'journal_id': journal_id,
'date': date,
'type': entry_type,
'narration':inv.comment
}
period_id=inv.period_id and inv.period_id.id or False
if not period_id:
period_ids= self.pool.get('account.period').search(cr, uid, [('date_start','<=',inv.date_invoice or time.strftime('%Y-%m-%d')),('date_stop','>=',inv.date_invoice or time.strftime('%Y-%m-%d'))])
@ -919,44 +927,32 @@ class account_invoice(osv.osv):
}
def action_number(self, cr, uid, ids, *args):
#TODO: not correct fix but required a frech values before reading it.
self.write(cr, uid, ids, {})
for obj_inv in self.browse(cr, uid, ids):
id = obj_inv.id
invtype = obj_inv.type
number = obj_inv.number
move_id = obj_inv.move_id and obj_inv.move_id.id or False
reference = obj_inv.reference or ''
if not number:
tmp_context = {
'fiscalyear_id': obj_inv.period_id.fiscalyear_id.id
}
if obj_inv.journal_id.invoice_sequence_id:
sequence_id = obj_inv.journal_id.invoice_sequence_id.id
number = self.pool.get('ir.sequence').get_id(cr, uid,
sequence_id,
'id',
context=tmp_context)
else:
number = self.pool.get('ir.sequence').get_id(cr, uid,
'account.invoice.%s' % invtype,
'code',
context=tmp_context)
if invtype in ('in_invoice', 'in_refund'):
ref = reference
else:
ref = self._convert_ref(cr, uid, number)
cr.execute('UPDATE account_invoice SET number=%s ' \
'WHERE id=%s', (number, id))
cr.execute('UPDATE account_move SET ref=%s ' \
'WHERE id=%s AND (ref is null OR ref = \'\')',
if invtype in ('in_invoice', 'in_refund'):
ref = reference
else:
ref = self._convert_ref(cr, uid, number)
cr.execute('UPDATE account_move SET ref=%s ' \
'WHERE id=%s AND (ref is null OR ref = \'\')',
(ref, move_id))
cr.execute('UPDATE account_move_line SET ref=%s ' \
'WHERE move_id=%s AND (ref is null OR ref = \'\')',
(ref, move_id))
cr.execute('UPDATE account_analytic_line SET ref=%s ' \
'FROM account_move_line ' \
'WHERE account_move_line.move_id = %s ' \
'AND account_analytic_line.move_id = account_move_line.id',
(ref, move_id))
cr.execute('UPDATE account_move_line SET ref=%s ' \
'WHERE move_id=%s AND (ref is null OR ref = \'\')',
(ref, move_id))
cr.execute('UPDATE account_analytic_line SET ref=%s ' \
'FROM account_move_line ' \
'WHERE account_move_line.move_id = %s ' \
'AND account_analytic_line.move_id = account_move_line.id',
(ref, move_id))
for inv_id, name in self.name_get(cr, uid, [id]):
message = _('Invoice ') + " '" + name + "' "+ _("is validated.")
self.log(cr, uid, inv_id, message)

View File

@ -2,7 +2,7 @@
<openerp>
<data noupdate="1">
<record id="analytic_root" model="account.analytic.account">
<field name="name">Analytic Chart</field>
<field name="name" model="res.company" use="name" search="[('id', '=', 1)]"/>
<field name="code">0</field>
</record>
<record id="analytic_absences" model="account.analytic.account">

View File

@ -23,25 +23,25 @@
<field name="model">account.analytic.account</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Analytic Account">
<group col="8" colspan="4">
<filter icon="terp-check" string="Current" domain="[('state','=','open')]" help="Current Accounts"/>
<filter icon="terp-gtk-media-pause" string="Pending" domain="[('state','=','pending')]" help="Pending Accounts"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="partner_id" select="1"/>
<field name="user_id" widget="selection"/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Parent" icon="terp-folder-orange" domain="[]" context="{'group_by':'parent_id'}"/>
<filter string="Type" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'type'}"/>
<separator orientation="vertical"/>
<filter string="Associated Partner" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Manager" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<search string="Analytic Account">
<group col="8" colspan="4">
<filter icon="terp-check" string="Current" domain="[('state','=','open')]" help="Current Accounts"/>
<filter icon="terp-gtk-media-pause" string="Pending" domain="[('state','=','pending')]" help="Pending Accounts"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="partner_id" select="1"/>
<field name="user_id" widget="selection"/>
</group>
</search>
<newline/>
<group expand="0" string="Group By...">
<filter string="Parent" icon="terp-folder-orange" domain="[]" context="{'group_by':'parent_id'}"/>
<filter string="Type" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'type'}"/>
<separator orientation="vertical"/>
<filter string="Associated Partner" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Manager" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
</group>
</search>
</field>
</record>
@ -54,17 +54,17 @@
<tree toolbar="True" colors="red:(date&lt;=current_date);black:(date&gt;current_date)" string="Analytic account">
<field name="name"/>
<field name="code"/>
<field name="date"/>
<field name="company_currency_id"/>
<field name="debit"/>
<field name="credit"/>
<field name="balance"/>
<field name="quantity"/>
<field name="quantity_max"/>
<field name="parent_id" invisible="1"/>
<field name="type" invisible="1"/>
<field name="partner_id" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="company_currency_id"/>
<!-- <field name="date"/>-->
<!-- <field name="debit"/>-->
<!-- <field name="credit"/>-->
<!-- <field name="quantity"/>-->
<!-- <field name="quantity_max"/>-->
<!-- <field name="parent_id" invisible="1"/>-->
<!-- <field name="type" invisible="1"/>-->
<!-- <field name="partner_id" invisible="1"/>-->
<!-- <field name="user_id" invisible="1"/>-->
</tree>
</field>
</record>
@ -109,13 +109,13 @@
<field name="view_type">form</field>
<field name="view_mode">tree,graph,form</field>
<field name="view_id" ref="view_account_analytic_account_tree"/>
<field name="context">{"search_default_user_id":uid}</field>
<field name="context">{"search_default_user_id":uid}</field>
<field name="search_view_id" ref="account.view_account_analytic_account_search"/>
</record>
<!--<menuitem id="menu_analytic_account" name="Analytic Accounts" parent="account.menu_analytic_accounting"/>-->
<menuitem action="action_account_analytic_account_form" id="account_analytic_def_account" parent="menu_analytic"/>
<record id="act_account_renew_view" model="ir.actions.act_window">
<record id="act_account_renew_view" model="ir.actions.act_window">
<field name="name">Accounts to Renew</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.analytic.account</field>
@ -141,7 +141,7 @@
<!-- parent="account_analytic_def_account"/>-->
<!-- <menuitem action="action_account_analytic_account_tree2" id="account_analytic_chart" parent="account.menu_finance_charts"/>-->
<!-- <wizard id="wizard_analytic_account_chart" menu="False" model="account.analytic.account" name="account.analytic.account.chart" string="Analytic Chart of Accounts"/>
<!-- <wizard id="wizard_analytic_account_chart" menu="False" model="account.analytic.account" name="account.analytic.account.chart" string="Analytic Chart of Accounts"/>
<menuitem icon="STOCK_INDENT" action="wizard_analytic_account_chart" id="menu_action_analytic_account_tree2" parent="account.menu_finance_charts" type="wizard"/>-->
<menuitem id="next_id_40" name="Analytic" parent="account.menu_finance_generic_reporting" sequence="4"/>
@ -200,22 +200,26 @@
<field name="model">account.analytic.line</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Analytic Lines">
<group col='6' colspan='4'>
<search string="Search Analytic Lines">
<group col='6' colspan='4'>
<field name="name" select="1"/>
<field name="journal_id" select="1"/>
<field name="account_id" select="1"/>
<field name="amount" select="1"/>
<field name="date" select="1"/>
<field name="user_id" widget="selection"/>
</group>
<newline/>
<group string="Group By..." expand="0">
<filter string="General Account" context="{'group_by':'general_account_id'}"/>
<filter string="Analytic Account" context="{'group_by':'account_id'}"/>
<filter string="Analytic Journal" context="{'group_by':'journal_id'}"/>
<filter string="Product" context="{'group_by':'product_id'}"/>
</group>
</search>
</group>
<newline/>
<group col='6' colspan='4'>
<field name="journal_id" select="1" widget="selection"/>
</group>
<newline/>
<group string="Group By..." expand="0">
<filter string="General Account" context="{'group_by':'general_account_id'}"/>
<filter string="Analytic Account" context="{'group_by':'account_id'}"/>
<filter string="Analytic Journal" context="{'group_by':'journal_id'}"/>
<filter string="Product" context="{'group_by':'product_id'}"/>
</group>
</search>
</field>
</record>
<record id="action_account_analytic_line_form" model="ir.actions.act_window">
@ -298,16 +302,16 @@
</field>
</record>
<record id="view_analytic_journal_search" model="ir.ui.view">
<record id="view_analytic_journal_search" model="ir.ui.view">
<field name="name">account.analytic.journal.search</field>
<field name="model">account.analytic.journal</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="analytic Journals">
<group expand="0" string="Group By...">
<search string="analytic Journals">
<group expand="0" string="Group By...">
<filter string="Type" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'type'}"/>
</group>
</search>
</search>
</field>
</record>
@ -446,14 +450,14 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Analytic Entries Stats">
<group col="8" colspan="4">
<filter icon="terp-go-year" string="This Year" domain="[('name','=',time.strftime('%%Y'))]" help="Sale journal in this year"/>
<filter icon="terp-go-month" string="This Month" domain="[('month','=',time.strftime('%%m'))]" help="Sale journal in this month"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="month" select="1"/>
<field name="account_id" select="1"/>
</group>
<group col="8" colspan="4">
<filter icon="terp-go-year" string="This Year" domain="[('name','=',time.strftime('%%Y'))]" help="Sale journal in this year"/>
<filter icon="terp-go-month" string="This Month" domain="[('month','=',time.strftime('%%m'))]" help="Sale journal in this month"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="month" select="1"/>
<field name="account_id" select="1"/>
</group>
</search>
</field>
</record>

View File

@ -186,7 +186,7 @@
<para style="terp_default_9"><font color="white">[[ '. '*(a['level']-1) ]]</font><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) ]][[ a['name'] ]]</font></para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ a['balance'] and formatLang(abs(a['balance'])) or 0.0 ]]</para>
<para style="terp_default_Right_9_Bold">[[ a['balance'] and formatLang(get_abs(a['balance'])) or 0.0 ]]</para>
</td>
</tr>
</blockTable>
@ -196,7 +196,7 @@
<para style="terp_default_Bold_9">Balance:([[ get_currency(data['form']) ]])</para>
</td>
<td>
<para style="terp_default_Right_9_Bold"><u>[[ sum_dr() and formatLang(sum_dr()) or 0.0 ]]</u></para>
<para style="terp_default_Right_9_Bold"><u>[[ sum_dr() and formatLang(get_abs(sum_dr())) or 0.0 ]]</u></para>
</td>
</tr>
</blockTable>
@ -221,10 +221,10 @@
<para style="terp_default_9"><font face="Times-Roman">[[ repeatIn(get_lines_another('asset'), 'a') ]]</font>[[ a['code'] ]]<font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) ]]</font></para>
</td>
<td>
<para style="terp_default_9">[[ a['code'] ]]<font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) ]][[ a['name'] ]]</font></para>
<para style="terp_default_9"><font color="white">[[ '. '*(a['level']-1) ]]</font><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) ]][[ a['name'] ]]</font></para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ a['balance'] and formatLang(abs(a['balance'])) or 0.0 ]]</para>
<para style="terp_default_Right_9_Bold">[[ a['balance'] and formatLang(get_abs(a['balance'])) or 0.0 ]]</para>
</td>
</tr>
</blockTable>
@ -234,7 +234,7 @@
<para style="terp_default_Bold_9">Balance:([[ get_currency(data['form']) ]])</para>
</td>
<td>
<para style="terp_default_Right_9_Bold"><u>[[ sum_cr() and formatLang(sum_cr()) or 0.0 ]]</u></para>
<para style="terp_default_Right_9_Bold"><u>[[ sum_cr() and formatLang(get_abs(sum_cr())) or 0.0 ]]</u></para>
</td>
</tr>
</blockTable>

View File

@ -197,7 +197,7 @@
<para style="terp_default_9"><font color="white">[[ '. '*(a['level']-1) ]]</font><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) ]][[ a['name'] ]]</font></para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ a['balance'] and formatLang(abs(a['balance'])) or 0.0 ]]</para>
<para style="terp_default_Right_9_Bold">[[ a['balance'] and formatLang(get_abs(a['balance'])) or 0.0 ]]</para>
</td>
<td>
<para style="terp_default_9"><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) ]]</font><font>[[ a['code1'] ]]</font></para>
@ -206,7 +206,7 @@
<para style="terp_default_9"><font color="white">[[ '. '*(a['level1']-1) ]]</font><font>[[ a['level1']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) ]][[ a['name1'] ]]</font></para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ a['balance1'] and formatLang(abs(a['balance1'])) or 0.0 ]]</para>
<para style="terp_default_Right_9_Bold">[[ a['balance1'] and formatLang(get_abs(a['balance1'])) or 0.0 ]]</para>
</td>
</tr>
</blockTable>
@ -216,13 +216,13 @@
<para style="terp_default_Bold_9">Balance:([[ get_currency(data['form']) ]])</para>
</td>
<td>
<para style="terp_default_Right_9_Bold"><u>[[ sum_dr() and formatLang(abs(sum_dr())) or 0.0 ]]</u></para>
<para style="terp_default_Right_9_Bold"><u>[[ sum_dr() and formatLang(get_abs(sum_dr())) or 0.0 ]]</u></para>
</td>
<td>
<para style="terp_default_Bold_9">Balance:([[ get_currency(data['form']) ]])</para>
</td>
<td>
<para style="terp_default_Right_9_Bold"><u>[[ sum_cr() and formatLang(abs(sum_cr())) or 0.0 ]]</u></para>
<para style="terp_default_Right_9_Bold"><u>[[ sum_cr() and formatLang(get_abs(sum_cr())) or 0.0 ]]</u></para>
</td>
</tr>
</blockTable>

View File

@ -37,6 +37,7 @@ class report_balancesheet_horizontal(rml_parse.rml_parse):
self.result_temp=[]
self.localcontext.update({
'time': time,
'get_abs' : self.get_abs,
'get_lines' : self.get_lines,
'get_lines_another' : self.get_lines_another,
'get_company': self.get_company,
@ -48,6 +49,9 @@ class report_balancesheet_horizontal(rml_parse.rml_parse):
})
self.context = context
def get_abs(self,amount):
return abs(amount)
def sum_dr(self):
if self.res_pl['type'] == 'Net Profit':

View File

@ -35,6 +35,7 @@ class report_pl_account_horizontal(rml_parse.rml_parse):
self.result_temp=[]
self.localcontext.update( {
'time': time,
'get_abs' : self.get_abs,
'get_lines' : self.get_lines,
'get_lines_another' : self.get_lines_another,
'get_company': self.get_company,
@ -45,7 +46,10 @@ class report_pl_account_horizontal(rml_parse.rml_parse):
'final_result' : self.final_result,
})
self.context = context
def get_abs(self,amount):
return abs(amount)
def final_result(self):
return self.res_pl

View File

@ -201,7 +201,7 @@
</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ a.balance and formatLang(abs(a.balance)) or 0.0 ]]</para>
<para style="terp_default_Right_9_Bold">[[ a.balance and formatLang(get_abs(a.balance)) or 0.0 ]]</para>
</td>
</tr>
</blockTable>
@ -214,7 +214,7 @@
<para style="terp_default_Bold_9">[[ final_result()['type'] == 'Net Profit C.F.B.L.' and final_result()['type'] or removeParentNode('blockTable') ]]</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Profit C.F.B.L.' and formatLang(abs(final_result()['balance'])) or 0.0 ]]</para>
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Profit C.F.B.L.' and formatLang(get_abs(final_result()['balance'])) or 0.0 ]]</para>
</td>
</tr>
</blockTable>
@ -224,7 +224,7 @@
<para style="terp_default_Bold_9">Total:([[ get_currency(data['form']) ]])</para>
</td>
<td>
<para style="terp_default_Right_9_Bold"><u>[[ sum_dr() and formatLang(abs(sum_dr())) or 0.0 ]]</u></para>
<para style="terp_default_Right_9_Bold"><u>[[ sum_dr() and formatLang(get_abs(sum_dr())) or 0.0 ]]</u></para>
</td>
</tr>
</blockTable>
@ -256,7 +256,7 @@
</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ a.balance and formatLang(abs(a.balance)) or 0.0 ]]</para>
<para style="terp_default_Right_9_Bold">[[ a.balance and formatLang(get_abs(a.balance)) or 0.0 ]]</para>
</td>
</tr>
</blockTable>
@ -269,7 +269,7 @@
<para style="terp_default_Bold_9">[[ final_result()['type'] == 'Net Loss C.F.B.L.' and final_result()['type'] or removeParentNode('blockTable') ]]</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Loss C.F.B.L.' and formatLang(abs(final_result()['balance'])) or 0.0 ]]</para>
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Loss C.F.B.L.' and formatLang(get_abs(final_result()['balance'])) or 0.0 ]]</para>
</td>
</tr>
</blockTable>
@ -279,7 +279,7 @@
<para style="terp_default_Bold_9">Total:([[ get_currency(data['form']) ]])</para>
</td>
<td>
<para style="terp_default_Right_9_Bold"><u>[[ sum_cr() and formatLang(abs(sum_cr())) or 0.0 ]]</u></para>
<para style="terp_default_Right_9_Bold"><u>[[ sum_cr() and formatLang(get_abs(sum_cr())) or 0.0 ]]</u></para>
</td>
</tr>
</blockTable>

View File

@ -214,7 +214,7 @@
</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ a['balance'] and formatLang(abs(a['balance'])) or 0.0 ]]</para>
<para style="terp_default_Right_9_Bold">[[ a['balance'] and formatLang(get_abs(a['balance'])) or 0.0 ]]</para>
</td>
<td>
<para style="terp_default_9">
@ -227,7 +227,7 @@
</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ a['balance1'] and formatLang(abs(a['balance1'])) or 0.0 ]]</para>
<para style="terp_default_Right_9_Bold">[[ a['balance1'] and formatLang(get_abs(a['balance1'])) or 0.0 ]]</para>
</td>
</tr>
</blockTable>
@ -240,7 +240,7 @@
<para style="terp_default_Bold_9">[[ final_result()['type'] == 'Net Profit C.F.B.L.' and final_result()['type'] or '' ]]</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Profit C.F.B.L.' and formatLang(abs(final_result()['balance'])) or 0.0 ]]</para>
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Profit C.F.B.L.' and formatLang(get_abs(final_result()['balance'])) or 0.0 ]]</para>
</td>
<td>
<para style="terp_default_Bold_9"></para>
@ -249,7 +249,7 @@
<para style="terp_default_Bold_9">[[ final_result()['type'] == 'Net Loss C.F.B.L.' and final_result()['type'] or '' ]]</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Loss C.F.B.L.' and formatLang(abs(final_result()['balance'])) or 0.0 ]]</para>
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Loss C.F.B.L.' and formatLang(get_abs(final_result()['balance'])) or 0.0 ]]</para>
</td>
</tr>
</blockTable>
@ -260,13 +260,13 @@
<para style="terp_default_Bold_9">Total:([[ get_currency(data['form']) ]])</para>
</td>
<td>
<para style="terp_default_Right_9_Bold"><u>[[ sum_dr() and formatLang(abs(sum_dr())) or 0.0 ]]</u></para>
<para style="terp_default_Right_9_Bold"><u>[[ sum_dr() and formatLang(get_abs(sum_dr())) or 0.0 ]]</u></para>
</td>
<td>
<para style="terp_default_Bold_9">Total:([[ get_currency(data['form']) ]])</para>
</td>
<td>
<para style="terp_default_Right_9_Bold"><u>[[ sum_cr() and formatLang(abs(sum_cr())) or 0.0 ]]</u></para>
<para style="terp_default_Right_9_Bold"><u>[[ sum_cr() and formatLang(get_abs(sum_cr())) or 0.0 ]]</u></para>
</td>
</tr>
</blockTable>

View File

@ -62,6 +62,7 @@
"access_account_fiscalyear","account.fiscalyear","model_account_fiscalyear","account.group_account_manager",1,1,1,1
"access_account_fiscalyear_user","account.fiscalyear.user","model_account_fiscalyear","account.group_account_user",1,0,0,0
"access_account_fiscalyear_invoice","account.fiscalyear.invoice","model_account_fiscalyear","account.group_account_invoice",1,0,0,0
"access_account_fiscalyear_partner_manager","account.fiscalyear.partnermanager","model_account_fiscalyear","base.group_partner_manager",1,0,0,0
"access_res_currency_account_manager","res.currency account manager","base.model_res_currency","group_account_manager",1,1,1,1
"access_res_currency_rate_account_manager","res.currency.rate account manager","base.model_res_currency_rate","group_account_manager",1,1,1,1
"access_account_invoice_user","account.invoice user","model_account_invoice","base.group_user",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
62 access_account_fiscalyear account.fiscalyear model_account_fiscalyear account.group_account_manager 1 1 1 1
63 access_account_fiscalyear_user account.fiscalyear.user model_account_fiscalyear account.group_account_user 1 0 0 0
64 access_account_fiscalyear_invoice account.fiscalyear.invoice model_account_fiscalyear account.group_account_invoice 1 0 0 0
65 access_account_fiscalyear_partner_manager account.fiscalyear.partnermanager model_account_fiscalyear base.group_partner_manager 1 0 0 0
66 access_res_currency_account_manager res.currency account manager base.model_res_currency group_account_manager 1 1 1 1
67 access_res_currency_rate_account_manager res.currency.rate account manager base.model_res_currency_rate group_account_manager 1 1 1 1
68 access_account_invoice_user account.invoice user model_account_invoice base.group_user 1 0 0 0

View File

@ -45,7 +45,9 @@ import account_open_closed_fiscalyear
import account_compare_account_balance_report
import account_invoice_state
import account_chart
import account_move_line_select
#TODO: remove this file no moe used
# also remove related view fiel
#import account_move_line_select
import account_validate_account_move
import account_use_model

View File

@ -114,14 +114,12 @@ class account_bs_report(osv.osv_memory):
'type': 'ir.actions.report.xml',
'report_name': 'account.balancesheet.horizontal',
'datas': data,
'nodestroy':True,
}
else:
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.balancesheet',
'datas': data,
'nodestroy':True,
}
def _check_date(self, cr, uid, data, context=None):

View File

@ -7,12 +7,12 @@
<field name="model">account.move.line.select</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Account Select">
<label string="Are you sure you want to open Account move line entries!" colspan="4"/>
<separator string="" colspan="4" />
<form string="Account Select">
<label string="Are you sure you want to open Account move line entries!" colspan="4"/>
<separator string="" colspan="4" />
<group colspan="4" col="6">
<button icon="terp-gtk-stop" special="cancel" string="Cancel"/>
<button icon="terp-gtk-go-back-rtl" string="Open Entries" name="open_window" type="object" default_focus="1"/>
<button icon="terp-gtk-stop" special="cancel" string="Cancel"/>
<button icon="terp-gtk-go-back-rtl" string="Open Entries" name="open_window" type="object" default_focus="1"/>
</group>
</form>
</field>
@ -27,13 +27,13 @@
<field name="target">new</field>
</record>
<record id="ir_account_move_line_select" model="ir.values">
<field name="key2">tree_but_open</field>
<field name="model">account.account</field>
<field name="name">Open Account</field>
<field eval="'ir.actions.act_window,%d'%action_account_move_line_select_button" name="value"/>
<field eval="True" name="object"/>
</record>
<!-- <record id="ir_account_move_line_select" model="ir.values">-->
<!-- <field name="key2">tree_but_open</field>-->
<!-- <field name="model">account.account</field>-->
<!-- <field name="name">Open Account</field>-->
<!-- <field eval="'ir.actions.act_window,%d'%action_account_move_line_select_button" name="value"/>-->
<!-- <field eval="True" name="object"/>-->
<!-- </record>-->
</data>
</openerp>

View File

@ -111,14 +111,12 @@ class account_pl_report(osv.osv_memory):
'type': 'ir.actions.report.xml',
'report_name': 'pl.account.horizontal',
'datas': data,
'nodestroy':True,
}
else:
return {
'type': 'ir.actions.report.xml',
'report_name': 'pl.account',
'datas': data,
'nodestroy':True,
}
def _check_date(self, cr, uid, data, context=None):

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-03-12 23:52+0000\n"
"Last-Translator: Emerson <Unknown>\n"
"PO-Revision-Date: 2010-07-27 20:25+0000\n"
"Last-Translator: Leandro Chaves <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-22 04:10+0000\n"
"X-Launchpad-Export-Date: 2010-07-28 03:47+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_analytic_plans
@ -136,7 +136,7 @@ msgstr "Selecione Informação"
#. module: account_analytic_plans
#: field:account.analytic.plan.instance,account3_ids:0
msgid "Account3 Id"
msgstr ""
msgstr "ID Conta3"
#. module: account_analytic_plans
#: field:account.analytic.plan.instance,journal_id:0
@ -157,27 +157,27 @@ msgstr "Ref. Conta Analítica"
#. module: account_analytic_plans
#: rml:account.analytic.account.crossovered.analytic:0
msgid "Analytic Account :"
msgstr ""
msgstr "Conta Analítica:"
#. module: account_analytic_plans
#: view:account.analytic.plan.line:0
msgid "Analytic Plan Line"
msgstr ""
msgstr "Linha do Plano Analítico"
#. module: account_analytic_plans
#: rml:account.analytic.account.crossovered.analytic:0
msgid "Analytic Account Reference:"
msgstr ""
msgstr "Conta Analítica Referencia"
#. module: account_analytic_plans
#: model:ir.actions.wizard,name:account_analytic_plans.create_model
msgid "Create Model"
msgstr ""
msgstr "Criar Modelo"
#. module: account_analytic_plans
#: field:account.analytic.plan,default_instance_id:0
msgid "Default Entries"
msgstr ""
msgstr "Lançamentos padrões"
#. module: account_analytic_plans
#: view:account.analytic.plan:0
@ -185,32 +185,32 @@ msgstr ""
#: field:account.journal,plan_id:0
#: model:ir.model,name:account_analytic_plans.model_account_analytic_plan
msgid "Analytic Plans"
msgstr ""
msgstr "Planos Analíticos"
#. module: account_analytic_plans
#: field:account.analytic.plan.line,min_required:0
msgid "Minimum Allowed (%)"
msgstr ""
msgstr "Mínimo Permitido (%)"
#. module: account_analytic_plans
#: field:account.analytic.plan.instance,account1_ids:0
msgid "Account1 Id"
msgstr ""
msgstr "Id Conta1"
#. module: account_analytic_plans
#: field:account.analytic.plan.line,max_required:0
msgid "Maximum Allowed (%)"
msgstr ""
msgstr "Máximo Permitido (%)"
#. module: account_analytic_plans
#: wizard_view:create.model,info:0
msgid "Distribution Model Saved"
msgstr ""
msgstr "Modelo de Distribuição Arquivado (Salvo)"
#. module: account_analytic_plans
#: model:ir.model,name:account_analytic_plans.model_account_analytic_plan_instance
msgid "Analytic Plan Instance"
msgstr ""
msgstr "Instância do Plano Analítico"
#. module: account_analytic_plans
#: constraint:ir.ui.view:0
@ -220,7 +220,7 @@ msgstr "Invalido XML para Arquitetura da View"
#. module: account_analytic_plans
#: model:ir.actions.act_window,name:account_analytic_plans.account_analytic_instance_model_open
msgid "Distribution Models"
msgstr ""
msgstr "Modelos de Distribuição"
#. module: account_analytic_plans
#: model:ir.module.module,description:account_analytic_plans.module_meta_information
@ -256,17 +256,47 @@ msgid ""
"for one account entry.\n"
" "
msgstr ""
"Este modelo permite o uso de vários planos analíticos, de acordo com o "
"diário geral,\n"
"de forma que várias linhas analíticas são criadas quando a fatura ou "
"lançamento\n"
"são confirmadas.\n"
"\n"
"Por exemplo, você pode definir a seguinte estrutura analítica:\n"
" Projetos\n"
" Projeto 1\n"
" SubProj 1.1\n"
" SubProj 1.2\n"
" Projeto 2\n"
" Vendedor\n"
" Erico\n"
" Fabiano\n"
"\n"
"No exemplo temos dois planos: Projetos e Vendedores. Uma fatura deve\n"
"ser capaz de escrever lançamentos analíticos nos 2 planos: SubProj 1.1 e\n"
"Fabiano. A conta também pode ser separada. O exemplo a seguir é para\n"
"uma fatura que envolve os 2 subprojetos e está associada a um vendedor:\n"
"\n"
"Plano1:\n"
" SubProjeto 1.1: 50%\n"
" SubProjeto 1.2: 50%\n"
"Plano2:\n"
" Eric: 100%\n"
"\n"
"Quando esta linha da fatura for confirmada, ela vai gerar 3 linhas\n"
"analíticas, para um lançamento na conta,\n"
" "
#. module: account_analytic_plans
#: model:ir.module.module,shortdesc:account_analytic_plans.module_meta_information
msgid "Multiple-plans management in Analytic Accounting"
msgstr ""
msgstr "Múltiplos-planos gerenciados na Contabilidade Analítica"
#. module: account_analytic_plans
#: view:account.analytic.plan.line:0
#: model:ir.model,name:account_analytic_plans.model_account_analytic_plan_line
msgid "Analytic Plan Lines"
msgstr ""
msgstr "Linhas do Plano Analítico"
#. module: account_analytic_plans
#: rml:account.analytic.account.crossovered.analytic:0
@ -276,68 +306,69 @@ msgstr ""
#. module: account_analytic_plans
#: field:account.analytic.plan.instance,plan_id:0
msgid "Model's Plan"
msgstr ""
msgstr "Plano do Modelo"
#. module: account_analytic_plans
#: field:account.analytic.plan.instance,account2_ids:0
msgid "Account2 Id"
msgstr ""
msgstr "Id Conta2"
#. module: account_analytic_plans
#: rml:account.analytic.account.crossovered.analytic:0
msgid "Amount"
msgstr ""
msgstr "Valor"
#. module: account_analytic_plans
#: help:account.analytic.plan.line,root_analytic_id:0
msgid "Root account of this plan."
msgstr ""
msgstr "Conta raiz para este plano."
#. module: account_analytic_plans
#: field:account.analytic.plan.instance,account6_ids:0
msgid "Account6 Id"
msgstr ""
msgstr "Id Conta6"
#. module: account_analytic_plans
#: rml:account.analytic.account.crossovered.analytic:0
msgid "Quantity"
msgstr ""
msgstr "Quantidade"
#. module: account_analytic_plans
#: field:account.analytic.plan.instance,account_ids:0
msgid "Account Id"
msgstr ""
msgstr "Id Conta"
#. module: account_analytic_plans
#: rml:account.analytic.account.crossovered.analytic:0
msgid "Code"
msgstr ""
msgstr "Código"
#. module: account_analytic_plans
#: wizard_button:create.model,info,end:0
msgid "OK"
msgstr ""
msgstr "OK"
#. module: account_analytic_plans
#: field:account.analytic.plan.line,root_analytic_id:0
msgid "Root Account"
msgstr ""
msgstr "Conta Raiz"
#. module: account_analytic_plans
#: wizard_view:create.model,info:0
msgid ""
"This distribution model has been saved. You will be able to reuse it later."
msgstr ""
"Este modelo de distribuição foi salvo. Você poderá reutilizá-lo mais tarde."
#. module: account_analytic_plans
#: field:account.analytic.plan.line,sequence:0
msgid "Sequence"
msgstr ""
msgstr "Sequência"
#. module: account_analytic_plans
#: field:account.analytic.plan.instance.line,analytic_account_id:0
msgid "Analytic Account"
msgstr ""
msgstr "Conta analítica"
#. module: account_analytic_plans
#: field:account.analytic.default,analytics_id:0
@ -346,29 +377,29 @@ msgstr ""
#: field:account.invoice.line,analytics_id:0
#: field:account.move.line,analytics_id:0
msgid "Analytic Distribution"
msgstr ""
msgstr "Distribuição Analítica"
#. module: account_analytic_plans
#: model:ir.ui.menu,name:account_analytic_plans.menu_account_analytic_plan_instance_action
msgid "Analytic Distribution's models"
msgstr ""
msgstr "Modelos de Distribuição Analítica"
#. module: account_analytic_plans
#: wizard_button:wizard.crossovered.analytic,init,end:0
msgid "Cancel"
msgstr ""
msgstr "Cancelar"
#. module: account_analytic_plans
#: wizard_field:wizard.crossovered.analytic,init,date1:0
msgid "Start Date"
msgstr ""
msgstr "Data de Início"
#. module: account_analytic_plans
#: rml:account.analytic.account.crossovered.analytic:0
msgid "at"
msgstr ""
msgstr "em"
#. module: account_analytic_plans
#: rml:account.analytic.account.crossovered.analytic:0
msgid "From Date"
msgstr ""
msgstr "Data Inicial"

View File

@ -7,19 +7,19 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2009-09-08 16:30+0000\n"
"Last-Translator: Pedro_Maschio <pedro.bicudo@tgtconsult.com.br>\n"
"PO-Revision-Date: 2010-07-27 20:39+0000\n"
"Last-Translator: Leandro Chaves <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-22 04:18+0000\n"
"X-Launchpad-Export-Date: 2010-07-28 03:47+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_budget
#: field:crossovered.budget,creating_user_id:0
msgid "Responsible User"
msgstr ""
msgstr "Usuário responsável"
#. module: account_budget
#: rml:account.budget:0
@ -30,28 +30,28 @@ msgstr "% desempenho"
#: model:ir.actions.act_window,name:account_budget.open_budget_post_form
#: model:ir.ui.menu,name:account_budget.menu_budget_post_form
msgid "Budgetary Positions"
msgstr ""
msgstr "Posições Orçamentárias"
#. module: account_budget
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr ""
msgstr "Nome de modelo inválido na definição da ação"
#. module: account_budget
#: rml:account.analytic.account.budget:0
#: rml:crossovered.budget.report:0
msgid "Printed at:"
msgstr ""
msgstr "Impresso em:"
#. module: account_budget
#: view:crossovered.budget:0
msgid "Confirm"
msgstr ""
msgstr "confirmar"
#. module: account_budget
#: field:crossovered.budget,validating_user_id:0
msgid "Validate User"
msgstr ""
msgstr "Validar usuário"
#. module: account_budget
#: constraint:ir.model:0
@ -64,12 +64,12 @@ msgstr ""
#. module: account_budget
#: selection:crossovered.budget,state:0
msgid "Confirmed"
msgstr ""
msgstr "Confirmado"
#. module: account_budget
#: field:account.budget.post.dotation,period_id:0
msgid "Period"
msgstr ""
msgstr "Período"
#. module: account_budget
#: wizard_field:account.budget.report,init,date2:0
@ -77,61 +77,61 @@ msgstr ""
#: wizard_field:wizard.crossovered.budget,init,date_to:0
#: wizard_field:wizard.crossovered.budget.summary,init,date_to:0
msgid "End of period"
msgstr ""
msgstr "Fim do período"
#. module: account_budget
#: rml:account.budget:0
msgid "Printing date:"
msgstr ""
msgstr "Data de impressão:"
#. module: account_budget
#: selection:crossovered.budget,state:0
msgid "Draft"
msgstr ""
msgstr "Provisório"
#. module: account_budget
#: rml:account.analytic.account.budget:0
#: rml:account.budget:0
#: rml:crossovered.budget.report:0
msgid "at"
msgstr ""
msgstr "em"
#. module: account_budget
#: view:account.budget.post:0
msgid "Dotations"
msgstr ""
msgstr "Dotações"
#. module: account_budget
#: rml:account.budget:0
msgid "Performance"
msgstr ""
msgstr "Desempenho"
#. module: account_budget
#: rml:account.analytic.account.budget:0
#: rml:account.budget:0
#: rml:crossovered.budget.report:0
msgid "Currency:"
msgstr ""
msgstr "Moeda:"
#. module: account_budget
#: rml:account.budget:0
msgid "From"
msgstr ""
msgstr "De"
#. module: account_budget
#: field:crossovered.budget.lines,percentage:0
msgid "Percentage"
msgstr ""
msgstr "Porcentagem"
#. module: account_budget
#: rml:account.budget:0
msgid "Results"
msgstr ""
msgstr "Resultados"
#. module: account_budget
#: field:crossovered.budget,state:0
msgid "Status"
msgstr ""
msgstr "Estado"
#. module: account_budget
#: model:ir.module.module,description:account_budget.module_meta_information
@ -162,23 +162,46 @@ msgid ""
"Budgets per Budgets.\n"
"\n"
msgstr ""
"Este módulo permite um gerenciamento de orçamentos analíticos e cruzamento "
"com outros módulos.\n"
"\n"
"Uma vez definido o Orçamento Principal e Orçamentos acessórios (em "
"Finanças/Gerenciamento/Orçamento/), os Gerentes de Projeto podem marcar o "
"montante planejado em cada Conta Analítica.\n"
"\n"
"O contador tem a possibilidade de ver o montante total planejado por cada "
"Orçamento (Principal e Acessório) para poder se assegurar de que o total "
"planejado não é maior ou menor do que o planejado para esse Orçamento. Cada "
"lista de registros poderá ser alternada para o modo gráfico. \n"
"\n"
"Três relatórios estão disponíveis:\n"
"\n"
"1. O primeiro está disponível na Lista de Orçamentos. Este demonstra a "
"alocação, para os Orçamentos, das Contas Analíticas por Orçamento "
"Principal.\n"
"2. O segundo é um resumo do primeiro. Somente demonstra a alocação, para os "
"Orçamentos selecionados, das Contas Analíticas.\n"
"3. O último está disponível no Plano de Contas Analítico. Demonstra a "
"alocação, para as Contas selecionadas, do Orçamento Principal, por "
"Orçamento.\n"
"\n"
#. module: account_budget
#: rml:account.budget:0
#: rml:crossovered.budget.report:0
msgid "%"
msgstr ""
msgstr "%"
#. module: account_budget
#: rml:account.analytic.account.budget:0
#: rml:crossovered.budget.report:0
msgid "Description"
msgstr ""
msgstr "Descrição"
#. module: account_budget
#: rml:account.analytic.account.budget:0
msgid "Analytic Account :"
msgstr ""
msgstr "Conta Analítica:"
#. module: account_budget
#: wizard_button:account.budget.report,init,report:0
@ -186,12 +209,12 @@ msgstr ""
#: wizard_button:wizard.crossovered.budget,init,report:0
#: wizard_button:wizard.crossovered.budget.summary,init,report:0
msgid "Print"
msgstr ""
msgstr "Imprimir"
#. module: account_budget
#: rml:account.budget:0
msgid "A/c No."
msgstr ""
msgstr "No.Cta."
#. module: account_budget
#: rml:account.analytic.account.budget:0
@ -205,60 +228,60 @@ msgstr "para"
#: rml:account.budget:0
#: rml:crossovered.budget.report:0
msgid "Total :"
msgstr ""
msgstr "Total :"
#. module: account_budget
#: rml:account.analytic.account.budget:0
#: field:crossovered.budget.lines,planned_amount:0
#: rml:crossovered.budget.report:0
msgid "Planned Amount"
msgstr ""
msgstr "Valor Planejado"
#. module: account_budget
#: rml:account.analytic.account.budget:0
#: rml:crossovered.budget.report:0
msgid "Perc(%)"
msgstr ""
msgstr "Perc(%)"
#. module: account_budget
#: rml:account.budget:0
msgid "Period Budget"
msgstr ""
msgstr "Orçamento do Período"
#. module: account_budget
#: rml:account.budget:0
msgid "Budget Analysis"
msgstr ""
msgstr "Análise do Orçamento"
#. module: account_budget
#: view:crossovered.budget:0
#: selection:crossovered.budget,state:0
msgid "Done"
msgstr ""
msgstr "Completo"
#. module: account_budget
#: view:crossovered.budget:0
msgid "Validate"
msgstr ""
msgstr "Validar"
#. module: account_budget
#: wizard_view:wizard.crossovered.budget,init:0
#: wizard_view:wizard.crossovered.budget.summary,init:0
msgid "Select Options"
msgstr ""
msgstr "Selecione Opções"
#. module: account_budget
#: rml:account.analytic.account.budget:0
#: field:crossovered.budget.lines,practical_amount:0
#: rml:crossovered.budget.report:0
msgid "Practical Amount"
msgstr ""
msgstr "Valor Real"
#. module: account_budget
#: field:crossovered.budget,date_to:0
#: field:crossovered.budget.lines,date_to:0
msgid "End Date"
msgstr ""
msgstr "Data Final"
#. module: account_budget
#: constraint:ir.ui.view:0
@ -268,7 +291,7 @@ msgstr "Invalido XML para Arquitetura da View"
#. module: account_budget
#: field:crossovered.budget.lines,theoritical_amount:0
msgid "Theoritical Amount"
msgstr ""
msgstr "Valor Estimado"
#. module: account_budget
#: field:account.budget.post,name:0
@ -280,18 +303,18 @@ msgstr "Nome"
#. module: account_budget
#: model:ir.actions.wizard,name:account_budget.wizard_crossovered_budget_menu_1
msgid "Print Summary of Budgets"
msgstr ""
msgstr "Imprimir Resumo dos Orçamentos"
#. module: account_budget
#: model:ir.actions.wizard,name:account_budget.wizard_budget_spread
msgid "Spread amount"
msgstr ""
msgstr "Valor Alocado"
#. module: account_budget
#: view:account.analytic.account:0
#: view:account.budget.post:0
msgid "Lines"
msgstr ""
msgstr "Linhas"
#. module: account_budget
#: rml:account.budget:0
@ -302,58 +325,58 @@ msgstr ""
#: model:ir.model,name:account_budget.model_crossovered_budget
#: model:ir.ui.menu,name:account_budget.menu_act_crossovered_budget_view
msgid "Budget"
msgstr ""
msgstr "Orçamento"
#. module: account_budget
#: field:account.budget.post.dotation,post_id:0
msgid "Item"
msgstr ""
msgstr "Item"
#. module: account_budget
#: field:account.budget.post.dotation,amount:0
#: wizard_field:account.budget.spread,init,amount:0
msgid "Amount"
msgstr ""
msgstr "Valor"
#. module: account_budget
#: field:crossovered.budget.lines,paid_date:0
msgid "Paid Date"
msgstr ""
msgstr "Data do Pagamento"
#. module: account_budget
#: model:ir.actions.act_window,name:account_budget.action_account_budget_post_tree
#: model:ir.ui.menu,name:account_budget.menu_action_account_budget_post_tree
#: model:ir.ui.menu,name:account_budget.next_id_31
msgid "Budgets"
msgstr ""
msgstr "Orçamentos"
#. module: account_budget
#: selection:crossovered.budget,state:0
msgid "Cancelled"
msgstr ""
msgstr "Cancelado"
#. module: account_budget
#: view:account.budget.post.dotation:0
#: model:ir.model,name:account_budget.model_account_budget_post_dotation
msgid "Budget Dotation"
msgstr ""
msgstr "Dotação Orçamentária"
#. module: account_budget
#: view:account.budget.post.dotation:0
msgid "Budget Dotations"
msgstr ""
msgstr "Dotações Orçamentárias"
#. module: account_budget
#: rml:account.budget:0
msgid "Budget Item Detail"
msgstr ""
msgstr "Detalhe do Item do Orçamento"
#. module: account_budget
#: view:account.budget.post:0
#: field:crossovered.budget.lines,general_budget_id:0
#: model:ir.model,name:account_budget.model_account_budget_post
msgid "Budgetary Position"
msgstr ""
msgstr "Posição Orçamentária"
#. module: account_budget
#: wizard_field:account.budget.report,init,date1:0
@ -361,7 +384,7 @@ msgstr ""
#: wizard_field:wizard.crossovered.budget,init,date_from:0
#: wizard_field:wizard.crossovered.budget.summary,init,date_from:0
msgid "Start of period"
msgstr ""
msgstr "Início do período"
#. module: account_budget
#: model:ir.actions.report.xml,name:account_budget.account_analytic_account_budget
@ -369,49 +392,49 @@ msgstr ""
#: model:ir.actions.wizard,name:account_budget.account_analytic_account_budget_report
#: model:ir.actions.wizard,name:account_budget.wizard_crossovered_budget_menu
msgid "Print Budgets"
msgstr ""
msgstr "Imprimir Orçamentos"
#. module: account_budget
#: field:account.budget.post,code:0
#: field:crossovered.budget,code:0
msgid "Code"
msgstr ""
msgstr "Código"
#. module: account_budget
#: field:account.budget.post.dotation,tot_planned:0
msgid "Total Planned Amount"
msgstr ""
msgstr "Valor Total Planejado"
#. module: account_budget
#: wizard_view:wizard.analytic.account.budget.report,init:0
msgid "Select Dates Period"
msgstr ""
msgstr "Selecione as Datas do Período"
#. module: account_budget
#: field:account.budget.post,dotation_ids:0
msgid "Spreading"
msgstr ""
msgstr "Alocação"
#. module: account_budget
#: rml:account.analytic.account.budget:0
#: rml:crossovered.budget.report:0
msgid "Theoretical Amount"
msgstr ""
msgstr "Valor Planejado"
#. module: account_budget
#: wizard_field:account.budget.spread,init,fiscalyear:0
msgid "Fiscal Year"
msgstr ""
msgstr "Ano Fiscal"
#. module: account_budget
#: field:crossovered.budget.lines,analytic_account_id:0
msgid "Analytic Account"
msgstr ""
msgstr "Conta Analítica"
#. module: account_budget
#: rml:crossovered.budget.report:0
msgid "Budget :"
msgstr ""
msgstr "Orçamento:"
#. module: account_budget
#: rml:account.budget:0
@ -419,18 +442,18 @@ msgstr ""
#: wizard_view:account.budget.spread,init:0
#: wizard_button:account.budget.spread,init,spread:0
msgid "Spread"
msgstr ""
msgstr "Alocação"
#. module: account_budget
#: view:account.budget.post:0
#: field:account.budget.post,account_ids:0
msgid "Accounts"
msgstr ""
msgstr "Contas"
#. module: account_budget
#: model:ir.actions.report.xml,name:account_budget.account_budget
msgid "Print Budget"
msgstr ""
msgstr "Imprimir Orçamento"
#. module: account_budget
#: view:account.analytic.account:0
@ -445,7 +468,7 @@ msgstr ""
#: model:ir.model,name:account_budget.model_crossovered_budget_lines
#: model:ir.ui.menu,name:account_budget.menu_act_crossovered_budget_lines_view
msgid "Budget Lines"
msgstr ""
msgstr "Linhas do Orçamento"
#. module: account_budget
#: wizard_button:account.budget.report,init,end:0
@ -455,31 +478,31 @@ msgstr ""
#: wizard_button:wizard.crossovered.budget,init,end:0
#: wizard_button:wizard.crossovered.budget.summary,init,end:0
msgid "Cancel"
msgstr ""
msgstr "Cancelar"
#. module: account_budget
#: model:ir.module.module,shortdesc:account_budget.module_meta_information
msgid "Budget Management"
msgstr ""
msgstr "Administração do Orçamento"
#. module: account_budget
#: field:crossovered.budget,date_from:0
#: field:crossovered.budget.lines,date_from:0
msgid "Start Date"
msgstr ""
msgstr "Data de Início"
#. module: account_budget
#: rml:account.analytic.account.budget:0
#: rml:crossovered.budget.report:0
msgid "Analysis from"
msgstr ""
msgstr "Análise de"
#. module: account_budget
#: selection:crossovered.budget,state:0
msgid "Validated"
msgstr ""
msgstr "Validado"
#. module: account_budget
#: wizard_view:account.budget.report,init:0
msgid "Select period"
msgstr ""
msgstr "Selecione período"

View File

@ -88,7 +88,7 @@ class payment_order_create(osv.osv_memory):
'date': date_to_pay,
'currency': line.invoice and line.invoice.currency_id.id or False,
}, context=context)
return {'nodestroy':True,}
return {}
def search_entries(self, cr, uid, ids, context=None):
order_obj = self.pool.get('payment.order')

View File

@ -25,41 +25,44 @@ from osv import fields, osv
class base_contact_installer(osv.osv_memory):
_name = 'base.contact.installer'
_inherit = 'res.config.installer'
_columns = {
'name': fields.char('Name', size=64),
'migrate': fields.boolean('Migrate', help="If you select this, all addresses will be migrated."),
'name': fields.char('Name', size=64),
'migrate': fields.boolean('Migrate', help="If you select this, all addresses will be migrated."),
'nomigrate': fields.boolean('NoMigrate', help="If you select this, all addresses will be not migrated."),
}
def execute(self, cr, uid, ids, context=None):
"""
This function is used to create contact and address from existing partner address
This function is used to create contact and address from existing partner address
"""
cr.execute("""DROP TRIGGER IF EXISTS contactjob on res_partner_contact;
DROP LANGUAGE IF EXISTS plpgsql CASCADE;
CREATE LANGUAGE plpgsql ;
CREATE OR REPLACE FUNCTION add_to_job() RETURNS TRIGGER AS $contactjob$
DECLARE
new_name varchar;
new_phonenum varchar;
BEGIN
IF(TG_OP='INSERT') THEN
INSERT INTO res_partner_job(contact_id, address_id, function, state) VALUES(NEW.id, NEW.website::integer,NEW.first_name, 'current');
UPDATE res_partner_contact set first_name=Null, website=Null, active=True where id=NEW.id;
END IF;
RETURN NEW;
END;
$contactjob$ LANGUAGE plpgsql;
CREATE TRIGGER contactjob AFTER INSERT ON res_partner_contact FOR EACH ROW EXECUTE PROCEDURE add_to_job();""")
cr.commit()
obj = self.pool.get("base.contact.installer").browse(cr, uid, uid)
if obj.migrate:
cr.execute("""DROP TRIGGER IF EXISTS contactjob on res_partner_contact;
DROP LANGUAGE IF EXISTS plpgsql CASCADE;
CREATE LANGUAGE plpgsql ;
CREATE OR REPLACE FUNCTION add_to_job() RETURNS TRIGGER AS $contactjob$
DECLARE
new_name varchar;
new_phonenum varchar;
BEGIN
IF(TG_OP='INSERT') THEN
INSERT INTO res_partner_job(contact_id, address_id, function, state) VALUES(NEW.id, NEW.website::integer,NEW.first_name, 'current');
UPDATE res_partner_contact set first_name=Null, website=Null, active=True where id=NEW.id;
END IF;
RETURN NEW;
END;
$contactjob$ LANGUAGE plpgsql;
CREATE TRIGGER contactjob AFTER INSERT ON res_partner_contact FOR EACH ROW EXECUTE PROCEDURE add_to_job();""")
cr.commit()
cr.execute("INSERT into res_partner_contact (name, title, email, first_name, website) (SELECT coalesce(name, 'Noname'), title, email, function , to_char(id, '99999999') from res_partner_address)")
cr.commit()
cr.execute("INSERT into res_partner_contact (name, title, email, first_name, website) (SELECT coalesce(name, 'Noname'), title, email, function , to_char(id, '99999999') from res_partner_address)")
cr.commit()
cr.execute("DROP TRIGGER IF EXISTS contactjob on res_partner_contact")
cr.execute("DROP LANGUAGE IF EXISTS plpgsql CASCADE;")
cr.execute("DROP FUNCTION IF EXISTS add_to_job()")
cr.commit()
cr.execute("DROP TRIGGER IF EXISTS contactjob on res_partner_contact")
cr.execute("DROP LANGUAGE IF EXISTS plpgsql CASCADE;")
cr.execute("DROP FUNCTION IF EXISTS add_to_job()")
cr.commit()
base_contact_installer()

View File

@ -23,14 +23,18 @@
<attribute name='string'></attribute>
</xpath>
<xpath expr="//button[@string='Install Modules']" position="attributes">
<attribute name="string">Migrate</attribute>
<attribute name="string">Configure</attribute>
</xpath>
<group colspan="8">
<group colspan="2" col="2">
<label string="Due to changes in Address and Partner's relation, some of the details from address are needed to migrated into contact information." colspan="4"/>
<label string="Otherwise these details will not be visible from address/contact." colspan="4"/>
<label string="Do you want to migrate your Address data in Contact Data?" colspan="4" />
<field name="migrate" string="Yes/No" />
<group colspan="6">
<label string="Migrate:" colspan="1"/>
<field name="migrate" string="Yes" colspan="1"/>
<field name="nomigrate" string="No" colspan="1"/>
</group>
</group>
</group>
</data>

View File

@ -7,25 +7,25 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Setup">
<group colspan="4" col="8">
<group colspan="3" width="220">
<field name="config_logo" widget="image" width="220" height="130" nolabel="1" colspan="1"/>
<newline/>
<label align="0.0" string="You can start configuring the system or connect directly to the database as an administrator." width="200" colspan="2"/>
</group>
<separator string="" position="vertical" colspan="1" rowspan="8"/>
<group colspan="4" width="400">
<separator string="Installation Done" colspan="4"/>
<label align="0.0" string="Your database is now created." colspan="4"/>
<field name="installed_users" nolabel= "1" colspan="4"/>
</group>
</group>
<group colspan="8" col="8">
<separator string="" colspan="8"/>
<label string="" colspan="6"/>
<button name="menu" icon="gtk-ok" type="object" string="Use Directly" colspan="1"/>
<button name="config" icon="gtk-go-forward" type="object" string="Start Configuration" colspan="1"/>
</group>
<group colspan="4" col="8">
<group colspan="3" width="220">
<field name="config_logo" widget="image" width="220" height="130" nolabel="1" colspan="1"/>
<newline/>
<label align="0.0" string="You can start configuring the system or connect directly to the database as an administrator." width="200" colspan="2"/>
</group>
<separator string="" orientation="vertical" colspan="1" rowspan="8"/>
<group colspan="4" width="400">
<separator string="Installation Done" colspan="4"/>
<label align="0.0" string="Your database is now created." colspan="4"/>
<field name="installed_users" nolabel= "1" colspan="4"/>
</group>
</group>
<group colspan="8" col="8">
<separator string="" colspan="8"/>
<label string="" colspan="6"/>
<button name="menu" icon="gtk-ok" type="object" string="Use Directly" colspan="1"/>
<button name="config" icon="gtk-go-forward" type="object" string="Start Configuration" colspan="1"/>
</group>
</form>
</field>
</record>

View File

@ -11,7 +11,7 @@
<attribute name="string">Main Company Setup</attribute>
</form>
<xpath expr="//label[@string='description']" position="attributes">
<attribute name="string">Information of your company will be used to custiomise your documents like Invoices, Sale Orders and many more.</attribute>
<attribute name="string">Information of your company will be used to customize your documents like Invoices, Sale Orders and many more.</attribute>
</xpath>
<xpath expr='//separator[@string="title"]' position='attributes'>
<attribute name='string'>Configure Your Company</attribute>

View File

@ -8,7 +8,7 @@
<field name="arch" type="xml">
<data>
<form position="attributes">
<attribute name="string">CRM Modules Installation</attribute>
<attribute name="string">CRM Modules Configuration</attribute>
</form>
<separator string="title" position="attributes">

View File

@ -177,7 +177,7 @@ class crm_send_new_email(osv.osv_memory):
if 'email_from' in fields:
res.update({'email_from': user_mail_from and tools.ustr(user_mail_from) or ''})
if 'reply_to' in fields:
res.update({'reply_to': case.section_id.reply_to})
res.update({'reply_to': case.section_id and case.section_id.reply_to or False})
if 'subject' in fields:
res.update({'subject': tools.ustr(context.get('subject', case.name) or '')})
if 'email_cc' in fields:

View File

@ -68,6 +68,8 @@ class email_template_send_wizard(osv.osv_memory):
return template
def _get_template_value(self, cr, uid, field, context=None):
if context is None:
context = {}
template = self._get_template(cr, uid, context)
if not template:
return False
@ -119,6 +121,8 @@ class email_template_send_wizard(osv.osv_memory):
}
def fields_get(self, cr, uid, fields=None, context=None, write_access=True):
if context is None:
context = {}
result = super(email_template_send_wizard, self).fields_get(cr, uid, fields, context, write_access)
if 'attachment_ids' in result and 'src_model' in context:
result['attachment_ids']['domain'] = [('res_model','=',context['src_model']),('res_id','=',context['active_id'])]
@ -165,6 +169,8 @@ class email_template_send_wizard(osv.osv_memory):
else:
return value
if context is None:
context = {}
mail_ids = []
template = self._get_template(cr, uid, context)
for id in context['src_rec_ids']:

View File

@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2009-11-17 07:25+0000\n"
"PO-Revision-Date: 2010-07-27 18:36+0000\n"
"Last-Translator: Henrique Fernandes Monteiro <henriquefiles@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-06-22 03:53+0000\n"
"X-Launchpad-Export-Date: 2010-07-28 03:46+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: google_map
@ -24,7 +24,7 @@ msgstr "Executar o Google Map"
#. module: google_map
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "Invalido XML para Arquitetura da View"
msgstr "XML inválido para a arquitetura de exibição"
#. module: google_map
#: view:res.partner:0
@ -40,7 +40,8 @@ msgid ""
"url widget."
msgstr ""
"O módulo adiciona um campo Google Map no endereço do parceiro\n"
"de modo que possamos abrir o Google Maps diretamente da URL do widget."
"de modo que possamos abrir o Google Maps diretamente da\n"
"URL do widget."
#. module: google_map
#: view:res.partner:0

View File

@ -10,7 +10,7 @@
<field name="arch" type="xml">
<data>
<form position="attributes">
<attribute name="string">Select Human Resources Modules To Install</attribute>
<attribute name="string">Human Resources Modules Configuration</attribute>
</form>
<separator string="title" position="attributes">
<attribute name="string">Select Human Resources Modules To Install</attribute>

View File

@ -4,10 +4,9 @@
<menuitem id="menu_hr_root" icon="terp-hr" name="Human Resources" sequence="15"/>
<menuitem id="menu_hr_main" parent="menu_hr_root" name="Human Resources" sequence="0"/>
<menuitem id="menu_hr_configuration" name="Configuration" parent="hr.menu_hr_root" groups="group_hr_manager" sequence="50" />
<menuitem id="menu_hr_management" name="Human Resources" parent="hr.menu_hr_configuration" groups="group_hr_manager" sequence="1" />
<menuitem id="menu_view_employee_category_configuration_form" parent="hr.menu_hr_management" name="Employees"
sequence="1"/>
<menuitem id="menu_hr_configuration" name="Configuration" parent="hr.menu_hr_root" groups="group_hr_manager" sequence="50"/>
<menuitem id="menu_hr_management" name="Human Resources" parent="hr.menu_hr_configuration" groups="group_hr_manager" sequence="1"/>
<menuitem id="menu_view_employee_category_configuration_form" parent="hr.menu_hr_management" name="Employees" sequence="1"/>
<!--
==========

View File

@ -48,7 +48,7 @@ class hr_installer(osv.osv_memory):
help="Simplifies the management of employee attendances."),
'hr_payroll': fields.boolean('Payroll',
help="Generic Payroll system"),
'hr_payroll_account': fields.boolean('Payroll',
'hr_payroll_account': fields.boolean('Payroll Accounting',
help="Generic Payroll system Integrated with Accountings."),
}
_defaults = {

View File

@ -74,8 +74,6 @@
<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"
groups="group_hr_attendance"/>-->
<menuitem id="menu_hr_time_tracking" name="Time Tracking" parent="hr.menu_hr_root" sequence="3"/>
<menuitem action="open_view_attendance" id="menu_open_view_attendance" parent="menu_hr_time_tracking" groups="hr.group_hr_manager" sequence="3"/>

View File

@ -104,18 +104,22 @@ class hr_employee(osv.osv):
}
def run_employee_evaluation(self, cr, uid, automatic=False, use_new_cursor=False, context=None):
obj_evaluation = self.pool.get('hr_evaluation.evaluation')
if context is None:
context = {}
for id in self.browse(cr, uid, self.search(cr, uid, [], context=context), context=context):
if id.evaluation_plan_id and id.evaluation_date:
if (dt.ISO.ParseAny(id.evaluation_date) + dt.RelativeDateTime(months = int(id.evaluation_plan_id.month_next))).strftime('%Y-%m-%d') <= time.strftime("%Y-%m-%d"):
self.write(cr, uid, id.id, {'evaluation_date' : (dt.ISO.ParseAny(id.evaluation_date) + dt.RelativeDateTime(months =+ int(id.evaluation_plan_id.month_next))).strftime('%Y-%m-%d')}, context=context)
self.pool.get("hr_evaluation.evaluation").create(cr, uid, {'employee_id' : id.id, 'plan_id': id.evaluation_plan_id}, context)
obj_evaluation.create(cr, uid, {'employee_id' : id.id, 'plan_id': id.evaluation_plan_id}, context=context)
return True
def onchange_evaluation_plan_id(self, cr, uid, ids, evaluation_plan_id, evaluation_date, context=None):
evaluation_date = evaluation_date or False
evaluation_plan_obj=self.pool.get('hr_evaluation.plan')
obj_evaluation = self.pool.get('hr_evaluation.evaluation')
if context is None:
context = {}
if evaluation_plan_id:
flag = False
evaluation_plan = evaluation_plan_obj.browse(cr, uid, [evaluation_plan_id], context=context)[0]
@ -131,9 +135,11 @@ class hr_employee(osv.osv):
return {'value': {'evaluation_date': evaluation_date}}
def create(self, cr, uid, vals, context=None):
if context is None:
context = {}
id = super(hr_employee, self).create(cr, uid, vals, context=context)
if vals.get('evaluation_plan_id', False):
self.pool.get("hr_evaluation.evaluation").create(cr, uid, {'employee_id' : id, 'plan_id': vals['evaluation_plan_id']}, context=context)
obj_evaluation.create(cr, uid, {'employee_id' : id, 'plan_id': vals['evaluation_plan_id']}, context=context)
return id
hr_employee()
@ -173,10 +179,12 @@ class hr_evaluation(osv.osv):
'state' : lambda *a: 'draft',
}
def name_get(self, cr, uid, ids, context={}):
def name_get(self, cr, uid, ids, context=None):
if context is None:
context = {}
if not len(ids):
return []
reads = self.browse(cr, uid, ids, context)
reads = self.browse(cr, uid, ids, context=context)
res = []
for record in reads:
name = record.plan_id.name
@ -185,6 +193,8 @@ class hr_evaluation(osv.osv):
def onchange_employee_id(self, cr, uid, ids, employee_id, context=None):
employee_obj=self.pool.get('hr.employee')
if context is None:
context = {}
evaluation_plan_id=''
if employee_id:
for employee in employee_obj.browse(cr, uid, [employee_id], context=context):
@ -194,8 +204,11 @@ class hr_evaluation(osv.osv):
return {'value': {'plan_id':evaluation_plan_id}}
def button_plan_in_progress(self, cr, uid, ids, context=None):
hr_eval_inter_obj = self.pool.get('hr.evaluation.interview')
if context is None:
context = {}
apprai_id = []
for evaluation in self.browse(cr, uid, ids, context):
for evaluation in self.browse(cr, uid, ids, context=context):
wait = False
for phase in evaluation.plan_id.phase_ids:
childs = []
@ -210,7 +223,6 @@ class hr_evaluation(osv.osv):
if not child.user_id:
continue
hr_eval_inter_obj = self.pool.get('hr.evaluation.interview')
int_id = hr_eval_inter_obj.create(cr, uid, {
'evaluation_id': evaluation.id,
'survey_id': phase.survey_id.id,
@ -235,18 +247,24 @@ class hr_evaluation(osv.osv):
return True
def button_final_validation(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state':'progress'})
request_obj = self.pool.get('hr.evaluation.interview')
for id in self.browse(cr, uid ,ids,context=context):
if len(id.survey_request_ids) != len(request_obj.search(cr, uid, [('evaluation_id', '=', id.id),('state', '=', 'done')],context=context)):
if context is None:
context = {}
self.write(cr, uid, ids, {'state':'progress'}, context=context)
for id in self.browse(cr, uid ,ids, context=context):
if len(id.survey_request_ids) != len(request_obj.search(cr, uid, [('evaluation_id', '=', id.id),('state', '=', 'done')], context=context)):
raise osv.except_osv(_('Warning !'),_("You cannot change state, because some appraisal in waiting answer or draft state"))
return True
def button_done(self,cr, uid, ids, context=None):
self.write(cr,uid,ids,{'state':'done', 'date_close': time.strftime('%Y-%m-%d')}, context=context)
if context is None:
context = {}
self.write(cr, uid, ids,{'state':'done', 'date_close': time.strftime('%Y-%m-%d')}, context=context)
return True
def button_cancel(self, cr, uid, ids, context=None):
if context is None:
context = {}
self.write(cr, uid, ids,{'state':'cancel'}, context=context)
return True
@ -277,20 +295,22 @@ class hr_evaluation_interview(osv.osv):
}
def survey_req_waiting_answer(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, { 'state' : 'waiting_answer'})
if context is None:
context = {}
self.write(cr, uid, ids, { 'state' : 'waiting_answer'}, context=context)
return True
def survey_req_done(self, cr, uid, ids, context=None):
hr_eval_obj = self.pool.get('hr_evaluation.evaluation')
if context is None:
context = {}
hr_eval_obj = self.pool.get('hr_evaluation.evaluation')
for id in self.browse(cr, uid, ids, context=context):
flag = False
wating_id = 0
tot_done_req = 0
if not id.evaluation_id.id:
raise osv.except_osv(_('Warning !'),_("You cannot start evaluation without Evaluation."))
records = hr_eval_obj.browse(cr, uid, [id.evaluation_id.id],context=context)[0].survey_request_ids
records = hr_eval_obj.browse(cr, uid, [id.evaluation_id.id], context=context)[0].survey_request_ids
for child in records:
if child.state == "draft" :
wating_id = child.id
@ -300,16 +320,20 @@ class hr_evaluation_interview(osv.osv):
else :
tot_done_req += 1
if not flag and wating_id:
self.survey_req_waiting_answer(cr, uid, [wating_id], context)
self.survey_req_waiting_answer(cr, uid, [wating_id], context=context)
hr_eval_obj.write(cr, uid, [id.evaluation_id.id], {'progress': tot_done_req * 100 / len(records)}, context=context)
self.write(cr, uid, ids, { 'state': 'done'})
self.write(cr, uid, ids, { 'state': 'done'}, context=context)
return True
def survey_req_draft(self, cr, uid, ids, context=None):
if context is None:
context = {}
self.write(cr, uid, ids, { 'state': 'draft'}, context=context)
return True
def survey_req_cancel(self, cr, uid, ids, context=None):
if context is None:
context = {}
self.write(cr, uid, ids, { 'state': 'cancel'}, context=context)
return True
@ -326,7 +350,7 @@ class hr_evaluation_interview(osv.osv):
"""
if not context:
context = {}
record = self.browse(cr, uid, ids, context)
record = self.browse(cr, uid, ids, context=context)
record = record and record[0]
context.update({'survey_id': record.survey_id.id, 'response_id': [record.response.id], 'response_no':0,})
value = self.pool.get("survey").action_print_survey(cr, uid, ids, context)

View File

@ -238,7 +238,7 @@
<filter icon="terp-go-week" string="7 Days" help="Evaluations to close within the next 7 days"
domain="[('date', '&gt;=', (datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]" />
<filter icon="terp-gnome-cpu-frequency-applet+" string="Overpassed"
help="Evaluations that overpassed the deadline" domain="[('date','&gt;=',(datetime.date.today()))]" />
help="Evaluations that overpassed the deadline" domain="[('date','&gt;=',str(datetime.date.today()))]" />
<separator orientation="vertical"/>
<field name="employee_id" />
<field name="plan_id" widget="selection" />

View File

@ -30,6 +30,8 @@ class hr_evaluation_reminder(osv.osv_memory):
def send_mail(self, cr, uid, ids, context=None):
hr_evaluation_obj = self.pool.get('hr_evaluation.evaluation')
if context is None:
context = {}
evaluation_data = self.read(cr, uid, ids, context=context)[0]
for waiting_id in hr_evaluation_obj.browse(cr, uid, evaluation_data['evaluation_id'], context=context).survey_request_ids:
if waiting_id.state == "waiting_answer" and waiting_id.user_to_review_id.work_email :

View File

@ -25,7 +25,9 @@ from osv import fields, osv
from tools.translate import _
def _employee_get(obj, cr, uid, context=None):
ids = obj.pool.get('hr.employee').search(cr, uid, [('user_id', '=', uid)])
if context is None:
context = {}
ids = obj.pool.get('hr.employee').search(cr, uid, [('user_id', '=', uid)], context=context)
if ids:
return ids[0]
return False
@ -33,21 +35,27 @@ def _employee_get(obj, cr, uid, context=None):
class hr_expense_expense(osv.osv):
def copy(self, cr, uid, id, default=None, context=None):
if context is None:
context = {}
if not default: default = {}
default.update({'invoice_id': False, 'date_confirm': False, 'date_valid': False, 'user_valid': False})
return super(hr_expense_expense, self).copy(cr, uid, id, default, context)
return super(hr_expense_expense, self).copy(cr, uid, id, default, context=context)
def _amount(self, cr, uid, ids, field_name, arg, context=None):
if context is None:
context = {}
cr.execute("SELECT s.id,COALESCE(SUM(l.unit_amount*l.unit_quantity),0) AS amount FROM hr_expense_expense s LEFT OUTER JOIN hr_expense_line l ON (s.id=l.expense_id) WHERE s.id IN %s GROUP BY s.id ", (tuple(ids),))
res = dict(cr.fetchall())
return res
def _get_currency(self, cr, uid, context=None):
user = self.pool.get('res.users').browse(cr, uid, [uid])[0]
if context is None:
context = {}
user = self.pool.get('res.users').browse(cr, uid, [uid], context=context)[0]
if user.company_id:
return user.company_id.currency_id.id
else:
return self.pool.get('res.currency').search(cr, uid, [('rate','=',1.0)])[0]
return self.pool.get('res.currency').search(cr, uid, [('rate','=',1.0)], context=context)[0]
_name = "hr.expense.expense"
_description = "Expense"
@ -115,6 +123,8 @@ class hr_expense_expense(osv.osv):
def action_invoice_create(self, cr, uid, ids):
res = False
invoice_obj = self.pool.get('account.invoice')
property_obj = self.pool.get('ir.property')
sequence_obj = self.pool.get('ir.sequence')
for exp in self.browse(cr, uid, ids):
lines = []
for l in exp.line_ids:
@ -125,7 +135,7 @@ class hr_expense_expense(osv.osv):
acc = l.product_id.categ_id.property_account_expense_categ
tax_id = [x.id for x in l.product_id.supplier_taxes_id]
else:
acc = self.pool.get('ir.property').get(cr, uid, 'property_account_expense_categ', 'product.category')
acc = property_obj.get(cr, uid, 'property_account_expense_categ', 'product.category')
if not acc:
raise osv.except_osv(_('Error !'), _('Please configure Default Expanse account for Product purchase, `property_account_expense_categ`'))
@ -145,7 +155,7 @@ class hr_expense_expense(osv.osv):
payment_term_id = exp.employee_id.address_id.partner_id.property_payment_term.id
inv = {
'name': exp.name,
'reference': self.pool.get('ir.sequence').get(cr, uid, 'hr.expense.invoice'),
'reference': sequence_obj.get(cr, uid, 'hr.expense.invoice'),
'account_id': acc,
'type': 'in_invoice',
'partner_id': exp.employee_id.address_id.partner_id.id,
@ -184,6 +194,8 @@ class hr_expense_line(osv.osv):
_description = "Expense Line"
def _amount(self, cr, uid, ids, field_name, arg, context=None):
if context is None:
context = {}
if not len(ids):
return {}
cr.execute("SELECT l.id,COALESCE(SUM(l.unit_amount*l.unit_quantity),0) AS amount FROM hr_expense_line l WHERE id IN %s GROUP BY l.id ",(tuple(ids),))
@ -215,16 +227,16 @@ class hr_expense_line(osv.osv):
context = {}
v = {}
if product_id:
product=self.pool.get('product.product').browse(cr, uid, product_id, context=context)
v['name']=product.name
product = self.pool.get('product.product').browse(cr, uid, product_id, context=context)
v['name'] = product.name
# Compute based on pricetype of employee company
pricetype_id = self.pool.get('hr.employee').browse(cr, uid, employee_id).user_id.company_id.property_valuation_price_type.id
context['currency_id']=self.pool.get('hr.employee').browse(cr, uid, employee_id).user_id.company_id.currency_id.id
pricetype=self.pool.get('product.price.type').browse(cr, uid, pricetype_id)
amount_unit=product.price_get(pricetype.field, context)[product.id]
v['unit_amount']=amount_unit
pricetype_id = self.pool.get('hr.employee').browse(cr, uid, employee_id, context=context).user_id.company_id.property_valuation_price_type.id
context['currency_id'] = self.pool.get('hr.employee').browse(cr, uid, employee_id, context=context).user_id.company_id.currency_id.id
pricetype = self.pool.get('product.price.type').browse(cr, uid, pricetype_id, context=context)
amount_unit = product.price_get(pricetype.field, context)[product.id]
v['unit_amount'] = amount_unit
if not uom_id:
v['uom_id']=product.uom_id.id
v['uom_id'] = product.uom_id.id
return {'value': v}
hr_expense_line()

View File

@ -33,8 +33,10 @@ class hr_holidays_status(osv.osv):
_description = "Leave Type"
def get_days_cat(self, cr, uid, ids, category_id, return_false, context=None):
if context is None:
context = {}
res = {}
for record in self.browse(cr, uid, ids, context):
for record in self.browse(cr, uid, ids, context=context):
res[record.id] = {}
max_leaves = leaves_taken = 0
if not return_false:
@ -50,6 +52,8 @@ class hr_holidays_status(osv.osv):
return res
def get_days(self, cr, uid, ids, employee_id, return_false, context=None):
if context is None:
context = {}
res = {}
for record in self.browse(cr, uid, ids, context=context):
res[record.id] = {}
@ -67,16 +71,18 @@ class hr_holidays_status(osv.osv):
return res
def _user_left_days(self, cr, uid, ids, name, args, context=None):
if context is None:
context = {}
return_false = False
employee_id = False
res = {}
if context and context.has_key('employee_id'):
if not context['employee_id']:
return_false = True
employee_id = context['employee_id']
else:
employee_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)])
employee_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)], context=context)
if employee_ids:
employee_id = employee_ids[0]
else:
@ -112,7 +118,9 @@ class hr_holidays(osv.osv):
_order = "type desc, date_from asc"
def _employee_get(obj, cr, uid, context=None):
ids = obj.pool.get('hr.employee').search(cr, uid, [('user_id', '=', uid)])
if context is None:
context = {}
ids = obj.pool.get('hr.employee').search(cr, uid, [('user_id', '=', uid)], context=context)
if ids:
return ids[0]
return False
@ -152,13 +160,17 @@ class hr_holidays(osv.osv):
def _create_resource_leave(self, cr, uid, vals, context=None):
'''This method will create entry in resource calendar leave object at the time of holidays validated '''
if context is None:
context = {}
obj_res_leave = self.pool.get('resource.calendar.leaves')
return obj_res_leave.create(cr, uid, vals)
return obj_res_leave.create(cr, uid, vals, context=context)
def _remove_resouce_leave(self, cr, uid, ids, context=None):
'''This method will create entry in resource calendar leave object at the time of holidays cancel/removed'''
obj_res_leave = self.pool.get('resource.calendar.leaves')
leave_ids = obj_res_leave.search(cr, uid, [('holiday_id', 'in', ids)])
if context is None:
context = {}
leave_ids = obj_res_leave.search(cr, uid, [('holiday_id', 'in', ids)], context=context)
return obj_res_leave.unlink(cr, uid, leave_ids)
def create(self, cr, uid, vals, context=None):
@ -231,6 +243,8 @@ class hr_holidays(osv.osv):
_constraints = [(_check_date, 'Start date should not be larger than end date!\nNumber of Days should be greater than 1!', ['number_of_days_temp'])]
def unlink(self, cr, uid, ids, context=None):
if context is None:
context = {}
self._update_user_holidays(cr, uid, ids)
self._remove_resouce_leave(cr, uid, ids, context=context)
return super(hr_holidays, self).unlink(cr, uid, ids, context)
@ -252,9 +266,11 @@ class hr_holidays(osv.osv):
return self.onchange_date_from(cr, uid, ids, date_to, date_from)
def onchange_sec_id(self, cr, uid, ids, status, context=None):
if context is None:
context = {}
warning = {}
if status:
brows_obj = self.pool.get('hr.holidays.status').browse(cr, uid, [status])[0]
brows_obj = self.pool.get('hr.holidays.status').browse(cr, uid, [status], context=context)[0]
if brows_obj.categ_id and brows_obj.categ_id.section_id and not brows_obj.categ_id.section_id.allow_unlink:
warning = {
'title': "Warning for ",
@ -369,6 +385,9 @@ class hr_holidays(osv.osv):
return True
def check_holidays(self, cr, uid, ids):
holi_status_obj = self.pool.get('hr.holidays.status')
emp_obj = self.pool.get('hr.employee')
meeting_obj = self.pool.get('crm.meeting')
for record in self.browse(cr, uid, ids):
if not record.number_of_days:
raise osv.except_osv(_('Warning!'), _('Wrong leave definition.'))
@ -376,14 +395,14 @@ class hr_holidays(osv.osv):
leave_asked = record.number_of_days
if leave_asked < 0.00:
if not record.holiday_status_id.limit:
leaves_rest = self.pool.get('hr.holidays.status').get_days(cr, uid, [record.holiday_status_id.id], record.employee_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
leaves_rest = holi_status_obj.get_days(cr, uid, [record.holiday_status_id.id], record.employee_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
if leaves_rest < -(leave_asked):
raise osv.except_osv(_('Warning!'),_('You Cannot Validate leaves while available leaves are less than asked leaves.'))
elif record.holiday_type == 'category' and record.category_id:
leave_asked = record.number_of_days
if leave_asked < 0.00:
if not record.holiday_status_id.limit:
leaves_rest = self.pool.get('hr.holidays.status').get_days_cat(cr, uid, [record.holiday_status_id.id], record.category_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
leaves_rest = holi_status_obj.get_days_cat(cr, uid, [record.holiday_status_id.id], record.category_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
if leaves_rest < -(leave_asked):
raise osv.except_osv(_('Warning!'),_('You Cannot Validate leaves while available leaves are less than asked leaves.'))
else:# This condition will never meet!!
@ -401,10 +420,10 @@ class hr_holidays(osv.osv):
'allocation_type': record.allocation_type,
'parent_id': record.id,
}
employee_ids = self.pool.get('hr.employee').search(cr, uid, [])
employee_ids = emp_obj.search(cr, uid, [])
for employee in employee_ids:
vals['employee_id'] = employee
user_id = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)])
user_id = emp_obj.search(cr, uid, [('user_id','=',uid)])
if user_id:
vals['user_id'] = user_id[0]
holiday_ids.append(self.create(cr, uid, vals, context=None))
@ -435,7 +454,7 @@ class hr_holidays(osv.osv):
'user_id' : record.user_id.id,
'date' : record.date_from,
}
case_id = self.pool.get('crm.meeting').create(cr, uid, vals)
case_id = meeting_obj.create(cr, uid, vals)
self.write(cr, uid, ids, {'case_id': case_id})
return True

View File

@ -41,7 +41,7 @@ class hr_holidays_summary_dept(osv.osv_memory):
def print_report(self, cr, uid, ids, context=None):
if context is None:
context = {}
data = self.read(cr, uid, ids, [])[0]
data = self.read(cr, uid, ids, [], context=context)[0]
if not data['depts']:
raise osv.except_osv(_('Error'), _('You have to select at least 1 Department. And try again'))
datas = {

View File

@ -40,7 +40,7 @@ class hr_holidays_summary_employee(osv.osv_memory):
def print_report(self, cr, uid, ids, context=None):
if context is None:
context = {}
data = self.read(cr, uid, ids, [])[0]
data = self.read(cr, uid, ids, [], context=context)[0]
data['emp'] = context['active_ids']
datas = {
'ids': [],

View File

@ -21,15 +21,14 @@
##############################################################################
import time
from datetime import date, datetime, timedelta
import netsvc
from osv import osv
from osv import fields
from osv import fields, osv
from tools import config
from tools.translate import _
from datetime import date
from datetime import datetime
from datetime import timedelta
def prev_bounds(cdate=False):
when = date.fromtimestamp(time.mktime(time.strptime(cdate,"%Y-%m-%d")))
@ -114,12 +113,14 @@ class hr_payroll_structure(osv.osv):
@return: returns a id of newly created record
"""
code = self.browse(cr, uid, id).code
if context is None:
context = {}
code = self.browse(cr, uid, id, context=context).code
default = {
'code':code+"(copy)",
'company_id':self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id
}
res_id = super(hr_payroll_structure, self).copy(cr, uid, id, default, context)
res_id = super(hr_payroll_structure, self).copy(cr, uid, id, default, context=context)
return res_id
hr_payroll_structure()
@ -153,13 +154,13 @@ class payroll_register(osv.osv):
_name = 'hr.payroll.register'
_description = 'Payroll Register'
def _calculate(self, cr, uid, ids, field_names, arg, context):
def _calculate(self, cr, uid, ids, field_names, arg, context=None):
res = {}
allounce = 0.0
deduction = 0.0
net = 0.0
grows = 0.0
for register in self.browse(cr, uid, ids, context):
for register in self.browse(cr, uid, ids, context=context):
for slip in register.line_ids:
allounce += slip.allounce
deduction += slip.deduction
@ -210,21 +211,23 @@ class payroll_register(osv.osv):
context=context).company_id.id,
}
def compute_sheet(self, cr, uid, ids, context={}):
def compute_sheet(self, cr, uid, ids, context=None):
emp_pool = self.pool.get('hr.employee')
slip_pool = self.pool.get('hr.payslip')
func_pool = self.pool.get('hr.payroll.structure')
slip_line_pool = self.pool.get('hr.payslip.line')
wf_service = netsvc.LocalService("workflow")
if context is None:
context = {}
vals = self.browse(cr, uid, ids)[0]
vals = self.browse(cr, uid, ids, context=context)[0]
emp_ids = emp_pool.search(cr, uid, [])
emp_ids = emp_pool.search(cr, uid, [], context=context)
for emp in emp_pool.browse(cr, uid, emp_ids):
old_slips = slip_pool.search(cr, uid, [('employee_id','=', emp.id), ('date','=',vals.date)])
for emp in emp_pool.browse(cr, uid, emp_ids, context=context):
old_slips = slip_pool.search(cr, uid, [('employee_id','=', emp.id), ('date','=',vals.date)], context=context)
if old_slips:
slip_pool.write(cr, uid, old_slips, {'register_id':ids[0]})
slip_pool.write(cr, uid, old_slips, {'register_id':ids[0]}, context=context)
for sid in old_slips:
wf_service.trg_validate(uid, 'hr.payslip', sid, 'compute_sheet', cr)
else:
@ -237,48 +240,54 @@ class payroll_register(osv.osv):
'journal_id':vals.journal_id.id,
'bank_journal_id':vals.bank_journal_id.id
}
slip_id = slip_pool.create(cr, uid, res)
slip_id = slip_pool.create(cr, uid, res, context=context)
wf_service.trg_validate(uid, 'hr.payslip', slip_id, 'compute_sheet', cr)
number = self.pool.get('ir.sequence').get(cr, uid, 'salary.register')
self.write(cr, uid, ids, {'state':'draft', 'number':number})
self.write(cr, uid, ids, {'state':'draft', 'number':number}, context=context)
return True
def verify_sheet(self, cr, uid, ids, context={}):
def verify_sheet(self, cr, uid, ids, context=None):
if context is None:
context = {}
slip_pool = self.pool.get('hr.payslip')
for id in ids:
sids = slip_pool.search(cr, uid, [('register_id','=',id)])
sids = slip_pool.search(cr, uid, [('register_id','=',id)], context=context)
wf_service = netsvc.LocalService("workflow")
for sid in sids:
wf_service.trg_validate(uid, 'hr.payslip', sid, 'verify_sheet', cr)
self.write(cr, uid, ids, {'state':'hr_check'})
self.write(cr, uid, ids, {'state':'hr_check'}, context=context)
return True
def final_verify_sheet(self, cr, uid, ids, context={}):
def final_verify_sheet(self, cr, uid, ids, context=None):
slip_pool = self.pool.get('hr.payslip')
advice_pool = self.pool.get('hr.payroll.advice')
advice_line_pool = self.pool.get('hr.payroll.advice.line')
sequence_pool = self.pool.get('ir.sequence')
users_pool = self.pool.get('res.users')
if context is None:
context = {}
for id in ids:
sids = slip_pool.search(cr, uid, [('register_id','=',id), ('state','=','hr_check')])
sids = slip_pool.search(cr, uid, [('register_id','=',id), ('state','=','hr_check')], context=context)
wf_service = netsvc.LocalService("workflow")
for sid in sids:
wf_service.trg_validate(uid, 'hr.payslip', sid, 'final_verify_sheet', cr)
for reg in self.browse(cr, uid, ids):
for reg in self.browse(cr, uid, ids, context=context):
accs = {}
for slip in reg.line_ids:
pid = False
if accs.get(slip.employee_id.property_bank_account.code, False) == False:
advice = {
'name': 'Payment Advice from %s / Bank Account %s' % (self.pool.get('res.users').browse(cr, uid, uid).company_id.name, slip.employee_id.property_bank_account.name),
'number': self.pool.get('ir.sequence').get(cr, uid, 'payment.advice'),
'name': 'Payment Advice from %s / Bank Account %s' % (users_pool.browse(cr, uid, uid, context=context).company_id.name, slip.employee_id.property_bank_account.name),
'number': sequence_pool.get(cr, uid, 'payment.advice'),
'register_id':reg.id,
'account_id':slip.employee_id.property_bank_account.id
}
pid = advice_pool.create(cr, uid, advice)
pid = advice_pool.create(cr, uid, advice, context=context)
accs[slip.employee_id.property_bank_account.code] = pid
else:
pid = accs[slip.employee_id.property_bank_account.code]
@ -290,21 +299,21 @@ class payroll_register(osv.osv):
'amount':slip.other_pay + slip.net,
'bysal':slip.net
}
id = advice_line_pool.create(cr, uid, pline)
id = advice_line_pool.create(cr, uid, pline, context=context)
#, 'advice_ids':[(6, 0, [pid])]
self.write(cr, uid, ids, {'state':'confirm'})
self.write(cr, uid, ids, {'state':'confirm'}, context=context)
return True
def process_sheet(self, cr, uid, ids, context={}):
def process_sheet(self, cr, uid, ids, context=None):
slip_pool = self.pool.get('hr.payslip')
for id in ids:
sids = slip_pool.search(cr, uid, [('register_id','=',id), ('state','=','confirm')])
sids = slip_pool.search(cr, uid, [('register_id','=',id), ('state','=','confirm')], context=context)
wf_service = netsvc.LocalService("workflow")
for sid in sids:
wf_service.trg_validate(uid, 'hr.payslip', sid, 'process_sheet', cr)
self.write(cr, uid, ids, {'state':'done'})
self.write(cr, uid, ids, {'state':'done'}, context=context)
return True
payroll_register()
@ -341,16 +350,22 @@ class payroll_advice(osv.osv):
context=context).company_id.id,
}
def confirm_sheet(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'confirm'})
def confirm_sheet(self, cr, uid, ids, context=None):
if context is None:
context = {}
self.write(cr, uid, ids, {'state':'confirm'}, context=context)
return True
def set_to_draft(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'draft'})
def set_to_draft(self, cr, uid, ids, context=None):
if context is None:
context = {}
self.write(cr, uid, ids, {'state':'draft'}, context=context)
return True
def cancel_sheet(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'cancel'})
def cancel_sheet(self, cr, uid, ids, context=None):
if context is None:
context = {}
self.write(cr, uid, ids, {'state':'cancel'}, context=context)
return True
payroll_advice()
@ -374,15 +389,17 @@ class payroll_advice_line(osv.osv):
'flag': lambda *a: 'C',
}
def onchange_employee_id(self, cr, uid, ids, ddate, employee_id, context={}):
def onchange_employee_id(self, cr, uid, ids, ddate, employee_id, context=None):
vals = {}
slip_pool = self.pool.get('hr.payslip')
if context is None:
context = {}
if employee_id:
dates = prev_bounds(ddate)
sids = False
sids = slip_pool.search(cr, uid, [('paid','=',False),('state','=','confirm'),('date','>=',dates[0]), ('employee_id','=',employee_id), ('date','<=',dates[1])])
sids = slip_pool.search(cr, uid, [('paid','=',False),('state','=','confirm'),('date','>=',dates[0]), ('employee_id','=',employee_id), ('date','<=',dates[1])], context=context)
if sids:
slip = slip_pool.browse(cr, uid, sids[0])
slip = slip_pool.browse(cr, uid, sids[0], context=context)
vals['name'] = slip.employee_id.otherid
vals['amount'] = slip.net + slip.other_pay
vals['bysal'] = slip.net
@ -398,24 +415,26 @@ class contrib_register(osv.osv):
_name = 'hr.contibution.register'
_description = 'Contribution Register'
def _total_contrib(self, cr, uid, ids, field_names, arg, context={}):
def _total_contrib(self, cr, uid, ids, field_names, arg, context=None):
line_pool = self.pool.get('hr.contibution.register.line')
period_id = self.pool.get('account.period').search(cr,uid,[('date_start','<=',time.strftime('%Y-%m-%d')),('date_stop','>=',time.strftime('%Y-%m-%d'))])[0]
fiscalyear_id = self.pool.get('account.period').browse(cr, uid, period_id).fiscalyear_id
if context is None:
context = {}
period_id = self.pool.get('account.period').search(cr,uid,[('date_start','<=',time.strftime('%Y-%m-%d')),('date_stop','>=',time.strftime('%Y-%m-%d'))], context=context)[0]
fiscalyear_id = self.pool.get('account.period').browse(cr, uid, period_id, context=context).fiscalyear_id
res = {}
for cur in self.browse(cr, uid, ids):
current = line_pool.search(cr, uid, [('period_id','=',period_id),('register_id','=',cur.id)])
years = line_pool.search(cr, uid, [('period_id.fiscalyear_id','=',fiscalyear_id.id), ('register_id','=',cur.id)])
for cur in self.browse(cr, uid, ids, context=context):
current = line_pool.search(cr, uid, [('period_id','=',period_id),('register_id','=',cur.id)], context=context)
years = line_pool.search(cr, uid, [('period_id.fiscalyear_id','=',fiscalyear_id.id), ('register_id','=',cur.id)], context=context)
e_month = 0.0
c_month = 0.0
for i in line_pool.browse(cr, uid, current):
for i in line_pool.browse(cr, uid, current, context=context):
e_month += i.emp_deduction
c_month += i.comp_deduction
e_year = 0.0
c_year = 0.0
for j in line_pool.browse(cr, uid, years):
for j in line_pool.browse(cr, uid, years, context=context):
e_year += i.emp_deduction
c_year += i.comp_deduction
@ -454,9 +473,11 @@ class contrib_register_line(osv.osv):
_name = 'hr.contibution.register.line'
_description = 'Contribution Register Line'
def _total(self, cr, uid, ids, field_names, arg, context):
def _total(self, cr, uid, ids, field_names, arg, context=None):
if context is None:
context = {}
res={}
for line in self.browse(cr, uid, ids, context):
for line in self.browse(cr, uid, ids, context=context):
res[line.id] = line.emp_deduction + line.comp_deduction
return res
@ -564,22 +585,23 @@ class company_contribution(osv.osv):
context=context).company_id.id,
}
def execute_function(self, cr, uid, id, value, context):
def execute_function(self, cr, uid, id, value, context=None):
"""
self: pointer to self object
cr: cursor to database
uid: user id of current executer
"""
line_pool = self.pool.get('company.contribution.line')
if context is None:
context = {}
res = 0
ids = line_pool.search(cr, uid, [('category_id','=',id), ('to_val','>=',value),('from_val','<=',value)])
ids = line_pool.search(cr, uid, [('category_id','=',id), ('to_val','>=',value),('from_val','<=',value)], context=context)
if not ids:
ids = line_pool.search(cr, uid, [('category_id','=',id), ('from','<=',value)])
ids = line_pool.search(cr, uid, [('category_id','=',id), ('from','<=',value)], context=context)
if not ids:
res = 0
else:
res = line_pool.browse(cr, uid, ids)[0].value
res = line_pool.browse(cr, uid, ids, context=context)[0].value
return res
company_contribution()
@ -645,9 +667,12 @@ class hr_payslip(osv.osv):
_name = 'hr.payslip'
_description = 'Pay Slip'
def _calculate(self, cr, uid, ids, field_names, arg, context):
def _calculate(self, cr, uid, ids, field_names, arg, context=None):
slip_line_obj = self.pool.get('hr.payslip.line')
if context is None:
context = {}
res = {}
for rs in self.browse(cr, uid, ids, context):
for rs in self.browse(cr, uid, ids, context=context):
allow = 0.0
deduct = 0.0
others = 0.0
@ -698,7 +723,7 @@ class hr_payslip(osv.osv):
elif line.type == 'otherpay':
others += amount
self.pool.get('hr.payslip.line').write(cr, uid, [line.id], {'total':amount})
slip_line_obj.write(cr, uid, [line.id], {'total':amount}, context=context)
record = {
'allounce':round(allow),
@ -759,6 +784,8 @@ class hr_payslip(osv.osv):
}
def copy(self, cr, uid, id, default=None, context=None):
if context is None:
context = {}
company_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id
default = {
'line_ids': False,
@ -770,7 +797,7 @@ class hr_payslip(osv.osv):
'basic_before_leaves':0,
'basic':0
}
res_id = super(hr_payslip, self).copy(cr, uid, id, default, context)
res_id = super(hr_payslip, self).copy(cr, uid, id, default, context=context)
return res_id
def create_voucher(self, cr, uid, ids, name, voucher, sequence=5):
@ -784,31 +811,45 @@ class hr_payslip(osv.osv):
}
slip_move.create(cr, uid, res)
def set_to_draft(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'draft'})
def set_to_draft(self, cr, uid, ids, context=None):
if context is None:
context = {}
self.write(cr, uid, ids, {'state':'draft'}, context=context)
return True
def cancel_sheet(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'cancel'})
def cancel_sheet(self, cr, uid, ids, context=None):
if context is None:
context = {}
self.write(cr, uid, ids, {'state':'cancel'}, context=context)
return True
def account_check_sheet(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'accont_check'})
def account_check_sheet(self, cr, uid, ids, context=None):
if context is None:
context = {}
self.write(cr, uid, ids, {'state':'accont_check'}, context=context)
return True
def hr_check_sheet(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'hr_check'})
def hr_check_sheet(self, cr, uid, ids, context=None):
if context is None:
context = {}
self.write(cr, uid, ids, {'state':'hr_check'}, context=context)
return True
def process_sheet(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'done'})
def process_sheet(self, cr, uid, ids, context=None):
if context is None:
context = {}
self.write(cr, uid, ids, {'state':'done'}, context=context)
return True
def verify_sheet(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'confirm'})
def verify_sheet(self, cr, uid, ids, context=None):
if context is None:
context = {}
self.write(cr, uid, ids, {'state':'confirm'}, context=context)
return True
def get_contract(self, cr, uid, employee, date, context={}):
def get_contract(self, cr, uid, employee, date, context=None):
if context is None:
context = {}
sql_req= '''
SELECT c.id as id, c.wage as wage, struct_id as function
FROM hr_contract c
@ -828,7 +869,7 @@ class hr_payslip(osv.osv):
return contract
def _get_leaves(self, cr, user, slip, employee, context={}):
def _get_leaves(self, cr, user, slip, employee, context=None):
"""
Compute leaves for an employee
@ -840,7 +881,8 @@ class hr_payslip(osv.osv):
@return: return a result
"""
if context is None:
context = {}
result = []
dates = prev_bounds(slip.date)
@ -856,14 +898,17 @@ class hr_payslip(osv.osv):
return result
def compute_sheet(self, cr, uid, ids, context={}):
def compute_sheet(self, cr, uid, ids, context=None):
emp_pool = self.pool.get('hr.employee')
slip_pool = self.pool.get('hr.payslip')
func_pool = self.pool.get('hr.payroll.structure')
slip_line_pool = self.pool.get('hr.payslip.line')
holiday_pool = self.pool.get('hr.holidays')
date = self.read(cr, uid, ids, ['date'])[0]['date']
contract_obj = self.pool.get('hr.contract')
sequence_obj = self.pool.get('ir.sequence')
if context is None:
context = {}
date = self.read(cr, uid, ids, ['date'], context=context)[0]['date']
#Check for the Holidays
def get_days(start, end, month, year, calc_day):
@ -874,25 +919,25 @@ class hr_payslip(osv.osv):
count += 1
return count
for slip in self.browse(cr, uid, ids):
for slip in self.browse(cr, uid, ids, context=context):
contracts = self.get_contract(cr, uid, slip.employee_id, date, context)
if contracts.get('id', False) == False:
continue
contract = self.pool.get('hr.contract').browse(cr, uid, contracts.get('id'))
contract = contract_obj.browse(cr, uid, contracts.get('id'), context=context)
sal_type = contract.wage_type_id.type
function = contract.struct_id.id
lines = []
if function:
func = func_pool.read(cr, uid, function, ['line_ids'])
lines = slip_line_pool.browse(cr, uid, func['line_ids'])
func = func_pool.read(cr, uid, function, ['line_ids'], context=context)
lines = slip_line_pool.browse(cr, uid, func['line_ids'], context=context)
lines += slip.employee_id.line_ids
old_slip_id = slip_line_pool.search(cr, uid, [('slip_id','=',slip.id)])
slip_line_pool.unlink(cr, uid, old_slip_id)
old_slip_ids = slip_line_pool.search(cr, uid, [('slip_id','=',slip.id)], context=context)
slip_line_pool.unlink(cr, uid, old_slip_ids, context=context)
ad = []
lns = {}
@ -972,14 +1017,14 @@ class hr_payslip(osv.osv):
value = line.amount
elif line.amount_type == 'func':
value = self.pool.get('hr.payslip.line').execute_function(cr, uid, line.id, amt, context)
value = slip_line_pool.execute_function(cr, uid, line.id, amt, context)
line.amount = value
else:
if line.amount_type in ('fix', 'per'):
value = line.amount
elif line.amount_type == 'func':
value = self.pool.get('hr.payslip.line').execute_function(cr, uid, line.id, amt, context)
value = slip_line_pool.execute_function(cr, uid, line.id, amt, context)
line.amount = value
if line.type == 'allowance':
@ -997,7 +1042,7 @@ class hr_payslip(osv.osv):
'base':base
}
slip_line_pool.copy(cr, uid, line.id, vals, {})
if sal_type in ('gross', 'net'):
sal = contract.wage
if sal_type == 'net':
@ -1015,7 +1060,7 @@ class hr_payslip(osv.osv):
else:
basic = contract.wage
number = self.pool.get('ir.sequence').get(cr, uid, 'salary.slip')
number = sequence_obj.get(cr, uid, 'salary.slip')
ttyme = datetime.fromtimestamp(time.mktime(time.strptime(slip.date,"%Y-%m-%d")))
update.update({
'deg_id':function,
@ -1027,9 +1072,9 @@ class hr_payslip(osv.osv):
'contract_id':contract.id,
'company_id':slip.employee_id.company_id.id
})
self.write(cr, uid, [slip.id], update)
self.write(cr, uid, [slip.id], update, context=context)
for slip in self.browse(cr, uid, ids):
for slip in self.browse(cr, uid, ids, context=context):
if not slip.contract_id :
continue
@ -1055,7 +1100,7 @@ class hr_payslip(osv.osv):
total_leave = 0.0
paid_leave = 0.0
for hday in holiday_pool.browse(cr, uid, leave_ids):
for hday in holiday_pool.browse(cr, uid, leave_ids, context=context):
res = {
'slip_id':slip.id,
'name':hday.holiday_status_id.name + '-%s' % (hday.number_of_days),
@ -1089,7 +1134,7 @@ class hr_payslip(osv.osv):
leave += days
total += perday * days
slip_line_pool.create(cr, uid, res)
slip_line_pool.create(cr, uid, res, context=context)
basic = basic - total
leaves = total
@ -1100,7 +1145,7 @@ class hr_payslip(osv.osv):
'worked_days':working_day - leave,
'working_days':working_day,
})
self.write(cr, uid, [slip.id], update)
self.write(cr, uid, [slip.id], update, context=context)
return True
@ -1203,18 +1248,20 @@ class hr_payslip_line(osv.osv):
}
_order = 'sequence'
def execute_function(self, cr, uid, id, value, context):
def execute_function(self, cr, uid, id, value, context=None):
if context is None:
context = {}
line_pool = self.pool.get('hr.payslip.line.line')
res = 0
ids = line_pool.search(cr, uid, [('slipline_id','=',id), ('from_val','<=',value), ('to_val','>=',value)])
ids = line_pool.search(cr, uid, [('slipline_id','=',id), ('from_val','<=',value), ('to_val','>=',value)], context=context)
if not ids:
ids = line_pool.search(cr, uid, [('slipline_id','=',id), ('from_val','<=',value)])
ids = line_pool.search(cr, uid, [('slipline_id','=',id), ('from_val','<=',value)], context=context)
if not ids:
return res
res = line_pool.browse(cr, uid, ids)[-1].value
res = line_pool.browse(cr, uid, ids, context=context)[-1].value
return res
hr_payslip_line()

View File

@ -32,37 +32,38 @@ class hr_payroll_create_analytic(osv.osv_memory):
}
def do_duplicate(self, cr, uid, ids, context=None):
account_pool =self.pool.get('account.analytic.account')
account_pool = self.pool.get('account.analytic.account')
func_pool = self.pool.get('hr.employee.grade')
ad_pool = self.pool.get('hr.allounce.deduction.categoty')
data = self.read(cr,uid,ids)[0]
if context is None:
context = {}
data = self.read(cr, uid, ids, context=context)[0]
tpy = data['type']
company = data['company_id']
function_ids = func_pool.search(cr, uid, [])
ad_ids = ad_pool.search(cr, uid, [])
function_ids = func_pool.search(cr, uid, [], context=context)
ad_ids = ad_pool.search(cr, uid, [], context=context)
if tpy == 'bydeg':
for function in func_pool.browse(cr, uid, function_ids):
for function in func_pool.browse(cr, uid, function_ids, context=context):
res = {
'name':function.name,
'company_id':company
}
fid = account_pool.create(cr, uid, res)
fid = account_pool.create(cr, uid, res, context=context)
res = {
'name':'Basic Salary',
'company_id':company,
'parent_id': fid
}
account_pool.create(cr, uid, res)
for ad in ad_pool.browse(cr, uid, ad_ids):
account_pool.create(cr, uid, res, context=context)
for ad in ad_pool.browse(cr, uid, ad_ids, context=context):
res = {
'name':ad.name,
'company_id':company,
'parent_id': fid
}
account_pool.create(cr, uid, res)
account_pool.create(cr, uid, res, context=context)
@ -71,28 +72,28 @@ class hr_payroll_create_analytic(osv.osv_memory):
'name':'Basic Salary',
'company_id':company
}
adid = account_pool.create(cr, uid, res)
for function in func_pool.browse(cr, uid, function_ids):
adid = account_pool.create(cr, uid, res, context=context)
for function in func_pool.browse(cr, uid, function_ids, context=context):
res = {
'name':function.name,
'company_id':company,
'parent_id': adid
}
account_pool.create(cr, uid, res)
account_pool.create(cr, uid, res, context=context)
for ad in ad_pool.browse(cr, uid, ad_ids):
for ad in ad_pool.browse(cr, uid, ad_ids, context=context):
res = {
'name':ad.name,
'company_id':company,
}
adid = account_pool.create(cr, uid, res)
for function in func_pool.browse(cr, uid, function_ids):
adid = account_pool.create(cr, uid, res, context=context)
for function in func_pool.browse(cr, uid, function_ids, context=context):
res = {
'name':function.name,
'company_id':company,
'parent_id': adid
}
account_pool.create(cr, uid, res)
account_pool.create(cr, uid, res, context=context)
return {}
hr_payroll_create_analytic()

View File

@ -31,8 +31,10 @@ class hr_payroll_employees_detail(osv.osv_memory):
'employee_ids': fields.many2many('hr.employee', 'payroll_emp_rel','payroll_id','emp_id', 'Employees',required=True),
'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal Year', required=True)
}
def _get_fiscalyear(self, cr, uid, ids, context={}):
fiscal_ids=self.pool.get('account.fiscalyear').search(cr,uid,[])
def _get_fiscalyear(self, cr, uid, ids, context=None):
if context is None:
context = {}
fiscal_ids = self.pool.get('account.fiscalyear').search(cr,uid,[], context=context)
if fiscal_ids:
return fiscal_ids[0]
return False
@ -50,7 +52,8 @@ class hr_payroll_employees_detail(osv.osv_memory):
@param context: A standard dictionary
@return : return report
"""
if context is None:
context = {}
datas = {'ids': context.get('active_ids', [])}
res = self.read(cr, uid, ids, ['employee_ids', 'fiscalyear_id'], context=context)

View File

@ -33,7 +33,9 @@ class hr_payroll_year_salary(osv.osv_memory):
}
def _get_fiscalyear(self, cr, uid, ids, context=None):
fiscal_ids=self.pool.get('account.fiscalyear').search(cr,uid,[],context=context)
if context is None:
context = {}
fiscal_ids=self.pool.get('account.fiscalyear').search(cr, uid, [], context=context)
if fiscal_ids:
return fiscal_ids[0]
return False
@ -52,7 +54,8 @@ class hr_payroll_year_salary(osv.osv_memory):
@param context: A standard dictionary
@return : return report
"""
if context is None:
context = {}
datas = {'ids': context.get('active_ids', [])}
res = self.read(cr, uid, ids, ['employee_ids', 'fiscalyear_id','salary_on'], context=context)

View File

@ -1,7 +1,7 @@
#-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
@ -22,14 +22,13 @@
import time
import netsvc
from osv import osv
from osv import fields
from datetime import date, datetime, timedelta
from osv import fields, osv
from tools import config
from tools.translate import _
from datetime import date
from datetime import datetime
from datetime import timedelta
def prev_bounds(cdate=False):
when = date.fromtimestamp(time.mktime(time.strptime(cdate,"%Y-%m-%d")))
@ -49,14 +48,14 @@ class hr_payslip(osv.osv):
'''
_inherit = 'hr.payslip'
_description = 'Pay Slip'
_columns = {
'move_ids':fields.one2many('hr.payslip.account.move', 'slip_id', 'Accounting vouchers', required=False),
'move_line_ids':fields.many2many('account.move.line', 'payslip_lines_rel', 'slip_id', 'line_id', 'Accounting Lines', readonly=True),
'move_payment_ids':fields.many2many('account.move.line', 'payslip_payment_rel', 'slip_id', 'payment_id', 'Payment Lines', readonly=True),
'period_id': fields.many2one('account.period', 'Force Period', domain=[('state','<>','done')], help="Keep empty to use the period of the validation(Payslip) date."),
}
def create_voucher(self, cr, uid, ids, name, voucher, sequence=5):
slip_move = self.pool.get('hr.payslip.account.move')
for slip in ids:
@ -67,78 +66,83 @@ class hr_payslip(osv.osv):
'name':name
}
slip_move.create(cr, uid, res)
def cancel_sheet(self, cr, uid, ids, context={}):
def cancel_sheet(self, cr, uid, ids, context=None):
move_pool = self.pool.get('account.move')
slip_move = self.pool.get('hr.payslip.account.move')
if context is None:
context = {}
move_ids = []
for slip in self.browse(cr, uid, ids, context):
for slip in self.browse(cr, uid, ids, context=context):
for line in slip.move_ids:
move_ids.append(line.id)
if line.move_id:
if line.move_id.state == 'posted':
move_pool.button_cancel(cr, uid [line.move_id.id], context)
move_pool.unlink(cr, uid, [line.move_id.id])
slip_move.unlink(cr, uid, move_ids)
self.write(cr, uid, ids, {'state':'cancel'})
move_pool.unlink(cr, uid, [line.move_id.id], context=context)
slip_move.unlink(cr, uid, move_ids, context=context)
self.write(cr, uid, ids, {'state':'cancel'}, context=context)
return True
def process_sheet(self, cr, uid, ids, context={}):
def process_sheet(self, cr, uid, ids, context=None):
move_pool = self.pool.get('account.move')
movel_pool = self.pool.get('account.move.line')
invoice_pool = self.pool.get('account.invoice')
for slip in self.browse(cr,uid,ids):
fiscalyear_pool = self.pool.get('account.fiscalyear')
period_pool = self.pool.get('account.period')
if context is None:
context = {}
for slip in self.browse(cr, uid, ids, context=context):
line_ids = []
partner = False
partner_id = False
exp_ids = []
partner = slip.employee_id.bank_account_id.partner_id
partner_id = partner.id
fiscal_year_ids = self.pool.get('account.fiscalyear').search(cr, uid, [])
fiscal_year_ids = fiscalyear_pool.search(cr, uid, [], context=context)
if not fiscal_year_ids:
raise osv.except_osv(_('Warning !'), _('Please define fiscal year for perticular contract'))
fiscal_year_objs = self.pool.get('account.fiscalyear').read(cr, uid, fiscal_year_ids, ['date_start','date_stop'])
fiscal_year_objs = fiscalyear_pool.read(cr, uid, fiscal_year_ids, ['date_start','date_stop'], context=context)
year_exist = False
for fiscal_year in fiscal_year_objs:
if ((fiscal_year['date_start'] <= slip.date) and (fiscal_year['date_stop'] >= slip.date)):
year_exist = True
if not year_exist:
raise osv.except_osv(_('Warning !'), _('Fiscal Year is not defined for slip date %s'%slip.date))
search_period = self.pool.get('account.period').search(cr,uid,[('date_start','<=',slip.date),('date_stop','>=',slip.date)])
if not search_period:
search_periods = period_pool.search(cr, uid, [('date_start','<=',slip.date),('date_stop','>=',slip.date)], context=context)
if not search_periods:
raise osv.except_osv(_('Warning !'), _('Period is not defined for slip date %s'%slip.date))
period_id = search_period[0]
period_id = search_periods[0]
name = 'Payment of Salary to %s' % (slip.employee_id.name)
move = {
'journal_id': slip.bank_journal_id.id,
'period_id': period_id,
'period_id': period_id,
'date': slip.date,
'type':'bank_pay_voucher',
'ref':slip.number,
'narration': name
}
move_id = move_pool.create(cr, uid, move)
move_id = move_pool.create(cr, uid, move, context=context)
self.create_voucher(cr, uid, [slip.id], name, move_id)
name = "To %s account" % (slip.employee_id.name)
ded_rec = {
'move_id':move_id,
'name': name,
#'partner_id': partner_id,
'date': slip.date,
'account_id': slip.employee_id.property_bank_account.id,
'date': slip.date,
'account_id': slip.employee_id.property_bank_account.id,
'debit': 0.0,
'credit' : slip.total_pay,
'journal_id' : slip.journal_id.id,
'period_id' :period_id,
'ref':slip.number
}
line_ids += [movel_pool.create(cr, uid, ded_rec)]
line_ids += [movel_pool.create(cr, uid, ded_rec, context=context)]
name = "By %s account" % (slip.employee_id.property_bank_account.name)
cre_rec = {
'move_id':move_id,
@ -152,8 +156,8 @@ class hr_payslip(osv.osv):
'period_id' :period_id,
'ref':slip.number
}
line_ids += [movel_pool.create(cr, uid, cre_rec)]
line_ids += [movel_pool.create(cr, uid, cre_rec, context=context)]
other_pay = slip.other_pay
#Process all Reambuse Entries
for line in slip.line_ids:
@ -169,40 +173,40 @@ class hr_payslip(osv.osv):
invoice_pool.pay_and_reconcile(cr, uid, invids, amount, acc_id, period_id, journal_id, False, period_id, False, context, name)
other_pay -= amount
#TODO: link this account entries to the Payment Lines also Expanse Entries to Account Lines
l_ids = movel_pool.search(cr, uid, [('name','=',name)])
l_ids = movel_pool.search(cr, uid, [('name','=',name)], context=context)
line_ids += l_ids
l_ids = movel_pool.search(cr, uid, [('invoice','=',line.expanse_id.invoice_id.id)])
l_ids = movel_pool.search(cr, uid, [('invoice','=',line.expanse_id.invoice_id.id)], context=context)
exp_ids += l_ids
#Process for Other payment if any
other_move_id = False
if slip.other_pay > 0:
narration = 'Payment of Other Payeble amounts to %s' % (slip.employee_id.name)
move = {
'journal_id': slip.bank_journal_id.id,
'period_id': period_id,
'period_id': period_id,
'date': slip.date,
'type':'bank_pay_voucher',
'ref':slip.number,
'narration': narration
}
other_move_id = move_pool.create(cr, uid, move)
other_move_id = move_pool.create(cr, uid, move, context=context)
self.create_voucher(cr, uid, [slip.id], narration, move_id)
name = "To %s account" % (slip.employee_id.name)
ded_rec = {
'move_id':other_move_id,
'name':name,
'date':slip.date,
'account_id':slip.employee_id.property_bank_account.id,
'date':slip.date,
'account_id':slip.employee_id.property_bank_account.id,
'debit': 0.0,
'credit': other_pay,
'journal_id':slip.journal_id.id,
'period_id':period_id,
'ref':slip.number
}
line_ids += [movel_pool.create(cr, uid, ded_rec)]
line_ids += [movel_pool.create(cr, uid, ded_rec, context=context)]
name = "By %s account" % (slip.employee_id.property_bank_account.name)
cre_rec = {
'move_id':other_move_id,
@ -216,85 +220,94 @@ class hr_payslip(osv.osv):
'period_id':period_id,
'ref':slip.number
}
line_ids += [movel_pool.create(cr, uid, cre_rec)]
line_ids += [movel_pool.create(cr, uid, cre_rec, context=context)]
rec = {
'state':'done',
'move_payment_ids':[(6, 0, line_ids)],
'paid':True
}
self.write(cr, uid, [slip.id], rec)
self.write(cr, uid, [slip.id], rec, context=context)
for exp_id in exp_ids:
self.write(cr, uid, [slip.id], {'move_line_ids':[(4, exp_id)]})
self.write(cr, uid, [slip.id], {'move_line_ids':[(4, exp_id)]}, context=context)
return True
def account_check_sheet(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'accont_check'})
def account_check_sheet(self, cr, uid, ids, context=None):
if context is None:
context = {}
self.write(cr, uid, ids, {'state':'accont_check'}, context=context)
return True
def hr_check_sheet(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'hr_check'})
def hr_check_sheet(self, cr, uid, ids, context=None):
if context is None:
context = {}
self.write(cr, uid, ids, {'state':'hr_check'}, context=context)
return True
def verify_sheet(self, cr, uid, ids, context={}):
def verify_sheet(self, cr, uid, ids, context=None):
move_pool = self.pool.get('account.move')
movel_pool = self.pool.get('account.move.line')
exp_pool = self.pool.get('hr.expense.expense')
for slip in self.browse(cr,uid,ids):
fiscalyear_pool = self.pool.get('account.fiscalyear')
period_pool = self.pool.get('account.period')
property_pool = self.pool.get('ir.property')
payslip_pool = self.pool.get('hr.payslip.line')
if context is None:
context = {}
for slip in self.browse(cr, uid, ids, context=context):
total_deduct = 0.0
line_ids = []
partner = False
partner_id = False
if not slip.employee_id.bank_account_id:
raise osv.except_osv(_('Integrity Error !'), _('Please defined bank account for %s !' % (slip.employee_id.name)))
if not slip.employee_id.bank_account_id.partner_id:
raise osv.except_osv(_('Integrity Error !'), _('Please defined partner in bank account for %s !' % (slip.employee_id.name)))
partner = slip.employee_id.bank_account_id.partner_id
partner_id = slip.employee_id.bank_account_id.partner_id.id
period_id = False
if slip.period_id:
period_id = slip.period_id.id
else:
fiscal_year_ids = self.pool.get('account.fiscalyear').search(cr, uid, [])
fiscal_year_ids = fiscalyear_pool.search(cr, uid, [], context=context)
if not fiscal_year_ids:
raise osv.except_osv(_('Warning !'), _('Please define fiscal year for perticular contract'))
fiscal_year_objs = self.pool.get('account.fiscalyear').read(cr, uid, fiscal_year_ids, ['date_start','date_stop'])
fiscal_year_objs = fiscalyear_pool.read(cr, uid, fiscal_year_ids, ['date_start','date_stop'], context=context)
year_exist = False
for fiscal_year in fiscal_year_objs:
if ((fiscal_year['date_start'] <= slip.date) and (fiscal_year['date_stop'] >= slip.date)):
year_exist = True
if not year_exist:
raise osv.except_osv(_('Warning !'), _('Fiscal Year is not defined for slip date %s'%slip.date))
search_period = self.pool.get('account.period').search(cr,uid,[('date_start','<=',slip.date),('date_stop','>=',slip.date)])
if not search_period:
search_periods = period_pool.search(cr,uid,[('date_start','<=',slip.date),('date_stop','>=',slip.date)], context=context)
if not search_periods:
raise osv.except_osv(_('Warning !'), _('Period is not defined for slip date %s'%slip.date))
period_id = search_period[0]
period_id = search_periods[0]
move = {
#'name': slip.name,
#'name': slip.name,
'journal_id': slip.journal_id.id,
'period_id': period_id,
'period_id': period_id,
'date': slip.date,
'ref':slip.number,
'narration': slip.name
}
move_id = move_pool.create(cr, uid, move)
move_id = move_pool.create(cr, uid, move, context=context)
self.create_voucher(cr, uid, [slip.id], slip.name, move_id)
line = {
'move_id':move_id,
'name': "By Basic Salary / " + slip.employee_id.name,
'date': slip.date,
'account_id': slip.employee_id.salary_account.id,
'account_id': slip.employee_id.salary_account.id,
'debit': slip.basic,
'credit': 0.0,
'quantity':slip.working_days,
@ -303,20 +316,20 @@ class hr_payslip(osv.osv):
'analytic_account_id': False,
'ref':slip.number
}
#Setting Analysis Account for Basic Salary
if slip.employee_id.analytic_account:
line['analytic_account_id'] = slip.employee_id.analytic_account.id
move_line_id = movel_pool.create(cr, uid, line)
move_line_id = movel_pool.create(cr, uid, line, context=context)
line_ids += [move_line_id]
line = {
'move_id':move_id,
'name': "To Basic Paysble Salary / " + slip.employee_id.name,
'partner_id': partner_id,
'date': slip.date,
'account_id': slip.employee_id.employee_account.id,
'date': slip.date,
'account_id': slip.employee_id.employee_account.id,
'debit': 0.0,
'quantity':slip.working_days,
'credit': slip.basic,
@ -324,20 +337,20 @@ class hr_payslip(osv.osv):
'period_id': period_id,
'ref':slip.number
}
line_ids += [movel_pool.create(cr, uid, line)]
line_ids += [movel_pool.create(cr, uid, line, context=context)]
for line in slip.line_ids:
name = "[%s] - %s / %s" % (line.code, line.name, slip.employee_id.name)
amount = line.total
if line.type == 'leaves':
continue
rec = {
'move_id':move_id,
'name': name,
'date': slip.date,
'account_id': line.account_id.id,
'date': slip.date,
'account_id': line.account_id.id,
'debit': 0.0,
'credit' : 0.0,
'journal_id' : slip.journal_id.id,
@ -346,13 +359,13 @@ class hr_payslip(osv.osv):
'ref':slip.number,
'quantity':1
}
#Setting Analysis Account for Salary Slip Lines
if line.analytic_account_id:
rec['analytic_account_id'] = line.analytic_account_id.id
else:
else:
rec['analytic_account_id'] = slip.deg_id.account_id.id
if line.type == 'allowance' or line.type == 'otherpay':
rec['debit'] = amount
if not partner.property_account_payable:
@ -361,8 +374,8 @@ class hr_payslip(osv.osv):
'move_id':move_id,
'name': name,
'partner_id': partner_id,
'date': slip.date,
'account_id': partner.property_account_payable.id,
'date': slip.date,
'account_id': partner.property_account_payable.id,
'debit': 0.0,
'quantity':1,
'credit' : amount,
@ -370,7 +383,7 @@ class hr_payslip(osv.osv):
'period_id' :period_id,
'ref':slip.number
}
line_ids += [movel_pool.create(cr, uid, ded_rec)]
line_ids += [movel_pool.create(cr, uid, ded_rec, context=context)]
elif line.type == 'deduction' or line.type == 'otherdeduct':
if not partner.property_account_receivable:
raise osv.except_osv(_('Integrity Error !'), _('Please Configure Partners Receivable Account!!'))
@ -380,24 +393,24 @@ class hr_payslip(osv.osv):
'move_id':move_id,
'name': name,
'partner_id': partner_id,
'date': slip.date,
'date': slip.date,
'quantity':1,
'account_id': partner.property_account_receivable.id,
'account_id': partner.property_account_receivable.id,
'debit': amount,
'credit' : 0.0,
'journal_id' : slip.journal_id.id,
'period_id' :period_id,
'ref':slip.number
}
line_ids += [movel_pool.create(cr, uid, ded_rec)]
line_ids += [movel_pool.create(cr, uid, rec)]
line_ids += [movel_pool.create(cr, uid, ded_rec, context=context)]
line_ids += [movel_pool.create(cr, uid, rec, context=context)]
for contrub in line.category_id.contribute_ids:
print contrib.name, contrub.code, contrub.amount_type, contrib.contribute_per, line.total
# if line.company_contrib > 0:
# company_contrib = line.company_contrib
## if line.category_id.amount_type == 'per':
@ -405,9 +418,9 @@ class hr_payslip(osv.osv):
# narration = """Company Contribution of %s Encode same as a Company Expanse @ %s""" % (line.name, company_contrib)
# move = {
# #'name': slip.name,
# #'name': slip.name,
# 'journal_id': slip.journal_id.id,
# 'period_id': period_id,
# 'period_id': period_id,
# 'date': slip.date,
# 'ref':slip.number,
# 'narration': narration
@ -415,11 +428,11 @@ class hr_payslip(osv.osv):
# company_contrib_move_id = move_pool.create(cr, uid, move)
# name = "[%s] - %s / %s - Company Contribution" % (line.code, line.name, slip.employee_id.name)
# self.create_voucher(cr, uid, [slip.id], name, company_contrib_move_id)
#
#
# ded_deb = {
# 'move_id':company_contrib_move_id,
# 'name': name,
# 'date': slip.date,
# 'date': slip.date,
# 'quantity':1,
# 'account_id': line.category_id.account_id.id,
# 'debit': company_contrib,
@ -432,7 +445,7 @@ class hr_payslip(osv.osv):
# ded_cre = {
# 'move_id':company_contrib_move_id,
# 'name': name,
# 'date': slip.date,
# 'date': slip.date,
# 'quantity':1,
# 'account_id': line.category_id.register_id.account_id.id,
# 'debit': 0.0,
@ -442,26 +455,26 @@ class hr_payslip(osv.osv):
# 'ref':slip.number
# }
# line_ids += [movel_pool.create(cr, uid, ded_cre)]
#
#
# if line.category_id.include_in_salary:
# narration = """Company Contribution of %s Deducted from Employee %s""" % (line.name, company_contrib)
# move = {
# #'name': slip.name,
# #'name': slip.name,
# 'journal_id': slip.journal_id.id,
# 'period_id': period_id,
# 'period_id': period_id,
# 'date': slip.date,
# 'ref':slip.number,
# 'narration': narration
# }
# include_in_salary_move_id = move_pool.create(cr, uid, move)
# self.create_voucher(cr, uid, [slip.id], narration, include_in_salary_move_id)
#
#
# total_deduct += company_contrib
# ded_deb = {
# 'move_id':include_in_salary_move_id,
# 'name': name,
# 'partner_id': partner_id,
# 'date': slip.date,
# 'date': slip.date,
# 'quantity':1,
# 'account_id': partner.property_account_receivable.id,
# 'debit': company_contrib,
@ -474,7 +487,7 @@ class hr_payslip(osv.osv):
# ded_cre = {
# 'move_id':include_in_salary_move_id,
# 'name': name,
# 'date': slip.date,
# 'date': slip.date,
# 'quantity':1,
# 'account_id': line.category_id.account_id.id,
# 'debit': 0.0,
@ -497,14 +510,14 @@ class hr_payslip(osv.osv):
# }
# if line.category_id.contribute:
# ctr['comp_deduction'] = amount
#
#
# company = 0.0
# employee = 0.0
# if line.category_id.contribute and line.category_id.include_in_salary and line.category_id.amount_type == 'per':
# new_amount = (amount * (line.category_id.contribute_per / (1+line.category_id.contribute_per)))
# company = new_amount
# employee = amount - company
#
#
# elif line.category_id.contribute and line.category_id.include_in_salary and line.category_id.amount_type == 'fix':
# company = line.category_id.contribute_per
# employee = amount - company
@ -512,11 +525,11 @@ class hr_payslip(osv.osv):
# elif line.category_id.contribute and line.category_id.include_in_salary and line.category_id.amount_type == 'func':
# company = self.pool.get('hr.allounce.deduction.categoty').execute_function(cr, uid, line.category_id.id, line.slip_id.basic, context)
# employee = amount
#
#
# elif line.category_id.contribute and not line.category_id.include_in_salary and line.category_id.amount_type == 'per':
# company = amount * line.category_id.contribute_per
# employee = amount
#
#
# elif line.category_id.contribute and not line.category_id.include_in_salary and line.category_id.amount_type == 'fix':
# company = line.category_id.contribute_per
# employee = amount
@ -524,10 +537,10 @@ class hr_payslip(osv.osv):
# elif line.category_id.contribute and not line.category_id.include_in_salary and line.category_id.amount_type == 'func':
# company = self.pool.get('hr.allounce.deduction.categoty').execute_function(cr, uid, line.category_id.id, line.slip_id.basic, context)
# employee = amount
#
#
# ctr['emp_deduction'] = employee
# ctr['comp_deduction'] = company
#
#
# self.pool.get('hr.contibution.register.line').create(cr, uid, ctr)
adj_move_id = False
@ -539,16 +552,16 @@ class hr_payslip(osv.osv):
'ref':slip.number,
'narration': 'Adjustment : %s' % (slip.name)
}
adj_move_id = move_pool.create(cr, uid, move)
adj_move_id = move_pool.create(cr, uid, move, context=context)
name = "Adjustment Entry - %s" % (slip.employee_id.name)
self.create_voucher(cr, uid, [slip.id], name, adj_move_id)
ded_rec = {
'move_id':adj_move_id,
'name': name,
'partner_id': partner_id,
'date': slip.date,
'account_id': partner.property_account_receivable.id,
'date': slip.date,
'account_id': partner.property_account_receivable.id,
'debit': 0.0,
'quantity':1,
'credit' : total_deduct,
@ -556,13 +569,13 @@ class hr_payslip(osv.osv):
'period_id' :period_id,
'ref':slip.number
}
line_ids += [movel_pool.create(cr, uid, ded_rec)]
line_ids += [movel_pool.create(cr, uid, ded_rec, context=context)]
cre_rec = {
'move_id':adj_move_id,
'name': name,
'partner_id': partner_id,
'date': slip.date,
'account_id': partner.property_account_payable.id,
'account_id': partner.property_account_payable.id,
'debit': total_deduct,
'quantity':1,
'credit' : 0.0,
@ -570,7 +583,7 @@ class hr_payslip(osv.osv):
'period_id' :period_id,
'ref':slip.number
}
line_ids += [movel_pool.create(cr, uid, cre_rec)]
line_ids += [movel_pool.create(cr, uid, cre_rec, context=context)]
rec = {
'state':'confirm',
@ -578,12 +591,12 @@ class hr_payslip(osv.osv):
}
if not slip.period_id:
rec['period_id'] = period_id
dates = prev_bounds(slip.date)
exp_ids = exp_pool.search(cr, uid, [('date_valid','>=',dates[0]), ('date_valid','<=',dates[1]), ('state','=','invoiced')])
exp_ids = exp_pool.search(cr, uid, [('date_valid','>=',dates[0]), ('date_valid','<=',dates[1]), ('state','=','invoiced')], context=context)
if exp_ids:
acc = self.pool.get('ir.property').get(cr, uid, 'property_account_expense_categ', 'product.category')
for exp in exp_pool.browse(cr, uid, exp_ids):
acc = property_pool.get(cr, uid, 'property_account_expense_categ', 'product.category')
for exp in exp_pool.browse(cr, uid, exp_ids, context=context):
exp_res = {
'name':exp.name,
'amount_type':'fix',
@ -594,12 +607,12 @@ class hr_payslip(osv.osv):
'expanse_id':exp.id,
'account_id':acc
}
self.pool.get('hr.payslip.line').create(cr, uid, exp_res)
self.write(cr, uid, [slip.id], rec)
payslip_pool.create(cr, uid, exp_res, context=context)
self.write(cr, uid, [slip.id], rec, context=context)
return True
hr_payslip()
class account_move_link_slip(osv.osv):

View File

@ -136,11 +136,14 @@ class hr_applicant(osv.osv, crm.crm_case):
'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
}
def onchange_job(self,cr, uid, ids, job, context={}):
def onchange_job(self,cr, uid, ids, job, context=None):
job_obj = self.pool.get('hr.job')
if context is None:
context = {}
result = {}
if job:
job_obj = self.pool.get('hr.job')
result['department_id'] = job_obj.browse(cr, uid, job).department_id.id
result['department_id'] = job_obj.browse(cr, uid, job, context=context).department_id.id
return {'value': result}
return {'value': {'department_id': []}}
@ -152,14 +155,15 @@ class hr_applicant(osv.osv, crm.crm_case):
@param uid: the current users ID for security checks,
@param ids: List of case IDs
@param context: A standard dictionary for contextual values"""
stage_obj = self.pool.get('hr.recruitment.stage')
if not context:
context = {}
for case in self.browse(cr, uid, ids, context):
for case in self.browse(cr, uid, ids, context=context):
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, ['|',('department_id','=',department),('department_id','=',False)])
stage_ids = stage_obj.search(cr, uid, ['|',('department_id','=',department),('department_id','=',False)], context=context)
if st and stage_ids.index(st):
self.write(cr, uid, [case.id], {'stage_id': stage_ids[stage_ids.index(st)-1]})
self.write(cr, uid, [case.id], {'stage_id': stage_ids[stage_ids.index(st)-1]}, context=context)
return True
def stage_next(self, cr, uid, ids, context=None):
@ -170,14 +174,15 @@ class hr_applicant(osv.osv, crm.crm_case):
@param uid: the current users ID for security checks,
@param ids: List of case IDs
@param context: A standard dictionary for contextual values"""
stage_obj = self.pool.get('hr.recruitment.stage')
if not context:
context = {}
for case in self.browse(cr, uid, ids, context):
for case in self.browse(cr, uid, ids, context=context):
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, ['|',('department_id','=',department),('department_id','=',False)])
stage_ids = stage_obj.search(cr, uid, ['|',('department_id','=',department),('department_id','=',False)], context=context)
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]})
self.write(cr, uid, [case.id], {'stage_id': stage_ids[stage_ids.index(st)+1]}, context=context)
return True
def action_makeMeeting(self, cr, uid, ids, context=None):
@ -191,13 +196,14 @@ class hr_applicant(osv.osv, crm.crm_case):
@return : Dictionary value for created Meeting view
"""
data_obj = self.pool.get('ir.model.data')
if context is None:
context = {}
value = {}
for opp in self.browse(cr, uid, ids):
data_obj = self.pool.get('ir.model.data')
for opp in self.browse(cr, uid, ids, context=context):
# Get meeting views
result = data_obj._get_id(cr, uid, 'crm', 'view_crm_case_meetings_filter')
res = data_obj.read(cr, uid, result, ['res_id'])
res = data_obj.read(cr, uid, result, ['res_id'], context=context)
id1 = data_obj._get_id(cr, uid, 'crm', 'crm_case_calendar_view_meet')
id2 = data_obj._get_id(cr, uid, 'crm', 'crm_case_form_view_meet')
id3 = data_obj._get_id(cr, uid, 'crm', 'crm_case_tree_view_meet')
@ -243,13 +249,13 @@ class hr_applicant(osv.osv, crm.crm_case):
"""
if not context:
context = {}
record = self.browse(cr, uid, ids, context)
record = self.browse(cr, uid, ids, context=context)
record = record and record[0]
context.update({'survey_id': record.survey.id, 'response_id' : [record.response], 'response_no':0, })
value = self.pool.get("survey").action_print_survey(cr, uid, ids, context)
return value
def message_new(self, cr, uid, msg, context):
def message_new(self, cr, uid, msg, context=None):
"""
Automatically calls when new email message arrives
@ -257,8 +263,10 @@ class hr_applicant(osv.osv, crm.crm_case):
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks
"""
mailgate_pool = self.pool.get('email.server.tools')
attach_obj = self.pool.get('ir.attachment')
if context is None:
context = {}
subject = msg.get('subject')
body = msg.get('body')
@ -278,7 +286,7 @@ class hr_applicant(osv.osv, crm.crm_case):
res = mailgate_pool.get_partner(cr, uid, msg.get('from'))
if res:
vals.update(res)
res = self.create(cr, uid, vals, context)
res = self.create(cr, uid, vals, context=context)
message = _('A Job Request created') + " '" + subject + "' " + _("from Mailgate.")
self.log(cr, uid, res, message)
@ -293,17 +301,19 @@ class hr_applicant(osv.osv, crm.crm_case):
'res_model': self._name,
'res_id': res,
}
self.pool.get('ir.attachment').create(cr, uid, data_attach)
attach_obj.create(cr, uid, data_attach, context=context)
return res
def message_update(self, cr, uid, ids, vals={}, msg="", default_act='pending', context={}):
def message_update(self, cr, uid, ids, vals={}, msg="", default_act='pending', context=None):
"""
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of update mails IDs
"""
if context is None:
context = {}
if isinstance(ids, (str, int, long)):
ids = [ids]
@ -329,7 +339,7 @@ class hr_applicant(osv.osv, crm.crm_case):
vls[key] = res.group(2).lower()
vals.update(vls)
res = self.write(cr, uid, ids, vals)
res = self.write(cr, uid, ids, vals, context=context)
return res
def msg_send(self, cr, uid, id, *args, **argv):

View File

@ -1,50 +1,47 @@
<?xml version="1.0"?>
<openerp>
<data>
<menuitem icon="terp-hr" id="base.menu_hr" name="Human Resources"/>
<data>
######################## JOB OPPORTUNITIES (menu) ###########################
<record model="ir.actions.act_window" id="crm_case_categ0_act_job">
<field name="name">Applicants</field>
<field name="res_model">hr.applicant</field>
<field name="view_mode">tree,form,graph,calendar</field>
<field name="view_id" ref="crm_case_tree_view_job"/>
<field name="context">{"search_default_user_id":uid, 'search_default_current': 1}</field>
<field name="search_view_id" ref="view_crm_case_jobs_filter"/>
######################## JOB OPPORTUNITIES (menu) ###########################
<record model="ir.actions.act_window" id="crm_case_categ0_act_job">
<field name="name">Applicants</field>
<field name="res_model">hr.applicant</field>
<field name="view_mode">tree,form,graph,calendar</field>
<field name="view_id" ref="crm_case_tree_view_job"/>
<field name="context">{"search_default_user_id":uid, 'search_default_current': 1}</field>
<field name="search_view_id" ref="view_crm_case_jobs_filter"/>
</record>
</record>
<record model="ir.actions.act_window.view" id="action_hr_sec_tree_view_act_job">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="crm_case_tree_view_job"/>
<field name="act_window_id" ref="crm_case_categ0_act_job"/>
</record>
<record model="ir.actions.act_window.view" id="action_hr_sec_form_view_act_job">
<field name="sequence" eval="3"/>
<field name="view_mode">form</field>
<field name="view_id" ref="crm_case_form_view_job"/>
<field name="act_window_id" ref="crm_case_categ0_act_job"/>
</record>
<record model="ir.actions.act_window.view" id="action_hr_sec_graph_view_act_job">
<field name="sequence" eval="4"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="crm_case_graph_view_job"/>
<field name="act_window_id" ref="crm_case_categ0_act_job"/>
</record>
<!--<menuitem
name="Jobs - Hiring Process"
id="menu_crm_case_job_req_main"
parent="base.menu_hr"/>-->
<menuitem
name="Recruitment"
id="base.menu_crm_case_job_req_main"
parent="base.menu_hr"
sequence="1"/>
<record model="ir.actions.act_window.view" id="action_hr_sec_tree_view_act_job">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="crm_case_tree_view_job"/>
<field name="act_window_id" ref="crm_case_categ0_act_job"/>
</record>
<!--
ALL JOBS REQUESTS
-->
<menuitem name="Applicants" parent="base.menu_crm_case_job_req_main" id="menu_crm_case_categ0_act_job" action="crm_case_categ0_act_job" sequence="1"/>
<record model="ir.actions.act_window.view" id="action_hr_sec_form_view_act_job">
<field name="sequence" eval="3"/>
<field name="view_mode">form</field>
<field name="view_id" ref="crm_case_form_view_job"/>
<field name="act_window_id" ref="crm_case_categ0_act_job"/>
</record>
</data>
<record model="ir.actions.act_window.view" id="action_hr_sec_graph_view_act_job">
<field name="sequence" eval="4"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="crm_case_graph_view_job"/>
<field name="act_window_id" ref="crm_case_categ0_act_job"/>
</record>
<menuitem
name="Recruitment"
id="base.menu_crm_case_job_req_main"
parent="hr.menu_hr_root"
sequence="1"/>
<!-- ALL JOBS REQUESTS -->
<menuitem name="Applicants" parent="base.menu_crm_case_job_req_main" id="menu_crm_case_categ0_act_job" action="crm_case_categ0_act_job" sequence="1"/>
</data>
</openerp>

View File

@ -31,9 +31,11 @@ class hr_recruitment_partner_create(osv.osv_memory):
def view_init(self, cr , uid , fields_list, context=None):
case_obj = self.pool.get('hr.applicant')
for case in case_obj.browse(cr, uid, context['active_ids']):
if context is None:
context = {}
for case in case_obj.browse(cr, uid, context['active_ids'], context=context):
if case.partner_id:
raise osv.except_osv(_('Warning !'),
raise osv.except_osv(_('Error !'),
_('A partner is already defined on this job request.'))
pass
@ -45,31 +47,31 @@ class hr_recruitment_partner_create(osv.osv_memory):
if context is None:
context = {}
data = self.read(cr, uid, ids, [], context)[0]
data = self.read(cr, uid, ids, [], context=context)[0]
result = mod_obj._get_id(cr, uid, 'base', 'view_res_partner_filter')
res = mod_obj.read(cr, uid, result, ['res_id'])
res = mod_obj.read(cr, uid, result, ['res_id'], context=context)
for case in case_obj.browse(cr, uid, context['active_ids']):
partner_id = partner_obj.search(cr, uid, [('name', '=', case.partner_name or case.name)])
for case in case_obj.browse(cr, uid, context['active_ids'], context=context):
partner_id = partner_obj.search(cr, uid, [('name', '=', case.partner_name or case.name)], context=context)
if partner_id:
raise osv.except_osv(_('Warning !'),_('A partner is already existing with the same name.'))
raise osv.except_osv(_('Error !'),_('A partner is already existing with the same name.'))
partner_id = partner_obj.create(cr, uid, {
'name': case.partner_name or case.name,
'user_id': case.user_id.id,
'comment': case.description,
})
}, context=context)
contact_id = contact_obj.create(cr, uid, {
'partner_id': partner_id,
'name': case.partner_name,
'phone': case.partner_phone,
'mobile': case.partner_mobile,
'email': case.email_from
})
}, context=context)
case_obj.write(cr, uid, case.id, {
'partner_id': partner_id,
'partner_address_id': contact_id
})
}, context=context)
if data['close']:
case_obj.case_close(cr, uid, context['active_ids'])

View File

@ -9,9 +9,7 @@
<field name="arch" type="xml">
<form string="Convert To Partner">
<group col="4" colspan="6">
<label string="Are you sure you want to create a partner based on this job request ?" colspan="4"/>
<label string="You may have to verify that this partner does not exist already." colspan="4"/>
<!--field name="close"/-->
<label string="Are you sure you want to create a partner based on this job request ?"/>
</group>
<separator colspan="4"/>
<group col="2" colspan="4">
@ -31,15 +29,5 @@
<field name="target">new</field>
</record>
<!-- <record model="ir.values" id="hr_recruitment_partner_create_values">
<field name="model_id" ref="model_hr_applicant" />
<field name="object" eval="1" />
<field name="name">Create Partner</field>
<field name="key2">client_action_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_hr_recruitment_partner_create'))" />
<field name="key">action</field>
<field name="model">hr.applicant</field>
</record> -->
</data>
</openerp>

View File

@ -36,16 +36,22 @@ class job2phonecall(osv.osv_memory):
def _date_user(self, cr, uid, context=None):
case_obj = self.pool.get('hr.applicant')
case = case_obj.browse(cr, uid, context['active_id'])
if context is None:
context = {}
case = case_obj.browse(cr, uid, context['active_id'], context=context)
return case.user_id and case.user_id.id or False
def _date_category(self, cr, uid, context=None):
categ_id = self.pool.get('crm.case.categ').search(cr, uid, [('name','=','Outbound')])
if context is None:
context = {}
categ_id = self.pool.get('crm.case.categ').search(cr, uid, [('name','=','Outbound')], context=context)
return categ_id and categ_id[0] or case.categ_id and case.categ_id.id or False
def _get_note(self, cr, uid, context=None):
case_obj = self.pool.get('hr.applicant')
case = case_obj.browse(cr, uid, context['active_id'])
if context is None:
context = {}
case = case_obj.browse(cr, uid, context['active_id'], context=context)
return case.description or ''
_defaults = {
@ -59,11 +65,12 @@ class job2phonecall(osv.osv_memory):
job_case_obj = self.pool.get('hr.applicant')
data_obj = self.pool.get('ir.model.data')
phonecall_case_obj = self.pool.get('crm.phonecall')
if context is None:
context = {}
form = self.read(cr, uid, ids, [], context=context)[0]
# form = data['form']
result = mod_obj._get_id(cr, uid, 'crm', 'view_crm_case_phonecalls_filter')
res = mod_obj.read(cr, uid, result, ['res_id'])
res = mod_obj.read(cr, uid, result, ['res_id'], context=context)
# Select the view
id2 = data_obj._get_id(cr, uid, 'crm', 'crm_case_phone_tree_view')
@ -73,7 +80,7 @@ class job2phonecall(osv.osv_memory):
if id3:
id3 = data_obj.browse(cr, uid, id3, context=context).res_id
for job in job_case_obj.browse(cr, uid, context['active_ids']):
for job in job_case_obj.browse(cr, uid, context['active_ids'], context=context):
#TODO : Take other info from job
new_phonecall_id = phonecall_case_obj.create(cr, uid, {
'name' : job.name,
@ -90,11 +97,11 @@ class job2phonecall(osv.osv_memory):
'description':job.description,
'date':job.date,
}, context=context)
new_phonecall = phonecall_case_obj.browse(cr, uid, new_phonecall_id)
new_phonecall = phonecall_case_obj.browse(cr, uid, new_phonecall_id, context=context)
vals = {}
# if not job.case_id:
# vals.update({'phonecall_id' : new_phonecall.id})
job_case_obj.write(cr, uid, [job.id], vals)
job_case_obj.write(cr, uid, [job.id], vals, context=context)
job_case_obj.case_cancel(cr, uid, [job.id])
phonecall_case_obj.case_open(cr, uid, [new_phonecall_id])
@ -111,4 +118,4 @@ class job2phonecall(osv.osv_memory):
job2phonecall()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:>>>>>>> MERGE-SOURCE
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,7 +15,7 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -39,13 +39,16 @@ hr_timesheet_invoice_factor()
class account_analytic_account(osv.osv):
def _invoiced_calc(self, cr, uid, ids, name, arg, context={}):
def _invoiced_calc(self, cr, uid, ids, name, arg, context=None):
obj_invoice = self.pool.get('account.invoice')
if context is None:
context = {}
res = {}
for account in self.browse(cr, uid, ids):
for account in self.browse(cr, uid, ids, context=context):
invoiced = {}
cr.execute('select distinct(l.invoice_id) from hr_analytic_timesheet h left join account_analytic_line l on (h.line_id=l.id) where account_id=%s', (account.id,))
invoice_ids = filter(None, map(lambda x: x[0], cr.fetchall()))
for invoice in self.pool.get('account.invoice').browse(cr, uid, invoice_ids, context):
for invoice in obj_invoice.browse(cr, uid, invoice_ids, context=context):
res.setdefault(account.id, 0.0)
res[account.id] += invoice.amount_untaxed
for id in ids:
@ -73,20 +76,24 @@ account_analytic_account()
class account_analytic_line(osv.osv):
_inherit = 'account.analytic.line'
_columns = {
'invoice_id': fields.many2one('account.invoice', 'Invoice', ondelete="set null"),
'invoice_id': fields.many2one('account.invoice', 'Invoice', ondelete="set null"),
'to_invoice': fields.many2one('hr_timesheet_invoice.factor', 'Type of Invoicing'),
}
def unlink(self, cursor, user, ids, context=None):
if context is None:
context = {}
return super(account_analytic_line,self).unlink(cursor, user, ids,
context=context)
def write(self, cr, uid, ids, vals, context=None):
self._check_inv(cr, uid, ids,vals)
if context is None:
context = {}
self._check_inv(cr, uid, ids, vals)
return super(account_analytic_line,self).write(cr, uid, ids, vals,
context=context)
def _check_inv(self, cr, uid, ids,vals):
def _check_inv(self, cr, uid, ids, vals):
select = ids
if isinstance(select, (int, long)):
select = [ids]
@ -98,12 +105,14 @@ class account_analytic_line(osv.osv):
return True
def copy(self, cursor, user, obj_id, default=None, context=None):
if context is None:
context = {}
if default is None:
default = {}
default = default.copy()
default.update({'invoice_id': False})
return super(account_analytic_line, self).copy(cursor, user, obj_id,
default, context)
default, context=context)
account_analytic_line()
@ -126,12 +135,14 @@ class hr_analytic_timesheet(osv.osv):
return res
def copy(self, cursor, user, obj_id, default=None, context=None):
if context is None:
context = {}
if default is None:
default = {}
default = default.copy()
default.update({'invoice_id': False})
return super(hr_analytic_timesheet, self).copy(cursor, user, obj_id,
default, context)
default, context=context)
hr_analytic_timesheet()

View File

@ -187,7 +187,7 @@
<menuitem
action="action_hr_timesheet_invoice_factor_form"
id="hr_timesheet_invoice_factor_view"
parent="account.account_analytic_def_account"/>
parent="account.menu_low_level"/>
</data>
</openerp>

View File

@ -39,7 +39,7 @@ class hr_timesheet_analytic_cost_ledger(osv.osv_memory):
datas = {
'ids': 'active_ids' in context and context['active_ids'] or [],
'model': 'account.analytic.account',
'form': self.read(cr, uid, ids)[0]
'form': self.read(cr, uid, ids, context=context)[0]
}
return {
'type': 'ir.actions.report.xml',

View File

@ -48,16 +48,16 @@ class account_analytic_profit(osv.osv_memory):
line_obj = self.pool.get('account.analytic.line')
product_obj = self.pool.get('product.product')
price_obj = self.pool.get('product.pricelist')
data = {}
data['form'] = self.read(cr, uid , ids, [], context=context)[0]
if context is None:
context = {}
data = {}
data['form'] = self.read(cr, uid , ids, [], context=context)[0]
ids_chk = line_obj.search(cr, uid, [
('date', '>=', data['form']['date_from']),
('date', '<=', data['form']['date_to']),
('journal_id', 'in', data['form']['journal_ids']),
('user_id', 'in', data['form']['employee_ids']),
])
], context=context)
if not ids_chk:
raise osv.except_osv(_('Data Insufficient!'), _('No Records Found for Report!'))

View File

@ -46,17 +46,21 @@ class final_invoice_create(osv.osv_memory):
analytic_account_obj = self.pool.get('account.analytic.account')
res_partner_obj = self.pool.get('res.partner')
account_payment_term_obj = self.pool.get('account.payment.term')
invoice_obj = self.pool.get('account.invoice')
product_obj = self.pool.get('product.product')
fiscal_pos_obj = self.pool.get('account.fiscal.position')
invoice_line_obj = self.pool.get('account.invoice.line')
invoices = []
if context is None:
context = {}
result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
res = mod_obj.read(cr, uid, result, ['res_id'])
res = mod_obj.read(cr, uid, result, ['res_id'], context=context)
data = self.read(cr, uid, ids, [], context)[0]
data = self.read(cr, uid, ids, [], context=context)[0]
account_ids = 'active_ids' in context and context['active_ids'] or []
for account in analytic_account_obj.browse(cr, uid, account_ids, context):
for account in analytic_account_obj.browse(cr, uid, account_ids, context=context):
partner = account.partner_id
amount_total=0.0
if (not partner) or not (account.pricelist_id):
@ -77,15 +81,15 @@ class final_invoice_create(osv.osv_memory):
curr_invoice = {
'name': time.strftime('%D')+' - '+account.name,
'partner_id': account.partner_id.id,
'address_contact_id': self.pool.get('res.partner').address_get(cr, uid, [account.partner_id.id], adr_pref=['contact'])['contact'],
'address_invoice_id': self.pool.get('res.partner').address_get(cr, uid, [account.partner_id.id], adr_pref=['invoice'])['invoice'],
'address_contact_id': res_partner_obj.address_get(cr, uid, [account.partner_id.id], adr_pref=['contact'])['contact'],
'address_invoice_id': res_partner_obj.address_get(cr, uid, [account.partner_id.id], adr_pref=['invoice'])['invoice'],
'payment_term': partner.property_payment_term.id or False,
'account_id': partner.property_account_receivable.id,
'currency_id': account.pricelist_id.currency_id.id,
'date_due': date_due,
'fiscal_position': account.partner_id.property_account_position.id
}
last_invoice = self.pool.get('account.invoice').create(cr, uid, curr_invoice)
last_invoice = invoice_obj.create(cr, uid, curr_invoice, context=context)
invoices.append(last_invoice)
context2=context.copy()
@ -116,14 +120,14 @@ class final_invoice_create(osv.osv_memory):
line.product_uom_id,
move_line.ref""", (account.id,))
for product_id, amount, account_id, product_uom_id, ref in cr.fetchall():
product = self.pool.get('product.product').browse(cr, uid, product_id, context2)
product = product_obj.browse(cr, uid, product_id, context2)
if product:
taxes = product.taxes_id
else:
taxes = []
tax = self.pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id.property_account_position, taxes)
tax = fiscal_pos_obj.map_tax(cr, uid, account.partner_id.property_account_position, taxes)
curr_line = {
'price_unit': -amount,
'quantity': 1.0,
@ -136,14 +140,13 @@ class final_invoice_create(osv.osv_memory):
'account_id': account_id,
'account_analytic_id': account.id
}
self.pool.get('account.invoice.line').create(cr, uid, curr_line)
invoice_line_obj.create(cr, uid, curr_line, context=context)
if not data['balance_product']:
raise osv.except_osv(_('Balance product needed'), _('Please fill a Balance product in the wizard'))
product = self.pool.get('product.product').browse(cr, uid, data['balance_product'], context2)
product = product_obj.browse(cr, uid, data['balance_product'], context2)
taxes = product.taxes_id
tax = self.pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id.property_account_position, taxes)
tax = fiscal_pos_obj.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': account.amount_max - amount_total,
@ -157,9 +160,9 @@ class final_invoice_create(osv.osv_memory):
'account_id': account_id,
'account_analytic_id': account.id
}
self.pool.get('account.invoice.line').create(cr, uid, curr_line)
invoice_line_obj.create(cr, uid, curr_line, context=context)
if account.amount_max < amount_total:
self.pool.get('account.invoice').write(cr, uid, [last_invoice], {'type': 'out_refund',})
invoice_obj.write(cr, uid, [last_invoice], {'type': 'out_refund',}, context=context)
cr.execute('update account_analytic_line set invoice_id=%s where invoice_id is null and account_id=%s', (last_invoice, account.id))
return {

View File

@ -49,7 +49,7 @@ class hr_timesheet_invoice_create(osv.osv_memory):
if not len(context['active_ids']):
return {}
#Checking whether the analytic line is invoiced or not
analytic_line_obj = self.pool.get('account.analytic.line').browse(cr, uid, context['active_ids'], context)
analytic_line_obj = self.pool.get('account.analytic.line').browse(cr, uid, context['active_ids'], context=context)
for obj_acc in analytic_line_obj:
if obj_acc.invoice_id and obj_acc.invoice_id.state !='cancel':
raise osv.except_osv(_('Warning'),_('The analytic entry "%s" is already invoiced!')%(obj_acc.name,))
@ -67,13 +67,21 @@ class hr_timesheet_invoice_create(osv.osv_memory):
analytic_account_obj = self.pool.get('account.analytic.account')
res_partner_obj = self.pool.get('res.partner')
account_payment_term_obj = self.pool.get('account.payment.term')
invoice_obj = self.pool.get('account.invoice')
product_obj = self.pool.get('product.product')
invoice_factor_obj = self.pool.get('hr_timesheet_invoice.factor')
pro_price_obj = self.pool.get('product.pricelist')
fiscal_pos_obj = self.pool.get('account.fiscal.position')
product_uom_obj = self.pool.get('product.uom')
invoice_line_obj = self.pool.get('account.invoice.line')
invoices = []
if context is None:
context = {}
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]
res = mod_obj.read(cr, uid, result, ['res_id'], context=context)
data = self.read(cr, uid, ids, [], context=context)[0]
account_ids = data['accounts']
for account in analytic_account_obj.browse(cr, uid, account_ids, context):
for account in analytic_account_obj.browse(cr, uid, account_ids, context=context):
partner = account.partner_id
if (not partner) or not (account.pricelist_id):
raise osv.except_osv(_('Analytic Account incomplete'),
@ -106,7 +114,7 @@ class hr_timesheet_invoice_create(osv.osv_memory):
'date_due': date_due,
'fiscal_position': account.partner_id.property_account_position.id
}
last_invoice = self.pool.get('account.invoice').create(cr, uid, curr_invoice)
last_invoice = invoice_obj.create(cr, uid, curr_invoice, context=context)
invoices.append(last_invoice)
context2 = context.copy()
@ -115,14 +123,14 @@ class hr_timesheet_invoice_create(osv.osv_memory):
"FROM account_analytic_line as line " \
"WHERE account_id = %s " \
"AND id IN %s AND to_invoice IS NOT NULL " \
"GROUP BY product_id,to_invoice", (account.id,tuple(context['active_ids']),))
"GROUP BY product_id,to_invoice", (account.id, tuple(context['active_ids']),))
for product_id,factor_id,qty in cr.fetchall():
product = self.pool.get('product.product').browse(cr, uid, product_id, context2)
for product_id, factor_id, qty in cr.fetchall():
product = product_obj.browse(cr, uid, product_id, context2)
if not product:
raise osv.except_osv(_('Error'), _('At least one line has no product !'))
factor_name = ''
factor = self.pool.get('hr_timesheet_invoice.factor').browse(cr, uid, factor_id, context2)
factor = invoice_factor_obj.browse(cr, uid, factor_id, context2)
if not data['product']:
if factor.customer_name:
@ -130,16 +138,16 @@ class hr_timesheet_invoice_create(osv.osv_memory):
else:
factor_name = product.name
else:
factor_name = self.pool.get('product.product').name_get(cr, uid, [data['product']], context=context)[0][1]
factor_name = product_obj.name_get(cr, uid, [data['product']], context=context)[0][1]
if account.pricelist_id:
pl = account.pricelist_id.id
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]
price = pro_price_obj.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 = self.pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id.property_account_position, taxes)
tax = fiscal_pos_obj.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,
@ -169,7 +177,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'], self.pool.get('product.uom').browse(cr, uid, [line['product_uom_id']],context2)[0].name))
details.append("%s %s" % (line['unit_amount'], product_uom_obj.browse(cr, uid, [line['product_uom_id']],context2)[0].name))
else:
details.append("%s" % (line['unit_amount'], ))
if data['name']:
@ -179,17 +187,17 @@ 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))
self.pool.get('account.invoice.line').create(cr, uid, curr_line)
invoice_line_obj.create(cr, uid, curr_line, context=context)
cr.execute("update account_analytic_line set invoice_id=%s WHERE account_id = %s and id IN %s" ,(last_invoice, account.id,tuple(data['ids'])))
self.pool.get('account.invoice').button_reset_taxes(cr, uid, [last_invoice], context)
invoice_obj.button_reset_taxes(cr, uid, [last_invoice], context)
mod_obj = self.pool.get('ir.model.data')
act_obj = self.pool.get('ir.actions.act_window')
mod_id = mod_obj.search(cr, uid, [('name', '=', 'action_invoice_tree1')])[0]
res_id = mod_obj.read(cr, uid, mod_id, ['res_id'])['res_id']
act_win = act_obj.read(cr, uid, res_id, [])
mod_ids = mod_obj.search(cr, uid, [('name', '=', 'action_invoice_tree1')], context=context)[0]
res_id = mod_obj.read(cr, uid, mod_ids, ['res_id'], context=context)['res_id']
act_win = act_obj.read(cr, uid, res_id, [], context=context)
act_win['domain'] = [('id','in',invoices),('type','=','out_invoice')]
act_win['name'] = _('Invoices')
return act_win

View File

@ -20,10 +20,9 @@
##############################################################################
import time
from osv import fields
from osv import osv
import netsvc
from osv import fields, osv
from mx import DateTime
from tools.translate import _
@ -139,7 +138,7 @@ class hr_timesheet_sheet(osv.osv):
for sheet in self.browse(cr, uid, ids, context=context):
result[sheet.id] = 'none'
emp_ids2 = emp_obj.search(cr, uid,
[('user_id', '=', sheet.user_id.id)])
[('user_id', '=', sheet.user_id.id)], context=context)
if emp_ids2:
link_emp[emp_ids2[0]] = sheet.id
emp_ids.append(emp_ids2[0])
@ -169,11 +168,11 @@ class hr_timesheet_sheet(osv.osv):
context = {}
for sheet in self.browse(cr, uid, ids, context=context):
if DateTime.now() <= DateTime.strptime(sheet.date_from, '%Y-%m-%d'):
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_from,})
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_from,}, context=context)
elif DateTime.now() >= DateTime.strptime(sheet.date_to, '%Y-%m-%d'):
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_to,})
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_to,}, context=context)
else:
self.write(cr, uid, [sheet.id], {'date_current': time.strftime('%Y-%m-%d')})
self.write(cr, uid, [sheet.id], {'date_current': time.strftime('%Y-%m-%d')}, context=context)
return True
def date_previous(self, cr, uid, ids, context=None):
@ -181,11 +180,11 @@ class hr_timesheet_sheet(osv.osv):
context = {}
for sheet in self.browse(cr, uid, ids, context=context):
if DateTime.strptime(sheet.date_current, '%Y-%m-%d') <= DateTime.strptime(sheet.date_from, '%Y-%m-%d'):
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_from,})
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_from,}, context=context)
else:
self.write(cr, uid, [sheet.id], {
'date_current': (DateTime.strptime(sheet.date_current, '%Y-%m-%d') + DateTime.RelativeDateTime(days=-1)).strftime('%Y-%m-%d'),
})
}, context=context)
return True
def date_next(self, cr, uid, ids, context=None):
@ -193,11 +192,11 @@ class hr_timesheet_sheet(osv.osv):
context = {}
for sheet in self.browse(cr, uid, ids, context=context):
if DateTime.strptime(sheet.date_current, '%Y-%m-%d') >= DateTime.strptime(sheet.date_to, '%Y-%m-%d'):
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_to,})
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_to,}, context=context)
else:
self.write(cr, uid, [sheet.id], {
'date_current': (DateTime.strptime(sheet.date_current, '%Y-%m-%d') + DateTime.RelativeDateTime(days=1)).strftime('%Y-%m-%d'),
})
}, context=context)
return True
def button_dummy(self, cr, uid, ids, context=None):
@ -205,31 +204,31 @@ class hr_timesheet_sheet(osv.osv):
context = {}
for sheet in self.browse(cr, uid, ids, context=context):
if DateTime.strptime(sheet.date_current, '%Y-%m-%d') <= DateTime.strptime(sheet.date_from, '%Y-%m-%d'):
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_from,})
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_from,}, context=context)
elif DateTime.strptime(sheet.date_current, '%Y-%m-%d') >= DateTime.strptime(sheet.date_to, '%Y-%m-%d'):
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_to,})
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_to,}, context=context)
return True
def sign_in(self, cr, uid, ids, context=None):
emp_obj = self.pool.get('hr.employee')
if context is None:
context = {}
if not self.browse(cr, uid, ids, context)[0].date_current == time.strftime('%Y-%m-%d'):
if not self.browse(cr, uid, ids, context=context)[0].date_current == time.strftime('%Y-%m-%d'):
raise osv.except_osv(_('Error !'), _('You can not sign in from an other date than today'))
emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid)])
emp_ids = emp_obj.search(cr, uid, [('user_id', '=', uid)], context=context)
context['sheet_id']=ids[0]
success = emp_obj.attendance_action_change(cr, uid, emp_id, type='sign_in', context=context,)
success = emp_obj.attendance_action_change(cr, uid, emp_ids, type='sign_in', context=context,)
return True
def sign_out(self, cr, uid, ids, context=None):
emp_obj = self.pool.get('hr.employee')
if context is None:
context = {}
if not self.browse(cr, uid, ids, context)[0].date_current == time.strftime('%Y-%m-%d'):
if not self.browse(cr, uid, ids, context=context)[0].date_current == time.strftime('%Y-%m-%d'):
raise osv.except_osv(_('Error !'), _('You can not sign out from an other date than today'))
emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid)])
emp_ids = emp_obj.search(cr, uid, [('user_id', '=', uid)])
context['sheet_id']=ids[0]
success = emp_obj.attendance_action_change(cr, uid, emp_id, type='sign_out', context=context,)
success = emp_obj.attendance_action_change(cr, uid, emp_ids, type='sign_out', context=context,)
return True
_columns = {
@ -268,7 +267,9 @@ class hr_timesheet_sheet(osv.osv):
'department_id':fields.many2one('hr.department','Department'),
}
def _default_date_from(self,cr, uid, context={}):
def _default_date_from(self,cr, uid, context=None):
if context is None:
context = {}
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
r = user.company_id and user.company_id.timesheet_range or 'month'
if r=='month':
@ -279,7 +280,7 @@ class hr_timesheet_sheet(osv.osv):
return time.strftime('%Y-01-01')
return time.strftime('%Y-%m-%d')
def _default_date_to(self,cr, uid, context={}):
def _default_date_to(self,cr, uid, context=None):
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
r = user.company_id and user.company_id.timesheet_range or 'month'
if r=='month':
@ -330,17 +331,19 @@ class hr_timesheet_sheet(osv.osv):
wf_service.trg_create(uid, self._name, id, cr)
return True
def name_get(self, cr, uid, ids, context={}):
def name_get(self, cr, uid, ids, context=None):
if context is None:
context = {}
if not len(ids):
return []
return [(r['id'], r['date_from'] + ' - ' + r['date_to']) \
for r in self.read(cr, uid, ids, ['date_from', 'date_to'],
context, load='_classic_write')]
context=context, load='_classic_write')]
def unlink(self, cr, uid, ids, context=None):
if context is None:
context = {}
sheets = self.read(cr, uid, ids, ['state','total_attendance'])
sheets = self.read(cr, uid, ids, ['state','total_attendance'], context=context)
for sheet in sheets:
if sheet['state'] in ('confirm', 'done'):
raise osv.except_osv(_('Invalid action !'), _('Cannot delete Sheet(s) which are already confirmed !'))
@ -354,14 +357,17 @@ hr_timesheet_sheet()
class hr_timesheet_line(osv.osv):
_inherit = "hr.analytic.timesheet"
def _get_default_date(self, cr, uid, context={}):
def _get_default_date(self, cr, uid, context=None):
if context is None:
context = {}
if 'date' in context:
return context['date']
return time.strftime('%Y-%m-%d')
def _sheet(self, cursor, user, ids, name, args, context):
def _sheet(self, cursor, user, ids, name, args, context=None):
sheet_obj = self.pool.get('hr_timesheet_sheet.sheet')
if context is None:
context = {}
cursor.execute('SELECT l.id, COALESCE(MAX(s.id), 0) \
FROM hr_timesheet_sheet_sheet s \
LEFT JOIN (hr_analytic_timesheet l \
@ -386,6 +392,8 @@ class hr_timesheet_line(osv.osv):
return res
def _sheet_search(self, cursor, user, obj, name, args, context=None):
if context is None:
context = {}
if not len(args):
return []
sheet_obj = self.pool.get('hr_timesheet_sheet.sheet')
@ -395,7 +403,7 @@ class hr_timesheet_line(osv.osv):
fargs = args[i][0].split('.', 1)
if len(fargs) > 1:
args[i] = (fargs[0], 'in', sheet_obj.search(cursor, user,
[(fargs[1], args[i][1], args[i][2])]))
[(fargs[1], args[i][1], args[i][2])], context=context))
i += 1
continue
if isinstance(args[i][2], basestring):
@ -472,12 +480,16 @@ hr_timesheet_line()
class hr_attendance(osv.osv):
_inherit = "hr.attendance"
def _get_default_date(self, cr, uid, context={}):
def _get_default_date(self, cr, uid, context=None):
if context is None:
context = {}
if 'name' in context:
return context['name'] + time.strftime(' %H:%M:%S')
return time.strftime('%Y-%m-%d %H:%M:%S')
def _sheet(self, cursor, user, ids, name, args, context):
def _sheet(self, cursor, user, ids, name, args, context=None):
if context is None:
context = {}
sheet_obj = self.pool.get('hr_timesheet_sheet.sheet')
cursor.execute("SELECT a.id, COALESCE(MAX(s.id), 0) \
FROM hr_timesheet_sheet_sheet s \
@ -506,14 +518,16 @@ class hr_attendance(osv.osv):
def _sheet_search(self, cursor, user, obj, name, args, context=None):
if not len(args):
return []
sheet_obj = self.pool.get('hr_timesheet_sheet.sheet')
sheet_obj = self.pool.get('hr_timesheet_sheet.sheet')
if context is None:
context = {}
i = 0
while i < len(args):
fargs = args[i][0].split('.', 1)
if len(fargs) > 1:
args[i] = (fargs[0], 'in', sheet_obj.search(cursor, user,
[(fargs[1], args[i][1], args[i][2])]))
[(fargs[1], args[i][1], args[i][2])], context=context))
i += 1
continue
if isinstance(args[i][2], basestring):
@ -570,7 +584,7 @@ class hr_attendance(osv.osv):
if context is None:
context = {}
if 'sheet_id' in context:
ts = self.pool.get('hr_timesheet_sheet.sheet').browse(cr, uid, context['sheet_id'])
ts = self.pool.get('hr_timesheet_sheet.sheet').browse(cr, uid, context['sheet_id'], context=context)
if ts.state not in ('draft', 'new'):
raise osv.except_osv(_('Error !'), _('You cannot modify an entry in a confirmed timesheet !'))
res = super(hr_attendance,self).create(cr, uid, vals, context=context)
@ -584,7 +598,7 @@ class hr_attendance(osv.osv):
self._check(cr, uid, ids)
return super(hr_attendance,self).unlink(cr, uid, ids,*args, **kwargs)
def write(self, cr, uid, ids, vals, context={}):
def write(self, cr, uid, ids, vals, context=None):
if context is None:
context = {}
self._check(cr, uid, ids)

View File

@ -29,18 +29,20 @@ class hr_timesheet_current_open(osv.osv_memory):
def open_timesheet(self, cr, uid, ids, context=None):
ts = self.pool.get('hr_timesheet_sheet.sheet')
if context is None:
context = {}
view_type = 'form,tree'
user_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)])
user_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)], context=context)
if not len(user_ids):
raise osv.except_osv(_('Error !'), _('No employee defined for your user !'))
ids = ts.search(cr, uid, [('user_id','=',uid),('state','=','draft'),('date_from','<=',time.strftime('%Y-%m-%d')), ('date_to','>=',time.strftime('%Y-%m-%d'))])
ids = ts.search(cr, uid, [('user_id','=',uid),('state','=','draft'),('date_from','<=',time.strftime('%Y-%m-%d')), ('date_to','>=',time.strftime('%Y-%m-%d'))], context=context)
if len(ids) > 1:
view_type = 'tree,form'
domain = "[('id','in',["+','.join(map(str, ids))+"]),('user_id', '=', uid)]"
elif len(ids)==1:
ts.write(cr, uid, ids, {'date_current': time.strftime('%Y-%m-%d')})
ts.write(cr, uid, ids, {'date_current': time.strftime('%Y-%m-%d')}, context=context)
domain = "[('user_id', '=', uid)]"
else:
domain = "[('user_id', '=', uid)]"

View File

@ -8,7 +8,7 @@
<field name="arch" type="xml">
<data>
<form position="attributes">
<attribute name="string">Knowledge Modules Installation</attribute>
<attribute name="string">Knowledge Modules Configuration</attribute>
</form>
<separator string="title" position="attributes">

View File

@ -140,19 +140,28 @@ class mailgate_thread(osv.osv):
return True
mailgate_thread()
def format_date_tz(date, tz=None):
if not date:
return 'n/a'
format = tools.DEFAULT_SERVER_DATETIME_FORMAT
return tools.server_to_local_timestamp(date, format, format, tz)
class mailgate_message(osv.osv):
'''
Mailgateway Message
'''
def _get_display_text(self, cr, uid, ids, name, arg, context=None):
if context is None:
context = {}
tz = context.get('tz')
result = {}
for message in self.browse(cr, uid, ids, context=context):
msg_txt = ''
if message.history:
msg_txt += (message.email_from or '/') + ' wrote on ' + message.date + ':\n\t'
msg_txt += (message.email_from or '/') + ' wrote on ' + format_date_tz(message.date, tz) + ':\n\t'
msg_txt += '\n\t'.join(message.description.split('\n')[:3]) + '...'
else:
msg_txt = (message.user_id.name or '/') + ' on ' + message.date + ':\n\t'
msg_txt = (message.user_id.name or '/') + ' on ' + format_date_tz(message.date, tz) + ':\n\t'
if message.name == 'Opportunity':
msg_txt += "Converted to Opportunity"
else:

View File

@ -13,7 +13,7 @@
<field name="arch" type="xml">
<data>
<form position="attributes">
<attribute name="string">Marketing Modules Installation</attribute>
<attribute name="string">Marketing Modules Configuration</attribute>
</form>
<separator string="title" position="attributes">
<attribute name="string">Select Marketing Modules to Install</attribute>

View File

@ -1,6 +1,16 @@
<?xml version="1.0" ?>
<openerp>
<data>
<record id="action_dummy" model="ir.actions.server">
<field name="name">Dummy Action</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="state">dummy</field>
<field name="code"></field>
<field eval="5" name="sequence"/>
<field eval="True" name="condition"/>
</record>
</data>
<data>
<!-- Document directory -->
<record id="document_directory_marketingcampaign" model="document.directory">
@ -178,7 +188,7 @@
<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 name="server_action_id" ref="action_dummy"/>
<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>
@ -187,27 +197,27 @@
</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 name="server_action_id" ref="action_dummy"/>
<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 name="server_action_id" ref="action_dummy"/>
<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">
<field name="name">Thanks for subscribing to the Open ERP Discovery Day</field>
<field name="server_action_id" ref="base.action_start_configurator"/>
<field name="server_action_id" ref="action_dummy"/>
<field model="marketing.campaign" name="campaign_id" ref="marketing_campaign_openerpondemandfreetrial0"/>
<field name="email_template_id" ref="email_template_3"/>
</record>
<record id="marketing_campaign_activity_4" model="marketing.campaign.activity">
<field name="name">Propose to buy the Open ERP Book</field>
<field name="server_action_id" ref="base.action_start_configurator"/>
<field name="server_action_id" ref="action_dummy"/>
<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>
@ -216,33 +226,33 @@
<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"/>
<field name="server_action_id" ref="action_dummy"/>
<field model="marketing.campaign" name="campaign_id" ref="marketing_campaign_openerpondemandfreetrial0"/>
<field name="email_template_id" ref="email_template_4"/>
</record>
<record id="marketing_campaign_activity_6" model="marketing.campaign.activity">
<field name="name">Propose a free technical training to Gold partners</field>
<field name="server_action_id" ref="base.action_start_configurator"/>
<field name="server_action_id" ref="action_dummy"/>
<field model="marketing.campaign" name="campaign_id" ref="marketing_campaign_openerpondemandfreetrial0"/>
<field name="email_template_id" ref="email_template_5"/>
</record>
<record id="marketing_campaign_activity_7" model="marketing.campaign.activity">
<field name="name">Propose paid training to Silver partners</field>
<field name="server_action_id" ref="base.action_start_configurator"/>
<field name="server_action_id" ref="action_dummy"/>
<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 name="server_action_id" ref="action_dummy"/>
<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 name="server_action_id" ref="action_dummy"/>
<field model="marketing.campaign" name="campaign_id" ref="marketing_campaign_openerpondemandfreetrial0"/>
<field name="email_template_id" ref="email_template_8"/>
</record>

View File

@ -83,7 +83,7 @@
<newline/>
<label align="0.0" string="This wizard will automatically configure the web client for Business Intelligence." width="200" colspan="2"/>
</group>
<separator string="" position="vertical" colspan="1" rowspan="12"/>
<separator string="" orientation="vertical" colspan="1" rowspan="12"/>
<group colspan="4">
<separator string=" Business Intelligence Web Client" colspan="4"/>
<field name="host_name" colspan="4"/>

View File

@ -8,7 +8,7 @@
<field name="arch" type="xml">
<data>
<form position="attributes">
<attribute name="string">Tools Modules Installation</attribute>
<attribute name="string">Tools Modules Configuration</attribute>
</form>
<xpath expr='//separator[@string="vsep"]' position='attributes'>
<attribute name='string'></attribute>

View File

@ -22,6 +22,7 @@
from lxml import etree
import time
from datetime import date, datetime
from tools.translate import _
from osv import fields, osv
@ -38,21 +39,21 @@ class project_task_type(osv.osv):
_defaults = {
'sequence': 1
}
project_task_type()
class project(osv.osv):
_name = "project.project"
_description = "Project"
_inherits = {'account.analytic.account':"category_id"}
_inherits = {'account.analytic.account': "analytic_account_id"}
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False):
if user == 1:
return super(project, self).search(cr, user, args, offset=offset, limit=limit, order=order, context=context, count=count)
if context and context.has_key('user_prefence') and context['user_prefence']:
cr.execute("""SELECT project.id FROM project_project project
LEFT JOIN account_analytic_account account ON account.id = project.category_id
LEFT JOIN project_user_rel rel ON rel.project_id = project.category_id
LEFT JOIN account_analytic_account account ON account.id = project.analytic_account_id
LEFT JOIN project_user_rel rel ON rel.project_id = project.analytic_account_id
WHERE (account.user_id = %s or rel.uid = %s)"""%(user, user))
res = cr.fetchall()
return [(r[0]) for r in res]
@ -78,36 +79,64 @@ class project(osv.osv):
pricelist_id = pricelist.get('property_product_pricelist', False) and pricelist.get('property_product_pricelist')[0] or False
return {'value':{'contact_id': addr['contact'], 'pricelist_id': pricelist_id}}
def get_all_child_projects(self, cr, uid, ids, context=None):
cr.execute('''select prpc.id as id from account_analytic_account as p
join account_analytic_account as c on p.id = c.parent_id
join project_project as prp on prp.analytic_account_id = p.id
join project_project as prpc on prpc.analytic_account_id = c.id
where prp.id in %s''',(tuple(ids),))
child_ids = cr.fetchall()
if child_ids:
child_ids = [x[0] for x in child_ids]
child_ids = self.get_all_child_projects(cr, uid, child_ids)
return ids+child_ids
def _progress_rate(self, cr, uid, ids, names, arg, context=None):
res = {}.fromkeys(ids, 0.0)
progress = {}
if not ids:
return res
ids2 = self.search(cr, uid, [('parent_id','child_of',ids)], context=context)
if ids2:
cr.execute('''SELECT
project_id, sum(planned_hours), sum(total_hours), sum(effective_hours)
FROM
project_task
WHERE
project_id IN %s AND
state<>'cancelled'
GROUP BY
project_id''',(tuple(ids2),))
progress = dict(map(lambda x: (x[0], (x[1], x[2], x[3])), cr.fetchall()))
for project in self.browse(cr, uid, ids, context=context):
par_child_projects={}
all_projects = list(ids)
for id in ids:
child_projects = self.get_all_child_projects(cr, uid, [id], context)
child_projects = [x for x in child_projects]
par_child_projects[id] = child_projects
all_projects.extend(child_projects)
all_projects = dict.fromkeys(all_projects).keys()
cr.execute('''SELECT
project_id, sum(planned_hours), sum(total_hours), sum(effective_hours)
FROM
project_task
WHERE
project_id IN %s AND
state<>'cancelled'
GROUP BY
project_id''',(tuple(all_projects),))
progress = dict(map(lambda x: (x[0], (x[1], x[2], x[3])), cr.fetchall()))
for project in self.browse(cr, uid, par_child_projects.keys(), context=context):
s = [0.0, 0.0, 0.0]
tocompute = [project]
tocompute = par_child_projects[project.id]
while tocompute:
p = tocompute.pop()
tocompute += p.child_ids
for i in range(3):
s[i] += progress.get(p.id, (0.0, 0.0, 0.0))[i]
s[i] += progress.get(p, (0.0, 0.0, 0.0))[i]
if project.state == 'close':
progress_rate = 100.0
else:
progress_rate = s[1] and round(min(100.0 * s[2] / s[1], 99.99), 2)
res[project.id] = {
'planned_hours': s[0],
'effective_hours': s[2],
'total_hours': s[1],
'progress_rate': s[1] and (100.0 * s[2] / s[1]) or 0.0
'progress_rate': progress_rate
}
return res
@ -121,30 +150,30 @@ class project(osv.osv):
'complete_name': fields.function(_complete_name, method=True, string="Project Name", type='char', size=250),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the project without removing it."),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of Projects."),
'category_id': fields.many2one('account.analytic.account', 'Analytic Account', help="Link this project to an analytic account if you need financial management on projects. It enables you to connect projects with budgets, planning, cost and revenue analysis, timesheets on projects, etc."),
'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account', help="Link this project to an analytic account if you need financial management on projects. It enables you to connect projects with budgets, planning, cost and revenue analysis, timesheets on projects, etc."),
'priority': fields.integer('Sequence', help="Gives the sequence order when displaying a list of task"),
'warn_manager': fields.boolean('Warn Manager', help="If you check this field, the project manager will receive a request each time a task is completed by his team."),
'members': fields.many2many('res.users', 'project_user_rel', 'project_id', 'uid', 'Project Members', help="Project's member. Not used in any computation, just for information purpose."),
'tasks': fields.one2many('project.task', 'project_id', "Project tasks"),
'planned_hours': fields.function(_progress_rate, multi="progress", method=True, string='Planned Time', help="Sum of planned hours of all tasks related to this project."),
'effective_hours': fields.function(_progress_rate, multi="progress", method=True, string='Time Spent', help="Sum of spent hours of all tasks related to this project."),
'total_hours': fields.function(_progress_rate, multi="progress", method=True, string='Total Time', help="Sum of total hours of all tasks related to this project."),
'planned_hours': fields.function(_progress_rate, multi="progress", method=True, string='Planned Time', help="Sum of planned hours of all tasks related to this project and its child projects."),
'effective_hours': fields.function(_progress_rate, multi="progress", method=True, string='Time Spent', help="Sum of spent hours of all tasks related to this project and its child projects."),
'total_hours': fields.function(_progress_rate, multi="progress", method=True, string='Total Time', help="Sum of total hours of all tasks related to this project and its child projects."),
'progress_rate': fields.function(_progress_rate, multi="progress", method=True, string='Progress', type='float', help="Percent of tasks closed according to the total of tasks todo."),
'warn_customer': fields.boolean('Warn Partner', help="If you check this, the user will have a popup when closing a task that propose a message to send by email to the customer."),
'warn_header': fields.text('Mail Header', help="Header added at the beginning of the email for the warning message sent to the customer when a task is closed."),
'warn_footer': fields.text('Mail Footer', help="Footer added at the beginning of the email for the warning message sent to the customer when a task is closed."),
'type_ids': fields.many2many('project.task.type', 'project_task_type_rel', 'project_id', 'type_id', 'Tasks Stages'),
}
_order = "sequence"
_defaults = {
'active': True,
'priority': 1,
'sequence': 10,
'warn_manager': True,
}
def _check_dates(self, cr, uid, ids):
leave = self.read(cr, uid, ids[0], ['date_start', 'date'])
if leave['date_start'] and leave['date']:
@ -155,7 +184,7 @@ class project(osv.osv):
_constraints = [
(_check_dates, 'Error! project start-date must be lower then project end-date.', ['date_start', 'date'])
]
def set_template(self, cr, uid, ids, context=None):
res = self.setActive(cr, uid, ids, value=False, context=context)
return res
@ -195,16 +224,16 @@ class project(osv.osv):
def copy(self, cr, uid, id, default={}, context=None):
if context is None:
context = {}
task_obj = self.pool.get('project.task')
proj = self.browse(cr, uid, id, context=context)
default = default or {}
context['active_test'] = False
default['state'] = 'open'
if not default.get('name', False):
default['name'] = proj.name+_(' (copy)')
default['name'] = proj.name+_(' (copy)')
res = super(project, self).copy(cr, uid, id, default, context)
task_ids = task_obj.search(cr, uid, [('project_id','=', res), ('active','=',False)])
tasks = task_obj.browse(cr, uid, task_ids)
for task in tasks:
@ -216,11 +245,11 @@ class project(osv.osv):
dd = date(*time.strptime(task.date_deadline,'%Y-%m-%d')[:3])
diff = dd-ds
date_deadline = (datetime.now()+diff).strftime('%Y-%m-%d %H:%M:%S')
task_obj.write(cr, uid, task.id, {'active':True,
task_obj.write(cr, uid, task.id, {'active':True,
'date_start':time.strftime('%Y-%m-%d %H:%M:%S'),
'date_deadline':date_deadline,
'date_end':date_end})
ids = self.search(cr, uid, [('parent_id','child_of', [res])])
return res
@ -241,8 +270,8 @@ class project(osv.osv):
result.append(new_id)
cr.execute('select id from project_task where project_id=%s', (proj.id,))
res = cr.fetchall()
child_ids = self.search(cr, uid, [('parent_id','=', proj.category_id.id)], context=context)
parent_id = self.read(cr, uid, new_id, ['category_id'])['category_id'][0]
child_ids = self.search(cr, uid, [('parent_id','=', proj.analytic_account_id.id)], context=context)
parent_id = self.read(cr, uid, new_id, ['analytic_account_id'])['analytic_account_id'][0]
if child_ids:
self.duplicate_template(cr, uid, child_ids, context={'parent_id': parent_id})
@ -276,11 +305,11 @@ class project(osv.osv):
tasks_id = [x[0] for x in cr.fetchall()]
if tasks_id:
task_obj.write(cr, uid, tasks_id, {'active': value}, context=context)
child_ids = self.search(cr, uid, [('parent_id','=', proj.id)])
child_ids = self.search(cr, uid, [('parent_id','=', proj.analytic_account_id.id)])
if child_ids:
self.setActive(cr, uid, child_ids, value, context=None)
return True
project()
class task(osv.osv):
@ -337,13 +366,6 @@ class task(osv.osv):
if task['date_start'] > task['date_end']:
return False
return True
def _check_deadline_date(self, cr, uid, ids, context=None):
task = self.read(cr, uid, ids[0], ['date_start', 'date_deadline'])
if task['date_start'] and task['date_deadline']:
if task['date_deadline'] < task['date_start']:
return False
return True
def _is_template(self, cr, uid, ids, field_name, arg, context=None):
res = {}
@ -364,6 +386,7 @@ class task(osv.osv):
'state': fields.selection([('draft', 'Draft'),('open', 'In Progress'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'State', readonly=True, required=True,
help='If the task is created the state is \'Draft\'.\n If the task is started, the state becomes \'In Progress\'.\n If review is needed the task is in \'Pending\' state.\
\n If the task is over, the states is set to \'Done\'.'),
'create_date': fields.datetime('Create Date', readonly=True),
'date_start': fields.datetime('Starting Date'),
'date_end': fields.datetime('Ending Date'),
'date_deadline': fields.date('Deadline'),
@ -383,21 +406,20 @@ class task(osv.osv):
'delegated_user_id': fields.related('child_ids', 'user_id', type='many2one', relation='res.users', string='Delegated To'),
'partner_id': fields.many2one('res.partner', 'Partner'),
'work_ids': fields.one2many('project.task.work', 'task_id', 'Work done'),
'manager_id': fields.related('project_id', 'category_id', 'user_id', type='many2one', relation='res.users', string='Project Manager'),
'manager_id': fields.related('project_id', 'analytic_account_id', 'user_id', type='many2one', relation='res.users', string='Project Manager'),
'company_id': fields.many2one('res.company', 'Company'),
}
_defaults = {
'state': 'draft',
'priority': '2',
'progress': 0,
'sequence': 10,
'active': True,
'date_start': time.strftime('%Y-%m-%d %H:%M:%S'),
'project_id': _default_project,
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'project.task', context=c)
}
_order = "sequence, priority, date_start, id"
_constraints = [
@ -406,7 +428,7 @@ class task(osv.osv):
#
# Override view according to the company definition
#
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
users_obj = self.pool.get('res.users')
obj_tm = users_obj.browse(cr, uid, uid, context).company_id.project_time_mode_id
@ -458,11 +480,11 @@ class task(osv.osv):
'ref_doc1': 'project.task,%d'% (task.id,),
'ref_doc2': 'project.project,%d'% (project.id,),
})
elif project.warn_manager and cntx.get('mail_send',False):
elif project.warn_manager and cntx.get('mail_send',True):
mail_send = True
message = _('Task ') + " '" + task.name + "' "+ _("is Done.")
self.log(cr, uid, task.id, message)
self.write(cr, uid, [task.id], {'state': 'done', 'date_end':time.strftime('%Y-%m-%d %H:%M:%S'), 'remaining_hours': 0.0})
for parent_id in task.parent_ids:
if parent_id.state in ('pending','draft'):
reopen = True
@ -532,7 +554,7 @@ class task(osv.osv):
def do_open(self, cr, uid, ids, *args):
tasks= self.browse(cr,uid,ids)
for t in tasks:
self.write(cr, uid, [t.id], {'state': 'open'})
self.write(cr, uid, [t.id], {'state': 'open', 'date_start': time.strftime('%Y-%m-%d %H:%M:%S'),})
message = _('Task ') + " '" + t.name + "' "+ _("is Open.")
self.log(cr, uid, t.id, message)
return True
@ -584,14 +606,14 @@ class project_work(osv.osv):
'user_id': fields.many2one('res.users', 'Done by', required=True),
'company_id': fields.related('task_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True)
}
_defaults = {
'user_id': lambda obj, cr, uid, context: uid,
'date': time.strftime('%Y-%m-%d %H:%M:%S')
}
_order = "date desc"
def create(self, cr, uid, vals, *args, **kwargs):
if 'hours' in vals and (not vals['hours']):
vals['hours'] = 0.00
@ -613,12 +635,12 @@ class project_work(osv.osv):
for work in self.browse(cr, uid, ids):
cr.execute('update project_task set remaining_hours=remaining_hours + %s where id=%s', (work.hours, work.task_id.id))
return super(project_work,self).unlink(cr, uid, ids, *args, **kwargs)
project_work()
class config_compute_remaining(osv.osv_memory):
_name='config.compute.remaining'
def _get_remaining(self,cr, uid, ctx):
task_obj = self.pool.get('project.task')
if 'active_id' in ctx:
@ -628,12 +650,12 @@ class config_compute_remaining(osv.osv_memory):
_columns = {
'remaining_hours' : fields.float('Remaining Hours', digits=(16,2), help="Put here the remaining hours required to close the task."),
}
def _get_analytic_account(self, cr, uid, context={}):
if context.get('account_id', False):
return context.get('account_id')
return False
_defaults = {
'account_id' : _get_analytic_account,
}
@ -674,7 +696,7 @@ config_compute_remaining()
class message(osv.osv):
_name = "project.message"
_description = "Message"
_columns = {
'subject': fields.char('Subject', size=128, required="True"),
'project_id': fields.many2one('project.project', 'Project', ondelete='cascade'),
@ -704,7 +726,7 @@ class users(osv.osv):
_columns = {
'context_project_id': fields.many2one('project.project', 'Project')
}
users()
class account_analytic_account(osv.osv):

View File

@ -14,6 +14,15 @@
<field name="name">Project task</field>
<field name="object">project.task</field>
</record>
<!--
Resource: project.project
-->
<record id="all_projects_account" model="account.analytic.account">
<field name="name">Projects</field>
<field name="code">3</field>
</record>
<function eval="('default',False,'parent_id', [('project.project', False)], all_projects_account, True, False, False, False, True)" id="parent_project_default_set" model="ir.values" name="set"/>
</data>
</openerp>

View File

@ -31,6 +31,7 @@
<record id="project_project_9" model="project.project">
<field name="warn_manager">1</field>
<field name="name">Open ERP Integration</field>
<field name="parent_id" ref="all_projects_account"/>
<field name="user_id" ref="base.user_root"/>
<field eval="[(6, 0, [ref('project_tt_specification'),ref('project_tt_development'),ref('project_tt_testing'),ref('project_tt_merge')])]" name="type_ids"/>
</record>

View File

@ -9,7 +9,7 @@
<field name="arch" type="xml">
<data>
<form position="attributes">
<attribute name="string">Project Modules Installation</attribute>
<attribute name="string">Project Modules Configuration</attribute>
</form>
<separator string="title" position="attributes">
<attribute name="string">Project Management</attribute>

View File

@ -46,7 +46,7 @@
<group col="9" colspan="8">
<field name="state" select="1" readonly="1"/>
<button name="set_template" string="Set as Template" type="object" states="open" icon="gtk-convert"/>
<button name="set_open" string="Reactivate Project" type="object" states="pending,cancelled,done" icon="gtk-ok"/>
<button name="set_open" string="Reactivate Project" type="object" states="pending,cancelled,close" icon="gtk-ok"/>
<button name="set_pending" string="Pending" type="object" states="open" icon="gtk-media-pause"/>
<button name="set_cancel" string="Cancel" type="object" states="open,pending" icon="gtk-cancel"/>
<button name="set_done" string="Done" type="object" states="open,pending" icon="gtk-jump-to"/>
@ -130,7 +130,7 @@
<filter string="Parent" name="Parent" icon="terp-personal" domain = "[]" context="{'group_by':'parent_id'}"/>
<filter string="Users" name="Users" icon="terp-personal" domain = "[]" context="{'group_by':'user_id'}"/>
<filter string="Partner" name="Partner" icon="terp-personal" domain = "[]" context="{'group_by':'partner_id'}"/>
</group>
</group>
</search>
</field>
</record>
@ -245,7 +245,7 @@
<form string="Task edition">
<group colspan="6" col="6">
<field name="name" select="1"/>
<field name="project_id" required="1" select="1" domain="['|',('user_id','=',uid),('members','=',uid)]"/>
<field name="project_id" required="1" select="1" domain="[('user_id','=',uid)]"/>
<field name="total_hours" widget="float_time"/>
<field name="date_deadline"/>
<field name="user_id" select="1"/>
@ -316,6 +316,7 @@
<separator string="Dates" colspan="2"/>
<field name="date_start"/>
<field name="date_end"/>
<field name="create_date"/>
</group>
<separator string="Miscelleanous" colspan="4"/>
<field name="partner_id"/>
@ -418,7 +419,7 @@
<filter string="In Progress" domain="[('state','=','open')]" help="Open Tasks" icon="terp-camera_test"/>
<filter string="Pending" domain="[('state','=','pending')]" context="{'show_delegated':False}" help="Pending Tasks" icon="terp-gtk-media-pause"/>
<filter name="edit"
string="Edit" context="{'set_editable':'True','seq_visible': True}"
string="Edit" context="{'set_editable':True,'seq_visible': True}"
icon="gtk-execute"
groups="base.group_extended"/>
<separator orientation="vertical"/>
@ -537,7 +538,6 @@ Issues like bugs in a system, client complain, materials breakdown are collected
<act_window
domain="[('project_id', '=', active_id)]"
context="{'set_default_template':1}"
id="act_project_project_2_project_task_all"
name="Tasks"
res_model="project.task"

View File

@ -150,7 +150,7 @@ class project_vs_hours(osv.osv):
FROM project_project as pp,
account_analytic_account as aaa,
project_task as pt
WHERE aaa.id=pp.category_id and pt.project_id=pp.id and pp.category_id=aaa.id
WHERE aaa.id=pp.analytic_account_id and pt.project_id=pp.id and pp.analytic_account_id=aaa.id
GROUP BY aaa.user_id,aaa.state,aaa.name
UNION All
SELECT
@ -165,7 +165,7 @@ class project_vs_hours(osv.osv):
project_user_rel as pur,
account_analytic_account as aaa,
project_task as pt
WHERE pur.project_id=pp.id and pt.project_id=pp.id and pp.category_id=aaa.id AND pur.uid != aaa.user_id
WHERE pur.project_id=pp.id and pt.project_id=pp.id and pp.analytic_account_id=aaa.id AND pur.uid != aaa.user_id
GROUP BY pur.uid,aaa.state,aaa.name
)
""")

View File

@ -0,0 +1,223 @@
-
This scenario tests the delegation process. Closing all the delegated tasks(task delegation at multiple levels) transits the parent task from pending to open state.
-
Creating a project OpenERP Documentaion
-
!record {model: project.project, id: project_project_openerpdocumentaion0}:
company_id: base.main_company
name: OpenERP Documentaion
-
Creating a task 'Develop book for Technical and Functional reference'
-
!record {model: project.task, id: project_task_documentation_book}:
name: Develop book for Technical and Functional reference
planned_hours: 20.0
project_id: project_project_openerpdocumentaion0
remaining_hours: 20.0
state: draft
-
Open the task
-
!python {model: project.task}: |
self.do_open(cr, uid, [ref("project_task_documentation_book")],
{"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
"tz": False, "active_id": ref("project.menu_action_view_task"), })
-
Creating a task 'Publish the References'
-
!record {model: project.task, id: project_task_publish_book}:
name: Publish the References
planned_hours: 10.0
project_id: project_project_openerpdocumentaion0
remaining_hours: 10.0
state: draft
-
Open the task
-
!python {model: project.task}: |
self.do_open(cr, uid, [ref("project_task_publish_book")],
{"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
"tz": False, "active_id": ref("project.menu_action_view_task"), })
-
Creating a project.task.delegate record
-
!record {model: project.task.delegate, id: project_task_publish_book_delegate}:
name: Publish the References
new_task_description: aaa
planned_hours: 15.0
planned_hours_me: 1.0
prefix: 'CHECK: Publish the References'
state: pending
user_id: base.user_demo
-
Performing an osv_memory action validate on module project.task.delegate
-
!python {model: project.task.delegate}: |
self.validate(cr, uid, [ref("project_task_publish_book_delegate")],
{"lang": "en_US", "active_model": "project.task", "tz": False, "record_id":
4, "active_ids": [ref("project_task_publish_book")], "active_id": ref("project_task_publish_book"),
})
-
Creating a delegate task 'Prepare a book that gives functional overview of OpenERP'
-
!record {model: project.task, id: project_task_delegate_openerp_tutorial}:
name: Prepare a book that gives functional overview of OpenERP
planned_hours: 30.0
project_id: project.project_project_openerpdocumentaion0
remaining_hours: 30.0
state: draft
-
Open the task
-
!python {model: project.task}: |
self.do_open(cr, uid, [ref("project_task_delegate_openerp_tutorial")],
{"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
"tz": False, "active_id": ref("project.menu_action_view_task"), })
-
Creating a delegate task 'Prepare a technical reference for creating your modules'
-
!record {model: project.task, id: project_task_delegate_developer_book}:
name: Prepare a technical reference for creating your modules
planned_hours: 30.0
project_id: project_project_openerpdocumentaion0
remaining_hours: 30.0
state: draft
-
Open the task
-
!python {model: project.task}: |
self.do_open(cr, uid, [ref("project_task_delegate_developer_book")],
{"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
"tz": False, "active_id": ref("project.menu_action_view_task"), })
-
Delegate task 'Develop book for Technical and Functional reference' to these tasks and make it pending
-
!record {model: project.task, id: project_task_documentation_book}:
child_ids:
- project.project_task_delegate_openerp_tutorial
- project.project_task_delegate_developer_book
planned_hours: 20.0
state: pending
-
Creating a delegate task 'Prepare documentation for Module Development'
-
!record {model: project.task, id: project_task_delegate_module_develop}:
name: Prepare documentation for Module Development
planned_hours: 30.0
project_id: project.project_project_openerpdocumentaion0
remaining_hours: 30.0
state: draft
-
Creating a delegate 'Prepare documentation for Business Process Development'
-
!record {model: project.task, id: project_task_delegate_business_process_develop}:
name: Prepare documentation for Business Process Development
planned_hours: 30.0
project_id: project_project_openerpdocumentaion0
remaining_hours: 30.0
state: draft
-
Delegate task 'Prepare a technical reference for creating your modules' to these tasks and make it pending
-
!record {model: project.task, id: project_task_delegate_developer_book}:
child_ids:
- project.project_task_delegate_module_develop
- project.project_task_delegate_business_process_develop
planned_hours: 20.0
state: pending
-
Open the task
-
!python {model: project.task}: |
self.do_open(cr, uid, [ref("project_task_delegate_module_develop")],
{"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
"tz": False, "active_id": ref("project.menu_action_view_task"), })
-
Open the task
-
!python {model: project.task}: |
self.do_open(cr, uid, [ref("project_task_delegate_business_process_develop")],
{"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
"tz": False, "active_id": ref("project.menu_action_view_task"), })
-
Check if 'Prepare a technical reference for creating your modules' in pending state
-
!assert {model: project.task, id: project_task_delegate_developer_book, severity: error, string: Task is in pending state}:
- state == "pending"
-
Close the child task 'Prepare documentation for Module Development'
-
!python {model: project.task}: |
self.do_close(cr, uid, [ref("project_task_delegate_module_develop")], {"lang": "en_US",
"active_ids": [ref("project.menu_action_view_task")], "tz": False, "active_model":
"ir.ui.menu", "section_id": False, "search_default_project_id": False, "search_default_user_id":
1, "search_default_current": 1, "mail_send": False, "active_id": ref("project.menu_action_view_task"),
})
-
Close the child task 'Prepare documentation for Business Process Development'
-
!python {model: project.task}: |
self.do_close(cr, uid, [ref("project_task_delegate_business_process_develop")], {"lang": "en_US",
"active_ids": [ref("project.menu_action_view_task")], "tz": False, "active_model":
"ir.ui.menu", "section_id": False, "search_default_project_id": False, "search_default_user_id":
1, "search_default_current": 1, "mail_send": False, "active_id": ref("project.menu_action_view_task"),
})
-
Parent task 'Prepare a technical reference for creating your modules' task must now be in open state
-
!assert {model: project.task, id: project_task_delegate_developer_book, severity: error, string: Task is in done state}:
- state == "open"
-
Check if task 'Develop book for Technical and Functional reference' in pending state
-
!assert {model: project.task, id: project_task_documentation_book, severity: error, string: Task is in pending state}:
- state == "pending"
-
Close the child project 'Prepare a technical reference for creating your modules'
-
!python {model: project.task}: |
self.do_close(cr, uid, [ref("project_task_delegate_developer_book")], {"lang": "en_US",
"active_ids": [ref("project.menu_action_view_task")], "tz": False, "active_model":
"ir.ui.menu", "section_id": False, "search_default_project_id": False, "search_default_user_id":
1, "search_default_current": 1, "mail_send": False, "active_id": ref("project.menu_action_view_task"),
})
-
Close the child project 'Prepare a book that gives functional overview of OpenERP'
-
!python {model: project.task}: |
self.do_close(cr, uid, [ref("project_task_delegate_openerp_tutorial")], {"lang": "en_US",
"active_ids": [ref("project.menu_action_view_task")], "tz": False, "active_model":
"ir.ui.menu", "section_id": False, "search_default_project_id": False, "search_default_user_id":
1, "search_default_current": 1, "mail_send": False, "active_id": ref("project.menu_action_view_task"),
})
-
Parent task 'Develop book for Technical and Functional reference' must be now in open state
-
!assert {model: project.task, id: project_task_documentation_book, severity: error, string: Task is in done state}:
- state == "open"

View File

@ -19,6 +19,8 @@
#
##############################################################################
from lxml import etree
from tools.translate import _
from osv import fields, osv
@ -83,7 +85,36 @@ class project_task_delegate(osv.osv_memory):
'new_task_description': _get_new_desc,
'state': 'pending',
}
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
users_obj = self.pool.get('res.users')
obj_tm = users_obj.browse(cr, uid, uid, context).company_id.project_time_mode_id
tm = obj_tm and obj_tm.name or 'Hours'
res = super(project_task_delegate, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar, submenu=submenu)
if tm in ['Hours','Hour']:
return res
eview = etree.fromstring(res['arch'])
def _check_rec(eview):
if eview.attrib.get('widget','') == 'float_time':
eview.set('widget','float')
for child in eview:
_check_rec(child)
return True
_check_rec(eview)
res['arch'] = etree.tostring(eview)
for f in res['fields']:
if 'Hours' in res['fields'][f]['string']:
res['fields'][f]['string'] = res['fields'][f]['string'].replace('Hours',tm)
return res
def validate(self, cr, uid, ids, context=None):
if context is None:
context = {}

View File

@ -173,15 +173,15 @@ class project_task(osv.osv):
if res['type'] == 'search':
tt = timebox_obj.browse(cr, uid, timebox_obj.search(cr,uid,[]))
search_extended ='''<newline/><group col="%d" expand="0" string="%s" groups="project_gtd.group_project_getting">''' % (len(tt)+7,_('Getting Things Done'))
search_extended += '''<filter domain="[('timebox_id','=', False)]" context="{'set_editable':True,'set_visible':True}" icon="gtk-new" string="%s"/>''' % (_('Inbox'),)
search_extended += '''<filter domain="[('state', 'in', ('draft','open','pending'))]" context="{'set_editable':True,'set_visible':True}" icon="gtk-new" string="%s"/>''' % (_('Editable'),)
search_extended += '''<filter domain="[('timebox_id','=', False)]" context="{'set_editable':True,'set_visible':True,'gtd_visible':True}" icon="gtk-new" string="%s"/>''' % (_('Inbox'),)
# search_extended += '''<filter domain="[('state', 'in', ('draft','open','pending'))]" context="{'set_editable':True,'set_visible':True,'gtd_visible':True}" icon="gtk-new" string="%s"/>''' % (_('Editable'),)
search_extended += '''<separator orientation="vertical"/>'''
for time in tt:
if time.icon:
icon = time.icon
else :
icon=""
search_extended += '''<filter domain="[('timebox_id','=', ''' + str(time.id) + ''')]" icon="''' + icon + '''" string="''' + time.name + '''" context="{'set_visible':True}"/>'''
search_extended += '''<filter domain="[('timebox_id','=', ''' + str(time.id) + ''')]" icon="''' + icon + '''" string="''' + time.name + '''" context="{'gtd_visible':True}"/>'''
search_extended += '''
<separator orientation="vertical"/>
<field name="context_id" select="1" widget="selection" />

View File

@ -9,7 +9,6 @@
<tree string="Context">
<field name="sequence" invisible="1"/>
<field name="name" select="1"/>
<field name="project_default_id" select="1"/>
</tree>
</field>
</record>
@ -22,7 +21,6 @@
<form string="Context">
<field name="name"/>
<field name="sequence"/>
<field name="project_default_id"/>
</form>
</field>
</record>
@ -80,9 +78,9 @@
<field name="inherit_id" ref="project.view_task_tree2" />
<field name="arch" type="xml">
<field name="remaining_hours" position="after">
<button name="prev_timebox" type="object" icon="gtk-go-back" string="Previous" states="draft,pending,open" groups="project_gtd.group_project_getting" invisible=" not context.get('set_visible',True)"/>
<field string="Timebox" name="timebox_id" groups="project_gtd.group_project_getting" invisible=" not context.get('set_visible',True)"/>
<button name="next_timebox" type="object" icon="gtk-go-forward" string="Next" states="draft,pending,open" groups="project_gtd.group_project_getting" invisible=" not context.get('set_visible',False)"/>
<button name="prev_timebox" type="object" icon="gtk-go-back" string="Previous" states="draft,pending,open" groups="project_gtd.group_project_getting" invisible=" not context.get('gtd_visible',False)"/>
<field string="Timebox" name="timebox_id" groups="project_gtd.group_project_getting" invisible=" not context.get('gtd_visible', False)"/>
<button name="next_timebox" type="object" icon="gtk-go-forward" string="Next" states="draft,pending,open" groups="project_gtd.group_project_getting" invisible=" not context.get('gtd_visible',False)"/>
<button name="do_reopen" states="done,cancelled" string="Reactivate" type="object" icon="gtk-convert" help="For reopening the tasks" invisible="not context.get('set_visible',False)"/>
</field>
</field>
@ -100,5 +98,6 @@
</field>
</field>
</record>
</data>
</openerp>

View File

@ -27,7 +27,7 @@ class project_issue(osv.osv):
_description = 'project issue'
_columns = {
'timesheet_ids': fields.one2many('hr.analytic.timesheet', 'issue_id', 'Timesheets'),
'analytic_account_id': fields.related('project_id', 'category_id', string='Analytic Account')
'analytic_account_id': fields.related('project_id', 'analytic_account_id', string='Analytic Account')
}
project_issue()
@ -48,15 +48,6 @@ class hr_analytic_issue(osv.osv):
_columns = {
'issue_id' : fields.many2one('project.issue', 'Issue'),
}
def _get_analytic_account(self, cr, uid, context={}):
if context.get('account_id', False):
return context.get('account_id')
return False
_defaults = {
'account_id' : _get_analytic_account,
}
hr_analytic_issue()

View File

@ -10,7 +10,7 @@
<notebook colspan="4">
<page string="Worklogs">
<field name="analytic_account_id" invisible="1"/>
<field name="timesheet_ids" colspan="4" nolabel="1" default_get="{'account_id':project_id}" context="{'default_user_id' : user_id, 'default_account_id' : analytic_account_id}">
<field name="timesheet_ids" colspan="4" nolabel="1" context="{'default_user_id' : user_id, 'default_account_id' : analytic_account_id}">
<tree editable="top" string="Timesheet">
<field name="name"/>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" widget="float_time"/>

View File

@ -249,14 +249,14 @@
<field eval="1" name="active"/>
<field eval="1" name="warn_manager"/>
<field eval="0" name="warn_customer"/>
<field name="date_start">2010-02-25</field>
<field name="date_start" eval="(DateTime.now()-timedelta(70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="company_id" ref="base.main_company"/>
<field eval="1" name="priority"/>
<field name="state">open</field>
<field name="type">normal</field>
<field name="description">Develop an OpenERP Website.</field>
<field eval="[(6, 0, [ref('res_users_manager0'), ref('res_users_user0'), ref('res_users_userfinance0'), ref('res_users_userdesign0'), ref('res_users_userdeveloper0'), ref('res_users_usertester0'), ref('res_users_useranalyst0')])]" name="members"/>
<field name="date">2010-04-30</field>
<field name="date" eval="(DateTime.now()+timedelta(60-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="user_id" ref="base.user_root"/>
<field name="currency_id" ref="base.EUR"/>
<field eval="[(6, 0, [])]" name="type_ids"/>
@ -269,14 +269,14 @@
<field name="name">Information Gathering and Understanding</field>
<field name="product_uom" ref="product.uom_day"/>
<field eval="10" name="sequence"/>
<field name="constraint_date_end">2010-03-11 15:37:00</field>
<field name="date_start">2010-02-25 15:33:00</field>
<field name="constraint_date_end" eval="(DateTime.now()+timedelta(18-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="date_start" eval="(DateTime.now()-timedelta(70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="state">draft</field>
<field name="responsible_id" ref="res_users_demouser1"/>
<field eval="10.0" name="duration"/>
<field eval="15.0" name="duration"/>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field name="constraint_date_start">2010-02-24 15:37:00</field>
<field name="date_end">2010-03-10 15:33:00</field>
<field name="constraint_date_start" eval="(DateTime.now()+timedelta(2-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="date_end" eval="(DateTime.now()+timedelta(15-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
</record>
<record id="project_phase_planning0" model="project.phase">
@ -284,14 +284,14 @@
<field name="name">Planning</field>
<field name="product_uom" ref="product.uom_day"/>
<field eval="10" name="sequence"/>
<field name="constraint_date_end">2010-03-25 15:49:00</field>
<field name="date_start">2010-02-18 15:48:00</field>
<field name="constraint_date_end" eval="(DateTime.now()+timedelta(28-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="date_start" eval="(DateTime.now()+timedelta(10-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="state">draft</field>
<field name="responsible_id" ref="res_users_manager0"/>
<field eval="7.0" name="duration"/>
<field eval="15.0" name="duration"/>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field name="constraint_date_start">2010-02-12 15:49:00</field>
<field name="date_end">2010-03-11 15:48:00</field>
<field name="constraint_date_start" eval="(DateTime.now()+timedelta(13-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="date_end" eval="(DateTime.now()+timedelta(25-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
</record>
<record id="project_phase_webdesign0" model="project.phase">
@ -299,14 +299,14 @@
<field name="name">Web Design </field>
<field name="product_uom" ref="product.uom_day"/>
<field eval="10" name="sequence"/>
<field name="constraint_date_end">2010-04-15 16:08:00</field>
<field name="date_start">2010-04-01 16:02:00</field>
<field name="constraint_date_end" eval="(DateTime.now()+timedelta(45-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="date_start" eval="(DateTime.now()+timedelta(20-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="state">draft</field>
<field name="responsible_id" ref="res_users_userdesign0"/>
<field eval="10.0" name="duration"/>
<field eval="20.0" name="duration"/>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field name="constraint_date_start">2010-03-09 16:00:00</field>
<field name="date_end">2010-04-10 16:02:00</field>
<field name="constraint_date_start" eval="(DateTime.now()+timedelta(25-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="date_end" eval="(DateTime.now()+timedelta(40-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
</record>
<record id="project_phase_developmentintegrationandtesting0" model="project.phase">
@ -314,14 +314,14 @@
<field name="name">Development, Integration and Testing</field>
<field name="product_uom" ref="product.uom_day"/>
<field eval="10" name="sequence"/>
<field name="constraint_date_end">2010-04-27 17:29:00</field>
<field name="date_start">2010-04-12 16:10:00</field>
<field name="constraint_date_end" eval="(DateTime.now()+timedelta(57-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="date_start" eval="(DateTime.now()+timedelta(30-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="state">draft</field>
<field name="responsible_id" ref="res_users_manager0"/>
<field eval="15.0" name="duration"/>
<field eval="22.0" name="duration"/>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field name="constraint_date_start">2010-03-10 16:11:00</field>
<field name="date_end">2010-04-26 16:10:00</field>
<field name="constraint_date_start" eval="(DateTime.now()+timedelta(35-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="date_end" eval="(DateTime.now()+timedelta(52-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
</record>
<record id="project_phase_websitedeployment0" model="project.phase">
@ -329,14 +329,14 @@
<field name="name">Website Deployment</field>
<field name="product_uom" ref="product.uom_day"/>
<field eval="10" name="sequence"/>
<field name="constraint_date_end">2010-04-30 16:35:00</field>
<field name="date_start">2010-04-26 16:35:00</field>
<field name="constraint_date_end" eval="(DateTime.now()+timedelta(63-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="date_start" eval="(DateTime.now()+timedelta(55-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="state">draft</field>
<field name="responsible_id" ref="res_users_manager0"/>
<field eval="2.0" name="duration"/>
<field eval="5.0" name="duration"/>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field name="constraint_date_start">2010-03-10 16:35:00</field>
<field name="date_end">2010-04-27 16:34:00</field>
<field name="constraint_date_start" eval="(DateTime.now()+timedelta(58-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="date_end" eval="(DateTime.now()+timedelta(60-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
</record>
<!-- Project Resource Allocation -->
@ -396,11 +396,11 @@
<!-- Tasks -->
<record id="project_task_preparerequirementsdocument0" model="project.task">
<field eval="10" name="sequence"/>
<field name="date_end">2010-03-02 11:00:00</field>
<field eval="24.0" name="planned_hours"/>
<field eval="15" name="sequence"/>
<field eval="100.0" name="planned_hours"/>
<field name="user_id" ref="res_users_user0"/>
<field name="date_start">2010-02-24 05:00:00</field>
<field name="state">open</field>
<field name="date_start" eval="(DateTime.now()-timedelta(70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
@ -408,17 +408,18 @@
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Prepare Requirements Document</field>
<field name="date_deadline">2010-03-08</field>
<field eval="24.0" name="total_hours"/>
<field eval="24.0" name="remaining_hours"/>
<field name="date_deadline" eval="(DateTime.now()+timedelta(55-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field eval="100.0" name="total_hours"/>
<field eval="100.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_informationgatheringandunderstanding0"/>
</record>
<record id="project_task_definewebsitegoalspurposesandtargetaudience0" model="project.task">
<field eval="10" name="sequence"/>
<field eval="65.0" name="planned_hours"/>
<field eval="80.0" name="planned_hours"/>
<field name="user_id" ref="res_users_useranalyst0"/>
<field name="date_start">2010-02-25 15:38:08</field>
<field name="state">open</field>
<field name="date_start" eval="(DateTime.now()-timedelta(70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
@ -426,17 +427,18 @@
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Define Website Goals, Purposes and Target Audience</field>
<field name="date_deadline">2010-03-04</field>
<field eval="65.0" name="total_hours"/>
<field eval="65.0" name="remaining_hours"/>
<field name="date_deadline" eval="(DateTime.now()+timedelta(10-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field eval="80.0" name="total_hours"/>
<field eval="80.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_informationgatheringandunderstanding0"/>
</record>
<record id="project_task_usecases0" model="project.task">
<field eval="10" name="sequence"/>
<field eval="16.0" name="planned_hours"/>
<field eval="17" name="sequence"/>
<field eval="40.0" name="planned_hours"/>
<field name="user_id" ref="res_users_userdesign0"/>
<field name="date_start">2010-02-25 15:42:42</field>
<field name="state">open</field>
<field name="date_start" eval="(DateTime.now()+timedelta(48-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
@ -444,9 +446,9 @@
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Use Cases</field>
<field name="date_deadline">2010-03-10</field>
<field eval="16.0" name="total_hours"/>
<field eval="16.0" name="remaining_hours"/>
<field name="date_deadline" eval="(DateTime.now()+timedelta(55-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field eval="40.0" name="total_hours"/>
<field eval="40.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_informationgatheringandunderstanding0"/>
</record>
@ -454,7 +456,8 @@
<field eval="10" name="sequence"/>
<field eval="25.0" name="planned_hours"/>
<field name="user_id" ref="res_users_userfinance0"/>
<field name="date_start">2010-02-25 15:51:00</field>
<field name="state">open</field>
<field name="date_start" eval="(DateTime.now()+timedelta(10-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
@ -462,7 +465,7 @@
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Budget Planning</field>
<field name="date_deadline">2010-03-31</field>
<field name="date_deadline" eval="(DateTime.now()+timedelta(18-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field eval="25.0" name="total_hours"/>
<field eval="25.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_planning0"/>
@ -472,7 +475,8 @@
<field eval="10" name="sequence"/>
<field eval="25.0" name="planned_hours"/>
<field name="user_id" ref="res_users_user0"/>
<field name="date_start">2010-02-25 15:54:42</field>
<field name="state">open</field>
<field name="date_start" eval="(DateTime.now()+timedelta(10-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
@ -480,7 +484,7 @@
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Quality Planning</field>
<field name="date_deadline">2010-03-31</field>
<field name="date_deadline" eval="(DateTime.now()+timedelta(18-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field eval="25.0" name="total_hours"/>
<field eval="25.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_planning0"/>
@ -490,7 +494,8 @@
<field eval="10" name="sequence"/>
<field eval="20.0" name="planned_hours"/>
<field name="user_id" ref="res_users_user1"/>
<field name="date_start">2010-02-25 15:55:11</field>
<field name="state">open</field>
<field name="date_start" eval="(DateTime.now()+timedelta(13-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
@ -498,7 +503,7 @@
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Risk Management Planning</field>
<field name="date_deadline">2010-03-31</field>
<field name="date_deadline" eval="(DateTime.now()+timedelta(20-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field eval="20.0" name="total_hours"/>
<field eval="20.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_planning0"/>
@ -508,7 +513,8 @@
<field eval="10" name="sequence"/>
<field eval="30.0" name="planned_hours"/>
<field name="user_id" ref="res_users_manager0"/>
<field name="date_start">2010-02-25 15:57:48</field>
<field name="state">open</field>
<field name="date_start" eval="(DateTime.now()+timedelta(20-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
@ -516,7 +522,7 @@
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Create Project Schedules</field>
<field name="date_deadline">2010-03-31</field>
<field name="date_deadline" eval="(DateTime.now()+timedelta(25-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field eval="30.0" name="total_hours"/>
<field eval="30.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_planning0"/>
@ -526,7 +532,8 @@
<field eval="10" name="sequence"/>
<field eval="10.0" name="planned_hours"/>
<field name="user_id" ref="res_users_manager0"/>
<field name="date_start">2010-02-25 16:04:16</field>
<field name="state">open</field>
<field name="date_start" eval="(DateTime.now()+timedelta(20-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
@ -534,7 +541,7 @@
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Dataflow Design</field>
<field name="date_deadline">2010-04-02</field>
<field name="date_deadline" eval="(DateTime.now()+timedelta(23-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field eval="10.0" name="total_hours"/>
<field eval="10.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_webdesign0"/>
@ -544,7 +551,8 @@
<field eval="10" name="sequence"/>
<field eval="50.0" name="planned_hours"/>
<field name="user_id" ref="res_users_userdesign0"/>
<field name="date_start">2010-02-25 16:05:43</field>
<field name="state">open</field>
<field name="date_start" eval="(DateTime.now()+timedelta(22-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
@ -552,9 +560,9 @@
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">User Interface Design</field>
<field name="date_deadline">2010-04-10</field>
<field eval="50.0" name="total_hours"/>
<field eval="50.0" name="remaining_hours"/>
<field name="date_deadline" eval="(DateTime.now()+timedelta(40-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field eval="150.0" name="total_hours"/>
<field eval="150.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_webdesign0"/>
</record>
@ -562,7 +570,8 @@
<field eval="10" name="sequence"/>
<field eval="40.0" name="planned_hours"/>
<field name="user_id" ref="res_users_userdesign0"/>
<field name="date_start">2010-02-25 16:06:52</field>
<field name="state">open</field>
<field name="date_start" eval="(DateTime.now()+timedelta(30-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
@ -570,7 +579,7 @@
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Task Level WBS</field>
<field name="date_deadline">2010-04-07</field>
<field name="date_deadline" eval="(DateTime.now()+timedelta(40-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field eval="40.0" name="total_hours"/>
<field eval="40.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_webdesign0"/>
@ -580,7 +589,8 @@
<field eval="10" name="sequence"/>
<field eval="90.0" name="planned_hours"/>
<field name="user_id" ref="res_users_userdeveloper0"/>
<field name="date_start">2010-02-25 16:11:40</field>
<field name="state">open</field>
<field name="date_start" eval="(DateTime.now()+timedelta(30-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
@ -588,16 +598,18 @@
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Modular Programming</field>
<field name="date_deadline">2010-04-22</field>
<field name="date_deadline" eval="(DateTime.now()+timedelta(50-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field eval="90.0" name="total_hours"/>
<field eval="90.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_developmentintegrationandtesting0"/>
</record>
<record id="project_task_integratemodules0" model="project.task">
<field eval="10" name="sequence"/>
<field eval="20.0" name="planned_hours"/>
<field name="user_id" ref="res_users_userdeveloper1"/>
<field name="date_start">2010-02-25 16:13:10</field>
<field name="state">open</field>
<field name="date_start" eval="(DateTime.now()+timedelta(45-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
@ -605,16 +617,18 @@
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Integrate Modules</field>
<field name="date_deadline">2010-04-24</field>
<field name="date_deadline" eval="(DateTime.now()+timedelta(53-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field eval="20.0" name="total_hours"/>
<field eval="20.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_developmentintegrationandtesting0"/>
</record>
<record id="project_task_unittesting0" model="project.task">
<field eval="10" name="sequence"/>
<field eval="30.0" name="planned_hours"/>
<field eval="50.0" name="planned_hours"/>
<field name="user_id" ref="res_users_usertester0"/>
<field name="date_start">2010-02-25 16:14:32</field>
<field name="state">open</field>
<field name="date_start" eval="(DateTime.now()+timedelta(40-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
@ -622,16 +636,18 @@
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Unit Testing</field>
<field name="date_deadline">2010-04-24</field>
<field eval="30.0" name="total_hours"/>
<field eval="30.0" name="remaining_hours"/>
<field name="date_deadline" eval="(DateTime.now()+timedelta(55-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field eval="50.0" name="total_hours"/>
<field eval="50.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_developmentintegrationandtesting0"/>
</record>
<record id="project_task_regressiontest0" model="project.task">
<field eval="10" name="sequence"/>
<field eval="30.0" name="planned_hours"/>
<field name="user_id" ref="res_users_usertester0"/>
<field name="date_start">2010-02-25 16:15:38</field>
<field name="state">open</field>
<field name="date_start" eval="(DateTime.now()+timedelta(40-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
@ -639,16 +655,18 @@
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Regression Test</field>
<field name="date_deadline">2010-04-24</field>
<field name="date_deadline" eval="(DateTime.now()+timedelta(55-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field eval="30.0" name="total_hours"/>
<field eval="30.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_developmentintegrationandtesting0"/>
</record>
<record id="project_task_documentation0" model="project.task">
<field eval="10" name="sequence"/>
<field eval="15.0" name="planned_hours"/>
<field name="user_id" ref="res_users_demouser1"/>
<field name="date_start">2010-02-25 16:17:04</field>
<field name="state">open</field>
<field name="date_start" eval="(DateTime.now()+timedelta(40-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
@ -656,16 +674,18 @@
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Documentation</field>
<field name="date_deadline">2010-04-24</field>
<field name="date_deadline" eval="(DateTime.now()+timedelta(55-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field eval="15.0" name="total_hours"/>
<field eval="15.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_websitedeployment0"/>
</record>
<record id="project_task_performancetuning0" model="project.task">
<field eval="10" name="sequence"/>
<field eval="40.0" name="planned_hours"/>
<field name="user_id" ref="res_users_usertester1"/>
<field name="date_start">2010-02-25 16:17:42</field>
<field name="state">open</field>
<field name="date_start" eval="(DateTime.now()+timedelta(45-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
@ -673,16 +693,18 @@
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Performance Tuning</field>
<field name="date_deadline">2010-04-24</field>
<field name="date_deadline" eval="(DateTime.now()+timedelta(55-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field eval="40.0" name="total_hours"/>
<field eval="40.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_developmentintegrationandtesting0"/>
</record>
<record id="project_task_deploywebsite0" model="project.task">
<field eval="10" name="sequence"/>
<field eval="5.0" name="planned_hours"/>
<field name="user_id" ref="res_users_userdeveloper0"/>
<field name="date_start">2010-02-25 16:21:15</field>
<field name="state">open</field>
<field name="date_start" eval="(DateTime.now()+timedelta(55-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
@ -690,171 +712,29 @@
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Deploy Website</field>
<field name="date_deadline">2010-04-26</field>
<field name="date_deadline" eval="(DateTime.now()+timedelta(60-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field eval="5.0" name="total_hours"/>
<field eval="5.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_websitedeployment0"/>
</record>
<record id="project_task_presentation0" model="project.task">
<field eval="10" name="sequence"/>
<field eval="5.0" name="planned_hours"/>
<field name="user_id" ref="res_users_demouser1"/>
<field name="date_start">2010-02-25 16:22:09</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Presentation</field>
<field name="date_deadline">2010-04-28</field>
<field eval="5.0" name="total_hours"/>
<field eval="5.0" name="remaining_hours"/>
</record>
<record id="project_task_deployment0" model="project.task">
<field eval="10" name="sequence"/>
<field eval="5.0" name="planned_hours"/>
<field name="user_id" ref="res_users_userdeveloper0"/>
<field name="date_start">2010-02-25 16:36:02</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Deployment</field>
<field name="date_deadline">2010-04-28</field>
<field eval="5.0" name="total_hours"/>
<field eval="5.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_websitedeployment0"/>
</record>
<record id="project_task_presentation1" model="project.task">
<field eval="10" name="sequence"/>
<field eval="5.0" name="planned_hours"/>
<field name="user_id" ref="res_users_demouser1"/>
<field name="date_start">2010-02-25 16:36:43</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Presentation</field>
<field name="date_deadline">2010-04-29</field>
<field eval="5.0" name="total_hours"/>
<field eval="5.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_websitedeployment0"/>
</record>
<record id="project_task_modulesintegration0" model="project.task">
<field eval="10" name="sequence"/>
<field eval="20.0" name="planned_hours"/>
<field name="user_id" ref="res_users_userdeveloper1"/>
<field name="date_start">2010-02-25 17:22:46</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Modules Integration</field>
<field name="date_deadline">2010-04-24</field>
<field eval="20.0" name="total_hours"/>
<field eval="20.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_developmentintegrationandtesting0"/>
</record>
<record id="project_task_unittesting1" model="project.task">
<field eval="10" name="sequence"/>
<field eval="30.0" name="planned_hours"/>
<field name="user_id" ref="res_users_usertester0"/>
<field name="date_start">2010-02-25 17:34:32</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Unit Testing</field>
<field name="date_deadline">2010-04-24</field>
<field eval="30.0" name="total_hours"/>
<field eval="30.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_developmentintegrationandtesting0"/>
</record>
<record id="project_task_modulartesting0" model="project.task">
<field eval="10" name="sequence"/>
<field eval="20.0" name="planned_hours"/>
<field name="user_id" ref="res_users_userdeveloper1"/>
<field name="date_start">2010-02-25 17:35:46</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Modular Testing</field>
<field name="date_deadline">2010-04-24</field>
<field eval="20.0" name="total_hours"/>
<field eval="20.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_developmentintegrationandtesting0"/>
</record>
<record id="project_task_documentation1" model="project.task">
<field eval="10" name="sequence"/>
<field eval="10.0" name="planned_hours"/>
<field name="user_id" ref="res_users_demouser1"/>
<field name="date_start">2010-02-25 17:36:27</field>
<field name="state">open</field>
<field name="date_start" eval="(DateTime.now()+timedelta(58-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Documentation</field>
<field name="date_deadline">2010-04-28</field>
<field name="name">Presentation</field>
<field name="date_deadline" eval="(DateTime.now()+timedelta(65-70)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field eval="10.0" name="total_hours"/>
<field eval="10.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_developmentintegrationandtesting0"/>
</record>
<record id="project_task_performancetuning1" model="project.task">
<field eval="10" name="sequence"/>
<field eval="30.0" name="planned_hours"/>
<field name="user_id" ref="res_users_usertester1"/>
<field name="date_start">2010-02-25 17:37:03</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Performance Tuning</field>
<field name="date_deadline">2010-04-27</field>
<field eval="30.0" name="total_hours"/>
<field eval="30.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_developmentintegrationandtesting0"/>
</record>
<record id="project_task_modularprogramming1" model="project.task">
<field eval="10" name="sequence"/>
<field name="date_end">2010-03-12 18:00:00</field>
<field eval="100.0" name="planned_hours"/>
<field name="user_id" ref="res_users_userdeveloper0"/>
<field name="date_start">2010-03-01 12:00:00</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
<field eval="1" name="active"/>
<field name="name">Modular Programming</field>
<field name="date_deadline">2010-04-22</field>
<field eval="100.0" name="total_hours"/>
<field eval="100.0" name="remaining_hours"/>
<field name="phase_id" ref="project_phase_developmentintegrationandtesting0"/>
<field name="phase_id" ref="project_phase_websitedeployment0"/>
</record>
</data>

View File

@ -215,7 +215,7 @@ class project_task(osv.osv):
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False):
if not context:
context = {}
if not context.get('planning'):
if not context.get('planning', False):
return super(project_task,self).search(cr, user, args, offset, limit, order, context)
cr.execute(" SELECT t.id, t.name \
from project_task t \
@ -529,7 +529,7 @@ WHERE user_id=%s and account_id=%s and date>=%s and date<=%s''', (line.user_id.i
project_task
WHERE
''' + where + '''
project_id IN (select id from project_project where category_id=%s) AND
project_id IN (select id from project_project where analytic_account_id=%s) AND
date_end>=%s AND
date_end<=%s''', (
line.account_id.id,

View File

@ -87,7 +87,7 @@
<form string="Tasks">
<group colspan="4" col="2">
<field name="name" select="1"/>
<field name="project_id" required="1" select="1" domain="[('category_id','=',parent.account_id)]"/>
<field name="project_id" required="1" select="1" domain="[('analytic_account_id','=',parent.account_id)]"/>
</group>
<group colspan="4" col="4">
<field name="date_deadline"/>
@ -123,7 +123,7 @@
<field name="sequence"/>
</group>
<separator string="Miscelleanous" colspan="4"/>
<field name="type"/>
<field name="type_id"/>
<field name="active"/>
<field name="partner_id"/>
<separator colspan="4" string="Notes"/>

View File

@ -69,7 +69,7 @@ class project_work(osv.osv):
vals_line['product_id'] = result['product_id']
vals_line['date'] = vals['date'][:10]
vals_line['unit_amount'] = vals['hours']
acc_id = obj_task.project_id.category_id.id
acc_id = obj_task.project_id.analytic_account_id.id
vals_line['account_id'] = acc_id
res = obj_timesheet.on_change_account_id(cr, uid, False, acc_id)
if res.get('value'):
@ -165,7 +165,7 @@ class task(osv.osv):
task_obj_l = self.browse(cr, uid, ids, context)
if (vals.has_key('project_id') and vals['project_id']):
project_obj = self.pool.get('project.project').browse(cr, uid, vals['project_id'])
acc_id = project_obj.category_id.id
acc_id = project_obj.analytic_account_id.id
for task_obj in task_obj_l:
if len(task_obj.work_ids):
@ -188,7 +188,7 @@ class project_project(osv.osv):
context = {}
result = []
for project in self.browse(cr, user, ids, context):
name = "[%s] %s" % (project.category_id and project.category_id.code or '?', project.name)
name = "[%s] %s" % (project.analytic_account_id and project.analytic_account_id.code or '?', project.name)
result.append((project.id, name))
return result

View File

@ -33,7 +33,7 @@ class thunderbird_installer(osv.osv_memory):
data = super(thunderbird_installer, self).default_get(cr, uid, fields, context)
pdf_file = open(config['addons_path'] + "/thunderbird/doc/Installation Guide to OpenERP Thunderbid Plug-in.pdf", 'r')
data['pdf_file'] = base64.encodestring(pdf_file.read())
file = open(config['addons_path'] + "/thunderbird/plugin/tiny_plugin-2.0.xpi", 'r')
file = open(config['addons_path'] + "/thunderbird/plugin/OpenERP_plugin-2.0.xpi", 'r')
data['plugin_file'] = base64.encodestring(file.read())
return data
@ -48,9 +48,9 @@ class thunderbird_installer(osv.osv_memory):
_defaults = {
'thunderbird' : True,
'name' : 'tiny_plugin-2.0.xpi',
'name' : 'OpenERP_plugin-2.0.xpi',
'pdf_name' : 'Installation Guide to OpenERP Thunderbid Plug-in.pdf',
'description' : """ * Save the Thunderbird plug­in. \n * Follows the step to install Thunderbird plug­in. \n -> 1.From Menu Bar of Thunderbird, open Tools ­> Add ons. \n -> 2. Click on install button and a browser window appears. \n -> 3. Select the plug-in(.xpi file) and click Ok. \n -> 4. Software installation window appears and within a short time “Install Now” button will be enabled \n -> 5. Click "Install Now". \n -> 6. Restart Thunderbird."""
'description' : """ * Save the Thunderbird plug­in. \n * Follow the Steps to configure OpenERP in Thunderbird. \n -> 1. Go to Tools > OpenERP Synchronization. \n -> 2. check data (configured by default). \n -> 3. Click Test Connection. \n -> 4. A message appears with state of your connection. \n -> 5. If your connection failed, check if your database is open, and check your data. \n -> 6. If you have a good connection, click Ok and start to archive mail in OpenERP."""
}
thunderbird_installer()