[MERGE]: Merged with qwebreport-l10n_in

bzr revid: rsi@tinyerp.com-20140424064445-8tnf5sn1tjo91buq
This commit is contained in:
Rakesh Sindhav (OpenERP) 2014-04-24 12:14:45 +05:30
commit 504385cbc7
66 changed files with 1101 additions and 680 deletions

View File

@ -72,20 +72,18 @@ Dashboard for CRM will include:
'wizard/crm_phonecall_to_phonecall_view.xml',
'wizard/crm_opportunity_to_phonecall_view.xml',
'wizard/crm_merge_opportunities_view.xml',
'crm_view.xml',
'crm_phonecall_view.xml',
'crm_phonecall_menu.xml',
'crm_lead_view.xml',
'crm_lead_menu.xml',
'calendar_event_menu.xml',
'crm_phonecall_view.xml',
'crm_phonecall_menu.xml',
'report/crm_lead_report_view.xml',
'report/crm_phonecall_report_view.xml',

View File

@ -898,21 +898,22 @@ class crm_lead(format_address, osv.osv):
'type': 'ir.actions.act_window',
}
def action_makeMeeting(self, cr, uid, ids, context=None):
def action_schedule_meeting(self, cr, uid, ids, context=None):
"""
Open meeting's calendar view to schedule meeting on current opportunity.
:return dict: dictionary value for created Meeting view
"""
opportunity = self.browse(cr, uid, ids[0], context)
lead = self.browse(cr, uid, ids[0], context)
res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid, 'calendar', 'action_calendar_event', context)
partner_ids = [self.pool['res.users'].browse(cr, uid, uid, context=context).partner_id.id]
if lead.partner_id:
partner_ids.append(lead.partner_id.id)
res['context'] = {
'default_opportunity_id': opportunity.id,
'default_partner_id': opportunity.partner_id and opportunity.partner_id.id or False,
'default_partner_ids' : opportunity.partner_id and [opportunity.partner_id.id] or False,
'default_user_id': uid,
'default_section_id': opportunity.section_id and opportunity.section_id.id or False,
'default_email_from': opportunity.email_from,
'default_name': opportunity.name,
'default_opportunity_id': lead.type == 'opportunity' and lead.id or False,
'default_partner_id': lead.partner_id and lead.partner_id.id or False,
'default_partner_ids': partner_ids,
'default_section_id': lead.section_id and lead.section_id.id or False,
'default_name': lead.name,
}
return res

View File

@ -103,9 +103,9 @@
</header>
<sheet>
<div class="oe_right oe_button_box" name="buttons">
<button string="Schedule/Log Call"
name="%(opportunity2phonecall_act)d"
type="action"/>
<button class="oe_inline" type="action" string="Calls"
name="%(crm.crm_case_categ_phone_incoming0)d"
context="{'default_opportunity_id': active_id, 'search_default_opportunity_id': active_id, 'default_partner_id': partner_id, 'default_duration': 1.0}"/>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
@ -278,8 +278,8 @@
<t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Edit...</a></li></t>
<t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t>
<li><a name="%(mail.action_email_compose_message_wizard)d" type="action">Send Email</a></li>
<li><a name="%(opportunity2phonecall_act)d" type="action">Schedule/Log Call</a></li>
<li><a name="action_makeMeeting" type="object">Schedule Meeting</a></li>
<li><a type="action" name="%(crm.crm_case_categ_phone_incoming0)d" >Calls</a></li>
<li><a name="action_schedule_meeting" type="object">Schedule Meeting</a></li>
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
</ul>
</div>
@ -389,11 +389,11 @@
</header>
<sheet>
<div class="oe_right oe_button_box">
<button string="Schedule/Log Call" type="action"
name="%(opportunity2phonecall_act)d"/>
<button string="Meeting" type="object"
name="action_makeMeeting"
context="{'search_default_attendee_id': active_id, 'default_attendee_id' : active_id}"/>
<button class="oe_inline" type="action" string="Calls"
name="%(crm.crm_case_categ_phone_incoming0)d"
context="{'default_opportunity_id': active_id, 'search_default_opportunity_id': active_id, 'default_partner_id': partner_id, 'default_duration': 1.0}"/>
<button class="oe_inline" string="Schedule a Meeting" type="object"
name="action_schedule_meeting" context="{'partner_id': partner_id}"/>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>

View File

@ -144,7 +144,8 @@
<menuitem name="Scheduled Calls" id="menu_crm_case_phone_outbound"
parent="crm.menu_crm_case_phone"
action="crm_case_categ_phone_outgoing0" />
groups="crm.group_scheduled_calls"
action="crm_case_categ_phone_outgoing0"/>
</data>
</openerp>

View File

@ -178,6 +178,7 @@
help="Phone Calls Assigned to the current user or with a team having the current user as team leader"/>
<field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/>
<field name="user_id"/>
<field name="opportunity_id"/>
<field name="section_id" string="Sales Team"
groups="base.group_multi_salesteams"/>
<group expand="0" string="Group By...">

View File

@ -69,6 +69,9 @@ class crm_configuration(osv.TransientModel):
help="""Allows you to use Sales Teams to manage your leads and opportunities."""),
'alias_prefix': fields.char('Default Alias Name for Leads'),
'alias_domain' : fields.char('Alias Domain'),
'group_scheduled_calls': fields.boolean("Schedule calls to manage call center",
implied_group='crm.group_scheduled_calls',
help="""This adds the menu 'Scheduled Calls' under 'Sales / Phone Calls'""")
}
_defaults = {

View File

@ -9,9 +9,18 @@
<field name="arch" type="xml">
<data>
<div name="config_sale" position="before">
<separator string="After-Sale Services"/>
<separator string="Sale Services"/>
<group>
<label for="id" string="Pre-Sale Services"/>
<div>
<div>
<field name="group_scheduled_calls" class="oe_inline"/>
<label for="group_scheduled_calls"/>
</div>
</div>
</group>
<group>
<label for="id" string="Features"/>
<label for="id" string="After-Sale Services"/>
<div>
<div>
<field name="module_crm_claim" class="oe_inline"/>

View File

@ -92,5 +92,17 @@ class res_partner(osv.osv):
opportunity_ids[partner_id] = opportunity_id
return opportunity_ids
def schedule_meeting(self, cr, uid, ids, context=None):
if context is None:
context = {}
partner_ids = list(ids)
partner_ids.append(self.pool.get('res.users').browse(cr, uid, uid).partner_id.id)
res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid, 'calendar', 'action_calendar_event', context)
res['context'] = {
'default_partner_id': ids and ids[0] or False,
'default_partner_ids': partner_ids,
}
return res
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -94,13 +94,11 @@
attrs="{'invisible': [('customer', '=', False)]}"
name="%(crm.crm_case_category_act_oppor11)d"
context="{'search_default_partner_id': active_id}"/>
<button class="oe_inline" type="action"
string="Meetings"
name="%(calendar.action_calendar_event)d"
context="{'search_default_partner_ids': active_id, 'default_partner_ids' : [active_id]}"/>
<button class="oe_inline" string="Schedule a Meeting" type="object"
name="schedule_meeting" context="{'partner_id': active_id}"/>
<button class="oe_inline" type="action" string="Calls"
name="%(crm.crm_case_categ_phone_incoming0)d"
context="{'search_default_partner_id': active_id, 'default_duration': 1.0}" />
context="{'search_default_partner_id': active_id, 'default_duration': 1.0}"/>
</xpath>
</data>
</field>

View File

@ -42,6 +42,11 @@
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="group_scheduled_calls" model="res.groups">
<field name="name">Show Scheduled Calls Menu</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record model="res.users" id="base.user_root">
<field eval="[(4,ref('base.group_partner_manager'))]" name="groups_id"/>
</record>

View File

@ -19,9 +19,7 @@ openerp.crm = function(openerp) {
dataset.read_slice(['id', 'name']).done(function(result) {
_.each(result, function(v, k) {
// Set the proper value in the DOM
self.$el.find('img[data-member_id=' + v.id + ']').attr('title', v.name).tipsy({
offset: 10
});
self.$el.find('img[data-member_id=' + v.id + ']').attr('title', v.name).tooltip();
});
});
},

View File

@ -31,23 +31,17 @@
-
Now I begin communication and schedule a phone call with the customer.
-
!python {model: crm.opportunity2phonecall}: |
!python {model: crm.phonecall2phonecall}: |
import time
context.update({'active_model': 'crm.lead', 'active_ids': [ref('crm_case_3')]})
context.update({'active_model': 'crm.lead', 'active_ids': [ref('crm_case_3')],'active_id': ref('crm_case_3')})
call_id = self.create(cr, uid, {'date': time.strftime('%Y-%m-%d %H:%M:%S'),
'name': "Bonjour M. Jean, Comment allez-vous? J'ai bien reçu votre demande, pourrions-nous en parler quelques minutes?"}, context=context)
self.action_schedule(cr, uid, [call_id], context=context)
-
I check that phonecall is scheduled for that opportunity.
-
!python {model: crm.phonecall}: |
ids = self.search(cr, uid, [('opportunity_id', '=', ref('crm_case_3'))])
assert len(ids), 'Phonecall is not scheduled'
-
Now I schedule meeting with customer.
-
!python {model: crm.lead}: |
self.action_makeMeeting(cr, uid, [ref('crm_case_3')])
self.action_schedule_meeting(cr, uid, [ref('crm_case_3')])
-
After communicated with customer, I put some notes with contract details.
-

View File

@ -21,7 +21,6 @@
import crm_partner_binding
import crm_phonecall_to_phonecall
import crm_opportunity_to_phonecall
import crm_lead_to_opportunity
import crm_merge_opportunities

View File

