diff --git a/addons/account/__manifest__.py b/addons/account/__manifest__.py index 414e44021d..915d252677 100644 --- a/addons/account/__manifest__.py +++ b/addons/account/__manifest__.py @@ -93,4 +93,5 @@ You could use this simplified accounting in case you work with an (external) acc 'application': True, 'auto_install': False, 'post_init_hook': '_account_post_init', + 'license': 'LGPL-3', } diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 7e52283ee9..c82bd542bb 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1192,6 +1192,47 @@ class AccountMove(models.Model): else: self.show_name_warning = False + origin_name = self._origin.name + if not origin_name or origin_name == '/': + origin_name = self.highest_name + if self.name and self.name != '/' and origin_name and origin_name != '/': + format, format_values = self._get_sequence_format_param(self.name) + origin_format, origin_format_values = self._get_sequence_format_param(origin_name) + + if ( + format != origin_format + or dict(format_values, seq=0) != dict(origin_format_values, seq=0) + ): + changed = _( + "It was previously '%(previous)s' and it is now '%(current)s'.", + previous=origin_name, + current=self.name, + ) + reset = self._deduce_sequence_number_reset(self.name) + if reset == 'month': + detected = _( + "The sequence will restart at 1 at the start of every month.\n" + "The year detected here is '%(year)s' and the month is '%(month)s'.\n" + "The incrementing number in this case is '%(formatted_seq)s'." + ) + elif reset == 'year': + detected = _( + "The sequence will restart at 1 at the start of every year.\n" + "The year detected here is '%(year)s'.\n" + "The incrementing number in this case is '%(formatted_seq)s'." + ) + else: + detected = _( + "The sequence will never restart.\n" + "The incrementing number in this case is '%(formatted_seq)s'." + ) + format_values['formatted_seq'] = "{seq:0{seq_length}d}".format(**format_values) + detected = detected % format_values + return {'warning': { + 'title': _("The sequence format has changed."), + 'message': "%s\n\n%s" % (changed, detected) + }} + def _get_last_sequence_domain(self, relaxed=False): self.ensure_one() if not self.date or not self.journal_id: @@ -2320,10 +2361,15 @@ class AccountMove(models.Model): base_line = self.line_ids.filtered(lambda line: tax in line.tax_ids.flatten_taxes_hierarchy())[0] account_id = base_line.account_id.id + tags = refund_repartition_line.tag_ids + if line_vals.get('tax_ids'): + subsequent_taxes = self.env['account.tax'].browse(line_vals['tax_ids'][0][2]) + tags += subsequent_taxes.refund_repartition_line_ids.filtered(lambda x: x.repartition_type == 'base').tag_ids + line_vals.update({ 'tax_repartition_line_id': refund_repartition_line.id, 'account_id': account_id, - 'tax_tag_ids': [(6, 0, refund_repartition_line.tag_ids.ids)], + 'tax_tag_ids': [(6, 0, tags.ids)], }) elif line_vals.get('tax_ids') and line_vals['tax_ids'][0][2]: # Base line. diff --git a/addons/account/models/account_partial_reconcile.py b/addons/account/models/account_partial_reconcile.py index c5659cd081..ab78826586 100644 --- a/addons/account/models/account_partial_reconcile.py +++ b/addons/account/models/account_partial_reconcile.py @@ -598,13 +598,20 @@ class AccountPartialReconcile(models.Model): moves._post(soft=False) # Reconcile the tax lines being on a reconcile tax basis transfer account. - for line, move_index, sequence in to_reconcile_after: + for lines, move_index, sequence in to_reconcile_after: + + # In expenses, all move lines are created manually without any grouping on tax lines. + # In that case, 'lines' could be already reconciled. + lines = lines.filtered(lambda x: not x.reconciled) + if not lines: + continue + counterpart_line = moves[move_index].line_ids.filtered(lambda line: line.sequence == sequence) # When dealing with tiny amounts, the line could have a zero amount and then, be already reconciled. if counterpart_line.reconciled: continue - (line + counterpart_line).reconcile() + (lines + counterpart_line).reconcile() return moves diff --git a/addons/account/tests/test_account_move_out_invoice.py b/addons/account/tests/test_account_move_out_invoice.py index 18618c89da..4dbfe7113a 100644 --- a/addons/account/tests/test_account_move_out_invoice.py +++ b/addons/account/tests/test_account_move_out_invoice.py @@ -2537,6 +2537,81 @@ class TestAccountMoveOutInvoiceOnchanges(AccountTestInvoicingCommon): 'amount_untaxed' : self.move_vals['amount_untaxed'], }) + def test_out_invoice_reverse_move_tags(self): + country = self.env.ref('base.us') + tags = self.env['account.account.tag'].create([{ + 'name': "Test tag %s" % i, + 'applicability': 'taxes', + 'country_id': country.id, + } for i in range(8)]) + + taxes = self.env['account.tax'].create([{ + 'name': "Test tax include_base_amount = %s" % include_base_amount, + 'amount': 10.0, + 'include_base_amount': include_base_amount, + 'invoice_repartition_line_ids': [ + (0, 0, { + 'factor_percent': 100, + 'repartition_type': 'base', + 'tag_ids': [(6, 0, tags[(i * 4)].ids)], + }), + (0, 0, { + 'factor_percent': 100, + 'repartition_type': 'tax', + 'tag_ids': [(6, 0, tags[(i * 4) + 1].ids)], + }), + ], + 'refund_repartition_line_ids': [ + (0, 0, { + 'factor_percent': 100, + 'repartition_type': 'base', + 'tag_ids': [(6, 0, tags[(i * 4) + 2].ids)], + }), + (0, 0, { + 'factor_percent': 100, + 'repartition_type': 'tax', + 'tag_ids': [(6, 0, tags[(i * 4) + 3].ids)], + }), + ], + } for i, include_base_amount in enumerate((True, False))]) + + invoice = self.env['account.move'].create({ + 'move_type': 'out_invoice', + 'partner_id': self.partner_a.id, + 'invoice_date': fields.Date.from_string('2019-01-01'), + 'invoice_payment_term_id': self.pay_terms_a.id, + 'invoice_line_ids': [ + (0, 0, { + 'product_id': self.product_a.id, + 'price_unit': 1000.0, + 'tax_ids': [(6, 0, taxes.ids)], + }), + ] + }) + invoice.action_post() + + self.assertRecordValues(invoice.line_ids.sorted('tax_line_id'), [ + # Product line + {'tax_line_id': False, 'tax_ids': taxes.ids, 'tax_tag_ids': (tags[0] + tags[4]).ids}, + # Receivable line + {'tax_line_id': False, 'tax_ids': [], 'tax_tag_ids': []}, + # Tax lines + {'tax_line_id': taxes[0].id, 'tax_ids': taxes[1].ids, 'tax_tag_ids': (tags[1] + tags[4]).ids}, + {'tax_line_id': taxes[1].id, 'tax_ids': [], 'tax_tag_ids': tags[5].ids}, + ]) + + refund = invoice._reverse_moves(cancel=True) + + self.assertRecordValues(refund.line_ids.sorted('tax_line_id'), [ + # Product line + {'tax_line_id': False, 'tax_ids': taxes.ids, 'tax_tag_ids': (tags[2] + tags[6]).ids}, + # Receivable line + {'tax_line_id': False, 'tax_ids': [], 'tax_tag_ids': []}, + # Tax lines + {'tax_line_id': taxes[0].id, 'tax_ids': taxes[1].ids, 'tax_tag_ids': (tags[3] + tags[6]).ids}, + {'tax_line_id': taxes[1].id, 'tax_ids': [], 'tax_tag_ids': tags[7].ids}, + ]) + def test_out_invoice_change_period_accrual_1(self): move = self.env['account.move'].create({ 'move_type': 'out_invoice', diff --git a/addons/account/tests/test_sequence_mixin.py b/addons/account/tests/test_sequence_mixin.py index 8073e40ea7..5c32d4e80c 100644 --- a/addons/account/tests/test_sequence_mixin.py +++ b/addons/account/tests/test_sequence_mixin.py @@ -79,12 +79,22 @@ class TestSequenceMixin(AccountTestInvoicingCommon): copy2.journal_id = new_journal self.assertEqual(copy2.name, 'MISC2/2016/01/0001') with Form(copy2) as move_form: # It is editable in the form - move_form.name = 'MyMISC/2016/0001' + with mute_logger('flectra.tests.common.onchange'): + move_form.name = 'MyMISC/2016/0001' + self.assertIn( + 'The sequence will restart at 1 at the start of every year', + move_form._perform_onchange(['name'])['warning']['message'], + ) move_form.journal_id = self.test_move.journal_id self.assertEqual(move_form.name, '/') move_form.journal_id = new_journal self.assertEqual(move_form.name, 'MISC2/2016/01/0001') - move_form.name = 'MyMISC/2016/0001' + with mute_logger('flectra.tests.common.onchange'): + move_form.name = 'MyMISC/2016/0001' + self.assertIn( + 'The sequence will restart at 1 at the start of every year', + move_form._perform_onchange(['name'])['warning']['message'], + ) copy2.action_post() self.assertEqual(copy2.name, 'MyMISC/2016/0001') diff --git a/addons/account/views/account_bank_statement_views.xml b/addons/account/views/account_bank_statement_views.xml index 03ad0ff7cc..bf2623ca68 100644 --- a/addons/account/views/account_bank_statement_views.xml +++ b/addons/account/views/account_bank_statement_views.xml @@ -171,12 +171,12 @@ diff --git a/addons/account/wizard/account_invoice_send_views.xml b/addons/account/wizard/account_invoice_send_views.xml index 05eeb04fc8..6fed1cab80 100644 --- a/addons/account/wizard/account_invoice_send_views.xml +++ b/addons/account/wizard/account_invoice_send_views.xml @@ -83,6 +83,7 @@ list diff --git a/addons/account_check_printing/__manifest__.py b/addons/account_check_printing/__manifest__.py index 2d0a4581f5..8d459661bc 100644 --- a/addons/account_check_printing/__manifest__.py +++ b/addons/account_check_printing/__manifest__.py @@ -24,4 +24,5 @@ The check settings are located in the accounting journals configuration page. ], 'installable': True, 'auto_install': False, + 'license': 'LGPL-3', } diff --git a/addons/account_debit_note/__manifest__.py b/addons/account_debit_note/__manifest__.py index 073e0afd1e..e585bf7ab6 100644 --- a/addons/account_debit_note/__manifest__.py +++ b/addons/account_debit_note/__manifest__.py @@ -20,4 +20,5 @@ The wizard used is similar as the one for the credit note. ], 'installable': True, 'auto_install': False, + 'license': 'LGPL-3', } diff --git a/addons/account_edi/__manifest__.py b/addons/account_edi/__manifest__.py index 08efe0e3ca..f614278164 100644 --- a/addons/account_edi/__manifest__.py +++ b/addons/account_edi/__manifest__.py @@ -25,4 +25,5 @@ governements, etc.) 'installable': True, 'application': False, 'auto_install': True, + 'license': 'LGPL-3', } diff --git a/addons/account_edi_extended/__manifest__.py b/addons/account_edi_extended/__manifest__.py index 007eb4edcc..a3b85641ac 100644 --- a/addons/account_edi_extended/__manifest__.py +++ b/addons/account_edi_extended/__manifest__.py @@ -16,4 +16,5 @@ 'application': False, 'auto_install': False, 'post_init_hook': 'account_edi_block_level', + 'license': 'LGPL-3', } diff --git a/addons/account_edi_facturx/__manifest__.py b/addons/account_edi_facturx/__manifest__.py index 3e7e16ffb1..5fea31829f 100644 --- a/addons/account_edi_facturx/__manifest__.py +++ b/addons/account_edi_facturx/__manifest__.py @@ -11,4 +11,5 @@ 'installable': True, 'application': False, 'auto_install': True, + 'license': 'LGPL-3', } diff --git a/addons/account_edi_ubl/__manifest__.py b/addons/account_edi_ubl/__manifest__.py index afa10b999c..9c012ab608 100644 --- a/addons/account_edi_ubl/__manifest__.py +++ b/addons/account_edi_ubl/__manifest__.py @@ -10,4 +10,5 @@ 'installable': True, 'application': False, 'auto_install': True, + 'license': 'LGPL-3', } diff --git a/addons/account_fleet/__manifest__.py b/addons/account_fleet/__manifest__.py index cef17bccf3..acf45d6ba2 100644 --- a/addons/account_fleet/__manifest__.py +++ b/addons/account_fleet/__manifest__.py @@ -15,5 +15,5 @@ 'installable': True, 'auto_install': True, 'application': False, - 'license': 'OEEL-1', + 'license': 'LGPL-3', } diff --git a/addons/account_lock/__manifest__.py b/addons/account_lock/__manifest__.py index 45864e8e5b..ed39302363 100644 --- a/addons/account_lock/__manifest__.py +++ b/addons/account_lock/__manifest__.py @@ -13,4 +13,5 @@ """, 'depends': ['account'], 'data': [], + 'license': 'LGPL-3', } diff --git a/addons/account_payment/__manifest__.py b/addons/account_payment/__manifest__.py index 791ab07ffb..a1f8adf6ac 100644 --- a/addons/account_payment/__manifest__.py +++ b/addons/account_payment/__manifest__.py @@ -18,4 +18,5 @@ enable payment. ], 'installable': True, 'auto_install': False, + 'license': 'LGPL-3', } diff --git a/addons/account_qr_code_sepa/__manifest__.py b/addons/account_qr_code_sepa/__manifest__.py index cebce9198d..c9aba5a447 100644 --- a/addons/account_qr_code_sepa/__manifest__.py +++ b/addons/account_qr_code_sepa/__manifest__.py @@ -16,4 +16,5 @@ ], 'auto_install': True, + 'license': 'LGPL-3', } \ No newline at end of file diff --git a/addons/account_tax_python/__manifest__.py b/addons/account_tax_python/__manifest__.py index 4ae7c23055..cef0383570 100644 --- a/addons/account_tax_python/__manifest__.py +++ b/addons/account_tax_python/__manifest__.py @@ -17,4 +17,5 @@ A tax defined as python code consists of two snippets of python code which are e 'data': [ 'views/account_tax_views.xml', ], + 'license': 'LGPL-3', } diff --git a/addons/account_test/__manifest__.py b/addons/account_test/__manifest__.py index df97dd2426..f7a73b520f 100644 --- a/addons/account_test/__manifest__.py +++ b/addons/account_test/__manifest__.py @@ -26,5 +26,6 @@ and print the report from Print button in header area. 'report/report_account_test_templates.xml', ], 'active': False, - 'installable': True + 'installable': True, + 'license': 'LGPL-3', } diff --git a/addons/adyen_platforms/__manifest__.py b/addons/adyen_platforms/__manifest__.py index 12b83bec67..be58e52592 100644 --- a/addons/adyen_platforms/__manifest__.py +++ b/addons/adyen_platforms/__manifest__.py @@ -21,4 +21,5 @@ "static/src/xml/adyen_transactions_templates.xml", ], 'installable': True, + 'license': 'LGPL-3', } diff --git a/addons/analytic/__manifest__.py b/addons/analytic/__manifest__.py index 0f87f2edc5..2808cd279f 100644 --- a/addons/analytic/__manifest__.py +++ b/addons/analytic/__manifest__.py @@ -25,4 +25,5 @@ that have no counterpart in the general financial accounts. ], 'installable': True, 'auto_install': False, + 'license': 'LGPL-3', } diff --git a/addons/association/__manifest__.py b/addons/association/__manifest__.py index 8e7515c5a5..31094d2c1d 100644 --- a/addons/association/__manifest__.py +++ b/addons/association/__manifest__.py @@ -18,4 +18,5 @@ membership products (schemes). 'demo': [], 'installable': True, 'auto_install': False, + 'license': 'LGPL-3', } diff --git a/addons/attachment_indexation/__manifest__.py b/addons/attachment_indexation/__manifest__.py index 691b5ab66b..82c0e2a92e 100644 --- a/addons/attachment_indexation/__manifest__.py +++ b/addons/attachment_indexation/__manifest__.py @@ -14,4 +14,5 @@ The `pdfminer.six` Python library has to be installed in order to index PDF file """, 'depends': ['web'], 'installable': True, + 'license': 'LGPL-3', } diff --git a/addons/auth_ldap/__manifest__.py b/addons/auth_ldap/__manifest__.py index 7d432f28a0..0190616cdd 100644 --- a/addons/auth_ldap/__manifest__.py +++ b/addons/auth_ldap/__manifest__.py @@ -12,5 +12,6 @@ ], 'external_dependencies': { 'python': ['ldap'], - } + }, + 'license': 'LGPL-3', } diff --git a/addons/auth_oauth/__manifest__.py b/addons/auth_oauth/__manifest__.py index 1e4bf465f3..cd0779822e 100644 --- a/addons/auth_oauth/__manifest__.py +++ b/addons/auth_oauth/__manifest__.py @@ -18,4 +18,5 @@ Allow users to login through OAuth2 Provider. 'views/auth_oauth_templates.xml', 'security/ir.model.access.csv', ], + 'license': 'LGPL-3', } diff --git a/addons/auth_password_policy/__manifest__.py b/addons/auth_password_policy/__manifest__.py index aad5aa0d62..cefed18f5d 100644 --- a/addons/auth_password_policy/__manifest__.py +++ b/addons/auth_password_policy/__manifest__.py @@ -8,5 +8,6 @@ 'views/assets.xml', 'views/res_users.xml', 'views/res_config_settings_views.xml', - ] + ], + 'license': 'LGPL-3', } diff --git a/addons/auth_password_policy_portal/__manifest__.py b/addons/auth_password_policy_portal/__manifest__.py index 8241c90a67..40ebdb6dc4 100644 --- a/addons/auth_password_policy_portal/__manifest__.py +++ b/addons/auth_password_policy_portal/__manifest__.py @@ -3,5 +3,6 @@ 'depends': ['auth_password_policy', 'portal'], 'category': 'Tools', 'auto_install': True, - 'data': ['views/templates.xml'] + 'data': ['views/templates.xml'], + 'license': 'LGPL-3', } diff --git a/addons/auth_password_policy_signup/__manifest__.py b/addons/auth_password_policy_signup/__manifest__.py index ebf6f71933..cedc2caf5e 100644 --- a/addons/auth_password_policy_signup/__manifest__.py +++ b/addons/auth_password_policy_signup/__manifest__.py @@ -6,5 +6,6 @@ 'data': [ 'views/assets.xml', 'views/signup_templates.xml', - ] + ], + 'license': 'LGPL-3', } diff --git a/addons/auth_signup/__manifest__.py b/addons/auth_signup/__manifest__.py index 8e859f3304..80bb516f25 100644 --- a/addons/auth_signup/__manifest__.py +++ b/addons/auth_signup/__manifest__.py @@ -24,4 +24,5 @@ Allow users to sign up and reset their password 'views/auth_signup_assets.xml', ], 'bootstrap': True, + 'license': 'LGPL-3', } diff --git a/addons/auth_totp/__manifest__.py b/addons/auth_totp/__manifest__.py index f98675c525..eef19d6566 100644 --- a/addons/auth_totp/__manifest__.py +++ b/addons/auth_totp/__manifest__.py @@ -22,4 +22,5 @@ can setup API keys to replace their main password. 'views/user_preferences.xml', 'views/templates.xml', ], + 'license': 'LGPL-3', } diff --git a/addons/auth_totp_portal/__manifest__.py b/addons/auth_totp_portal/__manifest__.py index c316c51feb..435d53d279 100644 --- a/addons/auth_totp_portal/__manifest__.py +++ b/addons/auth_totp_portal/__manifest__.py @@ -7,4 +7,5 @@ 'security/security.xml', 'views/templates.xml', ], + 'license': 'LGPL-3', } diff --git a/addons/barcodes/__manifest__.py b/addons/barcodes/__manifest__.py index f1a8756184..78eb3aee04 100644 --- a/addons/barcodes/__manifest__.py +++ b/addons/barcodes/__manifest__.py @@ -13,4 +13,5 @@ 'installable': True, 'auto_install': False, 'post_init_hook': '_assign_default_nomeclature_id', + 'license': 'LGPL-3', } diff --git a/addons/base_address_city/__manifest__.py b/addons/base_address_city/__manifest__.py index 5f0db4fd06..fc40c93d62 100644 --- a/addons/base_address_city/__manifest__.py +++ b/addons/base_address_city/__manifest__.py @@ -18,4 +18,5 @@ This module allows to enforce users to choose the city of a partner inside a giv 'views/res_country_view.xml', ], 'depends': ['base'], + 'license': 'LGPL-3', } diff --git a/addons/base_address_extended/__manifest__.py b/addons/base_address_extended/__manifest__.py index 2f8f25a18f..81dcbef510 100644 --- a/addons/base_address_extended/__manifest__.py +++ b/addons/base_address_extended/__manifest__.py @@ -21,4 +21,5 @@ with the street name, the house number, and room number. ], 'depends': ['base'], 'post_init_hook': '_update_street_format', + 'license': 'LGPL-3', } diff --git a/addons/base_automation/__manifest__.py b/addons/base_automation/__manifest__.py index 83a7e7ba17..dfedea27d9 100644 --- a/addons/base_automation/__manifest__.py +++ b/addons/base_automation/__manifest__.py @@ -21,4 +21,5 @@ trigger an automatic reminder email. 'data/base_automation_data.xml', 'views/base_automation_view.xml', ], + 'license': 'LGPL-3', } diff --git a/addons/base_geolocalize/__manifest__.py b/addons/base_geolocalize/__manifest__.py index 1c9b30a573..0dde84abc1 100644 --- a/addons/base_geolocalize/__manifest__.py +++ b/addons/base_geolocalize/__manifest__.py @@ -16,4 +16,5 @@ Partners Geolocation 'data/data.xml', ], 'installable': True, + 'license': 'LGPL-3', } diff --git a/addons/base_iban/__manifest__.py b/addons/base_iban/__manifest__.py index f8b0a391d5..73babb0a75 100644 --- a/addons/base_iban/__manifest__.py +++ b/addons/base_iban/__manifest__.py @@ -17,4 +17,5 @@ with a single statement. 'views/setup_wizards_view.xml' ], 'demo': ['data/res_partner_bank_demo.xml'], + 'license': 'LGPL-3', } diff --git a/addons/base_import/__manifest__.py b/addons/base_import/__manifest__.py index beb83f8ff9..7905d8efdc 100644 --- a/addons/base_import/__manifest__.py +++ b/addons/base_import/__manifest__.py @@ -30,4 +30,5 @@ Re-implement Flectra's file import system: 'views/base_import_templates.xml', ], 'qweb': ['static/src/xml/base_import.xml'], + 'license': 'LGPL-3', } diff --git a/addons/base_import_module/__manifest__.py b/addons/base_import_module/__manifest__.py index d08101f37f..94bab24b92 100644 --- a/addons/base_import_module/__manifest__.py +++ b/addons/base_import_module/__manifest__.py @@ -17,4 +17,5 @@ for customization purpose. 'security/ir.model.access.csv', 'views/base_import_module_view.xml' ], + 'license': 'LGPL-3', } diff --git a/addons/base_import_module/tests/test_module/__manifest__.py b/addons/base_import_module/tests/test_module/__manifest__.py index e8f1cc0b1d..57d8645e08 100644 --- a/addons/base_import_module/tests/test_module/__manifest__.py +++ b/addons/base_import_module/tests/test_module/__manifest__.py @@ -15,4 +15,5 @@ ], 'installable': True, 'application': True, + 'license': 'LGPL-3', } diff --git a/addons/base_sparse_field/__manifest__.py b/addons/base_sparse_field/__manifest__.py index a13593b783..8b7276800f 100644 --- a/addons/base_sparse_field/__manifest__.py +++ b/addons/base_sparse_field/__manifest__.py @@ -15,4 +15,5 @@ 'security/ir.model.access.csv', 'views/views.xml', ], + 'license': 'LGPL-3', } diff --git a/addons/base_vat/__manifest__.py b/addons/base_vat/__manifest__.py index 8097a809a8..ef0aafe941 100644 --- a/addons/base_vat/__manifest__.py +++ b/addons/base_vat/__manifest__.py @@ -40,4 +40,5 @@ only the country code will be validated. 'views/res_partner_views.xml', 'views/res_config_settings_views.xml', ], + 'license': 'LGPL-3', } diff --git a/addons/board/__manifest__.py b/addons/board/__manifest__.py index 0a8947dafb..43816a5cd0 100644 --- a/addons/board/__manifest__.py +++ b/addons/board/__manifest__.py @@ -21,4 +21,5 @@ Allows users to create custom dashboard. ], 'qweb': ['static/src/xml/board.xml'], 'application': True, + 'license': 'LGPL-3', } diff --git a/addons/bus/__manifest__.py b/addons/bus/__manifest__.py index 2489f6a38f..f8b51ab02a 100644 --- a/addons/bus/__manifest__.py +++ b/addons/bus/__manifest__.py @@ -10,4 +10,5 @@ 'security/ir.model.access.csv', ], 'installable': True, + 'license': 'LGPL-3', } diff --git a/addons/calendar/__manifest__.py b/addons/calendar/__manifest__.py index ba92fce686..509edf3822 100644 --- a/addons/calendar/__manifest__.py +++ b/addons/calendar/__manifest__.py @@ -37,4 +37,5 @@ If you need to manage your meetings, you should install the CRM module. 'installable': True, 'application': True, 'auto_install': False, + 'license': 'LGPL-3', } diff --git a/addons/calendar_sms/__manifest__.py b/addons/calendar_sms/__manifest__.py index 1237b15c8c..cd8ed40bca 100644 --- a/addons/calendar_sms/__manifest__.py +++ b/addons/calendar_sms/__manifest__.py @@ -15,4 +15,5 @@ ], 'application': False, 'auto_install': True, + 'license': 'LGPL-3', } diff --git a/addons/contacts/__manifest__.py b/addons/contacts/__manifest__.py index f55131c844..a7d7158c02 100644 --- a/addons/contacts/__manifest__.py +++ b/addons/contacts/__manifest__.py @@ -16,4 +16,5 @@ You can track your vendors, customers and other contacts. 'views/contact_views.xml', ], 'application': True, + 'license': 'LGPL-3', } diff --git a/addons/coupon/__manifest__.py b/addons/coupon/__manifest__.py index c45f623671..b920aefd68 100644 --- a/addons/coupon/__manifest__.py +++ b/addons/coupon/__manifest__.py @@ -21,4 +21,5 @@ 'demo/coupon_demo.xml', ], 'installable': True, + 'license': 'LGPL-3', } diff --git a/addons/coupon/wizard/coupon_generate.py b/addons/coupon/wizard/coupon_generate.py index 8141227afa..7a3deed046 100644 --- a/addons/coupon/wizard/coupon_generate.py +++ b/addons/coupon/wizard/coupon_generate.py @@ -38,7 +38,7 @@ class CouponGenerate(models.TransientModel): del context template = self.env.ref('coupon.mail_template_sale_coupon', raise_if_not_found=False) if template: - email_values = {'email_to': partner.email, 'email_from': self.env.user.email or '', 'subject': subject} + email_values = {'email_from': self.env.user.email or '', 'subject': subject} template.send_mail(coupon.id, email_values=email_values, notif_layout='mail.mail_notification_light') @api.depends('partners_domain') diff --git a/addons/crm/__manifest__.py b/addons/crm/__manifest__.py index 63825a11d9..236aeba2b9 100644 --- a/addons/crm/__manifest__.py +++ b/addons/crm/__manifest__.py @@ -63,5 +63,6 @@ 'css': ['static/src/css/crm.css'], 'installable': True, 'application': True, - 'auto_install': False + 'auto_install': False, + 'license': 'LGPL-3', } diff --git a/addons/crm_livechat/__manifest__.py b/addons/crm_livechat/__manifest__.py index 060236afc8..faad21066e 100644 --- a/addons/crm_livechat/__manifest__.py +++ b/addons/crm_livechat/__manifest__.py @@ -13,5 +13,6 @@ 'im_livechat' ], 'description': 'Create new lead with using /lead command in the channel', - 'auto_install': True + 'auto_install': True, + 'license': 'LGPL-3', } diff --git a/addons/crm_sms/__manifest__.py b/addons/crm_sms/__manifest__.py index 1f5414610a..80de3da808 100644 --- a/addons/crm_sms/__manifest__.py +++ b/addons/crm_sms/__manifest__.py @@ -16,4 +16,5 @@ 'installable': True, 'application': False, 'auto_install': True, + 'license': 'LGPL-3', } diff --git a/addons/delivery/__manifest__.py b/addons/delivery/__manifest__.py index f7c3eea1a2..9a80a1d9fa 100644 --- a/addons/delivery/__manifest__.py +++ b/addons/delivery/__manifest__.py @@ -32,4 +32,5 @@ invoices from picking, the system is able to add and compute the shipping line. ], 'demo': ['data/delivery_demo.xml'], 'installable': True, + 'license': 'LGPL-3', } diff --git a/addons/delivery/data/delivery_demo.xml b/addons/delivery/data/delivery_demo.xml index 297b11c08a..46541fae9c 100644 --- a/addons/delivery/data/delivery_demo.xml +++ b/addons/delivery/data/delivery_demo.xml @@ -11,6 +11,7 @@ + order 20.0 order @@ -30,6 +31,7 @@ + order 10.0 diff --git a/addons/digest/__manifest__.py b/addons/digest/__manifest__.py index 190af51c6d..b34977f47b 100644 --- a/addons/digest/__manifest__.py +++ b/addons/digest/__manifest__.py @@ -24,4 +24,5 @@ Send KPI Digests periodically 'views/res_config_settings_views.xml', ], 'installable': True, + 'license': 'LGPL-3', } diff --git a/addons/event/__manifest__.py b/addons/event/__manifest__.py index 1e8cf4a40b..9a6122e17b 100644 --- a/addons/event/__manifest__.py +++ b/addons/event/__manifest__.py @@ -43,4 +43,5 @@ Key Features ], 'installable': True, 'auto_install': False, + 'license': 'LGPL-3', } diff --git a/addons/event_crm/__manifest__.py b/addons/event_crm/__manifest__.py index 0faec5063f..995fafe267 100644 --- a/addons/event_crm/__manifest__.py +++ b/addons/event_crm/__manifest__.py @@ -21,4 +21,5 @@ ], 'installable': True, 'auto_install': True, + 'license': 'LGPL-3', } diff --git a/addons/event_crm_sale/__manifest__.py b/addons/event_crm_sale/__manifest__.py index dcbb473af7..f9080f00df 100644 --- a/addons/event_crm_sale/__manifest__.py +++ b/addons/event_crm_sale/__manifest__.py @@ -13,4 +13,5 @@ ], 'installable': True, 'auto_install': True, + 'license': 'LGPL-3', } diff --git a/addons/event_sale/__manifest__.py b/addons/event_sale/__manifest__.py index 42a43fd357..dd0e8f0926 100644 --- a/addons/event_sale/__manifest__.py +++ b/addons/event_sale/__manifest__.py @@ -36,5 +36,6 @@ this event. ], 'demo': ['data/event_demo.xml'], 'installable': True, - 'auto_install': True + 'auto_install': True, + 'license': 'LGPL-3', } diff --git a/addons/event_sms/__manifest__.py b/addons/event_sms/__manifest__.py index a74d2c13e4..710dcecbbe 100644 --- a/addons/event_sms/__manifest__.py +++ b/addons/event_sms/__manifest__.py @@ -17,5 +17,6 @@ 'demo': [ ], 'installable': True, - 'auto_install': True + 'auto_install': True, + 'license': 'LGPL-3', } diff --git a/addons/fetchmail/__manifest__.py b/addons/fetchmail/__manifest__.py index d6646046c1..b433a74a39 100644 --- a/addons/fetchmail/__manifest__.py +++ b/addons/fetchmail/__manifest__.py @@ -44,4 +44,5 @@ For more specific needs, you may also assign custom-defined actions 'demo': [], 'installable': True, 'auto_install': True, + 'license': 'LGPL-3', } diff --git a/addons/flectra_referral/__manifest__.py b/addons/flectra_referral/__manifest__.py index 51ee2c07a3..3e2ef315a4 100644 --- a/addons/flectra_referral/__manifest__.py +++ b/addons/flectra_referral/__manifest__.py @@ -13,4 +13,5 @@ "static/src/xml/systray.xml", ], 'auto_install': False, + 'license': 'LGPL-3', } diff --git a/addons/fleet/__manifest__.py b/addons/fleet/__manifest__.py index 4c5459b795..d382777832 100644 --- a/addons/fleet/__manifest__.py +++ b/addons/fleet/__manifest__.py @@ -46,4 +46,5 @@ Main Features 'installable': True, 'application': True, + 'license': 'LGPL-3', } diff --git a/addons/fleet/report/fleet_report.py b/addons/fleet/report/fleet_report.py index 6ec2066265..5de281424f 100644 --- a/addons/fleet/report/fleet_report.py +++ b/addons/fleet/report/fleet_report.py @@ -42,8 +42,8 @@ WITH service_costs AS ( fleet_vehicle ve CROSS JOIN generate_series(( SELECT - min(acquisition_date) - FROM fleet_vehicle), CURRENT_DATE, '1 month') d + min(date) + FROM fleet_vehicle_log_services), CURRENT_DATE + '1 month'::interval, '1 month') d LEFT JOIN fleet_vehicle_log_services se ON se.vehicle_id = ve.id AND date_trunc('month', se.date) = date_trunc('month', d) WHERE @@ -74,7 +74,7 @@ contract_costs AS ( CROSS JOIN generate_series(( SELECT min(acquisition_date) - FROM fleet_vehicle), CURRENT_DATE, '1 month') d + FROM fleet_vehicle), CURRENT_DATE + '1 month'::interval, '1 month') d LEFT JOIN fleet_vehicle_log_contract co ON co.vehicle_id = ve.id AND date_trunc('month', co.date) = date_trunc('month', d) LEFT JOIN fleet_vehicle_log_contract cod ON cod.vehicle_id = ve.id diff --git a/addons/gamification/__manifest__.py b/addons/gamification/__manifest__.py index c092456013..190bcf8de0 100644 --- a/addons/gamification/__manifest__.py +++ b/addons/gamification/__manifest__.py @@ -41,4 +41,5 @@ Both goals and badges are flexibles and can be adapted to a large range of modul 'data/gamification_karma_rank_demo.xml', 'data/gamification_karma_tracking_demo.xml', ], + 'license': 'LGPL-3', } diff --git a/addons/gamification_sale_crm/__manifest__.py b/addons/gamification_sale_crm/__manifest__.py index 370a793e25..70239b6d35 100644 --- a/addons/gamification_sale_crm/__manifest__.py +++ b/addons/gamification_sale_crm/__manifest__.py @@ -9,4 +9,5 @@ 'data': ['data/gamification_sale_crm_data.xml'], 'demo': ['data/gamification_sale_crm_demo.xml'], 'auto_install': True, + 'license': 'LGPL-3', } diff --git a/addons/google_account/__manifest__.py b/addons/google_account/__manifest__.py index 1ebf3d6f22..64450dafdf 100644 --- a/addons/google_account/__manifest__.py +++ b/addons/google_account/__manifest__.py @@ -12,4 +12,5 @@ The module adds google user in res user. 'data': [ 'data/google_account_data.xml', ], + 'license': 'LGPL-3', } diff --git a/addons/google_calendar/__manifest__.py b/addons/google_calendar/__manifest__.py index b881bcf3a9..27aff54744 100644 --- a/addons/google_calendar/__manifest__.py +++ b/addons/google_calendar/__manifest__.py @@ -20,4 +20,5 @@ 'demo': [], 'installable': True, 'auto_install': False, + 'license': 'LGPL-3', } diff --git a/addons/google_drive/__manifest__.py b/addons/google_drive/__manifest__.py index d14799dc8b..87a0b7c7fc 100644 --- a/addons/google_drive/__manifest__.py +++ b/addons/google_drive/__manifest__.py @@ -25,5 +25,6 @@ Integrate google document to Flectra record. This module allows you to integrate google documents to any of your Flectra record quickly and easily using OAuth 2.0 for Installed Applications, You can configure your google Authorization Code from Settings > Configuration > General Settings by clicking on "Generate Google Authorization Code" -""" +""", + 'license': 'LGPL-3', } diff --git a/addons/google_recaptcha/__manifest__.py b/addons/google_recaptcha/__manifest__.py index 4ef3377ee2..51e0829dfc 100644 --- a/addons/google_recaptcha/__manifest__.py +++ b/addons/google_recaptcha/__manifest__.py @@ -14,4 +14,5 @@ 'views/res_config_settings_view.xml', ], 'auto_install': False, + 'license': 'LGPL-3', } diff --git a/addons/google_spreadsheet/__manifest__.py b/addons/google_spreadsheet/__manifest__.py index 888627bd02..ef10c9c112 100644 --- a/addons/google_spreadsheet/__manifest__.py +++ b/addons/google_spreadsheet/__manifest__.py @@ -20,4 +20,5 @@ The module adds the possibility to display data from Flectra in Google Spreadshe 'demo': [], 'installable': True, 'auto_install': False, + 'license': 'LGPL-3', } diff --git a/addons/hr/__manifest__.py b/addons/hr/__manifest__.py index e1670899dc..b70d64e075 100644 --- a/addons/hr/__manifest__.py +++ b/addons/hr/__manifest__.py @@ -50,4 +50,5 @@ 'static/src/bugfix/bugfix.xml', 'static/src/xml/hr_templates.xml', ], + 'license': 'LGPL-3', } diff --git a/addons/hr_attendance/__manifest__.py b/addons/hr_attendance/__manifest__.py index e5770a2702..d19ddc1ade 100644 --- a/addons/hr_attendance/__manifest__.py +++ b/addons/hr_attendance/__manifest__.py @@ -35,4 +35,5 @@ actions(Check in/Check out) performed by them. "static/src/xml/attendance.xml", ], 'application': True, + 'license': 'LGPL-3', } diff --git a/addons/hr_contract/__manifest__.py b/addons/hr_contract/__manifest__.py index 7b2acf99e5..ba62d970c1 100644 --- a/addons/hr_contract/__manifest__.py +++ b/addons/hr_contract/__manifest__.py @@ -31,4 +31,5 @@ You can assign several contracts per employee. 'installable': True, 'auto_install': False, 'application': True, + 'license': 'LGPL-3', } diff --git a/addons/hr_expense/__manifest__.py b/addons/hr_expense/__manifest__.py index fa5bbbdf0c..466746aa34 100644 --- a/addons/hr_expense/__manifest__.py +++ b/addons/hr_expense/__manifest__.py @@ -52,4 +52,5 @@ This module also uses analytic accounting and is compatible with the invoice on ], 'installable': True, 'application': True, + 'license': 'LGPL-3', } diff --git a/addons/hr_expense/tests/test_expenses.py b/addons/hr_expense/tests/test_expenses.py index 2fc0d5bbda..e99c571048 100644 --- a/addons/hr_expense/tests/test_expenses.py +++ b/addons/hr_expense/tests/test_expenses.py @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- # Part of Odoo, Flectra. See LICENSE file for full copyright and licensing details. from flectra.addons.hr_expense.tests.common import TestExpenseCommon -from flectra.tests import tagged +from flectra.tests import tagged, Form from flectra import fields +from flectra.exceptions import UserError @tagged('-at_install', 'post_install') @@ -168,3 +169,57 @@ class TestExpenses(TestExpenseCommon): # Assert not "Cannot create unbalanced journal entry" error. expense.action_sheet_move_create() + + def test_reconcile_payment(self): + tax = self.env['account.tax'].create({ + 'name': 'tax abc', + 'type_tax_use': 'purchase', + 'amount_type': 'percent', + 'amount': 15, + 'price_include': False, + 'include_base_amount': False, + 'tax_exigibility': 'on_payment' + }) + current_assets_type = self.env.ref('account.data_account_type_current_assets') + company = self.env.company.id + tax.cash_basis_transition_account_id = self.env['account.account'].create({ + 'name': "test", + 'code': 999991, + 'reconcile': True, + 'user_type_id': current_assets_type.id, + 'company_id': company, + }).id + + sheet = self.env['hr.expense.sheet'].create({ + 'company_id': company, + 'employee_id': self.expense_employee.id, + 'name': 'test sheet', + 'expense_line_ids': [ + (0, 0, { + 'name': 'expense_1', + 'date': '2016-01-01', + 'product_id': self.product_a.id, + 'unit_amount': 10.0, + 'employee_id': self.expense_employee.id, + 'tax_ids': tax + }), + (0, 0, { + 'name': 'expense_2', + 'date': '2016-01-01', + 'product_id': self.product_a.id, + 'unit_amount': 1.0, + 'employee_id': self.expense_employee.id, + 'tax_ids': tax + }), + ], + }) + + + #actions + sheet.action_submit_sheet() + sheet.approve_expense_sheets() + sheet.action_sheet_move_create() + action_data = sheet.action_register_payment() + wizard = Form(self.env['account.payment.register'].with_context(action_data['context'])).save() + wizard.action_create_payments() + self.assertEqual(sheet.state, 'done', 'all account.move.line linked to expenses must be reconciled after payment') diff --git a/addons/hr_fleet/__manifest__.py b/addons/hr_fleet/__manifest__.py index b6cc95a1ce..097aba8677 100644 --- a/addons/hr_fleet/__manifest__.py +++ b/addons/hr_fleet/__manifest__.py @@ -13,4 +13,5 @@ 'wizard/hr_departure_wizard_views.xml' ], 'auto_install': True, + 'license': 'LGPL-3', } diff --git a/addons/hr_gamification/__manifest__.py b/addons/hr_gamification/__manifest__.py index b7409fa0b5..b00f22f270 100644 --- a/addons/hr_gamification/__manifest__.py +++ b/addons/hr_gamification/__manifest__.py @@ -20,4 +20,5 @@ Badge received are displayed on the user profile. 'views/gamification_templates.xml', ], 'auto_install': True, + 'license': 'LGPL-3', } diff --git a/addons/hr_holidays/__manifest__.py b/addons/hr_holidays/__manifest__.py index 71daf88853..4e4241c37d 100644 --- a/addons/hr_holidays/__manifest__.py +++ b/addons/hr_holidays/__manifest__.py @@ -65,4 +65,5 @@ A synchronization with an internal agenda (Meetings of the CRM module) is also p 'installable': True, 'application': True, 'auto_install': False, + 'license': 'LGPL-3', } diff --git a/addons/hr_holidays_attendance/__manifest__.py b/addons/hr_holidays_attendance/__manifest__.py index 322a608114..8617224abd 100644 --- a/addons/hr_holidays_attendance/__manifest__.py +++ b/addons/hr_holidays_attendance/__manifest__.py @@ -12,4 +12,5 @@ Hides the attendance presence button when an employee is on leave. 'data': [ 'views/hr_employee_views.xml', ], + 'license': 'LGPL-3', } diff --git a/addons/hr_maintenance/__manifest__.py b/addons/hr_maintenance/__manifest__.py index 258dba89a1..0d32aaed38 100644 --- a/addons/hr_maintenance/__manifest__.py +++ b/addons/hr_maintenance/__manifest__.py @@ -17,4 +17,5 @@ 'demo': [], 'installable': True, 'auto_install': True, + 'license': 'LGPL-3', } diff --git a/addons/hr_org_chart/__manifest__.py b/addons/hr_org_chart/__manifest__.py index a1f721d8b3..fd3090dd6e 100644 --- a/addons/hr_org_chart/__manifest__.py +++ b/addons/hr_org_chart/__manifest__.py @@ -21,5 +21,6 @@ This module extend the employee form with a organizational chart. ], 'qweb': [ 'static/src/xml/hr_org_chart.xml', - ] + ], + 'license': 'LGPL-3', } diff --git a/addons/hr_presence/__manifest__.py b/addons/hr_presence/__manifest__.py index aa4f67e8c6..875d9cdd4d 100644 --- a/addons/hr_presence/__manifest__.py +++ b/addons/hr_presence/__manifest__.py @@ -28,4 +28,5 @@ Allows to contact directly the employee in case of unjustified absence. 'demo': [], 'installable': True, 'auto_install': False, + 'license': 'LGPL-3', } diff --git a/addons/hr_recruitment/__manifest__.py b/addons/hr_recruitment/__manifest__.py index c746a63c3c..022c5ed25f 100644 --- a/addons/hr_recruitment/__manifest__.py +++ b/addons/hr_recruitment/__manifest__.py @@ -39,4 +39,5 @@ 'installable': True, 'auto_install': False, 'application': True, + 'license': 'LGPL-3', } diff --git a/addons/hr_recruitment_survey/__manifest__.py b/addons/hr_recruitment_survey/__manifest__.py index 32b1f5f4f4..f799639c0d 100644 --- a/addons/hr_recruitment_survey/__manifest__.py +++ b/addons/hr_recruitment_survey/__manifest__.py @@ -21,4 +21,5 @@ 'data/hr_job_demo.xml', ], 'auto_install': False, + 'license': 'LGPL-3', } diff --git a/addons/hr_skills/__manifest__.py b/addons/hr_skills/__manifest__.py index 7162c3989a..2bc8cf38e4 100644 --- a/addons/hr_skills/__manifest__.py +++ b/addons/hr_skills/__manifest__.py @@ -33,4 +33,5 @@ This module introduces skills and resumé management for employees. ], 'installable': True, 'application': True, + 'license': 'LGPL-3', } diff --git a/addons/hr_skills_slides/__manifest__.py b/addons/hr_skills_slides/__manifest__.py index 00f29c7b61..eddc069fdd 100644 --- a/addons/hr_skills_slides/__manifest__.py +++ b/addons/hr_skills_slides/__manifest__.py @@ -22,4 +22,5 @@ This module add completed courses to resumé for employees. 'static/src/xml/resume_templates.xml', ], 'auto_install': True, + 'license': 'LGPL-3', } diff --git a/addons/hr_skills_survey/__manifest__.py b/addons/hr_skills_survey/__manifest__.py index 8f7cf75d28..70413bb8fe 100644 --- a/addons/hr_skills_survey/__manifest__.py +++ b/addons/hr_skills_survey/__manifest__.py @@ -22,4 +22,5 @@ This module adds certification to resumé for employees. 'static/src/xml/resume_templates.xml', ], 'auto_install': True, + 'license': 'LGPL-3', } diff --git a/addons/hr_timesheet/__manifest__.py b/addons/hr_timesheet/__manifest__.py index bb06966d18..4c292f3eed 100644 --- a/addons/hr_timesheet/__manifest__.py +++ b/addons/hr_timesheet/__manifest__.py @@ -46,4 +46,5 @@ up a management by affair. 'application': False, 'auto_install': False, 'post_init_hook': 'create_internal_project', + 'license': 'LGPL-3', } diff --git a/addons/hr_timesheet/report/report_timesheet_templates.xml b/addons/hr_timesheet/report/report_timesheet_templates.xml index f48b60c5a3..339913f081 100644 --- a/addons/hr_timesheet/report/report_timesheet_templates.xml +++ b/addons/hr_timesheet/report/report_timesheet_templates.xml @@ -2,6 +2,7 @@