Browse Source

Sep 25: [FIX] Bug Fixed 'subscription_package'

pull/337/head
Cybrosys Technologies 7 months ago
parent
commit
2b6a2f2bdb
  1. 2
      subscription_package/__manifest__.py
  2. 32
      subscription_package/models/sale_order.py
  3. 3
      subscription_package/models/subscription_plan.py
  4. BIN
      subscription_package/static/description/assets/screenshots/SUB1.png
  5. 38
      subscription_package/static/description/index.html
  6. 2
      subscription_package/views/subscription_plan.xml

2
subscription_package/__manifest__.py

@ -22,7 +22,7 @@
{ {
'name': 'Subscription Management For Community Odoo 16', 'name': 'Subscription Management For Community Odoo 16',
'version': '16.0.1.1.1', 'version': '16.0.2.1.1',
'summary': 'Subscription Package Management Module For Odoo16 Community', 'summary': 'Subscription Package Management Module For Odoo16 Community',
'description': 'Subscription Package Management Module For Odoo16 Community', 'description': 'Subscription Package Management Module For Odoo16 Community',
'category': 'Sales', 'category': 'Sales',

32
subscription_package/models/sale_order.py

@ -63,16 +63,28 @@ class SaleOrder(models.Model):
'product_qty': line.product_uom_qty, 'product_qty': line.product_uom_qty,
'unit_price': line.price_unit}] 'unit_price': line.price_unit}]
this_products_line.append(rec_list) this_products_line.append(rec_list)
self.env['subscription.package'].create( if line.product_id.subscription_plan_id.subscription_state == 'draft':
{ self.env['subscription.package'].create(
'sale_order': self.id, {
'reference_code': self.env['ir.sequence'].next_by_code('sequence.reference.code'), 'sale_order': self.id,
'start_date': fields.Date.today(), 'reference_code': self.env['ir.sequence'].next_by_code('sequence.reference.code'),
'stage_id': self.env.ref('subscription_package.draft_stage').id, 'start_date': fields.Date.today(),
'partner_id': self.partner_id.id, 'stage_id': self.env.ref('subscription_package.draft_stage').id,
'plan_id': line.product_id.subscription_plan_id.id, 'partner_id': self.partner_id.id,
'product_line_ids': this_products_line 'plan_id': line.product_id.subscription_plan_id.id,
}) 'product_line_ids': this_products_line
})
else:
self.env['subscription.package'].create(
{
'sale_order': self.id,
'reference_code': self.env['ir.sequence'].next_by_code('sequence.reference.code'),
'start_date': fields.Date.today(),
'stage_id': self.env.ref('subscription_package.progress_stage').id,
'partner_id': self.partner_id.id,
'plan_id': line.product_id.subscription_plan_id.id,
'product_line_ids': this_products_line
})
return super()._action_confirm() return super()._action_confirm()

3
subscription_package/models/subscription_plan.py

@ -59,6 +59,9 @@ class SubscriptionPlan(models.Model):
compute='_compute_product_count') compute='_compute_product_count')
subscription_count = fields.Integer(string='Subscriptions', subscription_count = fields.Integer(string='Subscriptions',
compute='_compute_subscription_count') compute='_compute_subscription_count')
subscription_state = fields.Selection([('draft', 'Draft'),
('in_progress', 'In Progress')],
default='in_progress')
@api.depends('product_count') @api.depends('product_count')
def _compute_product_count(self): def _compute_product_count(self):

BIN
subscription_package/static/description/assets/screenshots/SUB1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 69 KiB

38
subscription_package/static/description/index.html

