[MERGE] Forward-port saas-3 up to 7273474
This commit is contained in:
commit
b7814943c3
|
@ -77,10 +77,15 @@ class sale_order_line(osv.osv):
|
||||||
list_price = pricelist_obj.price_get(cr, uid, [pricelist],
|
list_price = pricelist_obj.price_get(cr, uid, [pricelist],
|
||||||
product.id, qty or 1.0, partner_id, {'uom': uom,'date': date_order })
|
product.id, qty or 1.0, partner_id, {'uom': uom,'date': date_order })
|
||||||
|
|
||||||
pricelists = pricelist_obj.read(cr,uid,[pricelist],['visible_discount'])
|
so_pricelist = pricelist_obj.browse(cr, uid, pricelist, context=context)
|
||||||
|
|
||||||
new_list_price = get_real_price(list_price, product.id, qty, uom, pricelist)
|
new_list_price = get_real_price(list_price, product.id, qty, uom, pricelist)
|
||||||
if len(pricelists)>0 and pricelists[0]['visible_discount'] and list_price[pricelist] != 0 and new_list_price != 0:
|
if so_pricelist.visible_discount and list_price[pricelist] != 0 and new_list_price != 0:
|
||||||
|
if so_pricelist.currency_id.id != product.company_id.currency_id.id:
|
||||||
|
# new_list_price is in company's currency while price in pricelist currency
|
||||||
|
new_list_price = self.pool['res.currency'].compute(cr, uid,
|
||||||
|
product.company_id.currency_id.id, so_pricelist.currency_id.id,
|
||||||
|
new_list_price, context=context)
|
||||||
discount = (new_list_price - price) / new_list_price * 100
|
discount = (new_list_price - price) / new_list_price * 100
|
||||||
if discount > 0:
|
if discount > 0:
|
||||||
result['price_unit'] = new_list_price
|
result['price_unit'] = new_list_price
|
||||||
|
|
|
@ -209,8 +209,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="container mt16 mb8">
|
<div class="container mt16 mb8">
|
||||||
<div class="pull-right" t-ignore="true" t-if="not editable">
|
<div class="pull-right" t-ignore="true" t-if="not editable">
|
||||||
Create a <a href="http://openerp.com/apps/website">free website</a> with
|
Create a <a href="http://www.odoo.com/page/website-builder">free website</a> with
|
||||||
<a class="label label-danger" href="https://openerp.com/apps/website">OpenERP</a>
|
<a class="label label-danger" href="http://www.odoo.com/page/website-builder">Odoo</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-left text-muted">
|
<div class="pull-left text-muted">
|
||||||
Copyright &copy; <span t-field="res_company.name">Company name</span>
|
Copyright &copy; <span t-field="res_company.name">Company name</span>
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
<group col="4">
|
<group col="4">
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="shortcut"/>
|
<field name="shortcut"/>
|
||||||
|
<field name="domain"/>
|
||||||
</group>
|
</group>
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
|
@ -183,8 +184,8 @@
|
||||||
<field name="fax"/>
|
<field name="fax"/>
|
||||||
<field name="user_ids" invisible="1"/>
|
<field name="user_ids" invisible="1"/>
|
||||||
<field name="email" widget="email" attrs="{'required': [('user_ids','!=', [])]}"/>
|
<field name="email" widget="email" attrs="{'required': [('user_ids','!=', [])]}"/>
|
||||||
<field name="title" domain="[('domain', '=', 'contact')]"
|
<field name="title" domain="[('domain','=','contact')]" options='{"no_open": True}' attrs="{'invisible': [('is_company','=',True)]}" context="{'default_domain': 'contact'}"/>
|
||||||
options='{"no_open": True}' attrs="{'invisible': [('is_company','=', True)]}" />
|
<field name="title" domain="[('domain','=','partner')]" options='{"no_open": True}' attrs="{'invisible': [('is_company','=',False)]}" context="{'default_domain': 'partner'}"/>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
|
|
|
@ -1401,6 +1401,16 @@ class BaseModel(object):
|
||||||
# Failed to write, log to messages, rollback savepoint (to
|
# Failed to write, log to messages, rollback savepoint (to
|
||||||
# avoid broken transaction) and keep going
|
# avoid broken transaction) and keep going
|
||||||
cr.execute('ROLLBACK TO SAVEPOINT model_load_save')
|
cr.execute('ROLLBACK TO SAVEPOINT model_load_save')
|
||||||
|
except Exception, e:
|
||||||
|
message = (_('Unknown error during import:') +
|
||||||
|
u' %s: %s' % (type(e), unicode(e)))
|
||||||
|
moreinfo = _('Resolve other errors first')
|
||||||
|
messages.append(dict(info, type='error',
|
||||||
|
message=message,
|
||||||
|
moreinfo=moreinfo))
|
||||||
|
# Failed for some reason, perhaps due to invalid data supplied,
|
||||||
|
# rollback savepoint and keep going
|
||||||
|
cr.execute('ROLLBACK TO SAVEPOINT model_load_save')
|
||||||
if any(message['type'] == 'error' for message in messages):
|
if any(message['type'] == 'error' for message in messages):
|
||||||
cr.execute('ROLLBACK TO SAVEPOINT model_load')
|
cr.execute('ROLLBACK TO SAVEPOINT model_load')
|
||||||
ids = False
|
ids = False
|
||||||
|
@ -4076,13 +4086,14 @@ class BaseModel(object):
|
||||||
|
|
||||||
self.check_access_rights(cr, user, 'create')
|
self.check_access_rights(cr, user, 'create')
|
||||||
|
|
||||||
|
vals = self._add_missing_default_values(cr, user, vals, context)
|
||||||
|
|
||||||
if self._log_access:
|
if self._log_access:
|
||||||
for f in LOG_ACCESS_COLUMNS:
|
for f in LOG_ACCESS_COLUMNS:
|
||||||
if vals.pop(f, None) is not None:
|
if vals.pop(f, None) is not None:
|
||||||
_logger.warning(
|
_logger.warning(
|
||||||
'Field `%s` is not allowed when creating the model `%s`.',
|
'Field `%s` is not allowed when creating the model `%s`.',
|
||||||
f, self._name)
|
f, self._name)
|
||||||
vals = self._add_missing_default_values(cr, user, vals, context)
|
|
||||||
|
|
||||||
tocreate = {}
|
tocreate = {}
|
||||||
for v in self._inherits:
|
for v in self._inherits:
|
||||||
|
|
Loading…
Reference in New Issue