New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ADD] sale_order_report_with_note (migrated sale_order_webkit to v8 in qweb and renamed the module) #33
Closed
Closed
[ADD] sale_order_report_with_note (migrated sale_order_webkit to v8 in qweb and renamed the module) #33
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
dfebab3
[IMP] migrated sale_order_webkit to v8 and renamed the module
SerpentCS 03d31a9
[FIX] resolved flake8 issues
SerpentCS 184acb9
[IMP] Changed module name & shortened author name in manifest file
SerpentCS 24a24c0
[IMP] Changed reference as per new module name
SerpentCS 14df89e
[IMP] Improved copyrights & README.rst
serpentcs-dev1 272375d
Merge branch '8.0' into 8.0
serpentcs-dev1 4500c3d
[FIX] revert commit
serpentcs-dev1 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 | ||
============ | ||
|
||
No specific installation requirements. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove not used sections. |
||
|
||
|
||
Configuration | ||
============= | ||
|
||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One line copyrights |
||
# © 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,25 @@ | ||
# -*- 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 Note', | ||
'version': '8.0.1.0.0', | ||
'category': 'Reports/Qweb', | ||
'license': 'AGPL-3', | ||
"author": "Camptocamp SA," | ||
"Eficent, " | ||
"Serpent CS," | ||
"Odoo Community Association (OCA)", | ||
'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_with_note.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_with_note.report_saleorder_qweb" | ||
report_type="qweb-pdf" | ||
menu="True" | ||
/> | ||
</data> | ||
</openerp> |
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,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_report_with_note.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_with_note.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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you change this to v9? this is still v8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange this is not done in the last commit, not sure when and why it was changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it's weird, it was added in the very first one (dfebab3). Just revert the change ✂️