@ -1,79 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.osv import fields, osv
from openerp.tools.translate import _
import time
class crm_opportunity2phonecall(osv.osv_memory):
"""Converts Opportunity to Phonecall"""
_inherit = 'crm.phonecall2phonecall'
_name = 'crm.opportunity2phonecall'
_description = 'Opportunity to Phonecall'
def default_get(self, cr, uid, fields, context=None):
opp_obj = self.pool.get('crm.lead')
categ_id = False
data_obj = self.pool.get('ir.model.data')
try:
res_id = data_obj._get_id(cr, uid, 'crm', 'categ_phone2')
categ_id = data_obj.browse(cr, uid, res_id, context=context).res_id
except ValueError:
pass
record_ids = context and context.get('active_ids', []) or []
res = {}
res.update({'action': 'log', 'date': time.strftime('%Y-%m-%d %H:%M:%S')})
for opp in opp_obj.browse(cr, uid, record_ids, context=context):
if 'name' in fields:
res.update({'name': opp.name})
if 'user_id' in fields:
res.update({'user_id': opp.user_id and opp.user_id.id or False})
if 'section_id' in fields:
res.update({'section_id': opp.section_id and opp.section_id.id or False})
if 'categ_id' in fields:
res.update({'categ_id': categ_id})
if 'partner_id' in fields:
res.update({'partner_id': opp.partner_id and opp.partner_id.id or False})
if 'contact_name' in fields:
res.update({'contact_name': opp.partner_id and opp.partner_id.name or False})
if 'phone' in fields:
res.update({'phone': opp.phone or (opp.partner_id and opp.partner_id.phone or False)})
return res
def action_schedule(self, cr, uid, ids, context=None):
value = {}
if context is None:
context = {}
phonecall = self.pool.get('crm.phonecall')
opportunity_ids = context and context.get('active_ids') or []
opportunity = self.pool.get('crm.lead')
data = self.browse(cr, uid, ids, context=context)[0]
call_ids = opportunity.schedule_phonecall(cr, uid, opportunity_ids, data.date, data.name, \
data.note, data.phone, data.contact_name, data.user_id and data.user_id.id or False, \
data.section_id and data.section_id.id or False, \
data.categ_id and data.categ_id.id or False, \
action=data.action, context=context)
return {'type': 'ir.actions.act_window_close'}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,52 +0,0 @@
<?xml version="1.0"?>
<openerp>
<data>
<!-- Opportunity to Phonecall view -->
<record model="ir.ui.view" id="opportunity2phonecall_view">
<field name="name">crm.opportunity2phonecall.form</field>
<field name="model">crm.opportunity2phonecall</field>
<field name="arch" type="xml">
<form string="Schedule/Log a Call" version="7.0">
<group>
<group>
<field name="action"/>
<field name="name"/>
<field name="categ_id" string="Type"
widget="selection"
domain="[('object_id.model', '=', 'crm.phonecall')]"
groups="base.group_no_one"/>
<field name="date" string="Planned Date" attrs="{'invisible': [('action','=','log')]}"/>
</group>
<group>
<field name="partner_id" readonly="True"/>
<field name="phone"/>
<field name="user_id" attrs="{'invisible': [('action','=','log')]}" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'base.group_sale_salesman_all_leads']}"/>
<field name="section_id" widget="selection" attrs="{'invisible': [('action','=','log')]}" groups="base.group_multi_salesteams"/>
</group>
</group>
<field name="note" placeholder="Call Description" />
<footer>
<button name="action_schedule" type="object" string="Log call" attrs="{'invisible' : [('action', '!=', 'log')]}" class="oe_highlight"/>
<button name="action_schedule" type="object" string="Schedule Call" attrs="{'invisible' : [('action', '!=', 'schedule')]}" class="oe_highlight" />
or
<button name="action_cancel" string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>
<!-- Opportunity to Phonecall action -->
<record model="ir.actions.act_window" id="opportunity2phonecall_act">
<field name="name">Schedule/Log Call</field>
<field name="res_model">crm.opportunity2phonecall</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="opportunity2phonecall_view"/>
<field name="target">new</field>
</record>
</data>
</openerp>

View File

@ -25,7 +25,7 @@ openerp.hr_attendance = function (instance) {
this.$(".oe_attendance_signout").click(function() {
self.do_update_attendance();
});
this.$el.tipsy({
this.$el.tooltip({
title: function() {
var last_text = instance.web.format_value(self.last_sign, {type: "datetime"});
var current_text = instance.web.format_value(new Date(), {type: "datetime"});
@ -36,7 +36,6 @@ openerp.hr_attendance = function (instance) {
return _.str.sprintf(_t("Click to Sign In at %s."), current_text);
}
},
html: true,
});
return this.check_attendance();
},

View File

@ -1,6 +1,6 @@
<template>
<t t-name="AttendanceSlider">
<div class="oe_attendance_status oe_attendance_nosigned" data-tipsy="true">
<div class="oe_attendance_status oe_attendance_nosigned" data-toggle="tooltip">
<div class="oe_attendance_signin"></div>
<div class="oe_attendance_signout"></div>
</div>

View File

@ -1,7 +1,8 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_hr_applicant_user,hr.applicant.user,model_hr_applicant,base.group_hr_user,1,1,1,1
access_hr_recruitment_report,hr.recruitment.report,model_hr_recruitment_report,base.group_hr_manager,1,1,1,1
access_hr_recruitment_stage_user,hr.recruitment.stage.user,model_hr_recruitment_stage,base.group_hr_user,1,1,1,1
access_hr_recruitment_stage_user,hr.recruitment.stage.user,model_hr_recruitment_stage,base.group_hr_user,1,0,0,0
access_hr_recruitment_stage_manager,hr.recruitment.stage.manager,model_hr_recruitment_stage,base.group_hr_manager,1,1,1,1
access_hr_recruitment_degree,hr.recruitment.degree,model_hr_recruitment_degree,base.group_hr_user,1,1,1,1
access_res_partner_hr_user,res.partner.user,base.model_res_partner,base.group_hr_user,1,1,1,1
access_survey_hr_user,survey.hr.user,survey.model_survey_survey,base.group_hr_user,1,1,1,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_applicant_user hr.applicant.user model_hr_applicant base.group_hr_user 1 1 1 1
3 access_hr_recruitment_report hr.recruitment.report model_hr_recruitment_report base.group_hr_manager 1 1 1 1
4 access_hr_recruitment_stage_user hr.recruitment.stage.user model_hr_recruitment_stage base.group_hr_user 1 1 0 1 0 1 0
5 access_hr_recruitment_stage_manager hr.recruitment.stage.manager model_hr_recruitment_stage base.group_hr_manager 1 1 1 1
6 access_hr_recruitment_degree hr.recruitment.degree model_hr_recruitment_degree base.group_hr_user 1 1 1 1
7 access_res_partner_hr_user res.partner.user base.model_res_partner base.group_hr_user 1 1 1 1
8 access_survey_hr_user survey.hr.user survey.model_survey_survey base.group_hr_user 1 1 1 0

View File

@ -50,6 +50,7 @@ Indian Payroll Salary Rules.
'l10n_in_hr_payroll_report.xml',
'l10n_in_hr_payroll_sequence.xml',
'views/report_payslipdetails.xml',
'views/report_hrsalarybymonth.xml',
'wizard/hr_salary_employee_bymonth_view.xml',
'wizard/hr_yearly_salary_detail_view.xml',
'report/payment_advice_report_view.xml',

View File

@ -18,13 +18,13 @@
rml="l10n_in_hr_payroll/report/report_payroll_advice.rml"
string="Print Advice" />
<report
auto="False"
id="hr_salary_employee_bymonth"
model="hr.salary.employee.month"
name="salary.employee.bymonth"
rml="l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.rml"
string="Yearly Salary by Head" />
<report
id="hr_salary_bymonth"
string="Yearly Salary by Head"
model="hr.salary.employee.month"
report_type="qweb-pdf"
file="l10n_in_hr_payroll.report_hrsalarybymonth"
name="l10n_in_hr_payroll.report_hrsalarybymonth"/>
<report
auto="False"

View File

@ -21,7 +21,7 @@
import datetime
import time
from openerp.osv import osv
from openerp.report import report_sxw
class report_hr_salary_employee_bymonth(report_sxw.rml_parse):
@ -64,8 +64,8 @@ class report_hr_salary_employee_bymonth(report_sxw.rml_parse):
current_year = last_year
current_month = current_month + 1
for c in range(0, (12-no_months)):
mnth_name.append('None')
self.mnths.append('None')
mnth_name.append('')
self.mnths.append('')
return [mnth_name]
def get_salary(self, form, emp_id, emp_salary, total_mnths):
@ -81,10 +81,10 @@ class report_hr_salary_employee_bymonth(report_sxw.rml_parse):
sal = self.cr.fetchall()
salary = dict(sal)
total = 0.0
cnt = 1
cnt = 0
for month in self.mnths:
if month <> 'None':
if month <> '':
if len(month) != 7:
month = '0' + str(month)
if month in salary and salary[month]:
@ -102,7 +102,7 @@ class report_hr_salary_employee_bymonth(report_sxw.rml_parse):
def get_employee(self, form):
emp_salary = []
salary_list = []
total_mnths=['Total', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
total_mnths=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
emp_obj = self.pool.get('hr.employee')
emp_ids = form.get('employee_ids', [])
employees = emp_obj.browse(self.cr, self.uid, emp_ids, context=self.context)
@ -128,6 +128,10 @@ class report_hr_salary_employee_bymonth(report_sxw.rml_parse):
self.total += item[count]
return self.total
report_sxw.report_sxw('report.salary.employee.bymonth', 'hr.salary.employee.month', 'l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.rml', parser=report_hr_salary_employee_bymonth, header='internal')
class wrapped_report_employee_salary_bymonth(osv.AbstractModel):
_name = 'report.l10n_in_hr_payroll.report_hrsalarybymonth'
_inherit = 'report.abstract_report'
_template = 'l10n_in_hr_payroll.report_hrsalarybymonth'
_wrapped_report_class = report_hr_salary_employee_bymonth
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,293 +0,0 @@
<?xml version="1.0"?>
<document filename="yearly salary report.pdf">
<template pageSize="(620.0,842.0)" title="Yearly Salary Report" author="OpenERP" allowSplitting="50">
<pageTemplate id="first">
<frame id="first" x1="28.0" y1="28.0" width="539" height="772"/>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="5,0" stop="5,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="6,0" stop="6,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="6,-1" stop="6,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="7,0" stop="7,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="7,-1" stop="7,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="8,0" stop="8,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="8,-1" stop="8,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="9,0" stop="9,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="9,-1" stop="9,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="10,0" stop="10,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="10,-1" stop="10,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="11,0" stop="11,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="11,-1" stop="11,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="12,0" stop="12,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="12,-1" stop="12,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="13,0" stop="13,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="13,-1" stop="13,-1"/>
</blockTableStyle>
<blockTableStyle id="Table2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="7,-1" stop="7,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="8,-1" stop="8,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="9,-1" stop="9,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="10,-1" stop="10,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="11,-1" stop="11,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="12,-1" stop="12,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="13,-1" stop="13,-1"/>
</blockTableStyle>
<blockTableStyle id="Table6">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="5,0" stop="5,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="6,0" stop="6,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="7,0" stop="7,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="8,0" stop="8,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="9,0" stop="9,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="10,0" stop="10,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="11,0" stop="11,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="12,0" stop="12,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="13,0" stop="13,0"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P3" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P4" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P5" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P6" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Standard" fontName="Helvetica"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Helvetica"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="7.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="7.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_1" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Table Contents" fontName="Helvetica"/>
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="5.0" leading="5" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="5.0" leading="2" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="7.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="5.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="5.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<images/>
</stylesheet>
<story>
<para style="P1">Yearly Salary Details </para>
<para style="P5">From <u>[[ formatLang(data['form']['start_date'], date=True) ]]</u> To <u>[[ formatLang(data['form']['end_date'], date=True) ]]</u> of <u>[[ (data['form']['category_id'][1]) ]]</u> Category</para>
<para style="P6">
<font color="white"> </font>
</para>
<section>
<para style="terp_default_1">[[ repeatIn(get_periods(data['form']),'m') ]]</para>
<blockTable colWidths="55.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,57.0" style="Table1">
<tr>
<td>
<para style="terp_tblheader_Details">Name</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ m[0] != 'None' and m[0] or '' ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ m[1] != 'None' and m[1] or '' ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ m[2] != 'None' and m[2] or '' ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ m[3] != 'None' and m[3] or '' ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ m[4] != 'None' and m[4] or '' ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ m[5] != 'None' and m[5] or '' ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ m[6] != 'None' and m[6] or '' ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ m[7] != 'None' and m[7] or '' ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ m[8] != 'None' and m[8] or '' ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ m[9] != 'None' and m[9] or '' ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ m[10] != 'None' and m[10] or '' ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ m[11] != 'None' and m[11] or '' ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Total</para>
</td>
</tr>
</blockTable>
<section>
<para style="terp_default_1">[[ repeatIn(get_employee(data['form']),'e') ]]</para>
<blockTable colWidths="55.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,57.0" style="Table2">
<tr>
<td>
<para style="terp_default_9">[[ e[0] ]]</para>
</td>
<td>
<para style="terp_default_Right_8">
<font face="Helvetica" size="5.0">[[ (e[1]!='' and formatLang(e[1])) or removeParentNode('font') ]]</font>
</para>
</td>
<td>
<para style="terp_default_Right_8">
<font face="Helvetica" size="5.0">[[ (e[2]!='' and formatLang(e[2])) or removeParentNode('font') ]]</font>
</para>
</td>
<td>
<para style="terp_default_Right_8">
<font face="Helvetica" size="5.0">[[ (e[3]!='' and formatLang(e[3])) or removeParentNode('font') ]]</font>
</para>
</td>
<td>
<para style="terp_default_Right_8">
<font face="Helvetica" size="5.0">[[ (e[4]!='' and formatLang(e[4])) or removeParentNode('font') ]]</font>
</para>
</td>
<td>
<para style="terp_default_Right_8">
<font face="Helvetica" size="5.0">[[ (e[5]!='' and formatLang(e[5])) or removeParentNode('font') ]]</font>
</para>
</td>
<td>
<para style="terp_default_Right_8">
<font face="Helvetica" size="5.0">[[ (e[6]!='' and formatLang(e[6])) or removeParentNode('font') ]]</font>
</para>
</td>
<td>
<para style="terp_default_Right_8">
<font face="Helvetica" size="5.0">[[ (e[7]!='' and formatLang(e[7])) or removeParentNode('font') ]]</font>
</para>
</td>
<td>
<para style="terp_default_Right_8">
<font face="Helvetica" size="5.0">[[ (e[8]!='' and formatLang(e[8])) or removeParentNode('font') ]]</font>
</para>
</td>
<td>
<para style="terp_default_Right_8">
<font face="Helvetica" size="5.0">[[ (e[9]!='' and formatLang(e[9])) or removeParentNode('font') ]]</font>
</para>
</td>
<td>
<para style="terp_default_Right_8">
<font face="Helvetica" size="5.0">[[ (e[10]!='' and formatLang(e[10])) or removeParentNode('font') ]]</font>
</para>
</td>
<td>
<para style="terp_default_Right_8">
<font face="Helvetica" size="5.0">[[ (e[11]!='' and formatLang(e[11])) or removeParentNode('font') ]]</font>
</para>
</td>
<td>
<para style="terp_default_Right_8">
<font face="Helvetica" size="5.0">[[ (e[12]!='' and formatLang(e[12])) or removeParentNode('font') ]]</font>
</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ formatLang(e[13],currency_obj= company.currency_id)]] </para>
</td>
</tr>
</blockTable>
</section>
</section>
<section>
<para style="terp_default_1">[[ repeatIn(get_months_tol(),'t') ]]</para>
<blockTable colWidths="55.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,40.0,57.0" style="Table6">
<tr>
<td>
<para style="terp_tblheader_Details">Total</para>
</td>
<td>
<para style="terp_tblheader_General_Right">[[ formatLang(t[1],currency_obj= company.currency_id) or removeParentNode('para') ]] </para>
</td>
<td>
<para style="terp_tblheader_General_Right">[[ formatLang(t[2],currency_obj= company.currency_id) or removeParentNode('para')]] </para>
</td>
<td>
<para style="terp_tblheader_General_Right">[[ formatLang(t[3],currency_obj= company.currency_id) or removeParentNode('para')]] </para>
</td>
<td>
<para style="terp_tblheader_General_Right">[[ formatLang(t[4],currency_obj= company.currency_id) or removeParentNode('para')]] </para>
</td>
<td>
<para style="terp_tblheader_General_Right">[[ formatLang(t[5],currency_obj= company.currency_id) or removeParentNode('para')]] </para>
</td>
<td>
<para style="terp_tblheader_General_Right">[[ formatLang(t[6],currency_obj= company.currency_id) or removeParentNode('para')]] </para>
</td>
<td>
<para style="terp_tblheader_General_Right">[[ formatLang(t[7],currency_obj= company.currency_id) or removeParentNode('para')]] ]</para>
</td>
<td>
<para style="terp_tblheader_General_Right">[[ formatLang(t[8],currency_obj= company.currency_id) or removeParentNode('para')]] </para>
</td>
<td>
<para style="terp_tblheader_General_Right">[[ formatLang(t[9],currency_obj= company.currency_id) or removeParentNode('para')]] </para>
</td>
<td>
<para style="terp_tblheader_General_Right">[[ formatLang(t[10],currency_obj= company.currency_id) or removeParentNode('para')]] </para>
</td>
<td>
<para style="terp_tblheader_General_Right">[[ formatLang(t[11],currency_obj= company.currency_id) or removeParentNode('para')]] </para>
</td>
<td>
<para style="terp_tblheader_General_Right">[[ formatLang(t[12],currency_obj= company.currency_id) or removeParentNode('para')]] </para>
</td>
<td>
<para style="terp_tblheader_General_Right">[[ formatLang(get_total(), currency_obj = company.currency_id)]]</para>
</td>
</tr>
</blockTable>
</section>
</story>
</document>

