[IMP] to fix

bzr revid: fp@tinyerp.com-20111201134831-w2t5psf00vrwnqwi
This commit is contained in:
Fabien Pinckaers 2011-12-01 14:48:31 +01:00
parent f122a674c8
commit 9073a54e41
5 changed files with 31 additions and 19 deletions

View File

@ -8,11 +8,10 @@
<field name="type">tree</field>
<field eval="8" name="priority"/>
<field name="arch" type="xml">
<tree toolbar="1" colors="red:(date&lt;current_date);black:(date&gt;=current_date);black:(date==False)" string="Analytic Accounts">
<tree toolbar="1" colors="red:state=='pending';grey:state=='done';blue:type=='view'" string="Analytic Accounts">
<field name="code"/>
<field name="complete_name"/>
<field name="quantity"/>
<field name="quantity_max"/>
<field name="date"/>
<field name="user_id" invisible="1"/>
<field name="parent_id" invisible="1"/>
@ -57,11 +56,10 @@
<field name="type">tree</field>
<field name="field_parent">child_complete_ids</field>
<field name="arch" type="xml">
<tree colors="blue:type == 'view';red:(date&lt;current_date);black:(date&gt;=current_date);black:(date==False)" string="Analytic account" toolbar="1">
<tree colors="red:state=='pending';grey:state=='done';blue:type=='view'" string="Analytic account" toolbar="1">
<field name="name"/>
<field name="code"/>
<field name="quantity"/>
<field name="quantity_max"/>
<field name="debit"/>
<field name="credit"/>
<field name="balance"/>
@ -85,7 +83,7 @@
<group colspan="4" col="6">
<field name="name" select="1" colspan="4"/>
<field name="code" select="1"/>
<field name="parent_id" on_change="on_change_parent(parent_id)" groups="base.group_extended" domain="[('type','=','view')]"/>
<field name="parent_id" on_change="on_change_parent(parent_id)" groups="base.group_extended"/>
<field name="company_id" on_change="on_change_company(company_id)" select="2" widget="selection" groups="base.group_multi_company" attrs="{'required': [('type','&lt;&gt;','view')]}"/>
<field name="type" select="2"/>
</group>
@ -194,7 +192,7 @@
<field name="journal_id" invisible="context.get('to_invoice', False)"/>
<field name="amount" sum="Total" invisible="context.get('to_invoice', False)"/>
<field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)" invisible="not context.get('to_invoice', False)"/>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" sum="Total Quantity" invisible="not context.get('to_invoice', False)"/>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" sum="Total Quantity"/>
<field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" invisible="not context.get('to_invoice', False)"/>
<field domain="[('type','=','normal')]" name="account_id"/>
<field name="general_account_id" invisible="context.get('to_invoice', False)"/>

View File

@ -406,25 +406,25 @@ 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='Hours Tot',
help="Number of hours you spent on the analytic account (from timesheet). It computes on all journal of type 'general'."),
'hours_quantity': fields.function(_analysis_all, multi='analytic_analysis', type='float', string='Total Duration',
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."),
'last_worked_invoiced_date': fields.function(_analysis_all, multi='analytic_analysis', type='date', string='Date of Last Invoiced Cost',
help="If invoice from the costs, this is the date of the latest work or cost that have been invoiced."),
'last_worked_date': fields.function(_analysis_all, multi='analytic_analysis', type='date', string='Date of Last Cost/Work',
help="Date of the latest work done on this account."),
'hours_qtt_non_invoiced': fields.function(_analysis_all, multi='analytic_analysis', type='float', string='Uninvoiced Hours',
help="Number of hours (from journal of type 'general') that can be invoiced if you invoice based on analytic account."),
'hours_qtt_invoiced': fields.function(_hours_qtt_invoiced_calc, type='float', string='Invoiced Hours',
help="Number of hours that can be invoiced plus those that already have been invoiced."),
'remaining_hours': fields.function(_remaining_hours_calc, type='float', string='Remaining Hours',
help="Computed using the formula: Maximum Quantity - Hours Tot."),
'hours_qtt_non_invoiced': fields.function(_analysis_all, multi='analytic_analysis', type='float', string='Uninvoiced Time',
help="Number of time (hours/days) (from journal of type 'general') that can be invoiced if you invoice based on analytic account."),
'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"),
'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 Hours (real)',
help="Computed using the formula: Invoiced Amount / Hours Tot.",
'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",
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

@ -117,8 +117,8 @@
<field eval="20" name="priority"/>
<field name="arch" type="xml">
<tree string="Analytic accounts">
<field name="code"/>
<field name="complete_name"/>
<field name="code"/>
<field name="hours_qtt_non_invoiced"/>
<field name="remaining_hours"/>
<field name="ca_to_invoice"/>

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 Quantity', help='Sets the higher limit of quantity of hours.'),
'quantity_max': fields.float('Maximum Time', help='Sets the higher limit of quantity of hours.'),
'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

@ -108,6 +108,20 @@ 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>
<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}</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 related to your customer projects in order to track the invoicing progress.</field>
</record>
<menuitem id="menu_invoicing_contracts" parent="menu_invoicing" sequence="4"
action="account_analytic_analysis.action_account_analytic_overdue"/>
</data>
</openerp>