diff --git a/agriculture_management_odoo/README.rst b/agriculture_management_odoo/README.rst new file mode 100644 index 000000000..8267ccc30 --- /dev/null +++ b/agriculture_management_odoo/README.rst @@ -0,0 +1,39 @@ +Agriculture Management +============================= +App for managing the Agriculture cultivation + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: VYSHNAV AR @cybrosys + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ + + diff --git a/agriculture_management_odoo/__init__.py b/agriculture_management_odoo/__init__.py new file mode 100644 index 000000000..4f3bd3dd4 --- /dev/null +++ b/agriculture_management_odoo/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import models +from . import wizard diff --git a/agriculture_management_odoo/__manifest__.py b/agriculture_management_odoo/__manifest__.py new file mode 100644 index 000000000..26b721548 --- /dev/null +++ b/agriculture_management_odoo/__manifest__.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'Agriculture Management Odoo', + 'version': '16.0.1.0.0', + 'summary': 'Agriculture Management Odoo', + 'sequence': 4, + 'description': """Agriculture Management Odoo, Agriculture, Farmers, Farming, Crops, Farm, Seeds, Farm Management""", + 'category': 'Productivity', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'license': 'LGPL-3', + 'depends': [ + 'base', + 'fleet', + ], + 'data': [ + 'security/user_groups.xml', + 'security/ir.model.access.csv', + 'data/data_sequence.xml', + 'report/crop_report.xml', + 'report/pest_report.xml', + 'report/crop_report_template.xml', + 'report/pest_report_template.xml', + 'report/crop_vehicle_report.xml', + 'report/crop_animal_report.xml', + 'wizard/crop_report_wiz.xml', + 'wizard/pest_report_wiz.xml', + 'views/menu_action.xml', + 'views/menu_items.xml', + 'views/seed_details_view.xml', + 'views/animal_details_views.xml', + 'views/location_details_view.xml', + 'views/vehicle_details_view.xml', + 'views/fleet_inherit_view.xml', + 'views/farmer_details_view.xml', + 'views/pest_request.xml', + 'views/pest_details.xml', + 'views/damage_loss.xml', + 'views/crop_request.xml', + 'views/tag_details.xml', + 'views/vehicle_rental_views.xml', + 'views/animal_rental_views.xml', + ], + 'images': ['static/description/banner.png'], + 'installable': True, + 'application': True, + 'auto_install': False, +} diff --git a/agriculture_management_odoo/data/data_sequence.xml b/agriculture_management_odoo/data/data_sequence.xml new file mode 100644 index 000000000..389a844e9 --- /dev/null +++ b/agriculture_management_odoo/data/data_sequence.xml @@ -0,0 +1,17 @@ + + + Pest Request + pest.request + PEST/REQ/ + 5 + + + + Crop Request + crop.requests + CROP/REQ/ + 5 + + + + \ No newline at end of file diff --git a/agriculture_management_odoo/doc/RELEASE_NOTES.md b/agriculture_management_odoo/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..70b6485bf --- /dev/null +++ b/agriculture_management_odoo/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 19.11.2022 +#### Version 16.0.1.0.0 +#### ADD +- Initial commit for agriculture_management_odoo + diff --git a/agriculture_management_odoo/models/__init__.py b/agriculture_management_odoo/models/__init__.py new file mode 100644 index 000000000..7ac9f8db2 --- /dev/null +++ b/agriculture_management_odoo/models/__init__.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import crop_requests +from . import seed_details +from . import animal_details +from . import location_details +from . import vehicle_details +from . import fleet_inherit +from . import farmer_details +from . import pest_details +from . import pest_request +from . import damage_loss +from . import tag_details +from . import vehicle_rental +from . import animal_rental diff --git a/agriculture_management_odoo/models/animal_details.py b/agriculture_management_odoo/models/animal_details.py new file mode 100644 index 000000000..3cd4f203d --- /dev/null +++ b/agriculture_management_odoo/models/animal_details.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +'''Module for Creating Animal Records''' +from odoo import models, fields + + +class AnimalDetails(models.Model): + '''Details of Animals''' + _name = 'animal.details' + _inherit = ['mail.thread', 'mail.activity.mixin'] + _description = "Animal Details" + _rec_name = 'breed' + + image = fields.Binary(string='Image', tracking=True) + breed = fields.Char(string='Breed', required=True, tracking=True) + age = fields.Char(string='Age', required=True, tracking=True) + state = fields.Selection( + [('available', 'Available'), ('not_available', 'Not Available')], + default="available", + string='Status', required=True, tracking=True) + note = fields.Text(string='Note', tracking=True) + + def action_not_available(self): + self.state = 'not_available' + + def action_sold(self): + self.state = 'sold' + + def action_available(self): + self.state = 'available' diff --git a/agriculture_management_odoo/models/animal_rental.py b/agriculture_management_odoo/models/animal_rental.py new file mode 100644 index 000000000..b52e5989c --- /dev/null +++ b/agriculture_management_odoo/models/animal_rental.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +'''Model for Renting the Animals''' +from odoo import models, fields, api + + +class AnimalRental(models.Model): + _name = 'animal.rental' + _inherit = ['mail.thread', 'mail.activity.mixin'] + _description = 'Animal Rental' + + animal_id = fields.Many2one('animal.details', string='Animal', + required=True, tracking=True) + no_of_days = fields.Float(string='No of Days', tracking=True, + compute='compute_days', store=True) + start_date = fields.Date(string='Start Date', required=True, tracking=True) + end_date = fields.Date(string='End Date', required=True, tracking=True) + note = fields.Text(string='Description', tracking=True) + + @api.depends('start_date', 'end_date') + def compute_days(self): + if self.start_date and self.end_date: + days = (self.end_date - self.start_date).days + self.no_of_days = days diff --git a/agriculture_management_odoo/models/crop_requests.py b/agriculture_management_odoo/models/crop_requests.py new file mode 100644 index 000000000..9f1ecabe0 --- /dev/null +++ b/agriculture_management_odoo/models/crop_requests.py @@ -0,0 +1,122 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +'''Model For Creating Crop Requests''' +from odoo import models, fields, api, _ + + +class CropRequests(models.Model): + '''Details to create Crop Requests''' + _name = 'crop.requests' + _inherit = ["mail.thread", 'mail.activity.mixin'] + _description = "Agriculture Management" + _rec_name = 'ref' + + ref = fields.Char(string='Reference', required=True, copy=False, + readonly=True, tracking=True, + default=lambda self: _('New')) + farmer_id = fields.Many2one('farmer.details', string='Farmer', + required=True, tracking=True) + seed_id = fields.Many2one('seed.details', string='Crop', required=True, + tracking=True) + location_id = fields.Many2one('location.details', string='Location', + required=True, tracking=True) + request_date = fields.Date(string='Request Date', + default=fields.Date.context_today, required=True, + tracking=True) + state = fields.Selection( + [('draft', 'Draft'), ('confirm', 'Confirmed'), + ('ploughing', 'Ploughing'), ('sowing', 'Sowing'), + ('manuring', 'Manuring'), ('irrigation', 'Irrigation'), + ('weeding', 'Weeding'), ('harvest', 'Harvest'), ('storage', 'Storage'), + ('cancel', 'Cancel')], + string='Status', default='draft', tracking=True, + group_expand='_group_expand_states') + note = fields.Text(string='Note', tracking=True) + machinery_ids = fields.One2many('crop.machinery', 'des', string='Machinery', + tracking=True) + animal_ids = fields.One2many('crop.animals', 'dec', string='Animals', + tracking=True) + tags_id = fields.Many2many('agr.tag', string='Tags', tracking=True) + user_id = fields.Many2one('res.users', string='Responsible User', + default=lambda self: self.env.user) + + @api.model + def create(self, values): + if values.get('ref', _('New')) == _('New'): + values['ref'] = self.env['ir.sequence'].next_by_code( + 'crop.requests') or _('New') + res = super(CropRequests, self).create(values) + return res + + def action_draft(self): + self.state = 'draft' + + def action_confirm(self): + self.state = 'confirm' + + def action_ploughing(self): + self.state = 'ploughing' + + def action_sowing(self): + self.state = 'sowing' + + def action_manuring(self): + self.state = 'manuring' + + def action_irrigation(self): + self.state = 'irrigation' + + def action_weeding(self): + self.state = 'weeding' + + def action_harvest(self): + self.state = 'harvest' + + def action_cancel(self): + self.state = 'cancel' + + def action_storage(self): + self.state = 'storage' + + def _group_expand_states(self, states, domain, order): + return [key for + key, val in type(self).state.selection] + + +class CropMachinery(models.Model): + '''Model For Attaching Vehicles''' + _name = 'crop.machinery' + + des = fields.Many2one('crop.requests') + vehicle_id = fields.Many2one('vehicle.details', string='Vehicle', + tracking=True) + qty = fields.Integer(string='Quantity') + + +class CropAnimals(models.Model): + '''Model For Attaching Animals''' + _name = 'crop.animals' + + dec = fields.Many2one('crop.requests') + animal_id = fields.Many2one('animal.details', string='Animal', + tracking=True) + qty = fields.Integer(string='Quantity') diff --git a/agriculture_management_odoo/models/damage_loss.py b/agriculture_management_odoo/models/damage_loss.py new file mode 100644 index 000000000..b377c419c --- /dev/null +++ b/agriculture_management_odoo/models/damage_loss.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models, fields + + +class DamageLossDetails(models.Model): + _name = 'damage.loss' + _inherit = ["mail.thread", 'mail.activity.mixin'] + + name = fields.Char(string='Name', required=True, tracking=True) + farmer_id = fields.Many2one('farmer.details', string='Farmer', + required=True, tracking=True) + crop_id = fields.Many2one('crop.requests', string='Crop', required=True, + tracking=True) + location_id = fields.Many2one('location.details', string='Location', + required=True, tracking=True) + damage_loss_type = fields.Selection( + [('damage', 'Damage'), ('loss', 'Loss')], string='Damage/Loss Type', + required=True, tracking=True) + damage_loss_date = fields.Date(string='Damage/Loss Date', + default=fields.Date.context_today, + required=True, tracking=True) + note = fields.Text(string='Damage/Loss Description', tracking=True) + damage_loss_image = fields.Binary(string='Image', tracking=True) diff --git a/agriculture_management_odoo/models/farmer_details.py b/agriculture_management_odoo/models/farmer_details.py new file mode 100644 index 000000000..465997dc9 --- /dev/null +++ b/agriculture_management_odoo/models/farmer_details.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models, fields, api + + +class FarmerDetails(models.Model): + _name = 'farmer.details' + _inherit = ["mail.thread", 'mail.activity.mixin'] + _description = 'Farmer Details' + _rec_name = 'farmer_name' + + farmer_name = fields.Many2one('res.partner', string='Farmer', required=True, + tracking=True) + farmer_image = fields.Binary(string='Image', tracking=True) + note = fields.Text(string='Notes', tracking=True) + + @api.onchange('farmer_name') + def onchange_farmer_name(self): + if self.farmer_name: + self.farmer_image = self.farmer_name.image_1920 diff --git a/agriculture_management_odoo/models/fleet_inherit.py b/agriculture_management_odoo/models/fleet_inherit.py new file mode 100644 index 000000000..7e1aa3104 --- /dev/null +++ b/agriculture_management_odoo/models/fleet_inherit.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +'''Inheriting the Fleet Module To Get Vehicles''' +from odoo import fields, models + + +class Fleet(models.Model): + _inherit = "fleet.vehicle" + + registration_date = fields.Date(string="Registration Date", + default=fields.Date.today) diff --git a/agriculture_management_odoo/models/location_details.py b/agriculture_management_odoo/models/location_details.py new file mode 100644 index 000000000..16cc33f15 --- /dev/null +++ b/agriculture_management_odoo/models/location_details.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models, fields + + +class LocationDetails(models.Model): + _name = 'location.details' + _inherit = ['mail.thread', 'mail.activity.mixin'] + _description = "Location Details" + _rec_name = 'location_name' + + location_name = fields.Char(string='Location Name', required=True, + tracking=True) + location_address = fields.Char(string='Location Address', required=True, + tracking=True) + location_area = fields.Float(string='Location Area', required=True, + tracking=True) + location_area_unit = fields.Selection( + [('acres', 'Acres'), ('hectares', 'Hectares')], string='Area Unit', + required=True, tracking=True) + location_type = fields.Selection([('plot', 'Plot'), ('field', 'Field')], + default="plot", + string='Location Type', required=True, + tracking=True) + note = fields.Text(string='Note', tracking=True) diff --git a/agriculture_management_odoo/models/pest_details.py b/agriculture_management_odoo/models/pest_details.py new file mode 100644 index 000000000..fcff0c34b --- /dev/null +++ b/agriculture_management_odoo/models/pest_details.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models, fields, api + + +class PestDetails(models.Model): + _name = 'pest.details' + _inherit = ["mail.thread", 'mail.activity.mixin'] + _description = 'Pest Details' + _rec_name = 'pest_name' + + pest_name = fields.Char(string='Pesticide', required=True, tracking=True) + pest_expiry_date = fields.Date(string='Expiry Date', required=True, + tracking=True) + pest_description = fields.Text(string='Pest Description', tracking=True) + pest_image = fields.Binary(string='Image', tracking=True) + pest_cost = fields.Float(string='Cost', required=True, tracking=True) + pest_quantity = fields.Integer(string='Quantity', required=True, + tracking=True) + total_cost = fields.Float(string='Total Cost', + compute='_compute_total_cost', store=True, + tracking=True) + currency_id = fields.Many2one('res.currency', string='Currency', + default=lambda + self: self.env.user.company_id.currency_id, + tracking=True) + + @api.depends('pest_cost', 'pest_quantity') + def _compute_total_cost(self): + for record in self: + record.total_cost = record.pest_cost * record.pest_quantity diff --git a/agriculture_management_odoo/models/pest_request.py b/agriculture_management_odoo/models/pest_request.py new file mode 100644 index 000000000..e6e0870ec --- /dev/null +++ b/agriculture_management_odoo/models/pest_request.py @@ -0,0 +1,84 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models, fields, api, _ + + +class PestRequests(models.Model): + _name = 'pest.request' + _inherit = ["mail.thread", 'mail.activity.mixin'] + _description = 'Pest Request' + _rec_name = 'reference' + + reference = fields.Char(string='Reference', required=True, copy=False, + readonly=True, tracking=True, + default=lambda self: _('New')) + request_date = fields.Date(string='Request Date', + default=fields.Date.context_today, required=True, + tracking=True) + farmer_id = fields.Many2one('res.partner', string='Farmer', required=True, + tracking=True) + crop_id = fields.Many2one('crop.requests', string='Crop', required=True, + tracking=True) + location_id = fields.Many2one('location.details', string='Location', + tracking=True) + pest_id = fields.Many2one('pest.details', string='Pest', required=True, + tracking=True) + currency_id = fields.Many2one('res.currency', string='Currency', + default=lambda + self: self.env.user.company_id.currency_id) + pest_quantity = fields.Integer(string='Pest Quantity', required=True, + tracking=True) + pest_cost = fields.Float(string='Pest Cost', required=True, tracking=True) + total_cost = fields.Float(string='Total Cost', + compute='_compute_total_cost', store=True, + tracking=True) + disease = fields.Text(string='Disease', tracking=True, required=True) + note = fields.Text(string='Note', tracking=True) + state = fields.Selection( + [('draft', 'Draft'), ('pending', 'Pending'), ('approve', 'Approved'), + ('rejected', 'Rejected')], + string='Status', default='draft', tracking=True) + + def action_draft(self): + self.state = 'draft' + + def action_pending(self): + self.state = 'pending' + + def action_approved(self): + self.state = 'approve' + + def action_rejected(self): + self.state = 'rejected' + + @api.depends('pest_cost', 'pest_quantity') + def _compute_total_cost(self): + for record in self: + record.total_cost = record.pest_cost * record.pest_quantity + + @api.model + def create(self, values): + if values.get('reference', _('New')) == _('New'): + values['reference'] = self.env['ir.sequence'].next_by_code( + 'pest.request') or _('New') + res = super(PestRequests, self).create(values) + return res diff --git a/agriculture_management_odoo/models/seed_details.py b/agriculture_management_odoo/models/seed_details.py new file mode 100644 index 000000000..18ecf2103 --- /dev/null +++ b/agriculture_management_odoo/models/seed_details.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models, fields + + +class SeedDetails(models.Model): + _name = 'seed.details' + _inherit = ["mail.thread", 'mail.activity.mixin'] + _description = "Seed Details" + + name = fields.Char(string='Name', required=True, tracking=True) + quantity = fields.Integer(string='Quantity', required=True, tracking=True) + unit = fields.Selection([('kg', 'Kilograms'), ('gms', 'Grams')], + string='Unit', required=True, tracking=True) + seed_type = fields.Selection( + [('registered', 'Registered'), ('breeder', 'Breeder'), + ('foundation', 'Foundation'), + ('certified', 'Certified')], string='Type', required=True, + tracking=True) + note = fields.Text(string='Note', tracking=True) diff --git a/agriculture_management_odoo/models/tag_details.py b/agriculture_management_odoo/models/tag_details.py new file mode 100644 index 000000000..e23f1b6f7 --- /dev/null +++ b/agriculture_management_odoo/models/tag_details.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from random import randint + +from odoo import fields, models + + +class Tag(models.Model): + _name = "agr.tag" + _description = "Agriculture Tags" + + def _get_default_color(self): + return randint(1, 11) + + name = fields.Char('Tag Name', required=True, translate=True) + color = fields.Integer('Color', default=_get_default_color) + + _sql_constraints = [ + ('name_uniq', 'unique (name)', "Tag name already exists !"), + ] diff --git a/agriculture_management_odoo/models/vehicle_details.py b/agriculture_management_odoo/models/vehicle_details.py new file mode 100644 index 000000000..0dd803f7f --- /dev/null +++ b/agriculture_management_odoo/models/vehicle_details.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from datetime import datetime +from odoo import models, fields, api + + +class VehicleDetails(models.Model): + _name = 'vehicle.details' + _inherit = ['mail.thread', 'mail.activity.mixin'] + _description = "Vehicle Details" + + name = fields.Char(string='Name', tracking=True, ) + vehicle_main_id = fields.Many2one('fleet.vehicle', string='Vehicle', + required=True, tracking=True, + domain=( + [('state_id', '=', 'Registered')])) + vehicle_type = fields.Selection( + [('tractor', 'Tractor'), ('harvester', 'Harvester'), + ('pickup', 'Pickup'), ('other', 'Other')], + string='Vehicle Type', required=True, tracking=True) + vehicle_model = fields.Char(string='Model Year', compute='compute_model', + store=True, tracking=True) + note = fields.Text(string='Note', tracking=True) + + @api.onchange("vehicle_main_id") + def onchange_vehicle(self): + self.name = str( + self.vehicle_main_id.model_id.brand_id.name or " ") + "/" + str( + self.vehicle_main_id.model_id.name or " ") + "/" + str( + self.vehicle_main_id.license_plate or " ") + + @api.depends('vehicle_main_id') + def compute_model(self): + for ref in self: + ref.vehicle_model = False + if ref.vehicle_main_id.registration_date: + date = datetime.strptime( + str(ref.vehicle_main_id.registration_date), '%Y-%m-%d') + ref.vehicle_model = str(date.year) diff --git a/agriculture_management_odoo/models/vehicle_rental.py b/agriculture_management_odoo/models/vehicle_rental.py new file mode 100644 index 000000000..2ddd18955 --- /dev/null +++ b/agriculture_management_odoo/models/vehicle_rental.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models, fields, api + + +class VehicleRental(models.Model): + _name = 'vehicle.rental' + _inherit = ['mail.thread', 'mail.activity.mixin'] + _description = 'Vehicle Rental' + + vehicle_id = fields.Many2one('vehicle.details', string='Vehicle', + required=True, tracking=True) + no_of_days = fields.Float(string='No of Days', tracking=True, + compute='compute_days', store=True) + start_date = fields.Date(string='Start Date', required=True, tracking=True) + end_date = fields.Date(string='End Date', required=True, tracking=True) + note = fields.Text(string='Description', tracking=True) + + @api.depends('start_date', 'end_date') + def compute_days(self): + if self.start_date and self.end_date: + days = (self.end_date - self.start_date).days + self.no_of_days = days diff --git a/agriculture_management_odoo/report/crop_animal_report.xml b/agriculture_management_odoo/report/crop_animal_report.xml new file mode 100644 index 000000000..87191d9df --- /dev/null +++ b/agriculture_management_odoo/report/crop_animal_report.xml @@ -0,0 +1,89 @@ + + + + + + Animal Crop Report + crop.requests + qweb-pdf + agriculture_management_odoo.animal_crop + agriculture_management_odoo.animal_crop + report + + + + \ No newline at end of file diff --git a/agriculture_management_odoo/report/crop_report.xml b/agriculture_management_odoo/report/crop_report.xml new file mode 100644 index 000000000..76c399f7a --- /dev/null +++ b/agriculture_management_odoo/report/crop_report.xml @@ -0,0 +1,13 @@ + + + + Crop Report + crop.report.wizard + qweb-pdf + agriculture_management_odoo.report_crop_details + agriculture_management_odoo.report_crop_details + + report + + + diff --git a/agriculture_management_odoo/report/crop_report_template.xml b/agriculture_management_odoo/report/crop_report_template.xml new file mode 100644 index 000000000..e90db980b --- /dev/null +++ b/agriculture_management_odoo/report/crop_report_template.xml @@ -0,0 +1,92 @@ + + + + diff --git a/agriculture_management_odoo/report/crop_vehicle_report.xml b/agriculture_management_odoo/report/crop_vehicle_report.xml new file mode 100644 index 000000000..830db9d15 --- /dev/null +++ b/agriculture_management_odoo/report/crop_vehicle_report.xml @@ -0,0 +1,88 @@ + + + + + + Vehicle Crop Report + crop.requests + qweb-pdf + agriculture_management_odoo.vehicle_crop + agriculture_management_odoo.vehicle_crop + report + + + \ No newline at end of file diff --git a/agriculture_management_odoo/report/pest_report.xml b/agriculture_management_odoo/report/pest_report.xml new file mode 100644 index 000000000..fc5587766 --- /dev/null +++ b/agriculture_management_odoo/report/pest_report.xml @@ -0,0 +1,13 @@ + + + + pest Report + pest.report.wizard + qweb-pdf + agriculture_management_odoo.report_pest_details + agriculture_management_odoo.report_pest_details + + report + + + diff --git a/agriculture_management_odoo/report/pest_report_template.xml b/agriculture_management_odoo/report/pest_report_template.xml new file mode 100644 index 000000000..983cad220 --- /dev/null +++ b/agriculture_management_odoo/report/pest_report_template.xml @@ -0,0 +1,113 @@ + + + + diff --git a/agriculture_management_odoo/security/ir.model.access.csv b/agriculture_management_odoo/security/ir.model.access.csv new file mode 100644 index 000000000..8b95b76b3 --- /dev/null +++ b/agriculture_management_odoo/security/ir.model.access.csv @@ -0,0 +1,37 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink + +access_crop_requests,access.crop.requests,model_crop_requests,base.group_user,1,1,1,1 + +access_seed_details,access.seed.details,model_seed_details,base.group_user,1,1,1,1 + +access_animal_details,access.animal.details,model_animal_details,base.group_user,1,1,1,1 + +access_location_details,access.location.details,model_location_details,base.group_user,1,1,1,1 + +access_vehicle_details,access.vehicle.details,model_vehicle_details,base.group_user,1,1,1,1 + +access_farmer_details,access.farmer.details,model_farmer_details,base.group_user,1,1,1,1 + +access_pest_request,access.pest.request,model_pest_request,base.group_user,1,1,1,1 + +access_pest_details,access.pest.details,model_pest_details,base.group_user,1,1,1,1 + +access_damage_loss,access.damage.loss,model_damage_loss,base.group_user,1,1,1,1 + +access_crop_machinery,access.crop.machinery,model_crop_machinery,base.group_user,1,1,1,1 + +access_crop_animals,access.crop.animals,model_crop_animals,base.group_user,1,1,1,1 + +access_agr_tag,access.agr.tag,model_agr_tag,base.group_user,1,1,1,1 + +access_vehicle_rental,access.vehicle.rental,model_vehicle_rental,base.group_user,1,1,1,1 + +access_animal_rental,access.animal.rental,model_animal_rental,base.group_user,1,1,1,1 + +access_crop_report_wizard,access.crop.report.wizard,model_crop_report_wizard,base.group_user,1,1,1,1 + +access_pest_report_wizard,access.pest.report.wizard,model_pest_report_wizard,base.group_user,1,1,1,1 + + + + diff --git a/agriculture_management_odoo/security/user_groups.xml b/agriculture_management_odoo/security/user_groups.xml new file mode 100644 index 000000000..fe25c0c72 --- /dev/null +++ b/agriculture_management_odoo/security/user_groups.xml @@ -0,0 +1,36 @@ + + + + Agriculture Management + Category for Agriculture + + + + User + + + + + Manager + + + + + + View Own Docs + + ['|',('user_id', '=', user.id),('create_uid', + '=', user.id)] + + + + + + View All Docs + + [(1, '=', 1)] + + + \ No newline at end of file diff --git a/agriculture_management_odoo/static/description/assets/icons/check.png b/agriculture_management_odoo/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/icons/check.png differ diff --git a/agriculture_management_odoo/static/description/assets/icons/chevron.png b/agriculture_management_odoo/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/icons/chevron.png differ diff --git a/agriculture_management_odoo/static/description/assets/icons/cogs.png b/agriculture_management_odoo/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/icons/cogs.png differ diff --git a/agriculture_management_odoo/static/description/assets/icons/consultation.png b/agriculture_management_odoo/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/icons/consultation.png differ diff --git a/agriculture_management_odoo/static/description/assets/icons/ecom-black.png b/agriculture_management_odoo/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/icons/ecom-black.png differ diff --git a/agriculture_management_odoo/static/description/assets/icons/education-black.png b/agriculture_management_odoo/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/icons/education-black.png differ diff --git a/agriculture_management_odoo/static/description/assets/icons/hotel-black.png b/agriculture_management_odoo/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/icons/hotel-black.png differ diff --git a/agriculture_management_odoo/static/description/assets/icons/license.png b/agriculture_management_odoo/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/icons/license.png differ diff --git a/agriculture_management_odoo/static/description/assets/icons/lifebuoy.png b/agriculture_management_odoo/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/icons/lifebuoy.png differ diff --git a/agriculture_management_odoo/static/description/assets/icons/manufacturing-black.png b/agriculture_management_odoo/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/icons/manufacturing-black.png differ diff --git a/agriculture_management_odoo/static/description/assets/icons/pos-black.png b/agriculture_management_odoo/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/icons/pos-black.png differ diff --git a/agriculture_management_odoo/static/description/assets/icons/puzzle.png b/agriculture_management_odoo/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/icons/puzzle.png differ diff --git a/agriculture_management_odoo/static/description/assets/icons/restaurant-black.png b/agriculture_management_odoo/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/icons/restaurant-black.png differ diff --git a/agriculture_management_odoo/static/description/assets/icons/service-black.png b/agriculture_management_odoo/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/icons/service-black.png differ diff --git a/agriculture_management_odoo/static/description/assets/icons/trading-black.png b/agriculture_management_odoo/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/icons/trading-black.png differ diff --git a/agriculture_management_odoo/static/description/assets/icons/training.png b/agriculture_management_odoo/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/icons/training.png differ diff --git a/agriculture_management_odoo/static/description/assets/icons/update.png b/agriculture_management_odoo/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/icons/update.png differ diff --git a/agriculture_management_odoo/static/description/assets/icons/user.png b/agriculture_management_odoo/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/icons/user.png differ diff --git a/agriculture_management_odoo/static/description/assets/icons/wrench.png b/agriculture_management_odoo/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/icons/wrench.png differ diff --git a/agriculture_management_odoo/static/description/assets/misc/categories.png b/agriculture_management_odoo/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/misc/categories.png differ diff --git a/agriculture_management_odoo/static/description/assets/misc/check-box.png b/agriculture_management_odoo/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/misc/check-box.png differ diff --git a/agriculture_management_odoo/static/description/assets/misc/compass.png b/agriculture_management_odoo/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/misc/compass.png differ diff --git a/agriculture_management_odoo/static/description/assets/misc/corporate.png b/agriculture_management_odoo/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/misc/corporate.png differ diff --git a/agriculture_management_odoo/static/description/assets/misc/customer-support.png b/agriculture_management_odoo/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/misc/customer-support.png differ diff --git a/agriculture_management_odoo/static/description/assets/misc/cybrosys-logo.png b/agriculture_management_odoo/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/misc/cybrosys-logo.png differ diff --git a/agriculture_management_odoo/static/description/assets/misc/features.png b/agriculture_management_odoo/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/misc/features.png differ diff --git a/agriculture_management_odoo/static/description/assets/misc/logo.png b/agriculture_management_odoo/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/misc/logo.png differ diff --git a/agriculture_management_odoo/static/description/assets/misc/pictures.png b/agriculture_management_odoo/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/misc/pictures.png differ diff --git a/agriculture_management_odoo/static/description/assets/misc/pie-chart.png b/agriculture_management_odoo/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/misc/pie-chart.png differ diff --git a/agriculture_management_odoo/static/description/assets/misc/right-arrow.png b/agriculture_management_odoo/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/misc/right-arrow.png differ diff --git a/agriculture_management_odoo/static/description/assets/misc/star.png b/agriculture_management_odoo/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/misc/star.png differ diff --git a/agriculture_management_odoo/static/description/assets/misc/support.png b/agriculture_management_odoo/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/misc/support.png differ diff --git a/agriculture_management_odoo/static/description/assets/misc/whatsapp.png b/agriculture_management_odoo/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/misc/whatsapp.png differ diff --git a/agriculture_management_odoo/static/description/assets/modules/1.png b/agriculture_management_odoo/static/description/assets/modules/1.png new file mode 100644 index 000000000..a000df6d7 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/modules/1.png differ diff --git a/agriculture_management_odoo/static/description/assets/modules/2.png b/agriculture_management_odoo/static/description/assets/modules/2.png new file mode 100644 index 000000000..b21837312 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/modules/2.png differ diff --git a/agriculture_management_odoo/static/description/assets/modules/3.png b/agriculture_management_odoo/static/description/assets/modules/3.png new file mode 100644 index 000000000..a9c4ec82c Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/modules/3.png differ diff --git a/agriculture_management_odoo/static/description/assets/modules/4.png b/agriculture_management_odoo/static/description/assets/modules/4.png new file mode 100644 index 000000000..17ba4d75f Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/modules/4.png differ diff --git a/agriculture_management_odoo/static/description/assets/modules/5.png b/agriculture_management_odoo/static/description/assets/modules/5.png new file mode 100644 index 000000000..a3194264c Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/modules/5.png differ diff --git a/agriculture_management_odoo/static/description/assets/modules/6.png b/agriculture_management_odoo/static/description/assets/modules/6.png new file mode 100644 index 000000000..e64a5b55c Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/modules/6.png differ diff --git a/agriculture_management_odoo/static/description/assets/screenshots/hero.gif b/agriculture_management_odoo/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..ccbcbcb53 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/screenshots/hero.gif differ diff --git a/agriculture_management_odoo/static/description/assets/screenshots/screenshot_1.png b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_1.png new file mode 100644 index 000000000..63aedc6d6 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_1.png differ diff --git a/agriculture_management_odoo/static/description/assets/screenshots/screenshot_10.png b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_10.png new file mode 100644 index 000000000..2ea267b70 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_10.png differ diff --git a/agriculture_management_odoo/static/description/assets/screenshots/screenshot_11.png b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_11.png new file mode 100644 index 000000000..520e934e8 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_11.png differ diff --git a/agriculture_management_odoo/static/description/assets/screenshots/screenshot_12.png b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_12.png new file mode 100644 index 000000000..a4a1e1468 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_12.png differ diff --git a/agriculture_management_odoo/static/description/assets/screenshots/screenshot_13.png b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_13.png new file mode 100644 index 000000000..8a2e130e6 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_13.png differ diff --git a/agriculture_management_odoo/static/description/assets/screenshots/screenshot_14.png b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_14.png new file mode 100644 index 000000000..a3979f87b Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_14.png differ diff --git a/agriculture_management_odoo/static/description/assets/screenshots/screenshot_15.png b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_15.png new file mode 100644 index 000000000..fd0127305 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_15.png differ diff --git a/agriculture_management_odoo/static/description/assets/screenshots/screenshot_16.png b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_16.png new file mode 100644 index 000000000..24869dde9 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_16.png differ diff --git a/agriculture_management_odoo/static/description/assets/screenshots/screenshot_17.png b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_17.png new file mode 100644 index 000000000..cbc3ebdef Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_17.png differ diff --git a/agriculture_management_odoo/static/description/assets/screenshots/screenshot_18.png b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_18.png new file mode 100644 index 000000000..4c4ac368c Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_18.png differ diff --git a/agriculture_management_odoo/static/description/assets/screenshots/screenshot_19.png b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_19.png new file mode 100644 index 000000000..12f118f02 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_19.png differ diff --git a/agriculture_management_odoo/static/description/assets/screenshots/screenshot_2.png b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_2.png new file mode 100644 index 000000000..2d168fcae Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_2.png differ diff --git a/agriculture_management_odoo/static/description/assets/screenshots/screenshot_3.png b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_3.png new file mode 100644 index 000000000..52f954869 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_3.png differ diff --git a/agriculture_management_odoo/static/description/assets/screenshots/screenshot_4.png b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_4.png new file mode 100644 index 000000000..305dfd4e1 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_4.png differ diff --git a/agriculture_management_odoo/static/description/assets/screenshots/screenshot_5.png b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_5.png new file mode 100644 index 000000000..ef7da89fa Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_5.png differ diff --git a/agriculture_management_odoo/static/description/assets/screenshots/screenshot_6.png b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_6.png new file mode 100644 index 000000000..098855ae3 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_6.png differ diff --git a/agriculture_management_odoo/static/description/assets/screenshots/screenshot_7.png b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_7.png new file mode 100644 index 000000000..ddbe86f6c Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_7.png differ diff --git a/agriculture_management_odoo/static/description/assets/screenshots/screenshot_8.png b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_8.png new file mode 100644 index 000000000..89b82d655 Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_8.png differ diff --git a/agriculture_management_odoo/static/description/assets/screenshots/screenshot_9.png b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_9.png new file mode 100644 index 000000000..9079512ba Binary files /dev/null and b/agriculture_management_odoo/static/description/assets/screenshots/screenshot_9.png differ diff --git a/agriculture_management_odoo/static/description/banner.png b/agriculture_management_odoo/static/description/banner.png new file mode 100644 index 000000000..f24bdfacb Binary files /dev/null and b/agriculture_management_odoo/static/description/banner.png differ diff --git a/agriculture_management_odoo/static/description/icon.png b/agriculture_management_odoo/static/description/icon.png new file mode 100644 index 000000000..1c311380e Binary files /dev/null and b/agriculture_management_odoo/static/description/icon.png differ diff --git a/agriculture_management_odoo/static/description/index.html b/agriculture_management_odoo/static/description/index.html new file mode 100644 index 000000000..6fc6ac2d0 --- /dev/null +++ b/agriculture_management_odoo/static/description/index.html @@ -0,0 +1,781 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ Agriculture Management

