Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Add module spp_programs_sp for managing service points in entitlements #110

Conversation

gonzalesedwin1123
Copy link
Member

@gonzalesedwin1123 gonzalesedwin1123 commented Aug 29, 2023

  • Default Entitlement Manager
  • Cash Entitlement Manager
  • In-kind Entitlement Manager

@codecov
Copy link

codecov bot commented Aug 29, 2023

Codecov Report

Merging #110 (45d2644) into 15.1.1 (f585380) will decrease coverage by 4.80%.
Report is 23 commits behind head on 15.1.1.
The diff coverage is 30.21%.

❗ Current head 45d2644 differs from pull request most recent head afa69e5. Consider uploading reports for the commit afa69e5 to get more accurate results

@@            Coverage Diff             @@
##           15.1.1     #110      +/-   ##
==========================================
- Coverage   80.26%   75.47%   -4.80%     
==========================================
  Files          75       85      +10     
  Lines        1718     1900     +182     
  Branches      185      223      +38     
==========================================
+ Hits         1379     1434      +55     
- Misses        287      414     +127     
  Partials       52       52              
Files Coverage Δ
spp_programs_sp/__init__.py 100.00% <100.00%> (ø)
spp_programs_sp/models/__init__.py 100.00% <100.00%> (ø)
spp_programs_sp/models/entitlement_cash.py 100.00% <100.00%> (ø)
spp_programs_sp/models/entitlement_inkind.py 100.00% <100.00%> (ø)
spp_programs_sp/models/programs.py 100.00% <100.00%> (ø)
spp_programs_sp/wizard/__init__.py 100.00% <100.00%> (ø)
spp_programs_sp/wizard/create_program_wizard.py 22.58% <22.58%> (ø)
..._programs_sp/models/entitlement_manager_default.py 18.75% <18.75%> (ø)
...p_programs_sp/models/entitlement_manager_inkind.py 15.90% <15.90%> (ø)
spp_programs_sp/models/entitlement_manager_cash.py 14.89% <14.89%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@gonzalesedwin1123 gonzalesedwin1123 changed the base branch from 15.0 to 15.1 September 5, 2023 03:23
Comment on lines 18 to 30
def create_g2p_program(self):
# Create a new journal for this program
journal_id = self.create_journal(self.name, self.currency_id.id)

return self.env["g2p.program"].create(
{
"name": self.name,
"journal_id": journal_id,
"target_type": self.target_type,
# Add the store_sp_in_entitlements field in program module
"store_sp_in_entitlements": self.store_sp_in_entitlements,
}
)
Copy link
Member

Choose a reason for hiding this comment

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

@gonzalesedwin1123 I suggest to override using super instead of overwrite. check below sample

def create_g2p_program(self):
        program_id = super().create_g2p_program()
        program_id. store_sp_in_entitlements = self. store_sp_in_entitlements
        return program_id

Copy link
Member

Choose a reason for hiding this comment

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

@gonzalesedwin1123 I updated the parent code of create_g2p_program and changed it to get_program_vals

you can now change it to this

def get_program_vals(self):
    vals = super().get_program_vals()
    vals.update({
        "store_sp_in_entitlements": self.store_sp_in_entitlements,
    })
    return vals

@gonzalesedwin1123 gonzalesedwin1123 merged commit 3a62e28 into 15.1.1 Oct 19, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Oct 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement different way to associate service points to entitlements
3 participants