Browse Source

Jan 11 : [FIX] Bug Fixed 'agriculture_management_odoo'

pull/231/head
AjmalCybro 3 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. 50
      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 = {

50
auto_database_backup/static/description/index.html

@ -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 -->
@ -159,20 +161,23 @@
<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
<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
<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
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Generated backup can
be
stored to Google Drive</span>
</div>
@ -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
@ -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
@ -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>
@ -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