View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="report_hrsalarybymonth">
<t t-call="report.html_container">
<t t-call="report.internal_layout">
<div class="page">
<div class="text-center">
<h3 class="text-center"><strong>Yearly Salary Details</strong></h3>
<p class="text-center">
From <u><span t-esc="formatLang(data['form']['start_date'], date=True)"/></u> To <u><span t-esc="formatLang(data['form']['end_date'], date=True)"/></u> of <u><span t-esc="data['form']['category_id'][1]"/></u> Category
</p>
</div>
<table class="table table-condensed">
<thead>
<tr style="border-top: 1px solid black">
<th>Name</th>
<t t-foreach="get_periods(data['form'])" t-as="m">
<t t-foreach="m" t-as="month">
<th class="text-right">
<span t-esc="month"/>
</th>
</t>
</t>
<th class="text-right">Total</th>
</tr>
</thead>
<tbody>
<t t-foreach="get_employee(data['form'])" t-as="e">
<tr>
<td><span t-esc="e[0]"/></td>
<t t-foreach="e[1:13]" t-as="month_sal">
<td class="text-right">
<span t-esc="month_sal"/>
</td>
</t>
<td class="text-right">
<span t-esc="formatLang(e[13],currency_obj= company.currency_id)"/>
</td>
</tr>
</t>
</tbody>
<tfoot>
<tr class="border-black">
<t t-foreach="get_months_tol()" t-as="t">
<td><strong>Total</strong></td>
<t t-foreach="t" t-as="tdata">
<td class="text-right"><strong><span t-esc="formatLang(tdata, currency_obj=company.currency_id)"/></strong></td>
</t>
<td class="text-right"><strong><span t-esc="formatLang(get_total(), currency_obj=company.currency_id)"/></strong></td>
</t>
</tr>
</tfoot>
</table>
</div>
</t>
</t>
</template>
</data>
</openerp>

View File

@ -20,7 +20,6 @@
##############################################################################
import time
from openerp.osv import fields, osv
class hr_salary_employee_bymonth(osv.osv_memory):
@ -60,11 +59,8 @@ class hr_salary_employee_bymonth(osv.osv_memory):
res = self.read(cr, uid, ids, context=context)
res = res and res[0] or {}
datas.update({'form': res})
return {
'type': 'ir.actions.report.xml',
'report_name': 'salary.employee.bymonth',
'datas': datas,
}
return self.pool['report'].get_action(cr, uid, ids,
'l10n_in_hr_payroll.report_hrsalarybymonth',
data=datas, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -53,7 +53,7 @@
<!-- Admin should not receivve emails at creation -->
<record id="base.partner_root" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<!-- Catchall Email Alias -->

View File

@ -4,76 +4,76 @@
<!-- Update 'Demo user' and partners email preferences to avoid mail bombing -->
<record id="base.partner_demo" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_1" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_2" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_3" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_4" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_5" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_6" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_7" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_8" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_9" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_10" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_11" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_12" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_13" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_14" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_15" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_16" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_17" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_18" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_19" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_20" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_21" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_22" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_23" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<!-- Discussion: attachments and spec [DEMO: search on has_attachments -->

View File

@ -96,13 +96,7 @@ class mail_notification(osv.Model):
if message.author_id and message.author_id.email == partner.email:
continue
# Partner does not want to receive any emails or is opt-out
if partner.notification_email_send == 'none':
continue
# Partner wants to receive only emails and comments
if partner.notification_email_send == 'comment' and message.type not in ('email', 'comment'):
continue
# Partner wants to receive only emails
if partner.notification_email_send == 'email' and message.type != 'email':
if partner.notify_email == 'none':
continue
notify_pids.append(partner.id)
return notify_pids

View File

@ -31,21 +31,18 @@ class res_partner_mail(osv.Model):
_mail_mass_mailing = _('Customers')
_columns = {
'notification_email_send': fields.selection([
'notify_email': fields.selection([
('none', 'Never'),
('email', 'Incoming Emails only'),
('comment', 'Incoming Emails and Discussions'),
('all', 'All Messages (discussions, emails, followed system notifications)'),
], 'Receive Messages by Email', required=True,
('always', 'All Messages'),
], 'Receive Inbox Notifications by Email', required=True,
oldname='notification_email_send',
help="Policy to receive emails for new messages pushed to your personal Inbox:\n"
"- Never: no emails are sent\n"
"- Incoming Emails only: for messages received by the system via email\n"
"- Incoming Emails and Discussions: for incoming emails along with internal discussions\n"
"- All Messages: for every notification you receive in your Inbox"),
}
_defaults = {
'notification_email_send': lambda *args: 'comment'
'notify_email': lambda *args: 'always'
}
def message_get_suggested_recipients(self, cr, uid, ids, context=None):

View File

@ -8,7 +8,7 @@
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='active']" position="after">
<field name='notification_email_send'/>
<field name='notify_email' widget="radio"/>
</xpath>
<xpath expr="//sheet" position="after">
<div class="oe_chatter">

View File

@ -54,10 +54,10 @@ class res_users(osv.Model):
init_res = super(res_users, self).__init__(pool, cr)
# duplicate list to avoid modifying the original reference
self.SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS)
self.SELF_WRITEABLE_FIELDS.extend(['notification_email_send', 'display_groups_suggestions'])
self.SELF_WRITEABLE_FIELDS.extend(['notify_email', 'display_groups_suggestions'])
# duplicate list to avoid modifying the original reference
self.SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS)
self.SELF_READABLE_FIELDS.extend(['notification_email_send', 'alias_domain', 'alias_name', 'display_groups_suggestions'])
self.SELF_READABLE_FIELDS.extend(['notify_email', 'alias_domain', 'alias_name', 'display_groups_suggestions'])
return init_res
def _auto_init(self, cr, context=None):

View File

@ -10,7 +10,7 @@
<field name="arch" type="xml">
<data>
<field name="email" position="before">
<field name="notification_email_send" readonly="0"/>
<field name="notify_email" widget="radio" readonly="0"/>
</field>
</data>
</field>
@ -24,7 +24,7 @@
<field name="arch" type="xml">
<data>
<field name="signature" position="before">
<field name="notification_email_send"/>
<field name="notify_email" widget="radio"/>
</field>
<field name="signature" position="before">
<label for="alias_id" string="Messaging Alias" class="oe_read_only"

View File

