openerp-dev-web team mailing list archive
-
openerp-dev-web team
-
Mailing list archive
-
Message #04483
[Merge] lp:~openerp-dev/openobject-addons/typo_task_2083 into lp:~openobject-training/openobject-addons/training_with_history
gpa(Open ERP) has proposed merging lp:~openerp-dev/openobject-addons/typo_task_2083 into lp:~openobject-training/openobject-addons/training_with_history.
Requested reviews:
Bhumika (OpenERP) (sbh-openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/typo_task_2083/+merge/54330
Solved the bug of calendar seance of task number 2083
--
https://code.launchpad.net/~openerp-dev/openobject-addons/typo_task_2083/+merge/54330
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/typo_task_2083.
=== removed directory 'base_contact_training'
=== removed file 'base_contact_training/__init__.py'
--- base_contact_training/__init__.py 2011-03-14 10:48:46 +0000
+++ base_contact_training/__init__.py 1970-01-01 00:00:00 +0000
@@ -1,25 +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/>.
-#
-##############################################################################
-
-import base_contact_training
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
=== removed file 'base_contact_training/__openerp__.py'
--- base_contact_training/__openerp__.py 2011-03-14 10:48:46 +0000
+++ base_contact_training/__openerp__.py 1970-01-01 00:00:00 +0000
@@ -1,39 +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/>.
-#
-##############################################################################
-
-
-{
- 'name': 'Base Contact Training',
- 'version': '1.0',
- 'category': 'Generic Modules/Base',
- 'description':'',
- 'author': 'OpenERP SA',
- 'website': 'http://www.openerp.com',
- 'depends': ['base','base_contact'],
- 'init_xml': [],
- 'update_xml':['base_contact_training_view.xml'],
- 'demo_xml': [],
- 'test': [],
- 'installable': True,
- 'active': False,
- 'certificate': '',
-}
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== removed file 'base_contact_training/base_contact_training.py'
--- base_contact_training/base_contact_training.py 2011-03-14 10:48:46 +0000
+++ base_contact_training/base_contact_training.py 1970-01-01 00:00:00 +0000
@@ -1,46 +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 osv import fields, osv
-
-class res_partner_function(osv.osv):
- _name = 'res.partner.function'
- _description = 'Function of the contact'
- _columns = {
- 'name': fields.char('Function Name', size=64, required=True),
- 'code': fields.char('Code', size=8, required=True),
- 'ref':fields.char('Notes', size=32,),
- }
- _order = 'name'
- _sql_constraints = [
- ('code_uniq', 'unique (code)', 'The Code of the Partner Function must be unique !')
- ]
-res_partner_function()
-
-class res_partner_job(osv.osv):
- _inherit = 'res.partner.job'
- _columns = {
- 'function_id': fields.many2one('res.partner.function','Partner Function')
- }
-res_partner_job()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
=== removed file 'base_contact_training/base_contact_training_view.xml'
--- base_contact_training/base_contact_training_view.xml 2011-03-14 10:48:46 +0000
+++ base_contact_training/base_contact_training_view.xml 1970-01-01 00:00:00 +0000
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
- <data>
- <record id="view_partner_function_form" model="ir.ui.view">
- <field name="name">res.partner.function.form</field>
- <field name="model">res.partner.function</field>
- <field name="type">form</field>
- <field name="arch" type="xml">
- <form string="Partner Functions">
- <field name="name" select="1"/>
- <field name="code" select="1"/>
- </form>
- </field>
- </record>
- <record id="view_partner_function_tree" model="ir.ui.view">
- <field name="name">res.partner.function.tree</field>
- <field name="model">res.partner.function</field>
- <field name="type">tree</field>
- <field name="arch" type="xml">
- <tree string="Partner Functions">
- <field name="code"/>
- <field name="name"/>
- </tree>
- </field>
- </record>
- <record id="action_partner_function_form" model="ir.actions.act_window">
- <field name="name">Partner Functions</field>
- <field name="type">ir.actions.act_window</field>
- <field name="res_model">res.partner.function</field>
- <field name="view_type">form</field>
- </record>
- <menuitem action="action_partner_function_form" id="menu_partner_function_form" parent="base.menu_address_book"/>
-
- </data>
-</openerp>
\ No newline at end of file
=== modified file 'training/__openerp__.py'
--- training/__openerp__.py 2011-03-18 08:57:04 +0000
+++ training/__openerp__.py 2011-03-22 11:57:24 +0000
@@ -56,7 +56,6 @@
'document_type',
'procurement',
'account_analytic_plans',
- 'base_contact_training',
],
'init_xml' : [
'training_sequence.xml',
=== modified file 'training/partner.py'
--- training/partner.py 2011-03-22 09:23:30 +0000
+++ training/partner.py 2011-03-22 11:57:24 +0000
@@ -77,29 +77,38 @@
def _get_function_by_kind(self, cr, uid, kind, context=None):
proxy = self.pool.get('training.config.contact.function')
ids = proxy.search(cr, uid, [('kind', '=', kind)], context=context)
+<<<<<<< TREE
result = [ obj.function_id.code for obj in proxy.browse(cr, uid, ids, context=context) ]
if not len(result):
+=======
+ res = [ obj.function for obj in proxy.browse(cr, uid, ids, context=context) ]
+ if not len(res):
+>>>>>>> MERGE-SOURCE
raise osv.except_osv(_('Warning'),
_("""Do not forget to configure the contact's function"""))
return result
def search(self, cr, uid, domain, offset = 0, limit = None, order = None, context = None, count = False):
+<<<<<<< TREE
if context is None:
context = {}
function = context.get('function', False)
proxy = self.pool.get('training.config.contact.function')
+=======
+ function = context and context.get('function', False) or False
+>>>>>>> MERGE-SOURCE
if function:
ids = proxy.search(cr, uid, [('kind', '=', function)], context=context)
if not ids:
raise osv.except_osv(_('Warning'),
_("Please, Could you configure the contact's function ?"))
- function_ids = [x.function_id.id for x in proxy.browse(cr, uid, ids, context=context)]
+ functions = [x.function for x in proxy.browse(cr, uid, ids, context=context)]
cr.execute("SELECT distinct(contact_id) "
"FROM res_partner_job "
- "WHERE function_id in (" + ','.join(['%s']*len(function_ids)) + ")"
- " AND state = 'current'", function_ids)
+ "WHERE function in (" + ','.join(['%s']*len(functions)) + ")"
+ " AND state = 'current'", functions)
contact_ids = set([x[0] for x in cr.fetchall()])
if domain:
@@ -126,7 +135,7 @@
}
_sql_constraints = [
- ('uniq_cont_add_func', 'unique(contact_id, address_id, function_id, state)', "Unique Exception, You can only have one job per contact, address, function and state"),
+ ('uniq_cont_add_func', 'unique(contact_id, address_id, function, state)', "Unique Exception, You can only have one job per contact, address, function and state"),
]
def onchange_address_id(self, cr, uid, ids, address_id):
=== modified file 'training/partner_view.xml'
--- training/partner_view.xml 2011-03-14 10:48:46 +0000
+++ training/partner_view.xml 2011-03-22 11:57:24 +0000
@@ -144,11 +144,11 @@
<field name="course_ids" colspan="4" nolabel="1">
<tree string="Courses">
<field name="course_id" />
- <field name="function_id" />
+ <field name="function" />
</tree>
<form string="Course">
<field name="course_id" />
- <field name="function_id" />
+ <field name="function" />
</form>
</field>
</page>
=== modified file 'training/security/ir.model.access.csv'
--- training/security/ir.model.access.csv 2011-03-14 10:48:46 +0000
+++ training/security/ir.model.access.csv 2011-03-22 11:57:24 +0000
@@ -87,8 +87,6 @@
"access_tr_part_reassign_wizard_session_man","training.participation.reassign.wizard","model_training_participation_reassign_wizard","training.group_session_manager",1,1,1,1
"access_tr_part_reassign_wizard_seance_man","training.participation.reassign.wizard","model_training_participation_reassign_wizard","training.group_seance_manager",1,1,1,1
"access_training_seance_purchase_error_ro","training.seance.purchase_errors","model_training_seance_purchase_errors","training.group_training",1,0,0,0
-"access_res_partner_function_training_ro","res.partner.function","base_contact_training.model_res_partner_function","training.group_training",1,0,0,0
-"access_res_partner_function_training_sub_man_ro","res.partner.function","base_contact_training.model_res_partner_function","training.group_subscription_manager",1,0,0,0
"access_training_content_review_user","training.content.review","training.model_training_content_review","training.group_content_review_user",1,0,0,0
"access_training_content_review_line_user","training.content.review.line","training.model_training_content_review_line","training.group_content_review_user",1,0,0,0
"access_training_content_review_writer_user","training.content.review.writer","training.model_training_content_review_writer","training.group_content_review_user",1,0,0,0
=== modified file 'training/training.py'
--- training/training.py 2011-03-22 11:24:19 +0000
+++ training/training.py 2011-03-22 11:57:24 +0000
@@ -2174,9 +2174,16 @@
'res.partner.job': (_store_get_jobs, ['contact_id'], 13),
}
),
+<<<<<<< TREE
'function_id': fields.related('subscription_line_id', 'job_id', 'function_id', type='many2one', relation='res.partner.function',
string='Function', select=2, readonly=True),
'partner_id' : fields.related('subscription_line_id', 'partner_id', type='many2one', relation='res.partner',
+=======
+ 'function': fields.related('subscription_line_id', 'job_id', 'function', type='char', string='Function', readonly=True),
+
+ 'partner_id' : fields.related('subscription_line_id', 'partner_id',
+ type='many2one', relation='res.partner',
+>>>>>>> MERGE-SOURCE
string='Partner', select=2, readonly=True),
'date' : fields.related('seance_id', 'date', type='datetime', string='Date', select=1, readonly=True, store=True),
'purchase_ids': fields.many2many('purchase.order.line',
@@ -2445,9 +2452,23 @@
('done', 'Done')],
'State', required=True, readonly=True, help="The status of the Seance"),
'contact_ids' : fields.one2many('training.participation.stakeholder', 'seance_id', 'Lecturers', readonly=True),
+<<<<<<< TREE
'contact_names' : fields.function(_contact_names_compute, method=True, type='char', size=256, string='Lecturers'),
'course_id' : fields.many2one('training.course', 'Course', domain="[('state_course', '=', 'validated')]"),
'state_course' : fields.related('course_id', 'state_course', string="Course's State", type='selection',
+=======
+ 'contact_names' : fields.function(_contact_names_compute, method=True,
+ type='char', size=256,
+ string='Lecturers'),
+ 'course_id' : fields.many2one('training.course',
+ 'Course',
+ select=1,
+ domain="[('state_course', '=', 'validated')]",
+ required=True,),
+ 'state_course' : fields.related('course_id', 'state_course',
+ string="Course's State",
+ type='selection',
+>>>>>>> MERGE-SOURCE
selection=[('draft', 'Draft'),
('pending', 'Pending'),
('deprecated', 'Deprecated'),
@@ -2786,7 +2807,7 @@
seance = self.browse(cr, uid, ids[0], context)
if not seance.course_id.course_type_id:
raise osv.except_osv(_('Warning'),
- _("You have to selcet course type in the seance of course"))
+ _("You have to select course type in the seance of course"))
return seance.course_id.course_type_id.product_id
training_seance()
@@ -4379,7 +4400,7 @@
_auto = False
_columns = {
- 'function_id' : fields.many2one('res.partner.function', 'Function', readonly=True),
+ 'function' : fields.char('Function', size=64, readonly=True),
'course_id' : fields.many2one('training.course', 'Course', readonly=True),
'contact_id' : fields.many2one('res.partner.contact', 'Contact', readonly=True),
}
@@ -4387,8 +4408,8 @@
def init(self, cr):
tools.drop_view_if_exists(cr, 'training_contact_course')
cr.execute("CREATE OR REPLACE VIEW training_contact_course as ( "
- "SELECT job.id, function_id, rel.course_id, rel.job_id, job.contact_id "
- "FROM training_course_job_rel rel, (SELECT id, contact_id, function_id FROM res_partner_job) AS job "
+ "SELECT job.id, job.function, rel.course_id, rel.job_id, job.contact_id "
+ "FROM training_course_job_rel rel, (SELECT id, contact_id, function FROM res_partner_job) AS job "
"WHERE job.id = rel.job_id )")
training_contact_course()
=== modified file 'training/training_view.xml'
--- training/training_view.xml 2011-03-21 10:41:55 +0000
+++ training/training_view.xml 2011-03-22 11:57:24 +0000
@@ -249,7 +249,7 @@
<tree string="Lecturers">
<field name="contact_id" />
<field name="name" />
- <field name="function_id" />
+ <field name="function" />
<field name="team_id"/>
</tree>
</field>
@@ -1923,7 +1923,7 @@
<field name="duration" />
<field name="contact_firstname" />
<field name="contact_lastname" />
- <field name="function_id"/>
+ <field name="function"/>
<field name="partner_id" groups="base.group_user" />
<field name="present"/>
<field name="group_id" invisible="1"/>
@@ -1946,7 +1946,7 @@
<field name="partner_id" />
<field name="seance_id" />
<field name="course_id" />
- <field name="function_id"/>
+ <field name="function"/>
<field name="subscription_line_id" />
<newline/>
<group expand="0" string="Group By...">
Follow ups