Browse Source

Aug 14: [FIX] Bug Fixed 'subscription_package'

pull/331/head
Cybrosys Technologies 9 months ago
parent
commit
f3952ed1ff
  1. 2
      subscription_package/__manifest__.py
  2. 6
      subscription_package/data/subscription_stage_data.xml
  3. 7
      subscription_package/doc/RELEASE_NOTES.md
  4. 8
      subscription_package/models/subscription_package.py
  5. 1
      subscription_package/models/subscription_package_stage.py
  6. 18
      subscription_package/views/subscription_package_views.xml

2
subscription_package/__manifest__.py

@ -21,7 +21,7 @@
############################################################################# #############################################################################
{ {
'name': 'Subscription Management', 'name': 'Subscription Management',
'version': '17.0.1.1.2', 'version': '17.0.2.1.2',
'category': 'Sales', 'category': 'Sales',
'summary': 'Subscription Package Management Module For Odoo17 Community', 'summary': 'Subscription Package Management Module For Odoo17 Community',
'description': 'Subscription Package Management Module specifically ' 'description': 'Subscription Package Management Module specifically '

6
subscription_package/data/subscription_stage_data.xml

@ -18,5 +18,11 @@
<field name="is_fold" eval="True"/> <field name="is_fold" eval="True"/>
<field name="category">closed</field> <field name="category">closed</field>
</record> </record>
<record model="subscription.package.stage" id="paused_stage">
<field name="name">Paused</field>
<field name="sequence">18</field>
<field name="is_fold" eval="True"/>
<field name="category">paused</field>
</record>
</data> </data>
</odoo> </odoo>

7
subscription_package/doc/RELEASE_NOTES.md

@ -6,10 +6,15 @@
#### 12.04.2024 #### 12.04.2024
#### Version 17.0.1.0.1 #### Version 17.0.1.0.1
#### ADD #### Update
- Bug Fix - Bug Fix
#### 13.06.2024 #### 13.06.2024
#### Version 17.0.1.1.2 #### Version 17.0.1.1.2
#### Update #### Update
- Bug Fix, fixed issue in invoicing the subscription sale order multiple times, made the next_invoice_date field in the model subscription.package editable, updated context in xml files. - Bug Fix, fixed issue in invoicing the subscription sale order multiple times, made the next_invoice_date field in the model subscription.package editable, updated context in xml files.
#### 14.08.2024
#### Version 17.0.2.1.2
#### Update
- Added Paused feature.

8
subscription_package/models/subscription_package.py

@ -88,7 +88,7 @@ class SubscriptionPackage(models.Model):
help='Add the tags') help='Add the tags')
stage_id = fields.Many2one('subscription.package.stage', string='Stage', stage_id = fields.Many2one('subscription.package.stage', string='Stage',
default=lambda self: self._default_stage_id(), default=lambda self: self._default_stage_id(),
index=True, index=True,tracking=True,
group_expand='_read_group_stage_ids', group_expand='_read_group_stage_ids',
help='Subscription Package stage', copy=False) help='Subscription Package stage', copy=False)
invoice_count = fields.Integer(string='Invoices', invoice_count = fields.Integer(string='Invoices',
@ -471,3 +471,9 @@ class SubscriptionPackage(models.Model):
""" The function is used to perform the renewal """ The function is used to perform the renewal
action for the subscription package.""" action for the subscription package."""
return self.button_sale_order() return self.button_sale_order()
def pause_subscription(self):
self.stage_id = self.env.ref('subscription_package.paused_stage').id
def button_resume(self):
self.stage_id = self.env.ref('subscription_package.progress_stage').id

1
subscription_package/models/subscription_package_stage.py

@ -40,6 +40,7 @@ class SubscriptionPackageStage(models.Model):
"to display.") "to display.")
category = fields.Selection([('draft', 'Draft'), category = fields.Selection([('draft', 'Draft'),
('progress', 'In Progress'), ('progress', 'In Progress'),
('paused', 'Paused'),
('closed', 'Closed')], ('closed', 'Closed')],
readonly=False, default='draft', readonly=False, default='draft',
help='Choose the appropriate category from' help='Choose the appropriate category from'

18
subscription_package/views/subscription_package_views.xml

@ -67,6 +67,9 @@
<button name="button_start_date" string="START" <button name="button_start_date" string="START"
type="object" class="btn-primary" type="object" class="btn-primary"
invisible="stage_category != 'draft'"/> invisible="stage_category != 'draft'"/>
<button name="button_resume" string="Resume"
type="object" class="btn-primary"
invisible="stage_category != 'paused'"/>
<button name="button_sale_order" string="Create Sale Order" <button name="button_sale_order" string="Create Sale Order"
type="object" class="btn-primary" type="object" class="btn-primary"
invisible="stage_category != 'progress' or so_count > 0"/> invisible="stage_category != 'progress' or so_count > 0"/>
@ -147,7 +150,8 @@
<field name="product_line_ids"> <field name="product_line_ids">
<tree string="Product lines" editable="bottom"> <tree string="Product lines" editable="bottom">
<field name="sequence" widget="handle"/> <field name="sequence" widget="handle"/>
<field name="product_id" context="{'default_detailed_type': 'service'}" required="1"/> <field name="product_id" context="{'default_detailed_type': 'service'}"
required="1"/>
<field name="uom_catg_id" invisible="1"/> <field name="uom_catg_id" invisible="1"/>
<field name="product_qty" required="1"/> <field name="product_qty" required="1"/>
<field name="product_uom_id" required="1"/> <field name="product_uom_id" required="1"/>
@ -262,6 +266,18 @@
</pivot> </pivot>
</field> </field>
</record> </record>
<record id="model_subscription_package_pause_record" model="ir.actions.server">
<field name="name">Pause Subscription</field>
<field name="model_id" ref="model_subscription_package"/>
<field name="binding_model_id" ref="model_subscription_package"/>
<field name="binding_view_types">form,list</field>
<field name="state">code</field>
<field name="code">
if records:
records.pause_subscription()
</field>
</record>
<!-- Subscription package menu items --> <!-- Subscription package menu items -->
<menuitem id="subscription_menu_root" <menuitem id="subscription_menu_root"
name="Subscription" name="Subscription"

Loading…
Cancel
Save