@ -44,7 +44,7 @@ instance.web.form.FieldMany2ManyTagsEmail = instance.web.form.FieldMany2ManyTags
new instance.web.Model('res.partner').call("search", [[
["id", "in", ids],
["email", "=", false],
["notification_email_send", "in", ['all', 'comment']] ]],
["notify_email", "=", 'always'] ]],
{context: this.build_context()})
.then(function (record_ids) {
// valid partner

View File

@ -189,17 +189,6 @@
</td>
<td><div class="oe_view_manager_view_search" t-opentag="true"/></td>
</tr>
<tr class="oe_header_row" t-if="widget.action.params.view_inbox and widget.action.params.show_compose_message" >
<td colspan="2">
<button type="button" class="oe_write_full oe_highlight">
Compose a new message
</button>
<span class='oe_alternative'>
or
<a href='#' class='oe_write_onwall oe_bold' help='Your followers can read this message'>Write to my followers</a>
</span>
</td>
</tr>
</tbody>
</table>
<div class="oe_mail-placeholder"></div>

View File

@ -77,7 +77,7 @@ class TestMail(common.TransactionCase):
'alias_name': 'ernest',
'email': 'e.e@example.com',
'signature': '--\nErnest',
'notification_email_send': 'comment',
'notify_email': 'always',
'groups_id': [(6, 0, [self.group_employee_id])]
}, {'no_reset_password': True})
self.user_noone_id = self.res_users.create(cr, uid, {
@ -86,7 +86,7 @@ class TestMail(common.TransactionCase):
'alias_name': 'noemie',
'email': 'n.n@example.com',
'signature': '--\nNoemie',
'notification_email_send': 'comment',
'notify_email': 'always',
'groups_id': [(6, 0, [])]
}, {'no_reset_password': True})

View File

