diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index a514d2bb58a..4da3b2f624d 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -1174,7 +1174,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 d73d9ca9f7a..b4f3f13b1d7 100644 --- a/addons/account/views/report_invoice.xml +++ b/addons/account/views/report_invoice.xml @@ -112,7 +112,7 @@ - + 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 @@ - 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/mail/tests/test_mail_channel.py b/addons/mail/tests/test_mail_channel.py index cabfe99203b..9469e7b4879 100644 --- a/addons/mail/tests/test_mail_channel.py +++ b/addons/mail/tests/test_mail_channel.py @@ -42,7 +42,7 @@ class TestMailGroup(TestMail): def mail_group_message_get_recipient_values(self, notif_message=None, recipient_ids=None): return self.env['mail.thread'].message_get_recipient_values(notif_message=notif_message, recipient_ids=recipient_ids) cls.env['mail.channel']._patch_method('message_get_recipient_values', mail_group_message_get_recipient_values) - super(TestMail, cls).tearDownClass() + super(TestMailGroup, cls).tearDownClass() @mute_logger('odoo.addons.base.ir.ir_model', 'odoo.models') def test_access_rights_public(self): 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 @@ - - + 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 44de171dbe1..95f509d1bdb 100644 --- a/addons/stock/i18n/stock.pot +++ b/addons/stock/i18n/stock.pot @@ -2577,6 +2577,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 @@ -2859,6 +2864,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" @@ -4402,6 +4412,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" @@ -4424,6 +4439,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" @@ -4941,6 +4967,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" @@ -5579,6 +5610,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 #: code:addons/stock/models/stock_picking.py:787 #, python-format diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index 087c111499a..c00834613a0 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -387,9 +387,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 @@