Skip to content
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

Open
wants to merge 5 commits into
base: 17.0
Choose a base branch
from
Open

17.0 credit note #69

wants to merge 5 commits into from

Conversation

rvjaraj
Copy link

@rvjaraj rvjaraj commented May 10, 2024

CREDIT NOTE

  • Migración de v15 to v17

@rvjaraj rvjaraj closed this May 10, 2024
@rvjaraj rvjaraj reopened this May 10, 2024
@rvjaraj rvjaraj force-pushed the 17.0-credit-note branch 3 times, most recently from 9cf5a5a to a8c0597 Compare June 13, 2024 16:49
Copy link
Contributor

@jorge-luis-dev jorge-luis-dev left a 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

@rvjaraj rvjaraj force-pushed the 17.0-credit-note branch 3 times, most recently from ef4ea74 to 20c9dd5 Compare July 5, 2024 21:55
…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
Copy link
Sponsor Contributor

@rvjaraj Please update your branch according to these changes: #71 to fix the tests

@rvjaraj
Copy link
Author

rvjaraj commented Jul 24, 2024

@celm1990 Branch Update

Copy link
Sponsor Contributor

@celm1990 celm1990 left a 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.

l10n_ec_credit_note/__manifest__.py Outdated Show resolved Hide resolved

from odoo import api, fields, models

_logger = logging.getLogger(__name__)
Copy link
Sponsor Contributor

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

l10n_ec_credit_note/models/account_move.py Outdated Show resolved Hide resolved

def copy_data(self, default=None):
res = super().copy_data(default=default)
if self._context.get("move_reverse_cancel"):
Copy link
Sponsor Contributor

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.

Copy link
Author

@rvjaraj rvjaraj Jul 31, 2024

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__)
Copy link
Sponsor Contributor

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

Copy link
Author

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">
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<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">
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<group string="Credit Note">
<group string="Credit Note(Only for Ecuadorian Companies)">

/>
<field
name="l10n_ec_property_account_discount_id"
placeholder="Same Account"
Copy link
Sponsor Contributor

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"
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Comment on lines +33 to +55
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
Copy link
Sponsor Contributor

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">
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove block element and only keep setting element into another block
image

rvjaraj and others added 2 commits July 31, 2024 12:47
Approved

Co-authored-by: Carlos Lopez <celm1990@hotmail.com>
Co-authored-by: Carlos Lopez <celm1990@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants