Browse Source

[ADD] Initial Commit

pull/124/head
Ajmalcybrosys 6 years ago
parent
commit
47b1161b64
  1. 0
      customer_due_days/README.md
  2. 1
      customer_due_days/__init__.py
  3. 10
      customer_due_days/__manifest__.py
  4. 3
      customer_due_days/report/__init__.py
  5. 39
      customer_due_days/report/due_report.py
  6. 14
      customer_due_days/report/due_report.xml
  7. 0
      customer_due_days/security/ir.model.access.csv
  8. 0
      customer_due_days/static/description/banner.jpg
  9. 0
      customer_due_days/static/description/cybro_logo.png
  10. 0
      customer_due_days/static/description/due_report.png
  11. 0
      customer_due_days/static/description/due_wizard.png
  12. 0
      customer_due_days/static/description/icon.png
  13. 0
      customer_due_days/static/description/index.html
  14. 0
      customer_due_days/wizard/__init__.py
  15. 13
      customer_due_days/wizard/due_days.py
  16. 1
      customer_due_days/wizard/due_days.xml

0
customer_due_day/README.md → customer_due_days/README.md

1
customer_due_day/__init__.py → customer_due_days/__init__.py

@ -1,2 +1,3 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from . import wizard
from . import report from . import report

10
customer_due_day/__manifest__.py → customer_due_days/__manifest__.py

@ -26,14 +26,16 @@
'author': 'Cybrosys Techno Solutions', 'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions', 'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions', 'maintainer': 'Cybrosys Techno Solutions',
'depends': ['base', 'base_report_xlsx', 'account'], 'depends': ['base', 'report_xlsx', 'account'],
'website': 'https://www.cybrosys.com', 'website': 'https://www.cybrosys.com',
'images': ['static/description/banner.jpg'],
'data': [ 'data': [
'security/ir.model.access.csv', 'security/ir.model.access.csv',
'report/due_days.xml', 'wizard/due_days.xml',
'report/due_report.xml',
], ],
'images': ['static/description/banner.jpg'], 'qweb': [],
'installable': True, 'installable': True,
'auto_install': False, 'auto_install': False,
'application': False, 'application': False,
} }

3
customer_due_days/report/__init__.py

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import due_report

39
customer_due_day/report/due_days.py → customer_due_days/report/due_report.py

@ -1,36 +1,14 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import json
import io
from datetime import datetime from datetime import datetime
from odoo.tools import date_utils from odoo import api, models,fields, _
from odoo import models, fields, api, _
try:
from odoo.tools.misc import xlsxwriter
except ImportError:
import xlsxwriter
class CreditDueExceedReportWizard(models.TransientModel): class CustomerDueReportXLSX(models.AbstractModel):
_name = 'customer.due.report' _name = 'report.customer_due_days.report_customer_due_xlsx'
_inherit = 'report.report_xlsx.abstract'
@api.model def generate_xlsx_report(self, workbook, data, vals):
def xlsx_credit_due_report(self,data): sheet = workbook.add_worksheet('Customer Due Report')
data = {}
data['form'] = self.read([])
return {
'type': 'ir_actions_xlsx_download',
'data': {'model': 'customer.due.report',
'options': json.dumps(data['form'],
default=date_utils.json_default),
'output_format': 'xlsx',
'report_name': 'customer_due_report',
}
}
def get_xlsx_report(self, options, response):
output = io.BytesIO()
workbook = xlsxwriter.Workbook(output, {'in_memory': True})
sheet = workbook.add_worksheet('Product Ageing Report')
format1 = workbook.add_format({'font_size': 15, 'align': 'center', 'bg_color': '#8a98a8', 'bold': True}) format1 = workbook.add_format({'font_size': 15, 'align': 'center', 'bg_color': '#8a98a8', 'bold': True})
format2 = workbook.add_format( format2 = workbook.add_format(
{'align': 'center', 'font_size': 10, 'bg_color': '#8a98a8', 'bottom': 1, 'bold': True}) {'align': 'center', 'font_size': 10, 'bg_color': '#8a98a8', 'bottom': 1, 'bold': True})
@ -118,7 +96,4 @@ class CreditDueExceedReportWizard(models.TransientModel):
sheet.write(row_num, col_num + 6, aml['amount_residual'], format4) sheet.write(row_num, col_num + 6, aml['amount_residual'], format4)
sheet.write(row_num, col_num + 7, total_overdue, format5) sheet.write(row_num, col_num + 7, total_overdue, format5)
row_num += 1 row_num += 1
workbook.close()
output.seek(0)
response.stream.write(output.read())
output.close()

14
customer_due_days/report/due_report.xml

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data>
<report
id="report_customer_due_xlsx"
model="res.partner"
report_type="xlsx"
string="Customer Due Analysis"
name="customer_due_days.report_customer_due_xlsx"
file="customer_due_days.report_customer_due_xlsx"
menu="False"
/>
</data>
</odoo>

0
customer_due_day/security/ir.model.access.csv → customer_due_days/security/ir.model.access.csv

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_customer_due_manager customer.due model_customer_due_report account.group_account_user 1 1 1 1

0
customer_due_day/static/description/banner.jpg → customer_due_days/static/description/banner.jpg

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

0
customer_due_day/static/description/cybro_logo.png → customer_due_days/static/description/cybro_logo.png

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

0
customer_due_day/static/description/due_report.png → customer_due_days/static/description/due_report.png

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 130 KiB

0
customer_due_day/static/description/due_wizard.png → customer_due_days/static/description/due_wizard.png

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

0
customer_due_day/static/description/icon.png → customer_due_days/static/description/icon.png

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

0
customer_due_day/static/description/index.html → customer_due_days/static/description/index.html

0
customer_due_day/report/__init__.py → customer_due_days/wizard/__init__.py

13
customer_due_days/wizard/due_days.py

@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
from odoo import models, fields, api, _
class CreditDueExceedReportWizard(models.TransientModel):
_name = 'customer.due.report'
@api.model
def xlsx_credit_due_report(self,data):
data = {}
return self.env.ref('customer_due_days.report_customer_due_xlsx').report_action(self, data=data)

1
customer_due_day/report/due_days.xml → customer_due_days/wizard/due_days.xml

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<odoo> <odoo>
<data> <data>
<record id="credit_due_days_view" model="ir.ui.view"> <record id="credit_due_days_view" model="ir.ui.view">
<field name="name">Customer Due Analysis</field> <field name="name">Customer Due Analysis</field>
<field name="model">customer.due.report</field> <field name="model">customer.due.report</field>
Loading…
Cancel
Save