@ -9,11 +9,11 @@
class="mr-2"> class="mr-2">
<i class="fa fa-check mr-1"></i>Community <i class="fa fa-check mr-1"></i>Community
</div> </div>
<!-- <div--> <!-- <div-->
<!-- style="color: #7C7BAD; font-size: 14px; font-family: 'Montserrat', sans-serif; font-weight: bold; background-color: white; display: inline-block; padding: 3px 10px; border-radius: 50px;"--> <!-- style="color: #7C7BAD; font-size: 14px; font-family: 'Montserrat', sans-serif; font-weight: bold; background-color: white; display: inline-block; padding: 3px 10px; border-radius: 50px;"-->
<!-- class="mr-2">--> <!-- class="mr-2">-->
<!-- <i class="fa fa-check mr-1"></i>Enterprise--> <!-- <i class="fa fa-check mr-1"></i>Enterprise-->
<!-- </div>--> <!-- </div>-->
</div> </div>
</div> </div>
<!-- END OF TITLE BAR --> <!-- END OF TITLE BAR -->
@ -203,6 +203,11 @@
<li>In Subscription Plan we have a Radio Button named 'Create Invoice',</li> <li>In Subscription Plan we have a Radio Button named 'Create Invoice',</li>
- If we choose 'Manually', then invoice creation is manually.<br/> - If we choose 'Manually', then invoice creation is manually.<br/>
- If we choose 'Draft', then invoice creation is automatically.<br/> - If we choose 'Draft', then invoice creation is automatically.<br/>
<li>In Subscription Plan we have a Radio Button named 'Subscription Status',<br/>
- If we choose 'Draft',When creating a subscription from a sales order, then the subscription state
will be the draft state.<br/>
- If we choose 'In Progress',When creating a subscription from a sales order, then the subscription
state will be the In Progress state.<br/>
</ul> </ul>
</p> </p>
<img src="assets/screenshots/SUB1.png" class="img-thumbnail"> <img src="assets/screenshots/SUB1.png" class="img-thumbnail">
@ -265,18 +270,18 @@
<img src="assets/screenshots/SUB7.png" class="img-thumbnail"> <img src="assets/screenshots/SUB7.png" class="img-thumbnail">
</div> </div>
</div> </div>
<!-- <div style="display: block; margin: 30px auto;">--> <!-- <div style="display: block; margin: 30px auto;">-->
<!-- <h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;"> Recurrence Period--> <!-- <h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;"> Recurrence Period-->
<!-- </h3>--> <!-- </h3>-->
<!-- <img src="assets/screenshots/SUB8.png" class="img-thumbnail">--> <!-- <img src="assets/screenshots/SUB8.png" class="img-thumbnail">-->
<!-- </div>--> <!-- </div>-->
<!-- <div style="display: block; margin: 30px auto;">--> <!-- <div style="display: block; margin: 30px auto;">-->
<!-- <h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Create Recurrence Period--> <!-- <h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Create Recurrence Period-->
<!-- </h3>--> <!-- </h3>-->
<!-- <img src="assets/screenshots/SUB9.png" class="img-thumbnail">--> <!-- <img src="assets/screenshots/SUB9.png" class="img-thumbnail">-->
<!-- </div>--> <!-- </div>-->
<div style="display: block; margin: 30px auto;"> <div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;"> Subscription Report <h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;"> Subscription Report
</h3> </h3>
@ -293,7 +298,8 @@
Subscriptions to Renew Subscriptions to Renew
</h3> </h3>
<img src="assets/screenshots/SUB11.png" class="img-thumbnail"><hr> <img src="assets/screenshots/SUB11.png" class="img-thumbnail">
<hr>
<img src="assets/screenshots/SUB12.png" class="img-thumbnail"> <img src="assets/screenshots/SUB12.png" class="img-thumbnail">
</div> </div>

2
subscription_package/views/subscription_plan.xml

@ -81,6 +81,8 @@
<field name="days_to_end" invisible="1"/> <field name="days_to_end" invisible="1"/>
<field name="invoice_mode" string="Create Invoice" <field name="invoice_mode" string="Create Invoice"
widget="radio" attrs="{'required': True}"/> widget="radio" attrs="{'required': True}"/>
<field name="subscription_state" string="Subscription Status"
widget="radio" attrs="{'required': True}"/>
<field name="short_code"/> <field name="short_code"/>
<field name="journal_id"/> <field name="journal_id"/>
<field name="company_id"/> <field name="company_id"/>

Loading…
Cancel
Save