diff --git a/addons/account/__manifest__.py b/addons/account/__manifest__.py index fdb296eb7b1..fd56de27e03 100644 --- a/addons/account/__manifest__.py +++ b/addons/account/__manifest__.py @@ -6,11 +6,7 @@ 'summary': 'Send Invoices and Track Payments', 'sequence': 30, 'description': """ -Invoicing & Payments -==================== -The specific and easy-to-use Invoicing system in Odoo allows you to keep track of your accounting, even when you are not an accountant. It provides an easy way to follow up on your vendors and customers. - -You could use this simplified accounting in case you work with an (external) account to keep your books, and you still want to keep track of payments. This module also offers you an easy method of registering payments, without having to encode complete abstracts of account. +Core mechanisms for the accounting modules. To display the menuitems, install the module account_invoicing. """, 'category': 'Accounting', 'website': 'https://www.odoo.com/page/billing', @@ -75,7 +71,7 @@ You could use this simplified accounting in case you work with an (external) acc "static/src/xml/account_report_backend.xml", ], 'installable': True, - 'application': True, + 'application': False, 'auto_install': False, 'post_init_hook': '_auto_install_l10n', } diff --git a/addons/account/views/account_menuitem.xml b/addons/account/views/account_menuitem.xml index af0457d9b08..92e59ad21e1 100644 --- a/addons/account/views/account_menuitem.xml +++ b/addons/account/views/account_menuitem.xml @@ -6,9 +6,13 @@ + + + + diff --git a/addons/account/views/product_view.xml b/addons/account/views/product_view.xml index 2cc9b5a67b6..f8979bd45da 100644 --- a/addons/account/views/product_view.xml +++ b/addons/account/views/product_view.xml @@ -24,7 +24,7 @@ - + diff --git a/addons/account_accountant/__manifest__.py b/addons/account_accountant/__manifest__.py index f8af161bd47..d9f442828b4 100644 --- a/addons/account_accountant/__manifest__.py +++ b/addons/account_accountant/__manifest__.py @@ -14,7 +14,7 @@ It gives the Administrator user access to all accounting features such as journa It assigns manager and user access rights to the Administrator for the accounting application and only user rights to the Demo user. """, 'website': 'https://www.odoo.com/page/accounting', - 'depends': ['account', 'web_tour'], + 'depends': ['account_invoicing', 'web_tour'], 'data': [ 'data/account_accountant_data.xml', 'security/account_accountant_security.xml', diff --git a/addons/account_accountant/data/account_accountant_data.xml b/addons/account_accountant/data/account_accountant_data.xml index 11970da9d7d..8bc3efb8d40 100644 --- a/addons/account_accountant/data/account_accountant_data.xml +++ b/addons/account_accountant/data/account_accountant_data.xml @@ -3,7 +3,7 @@ diff --git a/addons/account_invoicing/__init__.py b/addons/account_invoicing/__init__.py new file mode 100644 index 00000000000..67dee8c60db --- /dev/null +++ b/addons/account_invoicing/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. diff --git a/addons/account_invoicing/__manifest__.py b/addons/account_invoicing/__manifest__.py new file mode 100644 index 00000000000..34df30dd845 --- /dev/null +++ b/addons/account_invoicing/__manifest__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +{ + 'name': 'Invoicing Management', + 'version': '1.0', + 'summary': 'Send Invoices and Track Payments', + 'sequence': 30, + 'description': """ +Invoicing & Payments +==================== +The specific and easy-to-use Invoicing system in Odoo allows you to keep track of your accounting, even when you are not an accountant. It provides an easy way to follow up on your vendors and customers. + +You could use this simplified accounting in case you work with an (external) account to keep your books, and you still want to keep track of payments. This module also offers you an easy method of registering payments, without having to encode complete abstracts of account. + """, + 'category': 'Invoicing Management', + 'website': 'https://www.odoo.com/page/billing', + 'depends': ['account'], + 'data': [ + 'views/account_menuitem_views.xml', + 'views/product_template_views.xml', + ], + 'demo': [ + ], + 'qweb': [ + ], + 'application': True, +} diff --git a/addons/account/static/description/account_sc_00.png b/addons/account_invoicing/static/description/account_sc_00.png similarity index 100% rename from addons/account/static/description/account_sc_00.png rename to addons/account_invoicing/static/description/account_sc_00.png diff --git a/addons/account/static/description/account_sc_01.png b/addons/account_invoicing/static/description/account_sc_01.png similarity index 100% rename from addons/account/static/description/account_sc_01.png rename to addons/account_invoicing/static/description/account_sc_01.png diff --git a/addons/account/static/description/account_sc_03.png b/addons/account_invoicing/static/description/account_sc_03.png similarity index 100% rename from addons/account/static/description/account_sc_03.png rename to addons/account_invoicing/static/description/account_sc_03.png diff --git a/addons/account/static/description/account_voucher.png b/addons/account_invoicing/static/description/account_voucher.png similarity index 100% rename from addons/account/static/description/account_voucher.png rename to addons/account_invoicing/static/description/account_voucher.png diff --git a/addons/account/static/description/analysis.png b/addons/account_invoicing/static/description/analysis.png similarity index 100% rename from addons/account/static/description/analysis.png rename to addons/account_invoicing/static/description/analysis.png diff --git a/addons/account/static/description/icon.png b/addons/account_invoicing/static/description/icon.png similarity index 100% rename from addons/account/static/description/icon.png rename to addons/account_invoicing/static/description/icon.png diff --git a/addons/account/static/description/index.html b/addons/account_invoicing/static/description/index.html similarity index 100% rename from addons/account/static/description/index.html rename to addons/account_invoicing/static/description/index.html diff --git a/addons/account_invoicing/views/account_menuitem_views.xml b/addons/account_invoicing/views/account_menuitem_views.xml new file mode 100644 index 00000000000..947b92fe033 --- /dev/null +++ b/addons/account_invoicing/views/account_menuitem_views.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/addons/account_invoicing/views/product_template_views.xml b/addons/account_invoicing/views/product_template_views.xml new file mode 100644 index 00000000000..b9ce26f3f36 --- /dev/null +++ b/addons/account_invoicing/views/product_template_views.xml @@ -0,0 +1,13 @@ + + + + product.template.invoice.policy + product.template + + + + + + + + \ No newline at end of file diff --git a/addons/payment/data/payment_acquirer_data.xml b/addons/payment/data/payment_acquirer_data.xml index 0271aebdd52..5908c6e5366 100644 --- a/addons/payment/data/payment_acquirer_data.xml +++ b/addons/payment/data/payment_acquirer_data.xml @@ -155,13 +155,12 @@ Custom - none

- A generic payment method to send payment instructions to any payment acquirer. + A generic payment acquirer to send payment instructions to any payment acquirer.

  • Online Payment
  • diff --git a/addons/payment/models/account_payment.py b/addons/payment/models/account_payment.py index 60ddcc60b4d..5a15e71e6e5 100644 --- a/addons/payment/models/account_payment.py +++ b/addons/payment/models/account_payment.py @@ -10,7 +10,7 @@ class AccountPayment(models.Model): _inherit = 'account.payment' payment_transaction_id = fields.Many2one('payment.transaction', string="Payment Transaction") - payment_token_id = fields.Many2one('payment.token', string="Saved payment token", domain=[('acquirer_id.auto_confirm', '!=', 'authorize')], + payment_token_id = fields.Many2one('payment.token', string="Saved payment token", domain=[('acquirer_id.capture_manually', '=', False)], help="Note that tokens from acquirers set to only authorize transactions (instead of capturing the amount) are not available.") @api.onchange('partner_id') @@ -18,14 +18,14 @@ class AccountPayment(models.Model): res = {} if self.partner_id: partners = self.partner_id | self.partner_id.commercial_partner_id | self.partner_id.commercial_partner_id.child_ids - res['domain'] = {'payment_token_id': [('partner_id', 'in', partners.ids), ('acquirer_id.auto_confirm', '!=', 'authorize')]} + res['domain'] = {'payment_token_id': [('partner_id', 'in', partners.ids), ('acquirer_id.capture_manually', '=', False)]} return res @api.onchange('payment_method_id', 'journal_id') def _onchange_payment_method(self): if self.payment_method_code == 'electronic': - self.payment_token_id = self.env['payment.token'].search([('partner_id', '=', self.partner_id.id), ('acquirer_id.auto_confirm', '!=', 'authorize')], limit=1) + self.payment_token_id = self.env['payment.token'].search([('partner_id', '=', self.partner_id.id), ('acquirer_id.capture_manually', '=', False)], limit=1) else: self.payment_token_id = False @@ -38,7 +38,7 @@ class AccountPayment(models.Model): return account_payment def _do_payment(self): - if self.payment_token_id.acquirer_id.auto_confirm == 'authorize': + if self.payment_token_id.acquirer_id.capture_manually: raise ValidationError(_('This feature is not available for payment acquirers set to the "Authorize" mode.\n' 'Please use a token from another provider than %s.') % self.payment_token_id.acquirer_id.name) reference = "P-%s-%s" % (self.id, datetime.datetime.now().strftime('%y%m%d_%H%M%S')) diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py index 92f0da0bc74..bbb054a7a0b 100644 --- a/addons/payment/models/payment_acquirer.py +++ b/addons/payment/models/payment_acquirer.py @@ -71,15 +71,22 @@ class PaymentAcquirer(models.Model): website_published = fields.Boolean( 'Visible in Portal / Website', copy=False, help="Make this payment acquirer available (Customer invoices, etc.)") - auto_confirm = fields.Selection([ - ('none', 'No automatic confirmation'), - ('authorize', 'Authorize the amount and confirm the order on acquirer confirmation (capture manually)'), - ('confirm_so', 'Authorize & capture the amount and confirm the order on acquirer confirmation'), - ('generate_and_pay_invoice', 'Authorize & capture the amount, confirm the order and auto-validate the invoice on acquirer confirmation')], - string='Order Confirmation', default='confirm_so', required=True) + # Formerly associated to `authorize` option from auto_confirm + capture_manually = fields.Boolean(string="Capture Amount Manually", + help="Capture the amount from Odoo, when the delivery is completed.") + # Formerly associated to `generate_and_pay_invoice` option from auto_confirm journal_id = fields.Many2one( - 'account.journal', 'Payment Journal', - help="Account journal used for automatic payment reconciliation.") + 'account.journal', 'Payment Journal', domain=[('type', '=', 'bank')], + default=lambda self: self.env['account.journal'].search([('type', '=', 'bank')], limit=1), + help="""Payments will be registered into this journal. If you get paid straight on your bank account, + select your bank account. If you get paid in batch for several transactions, create a specific + payment journal for this payment acquirer to easily manage the bank reconciliation. You hold + the amount in a temporary transfer account of your books (created automatically when you create + the payment journal). Then when you get paid on your bank account by the payment acquirer, you + reconcile the bank statement line with this temporary transfer account. Use reconciliation + templates to do it in one-click.""") + specific_countries = fields.Boolean(string="Specific Countries", + help="If you leave it empty, the payment acquirer will be available for all the countries.") country_ids = fields.Many2many( 'res.country', 'payment_country_rel', 'payment_id', 'country_id', 'Countries', @@ -116,7 +123,7 @@ class PaymentAcquirer(models.Model): "If you manage subscriptions (recurring invoicing), you need it to automatically charge the customer when you " "issue an invoice.") token_implemented = fields.Boolean('Saving Card Data supported', compute='_compute_feature_support') - + authorize_implemented = fields.Boolean('Authorize Mechanism Supported', compute='_compute_feature_support') fees_implemented = fields.Boolean('Fees Computation Supported', compute='_compute_feature_support') fees_active = fields.Boolean('Add Extra Fees') fees_dom_fixed = fields.Float('Fixed domestic fees') @@ -142,11 +149,11 @@ class PaymentAcquirer(models.Model): "resized as a 64x64px image, with aspect ratio preserved. " "Use this field anywhere a small image is required.") - @api.multi def _compute_feature_support(self): feature_support = self._get_feature_support() for acquirer in self: acquirer.fees_implemented = acquirer.provider in feature_support['fees'] + acquirer.authorize_implemented = acquirer.provider in feature_support['authorize'] acquirer.token_implemented = acquirer.provider in feature_support['tokenize'] @api.multi @@ -158,13 +165,6 @@ class PaymentAcquirer(models.Model): return False return True - @api.constrains('auto_confirm') - def _check_authorization_support(self): - for acquirer in self: - if acquirer.auto_confirm == 'authorize' and acquirer.provider not in self._get_feature_support()['authorize']: - raise ValidationError(_('You cannot capture payments manually with this payment method. Please choose another Order Confirmation mode (in Configuration tab).')) - return True - _constraints = [ (_check_required_if_provider, 'Required fields not filled', []), ] @@ -185,13 +185,22 @@ class PaymentAcquirer(models.Model): @api.model def create(self, vals): image_resize_images(vals) + vals = self._check_journal_id(vals) return super(PaymentAcquirer, self).create(vals) @api.multi def write(self, vals): image_resize_images(vals) + vals = self._check_journal_id(vals) return super(PaymentAcquirer, self).write(vals) + def _check_journal_id(self, vals): + if not vals.get('journal_id', False): + default_journal = self.env['account.journal'].search([('type', '=', 'bank')], limit=1) + if default_journal: + vals.update({'journal_id': default_journal.id}) + return vals + @api.multi def toggle_website_published(self): self.write({'website_published': not self.website_published}) diff --git a/addons/payment/views/payment_views.xml b/addons/payment/views/payment_views.xml index 1a3f60e47cb..deaf1dee0bd 100644 --- a/addons/payment/views/payment_views.xml +++ b/addons/payment/views/payment_views.xml @@ -8,16 +8,6 @@ id='root_payment_menu' parent='account.menu_finance_configuration'/> - - - Payment Transactions - payment.transaction - form - tree,form - [('acquirer_id','=',active_id)] - {'default_acquirer_id': active_id} - - payment.acquirer.form payment.acquirer @@ -26,16 +16,11 @@ +
    -
    - @@ -93,10 +81,16 @@ - + - - + + + + + + + + - - - - - - -
    @@ -203,13 +190,13 @@
    - Payment Methods + Payment Acquirers payment.acquirer form kanban,tree,form

    - Click to create a payment method. + Click to create a payment acquirer.

    diff --git a/addons/payment_authorize/models/payment.py b/addons/payment_authorize/models/payment.py index a80627dbf35..24d57cb0db7 100644 --- a/addons/payment_authorize/models/payment.py +++ b/addons/payment_authorize/models/payment.py @@ -66,7 +66,7 @@ class PaymentAcquirerAuthorize(models.Model): 'x_trans_key': self.authorize_transaction_key, 'x_amount': str(values['amount']), 'x_show_form': 'PAYMENT_FORM', - 'x_type': 'AUTH_CAPTURE' if self.auto_confirm != 'authorize' else 'AUTH_ONLY', + 'x_type': 'AUTH_CAPTURE' if not self.capture_manually else 'AUTH_ONLY', 'x_method': 'CC', 'x_fp_sequence': '%s%s' % (self.id, int(time.time())), 'x_version': '3.1', @@ -246,7 +246,7 @@ class TxAuthorize(models.Model): def authorize_s2s_do_transaction(self, **data): self.ensure_one() transaction = AuthorizeAPI(self.acquirer_id) - if self.acquirer_id.auto_confirm != "authorize": + if not self.acquirer_id.capture_manually: res = transaction.auth_and_capture(self.payment_token_id, self.amount, self.reference) else: res = transaction.authorize(self.payment_token_id, self.amount, self.reference) diff --git a/addons/payment_authorize/tests/test_authorize.py b/addons/payment_authorize/tests/test_authorize.py index d19690284a8..b02d3d81209 100644 --- a/addons/payment_authorize/tests/test_authorize.py +++ b/addons/payment_authorize/tests/test_authorize.py @@ -25,7 +25,7 @@ class AuthorizeCommon(PaymentAcquirerCommon): # get the authorize account self.authorize = self.env.ref('payment.payment_acquirer_authorize') # Be sure to be in 'capture' mode - self.authorize.auto_confirm = 'confirm_so' + # self.authorize.auto_confirm = 'confirm_so' @odoo.tests.common.at_install(True) @@ -219,7 +219,7 @@ class AuthorizeForm(AuthorizeCommon): # switch to 'authorize only' # create authorize only s2s transaction & capture it - self.authorize.auto_confirm = 'authorize' + self.authorize.capture_manually = True transaction = self.env['payment.transaction'].create({ 'amount': 500, 'acquirer_id': authorize.id, @@ -236,7 +236,7 @@ class AuthorizeForm(AuthorizeCommon): self.assertEqual(transaction.state, 'done') # create authorize only s2s transaction & void it - self.authorize.auto_confirm = 'authorize' + self.authorize.capture_manually = True transaction = self.env['payment.transaction'].create({ 'amount': 500, 'acquirer_id': authorize.id, diff --git a/addons/payment_transfer/data/payment_acquirer_data.xml b/addons/payment_transfer/data/payment_acquirer_data.xml index 77ff2e2381d..cce3869a8ed 100644 --- a/addons/payment_transfer/data/payment_acquirer_data.xml +++ b/addons/payment_transfer/data/payment_acquirer_data.xml @@ -8,11 +8,10 @@ transfer - none test Transfer information will be provided after choosing the payment method.

    ]]> +

    Transfer information will be provided after choosing the payment aquirer.

    ]]>
    diff --git a/addons/payment_transfer/views/payment_views.xml b/addons/payment_transfer/views/payment_views.xml index 127ab7b1238..a126bb67626 100644 --- a/addons/payment_transfer/views/payment_views.xml +++ b/addons/payment_transfer/views/payment_views.xml @@ -17,9 +17,6 @@ {'invisible': [('provider', '=', 'transfer')]} - - {'invisible': [('provider', '=', 'transfer')]} -
    diff --git a/addons/sale/report/sale_report_views.xml b/addons/sale/report/sale_report_views.xml index 2a660a3616c..f42514261ff 100644 --- a/addons/sale/report/sale_report_views.xml +++ b/addons/sale/report/sale_report_views.xml @@ -94,6 +94,6 @@ This report performs analysis on your quotations and sales orders. Analysis check your sales revenues and sort it by different group criteria (salesman, partner, product, etc.) Use this report to perform analysis on sales not having invoiced yet. If you want to analyse your turnover, you should use the Invoice Analysis report in the Accounting application. - + diff --git a/addons/sale/views/sale_layout_category_view.xml b/addons/sale/views/sale_layout_category_view.xml index ecb0bbebb74..d5130bcd515 100644 --- a/addons/sale/views/sale_layout_category_view.xml +++ b/addons/sale/views/sale_layout_category_view.xml @@ -57,5 +57,6 @@ sequence="2" name="Report Layout Categories" groups="sale.group_sale_layout" + active="False" /> diff --git a/addons/sale/views/sale_views.xml b/addons/sale/views/sale_views.xml index 93a2051bd91..2704cdb146e 100644 --- a/addons/sale/views/sale_views.xml +++ b/addons/sale/views/sale_views.xml @@ -8,31 +8,29 @@ --> - - - - + web_icon="sale,static/description/icon.png" + active="False"/> + groups= "sales_team.group_sale_manager,sales_team.group_sale_salesman,account.group_account_manager,account.group_account_user" + active="False"/> - - + + - - - - - - - - - + + + + + + + + + sale.order.calendar @@ -119,7 +117,7 @@ - + @@ -159,7 +157,7 @@