summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrpa (Open ERP) <rpa@tinyerp.com>2011-01-19 10:29:23 +0530
committerrpa (Open ERP) <rpa@tinyerp.com>2011-01-19 10:29:23 +0530
commit5e2f05aa6cc4f35bbeee2d0034e44cf67a01b4cf (patch)
tree5aaaae75e96581bb0a1062062d9cae4cdbc3dd20
parent0bfc5de8163c16aec289181560e1ca5591383b11 (diff)
parentec7fc1cd7de4dac4cede8c4d82b9c2258135a12a (diff)
[MERGE]: Merge with lp:openobject-addons
bzr revid: rpa@tinyerp.com-20110119045923-vn0oonv0oqtf6j5g
-rw-r--r--addons/account/account.py4
-rw-r--r--addons/account/account_report.xml9
-rw-r--r--addons/account/data/account_data2.xml24
-rw-r--r--addons/account/invoice.py2
-rw-r--r--addons/account_voucher/account_voucher_view.xml13
-rw-r--r--addons/analytic/analytic.py2
-rw-r--r--addons/base_calendar/base_calendar.py60
-rw-r--r--addons/base_calendar/base_calendar_view.xml4
-rw-r--r--addons/crm/crm_meeting.py4
-rw-r--r--addons/crm/crm_meeting_view.xml7
-rw-r--r--addons/crm_claim/report/crm_claim_report_view.xml1
-rw-r--r--addons/hr_holidays/hr_holidays.py4
-rw-r--r--addons/product/product.py2
-rw-r--r--addons/project/board_project_view.xml4
-rw-r--r--addons/project/project.py21
-rw-r--r--addons/purchase/stock.py16
-rw-r--r--addons/share/wizard/share_wizard.py67
-rw-r--r--addons/share/wizard/share_wizard_view.xml6
-rw-r--r--addons/stock/stock_view.xml6
-rw-r--r--addons/survey/survey.py2
-rw-r--r--addons/survey/wizard/survey_answer.py5
-rw-r--r--addons/thunderbird/plugin/openerp_plugin.xpibin154536 -> 154284 bytes
-rw-r--r--addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jarbin73743 -> 71411 bytes
-rw-r--r--addons/thunderbird/plugin/openerp_plugin/makefile2
-rw-r--r--addons/web_uservoice/web/editors.py3
25 files changed, 157 insertions, 111 deletions
diff --git a/addons/account/account.py b/addons/account/account.py
index 3c6e9072152..9e48ca554b1 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -586,11 +586,11 @@ class account_journal_column(osv.osv):
'name': fields.char('Column Name', size=64, required=True),
'field': fields.selection(_col_get, 'Field Name', method=True, required=True, size=32),
'view_id': fields.many2one('account.journal.view', 'Journal View', select=True),
- 'sequence': fields.integer('Sequence', help="Gives the sequence order to journal column."),
+ 'sequence': fields.integer('Sequence', help="Gives the sequence order to journal column.", readonly=True),
'required': fields.boolean('Required'),
'readonly': fields.boolean('Readonly'),
}
- _order = "sequence"
+ _order = "view_id, sequence"
account_journal_column()
diff --git a/addons/account/account_report.xml b/addons/account/account_report.xml
index b3030dbaa96..beb23c9ebc3 100644
--- a/addons/account/account_report.xml
+++ b/addons/account/account_report.xml
@@ -35,15 +35,6 @@
rml="account/report/account_tax_report.rml"
string="Taxes Report"/>
- <report id="report_account_voucher_new"
- string="Print Voucher"
- model="account.move"
- name="account.move.voucher"
- rml="account/report/account_voucher_print.rml"
- auto="False"
- header = "False"
- menu="True"/>
-
<menuitem
id="menu_tax_report"
name="Taxes"
diff --git a/addons/account/data/account_data2.xml b/addons/account/data/account_data2.xml
index 2d387a422aa..b1fe4bd8e88 100644
--- a/addons/account/data/account_data2.xml
+++ b/addons/account/data/account_data2.xml
@@ -329,18 +329,6 @@
<field name="field">analytic_account_id</field>
<field eval="14" name="sequence"/>
</record>
- <record id="sp_journal_col25" model="account.journal.column">
- <field name="view_id" ref="account_sp_journal_view"/>
- <field name="name">Tax Acc.</field>
- <field name="field">tax_code_id</field>
- <field eval="15" name="sequence"/>
- </record>
- <record id="sp_journal_col26" model="account.journal.column">
- <field name="view_id" ref="account_sp_journal_view"/>
- <field name="name">Tax</field>
- <field name="field">tax_amount</field>
- <field eval="16" name="sequence"/>
- </record>
<record id="sp_journal_col24" model="account.journal.column">
<field name="view_id" ref="account_sp_journal_view"/>
<field name="name">State</field>
@@ -427,18 +415,6 @@
<field name="field">analytic_account_id</field>
<field eval="14" name="sequence"/>
</record>
- <record id="sp_refund_journal_col25" model="account.journal.column">
- <field name="view_id" ref="account_sp_refund_journal_view"/>
- <field name="name">Tax Acc.</field>
- <field name="field">tax_code_id</field>
- <field eval="15" name="sequence"/>
- </record>
- <record id="sp_refund_journal_col26" model="account.journal.column">
- <field name="view_id" ref="account_sp_refund_journal_view"/>
- <field name="name">Tax</field>
- <field name="field">tax_amount</field>
- <field eval="16" name="sequence"/>
- </record>
<record id="sp_refund_journal_col24" model="account.journal.column">
<field name="view_id" ref="account_sp_refund_journal_view"/>
<field name="name">State</field>
diff --git a/addons/account/invoice.py b/addons/account/invoice.py
index 3298ef3c843..64634e34a96 100644
--- a/addons/account/invoice.py
+++ b/addons/account/invoice.py
@@ -910,7 +910,7 @@ class account_invoice(osv.osv):
}
period_id = inv.period_id and inv.period_id.id or False
if not period_id:
- period_ids = self.pool.get('account.period').search(cr, uid, [('date_start','<=',inv.date_invoice or time.strftime('%Y-%m-%d')),('date_stop','>=',inv.date_invoice or time.strftime('%Y-%m-%d'))])
+ period_ids = self.pool.get('account.period').search(cr, uid, [('date_start','<=',inv.date_invoice or time.strftime('%Y-%m-%d')),('date_stop','>=',inv.date_invoice or time.strftime('%Y-%m-%d')), ('company_id', '=', inv.company_id.id)])
if period_ids:
period_id = period_ids[0]
if period_id:
diff --git a/addons/account_voucher/account_voucher_view.xml b/addons/account_voucher/account_voucher_view.xml
index 5a2c4b88dd9..745e7ab1078 100644
--- a/addons/account_voucher/account_voucher_view.xml
+++ b/addons/account_voucher/account_voucher_view.xml
@@ -20,6 +20,19 @@
</tree>
</field>
</record>
+ <record model="ir.ui.view" id="view_voucher_line_form">
+ <field name="name">account.voucher.line.form</field>
+ <field name="model">account.voucher.line</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Voucher Lines">
+ <field name="name"/>
+ <field name="account_id"/>
+ <field name="partner_id"/>
+ <field name="amount"/>
+ </form>
+ </field>
+ </record>
<record model="ir.ui.view" id="view_voucher_form">
<field name="name">account.voucher.form</field>
diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py
index bd3f3ddde0d..124607112a9 100644
--- a/addons/analytic/analytic.py
+++ b/addons/analytic/analytic.py
@@ -35,7 +35,7 @@ class account_analytic_account(osv.osv):
for son in account.child_ids:
res = recursive_computation(son.id, res)
for field in field_names:
- if account.currency_id.id == son.currency_id.id:
+ if account.currency_id.id == son.currency_id.id or field=='quantity':
res[account.id][field] += res[son.id][field]
else:
res[account.id][field] += currency_obj.compute(cr, uid, son.currency_id.id, account.currency_id.id, res[son.id][field], context=context)
diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py
index 98aea630ef1..5bc12c69671 100644
--- a/addons/base_calendar/base_calendar.py
+++ b/addons/base_calendar/base_calendar.py
@@ -30,6 +30,7 @@ import re
import time
import tools
+
months = {
1: "January", 2: "February", 3: "March", 4: "April", \
5: "May", 6: "June", 7: "July", 8: "August", 9: "September", \
@@ -1080,8 +1081,6 @@ class calendar_event(osv.osv):
for datas in self.read(cr, uid, ids, context=context):
event = datas['id']
if datas.get('rrule_type'):
- if datas['rrule_type']=='daily_working':
- datas.update({'rrule_type': 'weekly'})
if datas.get('rrule_type') == 'none':
result[event] = False
cr.execute("UPDATE %s set exrule=Null where id=%%s" % self._table,( event,))
@@ -1267,6 +1266,8 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
until_date = base_until_date and datetime.strptime(base_until_date[:10]+ ' 23:59:59', "%Y-%m-%d %H:%M:%S") or False
if count > limit:
break
+ if not data['date']:
+ continue
event_date = datetime.strptime(data['date'], "%Y-%m-%d %H:%M:%S")
# To check: If the start date is replace by event date .. the event date will be changed by that of calendar code
start_date = event_date
@@ -1400,10 +1401,9 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
continue
until_date = arg[2]
res = super(calendar_event, self).search(cr, uid, args_without_date, \
- offset, limit, order, context, count)
-
+ offset, limit, order, context, count=False)
res = self.get_recurrent_ids(cr, uid, res, start_date, until_date, limit)
- return res
+ return len(res) if count else res
def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True):
"""
@@ -1415,7 +1415,7 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
@param vals: Dictionary of field value.
@param context: A standard dictionary for contextual values
@return: True
- """
+ """
if context is None:
context = {}
if isinstance(ids, (str, int, long)):
@@ -1425,19 +1425,26 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
new_ids = []
res = False
for event_id in select:
- real_event_id = base_calendar_id2real_id(event_id)
- if len(str(event_id).split('-')) > 1:
+ real_event_id = base_calendar_id2real_id(event_id)
+
+ event = self.browse(cr,uid, event_id, context=context)
+ if('edit_all' in vals):
+ edit_all = vals['edit_all']
+ else:
+ edit_all = event.edit_all or not event.recurrency
+
+ if not edit_all:
data = self.read(cr, uid, event_id, ['date', 'date_deadline', \
'rrule', 'duration'])
if data.get('rrule'):
+ data.update(vals)
data.update({
- 'recurrent_uid': real_event_id,
- 'recurrent_id': data.get('date'),
'rrule_type': 'none',
'rrule': ''
})
- data.update(vals)
+
new_id = self.copy(cr, uid, real_event_id, default=data, context=context)
+ self.unlink(cr, uid, [event_id], context=context)
context.update({'active_id': new_id, 'active_ids': [new_id]})
continue
if not real_event_id in new_ids:
@@ -1454,6 +1461,7 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
context=context)
vals.update(updated_vals.get('value', {}))
+
if new_ids:
res = super(calendar_event, self).write(cr, uid, new_ids, vals, context=context)
@@ -1515,6 +1523,8 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
for base_calendar_id, real_id in select:
#REVET: Revision ID: olt@tinyerp.com-20100924131709-cqsd1ut234ni6txn
res = super(calendar_event, self).read(cr, uid, real_id, fields=fields, context=context, load=load)
+ if not res:
+ res = {}
ls = base_calendar_id2real_id(base_calendar_id, with_date=res and res.get('duration', 0) or 0)
if not isinstance(ls, (str, int, long)) and len(ls) >= 2:
res['date'] = ls[1]
@@ -1553,21 +1563,30 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
@return: True
"""
res = False
- for event_datas in self.read(cr, uid, ids, ['date', 'rrule', 'exdate'], context=context):
+ for event_datas in self.read(cr, uid, ids, ['date', 'rrule', 'exdate', 'edit_all'], context=context):
event_id = event_datas['id']
+ edit_all = event_datas.get('edit_all', False)
if isinstance(event_id, (int, long)):
res = super(calendar_event, self).unlink(cr, uid, event_id, context=context)
self.pool.get('res.alarm').do_alarm_unlink(cr, uid, [event_id], self._name)
self.unlink_events(cr, uid, [event_id], context=context)
else:
- str_event, date_new = event_id.split('-')
+ select = event_id.split('-')
+ if(len(select) < 2):
+ str_event = event_id
+ date_new = time.strftime("%Y%m%d%H%M%S", \
+ time.strptime(event_datas['date'], "%Y-%m-%d %H:%M:%S"))
+ else:
+ str_event, date_new = select
+
+
event_id = int(str_event)
- if event_datas['rrule']:
+ if event_datas['rrule'] and not edit_all:
# Remove one of the recurrent event
date_new = time.strftime("%Y%m%dT%H%M%S", \
time.strptime(date_new, "%Y%m%d%H%M%S"))
exdate = (event_datas['exdate'] and (event_datas['exdate'] + ',') or '') + date_new
- res = self.write(cr, uid, [event_id], {'exdate': exdate})
+ res = super(calendar_event, self).write(cr, uid, [event_id], {'exdate': exdate})
else:
res = super(calendar_event, self).unlink(cr, uid, [event_id], context=context)
self.pool.get('res.alarm').do_alarm_unlink(cr, uid, [event_id], self._name)
@@ -1601,7 +1620,9 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
res = super(calendar_event, self).create(cr, uid, vals, context)
alarm_obj = self.pool.get('res.alarm')
alarm_obj.do_alarm_create(cr, uid, [res], self._name, 'date', context=context)
- return res
+ records = self.browse(cr, uid, [res], context=context)
+ #return real_id2base_calendar_id(records[0].id, records[0].date)
+ return base_calendar_id2real_id(records[0].id)
def do_tentative(self, cr, uid, ids, context=None, *args):
""" Makes event invitation as Tentative
@@ -1724,6 +1745,13 @@ class ir_attachment(osv.osv):
return super(ir_attachment, self).search(cr, uid, new_args, offset=offset,
limit=limit, order=order,
context=context, count=False)
+
+ def create(self, cr, uid, vals, context=None):
+ if context:
+ id = context.get('default_res_id', False)
+ context.update({'default_res_id' : base_calendar_id2real_id(id)})
+ return super(ir_attachment, self).create(cr, uid, vals, context=context)
+
ir_attachment()
class ir_values(osv.osv):
diff --git a/addons/base_calendar/base_calendar_view.xml b/addons/base_calendar/base_calendar_view.xml
index d536ef02824..a7258feea0f 100644
--- a/addons/base_calendar/base_calendar_view.xml
+++ b/addons/base_calendar/base_calendar_view.xml
@@ -240,7 +240,7 @@
<field name="location" />
<field name="alarm_id" string="Reminder"
widget="selection" />
- <group colspan="2" col="4" >
+ <group colspan="2" col="4" attrs="{'readonly': [('state','=','done')]}">
<field name="recurrency"/>
<field name="edit_all" attrs="{'invisible':[('recurrency','=', False)]}"
on_change="onchange_edit_all(rrule_type,edit_all)"/>
@@ -344,7 +344,7 @@
</form>
</field>
</page>
- <page string="Recurrency Option" attrs="{'invisible':[('recurrency','=',False)]}">
+ <page string="Recurrency Option" attrs="{'invisible': [('recurrency','=',False)]}">
<group col="4" colspan="4" name="rrule">
<group col="4" colspan="4">
<field name="rrule_type" string="Recurrency period"
diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py
index 2c4edc02df7..57ce46b52cc 100644
--- a/addons/crm/crm_meeting.py
+++ b/addons/crm/crm_meeting.py
@@ -75,8 +75,8 @@ class crm_meeting(crm_case, osv.osv):
size=16, readonly=True),
}
_defaults = {
- 'state': lambda *a: 'draft',
- 'active': lambda *a: 1,
+ 'state': 'draft',
+ 'active': 1,
'user_id': lambda self, cr, uid, ctx: uid,
}
diff --git a/addons/crm/crm_meeting_view.xml b/addons/crm/crm_meeting_view.xml
index ae9f584d059..960f83e43c9 100644
--- a/addons/crm/crm_meeting_view.xml
+++ b/addons/crm/crm_meeting_view.xml
@@ -43,7 +43,7 @@
<field name="location" />
<field name="alarm_id" string="Reminder"
widget="selection" />
- <group colspan="2" col="4" >
+ <group colspan="2" col="4" attrs="{'readonly': [('state','=','done')]}">
<field name="recurrency"/>
<field name="edit_all" attrs="{'invisible':[('recurrency','=', False)]}"
on_change="onchange_edit_all(rrule_type,edit_all)"/>
@@ -165,11 +165,10 @@
</form>
</field>
</page>
- <page string="Recurrency Option" attrs="{'invisible':[('recurrency','=',False)]}">
+ <page string="Recurrency Option" attrs="{'invisible': [('recurrency','=',False)], 'readonly': [('state','=','done')]}">
<group col="4" colspan="4" name="rrule">
<group col="4" colspan="4">
- <field name="rrule_type" string="Recurrency period"
- attrs="{'readonly':[('recurrent_uid','!=',False)]}" />
+ <field name="rrule_type" string="Recurrency period" />
<field name="interval" />
diff --git a/addons/crm_claim/report/crm_claim_report_view.xml b/addons/crm_claim/report/crm_claim_report_view.xml
index 94561e87bfa..e790183e5db 100644
--- a/addons/crm_claim/report/crm_claim_report_view.xml
+++ b/addons/crm_claim/report/crm_claim_report_view.xml
@@ -20,7 +20,6 @@
<field name="nbr" string="#Claim" sum="#Claim"/>
<field name="email" sum="# Mails"/>
<field name="delay_close" avg="Avg Closing Delay"/>
- <field name="email"/>
<field name="probability" widget="progressbar"/>
<field name="delay_expected"/>
<field name="state" invisible="1"/>
diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py
index 9d6328af1eb..3e7a4a1b3a2 100644
--- a/addons/hr_holidays/hr_holidays.py
+++ b/addons/hr_holidays/hr_holidays.py
@@ -126,7 +126,7 @@ class hr_holidays(osv.osv):
'notes': fields.text('Reasons',readonly=True, states={'draft':[('readonly',False)]}),
'number_of_days_temp': fields.float('Number of Days', readonly=True, states={'draft':[('readonly',False)]}),
'number_of_days': fields.function(_compute_number_of_days, method=True, string='Number of Days', store=True),
- 'case_id': fields.many2one('crm.meeting', 'Meeting'),
+ 'case_id': fields.char('Meeting', size=64),
'type': fields.selection([('remove','Leave Request'),('add','Allocation Request')], 'Request Type', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="Choose 'Leave Request' if someone wants to take an off-day. \nChoose 'Allocation Request' if you want to increase the number of leaves available for someone"),
'parent_id': fields.many2one('hr.holidays', 'Parent'),
'linked_request_ids': fields.one2many('hr.holidays', 'parent_id', 'Linked Requests',),
@@ -290,7 +290,7 @@ class hr_holidays(osv.osv):
for record in self.browse(cr, uid, ids):
# Delete the meeting
if record.case_id:
- obj_crm_meeting.unlink(cr, uid, [record.case_id.id])
+ obj_crm_meeting.unlink(cr, uid, [record.case_id])
# If a category that created several holidays, cancel all related
wf_service = netsvc.LocalService("workflow")
diff --git a/addons/product/product.py b/addons/product/product.py
index 12ad7676fb0..ff18fad0a30 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -565,7 +565,7 @@ class product_product(osv.osv):
ids += self.search(cr, user, [('name',operator,name)]+ args, limit=limit, context=context)
if not len(ids):
ptrn=re.compile('(\[(.*?)\])')
- res = ptrn.search(str(name))
+ res = ptrn.search(name)
if res:
ids = self.search(cr, user, [('default_code','ilike',res.group(2))]+ args, limit=limit, context=context)
else:
diff --git a/addons/project/board_project_view.xml b/addons/project/board_project_view.xml
index 31b8e5085e2..822781ccb38 100644
--- a/addons/project/board_project_view.xml
+++ b/addons/project/board_project_view.xml
@@ -6,14 +6,14 @@
<field name="name">Project</field>
</record>
- <!-- Editable My task -->
+ <!-- My task -->
<record id="view_task_tree" model="ir.ui.view">
<field name="name">project.task.tree</field>
<field name="model">project.task</field>
<field name="type">tree</field>
<field eval="99" name="priority"/>
<field name="arch" type="xml">
- <tree editable="top" colors="red:date_deadline&lt;current_date;blue:date_deadline==current_date;black:date_deadline&gt;current_date" string="My Tasks">
+ <tree colors="red:date_deadline&lt;current_date;blue:date_deadline==current_date;black:date_deadline&gt;current_date" string="My Tasks">
<field name="name"/>
<field name="project_id"/>
<field name="date_deadline"/>
diff --git a/addons/project/project.py b/addons/project/project.py
index 663ef5673de..bff63746d9a 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -476,8 +476,20 @@ class task(osv.osv):
ids = child_ids
return True
+ def _check_dates(self, cr, uid, ids, context=None):
+ if context == None:
+ context = {}
+ obj_task = self.browse(cr, uid, ids[0], context=context)
+ start = obj_task.date_start or False
+ end = obj_task.date_end or False
+ if start and end :
+ if start > end:
+ return False
+ return True
+
_constraints = [
- (_check_recursion, 'Error ! You cannot create recursive tasks.', ['parent_ids'])
+ (_check_recursion, 'Error ! You cannot create recursive tasks.', ['parent_ids']),
+ (_check_dates, 'Error ! Task end-date must be greater then task start-date', ['date_start','date_end'])
]
#
# Override view according to the company definition
@@ -541,6 +553,7 @@ class task(osv.osv):
"""
request = self.pool.get('res.request')
for task in self.browse(cr, uid, ids, context=context):
+ vals = {}
project = task.project_id
if project:
# Send request to project manager
@@ -563,7 +576,11 @@ class task(osv.osv):
reopen = False
if reopen:
self.do_reopen(cr, uid, [parent_id.id])
- self.write(cr, uid, [task.id], {'state': 'done', 'date_end':time.strftime('%Y-%m-%d %H:%M:%S'), 'remaining_hours': 0.0})
+ vals.update({'state': 'done'})
+ vals.update({'remaining_hours': 0.0})
+ if not task.date_end:
+ vals.update({ 'date_end':time.strftime('%Y-%m-%d %H:%M:%S')})
+ self.write(cr, uid, [task.id],vals)
message = _("The task '%s' is done") % (task.name,)
self.log(cr, uid, task.id, message)
return True
diff --git a/addons/purchase/stock.py b/addons/purchase/stock.py
index e32528f985d..f8f21428540 100644
--- a/addons/purchase/stock.py
+++ b/addons/purchase/stock.py
@@ -143,8 +143,12 @@ class stock_partial_picking(osv.osv_memory):
if has_product_cost and m.product_id.cost_method == 'average' and m.purchase_line_id:
# We use the original PO unit purchase price as the basis for the cost, expressed
# in the currency of the PO (i.e the PO's pricelist currency)
- res['move%s_product_price'%(m.id)] = m.purchase_line_id.price_unit
- res['move%s_product_currency'%(m.id)] = pick.purchase_id.pricelist_id.currency_id.id
+ list_index = 0
+ for item in res['product_moves_in']:
+ if item['move_id'] == m.id:
+ res['product_moves_in'][list_index]['cost'] = m.purchase_line_id.price_unit
+ res['product_moves_in'][list_index]['currency'] = m.picking_id.purchase_id.pricelist_id.currency_id.id
+ list_index += 1
return res
stock_partial_picking()
@@ -168,8 +172,12 @@ class stock_partial_move(osv.osv_memory):
and m.purchase_line_id and m.picking_id.purchase_id:
# We use the original PO unit purchase price as the basis for the cost, expressed
# in the currency of the PO (i.e the PO's pricelist currency)
- res['move%s_product_price'%(m.id)] = m.purchase_line_id.price_unit
- res['move%s_product_currency'%(m.id)] = m.picking_id.purchase_id.pricelist_id.currency_id.id
+ list_index = 0
+ for item in res['product_moves_in']:
+ if item['move_id'] == m.id:
+ res['product_moves_in'][list_index]['cost'] = m.purchase_line_id.price_unit
+ res['product_moves_in'][list_index]['currency'] = m.picking_id.purchase_id.pricelist_id.currency_id.id
+ list_index += 1
return res
stock_partial_move()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py
index 2ad2784b323..48243c57dda 100644
--- a/addons/share/wizard/share_wizard.py
+++ b/addons/share/wizard/share_wizard.py
@@ -56,11 +56,11 @@ class share_create(osv.osv_memory):
'domain': fields.char('Domain', size=256, help="Optional domain for further data filtering"),
'user_type': fields.selection([('existing','Existing external users'),('new','New users (emails required)')],'Users to share with',
help="Select the type of user(s) you would like to share data with."),
- 'user_ids': fields.one2many('share.wizard.user', 'share_wizard_id', 'Users'),
+ 'user_ids': fields.many2many('res.users', 'share_wizard_res_user_rel', 'share_id', 'user_id', 'Existing users', domain=[('share', '=', True)]),
'new_users': fields.text("New users"),
'access_mode': fields.selection([('readwrite','Read & Write'),('readonly','Read-only')],'Access Mode'),
- 'result_line_ids': fields.one2many('share.wizard.result.line', 'share_wizard_id', 'Summary'),
- 'share_root_url': fields.char('Generic Share Access URL', size=512, tooltip='Main access page for users that are granted shared access')
+ 'result_line_ids': fields.one2many('share.wizard.result.line', 'share_wizard_id', 'Summary', readonly=True),
+ 'share_root_url': fields.char('Generic Share Access URL', size=512, readonly=True, tooltip='Main access page for users that are granted shared access')
}
_defaults = {
'user_type' : lambda self, cr, uid, *a: 'existing' if self.pool.get('res.users').search(cr, uid, [('share', '=', True)]) else 'new',
@@ -100,7 +100,7 @@ class share_create(osv.osv_memory):
existing = user_obj.search(cr, 1, [('login', '=', new_user)])
if existing:
raise osv.except_osv(_('User already exists'),
- _('This username (%s) already exists, perhaps data has already been shared with this person.\nYou may want to try selecting existing shared users instead.'))
+ _('This username (%s) already exists, perhaps data has already been shared with this person.\nYou may want to try selecting existing shared users instead.') % new_user)
user_id = user_obj.create(cr, 1, {
'login': new_user,
'password': generate_random_pass(),
@@ -113,8 +113,36 @@ class share_create(osv.osv_memory):
user_ids.append(user_id)
return user_ids
- def _setup_action_and_shortcut(self, cr, uid, wizard_data, user_ids, new_users, context=None):
+ def _create_shortcut(self, cr, uid, values, context=None):
+ if context is None:
+ context = {}
+ new_context = context.copy()
+ for key in context:
+ if key.startswith('default_'):
+ del new_context[key]
+
+ dataobj = self.pool.get('ir.model.data')
+ menu_id = dataobj._get_id(cr, uid, 'base', 'menu_administration_shortcut', new_context)
+ shortcut_menu_id = int(dataobj.read(cr, uid, menu_id, ['res_id'], new_context)['res_id'])
+ action_id = self.pool.get('ir.actions.act_window').create(cr, 1, values, new_context)
+ menu_data = {'name': values['name'],
+ 'sequence': 10,
+ 'action': 'ir.actions.act_window,'+str(action_id),
+ 'parent_id': shortcut_menu_id,
+ 'icon': 'STOCK_JUSTIFY_FILL'}
menu_obj = self.pool.get('ir.ui.menu')
+ menu_id = menu_obj.create(cr, 1, menu_data)
+ sc_data= {'name': values['name'], 'sequence': 1,'res_id': menu_id }
+ sc_menu_id = self.pool.get('ir.ui.view_sc').create(cr, uid, sc_data, new_context)
+
+ # update menu cache
+ user_groups = set(self.pool.get('res.users').read(cr, 1, uid, ['groups_id'])['groups_id'])
+ key = (cr.dbname, shortcut_menu_id, tuple(user_groups))
+ menu_obj._cache[key] = True
+ return action_id
+
+
+ def _setup_action_and_shortcut(self, cr, uid, wizard_data, user_ids, new_users, context=None):
user_obj = self.pool.get('res.users')
menu_action_id = user_obj._get_menu(cr, uid, context=context)
values = {
@@ -127,7 +155,7 @@ class share_create(osv.osv_memory):
'search_view_id': wizard_data.action_id.search_view_id.id,
}
for user_id in user_ids:
- action_id = menu_obj.create_shortcut(cr, user_id, values)
+ action_id = self._create_shortcut(cr, user_id, values)
if new_users:
user_obj.write(cr, 1, [user_id], {'action_id': action_id})
else:
@@ -143,13 +171,14 @@ class share_create(osv.osv_memory):
during recursion
@param suffix: optional suffix to append to the field path to reach the main object
"""
+
if relation_fields is None:
relation_fields = []
local_rel_fields = []
models = [x[1].model for x in relation_fields]
model_obj = self.pool.get('ir.model')
model_osv = self.pool.get(model.model)
- for field in model_osv._columns.values() + [x[2] for x in model_osv._inherit_fields]:
+ for field in model_osv._columns.values() + [x[2] for x in model_osv._inherit_fields.itervalues()]:
if field._type in ttypes and field._obj not in models:
relation_model_id = model_obj.search(cr, uid, [('model','=',field._obj)])[0]
if field._type == 'one2many':
@@ -160,14 +189,13 @@ class share_create(osv.osv_memory):
local_rel_fields.append((relation_field, model_browse))
if relation_model_id != model.id and field._type in ['one2many', 'many2many']:
local_rel_fields += self._get_recursive_relations(cr, uid, model_browse,
- [field._type], local_rel_fields, suffix=relation_field, context=context)
+ [field._type], relation_fields + local_rel_fields, suffix=relation_field, context=context)
return local_rel_fields
def _get_relationship_classes(self, cr, uid, model, context=None):
obj0 = [(None, model)]
obj1 = self._get_recursive_relations(cr, uid, model, ['one2many'], context=context)
- obj2 = self._get_recursive_relations(cr, uid, model, ['one2many', 'many2many'],
- context=context)
+ obj2 = self._get_recursive_relations(cr, uid, model, ['one2many', 'many2many'], context=context)
obj3 = self._get_recursive_relations(cr, uid, model, ['many2one'], context=context)
for dummy, model in obj1:
obj3 += self._get_recursive_relations(cr, uid, model, ['many2one'], context=context)
@@ -311,12 +339,12 @@ class share_create(osv.osv_memory):
# existing users
for user in wizard_data.user_ids:
share_url = share_root_url % \
- {'login': user.user_id.login,
+ {'login': user.login,
'password': '',
'dbname': cr.dbname} if format_url else share_root_url
result_obj.create(cr, uid, {
'share_wizard_id': wizard_data.id,
- 'login': user.user_id.login,
+ 'login': user.login,
'password': existing_passwd_str,
'share_url': share_url,
'newly_created': False,
@@ -335,7 +363,7 @@ class share_create(osv.osv_memory):
if wizard_data.user_type == 'new':
user_ids = self._create_new_share_users(cr, uid, wizard_data, group_id, context=context)
else:
- user_ids = [x.user_id.id for x in wizard_data.user_ids]
+ user_ids = [x.id for x in wizard_data.user_ids]
# reset home action to regular menu as user needs access to multiple items
user_obj.write(cr, 1, user_ids, {
'groups_id': [(4,group_id)],
@@ -423,7 +451,7 @@ class share_create(osv.osv_memory):
email_to = result_line.login
subject = _('%s has shared OpenERP %s information with you') % (user.name, wizard_data.action_id.name)
body = _("Dear,\n\n") + subject + "\n\n"
- body += _("To access it, you can go to the following URL:\n %s") % wizard_data.share_root_url
+ body += _("To access it, you can go to the following URL:\n %s") % result_line.share_url
body += "\n\n"
if result_line.newly_created:
body += _("You may use the following login and password to get access to this protected area:") + "\n"
@@ -436,22 +464,13 @@ class share_create(osv.osv_memory):
if not tools.email_send(
user.user_email,
- email_to,
+ [email_to],
subject,
body):
self.__logger.warning('Failed to send sharing email from %s to %s', user.user_email, email_to)
return {'type': 'ir.actions.act_window_close'}
share_create()
-class share_user_ref(osv.osv_memory):
- _name = 'share.wizard.user'
- _rec_name = 'user_id'
- _columns = {
- 'user_id': fields.many2one('res.users', 'Users', required=True, domain=[('share', '=', True)]),
- 'share_wizard_id': fields.many2one('share.wizard', 'Share Wizard', required=True),
- }
-share_user_ref()
-
class share_result_line(osv.osv_memory):
_name = 'share.wizard.result.line'
_rec_name = 'login'
diff --git a/addons/share/wizard/share_wizard_view.xml b/addons/share/wizard/share_wizard_view.xml
index 95fbc983c84..bd281c7e97a 100644
--- a/addons/share/wizard/share_wizard_view.xml
+++ b/addons/share/wizard/share_wizard_view.xml
@@ -33,11 +33,7 @@
<field name="user_type"/>
<group colspan="4" attrs="{'invisible':[('user_type','!=','existing')]}">
<separator colspan="4" string="Existing External Users"/>
- <field colspan="4" nolabel="1" name="user_ids" mode="tree">
- <tree editable="bottom" string="">
- <field name="user_id"/>
- </tree>
- </field>
+ <field colspan="4" nolabel="1" name="user_ids" mode="tree"/>
</group>
<group colspan="4" attrs="{'invisible':[('user_type','!=','new')]}">
<separator colspan="4" string="New Users (please provide one e-mail address per line below)"/>
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index 7ccc7214230..0a2d3a8728d 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -806,7 +806,7 @@
<button name="action_assign" states="confirmed" string="Check Availability" type="object" icon="gtk-find"/>
<button name="force_assign" states="confirmed" string="Force Availability" type="object" icon="gtk-jump-to"/>
<button name="action_process" states="assigned" string="Process" groups="stock.group_stock_user" type="object" icon="gtk-go-forward"/>
- <button states="done" name="%(action_stock_invoice_onshipping)d" string="Create Invoice" attrs="{'invisible': ['|',('invoice_state','=','invoiced'),('invoice_state','=','none')]}" type="action" icon="terp-gtk-go-back-rtl" />
+ <button name="%(action_stock_invoice_onshipping)d" string="Create Invoice" attrs="{'invisible': ['|','|',('state','&lt;&gt;','done'),('invoice_state','=','invoiced'),('invoice_state','=','none')]}" type="action" icon="terp-gtk-go-back-rtl" />
</group>
</page>
<page string="Additional info" groups="base.group_extended,base.group_multi_company">
@@ -1000,7 +1000,7 @@
<button name="force_assign" states="confirmed" string="Force Availability" type="object" icon="gtk-jump-to"/>
<button name="action_process" states="assigned" string="Process" type="object" icon="gtk-go-forward"/>
<button name="%(act_stock_return_picking)d" string="Return Products" states="done" type="action" icon="gtk-execute"/>
- <button name="%(action_stock_invoice_onshipping)d" string="Create Invoice" states="done" attrs="{'invisible': ['|',('invoice_state','=','invoiced'),('invoice_state','=','none')]}" type="action" icon="terp-gtk-go-back-rtl"/>
+ <button name="%(action_stock_invoice_onshipping)d" string="Create Invoice" attrs="{'invisible': ['|','|',('state','&lt;&gt;','done'),('invoice_state','=','invoiced'),('invoice_state','=','none')]}" type="action" icon="terp-gtk-go-back-rtl"/>
</group>
</page>
<page string="Additional info" groups="base.group_extended,base.group_multi_company">
@@ -1222,7 +1222,7 @@
<group colspan="1" states="done">
<button name="%(act_stock_return_picking)d" string="Return Products" states="done" type="action" icon="gtk-execute"/>
</group>
- <button name="%(action_stock_invoice_onshipping)d" string="Create Invoice" attrs="{'invisible': ['|',('invoice_state','=','invoiced'),('invoice_state','=','none')]}" type="action" icon="terp-gtk-go-back-rtl" />
+ <button states="done" name="%(action_stock_invoice_onshipping)d" string="Create Invoice" attrs="{'invisible': ['|','|',('state','&lt;&gt;','done'),('invoice_state','=','invoiced'),('invoice_state','=','none')]}" type="action" icon="terp-gtk-go-back-rtl" />
</group>
</page>
<page string="Additional Info" groups="base.group_extended,base.group_multi_company">
diff --git a/addons/survey/survey.py b/addons/survey/survey.py
index c06d274f20d..a36f8a1ffa6 100644
--- a/addons/survey/survey.py
+++ b/addons/survey/survey.py
@@ -184,7 +184,7 @@ class survey_page(osv.osv):
if len(context['line_order'][-1]) > 2 and type(context['line_order'][-1][2]) == type({}) and context['line_order'][-1][2].has_key('sequence'):
data['sequence'] = context['line_order'][-1][2]['sequence'] + 1
if context.has_key('survey_id'):
- data['survey_id'] = context['survey_id']
+ data['survey_id'] = context.get('survey_id', False)
return data
def survey_save(self, cr, uid, ids, context=None):
diff --git a/addons/survey/wizard/survey_answer.py b/addons/survey/wizard/survey_answer.py
index 23315d51c65..0d541079ba6 100644
--- a/addons/survey/wizard/survey_answer.py
+++ b/addons/survey/wizard/survey_answer.py
@@ -297,8 +297,9 @@ class survey_question_wiz(osv.osv_memory):
fields[tools.ustr(que.id) + "_" + tools.ustr(ans.id)] = {'type':'datetime', 'string':ans.answer}
elif que_rec.type == 'descriptive_text':
- for que_test in que_rec.descriptive_text.split('\n'):
- etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr(que_test)), 'align':"0.0"})
+ if que_rec.descriptive_text:
+ for que_test in que_rec.descriptive_text.split('\n'):
+ etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr(que_test)), 'align':"0.0"})
elif que_rec.type == 'single_textbox':
etree.SubElement(xml_group, 'field', {'readonly' :str(readonly), 'name': tools.ustr(que.id) + "_single", 'nolabel':"1" ,'colspan':"4"})
diff --git a/addons/thunderbird/plugin/openerp_plugin.xpi b/addons/thunderbird/plugin/openerp_plugin.xpi
index 50a55a626e4..d48a2a5c45e 100644
--- a/addons/thunderbird/plugin/openerp_plugin.xpi
+++ b/addons/thunderbird/plugin/openerp_plugin.xpi
Binary files differ
diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar
index c52c70bf74e..cf2c5037405 100644
--- a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar
+++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar
Binary files differ
diff --git a/addons/thunderbird/plugin/openerp_plugin/makefile b/addons/thunderbird/plugin/openerp_plugin/makefile
index 711fdfe117e..17ed0319bcc 100644
--- a/addons/thunderbird/plugin/openerp_plugin/makefile
+++ b/addons/thunderbird/plugin/openerp_plugin/makefile
@@ -1,7 +1,7 @@
all: xpi
jar:
- jar cvf chrome/openerp_plugin.jar chrome/openerp_plugin/*
+ jar cvf chrome/openerp_plugin.jar -C chrome/openerp_plugin/ .
xpi: jar
zip -r ../openerp_plugin.xpi *
diff --git a/addons/web_uservoice/web/editors.py b/addons/web_uservoice/web/editors.py
index 05b5a6651cd..585bc3428f3 100644
--- a/addons/web_uservoice/web/editors.py
+++ b/addons/web_uservoice/web/editors.py
@@ -2,7 +2,7 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
-# Copyright (C) 2010 OpenERP s.a. (<http://openerp.com>).
+# Copyright (C) 2010-2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@@ -19,7 +19,6 @@
#
##############################################################################
import openobject.templating
-from tools.translate import _
class BaseTemplateEditor(openobject.templating.TemplateEditor):
templates = ['/openobject/controllers/templates/base.mako']