-
Notifications
You must be signed in to change notification settings - Fork 2
Add module spp_programs_sp for managing service points in entitlements #110
Add module spp_programs_sp for managing service points in entitlements #110
Conversation
gonzalesedwin1123
commented
Aug 29, 2023
•
edited
Loading
edited
- Default Entitlement Manager
- Cash Entitlement Manager
- In-kind Entitlement Manager
Codecov Report
@@ 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
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
…ride of create_g2p_program function
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, | ||
} | ||
) |
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.
@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
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.
@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