[IMP] Contracts management

bzr revid: fp@tinyerp.com-20111208152658-9ahc2i138gztg7y1
This commit is contained in:
Fabien Pinckaers 2011-12-08 16:26:58 +01:00
parent 042836d89e
commit 63ad3f6af7
6 changed files with 9 additions and 40 deletions

View File

@ -8,9 +8,9 @@
<field name="type">tree</field>
<field eval="8" name="priority"/>
<field name="arch" type="xml">
<tree toolbar="1" colors="red:state=='pending';grey:state=='close';blue:type=='view'" string="Analytic Accounts">
<field name="code"/>
<tree toolbar="1" colors="red:state=='pending';grey:state in ('cancelled','close');blue:type=='view'" string="Analytic Accounts">
<field name="complete_name"/>
<field name="code"/>
<field name="quantity"/>
<field name="date"/>
<field name="user_id" invisible="1"/>
@ -57,7 +57,7 @@
<field name="type">tree</field>
<field name="field_parent">child_complete_ids</field>
<field name="arch" type="xml">
<tree colors="red:state=='pending';grey:state=='done';blue:type=='view'" string="Analytic account" toolbar="1">
<tree colors="red:state=='pending';grey:state in ('close','cancelled');blue:type=='view'" string="Analytic account" toolbar="1">
<field name="name"/>
<field name="code"/>
<field name="quantity"/>

View File

@ -406,7 +406,7 @@ class account_analytic_account(osv.osv):
'ca_theorical': fields.function(_analysis_all, multi='analytic_analysis', type='float', string='Theoretical Revenue',
help="Based on the costs you had on the project, what would have been the revenue if all these costs have been invoiced at the normal sale price provided by the pricelist.",
digits_compute=dp.get_precision('Account')),
'hours_quantity': fields.function(_analysis_all, multi='analytic_analysis', type='float', string='Total Duration',
'hours_quantity': fields.function(_analysis_all, multi='analytic_analysis', type='float', string='Total Time',
help="Number of time you spent on the analytic account (from timesheet). It computes quantities on all journal of type 'general'."),
'last_invoice_date': fields.function(_analysis_all, multi='analytic_analysis', type='date', string='Last Invoice Date',
help="If invoice from the costs, this is the date of the latest invoiced."),
@ -419,12 +419,12 @@ class account_analytic_account(osv.osv):
'hours_qtt_invoiced': fields.function(_hours_qtt_invoiced_calc, type='float', string='Invoiced Time',
help="Number of time (hours/days) that can be invoiced plus those that already have been invoiced."),
'remaining_hours': fields.function(_remaining_hours_calc, type='float', string='Remaining Time',
help="Computed using the formula: Maximum Duration - Total Time"),
help="Computed using the formula: Maximum Time - Total Time"),
'remaining_ca': fields.function(_remaining_ca_calc, type='float', string='Remaining Revenue',
help="Computed using the formula: Max Invoice Price - Invoiced Amount.",
digits_compute=dp.get_precision('Account')),
'revenue_per_hour': fields.function(_revenue_per_hour_calc, type='float', string='Revenue per Time (real)',
help="Computed using the formula: Invoiced Amount / Total Duration",
help="Computed using the formula: Invoiced Amount / Total Time",
digits_compute=dp.get_precision('Account')),
'real_margin': fields.function(_real_margin_calc, type='float', string='Real Margin',
help="Computed using the formula: Invoiced Amount - Total Costs.",

View File

@ -8,6 +8,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('invoice_id','=',False)]</field>
<field name="context">{'search_default_to_invoice': 1}</field>
<field name="search_view_id" ref="account.view_account_analytic_line_filter"/>
</record>
<menuitem action="action_hr_tree_invoiced_all" id="menu_action_hr_tree_invoiced_all" parent="base.menu_invoiced"/>
@ -58,18 +59,6 @@
</record>
<record id="action_account_analytic_overdue" model="ir.actions.act_window">
<field name="name">Contracts to Renew</field>
<field name="res_model">account.analytic.account</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph</field>
<field name="context">{'search_default_has_partner':1, 'search_default_my_accounts':1, 'search_default_draft':1, 'search_default_pending':1, 'search_default_open':1, 'search_default_renew':1}</field>
<field name="domain">[('type','=','normal')]</field>
<field name="search_view_id" ref="view_account_analytic_account_overdue_search"/>
<field name="help">You will find here the contracts to be renewed because the deadline is passed or the working hours are higher than the allocated hours. OpenERP automatically sets these analytic accounts to the pending state, in order to raise a warning during the timesheets recording. Salesmen should review all pending accounts and reopen or close the according to the negotiation with the customer.</field>
</record>
<menuitem action="action_account_analytic_overdue" id="menu_action_account_analytic_overdue" sequence="50" parent="base.menu_invoiced"/>
<record id="action_account_analytic_overdue" model="ir.actions.act_window">
<field name="name">Contracts to Renew</field>
<field name="res_model">account.analytic.account</field>

View File

@ -110,22 +110,5 @@
</field>
</record>
<record id="view_account_analytic_simplified" model="ir.ui.view">
<field name="name">account.analytic.account.simplified.tree</field>
<field name="model">account.analytic.account</field>
<field name="type">tree</field>
<field eval="20" name="priority"/>
<field name="arch" type="xml">
<tree string="Analytic accounts">
<field name="complete_name"/>
<field name="code"/>
<field name="hours_qtt_non_invoiced"/>
<field name="remaining_hours"/>
<field name="ca_to_invoice"/>
<field name="last_invoice_date"/>
</tree>
</field>
</record>
</data>
</openerp>

View File

@ -161,7 +161,7 @@ class account_analytic_account(osv.osv):
'debit': fields.function(_debit_credit_bal_qtty, type='float', string='Debit', multi='debit_credit_bal_qtty', digits_compute=dp.get_precision('Account')),
'credit': fields.function(_debit_credit_bal_qtty, type='float', string='Credit', multi='debit_credit_bal_qtty', digits_compute=dp.get_precision('Account')),
'quantity': fields.function(_debit_credit_bal_qtty, type='float', string='Quantity', multi='debit_credit_bal_qtty'),
'quantity_max': fields.float('Maximum Time', help='Sets the higher limit of quantity of hours.'),
'quantity_max': fields.float('Maximum Time', help='Sets the higher limit of time to work on the contract.'),
'partner_id': fields.many2one('res.partner', 'Partner'),
'contact_id': fields.many2one('res.partner.address', 'Contact'),
'user_id': fields.many2one('res.users', 'Account Manager'),

View File

@ -107,9 +107,6 @@ the project form.</field>
-->
<menuitem id="menu_project_working_hours" parent="base.menu_project_management_time_tracking" action="hr_timesheet.act_hr_timesheet_line_evry1_all_form"/>
<menuitem id="menu_invoicing" name="Billing" parent="base.menu_main_pm" sequence="4"/>
<record id="action_account_analytic_overdue" model="ir.actions.act_window">
<field name="name">Customer Projects</field>
<field name="res_model">account.analytic.account</field>
@ -120,7 +117,7 @@ the project form.</field>
<field name="search_view_id" ref="account_analytic_analysis.view_account_analytic_account_overdue_search"/>
<field name="help">You will find here the contracts related to your customer projects in order to track the invoicing progress.</field>
</record>
<menuitem id="menu_invoicing_contracts" parent="menu_invoicing" sequence="4"
<menuitem id="menu_invoicing_contracts" parent="menu_project_billing" sequence="4"
action="account_analytic_analysis.action_account_analytic_overdue"/>
</data>