[IMP] contract managemnet

bzr revid: fp@tinyerp.com-20111218193638-shwuuqjbqhlk6l3n
This commit is contained in:
Fabien Pinckaers 2011-12-18 20:36:38 +01:00
parent c96a049fb3
commit 22b57ea01e
6 changed files with 15 additions and 16 deletions

View File

@ -261,7 +261,7 @@ class account_invoice(osv.osv):
'partner_bank_id': fields.many2one('res.partner.bank', 'Bank Account',
help='Bank Account Number, Company bank account if Invoice is customer or supplier refund, otherwise Partner bank account number.', readonly=True, states={'draft':[('readonly',False)]}),
'move_lines':fields.function(_get_lines, type='many2many', relation='account.move.line', string='Entry Lines'),
'residual': fields.function(_amount_residual, digits_compute=dp.get_precision('Account'), string='Residual',
'residual': fields.function(_amount_residual, digits_compute=dp.get_precision('Account'), string='To Pay',
store={
'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line','move_id'], 50),
'account.invoice.tax': (_get_invoice_tax, None, 50),

View File

@ -10,7 +10,7 @@
<field name="arch" type="xml">
<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="code" groups="base.group_extended"/>
<field name="quantity"/>
<field name="date"/>
<field name="user_id" invisible="1"/>
@ -59,7 +59,7 @@
<field name="arch" type="xml">
<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="code" groups="base.group_extended"/>
<field name="quantity"/>
<field name="debit"/>
<field name="credit"/>
@ -82,8 +82,8 @@
<field name="arch" type="xml">
<form string="Analytic account">
<group colspan="4" col="6">
<field name="name" select="1" colspan="4"/>
<field name="code" select="1"/>
<field name="name" colspan="4"/>
<field name="code" groups="base.group_extended"/>
<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"/>

View File

@ -32,13 +32,11 @@
help="Analytic Accounts with a past deadline in one month." />
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="partner_id" select="1">
<field name="name" filter_domain="['|', ('name','ilike',self),('code','ilike',self)]" string="Contract"/>
<field name="partner_id">
<filter string="A contract in OpenERP is an analytic account having a partner set on it." name="has_partner" domain="[('partner_id', '!=', False)]" icon="terp-partner" />
</field>
<field name="user_id">
<filter string="My Accounts" domain="[('user_id','=',uid)]" icon="terp-personal" name="my_accounts" />
<filter string="No Account Manager" domain="[('user_id', '=', False)]" icon="terp-personal-" />
</field>
@ -64,7 +62,7 @@
<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="context">{'search_default_has_partner':1, 'search_default_user_id':uid, '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>
@ -76,7 +74,7 @@
<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="context">{'search_default_has_partner':1, 'search_default_user_id':uid, '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"/>
</record>

View File

@ -16,14 +16,14 @@
<field eval="18" name="priority"/>
<field name="arch" type="xml">
<group name="invoice_stats" position="inside">
<field name="hours_qtt_non_invoiced"/>
<field name="ca_to_invoice"/>
<field name="hours_qtt_non_invoiced" attrs="{'invisible': [('to_invoice','=',0)]}"/>
<field name="ca_to_invoice" attrs="{'invisible': [('to_invoice','=',0)]}"/>
<label string="" colspan="1"/>
<button
name="%(hr_timesheet_invoice.action_hr_timesheet_invoice_create_final)d"
string="Create Invoice"
type="action"
attrs="{'readonly':[('ca_to_invoice','=',0.0)]}"
attrs="{'readonly':[('ca_to_invoice','=',0.0)], 'invisible': [('to_invoice','=',0)]}"
icon="gtk-go-forward"/>
</group>
</field>

View File

@ -65,7 +65,8 @@ class account_analytic_account(osv.osv):
_columns = {
'pricelist_id': fields.many2one('product.pricelist', 'Customer Pricelist',
help="The product to invoice is defined on the employee form, the price will be deduced by this pricelist on the product."),
'amount_max': fields.float('Max. Invoice Price'),
'amount_max': fields.float('Max. Invoice Price',
help="Keep empty if this contract is not limited to a total fixed price."),
'amount_invoiced': fields.function(_invoiced_calc, string='Invoiced Amount',
help="Total invoiced"),
'to_invoice': fields.many2one('hr_timesheet_invoice.factor', 'Invoice on Timesheet & Costs',

View File

@ -18,7 +18,7 @@
<field name="price" groups="base.group_extended"/>
</group>
<group col="2" colspan="4" groups="base.group_extended">
<separator string="Force to use a specific product" colspan="4" />
<separator string="Force to use a specific product" colspan="4"/>
<field name="product"/>
</group>
</page>