+

+ Agriculture Management In Odoo16

+ + +
+
+
+ + +
+ + +
+
+ +
+

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ This module helps to print Current Stock Report for all Products in each + Warehouse with XLS +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Community & + Enterprise Support. +
+
+ + Set the Manager and User in settings. +
+
+ + Create Crop Requests. +
+
+ + Create Rentals for Vehicles and Animals. +
+
+
+ +
+ + Available in Odoo 16.0 + Community and Enterprise. +
+ +
+ + Create Damage/Loss Report. +
+ +
+ + Create Pesticide Request and Can View the Pesticide Details. +
+ +
+ + Create Total Crop Request Report. +
+ +
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+ +
+

+ Provide User Access +

+

+ In Settings, user can have Manager access which is overall + access and another one is User access.

+ + +
+ +
+

+ Configuration

+

+ User can create Seed, Farmers, Vehicles, Animals, Locations and Tags used for creating Crop Request.

+ +
+ +
+

+ Create Crop Request using created values in configuration.

+ +
+ +
+

+ User can print report of current record of used vehicles.

+ +
+ +
+

+ Report view of used vehicle report.

+ +
+ +
+

+ User Can Print Report Of Current Record of Used Animals.

+ +
+ +
+

+ Report View Of Used Animal Report.

+ +
+ +
+

