Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
601 additions
and
1,263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
.. image:: https://img.shields.io/badge/license-AGPLv3-blue.svg | ||
:target: https://www.gnu.org/licenses/agpl.html | ||
:alt: License: AGPL-3 | ||
|
||
=============================== | ||
Sale Order Report With Note | ||
=============================== | ||
|
||
* This module replaces the webkit Quotation / Sale Order report by | ||
a qweb report and adds header and footer notes on the sale order | ||
and quotation | ||
|
||
|
||
Installation | ||
============ | ||
|
||
To install this module there is no external library required. | ||
|
||
|
||
Configuration | ||
============= | ||
|
||
To configure this module, no configuration is required. | ||
|
||
|
||
Usage | ||
===== | ||
|
||
* To use this module set the header and footer notes in the Condition tab for Sale order. | ||
|
||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas | ||
:alt: Try me on Runbot | ||
:target: https://runbot.odoo-community.org/runbot/148/8.0 | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues | ||
<https://github.com/OCA/sale-reporting/issues>`_. In case of trouble, please | ||
check there if your issue has already been reported. If you spotted it first, | ||
help us smashing it by providing a detailed and welcomed feedback. | ||
|
||
|
||
Credits | ||
======= | ||
|
||
Images | ||
------ | ||
|
||
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_. | ||
|
||
Contributors | ||
------------ | ||
|
||
* Vincent Renaville <vincent.renaville@camptocamp.com> | ||
* Jordi Ballester Alomar <jordi.ballester@eficent.com> | ||
* Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com> | ||
|
||
Maintainer | ||
---------- | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
This module is maintained by the OCA. | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
To contribute to this module, please visit https://odoo-community.org. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (c) 2011 Camptocamp SA (http://www.camptocamp.com) | ||
# @author Guewen Baconnier | ||
# © 2015 Eficent Business and IT Consulting Services S.L. | ||
# - Jordi Ballester Alomar | ||
# © 2015 Serpent Consulting Services Pvt. Ltd. - Sudhir Arya | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (c) 2014 Camptocamp SA (http://www.camptocamp.com) | ||
# @author Guewen Baconnier Vincent Renaville | ||
# © 2015 Eficent Business and IT Consulting Services S.L. | ||
# - Jordi Ballester Alomar | ||
# © 2015 Serpent Consulting Services Pvt. Ltd. - Sudhir Arya | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
{ | ||
'name': 'Sales Order Report with Notes', | ||
'version': '8.0.1.0.0', | ||
'category': 'Reports/Qweb', | ||
'license': 'AGPL-3', | ||
"author": "Camptocamp SA," | ||
"Eficent Business and IT Consulting Services S.L., ", | ||
'website': "https://odoo-community.org/", | ||
'depends': ['sale'], | ||
'data': ['security/ir.model.access.csv', | ||
'report/sale_report.xml', | ||
'views/report_saleorder_qweb.xml', | ||
'views/sale_view.xml'], | ||
'installable': True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (c) 2011 Camptocamp SA (http://www.camptocamp.com) | ||
# @author Guewen Baconnier | ||
# © 2015 Eficent Business and IT Consulting Services S.L. | ||
# - Jordi Ballester Alomar | ||
# © 2015 Serpent Consulting Services Pvt. Ltd. - Sudhir Arya | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
from . import sale |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (c) 2013 Camptocamp SA (http://www.camptocamp.com) | ||
# @author Vincent Renaville | ||
# © 2015 Eficent Business and IT Consulting Services S.L. | ||
# - Jordi Ballester Alomar | ||
# © 2015 Serpent Consulting Services Pvt. Ltd. - Sudhir Arya | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
from openerp import api, fields, models, _ | ||
from openerp.exceptions import Warning | ||
|
||
|
||
class SaleConditionText(models.Model): | ||
"""Sale order Textual information""" | ||
|
||
_name = "sale.condition_text" | ||
_description = "sale conditions" | ||
|
||
name = fields.Char('Condition summary', required=True) | ||
type = fields.Selection([('header', 'Top condition'), | ||
('footer', 'Bottom condition')], | ||
'type', required=True) | ||
text = fields.Html('Condition', translate=True, required=True) | ||
|
||
|
||
class SaleOrder(models.Model): | ||
"""Adds condition to SO""" | ||
|
||
_inherit = "sale.order" | ||
_description = 'Sale Order' | ||
|
||
text_condition1 = fields.Many2one('sale.condition_text', 'Header', | ||
domain=[('type', '=', 'header')]) | ||
text_condition2 = fields.Many2one('sale.condition_text', 'Footer', | ||
domain=[('type', '=', 'footer')]) | ||
note1 = fields.Html('Header') | ||
note2 = fields.Html('Footer') | ||
|
||
@api.onchange('text_condition1', 'partner_id') | ||
def set_header(self): | ||
if not self.partner_id: | ||
raise Warning(_('No Customer Defined !'), | ||
_('Before choosing condition text' | ||
'select a customer.')) | ||
ctx = dict(self._context) | ||
lang = self.partner_id.lang or 'en_US' | ||
self.with_context(ctx).write({'lang': lang}) | ||
if self.text_condition1: | ||
self.note1 = self.text_condition1.text | ||
|
||
@api.onchange('text_condition2', 'partner_id') | ||
def set_footer(self): | ||
if not self.partner_id: | ||
raise Warning(_('No Customer Defined !'), | ||
_('Before choosing condition text' | ||
'select a customer.')) | ||
ctx = dict(self._context) | ||
lang = self.partner_id.lang or 'en_US' | ||
self.with_context(ctx).write({'lang': lang}) | ||
if self.text_condition2: | ||
self.note2 = self.text_condition2.text | ||
|
||
@api.multi | ||
def print_quotation(self): | ||
''' | ||
This function prints the sales order and mark it as sent, | ||
so that we can see more easily the next step of the workflow | ||
''' | ||
assert len(self.ids) == 1, '''This option should only be used | ||
for a single id at a time''' | ||
self.signal_workflow('quotation_sent') | ||
xml = 'sale_order_report.report_saleorder_qweb' | ||
return self.env['report'].get_action(self, xml) | ||
|
||
|
||
class SaleOrderLine(models.Model): | ||
"""ADD HTML note to sale order lines""" | ||
|
||
_inherit = "sale.order.line" | ||
|
||
formatted_note = fields.Html('Formatted Note') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<openerp> | ||
<data> | ||
<report id="sale.report_sale_order" | ||
string="Quotation - Order" | ||
model="sale.order" | ||
name="sale_order_report.report_saleorder_qweb" | ||
report_type="qweb-pdf" | ||
menu="True" | ||
/> | ||
</data> | ||
</openerp> |
4 changes: 2 additions & 2 deletions
4
...order_webkit/security/ir.model.access.csv → ...order_report/security/ir.model.access.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
sale_condition_text_sale_user,"sale.condition_text.sale_user","sale_order_webkit.model_sale_condition_text","base.group_sale_salesman",1,1,1,0 | ||
sale_condition_text_sale_manager,"sale.condition_text.sale_manager","sale_order_webkit.model_sale_condition_text","base.group_sale_manager",1,1,1,1 | ||
sale_condition_text_sale_user,"sale.condition_text.sale_user","sale_order_report.model_sale_condition_text","base.group_sale_salesman",1,1,1,0 | ||
sale_condition_text_sale_manager,"sale.condition_text.sale_manager","sale_order_report.model_sale_condition_text","base.group_sale_manager",1,1,1,1 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
.list_main_table { | ||
border:thin solid #E3E4EA; | ||
text-align:center; | ||
border-collapse: collapse; | ||
} | ||
|
||
table.list_main_table { | ||
margin-top: 20px; | ||
} | ||
|
||
.list_main_headers { | ||
padding: 0; | ||
} | ||
|
||
.list_main_headers th { | ||
border: thin solid #000000; | ||
padding-right:3px; | ||
padding-left:3px; | ||
background-color: #EEEEEE; | ||
text-align:center; | ||
font-size:12; | ||
font-weight:bold; | ||
} | ||
|
||
.list_main_table td { | ||
padding-right:3px; | ||
padding-left:3px; | ||
padding-top:3px; | ||
padding-bottom:3px; | ||
} | ||
|
||
.list_main_lines, | ||
.list_main_footers { | ||
padding: 0; | ||
} | ||
|
||
.list_main_footers { | ||
padding-top: 15px; | ||
} | ||
|
||
.list_main_lines td, | ||
.list_main_footers td, | ||
.list_main_footers th { | ||
border-style: none; | ||
text-align:left; | ||
font-size:12; | ||
padding:0; | ||
} | ||
|
||
.list_main_footers th { | ||
text-align:right; | ||
} | ||
|
||
td .total_empty_cell { | ||
width: 77%; | ||
} | ||
|
||
td .total_sum_cell { | ||
width: 13%; | ||
} | ||
|
||
.nobreak { | ||
page-break-inside: avoid; | ||
} | ||
|
||
caption.formatted_note { | ||
text-align:left; | ||
border-right:thin solid #EEEEEE; | ||
border-left:thin solid #EEEEEE; | ||
border-top:thin solid #EEEEEE; | ||
padding-left:10px; | ||
font-size:11; | ||
caption-side: bottom; | ||
} | ||
|
||
caption.formatted_note p { | ||
margin: 0; | ||
} | ||
|
||
.main_col1 { | ||
width: 40%; | ||
} | ||
td.main_col1 { | ||
text-align:left; | ||
} | ||
|
||
.main_col2, | ||
.main_col3, | ||
.main_col4, | ||
.main_col6 { | ||
width: 10%; | ||
} | ||
|
||
.main_col5 { | ||
width: 7%; | ||
} | ||
|
||
td.main_col5 { | ||
text-align: center; | ||
font-style:italic; | ||
font-size: 10; | ||
} | ||
|
||
.main_col7 { | ||
width: 13%; | ||
} | ||
|
||
.right_table { | ||
right: 4cm; | ||
width:"100%"; | ||
} | ||
|
||
.std_text { | ||
font-size:12; | ||
} | ||
|
||
th.date { | ||
width: 90px; | ||
} | ||
|
||
td.amount, th.amount { | ||
text-align: right; | ||
white-space: nowrap; | ||
} | ||
|
||
td.date { | ||
white-space: nowrap; | ||
width: 90px; | ||
} | ||
|
||
.address .recipient .shipping .invoice { | ||
font-size: 12px; | ||
} |
Oops, something went wrong.