Skip to content

Commit e73032b

Browse files
jasa-odoojco-odoozepa-odoo
committed
[IMP] l10n_in: gstr section mapping field added in account_move_line
With this commit, -Added the `l10n_in_is_lut_tax` field to the `account.tax` model to easily identify LUT taxes. -Removed the RC tags, as the existing `l10n_in_reverse_charge` field already indicates reverse charge taxes. Standard GST tags will now be used instead. -Introduced a GSTR section mapping field on account.move.line to facilitate efficient cross-verification between user-entered data and GSTR reporting. This field is also included in the journal item list view for better visibility. task-3360018 Co-authored-by: Jay Savaliya <[email protected]> Co-authored-by: Josse Colpaert <[email protected]> Co-authored-by: Zeel Patel <[email protected]>
1 parent 8e3baec commit e73032b

18 files changed

+1582
-1120
lines changed

addons/account/models/account_move.py

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3294,47 +3294,64 @@ def changed(fname):
32943294
if changed('commercial_partner_id'):
32953295
move.line_ids.partner_id = after[move]['commercial_partner_id']
32963296

3297-
@contextmanager
3298-
def _sync_dynamic_lines(self, container):
3299-
with self._disable_recursion(container, 'skip_invoice_sync') as disabled:
3300-
if disabled:
3301-
yield
3302-
return
3303-
def update_containers():
3304-
# Only invoice-like and journal entries in "auto tax mode" are synced
3305-
tax_container['records'] = container['records'].filtered(lambda m: m.is_invoice(True) or m.line_ids.tax_ids or m.line_ids.tax_repartition_line_id)
3306-
invoice_container['records'] = container['records'].filtered(lambda m: m.is_invoice(True))
3307-
misc_container['records'] = container['records'].filtered(lambda m: m.is_entry() and not m.tax_cash_basis_origin_move_id)
3297+
def _get_sync_stack(self, container):
3298+
tax_container, invoice_container, misc_container = ({} for _ in range(3))
33083299

3309-
tax_container, invoice_container, misc_container = ({} for __ in range(3))
3310-
update_containers()
3311-
with ExitStack() as stack:
3312-
stack.enter_context(self._sync_dynamic_line(
3300+
def update_containers():
3301+
# Only invoice-like and journal entries in "auto tax mode" are synced
3302+
tax_container['records'] = container['records'].filtered(lambda m: m.is_invoice(True) or m.line_ids.tax_ids or m.line_ids.tax_repartition_line_id)
3303+
invoice_container['records'] = container['records'].filtered(lambda m: m.is_invoice(True))
3304+
misc_container['records'] = container['records'].filtered(lambda m: m.is_entry() and not m.tax_cash_basis_origin_move_id)
3305+
3306+
return tax_container, invoice_container, misc_container
3307+
3308+
update_containers()
3309+
3310+
stack = [
3311+
(10, self._sync_dynamic_line(
33133312
existing_key_fname='term_key',
33143313
needed_vals_fname='needed_terms',
33153314
needed_dirty_fname='needed_terms_dirty',
33163315
line_type='payment_term',
33173316
container=invoice_container,
3318-
))
3319-
stack.enter_context(self._sync_unbalanced_lines(misc_container))
3320-
stack.enter_context(self._sync_rounding_lines(invoice_container))
3321-
stack.enter_context(self._sync_dynamic_line(
3317+
)),
3318+
(20, self._sync_unbalanced_lines(misc_container)),
3319+
(30, self._sync_rounding_lines(invoice_container)),
3320+
(40, self._sync_dynamic_line(
33223321
existing_key_fname='discount_allocation_key',
33233322
needed_vals_fname='line_ids.discount_allocation_needed',
33243323
needed_dirty_fname='line_ids.discount_allocation_dirty',
33253324
line_type='discount',
33263325
container=invoice_container,
3327-
))
3328-
stack.enter_context(self._sync_tax_lines(tax_container))
3329-
stack.enter_context(self._sync_non_deductible_base_lines(invoice_container))
3330-
stack.enter_context(self._sync_dynamic_line(
3326+
)),
3327+
(50, self._sync_tax_lines(tax_container)),
3328+
(60, self._sync_non_deductible_base_lines(invoice_container)),
3329+
(70, self._sync_dynamic_line(
33313330
existing_key_fname='epd_key',
33323331
needed_vals_fname='line_ids.epd_needed',
33333332
needed_dirty_fname='line_ids.epd_dirty',
33343333
line_type='epd',
33353334
container=invoice_container,
3336-
))
3337-
stack.enter_context(self._sync_invoice(invoice_container))
3335+
)),
3336+
(80, self._sync_invoice(invoice_container)),
3337+
]
3338+
3339+
return stack, update_containers
3340+
3341+
@contextmanager
3342+
def _sync_dynamic_lines(self, container):
3343+
with self._disable_recursion(container, 'skip_invoice_sync') as disabled:
3344+
if disabled:
3345+
yield
3346+
return
3347+
3348+
stack_list, update_containers = self._get_sync_stack(container)
3349+
update_containers()
3350+
with ExitStack() as stack:
3351+
stack_list.sort()
3352+
for _seq, contextmgr in stack_list:
3353+
stack.enter_context(contextmgr)
3354+
33383355
line_container = {'records': self.line_ids}
33393356
with self.line_ids._sync_invoice(line_container):
33403357
yield

addons/l10n_in/data/account.account.tag.csv

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
"tax_tag_nil_rated","NIL-RATED","taxes"
1717
"tax_tag_zero_rated","ZERO-RATED","taxes"
1818
"tax_tag_non_gst_supplies","NON GST SUPPLIES","taxes"
19-
"tax_tag_base_sgst_rc","BASE SGST (RC)","taxes"
20-
"tax_tag_base_cgst_rc","BASE CGST (RC)","taxes"
21-
"tax_tag_base_igst_rc","BASE IGST (RC)","taxes"
22-
"tax_tag_base_cess_rc","BASE CESS (RC)","taxes"
2319
"tax_tag_sgst","SGST","taxes"
2420
"tax_tag_cgst","CGST","taxes"
2521
"tax_tag_igst","IGST","taxes"
@@ -33,16 +29,12 @@
3329
"tax_tag_state_cess","STATE CESS","taxes"
3430
"tax_tag_non_itc_cess","NON ITC CESS","taxes"
3531
"tax_tag_other_non_itc_cess","Other NON ITC CESS","taxes"
36-
"tax_tag_sgst_rc","SGST (RC)","taxes"
37-
"tax_tag_cgst_rc","CGST (RC)","taxes"
38-
"tax_tag_igst_rc","IGST (RC)","taxes"
3932
"tax_tag_non_itc_sgst_rc","NON ITC SGST (RC)","taxes"
4033
"tax_tag_non_itc_cgst_rc","NON ITC CGST (RC)","taxes"
4134
"tax_tag_non_itc_igst_rc","NON ITC IGST (RC)","taxes"
4235
"tax_tag_other_non_itc_sgst_rc","Other NON ITC SGST (RC)","taxes"
4336
"tax_tag_other_non_itc_cgst_rc","Other NON ITC CGST (RC)","taxes"
4437
"tax_tag_other_non_itc_igst_rc","Other NON ITC IGST (RC)","taxes"
45-
"tax_tag_cess_rc","CESS (RC)","taxes"
4638
"tax_tag_non_itc_cess_rc","NON ITC CESS (RC)","taxes"
4739
"tax_tag_other_non_itc_cess_rc","Other NON ITC CESS (RC)","taxes"
4840
"account_tag_closing_stock","Closing Stock","accounts"

0 commit comments

Comments
 (0)