[IMP] Apply improvement in search view ,group by expand=1 and extended options expand=0
bzr revid: ksa@tinyerp.co.in-20100524062613-bfzk6smcewhcr25c
This commit is contained in:
parent
be5cd712c5
commit
d359e085a6
|
@ -74,13 +74,13 @@
|
|||
<page string="Accounting" position="inside">
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Customer Accounting Properties" colspan="2"/>
|
||||
<field name="property_account_receivable"/>
|
||||
<field name="property_account_receivable" groups="base.group_extended"/>
|
||||
<field name="property_account_position" widget="selection"/>
|
||||
<field name="property_payment_term" widget="selection"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Supplier Accounting Properties" colspan="2"/>
|
||||
<field name="property_account_payable"/>
|
||||
<field name="property_account_payable" groups="base.group_extended"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Customer Credit" colspan="2"/>
|
||||
|
|
|
@ -47,8 +47,21 @@
|
|||
<field name="user_id" widget="selection"/>
|
||||
<field name="partner_id"/>
|
||||
</group>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Partner" icon="terp-account" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="User" name='User' icon="terp-account" context="{'group_by':'user_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Product" icon="terp-account" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Analytic Journal" icon="terp-account" context="{'group_by':'journal_id'}"/>
|
||||
<filter string="Analytic Account" icon="terp-account" context="{'group_by':'parent_id'}"/>
|
||||
<filter string="State" icon="terp-account" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Month" icon="terp-account" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-account" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
|
||||
<newline/>
|
||||
<group expand="1" string="Extended options..." colspan="10" col="12">
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-account"
|
||||
string="Draft"
|
||||
domain="[('state','=','draft')]"/>
|
||||
|
@ -72,20 +85,8 @@
|
|||
<field name="date_start"/>
|
||||
<field name="date_end"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Partner" icon="terp-account" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="User" name='User' icon="terp-account" context="{'group_by':'user_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Product" icon="terp-account" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Analytic Journal" icon="terp-account" context="{'group_by':'journal_id'}"/>
|
||||
<filter string="Analytic Account" icon="terp-account" context="{'group_by':'parent_id'}"/>
|
||||
<filter string="State" icon="terp-account" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Month" icon="terp-account" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-account" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
</search>
|
||||
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -87,6 +87,26 @@
|
|||
<field name="partner_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</group>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Company" icon="terp-account" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<filter string="Salesman" name='User' icon="terp-account" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Payment Term" icon="terp-account" context="{'group_by':'payment_term'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Currency" icon="terp-account" context="{'group_by':'currency_id'}"/>
|
||||
<filter string="Journal" icon="terp-account" context="{'group_by':'journal_id'}"/>
|
||||
<filter string="Product" icon="terp-account" context="{'group_by':'product_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Partner" icon="terp-account" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Type" icon="terp-account" context="{'group_by':'type'}"/>
|
||||
<filter string="State" icon="terp-account" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Force Period" icon="terp-account" context="{'group_by':'period_id'}"/>
|
||||
<filter string="Fiscal Position" icon="terp-account" context="{'group_by':'fiscal_position'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-account" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-account" context="{'group_by':'date'}"/>
|
||||
<filter string="Year" icon="terp-account" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<filter string="Done"
|
||||
|
@ -107,27 +127,7 @@
|
|||
<field name="fiscal_position" widget="selection"/>
|
||||
<field name="date"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Company" icon="terp-account" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<filter string="Salesman" name='User' icon="terp-account" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Payment Term" icon="terp-account" context="{'group_by':'payment_term'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Currency" icon="terp-account" context="{'group_by':'currency_id'}"/>
|
||||
<filter string="Journal" icon="terp-account" context="{'group_by':'journal_id'}"/>
|
||||
<filter string="Product" icon="terp-account" context="{'group_by':'product_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Partner" icon="terp-account" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Type" icon="terp-account" context="{'group_by':'type'}"/>
|
||||
<filter string="State" icon="terp-account" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Force Period" icon="terp-account" context="{'group_by':'period_id'}"/>
|
||||
<filter string="Fiscal Position" icon="terp-account" context="{'group_by':'fiscal_position'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-account" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-account" context="{'group_by':'date'}"/>
|
||||
<filter string="Year" icon="terp-account" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -24,7 +24,7 @@ from tools.translate import _
|
|||
class account_chart(osv.osv_memory):
|
||||
"""
|
||||
For Chart of Accounrs
|
||||
"""
|
||||
"""
|
||||
_name = "account.chart"
|
||||
_description = "chart"
|
||||
_columns = {
|
||||
|
|
|
@ -33,25 +33,25 @@ class audittrail_rule(osv.osv):
|
|||
_name = 'audittrail.rule'
|
||||
_description = "Audittrail Rule"
|
||||
_columns = {
|
||||
"name": fields.char("Rule Name", size=32, required=True),
|
||||
"object_id": fields.many2one('ir.model', 'Object', required=True),
|
||||
"user_id": fields.many2many('res.users', 'audittail_rules_users',
|
||||
'user_id', 'rule_id', 'Users'),
|
||||
"log_read": fields.boolean("Log reads"),
|
||||
"log_write": fields.boolean("Log writes"),
|
||||
"log_unlink": fields.boolean("Log deletes"),
|
||||
"log_create": fields.boolean("Log creates"),
|
||||
"state": fields.selection((("draft", "Draft"),
|
||||
("subscribed", "Subscribed")),
|
||||
"State", required=True),
|
||||
"action_id": fields.many2one('ir.actions.act_window', "Action ID"),
|
||||
"name": fields.char("Rule Name", size=32, required=True),
|
||||
"object_id": fields.many2one('ir.model', 'Object', required=True),
|
||||
"user_id": fields.many2many('res.users', 'audittail_rules_users',
|
||||
'user_id', 'rule_id', 'Users'),
|
||||
"log_read": fields.boolean("Log reads"),
|
||||
"log_write": fields.boolean("Log writes"),
|
||||
"log_unlink": fields.boolean("Log deletes"),
|
||||
"log_create": fields.boolean("Log creates"),
|
||||
"state": fields.selection((("draft", "Draft"),
|
||||
("subscribed", "Subscribed")),
|
||||
"State", required=True),
|
||||
"action_id": fields.many2one('ir.actions.act_window', "Action ID"),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'state': lambda *a: 'draft',
|
||||
'log_create': lambda *a: 1,
|
||||
'log_unlink': lambda *a: 1,
|
||||
'log_write': lambda *a: 1,
|
||||
'state': lambda *a: 'draft',
|
||||
'log_create': lambda *a: 1,
|
||||
'log_unlink': lambda *a: 1,
|
||||
'log_write': lambda *a: 1,
|
||||
}
|
||||
|
||||
_sql_constraints = [
|
||||
|
@ -65,7 +65,7 @@ class audittrail_rule(osv.osv):
|
|||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of Auddittrail Rule’s IDs.
|
||||
@return: True
|
||||
@return: True
|
||||
"""
|
||||
obj_action = self.pool.get('ir.actions.act_window')
|
||||
obj_model = self.pool.get('ir.model.data')
|
||||
|
@ -74,13 +74,13 @@ class audittrail_rule(osv.osv):
|
|||
obj = self.pool.get(thisrule.object_id.model)
|
||||
if not obj:
|
||||
raise osv.except_osv(
|
||||
_('WARNING: audittrail is not part of the pool'),
|
||||
_('WARNING: audittrail is not part of the pool'),
|
||||
_('Change audittrail depends -- Setting rule as DRAFT'))
|
||||
self.write(cr, uid, [thisrule.id], {"state": "draft"})
|
||||
val = {
|
||||
"name": 'View Log',
|
||||
"res_model": 'audittrail.log',
|
||||
"src_model": thisrule.object_id.model,
|
||||
"name": 'View Log',
|
||||
"res_model": 'audittrail.log',
|
||||
"src_model": thisrule.object_id.model,
|
||||
"domain": "[('object_id','=', " + str(thisrule.object_id.id) + "), ('res_id', '=', active_id)]"
|
||||
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ class audittrail_rule(osv.osv):
|
|||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of Auddittrail Rule’s IDs.
|
||||
@return: True
|
||||
@return: True
|
||||
"""
|
||||
obj_action = self.pool.get('ir.actions.act_window')
|
||||
val_obj = self.pool.get('ir.values')
|
||||
|
@ -128,16 +128,16 @@ class audittrail_log(osv.osv):
|
|||
_description = "Audittrail Log"
|
||||
|
||||
_columns = {
|
||||
"name": fields.char("Name", size=32),
|
||||
"object_id": fields.many2one('ir.model', 'Object'),
|
||||
"user_id": fields.many2one('res.users', 'User'),
|
||||
"method": fields.selection((('read', 'Read'),
|
||||
('write', 'Write'),
|
||||
('unlink', 'Delete'),
|
||||
('create', 'Create')), "Method"),
|
||||
"timestamp": fields.datetime("Date"),
|
||||
"res_id": fields.integer('Resource Id'),
|
||||
"line_ids": fields.one2many('audittrail.log.line', 'log_id', 'Log lines'),
|
||||
"name": fields.char("Name", size=32),
|
||||
"object_id": fields.many2one('ir.model', 'Object'),
|
||||
"user_id": fields.many2one('res.users', 'User'),
|
||||
"method": fields.selection((('read', 'Read'),
|
||||
('write', 'Write'),
|
||||
('unlink', 'Delete'),
|
||||
('create', 'Create')), "Method"),
|
||||
"timestamp": fields.datetime("Date"),
|
||||
"res_id": fields.integer('Resource Id'),
|
||||
"line_ids": fields.one2many('audittrail.log.line', 'log_id', 'Log lines'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
|
@ -155,14 +155,14 @@ class audittrail_log_line(osv.osv):
|
|||
_name = 'audittrail.log.line'
|
||||
_description = "Log Line"
|
||||
_columns = {
|
||||
'field_id': fields.many2one('ir.model.fields', 'Fields', required=True),
|
||||
'log_id': fields.many2one('audittrail.log', 'Log'),
|
||||
'log': fields.integer("Log ID"),
|
||||
'old_value': fields.text("Old Value"),
|
||||
'new_value': fields.text("New Value"),
|
||||
'old_value_text': fields.text('Old value Text'),
|
||||
'new_value_text': fields.text('New value Text'),
|
||||
'field_description': fields.char('Field Description', size=64),
|
||||
'field_id': fields.many2one('ir.model.fields', 'Fields', required=True),
|
||||
'log_id': fields.many2one('audittrail.log', 'Log'),
|
||||
'log': fields.integer("Log ID"),
|
||||
'old_value': fields.text("Old Value"),
|
||||
'new_value': fields.text("New Value"),
|
||||
'old_value_text': fields.text('Old value Text'),
|
||||
'new_value_text': fields.text('New value Text'),
|
||||
'field_description': fields.char('Field Description', size=64),
|
||||
}
|
||||
|
||||
audittrail_log_line()
|
||||
|
@ -170,7 +170,7 @@ audittrail_log_line()
|
|||
|
||||
class audittrail_objects_proxy(osv_pool):
|
||||
""" Uses Object proxy for auditing changes on object of subscribed Rules"""
|
||||
|
||||
|
||||
def get_value_text(self, cr, uid, field_name, values, object, context=None):
|
||||
"""
|
||||
Gets textual values for the fields
|
||||
|
@ -178,9 +178,9 @@ class audittrail_objects_proxy(osv_pool):
|
|||
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param field_name: List of fields for text values
|
||||
@param values: Values for field to be converted into textual values
|
||||
@return: values: List of textual values for given fields
|
||||
@param field_name: List of fields for text values
|
||||
@param values: Values for field to be converted into textual values
|
||||
@return: values: List of textual values for given fields
|
||||
"""
|
||||
if not context:
|
||||
context = {}
|
||||
|
@ -226,7 +226,7 @@ class audittrail_objects_proxy(osv_pool):
|
|||
@param object: Object who's values are being changed
|
||||
@param lines: List of values for line is to be created
|
||||
"""
|
||||
|
||||
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
obj = pool.get(object.model)
|
||||
#start Loop
|
||||
|
@ -242,7 +242,7 @@ class audittrail_objects_proxy(osv_pool):
|
|||
new_value = 'new_value' in line and line['new_value'] or ''
|
||||
old_value_text = 'old_value_text' in line and line['old_value_text'] or ''
|
||||
new_value_text = 'new_value_text' in line and line['new_value_text'] or ''
|
||||
|
||||
|
||||
if old_value_text == new_value_text:
|
||||
continue
|
||||
if fields[0]['ttype'] == 'many2one':
|
||||
|
@ -251,12 +251,12 @@ class audittrail_objects_proxy(osv_pool):
|
|||
if type(new_value) == tuple:
|
||||
new_value = new_value[0]
|
||||
vals = {
|
||||
"log_id": id,
|
||||
"field_id": f_id[0],
|
||||
"old_value": old_value,
|
||||
"new_value": new_value,
|
||||
"old_value_text": old_value_text,
|
||||
"new_value_text": new_value_text,
|
||||
"log_id": id,
|
||||
"field_id": f_id[0],
|
||||
"old_value": old_value,
|
||||
"new_value": new_value,
|
||||
"old_value_text": old_value_text,
|
||||
"new_value_text": new_value_text,
|
||||
"field_description": fields[0]['field_description']
|
||||
}
|
||||
line_id = pool.get('audittrail.log.line').create(cr, uid, vals)
|
||||
|
@ -270,10 +270,10 @@ class audittrail_objects_proxy(osv_pool):
|
|||
@param db: the current database
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param object: Object who's values are being changed
|
||||
@param method: method to log: create, read, write, unlink
|
||||
@param method: method to log: create, read, write, unlink
|
||||
@param fct_src: execute method of Object proxy
|
||||
|
||||
@return: Returns result as per method of Object proxy
|
||||
|
||||
@return: Returns result as per method of Object proxy
|
||||
"""
|
||||
logged_uids = []
|
||||
pool = pooler.get_pool(db)
|
||||
|
@ -290,9 +290,9 @@ class audittrail_objects_proxy(osv_pool):
|
|||
resource_name = pool.get(model_object.model).name_get(cr, uid, [res_id])
|
||||
resource_name = resource_name and resource_name[0][1] or ''
|
||||
vals = {
|
||||
"method": method,
|
||||
"object_id": model_object.id,
|
||||
"user_id": uid, "res_id": res_id,
|
||||
"method": method,
|
||||
"object_id": model_object.id,
|
||||
"user_id": uid, "res_id": res_id,
|
||||
"name": resource_name
|
||||
}
|
||||
id = pool.get('audittrail.log').create(cr, uid, vals)
|
||||
|
@ -300,8 +300,8 @@ class audittrail_objects_proxy(osv_pool):
|
|||
for field in new_value:
|
||||
if new_value[field]:
|
||||
line = {
|
||||
'name': field,
|
||||
'new_value': new_value[field],
|
||||
'name': field,
|
||||
'new_value': new_value[field],
|
||||
'new_value_text': self.get_value_text(cr, uid, field, new_value[field], model_object)
|
||||
}
|
||||
lines.append(line)
|
||||
|
@ -329,10 +329,10 @@ class audittrail_objects_proxy(osv_pool):
|
|||
for field in args[1].keys():
|
||||
if args[1].keys():
|
||||
line = {
|
||||
'name': field,
|
||||
'new_value': field in new_values and new_values[field] or '',
|
||||
'old_value': field in old_values and old_values[field] or '',
|
||||
'new_value_text': self.get_value_text(cr, uid, field, new_values[field], model_object),
|
||||
'name': field,
|
||||
'new_value': field in new_values and new_values[field] or '',
|
||||
'old_value': field in old_values and old_values[field] or '',
|
||||
'new_value_text': self.get_value_text(cr, uid, field, new_values[field], model_object),
|
||||
'old_value_text': old_values_text[field]
|
||||
}
|
||||
lines.append(line)
|
||||
|
@ -360,8 +360,8 @@ class audittrail_objects_proxy(osv_pool):
|
|||
for field in old_values[res_id]:
|
||||
if old_values[res_id][field]:
|
||||
line = {
|
||||
'name': field,
|
||||
'old_value': old_values[res_id][field],
|
||||
'name': field,
|
||||
'old_value': old_values[res_id][field],
|
||||
'old_value_text': self.get_value_text(cr, uid, field, old_values[res_id][field], model_object)
|
||||
}
|
||||
lines.append(line)
|
||||
|
@ -385,8 +385,8 @@ class audittrail_objects_proxy(osv_pool):
|
|||
for field in old_values[res_id]:
|
||||
if old_values[res_id][field]:
|
||||
line = {
|
||||
'name': field,
|
||||
'old_value': old_values[res_id][field],
|
||||
'name': field,
|
||||
'old_value': old_values[res_id][field],
|
||||
'old_value_text': self.get_value_text(cr, uid, field, old_values[res_id][field], model_object)
|
||||
}
|
||||
lines.append(line)
|
||||
|
@ -403,9 +403,9 @@ class audittrail_objects_proxy(osv_pool):
|
|||
@param db: the current database
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param object: Object who's values are being changed
|
||||
@param method: method to log: create, read, write, unlink
|
||||
|
||||
@return: Returns result as per method of Object proxy
|
||||
@param method: method to log: create, read, write, unlink
|
||||
|
||||
@return: Returns result as per method of Object proxy
|
||||
"""
|
||||
pool = pooler.get_pool(db)
|
||||
cr = pooler.get_db(db).cursor()
|
||||
|
@ -433,7 +433,7 @@ class audittrail_objects_proxy(osv_pool):
|
|||
logged_uids.append(user.id)
|
||||
if not logged_uids or uid in logged_uids:
|
||||
if field in ('read', 'write', 'create', 'unlink'):
|
||||
if getattr(thisrule, 'log_' + field):
|
||||
if getattr(thisrule, 'log_',''):
|
||||
return self.log_fct(db, uid, object, method, fct_src, *args)
|
||||
return fct_src(db, uid, object, method, *args)
|
||||
res = my_fct(db, uid, object, method, *args)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,34 +15,35 @@
|
|||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
{
|
||||
"name" : "Basic Calendar Functionality",
|
||||
"version" : "1.0",
|
||||
"depends" : ["base"],
|
||||
"name" : "Basic Calendar Functionality",
|
||||
"version" : "1.0",
|
||||
"depends" : ["base"],
|
||||
'description': """Full featured calendar system that support:
|
||||
- Alerts (create requests)
|
||||
- Recurring events (*)
|
||||
- Invitations to others people""",
|
||||
"author" : "Tiny",
|
||||
'category': 'Generic Modules/Others',
|
||||
'website': 'http://www.openerp.com',
|
||||
- Invitations to others people""",
|
||||
"author" : "Tiny",
|
||||
'category': 'Generic Modules/Others',
|
||||
'website': 'http://www.openerp.com',
|
||||
"init_xml" : [
|
||||
'base_calendar_data.xml'
|
||||
],
|
||||
"demo_xml" : [],
|
||||
],
|
||||
"demo_xml" : [],
|
||||
"update_xml" : [
|
||||
'security/ir.model.access.csv',
|
||||
'wizard/calendar_event_edit_all_view.xml',
|
||||
'wizard/base_calendar_invite_attendee_view.xml',
|
||||
'wizard/calendar_event_edit_all_view.xml',
|
||||
'wizard/base_calendar_invite_attendee_view.xml',
|
||||
'wizard/base_calendar_set_exrule_view.xml',
|
||||
'base_calendar_view.xml'
|
||||
],
|
||||
"test" : ['test/base_calendar_test.yml'],
|
||||
"installable" : True,
|
||||
"active" : False,
|
||||
],
|
||||
# "test" : ['test/base_calendar_test.yml'],
|
||||
"installable" : True,
|
||||
"active" : False,
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -44,7 +44,6 @@ def get_recurrent_dates(rrulestring, exdate, startdate=None, exrule=None):
|
|||
@param startdate: Startdate for computing recurrent dates
|
||||
@return: List of Recurrent dates
|
||||
"""
|
||||
|
||||
def todate(date):
|
||||
val = parser.parse(''.join((re.compile('\d')).findall(date)))
|
||||
return val
|
||||
|
@ -313,60 +312,60 @@ class calendar_attendee(osv.osv):
|
|||
'cutype': fields.selection([('individual', 'Individual'), \
|
||||
('group', 'Group'), ('resource', 'Resource'), \
|
||||
('room', 'Room'), ('unknown', '') ], \
|
||||
'Invite Type', help="Specify the type of Invitation"),
|
||||
'member': fields.char('Member', size=124,
|
||||
help="Indicate the groups that the attendee belongs to"),
|
||||
'Invite Type', help="Specify the type of Invitation"),
|
||||
'member': fields.char('Member', size=124,
|
||||
help="Indicate the groups that the attendee belongs to"),
|
||||
'role': fields.selection([('req-participant', 'Participation required'), \
|
||||
('chair', 'Chair Person'), \
|
||||
('opt-participant', 'Optional Participation'), \
|
||||
('non-participant', 'For information Purpose')], 'Role', \
|
||||
help='Participation role for the calendar user'),
|
||||
'state': fields.selection([('tentative', 'Tentative'),
|
||||
('needs-action', 'Needs Action'),
|
||||
('accepted', 'Accepted'),
|
||||
('declined', 'Declined'),
|
||||
help='Participation role for the calendar user'),
|
||||
'state': fields.selection([('tentative', 'Tentative'),
|
||||
('needs-action', 'Needs Action'),
|
||||
('accepted', 'Accepted'),
|
||||
('declined', 'Declined'),
|
||||
('delegated', 'Delegated')], 'State', readonly=True, \
|
||||
help="Status of the attendee's participation"),
|
||||
'rsvp': fields.boolean('Required Reply?',
|
||||
help="Indicats whether the favor of a reply is requested"),
|
||||
help="Status of the attendee's participation"),
|
||||
'rsvp': fields.boolean('Required Reply?',
|
||||
help="Indicats whether the favor of a reply is requested"),
|
||||
'delegated_to': fields.function(_compute_data, method=True, \
|
||||
string='Delegated To', type="char", size=124, store=True, \
|
||||
multi='delegated_to', help="The users that the original \
|
||||
request was delegated to"),
|
||||
request was delegated to"),
|
||||
'delegated_from': fields.function(_compute_data, method=True, string=\
|
||||
'Delegated From', type="char", store=True, size=124, multi='delegated_from'),
|
||||
'Delegated From', type="char", store=True, size=124, multi='delegated_from'),
|
||||
'parent_ids': fields.many2many('calendar.attendee', 'calendar_attendee_parent_rel', \
|
||||
'attendee_id', 'parent_id', 'Delegrated From'),
|
||||
'attendee_id', 'parent_id', 'Delegrated From'),
|
||||
'child_ids': fields.many2many('calendar.attendee', 'calendar_attendee_child_rel', \
|
||||
'attendee_id', 'child_id', 'Delegrated To'),
|
||||
'attendee_id', 'child_id', 'Delegrated To'),
|
||||
'sent_by': fields.function(_compute_data, method=True, string='Sent By', \
|
||||
type="char", multi='sent_by', store=True, size=124, \
|
||||
help="Specify the user that is acting on behalf of the calendar user"),
|
||||
help="Specify the user that is acting on behalf of the calendar user"),
|
||||
'sent_by_uid': fields.function(_compute_data, method=True, string='Sent By User', \
|
||||
type="many2one", relation="res.users", multi='sent_by_uid'),
|
||||
type="many2one", relation="res.users", multi='sent_by_uid'),
|
||||
'cn': fields.function(_compute_data, method=True, string='Common name', \
|
||||
type="char", size=124, multi='cn', store=True),
|
||||
type="char", size=124, multi='cn', store=True),
|
||||
'dir': fields.char('URI Reference', size=124, help="Reference to the URI\
|
||||
that points to the directory information corresponding to the attendee."),
|
||||
that points to the directory information corresponding to the attendee."),
|
||||
'language': fields.function(_compute_data, method=True, string='Language', \
|
||||
type="selection", selection=_lang_get, multi='language', \
|
||||
store=True, help="To specify the language for text values in a\
|
||||
property or property parameter."),
|
||||
'user_id': fields.many2one('res.users', 'User'),
|
||||
'partner_address_id': fields.many2one('res.partner.address', 'Contact'),
|
||||
property or property parameter."),
|
||||
'user_id': fields.many2one('res.users', 'User'),
|
||||
'partner_address_id': fields.many2one('res.partner.address', 'Contact'),
|
||||
'partner_id': fields.related('partner_address_id', 'partner_id', type='many2one', \
|
||||
relation='res.partner', string='Partner', help="Partner related to contact"),
|
||||
'email': fields.char('Email', size=124, help="Email of Invited Person"),
|
||||
relation='res.partner', string='Partner', help="Partner related to contact"),
|
||||
'email': fields.char('Email', size=124, help="Email of Invited Person"),
|
||||
'event_date': fields.function(_compute_data, method=True, string='Event Date', \
|
||||
type="datetime", multi='event_date'),
|
||||
type="datetime", multi='event_date'),
|
||||
'event_end_date': fields.function(_compute_data, method=True, \
|
||||
string='Event End Date', type="datetime", \
|
||||
multi='event_end_date'),
|
||||
'ref': fields.reference('Event Ref', selection=_links_get, size=128),
|
||||
'availability': fields.selection([('free', 'Free'), ('busy', 'Busy')], 'Free/Busy', readonly="True"),
|
||||
multi='event_end_date'),
|
||||
'ref': fields.reference('Event Ref', selection=_links_get, size=128),
|
||||
'availability': fields.selection([('free', 'Free'), ('busy', 'Busy')], 'Free/Busy', readonly="True"),
|
||||
}
|
||||
_defaults = {
|
||||
'state': lambda *x: 'needs-action',
|
||||
'state': lambda *x: 'needs-action',
|
||||
}
|
||||
|
||||
def get_ics_file(self, cr, uid, event_obj, context=None):
|
||||
|
@ -401,7 +400,7 @@ property or property parameter."),
|
|||
event.add('location').value = event_obj.location
|
||||
if event_obj.rrule:
|
||||
event.add('rrule').value = event_obj.rrule
|
||||
|
||||
|
||||
if event_obj.alarm_id:
|
||||
# computes alarm data
|
||||
valarm = event.add('valarm')
|
||||
|
@ -422,10 +421,10 @@ property or property parameter."),
|
|||
if interval == 'minutes':
|
||||
delta = timedelta(minutes=duration)
|
||||
trigger.value = delta
|
||||
|
||||
|
||||
# Compute other details
|
||||
valarm.add('DESCRIPTION').value = alarm_data['name'] or 'OpenERP'
|
||||
|
||||
|
||||
for attendee in event_obj.attendee_ids:
|
||||
attendee_add = event.add('attendee')
|
||||
attendee_add.params['CUTYPE'] = [str(attendee.cutype)]
|
||||
|
@ -434,7 +433,7 @@ property or property parameter."),
|
|||
attendee_add.value = 'MAILTO:' + attendee.email
|
||||
res = cal.serialize()
|
||||
return res
|
||||
|
||||
|
||||
def _send_mail(self, cr, uid, ids, mail_to, email_from=tools.config.get('email_from', False), context={}):
|
||||
"""
|
||||
Send mail for calendar attendee.
|
||||
|
@ -457,14 +456,14 @@ property or property parameter."),
|
|||
att_infos.append(((att2.user_id and att2.user_id.name) or \
|
||||
(att2.partner_id and att2.partner_id.name) or \
|
||||
att2.email) + ' - Status: ' + att2.state.title())
|
||||
body_vals = {'name': res_obj.name,
|
||||
'start_date': res_obj.date,
|
||||
'end_date': res_obj.date_deadline or False,
|
||||
'description': res_obj.description or '-',
|
||||
'location': res_obj.location or '-',
|
||||
'attendees': '<br>'.join(att_infos),
|
||||
'user': res_obj.user_id and res_obj.user_id.name or 'OpenERP User',
|
||||
'sign': sign,
|
||||
body_vals = {'name': res_obj.name,
|
||||
'start_date': res_obj.date,
|
||||
'end_date': res_obj.date_deadline or False,
|
||||
'description': res_obj.description or '-',
|
||||
'location': res_obj.location or '-',
|
||||
'attendees': '<br>'.join(att_infos),
|
||||
'user': res_obj.user_id and res_obj.user_id.name or 'OpenERP User',
|
||||
'sign': sign,
|
||||
'company': company
|
||||
}
|
||||
body = html_invitation % body_vals
|
||||
|
@ -564,30 +563,30 @@ class res_alarm(osv.osv):
|
|||
_name = 'res.alarm'
|
||||
_description = 'Basic Alarm Information'
|
||||
_columns = {
|
||||
'name':fields.char('Name', size=256, required=True),
|
||||
'name':fields.char('Name', size=256, required=True),
|
||||
'trigger_occurs': fields.selection([('before', 'Before'), \
|
||||
('after', 'After')], \
|
||||
'Triggers', required=True),
|
||||
'Triggers', required=True),
|
||||
'trigger_interval': fields.selection([('minutes', 'Minutes'), \
|
||||
('hours', 'Hours'), \
|
||||
('days', 'Days')], 'Interval', \
|
||||
required=True),
|
||||
'trigger_duration': fields.integer('Duration', required=True),
|
||||
required=True),
|
||||
'trigger_duration': fields.integer('Duration', required=True),
|
||||
'trigger_related': fields.selection([('start', 'The event starts'), \
|
||||
('end', 'The event ends')], \
|
||||
'Related to', required=True),
|
||||
'Related to', required=True),
|
||||
'duration': fields.integer('Duration', help="""Duration' and 'Repeat' \
|
||||
are both optional, but if one occurs, so MUST the other"""),
|
||||
'repeat': fields.integer('Repeat'),
|
||||
are both optional, but if one occurs, so MUST the other"""),
|
||||
'repeat': fields.integer('Repeat'),
|
||||
'active': fields.boolean('Active', help="If the active field is set to \
|
||||
true, it will allow you to hide the event alarm information without removing it.")
|
||||
}
|
||||
_defaults = {
|
||||
'trigger_interval': lambda *x: 'minutes',
|
||||
'trigger_duration': lambda *x: 5,
|
||||
'trigger_occurs': lambda *x: 'before',
|
||||
'trigger_related': lambda *x: 'start',
|
||||
'active': lambda *x: 1,
|
||||
'trigger_interval': lambda *x: 'minutes',
|
||||
'trigger_duration': lambda *x: 5,
|
||||
'trigger_occurs': lambda *x: 'before',
|
||||
'trigger_related': lambda *x: 'start',
|
||||
'active': lambda *x: 1,
|
||||
}
|
||||
|
||||
def do_alarm_create(self, cr, uid, ids, model, date, context={}):
|
||||
|
@ -615,20 +614,20 @@ true, it will allow you to hide the event alarm information without removing it.
|
|||
self.do_alarm_unlink(cr, uid, [data.id], model)
|
||||
if basic_alarm:
|
||||
vals = {
|
||||
'action': 'display',
|
||||
'description': data.description,
|
||||
'name': data.name,
|
||||
'attendee_ids': [(6, 0, map(lambda x:x.id, data.attendee_ids))],
|
||||
'trigger_related': basic_alarm.trigger_related,
|
||||
'trigger_duration': basic_alarm.trigger_duration,
|
||||
'trigger_occurs': basic_alarm.trigger_occurs,
|
||||
'trigger_interval': basic_alarm.trigger_interval,
|
||||
'duration': basic_alarm.duration,
|
||||
'repeat': basic_alarm.repeat,
|
||||
'state': 'run',
|
||||
'event_date': data[date],
|
||||
'res_id': data.id,
|
||||
'model_id': model_id,
|
||||
'action': 'display',
|
||||
'description': data.description,
|
||||
'name': data.name,
|
||||
'attendee_ids': [(6, 0, map(lambda x:x.id, data.attendee_ids))],
|
||||
'trigger_related': basic_alarm.trigger_related,
|
||||
'trigger_duration': basic_alarm.trigger_duration,
|
||||
'trigger_occurs': basic_alarm.trigger_occurs,
|
||||
'trigger_interval': basic_alarm.trigger_interval,
|
||||
'duration': basic_alarm.duration,
|
||||
'repeat': basic_alarm.repeat,
|
||||
'state': 'run',
|
||||
'event_date': data[date],
|
||||
'res_id': data.id,
|
||||
'model_id': model_id,
|
||||
'user_id': uid
|
||||
}
|
||||
alarm_id = alarm_obj.create(cr, uid, vals)
|
||||
|
@ -702,8 +701,8 @@ class calendar_alarm(osv.osv):
|
|||
}
|
||||
|
||||
_defaults = {
|
||||
'action': lambda *x: 'email',
|
||||
'state': lambda *x: 'run',
|
||||
'action': lambda *x: 'email',
|
||||
'state': lambda *x: 'run',
|
||||
}
|
||||
def create(self, cr, uid, vals, context={}):
|
||||
"""
|
||||
|
@ -754,11 +753,11 @@ class calendar_alarm(osv.osv):
|
|||
for alarm in self.browse(cr, uid, alarm_ids):
|
||||
if alarm.action == 'display':
|
||||
value = {
|
||||
'name': alarm.name,
|
||||
'act_from': alarm.user_id.id,
|
||||
'act_to': alarm.user_id.id,
|
||||
'body': alarm.description,
|
||||
'trigger_date': alarm.trigger_date,
|
||||
'name': alarm.name,
|
||||
'act_from': alarm.user_id.id,
|
||||
'act_to': alarm.user_id.id,
|
||||
'body': alarm.description,
|
||||
'trigger_date': alarm.trigger_date,
|
||||
'ref_doc1': '%s,%s' % (alarm.model_id.model, alarm.res_id)
|
||||
}
|
||||
request_id = request_obj.create(cr, uid, value)
|
||||
|
@ -788,9 +787,9 @@ class calendar_alarm(osv.osv):
|
|||
mail_to.append(att.user_id.address_id.email)
|
||||
if mail_to:
|
||||
tools.email_send(
|
||||
tools.config.get('email_from', False),
|
||||
mail_to,
|
||||
sub,
|
||||
tools.config.get('email_from', False),
|
||||
mail_to,
|
||||
sub,
|
||||
body
|
||||
)
|
||||
self.write(cr, uid, [alarm.id], {'state':'done'})
|
||||
|
@ -820,12 +819,12 @@ class calendar_event(osv.osv):
|
|||
return {}
|
||||
event = self.browse(cr, uid, ids, context=context)[0]
|
||||
value = {
|
||||
'date': event.date and event.date[:11] + '00:00:00',
|
||||
'date_deadline': event.date_deadline and event.date_deadline[:11] + '00:00:00',
|
||||
'duration': 24
|
||||
'date': event.date and event.date[:11] + '00:00:00',
|
||||
'date_deadline': event.date_deadline and event.date_deadline[:11] + '00:00:00',
|
||||
'duration': 24
|
||||
}
|
||||
return {'value': value}
|
||||
|
||||
|
||||
def onchange_dates(self, cr, uid, ids, start_date, duration=False, end_date=False, allday=False, context={}):
|
||||
"""
|
||||
@param self: The object pointer
|
||||
|
@ -847,8 +846,8 @@ class calendar_event(osv.osv):
|
|||
if allday: # For all day event
|
||||
start = start_date[:11] + '00:00:00'
|
||||
value = {
|
||||
'date': start,
|
||||
'date_deadline': start,
|
||||
'date': start,
|
||||
'date_deadline': start,
|
||||
'duration': 24
|
||||
}
|
||||
return {'value': value}
|
||||
|
@ -877,7 +876,7 @@ class calendar_event(osv.osv):
|
|||
cr.execute("UPDATE %s set freq='None',interval=0,count=0,end_date=Null,\
|
||||
mo=False,tu=False,we=False,th=False,fr=False,sa=False,su=False,\
|
||||
day=0,select1='date',month_list=Null ,byday=Null where id=%s" % (self._table, id))
|
||||
|
||||
|
||||
if not value:
|
||||
cr.execute("UPDATE %s set rrule_type='none' where id=%s" % (self._table, id))
|
||||
return True
|
||||
|
@ -906,19 +905,19 @@ class calendar_event(osv.osv):
|
|||
for day in val['byday'].split(','):
|
||||
new_val[day] = True
|
||||
val.pop('byday')
|
||||
|
||||
|
||||
if val.get('until'):
|
||||
until = parser.parse(''.join((re.compile('\d')).findall(val.get('until'))))
|
||||
new_val['end_date'] = until.strftime('%Y-%m-%d')
|
||||
val.pop('until')
|
||||
new_val.pop('until')
|
||||
|
||||
|
||||
if val.get('bymonthday'):
|
||||
new_val['day'] = val.get('bymonthday')
|
||||
val.pop('bymonthday')
|
||||
new_val['select1'] = 'date'
|
||||
new_val.pop('bymonthday')
|
||||
|
||||
|
||||
if val.get('byday'):
|
||||
d = val.get('byday')
|
||||
if '-' in d:
|
||||
|
@ -928,12 +927,12 @@ class calendar_event(osv.osv):
|
|||
new_val['byday'] = d[:1]
|
||||
new_val['week_list'] = d[1:3].upper()
|
||||
new_val['select1'] = 'day'
|
||||
|
||||
|
||||
if val.get('bymonth'):
|
||||
new_val['month_list'] = val.get('bymonth')
|
||||
val.pop('bymonth')
|
||||
new_val.pop('bymonth')
|
||||
|
||||
|
||||
for k, v in new_val.items():
|
||||
temp = ", %s='%s'" % (k, v)
|
||||
qry += temp
|
||||
|
@ -941,9 +940,9 @@ class calendar_event(osv.osv):
|
|||
whr = " where id=%(id)s"
|
||||
qry = qry + whr
|
||||
val.update({
|
||||
'table': self._table,
|
||||
'rule_type': rrule_type,
|
||||
'id': id,
|
||||
'table': self._table,
|
||||
'rule_type': rrule_type,
|
||||
'id': id,
|
||||
})
|
||||
cr.execute(qry % val)
|
||||
return True
|
||||
|
@ -968,7 +967,7 @@ class calendar_event(osv.osv):
|
|||
raise osv.except_osv('Warning!', 'Interval can not be Negative')
|
||||
if datas.get('count', 0) < 0:
|
||||
raise osv.except_osv('Warning!', 'Count can not be Negative')
|
||||
rrule_custom = self.compute_rule_string(cr, uid, datas,\
|
||||
rrule_custom = self.compute_rule_string(cr, uid, datas, \
|
||||
context=context)
|
||||
result[event] = rrule_custom
|
||||
else:
|
||||
|
@ -977,40 +976,40 @@ class calendar_event(osv.osv):
|
|||
return result
|
||||
|
||||
_columns = {
|
||||
'id': fields.integer('ID'),
|
||||
'sequence': fields.integer('Sequence'),
|
||||
'name': fields.char('Description', size=64, required=True),
|
||||
'date': fields.datetime('Date'),
|
||||
'date_deadline': fields.datetime('Deadline'),
|
||||
'create_date': fields.datetime('Created', readonly=True),
|
||||
'duration': fields.float('Duration'),
|
||||
'description': fields.text('Your action'),
|
||||
'id': fields.integer('ID'),
|
||||
'sequence': fields.integer('Sequence'),
|
||||
'name': fields.char('Description', size=64, required=True),
|
||||
'date': fields.datetime('Date'),
|
||||
'date_deadline': fields.datetime('Deadline'),
|
||||
'create_date': fields.datetime('Created', readonly=True),
|
||||
'duration': fields.float('Duration'),
|
||||
'description': fields.text('Your action'),
|
||||
'class': fields.selection([('public', 'Public'), ('private', 'Private'), \
|
||||
('confidential', 'Confidential')], 'Mark as'),
|
||||
'location': fields.char('Location', size=264, help="Location of Event"),
|
||||
'show_as': fields.selection([('free', 'Free'), ('busy', 'Busy')], \
|
||||
'Show as'),
|
||||
'base_calendar_url': fields.char('Caldav URL', size=264),
|
||||
'Show as'),
|
||||
'base_calendar_url': fields.char('Caldav URL', size=264),
|
||||
'exdate': fields.text('Exception Date/Times', help="This property \
|
||||
defines the list of date/time exceptions for arecurring calendar component."),
|
||||
defines the list of date/time exceptions for arecurring calendar component."),
|
||||
'exrule': fields.char('Exception Rule', size=352, help="defines a \
|
||||
rule or repeating pattern for an exception to a recurrence set"),
|
||||
rule or repeating pattern for an exception to a recurrence set"),
|
||||
'rrule': fields.function(_get_rulestring, type='char', size=124, method=True, \
|
||||
string='Recurrent Rule', store=True, \
|
||||
fnct_inv=_set_rrulestring, help='Defines a\
|
||||
rule or repeating pattern for recurring events\n\
|
||||
e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
|
||||
FREQ=MONTHLY;INTERVAL=2;COUNT=10;BYDAY=-1SU'),
|
||||
FREQ=MONTHLY;INTERVAL=2;COUNT=10;BYDAY=-1SU'),
|
||||
'rrule_type': fields.selection([('none', ''), ('daily', 'Daily'), \
|
||||
('weekly', 'Weekly'), ('monthly', 'Monthly'), \
|
||||
('yearly', 'Yearly'), ('custom', 'Custom')], 'Recurrency'),
|
||||
'alarm_id': fields.many2one('res.alarm', 'Alarm'),
|
||||
'base_calendar_alarm_id': fields.many2one('calendar.alarm', 'Alarm'),
|
||||
'recurrent_uid': fields.integer('Recurrent ID'),
|
||||
'recurrent_id': fields.datetime('Recurrent ID date'),
|
||||
('yearly', 'Yearly'), ('custom', 'Custom')], 'Recurrency'),
|
||||
'alarm_id': fields.many2one('res.alarm', 'Alarm'),
|
||||
'base_calendar_alarm_id': fields.many2one('calendar.alarm', 'Alarm'),
|
||||
'recurrent_uid': fields.integer('Recurrent ID'),
|
||||
'recurrent_id': fields.datetime('Recurrent ID date'),
|
||||
'vtimezone': fields.related('user_id', 'context_tz', type='char', size=24, \
|
||||
string='Timezone', store=True),
|
||||
'user_id': fields.many2one('res.users', 'Responsible'),
|
||||
string='Timezone', store=True),
|
||||
'user_id': fields.many2one('res.users', 'Responsible'),
|
||||
'freq': fields.selection([('None', 'No Repeat'), \
|
||||
('secondly', 'Secondly'), \
|
||||
('minutely', 'Minutely'), \
|
||||
|
@ -1018,44 +1017,44 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
|
|||
('daily', 'Daily'), \
|
||||
('weekly', 'Weekly'), \
|
||||
('monthly', 'Monthly'), \
|
||||
('yearly', 'Yearly')], 'Frequency'),
|
||||
'interval': fields.integer('Interval'),
|
||||
'count': fields.integer('Count'),
|
||||
'mo': fields.boolean('Mon'),
|
||||
'tu': fields.boolean('Tue'),
|
||||
'we': fields.boolean('Wed'),
|
||||
'th': fields.boolean('Thu'),
|
||||
'fr': fields.boolean('Fri'),
|
||||
'sa': fields.boolean('Sat'),
|
||||
'su': fields.boolean('Sun'),
|
||||
('yearly', 'Yearly')], 'Frequency'),
|
||||
'interval': fields.integer('Interval'),
|
||||
'count': fields.integer('Count'),
|
||||
'mo': fields.boolean('Mon'),
|
||||
'tu': fields.boolean('Tue'),
|
||||
'we': fields.boolean('Wed'),
|
||||
'th': fields.boolean('Thu'),
|
||||
'fr': fields.boolean('Fri'),
|
||||
'sa': fields.boolean('Sat'),
|
||||
'su': fields.boolean('Sun'),
|
||||
'select1': fields.selection([('date', 'Date of month'), \
|
||||
('day', 'Day of month')], 'Option'),
|
||||
'day': fields.integer('Date of month'),
|
||||
('day', 'Day of month')], 'Option'),
|
||||
'day': fields.integer('Date of month'),
|
||||
'week_list': fields.selection([('MO', 'Monday'), ('TU', 'Tuesday'), \
|
||||
('WE', 'Wednesday'), ('TH', 'Thursday'), \
|
||||
('FR', 'Friday'), ('SA', 'Saturday'), \
|
||||
('SU', 'Sunday')], 'Weekday'),
|
||||
('SU', 'Sunday')], 'Weekday'),
|
||||
'byday': fields.selection([('1', 'First'), ('2', 'Second'), \
|
||||
('3', 'Third'), ('4', 'Fourth'), \
|
||||
('5', 'Fifth'), ('-1', 'Last')], 'By day'),
|
||||
'month_list': fields.selection(months.items(), 'Month'),
|
||||
'end_date': fields.date('Repeat Until'),
|
||||
'attendee_ids': fields.many2many('calendar.attendee', 'event_attendee_rel',\
|
||||
('5', 'Fifth'), ('-1', 'Last')], 'By day'),
|
||||
'month_list': fields.selection(months.items(), 'Month'),
|
||||
'end_date': fields.date('Repeat Until'),
|
||||
'attendee_ids': fields.many2many('calendar.attendee', 'event_attendee_rel', \
|
||||
'event_id', 'attendee_id', 'Attendees'),
|
||||
'allday': fields.boolean('All Day'),
|
||||
'allday': fields.boolean('All Day'),
|
||||
'active': fields.boolean('Active', help="If the active field is set to \
|
||||
true, it will allow you to hide the event alarm information without removing it.")
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'class': lambda *a: 'public',
|
||||
'show_as': lambda *a: 'busy',
|
||||
'freq': lambda *x: 'None',
|
||||
'select1': lambda *x: 'date',
|
||||
'interval': lambda *x: 1,
|
||||
'active': lambda *x: 1,
|
||||
'class': lambda *a: 'public',
|
||||
'show_as': lambda *a: 'busy',
|
||||
'freq': lambda *x: 'None',
|
||||
'select1': lambda *x: 'date',
|
||||
'interval': lambda *x: 1,
|
||||
'active': lambda *x: 1,
|
||||
}
|
||||
|
||||
|
||||
def open_event(self, cr, uid, ids, context=None):
|
||||
"""
|
||||
Open Event From for Editing
|
||||
|
@ -1067,11 +1066,11 @@ true, it will allow you to hide the event alarm information without removing it.
|
|||
"""
|
||||
if not context:
|
||||
context = {}
|
||||
|
||||
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
|
||||
|
||||
value = {}
|
||||
|
||||
|
||||
id2 = data_obj._get_id(cr, uid, 'base_calendar', 'event_form_view')
|
||||
id3 = data_obj._get_id(cr, uid, 'base_calendar', 'event_tree_view')
|
||||
id4 = data_obj._get_id(cr, uid, 'base_calendar', 'event_calendar_view')
|
||||
|
@ -1083,17 +1082,17 @@ true, it will allow you to hide the event alarm information without removing it.
|
|||
id4 = data_obj.browse(cr, uid, id4, context=context).res_id
|
||||
for id in ids:
|
||||
value = {
|
||||
'name': _('Event'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form,tree',
|
||||
'res_model': 'calendar.event',
|
||||
'view_id': False,
|
||||
'name': _('Event'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form,tree',
|
||||
'res_model': 'calendar.event',
|
||||
'view_id': False,
|
||||
'views': [(id2, 'form'), (id3, 'tree'), (id4, 'calendar')],
|
||||
'type': 'ir.actions.act_window',
|
||||
'res_id': base_calendar_id2real_id(id),
|
||||
'type': 'ir.actions.act_window',
|
||||
'res_id': base_calendar_id2real_id(id),
|
||||
'nodestroy': True
|
||||
}
|
||||
|
||||
|
||||
return value
|
||||
|
||||
def modify_this(self, cr, uid, event_id, defaults, real_date, context=None, *args):
|
||||
|
@ -1111,9 +1110,9 @@ true, it will allow you to hide the event alarm information without removing it.
|
|||
event_id = base_calendar_id2real_id(event_id)
|
||||
datas = self.read(cr, uid, event_id, context=context)
|
||||
defaults.update({
|
||||
'recurrent_uid': base_calendar_id2real_id(datas['id']),
|
||||
'recurrent_id': defaults.get('date') or real_date,
|
||||
'rrule_type': 'none',
|
||||
'recurrent_uid': base_calendar_id2real_id(datas['id']),
|
||||
'recurrent_id': defaults.get('date') or real_date,
|
||||
'rrule_type': 'none',
|
||||
'rrule': ''
|
||||
})
|
||||
exdate = datas['exdate'] and datas['exdate'].split(',') or []
|
||||
|
@ -1131,7 +1130,7 @@ true, it will allow you to hide the event alarm information without removing it.
|
|||
@param event_ids: List of crm meeting’s IDs.
|
||||
@return: True
|
||||
"""
|
||||
|
||||
|
||||
for event_id in event_ids:
|
||||
event_id = base_calendar_id2real_id(event_id)
|
||||
|
||||
|
@ -1146,7 +1145,7 @@ true, it will allow you to hide the event alarm information without removing it.
|
|||
qry += ", location = '%(location)s'"
|
||||
qry += "WHERE id = %s" % (event_id)
|
||||
cr.execute(qry %(defaults))
|
||||
|
||||
|
||||
return True
|
||||
|
||||
def get_recurrent_ids(self, cr, uid, select, base_start_date, base_until_date, limit=100):
|
||||
|
@ -1167,7 +1166,7 @@ true, it will allow you to hide the event alarm information without removing it.
|
|||
result = []
|
||||
if ids and (base_start_date or base_until_date):
|
||||
cr.execute("select m.id, m.rrule, m.date, m.date_deadline, \
|
||||
m.exdate from " + self._table + \
|
||||
m.exdate, m.exrule from " + self._table + \
|
||||
" m where m.id in ("\
|
||||
+ ','.join(map(lambda x: str(x), ids))+")")
|
||||
|
||||
|
@ -1214,7 +1213,7 @@ true, it will allow you to hide the event alarm information without removing it.
|
|||
new_rule = '%s=%s' % (name, value)
|
||||
new_rrule_str.append(new_rule)
|
||||
new_rrule_str = ';'.join(new_rrule_str)
|
||||
rdates = get_recurrent_dates(str(new_rrule_str), exdate, start_date)
|
||||
rdates = get_recurrent_dates(str(new_rrule_str), exdate, start_date, data['exrule'])
|
||||
for rdate in rdates:
|
||||
r_date = datetime.strptime(rdate, "%Y-%m-%d %H:%M:%S")
|
||||
if start_date and r_date < start_date:
|
||||
|
@ -1229,7 +1228,7 @@ true, it will allow you to hide the event alarm information without removing it.
|
|||
if isinstance(select, (str, int, long)):
|
||||
return ids and ids[0] or False
|
||||
return ids
|
||||
|
||||
|
||||
def compute_rule_string(self, cr, uid, datas, context=None, *args):
|
||||
"""
|
||||
Compute rule string.
|
||||
|
@ -1248,9 +1247,9 @@ true, it will allow you to hide the event alarm information without removing it.
|
|||
freq = datas.get('freq')
|
||||
if freq == 'None':
|
||||
return ''
|
||||
|
||||
|
||||
interval_srting = datas.get('interval') and (';INTERVAL=' + str(datas.get('interval'))) or ''
|
||||
|
||||
|
||||
if freq == 'weekly':
|
||||
|
||||
byday = map(lambda x: x.upper(), filter(lambda x: datas.get(x) and x in weekdays, datas))
|
||||
|
@ -1286,7 +1285,7 @@ true, it will allow you to hide the event alarm information without removing it.
|
|||
return rrule_string
|
||||
|
||||
|
||||
def search(self, cr, uid, args, offset=0, limit=100, order=None,
|
||||
def search(self, cr, uid, args, offset=0, limit=100, order=None,
|
||||
context=None, count=False):
|
||||
"""
|
||||
Overrides orm search method.
|
||||
|
@ -1317,6 +1316,7 @@ true, it will allow you to hide the event alarm information without removing it.
|
|||
return self.get_recurrent_ids(cr, uid, res, start_date, until_date, limit)
|
||||
|
||||
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True):
|
||||
"""
|
||||
Writes values in one or several fields.
|
||||
|
@ -1348,7 +1348,7 @@ true, it will allow you to hide the event alarm information without removing it.
|
|||
event_id = base_calendar_id2real_id(event_id)
|
||||
if not event_id in new_ids:
|
||||
new_ids.append(event_id)
|
||||
|
||||
|
||||
res = super(calendar_event, self).write(cr, uid, new_ids, vals, context=context)
|
||||
if vals.has_key('alarm_id') or vals.has_key('base_calendar_alarm_id'):
|
||||
alarm_obj = self.pool.get('res.alarm')
|
||||
|
@ -1478,7 +1478,7 @@ class calendar_todo(osv.osv):
|
|||
_description = "Calendar Task"
|
||||
|
||||
def _get_date(self, cr, uid, ids, name, arg, context):
|
||||
"""
|
||||
"""
|
||||
Get Date
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
|
@ -1494,7 +1494,7 @@ class calendar_todo(osv.osv):
|
|||
return res
|
||||
|
||||
def _set_date(self, cr, uid, id, name, value, arg, context):
|
||||
"""
|
||||
"""
|
||||
Set Date
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
|
@ -1512,8 +1512,8 @@ class calendar_todo(osv.osv):
|
|||
|
||||
_columns = {
|
||||
'date': fields.function(_get_date, method=True, fnct_inv=_set_date, \
|
||||
string='Duration', store=True, type='datetime'),
|
||||
'duration': fields.integer('Duration'),
|
||||
string='Duration', store=True, type='datetime'),
|
||||
'duration': fields.integer('Duration'),
|
||||
}
|
||||
|
||||
__attribute__ = {}
|
||||
|
@ -1526,7 +1526,7 @@ class ir_attachment(osv.osv):
|
|||
_inherit = 'ir.attachment'
|
||||
|
||||
def search_count(self, cr, user, args, context=None):
|
||||
"""
|
||||
"""
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param user: the current user’s ID for security checks,
|
||||
|
@ -1539,9 +1539,9 @@ class ir_attachment(osv.osv):
|
|||
args1.append(map(lambda x:str(x).split('-')[0], arg))
|
||||
return super(ir_attachment, self).search_count(cr, user, args1, context)
|
||||
|
||||
def search(self, cr, uid, args, offset=0, limit=None, order=None,
|
||||
def search(self, cr, uid, args, offset=0, limit=None, order=None,
|
||||
context=None, count=False):
|
||||
"""
|
||||
"""
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
|
@ -1555,8 +1555,8 @@ class ir_attachment(osv.osv):
|
|||
for i, arg in enumerate(new_args):
|
||||
if arg[0] == 'res_id':
|
||||
new_args[i] = (arg[0], arg[1], base_calendar_id2real_id(arg[2]))
|
||||
return super(ir_attachment, self).search(cr, uid, new_args, offset=offset,
|
||||
limit=limit, order=order,
|
||||
return super(ir_attachment, self).search(cr, uid, new_args, offset=offset,
|
||||
limit=limit, order=order,
|
||||
context=context, count=False)
|
||||
ir_attachment()
|
||||
|
||||
|
@ -1565,12 +1565,12 @@ class ir_values(osv.osv):
|
|||
|
||||
def set(self, cr, uid, key, key2, name, models, value, replace=True, \
|
||||
isobject=False, meta=False, preserve_user=False, company=False):
|
||||
"""
|
||||
"""
|
||||
Set IR Values
|
||||
@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 model: Get The Model
|
||||
@param model: Get The Model
|
||||
"""
|
||||
|
||||
new_model = []
|
||||
|
@ -1584,12 +1584,12 @@ class ir_values(osv.osv):
|
|||
|
||||
def get(self, cr, uid, key, key2, models, meta=False, context={}, \
|
||||
res_id_req=False, without_user=True, key2_req=True):
|
||||
"""
|
||||
"""
|
||||
Get IR Values
|
||||
@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 model: Get The Model
|
||||
@param model: Get The Model
|
||||
"""
|
||||
|
||||
new_model = []
|
||||
|
@ -1607,37 +1607,35 @@ class ir_model(osv.osv):
|
|||
|
||||
_inherit = 'ir.model'
|
||||
|
||||
def read(self, cr, uid, ids, fields=None, context={},
|
||||
def read(self, cr, uid, ids, fields=None, context={},
|
||||
load='_classic_read'):
|
||||
"""
|
||||
"""
|
||||
Read IR Model
|
||||
@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 ids: List of IR Model’s IDs.
|
||||
@param context: A standard dictionary for contextual values
|
||||
@param context: A standard dictionary for contextual values
|
||||
"""
|
||||
|
||||
new_ids = isinstance(ids, (str, int, long)) and [ids] or ids
|
||||
|
||||
data = super(ir_model, self).read(cr, uid, new_ids, fields=fields, \
|
||||
data = super(ir_model, self).read(cr, uid, ids, fields=fields, \
|
||||
context=context, load=load)
|
||||
if data:
|
||||
for val in data:
|
||||
val['id'] = base_calendar_id2real_id(val['id'])
|
||||
return isinstance(ids, (str, int, long)) and data[0] or data
|
||||
return data
|
||||
|
||||
ir_model()
|
||||
|
||||
class virtual_report_spool(web_services.report_spool):
|
||||
|
||||
def exp_report(self, db, uid, object, ids, datas=None, context=None):
|
||||
"""
|
||||
"""
|
||||
Export Report
|
||||
@param self: The object pointer
|
||||
@param db: get the current database,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param context: A standard dictionary for contextual values
|
||||
@param context: A standard dictionary for contextual values
|
||||
"""
|
||||
|
||||
if object == 'printscreen.list':
|
||||
|
@ -1656,20 +1654,20 @@ class res_users(osv.osv):
|
|||
_inherit = 'res.users'
|
||||
|
||||
def _get_user_avail(self, cr, uid, ids, context=None):
|
||||
"""
|
||||
"""
|
||||
Get USer Availability
|
||||
@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 ids: List of res user’s IDs.
|
||||
@param context: A standard dictionary for contextual values
|
||||
@param context: A standard dictionary for contextual values
|
||||
"""
|
||||
|
||||
current_datetime = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||
res = {}
|
||||
attendee_obj = self.pool.get('calendar.attendee')
|
||||
attendee_ids = attendee_obj.search(cr, uid, [
|
||||
('event_date', '<=', current_datetime), ('event_end_date', '<=', current_datetime),
|
||||
('event_date', '<=', current_datetime), ('event_end_date', '<=', current_datetime),
|
||||
('state', '=', 'accepted'), ('user_id', 'in', ids)
|
||||
])
|
||||
|
||||
|
@ -1687,13 +1685,13 @@ class res_users(osv.osv):
|
|||
return res
|
||||
|
||||
def _get_user_avail_fun(self, cr, uid, ids, name, args, context=None):
|
||||
"""
|
||||
"""
|
||||
Get USer Availability Function
|
||||
@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 ids: List of res user’s IDs.
|
||||
@param context: A standard dictionary for contextual values
|
||||
@param context: A standard dictionary for contextual values
|
||||
"""
|
||||
|
||||
return self._get_user_avail(cr, uid, ids, context=context)
|
||||
|
@ -1701,7 +1699,7 @@ class res_users(osv.osv):
|
|||
_columns = {
|
||||
'availability': fields.function(_get_user_avail_fun, type='selection', \
|
||||
selection=[('free', 'Free'), ('busy', 'Busy')], \
|
||||
string='Free/Busy', method=True),
|
||||
string='Free/Busy', method=True),
|
||||
}
|
||||
res_users()
|
||||
|
||||
|
|
|
@ -102,8 +102,8 @@
|
|||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
|
||||
<record id="action_view_attendee_form" model="ir.actions.act_window">
|
||||
<field name="name">Event Invitations</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
@ -113,11 +113,11 @@
|
|||
<field name="view_id" ref="base_calendar.base_calendar_attendee_tree_view" />
|
||||
<field name="context">{'default_sent_by_uid': uid}</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Calenadar's menu -->
|
||||
<menuitem id="base.menu_calendar_configuration" name="Calendar"
|
||||
parent="base.menu_base_config" sequence="10" />
|
||||
|
||||
|
||||
<!-- Invitation menu -->
|
||||
<menuitem id="menu_attendee_invitations"
|
||||
name="Event Invitations" parent="base.menu_calendar_configuration"
|
||||
|
@ -161,8 +161,8 @@
|
|||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
|
||||
<record id="action_res_alarm_view" model="ir.actions.act_window">
|
||||
<field name="name">Available Alarms</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
@ -176,8 +176,8 @@
|
|||
action="base_calendar.action_res_alarm_view"
|
||||
parent="base.menu_calendar_configuration" />
|
||||
|
||||
<!-- Event Form View-->
|
||||
|
||||
<!-- Event Form View-->
|
||||
|
||||
<record model="ir.ui.view" id="event_form_view">
|
||||
<field name="name">Event Form</field>
|
||||
<field name="model">calendar.event</field>
|
||||
|
@ -338,7 +338,7 @@
|
|||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Event Calendar View -->
|
||||
|
||||
<record model="ir.ui.view" id="event_calendar_view">
|
||||
|
@ -354,9 +354,9 @@
|
|||
</calendar>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Event Search View-->
|
||||
|
||||
|
||||
<record id="view_calendar_event_filter" model="ir.ui.view">
|
||||
<field name="name">Calendar Events Search</field>
|
||||
<field name="model">calendar.event</field>
|
||||
|
@ -377,7 +377,7 @@
|
|||
<field name="class" select="1"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="16">
|
||||
<group expand="1" string="Group By..." colspan="16">
|
||||
<filter string="Date" icon="terp-project"
|
||||
domain="[]" context="{'group_by':'date'}" />
|
||||
<filter string="Availability" icon="terp-project"
|
||||
|
@ -394,7 +394,7 @@
|
|||
|
||||
|
||||
<!-- Event action -->
|
||||
|
||||
|
||||
<record id="action_view_event" model="ir.actions.act_window">
|
||||
<field name="name">Events</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
@ -403,11 +403,11 @@
|
|||
<field name="view_mode">tree,form,calendar</field>
|
||||
<field name="search_view_id" ref="view_calendar_event_filter"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Event menu -->
|
||||
<menuitem id="menu_events"
|
||||
name="Events" parent="base.menu_calendar_configuration"
|
||||
sequence="5" action="action_view_event" />
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -6,3 +6,4 @@
|
|||
"access_calendar_todo","calendar.todo","model_calendar_todo",,1,1,1,1
|
||||
"access_base_calendar_invite_attendee","base_calendar.invite.attendee","model_base_calendar_invite_attendee",,1,1,1,1
|
||||
"access_calendar_event_edit_all","calendar_event_edit_all","model_calendar_event_edit_all",,1,1,1,1
|
||||
"access_base_calendar_set_exrule","base.calendar.set.exrule","model_base_calendar_set_exrule",,1,1,1,1
|
||||
|
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,12 +15,13 @@
|
|||
# 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 calendar_event_edit_all
|
||||
import base_calendar_invite_attendee
|
||||
import base_calendar_set_exrule
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -13,37 +13,38 @@
|
|||
<field name="type" />
|
||||
<field name="send_mail" />
|
||||
<newline />
|
||||
<group col="1" colspan="4"
|
||||
<group col="2" colspan="6"
|
||||
attrs="{'invisible': [('type', '!=', 'external')]}">
|
||||
<field name="email" colspan="4"
|
||||
attrs="{'required': [('type', '=', 'external')]}" />
|
||||
</group>
|
||||
<group col="1" colspan="4"
|
||||
<group col="2" colspan="6"
|
||||
attrs="{'invisible': [('type', '!=', 'internal')]}">
|
||||
<separator string="Users" colspan="4" />
|
||||
<field name="user_ids" select="1" colspan="4"
|
||||
nolabel="1" />
|
||||
<newline />
|
||||
</group>
|
||||
<group col="2" colspan="4"
|
||||
<group col="2" colspan="6"
|
||||
attrs="{'invisible': [('type', '!=', 'partner')]}">
|
||||
<field name="partner_id" colspan="2"
|
||||
on_change="onchange_partner_id(partner_id)"
|
||||
attrs="{'required': [('type', '=', 'partner')]}" />
|
||||
<newline />
|
||||
<separator string="Partner Contacts"
|
||||
colspan="4" />
|
||||
colspan="6" />
|
||||
<field name="contact_ids" select="1" colspan="4"
|
||||
nolabel="1" domain="[('partner_id', '=', partner_id)]"
|
||||
attrs="{'readonly': [('type', '!=', 'partner')]}" />
|
||||
</group>
|
||||
<newline />
|
||||
<separator string="" colspan="6" />
|
||||
<label string="" colspan="2" />
|
||||
<group col="4" colspan="4">
|
||||
<button icon='gtk-cancel' special="cancel"
|
||||
string="Cancel" />
|
||||
<button name="do_invite" string="Invite"
|
||||
type="object" icon="gtk-ok" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -43,12 +43,12 @@ class recording_objects_proxy(osv_pool):
|
|||
res = super(recording_objects_proxy, self).execute(*args, **argv)
|
||||
pool = pooler.get_pool(args[0])
|
||||
mod = pool.get('ir.module.record')
|
||||
|
||||
|
||||
if mod and mod.recording:
|
||||
if args[3] not in ('default_get','read','fields_view_get','fields_get','search','search_count','name_search','name_get','get','request_get', 'get_sc', 'unlink'):
|
||||
if _old_args is not None:
|
||||
if args[3] != 'write' and args[3] != 'create' and len(args) > 5 and isinstance(args[5], dict):
|
||||
args=list(args)
|
||||
args=list(args)
|
||||
args[5]=_old_args
|
||||
args=tuple(args)
|
||||
mod.recording_data.append(('osv_memory_action', args, argv ,None))
|
||||
|
@ -69,7 +69,7 @@ class recording_objects_proxy(osv_pool):
|
|||
return res
|
||||
|
||||
recording_objects_proxy()
|
||||
|
||||
|
||||
class xElement(minidom.Element):
|
||||
"""dom.Element with compact print
|
||||
The Element in minidom has a problem: if printed, adds whitespace
|
||||
|
@ -88,7 +88,7 @@ def doc_createXElement(xdoc, tagName):
|
|||
return e
|
||||
|
||||
import yaml
|
||||
|
||||
|
||||
class record(yaml.YAMLObject):
|
||||
yaml_tag = u'!record'
|
||||
def __init__(self, model, id=None, attrs={}):
|
||||
|
@ -106,7 +106,7 @@ class workflow(yaml.YAMLObject):
|
|||
self.action=action
|
||||
def __repr__(self):
|
||||
return '!workflow {model: %s, action: %s, ref: %s}' % (str(self.model,), str(self.action,), str(self.ref,))
|
||||
|
||||
|
||||
class ref(yaml.YAMLObject):
|
||||
yaml_tag = u'!ref'
|
||||
def __init__(self, expr="False"):
|
||||
|
@ -129,7 +129,7 @@ class function(yaml.YAMLObject):
|
|||
self.attrs=attrs
|
||||
def __repr__(self):
|
||||
return '!python {model: %s}: |' % (str(self.model), )
|
||||
|
||||
|
||||
class base_module_record(osv.osv):
|
||||
_name = "ir.module.record"
|
||||
_columns = {
|
||||
|
@ -169,16 +169,16 @@ class base_module_record(osv.osv):
|
|||
obj = dt.browse(cr, uid, dtids[0])
|
||||
self.depends[obj.module] = True
|
||||
return obj.module+'.'+obj.name, obj.noupdate
|
||||
|
||||
|
||||
def _create_record(self, cr, uid, doc, model, data, record_id, noupdate=False):
|
||||
data_pool = self.pool.get('ir.model.data')
|
||||
model_pool = self.pool.get(model)
|
||||
|
||||
|
||||
record = doc.createElement('record')
|
||||
record.setAttribute("id", record_id)
|
||||
record.setAttribute("model", model)
|
||||
record_list = [record]
|
||||
|
||||
|
||||
lids = data_pool.search(cr, uid, [('model','=',model)])
|
||||
res = data_pool.read(cr, uid, lids[:1], ['module'])
|
||||
if res:
|
||||
|
@ -207,7 +207,7 @@ class base_module_record(osv.osv):
|
|||
noupdate = noupdate or update
|
||||
if not id:
|
||||
relation_pool = self.pool.get(fields[key]['relation'])
|
||||
|
||||
|
||||
field.setAttribute("model", fields[key]['relation'])
|
||||
fld_nm = relation_pool._rec_name
|
||||
name = relation_pool.read(cr, uid, val,[fld_nm])[fld_nm] or False
|
||||
|
@ -231,7 +231,7 @@ class base_module_record(osv.osv):
|
|||
newid = self._create_id(cr, uid, fields[key]['relation'], valitem[2])
|
||||
valitem[1]=newid
|
||||
self.ids[(fields[key]['relation'], valitem[1])] = newid
|
||||
|
||||
|
||||
childrecord, update = self._create_record(cr, uid, doc, fields[key]['relation'],valitem[2], newid)
|
||||
noupdate = noupdate or update
|
||||
record_list += childrecord
|
||||
|
@ -260,11 +260,11 @@ class base_module_record(osv.osv):
|
|||
|
||||
def _create_yaml_record(self, cr, uid, model, data, record_id):
|
||||
record={'model': model, 'id': str(record_id)}
|
||||
|
||||
|
||||
model_pool = self.pool.get(model)
|
||||
data_pool = self.pool.get('ir.model.data')
|
||||
lids = data_pool.search(cr, uid, [('model','=',model)])
|
||||
|
||||
|
||||
res = data_pool.read(cr, uid, lids[:1], ['module'])
|
||||
attrs={}
|
||||
if res:
|
||||
|
@ -275,7 +275,7 @@ class base_module_record(osv.osv):
|
|||
defaults[model] = model_pool.default_get(cr, uid, data)
|
||||
except:
|
||||
defaults[model]={}
|
||||
for key,val in data.items():
|
||||
for key,val in data.items():
|
||||
if ((key in defaults[model]) and (val == defaults[model][key])) and not(fields[key].get('required',False)):
|
||||
continue
|
||||
if fields[key]['type'] in ('integer','float'):
|
||||
|
@ -303,7 +303,7 @@ class base_module_record(osv.osv):
|
|||
else:
|
||||
fname = model_pool._inherit_fields[key][2]._fields_id
|
||||
del valitem[2][fname] #delete parent_field from child's fields list
|
||||
|
||||
|
||||
childrecord = self._create_yaml_record(cr, uid, fields[key]['relation'],valitem[2], None)
|
||||
items[0].append(childrecord['attrs'])
|
||||
attrs[key] = items
|
||||
|
@ -343,7 +343,7 @@ class base_module_record(osv.osv):
|
|||
for f in filter(lambda a: isinstance(obj._columns[a], fields.function)\
|
||||
and (not obj._columns[a].store),obj._columns):
|
||||
del data[f]
|
||||
|
||||
|
||||
for key,val in data.items():
|
||||
if result.has_key(key):
|
||||
continue
|
||||
|
@ -378,6 +378,7 @@ class base_module_record(osv.osv):
|
|||
return result
|
||||
|
||||
def _create_function(self, cr, uid, doc, model, name, record_id):
|
||||
print "creareeeeeeeeeeeeeeeeee"
|
||||
record = doc.createElement('function')
|
||||
record.setAttribute("name", name)
|
||||
record.setAttribute("model", model)
|
||||
|
@ -402,7 +403,7 @@ class base_module_record(osv.osv):
|
|||
record,update = self._create_record(cr, uid, doc, rec[2], rec[5], id)
|
||||
noupdate = noupdate or update
|
||||
record_list += record
|
||||
|
||||
|
||||
elif rec[4] in ('menu_create',):
|
||||
for id in rec[5]:
|
||||
id,update = self._get_id(cr, uid, rec[3], id)
|
||||
|
@ -460,6 +461,7 @@ class base_module_record(osv.osv):
|
|||
return record
|
||||
|
||||
def _generate_function_yaml(self, cr, uid, args):
|
||||
print "geberareeeeeeeeeeeeeeee",args
|
||||
db, uid, model, action, ids, context = args
|
||||
temp_context = context.copy()
|
||||
active_id = temp_context['active_id']
|
||||
|
@ -484,7 +486,7 @@ class base_module_record(osv.osv):
|
|||
attrs=str(attrs)+'})'
|
||||
function['attrs'] = attrs
|
||||
return function
|
||||
|
||||
|
||||
def _generate_assert_xml(self, rec, doc):
|
||||
pass
|
||||
|
||||
|
@ -526,7 +528,7 @@ class base_module_record(osv.osv):
|
|||
self.ids = {}
|
||||
if len(self.recording_data):
|
||||
yaml_file='''\n'''
|
||||
|
||||
|
||||
for rec in self.recording_data:
|
||||
if rec[1][3] == 'create':
|
||||
self.mode="create"
|
||||
|
@ -565,21 +567,21 @@ class base_module_record(osv.osv):
|
|||
yaml_file += str(object) + '''\n'''
|
||||
attrs=yaml.dump(object.attrs, default_flow_style=False)
|
||||
yaml_file += attrs + '''\n\n'''
|
||||
|
||||
|
||||
yaml_result=''''''
|
||||
for line in yaml_file.split('\n'):
|
||||
line=line.replace("''","'")
|
||||
if (line.find('!record') == 0) or (line.find('!workflow') == 0) or (line.find('!python') == 0):
|
||||
line = "- \n" + " " + line
|
||||
elif line.find('!comment') == 0:
|
||||
line=line.replace('!comment','- \n ')
|
||||
line=line.replace('!comment','- \n ')
|
||||
elif line.find('- -') != -1:
|
||||
line=line.replace('- -',' -')
|
||||
line = " " + line
|
||||
else:
|
||||
line = " " + line
|
||||
yaml_result += line + '''\n'''
|
||||
|
||||
|
||||
return yaml_result
|
||||
|
||||
base_module_record()
|
||||
|
|
|
@ -27,8 +27,6 @@ import pooler
|
|||
from osv import osv
|
||||
from tools.translate import _
|
||||
|
||||
|
||||
|
||||
class report_creator_open(wizard.interface):
|
||||
def _open_report(self, cr, uid, data, context):
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
name="convert_opportunity"
|
||||
string="Convert"
|
||||
help="Convert to Opportunity"
|
||||
icon="gtk-index"
|
||||
icon="gtk-index"
|
||||
type="object"
|
||||
attrs="{'invisible':[('opportunity_id','!=',False)]}"/>
|
||||
<newline />
|
||||
|
@ -176,7 +176,7 @@
|
|||
<field name="email_to"/>
|
||||
<field name="description"/>
|
||||
</tree>
|
||||
</field>
|
||||
</field>
|
||||
<button colspan="2" string="Send New Email"
|
||||
name="%(action_crm_send_mail)d"
|
||||
context="{'mail':'new', 'model': 'crm.lead'}"
|
||||
|
@ -307,7 +307,7 @@
|
|||
help="Show Sales Team"/>
|
||||
</field>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="14">
|
||||
<group expand="1" string="Group By..." colspan="14">
|
||||
<filter string="Stage" icon="terp-crm" domain="[]" context="{'group_by':'stage_id'}"/>
|
||||
<filter string="State" icon="terp-crm" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Source" icon="terp-crm" domain="[]" context="{'group_by':'categ_id'}"/>
|
||||
|
|
|
@ -274,7 +274,7 @@
|
|||
<field name="user_id" select="1" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="16">
|
||||
<group expand="1" string="Group By..." colspan="16">
|
||||
<filter string="Date" icon="terp-project"
|
||||
domain="[]" context="{'group_by':'date'}" />
|
||||
<filter string="Privacy" icon="terp-crm"
|
||||
|
@ -320,7 +320,7 @@
|
|||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Partners inherited form -->
|
||||
|
||||
<record id="view_meeting_partner_info_form" model="ir.ui.view">
|
||||
|
|
|
@ -303,7 +303,7 @@
|
|||
help="My Sale Team" />
|
||||
</field>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="16">
|
||||
<group expand="1" string="Group By..." colspan="16">
|
||||
<filter string="Stage" icon="terp-crm" domain="[]"
|
||||
context="{'group_by':'stage_id'}" />
|
||||
<filter string="Priority" icon="terp-crm" domain="[]"
|
||||
|
@ -325,7 +325,7 @@
|
|||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Partners inherited form -->
|
||||
|
||||
<record id="view_opp_partner_info_form" model="ir.ui.view">
|
||||
|
@ -342,11 +342,11 @@
|
|||
<field name="name"/>
|
||||
<field name="email_from"/>
|
||||
<field name="phone"/>
|
||||
|
||||
|
||||
<field name="categ_id" invisible="1"/>
|
||||
<field name="type_id" invisible="1"/>
|
||||
<field name="referred" invisible="1"/>
|
||||
|
||||
|
||||
<field name="stage_id"/>
|
||||
<button name="stage_previous" string="Previous"
|
||||
states="open,pending" type="object" icon="gtk-go-back" />
|
||||
|
|
|
@ -137,7 +137,7 @@
|
|||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!--Inbound Phonecalls Form View -->
|
||||
|
||||
<record model="ir.ui.view" id="crm_case_inbound_phone_form_view">
|
||||
|
@ -197,9 +197,9 @@
|
|||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!--Inbound Phonecalls Tree View -->
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="crm_case_inbound_phone_tree_view">
|
||||
<field name="name">CRM - Inbound Phone Calls Tree</field>
|
||||
<field name="model">crm.phonecall</field>
|
||||
|
@ -274,7 +274,7 @@
|
|||
help="My Sale Team" />
|
||||
</field>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="4">
|
||||
<group expand="1" string="Group By..." colspan="4">
|
||||
<filter string="Partner" icon="terp-crm" domain="[]"
|
||||
context="{'group_by':'partner_id'}" />
|
||||
<filter string="Responsible" icon="terp-crm"
|
||||
|
@ -288,9 +288,9 @@
|
|||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Partners inherited form -->
|
||||
|
||||
|
||||
<record id="view_phonecall_partner_info_form" model="ir.ui.view">
|
||||
<field name="name">res.partner.phonecall.info.inherit</field>
|
||||
<field name="model">res.partner</field>
|
||||
|
@ -302,6 +302,6 @@
|
|||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
</record>
|
||||
|
||||
<!-- Leads by user and section Search View -->
|
||||
|
||||
|
||||
<record id="view_report_crm_lead_filter" model="ir.ui.view">
|
||||
<field name="name">crm.lead.report.select</field>
|
||||
<field name="model">crm.lead.report</field>
|
||||
|
@ -118,8 +118,41 @@
|
|||
<filter icon="terp-crm" string="My Case" help="My Case" domain="[('user_id','=',uid)]" />
|
||||
</field>
|
||||
</group>
|
||||
<group expand="1" string="Group By..." colspan="4" col="8">
|
||||
<filter string="User" name="User" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'user_id'}" />
|
||||
|
||||
<filter string="Company" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'company_id'}" />
|
||||
|
||||
<filter string="Section" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'section_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="State" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'state'}" />
|
||||
|
||||
<filter string="Stage" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'stage_id'}" />
|
||||
|
||||
<filter string="Category" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'categ_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="Day" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'day'}"/>
|
||||
|
||||
<filter string="Month" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'month'}" />
|
||||
|
||||
<filter string="Year" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'name'}" />
|
||||
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Extended options..." colspan="10" col="12">
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-sale"
|
||||
string="Done"
|
||||
domain="[('state','=','done')]"/>
|
||||
|
@ -132,40 +165,6 @@
|
|||
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]"/>
|
||||
</group>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="8">
|
||||
<filter string="User" name="User" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'user_id'}" />
|
||||
|
||||
<filter string="Company" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'company_id'}" />
|
||||
|
||||
<filter string="Section" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'section_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="State" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'state'}" />
|
||||
|
||||
<filter string="Stage" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'stage_id'}" />
|
||||
|
||||
<filter string="Category" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'categ_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="Day" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'day'}"/>
|
||||
|
||||
<filter string="Month" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'month'}" />
|
||||
|
||||
<filter string="Year" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'name'}" />
|
||||
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -220,7 +219,7 @@
|
|||
<field name="view_id" ref="view_report_crm_lead_graph"/>
|
||||
<field name="act_window_id" ref="action_report_crm_lead"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="action_report_crm_opportunity" model="ir.actions.act_window">
|
||||
<field name="name">Opportunities</field>
|
||||
<field name="res_model">crm.lead.report</field>
|
||||
|
@ -244,7 +243,7 @@
|
|||
<field name="view_id" ref="view_report_crm_lead_graph"/>
|
||||
<field name="act_window_id" ref="action_report_crm_opportunity"/>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem name="Leads" id="menu_report_crm_leads_tree"
|
||||
groups="base.group_extended"
|
||||
parent="base.next_id_64" action="action_report_crm_lead" />
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
</record>
|
||||
|
||||
<!-- Phone calls by user and section Search View -->
|
||||
|
||||
|
||||
<record id="view_report_crm_phonecall_filter" model="ir.ui.view">
|
||||
<field name="name">crm.phonecall.report.select</field>
|
||||
<field name="model">crm.phonecall.report</field>
|
||||
|
@ -118,8 +118,39 @@
|
|||
<filter icon="terp-crm" string="My Case" help="My Case" domain="[('user_id','=',uid)]" />
|
||||
</field>
|
||||
</group>
|
||||
|
||||
<group expand="1" string="Group By..." colspan="4" col="8">
|
||||
<filter string="User" name="User" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'user_id'}" />
|
||||
|
||||
<filter string="Company" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'company_id'}" />
|
||||
|
||||
<filter string="Section" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'section_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="State" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'state'}" />
|
||||
|
||||
<filter string="Category" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'categ_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="Day" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'day'}"/>
|
||||
|
||||
<filter string="Month" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'month'}" />
|
||||
|
||||
<filter string="Year" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'name'}" />
|
||||
</group>
|
||||
|
||||
<newline/>
|
||||
<group expand="1" string="Extended options..." colspan="10" col="12">
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-sale"
|
||||
string="Done"
|
||||
domain="[('state','=','done')]"/>
|
||||
|
@ -131,39 +162,8 @@
|
|||
<separator orientation="vertical"/>
|
||||
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.phonecall')]"/>
|
||||
</group>
|
||||
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="8">
|
||||
<filter string="User" name="User" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'user_id'}" />
|
||||
|
||||
<filter string="Company" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'company_id'}" />
|
||||
|
||||
<filter string="Section" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'section_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="State" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'state'}" />
|
||||
|
||||
<filter string="Category" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'categ_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="Day" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'day'}"/>
|
||||
|
||||
<filter string="Month" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'month'}" />
|
||||
|
||||
<filter string="Year" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'name'}" />
|
||||
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -271,7 +271,7 @@
|
|||
<field name="section_id" select="1"
|
||||
widget="selection"/>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="10" col="20">
|
||||
<group expand="1" string="Group By..." colspan="10" col="20">
|
||||
<filter string="Deadline" icon="terp-crm"
|
||||
domain="[]"
|
||||
context="{'group_by':'date_deadline'}" />
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
</record>
|
||||
|
||||
<!-- CRM Claim Report Search View -->
|
||||
|
||||
|
||||
<record id="view_report_crm_claim_filter" model="ir.ui.view">
|
||||
<field name="name">crm.claim.report.select</field>
|
||||
<field name="model">crm.claim.report</field>
|
||||
|
@ -122,8 +122,47 @@
|
|||
<filter icon="terp-crm" string="My Case" help="My Case" domain="[('user_id','=',uid)]" />
|
||||
</field>
|
||||
</group>
|
||||
|
||||
<group expand="1" string="Group By..." colspan="4" col="8">
|
||||
<filter string="User" name="User" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'user_id'}" />
|
||||
|
||||
<filter string="Company" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'company_id'}" />
|
||||
|
||||
<filter string="Section" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'section_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="State" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'state'}" />
|
||||
|
||||
<filter string="Stage" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'stage_id'}" />
|
||||
|
||||
<filter string="Category" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'categ_id'}" />
|
||||
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Priority" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'priority'}" />
|
||||
<filter string="Type" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'type_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="Day" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'day'}"/>
|
||||
|
||||
<filter string="Month" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'month'}" />
|
||||
|
||||
<filter string="Year" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'name'}" />
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Extended options..." colspan="10" col="12">
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-sale"
|
||||
string="Done"
|
||||
domain="[('state','=','done')]"/>
|
||||
|
@ -141,46 +180,6 @@
|
|||
<field name="type_id" widget="selection" domain="[('object_id.model', '=', 'crm.claim')]"/>
|
||||
</group>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="8">
|
||||
<filter string="User" name="User" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'user_id'}" />
|
||||
|
||||
<filter string="Company" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'company_id'}" />
|
||||
|
||||
<filter string="Section" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'section_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="State" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'state'}" />
|
||||
|
||||
<filter string="Stage" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'stage_id'}" />
|
||||
|
||||
<filter string="Category" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'categ_id'}" />
|
||||
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Priority" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'priority'}" />
|
||||
<filter string="Type" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'type_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="Day" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'day'}"/>
|
||||
|
||||
<filter string="Month" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'month'}" />
|
||||
|
||||
<filter string="Year" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'name'}" />
|
||||
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -284,7 +284,7 @@
|
|||
</field>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="10" col="20">
|
||||
<group expand="1" string="Group By..." colspan="10" col="20">
|
||||
<filter string="Partner" icon="terp-partner"
|
||||
domain="[]"
|
||||
context="{'group_by':'partner_id'}" />
|
||||
|
|
|
@ -121,8 +121,38 @@
|
|||
<filter icon="terp-crm" string="My Case" help="My Case" domain="[('user_id','=',uid)]" />
|
||||
</field>
|
||||
</group>
|
||||
<group expand="1" string="Group By..." colspan="4" col="8">
|
||||
<filter string="User" name="User" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'user_id'}" />
|
||||
|
||||
<filter string="Company" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'company_id'}" />
|
||||
|
||||
<filter string="Section" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'section_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="State" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'state'}" />
|
||||
|
||||
<filter string="Category" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'categ_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="Day" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'day'}"/>
|
||||
|
||||
<filter string="Month" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'month'}" />
|
||||
|
||||
<filter string="Year" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'name'}" />
|
||||
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Extended options..." colspan="10" col="12">
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-sale"
|
||||
string="Done"
|
||||
domain="[('state','=','done')]"/>
|
||||
|
@ -130,44 +160,12 @@
|
|||
<filter icon="terp-sale"
|
||||
string="Cancel"
|
||||
domain="[('state','=','cancel')]"/>
|
||||
|
||||
|
||||
<group>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.fundraising')]"/>
|
||||
</group>
|
||||
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="8">
|
||||
<filter string="User" name="User" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'user_id'}" />
|
||||
|
||||
<filter string="Company" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'company_id'}" />
|
||||
|
||||
<filter string="Section" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'section_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="State" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'state'}" />
|
||||
|
||||
<filter string="Category" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'categ_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="Day" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'day'}"/>
|
||||
|
||||
<filter string="Month" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'month'}" />
|
||||
|
||||
<filter string="Year" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'name'}" />
|
||||
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -243,7 +243,7 @@
|
|||
help="My section" />
|
||||
</field>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="12" col="20">
|
||||
<group expand="1" string="Group By..." colspan="12" col="20">
|
||||
<filter string="Customer" icon="terp-crm"
|
||||
domain="[]" context="{'group_by':'partner_id'}" />
|
||||
<filter string="State" icon="terp-crm" domain="[]"
|
||||
|
|
|
@ -114,36 +114,13 @@
|
|||
<field name="user_id" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Extended options..." colspan="4" col="5">
|
||||
<filter icon="terp-sale"
|
||||
string="Lowest"
|
||||
domain="[('priority','=','5')]"/>
|
||||
|
||||
<filter icon="terp-sale"
|
||||
string="Low"
|
||||
domain="[('priority','=','4')]"/>
|
||||
|
||||
<filter icon="terp-sale"
|
||||
string="Normal"
|
||||
domain="[('priority','=','3')]"/>
|
||||
|
||||
<filter icon="terp-sale"
|
||||
string="High"
|
||||
domain="[('priority','=','2')]"/>
|
||||
|
||||
<filter icon="terp-sale"
|
||||
string="Highest"
|
||||
domain="[('priority','=','1')]"/>
|
||||
|
||||
</group>
|
||||
<newline/>
|
||||
|
||||
<!-- Helpdesk report after Sales Services Apply Group -->
|
||||
<!-- Helpdesk report after Sales Services Apply Group -->
|
||||
|
||||
<group expand="1" string="Group By..." colspan="4" col="8">
|
||||
<filter string="User" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'user_id'}"
|
||||
default="1" />
|
||||
domain="[]" context="{'group_by':'user_id'}"
|
||||
default="1" />
|
||||
|
||||
<filter string="Company" icon="terp-sale"
|
||||
domain="[]"
|
||||
|
@ -169,6 +146,31 @@
|
|||
domain="[]" context="{'group_by':'name'}" />
|
||||
|
||||
</group>
|
||||
|
||||
<group expand="0" string="Extended options..." colspan="4" col="5">
|
||||
<filter icon="terp-sale"
|
||||
string="Lowest"
|
||||
domain="[('priority','=','5')]"/>
|
||||
|
||||
<filter icon="terp-sale"
|
||||
string="Low"
|
||||
domain="[('priority','=','4')]"/>
|
||||
|
||||
<filter icon="terp-sale"
|
||||
string="Normal"
|
||||
domain="[('priority','=','3')]"/>
|
||||
|
||||
<filter icon="terp-sale"
|
||||
string="High"
|
||||
domain="[('priority','=','2')]"/>
|
||||
|
||||
<filter icon="terp-sale"
|
||||
string="Highest"
|
||||
domain="[('priority','=','1')]"/>
|
||||
|
||||
</group>
|
||||
<newline/>
|
||||
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -118,7 +118,7 @@
|
|||
<record model="ir.ui.view" id="view_document_directory_tree">
|
||||
<field name="name">document.directory</field>
|
||||
<field name="model">document.directory</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Directories" toolbar="1">
|
||||
<field name="name"/>
|
||||
|
|
|
@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
@ -49,7 +49,7 @@ class node_context(object):
|
|||
context """
|
||||
cached_roots = {}
|
||||
|
||||
def __init__(self, cr, uid, context=None):
|
||||
def __init__(self, cr, uid, context=None):
|
||||
self.dbname = cr.dbname
|
||||
self.uid = uid
|
||||
self.context = context
|
||||
|
@ -59,21 +59,18 @@ class node_context(object):
|
|||
|
||||
def get_uri(self, cr, uri):
|
||||
""" Although this fn passes back to doc.dir, it is needed since
|
||||
it is a potential caching point """
|
||||
(ndir, duri) = self._dirobj._locate_child(cr,self.uid, self.rootdir,uri, None, self)
|
||||
while duri:
|
||||
ndir = ndir.child(cr, duri[0])
|
||||
it is a potential caching point """
|
||||
(ndir, duri) = self._dirobj._locate_child(cr,self.uid, self.rootdir,uri, None, self)
|
||||
while duri:
|
||||
ndir = ndir.child(cr, duri[0])
|
||||
if not ndir:
|
||||
return False
|
||||
duri = duri[1:]
|
||||
return False
|
||||
duri = duri[1:]
|
||||
return ndir
|
||||
|
||||
|
||||
|
||||
|
||||
class node_class(object):
|
||||
""" this is a superclass for our inodes
|
||||
It is an API for all code that wants to access the document files.
|
||||
It is an API for all code that wants to access the document files.
|
||||
Nodes have attributes which contain usual file properties
|
||||
"""
|
||||
our_type = 'baseclass'
|
||||
|
@ -93,10 +90,10 @@ class node_class(object):
|
|||
if parent:
|
||||
self.dctx = parent.dctx.copy()
|
||||
self.displayname = 'Object'
|
||||
|
||||
|
||||
def full_path(self):
|
||||
""" Return the components of the full path for some
|
||||
node.
|
||||
node.
|
||||
The returned list only contains the names of nodes.
|
||||
"""
|
||||
if self.parent:
|
||||
|
@ -120,7 +117,7 @@ class node_class(object):
|
|||
def path_get(self):
|
||||
print "node_class.path_get()"
|
||||
return False
|
||||
|
||||
|
||||
def get_data(self,cr):
|
||||
raise TypeError('no data for %s'% self.type)
|
||||
|
||||
|
@ -129,7 +126,7 @@ class node_class(object):
|
|||
|
||||
def get_etag(self,cr):
|
||||
""" Get a tag, unique per object + modification.
|
||||
|
||||
|
||||
see. http://tools.ietf.org/html/rfc2616#section-13.3.3 """
|
||||
return self._get_ttag(cr) + ':' + self._get_wtag(cr)
|
||||
|
||||
|
@ -139,14 +136,14 @@ class node_class(object):
|
|||
wtime = time.mktime(time.strptime(self.write_date,'%Y-%m-%d %H:%M:%S'))
|
||||
else: wtime = time.time()
|
||||
return str(wtime)
|
||||
|
||||
|
||||
def _get_ttag(self,cr):
|
||||
""" Get a unique tag for this type/id of object.
|
||||
Must be overriden, so that each node is uniquely identified.
|
||||
"""
|
||||
print "node_class.get_ttag()",self
|
||||
raise RuntimeError("get_etag stub()")
|
||||
|
||||
|
||||
def get_dav_props(self, cr):
|
||||
""" If this class has special behaviour for GroupDAV etc, export
|
||||
its capabilities """
|
||||
|
@ -172,17 +169,17 @@ class node_class(object):
|
|||
|
||||
class node_database(node_class):
|
||||
""" A node representing the database directory
|
||||
|
||||
|
||||
"""
|
||||
our_type = 'database'
|
||||
def __init__(self, path=[], parent=False, context=None):
|
||||
super(node_database,self).__init__(path, parent, context)
|
||||
|
||||
def children(self, cr, domain=None):
|
||||
res = self._child_get(cr, domain=domain) + self._file_get(cr)
|
||||
res = self._child_get(cr, domain=domain) + self._file_get(cr)
|
||||
return res
|
||||
|
||||
def child(self, cr, name, domain=None):
|
||||
def child(self, cr, name, domain=None):
|
||||
res = self._child_get(cr, name, domain=None)
|
||||
if res:
|
||||
return res[0]
|
||||
|
@ -196,7 +193,7 @@ class node_database(node_class):
|
|||
uid = self.context.uid
|
||||
ctx = self.context.context.copy()
|
||||
ctx.update(self.dctx)
|
||||
where = [('parent_id','=',parent_id)]
|
||||
where = [('parent_id','=',parent_id)]
|
||||
if name:
|
||||
where.append(('name','=',name))
|
||||
if not domain:
|
||||
|
@ -204,16 +201,16 @@ class node_database(node_class):
|
|||
|
||||
where2 = where + domain + [('type', '=', 'directory')]
|
||||
ids = dirobj.search(cr, uid, where2, context=ctx)
|
||||
res = []
|
||||
for dirr in dirobj.browse(cr,uid,ids,context=ctx):
|
||||
res = []
|
||||
for dirr in dirobj.browse(cr,uid,ids,context=ctx):
|
||||
res.append(node_dir(dirr.name,self,self.context,dirr))
|
||||
|
||||
|
||||
where2 = where + domain + [('type', '=', 'ressource'), ('ressource_parent_type_id','=',False)]
|
||||
ids = dirobj.search(cr, uid, where2, context=ctx)
|
||||
for dirr in dirobj.browse(cr,uid,ids,context=ctx):
|
||||
ids = dirobj.search(cr, uid, where2, context=ctx)
|
||||
for dirr in dirobj.browse(cr,uid,ids,context=ctx):
|
||||
res.append(node_res_dir(dirr.name,self,self.context,dirr))
|
||||
|
||||
fil_obj = dirobj.pool.get('ir.attachment')
|
||||
|
||||
fil_obj = dirobj.pool.get('ir.attachment')
|
||||
ids = fil_obj.search(cr,uid,where,context=ctx)
|
||||
if ids:
|
||||
for fil in fil_obj.browse(cr,uid,ids,context=ctx):
|
||||
|
@ -237,7 +234,7 @@ class node_database(node_class):
|
|||
|
||||
def _get_ttag(self,cr):
|
||||
return 'db-%s' % cr.dbname
|
||||
|
||||
|
||||
|
||||
class node_dir(node_database):
|
||||
our_type = 'collection'
|
||||
|
@ -268,29 +265,27 @@ class node_dir(node_database):
|
|||
print e
|
||||
pass
|
||||
|
||||
|
||||
|
||||
def get_data(self,cr):
|
||||
res = ''
|
||||
for child in self.children(cr):
|
||||
res += child.get_data(cr)
|
||||
for child in self.children(cr):
|
||||
res += child.get_data(cr)
|
||||
return res
|
||||
|
||||
|
||||
|
||||
def _file_get(self,cr, nodename=False):
|
||||
return super(node_dir,self)._file_get(cr, nodename, self.dir_id)
|
||||
return super(node_dir,self)._file_get(cr, nodename, self.dir_id)
|
||||
|
||||
|
||||
|
||||
|
||||
def _child_get(self, cr, name=None, domain=None):
|
||||
return super(node_dir,self)._child_get(cr, name, self.dir_id, domain=domain)
|
||||
|
||||
def rmcol(self, cr):
|
||||
uid = self.context.uid
|
||||
directory = self.context._dirobj.browse(cr, uid, self.dir_id)
|
||||
res = False
|
||||
directory = self.context._dirobj.browse(cr, uid, self.dir_id)
|
||||
res = False
|
||||
if not directory:
|
||||
raise OSError(2, 'Not such file or directory.')
|
||||
raise OSError(2, 'Not such file or directory.')
|
||||
if directory._table_name=='document.directory':
|
||||
if self.children(cr):
|
||||
raise OSError(39, 'Directory not empty.')
|
||||
|
@ -300,12 +295,12 @@ class node_dir(node_database):
|
|||
return res
|
||||
|
||||
def create_child_collection(self, cr, objname):
|
||||
object2 = False
|
||||
object2 = False
|
||||
dirobj = self.context._dirobj
|
||||
uid = self.context.uid
|
||||
ctx = self.context.context.copy()
|
||||
ctx.update(self.dctx)
|
||||
obj = dirobj.browse(cr, uid, self.dir_id)
|
||||
obj = dirobj.browse(cr, uid, self.dir_id)
|
||||
if obj and (obj.type == 'ressource') and not object2:
|
||||
raise OSError(1, 'Operation not permited.')
|
||||
|
||||
|
@ -315,11 +310,11 @@ class node_dir(node_database):
|
|||
'ressource_parent_type_id': obj and obj.ressource_type_id.id or False,
|
||||
'ressource_id': object2 and object2.id or False,
|
||||
'parent_id' : obj and obj.id or False
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return dirobj.create(cr, uid, val)
|
||||
|
||||
|
||||
|
||||
|
||||
def create_child(self,cr,path,data):
|
||||
""" API function to create a child file object and node
|
||||
Return the node_* created
|
||||
|
@ -353,8 +348,8 @@ class node_dir(node_database):
|
|||
if self.write_date:
|
||||
wtime = time.mktime(time.strptime(self.write_date, '%Y-%m-%d %H:%M:%S'))
|
||||
else: wtime = time.time()
|
||||
return str(wtime)
|
||||
|
||||
return str(wtime)
|
||||
|
||||
def _get_ttag(self,cr):
|
||||
return 'dir-%d' % self.dir_id
|
||||
|
||||
|
@ -379,13 +374,13 @@ class node_res_dir(node_class):
|
|||
self.resm_id = dirr.ressource_id
|
||||
self.namefield = dirr.resource_field.name or 'name'
|
||||
self.displayname = dirr.name
|
||||
# Important: the domain is evaluated using the *parent* dctx!
|
||||
# Important: the domain is evaluated using the *parent* dctx!
|
||||
self.domain = dirr.domain
|
||||
self.ressource_tree = dirr.ressource_tree
|
||||
# and then, we add our own vars in the dctx:
|
||||
if dctx:
|
||||
self.dctx.update(dctx)
|
||||
|
||||
|
||||
# and then, we prepare a dctx dict, for deferred evaluation:
|
||||
self.dctx_dict = {}
|
||||
for dfld in dirr.dctx_ids:
|
||||
|
@ -394,7 +389,7 @@ class node_res_dir(node_class):
|
|||
def children(self, cr, domain=None):
|
||||
return self._child_get(cr, domain=domain)
|
||||
|
||||
def child(self,cr, name, domain=None):
|
||||
def child(self,cr, name, domain=None):
|
||||
res = self._child_get(cr, name, domain=domain)
|
||||
if res:
|
||||
return res[0]
|
||||
|
@ -403,7 +398,7 @@ class node_res_dir(node_class):
|
|||
def _child_get(self,cr, name = None, domain=None):
|
||||
""" return virtual children of resource, based on the
|
||||
foreign object.
|
||||
|
||||
|
||||
Note that many objects use NULL for a name, so we should
|
||||
better call the name_search(),name_get() set of methods
|
||||
"""
|
||||
|
@ -420,28 +415,28 @@ class node_res_dir(node_class):
|
|||
where += safe_eval(self.domain, self.dctx)
|
||||
if self.resm_id:
|
||||
where.append(('id','=',self.resm_id))
|
||||
|
||||
|
||||
if name:
|
||||
where.append((self.namefield,'=',name))
|
||||
|
||||
|
||||
# print "Where clause for %s" % self.res_model, where
|
||||
if self.ressource_tree:
|
||||
object2 = False
|
||||
if self.resm_id:
|
||||
object2 = dirobj.pool.get(self.res_model).browse(cr, uid, self.resm_id) or False
|
||||
if obj._parent_name in obj.fields_get(cr, uid):
|
||||
object2 = dirobj.pool.get(self.res_model).browse(cr, uid, self.resm_id) or False
|
||||
if obj._parent_name in obj.fields_get(cr, uid):
|
||||
where.append((obj._parent_name,'=',object2 and object2.id or False))
|
||||
|
||||
|
||||
resids = obj.search(cr,uid, where, context=ctx)
|
||||
res = []
|
||||
res = []
|
||||
for bo in obj.browse(cr,uid,resids,context=ctx):
|
||||
if not bo:
|
||||
continue
|
||||
name = getattr(bo,self.namefield)
|
||||
if not name:
|
||||
continue
|
||||
# Yes! we can't do better but skip nameless records.
|
||||
|
||||
# Yes! we can't do better but skip nameless records.
|
||||
|
||||
res.append(node_res_obj(name, self.dir_id, self, self.context, self.res_model, bo))
|
||||
return res
|
||||
|
||||
|
@ -458,7 +453,7 @@ class node_res_obj(node_class):
|
|||
def __init__(self, path, dir_id, parent, context, res_model, res_bo, res_id = None):
|
||||
super(node_res_obj,self).__init__(path, parent,context)
|
||||
assert parent
|
||||
#todo: more info from dirr
|
||||
#todo: more info from dirr
|
||||
self.dir_id = dir_id
|
||||
self.mimetype = 'application/x-directory'
|
||||
# 'httpd/unix-directory'
|
||||
|
@ -468,15 +463,15 @@ class node_res_obj(node_class):
|
|||
self.content_length = 0
|
||||
self.res_model = res_model
|
||||
self.domain = parent.domain
|
||||
self.displayname = path
|
||||
self.dctx_dict = parent.dctx_dict
|
||||
if res_bo:
|
||||
self.res_id = res_bo.id
|
||||
self.displayname = path
|
||||
self.dctx_dict = parent.dctx_dict
|
||||
if res_bo:
|
||||
self.res_id = res_bo.id
|
||||
dc2 = self.context.context
|
||||
dc2.update(self.dctx)
|
||||
dc2['res_model'] = res_model
|
||||
dc2['res_id'] = res_bo.id
|
||||
dc2['this'] = res_bo
|
||||
dc2['this'] = res_bo
|
||||
for fld,expr in self.dctx_dict.items():
|
||||
try:
|
||||
self.dctx[fld] = safe_eval(expr,dc2)
|
||||
|
@ -487,11 +482,14 @@ class node_res_obj(node_class):
|
|||
else:
|
||||
self.res_id = res_id
|
||||
|
||||
def children(self, cr, domain=None):
|
||||
def children(self, cr, domain=None):
|
||||
return self._child_get(cr, domain=domain) + self._file_get(cr)
|
||||
|
||||
def child(self,cr, name, domain=None):
|
||||
res = self._child_get(cr, name, domain=domain)
|
||||
def child(self,cr, name):
|
||||
res = self._child_get(cr,name)
|
||||
|
||||
def child(self,cr, name, domain=None):
|
||||
res = self._child_get(cr, name, domain=domain)
|
||||
if res:
|
||||
return res[0]
|
||||
res = self._file_get(cr,name)
|
||||
|
@ -546,7 +544,7 @@ class node_res_obj(node_class):
|
|||
return ('vevent-collection','http://groupdav.org/')
|
||||
return None
|
||||
|
||||
def _child_get(self,cr, name=None, domain=None):
|
||||
def _child_get(self,cr, name=None, domain=None):
|
||||
dirobj = self.context._dirobj
|
||||
uid = self.context.uid
|
||||
ctx = self.context.context.copy()
|
||||
|
@ -554,38 +552,38 @@ class node_res_obj(node_class):
|
|||
directory = dirobj.browse(cr, uid, self.dir_id)
|
||||
obj = dirobj.pool.get(self.res_model)
|
||||
where = []
|
||||
res = []
|
||||
res = []
|
||||
if name:
|
||||
where.append(('name','=',name))
|
||||
|
||||
where.append(('name','=',name))
|
||||
|
||||
# Directory Structure display in tree structure
|
||||
if self.res_id and directory.ressource_tree:
|
||||
where1 = []
|
||||
if obj._parent_name in obj.fields_get(cr, uid):
|
||||
if self.res_id and directory.ressource_tree:
|
||||
where1 = []
|
||||
if obj._parent_name in obj.fields_get(cr, uid):
|
||||
where1 = where + [(obj._parent_name, '=', self.res_id)]
|
||||
resids = obj.search(cr,uid, where1, context=ctx)
|
||||
resids = obj.search(cr,uid, where1, context=ctx)
|
||||
for bo in obj.browse(cr,uid,resids,context=ctx):
|
||||
namefield = directory.resource_field.name or 'name'
|
||||
if not bo:
|
||||
continue
|
||||
res_name = getattr(bo, namefield)
|
||||
if not res_name:
|
||||
continue
|
||||
res.append(node_res_obj(res_name, self.dir_id, self, self.context, self.res_model, res_bo = bo))
|
||||
|
||||
|
||||
where2 = where + [('parent_id','=',self.dir_id) ]
|
||||
ids = dirobj.search(cr, uid, where2, context=ctx)
|
||||
continue
|
||||
res.append(node_res_obj(res_name, self.dir_id, self, self.context, self.res_model, res_bo = bo))
|
||||
|
||||
|
||||
where2 = where + [('parent_id','=',self.dir_id) ]
|
||||
ids = dirobj.search(cr, uid, where2, context=ctx)
|
||||
for dirr in dirobj.browse(cr, uid, ids, context=ctx):
|
||||
if dirr.type == 'directory':
|
||||
res.append(node_res_obj(dirr.name, dirr.id, self, self.context, self.res_model, res_bo = None, res_id = self.res_id))
|
||||
elif dirr.type == 'ressource':
|
||||
# child resources can be controlled by properly set dctx
|
||||
res.append(node_res_dir(dirr.name,self,self.context, dirr, {'active_id': self.res_id}))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
fil_obj = dirobj.pool.get('ir.attachment')
|
||||
where3 = where2 + [('res_model', '=', self.res_model), ('res_id','=',self.res_id)]
|
||||
# print "where clause for dir_obj", where2
|
||||
|
@ -593,20 +591,20 @@ class node_res_obj(node_class):
|
|||
if ids:
|
||||
for fil in fil_obj.browse(cr, uid, ids, context=ctx):
|
||||
res.append(node_file(fil.name, self, self.context, fil))
|
||||
|
||||
|
||||
# Get Child Ressource Directories
|
||||
if directory.ressource_type_id and directory.ressource_type_id.id:
|
||||
where4 = where + [('ressource_parent_type_id','=',directory.ressource_type_id.id)]
|
||||
|
||||
|
||||
# Get Child Ressource Directories
|
||||
if directory.ressource_type_id and directory.ressource_type_id.id:
|
||||
where4 = where + [('ressource_parent_type_id','=',directory.ressource_type_id.id)]
|
||||
where5 = where4 + [('ressource_id','=',0)]
|
||||
dirids = dirobj.search(cr,uid, where5)
|
||||
dirids = dirobj.search(cr,uid, where5)
|
||||
where5 = where4 + [('ressource_id','=',self.res_id)]
|
||||
dirids = dirids + dirobj.search(cr,uid, where5)
|
||||
dirids = dirids + dirobj.search(cr,uid, where5)
|
||||
for dirr in dirobj.browse(cr, uid, dirids, context=ctx):
|
||||
if dirr.type == 'directory' and not dirr.parent_id:
|
||||
res.append(node_res_obj(dirr.name, dirr.id, self, self.context, self.res_model, res_bo = None, res_id = self.res_id))
|
||||
if dirr.type == 'ressource':
|
||||
res.append(node_res_dir(dirr.name, self, self.context, dirr, {'active_id': self.res_id}))
|
||||
res.append(node_res_dir(dirr.name, self, self.context, dirr, {'active_id': self.res_id}))
|
||||
return res
|
||||
|
||||
def create_child_collection(self, cr, objname):
|
||||
|
@ -614,26 +612,26 @@ class node_res_obj(node_class):
|
|||
uid = self.context.uid
|
||||
ctx = self.context.context.copy()
|
||||
ctx.update(self.dctx)
|
||||
res_obj = dirobj.pool.get(self.context.context['res_model'])
|
||||
|
||||
object2 = res_obj.browse(cr, uid, self.context.context['res_id']) or False
|
||||
|
||||
obj = dirobj.browse(cr, uid, self.dir_id)
|
||||
res_obj = dirobj.pool.get(self.context.context['res_model'])
|
||||
|
||||
object2 = res_obj.browse(cr, uid, self.context.context['res_id']) or False
|
||||
|
||||
obj = dirobj.browse(cr, uid, self.dir_id)
|
||||
if obj and (obj.type == 'ressource') and not object2:
|
||||
raise OSError(1, 'Operation not permited.')
|
||||
|
||||
|
||||
|
||||
val = {
|
||||
'name': objname,
|
||||
'ressource_parent_type_id': obj and obj.ressource_type_id.id or False,
|
||||
'ressource_id': object2 and object2.id or False,
|
||||
'parent_id' : False
|
||||
}
|
||||
if (obj and (obj.type in ('directory'))) or not object2:
|
||||
val['parent_id'] = obj and obj.id or False
|
||||
|
||||
}
|
||||
if (obj and (obj.type in ('directory'))) or not object2:
|
||||
val['parent_id'] = obj and obj.id or False
|
||||
|
||||
return dirobj.create(cr, uid, val)
|
||||
|
||||
|
||||
def create_child(self,cr,path,data):
|
||||
""" API function to create a child file object and node
|
||||
Return the node_* created
|
||||
|
@ -673,41 +671,41 @@ class node_file(node_class):
|
|||
self.write_date = fil.write_date or fil.create_date
|
||||
self.content_length = fil.file_size
|
||||
self.displayname = fil.name
|
||||
|
||||
|
||||
# This only propagates the problem to get_data. Better
|
||||
# fix those files to point to the root dir.
|
||||
if fil.parent_id:
|
||||
self.storage_id = fil.parent_id.storage_id.id
|
||||
else:
|
||||
self.storage_id = None
|
||||
self.storage_id = None
|
||||
|
||||
def open(self, cr, mode=False):
|
||||
uid = self.context.uid
|
||||
if self.type in ('collection','database'):
|
||||
return False
|
||||
return False
|
||||
fobj = self.context._dirobj.pool.get('ir.attachment').browse(cr, uid, self.file_id, context=self.context.context)
|
||||
if fobj.store_method and fobj.store_method== 'fs' :
|
||||
s = StringIO.StringIO(self.get_data(cr, fobj))
|
||||
else:
|
||||
s = StringIO.StringIO(base64.decodestring(fobj.db_datas or ''))
|
||||
s.name = self
|
||||
return s
|
||||
return s
|
||||
|
||||
def rm(self, cr):
|
||||
uid = self.context.uid
|
||||
document_obj = self.context._dirobj.pool.get('ir.attachment')
|
||||
if self.type in ('collection','database'):
|
||||
return False
|
||||
document = document_obj.browse(cr, uid, self.file_id, context=self.context.context)
|
||||
return False
|
||||
document = document_obj.browse(cr, uid, self.file_id, context=self.context.context)
|
||||
res = False
|
||||
if document and document._table_name == 'ir.attachment':
|
||||
res = document_obj.unlink(cr, uid, [document.id])
|
||||
return res
|
||||
return res
|
||||
|
||||
def fix_ppath(self, cr, fbro):
|
||||
"""Sometimes we may init this w/o path, parent.
|
||||
This function fills the missing path from the file browse object
|
||||
|
||||
|
||||
Note: this may be an expensive operation, do on demand. However,
|
||||
once caching is in, we might want to do that at init time and keep
|
||||
this object anyway
|
||||
|
@ -716,7 +714,7 @@ class node_file(node_class):
|
|||
return
|
||||
assert fbro
|
||||
uid = self.context.uid
|
||||
|
||||
|
||||
dirpath = []
|
||||
if fbro.parent_id:
|
||||
dirobj = self.context._dirobj.pool.get('document.directory')
|
||||
|
@ -725,14 +723,14 @@ class node_file(node_class):
|
|||
dirpath.append(fbro.datas_fname)
|
||||
else:
|
||||
dirpath.append(fbro.name)
|
||||
|
||||
|
||||
if len(dirpath)>1:
|
||||
self.path = dirpath
|
||||
else:
|
||||
self.path = dirpath[0]
|
||||
|
||||
self.path = dirpath[0]
|
||||
|
||||
def get_data(self, cr, fil_obj = None):
|
||||
""" Retrieve the data for some file.
|
||||
""" Retrieve the data for some file.
|
||||
fil_obj may optionally be specified, and should be a browse object
|
||||
for the file. This is useful when the caller has already initiated
|
||||
the browse object. """
|
||||
|
@ -742,7 +740,7 @@ class node_file(node_class):
|
|||
data_obj = self.context._dirobj.pool.get('ir.model.data')
|
||||
data_id = data_obj._get_id(cr, self.context.uid, 'document', 'storage_db')
|
||||
if data_id:
|
||||
stor = data_obj.browse(cr, self.context.uid, data_id, context=self.context.context).res_id
|
||||
stor = data_obj.browse(cr, self.context.uid, data_id, context=self.context.context).res_id
|
||||
assert stor
|
||||
stobj = self.context._dirobj.pool.get('document.storage')
|
||||
return stobj.get_data(cr,self.context.uid,stor, self,self.context.context, fil_obj)
|
||||
|
@ -755,7 +753,7 @@ class node_file(node_class):
|
|||
return self.content_length
|
||||
|
||||
def set_data(self, cr, data, fil_obj = None):
|
||||
""" Store data at some file.
|
||||
""" Store data at some file.
|
||||
fil_obj may optionally be specified, and should be a browse object
|
||||
for the file. This is useful when the caller has already initiated
|
||||
the browse object. """
|
||||
|
@ -765,7 +763,7 @@ class node_file(node_class):
|
|||
data_obj = self.context._dirobj.pool.get('ir.model.data')
|
||||
data_id = data_obj._get_id(cr, self.context.uid, 'document', 'storage_db')
|
||||
if data_id:
|
||||
stor = data_obj.browse(cr, self.context.uid, data_id, context=self.context.context).res_id
|
||||
stor = data_obj.browse(cr, self.context.uid, data_id, context=self.context.context).res_id
|
||||
assert stor
|
||||
stobj = self.context._dirobj.pool.get('document.storage')
|
||||
return stobj.set_data(cr,self.context.uid,stor, self, data, self.context.context, fil_obj)
|
||||
|
@ -792,20 +790,20 @@ class node_content(node_class):
|
|||
def open(self, cr, mode=False):
|
||||
uid = self.context.uid
|
||||
if self.type in ('collection','database'):
|
||||
return False
|
||||
return False
|
||||
pool = self.context._dirobj.pool
|
||||
res = getattr(pool.get('document.directory.content'), 'process_read')(cr, uid, self)
|
||||
res = StringIO.StringIO(res)
|
||||
res.name = self
|
||||
return res
|
||||
|
||||
return res
|
||||
|
||||
def fill_fields(self,cr,dctx = None):
|
||||
""" Try to read the object and fill missing fields, like mimetype,
|
||||
dates etc.
|
||||
This function must be different from the constructor, because
|
||||
it uses the db cursor.
|
||||
"""
|
||||
|
||||
|
||||
cr.execute('SELECT DISTINCT mimetype FROM document_directory_content_type WHERE active AND code = %s;',
|
||||
(self.extension,))
|
||||
res = cr.fetchall()
|
||||
|
@ -835,3 +833,149 @@ class node_content(node_class):
|
|||
|
||||
def _get_ttag(self,cr):
|
||||
return 'cnt-%d%s' % (self.cnt_id,(self.act_id and ('-' + str(self.act_id))) or '')
|
||||
|
||||
class old_class(osv.osv):
|
||||
# the old code, remove..
|
||||
def __init__(self, cr, uid, path, object, object2=False, context={}, content=False, type='collection', root=False):
|
||||
self.cr = cr
|
||||
def _file_get(self, nodename=False):
|
||||
if not self.object:
|
||||
return []
|
||||
pool = pooler.get_pool(self.cr.dbname)
|
||||
fobj = pool.get('ir.attachment')
|
||||
res2 = []
|
||||
where = []
|
||||
if self.object2:
|
||||
where.append( ('res_model','=',self.object2._name) )
|
||||
where.append( ('res_id','=',self.object2.id) )
|
||||
else:
|
||||
where.append( ('parent_id','=',self.object.id) )
|
||||
where.append( ('res_id','=',False) )
|
||||
if nodename:
|
||||
where.append( (fobj._rec_name,'=',nodename) )
|
||||
for content in self.object.content_ids:
|
||||
res3 = content._table._file_get(self,nodename,content)
|
||||
if res3:
|
||||
res2.extend(res3)
|
||||
|
||||
ids = fobj.search(self.cr, self.uid, where+[ ('parent_id','=',self.object and self.object.id or False) ])
|
||||
if self.object and self.root and (self.object.type=='ressource'):
|
||||
ids += fobj.search(self.cr, self.uid, where+[ ('parent_id','=',False) ])
|
||||
res = fobj.browse(self.cr, self.uid, ids, context=self.context)
|
||||
return map(lambda x: node_class(self.cr, self.uid, self.path+'/'+eval('x.'+fobj._rec_name), x, False, context=self.context, type='file', root=False), res) + res2
|
||||
|
||||
def get_translation(self,value,lang):
|
||||
# Must go, it works on arbitrary models and could be ambiguous.
|
||||
result = value
|
||||
pool = pooler.get_pool(self.cr.dbname)
|
||||
translation_ids = pool.get('ir.translation').search(self.cr, self.uid, [('value','=',value),('lang','=',lang),('type','=','model')])
|
||||
if len(translation_ids):
|
||||
tran_id = translation_ids[0]
|
||||
translation = pool.get('ir.translation').read(self.cr, self.uid, tran_id, ['res_id','name'])
|
||||
res_model,field_name = tuple(translation['name'].split(','))
|
||||
res_id = translation['res_id']
|
||||
res = pool.get(res_model).read(self.cr, self.uid, res_id, [field_name])
|
||||
if res:
|
||||
result = res[field_name]
|
||||
return result
|
||||
|
||||
def directory_list_for_child(self,nodename,parent=False):
|
||||
pool = pooler.get_pool(self.cr.dbname)
|
||||
where = []
|
||||
if nodename:
|
||||
nodename = self.get_translation(nodename, self.context['lang'])
|
||||
where.append(('name','=',nodename))
|
||||
if (self.object and self.object.type=='directory') or not self.object2:
|
||||
where.append(('parent_id','=',self.object and self.object.id or False))
|
||||
else:
|
||||
where.append(('parent_id','=',False))
|
||||
if self.object:
|
||||
where.append(('ressource_parent_type_id','=',self.object.ressource_type_id.id))
|
||||
else:
|
||||
where.append(('ressource_parent_type_id','=',False))
|
||||
|
||||
ids = pool.get('document.directory').search(self.cr, self.uid, where+[('ressource_id','=',0)])
|
||||
if self.object2:
|
||||
ids += pool.get('document.directory').search(self.cr, self.uid, where+[('ressource_id','=',self.object2.id)])
|
||||
res = pool.get('document.directory').browse(self.cr, self.uid, ids, self.context)
|
||||
return res
|
||||
|
||||
def _child_get(self, nodename=False):
|
||||
if self.type not in ('collection','database'):
|
||||
return []
|
||||
res = self.directory_list_for_child(nodename)
|
||||
result= map(lambda x: node_class(self.cr, self.uid, self.path+'/'+x.name, x, x.type=='directory' and self.object2 or False, context=self.context, root=self.root), res)
|
||||
if self.type=='database':
|
||||
pool = pooler.get_pool(self.cr.dbname)
|
||||
fobj = pool.get('ir.attachment')
|
||||
vargs = [('parent_id','=',False),('res_id','=',False)]
|
||||
if nodename:
|
||||
vargs.append((fobj._rec_name,'=',nodename))
|
||||
file_ids=fobj.search(self.cr,self.uid,vargs)
|
||||
|
||||
res = fobj.browse(self.cr, self.uid, file_ids, context=self.context)
|
||||
result +=map(lambda x: node_class(self.cr, self.uid, self.path+'/'+eval('x.'+fobj._rec_name), x, False, context=self.context, type='file', root=self.root), res)
|
||||
if self.type=='collection' and self.object.type=="ressource":
|
||||
where = self.object.domain and eval(self.object.domain, {'active_id':self.root, 'uid':self.uid}) or []
|
||||
pool = pooler.get_pool(self.cr.dbname)
|
||||
obj = pool.get(self.object.ressource_type_id.model)
|
||||
_dirname_field = obj._rec_name
|
||||
if len(obj.fields_get(self.cr, self.uid, ['dirname'])):
|
||||
_dirname_field = 'dirname'
|
||||
|
||||
name_for = obj._name.split('.')[-1]
|
||||
if nodename and nodename.find(name_for) == 0 :
|
||||
id = int(nodename.replace(name_for,''))
|
||||
where.append(('id','=',id))
|
||||
elif nodename:
|
||||
if nodename.find('__') :
|
||||
nodename=nodename.replace('__','/')
|
||||
for invalid in INVALID_CHARS:
|
||||
if nodename.find(INVALID_CHARS[invalid]) :
|
||||
nodename=nodename.replace(INVALID_CHARS[invalid],invalid)
|
||||
nodename = self.get_translation(nodename, self.context['lang'])
|
||||
where.append((_dirname_field,'=',nodename))
|
||||
|
||||
if self.object.ressource_tree:
|
||||
if obj._parent_name in obj.fields_get(self.cr,self.uid):
|
||||
where.append((obj._parent_name,'=',self.object2 and self.object2.id or False))
|
||||
ids = obj.search(self.cr, self.uid, where)
|
||||
res = obj.browse(self.cr, self.uid, ids,self.context)
|
||||
result+= map(lambda x: node_class(self.cr, self.uid, self.path+'/'+x.name.replace('/','__'), self.object, x, context=self.context, root=x.id), res)
|
||||
return result
|
||||
else :
|
||||
if self.object2:
|
||||
return result
|
||||
else:
|
||||
if self.object2:
|
||||
return result
|
||||
|
||||
|
||||
ids = obj.search(self.cr, self.uid, where)
|
||||
res = obj.browse(self.cr, self.uid, ids,self.context)
|
||||
for r in res:
|
||||
if len(obj.fields_get(self.cr, self.uid, [_dirname_field])):
|
||||
r.name = eval('r.'+_dirname_field)
|
||||
else:
|
||||
r.name = False
|
||||
if not r.name:
|
||||
r.name = name_for + '%d'%r.id
|
||||
for invalid in INVALID_CHARS:
|
||||
if r.name.find(invalid) :
|
||||
r.name = r.name.replace(invalid,INVALID_CHARS[invalid])
|
||||
result2 = map(lambda x: node_class(self.cr, self.uid, self.path+'/'+x.name.replace('/','__'), self.object, x, context=self.context, root=x.id), res)
|
||||
if result2:
|
||||
if self.object.ressource_tree:
|
||||
result += result2
|
||||
else:
|
||||
result = result2
|
||||
return result
|
||||
|
||||
|
||||
def path_get(self):
|
||||
path = self.path
|
||||
if self.path[0]=='/':
|
||||
path = self.path[1:]
|
||||
return path
|
||||
|
||||
old_class()
|
||||
|
|
|
@ -71,6 +71,19 @@
|
|||
<field name="employee_id" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Employee" name="employee" icon="terp-hr" context="{'group_by':'employee_id'}"/>
|
||||
<filter string="Rating" icon="terp-hr" context="{'group_by':'rating'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Plan" icon="terp-hr" context="{'group_by':'plan_id'}"/>
|
||||
<filter string="State" icon="terp-hr" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-hr" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-hr" context="{'group_by':'create_date'}"/>
|
||||
<filter string="Year" icon="terp-hr" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-hr"
|
||||
string="Done"
|
||||
|
@ -87,18 +100,6 @@
|
|||
<field name="create_date"/>
|
||||
<field name="closed"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Employee" name="employee" icon="terp-hr" context="{'group_by':'employee_id'}"/>
|
||||
<filter string="Rating" icon="terp-hr" context="{'group_by':'rating'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Plan" icon="terp-hr" context="{'group_by':'plan_id'}"/>
|
||||
<filter string="State" icon="terp-hr" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-hr" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-hr" context="{'group_by':'create_date'}"/>
|
||||
<filter string="Year" icon="terp-hr" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -80,6 +80,20 @@
|
|||
domain="[('user_id','=',False)]"/>
|
||||
</field>
|
||||
</group>
|
||||
<group expand="1" string="Group By...">
|
||||
<filter string="User" name="User" icon="terp-hr" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Employee" icon="terp-hr" context="{'group_by':'employee_id'}"/>
|
||||
<filter string="Company" icon="terp-hr" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Department" icon="terp-hr" context="{'group_by':'department_id'}"/>
|
||||
<filter string="Product" icon="terp-hr" context="{'group_by':'product_id'}"/>
|
||||
<filter string="State" icon="terp-hr" context="{'group_by':'state'}"/>
|
||||
<filter string="Force Journal" icon="terp-hr" context="{'group_by':'journal_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-hr" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-hr" context="{'group_by':'date'}"/>
|
||||
<filter string="Year" icon="terp-hr" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<filter string="Invoiced"
|
||||
|
@ -105,21 +119,6 @@
|
|||
<field name="date_confirm"/>
|
||||
<field name="date_valid"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By...">
|
||||
<filter string="User" name="User" icon="terp-hr" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Employee" icon="terp-hr" context="{'group_by':'employee_id'}"/>
|
||||
<filter string="Company" icon="terp-hr" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Department" icon="terp-hr" context="{'group_by':'department_id'}"/>
|
||||
<filter string="Product" icon="terp-hr" context="{'group_by':'product_id'}"/>
|
||||
<filter string="State" icon="terp-hr" context="{'group_by':'state'}"/>
|
||||
<filter string="Force Journal" icon="terp-hr" context="{'group_by':'journal_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-hr" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-hr" context="{'group_by':'date'}"/>
|
||||
<filter string="Year" icon="terp-hr" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -232,7 +232,7 @@
|
|||
help="My Department"/>
|
||||
</field>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="11" col="20">
|
||||
<group expand="1" string="Group By..." colspan="11" col="20">
|
||||
<filter string="Department" icon="terp-project" domain="[]" context="{'group_by':'department_id'}"/>
|
||||
<filter string="Responsible" icon="terp-project" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
|
|
|
@ -90,8 +90,23 @@
|
|||
domain="[('user_id','=',False)]"/>
|
||||
</field>
|
||||
</group>
|
||||
<group expand="1" string="Group By ..." colspan="10" col="12">
|
||||
<filter string="User" name='User' icon="terp-hr" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Company" icon="terp-hr" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<filter string="Stage" name="Stage" icon="terp-hr" domain="[]" context="{'group_by':'stage_id'}" />
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="State" icon="terp-hr" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Jobs" icon="terp-sale" domain="[]" context="{'group_by':'job_id'}"/>
|
||||
<filter string="Department" icon="terp-hr" domain="[]" context="{'group_by':'department_id'}"/>
|
||||
<filter string="Degree" icon="terp-hr" domain="[]" context="{'group_by':'type_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" name = "day" icon="terp-hr" domain="[]" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-hr" domain="[]" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-hr" domain="[]" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
|
||||
<newline/>
|
||||
<group expand="1" string="Extended options..." colspan="10" col="12">
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-hr"
|
||||
string="Hired"
|
||||
name="done"
|
||||
|
@ -108,22 +123,7 @@
|
|||
<field name="date"/>
|
||||
<field name="date_closed"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By ..." colspan="10" col="12">
|
||||
<filter string="User" name='User' icon="terp-hr" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Company" icon="terp-hr" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<filter string="Stage" name="Stage" icon="terp-hr" domain="[]" context="{'group_by':'stage_id'}" />
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="State" icon="terp-hr" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Jobs" icon="terp-sale" domain="[]" context="{'group_by':'job_id'}"/>
|
||||
<filter string="Department" icon="terp-hr" domain="[]" context="{'group_by':'department_id'}"/>
|
||||
<filter string="Degree" icon="terp-hr" domain="[]" context="{'group_by':'type_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" name = "day" icon="terp-hr" domain="[]" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-hr" domain="[]" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-hr" domain="[]" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -69,24 +69,24 @@
|
|||
<field name="account_id"/>
|
||||
<field name="product_id"/>
|
||||
</group>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="User" name="User" icon="terp-hr" context="{'group_by':'user_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Account" icon="terp-hr" context="{'group_by':'account_id'}"/>
|
||||
<filter string="Product" icon="terp-hr" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Invoice" icon="terp-hr" context="{'group_by':'invoice_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-hr" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-hr" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-hr" context="{'group_by':'name'}"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<field name="date"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="invoice_id" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="User" name="User" icon="terp-hr" context="{'group_by':'user_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Account" icon="terp-hr" context="{'group_by':'account_id'}"/>
|
||||
<filter string="Product" icon="terp-hr" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Invoice" icon="terp-hr" context="{'group_by':'invoice_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-hr" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-hr" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-hr" context="{'group_by':'name'}"/>
|
||||
</group>
|
||||
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -75,6 +75,17 @@
|
|||
</field>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="User" name="User" icon="terp-hr" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Company" icon="terp-hr" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Department" icon="terp-hr" context="{'group_by':'department_id'}"/>
|
||||
<filter string="State" icon="terp-hr" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-hr" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-hr" context="{'group_by':'date_current'}"/>
|
||||
<filter string="Year" icon="terp-hr" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-hr"
|
||||
|
@ -86,18 +97,6 @@
|
|||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="User" name="User" icon="terp-hr" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Company" icon="terp-hr" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Department" icon="terp-hr" context="{'group_by':'department_id'}"/>
|
||||
<filter string="State" icon="terp-hr" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-hr" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-hr" context="{'group_by':'date_current'}"/>
|
||||
<filter string="Year" icon="terp-hr" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -57,7 +57,22 @@
|
|||
<field name="date_planned"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Extended options..." colspan="10" col="12">
|
||||
|
||||
<group expand="1" string="Group By..." colspan="4" col="6">
|
||||
<filter string="Source Location" icon="terp-mrp" context="{'group_by':'location_src_id'}"/>
|
||||
<filter string="Destination Location" icon="terp-mrp" context="{'group_by':'location_dest_id'}"/>
|
||||
<filter string="Picking" icon="terp-mrp" context="{'group_by':'picking_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Routing" icon="terp-mrp" context="{'group_by':'routing_id'}"/>
|
||||
<filter string="Product" name="Product" icon="terp-mrp" context="{'group_by':'product_id'}" />
|
||||
<filter string="State" icon="terp-mrp" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="BOM" icon="terp-mrp" context="{'group_by':'bom_id'}"/>
|
||||
<filter string="Month" icon="terp-mrp" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-mrp" context="{'group_by':'name'}"/>
|
||||
</group>
|
||||
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-mrp" string="Draft" domain="[('state','=','draft')]"/>
|
||||
<filter icon="terp-mrp" string="Picking Exception" domain="[('state','=','picking_except')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
|
@ -78,20 +93,7 @@
|
|||
<field name="date_finnished"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="6">
|
||||
<filter string="Source Location" icon="terp-mrp" context="{'group_by':'location_src_id'}"/>
|
||||
<filter string="Destination Location" icon="terp-mrp" context="{'group_by':'location_dest_id'}"/>
|
||||
<filter string="Picking" icon="terp-mrp" context="{'group_by':'picking_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Routing" icon="terp-mrp" context="{'group_by':'routing_id'}"/>
|
||||
<filter string="Product" name="Product" icon="terp-mrp" context="{'group_by':'product_id'}" />
|
||||
<filter string="State" icon="terp-mrp" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="BOM" icon="terp-mrp" context="{'group_by':'bom_id'}"/>
|
||||
<filter string="Month" icon="terp-mrp" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-mrp" context="{'group_by':'name'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_report_mrp_production_order" model="ir.actions.act_window">
|
||||
|
|
|
@ -10,13 +10,14 @@
|
|||
multi="True"
|
||||
id="bi_conf_cube_query_builder"/>
|
||||
|
||||
<wizard
|
||||
|
||||
<!-- <wizard
|
||||
string="Load Tables"
|
||||
model="olap.schema"
|
||||
name="olap.load.table"
|
||||
menu= "False"
|
||||
multi="True"
|
||||
id="bi_menu_olap_load_table"/>
|
||||
id="bi_menu_olap_load_table"/>-->
|
||||
|
||||
|
||||
<wizard
|
||||
|
|
|
@ -53,7 +53,7 @@ def get_cube(self, cr, uid, context):
|
|||
pool = pooler.get_pool(cr.dbname).get('olap.cube')
|
||||
ids = pool.search(cr, uid, [])
|
||||
res = pool.read(cr, uid, ids, ['schema_id','name'], context)
|
||||
res=[(r['schema_id'], r['name']) for r in res]
|
||||
res=[(r['schema_id'][0], r['name']) for r in res]
|
||||
|
||||
return res
|
||||
|
||||
|
@ -63,7 +63,7 @@ def get_details(self, cr, uid,data, context):
|
|||
"""
|
||||
pool = pooler.get_pool(cr.dbname).get('olap.cube')
|
||||
|
||||
search_id=data['form']['cube_schema'][0]
|
||||
search_id=data['form']['cube_schema']
|
||||
|
||||
ids=pool.search(cr,uid,[('schema_id','=',search_id)])
|
||||
|
||||
|
@ -162,7 +162,7 @@ def _execute_mdx(self, cr, uid, data, context):
|
|||
log=Log()
|
||||
|
||||
pool = pooler.get_pool(cr.dbname).get('olap.schema')
|
||||
ids = pool.search(cr, uid, [('database_id','=',data['form']['cube_schema'][0])])
|
||||
ids = pool.search(cr, uid, [('database_id','=',data['form']['cube_schema'])])
|
||||
res1 = pool.read(cr, uid, ids,['name'], context)
|
||||
|
||||
"""
|
||||
|
|
|
@ -17,11 +17,6 @@
|
|||
<field name="default_code" select="1"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="categ_id" select="1" widget="selection" operator="child_of"/>
|
||||
<newline/>
|
||||
<group col='8' colspan='14' expand="1" string="Extended options...">
|
||||
<field name="pricelist_id" select="1" widget="selection" context="{'pricelist': self}" />
|
||||
</group>
|
||||
<newline/>
|
||||
<group col='8' colspan='15' expand='1' string='Group by...'>
|
||||
<filter string='Category' icon="terp-stock" domain="[]" context="{'group_by' : 'categ_id'}" />
|
||||
<separator orientation="vertical"/>
|
||||
|
@ -29,6 +24,15 @@
|
|||
<separator orientation="vertical"/>
|
||||
<filter string='Type' icon="terp-stock" domain="[]" context="{'group_by' : 'type'}" />
|
||||
</group>
|
||||
<newline/>
|
||||
<group col='8' colspan='14' expand="0" string="Extended options...">
|
||||
<field name="pricelist_id" select="1" widget="selection" context="{'pricelist': self}" />
|
||||
</group>
|
||||
|
||||
<newline/>
|
||||
<group col='8' colspan='14' expand="0" string="Extended options..." groups="base.group_extended">
|
||||
<field name="pricelist_id" select="1" widget="selection" context="{'pricelist': self}" />
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -95,6 +95,20 @@
|
|||
domain="[('project_id','=',False"/>
|
||||
</field>
|
||||
</group>
|
||||
<group expand="1" string="Group By..." colspan="10" col="11">
|
||||
<filter string="User" name="User" icon="terp-project" context="{'group_by':'user_id'}" />
|
||||
<filter string="Project" icon="terp-project" context="{'group_by':'project_id'}"/>
|
||||
<filter string="Partner" icon="terp-project" context="{'group_by':'partner_id'}" />
|
||||
<filter string="Task" icon="terp-project" context="{'group_by':'name'}" />
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="State" icon="terp-project" context="{'group_by':'state'}"/>
|
||||
<filter string="Company" icon="terp-project" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<filter string="Stage" icon="terp-project" context="{'group_by':'type'}" />
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-project" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-project" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-project" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<filter string="Done"
|
||||
|
@ -114,21 +128,6 @@
|
|||
<field name="date_start"/>
|
||||
<field name="date_end"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="10" col="11">
|
||||
<filter string="User" name="User" icon="terp-project" context="{'group_by':'user_id'}" />
|
||||
<filter string="Project" icon="terp-project" context="{'group_by':'project_id'}"/>
|
||||
<filter string="Partner" icon="terp-project" context="{'group_by':'partner_id'}" />
|
||||
<filter string="Task" icon="terp-project" context="{'group_by':'name'}" />
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="State" icon="terp-project" context="{'group_by':'state'}"/>
|
||||
<filter string="Company" icon="terp-project" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<filter string="Stage" icon="terp-project" context="{'group_by':'type'}" />
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-project" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-project" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-project" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -95,8 +95,51 @@
|
|||
</field>
|
||||
<field name="user_id" select="1" widget="selection"/>
|
||||
</group>
|
||||
<group expand="1" string="Group By..." colspan="4" col="8">
|
||||
<filter string="User" name="User" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'user_id'}" />
|
||||
|
||||
<filter string="Company" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'company_id'}" />
|
||||
|
||||
<filter string="Section" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'section_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="State" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'state'}" />
|
||||
|
||||
<filter string="Category" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'categ_id'}" />
|
||||
|
||||
<filter string="Stage" icon="terp-sale" domain="[]" context="{'group_by':'stage_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Project" icon="terp-sale" domain="[]" context="{'group_by':'project_id'}" />
|
||||
<filter string="Priority" icon="terp-sale" domain="[]" context="{'group_by':'priority'}" />
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Type" icon="terp-sale" domain="[]" context="{'group_by':'type_id'}"/>
|
||||
<filter string="Task" icon="terp-sale" domain="[]" context="{'group_by':'task_id'}"/>
|
||||
<newline/>
|
||||
<filter string="Assigned To" icon="terp-sale" domain="[]" context="{'group_by':'assigned_to'}"/>
|
||||
<filter string="Partner" icon="terp-sale" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Channel" icon="terp-sale" domain="[]" context="{'group_by':'canal_id'}"/>
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="Day" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'day'}"/>
|
||||
|
||||
<filter string="Month" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'month'}" />
|
||||
|
||||
<filter string="Year" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'name'}" />
|
||||
|
||||
</group>
|
||||
|
||||
<newline/>
|
||||
<group expand="1" string="Extended options..." colspan="10" col="12">
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-sale"
|
||||
string="Done"
|
||||
domain="[('state','=','done')]"/>
|
||||
|
@ -127,49 +170,6 @@
|
|||
</group>
|
||||
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="4" col="8">
|
||||
<filter string="User" name="User" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'user_id'}" />
|
||||
|
||||
<filter string="Company" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'company_id'}" />
|
||||
|
||||
<filter string="Section" icon="terp-sale"
|
||||
domain="[]"
|
||||
context="{'group_by':'section_id'}" />
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="State" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'state'}" />
|
||||
|
||||
<filter string="Category" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'categ_id'}" />
|
||||
|
||||
<filter string="Stage" icon="terp-sale" domain="[]" context="{'group_by':'stage_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Project" icon="terp-sale" domain="[]" context="{'group_by':'project_id'}" />
|
||||
<filter string="Priority" icon="terp-sale" domain="[]" context="{'group_by':'priority'}" />
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Type" icon="terp-sale" domain="[]" context="{'group_by':'type_id'}"/>
|
||||
<filter string="Task" icon="terp-sale" domain="[]" context="{'group_by':'task_id'}"/>
|
||||
<newline/>
|
||||
<filter string="Assigned To" icon="terp-sale" domain="[]" context="{'group_by':'assigned_to'}"/>
|
||||
<filter string="Partner" icon="terp-sale" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Channel" icon="terp-sale" domain="[]" context="{'group_by':'canal_id'}"/>
|
||||
|
||||
<separator orientation="vertical" />
|
||||
<filter string="Day" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'day'}"/>
|
||||
|
||||
<filter string="Month" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'month'}" />
|
||||
|
||||
<filter string="Year" icon="terp-sale"
|
||||
domain="[]" context="{'group_by':'name'}" />
|
||||
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -81,6 +81,21 @@
|
|||
<field name="product_id"/>
|
||||
|
||||
</group>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Company" icon="terp-purchase" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<filter string="Warehouse" icon="terp-purchase" context="{'group_by':'warehouse_id'}"/>
|
||||
<filter string="Location" icon="terp-purchase" context="{'group_by':'location_id'}"/>
|
||||
<filter string="Responsible" name="Responsible" icon="terp-purchase" context="{'group_by':'user_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Product" icon="terp-purchase" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Partner" name="partner_id" icon="terp-purchase" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="State" icon="terp-purchase" context="{'group_by':'state'}"/>
|
||||
<filter string="Fiscal Position" icon="terp-purchase" context="{'group_by':'fiscal_position'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-purchase" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-purchase" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-purchase" context="{'group_by':'name'}"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-purchase" string="Shipping Exception" domain="[('state','=','shipping_except')]"/>
|
||||
|
@ -97,22 +112,6 @@
|
|||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
<field name="date"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Company" icon="terp-purchase" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<filter string="Warehouse" icon="terp-purchase" context="{'group_by':'warehouse_id'}"/>
|
||||
<filter string="Location" icon="terp-purchase" context="{'group_by':'location_id'}"/>
|
||||
<filter string="Responsible" name="Responsible" icon="terp-purchase" context="{'group_by':'user_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Product" icon="terp-purchase" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Partner" name="partner_id" icon="terp-purchase" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="State" icon="terp-purchase" context="{'group_by':'state'}"/>
|
||||
<filter string="Fiscal Position" icon="terp-purchase" context="{'group_by':'fiscal_position'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-purchase" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-purchase" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-purchase" context="{'group_by':'name'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -80,6 +80,21 @@
|
|||
<field name="partner_id"/>
|
||||
<field name="product_id"/>
|
||||
</group>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Company" icon="terp-sale" groups="base.group_multi_company" context="{'group_by':'company_id'}"/>
|
||||
<filter string="Shop" icon="terp-sale" context="{'group_by':'shop_id'}"/>
|
||||
<filter string="Salesman" icon="terp-sale" name="User" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Fiscal Position" icon="terp-sale" context="{'group_by':'fiscal_position'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Product" icon="terp-sale" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Partner" icon="terp-sale" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Payment Term" icon="terp-sale" context="{'group_by':'payment_term'}"/>
|
||||
<filter string="State" icon="terp-sale" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-sale" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-sale" context="{'group_by':'date'}"/>
|
||||
<filter string="Year" icon="terp-sale" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<filter icon="terp-sale" string="Shipping Exception" domain="[('state','=','shipping_except')]"/>
|
||||
|
@ -96,23 +111,7 @@
|
|||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
<field name="date"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Company" icon="terp-sale" groups="base.group_multi_company" context="{'group_by':'company_id'}"/>
|
||||
<filter string="Shop" icon="terp-sale" context="{'group_by':'shop_id'}"/>
|
||||
<filter string="Salesman" icon="terp-sale" name="User" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Fiscal Position" icon="terp-sale" context="{'group_by':'fiscal_position'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Product" icon="terp-sale" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Partner" icon="terp-sale" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Payment Term" icon="terp-sale" context="{'group_by':'payment_term'}"/>
|
||||
<filter string="State" icon="terp-sale" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-sale" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-sale" context="{'group_by':'date'}"/>
|
||||
<filter string="Year" icon="terp-sale" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
<page string="Sales & Purchases" position="inside">
|
||||
<group colspan="4" col="4" groups="base.group_extended">
|
||||
<separator string="Stock Properties" colspan="4"/>
|
||||
<field name="property_stock_customer" widget="selection" domain="[('usage','=','customer')]" />
|
||||
<field name="property_stock_supplier" widget="selection" domain="[('usage','=','supplier')]"/>
|
||||
<field name="property_stock_customer" widget="selection" domain="[('usage','=','customer')]" groups="base.group_extended" />
|
||||
<field name="property_stock_supplier" widget="selection" domain="[('usage','=','supplier')]" groups="base.group_extended"/>
|
||||
</group>
|
||||
</page>
|
||||
</field>
|
||||
|
|
Loading…
Reference in New Issue