[MERGE] forward port branch saas-11 up to 0304bf8

This commit is contained in:
Christophe Simonis
2016-11-02 17:53:45 +01:00
6 changed files with 20 additions and 8 deletions
@@ -650,8 +650,9 @@ class AccountBankStatementLine(models.Model):
# Look for a single move line with the same amount # Look for a single move line with the same amount
field = currency and 'amount_residual_currency' or 'amount_residual' field = currency and 'amount_residual_currency' or 'amount_residual'
liquidity_field = currency and 'amount_currency' or amount > 0 and 'debit' or 'credit' liquidity_field = currency and 'amount_currency' or amount > 0 and 'debit' or 'credit'
liquidity_amt_clause = currency and '%(amount)s' or 'abs(%(amount)s)'
sql_query = self._get_common_sql_query(excluded_ids=excluded_ids) + \ sql_query = self._get_common_sql_query(excluded_ids=excluded_ids) + \
" AND ("+field+" = %(amount)s OR (acc.internal_type = 'liquidity' AND "+liquidity_field+" = %(amount)s)) \ " AND ("+field+" = %(amount)s OR (acc.internal_type = 'liquidity' AND "+liquidity_field+" = " + liquidity_amt_clause + ")) \
ORDER BY date_maturity asc, aml.id asc LIMIT 1" ORDER BY date_maturity asc, aml.id asc LIMIT 1"
self.env.cr.execute(sql_query, params) self.env.cr.execute(sql_query, params)
results = self.env.cr.fetchone() results = self.env.cr.fetchone()
@@ -141,6 +141,7 @@
<field name="uom_id" ref="product.product_uom_kgm" /> <field name="uom_id" ref="product.product_uom_kgm" />
<field name="uom_po_id" ref="product.product_uom_kgm" /> <field name="uom_po_id" ref="product.product_uom_kgm" />
<field name="image" type="base64" file="point_of_sale/static/img/peche-image.jpg"/> <field name="image" type="base64" file="point_of_sale/static/img/peche-image.jpg"/>
<field name="taxes_id" eval='[(5,)]'/> <!-- no taxes -->
</record> </record>
<record id="raisins_noir" model="product.product"> <record id="raisins_noir" model="product.product">
+9
View File
@@ -108,6 +108,15 @@ class PickingType(models.Model):
res.append((picking_type.id, name)) res.append((picking_type.id, name))
return res return res
@api.model
def name_search(self, name, args=None, operator='ilike', limit=100):
args = args or []
domain = []
if name:
domain = ['|', ('name', operator, name), ('warehouse_id.name', operator, name)]
picks = self.search(domain + args, limit=limit)
return picks.name_get()
@api.onchange('code') @api.onchange('code')
def onchange_picking_code(self): def onchange_picking_code(self):
if self.code == 'incoming': if self.code == 'incoming':
+2 -3
View File
@@ -132,14 +132,13 @@ class ir_http(orm.AbstractModel):
langs = [lg[0] for lg in request.website.get_languages()] langs = [lg[0] for lg in request.website.get_languages()]
path = request.httprequest.path.split('/') path = request.httprequest.path.split('/')
if first_pass: if first_pass:
is_a_bot = self.is_a_bot()
nearest_lang = not func and self.get_nearest_lang(path[1]) nearest_lang = not func and self.get_nearest_lang(path[1])
url_lang = nearest_lang and path[1] url_lang = nearest_lang and path[1]
preferred_lang = ((cook_lang if cook_lang in langs else False) preferred_lang = ((cook_lang if cook_lang in langs else False)
or self.get_nearest_lang(request.lang) or (not is_a_bot and self.get_nearest_lang(request.lang))
or request.website.default_lang_code) or request.website.default_lang_code)
is_a_bot = self.is_a_bot()
request.lang = request.context['lang'] = nearest_lang or preferred_lang request.lang = request.context['lang'] = nearest_lang or preferred_lang
# if lang in url but not the displayed or default language --> change or remove # if lang in url but not the displayed or default language --> change or remove
# or no lang in url, and lang to dispay not the default language --> add lang # or no lang in url, and lang to dispay not the default language --> add lang
@@ -243,7 +243,7 @@
<h4 class="text-center text-muted" <h4 class="text-center text-muted"
t-field="event.address_id" t-options='{ t-field="event.address_id" t-options='{
"widget": "contact", "widget": "contact",
"fields": ["address", "phone", "mobile", "fax"] "fields": ["name", "address", "phone", "mobile", "fax"]
}'/> }'/>
</t> </t>
</template> </template>
@@ -345,7 +345,7 @@
</t> </t>
<div itemprop="location" class="mt16 mb8" t-field="event.address_id" t-options='{ <div itemprop="location" class="mt16 mb8" t-field="event.address_id" t-options='{
"widget": "contact", "widget": "contact",
"fields": ["address", "phone", "mobile", "fax", "email"] "fields": ["name", "address", "phone", "mobile", "fax", "email"]
}'/> }'/>
</div> </div>
</div> </div>
@@ -512,7 +512,7 @@
<i class="fa fa-clock-o"/> <span itemprop="startDate" t-esc="event.date_begin_located[:-3]"> </span> <i>to</i> <span itemprop="endDate" t-esc="event.date_end_located[:-3]"> </span> <i class="fa fa-clock-o"/> <span itemprop="startDate" t-esc="event.date_begin_located[:-3]"> </span> <i>to</i> <span itemprop="endDate" t-esc="event.date_end_located[:-3]"> </span>
<div itemprop="location" class="mt16 mb8" t-field="event.address_id" t-options='{ <div itemprop="location" class="mt16 mb8" t-field="event.address_id" t-options='{
"widget": "contact", "widget": "contact",
"fields": ["address", "phone", "mobile", "fax", "email"] "fields": ["name", "address", "phone", "mobile", "fax", "email"]
}'/> }'/>
</div> </div>
<div class="col-md-3 mt16"> <div class="col-md-3 mt16">
+2
View File
@@ -87,6 +87,8 @@ class BaseCase(unittest.TestCase):
initialized by subclasses. initialized by subclasses.
""" """
longMessage = True # more verbose error message by default: https://www.odoo.com/r/Vmh
def cursor(self): def cursor(self):
return self.registry.cursor() return self.registry.cursor()