@ -348,14 +348,14 @@ class test_mail(TestMail):
# Data creation
# --------------------------------------------------
# 0 - Update existing users-partners
self.res_users.write(cr, uid, [uid], {'email': 'a@a', 'notification_email_send': 'comment'})
self.res_users.write(cr, uid, [uid], {'email': 'a@a', 'notify_email': 'always'})
self.res_users.write(cr, uid, [self.user_raoul_id], {'email': 'r@r'})
# 1 - Bert Tartopoils, with email, should receive emails for comments and emails
p_b_id = self.res_partner.create(cr, uid, {'name': 'Bert Tartopoils', 'email': 'b@b'})
# 2 - Carine Poilvache, with email, should receive emails for emails
p_c_id = self.res_partner.create(cr, uid, {'name': 'Carine Poilvache', 'email': 'c@c', 'notification_email_send': 'email'})
p_c_id = self.res_partner.create(cr, uid, {'name': 'Carine Poilvache', 'email': 'c@c', 'notify_email': 'none'})
# 3 - Dédé Grosbedon, without email, to test email verification; should receive emails for every message
p_d_id = self.res_partner.create(cr, uid, {'name': 'Dédé Grosbedon', 'email': 'd@d', 'notification_email_send': 'all'})
p_d_id = self.res_partner.create(cr, uid, {'name': 'Dédé Grosbedon', 'email': 'd@d', 'notify_email': 'always'})
# 4 - Attachments
attach1_id = self.ir_attachment.create(cr, user_raoul.id, {
'name': 'Attach1', 'datas_fname': 'Attach1',
@ -582,9 +582,9 @@ class test_mail(TestMail):
# 1 - Bert Tartopoils, with email, should receive emails for comments and emails
p_b_id = self.res_partner.create(cr, uid, {'name': 'Bert Tartopoils', 'email': 'b@b'})
# 2 - Carine Poilvache, with email, should receive emails for emails
p_c_id = self.res_partner.create(cr, uid, {'name': 'Carine Poilvache', 'email': 'c@c', 'notification_email_send': 'email'})
p_c_id = self.res_partner.create(cr, uid, {'name': 'Carine Poilvache', 'email': 'c@c', 'notify_email': 'always'})
# 3 - Dédé Grosbedon, without email, to test email verification; should receive emails for every message
p_d_id = self.res_partner.create(cr, uid, {'name': 'Dédé Grosbedon', 'email': 'd@d', 'notification_email_send': 'all'})
p_d_id = self.res_partner.create(cr, uid, {'name': 'Dédé Grosbedon', 'email': 'd@d', 'notify_email': 'always'})
# 4 - Create a Bird mail.group, that will be used to test mass mailing
group_bird_id = self.mail_group.create(cr, uid,
{

View File

@ -943,8 +943,6 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
start: function() {
var self = this;
return self.pos.ready.done(function() {
$('.oe_tooltip').remove(); // remove tooltip from the start session button
// remove default webclient handlers that induce click delay
$(document).off();
$(window).off();

View File

@ -8,7 +8,7 @@
<field name="email">demo.portal@yourcompany.example.com</field>
<field name="supplier" eval="False"/>
<field name="customer" eval="True"/>
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
<field name="city">Vivegnis</field>
<field name="zip">4683</field>
<field name="country_id" ref="base.be"/>

View File

@ -41,9 +41,6 @@ class project_configuration(osv.osv_memory):
'the timesheet line entries for particular date and user, with the effect of creating, '
'editing and deleting either ways.\n'
'-This installs the module project_timesheet.'),
'module_project_long_term': fields.boolean("Manage resources planning on gantt view",
help='A long term project management module that tracks planning, scheduling, and resource allocation.\n'
'-This installs the module project_long_term.'),
'module_project_issue': fields.boolean("Track issues and bugs",
help='Provides management of issues/bugs in projects.\n'
'-This installs the module project_issue.'),

View File

@ -61,10 +61,6 @@
<field name="group_tasks_work_on_tasks" class="oe_inline"/>
<label for="group_tasks_work_on_tasks" />
</div>
<div>
<field name="module_project_long_term" class="oe_inline"/>
<label for="module_project_long_term"/>
</div>
</div>
</group>
<separator string="Helpdesk &amp; Support"/>

View File

@ -3,7 +3,8 @@ access_project_project,project.project,model_project_project,project.group_proje
access_project_project_manager,project.project,model_project_project,project.group_project_manager,1,1,1,1
access_account_analytic_account_user,account.analytic.account,analytic.model_account_analytic_account,project.group_project_user,1,0,0,0
access_account_analytic_account,account.analytic.account,analytic.model_account_analytic_account,project.group_project_manager,1,1,1,1
access_project_task_type_user,project.task.type user,model_project_task_type,project.group_project_user,1,1,1,1
access_project_task_type_user,project.task.type user,model_project_task_type,project.group_project_user,1,0,0,0
access_project_task_type_manager,project.task.type manager,model_project_task_type,project.group_project_manager,1,1,1,1
access_project_task,project.task,model_project_task,project.group_project_user,1,1,1,1
access_project_task_work,project.task.work,model_project_task_work,project.group_project_user,1,1,1,1
access_report_project_task_user,report.project.task.user,model_report_project_task_user,project.group_project_manager,1,1,1,1
@ -11,7 +12,7 @@ access_partner_task user,base.res.partner user,base.model_res_partner,project.gr
access_task_on_partner,project.task on partners,model_project_task,base.group_user,1,0,0,0
access_project_on_partner,project.project on partners,model_project_project,base.group_user,1,0,0,0
access_project_task_sale_user,project.task salesman,model_project_task,base.group_sale_salesman,1,1,1,1
access_project_task_type_sale_user,project.task.type salesman,project.model_project_task_type,base.group_sale_salesman,1,1,1,1
access_project_task_type_sale_user,project.task.type salesman,project.model_project_task_type,base.group_sale_salesman,1,0,0,0
access_project_task_history_sale_user,project.task.history salesman,project.model_project_task_history,base.group_sale_salesman,1,1,1,1
access_project_project_sale_user,project.project salesman,model_project_project,base.group_sale_salesman,1,0,0,0
access_account_analytic_line_project,account.analytic.line project,analytic.model_account_analytic_line,project.group_project_manager,1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
3 access_project_project_manager project.project model_project_project project.group_project_manager 1 1 1 1
4 access_account_analytic_account_user account.analytic.account analytic.model_account_analytic_account project.group_project_user 1 0 0 0
5 access_account_analytic_account account.analytic.account analytic.model_account_analytic_account project.group_project_manager 1 1 1 1
6 access_project_task_type_user project.task.type user model_project_task_type project.group_project_user 1 1 0 1 0 1 0
7 access_project_task_type_manager project.task.type manager model_project_task_type project.group_project_manager 1 1 1 1
8 access_project_task project.task model_project_task project.group_project_user 1 1 1 1
9 access_project_task_work project.task.work model_project_task_work project.group_project_user 1 1 1 1
10 access_report_project_task_user report.project.task.user model_report_project_task_user project.group_project_manager 1 1 1 1
12 access_task_on_partner project.task on partners model_project_task base.group_user 1 0 0 0
13 access_project_on_partner project.project on partners model_project_project base.group_user 1 0 0 0
14 access_project_task_sale_user project.task salesman model_project_task base.group_sale_salesman 1 1 1 1
15 access_project_task_type_sale_user project.task.type salesman project.model_project_task_type base.group_sale_salesman 1 1 0 1 0 1 0
16 access_project_task_history_sale_user project.task.history salesman project.model_project_task_history base.group_sale_salesman 1 1 1 1
17 access_project_project_sale_user project.project salesman model_project_project base.group_sale_salesman 1 0 0 0
18 access_account_analytic_line_project account.analytic.line project analytic.model_account_analytic_line project.group_project_manager 1 1 1 1

View File

@ -19,9 +19,7 @@ openerp.project = function(openerp) {
dataset.read_slice(['id', 'name']).done(function(result) {
_.each(result, function(v, k) {
// Set the proper value in the DOM
self.$el.find('img[data-member_id=' + v.id + ']').attr('title', v.name).tipsy({
offset: 10
});
self.$el.find('img[data-member_id=' + v.id + ']').attr('title', v.name).tooltip();
});
});
},

View File

@ -191,7 +191,7 @@
</div>
<group>
<group>
<field name="partner_id" on_change="onchange_partner_id(partner_id)" context="{'search_default_supplier':1,'default_supplier':1,'default_customer':0}" domain="[('supplier','=',True)]"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id)" context="{'search_default_supplier':1, 'default_supplier':1, 'default_customer':0}" domain="[('supplier','=',True)]"/>
<field name="partner_ref"/>
<field domain="[('type','=','purchase')]" name="pricelist_id" groups="product.group_purchase_pricelist" on_change="onchange_pricelist(pricelist_id, context)"/>
<field name="currency_id" groups="base.group_multi_currency"/>

View File

@ -358,7 +358,7 @@
<field name="name">sale.order.line.tree</field>
<field name="model">sale.order.line</field>
<field name="arch" type="xml">
<tree string="Sales Order Lines">
<tree string="Sales Order Lines" create="false">
<field name="product_id" invisible="1"/>
<field name="order_id"/>
<field name="order_partner_id"/>
@ -376,7 +376,7 @@
<field name="name">sale.order.line.form2</field>
<field name="model">sale.order.line</field>
<field name="arch" type="xml">
<form string="Sales Order Lines" version="7.0">
<form string="Sales Order Lines" version="7.0" create="false">
<header>
<button name="%(action_view_sale_order_line_make_invoice)d" string="Create Invoice" type="action" attrs="{'invisible': ['|',('invoiced', '=', 1), ('state', 'not in', ('confirmed', 'draft'))]}" class="oe_highlight" groups="base.group_user"/>
<button name="button_cancel" string="Cancel Line" type="object" states="confirmed,exception" groups="base.group_user"/>

View File

@ -106,6 +106,15 @@
content: "Press The Top-Left Edit Button" !important;
}
[data-oe-type=html].oe_no_empty:empty:before {
content: "" !important;
}
[data-oe-type=html].oe_no_empty:empty {
background-image: none !important;
height: 16px !important;
}
/* ---- EDITOR BAR ---- {{{ */
table.editorbar-panel {
cursor: pointer;

View File

@ -86,6 +86,13 @@
.oe_structure.oe_empty:empty:before, [data-oe-type=html]:empty:before, .oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child:before, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child:before
content: 'Press The Top-Left Edit Button' !important
[data-oe-type=html].oe_no_empty:empty:before
content: '' !important
[data-oe-type=html].oe_no_empty:empty
background-image: none !important
height: 16px !important
// }}}
/* ---- EDITOR BAR ---- {{{ */

View File

@ -297,13 +297,31 @@ website.Tour = openerp.Class.extend({
$(".popover.tour button")
.off()
.on("click", function () {
$(".popover.tour").remove();
var help = $("#help-menu-button");
var offset = help.offset();
var left = (offset.left > 0) ? (offset.left + help.width()) : offset.left;
var top = (help.height() > 0) ? (offset.top + help.height()) : offset.top;
if ($(this).is("[data-role='next']") && step.element) {
$(".popover.tour").remove();
}
if (step.busy) return;
if (!$(this).is("[data-role='next']")) {
clearTimeout(self.timer);
step.busy = true;
self.tour.end();
self.endTour(callback);
if (!$(this).is("[data-role='next']") || !step.element) {
$('.popover.tour')
.animate({
left: left,
top: top,
width: '1px',
height: '1px',
opacity: 0
}, 800,
function(){
$(".popover.tour").remove();
clearTimeout(self.timer);
step.busy = true;
self.tour.end();
self.endTour(callback);
});
}
});

View File

@ -105,6 +105,7 @@ class WebsiteForum(http.Controller):
values = self._prepare_forum_values(forum=forum, searches=post)
values.update({
'main_object': tag or forum,
'question_ids': question_ids,
'pager': pager,
'tag': tag,
@ -134,6 +135,7 @@ class WebsiteForum(http.Controller):
values = self._prepare_forum_values(forum=forum, searches={'tags': True}, **post)
values.update({
'tags': tags,
'main_object': forum,
})
return request.website.render("website_forum.tag", values)
@ -179,6 +181,7 @@ class WebsiteForum(http.Controller):
filters = 'question'
values = self._prepare_forum_values(forum=forum, searches=post)
values.update({
'main_object': question,
'question': question,
'header': {'question_data': True},
'filters': filters,
@ -209,6 +212,7 @@ class WebsiteForum(http.Controller):
values = self._prepare_forum_values(**post)
values.update({
'post': question,
'question': question,
'forum': forum,
'reasons': reasons,
})
@ -228,7 +232,7 @@ class WebsiteForum(http.Controller):
'state': 'close',
'closed_uid': request.uid,
'closed_date': datetime.today().strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT),
'closed_reason_id': post.get('reason_id', False),
'closed_reason_id': int(post.get('reason_id', False)),
}, context=request.context)
return werkzeug.utils.redirect("/forum/%s/question/%s" % (slug(forum), slug(question)))
@ -381,6 +385,7 @@ class WebsiteForum(http.Controller):
values = self._prepare_forum_values(forum=forum, searches=searches)
values .update({
'users': users,
'main_object': forum,
'notifications': self._get_notifications(),
'pager': pager,
})
@ -515,7 +520,6 @@ class WebsiteForum(http.Controller):
def badge_users(self, forum, badge, **kwargs):
user_ids = [badge_user.user_id.id for badge_user in badge.owner_ids]
users = request.registry['res.users'].browse(request.cr, SUPERUSER_ID, user_ids, context=request.context)
values = self._prepare_forum_values(forum=forum, searches={'badges': True})
values.update({
'badge': badge,

View File

@ -111,7 +111,7 @@ class Post(osv.Model):
'state': fields.selection([('active', 'Active'), ('close', 'Close'), ('offensive', 'Offensive')], 'Status'),
'views': fields.integer('Number of Views'),
'active': fields.boolean('Active'),
'is_correct': fields.boolean('Valid Answer', help='Correct Answer/ Answer on this question accepted.'),
'is_correct': fields.boolean('Valid Answer', help='Correct Answer or Answer on this question accepted.'),
'website_message_ids': fields.one2many(
'mail.message', 'res_id',
domain=lambda self: [
@ -230,8 +230,9 @@ class Post(osv.Model):
class PostReason(osv.Model):
_name = "forum.post.reason"
_description = "Post Closing Reason"
_order = 'name'
_columns = {
'name': fields.char('Post Reason', required=True),
'name': fields.char('Post Reason', required=True, translate=True),
}

View File

@ -10,10 +10,17 @@
font-size: 200%;
font-weight: bold;
}
.box div.subtitle {
margin-top: -4px;
}
.question .question-name {
font-size: 150%;
}
.question .badge {
background-color: #cccccc;
margin-left: 4px;
}
.oe_grey {
background-color: #eeeeee;
@ -37,11 +44,15 @@
}
.oe_answer_true {
color: #428bca;
color: #3c763d;
}
.oe_answer_false {
color: #999999;
color: #bbbbbb;
}
.favourite_question {
color: #bbbbbb !important;
}
.forum_favourite_question {

View File

@ -8,10 +8,15 @@
span
font-size: 200%
font-weight: bold
div.subtitle
margin-top: -4px
.question
.question-name
font-size: 150%
.badge
background-color: #ccc
margin-left: 4px
.oe_grey
background-color: #eeeeee
@ -30,10 +35,13 @@
color: #eea91e
.oe_answer_true
color: #428bca
color: #3c763d
.oe_answer_false
color: #999999
color: #bbbbbb
.favourite_question
color: #bbbbbb !important
.forum_favourite_question
color: #ffcc00 !important
@ -63,4 +71,4 @@ a.no-decoration
font: 1.2em "Helvetica Neue", Helvetica, Arial, sans-serif !important
.text-tags .text-tag .text-button
font: 1.2em "Helvetica Neue", Helvetica, Arial, sans-serif !important
height: 1.2em !important
height: 1.2em !important

View File

@ -65,11 +65,10 @@ $(document).ready(function () {
$link.parent().append($warning);
}
} else {
$link.parents().find(".oe_answer_true").removeClass("oe_answer_true alert alert-info").addClass('oe_answer_false');
$link.parents().find(".answer_correct").removeClass("answer_correct alert alert-info")
if (data) {
$link.removeClass("oe_answer_false").addClass('oe_answer_true');
$link.parents('.forum_answer').first().addClass("answer_correct alert alert-info");
$link.addClass("oe_answer_true").removeClass('oe_answer_false');
} else {
$link.removeClass("oe_answer_true").addClass('oe_answer_false');
}
}
});

View File

@ -58,19 +58,31 @@
<field name="arch" type="xml">
<form string="Forum Post" version="7.0">
<sheet>
<h1><field name="name" placeholder="Name"/></h1>
<label for="name" class="oe_edit_only"/>
<h1>
<field name="name" placeholder="Name"/>
</h1>
<group>
<field name="tag_ids" widget="many2many_tags"/>
<field name="forum_id"/>
<field name="parent_id"/>
<field name="content" placeholder="e.g. Once upon a time..." widget="html"/>
<group>
<field name="create_date"/>
<field name="forum_id"/>
<field name="parent_id"/>
</group><group>
<field name="tag_ids" widget="many2many_tags"/>
<field name="state"/>
<field name="closed_reason_id"/>
<field name="closed_uid"/>
<field name="closed_date"/>
</group><group>
<field name="create_uid"/>
</group>
<group>
<field name="create_date"/>
<field name="write_uid"/>
<field name="write_date"/>
</group><group>
<field name="is_correct"/>
<field name="views"/>
<field name="vote_count"/>
<field name="favourite_count"/>
<field name="child_count"/>
</group>
</group>
</sheet>

View File

@ -26,10 +26,6 @@
<t t-set="head">
<link rel='stylesheet' href="/web/static/lib/jquery.textext/jquery.textext.css"/>
<link rel='stylesheet' href='/website_forum/static/src/css/website_forum.css'/>
<!--
FP Note: Why do we need this ? Can we remove this code?
The problem is that you add your script for every page, not only for the forum
-->
<script type="text/javascript" src="/website_forum/static/src/js/website_forum.js"/>
<script type="text/javascript" src="/web/static/lib/jquery.textext/jquery.textext.js"/>
<script type="text/javascript" src="/web/static/lib/ckeditor/ckeditor.js"/>
@ -90,7 +86,7 @@
</div>
<div class="col-sm-3" id="right-column">
<a t-if="not header.get('ask_hide')" class="btn btn-primary btn-lg btn-block mb16" t-attf-href="/forum/#{slug(forum)}/ask">Ask a Question</a>
<div class="panel panel-default">
<div class="panel panel-default" id="about_forum">
<div class="panel-heading">
<h3 class="panel-title">About This Forum</h3>
</div>
@ -136,38 +132,33 @@
<template id="display_post">
<div class="question clearfix">
<div class="pull-left text-center">
<div t-attf-class="box #{question.child_count and 'oe_green' or 'oe_grey'}">
<div t-attf-class="box #{question.is_correct and 'oe_green' or 'oe_grey'} #{(question.child_count == 0) and 'text-muted' or ''}">
<span t-esc="question.child_count"/>
<span t-if="question.is_correct" class="fa fa-2x fa-check-circle"/>
<div t-if="question.child_count&gt;1">Answers</div>
<div t-if="question.child_count&lt;=1">Answer</div>
</div>
<div class="text-muted text-center">
<span t-field="question.views"/> Views
<div t-if="question.child_count&gt;1" class="subtitle">Answers</div>
<div t-if="question.child_count&lt;=1" class="subtitle">Answer</div>
</div>
</div>
<div class="pull-right text-center">
<div class="box oe_grey">
<span t-esc="question.vote_count or 0"/>
<div t-if="question.vote_count&gt;1">Votes</div>
<div t-if="question.vote_count&lt;=1">Vote</div>
</div>
</div>
<div style="margin-left: 95px;">
<div style="margin-left: 95px; margin-top:-8px;">
<div class="question-name">
<a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(question) }" t-field="question.name"/>
<span t-if="not question.active"><b> [Deleted]</b></span>
<span t-if="question.state == 'close'"><b> [Closed]</b></span>
</div>
<t t-foreach="question.tag_ids" t-as="tag">
<a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="badge pull-right" t-field="tag.name"/>
</t>
<div class="text-muted">
by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.create_uid.id }"
t-field="question.create_uid" t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
style="display: inline-block;"/>
on <span t-field="question.write_date" t-field-options='{"format":"short"}'/>
with <b t-field="question.views"/> views
<span t-if="question.vote_count&gt;0"> and
<b t-esc="question.vote_count or 0"/>
<t t-if="question.vote_count&gt;1">votes</t>
<t t-if="question.vote_count==1">vote</t>
</span>
</div>
<t t-foreach="question.tag_ids" t-as="tag">
<a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="badge" t-field="tag.name"/>
</t>
</div>
</div>
</template>
@ -335,23 +326,36 @@
<!-- Moderation: close a question -->
<template id="close_question">
<t t-call="website_forum.header">
<h3 class=""><b>Close question</b></h3><br/>
<form t-attf-action="/forum/#{ slug(forum) }/question/#{slug(question)}/close" method="post" role="form">
<h1 class="mt0">Close question</h1>
<p class="text-muted">
If you close this question, it will be hidden for most users. Only
users having a high karma can see closed questions to moderate
them.
</p>
<form t-attf-action="/forum/#{ slug(forum) }/question/#{slug(post)}/close" method="post" role="form" class="form-horizontal mt32 mb64">
<input name="post_id" t-att-value="post.id" type="hidden"/>
<span class="pull-left">Close the question:</span>
<a t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post) }" t-field="post.name"/>
<div class="mt16">
<label class="col-md-2 control-label mb16" for="reason">Reasons:</label>
<div class="col-md-9 mb16">
<select class="form-control" name="reason">
<div class="form-group">
<label class="col-md-3 control-label" for="reason">Question:</label>
<div class="col-md-8 mt8">
<span t-field="post.name"/>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label" for="reason">Reason:</label>
<div class="col-md-8">
<select class="form-control" name="reason_id">
<t t-foreach="reasons or []" t-as="reason">
<option t-att-value="reason.id" t-att-selected="reason.id == post.closed_reason_id.id"><t t-esc="reason.name"/></option>
</t>
</select>
</div>
</div>
<div>
<button class="btn btn-primary btn-lg">Close</button>
<div class="form-group">
<div class="col-md-offset-3 col-md-8">
<button class="btn btn-primary">Close question</button>
<span class="text-muted">or</span>
<a class="btn btn-link" t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post) }">back to question</a>
</div>
</div>
</form>
</t>
@ -383,27 +387,27 @@
<span id="vote_count" t-esc="post.vote_count"/>
<a t-attf-class="vote_down fa fa-thumbs-down no-decoration #{post.user_vote == -1 and 'text-warning' or ''}"
t-attf-href="/forum/#{slug(post.forum_id)}/post/#{slug(post)}/downvote"/>
<div>
<div t-if="vote_count &gt; 1" class="subtitle">
votes
</div>
<div t-if="vote_count &lt; 2" class="subtitle">
vote
</div>
</div>
</template>
<!-- Specific Post Layout -->
<template id="post_description_full" name="Question Navigation">
<t t-call="website_forum.header">
<div t-attf-class="question #{not question.active and 'alert alert-danger' or ''}">
<div class="text-center pull-left">
<t t-call="website_forum.vote">
<t t-set="post" t-value="question"/>
</t>
<div class="text-muted">
<span t-esc="question.child_count"/>
<span t-if="question.child_count&gt;1">Answers</span>
<span t-if="question.child_count&lt;=1">Answer</span>
<div class="text-muted text-center">
<span t-field="question.views"/> Views
</div>
<div>
<div class="mt4">
<a t-attf-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}/toggle_favourite"
t-attf-class="favourite_question no-decoration fa fa-2x fa-star #{question.user_favourite and 'forum_favourite_question' or ''}"/>
</div>
@ -414,6 +418,19 @@
<span t-if="not question.active"><b> [Deleted]</b></span>
<span t-if="question.state == 'close'"><b> [Closed]</b></span>
</h1>
<div class="alert alert-info" t-if="question.state == 'close'">
<p class="mt32 mb16 text-center">
<b>The question has been closed for reason: <i t-esc="question.closed_reason_id.name"/>
<br/>
<t t-if="question.closed_uid">
<i>by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ slug(question.closed_uid) }" t-field="question.closed_uid"/> </i>
</t>
on <span t-field="question.closed_date"/></b>
</p>
<div t-if="question.state == 'close' and user.karma&gt;=500" class="mb24 text-center">
<a class="fa fa-arrow-right" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/reopen"> Reopen</a>
</div>
</div>
<t t-raw="question.content"/>
<div class="mt16 clearfix">
@ -423,29 +440,25 @@
<a t-attf-href="/forum/#{ slug(forum) }/tag/#{ tag.id }/questions" class="badge" t-field="tag.name"/>
</t>
</div>
<ul class="list-inline">
<ul class="list-inline" id="options">
<li t-if="user.id == question.create_uid.id or user.karma&gt;=50">
<a style="cursor: pointer" data-toggle="collapse" class="text-muted fa fa-comment-o"
t-attf-data-target="#comment#{ question._name.replace('.','') + '-' + str(question.id) }">
comment
Comment
</a>
</li>
<li t-if="question.state != 'close' and (user.id == question.create_uid.id or user.karma&gt;=100)">
<a class="text-muted fa fa-times" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/ask_for_close">close</a>
</li>
<li t-if="question.state == 'close' and user.karma&gt;=500">
<a class="text-muted fa fa-undo" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)/reopen">reopen</a>
<a class="text-muted fa fa-times" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/ask_for_close"> Close</a>
</li>
<li t-if="user.id == question.create_uid.id or user.karma&gt;=300">
<a class="text-muted fa fa-edit" t-attf-href="/forum/#{ slug(forum) }/post/#{slug(question)}/edit">edit</a>
<a class="text-muted fa fa-edit" t-attf-href="/forum/#{ slug(forum) }/post/#{slug(question)}/edit"> Edit</a>
</li>
<li t-if="question.active and user.id == question.create_uid.id or user.karma&gt;=1000">
<a class="text-muted fa fa-trash-o" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/delete">delete</a>
<a class="text-muted fa fa-trash-o" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/delete"> Delete</a>
</li>
<li t-if="uid == question.create_uid.id and not question.active">
<a class="text-muted fa fa-trash-o" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/undelete">undelete</a>
<a class="text-muted fa fa-trash-o" t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/undelete"> Undelete</a>
</li>
<li><a class="text-muted fa fa-share" t-attf-href="/forum/#{slug(forum)}/question/#{slug(question)}">share</a></li>
</ul>
</div>
<div>
@ -458,15 +471,6 @@
<div t-field="question.create_uid" t-field-options='{"widget": "contact", "badges": true, "fields": ["karma"]}'/>
</div>
</div>
<div class="alert alert-info" t-if="question.state == 'close'">
<p class="mt32 mb32 text-center">
<b>The question has been closed for the following reason "<span t-field="question.closed_reason_id.name"/>"
<t t-if="question.closed_uid">
<i>by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ slug(question.closed_uid) }" t-field="question.closed_uid.name"/> </i>
</t>
<br/>close date <span t-field="question.closed_date"/></b>
</p>
</div>
</div>
<t t-call="website_forum.post_comment">
<t t-set="object" t-value="question"/>
@ -477,13 +481,13 @@
<div t-foreach="question.child_ids" t-as="answer" class="mt16 mb32">
<a t-attf-id="answer-#{str(answer.id)}"/>
<div t-attf-class="forum_answer #{answer.is_correct and 'alert alert-info answer_correct' or ''}" t-attf-id="answer_#{answer.id}" >
<div t-attf-class="forum_answer" t-attf-id="answer_#{answer.id}" >
<div class="text-center pull-left">
<t t-call="website_forum.vote">
<t t-set="post" t-value="answer"/>
</t>
<div class="text-muted">
<a t-attf-class="accept_answer fa fa-2x fa-check-circle no-decoration oe_answer_true #{answer.is_correct and 'oe_answer_true' or 'oe_answer_false'}"
<div class="text-muted mt8">
<a t-attf-class="accept_answer fa fa-2x fa-check-circle no-decoration #{answer.is_correct and 'oe_answer_true' or 'oe_answer_false'}"
t-attf-href="/forum/#{slug(question.forum_id)}/post/#{slug(answer)}/toggle_correct"/>
</div>
</div>
@ -493,19 +497,18 @@
<ul class="list-inline pull-right">
<li t-if="user.id == answer.create_uid.id or user.karma&gt;=50">
<a style="cursor: pointer" data-toggle="collapse" class="text-muted fa fa-comment-o"
t-attf-data-target="#comment#{ answer._name.replace('.','') + '-' + str(answer.id) }">comment
t-attf-data-target="#comment#{ answer._name.replace('.','') + '-' + str(answer.id) }"> Comment
</a>
</li>
<li t-if="user.id == answer.create_uid.id or user.karma&gt;=300">
<a class="text-muted fa fa-edit" t-attf-href="/forum/#{slug(forum)}/post/#{slug(answer)}/edit">edit</a>
<a class="text-muted fa fa-edit" t-attf-href="/forum/#{slug(forum)}/post/#{slug(answer)}/edit"> Edit</a>
</li>
<li t-if="user.id == answer.create_uid.id or user.karma&gt;=1000">
<a class="text-muted fa fa-trash-o" t-attf-href="/forum/#{slug(forum)}/post/#{slug(answer)}/delete">delete</a>
<a class="text-muted fa fa-trash-o" t-attf-href="/forum/#{slug(forum)}/post/#{slug(answer)}/delete"> Delete</a>
</li>
<li t-if="user.id == answer.create_uid.id">
<a class="text-muted fa fa-magic" t-attf-href="/forum/#{slug(forum)}/post/#{slug(answer)}/convert_to_comment">Convert as a comment</a>
<a class="text-muted fa fa-magic" t-attf-href="/forum/#{slug(forum)}/post/#{slug(answer)}/convert_to_comment"> Convert as a comment</a>
</li>
<li><a class="text-muted fa fa-share" t-attf-href="/forum/#{slug(forum)}/question/#{slug(question)}/#answer_#{answer.id}">share</a></li>
</ul>
<span t-field="answer.create_uid.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}'/>
<div>
@ -537,7 +540,7 @@
<template id="post_comment">
<div class="row clearfix">
<div class="col-sm-10 col-sm-offset-2">
<div t-foreach="reversed(object.website_message_ids)" t-as="message" class="comment oe_comment_grey mb8">
<div t-foreach="reversed(object.website_message_ids)" t-as="message" class="comment oe_comment_grey">
<small class="text-muted">
<button type="button" t-if="user.partner_id.id == message.author_id.id and user.karma&gt;=750"
t-attf-href="/forum/#{slug(forum)}/post/#{slug(object)}/comment/#{slug(message)}/delete"
@ -552,9 +555,9 @@
</small>
</div>
<div class="css_editable_mode_hidden">
<form t-attf-id="comment#{ object._name.replace('.','') + '-' + str(object.id) }" class="collapse"
<form t-attf-id="comment#{ object._name.replace('.','') + '-' + str(object.id) }" class="collapse oe_comment_grey"
t-attf-action="/forum/#{slug(forum)}/post/#{slug(object)}/comment" method="POST">
<input name="post_id" t-att-value="object.id" type="hidden"/>
<input name="post_id" t-att-value="object.id" type="hidden" class="mt8"/>
<textarea name="comment" class="form-control" placeholder="Comment this post..."/>
<button type="submit" class="btn btn-primary mt8">Post</button>
</form>
@ -778,7 +781,7 @@
</tr>
</table>
<div class="well well-sm">
<span t-field="user.partner_id.website_description"/>
<span t-field="user.partner_id.website_description" class="oe_no_empty"/>
<t t-if="uid == user.id">
<a class="fa fa-arrow-right" t-attf-href="/forum/#{slug(forum)}/user/#{slug(user)}/edit"> Edit Your Bio</a>
</t>
@ -831,7 +834,7 @@
</div>
</div>
<div class="tab-pane" id="followed_question">
<div t-foreach="followed" t-as="question">
<div t-foreach="followed" t-as="question" class="mb16">
<t t-call="website_forum.display_post"/>
</div>
</div>

View File

@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
import controllers
import models

View File

@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Documentation',
'category': 'Website',
'summary': 'Forum, Documentation',
'version': '1.0',
'description': """
Documentation based on question and pertinent answers of Forum
""",
'author': 'OpenERP SA',
'depends': [
'website_forum'
],
'data': [
'data/doc_data.xml',
'security/ir.model.access.csv',
'views/doc.xml',
'views/website_doc.xml',
],
'demo': [
'data/doc_demo.xml',
],
'installable': True,
'application': True,
}

