-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[REF] l10n_in*: add iap to l10n_in and add l10n_in_gstin_status module
This commit introduces two things: 1. a small refactor for `l10n_in*`: Before this commit l10n_in_edi used to be depends on `iap` but now we have moved the dependency of `iap` to `l10n_in` because part 2 introduces a new module using `iap`. Hence it's best to change `iap` dependency and reduces the code duplication 2. A new module enabling users to check the GSTIN status of vendors. We can install it manually or with 'GST Status API Service' in the 'Customer Invoices' section in the Accounting settings. After installation, Users will find a 'Check Status' button on the partner form. By clicking, the system retrieves the latest GSTIN status from the service provider, displaying the GSTIN status, and the date of the last verification. Now the 'Reverify' button is shown on partner form, vendor bills, customer invoices, credit notes, and debit notes to reverify the status. This enhancement ensures users have up-to-date information regarding vendor compliance directly within Odoo. task-3707122 closes odoo#175290 Related: odoo/enterprise#67787 Related: odoo/upgrade#6335 Signed-off-by: Josse Colpaert (jco) <[email protected]>
- Loading branch information
Showing
23 changed files
with
454 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
'base_vat', | ||
'account_debit_note', | ||
'account', | ||
'iap', | ||
], | ||
'auto_install': ['account'], | ||
'data': [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Part of Odoo. See LICENSE file for full copyright and licensing details. | ||
|
||
from odoo import api, models | ||
from odoo.addons.iap import jsonrpc | ||
|
||
DEFAULT_IAP_ENDPOINT = "https://l10n-in-edi.api.odoo.com" | ||
DEFAULT_IAP_TEST_ENDPOINT = "https://l10n-in-edi-demo.api.odoo.com" | ||
IAP_SERVICE_NAME = 'l10n_in_edi' | ||
|
||
|
||
class IapAccount(models.Model): | ||
_inherit = 'iap.account' | ||
|
||
@api.model | ||
def _l10n_in_connect_to_server(self, is_production, params, url_path, config_parameter, timeout=25): | ||
user_token = self.get(IAP_SERVICE_NAME) | ||
params.update({ | ||
"dbuuid": self.env["ir.config_parameter"].sudo().get_param("database.uuid"), | ||
"account_token": user_token.account_token, | ||
}) | ||
if is_production: | ||
default_endpoint = DEFAULT_IAP_ENDPOINT | ||
else: | ||
default_endpoint = DEFAULT_IAP_TEST_ENDPOINT | ||
endpoint = self.env["ir.config_parameter"].sudo().get_param(config_parameter, default_endpoint) | ||
url = "%s%s" % (endpoint, url_path) | ||
return jsonrpc(url, params=params, timeout=timeout) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
# Part of Odoo. See LICENSE file for full copyright and licensing details. | ||
|
||
from odoo import api, fields, models | ||
from odoo import _, fields, models | ||
from odoo.exceptions import ValidationError | ||
from odoo.addons.l10n_in.models.iap_account import IAP_SERVICE_NAME | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = 'res.config.settings' | ||
|
||
group_l10n_in_reseller = fields.Boolean(implied_group='l10n_in.group_l10n_in_reseller', string="Manage Reseller(E-Commerce)") | ||
l10n_in_edi_production_env = fields.Boolean( | ||
string="Indian Production Environment", | ||
related="company_id.l10n_in_edi_production_env", | ||
readonly=False | ||
) | ||
module_l10n_in_edi = fields.Boolean('Indian Electronic Invoicing') | ||
module_l10n_in_edi_ewaybill = fields.Boolean('Indian Electronic Waybill') | ||
module_l10n_in_gstin_status = fields.Boolean('Check GST Number Status') | ||
l10n_in_hsn_code_digit = fields.Selection(related='company_id.l10n_in_hsn_code_digit', readonly=False) | ||
|
||
def l10n_in_edi_buy_iap(self): | ||
if not self.l10n_in_edi_production_env or not (self.module_l10n_in_edi or self.module_l10n_in_gstin_status): | ||
raise ValidationError(_( | ||
"Please ensure that at least one Indian service and production environment is enabled," | ||
" and save the configuration to proceed with purchasing credits." | ||
)) | ||
return { | ||
'type': 'ir.actions.act_url', | ||
'url': self.env["iap.account"].get_credits_url(service_name=IAP_SERVICE_NAME), | ||
'target': '_new' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ | |
"depends": [ | ||
"account_edi", | ||
"l10n_in", | ||
"iap", | ||
], | ||
"description": """ | ||
Indian - E-invoicing | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Part of Odoo. See LICENSE file for full copyright and licensing details. | ||
|
||
from . import models |
Oops, something went wrong.