diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-11-15 14:50:46 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-11-15 14:50:46 +0100 |
| commit | 0bf7ab45119e7b441dd071118b2dfa4db9e3b90d (patch) | |
| tree | d21987d9234d45eb9f3fc7ccd0daea57a710d3b1 | |
| parent | 661dab1ed681ef408e7e7d78b7122157dae249ce (diff) | |
| parent | 0fe7989e24fa4380c135fd7718991dfa4a66a101 (diff) | |
[MERGE] forward port branch 10.0 up to 0fe7989e24f
| -rw-r--r-- | addons/account/models/account_invoice.py | 4 | ||||
| -rw-r--r-- | addons/account/views/report_invoice.xml | 2 | ||||
| -rw-r--r-- | addons/im_livechat/report/im_livechat_report_operator_views.xml | 1 | ||||
| -rw-r--r-- | addons/l10n_fr_fec/wizard/account_fr_fec.py | 61 | ||||
| -rw-r--r-- | addons/mrp/report/mrp_production_templates.xml | 3 | ||||
| -rw-r--r-- | addons/payment_stripe/controllers/main.py | 2 | ||||
| -rw-r--r-- | addons/stock/i18n/stock.pot | 37 | ||||
| -rw-r--r-- | addons/stock/models/stock_move.py | 10 | ||||
| -rw-r--r-- | addons/stock/views/stock_production_lot_views.xml | 2 | ||||
| -rw-r--r-- | addons/web/static/src/js/framework/crash_manager.js | 2 | ||||
| -rw-r--r-- | addons/website_sale/views/templates.xml | 2 | ||||
| -rw-r--r-- | doc/cla/corporate/metrum.md | 16 | ||||
| -rw-r--r-- | odoo/tools/misc.py | 2 |
13 files changed, 130 insertions, 14 deletions
diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 035ef3ee5c8..9ecf333292d 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -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 diff --git a/addons/account/views/report_invoice.xml b/addons/account/views/report_invoice.xml index 8a46469dc5b..0463559af2d 100644 --- a/addons/account/views/report_invoice.xml +++ b/addons/account/views/report_invoice.xml @@ -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> diff --git a/addons/im_livechat/report/im_livechat_report_operator_views.xml b/addons/im_livechat/report/im_livechat_report_operator_views.xml index 677191cf4b5..a7b4d271cd9 100644 --- a/addons/im_livechat/report/im_livechat_report_operator_views.xml +++ b/addons/im_livechat/report/im_livechat_report_operator_views.xml @@ -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'}" /> diff --git a/addons/l10n_fr_fec/wizard/account_fr_fec.py b/addons/l10n_fr_fec/wizard/account_fr_fec.py index 5b5bcc0fc88..237f8f06162 100644 --- a/addons/l10n_fr_fec/wizard/account_fr_fec.py +++ b/addons/l10n_fr_fec/wizard/account_fr_fec.py @@ -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 diff --git a/addons/mrp/report/mrp_production_templates.xml b/addons/mrp/report/mrp_production_templates.xml index d8a90b371ac..13fd06a4477 100644 --- a/addons/mrp/report/mrp_production_templates.xml +++ b/addons/mrp/report/mrp_production_templates.xml @@ -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"/> diff --git a/addons/payment_stripe/controllers/main.py b/addons/payment_stripe/controllers/main.py index b4627157a9e..356f36cf101 100644 --- a/addons/payment_stripe/controllers/main.py +++ b/addons/payment_stripe/controllers/main.py @@ -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', '/') diff --git a/addons/stock/i18n/stock.pot b/addons/stock/i18n/stock.pot index 731c13e7851..8d8ddde6c31 100644 --- a/addons/stock/i18n/stock.pot +++ b/addons/stock/i18n/stock.pot @@ -2640,6 +2640,11 @@ 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 msgid "Inventory Location" @@ -2922,6 +2927,11 @@ 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" msgstr "" @@ -4497,6 +4507,11 @@ 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" msgstr "" @@ -4519,6 +4534,17 @@ 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" msgstr "" @@ -5015,6 +5041,11 @@ 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" msgstr "" @@ -5571,6 +5602,12 @@ msgid "The parent location that includes this location. Example : The 'Dispatch 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" msgstr "" diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index 3c359c93b25..26db3fa010f 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -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): diff --git a/addons/stock/views/stock_production_lot_views.xml b/addons/stock/views/stock_production_lot_views.xml index cfa5d3929ce..694eebb6258 100644 --- a/addons/stock/views/stock_production_lot_views.xml +++ b/addons/stock/views/stock_production_lot_views.xml @@ -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> diff --git a/addons/web/static/src/js/framework/crash_manager.js b/addons/web/static/src/js/framework/crash_manager.js index efd4bcc979c..baf577b578d 100644 --- a/addons/web/static/src/js/framework/crash_manager.js +++ b/addons/web/static/src/js/framework/crash_manager.js @@ -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; } diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml index f093446c5ad..2dd70f71609 100644 --- a/addons/website_sale/views/templates.xml +++ b/addons/website_sale/views/templates.xml @@ -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"> diff --git a/doc/cla/corporate/metrum.md b/doc/cla/corporate/metrum.md new file mode 100644 index 00000000000..b64bf351a8b --- /dev/null +++ b/doc/cla/corporate/metrum.md @@ -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 diff --git a/odoo/tools/misc.py b/odoo/tools/misc.py index ca20ab3278b..6233f4572b1 100644 --- a/odoo/tools/misc.py +++ b/odoo/tools/misc.py @@ -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) |