+ User Can Rent The Vehicles.

+ +
+ +
+

+ User Can Rent The Animals.

+ +
+ +
+

+ User Can Submit Damage/ Loss of the Crops.

+ +
+ +
+

+ User Can Request Pesticide For The Crops.

+ +
+ +
+

+ User Can Create and View Details of Pesticides + Available.

+ +
+ +
+

+ User Can Take The Crop Request Report.

+ +
+ +
+

+ Enter The Date Range To Print Report.

+ +
+ +
+

+ Report View Of Crop Request.

+ +
+ +
+

+ User Can Take The Pest Request Report.

+ +
+ +
+

+ Enter The Date Range To Print Report.

+ +
+ +
+

+ Report View Of Pest Request.

+ +
+ +
+
+ + + +
+
+ +
+

+ Related + Products +

+
+
+
+ +
+
+ + + + +
+
+ +
+

+ Our Services +

+
+ +
+
+
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+ +
+ + + + + +
+
+ +
+

+ Our + Industries +

+
+ +
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+
+
+ + + + +
+
+ +
+

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? + Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+ +91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/agriculture_management_odoo/views/animal_details_views.xml b/agriculture_management_odoo/views/animal_details_views.xml new file mode 100644 index 000000000..60ea8e6a3 --- /dev/null +++ b/agriculture_management_odoo/views/animal_details_views.xml @@ -0,0 +1,54 @@ + + + + animal.details.tree + animal.details + + + + + + + + + + + animal.details.form + animal.details + +
+
+
+ +

+ +