View File

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
import main

View File

@ -0,0 +1,71 @@
# -*- coding: utf-8 -*-
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.addons.website.models.website import slug
class WebsiteDoc(http.Controller):
@http.route(['/forum/how-to', '/forum/how-to/<model("forum.documentation.toc"):toc>'], type='http', auth="public", website=True, multilang=True)
def toc(self, toc=None, **kwargs):
cr, uid, context, toc_id = request.cr, request.uid, request.context, False
if toc:
sections = toc.child_ids
forum = toc.forum_id
else:
toc_obj = request.registry['forum.documentation.toc']
obj_ids = toc_obj.search(cr, uid, [('parent_id', '=', False)], context=context)
sections = toc_obj.browse(cr, uid, obj_ids, context=context)
forum = sections and sections[0].forum_id or False
value = {
'toc': toc,
'main_object': toc or forum,
'forum': forum,
'sections': sections,
}
return request.website.render("website_forum_doc.documentation", value)
@http.route(['/forum/how-to/<model("forum.documentation.toc"):toc>/<model("forum.post"):post>'], type='http', auth="public", website=True, multilang=True)
def post(self, toc, post, **kwargs):
# TODO: implement a redirect instead of crash
assert post.documentation_toc_id.id == toc.id, "Wrong post!"
value = {
'toc': toc,
'post': post,
'main_object': post,
'forum': post.forum_id
}
return request.website.render("website_forum_doc.documentation_post", value)
@http.route('/forum/<model("forum.forum"):forum>/question/<model("forum.post"):post>/promote', type='http', auth="user", multilang=True, website=True)
def post_toc(self, forum, post, **kwargs):
cr, uid, context, toc_id = request.cr, request.uid, request.context, False
user = request.registry['res.users'].browse(cr, uid, uid, context=context)
assert user.karma >= 200, 'Not enough karma'
toc_obj = request.registry['forum.documentation.toc']
obj_ids = toc_obj.search(cr, uid, [], context=context)
tocs = toc_obj.browse(cr, uid, obj_ids, context=context)
value = {
'post': post,
'forum': post.forum_id,
'chapters': filter(lambda x: not x.child_ids, tocs)
}
return request.website.render("website_forum_doc.promote_question", value)
@http.route('/forum/<model("forum.forum"):forum>/promote_ok', type='http', auth="user", multilang=True, website=True)
def post_toc_ok(self, forum, post_id, toc_id, **kwargs):
cr, uid, context = request.cr, request.uid, request.context
user = request.registry['res.users'].browse(cr, uid, uid, context=context)
assert user.karma >= 200, 'Not enough karma'
toc_obj = request.registry['forum.documentation.toc']
stage_ids = toc_obj.search(cr, uid, [], limit=1, context=context)
post_obj = request.registry['forum.post']
post_obj.write(cr, uid, [int(post_id)], {
'documentation_toc_id': toc_id and int(toc_id) or False,
'documentation_stage_id': stage_ids and stage_ids[0] or False
}, context=context)
return request.redirect('/forum/'+str(forum.id)+'/question/'+str(post_id))

