[MERGE] forward port branch 10.0 up to 0fe7989e24

This commit is contained in:
Christophe Simonis
2017-11-15 14:50:46 +01:00
13 changed files with 130 additions and 14 deletions
+3 -1
View File
@@ -1165,7 +1165,9 @@ class AccountInvoice(models.Model):
res.setdefault(line.tax_id.tax_group_id, 0.0)
res[line.tax_id.tax_group_id] += line.amount
res = sorted(res.items(), key=lambda l: l[0].sequence)
res = map(lambda l: (l[0].name, l[1]), res)
res = [(
r[0].name, r[1], formatLang(self.with_context(lang=self.partner_id.lang).env, r[1], currency_obj=currency)
) for r in res]
return res
+1 -1
View File
@@ -113,7 +113,7 @@
<tr>
<td><span t-esc="amount_by_group[0] if len(o.tax_line_ids) > 1 else (o.tax_line_ids.tax_id.description or o.tax_line_ids.tax_id.name)"/></td>
<td class="text-right">
<span t-esc="amount_by_group[1]" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
<span t-esc="amount_by_group[2]"/>
</td>
</tr>
</t>
@@ -36,7 +36,6 @@
<filter name="group_by_channel" string="Channel" domain="[]" context="{'group_by':'channel_id'}"/>
<filter name="group_by_operator" string="Operator" domain="[('partner_id','!=', False)]" context="{'group_by':'partner_id'}"/>
<separator orientation="vertical" />
<filter name="group_by_hour" string="Creation date (hour)" domain="[]" context="{'group_by':'start_date_hour'}"/>
<filter name="group_by_day" string="Creation date (day)" domain="[]" context="{'group_by':'start_date:day'}"/>
<filter name="group_by_week" string="Creation date (week)" domain="[]" context="{'group_by':'start_date:week'}"/>
<filter name="group_by_month" string="Creation date (month)" domain="[]" context="{'group_by':'start_date:month'}" />
+60 -1
View File
@@ -170,8 +170,9 @@ class AccountFrFec(models.TransientModel):
'''
sql_query += '''
GROUP BY aml.account_id
GROUP BY aml.account_id, aat.type
HAVING sum(aml.balance) != 0
AND aat.type not in ('receivable', 'payable')
'''
formatted_date_from = self.date_from.replace('-', '')
date_from = datetime.strptime(self.date_from, DEFAULT_SERVER_DATE_FORMAT)
@@ -209,6 +210,64 @@ class AccountFrFec(models.TransientModel):
unaffected_earnings_results[5] = unaffected_earnings_account.name
w.writerow([s.encode("utf-8") for s in unaffected_earnings_results])
# INITIAL BALANCE - receivable/payable
sql_query = '''
SELECT
'OUV' AS JournalCode,
'Balance initiale' AS JournalLib,
'OUVERTURE/' || %s AS EcritureNum,
%s AS EcritureDate,
MIN(aa.code) AS CompteNum,
replace(MIN(aa.name), '|', '/') AS CompteLib,
CASE WHEN rp.ref IS null OR rp.ref = ''
THEN COALESCE('ID ' || rp.id, '')
ELSE rp.ref
END
AS CompAuxNum,
COALESCE(replace(rp.name, '|', '/'), '') AS CompAuxLib,
'-' AS PieceRef,
%s AS PieceDate,
'/' AS EcritureLib,
replace(CASE WHEN sum(aml.balance) <= 0 THEN '0,00' ELSE to_char(SUM(aml.balance), '999999999999999D99') END, '.', ',') AS Debit,
replace(CASE WHEN sum(aml.balance) >= 0 THEN '0,00' ELSE to_char(-SUM(aml.balance), '999999999999999D99') END, '.', ',') AS Credit,
'' AS EcritureLet,
'' AS DateLet,
%s AS ValidDate,
'' AS Montantdevise,
'' AS Idevise,
MIN(aa.id) AS CompteID
FROM
account_move_line aml
LEFT JOIN account_move am ON am.id=aml.move_id
LEFT JOIN res_partner rp ON rp.id=aml.partner_id
JOIN account_account aa ON aa.id = aml.account_id
LEFT JOIN account_account_type aat ON aa.user_type_id = aat.id
WHERE
am.date < %s
AND am.company_id = %s
AND aat.include_initial_balance = 't'
AND (aml.debit != 0 OR aml.credit != 0)
'''
# For official report: only use posted entries
if self.export_type == "official":
sql_query += '''
AND am.state = 'posted'
'''
sql_query += '''
GROUP BY aml.account_id, aat.type, rp.ref, rp.id
HAVING sum(aml.balance) != 0
AND aat.type in ('receivable', 'payable')
'''
self._cr.execute(
sql_query, (formatted_date_year, formatted_date_from, formatted_date_from, formatted_date_from, self.date_from, company.id))
for row in self._cr.fetchall():
listrow = list(row)
account_id = listrow.pop()
w.writerow([s.encode("utf-8") for s in listrow])
# LINES
sql_query = '''
SELECT
@@ -93,8 +93,7 @@
</tr>
<tr t-foreach="o.move_raw_ids" t-as="line">
<td>
<span t-field="line.product_id.code"/>
<span t-field="line.product_id.name"/>
<span t-field="line.product_id"/>
</td>
<td class="text-right">
<span t-field="line.product_uom_qty"/>
+1 -1
View File
@@ -35,5 +35,5 @@ class StripeController(http.Controller):
response = tx._create_stripe_charge(tokenid=post['tokenid'], email=post['email'])
_logger.info('Stripe: entering form_feedback with post data %s', pprint.pformat(response))
if response:
request.env['payment.transaction'].sudo().form_feedback(response, 'stripe')
request.env['payment.transaction'].sudo().with_context(lang=None).form_feedback(response, 'stripe')
return post.pop('return_url', '/')
+37
View File
@@ -2639,6 +2639,11 @@ msgstr ""
msgid "Inventory Line"
msgstr ""
#. module: stock
#: model:ir.actions.act_window,name:stock.action_inventory_line_tree
msgid "Inventory Lines"
msgstr ""
#. module: stock
#: model:ir.model.fields,field_description:stock.field_product_product_property_stock_inventory
#: model:ir.model.fields,field_description:stock.field_product_template_property_stock_inventory
@@ -2921,6 +2926,11 @@ msgstr ""
msgid "Linked Quant"
msgstr ""
#. module: stock
#: model:ir.ui.view,arch_db:stock.view_inventory_form
msgid "List view of lines"
msgstr ""
#. module: stock
#: model:ir.ui.view,arch_db:stock.view_location_form
msgid "Localization"
@@ -4496,6 +4506,11 @@ msgstr ""
msgid "Quantity"
msgstr ""
#. module: stock
#: model:ir.model.fields,field_description:stock.field_stock_pack_operation_qty_done_uom_ordered
msgid "Quantity Done"
msgstr ""
#. module: stock
#: model:ir.ui.view,arch_db:stock.view_warehouse_orderpoint_form
msgid "Quantity Multiple"
@@ -4518,6 +4533,17 @@ msgstr ""
msgid "Quantity cannot be negative."
msgstr ""
#. module: stock
#: code:addons/stock/models/stock_move.py:394
#, python-format
msgid "Quantity decreased!"
msgstr ""
#. module: stock
#: model:ir.model.fields,help:stock.field_stock_pack_operation_qty_done_uom_ordered
msgid "Quantity done in UOM ordered"
msgstr ""
#. module: stock
#: model:ir.model.fields,help:stock.field_stock_move_availability
msgid "Quantity in stock that can still be reserved for this move"
@@ -5014,6 +5040,11 @@ msgstr ""
msgid "Search Inventory"
msgstr ""
#. module: stock
#: model:ir.ui.view,arch_db:stock.stock_inventory_line_search
msgid "Search Inventory Lines"
msgstr ""
#. module: stock
#: model:ir.ui.view,arch_db:stock.stock_scrap_search_view
msgid "Search Scrap"
@@ -5570,6 +5601,12 @@ msgstr ""
msgid "The parent location that includes this location. Example : The 'Dispatch Zone' is the 'Gate 1' parent location."
msgstr ""
#. module: stock
#: code:addons/stock/models/stock_picking.py:795
#, python-format
msgid "The pick is already validated"
msgstr ""
#. module: stock
#: model:ir.model,name:stock.model_stock_picking_type
msgid "The picking type determines the picking view"
+7 -3
View File
@@ -390,9 +390,13 @@ class StockMove(models.Model):
if not self.product_id or self.product_qty < 0.0:
self.product_qty = 0.0
if self.product_qty < self._origin.product_qty:
return {'warning': _("By changing this quantity here, you accept the "
"new quantity as complete: Odoo will not "
"automatically generate a back order.")}
warning_mess = {
'title': _('Quantity decreased!'),
'message' : _("By changing this quantity here, you accept the "
"new quantity as complete: Odoo will not "
"automatically generate a back order."),
}
return {'warning': warning_mess}
@api.onchange('product_id')
def onchange_product_id(self):
@@ -28,7 +28,7 @@
<label for="product_qty"/>
<div class="o_row">
<field name="product_qty"/>
<field name="product_uom_id" groups="product.group_uom"/>
<field name="product_uom_id" readonly="1" groups="product.group_uom"/>
</div>
<field name="ref"/>
</group>
@@ -54,7 +54,7 @@ var CrashManager = core.Class.extend({
new (handler)(this, error).display();
return;
}
if (error.data.name === "openerp.http.SessionExpiredException" || error.data.name === "werkzeug.exceptions.Forbidden") {
if (error.data.name === "odoo.http.SessionExpiredException" || error.data.name === "werkzeug.exceptions.Forbidden") {
this.show_warning({type: _t("Odoo Session Expired"), data: {message: _t("Your Odoo session expired. Please refresh the current web page.")}});
return;
}
+1 -1
View File
@@ -1625,7 +1625,7 @@
</template>
<template id="total">
<div id="cart_total" t-att-class="extra_class or ''" t-if="website_sale_order">
<div id="cart_total" t-att-class="extra_class or ''" t-if="website_sale_order and website_sale_order.website_order_line">
<div class="row" id="order_total_untaxed">
<span class="col-xs-6 text-right text-muted">Subtotal:</span>
<span class="col-xs-6 text-right-not-xs text-left-xs text-muted">
+16
View File
@@ -0,0 +1,16 @@
Belgium, 2017-11-14
METRUM SA agrees to the terms of the Odoo Corporate Contributor License
Agreement v1.0.
I declare that I am authorized and able to make this agreement and sign this
declaration.
Signed,
Jonathan Nemry jonathan.nemry@metrum.lu https://github.com/JonathanNEMRY
List of contributors:
Pascal Pelzer pascal.pelzer@metrum.lu https://github.com/PascalPelzer
Jonathan Nemry jonathan.nemry@metrum.lu https://github.com/JonathanNEMRY
+1 -1
View File
@@ -1175,7 +1175,7 @@ def formatLang(env, value, digits=None, grouping=True, monetary=False, dp=False,
if isinstance(value, (str, unicode)) and not value:
return ''
lang = env.user.company_id.partner_id.lang or 'en_US'
lang = env.context.get('lang') or env.user.company_id.partner_id.lang or 'en_US'
lang_objs = env['res.lang'].search([('code', '=', lang)])
if not lang_objs:
lang_objs = env['res.lang'].search([], limit=1)