+ + + + + + + + + +
+
+ + + +
+
+
+
+ +
\ No newline at end of file diff --git a/agriculture_management_odoo/views/animal_rental_views.xml b/agriculture_management_odoo/views/animal_rental_views.xml new file mode 100644 index 000000000..305110e39 --- /dev/null +++ b/agriculture_management_odoo/views/animal_rental_views.xml @@ -0,0 +1,44 @@ + + + + animal.rental.tree + animal.rental + + + + + + + + + + + animal.rental.form + animal.rental + +
+ + + + + + + + + + + + + +
+ + + +
+
+
+
+ + +
\ No newline at end of file diff --git a/agriculture_management_odoo/views/crop_request.xml b/agriculture_management_odoo/views/crop_request.xml new file mode 100644 index 000000000..487b81e93 --- /dev/null +++ b/agriculture_management_odoo/views/crop_request.xml @@ -0,0 +1,150 @@ + + + + crop.request.kanban + crop.requests + + + + + + + + + + +
+
+ + +
+ +
+ +
+ +
+ +
+
+
+
+
+
+
+
+
+ + + + crop.request.tree + crop.requests + + + + + + + + + + + + crop.request.form + crop.requests + +
+
+
+ +

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+
+
+
\ No newline at end of file diff --git a/agriculture_management_odoo/views/damage_loss.xml b/agriculture_management_odoo/views/damage_loss.xml new file mode 100644 index 000000000..5946a652c --- /dev/null +++ b/agriculture_management_odoo/views/damage_loss.xml @@ -0,0 +1,48 @@ + + + + damage.loss.tree + damage.loss + + + + + + + + + + + + + damage.loss.form + damage.loss + +
+ +

+ +

+ + + + + + + + + + + + + +
+
+ + + +
+
+
+
+
\ No newline at end of file diff --git a/agriculture_management_odoo/views/farmer_details_view.xml b/agriculture_management_odoo/views/farmer_details_view.xml new file mode 100644 index 000000000..0a50729bf --- /dev/null +++ b/agriculture_management_odoo/views/farmer_details_view.xml @@ -0,0 +1,64 @@ + + + + farmer.details.kanban + farmer.details + + + + + + +
+
+
    + + +
    + + +
    +
    + +
    +
    +
    +
+
+
+
+
+
+
+
+ + + farmer.details.form + farmer.details + +
+ + + + + + + + + + + +
+ + + +
+
+
+
+
\ No newline at end of file diff --git a/agriculture_management_odoo/views/fleet_inherit_view.xml b/agriculture_management_odoo/views/fleet_inherit_view.xml new file mode 100644 index 000000000..f67df601c --- /dev/null +++ b/agriculture_management_odoo/views/fleet_inherit_view.xml @@ -0,0 +1,18 @@ + + + + fleet.vehicle.inherited + fleet.vehicle + + + + + + + + + + + \ No newline at end of file diff --git a/agriculture_management_odoo/views/location_details_view.xml b/agriculture_management_odoo/views/location_details_view.xml new file mode 100644 index 000000000..bcebc3114 --- /dev/null +++ b/agriculture_management_odoo/views/location_details_view.xml @@ -0,0 +1,44 @@ + + + + location.details.tree + location.details + + + + + + + + + + + location.details.form + location.details + +
+ +

+ +

+ + + + + + + + + + + +
+
+ + + +
+
+
+
+
\ No newline at end of file diff --git a/agriculture_management_odoo/views/menu_action.xml b/agriculture_management_odoo/views/menu_action.xml new file mode 100644 index 000000000..403c7701e --- /dev/null +++ b/agriculture_management_odoo/views/menu_action.xml @@ -0,0 +1,177 @@ + + + + + Crops + ir.actions.act_window + crop.requests + kanban,tree,form + {'search_default_available':1} + +

+ Create Your First Crop Request +

+
+
+ + + + Vehicle Rental + ir.actions.act_window + vehicle.rental + tree,form,kanban + {'search_default_available':1} + +

+ Create Your First Vehicle Rental Request +

+
+
+ + + Vehicle Rental + ir.actions.act_window + animal.rental + tree,form,kanban + {'search_default_available':1} + +

+ Create Your First Animal Rental Request +

+
+
+ + + + Pesticide Request + ir.actions.act_window + pest.request + tree,form + {'search_default_available':1} + +

+ Create Your First Pest Request +

+
+
+ + + Pesticide Details + ir.actions.act_window + pest.details + tree,form + {'search_default_available':1} + +

+ Create Your First Pesticide +

+
+
+ + + Damage and Loss + ir.actions.act_window + damage.loss + tree,form + {'search_default_available':1} + +

+ Create Your First Damage and Loss +

+
+
+ + + Crop Report + ir.actions.act_window + crop.report.wizard + form + + new + + + Pest Report + ir.actions.act_window + pest.report.wizard + form + + new + + + + + Seeds + ir.actions.act_window + seed.details + tree,form + {'search_default_available':1} + +

+ Create Your First Seed +

+
+
+ + Animals + ir.actions.act_window + animal.details + tree,form + {'search_default_available':1} + +

+ Create Your First Animal +

+
+
+ + Locations + ir.actions.act_window + location.details + tree,form + {'search_default_available':1} + +

+ Create Your First Location +

+
+
+ + + Vehicles + ir.actions.act_window + vehicle.details + tree,form + {'search_default_available':1} + +

+ Create Your First Vehicle +

+
+
+ + + Tags + ir.actions.act_window + agr.tag + tree,form + {'search_default_available':1} + +

+ Create Your First Tag +

+
+
+ + + Farmers + ir.actions.act_window + farmer.details + kanban,form,tree + {'search_default_available':1} + +

+ Create Your First Farmer +

+
+
+
\ No newline at end of file diff --git a/agriculture_management_odoo/views/menu_items.xml b/agriculture_management_odoo/views/menu_items.xml new file mode 100644 index 000000000..09ac301e7 --- /dev/null +++ b/agriculture_management_odoo/views/menu_items.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/agriculture_management_odoo/views/pest_details.xml b/agriculture_management_odoo/views/pest_details.xml new file mode 100644 index 000000000..d0f8b6650 --- /dev/null +++ b/agriculture_management_odoo/views/pest_details.xml @@ -0,0 +1,52 @@ + + + + + pest.details.tree + pest.details + + + + + + + + + + + + + pest.details.form + pest.details + +
+ + + + + + + + + + + + + + + + +
+ + + +
+
+
+
+
\ No newline at end of file diff --git a/agriculture_management_odoo/views/pest_request.xml b/agriculture_management_odoo/views/pest_request.xml new file mode 100644 index 000000000..4575ae2a0 --- /dev/null +++ b/agriculture_management_odoo/views/pest_request.xml @@ -0,0 +1,78 @@ + + + + pest.request.tree + pest.request + + + + + + + + + + + + + + + pest.request.form + pest.request + +
+
+
+ +

+ +

+ + + + + + + + + + + + + + + + + +
+
+ + + +
+
+
+
+
\ No newline at end of file diff --git a/agriculture_management_odoo/views/seed_details_view.xml b/agriculture_management_odoo/views/seed_details_view.xml new file mode 100644 index 000000000..e7b948864 --- /dev/null +++ b/agriculture_management_odoo/views/seed_details_view.xml @@ -0,0 +1,46 @@ + + + + + seed.details.tree + seed.details + + + + + + + + + + + + + seed.details.form + seed.details + +
+ +

+ Name +

+ + + + + + + + + + +
+
+ + + +
+
+
+
+
\ No newline at end of file diff --git a/agriculture_management_odoo/views/tag_details.xml b/agriculture_management_odoo/views/tag_details.xml new file mode 100644 index 000000000..5e16aa73b --- /dev/null +++ b/agriculture_management_odoo/views/tag_details.xml @@ -0,0 +1,37 @@ + + + + agriculture.tag.view.form + agr.tag + +
+ +
+
+ + + + + +
+
+
+
+ + + agriculture.tag.view.tree + agr.tag + + + + + + + + +
\ No newline at end of file diff --git a/agriculture_management_odoo/views/vehicle_details_view.xml b/agriculture_management_odoo/views/vehicle_details_view.xml new file mode 100644 index 000000000..85abd5d8c --- /dev/null +++ b/agriculture_management_odoo/views/vehicle_details_view.xml @@ -0,0 +1,43 @@ + + + + vehicle.details.tree + vehicle.details + + + + + + + + + + + vehicle.details.form + vehicle.details + +
+ +

+ +

+ + + + + + + + + + +
+
+ + + +
+
+
+
+
\ No newline at end of file diff --git a/agriculture_management_odoo/views/vehicle_rental_views.xml b/agriculture_management_odoo/views/vehicle_rental_views.xml new file mode 100644 index 000000000..9bbf408e8 --- /dev/null +++ b/agriculture_management_odoo/views/vehicle_rental_views.xml @@ -0,0 +1,44 @@ + + + + vehicle.rental.tree + vehicle.rental + + + + + + + + + + + vehicle.rental.form + vehicle.rental + +
+ + + + + + + + + + + + + +
+ + + +
+
+
+
+ + +
\ No newline at end of file diff --git a/agriculture_management_odoo/wizard/__init__.py b/agriculture_management_odoo/wizard/__init__.py new file mode 100644 index 000000000..ae6ad7ce5 --- /dev/null +++ b/agriculture_management_odoo/wizard/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import crop_report_wiz +from . import pest_report_wiz diff --git a/agriculture_management_odoo/wizard/crop_report_wiz.py b/agriculture_management_odoo/wizard/crop_report_wiz.py new file mode 100644 index 000000000..ab6635424 --- /dev/null +++ b/agriculture_management_odoo/wizard/crop_report_wiz.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class CropReport(models.TransientModel): + _name = 'crop.report.wizard' + _description = 'Crop Report Wizard' + + date_from = fields.Date(string='From Date') + date_to = fields.Date(string='To Date') + + def action_pdf_report(self): + ret = """select crop_requests.ref, res_partner.name, + seed_details.name, crop_requests.request_date, crop_requests.state, + location_details.location_name from crop_requests + inner join farmer_details ON + crop_requests.farmer_id = farmer_details.id + inner join res_partner ON + farmer_details.farmer_name = res_partner.id + inner join seed_details ON + crop_requests.seed_id = seed_details.id + inner join location_details ON + crop_requests.location_id = location_details.id""" + if self.date_from and self.date_to: + ret = ret + """ where crop_requests.request_date > '""" + str( + self.date_from) + """' AND crop_requests.request_date < '""" + str( + self.date_to) + """'""" + self.env.cr.execute(ret) + record = self.env.cr.fetchall() + data = { + 'form': self.read()[0], + 'date_to': self.date_to, + 'date_from': self.date_from, + 'record': record + } + return self.env.ref( + 'agriculture_management_odoo.action_crop_request_report').report_action( + self, data=data) diff --git a/agriculture_management_odoo/wizard/crop_report_wiz.xml b/agriculture_management_odoo/wizard/crop_report_wiz.xml new file mode 100644 index 000000000..7d71342d4 --- /dev/null +++ b/agriculture_management_odoo/wizard/crop_report_wiz.xml @@ -0,0 +1,25 @@ + + + + crop.report.wizard.form + crop.report.wizard + +
+ + + + + + + + +
+
+
+
+
+
\ No newline at end of file diff --git a/agriculture_management_odoo/wizard/pest_report_wiz.py b/agriculture_management_odoo/wizard/pest_report_wiz.py new file mode 100644 index 000000000..6045cb56e --- /dev/null +++ b/agriculture_management_odoo/wizard/pest_report_wiz.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class CropReport(models.TransientModel): + _name = 'pest.report.wizard' + _description = 'Pest Report Wizard' + + date_from = fields.Date(string='From Date') + date_to = fields.Date(string='To Date') + + def action_pdf_pest_report(self): + ret = """select pest_request.reference, res_partner.name, crop_requests.ref, + pest_request.disease, pest_details.pest_name,pest_request.pest_quantity, + pest_request.pest_cost, pest_request.total_cost,pest_request.state from pest_request + inner join res_partner on pest_request.farmer_id = res_partner.id + inner join crop_requests on crop_requests.id = pest_request.crop_id + inner join pest_details on pest_details.id = pest_request.pest_id""" + if self.date_from and self.date_to: + ret = ret + """ where crop_requests.request_date > '""" + str( + self.date_from) + """' AND crop_requests.request_date < '""" + str( + self.date_to) + """'""" + self.env.cr.execute(ret) + record = self.env.cr.fetchall() + print(record) + data = { + 'form': self.read()[0], + 'date_to': self.date_to, + 'date_from': self.date_from, + 'record': record + } + return self.env.ref( + 'agriculture_management_odoo.action_pest_request_report').report_action( + self, data=data) diff --git a/agriculture_management_odoo/wizard/pest_report_wiz.xml b/agriculture_management_odoo/wizard/pest_report_wiz.xml new file mode 100644 index 000000000..5718d65dd --- /dev/null +++ b/agriculture_management_odoo/wizard/pest_report_wiz.xml @@ -0,0 +1,25 @@ + + + + pest.report.wizard.form + pest.report.wizard + +
+ + + + + + + + +
+
+
+
+
+
\ No newline at end of file diff --git a/subscription_package/README.md b/subscription_package/README.md new file mode 100644 index 000000000..815553060 --- /dev/null +++ b/subscription_package/README.md @@ -0,0 +1,37 @@ +Subscription Package for Community in odoo 16 +============================================== +* Subscription Package for Odoo 16 community edition + +Installation +============ + - www.odoo.com/documentation/16.0/setup/install.html + - Install our custom addon + +Company +------- +* 'Cybrosys Techno Solutions `__ + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Credits +-------- +* Developer: Amal Prasad @ Cybrosys, + Alakananda @ Cybrosys + V16 Archana V @ Cybrosys + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ \ No newline at end of file diff --git a/subscription_package/__init__.py b/subscription_package/__init__.py new file mode 100644 index 000000000..f8545aae7 --- /dev/null +++ b/subscription_package/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import models +from . import report +from . import wizard diff --git a/subscription_package/__manifest__.py b/subscription_package/__manifest__.py new file mode 100644 index 000000000..4829d99ea --- /dev/null +++ b/subscription_package/__manifest__.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2022-TODAY Cybrosys Technologies (). +# Author: Cybrosys Techno Solutions () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +{ + 'name': 'Subscription Management For Community Odoo 16', + 'Version': '16.0.1.0.0', + 'summary': 'Subscription Package Management Module For Odoo16 Community', + 'description': 'Subscription Package Management Module For Odoo16 Community', + 'category': 'Sales', + 'author': 'Cybrosys Techno solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['base', 'sale_management'], + 'data': [ + 'security/security.xml', + 'security/ir.model.access.csv', + 'data/uom_demo.xml', + 'data/subscription_stage_data.xml', + 'data/mail_template.xml', + 'data/cron.xml', + 'wizard/subscription_close_wizard.xml', + 'views/subscription_package.xml', + 'views/subscription_products.xml', + 'views/subscription_plan.xml', + 'views/subscription_stage.xml', + 'views/subscription_close.xml', + 'views/subscription_renew.xml', + 'views/mail_activity_views.xml', + 'views/res_partner.xml', + 'views/recurrence_views.xml', + 'report/subscription_report_view.xml', + ], + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'application': True, + 'auto_install': False, +} diff --git a/subscription_package/data/cron.xml b/subscription_package/data/cron.xml new file mode 100644 index 000000000..d5459a16b --- /dev/null +++ b/subscription_package/data/cron.xml @@ -0,0 +1,14 @@ + + + + + Check Close Limit + + code + model.close_limit_cron() + 1 + days + -1 + + + \ No newline at end of file diff --git a/subscription_package/data/mail_template.xml b/subscription_package/data/mail_template.xml new file mode 100644 index 000000000..61a4ff74f --- /dev/null +++ b/subscription_package/data/mail_template.xml @@ -0,0 +1,56 @@ + + + + + Subscription: Email Renew Alert + + {{ object.company_id.name }}: Please check the subscription {{ object.name }} + {{ object.company_id.email }} + {{ object.partner_id.email }} + + {{ object.partner_id.lang }} + +
+ + + + + + + +
+ + + + + Subscription Renew Alert +
+ + + + + + + + +
+

