diff --git a/agriculture_management_odoo/README.rst b/agriculture_management_odoo/README.rst index 9e898ef47..f5bef64de 100644 --- a/agriculture_management_odoo/README.rst +++ b/agriculture_management_odoo/README.rst @@ -1,6 +1,11 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3) + Agriculture Management ====================== -App for managing the Agriculture cultivation +In the Agriculture Management App, We can manage the agriculture to our own need. +We can also manage the rentals of vehicle and animals for agriculture purpose. Configuration ============= @@ -10,9 +15,16 @@ Company ------- * `Cybrosys Techno Solutions `__ +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + Credits ------- -* Developer: VYSHNAV AR @cybrosys +* Developers: (V15) Vyshnav AR, +* Contact : odoo@cybrosys.com + Contacts -------- @@ -35,5 +47,3 @@ For support and more information, please visit `Our Website `__ - - diff --git a/agriculture_management_odoo/__init__.py b/agriculture_management_odoo/__init__.py index ca12c8644..a4f7f6082 100644 --- a/agriculture_management_odoo/__init__.py +++ b/agriculture_management_odoo/__init__.py @@ -3,8 +3,8 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2022-TODAY Cybrosys Technologies() -# Author: Cybrosys Techno Solutions() +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vyshnav AR() # # You can modify it under the terms of the GNU LESSER # GENERAL PUBLIC LICENSE (LGPL v3), Version 3. @@ -21,4 +21,3 @@ ############################################################################# from . import models from . import wizard - diff --git a/agriculture_management_odoo/__manifest__.py b/agriculture_management_odoo/__manifest__.py index c9998cda5..9376d7e03 100644 --- a/agriculture_management_odoo/__manifest__.py +++ b/agriculture_management_odoo/__manifest__.py @@ -3,8 +3,8 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2022-TODAY Cybrosys Technologies() -# Author: Cybrosys Techno Solutions() +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vyshnav AR() # # You can modify it under the terms of the GNU LESSER # GENERAL PUBLIC LICENSE (LGPL v3), Version 3. @@ -20,51 +20,51 @@ # ############################################################################# { - 'name': 'Agriculture Management In Odoo', + 'name': 'Agriculture Management', 'version': '15.0.2.0.0', - 'summary': 'Agriculture Management In Odoo', - 'description': """Agriculture Management In Odoo""", - 'category': 'Productivity', - 'website': 'https://www.cybrosys.com', + 'category': 'Industries', + 'summary': """Agriculture And Farming Management In Odoo""", + 'description': """ Agriculture And Farming Management In Odoo""", 'author': 'Cybrosys Techno Solutions', 'company': 'Cybrosys Techno Solutions', 'maintainer': 'Cybrosys Techno Solutions', - 'license': 'LGPL-3', - 'depends': [ - 'base', - 'fleet', - ], + 'website': 'https://www.cybrosys.com', + 'depends': ['base', 'fleet', 'account'], 'data': [ - 'security/user_groups.xml', + 'security/agriculture_management_groups.xml', + 'security/crop_request_security.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', - 'report/crop_animal.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', + 'data/ir_sequence_data.xml', + 'report/crop_request_reports.xml', + 'report/pest_request_reports.xml', + 'report/crop_request_templates.xml', + 'report/pest_request_templates.xml', + 'report/crop_vehicle_templates.xml', + 'report/crop_animal_templates.xml', + 'report/crop_animal_reports.xml', + 'wizard/crop_report_views.xml', + 'wizard/pest_report_views.xml', + 'wizard/animal_register_payment_views.xml', + 'wizard/vehicle_register_payment_views.xml', + 'views/seed_detail_views.xml', + 'views/animal_detail_views.xml', + 'views/location_detail_views.xml', + 'views/vehicle_detail_views.xml', + 'views/fleet_vehicle_views.xml', + 'views/farmer_detail_views.xml', + 'views/pest_request_views.xml', + 'views/pest_detail_views.xml', + 'views/damage_loss_views.xml', + 'views/crop_request_views.xml', + 'views/agriculture_tag_views.xml', 'views/vehicle_rental_views.xml', 'views/animal_rental_views.xml', + 'report/crop_vehicle_reports.xml', + 'views/agriculture_management_menus.xml', ], 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', 'installable': True, - 'application': True, 'auto_install': False, + 'application': True, } diff --git a/agriculture_management_odoo/data/data_sequence.xml b/agriculture_management_odoo/data/data_sequence.xml deleted file mode 100644 index 9ea064027..000000000 --- a/agriculture_management_odoo/data/data_sequence.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - 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/data/ir_sequence_data.xml b/agriculture_management_odoo/data/ir_sequence_data.xml new file mode 100644 index 000000000..7f2a51f3f --- /dev/null +++ b/agriculture_management_odoo/data/ir_sequence_data.xml @@ -0,0 +1,35 @@ + + + + + Pest Request + pest.request + PEST/REQ/ + 5 + + + + + Crop Request + crop.request + CROP/REQ/ + 5 + + + + + Animal Rental + animal.rental + ANIMAL/RENTAL/ + 5 + + + + + Vehicle Rental + vehicle.rental + VEHICLE/RENTAL/ + 5 + + + diff --git a/agriculture_management_odoo/doc/RELEASE_NOTES.md b/agriculture_management_odoo/doc/RELEASE_NOTES.md index ed72f5bb1..4795c53e5 100644 --- a/agriculture_management_odoo/doc/RELEASE_NOTES.md +++ b/agriculture_management_odoo/doc/RELEASE_NOTES.md @@ -3,10 +3,8 @@ #### 10.11.2022 #### Version 15.0.1.0.0 #### ADD -- Initial commit for agriculture_management_odoo - -#### 10.11.2022 +- Initial commit for Agriculture Management +#### 08.01.2024 #### Version 15.0.2.0.0 -#### UPDT -- Updated - + #### UPDT +- Added the feature of payment for rentals of vehicle and animals, and added the feature of payment with invoice for buying pesticides. diff --git a/agriculture_management_odoo/models/__init__.py b/agriculture_management_odoo/models/__init__.py index 7ac9f8db2..f276a722d 100644 --- a/agriculture_management_odoo/models/__init__.py +++ b/agriculture_management_odoo/models/__init__.py @@ -3,8 +3,8 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2022-TODAY Cybrosys Technologies() -# Author: Cybrosys Techno Solutions() +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vyshnav AR() # # You can modify it under the terms of the GNU LESSER # GENERAL PUBLIC LICENSE (LGPL v3), Version 3. @@ -19,16 +19,18 @@ # 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 animal_detail +from . import animal_rental +from . import agriculture_tag +from . import crop_animal +from . import crop_machinery +from . import crop_request from . import damage_loss -from . import tag_details +from . import farmer_detail +from . import fleet_vehicle +from . import location_detail +from . import pest_detail +from . import pest_request +from . import seed_detail +from . import vehicle_detail from . import vehicle_rental -from . import animal_rental diff --git a/agriculture_management_odoo/models/agriculture_tag.py b/agriculture_management_odoo/models/agriculture_tag.py new file mode 100644 index 000000000..5339c93bf --- /dev/null +++ b/agriculture_management_odoo/models/agriculture_tag.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vyshnav AR() +# +# 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 +from random import randint + + +class AgricultureTag(models.Model): + """ This model represents tags related to agriculture. Tags are used to + categorize and label various agricultural elements, products. + They facilitate the organization and grouping of agricultural information + for easier searching and classification. """ + _name = "agriculture.tag" + _description = "Agriculture Tags" + + def _get_default_color(self): + """ The function selects colors for tags, likely based on some + criteria or input, facilitating visual differentiation and + categorization.""" + return randint(1, 11) + + name = fields.Char(string='Tag Name', required=True, translate=True, + help='Tags are helpful for easy identification. Please ' + 'create appropriate tags.') + color = fields.Integer(string='Color', default=_get_default_color, + help='Color are helpful for Highlight tags . Please' + 'choose different colors for differed tags') + + _sql_constraints = [ + # Partial constraint, complemented by unique tag and name. + # useful to keep because it provides a proper error message when a + # violation occurs + ('name_uniq', 'unique (name)', "Tag name already exists !"), + ] diff --git a/agriculture_management_odoo/models/animal_detail.py b/agriculture_management_odoo/models/animal_detail.py new file mode 100644 index 000000000..0ac729941 --- /dev/null +++ b/agriculture_management_odoo/models/animal_detail.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vyshnav AR() +# +# 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 AnimalDetail(models.Model): + """This model represents comprehensive details about animals involved + in agricultural management. It provides a structured way to store + information related to various animal breeds and their attributes.""" + _name = 'animal.detail' + _inherit = ['mail.thread', 'mail.activity.mixin'] + _description = "Animal Details" + _rec_name = 'breed' + + image = fields.Binary(help='Upload images of animals', + tracking=True) + breed = fields.Char(string='Breed', help='Mention the breed of animal', + required=True, tracking=True) + age = fields.Char(string='Age', help='Mention the age of animal', + required=True, tracking=True) + state = fields.Selection( + [('available', 'Available'), ('not_available', 'Not Available')], + default="available", help='The status whether this animal, whether it ' + 'is available or not', + string='Status', required=True, tracking=True) + note = fields.Text(string='Note', tracking=True, + help='If any notes or description about the animal', + placeholder='Note') + company_id = fields.Many2one( + 'res.company', string='Company', required=True, + readonly=True, help='This field represents the company associated with ' + 'the current user or environment.', + default=lambda self: self.env.company) + + def action_not_available(self): + """Function for change state to not available""" + self.state = 'not_available' + + def action_available(self): + """Function for change state to available""" + self.state = 'available' diff --git a/agriculture_management_odoo/models/animal_details.py b/agriculture_management_odoo/models/animal_details.py deleted file mode 100644 index 3cd4f203d..000000000 --- a/agriculture_management_odoo/models/animal_details.py +++ /dev/null @@ -1,49 +0,0 @@ -# -*- 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 index 30f580951..265ac7f34 100644 --- a/agriculture_management_odoo/models/animal_rental.py +++ b/agriculture_management_odoo/models/animal_rental.py @@ -3,8 +3,8 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2022-TODAY Cybrosys Technologies() -# Author: Cybrosys Techno Solutions() +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vyshnav AR() # # You can modify it under the terms of the GNU LESSER # GENERAL PUBLIC LICENSE (LGPL v3), Version 3. @@ -19,26 +19,123 @@ # If not, see . # ############################################################################# -'''Model for Renting the Animals''' -from odoo import models, fields, api +from odoo import api, fields, models, _ +from odoo.exceptions import ValidationError class AnimalRental(models.Model): + """ This model represents details about animal rental in the context of + crop requests. It provides a structured way to manage information related to + the rental of animals for agricultural purposes. """ _name = 'animal.rental' _inherit = ['mail.thread', 'mail.activity.mixin'] _description = 'Animal Rental' _rec_name = 'animal_id' - animal_id = fields.Many2one('animal.details', string='Animal', + name = fields.Char(string='Reference', readonly=True, + default=lambda self: _('New'), copy=False, + help='Field for the sequence of renting entries of ' + 'animals') + farmer_id = fields.Many2one('farmer.detail', string='Farmer', + help='Select the farmer who needs 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) + animal_id = fields.Many2one('animal.detail', string='Animal', + help="Select the animal for renting", + required=True, tracking=True) + no_of_days = fields.Float(string='No of Days', tracking=True, store=True, + help="The number of days we want to rent that" + " animal.", compute='_compute_no_of_days') + start_date = fields.Date(string='Start Date', required=True, tracking=True, + help="Start date of rental period") + company_id = fields.Many2one('res.company', string='Company', + required=True, readonly=True, + default=lambda self: self.env.company, + help='This field represents the company ' + 'associated with the current user or ' + 'environment.') + currency_id = fields.Many2one(related='company_id.currency_id', + string='Currency', help='Currency of company') + amount = fields.Monetary(string='Amount', help="Rental amount per day", + required=True) + total_amount = fields.Monetary(string='Total Amount', + help="Total rental amount", + compute='_compute_total_amount', + currency_field='currency_id') + end_date = fields.Date(string='End Date', help="End date of rental period", + required=True, tracking=True) + note = fields.Text(string='Description', tracking=True, + help="Description for renting animal", + placeholder='Note') + state = fields.Selection( + [('draft', 'Draft'), ('confirm', 'Confirmed'), ('return', 'Returned'), + ('paid', 'Paid'), ('cancel', 'Cancel')], string='Status', + default='draft', tracking=True, copy=False, + help="Status of renting the animal, Which is th status of the animal " + "rented?") + animal_paid_bool = fields.Boolean(string='Paid Bool', default=False, + copy=False) + + @api.model + def create(self, values): + """Function for creating new animal rental""" + if values.get('name', _('New')) == _('New'): + values['name'] = self.env['ir.sequence'].next_by_code( + 'animal.rental') or _('New') + return super(AnimalRental, self).create(values) + + @api.constrains('start_date', 'end_date') + def _check_dates(self): + for record in self: + if record.start_date and record.end_date: + if record.end_date < record.start_date: + raise ValidationError( + "End date cannot be before start date!") + + @api.depends('no_of_days', 'amount') + def _compute_total_amount(self): + """ Function for compute total amount """ + for record in self: + record.total_amount = record.no_of_days * record.amount @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 + def _compute_no_of_days(self): + """Function for computing rental period based on start date and end + date""" + for record in self: + if record.start_date and record.end_date: + record.no_of_days = (record.end_date - record.start_date).days + + def action_draft(self): + """ Function for change state of animal rental to draft """ + self.state = 'draft' + + def action_confirm(self): + """ Function for change state of crop request to confirm """ + self.state = 'confirm' + + def action_return(self): + """ Function for change state of crop request to cancel """ + self.state = 'return' + + def action_cancel(self): + """ Function for change state of crop request to cancel """ + self.state = 'cancel' + + def action_register_payment(self): + """Method for viewing the wizard for register payment""" + view_id = self.env.ref( + 'agriculture_management_odoo.animal_register_payment_wizard_view_form').id + return { + 'name': 'Register Payment', + 'type': 'ir.actions.act_window', + 'view_mode': 'form', + 'res_model': 'animal.register.payment.wizard', + 'views': [(view_id, 'form')], + 'context': { + 'default_farmer_id': self.farmer_id.id, + 'default_rental_duration': self.no_of_days, + 'default_amount': self.total_amount, + 'default_ref': self.name + }, + 'target': 'new', + } diff --git a/agriculture_management_odoo/models/crop_animal.py b/agriculture_management_odoo/models/crop_animal.py new file mode 100644 index 000000000..5bc7815d7 --- /dev/null +++ b/agriculture_management_odoo/models/crop_animal.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vyshnav AR() +# +# 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 CropAnimal(models.Model): + """ This model serves as a bridge to attach animal details to crop + request records. It provides a structured way to associate animal-related + information with specific crop requests.""" + _name = 'crop.animal' + _description = 'Crop Animal Details' + + crop_request_id = fields.Many2one('crop.request', string='Crop', + help='Select the crop id for this animal to be ' + 'used') + animal_id = fields.Many2one('animal.detail', string='Animal', + help="select animal used for this farming", + domain=[('state', '=', 'available')], + tracking=True) + qty = fields.Integer(string='Quantity', + help=" Number of animals used for farming") + company_id = fields.Many2one( + 'res.company', string='Company', required=True, + readonly=True, help='This field represents the company associated with ' + 'the current user or environment.', + default=lambda self: self.env.company) diff --git a/agriculture_management_odoo/models/crop_machinery.py b/agriculture_management_odoo/models/crop_machinery.py new file mode 100644 index 000000000..77cb58712 --- /dev/null +++ b/agriculture_management_odoo/models/crop_machinery.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vyshnav AR() +# +# 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 CropMachinery(models.Model): + """ This model serves as a bridge to attach machinery details to crop + request records. It provides a structured way to associate machinery-related + information with specific crop requests.""" + _name = 'crop.machinery' + _description = 'Crop Machinery Details' + + crop_request_id = fields.Many2one('crop.request', string='Crop id', + help="The crop id should be used to identify the " + "machinery is used which crop farming") + vehicle_id = fields.Many2one('vehicle.detail', + help="The vehicle that used for farming", + tracking=True, string='Vehicle', ) + qty = fields.Integer(string='Quantity', + help="The Number of the vehicle that used for farming") + company_id = fields.Many2one( + 'res.company', string='Company', required=True, + readonly=True, help='This field represents the company associated with' + ' the current user or environment.', + default=lambda self: self.env.company) diff --git a/agriculture_management_odoo/models/crop_request.py b/agriculture_management_odoo/models/crop_request.py new file mode 100644 index 000000000..27f72b4cc --- /dev/null +++ b/agriculture_management_odoo/models/crop_request.py @@ -0,0 +1,134 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vyshnav AR() +# +# 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, fields, models, _ + + +class CropRequest(models.Model): + """ This model represents the creation of crop requests. It provides a + structured way to initiate and manage requests for crop cultivation tasks, + including associating animals, machinery, and other relevant details.""" + _name = 'crop.request' + _inherit = ["mail.thread", 'mail.activity.mixin'] + _description = "Crop Request" + _rec_name = 'ref' + + ref = fields.Char(string='Reference', help="Reference id of crop requests", + copy=False, readonly=True, tracking=True, + default=lambda self: _('New')) + company_id = fields.Many2one( + 'res.company', string='Company', required=True, + readonly=True, help='The company associated with the current user or ' + 'environment.', + default=lambda self: self.env.company) + farmer_id = fields.Many2one('farmer.detail', string='Farmer', + help="Choose the farmer for the crop", + required=True, tracking=True) + seed_id = fields.Many2one('seed.detail', string='Crop', + help=" Select the seed details", + required=True, tracking=True) + location_id = fields.Many2one('location.detail', + string='Location', required=True, + help="Mention the Location details for " + "farming", tracking=True) + request_date = fields.Date(string='Request Date', tracking=True, + help="The Requested Date for crop", + default=fields.Date.context_today, required=True) + state = fields.Selection( + [('draft', 'Draft'), ('confirm', 'Confirmed'), + ('ploughing', 'Ploughing'), ('sowing', 'Sowing'), + ('manuring', 'Manuring'), ('irrigation', 'Irrigation'), + ('weeding', 'Weeding'), ('harvest', 'Harvest'), ('storage', 'Storage'), + ('cancel', 'Cancel')], group_expand='_group_expand_states', + string='Status', default='draft', tracking=True, + help="Mention the Status of crop, which stage now the crop is reached") + note = fields.Text(string='Note', tracking=True, + help="Description about crop and farming need to " + "remember", placeholder='Note') + machinery_ids = fields.One2many('crop.machinery', + 'crop_request_id', string='Machinery', + tracking=True, help="The machinery required" + "for this farming") + animal_ids = fields.One2many('crop.animal', + 'crop_request_id', string='Animals', + tracking=True, + help="Animals used for this crop farming") + tag_ids = fields.Many2many('agriculture.tag', string='Tags', + tracking=True, help="Create appropriate" + " tags for the crop ") + user_id = fields.Many2one('res.users', + string='Responsible User', + help="Mention the user of the documents", + default=lambda self: self.env.user) + + @api.model + def create(self, values): + """Function for creating new crop requests""" + if values.get('ref', _('New')) == _('New'): + values['ref'] = self.env['ir.sequence'].next_by_code( + 'crop.request') or _('New') + return super(CropRequest, self).create(values) + + def action_draft(self): + """ Function for change state of crop request to draft """ + self.state = 'draft' + + def action_confirm(self): + """ Function for change state of crop request to confirm """ + self.state = 'confirm' + + def action_ploughing(self): + """ Function for change state of crop request to ploughing """ + self.state = 'ploughing' + + def action_sowing(self): + """ Function for change state of crop request to sowing """ + self.state = 'sowing' + + def action_manuring(self): + """ Function for change state of crop request to manuring """ + self.state = 'manuring' + + def action_irrigation(self): + """ Function for change state of crop request to irrigation """ + self.state = 'irrigation' + + def action_weeding(self): + """ Function for change state of crop request to weeding """ + self.state = 'weeding' + + def action_harvest(self): + """ Function for change state of crop request to harvest """ + self.state = 'harvest' + + def action_cancel(self): + """ Function for change state of crop request to cancel """ + self.state = 'cancel' + + def action_storage(self): + """ Function for change state of crop request to storage """ + self.state = 'storage' + + def _group_expand_states(self, states, domain, order): + """This function takes a list of states and expands them based on the + given domain and order.""" + return [key for + key, val in type(self).state.selection] diff --git a/agriculture_management_odoo/models/crop_requests.py b/agriculture_management_odoo/models/crop_requests.py deleted file mode 100644 index 086c59a25..000000000 --- a/agriculture_management_odoo/models/crop_requests.py +++ /dev/null @@ -1,123 +0,0 @@ -# -*- 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', - domain=[('state', '=', 'available')], - 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 index b377c419c..7b27d905f 100644 --- a/agriculture_management_odoo/models/damage_loss.py +++ b/agriculture_management_odoo/models/damage_loss.py @@ -3,8 +3,8 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2022-TODAY Cybrosys Technologies() -# Author: Cybrosys Techno Solutions() +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vyshnav AR() # # You can modify it under the terms of the GNU LESSER # GENERAL PUBLIC LICENSE (LGPL v3), Version 3. @@ -19,25 +19,46 @@ # If not, see . # ############################################################################# -from odoo import models, fields +from odoo import fields, models -class DamageLossDetails(models.Model): +class DamageLoss(models.Model): + """This model represents details about damage and loss incidents. + It provides a structured way to record information related to damages and + losses incurred in the context of agricultural activities or other domains. + """ _name = 'damage.loss' + _description = 'Damage Loss Details' _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) + name = fields.Char(string='Name', help="Reason for damage or loss of crop ", + required=True, tracking=True) + farmer_id = fields.Many2one('farmer.detail', + help=" Mention the corresponding Farmer", + string='Farmer', required=True, tracking=True) + crop_id = fields.Many2one('crop.request', + help="Mention the corresponding crop", + string='Crop', required=True, tracking=True) + location_id = fields.Many2one('location.detail', tracking=True, + string='Location', help="The location of the " + "damage or loss takes place", + required=True) + damage_loss_type = fields.Selection([('damage', 'Damage'), + ('loss', 'Loss')], + string='Damage/Loss Type', + help="Mention the damage or lass type", + required=True, tracking=True) damage_loss_date = fields.Date(string='Damage/Loss Date', + help="The date in which damage occurs", 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) + note = fields.Text(string='Damage/Loss Description', tracking=True, + help="Describe the details of damage/loss", + placeholder='Note') + image = fields.Binary(tracking=True, + help="Upload some images of damage/loss") + company_id = fields.Many2one( + 'res.company', string='Company', required=True, + readonly=True, help='The company associated with the current user or ' + 'environment.', + default=lambda self: self.env.company) diff --git a/agriculture_management_odoo/models/farmer_detail.py b/agriculture_management_odoo/models/farmer_detail.py new file mode 100644 index 000000000..a94483490 --- /dev/null +++ b/agriculture_management_odoo/models/farmer_detail.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vyshnav AR() +# +# 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, fields, models + + +class FarmerDetail(models.Model): + """This model represents comprehensive details about farmers within the + context of agriculture management. It provides a structured way to store + information related to individual farmers, including their personal and + contact details. """ + _name = 'farmer.detail' + _inherit = ["mail.thread", 'mail.activity.mixin'] + _description = 'Farmer' + _rec_name = 'farmer_id' + + farmer_id = fields.Many2one('res.partner', string='Farmer', + help=' Select the corresponding farmer', + required=True, tracking=True) + farmer_image = fields.Binary(string='Image', copy=False, + help='Upload image of Farmer') + note = fields.Text(string='Notes', tracking=True, + help="Description regarding the farmer", + placeholder='Note') + company_id = fields.Many2one( + 'res.company', string='Company', required=True, + readonly=True, help='The company associated with the current user or ' + 'environment.', + default=lambda self: self.env.company) + + @api.onchange('farmer_id') + def _onchange_farmer_id(self): + """Function for select image of farmer automatically when choosing + the farmer""" + for record in self: + if record.farmer_id: + record.farmer_image = record.farmer_id.image_1920 diff --git a/agriculture_management_odoo/models/farmer_details.py b/agriculture_management_odoo/models/farmer_details.py deleted file mode 100644 index 465997dc9..000000000 --- a/agriculture_management_odoo/models/farmer_details.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- 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_vehicle.py similarity index 62% rename from agriculture_management_odoo/models/fleet_inherit.py rename to agriculture_management_odoo/models/fleet_vehicle.py index 7e1aa3104..bb8690a63 100644 --- a/agriculture_management_odoo/models/fleet_inherit.py +++ b/agriculture_management_odoo/models/fleet_vehicle.py @@ -3,8 +3,8 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2022-TODAY Cybrosys Technologies() -# Author: Cybrosys Techno Solutions() +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vyshnav AR() # # You can modify it under the terms of the GNU LESSER # GENERAL PUBLIC LICENSE (LGPL v3), Version 3. @@ -19,12 +19,16 @@ # If not, see . # ############################################################################# -'''Inheriting the Fleet Module To Get Vehicles''' from odoo import fields, models -class Fleet(models.Model): +class FleetVehicle(models.Model): + """ This model inherits from the 'fleet.vehicle' model to extend and + utilize the existing functionality for managing vehicle details. It provides + a structured way to access and utilize vehicle information within a fleet + management context.""" _inherit = "fleet.vehicle" registration_date = fields.Date(string="Registration Date", - default=fields.Date.today) + default=fields.Date.today, + help="The Registration date of the vehicle") diff --git a/agriculture_management_odoo/models/location_detail.py b/agriculture_management_odoo/models/location_detail.py new file mode 100644 index 000000000..d28949022 --- /dev/null +++ b/agriculture_management_odoo/models/location_detail.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vyshnav AR() +# +# 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 LocationDetail(models.Model): + """This model represents comprehensive details about locations within + the context of agriculture. It provides a structured way to store + information related to various geographic locations, such as farms, fields, + or storage areas. """ + _name = 'location.detail' + _inherit = ['mail.thread', 'mail.activity.mixin'] + _description = "Location Details" + _rec_name = 'location_name' + + location_name = fields.Char(string='Location Name', required=True, + help='Give the name of Location where' + ' farming done', tracking=True) + location_address = fields.Char(string='Location Address', required=True, + help='Give the full address of the location', + tracking=True) + location_area = fields.Float(string='Location Area', required=True, + help='The area of location', tracking=True) + location_area_unit = fields.Selection([('acres', 'Acres'), + ('hectares', 'Hectares')], + string='Area Unit', tracking=True, + required=True, + help='Mention the units of area') + location_type = fields.Selection([('plot', 'Plot'), + ('field', 'Field')], default="plot", + required=True, tracking=True, + help='Describe the type of farming area', + string='Location Type') + note = fields.Text(string='Note', tracking=True, + help='If any description for the location, mention here', + placeholder='Note') + company_id = fields.Many2one( + 'res.company', string='Company', required=True, + readonly=True, help='The company associated with the current user or ' + 'environment.', + default=lambda self: self.env.company) diff --git a/agriculture_management_odoo/models/location_details.py b/agriculture_management_odoo/models/location_details.py deleted file mode 100644 index 16cc33f15..000000000 --- a/agriculture_management_odoo/models/location_details.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- 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_detail.py b/agriculture_management_odoo/models/pest_detail.py new file mode 100644 index 000000000..2657a6d10 --- /dev/null +++ b/agriculture_management_odoo/models/pest_detail.py @@ -0,0 +1,65 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vyshnav AR() +# +# 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, fields, models + + +class PestDetail(models.Model): + """ This model represents comprehensive details about pests within the + context of agriculture management. """ + _name = 'pest.detail' + _inherit = ["mail.thread", 'mail.activity.mixin'] + _description = 'Pest Details' + _rec_name = 'pest_name' + + pest_name = fields.Char(string='Pesticide', tracking=True, + help="Mention the pesticide name", required=True) + pest_expiry_date = fields.Date(string='Expiry Date', + help=" Mention the pesticide expiry date", + required=True, tracking=True) + pest_description = fields.Text(string='Pest Description', tracking=True, + help="Brief description about the pesticide") + pest_image = fields.Binary(string='Image', tracking=True, + help="Upload the image of pesticide") + pest_cost = fields.Float(string='Cost', help="The cost of the pesticide", + required=True, tracking=True) + pest_quantity = fields.Integer(string='Quantity', + help="The quantity of pesticide purchased", + required=True, tracking=True) + total_cost = fields.Float(string='Total Cost', tracking=True, + help="The total cost of pesticide", + compute='_compute_total_cost', store=True) + company_id = fields.Many2one( + 'res.company', string='Company', required=True, + readonly=True, help='The company associated with the current user or ' + 'environment.', + default=lambda self: self.env.company) + currency_id = fields.Many2one('res.currency', + help="Currency of company", 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): + """Function for calculate total cost of pesticide """ + for record in self: + record.total_cost = record.pest_cost * record.pest_quantity diff --git a/agriculture_management_odoo/models/pest_details.py b/agriculture_management_odoo/models/pest_details.py deleted file mode 100644 index fcff0c34b..000000000 --- a/agriculture_management_odoo/models/pest_details.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- 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 index f35f5b803..0a7ce6280 100644 --- a/agriculture_management_odoo/models/pest_request.py +++ b/agriculture_management_odoo/models/pest_request.py @@ -3,8 +3,8 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2022-TODAY Cybrosys Technologies() -# Author: Cybrosys Techno Solutions() +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vyshnav AR() # # You can modify it under the terms of the GNU LESSER # GENERAL PUBLIC LICENSE (LGPL v3), Version 3. @@ -19,67 +19,118 @@ # If not, see . # ############################################################################# -from odoo import models, fields, api, _ +from odoo import api, fields, models, _ -class PestRequests(models.Model): +class PestRequest(models.Model): + """ This model represents requests related to pest management within the + context of agriculture. It provides a structured way to initiate and manage + requests for pest control measures, treatments, and interventions.""" _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, + reference = fields.Char(string='Reference', help='Mention the details of ' + 'pesticide request', + 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, + request_date = fields.Date(string='Request Date', tracking=True, + help='The date the pesticide request was sent.', + default=fields.Date.context_today, required=True) + farmer_id = fields.Many2one('farmer.detail', string='Farmer', + help='Mention the corresponding farmer that ' + 'request send', 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, + crop_id = fields.Many2one('crop.request', string='Crop', + help='Mention the corresponding crop the ' + 'pesticide needed', required=True, tracking=True) + pest_id = fields.Many2one('pest.detail', string='Pest', + help='Mention the pesticide name Required ', + required=True, tracking=True) + company_id = fields.Many2one( + 'res.company', string='Company', required=True, + readonly=True, help='The company associated with the current user or ' + 'environment.', + default=lambda self: self.env.company) currency_id = fields.Many2one('res.currency', string='Currency', + help='Currency used by the company', default=lambda self: self.env.user.company_id.currency_id) - pest_quantity = fields.Integer(string='Pest Quantity', required=True, - tracking=True) + pest_quantity = fields.Integer(string='Pest Quantity', tracking=True, + help='The quantity of pesticide that is' + 'required to be purchased', + required=True) pest_cost = fields.Float(string='Pest Cost', required=True, + help="The unit price of the pesticide", tracking=True, related='pest_id.pest_cost') - 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) + total_cost = fields.Float(string='Total Cost', tracking=True, store=True, + help="The total cost of the pesticide that was " + "purchased.", compute='_compute_total_cost') + disease = fields.Text(string='Disease', tracking=True, required=True, + help="The corresponding disease of crop") + note = fields.Text(string='Note', tracking=True, + help="Please describe any additional details here if " + "there is a need to mention additional data.", + placeholder='Note') state = fields.Selection( [('draft', 'Draft'), ('pending', 'Pending'), ('approve', 'Approved'), - ('rejected', 'Rejected')], - string='Status', default='draft', tracking=True) + ('rejected', 'Rejected'), ('paid', 'Paid')], string='Status', + default='draft', tracking=True, copy=False, + help=" The status of pesticide request") + pest_paid_bool = fields.Boolean(string='Paid Bool', default=False, + copy=False) def action_draft(self): + """ Function for change state of crop request to cancel """ self.state = 'draft' def action_pending(self): + """ Function for change state of pest request to pending """ self.state = 'pending' def action_approved(self): + """ Function for change state of pest request to approve """ self.state = 'approve' + def action_create_invoice(self): + """Method for creating invoice for the pesticides""" + create_invoice = self.env['account.move'].create({ + 'partner_id': self.farmer_id.id, + 'move_type': 'out_invoice', + 'invoice_line_ids': [(0, 0, {'name': self.pest_id.pest_name, + 'price_unit': self.total_cost})] + }) + create_invoice.action_post() + inv_post = { + 'name': 'Customer Invoice', + 'view_mode': 'form', + 'view_type': 'form', + 'view_id': self.env.ref('account.view_move_form').id, + 'res_id': create_invoice.id, + 'res_model': 'account.move', + 'context': "{'move_type':'out_invoice'}", + 'type': 'ir.actions.act_window', + } + self.pest_paid_bool = True + self.state = 'paid' + return inv_post + def action_rejected(self): + """ Function for change state of pest request to rejected """ self.state = 'rejected' @api.depends('pest_cost', 'pest_quantity') def _compute_total_cost(self): + """Function for calculate total cost of pesticide""" for record in self: record.total_cost = record.pest_cost * record.pest_quantity @api.model def create(self, values): + """ Function for create new pest request """ 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 + return super(PestRequest, self).create(values) diff --git a/agriculture_management_odoo/models/seed_detail.py b/agriculture_management_odoo/models/seed_detail.py new file mode 100644 index 000000000..b2629c8b3 --- /dev/null +++ b/agriculture_management_odoo/models/seed_detail.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vyshnav AR() +# +# 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 SeedDetail(models.Model): + """This model represents comprehensive details about seeds within the + context of agriculture management. It provides a structured way to store + information related to various types of seeds used for planting and + cultivation.""" + _name = 'seed.detail' + _inherit = ["mail.thread", 'mail.activity.mixin'] + _description = "Seed" + + name = fields.Char(string='Name', help='Mention the name of the breed of ' + 'crop used for farming', + required=True, tracking=True) + quantity = fields.Integer(string='Quantity', required=True, tracking=True, + help='Mention Quantity or seed purchased for ' + 'farming') + unit = fields.Selection([('kg', 'Kilograms'), ('gms', 'Grams')], + string='Unit', required=True, tracking=True, + help='Mention the quantity of seed purchased for ' + 'farming') + seed_type = fields.Selection( + [('registered', 'Registered'), ('breeder', 'Breeder'), + ('foundation', 'Foundation'), + ('certified', 'Certified')], string='Type', tracking=True, + help='Mention the status of seed purchased for farming', required=True) + note = fields.Text(string='Note', tracking=True, + help="Please describe any additional details here if " + "there is a need to mention additional data.", + placeholder='Note') + company_id = fields.Many2one( + 'res.company', string='Company', required=True, + readonly=True, help='The company associated with the current user or ' + 'environment.', + default=lambda self: self.env.company) diff --git a/agriculture_management_odoo/models/seed_details.py b/agriculture_management_odoo/models/seed_details.py deleted file mode 100644 index 18ecf2103..000000000 --- a/agriculture_management_odoo/models/seed_details.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- 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 deleted file mode 100644 index e23f1b6f7..000000000 --- a/agriculture_management_odoo/models/tag_details.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- 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_detail.py b/agriculture_management_odoo/models/vehicle_detail.py new file mode 100644 index 000000000..87ac08477 --- /dev/null +++ b/agriculture_management_odoo/models/vehicle_detail.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vyshnav AR() +# +# 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, fields, models +from datetime import datetime + + +class VehicleDetail(models.Model): + """ This model represents comprehensive details about vehicles within + the context of agriculture management. It provides a structured way to + store information related to various types of vehicles used for + transportation and agricultural operations.""" + _name = 'vehicle.detail' + _inherit = ['mail.thread', 'mail.activity.mixin'] + _description = "Vehicle Details" + + name = fields.Char(string='Name', tracking=True, + help="Mention the name of vehicle chose", ) + vehicle_main_id = fields.Many2one('fleet.vehicle', + help="Select the vehicle that used for " + "farming", 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, + help=' Mention the status of vehicle ', tracking=True) + vehicle_model = fields.Char(string='Model Year', store=True, + help='Mention the model of selected model', + compute='_compute_vehicle_model', tracking=True) + note = fields.Text(string='Note', tracking=True, + help="Please describe any additional details here if " + "there is a need to mention additional data.", + placeholder='Note') + company_id = fields.Many2one( + 'res.company', string='Company', required=True, + readonly=True, help='The company associated with the current user or ' + 'environment.', + default=lambda self: self.env.company) + + @api.onchange("vehicle_main_id") + def _onchange_vehicle_main_id(self): + """Function for auto update the name of vehicle based on model and + brand""" + 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_vehicle_model(self): + """ Function for selecting model of vehicle based on vehicle id""" + 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_details.py b/agriculture_management_odoo/models/vehicle_details.py deleted file mode 100644 index 0dd803f7f..000000000 --- a/agriculture_management_odoo/models/vehicle_details.py +++ /dev/null @@ -1,58 +0,0 @@ -# -*- 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 index 87f09734c..e55b7a416 100644 --- a/agriculture_management_odoo/models/vehicle_rental.py +++ b/agriculture_management_odoo/models/vehicle_rental.py @@ -3,8 +3,8 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2022-TODAY Cybrosys Technologies() -# Author: Cybrosys Techno Solutions() +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vyshnav AR() # # You can modify it under the terms of the GNU LESSER # GENERAL PUBLIC LICENSE (LGPL v3), Version 3. @@ -19,25 +19,124 @@ # If not, see . # ############################################################################# -from odoo import models, fields, api +from odoo import api, fields, models, _ +from odoo.exceptions import ValidationError class VehicleRental(models.Model): + """This model represents details about vehicle rentals within the + context of agriculture management. It provides a structured way to manage + information related to renting vehicles for agricultural tasks.""" _name = 'vehicle.rental' _inherit = ['mail.thread', 'mail.activity.mixin'] _description = 'Vehicle Rental' _rec_name = 'vehicle_id' - 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) + name = fields.Char(string='Reference', readonly=True, + default=lambda self: _('New'), copy=False, + help='Field for the sequence of renting entries of ' + 'vehicles.') + farmer_id = fields.Many2one('farmer.detail', string='Farmer', + help='Select the farmer who needs vehicle.', + required=True, tracking=True) + vehicle_id = fields.Many2one('vehicle.detail', + help="Select the vehicle that used for farming", + string='Vehicle', required=True, tracking=True) + no_of_days = fields.Float(string='No of Days', + compute='_compute_no_of_days', + help="The number of days we want to rent that " + "vehicle.", tracking=True, store=True) + start_date = fields.Date(string='Start Date', tracking=True, + help=" Start date of rental period", required=True) + end_date = fields.Date(string='End Date', help="End date of rental period", + required=True, tracking=True) + company_id = fields.Many2one('res.company', string='Company', + required=True, readonly=True, + help='The company associated with the current ' + 'user or environment.', + default=lambda self: self.env.company) + currency_id = fields.Many2one(related='company_id.currency_id', + string='Currency', help='Currency of company') + amount = fields.Monetary(string='Amount', help="Rental amount per day", + required=True) + total_amount = fields.Monetary(string='Total Amount', + help="Total rental amount", + compute='_compute_total_amount', + currency_field='currency_id') + note = fields.Text(string='Description', tracking=True, + help="Please describe any additional details here if " + "there is a need to mention additional data.", + placeholder='Note') + state = fields.Selection( + [('draft', 'Draft'), ('confirm', 'Confirmed'), ('return', 'Returned'), + ('paid', 'Paid'), ('cancel', 'Cancel')], string='Status', + default='draft', tracking=True, copy=False, + help="Status of renting the vehicle, Which is th status of the vehicle " + "rented?") + vehicle_paid_bool = fields.Boolean(string='Paid Bool', default=False, + copy=False) + + @api.model + def create(self, values): + """Function for creating new animal rental""" + if values.get('name', _('New')) == _('New'): + values['name'] = self.env['ir.sequence'].next_by_code( + 'vehicle.rental') or _('New') + return super(VehicleRental, self).create(values) + + @api.constrains('start_date', 'end_date') + def _check_dates(self): + for record in self: + if record.start_date and record.end_date: + if record.end_date < record.start_date: + raise ValidationError( + "End date cannot be before start date!") + + @api.depends('no_of_days', 'amount') + def _compute_total_amount(self): + """ Function for compute total amount """ + for record in self: + record.total_amount = record.no_of_days * record.amount @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 + def _compute_no_of_days(self): + """Function for calculating the rental period based start date and + end date""" + for record in self: + if record.start_date and record.end_date: + record.no_of_days = (record.end_date - record.start_date).days + + def action_draft(self): + """ Function for change state of animal rental to draft """ + self.state = 'draft' + + def action_confirm(self): + """ Function for change state of crop request to confirm """ + self.state = 'confirm' + + def action_return(self): + """ Function for change state of crop request to cancel """ + self.state = 'return' + + def action_cancel(self): + """ Function for change state of crop request to cancel """ + self.state = 'cancel' + + def action_register_payment(self): + """Method for viewing the wizard for register payment""" + view_id = self.env.ref( + 'agriculture_management_odoo.vehicle_register_payment_wizard_view_form').id + return { + 'name': 'Register Payment', + 'type': 'ir.actions.act_window', + 'view_mode': 'form', + 'res_model': 'vehicle.register.payment.wizard', + 'views': [(view_id, 'form')], + 'context': { + 'default_farmer_id': self.farmer_id.id, + 'default_rental_duration': self.no_of_days, + 'default_amount': self.total_amount, + 'default_ref': self.name + }, + 'target': 'new', + } diff --git a/agriculture_management_odoo/report/crop_animal.xml b/agriculture_management_odoo/report/crop_animal_reports.xml similarity index 73% rename from agriculture_management_odoo/report/crop_animal.xml rename to agriculture_management_odoo/report/crop_animal_reports.xml index 32a7c5561..35eeff004 100644 --- a/agriculture_management_odoo/report/crop_animal.xml +++ b/agriculture_management_odoo/report/crop_animal_reports.xml @@ -1,12 +1,13 @@ + Animal Crop Report - crop.requests + crop.request qweb-pdf agriculture_management_odoo.animal_crop agriculture_management_odoo.animal_crop - + report diff --git a/agriculture_management_odoo/report/crop_animal_report.xml b/agriculture_management_odoo/report/crop_animal_templates.xml similarity index 74% rename from agriculture_management_odoo/report/crop_animal_report.xml rename to agriculture_management_odoo/report/crop_animal_templates.xml index 1132fbaad..089a4b4ab 100644 --- a/agriculture_management_odoo/report/crop_animal_report.xml +++ b/agriculture_management_odoo/report/crop_animal_templates.xml @@ -1,5 +1,6 @@ + - \ No newline at end of file + diff --git a/agriculture_management_odoo/report/crop_report.xml b/agriculture_management_odoo/report/crop_request_reports.xml similarity index 74% rename from agriculture_management_odoo/report/crop_report.xml rename to agriculture_management_odoo/report/crop_request_reports.xml index 76c399f7a..c66d2e5cd 100644 --- a/agriculture_management_odoo/report/crop_report.xml +++ b/agriculture_management_odoo/report/crop_request_reports.xml @@ -1,13 +1,13 @@ + Crop Report - crop.report.wizard + crop.report 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_request_templates.xml similarity index 98% rename from agriculture_management_odoo/report/crop_report_template.xml rename to agriculture_management_odoo/report/crop_request_templates.xml index e90db980b..37f1668fe 100644 --- a/agriculture_management_odoo/report/crop_report_template.xml +++ b/agriculture_management_odoo/report/crop_request_templates.xml @@ -1,5 +1,6 @@ +