[MERGE] forward port of branch 7.0 up to 3e7d3c7
This commit is contained in:
commit
d6ae7fb7db
|
@ -1753,7 +1753,7 @@ class account_tax_code(osv.osv):
|
|||
res2 = {}
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
def _rec_get(record):
|
||||
amount = res.get(record.id, 0.0)
|
||||
amount = res.get(record.id) or 0.0
|
||||
for rec in record.child_ids:
|
||||
amount += _rec_get(rec) * rec.sign
|
||||
return amount
|
||||
|
|
|
@ -92,6 +92,7 @@ class account_payment_populate_statement(osv.osv_memory):
|
|||
'date': line.date or time.strftime('%Y-%m-%d'),
|
||||
'amount': abs(amount),
|
||||
'period_id': statement.period_id.id,
|
||||
'payment_rate_currency_id': statement.currency.id,
|
||||
}
|
||||
voucher_id = voucher_obj.create(cr, uid, voucher_res, context=context)
|
||||
|
||||
|
|
|
@ -5,5 +5,16 @@
|
|||
<menuitem name="Import & Synchronize" id="base.menu_import_crm"
|
||||
parent="base.menu_base_partner"/>
|
||||
|
||||
<record id="view_crm_meeting_search" model="ir.ui.view">
|
||||
<field name="name">CRM - Meetings Search</field>
|
||||
<field name="model">crm.meeting</field>
|
||||
<field name="inherit_id" ref="base_calendar.view_crm_meeting_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='user_id']" position="after">
|
||||
<field name="opportunity_id"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -919,6 +919,7 @@ class crm_lead(format_address, osv.osv):
|
|||
opportunity = self.browse(cr, uid, ids[0], context)
|
||||
res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid, 'calendar', 'action_calendar_event', context)
|
||||
res['context'] = {
|
||||
'search_default_opportunity_id': opportunity.id,
|
||||
'default_opportunity_id': opportunity.id,
|
||||
'default_partner_id': opportunity.partner_id and opportunity.partner_id.id or False,
|
||||
'default_partner_ids' : opportunity.partner_id and [opportunity.partner_id.id] or False,
|
||||
|
|
|
@ -392,7 +392,7 @@
|
|||
name="%(opportunity2phonecall_act)d"/>
|
||||
<button string="Meeting" type="object"
|
||||
name="action_makeMeeting"
|
||||
context="{'search_default_attendee_id': active_id, 'default_attendee_id' : active_id}"/>
|
||||
type="object" />
|
||||
</div>
|
||||
<div class="oe_title">
|
||||
<label for="name" class="oe_edit_only"/>
|
||||
|
|
|
@ -109,8 +109,11 @@ class document_file(osv.osv):
|
|||
ids.extend(parents[parent_id])
|
||||
|
||||
# sort result according to the original sort ordering
|
||||
ids = [id for id in orig_ids if id in ids]
|
||||
return len(ids) if count else ids
|
||||
if count:
|
||||
return len(ids)
|
||||
else:
|
||||
set_ids = set(ids)
|
||||
return [id for id in orig_ids if id in set_ids]
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
if not default:
|
||||
|
|
|
@ -270,7 +270,7 @@
|
|||
<separator/>
|
||||
<filter icon="terp-personal" string="My Events" help="My Events" domain="[('user_id','=',uid)]"/>
|
||||
<separator/>
|
||||
<filter icon="terp-go-today" string="Upcoming" name="upcoming" domain="[('date_begin','>=', time.strftime('%%Y-%%m-%%d 00:00:00'))]" help="Upcoming events from today" />
|
||||
<filter icon="terp-go-today" string="Upcoming" name="upcoming" domain="[('date_begin','>=', datetime.datetime.combine(context_today(), datetime.time(0,0,0)))]" help="Upcoming events from today" />
|
||||
<field name="type"/>
|
||||
<field name="user_id"/>
|
||||
<group expand="0" string="Group By...">
|
||||
|
|
|
@ -259,7 +259,7 @@
|
|||
<field name="date"/>
|
||||
<field name="member_price"/>
|
||||
<field name="membership_id"/>
|
||||
<field name="account_invoice_id"/>
|
||||
<field name="account_invoice_id" context="{'form_view_ref': 'account.invoice_form'}"/>
|
||||
<field name="state" colspan="4"/>
|
||||
</form>
|
||||
</field>
|
||||
|
|
|
@ -952,7 +952,7 @@
|
|||
<field name="name" />
|
||||
<filter string="Open" domain="[('state', '=', 'opened')]" />
|
||||
<separator/>
|
||||
<filter string="Today" domain="[('start_at', '>=', time.strftime('%%Y-%%m-%%d 00:00:00'))]" />
|
||||
<filter string="Today" domain="[('start_at', '>=', datetime.datetime.combine(context_today(), datetime.time(0,0,0)))]" />
|
||||
<field name="config_id" />
|
||||
<field name="user_id" />
|
||||
<group expand="0" string="Group By...">
|
||||
|
|
|
@ -19,12 +19,13 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp import SUPERUSER_ID
|
||||
from openerp.osv import fields, osv
|
||||
from openerp.tools.translate import _
|
||||
import logging
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
UID_ROOT = 1
|
||||
UID_ROOT = SUPERUSER_ID
|
||||
SHARED_DOCS_MENU = "Documents"
|
||||
SHARED_DOCS_CHILD_MENU = "Shared Documents"
|
||||
|
||||
|
@ -56,9 +57,18 @@ class share_wizard_portal(osv.TransientModel):
|
|||
return super(share_wizard_portal, self)._check_preconditions(cr, uid, wizard_data, context=context)
|
||||
|
||||
def _create_or_get_submenu_named(self, cr, uid, parent_menu_id, menu_name, context=None):
|
||||
if not parent_menu_id:
|
||||
return
|
||||
if context is None:
|
||||
context = {}
|
||||
Menus = self.pool.get('ir.ui.menu')
|
||||
if not parent_menu_id and context.get('group_id'):
|
||||
cxt = dict(context)
|
||||
cxt['ir.ui.menu.full_list'] = True
|
||||
parent_menu_ids = Menus.search(cr, SUPERUSER_ID,
|
||||
[('groups_id', 'in', [context.get('group_id')]), ('parent_id', '=', False)], limit=1, context=cxt)
|
||||
parent_menu_id = parent_menu_ids and parent_menu_ids[0] or False
|
||||
if not parent_menu_id:
|
||||
return False
|
||||
|
||||
parent_menu = Menus.browse(cr, uid, parent_menu_id) # No context
|
||||
menu_id = None
|
||||
max_seq = 10
|
||||
|
@ -79,9 +89,12 @@ class share_wizard_portal(osv.TransientModel):
|
|||
def _sharing_root_menu_id(self, cr, uid, portal, context=None):
|
||||
"""Create or retrieve root ID of sharing menu in portal menu
|
||||
|
||||
:param portal: browse_record of portal, constructed with a context WITHOUT language
|
||||
:param portal: browse_record of shared group, constructed with a context WITHOUT language
|
||||
"""
|
||||
parent_menu_id = self._create_or_get_submenu_named(cr, uid, portal.parent_menu_id.id, SHARED_DOCS_MENU, context=context)
|
||||
if context is None:
|
||||
context = {}
|
||||
ctx = dict(context, group_id=portal.id)
|
||||
parent_menu_id = self._create_or_get_submenu_named(cr, uid, False, SHARED_DOCS_MENU, context=ctx)
|
||||
if parent_menu_id:
|
||||
child_menu_id = self._create_or_get_submenu_named(cr, uid, parent_menu_id, SHARED_DOCS_CHILD_MENU, context=context)
|
||||
return child_menu_id
|
||||
|
@ -90,7 +103,7 @@ class share_wizard_portal(osv.TransientModel):
|
|||
"""Create sharing menus in portal menu according to share wizard options.
|
||||
|
||||
:param wizard_data: browse_record of share.wizard
|
||||
:param portal: browse_record of portal, constructed with a context WITHOUT language
|
||||
:param portal: browse_record of shared group, constructed with a context WITHOUT language
|
||||
"""
|
||||
root_menu_id = self._sharing_root_menu_id(cr, uid, portal, context=context)
|
||||
if not root_menu_id:
|
||||
|
@ -126,13 +139,16 @@ class share_wizard_portal(osv.TransientModel):
|
|||
# setup the menu for portal groups
|
||||
for group in wizard_data.group_ids:
|
||||
if group.id in all_portal_group_ids:
|
||||
self._create_shared_data_menu(cr, uid, wizard_data, group.id, context=context)
|
||||
self._create_shared_data_menu(cr, uid, wizard_data, group, context=context)
|
||||
|
||||
for user in group.users:
|
||||
new_line = {'user_id': user.id,
|
||||
'newly_created': False}
|
||||
wizard_data.write({'result_line_ids': [(0,0,new_line)]})
|
||||
|
||||
selected_group_ids = [x.id for x in wizard_data.group_ids]
|
||||
res_groups.write(cr, SUPERUSER_ID, selected_group_ids, {'implied_ids': [(4, super_result[0])]})
|
||||
|
||||
elif wizard_data.user_ids:
|
||||
# must take care of existing users, by adding them to the new group, which is super_result[0],
|
||||
# and adding the shortcut
|
||||
|
|
|
@ -1103,13 +1103,20 @@ class task(osv.osv):
|
|||
context = context or {}
|
||||
result = ""
|
||||
ident = ' '*ident
|
||||
company = self.pool["res.users"].browse(cr, uid, uid, context=context).company_id
|
||||
duration_uom = {
|
||||
'day(s)': 'd', 'days': 'd', 'day': 'd', 'd': 'd',
|
||||
'month(s)': 'm', 'months': 'm', 'month': 'month', 'm': 'm',
|
||||
'week(s)': 'w', 'weeks': 'w', 'week': 'w', 'w': 'w',
|
||||
'hour(s)': 'H', 'hours': 'H', 'hour': 'H', 'h': 'H',
|
||||
}.get(company.project_time_mode_id.name.lower(), "hour(s)")
|
||||
for task in tasks:
|
||||
if task.stage_id and task.stage_id.fold:
|
||||
continue
|
||||
result += '''
|
||||
%sdef Task_%s():
|
||||
%s todo = \"%.2fH\"
|
||||
%s effort = \"%.2fH\"''' % (ident,task.id, ident,task.remaining_hours, ident,task.total_hours)
|
||||
%s todo = \"%.2f%s\"
|
||||
%s effort = \"%.2f%s\"''' % (ident, task.id, ident, task.remaining_hours, duration_uom, ident, task.total_hours, duration_uom)
|
||||
start = []
|
||||
for t2 in task.parent_ids:
|
||||
start.append("up.Task_%s.end" % (t2.id,))
|
||||
|
|
|
@ -1333,10 +1333,16 @@ class account_invoice(osv.Model):
|
|||
for order in purchase_order_obj.browse(cr, uid, po_ids, context=context):
|
||||
purchase_order_obj.message_post(cr, user_id, order.id, body=_("Invoice received"), context=context)
|
||||
invoiced = []
|
||||
shipped = True
|
||||
# for invoice method manual or order, don't care about shipping state
|
||||
# for invoices based on incoming shippment, beware of partial deliveries
|
||||
if (order.invoice_method == 'picking' and
|
||||
not all(picking.invoice_state in ['invoiced'] for picking in order.picking_ids)):
|
||||
shipped = False
|
||||
for po_line in order.order_line:
|
||||
if any(line.invoice_id.state not in ['draft', 'cancel'] for line in po_line.invoice_lines):
|
||||
if all(line.invoice_id.state not in ['draft', 'cancel'] for line in po_line.invoice_lines):
|
||||
invoiced.append(po_line.id)
|
||||
if invoiced:
|
||||
if invoiced and shipped:
|
||||
self.pool['purchase.order.line'].write(cr, uid, invoiced, {'invoiced': True})
|
||||
workflow.trg_write(uid, 'purchase.order', order.id, cr)
|
||||
return res
|
||||
|
|
|
@ -2707,9 +2707,11 @@ class stock_move(osv.osv):
|
|||
continue
|
||||
partial_data = partial_datas.get('move%s'%(move.id), False)
|
||||
assert partial_data, _('Missing partial picking data for move #%s.') % (move.id)
|
||||
product_qty = partial_data.get('product_qty',0.0)
|
||||
move_product_qty[move.id] = product_qty
|
||||
product_uom = partial_data.get('product_uom', False)
|
||||
product_qty = partial_data.get('product_qty', 0.0)
|
||||
product_qty = self.pool['product.uom']._compute_qty(cr, uid, product_uom, product_qty, move.product_uom.id)
|
||||
move_product_qty[move.id] = product_qty
|
||||
|
||||
product_price = partial_data.get('product_price',0.0)
|
||||
product_currency = partial_data.get('product_currency',False)
|
||||
prodlot_ids[move.id] = partial_data.get('prodlot_id')
|
||||
|
|
|
@ -1384,7 +1384,7 @@
|
|||
<filter icon="terp-stock" string="To Do" name="future" domain="[('state','in',('assigned','confirmed','waiting'))]" help="Stock moves that are Confirmed, Available or Waiting"/>
|
||||
<filter icon="terp-dialog-close" string="Done" name="done" domain="[('state','=','done')]" help="Stock moves that have been processed"/>
|
||||
<separator/>
|
||||
<filter icon="terp-go-today" string="Today" domain="[('date','<=',time.strftime('%%Y-%%m-%%d 23:59:59')),('date','>=',time.strftime('%%Y-%%m-%%d 00:00:00'))]" help="Orders processed Today or planned for Today"/>
|
||||
<filter icon="terp-go-today" string="Today" domain="[('date','<=', datetime.datetime.combine(context_today(), datetime.time(23,59,59))), ('date','>=', datetime.datetime.combine(context_today(), datetime.time(0,0,0)))]" help="Orders processed Today or planned for Today"/>
|
||||
<field name="product_id"/>
|
||||
<field name="name" string="Location" filter_domain="['|',('location_id','ilike',self),('location_dest_id','ilike',self)]"/>
|
||||
<field name="partner_id" string="Partner" filter_domain="[('picking_id.partner_id','child_of',self)]"/>
|
||||
|
|
|
@ -899,15 +899,15 @@ class view(osv.osv):
|
|||
if model_value._obj==node_obj:
|
||||
_Node_Field=model_key
|
||||
_Model_Field=model_value._fields_id
|
||||
flag=False
|
||||
for node_key,node_value in _Node_Obj._columns.items():
|
||||
if node_value._type=='one2many':
|
||||
if node_value._obj==conn_obj:
|
||||
if src_node in _Arrow_Obj._columns and flag:
|
||||
# _Source_Field = "Incoming Arrows" (connected via des_node)
|
||||
if node_value._fields_id == des_node:
|
||||
_Source_Field=node_key
|
||||
if des_node in _Arrow_Obj._columns and not flag:
|
||||
# _Destination_Field = "Outgoing Arrows" (connected via src_node)
|
||||
if node_value._fields_id == src_node:
|
||||
_Destination_Field=node_key
|
||||
flag = True
|
||||
|
||||
datas = _Model_Obj.read(cr, uid, id, [],context)
|
||||
for a in _Node_Obj.read(cr,uid,datas[_Node_Field],[]):
|
||||
|
|
|
@ -250,7 +250,7 @@ class Cursor(object):
|
|||
def split_for_in_conditions(self, ids):
|
||||
"""Split a list of identifiers into one or more smaller tuples
|
||||
safe for IN conditions, after uniquifying them."""
|
||||
return tools.misc.split_every(self.IN_MAX, set(ids))
|
||||
return tools.misc.split_every(self.IN_MAX, ids)
|
||||
|
||||
def print_log(self):
|
||||
global sql_counter
|
||||
|
|
Loading…
Reference in New Issue