-
-
Notifications
You must be signed in to change notification settings - Fork 49
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 credit note #69
base: 17.0
Are you sure you want to change the base?
17.0 credit note #69
Conversation
9cf5a5a
to
a8c0597
Compare
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.
Exelente!!! Ya lo probé. Saludos
ef4ea74
to
20c9dd5
Compare
…ounts in Ecuador [MOD] changes credit note by 17.0 [ADD] Wizard and control account by line [ADD] Compute view form account in line invoice [MOD] Control account anglo saxon out lines [FIX] Anglo account and remove context [FIX] pre-commit [FIX] Remove Context [ADD] Test module [ADD] Test module [ADD] Test module [ADD] Test module post [FXI] Test module witch post [FXI] Test module witch post y# This is a combination of 6 commits. [ADD] stock_account dependes [FIX] Anglo test [FIX] pre-commit [FIX] pre-commit and codecov [MOD] changes credit note by 17.0 [FIX] pre-commit [ADD] Test Implementation [FIX] Dependencies and remove context [ADD] Test module [ADD] Test module [ADD] Test module [ADD] Test module post [FXI] Test module witch post [FXI] Test module witch post [ADD] stock_account dependes [FIX] Anglo test [FIX] pre-commit [FIX] pre-commit and codecov [FIX] refactor test a code [FIX] pre-commit [FIX] codecov [FIX] refactor test a code [FIX] refactor test a code [FIX] refactor test a code [FIX] Config view migration [ADD] i18n [IMP] l10n_ec_account_edi: Add email notification when certificate is expired [IMP] l10n_ec_account_edi: Cron for check unauthorized electronic documents [UPD] Update l10n_ec_account_edi.pot [BOT] post-merge updates Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: l10n-ecuador-17.0/l10n-ecuador-17.0-l10n_ec_account_edi Translate-URL: https://translation.odoo-community.org/projects/l10n-ecuador-17-0/l10n-ecuador-17-0-l10n_ec_account_edi/ Restaurar l10n_ec_account_edi y l10n_ec_base desde la rama 17.0 del repositorio original
@celm1990 Branch Update |
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.
@rvjaraj, thanks for your contribution. I have provided my comments for a first technical review. Let me know if you have any questions or need further clarification.
|
||
from odoo import api, fields, models | ||
|
||
_logger = logging.getLogger(__name__) |
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.
remove if not is used
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.
ok
|
||
def copy_data(self, default=None): | ||
res = super().copy_data(default=default) | ||
if self._context.get("move_reverse_cancel"): |
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.
Apply these changes only if it is an Ecuadorian company.
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.
ok
|
||
from odoo import models | ||
|
||
_logger = logging.getLogger(__name__) |
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.
remove if not is used
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.
ok
<field name="inherit_id" ref="account.view_category_property_form" /> | ||
<field name="arch" type="xml"> | ||
<group name="account_property" position="inside"> | ||
<group string="Credit Note"> |
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.
<group string="Credit Note"> | |
<group string="Credit Note(Only for Ecuadorian Companies)"> |
<field name="inherit_id" ref="account.product_template_form_view" /> | ||
<field name="arch" type="xml"> | ||
<group name="payables" position="after"> | ||
<group string="Credit Note"> |
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.
<group string="Credit Note"> | |
<group string="Credit Note(Only for Ecuadorian Companies)"> |
/> | ||
<field | ||
name="l10n_ec_property_account_discount_id" | ||
placeholder="Same Account" |
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.
What do you mean by "Same Account"? It's better to leave this placeholder empty because it is confusing.
/> | ||
<field | ||
name="l10n_ec_property_account_return_id" | ||
placeholder="Same Account" |
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.
same here
def _reverse_moves(self, default_values_list=None, cancel=False): | ||
reverse_moves = super()._reverse_moves( | ||
default_values_list=default_values_list, cancel=cancel | ||
) | ||
if ( | ||
self.company_id.account_fiscal_country_id.code == "EC" | ||
and reverse_moves.filtered( | ||
lambda x: x.l10n_ec_type_credit_note and x.move_type in ["out_refund"] | ||
) | ||
): | ||
rev_mov_fil = reverse_moves.filtered( | ||
lambda x: x.l10n_ec_type_credit_note and x.move_type in ["out_refund"] | ||
) | ||
rev_mov_lines = rev_mov_fil.with_context(skip_invoice_sync=cancel).mapped( | ||
"line_ids" | ||
) | ||
for reverse_move_line in rev_mov_lines.filtered( | ||
lambda x: x.display_type == "product" | ||
): | ||
reverse_move_line.account_id = self._get_account_product_line( | ||
reverse_move_line | ||
) | ||
return reverse_moves |
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.
Can this code be handled at a different time or in another function (e.g., on functions copy
or copy_data
)? I see it as risky because when the super call
occurs, the record might already be posted
, and it could be problematic to try changing the account
if the document is already posted.
https://github.com/odoo/odoo/blob/96b3ffc2394be46a4f7a44b7a618a7ee8f2c594f/addons/account/models/account_move.py#L3768
/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//div[@id='l10n_ec_section']" position="inside"> | ||
<block title="Credit Note" id="l10n_ec_credit_note"> |
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.
Approved Co-authored-by: Carlos Lopez <celm1990@hotmail.com>
CREDIT NOTE