View File

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="menu_questions" model="website.menu">
<field name="name">Documentation</field>
<field name="url" eval="'/forum/how-to'"/>
<field name="parent_id" ref="website.main_menu"/>
<field name="sequence" type="int">65</field>
</record>
<!-- JUMP TO DOCUMENTATION AT INSTALL -->
<record id="action_open_documentation" model="ir.actions.act_url">
<field name="name">Documentation</field>
<field name="target">self</field>
<field name="url" eval="'/forum/how-to'"/>
</record>
<record id="base.open_menu" model="ir.actions.todo">
<field name="action_id" ref="action_open_documentation"/>
<field name="state">open</field>
</record>
<!-- Stages -->
<record id="stage_ideas" model="forum.documentation.stage">
<field name="name">Ideas</field>
<field name="sequence">1</field>
</record>
<record id="stage_draft" model="forum.documentation.stage">
<field name="name">Draft</field>
<field name="sequence">2</field>
</record>
<record id="stage_review" model="forum.documentation.stage">
<field name="name">Review</field>
<field name="sequence">3</field>
</record>
<record id="stage_publish" model="forum.documentation.stage">
<field name="name">Publish</field>
<field name="sequence">4</field>
</record>
</data>
</openerp>

View File

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Table Of Content -->
<record id="toc_functional_doc" model="forum.documentation.toc">
<field name="name">Functional Documentation</field>
<field name="introduction" type="html">
<p class="text-muted">
This documentation is produced using the best posts from the
<a href="/forum">community forum</a>.
</p>
</field>
<field name="forum_id" ref="website_forum.forum_help"/>
</record>
<record id="toc_sale" model="forum.documentation.toc">
<field name="name">Sales Management</field>
<field name="parent_id" ref="toc_functional_doc"/>
<field name="introduction" type="html">
<p class="text-muted">
Tracks leads, boost opportunities and close deals.
This serie of how-to will help you develop your business.
</p>
</field>
<field name="forum_id" ref="website_forum.forum_help"/>
</record>
<record id="toc_sale_customer" model="forum.documentation.toc">
<field name="name">Customers</field>
<field name="parent_id" ref="toc_sale"/>
<field name="forum_id" ref="website_forum.forum_help"/>
</record>
<record id="toc_sale_so" model="forum.documentation.toc">
<field name="name">Sales orders</field>
<field name="parent_id" ref="toc_sale"/>
<field name="forum_id" ref="website_forum.forum_help"/>
</record>
<record id="toc_0" model="forum.documentation.toc">
<field name="name">Sales &amp; Warehouse</field>
<field name="parent_id" ref="toc_sale"/>
<field name="forum_id" ref="website_forum.forum_help"/>
</record>
<record id="toc_crm" model="forum.documentation.toc">
<field name="name">Customer Relationship Management</field>
<field name="parent_id" ref="toc_functional_doc"/>
<field name="forum_id" ref="website_forum.forum_help"/>
</record>
<record id="toc_crm_lead" model="forum.documentation.toc">
<field name="name">Lead &amp; Opportunity</field>
<field name="parent_id" ref="toc_crm"/>
<field name="forum_id" ref="website_forum.forum_help"/>
</record>
<record id="toc_crm_claim" model="forum.documentation.toc">
<field name="name">Claims</field>
<field name="parent_id" ref="toc_crm"/>
<field name="forum_id" ref="website_forum.forum_help"/>
</record>
<record id="toc_crm_after_sale" model="forum.documentation.toc">
<field name="name">After-sale communication</field>
<field name="parent_id" ref="toc_crm"/>
<field name="forum_id" ref="website_forum.forum_help"/>
</record>
<record id="toc_website" model="forum.documentation.toc">
<field name="name">Website</field>
<field name="parent_id" ref="toc_functional_doc"/>
<field name="forum_id" ref="website_forum.forum_help"/>
</record>
<record id="toc_cms_ecommerce" model="forum.documentation.toc">
<field name="name">CMS &amp; eCommerce</field>
<field name="parent_id" ref="toc_website"/>
<field name="forum_id" ref="website_forum.forum_help"/>
</record>
<record id="toc_hrm" model="forum.documentation.toc">
<field name="name">Human Resources Management</field>
<field name="parent_id" ref="toc_functional_doc"/>
<field name="forum_id" ref="website_forum.forum_help"/>
</record>
<record id="toc_hrm_contract" model="forum.documentation.toc">
<field name="name">Employee Contract</field>
<field name="parent_id" ref="toc_hrm"/>
<field name="forum_id" ref="website_forum.forum_help"/>
</record>
<!-- Questions -->
<record id="website_forum.question_0" model="forum.post">
<field name="documentation_toc_id" ref="toc_hrm_contract"/>
</record>
<record id="website_forum.question_1" model="forum.post">
<field name="documentation_toc_id" ref="toc_cms_ecommerce"/>
</record>
</data>
</openerp>

View File

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
import documentation

View File

@ -0,0 +1,75 @@
# -*- coding: utf-8 -*-
import openerp
from openerp.osv import osv, fields
class Documentation(osv.Model):
_name = 'forum.documentation.toc'
_description = 'Documentation ToC'
_inherit = ['website.seo.metadata']
_order = "parent_left"
_parent_order = "sequence, name"
_parent_store = True
def name_get(self, cr, uid, ids, context=None):
if isinstance(ids, (list, tuple)) and not len(ids):
return []
if isinstance(ids, (long, int)):
ids = [ids]
reads = self.read(cr, uid, ids, ['name','parent_id'], context=context)
res = []
for record in reads:
name = record['name']
if record['parent_id']:
name = record['parent_id'][1]+' / '+name
res.append((record['id'], name))
return res
def _name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None):
res = self.name_get(cr, uid, ids, context=context)
return dict(res)
_columns = {
'sequence': fields.integer('Sequence'),
'display_name': fields.function(_name_get_fnc, type="char", string='Full Name'),
'name': fields.char('Name', required=True, translate=True),
'introduction': fields.html('Introduction', translate=True),
'parent_id': fields.many2one('forum.documentation.toc', 'Parent Table Of Content', ondelete='cascade'),
'child_ids': fields.one2many('forum.documentation.toc', 'parent_id', 'Children Table Of Content'),
'parent_left': fields.integer('Left Parent', select=True),
'parent_right': fields.integer('Right Parent', select=True),
'post_ids': fields.one2many('forum.post', 'documentation_toc_id', 'Posts'),
'forum_id': fields.many2one('forum.forum', 'Forum', required=True),
}
_constraints = [
(osv.osv._check_recursion, 'Error ! You cannot create recursive categories.', ['parent_id'])
]
class DocumentationStage(osv.Model):
_name = 'forum.documentation.stage'
_description = 'Post Stage'
_order = 'sequence'
_columns = {
'sequence': fields.integer('Sequence'),
'name': fields.char('Stage Name', required=True, translate=True),
}
class Post(osv.Model):
_inherit = 'forum.post'
_columns = {
'documentation_toc_id': fields.many2one('forum.documentation.toc', 'Documentation ToC', ondelete='set null'),
'documentation_stage_id': fields.many2one('forum.documentation.stage', 'Documentation Stage'),
'color': fields.integer('Color Index')
}
def _read_group_stage_ids(self, cr, uid, ids, domain, read_group_order=None, access_rights_uid=None, context=None):
stage_obj = self.pool.get('forum.documentation.stage')
stage_ids = stage_obj.search(cr, uid, [], context=context)
result = stage_obj.name_get(cr, uid, stage_ids, context=context)
return result, {}
_group_by_full = {
'documentation_stage_id': _read_group_stage_ids,
}

View File

@ -0,0 +1,4 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
all_documentation_toc,forum.documentation.toc,model_forum_documentation_toc,,1,0,0,0
users_documentation_toc,forum.documentation.toc,model_forum_documentation_toc,base.group_user,1,1,1,1
users_documentation_stage,forum.documentation.stage,model_forum_documentation_stage,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 all_documentation_toc forum.documentation.toc model_forum_documentation_toc 1 0 0 0
3 users_documentation_toc forum.documentation.toc model_forum_documentation_toc base.group_user 1 1 1 1
4 users_documentation_stage forum.documentation.stage model_forum_documentation_stage base.group_user 1 1 1 1

View File

