[MERGE]: merging from the development branch3

bzr revid: mga@mga-20100328190103-bxr3erm84dzje5ra
This commit is contained in:
Mantavya Gajjar
2010-03-29 00:31:03 +05:30
19 changed files with 166 additions and 132 deletions
+2 -2
View File
@@ -93,10 +93,10 @@
<child1>
<action colspan="4" height="220" name="%(action_view_task_tree)d" string="My Open Tasks" width="510"/>
<action colspan="4" name="%(project_issue.project_issue_categ_act0)d" string="Issues"/>
</child1>
<child2>
<action colspan="4" height="150" name="%(action_view_project_member_tree)d" string="Members list of project"/>
<action colspan="4" height="150" name="%(action_view_project_member_tree)d" string="Project(s) Members"/>
<action colspan="4" name="%(action_view_project_editable_messages_tree)d" string="Messages"/>
</child2>
</hpaned>
+1 -1
View File
@@ -165,7 +165,7 @@ class document_file(osv.osv):
vals['res_model'] = context.get('default_res_model', False)
if vals.get('res_id', False) and vals.get('res_model', False):
obj_model = self.pool.get(vals['res_model'])
result = obj_model.read(cr, uid, [vals['res_id']], context=context)
result = obj_model.read(cr, uid, [vals['res_id']], ['name', 'partner_id', 'address_id'], context=context)
if len(result):
obj = result[0]
if obj.get('name', False):
+14 -13
View File
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,7 +15,7 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@@ -39,20 +39,21 @@
""",
'author': 'Tiny',
'depends': [
'account',
'account_report',
'base_vat',
'base_iban',
'account_chart'
'depends': [
'account',
'account_report',
'base_vat',
'base_iban',
'account_chart'
],
'init_xml': [],
'update_xml': [
'account_pcmn_belgium.xml',
'l10n_be_wizard.xml',
'l10n_be_sequence.xml',
'fiscal_templates.xml',
'security/ir.model.access.csv'
'account_pcmn_belgium.xml',
'l10n_be_wizard.xml',
'wizard/l10n_be_account_vat_declaration_view.xml',
'l10n_be_sequence.xml',
'fiscal_templates.xml',
'security/ir.model.access.csv'
],
'demo_xml': [
'account.report.report.csv'
+3 -5
View File
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,17 +15,15 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import osv
class res_company(osv.osv):
_inherit = "res.company"
_description = 'res.company'
def _get_default_ad(self, addresses):
city = post_code = address = ""
for ads in addresses:
@@ -39,4 +37,4 @@ class res_company(osv.osv):
return city, post_code, address
res_company()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+2 -2
View File
@@ -21,7 +21,7 @@
type="wizard"
id="partner_wizard_vat_menu"/>
<wizard
<!-- <wizard
string="Periodical VAT Declaration"
name="wizard.account.xml.vat.declaration"
menu="False"
@@ -32,7 +32,7 @@
parent="menu_finance_belgian_statement"
action="wizard_xml_vat_declaration"
type="wizard"
id="account_wizard_vat_declaration"/>
id="account_wizard_vat_declaration"/> -->
<wizard
string="Partner VAT intra"
+3 -2
View File
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,13 +15,14 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import account_vat_declaration
import partner_vat_listing
import wizard_vat_intra
import l10n_be_account_vat_declaration
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,69 +15,62 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import wizard
import time
import datetime
import pooler
import base64
from osv import osv, fields
from tools.translate import _
form_fyear = """<?xml version="1.0"?>
<form string="Select Period">
<field name="period" />
</form>"""
class l10n_be_vat_declaration(osv.osv_memory):
""" Vat Declaration """
_name = "l1on_be.vat.declaration"
_description = "Vat Declaration"
fields_fyear = {
'period': {'string': 'Period', 'type': 'many2one', 'relation': 'account.period', 'required': True,},
}
_columns = {
'period_id': fields.many2one('account.period','Period', required=True),
'msg': fields.text('File created', size=64, readonly=True),
'file_save' : fields.binary('Save File'),
}
form = """<?xml version="1.0"?>
<form string="Notification">
<separator string="XML Flie has been Created." colspan="4"/>
<field name="msg" colspan="4" nolabel="1"/>
<field name="file_save" />
</form>"""
_defaults = {
'msg': lambda *a:'''Save the File with '".xml"' extension.''',
}
fields = {
'msg': {'string':'File created', 'type':'text', 'size':'100','readonly':True},
'file_save':{'string': 'Save File',
'type': 'binary',
'readonly': True,},
}
def create_xml(self, cr, uid, ids, context={}):
obj_fyear = self.pool.get('account.fiscalyear')
obj_tax_code = self.pool.get('account.tax.code')
obj_acc_period = self.pool.get('account.period')
obj_user = self.pool.get('res.users')
obj_comp = self.pool.get('res.company')
obj_data = self.pool.get('ir.model.data')
class wizard_vat_declaration(wizard.interface):
def _create_xml(self, cr, uid, data, context):
list_of_tags=['00','01','02','03','45','46','47','48','49','54','55','56','57','59','61','62','63','64','71','81','82','83','84','85','86','87','91']
pool_obj = pooler.get_pool(cr.dbname)
#obj_company = pool_obj.get('res.company').browse(cr,uid,1)
obj_company = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid).company_id
obj_company = obj_user.browse(cr, uid, uid, context=context).company_id
user_cmpny = obj_company.name
vat_no=obj_company.partner_id.vat
if not vat_no:
raise wizard.except_wizard(_('Data Insufficient'),_('No VAT Number Associated with Main Company!'))
tax_ids = pool_obj.get('account.tax.code').search(cr,uid,[])
tax_code_ids = obj_tax_code.search(cr, uid, [], context=context)
ctx = context.copy()
ctx['period_id'] = data['form']['period'] #added context here
tax_info = pool_obj.get('account.tax.code').read(cr,uid,tax_ids,['code','sum_period'],context=ctx)
data = self.read(cr, uid, ids)[0]
ctx['period_id'] = data['period_id'] #added context here
tax_info = obj_tax_code.read(cr, uid, tax_code_ids, ['code','sum_period'], context=ctx)
address=post_code=city=''
address = post_code = city = ''
if not obj_company.partner_id.address:
address=post_code=city=''
address = post_code = city = ''
city, post_code, address = obj_comp._get_default_ad(obj_company.partner_id.address)
city, post_code, address = pooler.get_pool(cr.dbname).get('res.company')._get_default_ad(obj_company.partner_id.address)
obj_fyear = pool_obj.get('account.fiscalyear')
year_id = obj_fyear.find(cr, uid)
account_period=pool_obj.get('account.period').browse(cr, uid, data['form']['period'])
account_period = obj_acc_period.browse(cr, uid, data['period_id'], context=context)
current_year = account_period.fiscalyear_id.name
period_code = account_period.code
@@ -93,7 +86,7 @@ class wizard_vat_declaration(wizard.interface):
starting_month = account_period.date_start[5:7]
ending_month = account_period.date_stop[5:7]
if starting_month != ending_month:
#starting month and ending month of selected period are not the same
#starting month and ending month of selected period are not the same
#it means that the accounting isn't based on periods of 1 month but on quarters
quarter = str(((int(starting_month) - 1) / 3) + 1)
data_of_file += '<QUARTER>'+quarter+'</QUARTER>\n\t\t\t'
@@ -110,21 +103,10 @@ class wizard_vat_declaration(wizard.interface):
data_of_file +='\n\t\t\t\t<D'+str(int(item['code'])) +'>' + str(int(item['sum_period']*100)) + '</D'+str(int(item['code'])) +'>'
data_of_file +='\n\t\t\t</DATA_ELEM>\n\t\t</DATA>\n\t</VATRECORD>\n</VATSENDING>'
data['form']['msg']='Save the File with '".xml"' extension.'
data['form']['file_save']=base64.encodestring(data_of_file)
return data['form']
data['file_save'] = base64.encodestring(data_of_file)
self.write(cr, uid, ids, {'file_save':data['file_save']}, context=context)
states = {
'init': {
'actions': [],
'result': {'type':'form', 'arch':form_fyear, 'fields':fields_fyear, 'state':[('end','Cancel'),('go','Create XML')]},
},
'go': {
'actions': [_create_xml],
'result': {'type':'form', 'arch':form, 'fields':fields, 'state':[('end','Ok')]},
}
}
l10n_be_vat_declaration()
wizard_vat_declaration('wizard.account.xml.vat.declaration')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<menuitem
id="menu_finance_belgian_statement"
name="Belgium Statements"
parent="account.menu_finance_legal_statement"/>
<record id="view_vat_declaration" model="ir.ui.view">
<field name="name">Select Period</field>
<field name="model">l1on_be.vat.declaration</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Select Period">
<group colspan="4" >
<field name="period_id" select="1"/>
<button colspan="1" name="create_xml" string="Create XML" type="object" default_focus="1"/>
</group>
<separator string="XML Flie has been Created." colspan="4"/>
<group colspan="4" >
<field name="msg" nolabel="1" colspan="4"/>
<field name="file_save" readonly="True"/>
</group>
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
</form>
</field>
</record>
<record id="action_vat_declaration" model="ir.actions.act_window">
<field name="name">Vat Declaraion</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">l1on_be.vat.declaration</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="view_vat_declaration"/>
<field name="target">new</field>
</record>
<menuitem
name="Periodical VAT Declaration"
parent="menu_finance_belgian_statement"
action="action_vat_declaration"
id="l10_be_vat_declaration"/>
</data>
</openerp>
+2 -3
View File
@@ -207,7 +207,7 @@
<field name="remaining_hours" widget="float_time"/>
<group col="4" colspan="4">
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-refresh" name="compute_hours" string="Update" type="object"/>
<button icon="gtk-refresh" name="compute_hours" string="Update" type="object" default_focus="1"/>
</group>
</form>
</field>
@@ -334,7 +334,7 @@
<field name="delegated_user_id" invisible="context.get('show_delegated', True)"/>
<field name="planned_hours" widget="float_time" />
<field name="total_hours" widget="float_time"/>
<field name="remaining_hours" widget="float_time" sum="Remaining Hours" invisible="context.get('set_visible',False)"/>
<field name="remaining_hours" widget="float_time" avg="Remaining Hours" invisible="context.get('set_visible',False)"/>
<field name="date_deadline" invisible="context.get('set_visible',False)"/>
<field name="type" groups="base.group_extended" invisible="context.get('set_visible',False)"/>
<field name="date_start" invisible="1"/>
@@ -412,7 +412,6 @@
<field name="name" select="1"/>
<field name="project_id" select="1" widget="selection" default="context.get('project_id', False)">
<filter domain="[('project_id.user_id','=',uid)]" help="My Projects" icon="terp-project"/>
<filter domain="[('project_id','=',False)]" help="Tasks not assigned to a project" icon="terp-project"/>
</field>
<field name="user_id" select="1" widget="selection">
<filter domain="[('user_id','=',uid)]" help="My Tasks" icon="gtk-execute" default="1"/>
@@ -32,7 +32,6 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Tasks">
<group col="10" colspan="4">
<filter icon="terp-project" string="This Year" domain="[('name','=',time.strftime('%%Y'))]" help="Tasks performed in this year"/>
<filter icon="terp-project" string="This Month" domain="[('month','=',time.strftime('%%m'))]" help="Tasks performed in this month"/>
<separator orientation="vertical"/>
@@ -41,8 +40,8 @@
<filter string="Deadline" icon="terp-project" domain="[('date_deadline','=',time.strftime('%%Y/%%m/%%d'))]"/>
<filter string="Closed" icon="terp-project" domain="[('state','=','done')]"/>
<separator orientation="vertical"/>
<field name="project_id" select="1"/>
<field name="user_id" select="1" widget="selection">
<field name="project_id"/>
<field name="user_id" widget="selection">
<filter icon="terp-project" string="My Task" domain="[('user_id','=',uid)]" default="1"/>
</field>
<newline/>
@@ -55,12 +54,11 @@
<filter string="Month" icon="terp-project" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-project" context="{'group_by':'name'}"/>
</group>
</group>
</search>
</field>
</record>
<record id="action_project_task_user_tree" model="ir.actions.act_window">
<record id="action_project_task_user_tree" model="ir.actions.act_window">
<field name="name">Tasks</field>
<field name="res_model">report.project.task.user</field>
<field name="view_type">form</field>
+3 -3
View File
@@ -133,15 +133,15 @@ class wizard_compute_tasks(wizard.interface):
'init': {
'actions': [],
'result': {'type':'form', 'arch':compute_form, 'fields':compute_fields, 'state':[
('end', 'Cancel'),
('compute', 'Compute')
('end', 'Cancel', 'gtk-cancel'),
('compute', 'Compute', 'gtk-ok', True)
]},
},
'compute': {
'actions': [_compute_date],
'result': {'type':'form','arch':success_msg,'fields':{}, 'state':[('end', 'Ok')]},
'result': {'type':'form','arch':success_msg,'fields':{}, 'state':[('end', 'Ok', 'gtk-ok', True)]},
}
}
wizard_compute_tasks('wizard.compute.tasks')
+3 -3
View File
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,7 +15,7 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@@ -96,7 +96,7 @@ class wizard_delegate(wizard.interface):
'actions': [_ask_auto_complete],
'result': {'type':'form', 'arch':ask_form, 'fields':ask_fields, 'state':[
('end', 'Cancel'),
('valid', 'Validate')
('valid', 'Validate', '', True)
]},
},
'valid': {
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,7 +15,7 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@@ -61,7 +61,7 @@ class wiz_timebox_fill(wizard.interface):
'arch':_gtd_arch,
'fields':_gtd_field,
'state':[
('end','Cancel'),
('end','Cancel', 'gtk-cancel'),
('process','Add to Timebox')
]
}
@@ -165,8 +165,8 @@ class wizard_compute_phases(wizard.interface):
'init': {
'actions': [],
'result': {'type': 'form', 'arch': compute_form, 'fields': compute_fields, 'state':[
('end', 'Cancel'),
('compute', 'Compute')
('end', 'Cancel', 'gtk-cancel'),
('compute', 'Compute', 'gtk-ok', True)
]},
},
@@ -76,7 +76,8 @@ class wizard_compute_tasks(wizard.interface):
if resource_id:
# resource = resource_obj.browse(cr, uid, resource_id, context=context)[0]
resource = resource_obj.read(cr, uid, resource_id, ['calendar_id','time_efficiency'], context=context)[0]
leaves = wkcal.compute_leaves(cr, uid, calendar_id , resource_id[0], resource.get('calendar_id')[0])
if resource.get('calendar_id', False):
leaves = wkcal.compute_leaves(cr, uid, calendar_id , resource_id[0], resource['calendar_id'] and resource['calendar_id'][0] or False)
time_efficiency = resource.get('time_efficiency')
resources.append(classobj((user.name.encode('utf8')), (Resource,), {'__doc__': user.name,
'__name__': user.name,
@@ -147,8 +148,8 @@ class wizard_compute_tasks(wizard.interface):
'init': {
'actions': [],
'result': {'type': 'form', 'arch': compute_form, 'fields': compute_fields, 'state': [
('end', 'Cancel'),
('compute', 'Compute')
('end', 'Cancel', 'gtk-cancel'),
('compute', 'Compute', 'gtk-ok', True)
]},
},
'compute': {
@@ -139,7 +139,7 @@ class wizard_schedule_task(wizard.interface):
states = {
'init': {
'actions': [_compute_date],
'result': {'type':'form','arch':success_msg,'fields':{}, 'state':[('end', 'Ok')]},
'result': {'type':'form','arch':success_msg,'fields':{}, 'state':[('end', 'Ok', 'gtk-ok', True)]},
}
}
wizard_schedule_task('phase.schedule.tasks')
+25 -18
View File
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
@@ -70,7 +70,7 @@ class report_account_analytic_planning(osv.osv):
return result
def _check_planning_responsible(self, cr, uid, ids, context={}):
for obj_plan in self.browse(cr,uid,ids):
for obj_plan in self.browse(cr, uid, ids, context=context):
cr.execute("""
SELECT id FROM report_account_analytic_planning plan
WHERE ( (%(date_from)s BETWEEN date_from AND date_to)
@@ -117,19 +117,19 @@ class report_account_analytic_planning(osv.osv):
]
def action_open(self, cr, uid, id, context={}):
self.write(cr, uid, id, {'state' : 'open'})
self.write(cr, uid, id, {'state' : 'open'}, context=context)
return True
def action_cancel(self, cr, uid, id, context={}):
self.write(cr, uid, id, {'state' : 'cancel'})
self.write(cr, uid, id, {'state' : 'cancel'}, context=context)
return True
def action_draft(self, cr, uid, id, context={}):
self.write(cr, uid, id, {'state' : 'draft'})
self.write(cr, uid, id, {'state' : 'draft'}, context=context)
return True
def action_done(self, cr, uid, id, context={}):
self.write(cr, uid, id, {'state' : 'done'})
self.write(cr, uid, id, {'state' : 'done'}, context=context)
return True
report_account_analytic_planning()
@@ -156,8 +156,9 @@ class report_account_analytic_planning_line(osv.osv):
return res
def _amount_base_uom(self, cr, uid, ids, name, args, context):
users_obj = self.pool.get('res.users')
result = {}
tm = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.planning_time_mode_id
tm = users_obj.browse(cr, uid, uid, context).company_id.planning_time_mode_id
if tm and tm.factor:
div = tm.factor
else:
@@ -220,13 +221,14 @@ class report_account_analytic_planning_user(osv.osv):
def _get_tasks(self, cr, uid, ids, name, args, context):
users_obj = self.pool.get('res.users')
result = {}
tm = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.project_time_mode_id
tm = users_obj.browse(cr, uid, uid, context=context).company_id.project_time_mode_id
if tm and tm.factor:
div = tm.factor
else:
div = 1.0
tm2 = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.planning_time_mode_id
tm2 = users_obj.browse(cr, uid, uid, context=context).company_id.planning_time_mode_id
if tm2 and tm2.factor:
div2 = tm2.factor
else:
@@ -252,8 +254,9 @@ class report_account_analytic_planning_user(osv.osv):
return result
def _get_timesheets(self, cr, uid, ids, name, args, context):
users_obj = self.pool.get('res.users')
result = {}
tm2 = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.planning_time_mode_id
tm2 = users_obj.browse(cr, uid, uid, context).company_id.planning_time_mode_id
if tm2 and tm2.factor:
div2 = tm2.factor
else:
@@ -313,8 +316,8 @@ Business Days - (Time Allocation of Tasks + Time Allocation without Tasks + Holi
FROM hr_holidays holidays
WHERE holidays.employee_id IN
(
SELECT emp.id
FROM hr_employee emp, resource_resource res WHERE emp.resource_id = res.id and res.user_id = users.id
SELECT emp.id
FROM hr_employee emp, resource_resource res WHERE emp.resource_id = res.id and res.user_id = users.id
)
AND holidays.state IN ('validate')
AND holidays.type = 'remove'
@@ -360,13 +363,14 @@ class report_account_analytic_planning_account(osv.osv):
_auto = False
def _get_tasks(self, cr, uid, ids, name, args, context):
users_obj = self.pool.get('res.users')
result = {}
tm = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.project_time_mode_id
tm = users_obj.browse(cr, uid, uid, context).company_id.project_time_mode_id
if tm and tm.factor:
div = tm.factor
else:
div = 1.0
tm2 = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.planning_time_mode_id
tm2 = users_obj.browse(cr, uid, uid, context).company_id.planning_time_mode_id
if tm2 and tm2.factor:
div2 = tm2.factor
else:
@@ -384,8 +388,9 @@ class report_account_analytic_planning_account(osv.osv):
return result
def _get_timesheets(self, cr, uid, ids, name, args, context):
users_obj = self.pool.get('res.users')
result = {}
tm2 = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.planning_time_mode_id
tm2 = users_obj.browse(cr, uid, uid, context).company_id.planning_time_mode_id
if tm2 and tm2.factor:
div2 = tm2.factor
else:
@@ -456,8 +461,9 @@ class report_account_analytic_planning_stat(osv.osv):
_order = 'planning_id,user_id'
def _sum_amount_real(self, cr, uid, ids, name, args, context):
users_obj = self.pool.get('res.users')
result = {}
tm2 = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.planning_time_mode_id
tm2 = users_obj.browse(cr, uid, uid, context).company_id.planning_time_mode_id
if tm2 and tm2.factor:
div2 = tm2.factor
else:
@@ -473,13 +479,14 @@ where user_id=%s and account_id=%s and date>=%s and date<=%s''', (line.user_id.i
return result
def _sum_amount_tasks(self, cr, uid, ids, name, args, context):
users_obj = self.pool.get('res.users')
result = {}
tm = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.project_time_mode_id
tm = users_obj.browse(cr, uid, uid, context).company_id.project_time_mode_id
if tm and tm.factor:
div = tm.factor
else:
div = 1.0
tm2 = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.planning_time_mode_id
tm2 = users_obj.browse(cr, uid, uid, context).company_id.planning_time_mode_id
if tm2 and tm2.factor:
div2 = tm2.factor
else:
@@ -223,7 +223,6 @@
<menuitem action="action_account_analytic_planning_form"
id="menu_report_account_analytic_planning" parent="planning_main" />
<menuitem action="resource.action_resource_resource_tree" id="base.menu_resource_resource_tree" parent="planning_main" />
<!--
Planning statistics
@@ -357,7 +356,7 @@
<!--Added link to open the list of all tasks planned on all lines of this planning.-->
<act_window context="{'planning': active_id}"
id="act_task_of_lines" name="Planning tasks" res_model="project.task"
id="act_task_of_lines" name="Tasks" res_model="project.task"
src_model="report_account_analytic.planning"
/>
+9 -8
View File
@@ -35,9 +35,10 @@
<field name="model">resource.calendar</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Resource Calendar">
<search string="Search Working Period">
<group col='15' colspan='4'>
<field name="name" string="Working Calendar"/>
<field name="name" string="Name"/>
<!-- <field name="name" string="Working Calendar"/> -->
<field name="manager" string="Workgroup Manager" widget="selection"/>
<field name="company_id" string="Company" widget="selection"/>
</group>
@@ -50,7 +51,7 @@
<field name="model">resource.calendar.leaves</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Resource Calendar Leaves">
<search string="Search Working Period Leaves">
<group col='15' colspan='4'>
<field name="name" string="Name"/>
<field name="company_id" string="Company" widget="selection"/>
@@ -70,7 +71,7 @@
<field name="model">resource.calendar</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Resource Calendar">
<form string="Working Period">
<field name="name" select="1"/>
<field name="manager" select="1"/>
<field name="company_id" select="1"/>
@@ -85,7 +86,7 @@
<field name="model">resource.calendar</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Resource Calendar">
<tree string="Working Period">
<field name="name"/>
<field name="manager" select="1"/>
<field name="company_id" select="1"/>
@@ -94,7 +95,7 @@
</record>
<record id="action_resource_calendar_form" model="ir.actions.act_window">
<field name="name">Resource Calendar</field>
<field name="name">Working Period</field>
<field name="res_model">resource.calendar</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
@@ -181,10 +182,10 @@
<tree string="Resources">
<field name="name" />
<field name="company_id" />
<field name="calendar_id" />
<field name="resource_type" />
<field name="user_id" />
<field name="calendar_id" />
<field name="time_efficiency" />
<field name="user_id" />
</tree>
</field>
</record>