diff --git a/account_invoice_line_default_account/README.rst b/account_invoice_line_default_account/README.rst index 7c8c3fb89b1..ff76060d690 100644 --- a/account_invoice_line_default_account/README.rst +++ b/account_invoice_line_default_account/README.rst @@ -22,32 +22,17 @@ partner record. Usage ===== -To use this module, you need to: - .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/95/8.0 - -.. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt -.. branch is "8.0" for example - -For further information, please visit: + :target: https://runbot.odoo-community.org/runbot/95/10.0 -* https://www.odoo.com/forum/help-1 - -Known issues / Roadmap -====================== - -* ... Bug Tracker =========== Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed feedback -`here `_. - +If you spotted it first, help us smashing it by providing a detailed and welcomed feedback. Credits ======= diff --git a/account_invoice_line_default_account/__init__.py b/account_invoice_line_default_account/__init__.py index 6f362af3265..cde864bae21 100644 --- a/account_invoice_line_default_account/__init__.py +++ b/account_invoice_line_default_account/__init__.py @@ -1,3 +1,3 @@ -# -*- coding: UTF-8 -*- +# -*- coding: utf-8 -*- from . import models diff --git a/account_invoice_line_default_account/__manifest__.py b/account_invoice_line_default_account/__manifest__.py index 8b20e930781..fff1c0899b1 100644 --- a/account_invoice_line_default_account/__manifest__.py +++ b/account_invoice_line_default_account/__manifest__.py @@ -9,6 +9,7 @@ 'account' ], 'author': 'Therp BV,BCIM,Odoo Community Association (OCA)', + 'license': 'AGPL-3', 'contributors': ['Jacques-Etienne Baudoux '], 'category': 'Accounting', 'data': [ diff --git a/account_invoice_line_default_account/__openerp__.py b/account_invoice_line_default_account/__openerp__.py deleted file mode 100644 index f65163e9717..00000000000 --- a/account_invoice_line_default_account/__openerp__.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2012 Therp BV (). -# This module copyright (C) 2013-2015 BCIM SPRL (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## -{ - 'name': 'Account Invoice Line Default Account', - 'version': '1.0', - 'depends': [ - 'account' - ], - 'author': 'Therp BV,BCIM,Odoo Community Association (OCA)', - 'contributors': ['Jacques-Etienne Baudoux '], - 'category': 'Accounting', - 'data': [ - 'views/res_partner.xml', - 'views/account_invoice.xml', - ], - 'demo': [], - 'test': [], - 'installable': True, - 'active': False, -} diff --git a/account_invoice_line_default_account/models/__init__.py b/account_invoice_line_default_account/models/__init__.py index 4e21273cf5e..7b9b47549bc 100644 --- a/account_invoice_line_default_account/models/__init__.py +++ b/account_invoice_line_default_account/models/__init__.py @@ -1,4 +1,4 @@ -# -*- coding: UTF-8 -*- +# -*- coding: utf-8 -*- from . import res_partner from . import account_invoice_line diff --git a/account_invoice_line_default_account/models/account_invoice_line.py b/account_invoice_line_default_account/models/account_invoice_line.py index ce9b1b3a50d..028d2a4429d 100644 --- a/account_invoice_line_default_account/models/account_invoice_line.py +++ b/account_invoice_line_default_account/models/account_invoice_line.py @@ -1,4 +1,4 @@ -# -*- coding: UTF-8 -*- +# -*- coding: utf-8 -*- # Copyright 2012 Therp BV () # Copyright 2013-2018 BCIM SPRL () diff --git a/account_invoice_line_default_account/models/res_partner.py b/account_invoice_line_default_account/models/res_partner.py index de7da80861d..a866e67e926 100644 --- a/account_invoice_line_default_account/models/res_partner.py +++ b/account_invoice_line_default_account/models/res_partner.py @@ -1,8 +1,28 @@ -# -*- coding: UTF-8 -*- +# -*- coding: utf-8 -*- # Copyright 2012 Therp BV () # Copyright 2013-2018 BCIM SPRL () -from odoo import models, fields +from odoo import models, fields, api + + +class AccountAccountType(models.Model): + _inherit = 'account.account.type' + + @api.model + def name_search(self, name='', args=None, operator='ilike', limit=100): + # Support xmlid in domain + res = [] + if operator == '=': + try: + o = self.env.ref(name) + if o._name == self._name: + res += o.name_get() + except: + pass + if not res: + res = super(AccountAccountType, self).name_search( + name=name, args=args, operator=operator, limit=limit) + return res class ResPartner(models.Model): @@ -11,7 +31,7 @@ class ResPartner(models.Model): property_account_income = fields.Many2one( 'account.account', string='Default Income Account', - domain='''[('user_type_id', '=', 'Income')]''', + domain="[('user_type_id', '=', 'account.data_account_type_revenue')]", help='Default counterpart account for sales on invoice lines', company_dependent=True) auto_update_account_income = fields.Boolean( @@ -22,7 +42,7 @@ class ResPartner(models.Model): property_account_expense = fields.Many2one( 'account.account', string='Default Expense Account', - domain='''[('user_type_id', '=', 'Expenses')]''', + domain="[('user_type_id', '=', 'account.data_account_type_expenses')]", help='Default counterpart account for purchases on invoice lines', company_dependent=True) auto_update_account_expense = fields.Boolean(