Browse Source

Jan 11 : [FIX] Bug Fixed 'agriculture_management_odoo'

pull/231/head
AjmalCybro 2 years ago
parent
commit
e11c886726
  1. 3
      agriculture_management_odoo/doc/RELEASE_NOTES.md
  2. 1
      agriculture_management_odoo/models/vehicle_rental.py
  3. 4
      agriculture_management_odoo/report/pest_report_template.xml
  4. 26
      agriculture_management_odoo/wizard/crop_report_wiz.py
  5. 32
      agriculture_management_odoo/wizard/pest_report_wiz.py
  6. 98
      auto_database_backup/static/description/index.html

3
agriculture_management_odoo/doc/RELEASE_NOTES.md

@ -5,9 +5,8 @@
#### ADD
- Initial commit for agriculture_management_odoo
#### 19.11.2022
#### Version 16.0.2.0.0
#### UPDT
- Updated
- Update

1
agriculture_management_odoo/models/vehicle_rental.py

@ -26,6 +26,7 @@ class VehicleRental(models.Model):
_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)

4
agriculture_management_odoo/report/pest_report_template.xml

@ -86,11 +86,11 @@
</td>
<td>
<span t-att-style="style"
t-esc="val[5]"/>
t-esc="val[6]"/>
</td>
<td>
<span t-att-style="style"
t-esc="val[6]"/>
t-esc="val[5]"/>
</td>
<td>
<span t-att-style="style"

26
agriculture_management_odoo/wizard/crop_report_wiz.py