Dear, +

+

Your subscription Plan + + is going to Expired on + . +

+

If you have some concerns about it, please contact your contact person + + or reply to this email. +

+

Kind regards.

+
+
+
+
+ +
\ No newline at end of file diff --git a/subscription_package/data/subscription_stage_data.xml b/subscription_package/data/subscription_stage_data.xml new file mode 100644 index 000000000..ee7425778 --- /dev/null +++ b/subscription_package/data/subscription_stage_data.xml @@ -0,0 +1,25 @@ + + + + + + Draft + 5 + draft + + + + In Progress + 10 + progress + + + + Closed + 15 + + closed + + + + \ No newline at end of file diff --git a/subscription_package/data/uom_demo.xml b/subscription_package/data/uom_demo.xml new file mode 100644 index 000000000..23ca52f94 --- /dev/null +++ b/subscription_package/data/uom_demo.xml @@ -0,0 +1,24 @@ + + + + + + Time + + + + + Months + + reference + + + + + Years + + bigger + + + + \ No newline at end of file diff --git a/subscription_package/doc/RELEASE_NOTES.md b/subscription_package/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..0555b1f0c --- /dev/null +++ b/subscription_package/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 01.10.2022 +#### Version 16.0.1.0.0 +#### ADD +- Initial commit for subscription_packages odoo \ No newline at end of file diff --git a/subscription_package/models/__init__.py b/subscription_package/models/__init__.py new file mode 100644 index 000000000..c7fea59e9 --- /dev/null +++ b/subscription_package/models/__init__.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import subscription_plan +from . import subscription_stage +from . import subscription_package +from . import subscription_products +from . import subscription_close +from . import subscription_renew +from . import res_partner +from.import recurrence_period diff --git a/subscription_package/models/recurrence_period.py b/subscription_package/models/recurrence_period.py new file mode 100644 index 000000000..b2424543e --- /dev/null +++ b/subscription_package/models/recurrence_period.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from odoo import models, fields + + +class RecurrencePeriod(models.Model): + _name = "recurrence.period" + _description = "Recurrence Period " + + name = fields.Char(string="Name") + duration = fields.Float(string="Duration") + unit = fields.Selection([('hours', 'hours'), + ('days', 'Report'),('weeks', 'Report'),('months', 'Report'),('years', 'Report')], + string= 'Unit' ) + + + +class SubPackages(models.Model): + _inherit = 'subscription.package' + + recurrence_period_id = fields.Many2one("recurrence.period" , string= "Recurrence Period") diff --git a/subscription_package/models/res_partner.py b/subscription_package/models/res_partner.py new file mode 100644 index 000000000..171c7f58d --- /dev/null +++ b/subscription_package/models/res_partner.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from odoo import fields, models + + +class Partner(models.Model): + _inherit = 'res.partner' + + active_subscription = fields.Boolean(string="Active Subscription", + default=False) + subscription_product_line_ids = fields.One2many('subscription.package.product.line', + 'res_partner_id', + ondelete='restrict', + string='Products Line') diff --git a/subscription_package/models/subscription_close.py b/subscription_package/models/subscription_close.py new file mode 100644 index 000000000..a5c2fa31f --- /dev/null +++ b/subscription_package/models/subscription_close.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from odoo import models, fields + + +class SubscriptionPackageStopReason(models.Model): + _name = "subscription.package.stop" + _description = "Subscription Package Stop Reason" + _order = 'sequence' + + sequence = fields.Integer(help="Determine the display order", index=True, + string='Sequence') + name = fields.Char(string='Reason', required=True) diff --git a/subscription_package/models/subscription_package.py b/subscription_package/models/subscription_package.py new file mode 100644 index 000000000..9491ebcf1 --- /dev/null +++ b/subscription_package/models/subscription_package.py @@ -0,0 +1,395 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from odoo import _, api, models, fields, SUPERUSER_ID +import datetime +from odoo.exceptions import UserError +from dateutil.relativedelta import relativedelta + + +class SubscriptionPackageProductLine(models.Model): + _name = 'subscription.package.product.line' + _description = 'Subscription Product Lines' + + subscription_id = fields.Many2one('subscription.package', store=True, + string='Subscription') + company_id = fields.Many2one('res.company', string='Company', store=True, + related='subscription_id.company_id') + create_date = fields.Datetime(string='Create date', store=True, + default=fields.Datetime.now) + user_id = fields.Many2one('res.users', string='Salesperson', store=True, + related='subscription_id.user_id') + product_id = fields.Many2one('product.product', string='Product', + store=True, ondelete='restrict', + domain=[('is_subscription', '=', True)]) + product_qty = fields.Float(string='Quantity', store=True, default=1.0) + product_uom_id = fields.Many2one('uom.uom', string='UoM', store=True, + related='product_id.uom_id', + ondelete='restrict') + uom_catg_id = fields.Many2one('uom.category', string='UoM', store=True, + related='product_id.uom_id.category_id') + unit_price = fields.Float(string='Unit Price', store=True, readonly=False, + related='product_id.list_price') + currency_id = fields.Many2one('res.currency', string='Currency', + store=True, + related='subscription_id.currency_id') + total_amount = fields.Monetary(string='Subtotal', store=True, + compute='_compute_total_amount') + sequence = fields.Integer('Sequence', help="Determine the display order", + index=True) + res_partner_id = fields.Many2one('res.partner', string='Currency', + store=True, + related='subscription_id.partner_id') + + @api.depends('product_qty', 'unit_price') + def _compute_total_amount(self): + """ Calculate subtotal amount of product line """ + for rec in self: + if rec.product_id: + rec.total_amount = rec.unit_price * rec.product_qty + + +class SubscriptionPackage(models.Model): + _name = 'subscription.package' + _description = 'Subscription Package' + _rec_name = 'name' + _inherit = ['mail.thread', 'mail.activity.mixin'] + + + + @api.model + def _read_group_stage_ids(self, categories, domain, order): + """ Read all the stages and display it in the kanban view, + even if it is empty.""" + category_ids = categories._search([], order=order, + access_rights_uid=SUPERUSER_ID) + return categories.browse(category_ids) + + def _default_stage_id(self): + """Setting default stage""" + rec = self.env['subscription.package.stage'].search([], limit=1, + order='sequence ASC') + return rec.id if rec else None + + name = fields.Char(string='Name', default="New", compute='_compute_name', + store=True, required=True) + partner_id = fields.Many2one('res.partner', string='Customer', store=True) + partner_invoice_id = fields.Many2one('res.partner', + string='Invoice Address', + related='partner_id', readonly=False) + partner_shipping_id = fields.Many2one('res.partner', + string='Shipping/Service Address', + related='partner_id', + readonly=False) + plan_id = fields.Many2one('subscription.package.plan', + string='Subscription Plan') + start_date = fields.Date(string='Start Date', store=True, + ondelete='restrict') + next_invoice_date = fields.Date(string='Next Invoice Date', readonly=False, + store=True, + compute="_compute_next_invoice_date") + company_id = fields.Many2one('res.company', string='Company', + default=lambda self: self.env.company, + required=True) + user_id = fields.Many2one('res.users', string='Sales Person', + default=lambda self: self.env.uid) + sale_order = fields.Many2one('sale.order', string="Sale Order") + to_renew = fields.Boolean(string='To Renew', default=False) + tag_ids = fields.Many2many('account.account.tag', string='Tags') + stage_id = fields.Many2one('subscription.package.stage', string='Stage', + default=lambda self: self._default_stage_id(), + index=True, + group_expand='_read_group_stage_ids') + invoice_count = fields.Integer(string='Invoices', + compute='_compute_invoice_count') + so_count = fields.Integer(string='Sales', compute='_compute_sale_count') + description = fields.Text(string='Description') + analytic_account_id = fields.Many2one('account.analytic.account', + string='Analytic Account') + product_line_ids = fields.One2many('subscription.package.product.line', + 'subscription_id', ondelete='restrict', + string='Products Line') + currency_id = fields.Many2one('res.currency', string='Currency', + readonly=True, + default=lambda + self: self.env.company.currency_id) + current_stage = fields.Char(string='Current Stage', default='Draft', + store=True, compute='_compute_current_stage') + reference_code = fields.Char(string='Reference', store=True) + is_closed = fields.Boolean(string="Closed", default=False) + close_reason = fields.Many2one('subscription.package.stop', + string='Close Reason') + closed_by = fields.Many2one('res.users', string='Closed By') + close_date = fields.Date(string='Closed on') + stage_category = fields.Selection(related='stage_id.category', store=True) + invoice_mode = fields.Selection(related="plan_id.invoice_mode") + total_recurring_price = fields.Float(string='Recurring Price', + compute='_compute_total_recurring_price', + store=True) + + @api.depends('invoice_count') + def _compute_invoice_count(self): + """ Calculate Invoice count based on subscription package """ + invoice_count = self.env['account.move'].search_count( + [('subscription_id', '=', self.id)]) + if invoice_count > 0: + self.invoice_count = invoice_count + else: + self.invoice_count = 0 + + @api.depends('so_count') + def _compute_sale_count(self): + """ Calculate sale order count based on subscription package """ + self.so_count = self.env['sale.order'].search_count( + [('subscription_id', '=', self.id)]) + + @api.depends('stage_id') + def _compute_current_stage(self): + """ It displays current stage for subscription package """ + for rec in self: + rec.current_stage = rec.env['subscription.package.stage'].search( + [('id', '=', rec.stage_id.id)]).category + + @api.depends('start_date') + def _compute_next_invoice_date(self): + pending_subscriptions = self.env['subscription.package'].search( + [('stage_category', '=', 'progress')]) + for sub in pending_subscriptions: + if sub.start_date: + sub.next_invoice_date = sub.start_date + relativedelta( + days=sub.plan_id.renewal_time) + + def button_invoice_count(self): + """ It displays invoice based on subscription package """ + return { + 'name': 'Invoices', + 'domain': [('subscription_id', '=', self.id)], + 'view_type': 'form', + 'res_model': 'account.move', + 'view_mode': 'tree,form', + 'type': 'ir.actions.act_window', + 'context': { + "create": False + } + } + + def button_sale_count(self): + """ It displays sale order based on subscription package """ + return { + 'name': 'Products', + 'domain': [('subscription_id', '=', self.id)], + 'view_type': 'form', + 'res_model': 'sale.order', + 'view_mode': 'tree,form', + 'type': 'ir.actions.act_window', + 'context': { + "create": False + } + } + + def button_close(self): + """ Button for subscription close wizard """ + return { + 'name': "Subscription Close Reason", + 'type': 'ir.actions.act_window', + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'subscription.close.wizard', + 'target': 'new' + } + + def button_payment(self): + """ Button to create invoice for subscription package""" + this_products_line = [] + for rec in self.product_line_ids: + rec_list = [0, 0, {'product_id': rec.product_id.id, + 'quantity': rec.product_qty}] + this_products_line.append(rec_list) + invoices = self.env['account.move'].search([('subscription_id', '=', self.id), ('state', '=', 'draft')]) + orders = self.env['sale.order'].search([('subscription_id', '=', self.id), ('invoice_status', '=', 'no')]) + if invoices: + for invoice in invoices: + invoice.action_post() + if orders and invoices: + for order in orders: + order.action_confirm() + for invoice in invoices: + invoice.action_post() + out_invoice = self.env['account.move'].create( + { + 'move_type': 'out_invoice', + 'date': fields.Date.today(), + 'invoice_date': fields.Date.today(), + 'partner_id': self.partner_invoice_id.id, + 'currency_id': self.partner_invoice_id.currency_id.id, + 'invoice_line_ids': this_products_line + }) + self.env['account.move'].payment_id = out_invoice.id + if self.stage_category == 'progress': + values = {'start_date': datetime.datetime.today()} + self.write(values) + return { + 'name': 'Subscription Payment', + 'type': 'ir.actions.act_window', + 'res_model': 'account.move', + 'view_mode': 'form', + 'res_id': out_invoice.id + } + + def button_start_date(self): + """Button to start subscription package""" + print("kkkkkkkkkkkkkkkkkkkkkkkkkkkk") + + if not self.start_date: + + self.start_date = datetime.date.today() + for rec in self: + print((rec.env['subscription.package.stage'].search([ + ('category', '=', 'draft')]).id)) + if len(rec.env['subscription.package.stage'].search([('category', '=', 'draft')])) > 1: + raise UserError( + _('More than one stage is having category "Draft". ' + 'Please change category of stage to "In Progress", ' + 'only one stage is allowed to have category "Draft"')) + else: + print( (rec.env['subscription.package.stage'].search([ + ('category', '=', 'draft')]).id) ) + rec.write( + {'stage_id': (rec.env['subscription.package.stage'].search([ + ('category', '=', 'draft')]).id) + 1}) + + def button_sale_order(self): + """Button to create sale order""" + this_products_line = [] + for rec in self.product_line_ids: + rec_list = [0, 0, {'product_id': rec.product_id.id, + 'product_uom_qty': rec.product_qty}] + this_products_line.append(rec_list) + # for order in self.sale_order: + orders = self.env['sale.order'].search([('subscription_id', '=', self.id), ('invoice_status', '=', 'no')]) + if orders: + for order in orders: + order.action_confirm() + so_id = self.env['sale.order'].create({ + 'partner_id': self.partner_id.id, + 'partner_invoice_id': self.partner_id.id, + 'partner_shipping_id': self.partner_id.id, + 'is_subscription': True, + 'subscription_id': self.id, + 'order_line': this_products_line + }) + self.sale_order = so_id + return { + 'name': _('Sales Orders'), + 'type': 'ir.actions.act_window', + 'res_model': 'sale.order', + 'domain': [('id', '=', so_id.id)], + 'view_mode': 'tree,form' + } + + @api.model + def create(self, vals): + """It displays subscription product in partner and generate sequence""" + partner = self.env['res.partner'].search( + [('id', '=', vals.get('partner_id'))]) + partner.active_subscription = True + if vals.get('reference_code', 'New') is False: + vals['reference_code'] = self.env['ir.sequence'].next_by_code( + 'sequence.reference.code') or 'New' + create_id = super(SubscriptionPackage, self).create(vals) + return create_id + + @api.depends('reference_code') + def _compute_name(self): + """It displays record name as combination of short code, reference + code and partner name """ + plan_id = self.env['subscription.package.plan'].search( + [('id', '=', self.plan_id.id)]) + if plan_id.short_code and self.reference_code: + self.name = plan_id.short_code + '/' + self.reference_code + '-' + self.partner_id.name + + def set_close(self): + """ Button to close subscription package """ + stage = self.env['subscription.package.stage'].search( + [('category', '=', 'closed')], limit=1).id + for sub in self: + values = {'stage_id': stage, 'to_renew': False} + sub.write(values) + return True + + def close_limit_cron(self): + """ It Checks renew date, close date. It will send mail when renew date """ + pending_subscriptions = self.env['subscription.package'].search( + [('stage_category', '=', 'progress')]) + today_date = fields.Date.today() + pending_subscription = False + close_subscription = False + for pending_subscription in pending_subscriptions: + pending_subscription.close_date = pending_subscription.start_date + relativedelta( + days=pending_subscription.plan_id.days_to_end) + difference = ( + pending_subscription.close_date - pending_subscription.start_date).days / 10 + renew_date = pending_subscription.close_date - relativedelta( + days=difference) + if today_date == renew_date: + self.env.ref( + 'subscription_package.mail_template_subscription_renew').send_mail( + pending_subscription.id, force_send=True) + pending_subscription.write({'to_renew': True}) + if pending_subscription.plan_id.invoice_mode == 'draft_invoice': + this_products_line = [] + for rec in pending_subscription.product_line_ids: + rec_list = [0, 0, {'product_id': rec.product_id.id, + 'quantity': rec.product_qty}] + this_products_line.append(rec_list) + self.env['account.move'].create( + { + 'move_type': 'out_invoice', + 'date': fields.Date.today(), + 'invoice_date': fields.Date.today(), + 'state': 'draft', + 'partner_id': pending_subscription.partner_invoice_id.id, + 'currency_id': pending_subscription.partner_invoice_id.currency_id.id, + 'invoice_line_ids': this_products_line + }) + pending_subscription.write({'to_renew': False, + 'start_date': datetime.datetime.today()}) + close_subscriptions = self.env['subscription.package'].search( + [('stage_category', '=', 'progress'), ('to_renew', '=', True)]) + for close_subscription in close_subscriptions: + close_subscription.close_date = close_subscription.start_date + relativedelta( + days=close_subscription.plan_id.days_to_end) + if today_date == close_subscription.close_date: + close_subscription.set_close() + return dict(pending=pending_subscription, closed=close_subscription) + + @api.depends('product_line_ids.total_amount') + def _compute_total_recurring_price(self): + """ Calculate recurring price """ + for record in self: + total_recurring = 0 + for line in record.product_line_ids: + total_recurring += line.total_amount + record['total_recurring_price'] = total_recurring + + def action_renew(self): + return self.button_sale_order() diff --git a/subscription_package/models/subscription_plan.py b/subscription_package/models/subscription_plan.py new file mode 100644 index 000000000..db553fbf3 --- /dev/null +++ b/subscription_package/models/subscription_plan.py @@ -0,0 +1,130 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from odoo import api, models, fields + + +class SubscriptionPlan(models.Model): + _name = 'subscription.package.plan' + _description = 'Subscription Package Plan' + + name = fields.Char(string='Plan Name', required=True) + renewal_value = fields.Char(string='Renewal') + renewal_period = fields.Selection([('days', 'Day(s)'), + ('weeks', 'Week(s)'), + ('months', 'Month(s)'), + ('years', 'Year(s)')], + default='months') + renewal_time = fields.Integer(string='Renewal Time Interval', + readonly=True, + compute='_compute_renewal_time', + store=True) + limit_choice = fields.Selection([('ones', 'Ones'), + ('manual', 'Until Closed Manually'), + ('custom', 'Custom')], + default='ones') + limit_count = fields.Integer(string='Custom Renewal Limit') + days_to_end = fields.Integer(string='Days End', readonly=True, + compute='_compute_days_to_end', store=True, + help="Subscription ending date") + invoice_mode = fields.Selection([('manual', 'Manually'), + ('draft_invoice', 'Draft')], + default='draft_invoice') + journal_id = fields.Many2one('account.journal', string='Journal', + store=True, domain="[('type', '=', 'sale')]") + company_id = fields.Many2one('res.company', string='Company', store=True, + default=lambda self: self.env.company) + short_code = fields.Char(string='Short Code') + terms_and_conditions = fields.Text(string='Terms and Conditions') + product_count = fields.Integer(string='Products', + compute='_compute_product_count') + subscription_count = fields.Integer(string='Subscriptions', + compute='_compute_subscription_count') + + @api.depends('product_count') + def _compute_product_count(self): + """ Calculate product count based on subscription plan """ + self.product_count = self.env['product.product'].search_count( + [('subscription_plan_id', '=', self.id)]) + + @api.depends('subscription_count') + def _compute_subscription_count(self): + """ Calculate subscription count based on subscription plan """ + self.subscription_count = self.env[ + 'subscription.package'].search_count([('plan_id', '=', self.id)]) + + @api.depends('renewal_value', 'renewal_period') + def _compute_renewal_time(self): + """ This method calculate renewal time based on renewal value """ + for rec in self: + if rec.renewal_period == 'days': + rec.renewal_time = int(rec.renewal_value) + elif rec.renewal_period == 'weeks': + rec.renewal_time = int(rec.renewal_value) * 7 + elif rec.renewal_period == 'months': + rec.renewal_time = int(rec.renewal_value) * 28 + elif rec.renewal_period == 'years': + rec.renewal_time = int(rec.renewal_value) * 364 + if rec.name: + rec.short_code = str(rec.name[0:3]).upper() + + @api.depends('renewal_time', 'limit_count') + def _compute_days_to_end(self): + """ This method calculate days to end for subscription plan based on + limit count """ + for rec in self: + if rec.limit_choice == 'ones': + rec.days_to_end = rec.renewal_time + if rec.limit_choice == 'manual': + rec.days_to_end = False + if rec.limit_choice == 'custom': + rec.days_to_end = rec.renewal_time * rec.limit_count + + def button_product_count(self): + """ It displays products based on subscription plan """ + return { + 'name': 'Products', + 'domain': [('subscription_plan_id', '=', self.id)], + 'view_type': 'form', + 'res_model': 'product.product', + 'view_mode': 'tree,form', + 'type': 'ir.actions.act_window', + } + + def button_sub_count(self): + """ It displays subscriptions based on subscription plan """ + return { + 'name': 'Subscriptions', + 'domain': [('plan_id', '=', self.id)], + 'view_type': 'form', + 'res_model': 'subscription.package', + 'view_mode': 'tree,form', + 'type': 'ir.actions.act_window', + } + + def name_get(self): + """ It displays record name as combination of short code and + plan name """ + res = [] + for rec in self: + res.append((rec.id, '%s - %s' % (rec.short_code, rec.name))) + return res diff --git a/subscription_package/models/subscription_products.py b/subscription_package/models/subscription_products.py new file mode 100644 index 000000000..1d3df8832 --- /dev/null +++ b/subscription_package/models/subscription_products.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from odoo import api, models, fields + + +class SubscriptionInvoice(models.Model): + _inherit = "account.move" + + is_subscription = fields.Boolean(string='Is Subscription', default=False) + subscription_id = fields.Many2one('subscription.package', + string='Subscription') + + @api.model_create_multi + def create(self, vals_list): + """ It displays subscription in account move """ + for rec in vals_list: + so_id = self.env['sale.order'].search( + [('name', '=', rec.get('invoice_origin'))]) + if so_id.is_subscription is True: + new_vals_list = [{'is_subscription': True, + 'subscription_id': so_id.subscription_id}] + vals_list[0].update(new_vals_list[0]) + return super(SubscriptionInvoice, self).create(vals_list) + + +class SubscriptionProduct(models.Model): + _inherit = "product.template" + + is_subscription = fields.Boolean(string='Is Subscription', default=False) + subscription_plan_id = fields.Many2one('subscription.package.plan', + string='Subscription Plan') diff --git a/subscription_package/models/subscription_renew.py b/subscription_package/models/subscription_renew.py new file mode 100644 index 000000000..899e21277 --- /dev/null +++ b/subscription_package/models/subscription_renew.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from odoo import api, models, fields +import datetime + + +class SubscriptionSaleOrder(models.Model): + _inherit = "sale.order" + + is_subscription = fields.Boolean(string='Is Subscription', default=False) + subscription_id = fields.Many2one('subscription.package', + string='Subscription') + sub_reference = fields.Char(string="Sub Reference Code", store=True, + compute="_compute_reference_code") + + @api.model + def create(self, vals): + """ It displays subscription in sale order """ + if vals.get('is_subscription') is True: + new_vals = [{ + 'is_subscription': True, + 'subscription_id': vals.get('subscription_id'), + }] + vals.update(new_vals[0]) + return super(SubscriptionSaleOrder, self).create(vals) + else: + return super(SubscriptionSaleOrder, self).create(vals) + + @api.depends('subscription_id') + def _compute_reference_code(self): + """ It displays subscription reference code """ + self.sub_reference = self.env['subscription.package'].search( + [('id', '=', int(self.subscription_id.id))]).reference_code + + def action_confirm(self): + """ It Changed the stage, to renew, start date for subscription + package based on sale order confirm """ + + res = super(SubscriptionSaleOrder, self).action_confirm() + sale_order = self.subscription_id.sale_order + so_state = self.search([('id', '=', sale_order.id)]).state + if so_state in ['sale', 'done']: + stage = self.env['subscription.package.stage'].search( + [('category', '=', 'progress')], limit=1).id + values = {'stage_id': stage, 'to_renew': False, + 'start_date': datetime.datetime.today()} + self.subscription_id.write(values) + return res diff --git a/subscription_package/models/subscription_stage.py b/subscription_package/models/subscription_stage.py new file mode 100644 index 000000000..8fa2e02c4 --- /dev/null +++ b/subscription_package/models/subscription_stage.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from odoo import models, fields + + +class SubscriptionPackageStage(models.Model): + _name = "subscription.package.stage" + _description = "Subscription Package Stages" + _rec_name = 'name' + + name = fields.Char(string='Stage Name', required=True) + sequence = fields.Integer('Sequence', help="Determine the display order", + index=True) + condition = fields.Text(string='Conditions') + fold = fields.Boolean(string='Folded in Kanban', + help="This stage is folded in the kanban view " + "when there are no records in that stage " + "to display.") + category = fields.Selection([('draft', 'Draft'), + ('progress', 'In Progress'), + ('closed', 'Closed')], + readonly=False, default='draft') diff --git a/subscription_package/report/__init__.py b/subscription_package/report/__init__.py new file mode 100644 index 000000000..d2cd434d0 --- /dev/null +++ b/subscription_package/report/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import subscription_report diff --git a/subscription_package/report/subscription_report.py b/subscription_package/report/subscription_report.py new file mode 100644 index 000000000..27ef19c96 --- /dev/null +++ b/subscription_package/report/subscription_report.py @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from odoo import models, fields +from odoo import tools + + +class SubscriptionReport(models.Model): + _name = "subscription.report" + _description = "Subscription Analysis" + _auto = False + + total_recurring_price = fields.Float('Recurring Price', readonly=True) + quantity = fields.Float('Quantity', readonly=True) + user_id = fields.Many2one('res.users', 'Salesperson', readonly=True) + plan_id = fields.Many2one('subscription.package.plan', 'Subscription Template', readonly=True) + + def _query(self): + select_ = """ + SELECT min(sl.id) as id, + sl.product_qty as quantity, + sub.total_recurring_price as total_recurring_price, + sub.user_id as user_id, + sub.plan_id as plan_id, + sub.name as name + """ + from_ = """ + subscription_package_product_line sl + join subscription_package sub on (sl.subscription_id = sub.id) + """ + groupby_ = """ + GROUP BY sl.product_qty, + sub.total_recurring_price, + sub.user_id, + sub.plan_id, + sub.name + """ + return '%s FROM ( %s ) %s' % (select_, from_, groupby_) + + def init(self): + tools.drop_view_if_exists(self.env.cr, self._table) + self.env.cr.execute("""CREATE or REPLACE VIEW %s as (%s)""" % ( + self._table, self._query())) diff --git a/subscription_package/report/subscription_report_view.xml b/subscription_package/report/subscription_report_view.xml new file mode 100644 index 000000000..c32147236 --- /dev/null +++ b/subscription_package/report/subscription_report_view.xml @@ -0,0 +1,37 @@ + + + + + Subscription Report Pivot + subscription.report + + + + + + + + + + Subscription Report Graph + subscription.report + + + + + + + + + Subscriptions Report + subscription.report + pivot,graph + + + + + \ No newline at end of file diff --git a/subscription_package/security/ir.model.access.csv b/subscription_package/security/ir.model.access.csv new file mode 100644 index 000000000..5539c213b --- /dev/null +++ b/subscription_package/security/ir.model.access.csv @@ -0,0 +1,9 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_subscription_package_plan,subscription.package_plan,model_subscription_package_plan,base.group_user,1,1,1,1 +access_subscription_package_stage,subscription.package.stage,model_subscription_package_stage,base.group_user,1,1,1,1 +access_subscription_package,subscription.package,model_subscription_package,base.group_user,1,1,1,1 +access_subscription_report,subscription.report,model_subscription_report,base.group_user,1,1,1,1 +access_subscription_package_product_line,subscription.package.product.line,model_subscription_package_product_line,base.group_user,1,1,1,1 +access_subscription_package_stop,subscription.package.stop,model_subscription_package_stop,base.group_user,1,1,1,1 +access_subscription_close_wizard,access.subscription.close.wizard,model_subscription_close_wizard,base.group_user,1,1,1,1 +access_recurrence_period,access.recurrence.period,model_recurrence_period,base.group_user,1,1,1,1 diff --git a/subscription_package/security/security.xml b/subscription_package/security/security.xml new file mode 100644 index 000000000..0e010a2ea --- /dev/null +++ b/subscription_package/security/security.xml @@ -0,0 +1,25 @@ + + + + + + Subscription + Helps you handle your subscription security. + 9 + + + + User + + + + + + Subscription Administrator + + + + + + + diff --git a/subscription_package/static/description/assets/icons/check.png b/subscription_package/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/subscription_package/static/description/assets/icons/check.png differ diff --git a/subscription_package/static/description/assets/icons/chevron.png b/subscription_package/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/subscription_package/static/description/assets/icons/chevron.png differ diff --git a/subscription_package/static/description/assets/icons/cogs.png b/subscription_package/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/subscription_package/static/description/assets/icons/cogs.png differ diff --git a/subscription_package/static/description/assets/icons/consultation.png b/subscription_package/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/subscription_package/static/description/assets/icons/consultation.png differ diff --git a/subscription_package/static/description/assets/icons/ecom-black.png b/subscription_package/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/subscription_package/static/description/assets/icons/ecom-black.png differ diff --git a/subscription_package/static/description/assets/icons/education-black.png b/subscription_package/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/subscription_package/static/description/assets/icons/education-black.png differ diff --git a/subscription_package/static/description/assets/icons/hotel-black.png b/subscription_package/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/subscription_package/static/description/assets/icons/hotel-black.png differ diff --git a/subscription_package/static/description/assets/icons/license.png b/subscription_package/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/subscription_package/static/description/assets/icons/license.png differ diff --git a/subscription_package/static/description/assets/icons/lifebuoy.png b/subscription_package/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/subscription_package/static/description/assets/icons/lifebuoy.png differ diff --git a/subscription_package/static/description/assets/icons/manufacturing-black.png b/subscription_package/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/subscription_package/static/description/assets/icons/manufacturing-black.png differ diff --git a/subscription_package/static/description/assets/icons/pos-black.png b/subscription_package/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/subscription_package/static/description/assets/icons/pos-black.png differ diff --git a/subscription_package/static/description/assets/icons/puzzle.png b/subscription_package/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/subscription_package/static/description/assets/icons/puzzle.png differ diff --git a/subscription_package/static/description/assets/icons/restaurant-black.png b/subscription_package/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/subscription_package/static/description/assets/icons/restaurant-black.png differ diff --git a/subscription_package/static/description/assets/icons/service-black.png b/subscription_package/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/subscription_package/static/description/assets/icons/service-black.png differ diff --git a/subscription_package/static/description/assets/icons/trading-black.png b/subscription_package/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/subscription_package/static/description/assets/icons/trading-black.png differ diff --git a/subscription_package/static/description/assets/icons/training.png b/subscription_package/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/subscription_package/static/description/assets/icons/training.png differ diff --git a/subscription_package/static/description/assets/icons/update.png b/subscription_package/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/subscription_package/static/description/assets/icons/update.png differ diff --git a/subscription_package/static/description/assets/icons/user.png b/subscription_package/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/subscription_package/static/description/assets/icons/user.png differ diff --git a/subscription_package/static/description/assets/icons/wrench.png b/subscription_package/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/subscription_package/static/description/assets/icons/wrench.png differ diff --git a/subscription_package/static/description/assets/misc/categories.png b/subscription_package/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/subscription_package/static/description/assets/misc/categories.png differ diff --git a/subscription_package/static/description/assets/misc/check-box.png b/subscription_package/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/subscription_package/static/description/assets/misc/check-box.png differ diff --git a/subscription_package/static/description/assets/misc/compass.png b/subscription_package/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/subscription_package/static/description/assets/misc/compass.png differ diff --git a/subscription_package/static/description/assets/misc/corporate.png b/subscription_package/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/subscription_package/static/description/assets/misc/corporate.png differ diff --git a/subscription_package/static/description/assets/misc/customer-support.png b/subscription_package/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/subscription_package/static/description/assets/misc/customer-support.png differ diff --git a/subscription_package/static/description/assets/misc/cybrosys-logo.png b/subscription_package/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/subscription_package/static/description/assets/misc/cybrosys-logo.png differ diff --git a/subscription_package/static/description/assets/misc/features.png b/subscription_package/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/subscription_package/static/description/assets/misc/features.png differ diff --git a/subscription_package/static/description/assets/misc/logo.png b/subscription_package/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/subscription_package/static/description/assets/misc/logo.png differ diff --git a/subscription_package/static/description/assets/misc/pictures.png b/subscription_package/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/subscription_package/static/description/assets/misc/pictures.png differ diff --git a/subscription_package/static/description/assets/misc/pie-chart.png b/subscription_package/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/subscription_package/static/description/assets/misc/pie-chart.png differ diff --git a/subscription_package/static/description/assets/misc/right-arrow.png b/subscription_package/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/subscription_package/static/description/assets/misc/right-arrow.png differ diff --git a/subscription_package/static/description/assets/misc/star.png b/subscription_package/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/subscription_package/static/description/assets/misc/star.png differ diff --git a/subscription_package/static/description/assets/misc/support.png b/subscription_package/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/subscription_package/static/description/assets/misc/support.png differ diff --git a/subscription_package/static/description/assets/misc/whatsapp.png b/subscription_package/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/subscription_package/static/description/assets/misc/whatsapp.png differ diff --git a/subscription_package/static/description/assets/modules/4.png b/subscription_package/static/description/assets/modules/4.png new file mode 100644 index 000000000..31ed46762 Binary files /dev/null and b/subscription_package/static/description/assets/modules/4.png differ diff --git a/subscription_package/static/description/assets/modules/5.png b/subscription_package/static/description/assets/modules/5.png new file mode 100644 index 000000000..038385e41 Binary files /dev/null and b/subscription_package/static/description/assets/modules/5.png differ diff --git a/subscription_package/static/description/assets/modules/6.png b/subscription_package/static/description/assets/modules/6.png new file mode 100644 index 000000000..655347837 Binary files /dev/null and b/subscription_package/static/description/assets/modules/6.png differ diff --git a/subscription_package/static/description/assets/screenshots/SUB1.png b/subscription_package/static/description/assets/screenshots/SUB1.png new file mode 100644 index 000000000..6558e695e Binary files /dev/null and b/subscription_package/static/description/assets/screenshots/SUB1.png differ diff --git a/subscription_package/static/description/assets/screenshots/SUB10.png b/subscription_package/static/description/assets/screenshots/SUB10.png new file mode 100644 index 000000000..c8c6aab41 Binary files /dev/null and b/subscription_package/static/description/assets/screenshots/SUB10.png differ diff --git a/subscription_package/static/description/assets/screenshots/SUB11.png b/subscription_package/static/description/assets/screenshots/SUB11.png new file mode 100644 index 000000000..367157e89 Binary files /dev/null and b/subscription_package/static/description/assets/screenshots/SUB11.png differ diff --git a/subscription_package/static/description/assets/screenshots/SUB12.png b/subscription_package/static/description/assets/screenshots/SUB12.png new file mode 100644 index 000000000..ad68c73d1 Binary files /dev/null and b/subscription_package/static/description/assets/screenshots/SUB12.png differ diff --git a/subscription_package/static/description/assets/screenshots/SUB13.png b/subscription_package/static/description/assets/screenshots/SUB13.png new file mode 100644 index 000000000..75e51478a Binary files /dev/null and b/subscription_package/static/description/assets/screenshots/SUB13.png differ diff --git a/subscription_package/static/description/assets/screenshots/SUB14.png b/subscription_package/static/description/assets/screenshots/SUB14.png new file mode 100644 index 000000000..de41a521b Binary files /dev/null and b/subscription_package/static/description/assets/screenshots/SUB14.png differ diff --git a/subscription_package/static/description/assets/screenshots/SUB2.png b/subscription_package/static/description/assets/screenshots/SUB2.png new file mode 100644 index 000000000..477a46bcb Binary files /dev/null and b/subscription_package/static/description/assets/screenshots/SUB2.png differ diff --git a/subscription_package/static/description/assets/screenshots/SUB3.png b/subscription_package/static/description/assets/screenshots/SUB3.png new file mode 100644 index 000000000..e0c619391 Binary files /dev/null and b/subscription_package/static/description/assets/screenshots/SUB3.png differ diff --git a/subscription_package/static/description/assets/screenshots/SUB4.png b/subscription_package/static/description/assets/screenshots/SUB4.png new file mode 100644 index 000000000..ee003448d Binary files /dev/null and b/subscription_package/static/description/assets/screenshots/SUB4.png differ diff --git a/subscription_package/static/description/assets/screenshots/SUB5.png b/subscription_package/static/description/assets/screenshots/SUB5.png new file mode 100644 index 000000000..0bd7f4fcc Binary files /dev/null and b/subscription_package/static/description/assets/screenshots/SUB5.png differ diff --git a/subscription_package/static/description/assets/screenshots/SUB6.png b/subscription_package/static/description/assets/screenshots/SUB6.png new file mode 100644 index 000000000..ef7b77860 Binary files /dev/null and b/subscription_package/static/description/assets/screenshots/SUB6.png differ diff --git a/subscription_package/static/description/assets/screenshots/SUB7.png b/subscription_package/static/description/assets/screenshots/SUB7.png new file mode 100644 index 000000000..e24d7ec0e Binary files /dev/null and b/subscription_package/static/description/assets/screenshots/SUB7.png differ diff --git a/subscription_package/static/description/assets/screenshots/SUB8.png b/subscription_package/static/description/assets/screenshots/SUB8.png new file mode 100644 index 000000000..2025fddf8 Binary files /dev/null and b/subscription_package/static/description/assets/screenshots/SUB8.png differ diff --git a/subscription_package/static/description/assets/screenshots/SUB9.png b/subscription_package/static/description/assets/screenshots/SUB9.png new file mode 100644 index 000000000..07c5ca91b Binary files /dev/null and b/subscription_package/static/description/assets/screenshots/SUB9.png differ diff --git a/subscription_package/static/description/assets/screenshots/hero.gif b/subscription_package/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..c601b65c1 Binary files /dev/null and b/subscription_package/static/description/assets/screenshots/hero.gif differ diff --git a/subscription_package/static/description/banner.png b/subscription_package/static/description/banner.png new file mode 100644 index 000000000..4a9e2bd5d Binary files /dev/null and b/subscription_package/static/description/banner.png differ diff --git a/subscription_package/static/description/icon.png b/subscription_package/static/description/icon.png new file mode 100644 index 000000000..e0cbf5034 Binary files /dev/null and b/subscription_package/static/description/icon.png differ diff --git a/subscription_package/static/description/index.html b/subscription_package/static/description/index.html new file mode 100644 index 000000000..88743dbb0 --- /dev/null +++ b/subscription_package/static/description/index.html @@ -0,0 +1,703 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+
+ +
+
+
+ +

