From 62817a80d36b1ed058cbf4e5055203b80867e117 Mon Sep 17 00:00:00 2001 From: Odoo Translation Bot Date: Sun, 8 Jan 2017 02:56:42 +0100 Subject: [PATCH 001/135] [I18N] Update translation terms from Transifex --- addons/account/i18n/da.po | 4 +-- addons/account_analytic_analysis/i18n/tr.po | 6 ++-- addons/account_followup/i18n/da.po | 34 ++++++++++----------- addons/anonymization/i18n/hr.po | 12 ++++---- addons/crm_partner_assign/i18n/tr.po | 6 ++-- addons/hr_timesheet_invoice/i18n/tr.po | 6 ++-- addons/payment/i18n/ar.po | 4 +-- 7 files changed, 36 insertions(+), 36 deletions(-) diff --git a/addons/account/i18n/da.po b/addons/account/i18n/da.po index a61c1b47d47..80c59f1b779 100644 --- a/addons/account/i18n/da.po +++ b/addons/account/i18n/da.po @@ -11,7 +11,7 @@ msgstr "" "Project-Id-Version: Odoo 8.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-10-15 06:40+0000\n" -"PO-Revision-Date: 2016-12-20 11:23+0000\n" +"PO-Revision-Date: 2017-01-06 13:14+0000\n" "Last-Translator: Hans Henrik Gabelgaard \n" "Language-Team: Danish (http://www.transifex.com/odoo/odoo-8/language/da/)\n" "MIME-Version: 1.0\n" @@ -10525,7 +10525,7 @@ msgstr "Total beløb du skal betale denne leverandør." #. module: account #: view:account.move.line:account.view_move_line_tree_reconcile msgid "Total credit" -msgstr "" +msgstr "Total til gode" #. module: account #: view:account.move.line:account.view_move_line_tree_reconcile diff --git a/addons/account_analytic_analysis/i18n/tr.po b/addons/account_analytic_analysis/i18n/tr.po index e9524be7058..fc73028190b 100644 --- a/addons/account_analytic_analysis/i18n/tr.po +++ b/addons/account_analytic_analysis/i18n/tr.po @@ -4,13 +4,13 @@ # # Translators: # FIRST AUTHOR , 2014 -# Murat Kaplan , 2015-2016 +# Murat Kaplan , 2015-2017 msgid "" msgstr "" "Project-Id-Version: Odoo 8.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-01-21 14:07+0000\n" -"PO-Revision-Date: 2016-11-09 12:13+0000\n" +"PO-Revision-Date: 2017-01-04 14:26+0000\n" "Last-Translator: Murat Kaplan \n" "Language-Team: Turkish (http://www.transifex.com/odoo/odoo-8/language/tr/)\n" "MIME-Version: 1.0\n" @@ -394,7 +394,7 @@ msgstr "Süresi dolmak üzere" #. module: account_analytic_analysis #: field:account.analytic.account,fix_price_invoices:0 msgid "Fixed Price" -msgstr "Beklenen Ciro" +msgstr "Beklenen Gelir" #. module: account_analytic_analysis #: field:account.analytic.account,recurring_invoices:0 diff --git a/addons/account_followup/i18n/da.po b/addons/account_followup/i18n/da.po index 2088cff6139..f0ef9be42c6 100644 --- a/addons/account_followup/i18n/da.po +++ b/addons/account_followup/i18n/da.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Odoo 8.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-01-21 14:07+0000\n" -"PO-Revision-Date: 2016-04-11 12:48+0000\n" +"PO-Revision-Date: 2017-01-06 13:43+0000\n" "Last-Translator: Martin Trigaux\n" "Language-Team: Danish (http://www.transifex.com/odoo/odoo-8/language/da/)\n" "MIME-Version: 1.0\n" @@ -159,7 +159,7 @@ msgid "" "In case of any queries concerning this matter, do not hesitate to contact our accounting department.\n" "\n" "Best Regards,\n" -msgstr "" +msgstr "\nKære %(partner_name)s,\n\nVed gennemgang af vores bogholderi har vi bemærket, at vi stadig ikke har modtaget betaling for ovenstående faktura på trods af tidligere rykker.\n\nDet er vigtigt at udestående betales straks, ellers vil vi vurdere om hvor hvidt jeres konto spærres for yderligere levering.\n\nHvis der er problemer med betaling eller stemmer saldoen ikke overens, så kontakt os hurtigst muligt så vi kan få løst problemet.\n\nMed venlig hilsen,\n" #. module: account_followup #: model:account_followup.followup.line,description:account_followup.demo_followup_line4 @@ -178,7 +178,7 @@ msgid "" "\n" "Best Regards,\n" " " -msgstr "" +msgstr "\nKære %(partner_name)s,\n\nVed gennemgang af vores bogholderi har vi bemærket, at vi stadig ikke har modtaget betaling for ovenstående faktura på trods af tidligere rykker.\n\nDet er vigtigt at udestående betales straks, ellers vil vi vurdere om hvor hvidt jeres konto spærres for yderligere levering.\n\nHvis der er problemer med betaling eller stemmer saldoen ikke overens, så kontakt os hurtigst muligt så vi kan få løst problemet.\n\nMed venlig hilsen," #. module: account_followup #: model:account_followup.followup.line,description:account_followup.demo_followup_line1 @@ -191,7 +191,7 @@ msgid "" "Would your payment have been carried out after this mail was sent, please ignore this message. Do not hesitate to contact our accounting department. \n" "\n" "Best Regards,\n" -msgstr "" +msgstr "\nKære %(partner_name)s,\n\nVed gennemgang af vores bogholderi har vi bemærket, at vi ikke har modtaget betaling for ovenstående faktura. \n\nHar I allerede indbetalt beløbet indenfor de seneste fem hverdage, så kan I se bort fra henvendelsen. Har I glemt at betale regningen, så beder vi jer indbetale beløbet straks. \n\nMed venlig hilsen,\n" #. module: account_followup #: model:account_followup.followup.line,description:account_followup.demo_followup_line2 @@ -209,7 +209,7 @@ msgid "" "Details of due payments is printed below.\n" "\n" "Best Regards,\n" -msgstr "" +msgstr "\nKære %(partner_name)s,\n\nPå trods af flere rykkere er Jeres udestående endnu ikke betalt. \n\nDenne rykker er et varsel i henhold til inkassolovens § 10. Det skyldige beløb skal betales senest 10 dage fra dags dato. Hvis det ikke sker, vil det kunne medføre yderligere omkostninger for Dem, idet sagen uden yderligere varsel vil blive overgivet til inkasso.\n\nMed venlig hilsen,\n\n" #. module: account_followup #: code:addons/account_followup/wizard/account_followup_print.py:174 @@ -472,7 +472,7 @@ msgstr "Kunde opfølgning" #. module: account_followup #: field:res.partner,payment_note:0 msgid "Customer Payment Promise" -msgstr "" +msgstr "Kunden lovet betaling" #. module: account_followup #: view:website:account_followup.report_followup @@ -533,7 +533,7 @@ msgstr "Forfaldsdato" #. module: account_followup #: field:account_followup.followup.line,delay:0 msgid "Due Days" -msgstr "" +msgstr "Dage forfalden" #. module: account_followup #: field:account_followup.print,email_body:0 @@ -614,12 +614,12 @@ msgstr "" #: field:account.move.line,followup_line_id:0 #: view:account_followup.stat:account_followup.view_account_followup_stat_search msgid "Follow-up Level" -msgstr "" +msgstr "Opfølgning niveau" #. module: account_followup #: model:ir.ui.menu,name:account_followup.account_followup_menu msgid "Follow-up Levels" -msgstr "" +msgstr "Opfølgnings niveauer" #. module: account_followup #: model:ir.actions.report.xml,name:account_followup.action_report_followup @@ -820,7 +820,7 @@ msgstr "Retssager" #: view:account_followup.followup.line:account_followup.view_account_followup_followup_line_form #: field:account_followup.followup.line,manual_action:0 msgid "Manual Action" -msgstr "" +msgstr "Manuel handling" #. module: account_followup #: model:ir.actions.act_window,name:account_followup.action_customer_followup @@ -1037,13 +1037,13 @@ msgstr "" #: view:account_followup.followup.line:account_followup.view_account_followup_followup_line_form #: field:account_followup.followup.line,send_letter:0 msgid "Send a Letter" -msgstr "" +msgstr "Send et brev" #. module: account_followup #: view:account_followup.followup.line:account_followup.view_account_followup_followup_line_form #: field:account_followup.followup.line,send_email:0 msgid "Send an Email" -msgstr "" +msgstr "Send en email" #. module: account_followup #: view:account_followup.print:account_followup.view_account_followup_print @@ -1106,7 +1106,7 @@ msgid "" "The number of days after the due date of the invoice to wait before sending " "the reminder. Could be negative if you want to send a polite alert " "beforehand." -msgstr "" +msgstr "Antal dage efter forfaldsdato på en faktura, før rykker sendes. Kan være negativ hvis en venlig påmindelse skal sendes før forfald. " #. module: account_followup #: code:addons/account_followup/account_followup.py:313 @@ -1171,7 +1171,7 @@ msgstr "" #. module: account_followup #: view:account.move.line:account_followup.account_move_line_partner_tree msgid "Total credit" -msgstr "" +msgstr "Total til gode" #. module: account_followup #: view:account.move.line:account_followup.account_move_line_partner_tree @@ -1213,7 +1213,7 @@ msgid "" " use the following keywords in the text. Don't\n" " forget to translate in all languages you installed\n" " using to top right icon." -msgstr "" +msgstr "Skriv introduktionen til brevether,\ni forhold til niveau af rykker. Du kan\nbruge følgende nøgleord i teksten. Glem\nikke at oversætte alle sprog du har installeret\nved hjælp af øverste højre ikon (globus)." #. module: account_followup #: code:addons/account_followup/account_followup.py:291 @@ -1227,12 +1227,12 @@ msgstr "" msgid "" "Your description is invalid, use the right legend or %% if you want to use " "the percent character." -msgstr "" +msgstr "Din beskrivelse er forkert, brug den korrekte syntax eller %% hvis du ønsker at bruge procent karakteren." #. module: account_followup #: view:account_followup.followup.line:account_followup.view_account_followup_followup_line_form msgid "days overdue, do the following actions:" -msgstr "" +msgstr "dage forfalden, udfør følgende handling:" #. module: account_followup #: view:account_followup.followup.line:account_followup.view_account_followup_followup_line_form diff --git a/addons/anonymization/i18n/hr.po b/addons/anonymization/i18n/hr.po index cf64bc1096a..913d5ece492 100644 --- a/addons/anonymization/i18n/hr.po +++ b/addons/anonymization/i18n/hr.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Odoo 8.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-01-21 14:07+0000\n" -"PO-Revision-Date: 2016-11-14 09:01+0000\n" +"PO-Revision-Date: 2017-01-05 14:31+0000\n" "Last-Translator: Martin Trigaux\n" "Language-Team: Croatian (http://www.transifex.com/odoo/odoo-8/language/hr/)\n" "MIME-Version: 1.0\n" @@ -107,7 +107,7 @@ msgstr "Prikrivanje podataka u bazi" #. module: anonymization #: model:ir.ui.menu,name:anonymization.menu_administration_anonymization msgid "Database anonymization" -msgstr "" +msgstr "Prikrivanje podataka u bazi" #. module: anonymization #: field:ir.model.fields.anonymization.history,date:0 @@ -134,7 +134,7 @@ msgstr "Greška !" #. module: anonymization #: selection:ir.model.fields.anonymization.history,state:0 msgid "Exception occured" -msgstr "" +msgstr "Došlo je do greške" #. module: anonymization #: field:ir.model.fields.anonymize.wizard,file_export:0 @@ -225,7 +225,7 @@ msgstr "Novi" #. module: anonymization #: selection:ir.model.fields.anonymization,state:0 msgid "Not Existing" -msgstr "" +msgstr "Ne postoji" #. module: anonymization #: field:ir.model.fields.anonymization,model_id:0 @@ -272,7 +272,7 @@ msgstr "Sažetak" #. module: anonymization #: field:ir.model.fields.anonymization.migration.fix,target_version:0 msgid "Target Version" -msgstr "" +msgstr "Ciljana verzija" #. module: anonymization #: code:addons/anonymization/anonymization.py:91 @@ -318,7 +318,7 @@ msgstr "" #. module: anonymization #: selection:ir.model.fields.anonymize.wizard,state:0 msgid "Unstable" -msgstr "" +msgstr "Nestabilno" #. module: anonymization #: code:addons/anonymization/anonymization.py:65 diff --git a/addons/crm_partner_assign/i18n/tr.po b/addons/crm_partner_assign/i18n/tr.po index e515ef63152..3a56e01bbd2 100644 --- a/addons/crm_partner_assign/i18n/tr.po +++ b/addons/crm_partner_assign/i18n/tr.po @@ -5,13 +5,13 @@ # Translators: # FIRST AUTHOR , 2014 # gezgin biri , 2015 -# Murat Kaplan , 2015-2016 +# Murat Kaplan , 2015-2017 msgid "" msgstr "" "Project-Id-Version: Odoo 8.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-09-08 15:14+0000\n" -"PO-Revision-Date: 2016-10-19 12:44+0000\n" +"PO-Revision-Date: 2017-01-04 14:26+0000\n" "Last-Translator: Murat Kaplan \n" "Language-Team: Turkish (http://www.transifex.com/odoo/odoo-8/language/tr/)\n" "MIME-Version: 1.0\n" @@ -330,7 +330,7 @@ msgstr "Artırma" #. module: crm_partner_assign #: view:crm.lead:crm_partner_assign.crm_opportunity_portal_tree msgid "Expected Revenues" -msgstr "Beklenen Ciro" +msgstr "Beklenen Gelir" #. module: crm_partner_assign #: view:crm.lead.report.assign:crm_partner_assign.view_report_crm_lead_assign_filter diff --git a/addons/hr_timesheet_invoice/i18n/tr.po b/addons/hr_timesheet_invoice/i18n/tr.po index a44db8387b6..deac91e688f 100644 --- a/addons/hr_timesheet_invoice/i18n/tr.po +++ b/addons/hr_timesheet_invoice/i18n/tr.po @@ -5,13 +5,13 @@ # Translators: # Ediz Duman , 2015 # FIRST AUTHOR , 2014 -# Murat Kaplan , 2015-2016 +# Murat Kaplan , 2015-2017 msgid "" msgstr "" "Project-Id-Version: Odoo 8.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-01-21 14:08+0000\n" -"PO-Revision-Date: 2016-10-19 12:44+0000\n" +"PO-Revision-Date: 2017-01-04 14:27+0000\n" "Last-Translator: Murat Kaplan \n" "Language-Team: Turkish (http://www.transifex.com/odoo/odoo-8/language/tr/)\n" "MIME-Version: 1.0\n" @@ -575,7 +575,7 @@ msgstr "Mart" #. module: hr_timesheet_invoice #: field:account.analytic.account,amount_max:0 msgid "Max. Invoice Price" -msgstr "Beklenen Ciro" +msgstr "Beklenen Gelir" #. module: hr_timesheet_invoice #: field:report.analytic.account.close,quantity_max:0 diff --git a/addons/payment/i18n/ar.po b/addons/payment/i18n/ar.po index a75b80761c3..e87709270d6 100644 --- a/addons/payment/i18n/ar.po +++ b/addons/payment/i18n/ar.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Odoo 8.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-01-21 14:08+0000\n" -"PO-Revision-Date: 2016-07-21 10:49+0000\n" +"PO-Revision-Date: 2017-01-04 18:44+0000\n" "Last-Translator: Fahad Alqahtani \n" "Language-Team: Arabic (http://www.transifex.com/odoo/odoo-8/language/ar/)\n" "MIME-Version: 1.0\n" @@ -309,7 +309,7 @@ msgstr "اسم الشريك" #. module: payment #: field:payment.transaction,partner_reference:0 msgid "Partner Reference" -msgstr "" +msgstr "رقم إشارة الشريك" #. module: payment #: code:addons/payment/models/payment_acquirer.py:274 From 23deeb187d358d66a87f024c495de06575d82967 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 10 Jan 2017 15:08:18 +0100 Subject: [PATCH 002/135] [FIX] account_check_printing: remove useless sudo This sudo is useless, and prevent the use of the record rules on the creation of payments. opw-703143 --- addons/account_check_printing/account_payment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_check_printing/account_payment.py b/addons/account_check_printing/account_payment.py index 68850f7c206..23742fc73d0 100644 --- a/addons/account_check_printing/account_payment.py +++ b/addons/account_check_printing/account_payment.py @@ -86,7 +86,7 @@ class account_payment(models.Model): and vals.get('check_manual_sequencing'): sequence = self.env['account.journal'].browse(vals['journal_id']).check_sequence_id vals.update({'check_number': sequence.next_by_id()}) - return super(account_payment, self.sudo()).create(vals) + return super(account_payment, self).create(vals) @api.multi def print_checks(self): From 78646696b862327cb4f33b42f31785957581558e Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Tue, 10 Jan 2017 10:53:09 +0100 Subject: [PATCH 003/135] [FIX] hr_attendance: attendance_manual In Kiosk mode, the user logged cannot check in and check out his related employee with any wrong pin. opw:703744 --- addons/hr_attendance/models/hr_employee.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_attendance/models/hr_employee.py b/addons/hr_attendance/models/hr_employee.py index 7fcd8ee8ff4..a17c2e50b84 100644 --- a/addons/hr_attendance/models/hr_employee.py +++ b/addons/hr_attendance/models/hr_employee.py @@ -74,7 +74,7 @@ class HrEmployee(models.Model): @api.multi def attendance_manual(self, next_action, entered_pin=None): self.ensure_one() - if self.env['res.users'].browse(SUPERUSER_ID).has_group('hr_attendance.group_hr_attendance_use_pin') and (self.user_id and self.user_id.id != self._uid or not self.user_id): + if entered_pin or self.env['res.users'].browse(SUPERUSER_ID).has_group('hr_attendance.group_hr_attendance_use_pin') and (self.user_id and self.user_id.id != self._uid or not self.user_id): if entered_pin != self.pin: return {'warning': _('Wrong PIN')} return self.attendance_action(next_action) From c2040da0bafc0bc341bbd1fa72a62ef94db79bd3 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Thu, 8 Dec 2016 11:10:58 +0100 Subject: [PATCH 004/135] [REF] mrp: inventory post when last work order is finished Before this patch, the inventory was automatically posted when you click on "done" on the last planned work order. This behavior was preventing the user from correcting, for example, the consumed quantity on the raw materials move on the manufacturing order if it was different from the theoretical quantity. Note that finishing anyone but the last work order still let you edit the consumed quantity. Same with changing the lot. Now you have to click on "mark as done" on the manufacturing order to post the inventory. Note that this is the same behavior when working without work order (produce > mark as done will post). We adapt the tests to reflect this change. --- addons/mrp/models/mrp_workorder.py | 2 -- addons/mrp/tests/test_workorder_operation.py | 7 ++++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/addons/mrp/models/mrp_workorder.py b/addons/mrp/models/mrp_workorder.py index dbc0ee221c2..fc0da1ecdab 100644 --- a/addons/mrp/models/mrp_workorder.py +++ b/addons/mrp/models/mrp_workorder.py @@ -377,8 +377,6 @@ class MrpWorkorder(models.Model): self.ensure_one() self.end_all() self.write({'state': 'done', 'date_finished': fields.Datetime.now()}) - if not self.production_id.workorder_ids.filtered(lambda x: x.state not in ('done','cancel')): - self.production_id.post_inventory() # User should put it to done manually @api.multi def end_previous(self, doall=False): diff --git a/addons/mrp/tests/test_workorder_operation.py b/addons/mrp/tests/test_workorder_operation.py index 00541dfc8df..14eb7a65b31 100644 --- a/addons/mrp/tests/test_workorder_operation.py +++ b/addons/mrp/tests/test_workorder_operation.py @@ -123,9 +123,10 @@ class TestWorkOrderProcess(common.TransactionCase): # This behaviour was changed #self.assertEqual(production_table.state, 'done', "Production order should be in done state.") - # ---------------------------------------- - # Check consume quants and produce quants. - # ---------------------------------------- + # --------------------------------------------------------------- + # Check consume quants and produce quants after posting inventory + # --------------------------------------------------------------- + production_table.button_mark_done() self.assertEqual(sum(move_table_sheet.quant_ids.mapped('qty')), 1, "Wrong quantity of consumed product %s" % move_table_sheet.product_id.name) self.assertEqual(sum(move_leg.quant_ids.mapped('qty')), 4, "Wrong quantity of consumed product %s" % move_leg.product_id.name) self.assertEqual(sum(move_table_bolt.quant_ids.mapped('qty')), 4, "Wrong quantity of consumed product %s" % move_table_bolt.product_id.name) From fc813847d8cf3242a0202cff813c3466cd0a5e1f Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 10 Jan 2017 16:43:50 +0100 Subject: [PATCH 005/135] [FIX] account: wrong counterpart in invoice / out refund register payment Revision 20935462a0cabeb45480ce70114ff2f4e91eaf79 introduces the below regression: When registering a payment on a customer invoice refund or a vendor bill, with a payment difference e.g. payment of 101 for an invoice of 100 and marking the invoice as fully paid, the counter part in the payment account move were wrongly computed: In those cases, its the payment total minus the invoice residual total that must be performed, and not the other way around. This revision solves this, inspired on how the payment difference is computed for display in the wizard on how it was before the above revision, in the method `_compute_payment_difference` Fixes #15000 --- addons/account/models/account_payment.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py index 486c7eba0ab..b93c23c380e 100644 --- a/addons/account/models/account_payment.py +++ b/addons/account/models/account_payment.py @@ -388,9 +388,12 @@ class account_payment(models.Model): # the writeoff debit and credit must be computed from the invoice residual in company currency # minus the payment amount in company currency, and not from the payment difference in the payment currency # to avoid loss of precision during the currency rate computations. See revision 20935462a0cabeb45480ce70114ff2f4e91eaf79 for a detailed example. - total_residual_company_signed = sum(invoice.residual_company_signed for invoice in self.invoice_ids) + total_residual_company_signed = self._compute_total_invoices_amount() total_payment_company_signed = self.currency_id.with_context(date=self.payment_date).compute(self.amount, self.company_id.currency_id) - amount_wo = total_residual_company_signed - total_payment_company_signed + if self.invoice_ids[0].type in ['in_invoice', 'out_refund']: + amount_wo = total_payment_company_signed - total_residual_company_signed + else: + amount_wo = total_residual_company_signed - total_payment_company_signed debit_wo = amount_wo > 0 and amount_wo or 0.0 credit_wo = amount_wo < 0 and -amount_wo or 0.0 writeoff_line['name'] = _('Counterpart') From cd4ff9341e8a1bf9ca383b43facba573204f9fa1 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Tue, 10 Jan 2017 17:02:39 +0100 Subject: [PATCH 006/135] [FIX] http: make error 400 slightly more user-friendly Users who get an error 400 due to an invalid CSRF token might be doing something legit. For example they may have opened the page with the HTTP form 2 hours before posting it, and let the CSRF token expire naturally (default lifetime is 1h). In this situation the "invalid CSRF token" message might be too cryptic for them to understand that they need to refresh the form and try again. Mentioning that their "Session expired" as well should sound more familiar and lead to the right reaction. --- openerp/http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/http.py b/openerp/http.py index 5977b7a402d..a2364175bef 100644 --- a/openerp/http.py +++ b/openerp/http.py @@ -840,7 +840,7 @@ more details. passing the `csrf=False` parameter to the `route` decorator. """, request.httprequest.path) - raise werkzeug.exceptions.BadRequest('Invalid CSRF Token') + raise werkzeug.exceptions.BadRequest('Session expired (invalid CSRF token)') r = self._call_function(**self.params) if not r: From 72e150d0437aa2dc04a2d5e3871c6342e67f962e Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 10 Jan 2017 18:25:46 +0100 Subject: [PATCH 007/135] [FIX] account: exchange rate of `price_subtotal_signed` The field `price_subtotal_signed` contains the price converted in the company currency. However, we should make sure to use the exchange rate of the invoice date for its computation. An use problematic use case is the creation of a deferred revenue from an invoice (commit 7fe89d08b3a). opw-702352 --- addons/account/models/account_invoice.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index b2a87308372..0cd76e1fd05 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -1105,7 +1105,8 @@ class AccountInvoiceLine(models.Model): @api.one @api.depends('price_unit', 'discount', 'invoice_line_tax_ids', 'quantity', - 'product_id', 'invoice_id.partner_id', 'invoice_id.currency_id', 'invoice_id.company_id') + 'product_id', 'invoice_id.partner_id', 'invoice_id.currency_id', 'invoice_id.company_id', + 'invoice_id.date_invoice') def _compute_price(self): currency = self.invoice_id and self.invoice_id.currency_id or None price = self.price_unit * (1 - (self.discount or 0.0) / 100.0) @@ -1114,7 +1115,7 @@ class AccountInvoiceLine(models.Model): taxes = self.invoice_line_tax_ids.compute_all(price, currency, self.quantity, product=self.product_id, partner=self.invoice_id.partner_id) self.price_subtotal = price_subtotal_signed = taxes['total_excluded'] if taxes else self.quantity * price if self.invoice_id.currency_id and self.invoice_id.company_id and self.invoice_id.currency_id != self.invoice_id.company_id.currency_id: - price_subtotal_signed = self.invoice_id.currency_id.compute(price_subtotal_signed, self.invoice_id.company_id.currency_id) + price_subtotal_signed = self.invoice_id.currency_id.with_context(date=self.invoice_id.date_invoice).compute(price_subtotal_signed, self.invoice_id.company_id.currency_id) sign = self.invoice_id.type in ['in_refund', 'out_refund'] and -1 or 1 self.price_subtotal_signed = price_subtotal_signed * sign From 2f66e7abde072f100ef06c3a91fc416676f200bc Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Tue, 10 Jan 2017 18:37:53 +0100 Subject: [PATCH 008/135] [FIX] mrp: handle the case of empty routings Before, when the routing of a production order was empty (no operations), it got into an inconsistent state (you click on "plan" and nothing happens). Empty routings were used before to do subcontracting or 2-steps inventeory (we did not set any operations on the routing but we set a location). Here, we change the related routing field on the production order into a calculated field which becomes empty when the routing has no operations. This way, the "produce" button is displayed (as for production orders without routing) and working/ This is a temporary patch to workaround the issuein a stable release. In master, we might remove the location on routing and place it on the workcenters and put a constraint that does not allow an empty routing. --- addons/mrp/models/mrp_production.py | 15 ++++++++++----- addons/mrp/tests/test_order.py | 13 +++++++++++++ 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py index 9b3dd69dadc..60c32669a2c 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -94,7 +94,7 @@ class MrpProduction(models.Model): help="Bill of Materials allow you to define the list of required raw materials to make a finished product.") routing_id = fields.Many2one( 'mrp.routing', 'Routing', - readonly=True, related='bom_id.routing_id', store=True, + readonly=True, compute='_compute_routing', store=True, help="The list of operations (list of work centers) to produce the finished product. The routing " "is mainly used to compute work center costs during operations and to plan future loads on " "work centers based on production planning.") @@ -152,6 +152,15 @@ class MrpProduction(models.Model): priority = fields.Selection([('0', 'Not urgent'), ('1', 'Normal'), ('2', 'Urgent'), ('3', 'Very Urgent')], 'Priority', readonly=True, states={'confirmed': [('readonly', False)]}, default='1') + @api.multi + @api.depends('bom_id.routing_id', 'bom_id.routing_id.operation_ids') + def _compute_routing(self): + for production in self: + if production.bom_id.routing_id.operation_ids: + production.routing_id = production.bom_id.routing_id.id + else: + production.routing_id = False + @api.multi @api.depends('workorder_ids') def _compute_workorder_count(self): @@ -243,10 +252,6 @@ class MrpProduction(models.Model): self.location_src_id = self.picking_type_id.default_location_src_id.id or location.id self.location_dest_id = self.picking_type_id.default_location_dest_id.id or location.id - @api.onchange('bom_id') - def onchange_bom_id(self): - self.routing_id = self.bom_id.routing_id.id - @api.model def create(self, values): if not values.get('name', False) or values['name'] == _('New'): diff --git a/addons/mrp/tests/test_order.py b/addons/mrp/tests/test_order.py index 5e5535b9137..3477eaae8b7 100644 --- a/addons/mrp/tests/test_order.py +++ b/addons/mrp/tests/test_order.py @@ -332,3 +332,16 @@ class TestMrpOrder(TestMrpCommon): production_2.action_assign() # check sub product availability state is assigned self.assertEqual(production_2.availability, 'assigned', 'Production order should be availability for assigned state') + + def test_empty_routing(self): + """ Check what happens when you work with an empty routing""" + routing = self.env['mrp.routing'].create({'name': 'Routing without operations', + 'location_id': self.warehouse_1.wh_input_stock_loc_id.id,}) + self.bom_3.routing_id = routing.id + production = self.env['mrp.production'].create({'name': 'MO test', + 'product_id': self.product_6.id, + 'product_qty': 3, + 'bom_id': self.bom_3.id, + 'product_uom_id': self.product_6.uom_id.id,}) + self.assertEqual(production.routing_id.id, False, 'The routing field should be empty on the mo') + self.assertEqual(production.move_raw_ids[0].location_id.id, self.warehouse_1.wh_input_stock_loc_id.id, 'Raw moves start location should have altered.') \ No newline at end of file From ff098a7ad4582592cbd30caa85259b12222b998f Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Wed, 21 Dec 2016 17:00:11 +0100 Subject: [PATCH 009/135] [FIX] mrp: procurement creation for raw materials According to the routes set on the products of the raw materials, a procurement may have to be created for the consumed lines of the MO. A route may also be set on a product category. Before this patch, we only look for procurement rules for the routes defined on the products and on its category, ignoring the inherited route of the parent category. Fortunetaly, we have a computed field on the product model returning all the routes from the current category, so we use this one in the search for procurement rules. A test has been added to show the failure. --- addons/mrp/models/mrp_production.py | 2 +- addons/mrp/tests/test_procurement.py | 35 ++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py index 60c32669a2c..3b6d10f34da 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -350,7 +350,7 @@ class MrpProduction(models.Model): mto_route = False for move in self.move_raw_ids: product = move.product_id - routes = product.route_ids + product.categ_id.route_ids + routes = product.route_ids + product.route_from_categ_ids # TODO: optimize with read_group? pull = self.env['procurement.rule'].search([('route_id', 'in', [x.id for x in routes]), ('location_src_id', '=', move.location_id.id), ('location_id', '=', move.location_dest_id.id)], limit=1) diff --git a/addons/mrp/tests/test_procurement.py b/addons/mrp/tests/test_procurement.py index bc212050db5..98074e5e004 100644 --- a/addons/mrp/tests/test_procurement.py +++ b/addons/mrp/tests/test_procurement.py @@ -105,3 +105,38 @@ class TestProcurement(TestMrpCommon): production_product_6.button_mark_done() self.assertEqual(production_product_6.state, 'done', 'Production order should be in state done') self.assertEqual(self.product_6.qty_available, 24, 'Wrong quantity available of finished product.') + + def test_procurement_2(self): + """Check that a manufacturing order create the right procurements when the route are set on + a parent category of a product""" + # find a child category id + all_categ_id = self.env['product.category'].search([('parent_id', '=', None)], limit=1) + child_categ_id = self.env['product.category'].search([('parent_id', '=', all_categ_id.id)], limit=1) + + # set the product of `self.bom_1` to this child category + for bom_line_id in self.bom_1.bom_line_ids: + # check that no routes are defined on the product + self.assertEquals(len(bom_line_id.product_id.route_ids), 0) + # set the category of the product to a child category + bom_line_id.product_id.categ_id = child_categ_id + + # set the MTO route to the parent category (all) + self.warehouse = self.env.ref('stock.warehouse0') + mto_route = self.warehouse.mto_pull_id.route_id + mto_route.product_categ_selectable = True + all_categ_id.write({'route_ids': [(6, 0, [mto_route.id])]}) + + # create MO + production_product_4 = self.env['mrp.production'].create({ + 'name': 'MO/Test-00002', + 'product_id': self.product_4.id, + 'product_qty': 1, + 'bom_id': self.bom_1.id, + 'product_uom_id': self.product_4.uom_id.id, + }) + + # check that procurement are correctly created + procurement = self.env['procurement.order'].search( + [('group_id', '=', production_product_4.procurement_group_id.id), + ('product_id', 'in', self.bom_1.bom_line_ids.mapped('product_id.id'))]) + self.assertEqual(len(procurement), 2) From 5a1ec145199c79ff97679baa14cea874b83bf9eb Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 10 Jan 2017 17:06:57 +0100 Subject: [PATCH 010/135] [FIX] marketing_campaign: method not implemented In the Lead Automation module, the module is working as expected when the activity type is 'Email'. In other cases, the corresponding methods are not implemented and raise an error. opw-697829 --- addons/marketing_campaign/models/marketing_campaign.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/addons/marketing_campaign/models/marketing_campaign.py b/addons/marketing_campaign/models/marketing_campaign.py index 2aa745dfaa1..eccd3c4dd8d 100644 --- a/addons/marketing_campaign/models/marketing_campaign.py +++ b/addons/marketing_campaign/models/marketing_campaign.py @@ -340,6 +340,16 @@ class MarketingCampaignActivity(models.Model): self.ensure_one() return self.email_template_id.send_mail(workitem.res_id) + @api.multi + def _process_wi_report(self, workitem): + self.ensure_one() + return self.report_id.render_report(workitem.res_id, self.report_id.report_name, None) + + @api.multi + def _process_wi_action(self, workitem): + self.ensure_one() + return self.server_action_id.run() + @api.multi def process(self, workitem): self.ensure_one() From 6c0bf660b1d106a7e9f7f92c4bf0cae783a43a2d Mon Sep 17 00:00:00 2001 From: boogerlad Date: Tue, 3 Jan 2017 17:27:53 -0500 Subject: [PATCH 011/135] [CLA] Signature for boogerlad.md --- doc/cla/individual/boogerlad.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/cla/individual/boogerlad.md diff --git a/doc/cla/individual/boogerlad.md b/doc/cla/individual/boogerlad.md new file mode 100644 index 00000000000..af450cfd20a --- /dev/null +++ b/doc/cla/individual/boogerlad.md @@ -0,0 +1,11 @@ +canada, 2017/1/3 + +I hereby agree to the terms of the Odoo Individual Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +kevin hua boogerlad@gmail.com https://github.com/boogerlad From a5dc060afb142c58509ba773c3d1c766678513c0 Mon Sep 17 00:00:00 2001 From: boogerlad Date: Tue, 3 Jan 2017 17:24:13 -0500 Subject: [PATCH 012/135] [FIX] calendar: attendee of a private event should be able to see the content Someone invited to an event should be able to see all details, instead of "busy" This commit closes #12935 --- addons/calendar/calendar.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/calendar/calendar.py b/addons/calendar/calendar.py index 14742cb1c3e..da6c14d2346 100644 --- a/addons/calendar/calendar.py +++ b/addons/calendar/calendar.py @@ -1705,7 +1705,8 @@ class calendar_event(osv.Model): for r in result: if r['user_id']: user_id = type(r['user_id']) in (tuple, list) and r['user_id'][0] or r['user_id'] - if user_id == uid: + partner_id = self.pool['res.users'].browse(cr, uid, uid, context).partner_id.id + if user_id == uid or partner_id in r.get("partner_ids", []): continue if r['class'] == 'private': for f in r.keys(): From 6b87284f3f00527b10cb41477849079423c97211 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Tue, 10 Jan 2017 21:29:52 +0100 Subject: [PATCH 013/135] [FIX] website_sale: fix amount format This commit fix wrong grouping when we format price via price_to_str. where '[3,0]' was interpreted as string and not array in intersperse. Thousand separator was duplicated ",,,320.00" e.g. This commit fix also product page where amount for variant was formatted js side before that RPC translation (website.ready() defered) was resolved. '/website/translations' is only called when user have rights to edit page. So a standard user didn't call it and l10n is not initialized. After an update, now we format the amount with the l10n value. To stay retro compatible, if l10n is not initialized (value = []) we use [] for grouping as 'fallback value'. To fix decimal precision you need to update the template product_price. To fix the grouping, you need to update the website.layout To fix the decimal separator, (and previous fix), you just need to pull the JS This commit is related to #1103, #11553, #14772, #14874, ... And fix the previous fix odoo/odoo@1f10ef8055f6c661fc6407a8ce4593dfc30452b4 It should also fix (by side-effect) the translation JS for user without editor right. Already fixed in V9 - don't forward this commit... --- addons/website/views/website_templates.xml | 2 +- .../website_sale/static/src/js/website_sale.js | 16 +++++++++------- addons/website_sale/views/templates.xml | 3 ++- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml index f686e785dd6..539f1d05b95 100644 --- a/addons/website/views/website_templates.xml +++ b/addons/website/views/website_templates.xml @@ -56,7 +56,7 @@