[MERGE] Forward-port of 7.0 up to 64ac1b0
This commit is contained in:
commit
f3880a8a09
|
@ -235,18 +235,8 @@ class document_directory(osv.osv):
|
||||||
_parent(dir_id, path)
|
_parent(dir_id, path)
|
||||||
return path
|
return path
|
||||||
|
|
||||||
def _check_recursion(self, cr, uid, ids, context=None):
|
|
||||||
level = 100
|
|
||||||
while len(ids):
|
|
||||||
cr.execute('select distinct parent_id from document_directory where id in ('+','.join(map(str,ids))+')')
|
|
||||||
ids = filter(None, map(lambda x:x[0], cr.fetchall()))
|
|
||||||
if not level:
|
|
||||||
return False
|
|
||||||
level -= 1
|
|
||||||
return True
|
|
||||||
|
|
||||||
_constraints = [
|
_constraints = [
|
||||||
(_check_recursion, 'Error! You cannot create recursive directories.', ['parent_id'])
|
(osv.osv._check_recursion, 'Error! You cannot create recursive directories.', ['parent_id'])
|
||||||
]
|
]
|
||||||
|
|
||||||
def onchange_content_id(self, cr, uid, ids, ressource_type_id):
|
def onchange_content_id(self, cr, uid, ids, ressource_type_id):
|
||||||
|
|
|
@ -522,8 +522,8 @@ class hr_employee(osv.osv):
|
||||||
where
|
where
|
||||||
h.state='validate' and
|
h.state='validate' and
|
||||||
s.limit=False and
|
s.limit=False and
|
||||||
h.employee_id in (%s)
|
h.employee_id in %s
|
||||||
group by h.employee_id"""% (','.join(map(str,ids)),) )
|
group by h.employee_id""", (tuple(ids),))
|
||||||
res = cr.dictfetchall()
|
res = cr.dictfetchall()
|
||||||
remaining = {}
|
remaining = {}
|
||||||
for r in res:
|
for r in res:
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<field invisible="1" name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)"/>
|
<field invisible="1" name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)"/>
|
||||||
<field invisible="1" name="amount"/>
|
<field invisible="1" name="amount"/>
|
||||||
<field invisible="1" name="general_account_id"/>
|
<field invisible="1" name="general_account_id"/>
|
||||||
|
<field invisible="1" name="to_invoice"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</page>
|
</page>
|
||||||
|
|
|
@ -1892,7 +1892,6 @@ class stock_move(osv.osv):
|
||||||
result = {
|
result = {
|
||||||
'product_qty': 0.00
|
'product_qty': 0.00
|
||||||
}
|
}
|
||||||
warning = {}
|
|
||||||
|
|
||||||
if (not product_id) or (product_uos_qty <=0.0):
|
if (not product_id) or (product_uos_qty <=0.0):
|
||||||
result['product_uos_qty'] = 0.0
|
result['product_uos_qty'] = 0.0
|
||||||
|
@ -1900,22 +1899,15 @@ class stock_move(osv.osv):
|
||||||
|
|
||||||
product_obj = self.pool.get('product.product')
|
product_obj = self.pool.get('product.product')
|
||||||
uos_coeff = product_obj.read(cr, uid, product_id, ['uos_coeff'])
|
uos_coeff = product_obj.read(cr, uid, product_id, ['uos_coeff'])
|
||||||
|
|
||||||
# Warn if the quantity was decreased
|
# No warning if the quantity was decreased to avoid double warnings:
|
||||||
for move in self.read(cr, uid, ids, ['product_uos_qty']):
|
# The clients should call onchange_quantity too anyway
|
||||||
if product_uos_qty < move['product_uos_qty']:
|
|
||||||
warning.update({
|
|
||||||
'title': _('Warning: No Back Order'),
|
|
||||||
'message': _("By changing the quantity here, you accept the "
|
|
||||||
"new quantity as complete: OpenERP will not "
|
|
||||||
"automatically generate a Back Order.") })
|
|
||||||
break
|
|
||||||
|
|
||||||
if product_uos and product_uom and (product_uom != product_uos):
|
if product_uos and product_uom and (product_uom != product_uos):
|
||||||
result['product_qty'] = product_uos_qty / uos_coeff['uos_coeff']
|
result['product_qty'] = product_uos_qty / uos_coeff['uos_coeff']
|
||||||
else:
|
else:
|
||||||
result['product_qty'] = product_uos_qty
|
result['product_qty'] = product_uos_qty
|
||||||
return {'value': result, 'warning': warning}
|
return {'value': result}
|
||||||
|
|
||||||
def onchange_product_id(self, cr, uid, ids, prod_id=False, loc_id=False,
|
def onchange_product_id(self, cr, uid, ids, prod_id=False, loc_id=False,
|
||||||
loc_dest_id=False, partner_id=False):
|
loc_dest_id=False, partner_id=False):
|
||||||
|
|
|
@ -360,6 +360,7 @@ class res_partner(osv.osv, format_address):
|
||||||
value = {}
|
value = {}
|
||||||
value['title'] = False
|
value['title'] = False
|
||||||
if is_company:
|
if is_company:
|
||||||
|
value['use_parent_address'] = False
|
||||||
domain = {'title': [('domain', '=', 'partner')]}
|
domain = {'title': [('domain', '=', 'partner')]}
|
||||||
else:
|
else:
|
||||||
domain = {'title': [('domain', '=', 'contact')]}
|
domain = {'title': [('domain', '=', 'contact')]}
|
||||||
|
@ -379,9 +380,10 @@ class res_partner(osv.osv, format_address):
|
||||||
'was never correctly set. If an existing contact starts working for a new '
|
'was never correctly set. If an existing contact starts working for a new '
|
||||||
'company then a new contact should be created under that new '
|
'company then a new contact should be created under that new '
|
||||||
'company. You can use the "Discard" button to abandon this change.')}
|
'company. You can use the "Discard" button to abandon this change.')}
|
||||||
parent = self.browse(cr, uid, parent_id, context=context)
|
if use_parent_address:
|
||||||
address_fields = self._address_fields(cr, uid, context=context)
|
parent = self.browse(cr, uid, parent_id, context=context)
|
||||||
result['value'] = dict((key, value_or_id(parent[key])) for key in address_fields)
|
address_fields = self._address_fields(cr, uid, context=context)
|
||||||
|
result['value'] = dict((key, value_or_id(parent[key])) for key in address_fields)
|
||||||
else:
|
else:
|
||||||
result['value'] = {'use_parent_address': False}
|
result['value'] = {'use_parent_address': False}
|
||||||
return result
|
return result
|
||||||
|
|
|
@ -159,8 +159,8 @@
|
||||||
<div class="oe_edit_only">
|
<div class="oe_edit_only">
|
||||||
<field name="use_parent_address" class="oe_inline"
|
<field name="use_parent_address" class="oe_inline"
|
||||||
on_change="onchange_address(use_parent_address, parent_id)"
|
on_change="onchange_address(use_parent_address, parent_id)"
|
||||||
attrs="{'invisible': [('parent_id','=', False),('use_parent_address','=',False)]}"/>
|
attrs="{'invisible': ['|', ('is_company', '=', True),('parent_id', '=', False)]}"/>
|
||||||
<label for="use_parent_address" attrs="{'invisible': [('parent_id','=', False),('use_parent_address','=',False)]}"/>
|
<label for="use_parent_address" attrs="{'invisible': ['|', ('is_company', '=', True), ('parent_id', '=', False)]}"/>
|
||||||
</div>
|
</div>
|
||||||
<button name="open_parent" type="object" string="(edit company address)" class="oe_link oe_edit_only"
|
<button name="open_parent" type="object" string="(edit company address)" class="oe_link oe_edit_only"
|
||||||
attrs="{'invisible': ['|',('parent_id','=', False),('use_parent_address','=',False)]}"/>
|
attrs="{'invisible': ['|',('parent_id','=', False),('use_parent_address','=',False)]}"/>
|
||||||
|
@ -190,7 +190,7 @@
|
||||||
|
|
||||||
<notebook colspan="4">
|
<notebook colspan="4">
|
||||||
<page string="Contacts" attrs="{'invisible': [('is_company','=',False), ('child_ids', '=', [])]}" autofocus="autofocus">
|
<page string="Contacts" attrs="{'invisible': [('is_company','=',False), ('child_ids', '=', [])]}" autofocus="autofocus">
|
||||||
<field name="child_ids" mode="kanban" context="{'default_parent_id': active_id, 'default_street': street, 'default_street2': street2, 'default_city': city, 'default_state_id': state_id, 'default_zip': zip, 'default_country_id': country_id, 'default_supplier': supplier, 'default_customer': customer}">
|
<field name="child_ids" mode="kanban" context="{'default_parent_id': active_id, 'default_street': street, 'default_street2': street2, 'default_city': city, 'default_state_id': state_id, 'default_zip': zip, 'default_country_id': country_id, 'default_supplier': supplier, 'default_customer': customer, 'default_use_parent_address': True}">
|
||||||
<kanban>
|
<kanban>
|
||||||
<field name="color"/>
|
<field name="color"/>
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
|
|
|
@ -379,7 +379,11 @@ class _rml_canvas(object):
|
||||||
v = utils.attr_get(node, ['x','y'])
|
v = utils.attr_get(node, ['x','y'])
|
||||||
text=self._textual(node, **v)
|
text=self._textual(node, **v)
|
||||||
text = utils.xml2str(text)
|
text = utils.xml2str(text)
|
||||||
self.canvas.drawString(text=text, **v)
|
try:
|
||||||
|
self.canvas.drawString(text=text, **v)
|
||||||
|
except TypeError:
|
||||||
|
_logger.error("Bad RML: <drawString> tag requires attributes 'x' and 'y'!")
|
||||||
|
raise
|
||||||
|
|
||||||
def _drawCenteredString(self, node):
|
def _drawCenteredString(self, node):
|
||||||
v = utils.attr_get(node, ['x','y'])
|
v = utils.attr_get(node, ['x','y'])
|
||||||
|
|
Loading…
Reference in New Issue