diff options
| author | jbw <jbw@odoo.com> | 2021-02-03 15:01:41 +0000 |
|---|---|---|
| committer | jbw <jbw@odoo.com> | 2021-02-08 10:32:45 +0000 |
| commit | d68fb5f72d69d0382392afd7407f94520857f764 (patch) | |
| tree | dcd713708662b27fb7a42329c55cc3981aa3a436 /addons/l10n_be_invoice_bba | |
| parent | 38983d123d171ac3cc1efacd99d9776f0ed08734 (diff) | |
[IMP] account: get default payment ref format with country
Set the payment reference standard to the one of the country of the
company by default.
This is a backport of task 2297165. Mimicking it's bahviour without
merging the l10n_be_invoice_bba module into the l10n_be module.
closes odoo/odoo#65466
Task: 2440462
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Diffstat (limited to 'addons/l10n_be_invoice_bba')
| -rw-r--r-- | addons/l10n_be_invoice_bba/__init__.py | 2 | ||||
| -rw-r--r-- | addons/l10n_be_invoice_bba/__manifest__.py | 5 | ||||
| -rw-r--r-- | addons/l10n_be_invoice_bba/i18n/l10n_be_invoice_bba.pot | 1 | ||||
| -rw-r--r-- | addons/l10n_be_invoice_bba/models/__init__.py | 7 | ||||
| -rw-r--r-- | addons/l10n_be_invoice_bba/models/account_invoice.py | 50 | ||||
| -rw-r--r-- | addons/l10n_be_invoice_bba/models/account_journal.py | 11 |
6 files changed, 6 insertions, 70 deletions
diff --git a/addons/l10n_be_invoice_bba/__init__.py b/addons/l10n_be_invoice_bba/__init__.py index f5bc480ccb8..36c70b731ab 100644 --- a/addons/l10n_be_invoice_bba/__init__.py +++ b/addons/l10n_be_invoice_bba/__init__.py @@ -2,5 +2,3 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. - -from . import models diff --git a/addons/l10n_be_invoice_bba/__manifest__.py b/addons/l10n_be_invoice_bba/__manifest__.py index 96aa38ea70d..9f8402c2e56 100644 --- a/addons/l10n_be_invoice_bba/__manifest__.py +++ b/addons/l10n_be_invoice_bba/__manifest__.py @@ -3,6 +3,11 @@ # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. + +# This module is empty. It is merged whith l10n_be version 14.1. This behaviour was backported in 14.0 +# but the module can not removed in a stable version. + + { 'name': 'Belgium - Structured Communication', 'version': '1.2', diff --git a/addons/l10n_be_invoice_bba/i18n/l10n_be_invoice_bba.pot b/addons/l10n_be_invoice_bba/i18n/l10n_be_invoice_bba.pot index 9aa40adacad..f8bbd6bf5d5 100644 --- a/addons/l10n_be_invoice_bba/i18n/l10n_be_invoice_bba.pot +++ b/addons/l10n_be_invoice_bba/i18n/l10n_be_invoice_bba.pot @@ -41,3 +41,4 @@ msgid "" "You can choose different models for each type of reference. The default one " "is the Odoo reference." msgstr "" + diff --git a/addons/l10n_be_invoice_bba/models/__init__.py b/addons/l10n_be_invoice_bba/models/__init__.py deleted file mode 100644 index 18a4627629e..00000000000 --- a/addons/l10n_be_invoice_bba/models/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. - -from . import account_invoice -from . import account_journal
\ No newline at end of file diff --git a/addons/l10n_be_invoice_bba/models/account_invoice.py b/addons/l10n_be_invoice_bba/models/account_invoice.py deleted file mode 100644 index 3ee6d699319..00000000000 --- a/addons/l10n_be_invoice_bba/models/account_invoice.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. - -import random -import re - -from odoo import api, fields, models, _ -from odoo.exceptions import UserError - -""" -account.move object: add support for Belgian structured communication -""" - - -class AccountMove(models.Model): - _inherit = 'account.move' - - def _get_invoice_reference_be_partner(self): - """ This computes the reference based on the belgian national standard - “OGM-VCS”. - For instance, if an invoice is issued for the partner with internal - reference 'food buyer 654', the digits will be extracted and used as - the data. This will lead to a check number equal to 72 and the - reference will be '+++000/0000/65472+++'. - If no reference is set for the partner, its id in the database will - be used. - """ - self.ensure_one() - bbacomm = (re.sub('\D', '', self.partner_id.ref or '') or str(self.partner_id.id))[-10:].rjust(10, '0') - base = int(bbacomm) - mod = base % 97 or 97 - reference = '+++%s/%s/%s%02d+++' % (bbacomm[:3], bbacomm[3:7], bbacomm[7:], mod) - return reference - - def _get_invoice_reference_be_invoice(self): - """ This computes the reference based on the belgian national standard - “OGM-VCS”. - The data of the reference is the database id number of the invoice. - For instance, if an invoice is issued with id 654, the check number - is 72 so the reference will be '+++000/0000/65472+++'. - """ - self.ensure_one() - base = self.id - bbacomm = str(base).rjust(10, '0') - base = int(bbacomm) - mod = base % 97 or 97 - reference = '+++%s/%s/%s%02d+++' % (bbacomm[:3], bbacomm[3:7], bbacomm[7:], mod) - return reference diff --git a/addons/l10n_be_invoice_bba/models/account_journal.py b/addons/l10n_be_invoice_bba/models/account_journal.py deleted file mode 100644 index 9ec4f408cbd..00000000000 --- a/addons/l10n_be_invoice_bba/models/account_journal.py +++ /dev/null @@ -1,11 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo import fields, models - - -class AccountJournal(models.Model): - _inherit = 'account.journal' - - invoice_reference_model = fields.Selection(selection_add=[ - ('be', 'Belgium') - ], ondelete={'be': lambda recs: recs.write({'invoice_reference_model': 'odoo'})}) |