+ Subscription Package

+

Print Subscription + Package + +

+ + + +
+
+
+ + +
+ + +
+
+ +
+

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
+ This module is used to generate subscription package. +
+
+ + + +
+
+ +
+

Features +

+
+
+
+
+ + Enterprise and Community compatible. +
+
+ + Available in Odoo 15.0 Community and Enterprise. +
+ + +
+
+ +
+ + Subscription Package Plan +
+
+
+ +
+ + Subscription Renewable +
+
+
+ +
+ + Automatic Subscription Closed +
+
+
+ +
+ + Renew Email Alerts +
+
+
+ +
+ + Create Subscription Plans +
+
+
+ +
+ + Recurring Invoices Daily/Weekly/Monthly/Yearly +
+
+
+ + + +
+
+ +
+

Screenshots +

+
+
+
+ +
+

Create Subscription + Plan. +

+

+

    +
  • First of all, You will create a Subscription Plan.
  • +
  • In Subscription Plan we have a Radio Button named 'Number of Occurrence',
    + - if we choose 'Ones', then this plan will expire according to 'Invoice on' time interval.
    + - if we choose 'Until Closed Manually', then this plan will expire only after clicking the button + 'Close + Subscription'.
    + - if we choose 'Custom', then this plan will expire according to 'Invoice on' time interval and + 'Renewal + Limit'. +
  • +
  • In Subscription Plan we have a Radio Button named 'Create Invoice',
  • + - If we choose 'Manually', then invoice creation is manually.
    + - If we choose 'Draft', then invoice creation is automatically.
    +