@ -43,26 +43,34 @@ class CropReport(models.TransientModel):
crop_requests.seed_id = seed_details.id
inner join location_details ON
crop_requests.location_id = location_details.id"""
today = fields.Date.today()
if self.date_from:
if self.date_from and not self.date_to:
if self.date_from > today:
raise UserError(
_('You could not set the start date or the end date in the future.'))
if self.date_to:
else:
ret = ret + """ where crop_requests.request_date >= '""" + str(
self.date_from) + """' AND crop_requests.request_date <= '""" \
+ str(
today) + """'"""
if self.date_to and not self.date_from:
if self.date_to > today:
raise UserError(
_('You could not set the start date or the end date in the future.'))
if self.date_from >= self.date_to:
else:
ret = ret + """ where crop_requests.request_date <= '""" + str(
self.date_to) + """'"""
if self.date_from and self.date_to:
if self.date_from <= self.date_to:
ret = ret + """ where crop_requests.request_date >= '""" + \
str(self.date_from) + """' AND crop_requests.request_date <= '""" \
+ str(self.date_to) + """'"""
else:
raise UserError(
_('The start date must be inferior to the end date.'))
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 = {

32
agriculture_management_odoo/wizard/pest_report_wiz.py

@ -32,30 +32,42 @@ class CropReport(models.TransientModel):
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
pest_request.disease, pest_details.pest_name as pest_name,pest_details.pest_cost as cost,pest_request.pest_quantity,
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"""
today = fields.Date.today()
if self.date_from:
if self.date_from and not self.date_to:
if self.date_from > today:
raise UserError(
_('You could not set the start date or the end date in the future.'))
if self.date_to:
else:
ret = ret + ret + """ where pest_request.request_date >= '""" \
+ str(
self.date_from) + """' AND pest_request.request_date <=
'""" \
+ str(
today) + """'"""
if self.date_to and not self.date_from:
if self.date_to > today:
raise UserError(
_('You could not set the start date or the end date in the future.'))
if self.date_from >= self.date_to:
else:
ret = ret + """ where pest_request.request_date <= '""" + str(
self.date_to) + """'"""
if self.date_from and self.date_to:
if self.date_from <= self.date_to:
ret = ret + """ where pest_request.request_date >= '""" + \
str(self.date_from) + """' AND pest_request.request_date
<= '""" \
+ str(self.date_to) + """'"""
else:
raise UserError(
_('The start date must be inferior to the end date.'))
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 = {

98
auto_database_backup/static/description/index.html

@ -2,7 +2,7 @@
<!-- TITLE BAR -->
<div class="d-flex justify-content-between align-items-center"
style="border-bottom: 1px solid #875A7B; padding: 15px; display: flex; justify-content: space-between; align-items: center;">
<img src="assets/misc/cybrosys-logo.png" width="42" height="42" style="width: 42px; height: 42px;"/>
<img src="assets/misc/cybrosys-logo.png" width="42" height="42" style="width: 42px; height: 42px;" />
<div>
<div
style="color: #7C7BAD; font-size: 14px; font-family: 'Montserrat', sans-serif; font-weight: bold; background-color: white; display: inline-block; padding: 3px 10px; border-radius: 50px;"
@ -34,7 +34,7 @@
Server, Remote Server, Google Drive, Onedrive And Dropbox.</p>
<!-- END OF APP HERO -->
<img src="assets/screenshots/hero.png" class="img-responsive"
style="width: 100%; margin-left: auto; margin-right: auto;"/>
style="width: 100%; margin-left: auto; margin-right: auto;" />
</div>
</div>
</div>
@ -46,7 +46,7 @@
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px; margin-top: 300px;">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/compass.png"/>
<img src="assets/misc/compass.png" />
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Explore This
Module</h2>
@ -62,7 +62,7 @@
more about this
module</span>
</div>
<img src="assets/misc/right-arrow.png" width="36" height="36"/>
<img src="assets/misc/right-arrow.png" width="36" height="36" />
</div>
</a>
</div>
@ -76,7 +76,7 @@
features of this
module</span>
</div>
<img src="assets/misc/right-arrow.png" width="36" height="36"/>
<img src="assets/misc/right-arrow.png" width="36" height="36" />
</div>
</a>
</div>
@ -90,7 +90,7 @@
screenshots for this
module</span>
</div>
<img src="assets/misc/right-arrow.png" width="36" height="36"/>
<img src="assets/misc/right-arrow.png" width="36" height="36" />
</div>
</a>
</div>
@ -101,7 +101,7 @@
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;" id="overview">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/pie-chart.png"/>
<img src="assets/misc/pie-chart.png" />
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Overview
</h2>
@ -116,15 +116,17 @@
and storage.
Using Automatic Database Backup module user can generate and store database backups to multiple
location.
</div>
<br/>
<div>
This module uses an external python dependency 'dropbox'.Before installing the module install the python package
<div class="alert alert-primary mt-4">
This module uses an external python dependency 'dropbox'.Before installing the module install the python
package
first.The required python package can be installed using the following command,
<hr />
<code class="d-block mt-2">pip install dropbox</code>
</div>
<div>
<i>pip install dropbox</i>
</div>
</div>
<!-- END OF OVERVIEW SECTION -->
@ -132,7 +134,7 @@
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;" id="features">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/features.png"/>
<img src="assets/misc/features.png" />
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Features
</h2>
@ -140,44 +142,47 @@
<div class="row" style="font-family: 'Montserrat', sans-serif; font-weight: 400; font-size: 14px; line-height: 200%;">
<div class="col-sm-12 col-md-6">
<div class="d-flex align-items-center" style="margin-top: 40px; margin-bottom: 40px">
<img src="assets/misc/check-box.png" class="mr-2"/>
<img src="assets/misc/check-box.png" class="mr-2" />
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Generate Database
Backups on regular intervals</span>
</div>
<div class="d-flex align-items-center" style="margin-top: 30px; margin-bottom: 30px">
<img src="assets/misc/check-box.png" class="mr-2"/>
<img src="assets/misc/check-box.png" class="mr-2" />
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Store Backup to
Dropbox</span>
</div>
<div class="d-flex align-items-center" style="margin-top: 30px; margin-bottom: 30px">
<img src="assets/misc/check-box.png" class="mr-2"/>
<img src="assets/misc/check-box.png" class="mr-2" />
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Store Backup to
Onedrive</span>
</div>
<div class="d-flex align-items-center" style="margin-top: 30px; margin-bottom: 30px">
<img src="assets/misc/check-box.png" class="mr-2"/>
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Notify user on success
<img src="assets/misc/check-box.png" class="mr-2" />
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Notify user on
success
and failure of backup generation</span>
</div>
</div>
<div class="col-sm-12 col-md-6">
<div class="d-flex align-items-center" style="margin-top: 30px; margin-bottom: 30px">
<img src="assets/misc/check-box.png" class="mr-2"/>
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Store Backup to Remote
<img src="assets/misc/check-box.png" class="mr-2" />
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Store Backup to
Remote
Server</span>
</div>
<div class="d-flex align-items-center" style="margin-top: 30px; margin-bottom: 30px">
<img src="assets/misc/check-box.png" class="mr-2"/>
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Generated backup can be
<img src="assets/misc/check-box.png" class="mr-2" />
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Generated backup can
be
stored to Google Drive</span>
</div>
<div class="d-flex align-items-center" style="margin-top: 30px; margin-bottom: 30px">
<img src="assets/misc/check-box.png" class="mr-2"/>
<img src="assets/misc/check-box.png" class="mr-2" />
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Automatically remove
old backups</span>
</div>
@ -189,7 +194,7 @@
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;" id="screenshots">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/pictures.png"/>
<img src="assets/misc/pictures.png" />
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Screenshots
</h2>
@ -246,8 +251,7 @@
Drive</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">you'll need to create a
new
Google API project and enabling the Google Drive API, Go to the <a
href="https://console.developers.google.com/"
Google API project and enabling the Google Drive API, Go to the <a href="https://console.developers.google.com/"
target="_blank">Google API Console</a> and log into your
account.
While creating the project, for the Redirect URI restrictions, copy your Odoo database URI followed by
@ -276,10 +280,10 @@
be
redirected to an authorization page.</p>
<img src="assets/screenshots/backup6.png" class="img-thumbnail">
<img src="assets/screenshots/backup7.png" class="img-thumbnail"/>
<img src="assets/screenshots/backup7.png" class="img-thumbnail" />
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">Reset the token if
required.</p>
<img src="assets/screenshots/backup8.png" class="img-thumbnail"/>
<img src="assets/screenshots/backup8.png" class="img-thumbnail" />
</div>
@ -290,8 +294,7 @@
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">Select backup
destination
as Dropbox. Enter the App key and App secret.
you'll need to register a new app in the <a href="https://www.dropbox.com/developers/apps"
target="_blank">App
you'll need to register a new app in the <a href="https://www.dropbox.com/developers/apps" target="_blank">App
Console</a>.
Select Dropbox API app and choose your app's permission (files.content.write and files.content.read
permissions
@ -401,7 +404,7 @@
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/categories.png"/>
<img src="assets/misc/categories.png" />
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Related
Products
@ -416,24 +419,21 @@
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/dynamic_accounts_report/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/1.png">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/1.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/custom_gantt_view/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/2.png">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/2.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/project_custom_gantt/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/3.png">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/3.png">
</div>
</a>
</div>
@ -442,24 +442,21 @@
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/account_reports_xlsx/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/4.png">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/4.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/base_accounting_kit/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/5.gif">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/5.gif">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/15.0/hr_payroll_community/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/6.png">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/6.png">
</div>
</a>
</div>
@ -481,7 +478,7 @@
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/star.png"/>
<img src="assets/misc/star.png" />
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Our Services
</h2>
@ -593,7 +590,7 @@
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/corporate.png"/>
<img src="assets/misc/corporate.png" />
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Our
Industries
@ -718,7 +715,7 @@
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/customer-support.png"/>
<img src="assets/misc/customer-support.png" />
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Support
</h2>
@ -729,7 +726,7 @@
<div style="background-color: #F6F8F9; padding: 30px; display: flex; align-items: center;">
<div class="mr-4"
style="background-color: #714B67; display: inline-block; height: 70px; width: 70px; display: flex; align-items: center; justify-content: center;">
<img src="assets/misc/support.png" height="48" width="48" style="width: 42px; height: 42px;"/>
<img src="assets/misc/support.png" height="48" width="48" style="width: 42px; height: 42px;" />
</div>
<div>
<h4>Need Help?</h4>
@ -745,7 +742,7 @@
<div style="background-color: #F6F8F9; padding: 30px; display: flex; align-items: center;">
<div class="mr-4"
style="background-color: #2AC44D; display: inline-block; height: 70px; width: 70px; display: flex; align-items: center; justify-content: center;">
<img src="assets/misc/whatsapp.png" height="52" width="52" style="width: 52px; height: 52px;"/>
<img src="assets/misc/whatsapp.png" height="52" width="52" style="width: 52px; height: 52px;" />
</div>
<div>
<h4>WhatsApp</h4>
@ -760,8 +757,7 @@
</div>
<div class="row">
<div class="col-sm-12 my-5 d-flex justify-content-center align-items-center">
<img src="assets/misc/logo.png" width="144" height="31"
style="width:144px; height: 31px; margin-top: 40px;"/>
<img src="assets/misc/logo.png" width="144" height="31" style="width:144px; height: 31px; margin-top: 40px;" />
</div>
</div>
</div>

Loading…
Cancel
Save