-
Notifications
You must be signed in to change notification settings - Fork 23.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
17.0 l10n ke edi oscu dako #162196
Draft
dbkosky
wants to merge
2
commits into
odoo:17.0
Choose a base branch
from
odoo-dev:17.0-l10n-ke-edi-oscu-dako
base: 17.0
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+134
−105
Draft
17.0 l10n ke edi oscu dako #162196
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 |
---|---|---|
@@ -1,101 +1,101 @@ | ||
"id","description","invoice_label","type_tax_use","name","amount_type","amount","tax_group_id","l10n_ke_item_code_id","repartition_line_ids/repartition_type","repartition_line_ids/document_type","repartition_line_ids/tag_ids","repartition_line_ids/factor_percent","repartition_line_ids/account_id" | ||
"ST16","Sales VAT (16%)","Sales VAT (16%)","sale","16%","percent","16.0","tax_group_16","","base","invoice","+16% Sales Base","","" | ||
"","","","","","","","","","tax","invoice","+16% Sales Tax","100","ke2200" | ||
"","","","","","","","","","base","refund","-16% Sales Base","","" | ||
"","","","","","","","","","tax","refund","-16% Sales Tax","100","ke2200" | ||
"ST8","Sales VAT (8%)","Sales VAT (8%)","sale","8%","percent","8.0","tax_group_8","","base","invoice","+8% Sales Base","","" | ||
"","","","","","","","","","tax","invoice","+8% Sales Tax","100","ke2200" | ||
"","","","","","","","","","base","refund","-8% Sales Base","","" | ||
"","","","","","","","","","tax","refund","-8% Sales Tax","100","ke2200" | ||
"ST0","Sales VAT Zero Rated","Sales VAT Zero Rated","sale","0%","percent","0.0","tax_group_0","","base","invoice","+Zero Rated Sales Base","","" | ||
"","","","","","","","","","tax","invoice","","100","" | ||
"","","","","","","","","","base","refund","-Zero Rated Sales Base","","" | ||
"","","","","","","","","","tax","refund","","100","" | ||
"STEX","Sales VAT Exempt","Sales VAT Exempt","sale","0% EXEMPT","percent","0.0","tax_group_0","","base","invoice","+Exempt Sales Base","","" | ||
"","","","","","","","","","tax","invoice","","100","" | ||
"","","","","","","","","","base","refund","-Exempt Sales Base","","" | ||
"","","","","","","","","","tax","refund","","100","" | ||
"SWT3","3% WH","3%","sale","3% WH","percent","-3.0","tax_group_withholding","","base","invoice","","","" | ||
"","","","","","","","","","tax","invoice","","","ke1120" | ||
"","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","tax","refund","","","ke1120" | ||
"SWT5","5% WH","5%","sale","5% WH","percent","-5.0","tax_group_withholding","","base","invoice","","","" | ||
"","","","","","","","","","tax","invoice","","","ke1120" | ||
"","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","tax","refund","","","ke1120" | ||
"SWT10","10% WH","10%","sale","10% WH","percent","-10.0","tax_group_withholding","","base","invoice","","","" | ||
"","","","","","","","","","tax","invoice","","","ke1120" | ||
"","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","tax","refund","","","ke1120" | ||
"SWT12","12% WH","12%","sale","12% WH","percent","-12.0","tax_group_withholding","","base","invoice","","","" | ||
"","","","","","","","","","tax","invoice","","","ke1120" | ||
"","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","tax","refund","","","ke1120" | ||
"SWT15","15% WH","15%","sale","15% WH","percent","-15.0","tax_group_withholding","","base","invoice","","","" | ||
"","","","","","","","","","tax","invoice","","","ke1120" | ||
"","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","tax","refund","","","ke1120" | ||
"SWT20","20% WH","20%","sale","20% WH","percent","-20.0","tax_group_withholding","","base","invoice","","","" | ||
"","","","","","","","","","tax","invoice","","","ke1120" | ||
"","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","tax","refund","","","ke1120" | ||
"SWT25","25% WH","25%","sale","25% WH","percent","-25.0","tax_group_withholding","","base","invoice","","","" | ||
"","","","","","","","","","tax","invoice","","","ke1120" | ||
"","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","tax","refund","","","ke1120" | ||
"SWT30","30% WH","30%","sale","30% WH","percent","-30.0","tax_group_withholding","","base","invoice","","","" | ||
"","","","","","","","","","tax","invoice","","","ke1120" | ||
"","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","tax","refund","","","ke1120" | ||
"PT16","Purchases VAT (16%)","Purchases VAT (16%)","purchase","16%","percent","16.0","tax_group_16","","base","invoice","+16% Purchases Base","","" | ||
"","","","","","","","","","tax","invoice","+16% Purchases Tax","100","ke1110" | ||
"","","","","","","","","","base","refund","-16% Purchases Base","","" | ||
"","","","","","","","","","tax","refund","-16% Purchases Tax","100","ke1110" | ||
"PT8","Purchases VAT (8%)","Purchases VAT (8%)","purchase","8%","percent","8.0","tax_group_8","","base","invoice","+8% purchases Base","","" | ||
"","","","","","","","","","tax","invoice","+8% Purchases Tax","100","ke1110" | ||
"","","","","","","","","","base","refund","-8% purchases Base","","" | ||
"","","","","","","","","","tax","refund","-8% Purchases Tax","100","ke1110" | ||
"PT0","Purchases VAT Zero rated (0%)","Purchases VAT Zero rated","purchase","0%","percent","0.0","tax_group_0","","base","invoice","+Zero Rated Purchases Base","","" | ||
"","","","","","","","","","tax","invoice","","100","" | ||
"","","","","","","","","","base","refund","-Zero Rated Purchases Base","","" | ||
"","","","","","","","","","tax","refund","","100","" | ||
"PTEX","Purchase VAT Exempt","Purchase VAT Exempt","purchase","0% EXEMPT","percent","0.0","tax_group_0","","base","invoice","+Exempt Purchases Base","","" | ||
"","","","","","","","","","tax","invoice","","100","" | ||
"","","","","","","","","","base","refund","-Exempt Purchases Base","","" | ||
"","","","","","","","","","tax","refund","","100","" | ||
"PWT3","3% WH","3%","purchase","3% WH","percent","-3.0","tax_group_withholding","","base","invoice","","","" | ||
"","","","","","","","","","tax","invoice","","","ke2203" | ||
"","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","tax","refund","","","ke2203" | ||
"PWT5","5% WH","5%","purchase","5% WH","percent","-5.0","tax_group_withholding","","base","invoice","","","" | ||
"","","","","","","","","","tax","invoice","","","ke2203" | ||
"","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","tax","refund","","","ke2203" | ||
"PWT10","10% WH","10%","purchase","10% WH","percent","-10.0","tax_group_withholding","","base","invoice","","","" | ||
"","","","","","","","","","tax","invoice","","","ke2203" | ||
"","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","tax","refund","","","ke2203" | ||
"PWT12","12% WH","12%","purchase","12% WH","percent","-12.0","tax_group_withholding","","base","invoice","","","" | ||
"","","","","","","","","","tax","invoice","","","ke2203" | ||
"","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","tax","refund","","","ke2203" | ||
"PWT15","15% WH","15%","purchase","15% WH","percent","-15.0","tax_group_withholding","","base","invoice","","","" | ||
"","","","","","","","","","tax","invoice","","","ke2203" | ||
"","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","tax","refund","","","ke2203" | ||
"PWT20","20% WH","20%","purchase","20% WH","percent","-20.0","tax_group_withholding","","base","invoice","","","" | ||
"","","","","","","","","","tax","invoice","","","ke2203" | ||
"","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","tax","refund","","","ke2203" | ||
"PWT25","25% WH","25%","purchase","25% WH","percent","-25.0","tax_group_withholding","","base","invoice","","","" | ||
"","","","","","","","","","tax","invoice","","","ke2203" | ||
"","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","tax","refund","","","ke2203" | ||
"PWT30","30% WH","30%","purchase","30% WH","percent","-30.0","tax_group_withholding","","base","invoice","","","" | ||
"","","","","","","","","","tax","invoice","","","ke2203" | ||
"","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","tax","refund","","","ke2203" | ||
"ST0EXPORT","Export (0%)","0%","sale","0% EXPORT","percent","0","tax_group_0","l10n_ke.item_code_2023_00011200","base","invoice","+Exempt Sales Base","","" | ||
"","","","","","","","","","tax","invoice","","100","" | ||
"","","","","","","","","","base","refund","-Exempt Sales Base","","" | ||
"","","","","","","","","","tax","refund","","100","" | ||
"id","description","invoice_label","type_tax_use","name","amount_type","amount","tax_group_id","active","l10n_ke_item_code_id","repartition_line_ids/repartition_type","repartition_line_ids/document_type","repartition_line_ids/tag_ids","repartition_line_ids/factor_percent","repartition_line_ids/account_id" | ||
"ST16","Sales VAT (16%)","16%","sale","16%","percent","16.0","tax_group_16","1","","base","invoice","+16% Sales Base","","" | ||
"","","","","","","","","","","tax","invoice","+16% Sales Tax","100","ke2200" | ||
"","","","","","","","","","","base","refund","-16% Sales Base","","" | ||
"","","","","","","","","","","tax","refund","-16% Sales Tax","100","ke2200" | ||
"ST8","Sales VAT (8%)","8%","sale","8%","percent","8.0","tax_group_8","1","","base","invoice","+8% Sales Base","","" | ||
"","","","","","","","","","","tax","invoice","+8% Sales Tax","100","ke2200" | ||
"","","","","","","","","","","base","refund","-8% Sales Base","","" | ||
"","","","","","","","","","","tax","refund","-8% Sales Tax","100","ke2200" | ||
"ST0","Sales VAT Zero Rated","0%","sale","0%","percent","0.0","tax_group_0","1","","base","invoice","+Zero Rated Sales Base","","" | ||
"","","","","","","","","","","tax","invoice","","100","" | ||
"","","","","","","","","","","base","refund","-Zero Rated Sales Base","","" | ||
"","","","","","","","","","","tax","refund","","100","" | ||
"STEX","Sales VAT Exempt","Exempt","sale","0% EXEMPT","percent","0.0","tax_group_0","1","","base","invoice","+Exempt Sales Base","","" | ||
"","","","","","","","","","","tax","invoice","","100","" | ||
"","","","","","","","","","","base","refund","-Exempt Sales Base","","" | ||
"","","","","","","","","","","tax","refund","","100","" | ||
"SWT3","3% WH","3%","sale","3% WH","percent","-3.0","tax_group_withholding","0","","base","invoice","","","" | ||
"","","","","","","","","","","tax","invoice","","","ke1120" | ||
"","","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","","tax","refund","","","ke1120" | ||
"SWT5","5% WH","5%","sale","5% WH","percent","-5.0","tax_group_withholding","0","","base","invoice","","","" | ||
"","","","","","","","","","","tax","invoice","","","ke1120" | ||
"","","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","","tax","refund","","","ke1120" | ||
"SWT10","10% WH","10%","sale","10% WH","percent","-10.0","tax_group_withholding","0","","base","invoice","","","" | ||
"","","","","","","","","","","tax","invoice","","","ke1120" | ||
"","","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","","tax","refund","","","ke1120" | ||
"SWT12","12% WH","12%","sale","12% WH","percent","-12.0","tax_group_withholding","0","","base","invoice","","","" | ||
"","","","","","","","","","","tax","invoice","","","ke1120" | ||
"","","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","","tax","refund","","","ke1120" | ||
"SWT15","15% WH","15%","sale","15% WH","percent","-15.0","tax_group_withholding","0","","base","invoice","","","" | ||
"","","","","","","","","","","tax","invoice","","","ke1120" | ||
"","","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","","tax","refund","","","ke1120" | ||
"SWT20","20% WH","20%","sale","20% WH","percent","-20.0","tax_group_withholding","0","","base","invoice","","","" | ||
"","","","","","","","","","","tax","invoice","","","ke1120" | ||
"","","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","","tax","refund","","","ke1120" | ||
"SWT25","25% WH","25%","sale","25% WH","percent","-25.0","tax_group_withholding","0","","base","invoice","","","" | ||
"","","","","","","","","","","tax","invoice","","","ke1120" | ||
"","","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","","tax","refund","","","ke1120" | ||
"SWT30","30% WH","30%","sale","30% WH","percent","-30.0","tax_group_withholding","0","","base","invoice","","","" | ||
"","","","","","","","","","","tax","invoice","","","ke1120" | ||
"","","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","","tax","refund","","","ke1120" | ||
"PT16","Purchases VAT (16%)","16%","purchase","16%","percent","16.0","tax_group_16","1","","base","invoice","+16% Purchases Base","","" | ||
"","","","","","","","","","","tax","invoice","+16% Purchases Tax","100","ke1110" | ||
"","","","","","","","","","","base","refund","-16% Purchases Base","","" | ||
"","","","","","","","","","","tax","refund","-16% Purchases Tax","100","ke1110" | ||
"PT8","Purchases VAT (8%)","8%","purchase","8%","percent","8.0","tax_group_8","1","","base","invoice","+8% purchases Base","","" | ||
"","","","","","","","","","","tax","invoice","+8% Purchases Tax","100","ke1110" | ||
"","","","","","","","","","","base","refund","-8% purchases Base","","" | ||
"","","","","","","","","","","tax","refund","-8% Purchases Tax","100","ke1110" | ||
"PT0","Purchases VAT Zero rated (0%)","0%","purchase","0%","percent","0.0","tax_group_0","1","","base","invoice","+Zero Rated Purchases Base","","" | ||
"","","","","","","","","","","tax","invoice","","100","" | ||
"","","","","","","","","","","base","refund","-Zero Rated Purchases Base","","" | ||
"","","","","","","","","","","tax","refund","","100","" | ||
"PTEX","Purchase VAT Exempt","Exempt","purchase","0% EXEMPT","percent","0.0","tax_group_0","1","","base","invoice","+Exempt Purchases Base","","" | ||
"","","","","","","","","","","tax","invoice","","100","" | ||
"","","","","","","","","","","base","refund","-Exempt Purchases Base","","" | ||
"","","","","","","","","","","tax","refund","","100","" | ||
"PWT3","3% WH","3%","purchase","3% WH","percent","-3.0","tax_group_withholding","0","","base","invoice","","","" | ||
"","","","","","","","","","","tax","invoice","","","ke2203" | ||
"","","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","","tax","refund","","","ke2203" | ||
"PWT5","5% WH","5%","purchase","5% WH","percent","-5.0","tax_group_withholding","0","","base","invoice","","","" | ||
"","","","","","","","","","","tax","invoice","","","ke2203" | ||
"","","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","","tax","refund","","","ke2203" | ||
"PWT10","10% WH","10%","purchase","10% WH","percent","-10.0","tax_group_withholding","0","","base","invoice","","","" | ||
"","","","","","","","","","","tax","invoice","","","ke2203" | ||
"","","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","","tax","refund","","","ke2203" | ||
"PWT12","12% WH","12%","purchase","12% WH","percent","-12.0","tax_group_withholding","0","","base","invoice","","","" | ||
"","","","","","","","","","","tax","invoice","","","ke2203" | ||
"","","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","","tax","refund","","","ke2203" | ||
"PWT15","15% WH","15%","purchase","15% WH","percent","-15.0","tax_group_withholding","0","","base","invoice","","","" | ||
"","","","","","","","","","","tax","invoice","","","ke2203" | ||
"","","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","","tax","refund","","","ke2203" | ||
"PWT20","20% WH","20%","purchase","20% WH","percent","-20.0","tax_group_withholding","0","","base","invoice","","","" | ||
"","","","","","","","","","","tax","invoice","","","ke2203" | ||
"","","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","","tax","refund","","","ke2203" | ||
"PWT25","25% WH","25%","purchase","25% WH","percent","-25.0","tax_group_withholding","0","","base","invoice","","","" | ||
"","","","","","","","","","","tax","invoice","","","ke2203" | ||
"","","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","","tax","refund","","","ke2203" | ||
"PWT30","30% WH","30%","purchase","30% WH","percent","-30.0","tax_group_withholding","0","","base","invoice","","","" | ||
"","","","","","","","","","","tax","invoice","","","ke2203" | ||
"","","","","","","","","","","base","refund","","","" | ||
"","","","","","","","","","","tax","refund","","","ke2203" | ||
"ST0EXPORT","Export (0%)","0%","sale","0% EXPORT","percent","0","tax_group_0","1","l10n_ke.item_code_2023_00011200","base","invoice","+Exempt Sales Base","","" | ||
"","","","","","","","","","","tax","invoice","","100","" | ||
"","","","","","","","","","","base","refund","-Exempt Sales Base","","" | ||
"","","","","","","","","","","tax","refund","","100","" |
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
import re | ||
from datetime import datetime | ||
|
||
from odoo import models, fields, _ | ||
from odoo import models, fields, _, api | ||
from odoo.exceptions import UserError | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
@@ -17,6 +17,21 @@ class AccountMove(models.Model): | |
l10n_ke_cu_serial_number = fields.Char(string='CU Serial Number', copy=False) | ||
l10n_ke_cu_invoice_number = fields.Char(string='CU Invoice Number', copy=False) | ||
l10n_ke_cu_qrcode = fields.Char(string='CU QR Code', copy=False) | ||
l10n_ke_cu_show_send_button = fields.Boolean(string='Show Send to Tremol button', compute='_compute_l10n_ke_cu_show_send_button') | ||
|
||
@api.depends('country_code', 'l10n_ke_cu_qrcode', 'state', 'move_type') | ||
def _compute_l10n_ke_cu_show_send_button(self): | ||
for move in self: | ||
move.l10n_ke_cu_show_send_button = ( | ||
move.country_code == 'KE' | ||
and not move.l10n_ke_cu_qrcode | ||
and move.state == 'posted' | ||
and move.move_type in ['out_invoice', 'out_refund'] | ||
and ( | ||
'l10n_ke_oscu_is_active' not in move.company_id | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not define l10n_ke_oscu_is_active in l10n_ke then instead of this hack? Or define this boolean in l10n_ke (even simpler) |
||
or not move.company_id.l10n_ke_oscu_is_active | ||
) | ||
) | ||
|
||
# ------------------------------------------------------------------------- | ||
# HELPERS | ||
|
@@ -82,6 +97,12 @@ def _l10n_ke_validate_move(self): | |
|
||
def _l10n_ke_fiscal_device_details_filled(self): | ||
self.ensure_one() | ||
# If the company is configured for OSCU, don't block the Send & Print. | ||
if ( | ||
'l10n_ke_oscu_is_active' in self.company_id | ||
and self.company_id.l10n_ke_oscu_is_active | ||
): | ||
return True | ||
return all([ | ||
self.country_code == 'KE', | ||
self.l10n_ke_cu_invoice_number, | ||
|
@@ -232,6 +253,11 @@ def l10n_ke_action_cu_post(self): | |
""" Returns the client action descriptor dictionary for sending the | ||
invoice(s) to the control unit (the fiscal device). | ||
""" | ||
# If l10n_ke_edi_oscu is configured for the company, disable sending via TREMOL. | ||
if 'l10n_ke_oscu_is_active' in self.company_id and self.company_id.l10n_ke_oscu_is_active: | ||
raise UserError( | ||
_('An OSCU has been initialized for this company. Please send the e-invoice via Send and Print -> Send to eTIMS instead.') | ||
) | ||
# Check the configuration of the invoice | ||
errors = self._l10n_ke_validate_move() | ||
if errors: | ||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would not be bad to have it in the commit msg as well that we are changing the invoice_label