+

+ +
+ +
+

Create Subscription + Product +

+

+

    +
  • First of all, You will create a Product.
  • +
  • Here we have a CheckBox named 'Is Subscription', if we Enable the Checkbox, then the product is + subscription + product. +
  • +
  • Now we choose a Subscription Plan for the period.
  • +
+

+ +
+
+

Create Subscription + Customer +

+

+

    +
  • First of all, You will create a Customer.
  • +
  • Here we have a page 'Subscription' that show subscription product for customer.
  • +
+

+ + + +
+
+

Activity Types +

+ + +
+
+

Subscription Close + Reasons +

+ + +
+
+

Subscription Stages +

+ + +
+
+

Create Subscription + Stage +

+ + +
+
+
+

Recurrence Period +

+ + +
+
+

Create Recurrence Period +

+ + +
+
+

CSubscription Report +

+

+

    +
  • It shows report for subscription plans. +
  • +
+

+ +
+
+

+ Subscriptions to Renew +

+ + +
+ +
+

Create Subscription + Package with Sale Order +

+ + +
+
+

+

+

+

    +
  • To create a Subscription with source 'Create Sale Order', Create a Quotation of Sale Order with at + least + one + subscription type product in the order line. +
  • +
  • When we click on the 'Confirm' button on the 'Sale Quotation' then, automatically a subscription is + created + in 'In-progress' state. +
  • +
