[MERGE] merge from rma branch

bzr revid: ged@openerp.com-20140410145131-fj17mdpi13wa5a9m
This commit is contained in:
Gery Debongnie 2014-04-10 16:51:31 +02:00
commit 2e9ee9c76e
64 changed files with 671 additions and 185 deletions

View File

@ -163,13 +163,14 @@ class res_partner(osv.osv):
return self._asset_difference_search(cr, uid, obj, name, 'payable', args, context=context) return self._asset_difference_search(cr, uid, obj, name, 'payable', args, context=context)
def _invoice_journal_item_count(self, cr, uid, ids, field_name, arg, context=None): def _invoice_journal_item_count(self, cr, uid, ids, field_name, arg, context=None):
res = dict(map(lambda x: (x,{'invoice_count': 0, 'journal_item_count': 0}), ids)) res = dict(map(lambda x: (x,{'invoice_count': 0, 'journal_item_count': 0, 'cotracts_count': 0 }), ids))
# the user may not have access rights # the user may not have access rights
try: try:
for partner in self.browse(cr, uid, ids, context): for partner in self.browse(cr, uid, ids, context):
res[partner.id] = { res[partner.id] = {
'invoice_count': len(partner.invoice_ids), 'invoice_count': len(partner.invoice_ids),
'journal_item_count': len(partner.journal_item_ids), 'journal_item_count': len(partner.journal_item_ids),
'cotracts_count': len(partner.contract_ids)
} }
except: except:
pass pass
@ -204,6 +205,7 @@ class res_partner(osv.osv):
'debit': fields.function(_credit_debit_get, fnct_search=_debit_search, string='Total Payable', multi='dc', help="Total amount you have to pay to this supplier."), 'debit': fields.function(_credit_debit_get, fnct_search=_debit_search, string='Total Payable', multi='dc', help="Total amount you have to pay to this supplier."),
'debit_limit': fields.float('Payable Limit'), 'debit_limit': fields.float('Payable Limit'),
'invoice_count': fields.function(_invoice_journal_item_count, string="Invoices", type='integer', multi="invoice_journal"), 'invoice_count': fields.function(_invoice_journal_item_count, string="Invoices", type='integer', multi="invoice_journal"),
'cotracts_count': fields.function(_invoice_journal_item_count, string="Contracts", type='integer', multi="invoice_journal"),
'journal_item_ids': fields.one2many('account.move.line', 'partner_id', 'Journal Items'), 'journal_item_ids': fields.one2many('account.move.line', 'partner_id', 'Journal Items'),
'journal_item_count': fields.function(_invoice_journal_item_count, string="Journal Items", type="integer", multi="invoice_journal"), 'journal_item_count': fields.function(_invoice_journal_item_count, string="Journal Items", type="integer", multi="invoice_journal"),
'property_account_payable': fields.property( 'property_account_payable': fields.property(

View File

@ -71,11 +71,13 @@
context="{'search_default_partner_id': active_id,'default_partner_id': active_id}" groups="account.group_account_invoice"> context="{'search_default_partner_id': active_id,'default_partner_id': active_id}" groups="account.group_account_invoice">
<field string="Invoices" name="invoice_count" widget="statinfo" attrs="{'readonly':1}"/> <field string="Invoices" name="invoice_count" widget="statinfo" attrs="{'readonly':1}"/>
</button> </button>
<button type="action" class="oe_stat_button" name="%(account.action_account_moves_all_tree)d" groups="account.group_account_user" icon="fa-book"> <button type="action" class="oe_stat_button" name="%(account.action_account_moves_all_tree)d" groups="account.group_account_user" icon="fa-list">
<field string="Journal Items" name="journal_item_count" widget="statinfo"/> <field string="Journal Items" name="journal_item_count" widget="statinfo"/>
</button> </button>
<button type="action" string="Contracts" name="%(account.action_open_partner_analytic_accounts)d" <button class="oe_inline oe_stat_button" type="action" name="%(account.action_open_partner_analytic_accounts)d"
groups="analytic.group_analytic_accounting"/> icon="fa-book" groups="analytic.group_analytic_accounting">
<field string="Contracts" name="cotracts_count" widget="statinfo"/>
</button>
</xpath> </xpath>
</field> </field>
</record> </record>

View File

@ -114,6 +114,19 @@ class sale_order_line(osv.osv):
if rec: if rec:
inv_line_obj.write(cr, uid, [line.id], {'account_analytic_id': rec.analytic_id.id}, context=context) inv_line_obj.write(cr, uid, [line.id], {'account_analytic_id': rec.analytic_id.id}, context=context)
return create_ids return create_ids
class product_product(osv.Model):
_inherit = 'product.product'
def _rules_count(self, cr, uid, ids, field_name, arg, context=None):
res = dict(map(lambda x: (x,0), ids))
try:
for rule in self.browse(cr, uid, ids, context=context):
res[rule.id] = len(rule.rules_ids)
except:
pass
return res
_columns = {
'rules_ids': fields.one2many('account.analytic.default', 'product_id', 'Analytic Rules '),
'rules_count': fields.function(_rules_count, string='# Analytic Rules', type='integer'),
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -80,7 +80,10 @@
<field name="inherit_id" ref="product.product_normal_form_view"/> <field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//div[@name='buttons']" position="inside"> <xpath expr="//div[@name='buttons']" position="inside">
<button string="Analytic Rules" name= "%(action_product_default_list)d" type="action" groups="analytic.group_analytic_accounting" /> <button class="oe_inline oe_stat_button" name= "%(action_product_default_list)d" type="action"
groups="analytic.group_analytic_accounting" icon="fa-xing">
<field string="Analytic Rules" name="rules_count" widget="statinfo" />
</button>
</xpath> </xpath>
</field> </field>
</record> </record>

View File

@ -237,9 +237,17 @@ class account_asset_asset(osv.osv):
if salvage_value: if salvage_value:
val['value_residual'] = purchase_value - salvage_value val['value_residual'] = purchase_value - salvage_value
return {'value': val} return {'value': val}
def _entry_count(self, cr, uid, ids, field_name, arg, context=None):
res = dict(map(lambda x: (x,0), ids))
try:
for entry in self.browse(cr, uid, ids, context=context):
res[entry.id] = len(entry.account_move_line_ids)
except:
pass
return res
_columns = { _columns = {
'account_move_line_ids': fields.one2many('account.move.line', 'asset_id', 'Entries', readonly=True, states={'draft':[('readonly',False)]}), 'account_move_line_ids': fields.one2many('account.move.line', 'asset_id', 'Entries', readonly=True, states={'draft':[('readonly',False)]}),
'entry_count': fields.function(_entry_count, string='# Asset Entries', type='integer'),
'name': fields.char('Asset Name', size=64, required=True, readonly=True, states={'draft':[('readonly',False)]}), 'name': fields.char('Asset Name', size=64, required=True, readonly=True, states={'draft':[('readonly',False)]}),
'code': fields.char('Reference', size=32, readonly=True, states={'draft':[('readonly',False)]}), 'code': fields.char('Reference', size=32, readonly=True, states={'draft':[('readonly',False)]}),
'purchase_value': fields.float('Gross Value', required=True, readonly=True, states={'draft':[('readonly',False)]}), 'purchase_value': fields.float('Gross Value', required=True, readonly=True, states={'draft':[('readonly',False)]}),

View File

@ -84,7 +84,9 @@
</header> </header>
<sheet> <sheet>
<div class="oe_button_box oe_right"> <div class="oe_button_box oe_right">
<button name="open_entries" string="Entries" type="object" class="oe_inline"/> <button class="oe_inline oe_stat_button" name="open_entries" type="object" icon="fa-pencil">
<field string="Entries" name="entry_count" widget="statinfo" />
</button>
</div> </div>
<div class="oe_title"> <div class="oe_title">
<label for="name" class="oe_edit_only"/> <label for="name" class="oe_edit_only"/>

View File

@ -78,14 +78,18 @@
<field name="model">res.partner</field> <field name="model">res.partner</field>
<field name="groups_id" eval="[(4, ref('account.group_account_invoice'))]"/> <field name="groups_id" eval="[(4, ref('account.group_account_invoice'))]"/>
<field name="arch" type="xml" > <field name="arch" type="xml" >
<xpath expr="//div[@name='buttons']" position="inside" groups="account.group_account_invoice">
<button class="oe_inline oe_stat_button" type="object" name="do_button_print"
icon="fa-print" string="Print Overdue" widget="statinfo" groups="account.group_account_user"
help="Print overdue payments report independent of follow-up line"
attrs="{'invisible':[('payment_amount_due', '&lt;=', 0.0)]}"/>
<button class="oe_inline oe_stat_button" type="object" name="do_partner_mail"
icon="fa-envelope-o" string="Mail Overdue" widget="statinfo"
help="If not specified by the latest follow-up level, it will send from the default email template"
attrs="{'invisible':[('payment_amount_due', '&lt;=', 0.0)]}" groups="account.group_account_user"/>
</xpath>
<page string="Accounting" position="before" version="7.0"> <page string="Accounting" position="before" version="7.0">
<page string="Payment Follow-up" groups="account.group_account_invoice" name="followup_tab"> <page string="Payment Follow-up" groups="account.group_account_invoice" name="followup_tab">
<div class="oe_right oe_button_box" name="followup_button">
<button name="do_button_print" type="object" string="Print Overdue Payments" groups="account.group_account_user"
help="Print overdue payments report independent of follow-up line" attrs="{'invisible':[('payment_amount_due', '&lt;=', 0.0)]}" />
<button name="do_partner_mail" type="object" string="Send Overdue Email" groups="account.group_account_user"
help="If not specified by the latest follow-up level, it will send from the default email template" attrs="{'invisible':[('payment_amount_due', '&lt;=', 0.0)]}"/>
</div>
<p attrs="{'invisible':[('latest_followup_date','=', False)]}"> <p attrs="{'invisible':[('latest_followup_date','=', False)]}">
The <field name="latest_followup_date" class = "oe_inline"/>, the latest payment follow-up The <field name="latest_followup_date" class = "oe_inline"/>, the latest payment follow-up
was: <field name="latest_followup_level_id" class="oe_inline"/> was: <field name="latest_followup_level_id" class="oe_inline"/>

View File

@ -69,14 +69,14 @@
<field name="state" widget="statusbar" statusbar_visible="draft,open"/> <field name="state" widget="statusbar" statusbar_visible="draft,open"/>
</header> </header>
<sheet string="Payment order"> <sheet string="Payment order">
<div class="oe_button_box">
<button name="%(action_create_payment_order)d" string="Select Invoices to Pay"
type="action" attrs="{'invisible':[('state','=','done')]}" icon="gtk-find"/>
</div>
<div class="oe_title"> <div class="oe_title">
<label for="reference" class="oe_edit_only"/> <label for="reference" class="oe_edit_only"/>
<h1><field name="reference"/></h1> <h1><field name="reference"/></h1>
</div> </div>
<div class=" oe_right oe_button_box">
<button class="oe_inline oe_stat_button oe_right" name="%(action_create_payment_order)d" string="Invoices" Help="Select Invoices to Pay"
type="action" attrs="{'invisible':[('state','=','done')]}" icon="fa-pencil-square-o" widget="statinfo"/>
</div>
<group> <group>
<group> <group>
<field name="user_id" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'account.group_account_invoice']}"/> <field name="user_id" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'account.group_account_invoice']}"/>
@ -292,7 +292,7 @@
<field name="inherit_id" ref="account.view_bank_statement_form"/> <field name="inherit_id" ref="account.view_bank_statement_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//div[@name='import_buttons']" position="inside"> <xpath expr="//div[@name='import_buttons']" position="inside">
<button name="%(action_account_populate_statement_confirm)d" attrs="{'invisible':[('state','=','confirm')]}" string="Import Payment Lines" type="action" icon="gtk-execute"/> <button class="oe_inline oe_stat_button" name="%(action_account_populate_statement_confirm)d" attrs="{'invisible':[('state','=','confirm')]}" string="Import Lines" help="Import Payment Lines" type="action" icon="fa-cogs" widget="statinfo"/>
</xpath> </xpath>
</field> </field>
</record> </record>

View File

@ -200,9 +200,9 @@
<field name="inherit_id" ref="account.view_bank_statement_form"/> <field name="inherit_id" ref="account.view_bank_statement_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//div[@name='import_buttons']" position="inside"> <xpath expr="//div[@name='import_buttons']" position="inside">
<button name="%(action_view_account_statement_from_invoice_lines)d" <button class="oe_inline oe_stat_button" name="%(action_view_account_statement_from_invoice_lines)d"
string="Import Invoices" type="action" string="Import Invoice" type="action"
attrs="{'invisible':[('state','=','confirm')]}"/> attrs="{'invisible':[('state','=','confirm')]}" widget="statinfo" icon="fa-pencil-square-o"/>
</xpath> </xpath>
</field> </field>
</record> </record>

View File

@ -9,7 +9,6 @@
<field name="context">{'default_ref': 'stock.picking.out,'+str(context.get('active_id', False))}</field> <field name="context">{'default_ref': 'stock.picking.out,'+str(context.get('active_id', False))}</field>
<field name="domain">[('ref','=','stock.picking.out,'+str(context.get('active_id',False)))]</field> <field name="domain">[('ref','=','stock.picking.out,'+str(context.get('active_id',False)))]</field>
</record> </record>
<record id="crm_claim_from_delivery" model="ir.ui.view"> <record id="crm_claim_from_delivery" model="ir.ui.view">
<field name="name">crm.claim.from_delivery.form</field> <field name="name">crm.claim.from_delivery.form</field>
<field name="model">stock.picking.out</field> <field name="model">stock.picking.out</field>
@ -17,11 +16,13 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="/form/sheet/h1" position="before"> <xpath expr="/form/sheet/h1" position="before">
<div class="oe_right oe_button_box"> <div class="oe_right oe_button_box">
<button name="%(action_claim_from_delivery)d" string="Claims" type="action"/> <button class="oe_inline oe_stat_button" type="action"
name="%(action_claim_from_delivery)d" icon="fa-comments" >
<field string="Claims" name="claim_count" widget="statinfo"/>
</button>
</div> </div>
</xpath> </xpath>
</field> </field>
</record> </record>
</data> </data>
</openerp> </openerp>

View File

@ -214,7 +214,14 @@ class crm_lead(format_address, osv.osv):
duration = len(no_days) duration = len(no_days)
res[lead.id][field] = abs(int(duration)) res[lead.id][field] = abs(int(duration))
return res return res
def _meeting_count(self, cr, uid, ids, field_name, arg, context=None):
res = dict(map(lambda x: (x,0), ids))
try:
for meeting in self.browse(cr, uid, ids, context=context):
res[meeting.id] = len(meeting.opportunity_ids)
except:
pass
return res
_columns = { _columns = {
'partner_id': fields.many2one('res.partner', 'Partner', ondelete='set null', track_visibility='onchange', 'partner_id': fields.many2one('res.partner', 'Partner', ondelete='set null', track_visibility='onchange',
select=True, help="Linked partner (optional). Usually created when converting the lead."), select=True, help="Linked partner (optional). Usually created when converting the lead."),
@ -289,6 +296,8 @@ class crm_lead(format_address, osv.osv):
'payment_mode': fields.many2one('crm.payment.mode', 'Payment Mode', \ 'payment_mode': fields.many2one('crm.payment.mode', 'Payment Mode', \
domain="[('section_id','=',section_id)]"), domain="[('section_id','=',section_id)]"),
'planned_cost': fields.float('Planned Costs'), 'planned_cost': fields.float('Planned Costs'),
'opportunity_ids': fields.one2many('calendar.event', 'opportunity_id', 'Opportunities'),
'meeting_count': fields.function(_meeting_count, string='# Meetings', type='integer'),
} }
_defaults = { _defaults = {

View File

@ -103,9 +103,8 @@
</header> </header>
<sheet> <sheet>
<div class="oe_right oe_button_box" name="buttons"> <div class="oe_right oe_button_box" name="buttons">
<button string="Schedule/Log Call" <button class="oe_inline oe_stat_button" type="action" name="%(opportunity2phonecall_act)d" icon="fa-phone"
name="%(opportunity2phonecall_act)d" widget="statinfo" string="Calls"/>
type="action"/>
</div> </div>
<div class="oe_title"> <div class="oe_title">
<label for="name" class="oe_edit_only"/> <label for="name" class="oe_edit_only"/>
@ -389,11 +388,13 @@
</header> </header>
<sheet> <sheet>
<div class="oe_right oe_button_box"> <div class="oe_right oe_button_box">
<button string="Schedule/Log Call" type="action" <button class="oe_inline oe_stat_button" type="action" name="%(opportunity2phonecall_act)d" icon="fa-phone"
name="%(opportunity2phonecall_act)d"/> widget="statinfo" string="Calls"/>
<button string="Meeting" type="object" <button class="oe_inline oe_stat_button" type="object"
name="action_makeMeeting" context="{'search_default_attendee_id': active_id, 'default_attendee_id' : active_id}"
context="{'search_default_attendee_id': active_id, 'default_attendee_id' : active_id}"/> name="action_makeMeeting" icon="fa-calendar">
<field string="Meetings" name="meeting_count" widget="statinfo"/>
</button>
</div> </div>
<div class="oe_title"> <div class="oe_title">
<label for="name" class="oe_edit_only"/> <label for="name" class="oe_edit_only"/>

View File

@ -31,6 +31,15 @@ class crm_phonecall(osv.osv):
_description = "Phonecall" _description = "Phonecall"
_order = "id desc" _order = "id desc"
_inherit = ['mail.thread'] _inherit = ['mail.thread']
def _meeting_count(self, cr, uid, ids, field_name, arg, context=None):
res = dict(map(lambda x: (x,0), ids))
try:
for meeting in self.browse(cr, uid, ids, context=context):
res[meeting.id] = len(meeting.meeting_ids)
except:
pass
return res
_columns = { _columns = {
'date_action_last': fields.datetime('Last Action', readonly=1), 'date_action_last': fields.datetime('Last Action', readonly=1),
'date_action_next': fields.datetime('Next Action', readonly=1), 'date_action_next': fields.datetime('Next Action', readonly=1),
@ -65,6 +74,8 @@ class crm_phonecall(osv.osv):
'date_closed': fields.datetime('Closed', readonly=True), 'date_closed': fields.datetime('Closed', readonly=True),
'date': fields.datetime('Date'), 'date': fields.datetime('Date'),
'opportunity_id': fields.many2one ('crm.lead', 'Lead/Opportunity'), 'opportunity_id': fields.many2one ('crm.lead', 'Lead/Opportunity'),
'meeting_ids': fields.one2many('calendar.event', 'phonecall_id', 'Phonecalls'),
'meeting_count': fields.function(_meeting_count, string='# Meetings', type='integer'),
} }
def _get_default_state(self, cr, uid, context=None): def _get_default_state(self, cr, uid, context=None):

View File

@ -64,15 +64,16 @@
<field name="state" nolabel="1" widget="statusbar" clickable="True"/> <field name="state" nolabel="1" widget="statusbar" clickable="True"/>
</header> </header>
<sheet string="Phone Call"> <sheet string="Phone Call">
<div class="oe_right"> <div class="oe_right oe_button_box">
<button string="Convert to Opportunity" <button class="oe_inline oe_stat_button" type="object" name="action_button_convert2opportunity"
type="object" icon="fa-star" string="Opportunity"
name="action_button_convert2opportunity" attrs="{'invisible':[ '|', ('opportunity_id','!=',False), ('state', 'not in', ('open', 'done'))]}"
attrs="{'invisible':[ '|', ('opportunity_id','!=',False), ('state', 'not in', ('open', 'done'))]}"/> help="Convert to Opportunity" widget="statinfo"/>
<button string="Schedule Other Call" <button class="oe_inline oe_stat_button" type="action"
name="%(phonecall_to_phonecall_act)d" name="%(phonecall_to_phonecall_act)d" icon="fa-phone" string="Other Call" widget="statinfo"/>
type="action"/> <button class="oe_inline oe_stat_button" name="action_make_meeting" type="object" icon="fa-calendar fa-fw">
<button string="Schedule a Meeting" name="action_make_meeting" type="object"/> <field string="Plan Meeting" name="meeting_count" widget="statinfo" />
</button>
</div> </div>
<div class="oe_title"> <div class="oe_title">
<div class="oe_edit_only"> <div class="oe_edit_only">

View File

@ -190,8 +190,17 @@ class crm_claim(osv.osv):
class res_partner(osv.osv): class res_partner(osv.osv):
_inherit = 'res.partner' _inherit = 'res.partner'
def _claim_count(self, cr, uid, ids, field_name, arg, context=None):
res = dict(map(lambda x: (x,0), ids))
try:
for partner in self.browse(cr, uid, ids, context=context):
res[partner.id] = len(partner.claims_ids)
except:
pass
return res
_columns = { _columns = {
'claims_ids': fields.one2many('crm.claim', 'partner_id', 'Claims'), 'claims_ids': fields.one2many('crm.claim', 'partner_id', 'Claims'),
'claim_count': fields.function(_claim_count, string='# Claims', type='integer'),
} }
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -9,11 +9,11 @@
<field name="priority" eval="50"/> <field name="priority" eval="50"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//div[@name='buttons']" position="inside"> <xpath expr="//div[@name='buttons']" position="inside">
<button class="oe_inline" type="action" <button class="oe_inline oe_stat_button" type="action"
name="%(crm_case_categ_claim0)d"
string="Claims"
context="{'search_default_partner_id': active_id, 'default_partner_id': active_id}" context="{'search_default_partner_id': active_id, 'default_partner_id': active_id}"
groups="base.group_sale_salesman" /> name="%(crm_case_categ_claim0)d" icon="fa-comments" groups="base.group_sale_salesman">
<field string="Claims" name="claim_count" widget="statinfo"/>
</button>
</xpath> </xpath>
</field> </field>
</record> </record>

View File

@ -36,7 +36,8 @@
<field name="inherit_id" ref="crm.crm_case_form_view_leads" /> <field name="inherit_id" ref="crm.crm_case_form_view_leads" />
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//div[@name='buttons']/button" position="after"> <xpath expr="//div[@name='buttons']/button" position="after">
<button name="%(convert_lead2projectissue_wizard_action)d" string="Convert to Issue" type="action" help="Convert to Issue" /> <button class="oe_inline oe_stat_button" type="action" name="%(convert_lead2projectissue_wizard_action)d" icon="fa-bug"
help="Convert to Issue" widget="statinfo" string="Move to Issue"/>
</xpath> </xpath>
</field> </field>
</record> </record>

View File

@ -14,15 +14,16 @@
</div> </div>
<div class="oe_right oe_button_box" name="buttons"> <div class="oe_right oe_button_box" name="buttons">
<field name="ref_ir_act_window" invisible="1"/> <field name="ref_ir_act_window" invisible="1"/>
<button name="create_action" string="Add context action" type="object" <button class="oe_inline oe_stat_button" name="create_action" string="Add action" type="object"
attrs="{'invisible':[('ref_ir_act_window','!=',False)]}" attrs="{'invisible':[('ref_ir_act_window','!=',False)]}" icon="fa-plus"
help="Display an option on related documents to open a composition wizard with this template"/> help="Display an option on related documents to open a composition wizard with this template" widget="statinfo"/>
<button name="unlink_action" string="Remove context action" type="object" <button name="unlink_action" string="Drop action" type="object"
class="oe_stat_button" icon="fa-minus"
attrs="{'invisible':[('ref_ir_act_window','=',False)]}" attrs="{'invisible':[('ref_ir_act_window','=',False)]}"
help="Remove the contextual action to use this template on related documents"/> help="Remove the contextual action to use this template on related documents" widget="statinfo"/>
<button name="%(wizard_email_template_preview)d" string="Preview" <button class="oe_inline oe_stat_button" name="%(wizard_email_template_preview)d" icon="fa-search-plus" string="Preview"
type="action" target="new" type="action" target="new"
context="{'template_id':active_id}"/> context="{'template_id':active_id}" widget="statinfo"/>
</div> </div>
<notebook> <notebook>
<page string="Mailing Template"> <page string="Mailing Template">

View File

@ -149,6 +149,17 @@ class event_event(osv.osv):
res[event.id]= True res[event.id]= True
continue continue
return res return res
def _count_all(self, cr, uid, ids, field_name, arg, context=None):
res = dict(map(lambda x: (x,{'count_regitrations': 0, 'count_tracks': 0,}), ids))
try:
for data in self.browse(cr, uid, ids, context=context):
res[data.id] = {'count_regitrations': len(data.registration_ids),
'count_tracks': len(data.track_ids),
}
except:
pass
return res
_columns = { _columns = {
'name': fields.char('Event Name', size=64, required=True, translate=True, readonly=False, states={'done': [('readonly', True)]}), 'name': fields.char('Event Name', size=64, required=True, translate=True, readonly=False, states={'done': [('readonly', True)]}),
@ -169,6 +180,7 @@ class event_event(osv.osv):
store={'event.registration': (_get_events_from_registrations, ['state'], 10), store={'event.registration': (_get_events_from_registrations, ['state'], 10),
'event.event': (lambda self, cr, uid, ids, c = {}: ids, ['seats_max', 'registration_ids'], 20)}), 'event.event': (lambda self, cr, uid, ids, c = {}: ids, ['seats_max', 'registration_ids'], 20)}),
'registration_ids': fields.one2many('event.registration', 'event_id', 'Registrations', readonly=False, states={'done': [('readonly', True)]}), 'registration_ids': fields.one2many('event.registration', 'event_id', 'Registrations', readonly=False, states={'done': [('readonly', True)]}),
'track_ids': fields.one2many('event.track', 'event_id', 'Tracks', readonly=False),
'date_begin': fields.datetime('Start Date', required=True, readonly=True, states={'draft': [('readonly', False)]}), 'date_begin': fields.datetime('Start Date', required=True, readonly=True, states={'draft': [('readonly', False)]}),
'date_end': fields.datetime('End Date', required=True, readonly=True, states={'draft': [('readonly', False)]}), 'date_end': fields.datetime('End Date', required=True, readonly=True, states={'draft': [('readonly', False)]}),
'state': fields.selection([ 'state': fields.selection([
@ -191,6 +203,8 @@ class event_event(osv.osv):
'company_id': fields.many2one('res.company', 'Company', required=False, change_default=True, readonly=False, states={'done': [('readonly', True)]}), 'company_id': fields.many2one('res.company', 'Company', required=False, change_default=True, readonly=False, states={'done': [('readonly', True)]}),
'is_subscribed' : fields.function(_subscribe_fnc, type="boolean", string='Subscribed'), 'is_subscribed' : fields.function(_subscribe_fnc, type="boolean", string='Subscribed'),
'organizer_id': fields.many2one('res.partner', "Organizer"), 'organizer_id': fields.many2one('res.partner', "Organizer"),
'count_regitrations': fields.function(_count_all, type="integer", string="Registrations", multi=True),
'count_tracks': fields.function(_count_all, type='integer', string='Tracks', multi=True),
} }
_defaults = { _defaults = {
'state': 'draft', 'state': 'draft',

View File

@ -65,13 +65,19 @@
<field name="state" widget="statusbar" statusbar_visible="draft,confirm,done"/> <field name="state" widget="statusbar" statusbar_visible="draft,confirm,done"/>
</header> </header>
<sheet> <sheet>
<div class="oe_right oe_button_box" groups="base.group_user">
<button name="%(event.act_event_list_register_event)d" type="action" string="Registrations" help="Register with this event"/>
</div>
<div class="oe_title"> <div class="oe_title">
<label for="name" class="oe_edit_only"/> <label for="name" class="oe_edit_only"/>
<h1><field name="name"/></h1> <h1><field name="name"/></h1>
</div> </div>
<div class="oe_right oe_button_box" groups="base.group_user">
<button name="%(event.act_event_list_register_event)d"
type="action"
class="oe_stat_button oe_inline"
icon="fa-github"
help="Register with this event">
<field name="count_regitrations" widget="statinfo" string="Registrations"/>
</button>
</div>
<group name="main_field_group"> <group name="main_field_group">
<group> <group>
<field name="address_id" context="{'show_address': 1}" options='{"always_reload": True}'/> <field name="address_id" context="{'show_address': 1}" options='{"always_reload": True}'/>

View File

@ -313,6 +313,20 @@ class fleet_vehicle(osv.Model):
except ValueError: except ValueError:
model_id = False model_id = False
return model_id return model_id
def _count_all(self, cr, uid, ids, field_name, arg, context=None):
res = dict(map(lambda x: (x,{'odometer_count': 0, 'fuel_logs_count': 0, 'service_count': 0, 'contract_count': 0, 'cost_count': 0,}), ids))
try:
for costs in self.browse(cr, uid, ids, context=context):
res[costs.id] = {'odometer_count': len(costs.odometer_ids),
'fuel_logs_count': len(costs.log_fuel),
'service_count': len(costs.log_services),
'contract_count': len(costs.log_contracts),
'cost_count': len(costs.costs_ids)
}
except:
pass
return res
_name = 'fleet.vehicle' _name = 'fleet.vehicle'
_description = 'Information on a vehicle' _description = 'Information on a vehicle'
@ -327,6 +341,13 @@ class fleet_vehicle(osv.Model):
'log_fuel': fields.one2many('fleet.vehicle.log.fuel', 'vehicle_id', 'Fuel Logs'), 'log_fuel': fields.one2many('fleet.vehicle.log.fuel', 'vehicle_id', 'Fuel Logs'),
'log_services': fields.one2many('fleet.vehicle.log.services', 'vehicle_id', 'Services Logs'), 'log_services': fields.one2many('fleet.vehicle.log.services', 'vehicle_id', 'Services Logs'),
'log_contracts': fields.one2many('fleet.vehicle.log.contract', 'vehicle_id', 'Contracts'), 'log_contracts': fields.one2many('fleet.vehicle.log.contract', 'vehicle_id', 'Contracts'),
'costs_ids': fields.one2many('fleet.vehicle.cost', 'vehicle_id', 'Costs'),
'odometer_ids': fields.one2many('fleet.vehicle.odometer', 'vehicle_id', 'Odometer'),
'cost_count': fields.function(_count_all, type='integer', string="Costs" , multi=True),
'contract_count': fields.function(_count_all, type='integer', string='Contracts', multi=True),
'service_count': fields.function(_count_all, type='integer', string='Services', multi=True),
'fuel_logs_count': fields.function(_count_all, type='integer', string='Fuel Logs', multi=True),
'odometer_count': fields.function(_count_all, type='integer', string='Odometer', multi=True),
'acquisition_date': fields.date('Acquisition Date', required=False, help='Date when the vehicle has been bought'), 'acquisition_date': fields.date('Acquisition Date', required=False, help='Date when the vehicle has been bought'),
'color': fields.char('Color', size=32, help='Color of the vehicle'), 'color': fields.char('Color', size=32, help='Color of the vehicle'),
'state_id': fields.many2one('fleet.vehicle.state', 'State', help='Current state of the vehicle', ondelete="set null"), 'state_id': fields.many2one('fleet.vehicle.state', 'State', help='Current state of the vehicle', ondelete="set null"),

View File

@ -211,11 +211,46 @@
<field name="tag_ids" widget="many2many_tags" /> <field name="tag_ids" widget="many2many_tags" />
</div> </div>
<div class="oe_right oe_button_box"> <div class="oe_right oe_button_box">
<button name="return_action_to_open" type="object" context="{'xml_id':'fleet_vehicle_log_contract_act'}" string="Contracts" help="show the contract for this vehicle" /> <button name="return_action_to_open"
<button name="act_show_log_cost" type="object" string="Costs" help="show all the costs for this vehicle" groups="fleet.group_fleet_manager"/> type="object"
<button name="return_action_to_open" type="object" context="{'xml_id':'fleet_vehicle_log_services_act'}" string="Services" help="show the services logs for this vehicle" /> class="oe_stat_button"
<button name="return_action_to_open" type="object" context="{'xml_id':'fleet_vehicle_log_fuel_act'}" string="Fuel Logs" help="show the fuel logs for this vehicle" /> icon="fa-book"
<button name="return_action_to_open" type="object" context="{'xml_id':'fleet_vehicle_odometer_act'}" string="Odometer Logs" help="show the odometer logs for this vehicle" /> context="{'xml_id':'fleet_vehicle_log_contract_act'}"
help="show the contract for this vehicle">
<field name="contract_count" widget="statinfo" string="Contracts"/>
</button>
<button name="act_show_log_cost"
type="object"
class="oe_stat_button"
icon="fa-usd"
help="show all the costs for this vehicle"
groups="fleet.group_fleet_manager">
<field name="cost_count" widget="statinfo" string="Costs"/>
</button>
<button name="return_action_to_open"
type="object"
class="oe_stat_button"
icon="fa-wrench"
context="{'xml_id':'fleet_vehicle_log_services_act'}"
help="show the services logs for this vehicle" >
<field name="service_count" widget="statinfo" string="Services"/>
</button>
<button name="return_action_to_open"
type="object"
class="oe_stat_button"
icon="fa-flask"
context="{'xml_id':'fleet_vehicle_log_fuel_act'}"
help="show the fuel logs for this vehicle" >
<field name="fuel_logs_count" widget="statinfo" string="Fuel"/>
</button>
<button name="return_action_to_open"
type="object"
class="oe_stat_button"
icon="fa-tachometer"
context="{'xml_id':'fleet_vehicle_odometer_act'}"
help="show the odometer logs for this vehicle" >
<field name="odometer_count" widget="statinfo" string="Odometer"/>
</button>
</div> </div>
<group col="2" string="General Properties"> <group col="2" string="General Properties">
<group > <group >

View File

@ -114,6 +114,15 @@ class gamification_challenge(osv.Model):
return self.pool.get('ir.model.data').get_object_reference(cr, uid, 'gamification', 'simple_report_template')[1] return self.pool.get('ir.model.data').get_object_reference(cr, uid, 'gamification', 'simple_report_template')[1]
except ValueError: except ValueError:
return False return False
def _count_goals(self, cr, uid, ids, field_name, arg, context=None):
res = {}
try:
for goals in self.browse(cr, uid, ids, context=context):
res[goals.id] = len(goals.goals_ids)
except:
pass
return res
_order = 'end_date, start_date, name, id' _order = 'end_date, start_date, name, id'
_columns = { _columns = {
@ -191,6 +200,8 @@ class gamification_challenge(osv.Model):
'category': fields.selection(lambda s, *a, **k: s._get_categories(*a, **k), 'category': fields.selection(lambda s, *a, **k: s._get_categories(*a, **k),
string="Appears in", help="Define the visibility of the challenge through menus", required=True), string="Appears in", help="Define the visibility of the challenge through menus", required=True),
'goals_ids': fields.one2many('gamification.goal', 'challenge_id', 'Related Goals'),
'goals_count': fields.function(_count_goals, type='integer', string='Related Goals')
} }
_defaults = { _defaults = {

View File

@ -53,7 +53,13 @@
<!-- action buttons --> <!-- action buttons -->
<div class="oe_right oe_button_box"> <div class="oe_right oe_button_box">
<button type="action" name="%(goals_from_challenge_act)d" string="Related Goals" attrs="{'invisible': [('state','=','draft')]}" /> <button type="action"
name="%(goals_from_challenge_act)d"
class="oe_stat_button"
icon="fa-gift"
attrs="{'invisible': [('state','=','draft')]}">
<field name="goals_count" widget="statinfo" string="Goals" help="Related Goals"/>
</button>
</div> </div>
<group> <group>
<group> <group>

View File

@ -92,6 +92,17 @@ class hr_job(osv.Model):
res.append(employee.job_id.id) res.append(employee.job_id.id)
return res return res
def _count_all(self, cr, uid, ids, field_name, arg, context=None):
res = dict(map(lambda x: (x,{'documents_count': 0, 'application_count': 0,}), ids))
try:
for data in self.browse(cr, uid, ids, context=context):
res[data.id] = {'documents_count': len(data.document_ids),
'application_count': len(data.applicant_ids),
}
except:
pass
return res
_name = "hr.job" _name = "hr.job"
_description = "Job Position" _description = "Job Position"
_inherit = ['mail.thread', 'ir.needaction_mixin'] _inherit = ['mail.thread', 'ir.needaction_mixin']
@ -122,6 +133,10 @@ class hr_job(osv.Model):
track_visibility='always', track_visibility='always',
help="By default 'Closed', set it to 'In Recruitment' if recruitment process is going on for this job position."), help="By default 'Closed', set it to 'In Recruitment' if recruitment process is going on for this job position."),
'write_date': fields.datetime('Update Date', readonly=True), 'write_date': fields.datetime('Update Date', readonly=True),
'applicant_ids':fields.one2many('hr.applicant', 'job_id', 'Applications'),
'application_count': fields.function(_count_all, type='integer', string='Applications', multi=True),
'document_ids': fields.one2many('ir.attachment', 'company_id', 'Documents'),
'documents_count': fields.function(_count_all, type='integer', string='Documents', multi=True),
} }
_defaults = { _defaults = {
@ -186,6 +201,20 @@ class hr_employee(osv.osv):
def _set_image(self, cr, uid, id, name, value, args, context=None): def _set_image(self, cr, uid, id, name, value, args, context=None):
return self.write(cr, uid, [id], {'image': tools.image_resize_image_big(value)}, context=context) return self.write(cr, uid, [id], {'image': tools.image_resize_image_big(value)}, context=context)
def _count_all(self, cr, uid, ids, field_name, arg, context=None):
res = dict(map(lambda x: (x,{'appraisal_count': 0, 'leaves_count': 0, 'contracts_count': 0, 'timesheet_count': 0, 'payslip_count': 0,}), ids))
try:
for datas in self.browse(cr, uid, ids, context=context):
res[datas.id] = {'appraisal_count': len(datas.appraisal_ids),
'leaves_count': len(datas.leave_ids),
'contracts_count': len(datas.contract_ids),
'timesheet_count': len(datas.timsheet_ids),
'payslip_count': len(datas.payslip_ids)
}
except:
pass
return res
_columns = { _columns = {
#we need a related field in order to be able to sort the employee by name #we need a related field in order to be able to sort the employee by name
@ -237,6 +266,16 @@ class hr_employee(osv.osv):
'city': fields.related('address_id', 'city', type='char', string='City'), 'city': fields.related('address_id', 'city', type='char', string='City'),
'login': fields.related('user_id', 'login', type='char', string='Login', readonly=1), 'login': fields.related('user_id', 'login', type='char', string='Login', readonly=1),
'last_login': fields.related('user_id', 'date', type='datetime', string='Latest Connection', readonly=1), 'last_login': fields.related('user_id', 'date', type='datetime', string='Latest Connection', readonly=1),
'appraisal_ids': fields.one2many('hr.evaluation.interview', 'user_to_review_id', 'Appraisal Interviews'),
'leave_ids': fields.one2many('hr.holidays', 'employee_id', 'Leaves'),
'contracts_ids': fields.one2many('hr.contract', 'employee_id', 'Contracts'),
'timsheet_ids': fields.one2many('hr_timesheet_sheet.sheet', 'employee_id', 'Timesheets'),
'payslip_ids': fields.one2many('hr.payslip', 'employee_id', 'Payslips'),
'appraisal_count': fields.function(_count_all, type='integer', string='Appraisal Interviews', multi=True),
'leaves_count': fields.function(_count_all, type='integer', string='Leaves', multi=True),
'contracts_count': fields.function(_count_all, type='integer', string='Contracts', multi=True),
'timesheet_count': fields.function(_count_all, type='integer', string='Timsheets', multi=True),
'payslip_count': fields.function(_count_all, type='integer', string='Payslips', multi=True),
} }
def _get_default_image(self, cr, uid, context=None): def _get_default_image(self, cr, uid, context=None):

View File

@ -21,7 +21,13 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<data> <data>
<xpath expr="//div[@name='button_box']" position="inside"> <xpath expr="//div[@name='button_box']" position="inside">
<button name="%(act_hr_employee_2_hr_contract)d" string="Contracts" type="action" groups="base.group_hr_manager"/> <button name="%(act_hr_employee_2_hr_contract)d"
class="oe_stat_button"
icon="fa-book"
type="action"
groups="base.group_hr_manager">
<field name="contracts_count" widget="statinfo" string="Contracts"/>
</button>
</xpath> </xpath>
<xpath expr="//field[@name='coach_id']" position="after"> <xpath expr="//field[@name='coach_id']" position="after">
<field name="manager"/> <field name="manager"/>

View File

@ -145,7 +145,12 @@
</group> </group>
</xpath> </xpath>
<xpath expr="//div[@name='button_box']" position="inside"> <xpath expr="//div[@name='button_box']" position="inside">
<button name="%(act_hr_employee_2_hr__evaluation_interview)d" string="Appraisal Interviews" type="action"/> <button name="%(act_hr_employee_2_hr__evaluation_interview)d"
class="oe_stat_button"
icon="fa-sitemap"
type="action">
<field name="appraisal_count" widget="statinfo" string="Form"/>
</button>
</xpath> </xpath>
</field> </field>
</record> </record>

View File

@ -483,7 +483,13 @@
</group> </group>
</xpath> </xpath>
<xpath expr="//div[@name='button_box']" position="inside"> <xpath expr="//div[@name='button_box']" position="inside">
<button name="%(act_hr_employee_holiday_request)d" string="Leaves" type="action" groups="base.group_hr_user"/> <button name="%(act_hr_employee_holiday_request)d"
type="action"
class="oe_stat_button"
icon="fa-calendar"
groups="base.group_hr_user">
<field name="leaves_count" widget="statinfo" string="Leaves"/>
</button>
</xpath> </xpath>
</field> </field>
</record> </record>

View File

@ -258,6 +258,15 @@ class hr_payslip(osv.osv):
for r in res: for r in res:
result[r[0]].append(r[1]) result[r[0]].append(r[1])
return result return result
def _count_detail_payslip(self, cr, uid, ids, field_name, arg, context=None):
res = {}
try:
for details in self.browse(cr, uid, ids, context=context):
res[details.id] = len(details.line_ids)
except:
pass
return res
_columns = { _columns = {
'struct_id': fields.many2one('hr.payroll.structure', 'Structure', readonly=True, states={'draft': [('readonly', False)]}, help='Defines the rules that have to be applied to this payslip, accordingly to the contract chosen. If you let empty the field contract, this field isn\'t mandatory anymore and thus the rules applied will be all the rules set on the structure of all contracts of the employee valid for the chosen period'), 'struct_id': fields.many2one('hr.payroll.structure', 'Structure', readonly=True, states={'draft': [('readonly', False)]}, help='Defines the rules that have to be applied to this payslip, accordingly to the contract chosen. If you let empty the field contract, this field isn\'t mandatory anymore and thus the rules applied will be all the rules set on the structure of all contracts of the employee valid for the chosen period'),
@ -287,6 +296,7 @@ class hr_payslip(osv.osv):
'details_by_salary_rule_category': fields.function(_get_lines_salary_rule_category, method=True, type='one2many', relation='hr.payslip.line', string='Details by Salary Rule Category'), 'details_by_salary_rule_category': fields.function(_get_lines_salary_rule_category, method=True, type='one2many', relation='hr.payslip.line', string='Details by Salary Rule Category'),
'credit_note': fields.boolean('Credit Note', help="Indicates this payslip has a refund of another", readonly=True, states={'draft': [('readonly', False)]}), 'credit_note': fields.boolean('Credit Note', help="Indicates this payslip has a refund of another", readonly=True, states={'draft': [('readonly', False)]}),
'payslip_run_id': fields.many2one('hr.payslip.run', 'Payslip Batches', readonly=True, states={'draft': [('readonly', False)]}), 'payslip_run_id': fields.many2one('hr.payslip.run', 'Payslip Batches', readonly=True, states={'draft': [('readonly', False)]}),
'payslip_count': fields.function(_count_detail_payslip, type='integer', string="Payslip Computation Details"),
} }
_defaults = { _defaults = {
'date_from': lambda *a: time.strftime('%Y-%m-01'), 'date_from': lambda *a: time.strftime('%Y-%m-01'),

View File

@ -222,7 +222,12 @@
</header> </header>
<sheet> <sheet>
<div class="oe_right oe_button_box"> <div class="oe_right oe_button_box">
<button name="%(act_payslip_lines)d" string="Payslip Computation Details" type="action"/> <button name="%(act_payslip_lines)d"
class="oe_stat_button"
icon="fa-money"
type="action">
<field name="payslip_count" widget="statinfo" string="Payslip" help="Payslip Computation Details"/>
</button>
</div> </div>
<div class="oe_title"> <div class="oe_title">
<label for="employee_id" class="oe_edit_only"/> <label for="employee_id" class="oe_edit_only"/>
@ -387,7 +392,13 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<data> <data>
<xpath expr="//div[@name='button_box']" position="inside"> <xpath expr="//div[@name='button_box']" position="inside">
<button name="%(act_hr_employee_payslip_list)d" string="Payslips" type="action" groups="base.group_hr_user"/> <button name="%(act_hr_employee_payslip_list)d"
class="oe_stat_button"
icon="fa-money"
type="action"
groups="base.group_hr_user">
<field name="payslip_count" widget="statinfo" string="Payslips"/>
</button>
</xpath> </xpath>
</data> </data>
</field> </field>

View File

@ -74,16 +74,27 @@
</header> </header>
<sheet> <sheet>
<div class="oe_right oe_button_box"> <div class="oe_right oe_button_box">
<button name="action_makeMeeting" type="object" <button name="action_makeMeeting" class="oe_stat_button" icon="fa-calendar" type="object"
string="Schedule Meeting" help="Schedule interview with this applicant"/> string="Meeting" help="Schedule interview with this applicant"/>
<button name="%(survey.action_view_survey_question_message)d" type="action" <button name="%(survey.action_view_survey_question_message)d"
string="Start Interview" help="Answer related job question" class="oe_stat_button"
icon="fa-user"
type="action"
string="Interview" help="Answer related job question"
context="{'survey_id': survey, 'response_id': [response], 'response_no':0 ,'active' : response, 'object' : 'hr.applicant'}" context="{'survey_id': survey, 'response_id': [response], 'response_no':0 ,'active' : response, 'object' : 'hr.applicant'}"
attrs="{'invisible':[('survey','=',False)]}"/> attrs="{'invisible':[('survey','=',False)]}"/>
<button name="action_print_survey" type="object" <button name="action_print_survey"
string="Print Interview" help="Print interview report" class="oe_stat_button"
icon="fa-print"
type="object"
string="Print" help="Print interview report"
attrs="{'invisible':[('survey','=',False)]}"/> attrs="{'invisible':[('survey','=',False)]}"/>
<button name="action_get_attachment_tree_view" string="Documents" type="object"/> <button name="action_get_attachment_tree_view"
class="oe_stat_button"
icon="fa-book"
type="object">
<field name="attachment_number" widget="statinfo" string="Documents"/>
</button>
</div> </div>
<div class="oe_title"> <div class="oe_title">
<label for="name" class="oe_edit_only"/> <label for="name" class="oe_edit_only"/>
@ -367,10 +378,23 @@
<xpath expr="//field[@name='department_id']" position="after"> <xpath expr="//field[@name='department_id']" position="after">
<field name="user_id" class="oe_inline"/> <field name="user_id" class="oe_inline"/>
</xpath> </xpath>
<div name="buttons" position="inside"> <xpath expr="//div[@name='buttons']" position="inside">
<button string="Applications" name="%(action_hr_job_applications)d" context="{'default_user_id': user_id}" type="action"/> <div class="oe_button_box" >
<button string="Documents" name="action_get_attachment_tree_view" type="object"/> <button class="oe_stat_button"
</div> icon="fa-file-o"
name="%(action_hr_job_applications)d"
context="{'default_user_id': user_id}"
type="action">
<field name="application_count" widget="statinfo" string="Applications"/>
</button>
<button class="oe_stat_button"
icon="fa-book"
name="action_get_attachment_tree_view"
type="object">
<field name="documents_count" widget="statinfo" string="Documents"/>
</button>
</div>
</xpath>
</field> </field>
</record> </record>

View File

@ -118,10 +118,8 @@
<label for="use_timesheets"/> <label for="use_timesheets"/>
</xpath> </xpath>
<xpath expr='//div[@name="buttons"]' position='inside'> <xpath expr='//div[@name="buttons"]' position='inside'>
<button string="Costs and Revenues" <button class="oe_inline oe_stat_button" type="action" name="%(act_analytic_cost_revenue)d"
name="%(act_analytic_cost_revenue)d" icon="fa-usd" string="Cost/Revenue" widget="statinfo"/>
type="action"/>
</xpath> </xpath>
</field> </field>
</record> </record>

View File

@ -103,6 +103,17 @@ class hr_timesheet_sheet(osv.osv):
for sheet in self.browse(cr, uid, ids, context=context): for sheet in self.browse(cr, uid, ids, context=context):
if sheet.employee_id.id not in employee_ids: employee_ids.append(sheet.employee_id.id) if sheet.employee_id.id not in employee_ids: employee_ids.append(sheet.employee_id.id)
return hr_employee.attendance_action_change(cr, uid, employee_ids, context=context) return hr_employee.attendance_action_change(cr, uid, employee_ids, context=context)
def _count_all(self, cr, uid, ids, field_name, arg, context=None):
res = dict(map(lambda x: (x,{'timesheet_activity_count': 0, 'attendance_count': 0,}), ids))
try:
for datas in self.browse(cr, uid, ids, context=context):
res[datas.id] = {'timesheet_activity_count': len(datas.timesheet_activity_ids),
'attendance_count': len(datas.attendances_ids),
}
except:
pass
return res
_columns = { _columns = {
'name': fields.char('Note', size=64, select=1, 'name': fields.char('Note', size=64, select=1,
@ -134,6 +145,9 @@ class hr_timesheet_sheet(osv.osv):
'account_ids': fields.one2many('hr_timesheet_sheet.sheet.account', 'sheet_id', 'Analytic accounts', readonly=True), 'account_ids': fields.one2many('hr_timesheet_sheet.sheet.account', 'sheet_id', 'Analytic accounts', readonly=True),
'company_id': fields.many2one('res.company', 'Company'), 'company_id': fields.many2one('res.company', 'Company'),
'department_id':fields.many2one('hr.department','Department'), 'department_id':fields.many2one('hr.department','Department'),
'timesheet_activity_ids': fields.one2many('hr.analytic.timesheet', 'sheet_id', 'Timesheet Activities'),
'timesheet_activity_count': fields.function(_count_all, type='integer', string='Timesheet Activities', multi=True),
'attendance_count': fields.function(_count_all, type='integer', string="Attendances", multi=True),
} }
def _default_date_from(self, cr, uid, context=None): def _default_date_from(self, cr, uid, context=None):

View File

@ -73,10 +73,15 @@
<div class="oe_right oe_button_box" name="buttons"> <div class="oe_right oe_button_box" name="buttons">
<button type="action" <button type="action"
name="%(act_hr_timesheet_sheet_sheet_2_hr_analytic_timesheet)d" name="%(act_hr_timesheet_sheet_sheet_2_hr_analytic_timesheet)d"
string="Timesheet Activities" /> class="oe_stat_button"
icon="fa-clock-o">
<field name="timesheet_activity_count" widget="statinfo" string="Timesheet" help="Timesheet Activities"/>
</button>
<button type="action" groups="base.group_hr_attendance" <button type="action" groups="base.group_hr_attendance"
name="%(act_hr_timesheet_sheet_sheet_2_hr_attendance)d" class="oe_stat_button" icon="fa-users"
string="Attendances" /> name="%(act_hr_timesheet_sheet_sheet_2_hr_attendance)d">
<field name="attendance_count" widget="statinfo" string="Attendances"/>
</button>
</div> </div>
<div class="oe_title"> <div class="oe_title">
<label for="employee_id" class="oe_edit_only"/> <label for="employee_id" class="oe_edit_only"/>
@ -365,7 +370,13 @@
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_employee_extd_form"/> <field name="inherit_id" ref="hr_timesheet.hr_timesheet_employee_extd_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside"> <xpath expr="//div[@name='button_box']" position="inside">
<button name="%(act_hr_employee_2_hr_timesheet)d" string="Timesheets" type="action" groups="base.group_hr_manager"/> <button name="%(act_hr_employee_2_hr_timesheet)d"
type="action"
class="oe_stat_button"
icon="fa-clock-o"
groups="base.group_hr_manager">
<field name="timesheet_count" widget="statinfo" string="Timesheets"/>
</button>
</xpath> </xpath>
</field> </field>
</record> </record>

View File

@ -85,6 +85,15 @@ translate_selections = {
class marketing_campaign(osv.osv): class marketing_campaign(osv.osv):
_name = "marketing.campaign" _name = "marketing.campaign"
_description = "Marketing Campaign" _description = "Marketing Campaign"
def _count_segments(self, cr, uid, ids, field_name, arg, context=None):
res = {}
try:
for segments in self.browse(cr, uid, ids, context=context):
res[segments.id] = len(segments.segment_ids)
except:
pass
return res
_columns = { _columns = {
'name': fields.char('Name', size=64, required=True), 'name': fields.char('Name', size=64, required=True),
@ -121,6 +130,8 @@ Normal - the campaign runs normally and automatically sends all emails and repor
'activity_ids': fields.one2many('marketing.campaign.activity', 'activity_ids': fields.one2many('marketing.campaign.activity',
'campaign_id', 'Activities'), 'campaign_id', 'Activities'),
'fixed_cost': fields.float('Fixed Cost', help="Fixed cost for running this campaign. You may also specify variable cost and revenue on each campaign activity. Cost and Revenue statistics are included in Campaign Reporting.", digits_compute=dp.get_precision('Product Price')), 'fixed_cost': fields.float('Fixed Cost', help="Fixed cost for running this campaign. You may also specify variable cost and revenue on each campaign activity. Cost and Revenue statistics are included in Campaign Reporting.", digits_compute=dp.get_precision('Product Price')),
'segment_ids': fields.one2many('marketing.campaign.segment', 'campaign_id', 'Segments', readonly=False),
'segments_count': fields.function(_count_segments, type='integer', string='Segments')
} }
_defaults = { _defaults = {

View File

@ -64,12 +64,19 @@
<div class="oe_right oe_button_box" name="button_box"> <div class="oe_right oe_button_box" name="button_box">
<button type="action" <button type="action"
name="%(act_marketing_campaing_stat)d" name="%(act_marketing_campaing_stat)d"
string="Campaign Statistics"/> class="oe_stat_button"
icon="fa-keyboard-o"
string="Statistics" help="Marketing Campaign Statistics"/>
<button type="action" <button type="action"
name="%(act_marketing_campaing_segment_opened)d" name="%(act_marketing_campaing_segment_opened)d"
string="Segments"/> class="oe_stat_button"
icon="fa-table">
<field name="segments_count" widget="statinfo" string="Segments"/>
</button>
<button type="action" <button type="action"
name="%(act_marketing_campaing_followup)d" name="%(act_marketing_campaing_followup)d"
class="oe_stat_button"
icon="fa-thumbs-up"
string="Follow-Up"/> string="Follow-Up"/>
</div> </div>
<div class="oe_title"> <div class="oe_title">

View File

@ -1111,8 +1111,24 @@ class mrp_production_product_line(osv.osv):
class product_product(osv.osv): class product_product(osv.osv):
_inherit = "product.product" _inherit = "product.product"
def _bom_count(self, cr, uid, ids, field_name, arg, context=None):
res = dict(map(lambda x: (x,{'bom_count': 0, 'mo_count': 0, 'bom_strct':0}), ids))
try:
for bom in self.browse(cr, uid, ids, context=context):
res[bom.id] = {
'bom_count': len(bom.bom_ids),
'mo_count': len(bom.mo_ids),
'bom_strct':len(bom.bom_ids),
}
except:
pass
return res
_columns = { _columns = {
'bom_ids': fields.one2many('mrp.bom', 'product_id', 'Bill of Materials'), 'bom_ids': fields.one2many('mrp.bom', 'product_id', 'Bill of Materials'),
'mo_ids': fields.one2many('mrp.production', 'product_id', 'Manufacturing Orders'),
'bom_count': fields.function(_bom_count, string='# Bill of Material', type='integer', multi="bom_count"),
'bom_strct': fields.function(_bom_count, string='# Bill of Material Structure', type='integer', multi="bom_count"),
'mo_count': fields.function(_bom_count, string='# Manufacturing Orders', type='integer', multi="bom_count"),
} }
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1040,9 +1040,18 @@
<field name="inherit_id" ref="product.product_normal_form_view"/> <field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//div[@name='buttons']" position="inside"> <xpath expr="//div[@name='buttons']" position="inside">
<button string="Bill of Materials" name="%(product_open_bom)d" type="action" attrs="{'invisible':[('type', '=', 'service')]}"/> <button class="oe_inline oe_stat_button" name="%(product_open_bom)d" type="action"
<button string="BoM Structure" name="%(act_product_mrp_bom_open)d" type="action" groups="mrp.group_mrp_user" attrs="{'invisible':[('type', '=', 'service')]}"/> groups="mrp.group_mrp_user" attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-flask">
<button string="Manufacturing Orders" name="%(act_product_mrp_production)d" type="action" groups="mrp.group_mrp_user" attrs="{'invisible':[('type', '=', 'service')]}"/> <field string="Bill of Materials" name="bom_count" widget="statinfo" />
</button>
<button class="oe_inline oe_stat_button" name="%(act_product_mrp_bom_open)d" type="action"
groups="mrp.group_mrp_user" attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-flask">
<field string="BoM Structure" name="bom_strct" widget="statinfo" />
</button>
<button class="oe_inline oe_stat_button" name="%(act_product_mrp_production)d" type="action"
groups="mrp.group_mrp_user" attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-list-alt">
<field string="Manufacturing" name="mo_count" widget="statinfo" />
</button>
</xpath> </xpath>
</field> </field>
</record> </record>

View File

@ -843,8 +843,10 @@
</header> </header>
<sheet> <sheet>
<div class="oe_right oe_button_box"> <div class="oe_right oe_button_box">
<button name="%(action_pos_box_in)d" string="Put Money In" type="action" states="opened,closing_control"/> <button class="oe_stat_button" name="%(action_pos_box_in)d" string="Put Money"
<button name="%(action_pos_box_out)d" string="Take Money Out" type="action" states="opened,closing_control"/> type="action" states="opened,closing_control" icon="fa-level-down"/>
<button class="oe_stat_button" name="%(action_pos_box_out)d" string="Take Money"
type="action" states="opened,closing_control" icon="fa-level-up"/>
</div> </div>
<h1 class="oe_title"> <h1 class="oe_title">
Session: Session:

View File

@ -614,8 +614,17 @@ class product_template(osv.osv):
class product_product(osv.osv): class product_product(osv.osv):
_inherit="product.product" _inherit="product.product"
def _orderpoint_count(self, cr, uid, ids, field_name, arg, context=None):
res = dict(map(lambda x: (x,0), ids))
try:
for orderpoint in self.browse(cr, uid, ids, context=context):
res[orderpoint.id] = len(orderpoint.orderpoint_ids)
except:
pass
return res
_columns = { _columns = {
'orderpoint_ids': fields.one2many('stock.warehouse.orderpoint', 'product_id', 'Minimum Stock Rules'), 'orderpoint_ids': fields.one2many('stock.warehouse.orderpoint', 'product_id', 'Minimum Stock Rules'),
'orderpoint_count': fields.function(_orderpoint_count, string='# Orderpoints', type='integer'),
} }

View File

@ -357,7 +357,10 @@
<button string="⇒ Request Procurement" name="%(act_make_procurement)d" type="action" class="oe_link"/> <button string="⇒ Request Procurement" name="%(act_make_procurement)d" type="action" class="oe_link"/>
</xpath> </xpath>
<xpath expr="//div[@name='buttons']" position="inside"> <xpath expr="//div[@name='buttons']" position="inside">
<button string="Orderpoints" name="%(product_open_orderpoint)d" type="action" attrs="{'invisible':[('type', '=', 'service')]}"/> <button class="oe_inline oe_stat_button" name="%(product_open_orderpoint)d" type="action"
attrs="{'invisible':[('type', '=', 'service')]}" icon="fa-pinterest">
<field string="Orderpoints" name="orderpoint_count" widget="statinfo" />
</button>
</xpath> </xpath>
<xpath expr="//field[@name='cost_method']" position="before"> <xpath expr="//field[@name='cost_method']" position="before">
<field name="procure_method" groups="base.group_user" <field name="procure_method" groups="base.group_user"

View File

@ -186,20 +186,11 @@ class project(osv.osv):
task_attachments = attachment.search(cr, uid, [('res_model', '=', 'project.task'), ('res_id', 'in', task_ids)], context=context, count=True) task_attachments = attachment.search(cr, uid, [('res_model', '=', 'project.task'), ('res_id', 'in', task_ids)], context=context, count=True)
res[id] = (project_attachments or 0) + (task_attachments or 0) res[id] = (project_attachments or 0) + (task_attachments or 0)
return res return res
def _task_count(self, cr, uid, ids, field_name, arg, context=None): def _task_count(self, cr, uid, ids, field_name, arg, context=None):
""" :deprecated: this method will be removed with OpenERP v8. Use task_ids res={}
fields instead. """ for tasks in self.browse(cr, uid, ids, context):
if context is None: res[tasks.id] = len(tasks.task_ids)
context = {}
res = dict.fromkeys(ids, 0)
ctx = context.copy()
ctx['active_test'] = False
task_ids = self.pool.get('project.task').search(cr, uid, [('project_id', 'in', ids)], context=ctx)
for task in self.pool.get('project.task').browse(cr, uid, task_ids, context):
res[task.project_id.id] += 1
return res return res
def _get_alias_models(self, cr, uid, context=None): def _get_alias_models(self, cr, uid, context=None):
""" Overriden in project_issue to offer more options """ """ Overriden in project_issue to offer more options """
return [('project.task', "Tasks")] return [('project.task', "Tasks")]
@ -265,8 +256,7 @@ class project(osv.osv):
}), }),
'resource_calendar_id': fields.many2one('resource.calendar', 'Working Time', help="Timetable working hours to adjust the gantt diagram report", states={'close':[('readonly',True)]} ), 'resource_calendar_id': fields.many2one('resource.calendar', 'Working Time', help="Timetable working hours to adjust the gantt diagram report", states={'close':[('readonly',True)]} ),
'type_ids': fields.many2many('project.task.type', 'project_task_type_rel', 'project_id', 'type_id', 'Tasks Stages', states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}), 'type_ids': fields.many2many('project.task.type', 'project_task_type_rel', 'project_id', 'type_id', 'Tasks Stages', states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}),
'task_count': fields.function(_task_count, type='integer', string="Open Tasks", 'task_count': fields.function(_task_count, type='integer', string="Tasks",),
deprecated="This field will be removed in OpenERP v8. Use task_ids one2many field instead."),
'task_ids': fields.one2many('project.task', 'project_id', 'task_ids': fields.one2many('project.task', 'project_id',
domain=[('stage_id.fold', '=', False)]), domain=[('stage_id.fold', '=', False)]),
'color': fields.integer('Color Index'), 'color': fields.integer('Color Index'),

View File

@ -93,21 +93,26 @@
</div> </div>
</div> </div>
<div class="oe_right oe_button_box" name="buttons" groups="base.group_user"> <div class="oe_right oe_button_box" name="buttons" groups="base.group_user">
<field name="tasks" widget="x2many_counter" string="Tasks" attrs="{'invisible':[('use_tasks','=', False)]}" options='{"views": [[false, "kanban"], [false, "tree"], [false, "form"], [false, "calendar"], [false, "gantt"], [false, "graph"]]}'/> <button class="oe_inline oe_stat_button" type="action" attrs="{'invisible':[('use_tasks','=', 0)]}"
<button name="attachment_tree_view" string="Documents" type="object"/> name="%(act_project_project_2_project_task_all)d" icon="fa-tasks">
<field string="Task" name="task_count" widget="statinfo"/>
</button>
<button class="oe_inline oe_stat_button" name="attachment_tree_view" type="object" icon="fa-files-o">
<field string="Documents" name="doc_count" widget="statinfo"/>
</button>
</div> </div>
<group> <group>
<group> <group col="4">
<field name="user_id" string="Project Manager" <field name="user_id" string="Project Manager"
attrs="{'readonly':[('state','in',['close', 'cancelled'])]}" attrs="{'readonly':[('state','in',['close', 'cancelled'])]}"
context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'project.group_project_manager']}"/> context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'project.group_project_manager']}"/>
<newline/>
<field name="partner_id" on_change="onchange_partner_id(partner_id)"/> <field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
<span></span> </group>
<p attrs="{'invisible': [('analytic_account_id','=',False)]}"> <p attrs="{'invisible': [('analytic_account_id','=',False)]}">
To invoice or setup invoicing and renewal options, go to the related contract: To invoice or setup invoicing and renewal options, go to the related contract:
<field name="analytic_account_id" readonly="1" required="0" class="oe_inline" nolabel="1"/>. <field name="analytic_account_id" readonly="1" required="0" class="oe_inline" nolabel="1"/>.
</p> </p>
</group>
<group name="group_alias" <group name="group_alias"
attrs="{'invisible': [('alias_domain', '=', False)]}"> attrs="{'invisible': [('alias_domain', '=', False)]}">
<label for="alias_name" string="Email Alias"/> <label for="alias_name" string="Email Alias"/>

View File

@ -22,11 +22,20 @@
from openerp.osv import fields,osv from openerp.osv import fields,osv
class res_partner(osv.osv): class res_partner(osv.osv):
def _task_count(self, cr, uid, ids, field_name, arg, context=None):
res = dict(map(lambda x: (x,0), ids))
try:
for partner in self.browse(cr, uid, ids, context):
res[partner.id] = len(partner.task_ids)
except:
pass
return res
""" Inherits partner and adds Tasks information in the partner form """ """ Inherits partner and adds Tasks information in the partner form """
_inherit = 'res.partner' _inherit = 'res.partner'
_columns = { _columns = {
'task_ids': fields.one2many('project.task', 'partner_id', 'Tasks'), 'task_ids': fields.one2many('project.task', 'partner_id', 'Tasks'),
'task_count': fields.function(_task_count, string='# Tasks', type='integer'),
} }
def copy(self, cr, uid, record_id, default=None, context=None): def copy(self, cr, uid, record_id, default=None, context=None):

View File

@ -10,11 +10,13 @@
<field name="priority" eval="50"/> <field name="priority" eval="50"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//div[@name='buttons']" position="inside"> <xpath expr="//div[@name='buttons']" position="inside">
<button class="oe_inline" type="action" <button class="oe_inline oe_stat_button" type="action" name="%(action_view_task)d"
name="%(action_view_task)d"
string="Tasks"
context="{'search_default_partner_id': active_id, 'default_partner_id': active_id}" context="{'search_default_partner_id': active_id, 'default_partner_id': active_id}"
groups="project.group_project_user" /> icon="fa-tasks" groups="project.group_project_user">
<field string="Tasks" name="task_count" widget="statinfo"/>
</button>
</xpath> </xpath>
</field> </field>
</record> </record>

View File

@ -229,7 +229,6 @@ class project_issue(osv.Model):
if work.task_id: if work.task_id:
issues += issue_pool.search(cr, uid, [('task_id','=',work.task_id.id)]) issues += issue_pool.search(cr, uid, [('task_id','=',work.task_id.id)])
return issues return issues
_columns = { _columns = {
'id': fields.integer('ID', readonly=True), 'id': fields.integer('ID', readonly=True),
'name': fields.char('Issue', size=128, required=True), 'name': fields.char('Issue', size=128, required=True),
@ -491,21 +490,15 @@ class project(osv.Model):
return [('project.task', "Tasks"), ("project.issue", "Issues")] return [('project.task', "Tasks"), ("project.issue", "Issues")]
def _issue_count(self, cr, uid, ids, field_name, arg, context=None): def _issue_count(self, cr, uid, ids, field_name, arg, context=None):
""" :deprecated: this method will be removed with OpenERP v8. Use issue_ids res={}
fields instead. """ for issues in self.browse(cr, uid, ids, context):
res = dict.fromkeys(ids, 0) res[issues.id] = len(issues.issue_ids)
issue_ids = self.pool.get('project.issue').search(cr, uid, [('project_id', 'in', ids)])
for issue in self.pool.get('project.issue').browse(cr, uid, issue_ids, context):
if issue.stage_id and not issue.stage_id.fold:
res[issue.project_id.id] += 1
return res return res
_columns = { _columns = {
'project_escalation_id': fields.many2one('project.project', 'Project Escalation', 'project_escalation_id': fields.many2one('project.project', 'Project Escalation',
help='If any issue is escalated from the current Project, it will be listed under the project selected here.', help='If any issue is escalated from the current Project, it will be listed under the project selected here.',
states={'close': [('readonly', True)], 'cancelled': [('readonly', True)]}), states={'close': [('readonly', True)], 'cancelled': [('readonly', True)]}),
'issue_count': fields.function(_issue_count, type='integer', string="Unclosed Issues", 'issue_count': fields.function(_issue_count, type='integer', string="Issues",),
deprecated="This field will be removed in OpenERP v8. Use issue_ids one2many field instead."),
'issue_ids': fields.one2many('project.issue', 'project_id', 'issue_ids': fields.one2many('project.issue', 'project_id',
domain=[('stage_id.fold', '=', False)]) domain=[('stage_id.fold', '=', False)])
} }
@ -575,5 +568,20 @@ class project_project(osv.Model):
self._check_create_write_values(cr, uid, vals, context=context) self._check_create_write_values(cr, uid, vals, context=context)
return super(project_project, self).write(cr, uid, ids, vals, context=context) return super(project_project, self).write(cr, uid, ids, vals, context=context)
class res_partner(osv.osv):
def _issue_count(self, cr, uid, ids, field_name, arg, context=None):
res = dict(map(lambda x: (x,0), ids))
try:
for partner in self.browse(cr, uid, ids, context=context):
res[partner.id] = len(partner.issue_ids)
except:
pass
return res
""" Inherits partner and adds Issue information in the partner form """
_inherit = 'res.partner'
_columns = {
'issue_ids': fields.one2many('project.issue', 'partner_id', 'Issues'),
'issue_count': fields.function(_issue_count, string='# Issues', type='integer'),
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -306,7 +306,10 @@
<label for="use_issues"/> <label for="use_issues"/>
</xpath> </xpath>
<xpath expr='//div[@name="buttons"]' position='inside'> <xpath expr='//div[@name="buttons"]' position='inside'>
<button name="%(act_project_project_2_project_issue_all)d" string="Issues" type="action" attrs="{'invisible':[('use_issues','=', 0)]}"/> <button class="oe_inline oe_stat_button" type="action" attrs="{'invisible':[('use_issues','=', 0)]}"
name="%(act_project_project_2_project_issue_all)d" icon="fa-bug">
<field string="Issues" name="issue_count" widget="statinfo"/>
</button>
</xpath> </xpath>
<xpath expr='//page[@name="project_stages"]' position="attributes"> <xpath expr='//page[@name="project_stages"]' position="attributes">
<attribute name="attrs">{'invisible': [('use_tasks', '=', False),('use_issues','=',False)]}</attribute> <attribute name="attrs">{'invisible': [('use_tasks', '=', False),('use_issues','=',False)]}</attribute>
@ -375,11 +378,14 @@
<field name="priority" eval="50"/> <field name="priority" eval="50"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//div[@name='buttons']" position="inside"> <xpath expr="//div[@name='buttons']" position="inside">
<button class="oe_inline" type="action" string="Issues" <button class="oe_inline oe_stat_button" type="action" name="%(action_view_issues)d"
attrs="{'invisible': [('customer', '=', False)]}"
name="%(action_view_issues)d"
context="{'search_default_partner_id': active_id, 'default_partner_id': active_id}" context="{'search_default_partner_id': active_id, 'default_partner_id': active_id}"
groups="project.group_project_user"/> attrs="{'invisible': [('customer', '=', False)]}"
icon="fa-bug" groups="project.group_project_user">
<field string="Issues" name="issue_count" widget="statinfo"/>
</button>
</xpath> </xpath>
</field> </field>
</record> </record>

View File

@ -98,7 +98,14 @@ class project_phase(osv.osv):
else: else:
res[phase.id] = round(100.0 * done / tot, 2) res[phase.id] = round(100.0 * done / tot, 2)
return res return res
def _tasks_count(self, cr, uid, ids, field_name, arg, context=None):
res = dict(map(lambda x: (x,0), ids))
try:
for task in self.browse(cr, uid, ids, context=context):
res[task.id] = len(task.task_ids)
except:
pass
return res
_columns = { _columns = {
'name': fields.char("Name", size=64, required=True), 'name': fields.char("Name", size=64, required=True),
'date_start': fields.datetime('Start Date', select=True, help="It's computed by the scheduler according the project date or the end date of the previous phase.", states={'done':[('readonly',True)], 'cancelled':[('readonly',True)]}), 'date_start': fields.datetime('Start Date', select=True, help="It's computed by the scheduler according the project date or the end date of the previous phase.", states={'done':[('readonly',True)], 'cancelled':[('readonly',True)]}),
@ -119,6 +126,7 @@ class project_phase(osv.osv):
help='If the phase is created the status \'Draft\'.\n If the phase is started, the status becomes \'In Progress\'.\n If review is needed the phase is in \'Pending\' status.\ help='If the phase is created the status \'Draft\'.\n If the phase is started, the status becomes \'In Progress\'.\n If review is needed the phase is in \'Pending\' status.\
\n If the phase is over, the status is set to \'Done\'.'), \n If the phase is over, the status is set to \'Done\'.'),
'progress': fields.function(_compute_progress, string='Progress', help="Computed based on related tasks"), 'progress': fields.function(_compute_progress, string='Progress', help="Computed based on related tasks"),
'tasks_count': fields.function(_tasks_count, string='# Related Tasks', type='integer'),
} }
_defaults = { _defaults = {
'state': 'draft', 'state': 'draft',

View File

@ -102,9 +102,10 @@
<label for="use_phases"/> <label for="use_phases"/>
</xpath> </xpath>
<xpath expr="//div[@name='buttons']" position='inside'> <xpath expr="//div[@name='buttons']" position='inside'>
<button name="%(act_project_phases)d" <button class="oe_inline oe_stat_button" type="action"
string="Phases" type="action" attrs="{'invisible':[('use_phases','=', 0)]}" name="%(act_project_phases)d" icon="fa-qrcode">
attrs="{'invisible':[('use_phases','=', 0)]}"/> <field string="Phases" name="phase_count" widget="statinfo"/>
</button>
</xpath> </xpath>
</field> </field>
</record> </record>
@ -151,7 +152,11 @@
<field name="state" widget="statusbar" statusbar_visible="draft,open,done" statusbar_colors='{"pending":"blue"}'/> <field name="state" widget="statusbar" statusbar_visible="draft,open,done" statusbar_colors='{"pending":"blue"}'/>
</header> </header>
<sheet> <sheet>
<button name="%(project_phase_task_list)d" string="Related Tasks" type="action" class="oe_right"/> <div class="oe_button_box oe_right">
<button class=" oe_inline oe_stat_button " name= "%(project_phase_task_list)d" type="action" icon="fa-tasks">
<field string="Tasks" name="tasks_count" widget="statinfo"/>
</button>
</div>
<div class="oe_title"> <div class="oe_title">
<label for="name" class="oe_edit_only"/> <label for="name" class="oe_edit_only"/>
<h1><field name="name"/></h1> <h1><field name="name"/></h1>

View File

@ -30,7 +30,10 @@
<label for="use_timesheets"/> <label for="use_timesheets"/>
</xpath> </xpath>
<xpath expr='//div[@name="buttons"]' position="inside"> <xpath expr='//div[@name="buttons"]' position="inside">
<button name="open_timesheets" string="Timesheets" type="object" attrs="{'invisible':[('use_timesheets','=', 0)]}"/> <button class="oe_inline oe_stat_button" name="open_timesheets" type="object" attrs="{'invisible':[('use_timesheets','=', 0)]}"
icon="fa-calendar" widget="statinfo">
<field name="hours_quantity" string="Timesheets" widget="statinfo"/>
</button>
</xpath> </xpath>
</field> </field>
</record> </record>

View File

@ -26,15 +26,14 @@ class res_partner(osv.osv):
_inherit = 'res.partner' _inherit = 'res.partner'
def _purchase_order_count(self, cr, uid, ids, field_name, arg, context=None): def _purchase_order_count(self, cr, uid, ids, field_name, arg, context=None):
res = dict(map(lambda x: (x,0), ids)) res = dict(map(lambda x: (x,{'purchase_order_count': 0, 'supplier_invoice_count': 0}), ids))
# this user may not have access to user rights invoice_ids = self.pool.get('account.invoice').search(cr,uid, [('type', '=', 'in_invoice'), ('partner_id', '=', ids[0])])
try: for partner in self.browse(cr, uid, ids, context=context):
for partner in self.browse(cr, uid, ids, context=context): res[partner.id] = {
res[partner.id] = len(partner.purchase_order_ids) 'purchase_order_count': len(partner.purchase_order_ids),
except: 'supplier_invoice_count': len(invoice_ids),
pass }
return res return res
def copy(self, cr, uid, id, default=None, context=None): def copy(self, cr, uid, id, default=None, context=None):
if default is None: if default is None:
default = {} default = {}
@ -53,8 +52,10 @@ class res_partner(osv.osv):
domain=[('type','=','purchase')], domain=[('type','=','purchase')],
string="Purchase Pricelist", string="Purchase Pricelist",
help="This pricelist will be used, instead of the default one, for purchases from the current partner"), help="This pricelist will be used, instead of the default one, for purchases from the current partner"),
'purchase_order_count': fields.function(_purchase_order_count, string='# of Purchase Order', type='integer'), 'purchase_order_count': fields.function(_purchase_order_count, string='# of Purchase Order', type='integer', multi="count"),
'purchase_order_ids': fields.one2many('purchase.order','partner_id','Purchase Order') 'purchase_order_ids': fields.one2many('purchase.order','partner_id','Purchase Order'),
'invoice_ids': fields.one2many('account.invoice','partner_id','Supplier Invoices'),
'supplier_invoice_count': fields.function(_purchase_order_count, string='# Supplier Invoices', type='integer', multi="count"),
} }

View File

@ -74,13 +74,15 @@
<field name="priority" eval="20"/> <field name="priority" eval="20"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//div[@name='buttons']" position="inside"> <xpath expr="//div[@name='buttons']" position="inside">
<button name="%(purchase.act_res_partner_2_purchase_order)d" type="action" <button class="oe_inline oe_stat_button" name="%(purchase.act_res_partner_2_purchase_order)d" type="action"
string="Purchase Orders"
attrs="{'invisible': [('supplier', '=', False)]}" attrs="{'invisible': [('supplier', '=', False)]}"
groups="purchase.group_purchase_user"/> groups="purchase.group_purchase_user" icon="fa-shopping-cart">
<button name="%(purchase.act_res_partner_2_supplier_invoices)d" type="action" <field string="Purchases" name="purchase_order_count" widget="statinfo"/>
attrs="{'invisible': [('supplier', '=', False)]}" </button>
string="Supplier Invoices"/> <button class="oe_inline oe_stat_button" name="%(purchase.act_res_partner_2_supplier_invoices)d" type="action"
attrs="{'invisible': [('supplier', '=', False)]}" icon="fa-pencil-square-o" help="Supplier Invoices">
<field string="Pay Invoices" name="supplier_invoice_count" widget="statinfo"/>
</button>
</xpath> </xpath>
</field> </field>
</record> </record>

View File

@ -150,6 +150,17 @@ class purchase_order(osv.osv):
limit=1) limit=1)
return res and res[0] or False return res and res[0] or False
def _count_all(self, cr, uid, ids, field_name, arg, context=None):
res = dict(map(lambda x: (x,{'shipment_count': 0, 'invoice_count': 0,}), ids))
try:
for data in self.browse(cr, uid, ids, context=context):
res[data.id] = {'shipment_count': len(data.picking_ids),
'invoice_count': len(data.invoice_ids),
}
except:
pass
return res
STATE_SELECTION = [ STATE_SELECTION = [
('draft', 'Draft PO'), ('draft', 'Draft PO'),
('sent', 'RFQ Sent'), ('sent', 'RFQ Sent'),
@ -226,6 +237,8 @@ class purchase_order(osv.osv):
'create_uid': fields.many2one('res.users', 'Responsible'), 'create_uid': fields.many2one('res.users', 'Responsible'),
'company_id': fields.many2one('res.company','Company',required=True,select=1, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)]}), 'company_id': fields.many2one('res.company','Company',required=True,select=1, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)]}),
'journal_id': fields.many2one('account.journal', 'Journal'), 'journal_id': fields.many2one('account.journal', 'Journal'),
'shipment_count': fields.function(_count_all, type='integer', string='Incoming Shipments', multi=True),
'invoice_count': fields.function(_count_all, type='integer', string='Invoices', multi=True)
} }
_defaults = { _defaults = {
'date_order': fields.date.context_today, 'date_order': fields.date.context_today,
@ -1257,8 +1270,19 @@ class mail_mail(osv.Model):
class product_template(osv.Model): class product_template(osv.Model):
_name = 'product.template' _name = 'product.template'
_inherit = 'product.template' _inherit = 'product.template'
def _purchase_count(self, cr, uid, ids, field_name, arg, context=None):
res = dict(map(lambda x: (x,0), ids))
try:
for purchase in self.browse(cr, uid, ids, context=context):
res[purchase.id] = len(purchase.purchase_ids)
except:
pass
return res
_columns = { _columns = {
'purchase_ok': fields.boolean('Can be Purchased', help="Specify if the product can be selected in a purchase order line."), 'purchase_ok': fields.boolean('Can be Purchased', help="Specify if the product can be selected in a purchase order line."),
'purchase_ids': fields.one2many('purchase.order', 'product_id', 'Purchases'),
'purchase_count': fields.function(_purchase_count, string='# Purchases', type='integer'),
} }
_defaults = { _defaults = {
'purchase_ok': 1, 'purchase_ok': 1,

View File

@ -631,7 +631,10 @@
<field name="inherit_id" ref="account.product_normal_form_view"/> <field name="inherit_id" ref="account.product_normal_form_view"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//div[@name='buttons']" position="inside"> <xpath expr="//div[@name='buttons']" position="inside">
<button string="Purchases" name="%(action_purchase_line_product_tree)d" type="action" groups="purchase.group_purchase_user"/> <button class="oe_inline oe_stat_button" name="%(action_purchase_line_product_tree)d" type="action"
groups="purchase.group_purchase_user" icon="fa-shopping-cart">
<field string="Purchases" name="purchase_count" widget="statinfo" />
</button>
</xpath> </xpath>
<field name="property_account_expense" position="replace" > <field name="property_account_expense" position="replace" >
<field name="property_account_expense" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('purchase_ok','=',0)]}" groups="account.group_account_user"/> <field name="property_account_expense" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('purchase_ok','=',0)]}" groups="account.group_account_user"/>

View File

@ -47,9 +47,17 @@
<div class="oe_right oe_button_box" name="buttons"> <div class="oe_right oe_button_box" name="buttons">
<button type="object" <button type="object"
name="view_picking" name="view_picking"
string="Incoming Shipments" states="approved"/> class="oe_stat_button"
icon="fa-truck"
states="approved">
<field name="shipment_count" widget="statinfo" string="In Shipments" help="Incoming Shipments"/>
</button>
<button type="object" name="invoice_open" <button type="object" name="invoice_open"
string="Invoices" attrs="{'invisible': [('state', 'in', ['draft','sent'])]}"/> class="oe_stat_button"
icon="fa-pencil-square-o"
attrs="{'invisible': [('state', 'in', ['draft','sent'])]}">
<field name="invoice_count" widget="statinfo" string="Invoices"/>
</button>
</div> </div>
</xpath> </xpath>
</field> </field>

View File

@ -48,10 +48,11 @@
<field name="priority" eval="20"/> <field name="priority" eval="20"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//div[@name='buttons']" position="inside"> <xpath expr="//div[@name='buttons']" position="inside">
<button name="%(sale.act_res_partner_2_sale_order)d" type="action" <button class="oe_inline oe_stat_button" type="action" name="%(sale.act_res_partner_2_sale_order)d"
string="Quotations and Sales"
attrs="{'invisible': [('customer', '=', False)]}" attrs="{'invisible': [('customer', '=', False)]}"
groups="base.group_sale_salesman"/> icon="fa-strikethrough" groups="base.group_sale_salesman">
<field string="Sales" name="sale_order_count" widget="statinfo"/>
</button>
</xpath> </xpath>
</field> </field>
</record> </record>

View File

@ -1024,4 +1024,18 @@ class account_invoice(osv.Model):
workflow.trg_validate(uid, 'account.invoice', id, 'invoice_cancel', cr) workflow.trg_validate(uid, 'account.invoice', id, 'invoice_cancel', cr)
return super(account_invoice, self).unlink(cr, uid, ids, context=context) return super(account_invoice, self).unlink(cr, uid, ids, context=context)
class product_product(osv.Model):
_inherit = 'product.product'
def _sales_count(self, cr, uid, ids, field_name, arg, context=None):
res = dict(map(lambda x: (x,0), ids))
try:
for sale in self.browse(cr, uid, ids, context=context):
res[sale.id] = len(sale.sales_ids)
except:
pass
return res
_columns = {
'sales_ids': fields.one2many('sale.order.line', 'product_id', 'Sales '),
'sales_count': fields.function(_sales_count, string='# Sales', type='integer'),
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -499,7 +499,10 @@
<field name="inherit_id" ref="product.product_normal_form_view"/> <field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//div[@name='buttons']" position="inside"> <xpath expr="//div[@name='buttons']" position="inside">
<button string="Sales" name="%(action_order_line_product_tree)d" type="action" groups="base.group_sale_salesman"/> <button class="oe_inline oe_stat_button" name="%(action_order_line_product_tree)d"
type="action" groups="base.group_sale_salesman" icon="fa-strikethrough">
<field string="Sales" name="sales_count" widget="statinfo" />
</button>
</xpath> </xpath>
</field> </field>
</record> </record>

View File

@ -352,7 +352,14 @@ class product_product(osv.osv):
for id in ids: for id in ids:
res[id][f] = stock.get(id, 0.0) res[id][f] = stock.get(id, 0.0)
return res return res
def _move_count(self, cr, uid, ids, field_name, arg, context=None):
res = dict(map(lambda x: (x,0), ids))
try:
for move in self.browse(cr, uid, ids, context=context):
res[move.id] = len(move.move_ids)
except:
pass
return res
_columns = { _columns = {
'reception_count': fields.function(_stock_move_count, string="Reception", type='integer', multi='pickings'), 'reception_count': fields.function(_stock_move_count, string="Reception", type='integer', multi='pickings'),
'delivery_count': fields.function(_stock_move_count, string="Delivery", type='integer', multi='pickings'), 'delivery_count': fields.function(_stock_move_count, string="Delivery", type='integer', multi='pickings'),
@ -413,6 +420,8 @@ class product_product(osv.osv):
help="If real-time valuation is enabled for a product, the system will automatically write journal entries corresponding to stock moves." \ help="If real-time valuation is enabled for a product, the system will automatically write journal entries corresponding to stock moves." \
"The inventory variation account set on the product category will represent the current inventory value, and the stock input and stock output account will hold the counterpart moves for incoming and outgoing products." "The inventory variation account set on the product category will represent the current inventory value, and the stock input and stock output account will hold the counterpart moves for incoming and outgoing products."
, required=True), , required=True),
'move_ids': fields.one2many('stock.move', 'product_id', 'Moves'),
'move_count': fields.function(_move_count, string='# Moves', type='integer'),
} }
_defaults = { _defaults = {

View File

@ -73,8 +73,14 @@
<field name="inherit_id" ref="product.product_normal_form_view"/> <field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//div[@name='buttons']" position="inside"> <xpath expr="//div[@name='buttons']" position="inside">
<button string="Inventory" name="%(action_product_location_tree)d" type="action" attrs="{'invisible':[('type', '=', 'service')]}" groups="stock.group_locations"/> <button class="oe_inline oe_stat_button"
<button string="Moves" name= "%(act_product_stock_move_open)d" type="action" attrs="{'invisible':[('type', '=', 'service')]}" groups="stock.group_stock_user"/> name="%(action_product_location_tree)d" type="action"
attrs="{'invisible':[('type', '=', 'service')]}" groups="stock.group_locations" icon="fa-files-o" string="Inventory" />
<button class="oe_inline oe_stat_button" name= "%(act_product_stock_move_open)d" type="action"
attrs="{'invisible':[('type', '=', 'service')]}" groups="stock.group_stock_user" icon="fa-exchange">
<field string="Moves" name="move_count" widget="statinfo"/>
</button>
</xpath> </xpath>
<group name="procurement_uom" position="before"> <group name="procurement_uom" position="before">
<group name="delay" string="Delays"> <group name="delay" string="Delays">

View File

@ -636,7 +636,11 @@ class stock_picking(osv.osv):
vals['name'] = self.pool.get('ir.sequence').get(cr, user, seq_obj_name) vals['name'] = self.pool.get('ir.sequence').get(cr, user, seq_obj_name)
new_id = super(stock_picking, self).create(cr, user, vals, context) new_id = super(stock_picking, self).create(cr, user, vals, context)
return new_id return new_id
def _claim_count(self, cr, uid, ids, field_name, arg, context=None):
res = {}
claim = self.pool.get('crm.claim').search(cr, uid, [('ref', '=',('stock.picking.out,' + str(ids[0])))], context=context)
res[ids[0]] = len(claim)
return res
_columns = { _columns = {
'name': fields.char('Reference', size=64, select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), 'name': fields.char('Reference', size=64, select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
'origin': fields.char('Source Document', size=64, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="Reference of the document", select=True), 'origin': fields.char('Source Document', size=64, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="Reference of the document", select=True),
@ -680,6 +684,7 @@ class stock_picking(osv.osv):
("none", "Not Applicable")], "Invoice Control", ("none", "Not Applicable")], "Invoice Control",
select=True, required=True, readonly=True, track_visibility='onchange', states={'draft': [('readonly', False)]}), select=True, required=True, readonly=True, track_visibility='onchange', states={'draft': [('readonly', False)]}),
'company_id': fields.many2one('res.company', 'Company', required=True, select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), 'company_id': fields.many2one('res.company', 'Company', required=True, select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
'claim_count': fields.function(_claim_count, string='Claims', type='integer'),
} }
_defaults = { _defaults = {
'name': lambda self, cr, uid, context: '/', 'name': lambda self, cr, uid, context: '/',
@ -3122,7 +3127,9 @@ class stock_picking_out(osv.osv):
out_defaults = super(stock_picking_out, self).default_get(cr, uid, fields_list, context=context) out_defaults = super(stock_picking_out, self).default_get(cr, uid, fields_list, context=context)
defaults.update(out_defaults) defaults.update(out_defaults)
return defaults return defaults
def _claim_count(self, cr, uid, ids, field_name, arg, context=None):
return super(stock_picking_out, self)._claim_count(cr, uid, ids, field_name, arg, context=context)
_columns = { _columns = {
'backorder_id': fields.many2one('stock.picking.out', 'Back Order of', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="If this shipment was split, then this field links to the shipment which contains the already processed part.", select=True), 'backorder_id': fields.many2one('stock.picking.out', 'Back Order of', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="If this shipment was split, then this field links to the shipment which contains the already processed part.", select=True),
'state': fields.selection( 'state': fields.selection(
@ -3139,6 +3146,7 @@ class stock_picking_out(osv.osv):
* Ready to Deliver: products reserved, simply waiting for confirmation.\n * Ready to Deliver: products reserved, simply waiting for confirmation.\n
* Delivered: has been processed, can't be modified or cancelled anymore\n * Delivered: has been processed, can't be modified or cancelled anymore\n
* Cancelled: has been cancelled, can't be confirmed anymore"""), * Cancelled: has been cancelled, can't be confirmed anymore"""),
'claim_count': fields.function(_claim_count, string='Claims', type='integer'),
} }
_defaults = { _defaults = {
'type': 'out', 'type': 'out',

View File

@ -239,12 +239,23 @@
<field name="date"/> <field name="date"/>
<field name="active"/> <field name="active"/>
</group> </group>
<group groups="stock.group_tracking_lot" string="Traceability"> <group class="oe_right" groups="stock.group_tracking_lot" string="Traceability">
<button name="action_traceability" string="Upstream Traceability" type="object" <div class="oe_right oe_button_box">
colspan="2"/> <button name="action_traceability"
<button name="action_traceability" string="Downstream Traceability" type="object" string="Upstream"
context="{'type': 'move_history_ids'}" colspan="2"/> help="Upstream Traceability"
</group> class="oe_stat_button"
icon="fa-arrow-up"
type="object" colspan="2"/>
<button name="action_traceability"
string="Downstream"
help="Downstream Traceability"
class="oe_stat_button"
icon="fa-arrow-down"
type="object"
context="{'type': 'move_history_ids'}" colspan="2"/>
</div>
</group>
</group> </group>
<field name="move_ids"/> <field name="move_ids"/>
</form> </form>
@ -344,8 +355,16 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Serial Number" version="7.0"> <form string="Serial Number" version="7.0">
<div class="oe_button_box oe_right"> <div class="oe_button_box oe_right">
<button name="action_traceability" string="Upstream Traceability" type="object" context="{'type': 'move_history_ids2', 'field': 'prodlot_id'}"/> <button name="action_traceability"
<button name="action_traceability" string="Downstream Traceability" type="object" context="{'type': 'move_history_ids', 'field': 'prodlot_id'}"/> string="Upstream" class="oe_stat_button"
help="Upstream Traceability"
icon="fa-arrow-up" type="object"
context="{'type': 'move_history_ids2', 'field': 'prodlot_id'}"/>
<button name="action_traceability"
string="Downstream" class="oe_stat_button"
icon="fa-arrow-down" type="object"
help="Downstream Traceability"
context="{'type': 'move_history_ids', 'field': 'prodlot_id'}"/>
</div> </div>
<div class="oe_title"> <div class="oe_title">
<label for="name" class="oe_edit_only"/> <label for="name" class="oe_edit_only"/>

View File

@ -28,11 +28,16 @@
</header> </header>
<sheet> <sheet>
<div class="oe_button_box oe_right"> <div class="oe_button_box oe_right">
<button name="test_survey" states="open,draft,close,cancel" string="Test Survey" type="object" icon="gtk-new" context="{'survey_id': active_id}" attrs="{'invisible':[('id','=',0)]}"/> <button class="oe_inline oe_stat_button" name="test_survey" states="open,draft,close,cancel"
<button name="fill_survey" states="open" string="Answer Survey" type="object" icon="gtk-execute" context="{'survey_id': active_id}" attrs="{'invisible':[('state','!=','open')]}"/> string="Test Survey" type="object" icon="fa-file-o" context="{'survey_id': active_id}"
<button name="action_print_survey" states="open,draft,close,cancel" string="Print Answer" type="object"/> attrs="{'invisible':[('id','=',0)]}"/>
<button name="edit_survey" states="open,draft,close,cancel" <button class="oe_inline oe_stat_button" name="fill_survey" states="open" string="Reply Survey"
string="Edit Survey" type="object" context="{'active':True,'edit' : True,'survey_id': active_id}"/> type="object" icon="fa-star-half-o" context="{'survey_id': active_id}"
attrs="{'invisible':[('state','!=','open')]}"/>
<button class="oe_inline oe_stat_button" name="action_print_survey" states="open,draft,close,cancel"
string="Print Answer" type="object" icon="fa-print"/>
<button class="oe_inline oe_stat_button" name="edit_survey" states="open,draft,close,cancel"
string="Edit Survey" type="object" context="{'active':True,'edit' : True,'survey_id': active_id}" icon="fa-cog"/>
</div> </div>
<div class="oe_title"> <div class="oe_title">

View File

@ -160,7 +160,12 @@
<field name="model">event.event</field> <field name="model">event.event</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//div[@class='oe_right oe_button_box']" position="inside"> <xpath expr="//div[@class='oe_right oe_button_box']" position="inside">
<button name="%(website_event_track.act_event_list_tracks)d" type="action" string="Tracks"/> <button name="%(website_event_track.act_event_list_tracks)d"
type="action"
class="oe_stat_button oe_inline"
icon="fa-inbox">
<field name="count_tracks" widget="statinfo"/>
</button>
</xpath> </xpath>
<xpath expr="//field[@name='organizer_id']" position="after"> <xpath expr="//field[@name='organizer_id']" position="after">
<field name="timezone_of_event" /> <field name="timezone_of_event" />