[MERGE] Merged with lp:addons
bzr revid: ron@tinyerp.com-20111021054113-qitxy96fyx36fi8m
This commit is contained in:
commit
ae326f6909
|
@ -1714,35 +1714,37 @@
|
|||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Payment Term">
|
||||
<field name="name" select="1"/>
|
||||
<field name="sequence"/>
|
||||
<group colspan="2" col="4">
|
||||
<separator string="Amount Computation" colspan="4"/>
|
||||
<field name="value" colspan="4"/>
|
||||
<field name="value_amount" colspan="4" attrs="{'readonly':[('value','=','balance')]}"/>
|
||||
<group>
|
||||
<group colspan="2" col="4">
|
||||
<field name="name" select="1"/>
|
||||
<separator string="Amount Computation" colspan="4"/>
|
||||
<field name="value" colspan="4"/>
|
||||
<field name="value_amount" colspan="4" attrs="{'readonly':[('value','=','balance')]}"/>
|
||||
</group>
|
||||
<group colspan="2" col="4">
|
||||
<field name="sequence"/>
|
||||
<separator string="Due Date Computation" colspan="4"/>
|
||||
<field name="days" colspan="4"/>
|
||||
<field name="days2" colspan="4"/>
|
||||
</group>
|
||||
</group>
|
||||
<group colspan="2" col="4">
|
||||
<separator string="Due date Computation" colspan="4"/>
|
||||
<field name="days" colspan="4"/>
|
||||
<field name="days2" colspan="4"/>
|
||||
</group>
|
||||
<label string=""/>
|
||||
<newline/>
|
||||
<label string="Example: at 14 net days 2 percents, remaining amount at 30 days end of month." colspan="4"/>
|
||||
<separator string="Example" colspan="4"/>
|
||||
<label string="At 14 net days 2 percent, remaining amount at 30 days end of month." colspan="4"/>
|
||||
<group colspan="2" col="2">
|
||||
<label string="Line 1:" colspan="2"/>
|
||||
<label string=" valuation: percent"/>
|
||||
<label string=" number of days: 14"/>
|
||||
<label string=" value amount: 0.02"/>
|
||||
<label string=" day of the month: 0"/>
|
||||
<label string=" Valuation: Percent"/>
|
||||
<label string=" Number of Days: 14"/>
|
||||
<label string=" Value amount: 0.02"/>
|
||||
<label string=" Day of the Month: 0"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group colspan="2" col="2">
|
||||
<label string="Line 2:" colspan="2"/>
|
||||
<label string=" valuation: balance"/>
|
||||
<label string=" number of days: 30"/>
|
||||
<label string=" value amount: n.a"/>
|
||||
<label string=" day of the month= -1"/>
|
||||
<label string=" Valuation: Balance"/>
|
||||
<label string=" Number of Days: 30"/>
|
||||
<label string=" Value amount: n.a"/>
|
||||
<label string=" Day of the Month= -1"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
@ -1769,7 +1771,7 @@
|
|||
<separator colspan="4" string="Information"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="active" select="1"/>
|
||||
<separator colspan="4" string="Description on invoices"/>
|
||||
<separator colspan="4" string="Description On Invoices"/>
|
||||
<field colspan="4" name="note" nolabel="1"/>
|
||||
<separator colspan="4" string="Computation"/>
|
||||
<field colspan="4" name="line_ids" nolabel="1"/>
|
||||
|
|
|
@ -55,6 +55,18 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="account_invoice_supplier_form_layout">
|
||||
<field name="name">account.invoice.supplier.form.layout</field>
|
||||
<field name="model">account.invoice</field>
|
||||
<field name="inherit_id" ref="account.invoice_supplier_form"/>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='invoice_line']/tree/*[1]" position="before">
|
||||
<field name="state" invisible="1"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- notification message views -->
|
||||
<record model="ir.ui.view" id="view_notify_message_search">
|
||||
<field name="name">notify.message.search</field>
|
||||
|
|
|
@ -995,15 +995,24 @@ class calendar_event(osv.osv):
|
|||
"""
|
||||
|
||||
result = {}
|
||||
if not isinstance(ids, list):
|
||||
ids = [ids]
|
||||
|
||||
for datas in self.read(cr, uid, ids, ['id','byday','recurrency', 'month_list','end_date', 'rrule_type', 'select1', 'interval', 'count', 'end_type', 'mo', 'tu', 'we', 'th', 'fr', 'sa', 'su', 'exrule', 'day', 'week_list' ], context=context):
|
||||
event = datas['id']
|
||||
if datas.get('interval', 0) < 0:
|
||||
raise osv.except_osv(_('Warning!'), _('Interval cannot be negative'))
|
||||
if datas.get('count', 0) < 0:
|
||||
raise osv.except_osv(_('Warning!'), _('Count cannot be negative'))
|
||||
result[event] = self.compute_rule_string(datas)
|
||||
if datas['recurrency']:
|
||||
result[event] = self.compute_rule_string(datas)
|
||||
else:
|
||||
result[event] = ""
|
||||
return result
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_columns = {
|
||||
'id': fields.integer('ID', readonly=True),
|
||||
'sequence': fields.integer('Sequence'),
|
||||
|
@ -1072,6 +1081,7 @@ rule or repeating pattern of time to exclude from the recurring rule."),
|
|||
'recurrency': fields.boolean('Recurrent', help="Recurrent Meeting"),
|
||||
'edit_all': fields.boolean('Edit All', help="Edit all Occurrences of recurrent Meeting."),
|
||||
}
|
||||
|
||||
def default_organizer(self, cr, uid, context=None):
|
||||
user_pool = self.pool.get('res.users')
|
||||
user = user_pool.browse(cr, uid, uid, context=context)
|
||||
|
@ -1177,7 +1187,6 @@ rule or repeating pattern of time to exclude from the recurring rule."),
|
|||
@param self: the object pointer
|
||||
@param datas: dictionary of freq and interval value.
|
||||
"""
|
||||
|
||||
def get_week_string(freq, datas):
|
||||
weekdays = ['mo', 'tu', 'we', 'th', 'fr', 'sa', 'su']
|
||||
if freq == 'weekly':
|
||||
|
@ -1211,9 +1220,88 @@ rule or repeating pattern of time to exclude from the recurring rule."),
|
|||
interval_srting = datas.get('interval') and (';INTERVAL=' + str(datas.get('interval'))) or ''
|
||||
|
||||
return 'FREQ=' + freq.upper() + get_week_string(freq, datas) + interval_srting + get_end_date(datas) + get_month_string(freq, datas)
|
||||
|
||||
def _get_empty_rrule_data(self):
|
||||
return {
|
||||
'byday' : False,
|
||||
'recurrency' : False,
|
||||
'end_date' : False,
|
||||
'rrule_type' : False,
|
||||
'select1' : False,
|
||||
'interval' : 0,
|
||||
'count' : False,
|
||||
'end_type' : False,
|
||||
'mo' : False,
|
||||
'tu' : False,
|
||||
'we' : False,
|
||||
'th' : False,
|
||||
'fr' : False,
|
||||
'sa' : False,
|
||||
'su' : False,
|
||||
'exrule' : False,
|
||||
'day' : False,
|
||||
'week_list' : False
|
||||
}
|
||||
|
||||
def _write_rrule(self, cr, uid, ids, field_value, rule_date=False, context=None):
|
||||
data = self._get_empty_rrule_data()
|
||||
|
||||
if field_value:
|
||||
data['recurrency'] = True
|
||||
for event in self.browse(cr, uid, ids, context=context):
|
||||
rdate = rule_date or event.date
|
||||
update_data = self._parse_rrule(field_value, dict(data), rdate)
|
||||
data.update(update_data)
|
||||
#parse_rrule
|
||||
self.write(cr, uid, event.id, data, context=context)
|
||||
|
||||
|
||||
def _parse_rrule(self, rule, data, date_start):
|
||||
day_list = ['mo', 'tu', 'we', 'th', 'fr', 'sa', 'su']
|
||||
rrule_type = ['yearly', 'monthly', 'weekly', 'daily']
|
||||
r = rrule.rrulestr(rule, dtstart=datetime.strptime(date_start, "%Y-%m-%d %H:%M:%S"))
|
||||
|
||||
if r._freq > 0 and r._freq < 4:
|
||||
data['rrule_type'] = rrule_type[r._freq]
|
||||
|
||||
data['count'] = r._count
|
||||
data['interval'] = r._interval
|
||||
data['end_date'] = r._until and r._until.strftime("%Y-%m-%d %H:%M:%S")
|
||||
#repeat weekly
|
||||
if r._byweekday:
|
||||
for i in xrange(0,7):
|
||||
if i in r._byweekday:
|
||||
data[day_list[i]] = True
|
||||
data['rrule_type'] = 'weekly'
|
||||
#repeat monthly bynweekday ((weekday, weeknumber), )
|
||||
if r._bynweekday:
|
||||
data['week_list'] = day_list[r._bynweekday[0][0]].upper()
|
||||
data['byday'] = r._bynweekday[0][1]
|
||||
data['select1'] = 'day'
|
||||
data['rrule_type'] = 'monthly'
|
||||
|
||||
if r._bymonthday:
|
||||
data['day'] = r._bymonthday[0]
|
||||
data['select1'] = 'date'
|
||||
data['rrule_type'] = 'monthly'
|
||||
|
||||
#yearly but for openerp it's monthly, take same information as monthly but interval is 12 times
|
||||
if r._bymonth:
|
||||
data['interval'] = data['interval'] * 12
|
||||
|
||||
#FIXEME handle forever case
|
||||
#end of recurrence
|
||||
#in case of repeat for ever that we do not support right now
|
||||
if not (data.get('count') or data.get('end_date')):
|
||||
data['count'] = 100
|
||||
if data.get('count'):
|
||||
data['end_type'] = 'count'
|
||||
else:
|
||||
data['end_type'] = 'end_date'
|
||||
return data
|
||||
|
||||
def remove_virtual_id(self, ids):
|
||||
if isinstance(ids, (str, int)):
|
||||
if isinstance(ids, (str, int, long)):
|
||||
return base_calendar_id2real_id(ids)
|
||||
|
||||
if isinstance(ids, (list, tuple)):
|
||||
|
@ -1243,7 +1331,6 @@ rule or repeating pattern of time to exclude from the recurring rule."),
|
|||
if until_date:
|
||||
continue
|
||||
until_date = arg[2]
|
||||
|
||||
res = super(calendar_event, self).search(cr, uid, args_without_date, \
|
||||
0, 0, order, context, count=False)
|
||||
res = self.get_recurrent_ids(cr, uid, res, start_date, until_date, limit, context=context)
|
||||
|
@ -1289,6 +1376,9 @@ rule or repeating pattern of time to exclude from the recurring rule."),
|
|||
select = [ids]
|
||||
else:
|
||||
select = ids
|
||||
|
||||
|
||||
|
||||
new_ids = []
|
||||
res = False
|
||||
for event_id in select:
|
||||
|
@ -1339,6 +1429,13 @@ rule or repeating pattern of time to exclude from the recurring rule."),
|
|||
context=context)
|
||||
vals.update(updated_vals.get('value', {}))
|
||||
if new_ids:
|
||||
if 'rrule' in vals.keys():
|
||||
if 'date' in vals.keys():
|
||||
date_to_write = vals['date']
|
||||
else:
|
||||
date_to_write = False
|
||||
self._write_rrule(cr, uid, new_ids, vals['rrule'], date_to_write, context)
|
||||
|
||||
res = super(calendar_event, self).write(cr, uid, new_ids, vals, context=context)
|
||||
|
||||
if ('alarm_id' in vals or 'base_calendar_alarm_id' in vals)\
|
||||
|
@ -1465,6 +1562,11 @@ rule or repeating pattern of time to exclude from the recurring rule."),
|
|||
|
||||
if vals.get('vtimezone', '') and vals.get('vtimezone', '').startswith('/freeassociation.sourceforge.net/tzfile/'):
|
||||
vals['vtimezone'] = vals['vtimezone'][40:]
|
||||
|
||||
if 'date' in vals and 'rrule' in vals and vals['rrule']:
|
||||
update_datas = self._parse_rrule(vals['rrule'], self._get_empty_rrule_data(), vals['date'])
|
||||
update_datas['recurrency'] = True
|
||||
vals.update(update_datas)
|
||||
|
||||
updated_vals = self.onchange_dates(cr, uid, [],
|
||||
vals.get('date', False),
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
Now I will set recurrence for this event to occur monday and friday of week
|
||||
-
|
||||
!python {model: calendar.event}: |
|
||||
data = {'fr': 1, 'mo': 1, 'interval': 1, 'rrule_type': 'weekly', 'end_type': 'end_date', 'end_date': '2011-05-31 00:00:00'}
|
||||
data = {'fr': 1, 'mo': 1, 'interval': 1, 'rrule_type': 'weekly', 'end_type': 'end_date', 'end_date': '2011-05-31 00:00:00', 'recurrency' : True}
|
||||
self.write(cr, uid, [ref("calendar_event_technicalpresentation0")], data)
|
||||
- |
|
||||
In order to check that recurrent events are views successfully in calendar view,
|
||||
|
|
|
@ -143,6 +143,17 @@ class res_partner_address(osv.osv):
|
|||
res.append((r['id'], addr.strip() or '/'))
|
||||
return res
|
||||
|
||||
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
|
||||
if not args:
|
||||
args=[]
|
||||
ids = self.search(cr, user, [('name',operator,name)] + args, limit=limit, context=context)
|
||||
jobs = self.pool.get('res.partner.job')
|
||||
if name:
|
||||
job_ids = jobs.search(cr, user, [('contact_id', operator, name)] + args, limit=limit, context=context)
|
||||
for job in jobs.browse(cr, user, job_ids):
|
||||
ids += [job.address_id.id]
|
||||
return self.name_get(cr, user, ids, context)
|
||||
|
||||
_name = 'res.partner.address'
|
||||
_inherit = 'res.partner.address'
|
||||
_description ='Partner Address'
|
||||
|
|
|
@ -324,7 +324,6 @@ class node_calendar(nodes.node_class):
|
|||
uid = self.context.uid
|
||||
|
||||
res = self.set_data(cr, data)
|
||||
|
||||
if res and len(res):
|
||||
# We arbitrarily construct only the first node of the data
|
||||
# that have been imported. ICS may have had more elements,
|
||||
|
@ -332,6 +331,7 @@ class node_calendar(nodes.node_class):
|
|||
assert isinstance(res[0], (int, long))
|
||||
fnodes = fil_obj.get_calendar_objects(cr, uid, [self.calendar_id], self,
|
||||
domain=[('id','=',res[0])], context=ctx)
|
||||
|
||||
if self.context.get('DAV-client','') in ('iPhone', 'iCalendar',):
|
||||
# For those buggy clients, register the alias
|
||||
bca_obj = fil_obj.pool.get('basic.calendar.alias')
|
||||
|
|
|
@ -121,10 +121,10 @@ def str2mailto(emailstr, multi=False):
|
|||
for mas in mailz:
|
||||
m = mege.match(mas.strip())
|
||||
if not m:
|
||||
# one of the rare non-matching strings is "sad" :(
|
||||
# retz.append({ 'name': mas.strip() })
|
||||
# continue
|
||||
raise ValueError("Invalid email address %r" % mas)
|
||||
#one of the rare non-matching strings is "sad" :(
|
||||
retz.append({ 'name': mas.strip() })
|
||||
continue
|
||||
# raise ValueError("Invalid email address %r" % mas)
|
||||
rd = { 'name': m.group(1).strip(),
|
||||
'email': m.group(5), }
|
||||
if m.group(2):
|
||||
|
@ -189,6 +189,9 @@ def map_data(cr, uid, obj, context=None):
|
|||
field = obj.ical_get(map_dict, 'field')
|
||||
field_type = obj.ical_get(map_dict, 'type')
|
||||
if field:
|
||||
#ignore write date, this field is resered for the orm
|
||||
if field == 'write_date':
|
||||
continue
|
||||
if field_type == 'selection':
|
||||
if not map_val:
|
||||
continue
|
||||
|
@ -299,7 +302,6 @@ class CalDAV(object):
|
|||
att_data = []
|
||||
exdates = []
|
||||
_server_tzinfo = pytz.timezone(tools.get_server_timezone())
|
||||
|
||||
for cal_data in child.getChildren():
|
||||
if cal_data.name.lower() == 'organizer':
|
||||
dmail = { 'name': cal_data.params.get('CN', ['',])[0],
|
||||
|
@ -552,7 +554,7 @@ class CalDAV(object):
|
|||
@param data_id: Get Data’s ID or False
|
||||
@param context: A standard dictionary for contextual values
|
||||
"""
|
||||
|
||||
|
||||
ical_data = content
|
||||
self.__attribute__ = get_attribute_mapping(cr, uid, self._calname, context)
|
||||
parsedCal = vobject.readOne(ical_data)
|
||||
|
|
|
@ -24,6 +24,7 @@ from tools import config
|
|||
import base64
|
||||
import addons
|
||||
from tools.translate import _
|
||||
import tools
|
||||
|
||||
class caldav_browse(osv.osv_memory):
|
||||
|
||||
|
@ -176,16 +177,6 @@ configuration
|
|||
pref_ids = pref_obj.browse(cr, uid ,context.get('rec_id',False), context=context)
|
||||
res = {}
|
||||
host = context.get('host')
|
||||
port = ''
|
||||
prefix = 'http://'
|
||||
if not config.get('xmlrpc'):
|
||||
if not config.get('netrpc'):
|
||||
prefix = 'https://'
|
||||
port = config.get('xmlrpcs_port', 8071)
|
||||
else:
|
||||
port = config.get('netrpc_port',8070)
|
||||
else:
|
||||
port = config.get('xmlrpc_port',8069)
|
||||
if not config.get_misc('webdav','enable',True):
|
||||
raise Exception("WebDAV is disabled, cannot continue")
|
||||
user_pool = self.pool.get('res.users')
|
||||
|
@ -195,16 +186,16 @@ configuration
|
|||
if pref_ids:
|
||||
pref_ids = pref_ids[0]
|
||||
if pref_ids.device == 'iphone':
|
||||
url = host + ':' + str(port) + '/'+ pref_ids.service + '/' + cr.dbname + '/'+'calendars/'
|
||||
url = host + '/'+ pref_ids.service + '/' + cr.dbname + '/'+'calendars/'
|
||||
else :
|
||||
url = host + ':' + str(port) + '/'+ pref_ids.service + '/' + cr.dbname + '/'+'calendars/'+ 'users/'+ current_user.login + '/'+ pref_ids.collection.name+ '/'+ pref_ids.calendar.name
|
||||
url = host + '/'+ pref_ids.service + '/' + cr.dbname + '/'+'calendars/'+ 'users/'+ current_user.login + '/'+ pref_ids.collection.name+ '/'+ pref_ids.calendar.name
|
||||
|
||||
res['description'] = self.__doc.get(pref_ids.device , self.__doc['other'])
|
||||
file = open(addons.get_module_resource('caldav','doc', 'caldav_doc.pdf'),'rb')
|
||||
res['caldav_doc_file'] = base64.encodestring(file.read())
|
||||
|
||||
#res['doc_link'] = 'http://doc.openerp.com/'
|
||||
res['url'] = prefix+url
|
||||
res['url'] = url
|
||||
return res
|
||||
|
||||
def browse_caldav(self, cr, uid, ids, context):
|
||||
|
@ -239,12 +230,8 @@ class user_preference(osv.osv_memory):
|
|||
return ids[0]
|
||||
|
||||
def _get_default_host(self, cr, uid, context):
|
||||
ids=self.search(cr,uid,[])
|
||||
host_name = ''
|
||||
if ids:
|
||||
ids = len(ids)> 1 and len(ids)-1 or ids[0] # Use len(ids)-1 for taking the value of last id
|
||||
host_name = self.browse(cr, uid,[ids],context=context)[0].host_name
|
||||
return host_name
|
||||
|
||||
return self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url', default='http://localhost:8069', context=context)
|
||||
|
||||
_defaults={
|
||||
'service': 'webdav',
|
||||
|
|
|
@ -9,4 +9,4 @@
|
|||
assert meeting_rec.state == 'open', "Meeting is not in confirm state"
|
||||
self.case_close(cr, uid, [ref('crm_case_initialdiscussion0')])
|
||||
meeting_rec_close = self.browse(cr, uid, ref("crm_case_initialdiscussion0"))
|
||||
assert meeting_rec_close.state == 'done', "Meeting is not in done state"
|
||||
assert meeting_rec_close.state == 'done', "Meeting is not in done state"
|
||||
|
|
|
@ -39,7 +39,7 @@ It also has been merged with the earlier CRM & SRM segmentation tool because the
|
|||
'website': 'http://www.openerp.com',
|
||||
'depends': ['base', 'crm'],
|
||||
'init_xml': [],
|
||||
'update_xml': ['security/ir.model.access.csv', 'wizard/open_questionnaire_view.xml', 'crm_profiling_view.xml'],
|
||||
'update_xml': ['security/ir.model.access.csv', 'crm_profiling_view.xml'],
|
||||
'demo_xml': ['crm_profiling_demo.xml'],
|
||||
'test': [#'test/process/profiling.yml', #TODO:It's not debuging because problem to write data for open.questionnaire from partner section.
|
||||
'test/process/segmentation.yml',],
|
||||
|
|
|
@ -159,19 +159,19 @@ class questionnaire(osv.osv):
|
|||
_name="crm_profiling.questionnaire"
|
||||
_description= "Questionnaire"
|
||||
|
||||
def build_form(self, cr, uid, questionnaire_id, context=None):
|
||||
def build_form(self, cr, uid, data, context=None):
|
||||
"""
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param data: Get Data
|
||||
@param context: A standard dictionary for contextual values """
|
||||
|
||||
|
||||
query = """
|
||||
select name, id
|
||||
from crm_profiling_question
|
||||
where id in ( select question from profile_questionnaire_quest_rel where questionnaire = %s)"""
|
||||
res = cr.execute(query, (questionnaire_id,))
|
||||
res = cr.execute(query, (data['form']['questionnaire_name'],))
|
||||
result = cr.fetchall()
|
||||
quest_fields={}
|
||||
quest_form='''<?xml version="1.0"?>
|
||||
|
@ -180,6 +180,7 @@ class questionnaire(osv.osv):
|
|||
quest_form = quest_form + '<field name="quest_form%d"/><newline/>' % (oid,)
|
||||
quest_fields['quest_form%d' % (oid,)] = {'string': name, 'type': 'many2one', \
|
||||
'relation': 'crm_profiling.answer', 'domain': [('question_id','=',oid)] }
|
||||
quest_form = quest_form + '''</form>'''
|
||||
return quest_form, quest_fields
|
||||
|
||||
_columns = {
|
||||
|
@ -218,16 +219,16 @@ class partner(osv.osv):
|
|||
@param context: A standard dictionary for contextual values """
|
||||
|
||||
temp = []
|
||||
for x in context.get('fields'):
|
||||
if x.startswith("quest_form") and data[x] != 0 :
|
||||
if data[x] and data[x][0]:
|
||||
temp.append(data[x][0])
|
||||
partner_id = context.get('active_id')
|
||||
for x in data['form']:
|
||||
if x.startswith("quest_form") and data['form'][x] != 0 :
|
||||
temp.append(data['form'][x])
|
||||
|
||||
query = "select answer from partner_question_rel where partner=%s"
|
||||
cr.execute(query, (partner_id,))
|
||||
cr.execute(query, (data['id'],))
|
||||
for x in cr.fetchall():
|
||||
temp.append(x[0])
|
||||
self.write(cr, uid, [partner_id], {'answers_ids':[[6, 0, temp]]}, context=context)
|
||||
|
||||
self.write(cr, uid, [data['id']], {'answers_ids':[[6, 0, temp]]}, context=context)
|
||||
return {}
|
||||
|
||||
|
||||
|
|
|
@ -2,6 +2,13 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
<wizard
|
||||
string="Using a questionnaire"
|
||||
model="crm_profiling.questionnaire"
|
||||
name="open_questionnaire"
|
||||
menu="False"
|
||||
id="wizard_open_questionnaire"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="open_questionnaires">
|
||||
<field name="name">Questionnaires</field>
|
||||
<field name="res_model">crm_profiling.questionnaire</field>
|
||||
|
@ -133,7 +140,7 @@
|
|||
<notebook position="inside">
|
||||
<page string="Profiling">
|
||||
<button string="Use a questionnaire"
|
||||
name="%(action_open_questionnaire)d" type="action" colspan="1"
|
||||
name="%(wizard_open_questionnaire)d" type="action" colspan="1"
|
||||
icon="gtk-justify-fill" />
|
||||
<newline/>
|
||||
<field name="answers_ids" colspan="4" nolabel="1"/>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
</data>
|
||||
</openerp>
|
|
@ -18,72 +18,50 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
import pooler
|
||||
import wizard
|
||||
from tools import UpdateableStr, UpdateableDict
|
||||
|
||||
from osv import osv, fields
|
||||
from tools.translate import _
|
||||
_QUEST_FORM = UpdateableStr()
|
||||
_QUEST_FIELDS=UpdateableDict()
|
||||
|
||||
class open_questionnaire(osv.osv_memory):
|
||||
_name = 'open.questionnaire'
|
||||
_columns = {
|
||||
'questionnaire_id': fields.many2one('crm_profiling.questionnaire', 'Questionnaire name', required=True),
|
||||
class open_questionnaire(wizard.interface):
|
||||
|
||||
def _questionnaire_compute(self, cr, uid, data, context):
|
||||
pooler.get_pool(cr.dbname).get(data['model'])._questionnaire_compute(cr, uid, data, context)
|
||||
return {}
|
||||
|
||||
|
||||
def build_form(self, cr, uid, data, context):
|
||||
quest_form, quest_fields = pooler.get_pool(cr.dbname).get('crm_profiling.questionnaire').build_form(cr, uid, data, context)
|
||||
_QUEST_FORM. __init__(quest_form)
|
||||
_QUEST_FIELDS.__init__(quest_fields)
|
||||
return{}
|
||||
|
||||
_questionnaire_choice_arch = '''<?xml version="1.0"?>
|
||||
<form string="Questionnaire">
|
||||
<field name="questionnaire_name"/>
|
||||
</form>'''
|
||||
|
||||
_questionnaire_choice_fields = {
|
||||
'questionnaire_name': {'string': 'Questionnaire name', 'type': 'many2one', 'relation': 'crm_profiling.questionnaire', 'required': True },
|
||||
}
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
|
||||
res = super(open_questionnaire, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
|
||||
if context.has_key('form') and context.has_key('fields'):
|
||||
field = {}
|
||||
form = context.get('form')
|
||||
form += """
|
||||
<newline/>
|
||||
<separator string="" colspan="4"/>
|
||||
<group col="4" colspan="4">
|
||||
<group col="2" colspan="2"/>
|
||||
<button special="cancel" icon="gtk-cancel" string="Cancel"/>
|
||||
<button name="questionnaire_compute" string="Save Data" icon="terp-stock_format-scientific" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
"""
|
||||
res['fields'] = context.get('fields')
|
||||
for key, value in res['fields'].items():
|
||||
field[key] = fields.many2one('crm_profiling.answer', value['string'])
|
||||
self._columns.update(field)
|
||||
res['arch'] = form
|
||||
return res
|
||||
|
||||
|
||||
def questionnaire_compute(self, cr, uid, ids, context=None):
|
||||
""" Adds selected answers in partner form """
|
||||
model = context.get('active_model')
|
||||
if model == 'res.partner':
|
||||
data = self.read(cr, uid, ids, context.get('fields').keys(), context=context)[0]
|
||||
self.pool.get(model)._questionnaire_compute(cr, uid, data, context=context)
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
|
||||
|
||||
def build_form(self, cr, uid, ids, context=None):
|
||||
""" Dynamically generates form according to selected questionnaire """
|
||||
models_data = self.pool.get('ir.model.data')
|
||||
questionnaire_id = self.browse(cr, uid, ids, context=context)[0].questionnaire_id.id
|
||||
quest_form, quest_fields = self.pool.get('crm_profiling.questionnaire').build_form(cr, uid, questionnaire_id, context=context)
|
||||
context.update({
|
||||
'form': quest_form,
|
||||
'fields': quest_fields
|
||||
})
|
||||
|
||||
result = models_data._get_id(cr, uid, 'crm_profiling', 'view_open_questionnaire_form')
|
||||
res_id = models_data.browse(cr, uid, result, context=context).res_id
|
||||
|
||||
return {
|
||||
'name': _('Questionnaire'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'open.questionnaire',
|
||||
'type': 'ir.actions.act_window',
|
||||
'views': [(res_id,'form')],
|
||||
'target': 'new',
|
||||
'context': context
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type': 'form', 'arch': _questionnaire_choice_arch, 'fields': _questionnaire_choice_fields, 'state':[('end', 'Cancel','gtk-cancel'), ('open', 'Open Questionnaire','terp-camera_test')]}
|
||||
},
|
||||
'open': {
|
||||
'actions': [build_form],
|
||||
'result': {'type': 'form', 'arch':_QUEST_FORM, 'fields': _QUEST_FIELDS, 'state':[('end', 'Cancel','gtk-cancel'), ('compute', 'Save Data','terp-stock_format-scientific')]}
|
||||
},
|
||||
'compute': {
|
||||
'actions': [],
|
||||
'result': {'type': 'action', 'action': _questionnaire_compute, 'state':'end'}
|
||||
}
|
||||
}
|
||||
|
||||
open_questionnaire()
|
||||
open_questionnaire('open_questionnaire')
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
<?xml version="1.0" ?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_open_questionnaire_form" model="ir.ui.view">
|
||||
<field name="name">Open Questionnaires</field>
|
||||
<field name="model">open.questionnaire</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Questionnaires">
|
||||
<field name="questionnaire_id"/>
|
||||
<newline/>
|
||||
<separator string="" colspan="4"/>
|
||||
<group col="4" colspan="4">
|
||||
<group col="2" colspan="2"/>
|
||||
<button special="cancel" icon="gtk-cancel" string="Cancel"/>
|
||||
<button name="build_form" string="Open Questionnaire" icon="terp-camera_test" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_open_questionnaire">
|
||||
<field name="name">Open Questionnaire</field>
|
||||
<field name="res_model">open.questionnaire</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Questionnaire form view -->
|
||||
<!--<act_window
|
||||
context="{}"
|
||||
id="act_open_questionnaire"
|
||||
name="Using a Questionnaire"
|
||||
res_model="open.questionnaire"
|
||||
src_model="crm_profiling.questionnaire"
|
||||
view_id="view_open_questionnaire_form"
|
||||
target="new"
|
||||
view_mode="form"/>-->
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -0,0 +1,137 @@
|
|||
# Slovenian translation for openobject-addons
|
||||
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2011-01-11 11:15+0000\n"
|
||||
"PO-Revision-Date: 2011-10-19 07:34+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Slovenian <sl@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2011-10-21 04:55+0000\n"
|
||||
"X-Generator: Launchpad (build 14165)\n"
|
||||
|
||||
#. module: document_ftp
|
||||
#: model:ir.model,name:document_ftp.model_document_ftp_configuration
|
||||
msgid "Auto Directory Configuration"
|
||||
msgstr "Avto konfiguracija map"
|
||||
|
||||
#. module: document_ftp
|
||||
#: view:document.ftp.configuration:0
|
||||
msgid ""
|
||||
"Indicate the network address on which your OpenERP server should be "
|
||||
"reachable for end-users. This depends on your network topology and "
|
||||
"configuration, and will only affect the links displayed to the users. The "
|
||||
"format is HOST:PORT and the default host (localhost) is only suitable for "
|
||||
"access from the server machine itself.."
|
||||
msgstr ""
|
||||
|
||||
#. module: document_ftp
|
||||
#: field:document.ftp.configuration,progress:0
|
||||
msgid "Configuration Progress"
|
||||
msgstr ""
|
||||
|
||||
#. module: document_ftp
|
||||
#: model:ir.actions.url,name:document_ftp.action_document_browse
|
||||
msgid "Browse Files"
|
||||
msgstr "Brskanje Datoteke"
|
||||
|
||||
#. module: document_ftp
|
||||
#: field:document.ftp.configuration,config_logo:0
|
||||
msgid "Image"
|
||||
msgstr "Slika"
|
||||
|
||||
#. module: document_ftp
|
||||
#: field:document.ftp.configuration,host:0
|
||||
msgid "Address"
|
||||
msgstr "Naslov"
|
||||
|
||||
#. module: document_ftp
|
||||
#: field:document.ftp.browse,url:0
|
||||
msgid "FTP Server"
|
||||
msgstr "Strežnik FTP"
|
||||
|
||||
#. module: document_ftp
|
||||
#: model:ir.actions.act_window,name:document_ftp.action_config_auto_directory
|
||||
msgid "FTP Server Configuration"
|
||||
msgstr "Konfiguracija FTP strežnika"
|
||||
|
||||
#. module: document_ftp
|
||||
#: model:ir.module.module,description:document_ftp.module_meta_information
|
||||
msgid ""
|
||||
"This is a support FTP Interface with document management system.\n"
|
||||
" With this module you would not only be able to access documents through "
|
||||
"OpenERP\n"
|
||||
" but you would also be able to connect with them through the file system "
|
||||
"using the\n"
|
||||
" FTP client.\n"
|
||||
msgstr ""
|
||||
|
||||
#. module: document_ftp
|
||||
#: view:document.ftp.browse:0
|
||||
msgid "_Browse"
|
||||
msgstr "_Prebrskaj"
|
||||
|
||||
#. module: document_ftp
|
||||
#: help:document.ftp.configuration,host:0
|
||||
msgid ""
|
||||
"Server address or IP and port to which users should connect to for DMS access"
|
||||
msgstr ""
|
||||
"Naslov strežnika ali IP in vrata, na katerega se bodo uporabniki povezali za "
|
||||
"DMS dostop"
|
||||
|
||||
#. module: document_ftp
|
||||
#: model:ir.ui.menu,name:document_ftp.menu_document_browse
|
||||
msgid "Shared Repository (FTP)"
|
||||
msgstr ""
|
||||
|
||||
#. module: document_ftp
|
||||
#: view:document.ftp.browse:0
|
||||
msgid "_Cancel"
|
||||
msgstr "_Prekliči"
|
||||
|
||||
#. module: document_ftp
|
||||
#: view:document.ftp.configuration:0
|
||||
msgid "Configure FTP Server"
|
||||
msgstr "Konfiguriraj FTP strežnik"
|
||||
|
||||
#. module: document_ftp
|
||||
#: model:ir.module.module,shortdesc:document_ftp.module_meta_information
|
||||
msgid "Integrated FTP Server with Document Management System"
|
||||
msgstr ""
|
||||
|
||||
#. module: document_ftp
|
||||
#: view:document.ftp.configuration:0
|
||||
msgid "title"
|
||||
msgstr "naslov"
|
||||
|
||||
#. module: document_ftp
|
||||
#: model:ir.model,name:document_ftp.model_document_ftp_browse
|
||||
msgid "Document FTP Browse"
|
||||
msgstr ""
|
||||
|
||||
#. module: document_ftp
|
||||
#: view:document.ftp.configuration:0
|
||||
msgid "Knowledge Application Configuration"
|
||||
msgstr ""
|
||||
|
||||
#. module: document_ftp
|
||||
#: model:ir.actions.act_window,name:document_ftp.action_ftp_browse
|
||||
msgid "Document Browse"
|
||||
msgstr ""
|
||||
|
||||
#. module: document_ftp
|
||||
#: view:document.ftp.browse:0
|
||||
msgid "Browse Document"
|
||||
msgstr ""
|
||||
|
||||
#. module: document_ftp
|
||||
#: view:document.ftp.configuration:0
|
||||
msgid "res_config_contents"
|
||||
msgstr "res_config_contents"
|
|
@ -55,7 +55,7 @@ class pos_payment_report_date(osv.osv_memory):
|
|||
_columns = {
|
||||
'date_start': fields.date('Start Date', required=True),
|
||||
'date_end': fields.date('End Date', required=True),
|
||||
'user_id': fields.many2many('res.users', 'res_user_sale', 'user_id', 'sale_id', 'Salesman')
|
||||
'user_id': fields.many2many('res.users', 'res_user_sale_date', 'user_id', 'sale_id', 'Salesman')
|
||||
}
|
||||
_defaults = {
|
||||
'date_start': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
|
|
|
@ -28,7 +28,7 @@ from project.project import task as base_project_task
|
|||
|
||||
class project_task(osv.osv):
|
||||
_name = "project.task"
|
||||
_inherit = ["calendar.todo", "project.task"]
|
||||
_inherit = ["project.task", "calendar.todo"]
|
||||
_columns = {
|
||||
# force inherit from project.project_task so that
|
||||
# calendar.todo.active is masked oute
|
||||
|
@ -42,11 +42,11 @@ class project_task(osv.osv):
|
|||
help='If the task is created the state is \'Draft\'.\n If the task is started, the state becomes \'In Progress\'.\n If review is needed the task is in \'Pending\' state.\
|
||||
\n If the task is over, the states is set to \'Done\'.'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'state': 'draft',
|
||||
}
|
||||
|
||||
|
||||
def open_task(self, cr, uid, ids, context=None):
|
||||
"""
|
||||
Open Task Form for Project Task.
|
||||
|
@ -109,6 +109,8 @@ class project_task(osv.osv):
|
|||
self.write(cr, uid, [exists], val)
|
||||
ids.append(exists)
|
||||
else:
|
||||
#set user_id with id, needed later
|
||||
val.update({'user_id' : uid})
|
||||
task_id = self.create(cr, uid, val)
|
||||
ids.append(task_id)
|
||||
return ids
|
||||
|
|
|
@ -65,9 +65,9 @@
|
|||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="progress" position="after">
|
||||
<field name="recurrency"/>
|
||||
<field name="edit_all" attrs="{'invisible':[('recurrency','=', False)]}"
|
||||
on_change="onchange_edit_all(rrule_type,edit_all)"/>
|
||||
<!-- Recurrency of task not well implemented for now, remove the option-->
|
||||
<field name="recurrency" invisible="1"/>
|
||||
<field name="edit_all" attrs="{'invisible':[('recurrency','=', False)]}"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -79,46 +79,57 @@
|
|||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<notebook colspan="4" position="inside">
|
||||
<page string="Recurrency Option" attrs="{'invisible':[('recurrency','=',False)]}">
|
||||
<group colspan="2" col="4" >
|
||||
<field name="rrule_type" string="Recurrency" colspan="1" attrs="{'readonly':[('recurrent_uid','!=',False)]}"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group col="4" colspan="6" name="rrule">
|
||||
<separator string="Recurrency Rule" colspan="8"/>
|
||||
<group col="6" colspan="4">
|
||||
<field name="interval" string="Repeat Times" attrs="{'readonly': [('end_date','!=',False)]}"/>
|
||||
<field name="count" attrs="{'readonly': [('end_date','!=',False)]}"/>
|
||||
<field name="end_date" attrs="{'invisible': [('readonly','!=',False)]}"/>
|
||||
<page string="Recurrency Option" attrs="{'invisible': [('recurrency','=',False)], 'readonly': ['|', ('recurrent_uid','!=',False), ('state','=','done')]}">
|
||||
<group col="4" colspan="4" name="rrule">
|
||||
<group col="4" colspan="4">
|
||||
<field name="rrule_type" string="Recurrency period" />
|
||||
<field name="interval" />
|
||||
|
||||
|
||||
<separator string="End of recurrency" colspan="4"/>
|
||||
<field name="end_type" />
|
||||
<label string=" " colspan="2" />
|
||||
<newline />
|
||||
<field name="count" attrs="{'invisible' : [('end_type', '!=', 'count')] }"/>
|
||||
<label string=" " colspan="2" />
|
||||
<newline />
|
||||
<field name="end_date" attrs="{'invisible' : [('end_type', '!=', 'end_date')], 'required': [('end_type', '=', 'end_date')]}"/>
|
||||
<newline />
|
||||
|
||||
|
||||
</group>
|
||||
<group col="14" colspan="4" name="Select weekdays"
|
||||
attrs="{'invisible' :[('rrule_type','not in', ['weekly','daily_working'])]}">
|
||||
<group col="8" colspan="4" name="Select weekdays" attrs="{'invisible' :[('rrule_type','not in', ['weekly'])]}">
|
||||
<separator string="Choose day where repeat the meeting" colspan="8"/>
|
||||
<field name="mo" colspan="1" />
|
||||
<field name="tu" colspan="1" />
|
||||
<field name="we" colspan="1" />
|
||||
<field name="th" colspan="1" />
|
||||
<newline/>
|
||||
<field name="fr" colspan="1" />
|
||||
<field name="sa" colspan="1" attrs="{'invisible': [('rrule_type','=','daily_working')]}"/>
|
||||
<field name="su" colspan="1" attrs="{'invisible': [('rrule_type','=','daily_working')]}"/>
|
||||
<field name="sa" colspan="1" />
|
||||
<field name="su" colspan="1" />
|
||||
<newline />
|
||||
</group>
|
||||
<group col="10" colspan="4" attrs="{'invisible': [('rrule_type','!=','monthly'), ('rrule_type','!=','yearly')]}">
|
||||
<group col="10" colspan="4"
|
||||
attrs="{'invisible' : [('rrule_type','!=','monthly')]}">
|
||||
<separator string="Choose day in the month where repeat the meeting" colspan="12"/>
|
||||
<group col="2" colspan="1">
|
||||
<field name="select1" />
|
||||
<field name="select1" />
|
||||
</group>
|
||||
<group col="2" colspan="1" attrs="{'invisible' : [('select1','=','day')]}">
|
||||
<field name="day" attrs="{'required' : [('select1','=','date')]}" />
|
||||
<group col="2" colspan="1">
|
||||
<field name="day"
|
||||
attrs="{'required' : [('select1','=','date'), ('rrule_type','=','monthly')],
|
||||
'invisible' : [('select1','=','day')]}" />
|
||||
</group>
|
||||
<group col="3" colspan="1" attrs="{'invisible' : [('select1','=','date')]}">
|
||||
<field name="byday" string="The" attrs="{'required' : [('select1','=','day')]}" />
|
||||
<field name="week_list" nolabel="1" attrs="{'required' : [('select1','=','day')]}" />
|
||||
</group>
|
||||
<group col="1" colspan="1" attrs="{'invisible' : [('rrule_type','!=','yearly')]}">
|
||||
<field name="month_list" string="of" colspan="1" attrs="{'required' : [('rrule_type','=','yearly')]}" />
|
||||
<group col="3" colspan="1">
|
||||
<field name="byday" string="The"
|
||||
attrs="{'required' : [('select1','=','day'), ('rrule_type','=','monthly')], 'invisible' : [('select1','=','date')]}" />
|
||||
<field name="week_list" nolabel="1"
|
||||
attrs="{'required' : [('select1','=','day'), ('rrule_type','=','monthly')], 'invisible' : [('select1','=','date')]}" />
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
</page>
|
||||
</notebook>
|
||||
</field>
|
||||
|
|
|
@ -62,7 +62,7 @@ class stock_partial_picking(osv.osv_memory):
|
|||
res.update(picking_id=picking_id)
|
||||
if 'move_ids' in fields:
|
||||
picking = self.pool.get('stock.picking').browse(cr, uid, picking_id, context=context)
|
||||
moves = [self._partial_move_for(cr, uid, m) for m in picking.move_lines if m.state == 'assigned']
|
||||
moves = [self._partial_move_for(cr, uid, m) for m in picking.move_lines if m.state not in ('done','cancel')]
|
||||
res.update(move_ids=moves)
|
||||
if 'date' in fields:
|
||||
res.update(date=time.strftime(DEFAULT_SERVER_DATETIME_FORMAT))
|
||||
|
@ -88,7 +88,7 @@ class stock_partial_picking(osv.osv_memory):
|
|||
def _partial_move_for(self, cr, uid, move):
|
||||
partial_move = {
|
||||
'product_id' : move.product_id.id,
|
||||
'quantity' : move.product_qty,
|
||||
'quantity' : move.state == 'assigned' and move.product_qty or 0,
|
||||
'product_uom' : move.product_uom.id,
|
||||
'prodlot_id' : move.prodlot_id.id,
|
||||
'move_id' : move.id,
|
||||
|
|
Loading…
Reference in New Issue