@ -0,0 +1,116 @@
<?xml version="1.0"?>
<openerp>
<data>
<!-- DOCUMENTATION TOC VIEWS -->
<record id="view_documentation_toc_list" model="ir.ui.view">
<field name="name">forum.documentation.toc.list</field>
<field name="model">forum.documentation.toc</field>
<field name="arch" type="xml">
<tree string="Documentation TOC" editable="bottom">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="forum_id"/>
<field name="parent_id"/>
</tree>
</field>
</record>
<record id="action_documentation_toc" model="ir.actions.act_window">
<field name="name">Documentation</field>
<field name="res_model">forum.documentation.toc</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
</record>
<menuitem id="menu_documentation"
parent="website_forum.menu_website_forum" groups="base.group_user"
name="Documentation ToC" action="action_documentation_toc" sequence="20"/>
<record id="view_documentation_toc_list" model="ir.ui.view">
<field name="name">forum.documentation.toc.list</field>
<field name="model">forum.documentation.toc</field>
<field name="arch" type="xml">
<tree string="Documentation TOC" editable="bottom">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="parent_id"/>
</tree>
</field>
</record>
<record id="action_documentation_toc" model="ir.actions.act_window">
<field name="name">Documentation</field>
<field name="res_model">forum.documentation.toc</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
</record>
<menuitem id="menu_documentation"
parent="website_forum.menu_website_forum" groups="base.group_user"
name="Documentation ToC" action="action_documentation_toc" sequence="20"/>
<!-- Project Task Kanban View -->
<record model="ir.ui.view" id="view_forum_post_kanban">
<field name="name">forum.post.kanban</field>
<field name="model">forum.post</field>
<field name="arch" type="xml">
<kanban default_group_by="documentation_stage_id" >
<field name="documentation_stage_id"/>
<field name="create_uid"/>
<field name="color"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">
<div class="oe_dropdown_toggle oe_dropdown_kanban" groups="base.group_user">
<span class="oe_e">í</span>
<ul class="oe_dropdown_menu">
<li t-if="widget.view.is_action_enabled('edit')"><a type="edit">Edit...</a></li>
<li t-if="widget.view.is_action_enabled('delete')"><a type="delete">Delete</a></li>
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
</ul>
</div>
<div class="oe_kanban_content">
<div><b><field name="name"/></b></div>
<div class="oe_kanban_bottom_right">
<img t-att-src="kanban_image('res.users', 'image_small', record.create_uid.raw_value)" t-att-title="record.create_uid.value" width="24" height="24" class="oe_kanban_avatar"/>
</div>
</div>
<div class="oe_clear"></div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="action_forum_doc_post" model="ir.actions.act_window">
<field name="name">Documentation Posts</field>
<field name="res_model">forum.post</field>
<field name="view_type">form</field>
<field name="view_mode">kanban,tree,form</field>
<field name="domain">[('documentation_toc_id','&lt;&gt;', False)]</field>
</record>
<menuitem id="menu_forum_doc_posts"
parent="website_forum.menu_website_forum" name="Documentation Posts"
action="action_forum_doc_post" sequence="25"/>
<record id="view_forum_post_doc_form" model="ir.ui.view">
<field name="name">forum.post.form.doc</field>
<field name="model">forum.post</field>
<field name="inherit_id" ref="website_forum.view_forum_post_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='parent_id']" position="after">
<field name="documentation_toc_id"/>
</xpath>
<xpath expr="//sheet" position="before">
<header>
<field name="documentation_stage_id" widget="statusbar"/>
</header>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@ -0,0 +1,264 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Layout add nav and footer -->
<template id="header_footer_custom" inherit_id="website.layout"
name="Footer Documentation Link">
<xpath expr="//footer//ul[@name='products']" position="inside">
<li><a href="/forum/how-to">Documentation</a></li>
</xpath>
</template>
<!-- Page Index -->
<template id="toc" name="Documentation Index">
<t t-set="level" t-value="level+1"/>
<t t-foreach="titles" t-as="title">
<div t-attf-class="h#{str(level) + (level&lt;3 and ' page-header' or '')}">
<t t-esc="title.name"/>
<small t-if="len(title.post_ids)">
<t t-esc="len(title.post_ids)"/>
<t t-if="len(title.post_ids)==1">essay</t>
<t t-if="len(title.post_ids)&gt;1">essays</t>
</small>
</div>
<ul t-if="title.post_ids" class="mt32">
<li t-foreach="title.post_ids" t-as="post">
<a t-attf-href="/forum/how-to/#{slug(title)}/#{slug(post)}" t-field="post.name"/>
</li>
</ul>
<t t-set="titles" t-value="title.child_ids"/>
<t t-call="website_forum_doc.toc"/>
</t>
</template>
<template id="breadcrumb" name="Documentation Breadcrumb">
<t t-if="toc.parent_id">
<t t-call="website_forum_doc.breadcrumb">
<t t-set="toc" t-value="toc.parent_id"/>
</t>
</t>
<li t-if="toc">
<a t-attf-href="/forum/how-to/#{ slug(toc) }" t-field="toc.name"/>
</li>
</template>
<template id="documentation" name="Documentation Index">
<t t-call="website.layout">
<section class="container mt16" t-if="toc">
<div class="row">
<div class="col-sm-8">
<ol class="breadcrumb mb0">
<t t-call="website_forum_doc.breadcrumb">
<t t-set="toc" t-value="toc.parent_id"/>
</t>
<li class="active">
<span t-field="toc.name"/>
</li>
</ol>
</div>
<div class="col-sm-4 text-right">
<form class="navbar-form navbar-right mt0" role="search" t-attf-action="/forum/#{ slug(forum) }" method="get">
<div class="form-group">
<input type="search" class="form-control"
name="search" placeholder="Search..."
t-att-value="search or ''"/>
<button type="submit" class="btn btn-default">Search</button>
</div>
</form>
</div>
</div>
</section>
<section class="container">
<t t-set="level" t-value="toc and 1 or 0"/>
<h1 class="page-header" t-if="toc">
<t t-esc="toc.name"/>
</h1>
<t t-set="titles" t-value="sections"/>
<t t-call="website_forum_doc.toc"/>
</section>
<div class="oe_structure"/>
</t>
</template>
<template id="documentation_post" name="Documentation Question">
<t t-call="website.layout">
<section class="container mt16" t-if="toc">
<div class="row">
<div class="col-sm-8">
<ol class="breadcrumb mb0">
<t t-call="website_forum_doc.breadcrumb">
<t t-set="toc" t-value="toc.parent_id"/>
</t>
<li>
<a t-attf-href="/forum/how-to/#{ slug(toc) }" t-field="toc.name"/>
</li>
</ol>
</div>
<div class="col-sm-4 text-right" t-if="forum">
<form class="navbar-form navbar-right mt0" role="search" t-attf-action="/forum/#{ slug(forum) }" method="get">
<div class="form-group">
<input type="search" class="form-control"
name="search" placeholder="Search..."
t-att-value="search or ''"/>
<button type="submit" class="btn btn-default">Search</button>
</div>
</form>
</div>
</div>
</section>
<section class="container">
<div class="row">
<div class="col-sm-9">
<h1 class="page-header" t-field="post.name"/>
<blockquote t-if="bool(post.content)">
<t t-raw="post.content"/>
</blockquote>
<t t-if="post.child_ids">
<t t-raw="post.child_ids[0].content"/>
</t>
<div t-if="len(toc.post_ids)&gt;1">
<h2 class="page-header">Related topics</h2>
<ul>
<t t-foreach="toc.post_ids" t-as="topic">
<li t-if="post.id != topic.id">
<a t-attf-href="/forum/how-to/#{slug(toc)}/#{slug(topic)}" t-field="post.name"/>
</li>
</t>
</ul>
</div>
</div><div class="col-sm-3">
<div class="panel panel-default mt48" id="about_doc">
<div class="panel-heading">
<h3 class="panel-title">Need more info?</h3>
</div>
<div class="panel-body">
<div class="text-muted">
This documentation page has been extracted
from the Q&amp;A section where you can
discuss it and get feedback.
</div>
&amp;nbsp; <a t-attf-href="/forum/#{slug(forum)}/question/#{slug(post)}" class="fa fa-arrow-right mt16"> Related question</a>
</div>
</div>
</div>
</div>
</section>
<div class="oe_structure mt16 mb16"/>
</t>
</template>
<!--TOC ON FORUM POST-->
<template id="forum_question_doc" inherit_id="website_forum.post_description_full" name="Forum Post to Doc">
<xpath expr="//ul[@id='options']" position="inside">
<li t-if="(not question.documentation_stage_id) and user.karma&gt;=200">
<a t-attf-href="/forum/#{ slug(forum) }/question/#{slug(question)}/promote" class="text-muted fa fa-bookmark-o">
Promote to Doc
</a>
</li>
</xpath>
<xpath expr="//hr" position="before">
<div class="alert alert-success alert-dismissable mt16" t-if="question.documentation_toc_id">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&amp;times;</button>
This question has been included in the <a href="/forum/how-to">official documentation</a>.
</div>
</xpath>
</template>
<template id="promote_question">
<t t-call="website.layout">
<section class="container">
<h1 class="page-header">Promote question to documentation</h1>
<p>
To be promoted in the official documentation the question
and answer must satisfy the following criteria:
</p>
<ul>
<li>The question title is short and descriptive</li>
<li>The question describes a real business problem, not a software problem</li>
<li>The answer is understandable for someone who does not know Odoo</li>
</ul>
<p>
Before submiting the question, help us improve its quality by
editing the question and the main answer.
</p>
</section>
<div class="container">
<div class="well">
<form t-attf-action="/forum/#{ slug(forum) }/promote_ok" method="post" role="form" class="form-horizontal">
<input name="post_id" t-att-value="post.id" type="hidden"/>
<div class="form-group">
<label class="col-md-3 control-label" for="reason">Question:</label>
<div class="col-md-8 mt8">
<span t-field="post.name"/>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label" for="reason">Publish in Chapter:</label>
<div class="col-md-8">
<select class="form-control" name="toc_id">
<option/>
<t t-foreach="chapters or []" t-as="chapter">
<option t-att-value="chapter.id"><t t-esc="chapter.display_name"/></option>
</t>
</select>
</div>
</div>
<div class="form-group">
<div class="col-md-offset-3 col-md-8">
<button class="btn btn-primary">Push to documentation</button>
<span class="text-muted">or</span>
<a class="btn btn-link" t-attf-href="/forum/#{ slug(forum) }/question/#{ slug(post) }">cancel</a>
</div>
</div>
</form>
</div>
</div>
<section class="container">
<h2 class="page-header">Samples</h2>
<div class="row">
<div class="col-sm-6">
<h4>Good question titles</h4>
<ul>
<li>How to forecast sales revenues?</li>
<li>How to compute future inventories for a product?</li>
</ul>
</div>
<div class="col-sm-6">
<h4>Bad questions</h4>
<ul>
<li>What report should I use to compute probabilities per stage?</li>
<li>What's the available stock field?</li>
</ul>
</div>
</div>
<div class="row mb64">
<div class="col-sm-6">
<h4>Good answer structure</h4>
<ol>
<li>Describe the business solution</li>
<li>Explain how to implement it in OpenERP</li>
<li>Benefits of having done this setup</li>
</ol>
</div>
<div class="col-sm-6">
<h4>Bad answer structure</h4>
<ol>
<li>Explain how to configure in OpenERP</li>
<li>No business benefit</li>
</ol>
</div>
</div>
</section>
</t>
</template>
</data>
</openerp>

View File

@ -241,15 +241,15 @@ Best Designers has now emerged serving the Small and Medium Business SMBs
</record>
<record id="base.res_partner_24" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_25" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
<record id="base.res_partner_26" model="res.partner">
<field name="notification_email_send">none</field>
<field name="notify_email">none</field>
</record>
</data>
</openerp>