+

+ +
+ +
+ + + + +
+
+ +
+

Related + Products +

+
+
+
+ +
+
+ + + + +
+
+ +
+

Our Services +

+
+ +
+
+
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+ +
+ + + + + +
+
+ +
+

Our + Industries +

+
+ +
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+
+
+ + + + +
+
+ +
+

Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/subscription_package/views/mail_activity_views.xml b/subscription_package/views/mail_activity_views.xml new file mode 100644 index 000000000..1b7da4426 --- /dev/null +++ b/subscription_package/views/mail_activity_views.xml @@ -0,0 +1,18 @@ + + + + + Activity Types + mail.activity.type + tree,form + ['|', ('res_model', '=', False), ('res_model', '=', 'subscription.package')] + {'default_res_model': 'subscription.package'} + + + + + \ No newline at end of file diff --git a/subscription_package/views/recurrence_views.xml b/subscription_package/views/recurrence_views.xml new file mode 100644 index 000000000..11f5c93f2 --- /dev/null +++ b/subscription_package/views/recurrence_views.xml @@ -0,0 +1,54 @@ + + + + recurrence.period.tree + recurrence.period + + + + + + + + + + recurrence.period.form + recurrence.period + +
+ + + + + + + +
+
+
+ + + Recurrence Period + recurrence.period + list,form + + + + + + subscription.package.form.inherit + subscription.package + + + + + + + + + +
\ No newline at end of file diff --git a/subscription_package/views/res_partner.xml b/subscription_package/views/res_partner.xml new file mode 100644 index 000000000..8ee8b780b --- /dev/null +++ b/subscription_package/views/res_partner.xml @@ -0,0 +1,25 @@ + + + + + inherit.subscription.partner.form + res.partner + + + + + + + + + + + + + + + + + + + diff --git a/subscription_package/views/subscription_close.xml b/subscription_package/views/subscription_close.xml new file mode 100644 index 000000000..0c4e7c371 --- /dev/null +++ b/subscription_package/views/subscription_close.xml @@ -0,0 +1,27 @@ + + + + + Subscription Stop Reason + subscription.package.stop + tree + + + + Subscription Stop Reason Tree + subscription.package.stop + + + + + + + + + + + \ No newline at end of file diff --git a/subscription_package/views/subscription_package.xml b/subscription_package/views/subscription_package.xml new file mode 100644 index 000000000..5114d70d2 --- /dev/null +++ b/subscription_package/views/subscription_package.xml @@ -0,0 +1,271 @@ + + + + + + Reference Code + sequence.reference.code + SUB + 4 + + + + + Subscriptions + ir.actions.act_window + subscription.package + kanban,tree,form,pivot + +

+ Create a new subscription package ! +

+
+
+ + + Subscriptions Customers + ir.actions.act_window + res.partner + kanban,tree,form + [('active_subscription', '=', True)] + +

+ Create a new subscription package ! +

+
+
+ + + Subscriptions to Renew + ir.actions.act_window + subscription.package + [('to_renew', '=', True)] + kanban,tree,form,pivot + +

+ Create a new subscription package ! +

+
+
+ + + subscription.package.tree + subscription.package + + + + + + + + + + + + + subscription.package.form + subscription.package + + +
+
+ + +
+ +
+ + +
+
+

+ +

+
+ For Renewal +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+
+
+ + + + subscription.package.kanban + subscription.package + + + + + + + + + + +
+
+
+ +
+
+ +
+
+ To Renew +
+
+
+
+ +
+
+ +
+
+
+
+
+ + + + + + + + subscription.package.pivot + subscription.package + + + + + + + + + + + + + + + + + + diff --git a/subscription_package/views/subscription_plan.xml b/subscription_package/views/subscription_plan.xml new file mode 100644 index 000000000..004eb3539 --- /dev/null +++ b/subscription_package/views/subscription_plan.xml @@ -0,0 +1,109 @@ + + + + + Subscription Plan + ir.actions.act_window + subscription.package.plan + tree,form + +

+ Create a new subscription plan ! +

+
+
+ + + subscription.package.plan.tree + subscription.package.plan + + + + + + + + + + + + subscription.package.plan.form + subscription.package.plan + +
+ +
+ + +
+
+

+

+
+ + + + + + + + + + + + + + +
+
+
+
+ + + + + + +
diff --git a/subscription_package/views/subscription_products.xml b/subscription_package/views/subscription_products.xml new file mode 100644 index 000000000..93e645fc5 --- /dev/null +++ b/subscription_package/views/subscription_products.xml @@ -0,0 +1,86 @@ + + + + + Inherit Product Search + product.template + + 25 + + + + + + + + + + Inherit Product Product: Is Subscription Product + product.product + + 25 + + + + + + + + + + + + + + + + Inherit Product Template: Product Subscription + product.template + + 25 + + + + + + + + + + + + + + + + Products + ir.actions.act_window + product.template + kanban,tree,form,activity + + + { + 'search_default_filter_is_subscription': True, + 'search_default_filter_to_sell':1, + 'default_type':'service', + 'default_is_subscription':True} + +

+ Create a new product +

+
+
+ + + +
\ No newline at end of file diff --git a/subscription_package/views/subscription_renew.xml b/subscription_package/views/subscription_renew.xml new file mode 100644 index 000000000..4500e7688 --- /dev/null +++ b/subscription_package/views/subscription_renew.xml @@ -0,0 +1,21 @@ + + + + + sale.order.form.subscription.info + sale.order + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/subscription_package/views/subscription_stage.xml b/subscription_package/views/subscription_stage.xml new file mode 100644 index 000000000..73c7ffc5d --- /dev/null +++ b/subscription_package/views/subscription_stage.xml @@ -0,0 +1,51 @@ + + + + + Stages + subscription.package.stage + tree,form + + + + Subscription Stage Tree + subscription.package.stage + + + + + + + + + + Subscription Stage Form + subscription.package.stage + +
+ + + + + + + + + + + + + + +
+
+
+ + + +
\ No newline at end of file diff --git a/subscription_package/wizard/__init__.py b/subscription_package/wizard/__init__.py new file mode 100644 index 000000000..02b1d18ed --- /dev/null +++ b/subscription_package/wizard/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import subscription_close_wizard diff --git a/subscription_package/wizard/subscription_close_wizard.py b/subscription_package/wizard/subscription_close_wizard.py new file mode 100644 index 000000000..6bcd396c5 --- /dev/null +++ b/subscription_package/wizard/subscription_close_wizard.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from odoo import models, fields, api + + +class SubscriptionCloseWizard(models.TransientModel): + _name = 'subscription.close.wizard' + _description = 'Subscription Close Wizard' + + close_reason = fields.Many2one('subscription.package.stop', string='Close Reason') + closed_by = fields.Many2one('res.users', string='Closed By', default=lambda self: self.env.user) + close_date = fields.Date(string='Closed On', default=lambda self: fields.Date.today()) + + def button_submit(self): + self.ensure_one() + this_sub_id = self.env.context.get('active_id') + sub = self.env['subscription.package'].search([('id', '=', this_sub_id)]) + sub.is_closed = True + sub.close_reason = self.close_reason + sub.closed_by = self.closed_by + sub.close_date = self.close_date + stage = (self.env['subscription.package.stage'].search([ + ('category', '=', 'closed')]).id) + values = {'stage_id': stage, 'to_renew': False} + sub.write(values) diff --git a/subscription_package/wizard/subscription_close_wizard.xml b/subscription_package/wizard/subscription_close_wizard.xml new file mode 100644 index 000000000..787d36a15 --- /dev/null +++ b/subscription_package/wizard/subscription_close_wizard.xml @@ -0,0 +1,23 @@ + + + + + subscription.close.wizard.view + subscription.close.wizard + +
+ + + + + + +
+
+
+ +
\ No newline at end of file