clearcorp team mailing list archive
-
clearcorp team
-
Mailing list archive
-
Message #00892
lp:~rr.clearcorp/openerp-ccorp-addons/7.0-base_import_exchange_rates into lp:openerp-ccorp-addons/6.1
Ronald Rubi has proposed merging lp:~rr.clearcorp/openerp-ccorp-addons/7.0-base_import_exchange_rates into lp:openerp-ccorp-addons/6.1.
Requested reviews:
CLEARCORP drivers (clearcorp-drivers)
For more details, see:
https://code.launchpad.net/~rr.clearcorp/openerp-ccorp-addons/7.0-base_import_exchange_rates/+merge/194232
[ADD] Add dependence res_currency_sequence in base_import_exchange_rates
--
The attached diff has been truncated due to its size.
https://code.launchpad.net/~rr.clearcorp/openerp-ccorp-addons/7.0-base_import_exchange_rates/+merge/194232
Your team CLEARCORP development team is subscribed to branch lp:openerp-ccorp-addons/6.1.
=== removed directory 'TODO-6.1/company_webkit'
=== removed file 'TODO-6.1/company_webkit/__init__.py'
--- TODO-6.1/company_webkit/__init__.py 2012-06-30 22:41:06 +0000
+++ TODO-6.1/company_webkit/__init__.py 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
-import company_webkit
=== removed file 'TODO-6.1/company_webkit/__openerp__.py'
--- TODO-6.1/company_webkit/__openerp__.py 2012-06-30 22:41:06 +0000
+++ TODO-6.1/company_webkit/__openerp__.py 1970-01-01 00:00:00 +0000
@@ -1,44 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# account_rename.py
-# account_rename
-# First author: Mag Guevara <mag.guevara@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
-# Copyright (c) 2011-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without modification, are
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice, this list of
-# conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice, this list
-# of conditions and the following disclaimer in the documentation and/or other materials
-# provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation are those of the
-# authors and should not be interpreted as representing official policies, either expressed
-# or implied, of ClearCorp S.A..
-#
-##############################################################################
-{
- "name" : "Company fields for report webkit",
- "author" : "ClearCorp S.A.",
- "version" : "1.0",
- "depends" : ["base","report_webkit"],
- "init_xml" : [],
- "update_xml" : ["company_webkit_view.xml"],
- "category" : "Report",
- "active" : False,
- "instalable" : True,
-}
=== removed file 'TODO-6.1/company_webkit/company_webkit.py'
--- TODO-6.1/company_webkit/company_webkit.py 2012-06-30 22:41:06 +0000
+++ TODO-6.1/company_webkit/company_webkit.py 1970-01-01 00:00:00 +0000
@@ -1,282 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# company_webkit.py
-# company_webkit
-# First author: Mag Guevara <mag.guevara@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
-# Copyright (c) 2011-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without modification, are
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice, this list of
-# conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice, this list
-# of conditions and the following disclaimer in the documentation and/or other materials
-# provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation are those of the
-# authors and should not be interpreted as representing official policies, either expressed
-# or implied, of ClearCorp S.A..
-#
-##############################################################################
-from osv import osv, fields
-from tools import debug
-from tools.translate import _
-
-class company_webkit(osv.osv):
- _name = "res.company"
- _inherit = "res.company"
-
- def _get_default_header(self,cr,uid,ids):
- return """
-<html>
- <head>
- <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
- <script>
- function subst() {
- var vars={};
- var x=document.location.search.substring(1).split('&');
- for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
- var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
- for(var i in x) {
- var y = document.getElementsByClassName(x[i]);
- for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
- }
- }
- </script>
- <style type="text/css">
- ${css}
- </style>
- </head>
- <body class = "header" onload="subst()">
- <table class="header-table" cellspacing = "3">
- <tbody>
- <tr>
- <td>
- ${helper.embed_logo_by_name('company_logo')|n}
- </td>
- <td>
- <table class="company_data">
- <tr class = "title">
- <td>${company.partner_id.name |entity}</td>
- <td style = "text-align : right;">${_("Address")}</td>
- </tr>
- <tr>
- <td>${_("ID Num")}: ${company.partner_id.ref | entity}</td>
- <td style = "text-align : right;">${company.partner_id.address[0].street or ''|entity}</td>
- </tr>
- <tr>
- <td>${_("Tel-fax")}: ${company.partner_id.address[0].phone or '-'|entity}</td>
- <td style = "text-align : right;">${company.partner_id.address[0].street2 or ''|entity}</td>
- </tr>
- <tr>
- <td>${_("E-mail")}: ${company.partner_id.address[0].email or '-'|entity}</td>
- <td style = "text-align : right;">${company.partner_id.address[0].zip or ''|entity} ${company.partner_id.address[0].city or ''|entity}</td>
- </tr>
- <tr>
- <td>${_("Web")}: ${company.partner_id.website or '-'|entity}</td>
- %if company.partner_id.address[0].country_id :
- <td style = "text-align : right;">${company.partner_id.address[0].state_id.name or ''|entity}, ${company.partner_id.address[0].country_id.name or ''|entity} </td>
- %else:
- <td style = "text-align : right;"> </td>
- %endif
- </tr>
- </table>
- </td>
- </tr>
- </tbody>
- </table>
-
- <p class = "slogan">${company.rml_header1}</p>
- <hr />${_debug or ''|n} </body>
-</html>
-"""
-
- def _get_default_footer(self,cr,uid,ids):
- return """
-<html>
- <head>
- <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
- <script>
- function subst() {
- var vars={};
- var x=document.location.search.substring(1).split('&');
- for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
- var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
- for(var i in x) {
- var y = document.getElementsByClassName(x[i]);
- for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
- }
- }
- </script>
- <style type="text/css">
- ${css}
- </style>
- </head>
- <body class = "footer" onload="subst()">
- <table class = "footer_table">
- <tr><td><p class ="company_footer">${company.webkit_footer1 or ' '}</p></td></tr>
- <tr><td><p class ="company_footer">${company.webkit_footer2 or ' '}</p></td><td style="text-align:right;font-size:12;">Page <span class="page"/></td><td style="text-align:left;font-size:12;"> of <span class="topage"/></td></tr>
- <tr><td><p class ="company_footer">${company.webkit_footer3 or ' '}</p></td></tr>
- </table>
- </body>
-</html>
- """
- def _get_default_css(self,cr,uid,ids):
- return """
- .header {
- padding : 200px 10px 5px 10px;
- border:0; margin: 0;
- }
- .header-table {
- width: 100%;
- padding-top: 8%;
- }
- .partner-table {
- width: 100%;
- font-family: Arial,Verdana, Sans, Serif;
- font-size: 12;
- }
-
- #data-table {
- width: 100%;
- padding-top: 20px;
- font-family: Arial,Verdana, Sans, Serif;
- font-size: 12;
- }
- #data-table th{
- border-bottom:2px solid black;
- text-align:center;
- font-size:12;
- font-weight:bold;
- padding-right:3px;
- padding-left:3px;
- }
- #data-table thead {
- display:table-header-group;
- }
-
- .title {
- font-size:16;
- font-weight: bold;
- }
-
- .company_address{
- width : 100%;
- text-align: right;
- font-family: Arial,Verdana, Sans, Serif;
- font-size: 13;
- }
-
- .company_data {
- width : 100%;
- text-align: center;
- font-family: Arial,Verdana, Sans, Serif;
- font-size: 13;
-
- }
-
- .company_footer {
- font-family: Arial,Verdana, Sans, Serif;
- font-size: 8.4;
- font-style : italic;
- }
- .footer {
- border-top: 1px solid black;
- width: 100%;
- border:0; margin: 0;
- padding-bottom: 300px;
- }
-
- .data {
- padding : 5px 10px 10px 10px;
- border:0; margin: 0;
- }
-
- .footer_table {
- width: 100%;
- padding-bottom: 150px;
- border-top: 1px solid black;
- }
-
- .slogan {
- font-family: Arial,Verdana, Sans, Serif;
- font-size: 10;
- font-style : italic;
- color : #888888;
- }
-
- #notes_table {
- font-family: Arial,Verdana, Sans, Serif;
- font-size: 12;
- font-style : italic;
- width:65%;
- border-collapse:separate;
- border-spacing:10px;
- }
- #notes_table td{
- background-color: #eee;
- padding: 10px
- }
-
- .document_data {
- font-family: Arial,Verdana, Sans, Serif;
- font-size: 13;
- width : 100%;
- }
-
- #data-table tbody tr.even td {
- background-color: #eee;
- }
- #data-table tbody tr.odd td {
- background-color: #fff;
- }
-
- .notes{
- padding-top : 0px;
- margin-left: 5px;
- font-style : italic;
- }
- #desc_col{
- width : 380px;
- }
-
- """
- def create(self,cr,uid, vals,context=None):
- company_id = super(company_webkit,self).create(cr,uid,vals,context)
- obj_company = self.pool.get('res.company').browse(cr,uid,company_id)
-
- vals = {
- 'name' : 'Base ' + obj_company.name,
- 'html': obj_company._get_default_header(),
- 'css' : obj_company._get_default_css(),
- 'footer_html' : obj_company._get_default_footer(),
- 'margin_top' : 55.00,
- 'margin_bottom' : 24.00,
- 'orientation' : 'Portrait',
- 'format' : 'Letter',
- }
- register_id = self.pool.get('ir.header_webkit').search(cr,uid,[('name','=', 'Base ' + obj_company.name)])
- if not register_id:
- #obj_header = super(rent_contract,self).create(cr,uid,vals,context)
- obj_company.write({'header_webkit' : [(0,0, vals)]})
- return obj_company.id
-
- _columns = {
- 'webkit_footer1': fields.char('Report Footer 1', size=200),
- 'webkit_footer2': fields.char('Report Footer 2', size=200),
- 'webkit_footer3': fields.char('Report Footer 3', size=200),
- }
-company_webkit()
=== removed file 'TODO-6.1/company_webkit/company_webkit_view.xml'
--- TODO-6.1/company_webkit/company_webkit_view.xml 2012-06-30 22:41:06 +0000
+++ TODO-6.1/company_webkit/company_webkit_view.xml 1970-01-01 00:00:00 +0000
@@ -1,28 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<openerp>
- <data>
-
- <!--
- ======================================
- accounts
- ======================================
- -->
-
- <record model = "ir.ui.view" id = "view_webkit_company_form">
- <field name = "name">res.company.form</field>
- <field name = "model">res.company</field>
- <field name = "type">form</field>
- <field name="inherit_id" ref="report_webkit.currency_del_img"/>
- <field name = "arch" type = "xml">
- <data>
- <field name = "lib_path" position = "after">
- <field name = "webkit_footer1"/>
- <field name = "webkit_footer2"/>
- <field name = "webkit_footer3"/>
- </field>
- </data>
- </field>
- </record>
- </data>
-</openerp>
-
=== added directory 'TODO-7.0'
=== renamed directory 'account_account_rename' => 'TODO-7.0/account_account_rename'
=== renamed directory 'account_multicompany_relation' => 'TODO-7.0/account_multicompany_relation'
=== renamed directory 'account_parser_type' => 'TODO-7.0/account_parser_type'
=== renamed directory 'account_template_chart_name' => 'TODO-7.0/account_template_chart_name'
=== renamed directory 'account_webkit_report_library' => 'TODO-7.0/account_webkit_report_library'
=== renamed directory 'base_partner_code' => 'TODO-7.0/base_partner_code'
=== renamed directory 'base_partner_merge_ccorp' => 'TODO-7.0/base_partner_merge_ccorp'
=== renamed directory 'base_partner_search_extended' => 'TODO-7.0/base_partner_search_extended'
=== renamed directory 'base_partner_sequence_ccorp' => 'TODO-7.0/base_partner_sequence_ccorp'
=== renamed directory 'base_toolbar_custom_actions' => 'TODO-7.0/base_toolbar_custom_actions'
=== renamed directory 'bom_price_update' => 'TODO-7.0/bom_price_update'
=== renamed directory 'generic_instance_merge' => 'TODO-7.0/generic_instance_merge'
=== renamed directory 'hr_contract_name' => 'TODO-7.0/hr_contract_name'
=== renamed directory 'hr_payroll_sort_employees' => 'TODO-7.0/hr_payroll_sort_employees'
=== renamed directory 'magento_stadistic' => 'TODO-7.0/magento_stadistic'
=== renamed directory 'modules_magento_7' => 'TODO-7.0/modules_magento_7'
=== renamed directory 'mrp_production_sequence' => 'TODO-7.0/mrp_production_sequence'
=== renamed directory 'product_cost_group' => 'TODO-7.0/product_cost_group'
=== renamed directory 'product_search_improver' => 'TODO-7.0/product_search_improver'
=== renamed directory 'purchase_order_archive' => 'TODO-7.0/purchase_order_archive'
=== renamed directory 'purchase_order_sequence' => 'TODO-7.0/purchase_order_sequence'
=== renamed directory 'purchase_order_supplier_domain' => 'TODO-7.0/purchase_order_supplier_domain'
=== renamed directory 'rent' => 'TODO-7.0/rent'
=== renamed directory 'sale_order_line_ccorp' => 'TODO-7.0/sale_order_line_ccorp'
=== renamed directory 'sale_order_sequence' => 'TODO-7.0/sale_order_sequence'
=== renamed directory 'sneldev_magento' => 'TODO-7.0/sneldev_magento'
=== modified file 'TODO-7.0/sneldev_magento/wizard/export_tools.py'
--- sneldev_magento/wizard/export_tools.py 2012-09-10 15:35:49 +0000
+++ TODO-7.0/sneldev_magento/wizard/export_tools.py 2013-11-06 21:08:00 +0000
@@ -26,8 +26,6 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
-
-import wizard
import pooler
import threading
=== modified file 'TODO-7.0/sneldev_magento/wizard/sneldev_magento_categories_export.py'
--- sneldev_magento/wizard/sneldev_magento_categories_export.py 2012-09-13 21:23:10 +0000
+++ TODO-7.0/sneldev_magento/wizard/sneldev_magento_categories_export.py 2013-11-06 21:08:00 +0000
@@ -21,8 +21,6 @@
import pooler
-import wizard
-import pooler
import os
from export_tools import *
=== modified file 'TODO-7.0/sneldev_magento/wizard/sneldev_magento_categories_import.py'
--- sneldev_magento/wizard/sneldev_magento_categories_import.py 2012-09-10 15:35:49 +0000
+++ TODO-7.0/sneldev_magento/wizard/sneldev_magento_categories_import.py 2013-11-06 21:08:00 +0000
@@ -19,9 +19,6 @@
#
##############################################################################
-
-import pooler
-import wizard
import pooler
import os
@@ -46,4 +43,4 @@
wiz_sneldev_categories_import()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'TODO-7.0/sneldev_magento/wizard/sneldev_magento_customers_import.py'
--- sneldev_magento/wizard/sneldev_magento_customers_import.py 2012-10-03 21:45:53 +0000
+++ TODO-7.0/sneldev_magento/wizard/sneldev_magento_customers_import.py 2013-11-06 21:08:00 +0000
@@ -20,8 +20,6 @@
##############################################################################
import pooler
-import wizard
-import pooler
import os
from export_tools import *
=== modified file 'TODO-7.0/sneldev_magento/wizard/sneldev_magento_orders_import.py'
--- sneldev_magento/wizard/sneldev_magento_orders_import.py 2012-10-03 21:45:53 +0000
+++ TODO-7.0/sneldev_magento/wizard/sneldev_magento_orders_import.py 2013-11-06 21:08:00 +0000
@@ -21,8 +21,6 @@
import pooler
-import wizard
-import pooler
import os
from export_tools import *
@@ -54,4 +52,4 @@
wiz_sneldev_orders_import()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'TODO-7.0/sneldev_magento/wizard/sneldev_magento_products_export.py'
--- sneldev_magento/wizard/sneldev_magento_products_export.py 2012-09-17 16:07:49 +0000
+++ TODO-7.0/sneldev_magento/wizard/sneldev_magento_products_export.py 2013-11-06 21:08:00 +0000
@@ -21,8 +21,6 @@
import pooler
-import wizard
-import pooler
import os
from export_tools import *
=== modified file 'TODO-7.0/sneldev_magento/wizard/sneldev_magento_products_import.py'
--- sneldev_magento/wizard/sneldev_magento_products_import.py 2012-10-16 22:33:14 +0000
+++ TODO-7.0/sneldev_magento/wizard/sneldev_magento_products_import.py 2013-11-06 21:08:00 +0000
@@ -19,9 +19,6 @@
#
##############################################################################
-
-import pooler
-import wizard
import pooler
import os
=== modified file 'TODO-7.0/sneldev_magento/wizard/sneldev_magento_stock_export.py'
--- sneldev_magento/wizard/sneldev_magento_stock_export.py 2012-09-11 15:05:32 +0000
+++ TODO-7.0/sneldev_magento/wizard/sneldev_magento_stock_export.py 2013-11-06 21:08:00 +0000
@@ -19,9 +19,6 @@
#
##############################################################################
-
-import pooler
-import wizard
import pooler
import os
@@ -47,4 +44,4 @@
wiz_sneldev_stock_export()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'TODO-7.0/sneldev_magento/wizard/sneldev_magento_stock_init.py'
--- sneldev_magento/wizard/sneldev_magento_stock_init.py 2012-09-10 15:35:49 +0000
+++ TODO-7.0/sneldev_magento/wizard/sneldev_magento_stock_init.py 2013-11-06 21:08:00 +0000
@@ -21,8 +21,6 @@
import pooler
-import wizard
-import pooler
import os
from export_tools import *
=== modified file 'TODO-7.0/sneldev_magento/wizard/sneldev_magento_sync_start.py'
--- sneldev_magento/wizard/sneldev_magento_sync_start.py 2012-09-10 15:35:49 +0000
+++ TODO-7.0/sneldev_magento/wizard/sneldev_magento_sync_start.py 2013-11-06 21:08:00 +0000
@@ -21,8 +21,6 @@
import pooler
-import wizard
-import pooler
import os
from export_tools import *
@@ -44,4 +42,4 @@
wiz_sneldev_sync_start()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'TODO-7.0/sneldev_magento/wizard/sneldev_magento_sync_stop.py'
--- sneldev_magento/wizard/sneldev_magento_sync_stop.py 2012-09-10 15:35:49 +0000
+++ TODO-7.0/sneldev_magento/wizard/sneldev_magento_sync_stop.py 2013-11-06 21:08:00 +0000
@@ -21,8 +21,6 @@
import pooler
-import wizard
-import pooler
import os
from export_tools import *
@@ -44,4 +42,4 @@
wiz_sneldev_sync_stop()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== renamed directory 'stock_extended' => 'TODO-7.0/stock_extended'
=== added directory 'account_account_extended_ccorp'
=== added file 'account_account_extended_ccorp/__init__.py'
--- account_account_extended_ccorp/__init__.py 1970-01-01 00:00:00 +0000
+++ account_account_extended_ccorp/__init__.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,26 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import account_account_extended_ccorp
+import account_move_line_extended
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'account_account_extended_ccorp/__openerp__.py'
--- account_account_extended_ccorp/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_account_extended_ccorp/__openerp__.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,47 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+{
+ 'name': 'Account Account extended ccorp',
+ 'version': '1.0',
+ 'author' : 'CLEARCORP S.A.',
+ 'complexity': 'normal',
+ 'website': 'http://clearcorp.co.cr',
+ 'category': 'Accounting & Finance',
+ 'description': """
+Extends account account and account move line
+===============================================
+Adds a boolean attribute to diferentiate accounts that move cash.
+Adds filters to account move line: Currency and account type
+""",
+ 'depends': ['account'],
+ 'init_xml': [],
+ 'demo_xml': [],
+ 'data': [
+ 'account_account_extended_ccorp_view.xml',
+ 'account_move_line_extended.xml'],
+ 'license': 'AGPL-3',
+ 'installable': True,
+ 'active': False,
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'account_account_extended_ccorp/account_account_extended_ccorp.py'
--- account_account_extended_ccorp/account_account_extended_ccorp.py 1970-01-01 00:00:00 +0000
+++ account_account_extended_ccorp/account_account_extended_ccorp.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,31 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import osv,fields
+
+class AccountAccount(osv.osv):
+
+ _inherit = 'account.account'
+ _columns = {
+ 'moves_cash': fields.boolean('Moves cash'),
+ }
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'account_account_extended_ccorp/account_account_extended_ccorp_view.xml'
--- account_account_extended_ccorp/account_account_extended_ccorp_view.xml 1970-01-01 00:00:00 +0000
+++ account_account_extended_ccorp/account_account_extended_ccorp_view.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,20 @@
+<openerp>
+ <data>
+
+ <!--
+ Account
+ -->
+ <record id="view_account_ccorp_form" model="ir.ui.view">
+ <field name="name">view.account.ccorp.form</field>
+ <field name="model">account.account</field>
+ <field name="inherit_id" ref="account.view_account_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <field name="reconcile" position="after">
+ <field name="moves_cash"/>
+ </field>
+ </data>
+ </field>
+ </record>
+ </data>
+</openerp>
=== added file 'account_account_extended_ccorp/account_move_line_extended.py'
--- account_account_extended_ccorp/account_move_line_extended.py 1970-01-01 00:00:00 +0000
+++ account_account_extended_ccorp/account_move_line_extended.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,55 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import osv,fields, orm
+
+class accountMovelineInherit(orm.Model):
+
+ _inherit = "account.move.line"
+
+ #===== Add currency and account_type with two function fields
+
+ #===== Currency -> get currency_id from company_id or account_id
+ def _currency_filter(self, cr, uid, ids, field_name, arg, context=None):
+ result = {}
+ for rec in self.browse(cr, uid, ids, context=context):
+ if rec.account_id.currency_id:
+ result[rec.id] = (rec.account_id.currency_id.id,rec.account_id.currency_id.name)
+ else:
+ result[rec.id] = (rec.company_id.currency_id.id,rec.company_id.currency_id.name)
+ return result
+
+ #====== Account Type -> get user_type from account_id
+ def _account_type_filter(self, cr, uid, ids, field_name, arg, context=None):
+ result = {}
+ for rec in self.browse(cr, uid, ids, context=context):
+ result[rec.id] = (rec.account_id.user_type.id, rec.account_id.user_type.name)
+ return result
+
+ _columns = {
+ 'currency_filter':fields.function(_currency_filter, string='Currency', type="many2one", relation='res.currency',store=True),
+ 'account_type':fields.function(_account_type_filter, string='Account Type', type='many2one', relation='account.account.type',store=True)
+ }
+
+
+
+
\ No newline at end of file
=== added file 'account_account_extended_ccorp/account_move_line_extended.xml'
--- account_account_extended_ccorp/account_move_line_extended.xml 1970-01-01 00:00:00 +0000
+++ account_account_extended_ccorp/account_move_line_extended.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<openerp>
+ <data>
+ <record id="view_move_line_filter_inherit" model="ir.ui.view">
+ <field name="name">view.move.line.filter.inherit</field>
+ <field name="model">account.move.line</field>
+ <field name="inherit_id" ref="account.view_account_move_line_filter"/>
+ <field name="arch" type="xml">
+ <data>
+ <field name="name" position="after">
+ <field name="account_type" context="{'account_type':self}" widget="selection"/>
+ </field>
+ <group string="Group By..." position="inside">
+ <filter string="Currency" icon="terp-stock_symbol-selection" domain="" context="{'group_by':'currency_filter'}"/>
+ <filter string="Account Type" icon="terp-stock_symbol-selection" domain="" context="{'group_by':'account_type'}"/>
+ </group>
+ </data>
+ </field>
+ </record>
+
+ <record id="view_move_line_tree_inherit" model="ir.ui.view">
+ <field name="name">view.move.line.tree.inherit</field>
+ <field name="model">account.move.line</field>
+ <field name="inherit_id" ref="account.view_move_line_tree"/>
+ <field name="arch" type="xml">
+ <data>
+ <field name="reconcile" position="after">
+ <field name="currency_filter"/>
+ <field name="account_type"/>
+ </field>
+ </data>
+ </field>
+ </record>
+ </data>
+</openerp>
=== added directory 'account_account_extended_ccorp/i18n'
=== added file 'account_account_extended_ccorp/i18n/en_US.po'
--- account_account_extended_ccorp/i18n/en_US.po 1970-01-01 00:00:00 +0000
+++ account_account_extended_ccorp/i18n/en_US.po 2013-11-06 21:08:00 +0000
@@ -0,0 +1,27 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * account_account_extended_ccorp
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-08-16 20:51+0000\n"
+"PO-Revision-Date: 2013-08-16 20:51+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: account_account_extended_ccorp
+#: field:account.account,moves_cash:0
+msgid "Moves cash"
+msgstr "Moves cash"
+
+#. module: account_account_extended_ccorp
+#: model:ir.model,name:account_account_extended_ccorp.model_account_account
+msgid "Account"
+msgstr "Account"
+
=== added file 'account_account_extended_ccorp/i18n/es_CR.po'
--- account_account_extended_ccorp/i18n/es_CR.po 1970-01-01 00:00:00 +0000
+++ account_account_extended_ccorp/i18n/es_CR.po 2013-11-06 21:08:00 +0000
@@ -0,0 +1,49 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * account_account_extended_ccorp
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-09-20 22:09+0000\n"
+"PO-Revision-Date: 2013-09-20 22:09+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: account_account_extended_ccorp
+#: field:account.account,moves_cash:0
+msgid "Moves cash"
+msgstr "Mueve efectivo"
+
+#. module: account_account_extended_ccorp
+#: model:ir.model,name:account_account_extended_ccorp.model_account_account
+msgid "Account"
+msgstr "Cuenta"
+
+#. module: account_account_extended_ccorp
+#: view:account.move.line:0
+msgid "Group By..."
+msgstr "Agrupar por..."
+
+#. module: account_account_extended_ccorp
+#: view:account.move.line:0
+#: field:account.move.line,currency_filter:0
+msgid "Currency"
+msgstr "Divisa"
+
+#. module: account_account_extended_ccorp
+#: model:ir.model,name:account_account_extended_ccorp.model_account_move_line
+msgid "Journal Items"
+msgstr "Elementos diario"
+
+#. module: account_account_extended_ccorp
+#: view:account.move.line:0
+#: field:account.move.line,account_type:0
+msgid "Account Type"
+msgstr "Tipo de Cuenta"
+
=== added directory 'account_asset_extended_ccorp'
=== added file 'account_asset_extended_ccorp/__init__.py'
--- account_asset_extended_ccorp/__init__.py 1970-01-01 00:00:00 +0000
+++ account_asset_extended_ccorp/__init__.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import account_asset_extended_ccorp
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'account_asset_extended_ccorp/__openerp__.py'
--- account_asset_extended_ccorp/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_asset_extended_ccorp/__openerp__.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,46 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+{
+ 'name': 'Account Asset extended ccorp',
+ 'version': '1.0',
+ 'author' : 'CLEARCORP S.A.',
+ 'complexity': 'normal',
+ 'website': 'http://clearcorp.co.cr',
+ 'category': 'Accounting & Finance',
+ 'description': """
+Extend account asset
+==========================================
+Create relation asset with invoice line.
+Add model, asset number and responsible in assets.
+Modify in the creation of several assets on an invoice line.
+ """,
+ 'depends': ['account_asset'],
+ 'init_xml': [],
+ 'demo_xml': [],
+ 'data': ['account_asset_extended_ccorp_view.xml'],
+ 'license': 'AGPL-3',
+ 'installable': True,
+ 'active': False,
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'account_asset_extended_ccorp/account_asset_extended_ccorp.py'
--- account_asset_extended_ccorp/account_asset_extended_ccorp.py 1970-01-01 00:00:00 +0000
+++ account_asset_extended_ccorp/account_asset_extended_ccorp.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,77 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import osv,fields
+
+class AccountAssetAsset(osv.osv):
+
+ _inherit = 'account.asset.asset'
+ _columns = {
+ 'account_invoice_line_id': fields.many2one('account.invoice.line', 'Invoice Line'),
+ 'account_invoice_id': fields.related('account_invoice_line_id', 'invoice_id', type="many2one", relation="account.invoice", string="Invoice", store=False),
+ 'responsible' : fields.many2one('res.partner', 'Responsible'),
+ 'model': fields.char('Model', size=64),
+ 'asset_number': fields.char('Asset Number', size=64),
+ }
+
+class AccountInvoiceLine(osv.osv):
+
+ _inherit = 'account.invoice.line'
+ _columns = {
+ 'asset_ids': fields.one2many('account.asset.asset', 'account_invoice_line_id', 'Asset', readonly=True, states={'draft':[('readonly',False)]}),
+ }
+ def asset_create(self, cr, uid, lines, context=None):
+ context = context or {}
+ asset_obj = self.pool.get('account.asset.asset')
+ for line in lines:
+ if line.asset_category_id:
+ quantity = line.quantity
+ cont = 1
+ while cont <= quantity:
+ vals = {
+ 'name': line.name,
+ 'code': line.invoice_id.number or False,
+ 'category_id': line.asset_category_id.id,
+ 'purchase_value': line.price_subtotal/quantity,
+ 'period_id': line.invoice_id.period_id.id,
+ 'partner_id': line.invoice_id.partner_id.id,
+ 'company_id': line.invoice_id.company_id.id,
+ 'currency_id': line.invoice_id.currency_id.id,
+ 'purchase_date' : line.invoice_id.date_invoice,
+ }
+ changed_vals = asset_obj.onchange_category_id(cr, uid, [], vals['category_id'], context=context)
+ vals.update(changed_vals['value'])
+ vals.update({'account_invoice_line_id': line.id})
+ asset_id = asset_obj.create(cr, uid, vals, context=context)
+ if line.asset_category_id.open_asset:
+ asset_obj.validate(cr, uid, [asset_id], context=context)
+ cont+=1
+ return True
+
+ def copy_data(self, cr, uid, id, default=None, context=None):
+ res = super(AccountInvoiceLine, self).copy_data(cr, uid, id, default=default, context=context)
+ res.update({
+ 'asset_ids': [],
+ })
+ return res
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'account_asset_extended_ccorp/account_asset_extended_ccorp_view.xml'
--- account_asset_extended_ccorp/account_asset_extended_ccorp_view.xml 1970-01-01 00:00:00 +0000
+++ account_asset_extended_ccorp/account_asset_extended_ccorp_view.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,27 @@
+<openerp>
+ <data>
+
+ <!--
+ Asset
+ -->
+ <record id="view_account_asset_asset_ccorp_form" model="ir.ui.view">
+ <field name="name">view.account.asset.asset.ccorp.form</field>
+ <field name="model">account.asset.asset</field>
+ <field name="inherit_id" ref="account_asset.view_account_asset_asset_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/sheet/group/group/field[@name='parent_id']" position="after">
+ <field name="account_invoice_id" readonly="1"/>
+ </xpath>
+ <xpath expr="/form/sheet/group/group/field[@name='company_id']" position="after">
+ <field name="responsible"/>
+ </xpath>
+ <xpath expr="/form/sheet/notebook/page/group/group/field[@name='partner_id']" position="after">
+ <field name="model"/>
+ <field name="asset_number"/>
+ </xpath>
+ </data>
+ </field>
+ </record>
+ </data>
+</openerp>
=== added directory 'account_asset_extended_ccorp/i18n'
=== added file 'account_asset_extended_ccorp/i18n/account_asset_extended.pot'
--- account_asset_extended_ccorp/i18n/account_asset_extended.pot 1970-01-01 00:00:00 +0000
+++ account_asset_extended_ccorp/i18n/account_asset_extended.pot 2013-11-06 21:08:00 +0000
@@ -0,0 +1,49 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * account_asset_extended_ccorp
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-05-16 22:09+0000\n"
+"PO-Revision-Date: 2013-05-16 22:09+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: account_asset_extended_ccorp
+#: field:account.asset.asset,responsible:0
+msgid "Responsible"
+msgstr "Responsible"
+
+#. module: account_asset_extended_ccorp
+#: field:account.asset.asset,account_invoice_line_id:0
+#: model:ir.model,name:account_asset_extended_ccorp.model_account_invoice_line
+msgid "Invoice Line"
+msgstr "Línea factura"
+
+#. module: account_asset_extended_ccorp
+#: field:account.invoice.line,asset_ids:0
+#: model:ir.model,name:account_asset_extended_ccorp.model_account_asset_asset
+msgid "Asset"
+msgstr "Activo"
+
+#. module: account_asset_extended_ccorp
+#: field:account.asset.asset,account_invoice_id:0
+msgid "Invoice"
+msgstr "Invoice"
+
+#. module: account_asset_extended_ccorp
+#: field:account.asset.asset,asset_number:0
+msgid "Asset Number"
+msgstr "Asset Number"
+
+#. module: account_asset_extended_ccorp
+#: field:account.asset.asset,model:0
+msgid "Model"
+msgstr "Model"
+
=== added symlink 'account_asset_extended_ccorp/i18n/es.po'
=== target is u'es_CR.po'
=== added file 'account_asset_extended_ccorp/i18n/es_CR.po'
--- account_asset_extended_ccorp/i18n/es_CR.po 1970-01-01 00:00:00 +0000
+++ account_asset_extended_ccorp/i18n/es_CR.po 2013-11-06 21:08:00 +0000
@@ -0,0 +1,49 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * account_asset_extended_ccorp
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-05-16 22:09+0000\n"
+"PO-Revision-Date: 2013-05-16 22:09+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: account_asset_extended_ccorp
+#: field:account.asset.asset,responsible:0
+msgid "Responsible"
+msgstr "Responsable"
+
+#. module: account_asset_extended_ccorp
+#: field:account.asset.asset,account_invoice_line_id:0
+#: model:ir.model,name:account_asset_extended_ccorp.model_account_invoice_line
+msgid "Invoice Line"
+msgstr "Línea factura"
+
+#. module: account_asset_extended_ccorp
+#: field:account.invoice.line,asset_ids:0
+#: model:ir.model,name:account_asset_extended_ccorp.model_account_asset_asset
+msgid "Asset"
+msgstr "Activo"
+
+#. module: account_asset_extended_ccorp
+#: field:account.asset.asset,account_invoice_id:0
+msgid "Invoice"
+msgstr "Factura"
+
+#. module: account_asset_extended_ccorp
+#: field:account.asset.asset,asset_number:0
+msgid "Asset Number"
+msgstr "Número de Activo"
+
+#. module: account_asset_extended_ccorp
+#: field:account.asset.asset,model:0
+msgid "Model"
+msgstr "Modelo"
+
=== added directory 'account_general_ledger_report'
=== renamed directory 'account_general_ledger_report' => 'account_general_ledger_report.moved'
=== added file 'account_general_ledger_report/__init__.py'
--- account_general_ledger_report/__init__.py 1970-01-01 00:00:00 +0000
+++ account_general_ledger_report/__init__.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import report
+import wizard
\ No newline at end of file
=== added file 'account_general_ledger_report/__openerp__.py'
--- account_general_ledger_report/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_general_ledger_report/__openerp__.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,47 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+{
+ 'name': 'General Ledger Report Webkit',
+ 'version': '1.0',
+ 'url': 'http://launchpad.net/openerp-ccorp-addons',
+ 'author': 'ClearCorp S.A.',
+ 'website': 'http://clearcorp.co.cr',
+ 'category': 'Accounting & Finance',
+ 'complexity': 'normal',
+ 'description': """This module modifies the general ledger report""",
+ 'depends': [
+ 'account',
+ 'account_report_lib',
+ 'account_report_signatures'
+ ],
+ 'init_xml': [],
+ 'demo_xml': [],
+ 'update_xml': [
+ 'report/report.xml',
+ 'wizard/account_general_ledger_report_wizard.xml',
+ 'report_menus.xml',
+ ],
+ 'license': 'AGPL-3',
+ 'installable': True,
+ 'active': False,
+}
\ No newline at end of file
=== added directory 'account_general_ledger_report/i18n'
=== added file 'account_general_ledger_report/i18n/es_CR.po'
--- account_general_ledger_report/i18n/es_CR.po 1970-01-01 00:00:00 +0000
+++ account_general_ledger_report/i18n/es_CR.po 2013-11-06 21:08:00 +0000
@@ -0,0 +1,280 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * account_general_ledger_report
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-06-07 21:22+0000\n"
+"PO-Revision-Date: 2013-06-07 21:22+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: account_general_ledger_report
+#: view:general.ledger.wiz:0
+msgid "This report allows you to print or generate a pdf of your General Ledger"
+msgstr "Este reporte permite imprimir o generar un pdf del Libro mayor"
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:31
+msgid "Filter by: "
+msgstr "Filtrado por: "
+
+#. module: account_general_ledger_report
+#: field:general.ledger.wiz,amount_currency:0
+msgid "With Currency"
+msgstr "Con moneda"
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:104
+msgid "Label"
+msgstr "Etiqueta"
+
+#. module: account_general_ledger_report
+#: field:general.ledger.wiz,period_from:0
+msgid "Start Period"
+msgstr "Período inicial"
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:109
+msgid "Debit"
+msgstr "Débito"
+
+#. module: account_general_ledger_report
+#: view:general.ledger.wiz:0
+msgid "General Ledger"
+msgstr "Libro mayor"
+
+#. module: account_general_ledger_report
+#: help:general.ledger.wiz,historic_strict:0
+msgid "If selected, will display a historical unreconciled lines, taking into account the end of the period or date selected"
+msgstr "Si está selecciondo, desplegará las líneas no conciliadas históricas, dentro de la cuenta al final del período o de la fecha seleccionada"
+
+#. module: account_general_ledger_report
+#: field:general.ledger.wiz,special_period:0
+msgid "Special period"
+msgstr "Período especial"
+
+#. module: account_general_ledger_report
+#: field:general.ledger.wiz,company_id:0
+msgid "Company"
+msgstr "Compañía"
+
+#. module: account_general_ledger_report
+#: model:ir.model,name:account_general_ledger_report.model_general_ledger_wiz
+msgid "General Ledger Report Wizard"
+msgstr "Asistente para el Libro Mayor"
+
+#. module: account_general_ledger_report
+#: help:general.ledger.wiz,special_period:0
+msgid "Include special period"
+msgstr "Includir períodos especiales"
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:44
+msgid "Period: "
+msgstr "Período: "
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:100
+msgid "Period"
+msgstr "Período"
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:59
+msgid "Target moves: "
+msgstr "Movimientos destino: "
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:113
+msgid "Curr. Am."
+msgstr "Mon. M."
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:99
+#: selection:general.ledger.wiz,filter:0
+msgid "Date"
+msgstr "Fecha"
+
+#. module: account_general_ledger_report
+#: field:general.ledger.wiz,chart_account_id:0
+msgid "Chart of Account"
+msgstr "Catálogo de Cuentas"
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:162
+msgid "TOTAL"
+msgstr "TOTAL"
+
+#. module: account_general_ledger_report
+#: view:general.ledger.wiz:0
+#: field:general.ledger.wiz,journal_ids:0
+msgid "Journals"
+msgstr "Diarios"
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:114
+msgid "Curr. Bal."
+msgstr "Bal. M."
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:30
+msgid "Fiscal Year: "
+msgstr "Año fiscal: "
+
+#. module: account_general_ledger_report
+#: help:general.ledger.wiz,chart_account_id:0
+msgid "Select Charts of Accounts"
+msgstr "Selecccione el catálogo contable"
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:50
+msgid "Accounts: "
+msgstr "Cuentas: "
+
+#. module: account_general_ledger_report
+#: field:general.ledger.wiz,date_to:0
+msgid "End Date"
+msgstr "Fecha final"
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:15
+msgid "General Ledger Report "
+msgstr "Informe del libro mayor"
+
+#. module: account_general_ledger_report
+#: selection:general.ledger.wiz,target_move:0
+msgid "All Posted Entries"
+msgstr "Todos los apuntes publicados"
+
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:88
+msgid "No move lines for this account"
+msgstr "No existen líneas de asiento para esta cuenta"
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:47
+msgid "No filter"
+msgstr "Sin filtros"
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:111
+msgid "Cumul. Bal."
+msgstr "Bal Acumul."
+
+#. module: account_general_ledger_report
+#: help:general.ledger.wiz,fiscalyear_id:0
+msgid "Keep empty for all open fiscal year"
+msgstr "Mantener vacío para todos los años fiscales abiertos"
+
+#. module: account_general_ledger_report
+#: field:general.ledger.wiz,period_to:0
+msgid "End Period"
+msgstr "Período final"
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:110
+msgid "Credit"
+msgstr "Crédito"
+
+#. module: account_general_ledger_report
+#: field:general.ledger.wiz,fiscalyear_id:0
+msgid "Fiscal Year"
+msgstr "Año fiscal"
+
+#. module: account_general_ledger_report
+#: field:general.ledger.wiz,historic_strict:0
+msgid "Strict History"
+msgstr "Histórico estricto"
+
+#. module: account_general_ledger_report
+#: selection:general.ledger.wiz,filter:0
+msgid "No Filters"
+msgstr "Sin filtros"
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:101
+msgid "Entry"
+msgstr "Asiento"
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:56
+msgid "All"
+msgstr "Todo"
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:29
+msgid "Chart of Accounts: "
+msgstr "Catálogo de cuentas: "
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:107
+msgid "Reconcile"
+msgstr "Conciliación"
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:37
+msgid "Dates: "
+msgstr "Fechas: "
+
+#. module: account_general_ledger_report
+#: help:general.ledger.wiz,amount_currency:0
+msgid "It adds the currency column on report if the currency differs from the company currency."
+msgstr "Añade una columna de moneda en el reporte si la moneda es diferente de la moneda de la compañía"
+
+#. module: account_general_ledger_report
+#: field:general.ledger.wiz,target_move:0
+msgid "Target Moves"
+msgstr "Movimientos destino"
+
+#. module: account_general_ledger_report
+#: model:ir.actions.act_window,name:account_general_ledger_report.action_general_ledger_report_wizard
+msgid "General Ledger Report"
+msgstr "Informe del libro mayor"
+
+#. module: account_general_ledger_report
+#: field:general.ledger.wiz,account_ids:0
+msgid "Accounts"
+msgstr "Cuentas"
+
+#. module: account_general_ledger_report
+#: selection:general.ledger.wiz,filter:0
+msgid "Periods"
+msgstr "Períodos"
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:103
+msgid "Partner"
+msgstr "Empresa"
+
+#. module: account_general_ledger_report
+#: field:general.ledger.wiz,date_from:0
+msgid "Start Date"
+msgstr "Fecha inicial"
+
+#. module: account_general_ledger_report
+#: field:general.ledger.wiz,filter:0
+msgid "Filter by"
+msgstr "Filtrar por"
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:84
+msgid "Initial balance:"
+msgstr "Balance inicial:"
+
+#. module: account_general_ledger_report
+#: selection:general.ledger.wiz,target_move:0
+msgid "All Entries"
+msgstr "Todos los apuntes"
+
+#. module: account_general_ledger_report
+#: report:addons/account_general_ledger_report/report/account_general_ledger_report.mako:102
+msgid "Journal"
+msgstr "Diario"
+
=== added directory 'account_general_ledger_report/report'
=== added file 'account_general_ledger_report/report/__init__.py'
--- account_general_ledger_report/report/__init__.py 1970-01-01 00:00:00 +0000
+++ account_general_ledger_report/report/__init__.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import account_general_ledger_report
=== added file 'account_general_ledger_report/report/account_general_ledger_report.mako'
--- account_general_ledger_report/report/account_general_ledger_report.mako 1970-01-01 00:00:00 +0000
+++ account_general_ledger_report/report/account_general_ledger_report.mako 2013-11-06 21:08:00 +0000
@@ -0,0 +1,182 @@
+<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <link rel='stylesheet' href='addons/account_webkit_report_library/webkit_headers/main.css' />
+ <style>
+ ${css}
+ </style>
+ </head>
+ <body>
+ <div class="table header">
+ <div class="table-row">
+ <div class="table-cell logo">${helper.embed_logo_by_name('default_logo', height=70)|n}</div>
+ <br/>
+ <div class="table-cell text">
+ <p class="title">${_('General Ledger Report ')}</p>
+ </div>
+ </div>
+ </div>
+ <br/>
+ <%
+ chart_account = get_chart_account_id(data)
+ fiscalyear = get_fiscal_year(data)
+ filter = get_filter(data)
+ %>
+
+ <div class="table list">
+ <div class="table-header">
+ <div class="table-row labels no-wrap">
+ <div class="table-cell first-column" style="width: 70px">${_('Chart of Accounts: ')}<br/>${chart_account.name}</div>
+ <div class="table-cell" style="width: 70px">${_('Fiscal Year: ')}<br/>${fiscalyear.name}</div>
+ <div class="table-cell" style="width: 70px">${_('Filter by: ')}<br/>
+ %if filter == 'filter_date':
+ <%
+ start_date = get_date_from(data)
+ stop_date = get_date_to(data)
+ %>
+ ${_('Dates: ')}<br/>
+ ${formatLang(start_date, date=True) if start_date else u'' } - ${formatLang(stop_date, date=True) if start_date else u'' }
+ %elif filter == 'filter_period':
+ <%
+ start_period = get_start_period(data)
+ stop_period = get_end_period(data)
+ %>
+ ${_('Period: ')}<br/>
+ ${start_period.name if start_period else u''} - ${stop_period.name if stop_period else u'' }
+ %else:
+ ${_('No filter')}
+ %endif
+ </div>
+ <div class="table-cell" style="width: 70px">${_('Accounts: ')}<br/>
+ %if get_accounts_ids(cr, uid, data):
+ %for account in get_accounts_ids(cr, uid, data):
+ ${(account.code) + ','}<br/>
+ %endfor
+ %else:
+ ${_('All')}
+ %endif
+ </div>
+ <div class="table-cell" style="width: 70px">${_('Target moves: ')}<br/>${ display_target_move(data) }</div>
+ </div>
+ </div>
+ </div>
+ <%
+ account_list_obj, account_lines, account_conciliation, account_balance = get_data(cr, uid, data)
+ cumul_balance_curr = 0.0
+ %>
+ %for account in account_list_obj:
+ <%
+ cumul_balance = account_balance[account.id]['balance'] or 0.0
+
+ if 'foreign_balance' in account_balance[account.id].keys():
+ cumul_balance_curr = account_balance[account.id]['foreign_balance']
+
+ amount_total_debit = amount_total_credit = amount_total_curr = 0.0
+ print_column = False
+ move_lines = []
+ %>
+ %if account.type != 'view':
+ <br/><br/>
+ <div class="table header">
+ <div class="table-row">
+ <div class="table-cell text">
+ <p class="subtitle">${account.code +' - ' +account.name}</p>
+ <p class="subtitle">${_('Initial balance:')} ${formatLang(cumul_balance)}
+ %if account.report_currency_id:
+ ${account.report_currency_id.position == 'before' and (account.report_currency_id.symbol+' ') or ''}${formatLang(cumul_balance_curr)}${account.report_currency_id.position == 'after' and (' '+account.report_currency_id.symbol) or ''}
+ %endif
+ ${account.id not in account_lines.keys() and _('No move lines for this account') or ''}
+ </p>
+ </div>
+ </div>
+ </div>
+ %if account.id in account_lines.keys():
+ <% move_lines = account_lines[account.id] %>
+
+ <div class="table list">
+ <div class="table-header">
+ <div class="table-row labels no-wrap">
+ <div class="table-cell first-column" style="width: 55px">${_('Date')}</div>
+ <div class="table-cell" style="width: 70px">${_('Period')}</div>
+ <div class="table-cell" style="width: 100px">${_('Entry')}</div>
+ <div class="table-cell" style="width: 70px">${_('Journal')}</div>
+ <div class="table-cell" style="width: 100px">${_('Partner')}</div>
+ <div class="table-cell" style="width: 100px">${_('Label')}</div>
+ %if account.reconcile or (account.id in account_conciliation.keys() and account_conciliation[account.id]):
+ <% print_column = True %>
+ <div class="table-cell" style="width: 75px">${_('Reconcile')}</div>
+ %endif
+ <div class="table-cell amount" style="width: 60px">${_('Debit')}</div>
+ <div class="table-cell amount" style="width: 60px">${_('Credit')}</div>
+ <div class="table-cell amount" style="width: 60px">${_('Cumul. Bal.')}</div>
+ %if account.report_currency_id:
+ <div class="table-cell amount" style="width: 60px">${_('Curr. Am.')}</div>
+ <div class="table-cell amount last-column" style="width: 60px">${_('Curr. Bal.')}</div>
+ %endif
+ </div>
+ </div>
+ <div class="table-body">
+ %for line in move_lines:
+ <%
+ amount_total_debit += line.debit
+ amount_total_credit += line.credit
+
+ cumul_balance = cumul_balance + line.debit - line.credit
+ if line.amount_currency:
+ cumul_balance_curr = cumul_balance_curr + line.amount_currency
+ amount_total_curr += line.amount_currency
+ %>
+ <div class="table-row ${row_even and 'even' or 'odd'}">
+ <div class="table-cell first-column">${formatLang(line.date, date=True)}</div>
+ <div class="table-cell">${line.period_id.name or ''}</div>
+ <div class="table-cell">${line.move_id.name or ''}</div>
+ <div class="table-cell">${line.journal_id.name}</div>
+ <div class="table-cell">${line.partner_id.name or ''}</div>
+ <div class="table-cell">${line.name or ''}</div>
+ %if print_column:
+ <div class="table-cell">
+ ${line.id in account_conciliation[account.id].keys() and account_conciliation[account.id][line.id] or ''}
+ </div>
+ %endif
+ <div class="table-cell amount">${formatLang(line.debit)}</div>
+ <div class="table-cell amount"> ${formatLang(line.credit)}</div>
+ <div class="table-cell amount last-column"> ${formatLang(cumul_balance)}</div>
+ %if account.report_currency_id:
+ <div class="table-cell amount"> ${line.amount_currency and formatLang(line.amount_currency) or ''}</div>
+ <div class="table-cell amount last-column"> ${formatLang(cumul_balance_curr)}</div>
+ %endif
+ </div>
+ %endfor
+ <div class="table-row spacer">
+ <div class="table-cell"> </div>
+ </div>
+ <div class="table-row subtotal">
+ <div class="table-cell first-column"> </div>
+ <div class="table-cell"> </div>
+ <div class="table-cell"> </div>
+ <div class="table-cell"> </div>
+ <div class="table-cell"> </div>
+ %if print_column:
+ <div class="table-cell"> </div>
+ %endif
+ <div class="table-cell">${_('TOTAL')}</div>
+ <div class="table-cell amount" >${formatLang(amount_total_debit)}</div>
+ <div class="table-cell amount" > ${formatLang(amount_total_credit)}</div>
+ %if account.report_currency_id:
+ <div class="table-cell amount"> ${formatLang(cumul_balance)}</div>
+ <div class="table-cell amount"> ${formatLang(amount_total_curr)}</div>
+ <div class="table-cell amount last-column"> ${formatLang(cumul_balance_curr)}</div>
+ %else:
+ <div class="table-cell amount last-column"> ${formatLang(cumul_balance)}</div>
+ %endif
+ </div>
+ <%
+ amount_total_debit = amount_total_credit = 0.0
+ %>
+ </div>
+ </div>
+ %endif
+ %endif
+ %endfor
+ </body>
+</html>
=== added file 'account_general_ledger_report/report/account_general_ledger_report.py'
--- account_general_ledger_report/report/account_general_ledger_report.py 1970-01-01 00:00:00 +0000
+++ account_general_ledger_report/report/account_general_ledger_report.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,179 @@
+#-*- coding:utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# d$
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import pooler
+from openerp.addons.account_report_lib.account_report_base import accountReportbase
+from report import report_sxw
+
+class GeneralLedgerReportWebkit(accountReportbase):
+
+ def __init__(self, cr, uid, name, context):
+ super(GeneralLedgerReportWebkit, self).__init__(cr, uid, name, context=context)
+ self.pool = pooler.get_pool(self.cr.dbname)
+ self.cursor = self.cr
+
+ self.localcontext.update({
+ 'cr': cr,
+ 'uid': uid,
+ 'get_chart_account_id': self.get_chart_account_id,
+ 'get_fiscalyear': self.get_fiscalyear,
+ 'get_filter': self.get_filter,
+ 'get_accounts_ids': self.get_accounts_ids,
+ 'get_data':self.get_data,
+ })
+
+ def get_data(self, cr, uid, data):
+ filter_data = []
+ account_list = []
+ account_selected = []
+
+ account_lines = {}
+ account_balance = {}
+ account_conciliation = {}
+
+ library_obj = self.pool.get('account.webkit.report.library')
+
+ filter_type = self.get_filter(data)
+ chart_account = self.get_chart_account_id(data)
+
+ if filter_type == 'filter_date':
+ start_date = self.get_date_from(data)
+ stop_date = self.get_date_to(data)
+
+ filter_data.append(start_date)
+ filter_data.append(stop_date)
+
+ elif filter_type == 'filter_period':
+
+ start_period = self.get_start_period(data) #return the period object
+ stop_period = self.get_end_period(data)
+
+ filter_data.append(start_period)
+ filter_data.append(stop_period)
+
+ else:
+ filter_type = ''
+
+ fiscalyear = self.get_fiscalyear(data)
+ target_move = self.get_target_move(data)
+
+ #From the wizard can select specific account, extract this accounts
+ account_selected = self.get_accounts_ids(cr, uid, data)
+
+ if not account_selected:
+ account_selected = [chart_account.id]
+ account_list_ids = library_obj.get_account_child_ids(cr, uid, account_selected) #get all the accounts in the chart_account_id
+
+ #Extract the id for the browse record
+ else:
+ account_ids = []
+ for account in account_selected:
+ account_ids.append(account.id)
+ account_list_ids = library_obj.get_account_child_ids(cr, uid, account_ids) #get all the accounts in the chart_account_id
+
+ account_list_obj = self.pool.get('account.account').browse(cr, uid, account_list_ids)
+
+ #Get the move_lines for each account.
+ move_lines = library_obj.get_move_lines(cr, 1,
+ account_list_ids,
+ filter_type=filter_type,
+ filter_data=filter_data,
+ fiscalyear=fiscalyear,
+ target_move=target_move,
+ order_by='account_id asc, date asc, ref asc')
+
+
+ #Reconcile -> show reconcile in the mako.
+ '''
+ First, if the account permit reconcile (reconcile == True), add to the dictionary.
+ If the account don't allow the reconcile, search if the lines have reconcile_id or partial_reconcile_id
+ If the account allow the reconcile or the lines have reconcile_id or partial_reconcile_id, add in the dictionary
+ and show in the mako the column "Reconcile"
+
+ the final result is:
+ {account_id: {line.id: [conciliation_name]}}
+ '''
+ #Search if the move_lines have partial or reconcile id
+ for line in move_lines:
+ #If the account have reconcile, add to the dictionary
+ if line.account_id.id not in account_conciliation:
+ account_conciliation[line.account_id.id] = {}
+
+ if line.reconcile_id and line.reconcile_id.name != '':
+ account_conciliation[line.account_id.id][line.id] = line.reconcile_id.name
+
+ elif line.reconcile_partial_id and line.reconcile_partial_id.name != '':
+ str_name = 'P: ' + line.reconcile_partial_id.name
+ #conciliation_lines.append(str_name)
+ account_conciliation[line.account_id.id][line.id] = str_name
+
+ if line.account_id.id not in account_lines:
+ account_lines[line.account_id.id] = []
+
+ account_lines[line.account_id.id].append(line)
+
+ fields = ['balance']
+ if self.get_amount_currency(data):
+ fields.append('foreign_balance')
+
+ if filter_type == 'filter_date':
+ account_balance = library_obj.get_account_balance(cr, uid,
+ account_list_ids,
+ fields,
+ initial_balance=True,
+ company_id=chart_account.company_id.id,
+ fiscal_year_id = fiscalyear.id,
+ state = target_move,
+ start_date = start_date,
+ end_date = stop_date,
+ chart_account_id = chart_account.id,
+ filter_type=filter_type)
+ elif filter_type == 'filter_period':
+ account_balance = library_obj.get_account_balance(cr, uid,
+ account_list_ids,
+ fields,
+ initial_balance=True,
+ company_id=chart_account.company_id.id,
+ fiscal_year_id = fiscalyear.id,
+ state = target_move,
+ start_period_id = start_period.id,
+ end_period_id = stop_period.id,
+ chart_account_id = chart_account.id,
+ filter_type=filter_type)
+ else:
+ account_balance = library_obj.get_account_balance(cr, uid,
+ account_list_ids,
+ fields,
+ initial_balance=True,
+ company_id=chart_account.company_id.id,
+ fiscal_year_id = fiscalyear.id,
+ state = target_move,
+ chart_account_id = chart_account.id,
+ filter_type=filter_type)
+
+
+ return account_list_obj, account_lines, account_conciliation, account_balance
+
+report_sxw.report_sxw('report.account_general_ledger_webkit',
+ 'account.account',
+ 'addons/account_general_ledger_report/report/account_general_ledger_report.mako',
+ parser=GeneralLedgerReportWebkit)
\ No newline at end of file
=== added file 'account_general_ledger_report/report/report.xml'
--- account_general_ledger_report/report/report.xml 1970-01-01 00:00:00 +0000
+++ account_general_ledger_report/report/report.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="account.account_general_ledger" model="ir.actions.report.xml">
+ <field name="report_type">webkit</field>
+ <field name="report_name">account_general_ledger_webkit</field>
+ <field eval="[(6,0,[])]" name="groups_id"/>
+ <field name="model">account.account</field>
+ <field name="type">ir.actions.report.xml</field>
+ <field name="name">General Ledger Webkit</field>
+ <field name="report_rml">account_general_ledger_report/report/account_general_ledger_report.mako</field>
+ <field name="report_file">account_general_ledger_report/report/account_general_ledger_report.mako</field>
+ <field name="webkit_header" ref="report_webkit_lib.webkit_header_clearcorp_official_portrait" />
+ </record>
+ </data>
+</openerp>
=== added file 'account_general_ledger_report/report_menus.xml'
--- account_general_ledger_report/report_menus.xml 1970-01-01 00:00:00 +0000
+++ account_general_ledger_report/report_menus.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <menuitem icon="STOCK_PRINT"
+ name="General Ledger"
+ parent="account.final_accounting_reports"
+ action="action_general_ledger_report_wizard"
+ groups="account.group_account_user,account.group_account_manager"
+ id="account.menu_general_ledger"/>
+
+ </data>
+</openerp>
=== added directory 'account_general_ledger_report/wizard'
=== added file 'account_general_ledger_report/wizard/__init__.py'
--- account_general_ledger_report/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ account_general_ledger_report/wizard/__init__.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,23 @@
+#-*- coding:utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# d$
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import account_general_ledger_report_wizard
\ No newline at end of file
=== added file 'account_general_ledger_report/wizard/account_general_ledger_report_wizard.py'
--- account_general_ledger_report/wizard/account_general_ledger_report_wizard.py 1970-01-01 00:00:00 +0000
+++ account_general_ledger_report/wizard/account_general_ledger_report_wizard.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import fields, osv
+
+class AccountReportGeneralLedgerWizard(osv.osv_memory):
+
+ _inherit = "account.report.wiz"
+ _name = "general.ledger.wiz"
+ _description = "General Ledger Report Wizard"
+
+ def _print_report(self, cursor, uid, ids, data, context=None):
+ context = context or {}
+
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account_general_ledger_webkit',
+ 'datas': data
+ }
+
\ No newline at end of file
=== added file 'account_general_ledger_report/wizard/account_general_ledger_report_wizard.xml'
--- account_general_ledger_report/wizard/account_general_ledger_report_wizard.xml 1970-01-01 00:00:00 +0000
+++ account_general_ledger_report/wizard/account_general_ledger_report_wizard.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id ="account_report_general_ledger_report_inherit" model="ir.ui.view">
+ <field name="name">General Ledger Report </field>
+ <field name="model">general.ledger.wiz</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="account_report_lib.account_report_lib_wizard_view"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/label[@string='']" position="replace">
+ <separator string="General Ledger" colspan="4"/>
+ <label nolabel="1" colspan="4" string="This report allows you to print or generate a pdf of your General Ledger"/>
+ </xpath>
+ <field name="chart_account_id" position="attributes">
+ <attribute name="attrs">{'required': True}</attribute>
+ </field>
+ <field name="fiscalyear_id" position="attributes">
+ <attribute name="attrs">{'required': True}</attribute>
+ </field>
+ <field name="target_move" position="attributes">
+ <attribute name="attrs">{'required': True}</attribute>
+ </field>
+ <field name="historic_strict" position="attributes">
+ <attribute name="attrs">{'invisible': True}</attribute>
+ </field>
+ <field name="period_from" position="replace">
+ <field name="period_from" domain="[('special', '=', False)]" attrs="{'required':[('filter', '=', 'filter_period')]}"/>
+ </field>
+ <field name="date_from" position="attributes">
+ <attribute name="attrs">{'required': [('filter', '=', 'filter_date')]}</attribute>
+ </field>
+ <field name="period_to" position="replace">
+ <field name="period_to" domain="[('special', '=', False)]" attrs="{'required':[('filter', '=', 'filter_period')]}"/>
+ </field>
+ <field name="date_to" position="attributes">
+ <attribute name="attrs">{'required': [('filter', '=', 'filter_date')]}</attribute>
+ </field>
+ <field name="special_period" position="attributes">
+ <attribute name="attrs">{'invisible': True}</attribute>
+ </field>
+ <group string="Journals" position="attributes">
+ <attribute name="attrs">{'invisible': True}</attribute>
+ </group>
+ <group string="Account Financial Report" position="attributes">
+ <attribute name="attrs">{'invisible': True}</attribute>
+ </group>
+ </data>
+ </field>
+ </record>
+
+ <record id="action_general_ledger_report_wizard" model="ir.actions.act_window">
+ <field name="name">General Ledger Report</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">general.ledger.wiz</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="account_report_general_ledger_report_inherit"/>
+ <field name="target">new</field>
+ </record>
+ </data>
+</openerp>
=== modified file 'account_invoice_global_discount/__init__.py'
--- account_invoice_global_discount/__init__.py 2012-06-30 22:41:06 +0000
+++ account_invoice_global_discount/__init__.py 2013-11-06 21:08:00 +0000
@@ -22,3 +22,6 @@
import account_invoice_global_discount
import wizard
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
=== modified file 'account_invoice_global_discount/__openerp__.py'
--- account_invoice_global_discount/__openerp__.py 2012-06-30 22:41:06 +0000
+++ account_invoice_global_discount/__openerp__.py 2013-11-06 21:08:00 +0000
@@ -24,7 +24,6 @@
"name" : 'Global invoice discount',
"version" : '1.0',
"author" : 'CLEARCORP S.A',
- #easy, normal, expert
'complexity': 'normal',
"description": """
Adds a discount feature for invoice.
@@ -37,16 +36,20 @@
"website" : "http://clearcorp.co.cr",
"images" : [],
"icon" : False,
- "depends" : ['account'],
+ "depends" : ['account',
+ 'product_visible_discount'],
"init_xml" : [],
"demo_xml" : [],
- "update_xml" : [
- 'account_invoice_global_discount_wizard.xml',
+ "update_xml" : [],
+ "data" : [
'account_invoice_global_discount_view.xml',
- ],
+ 'wizard/discount_wizard_view.xml',
+ ],
"test" : [],
"auto_install": False,
"application": False,
"installable": True,
'license': 'AGPL-3',
}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'account_invoice_global_discount/account_invoice_global_discount.py'
--- account_invoice_global_discount/account_invoice_global_discount.py 2012-06-30 22:41:06 +0000
+++ account_invoice_global_discount/account_invoice_global_discount.py 2013-11-06 21:08:00 +0000
@@ -18,7 +18,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-##############################################################################
from osv import osv,fields
from tools import config
@@ -103,3 +102,5 @@
},
multi='ccorp'),
}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'account_invoice_global_discount/account_invoice_global_discount_view.xml'
--- account_invoice_global_discount/account_invoice_global_discount_view.xml 2012-06-30 22:41:06 +0000
+++ account_invoice_global_discount/account_invoice_global_discount_view.xml 2013-11-06 21:08:00 +0000
@@ -1,115 +1,157 @@
<?xml version="1.0" encoding="utf-8"?>
-<openerp><data>
- <!--
- Resource: account.invoice
- Adds fields with not discounted amounts
- -->
- <record id="invoice_tree_ccorp1" model="ir.ui.view">
- <field name="name">account.invoice.tree_ccorp1</field>
- <field name="model">account.invoice</field>
- <field name="inherit_id" ref="account.invoice_tree"/>
- <field name="type">tree</field>
- <field name="arch" type="xml">
- <field name="amount_untaxed" position="replace">
- <field name="amount_untaxed_not_discounted" sum="Untaxed amount"/>
- </field>
- </field>
- </record>
- <record id="invoice_tree_ccorp2" model="ir.ui.view">
- <field name="name">account.invoice.tree_ccorp2</field>
- <field name="model">account.invoice</field>
- <field name="inherit_id" ref="account.invoice_tree"/>
- <field name="type">tree</field>
- <field name="arch" type="xml">
- <field name="amount_total" position="before">
- <field name="invoice_discount"/>
- <field name="amount_discounted" sum="Discounted amount"/>
- </field>
- </field>
- </record>
-
- <record id="invoice_supplier_form_ccorp_line1" model="ir.ui.view">
- <field name="name">account.invoice.supplier.form_ccorp1</field>
- <field name="model">account.invoice</field>
- <field name="inherit_id" ref="account.invoice_supplier_form"/>
- <field name="type">form</field>
- <field name="arch" type="xml">
- <xpath expr="/form/notebook/page/field[@name='invoice_line']/tree/field[@name='price_subtotal']" position="before">
- <field name="discount"/>
- </xpath>
- </field>
- </record>
- <record id="invoice_supplier_form_ccorp_line2" model="ir.ui.view">
- <field name="name">account.invoice.supplier.form_ccorp1</field>
- <field name="model">account.invoice</field>
- <field name="inherit_id" ref="account.invoice_supplier_form"/>
- <field name="type">form</field>
- <field name="arch" type="xml">
- <xpath expr="/form/notebook/page/field[@name='invoice_line']/tree/field[@name='price_subtotal']" position="after">
- <field name="price_subtotal_not_discounted"/>
- </xpath>
- </field>
- </record>
-
- <record id="invoice_supplier_form_ccorp1" model="ir.ui.view">
- <field name="name">account.invoice.supplier.form_ccorp1</field>
- <field name="model">account.invoice</field>
- <field name="inherit_id" ref="account.invoice_supplier_form"/>
- <field name="type">form</field>
- <field name="arch" type="xml">
- <xpath expr="/form/notebook/page/group/button[@name='button_reset_taxes']" position="replace">
- <button colspan="2" name="%(invoice_discount)d" states="draft" string="Apply Discount" type="action"/>
- <button colspan="2" name="button_reset_taxes" states="draft" string="Compute Totals" type="object"/>
- </xpath>
- </field>
- </record>
- <record id="invoice_supplier_form_ccorp2" model="ir.ui.view">
- <field name="name">account.invoice.supplier.form_ccorp2</field>
- <field name="model">account.invoice</field>
- <field name="inherit_id" ref="account.invoice_supplier_form"/>
- <field name="type">form</field>
- <field name="arch" type="xml">
- <xpath expr="/form/notebook/page/group/field[@name='amount_untaxed']" position="replace">
- <label colspan="2"/>
- <field name="amount_untaxed_not_discounted"/>
- <field name="invoice_discount"/>
- <field name="amount_discounted"/>
- </xpath>
- </field>
- </record>
-
- <record id="invoice_form_ccorp1" model="ir.ui.view">
- <field name="name">account.invoice.form_ccorp1</field>
- <field name="model">account.invoice</field>
- <field name="inherit_id" ref="account.invoice_form"/>
- <field name="type">form</field>
- <field name="arch" type="xml">
- <xpath expr="/form/notebook/page/group/field[@name='amount_untaxed']" position="replace">
- <field name="amount_untaxed_not_discounted"/>
- <group colspan="2" col="1">
- <button colspan="2" name="%(invoice_discount)d" states="draft" string="Apply Discount" type="action"/>
- </group>
- <field name="invoice_discount"/>
- <label colspan="2" string=""/>
- <field name="amount_discounted"/>
- </xpath>
- </field>
- </record>
-
- <!--
- Resource: account.invoice.line
- Adds the subtotal not discounted to tree and form views
- -->
- <record id="view_invoice_line_tree_ccorp" model="ir.ui.view">
- <field name="name">account.invoice.line.tree_ccorp</field>
- <field name="model">account.invoice.line</field>
- <field name="inherit_id" ref="account.view_invoice_line_tree"/>
- <field name="type">tree</field>
- <field name="arch" type="xml">
- <field name="price_subtotal" position="after">
- <field name="price_subtotal_not_discounted"/>
- </field>
- </field>
- </record>
-</data>
+<openerp>
+ <data>
+
+ <record id="account_invoice_supplier_form_ccorp_attributes" model="ir.ui.view">
+ <field name="name">account.invoice.supplier.form.ccorp.attributes</field>
+ <field name="model">account.invoice</field>
+ <field name="inherit_id" ref="account.invoice_supplier_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/sheet/notebook/page/field[@name='invoice_line']/tree[@string='Invoice lines']" position="attributes">
+ <attribute name="editable"></attribute>
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+ <record id="account_invoice_form_ccorp_attributes" model="ir.ui.view">
+ <field name="name">account.invoice.form.ccorp.attributes</field>
+ <field name="model">account.invoice</field>
+ <field name="inherit_id" ref="account.invoice_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/sheet/notebook/page/field[@name='invoice_line']/tree[@string='Invoice Lines']" position="attributes">
+ <attribute name="editable"></attribute>
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+ <record id="invoice_tree_ccorp1" model="ir.ui.view">
+ <field name="name">account.invoice.tree_ccorp1</field>
+ <field name="model">account.invoice</field>
+ <field name="inherit_id" ref="account.invoice_tree"/>
+ <field name="arch" type="xml">
+ <field name="amount_untaxed" position="replace">
+ <field name="amount_untaxed_not_discounted" sum="Untaxed amount"/>
+ </field>
+ <field name="amount_total" position="before">
+ <field name="invoice_discount"/>
+ <field name="amount_discounted" sum="Discounted amount"/>
+ </field>
+ </field>
+ </record>
+
+ <record id="account_invoice_supplier_form_ccorp_line1" model="ir.ui.view">
+ <field name="name">account.invoice.supplier.form.ccorp.line1</field>
+ <field name="model">account.invoice</field>
+ <field name="inherit_id" ref="account.invoice_supplier_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/sheet/notebook/page/field[@name='invoice_line']/tree/field[@name='price_subtotal']" position="before">
+ <field name="discount"/>
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+ <record id="account_invoice_supplier_form_ccorp_line2" model="ir.ui.view">
+ <field name="name">account.invoice.supplier.form.ccorp.line2</field>
+ <field name="model">account.invoice</field>
+ <field name="inherit_id" ref="account.invoice_supplier_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/sheet/notebook/page/field[@name='invoice_line']/tree/field[@name='price_subtotal']" position="after">
+ <field name="price_subtotal_not_discounted"/>
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+ <record id="account_invoice_supplier_form_ccorp1" model="ir.ui.view">
+ <field name="name">account.invoice.supplier.form.ccorp1</field>
+ <field name="model">account.invoice</field>
+ <field name="inherit_id" ref="account.invoice_supplier_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="//button[@name='button_reset_taxes']" position="replace">
+ <button colspan="2" name="invoice_discount" states="draft" string="Apply Discount" type="action"/>
+ <button colspan="2" name="button_reset_taxes" states="draft" string="Compute Totals" type="object"/>
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+ <record id="account_invoice_supplier_form_ccorp2" model="ir.ui.view">
+ <field name="name">account.invoice.supplier.form.ccorp2</field>
+ <field name="model">account.invoice</field>
+ <field name="inherit_id" ref="account.invoice_supplier_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/sheet/notebook/page/group/field[@name='amount_untaxed']" position="replace">
+ <field name="amount_untaxed_not_discounted"/>
+ <field name="invoice_discount"/>
+ <field name="amount_discounted"/>
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+ <record id="account_invoice_form_ccorp_line1" model="ir.ui.view">
+ <field name="name">account.invoice.form.ccorp.line1</field>
+ <field name="model">account.invoice</field>
+ <field name="inherit_id" ref="account.invoice_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/sheet/notebook/page/field[@name='invoice_line']/tree/field[@name='price_subtotal']" position="before">
+ <field name="discount"/>
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+ <record id="account_invoice_form_ccorp_line2" model="ir.ui.view">
+ <field name="name">account.invoice.form.ccorp.line2</field>
+ <field name="model">account.invoice</field>
+ <field name="inherit_id" ref="account.invoice_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/sheet/notebook/page/field[@name='invoice_line']/tree/field[@name='price_subtotal']" position="after">
+ <field name="price_subtotal_not_discounted"/>
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+ <record id="account_invoice_form_ccorp1" model="ir.ui.view">
+ <field name="name">account.invoice.form.ccorp1</field>
+ <field name="model">account.invoice</field>
+ <field name="inherit_id" ref="account.invoice_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="//button[@name='button_reset_taxes']" position="replace">
+ <button colspan="2" name="invoice_discount" states="draft" string="Apply Discount" type="action"/>
+ <button colspan="2" name="button_reset_taxes" states="draft" string="Compute Totals" type="object"/>
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+ <record id="account_invoice_form_ccorp2" model="ir.ui.view">
+ <field name="name">account.invoice.form.ccorp2</field>
+ <field name="model">account.invoice</field>
+ <field name="inherit_id" ref="account.invoice_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/sheet/notebook/page/group/field[@name='amount_untaxed']" position="replace">
+ <field name="amount_untaxed_not_discounted"/>
+ <field name="invoice_discount"/>
+ <field name="amount_discounted"/>
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+ </data>
</openerp>
=== removed file 'account_invoice_global_discount/account_invoice_global_discount_wizard.xml'
--- account_invoice_global_discount/account_invoice_global_discount_wizard.xml 2012-06-30 22:41:06 +0000
+++ account_invoice_global_discount/account_invoice_global_discount_wizard.xml 1970-01-01 00:00:00 +0000
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
- <data noupdate="1">
- <!--
- Resource: account.invoice
- -->
- <wizard string="Discount" model="account.invoice" name="invoice.discount" id="invoice_discount" menu="False"/>
- </data>
-</openerp>
=== modified file 'account_invoice_global_discount/wizard/__init__.py'
--- account_invoice_global_discount/wizard/__init__.py 2012-06-30 22:41:06 +0000
+++ account_invoice_global_discount/wizard/__init__.py 2013-11-06 21:08:00 +0000
@@ -1,35 +1,25 @@
-# -*- encoding: utf-8 -*-
+# -*- coding: utf-8 -*-
##############################################################################
#
-# __init__.py
-# account_invoice_global_discount
-# First author: Carlos Vásquez <carlos.vasquez@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
-# Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without modification, are
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice, this list of
-# conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice, this list
-# of conditions and the following disclaimer in the documentation and/or other materials
-# provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation are those of the
-# authors and should not be interpreted as representing official policies, either expressed
-# or implied, of ClearCorp S.A..
-#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
##############################################################################
import discount_wizard
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'account_invoice_global_discount/wizard/discount_wizard.py'
--- account_invoice_global_discount/wizard/discount_wizard.py 2012-06-30 22:41:06 +0000
+++ account_invoice_global_discount/wizard/discount_wizard.py 2013-11-06 21:08:00 +0000
@@ -1,87 +1,49 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# wizard_discount.py
-# account_invoice_global_discount
-# First author: Carlos Vásquez <carlos.vasquez@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
-# Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without modification, are
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice, this list of
-# conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice, this list
-# of conditions and the following disclaimer in the documentation and/or other materials
-# provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation are those of the
-# authors and should not be interpreted as representing official policies, either expressed
-# or implied, of ClearCorp S.A..
-#
-##############################################################################
-
-import pooler
-import wizard
-
-
-_form = """<?xml version="1.0"?>
-<form string="Discount:">
- <field name="discount"/>
-</form>
-"""
-
-_fields = {
- 'discount': {
- 'string': 'Discount percentage',
- 'type': 'float',
- 'required': True,
- 'default': lambda *args: 0
- },
-}
-
-
-def apply_discount(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- invoice_obj = pool.get('account.invoice')
- invoice_line_obj = pool.get('account.invoice.line')
- for invoice in invoice_obj.browse(cr, uid, data['ids'], context=context):
- invoice_line_obj.write(cr, uid, [line.id for line in invoice.invoice_line], {'discount': data['form']['discount']}, context=context,)
- return {}
-
-
-class discount_wizard(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {
- 'type': 'form',
- 'arch': _form,
- 'fields': _fields,
- 'state': (('end', 'Cancel'),
- ('apply_discount', 'Apply Discount', 'gtk-ok', True)
- )
- }
- },
- 'apply_discount': {
- 'actions': [],
- 'result': {
- 'type': 'action',
- 'action': apply_discount,
- 'state': "end",
- }
- },
- }
-
-discount_wizard('invoice.discount')
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import osv, fields
+
+class DiscountWizard(osv.osv):
+
+ _name = "discount.wizard"
+ _description = "Discount Wizard"
+
+ _columns = {
+ 'discount': fields.float('Discount percentage', required=True),
+ 'period_from': fields.many2one('account.period', 'Start Period'),
+ 'period_to': fields.many2one('account.period', 'End Period'),
+ }
+
+ _default = {
+ 'discount': lambda *args: 0
+ }
+
+
+ def apply_discount(self, cr, uid, data, context):
+ invoice_obj = self.pool.get('account.invoice')
+ invoice_line_obj = self.pool.get('account.invoice.line')
+ for invoice in invoice_obj.browse(cr, uid, data['ids'], context=context):
+ invoice_line_obj.write(cr, uid, [line.id for line in invoice.invoice_line], {'discount': data['form']['discount']}, context=context,)
+ return {}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
=== added file 'account_invoice_global_discount/wizard/discount_wizard_view.xml'
--- account_invoice_global_discount/wizard/discount_wizard_view.xml 1970-01-01 00:00:00 +0000
+++ account_invoice_global_discount/wizard/discount_wizard_view.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data noupdate="1">
+
+ <record id="discount_wizard_view" model="ir.ui.view">
+ <field name="name">Discount Wizard View</field>
+ <field name="model">discount.wizard</field>
+ <field name="arch" type="xml">
+ <form string="Discount Wizard" version="7.0">
+ <field name="discount" />
+ <footer>
+ <button name="apply_discount" string="Discount" type="object"/>
+ or
+ <button string="Cancel" class="oe_link" special="cancel" />
+ </footer>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_discount_wizard_view" model="ir.actions.act_window">
+ <field name="name">Action Discount Wizard View</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">discount.wizard</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="discount_wizard_view"/>
+ <field name="target">new</field>
+ </record>
+
+ </data>
+</openerp>
=== modified file 'account_invoice_journal_defaults/__openerp__.py'
--- account_invoice_journal_defaults/__openerp__.py 2012-06-29 21:17:48 +0000
+++ account_invoice_journal_defaults/__openerp__.py 2013-11-06 21:08:00 +0000
@@ -25,14 +25,12 @@
'category': 'Accounting & Finance',
"sequence": 4,
'complexity': "normal",
- 'description': """
-account_invoice_journal_defaults.
-=======================
- * Currency changed to readonly
- * Change button removed
- * account_id removed in onchange_partner
- * account_id added in onchange_journal
- """,
+ 'description': '''
+ * account_id and journal_id added to onchange_partner
+ * account_id added in onchange_journal
+ * account_id associated with the journal or with the account in the partner
+ * account_id change to read-only
+ ''',
"author" : 'CLEARCORP S.A',
'website':'http://www.clearcorp.co.cr',
"depends" : ['account'],
=== modified file 'account_invoice_journal_defaults/account_invoice_journal_defaults.py'
--- account_invoice_journal_defaults/account_invoice_journal_defaults.py 2013-01-14 21:57:42 +0000
+++ account_invoice_journal_defaults/account_invoice_journal_defaults.py 2013-11-06 21:08:00 +0000
@@ -29,30 +29,88 @@
_inherit = 'account.invoice'
def onchange_partner_id(self, cr, uid, ids, type, partner_id,\
- date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False):
+ date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False, journal_id = False, account_id = False):
result = super(AccountInvoice, self).onchange_partner_id(cr, uid, ids, type, partner_id, date_invoice, payment_term, partner_bank_id, company_id)
- if 'account_id' in result['value']:
+
+ #If the partner have account_id, but the journal doesn't have one, put the account that appears
+ #in result dictionary.
+
+ if not account_id:
+ journal = self.pool.get('account.journal').browse(cr, uid, journal_id)
+ acc_id = False
+
+ if journal.type == 'sale':
+ acc_id = journal.default_receivable_account_id
+ elif journal.type == 'purchase':
+ acc_id = journal.default_payable_account_id
+ elif journal.type == 'sale_refund':
+ acc_id = journal.default_payable_account_id
+ elif journal.type == 'purchase_refund':
+ acc_id = journal.default_receivable_account_id
+
+ if not acc_id:
+ if partner_id:
+ partner = self.pool.get('res.partner').browse(cr, uid, partner_id)
+
+ if partner.id != uid:
+ if journal.type == 'sale':
+ acc_id = partner.property_account_receivable
+ elif journal.type == 'purchase':
+ acc_id = partner.property_account_payable
+ elif journal.type == 'sale_refund':
+ acc_id = partner.property_account_payable
+ elif journal.type == 'purchase_refund':
+ acc_id = partner.property_account_receivable
+
+ else:
+ result['value']['account_id'] = False
+
+ result['value']['account_id'] = acc_id.id
+
+ else:
del result['value']['account_id']
-
+
return result
- def onchange_journal_id(self, cr, uid, ids, journal_id=False, context=None):
+ def onchange_journal_id(self, cr, uid, ids, journal_id=False, partner_id = False, context=None):
+
result = super(AccountInvoice, self).onchange_journal_id(cr, uid, ids, journal_id, context)
-
- journal = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context)
-
- if journal.type == 'sale':
- acc_id = journal.default_receivable_account_id.id
- elif journal.type == 'purchase':
- acc_id = journal.default_payable_account_id.id
- elif journal.type == 'sale_refund':
- acc_id = journal.default_payable_account_id.id
- elif journal.type == 'purchase_refund':
- acc_id = journal.default_receivable_account_id.id
-
- result['value']['account_id'] = acc_id
-
+
+ if journal_id is not False:
+ journal = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context)
+
+ if journal.type == 'sale':
+ acc_id = journal.default_receivable_account_id
+ elif journal.type == 'purchase':
+ acc_id = journal.default_payable_account_id
+ elif journal.type == 'sale_refund':
+ acc_id = journal.default_payable_account_id
+ elif journal.type == 'purchase_refund':
+ acc_id = journal.default_receivable_account_id
+
+ if not acc_id:
+ if partner_id:
+ partner = self.pool.get('res.partner').browse(cr, uid, partner_id['uid'], context)
+
+ if partner.id != uid:
+ if journal.type == 'sale':
+ acc_id = partner.property_account_receivable
+ elif journal.type == 'purchase':
+ acc_id = partner.property_account_payable
+ elif journal.type == 'sale_refund':
+ acc_id = partner.property_account_payable
+ elif journal.type == 'purchase_refund':
+ acc_id = partner.property_account_receivable
+
+ result['value']['account_id'] = acc_id.id
+
+ else:
+ result['value']['account_id'] = False
+
+ else:
+ result['value']['account_id'] = acc_id.id
+
return result
def create(self, cr, uid, vals, context=None):
@@ -118,11 +176,8 @@
_inherit = 'account.journal'
_columns = {
- 'default_receivable_account_id': fields.many2one('account.account', 'Default Receivable Account', domain="[('type','!=','view')]", help="It acts as a default receivable account"),
- 'default_payable_account_id': fields.many2one('account.account', 'Default Payable Account', domain="[('type','!=','view')]", help="It acts as a default payable account"),
+ 'default_receivable_account_id': fields.many2one('account.account', 'Default Receivable Account', help="It acts as a default receivable account"),
+ 'default_payable_account_id': fields.many2one('account.account', 'Default Payable Account', help="It acts as a default payable account"),
}
-
-
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'account_invoice_journal_defaults/account_invoice_journal_defaults_view.xml'
--- account_invoice_journal_defaults/account_invoice_journal_defaults_view.xml 2012-06-29 21:17:48 +0000
+++ account_invoice_journal_defaults/account_invoice_journal_defaults_view.xml 2013-11-06 21:08:00 +0000
@@ -10,16 +10,22 @@
<field name="inherit_id" ref="account.invoice_supplier_form"/>
<field name="arch" type="xml">
<data>
+ <field name = "journal_id" position = "replace">
+ <field name="journal_id" on_change="onchange_journal_id(journal_id, partner_id)" widget="selection"/>
+ </field>
+
+ <field name = "partner_id" position="replace">
+ <field string="Supplier" name="partner_id" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id, journal_id,account_id)" context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}" options='{"quick_create": false}' domain="[('supplier', '=', True)]"/>
+ </field>
+
<field name = "currency_id" position = "replace">
<field name="currency_id" width="50" readonly="1"/>
</field>
+
<field name = "account_id" position = "replace">
<field domain="[('company_id', '=', company_id), ('type', '=', 'payable')]" name="account_id" readonly="1" groups="account.group_account_user"/>
</field>
- <button string="Change" position = "replace">
- <button invisible = "True" type="action" icon="terp-stock_effects-object-colorize" string="Change" groups="account.group_account_user"/>
- </button>
- </data>
+ </data>
</field>
</record>
<!-- End Supplier Invoice -->
@@ -31,16 +37,22 @@
<field name="type">form</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
- <data>
+ <data>
+ <field name="journal_id" position="replace">
+ <field name="journal_id" groups="base.group_user" on_change="onchange_journal_id(journal_id, context, partner_id)" widget="selection"/>
+ </field>
+
+ <field name="partner_id" positon="replace">
+ <field string="Customer" name="partner_id" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id,journal_id,account_id)" groups="base.group_user" context="{'search_default_customer': 1}" options='{"quick_create": false}' domain="[('customer', '=', True)]"/>
+ </field>
+
<field name = "currency_id" position = "replace">
<field name="currency_id" width="50" readonly="1"/>
</field>
+
<field name = "account_id" position = "replace">
<field domain="[('company_id', '=', company_id),('type','=', 'receivable')]" name="account_id" readonly="1" groups="account.group_account_user"/>
</field>
- <button string="Change" position = "replace">
- <button invisible = "True" type="action" icon="terp-stock_effects-object-colorize" string="Change" groups="account.group_account_user"/>
- </button>
</data>
</field>
</record>
@@ -54,11 +66,11 @@
<field name="inherit_id" ref="account.view_account_journal_form"/>
<field name="arch" type="xml">
<data>
- <field name="default_credit_account_id" position = "after">
+ <field name="type" position = "after">
<group colspan="2" col="2" attrs="{'invisible':[('type','not in', ('sale', 'purchase', 'sale_refund', 'purchase_refund'))]}">
<separator string="Default Accounts Receivable/Payable" colspan="4"/>
- <field name="default_receivable_account_id" attrs="{'required':[('type','in', ('sale', 'purchase', 'sale_refund', 'purchase_refund'))]}" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
- <field name="default_payable_account_id" attrs="{'required':[('type','in', ('sale', 'purchase', 'sale_refund', 'purchase_refund'))]}" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
+ <field name="default_receivable_account_id" domain="[('type','=', 'receivable')]"/>
+ <field name="default_payable_account_id" domain="[('type','=', 'payable')]"/>
</group>
</field>
</data>
=== modified file 'account_invoice_webkit_report/__openerp__.py'
--- account_invoice_webkit_report/__openerp__.py 2012-12-04 18:01:04 +0000
+++ account_invoice_webkit_report/__openerp__.py 2013-11-06 21:08:00 +0000
@@ -24,10 +24,9 @@
"name" : 'Invoice Webkit Report',
"version" : '1.0',
"author" : 'CLEARCORP S.A',
- #easy, normal, expert
'complexity': 'normal',
"description": """
-Invoice webkit report
+ Invoice webkit report
""",
"category": 'Accounting & Finance',
"sequence": 4,
@@ -36,12 +35,16 @@
"icon" : False,
"depends" : [
'base',
- 'report_webkit',
+ 'account_report_lib',
'account_invoice_global_discount',
],
"init_xml" : [],
"demo_xml" : [],
- "update_xml" : ['ccorp_account_webkit_report.xml'],
+ "update_xml" : [
+ 'data/account_invoice_webkit_report_header.xml',
+ 'account_invoice_webkit_report.xml',
+ 'report/report.xml'
+ ],
"test" : [],
"auto_install": False,
"application": False,
=== modified file 'account_invoice_webkit_report/account_invoice_webkit_report.py'
--- account_invoice_webkit_report/account_invoice_webkit_report.py 2012-12-04 18:01:04 +0000
+++ account_invoice_webkit_report/account_invoice_webkit_report.py 2013-11-06 21:08:00 +0000
@@ -29,4 +29,5 @@
_columns = {
'use_email_invoice':fields.boolean('Use user email',help="In the invoice, if it is selected appears the user's mail is logged in. If not selected, do not appear any associated email"),
}
+
res_company()
\ No newline at end of file
=== added file 'account_invoice_webkit_report/account_invoice_webkit_report.xml'
--- account_invoice_webkit_report/account_invoice_webkit_report.xml 1970-01-01 00:00:00 +0000
+++ account_invoice_webkit_report/account_invoice_webkit_report.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<openerp>
+ <data>
+ <record id="view_company_form_inherit" model="ir.ui.view">
+ <field name="name">res.company.form.inherit</field>
+ <field name="model">res.company</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="base.view_company_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <page string="General Information" position="after">
+ <page string="Configuration Report" groups="base.group_extended">
+ <separator colspan="4" string="Invoices"/>
+ <field colspan="4" name="use_email_invoice"/>
+ </page>
+ </page>
+ </data>
+ </field>
+ </record>
+ </data>
+</openerp>
=== removed file 'account_invoice_webkit_report/ccorp_account_webkit_report.xml'
--- account_invoice_webkit_report/ccorp_account_webkit_report.xml 2013-01-17 15:31:51 +0000
+++ account_invoice_webkit_report/ccorp_account_webkit_report.xml 1970-01-01 00:00:00 +0000
@@ -1,34 +0,0 @@
-<?xml version="1.0"?>
-<openerp>
- <data>
-
- <record id="account.account_invoices" model="ir.actions.report.xml">
- <field name="auto" eval="False" />
- <field name="multi" eval="False" />
- <field name="model">account.invoice</field>
- <field name="name">account.invoice.layout_ccorp</field>
- <field name="report_file">account_invoice_webkit_report/report/invoice.mako</field>
- <field name="report_rml">account_invoice_webkit_report/report/invoice.mako</field>
- <field name="report_type">webkit</field>
- </record>
-
-
- <record id="view_company_form_inherit" model="ir.ui.view">
- <field name="name">res.company.form.inherit</field>
- <field name="model">res.company</field>
- <field name="type">form</field>
- <field name="inherit_id" ref="base.view_company_form"/>
- <field name="arch" type="xml">
- <data>
- <page string="General Information" position="after">
- <page string="Configuration Report" groups="base.group_extended">
- <separator colspan="4" string="Invoices"/>
- <field colspan="4" name="use_email_invoice"/>
- </page>
- </page>
- </data>
- </field>
- </record>
-
- </data>
-</openerp>
=== added directory 'account_invoice_webkit_report/data'
=== added file 'account_invoice_webkit_report/data/account_invoice_webkit_report_header.xml'
--- account_invoice_webkit_report/data/account_invoice_webkit_report_header.xml 1970-01-01 00:00:00 +0000
+++ account_invoice_webkit_report/data/account_invoice_webkit_report_header.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,239 @@
+<?xml version="1.0"?>
+<openerp>
+ <data noupdate="1">
+ <record id="invoice_header_webkit" model="ir.header_webkit">
+ <field name="name">Invoice CLEARCORP official header</field>
+ <field name="orientation">Portrait</field>
+ <field name="format">Letter</field>
+ <field name="margin_top">70.00</field>
+ <field name="margin_bottom">24.00</field>
+ <field name="margin_left">0</field>
+ <field name="margin_right">0</field>
+ <field name="css"><![CDATA[
+ .header {
+ padding : 200px 10px 5px 10px;
+ border:0; margin: 0;
+ }
+ .header-table {
+ width: 100%;
+ padding-top: 8%;
+ }
+ .partner-table {
+ width: 100%;
+ font-family: Arial,Verdana, Sans, Serif;
+ font-size: 12;
+ }
+
+ #data-table {
+ width: 100%;
+ padding-top: 20px;
+ font-family: Arial,Verdana, Sans, Serif;
+ font-size: 12;
+ }
+ #data-table th{
+ border-bottom:2px solid black;
+ text-align:center;
+ font-size:12;
+ font-weight:bold;
+ padding-right:3px;
+ padding-left:3px;
+ }
+ #data-table thead {
+ display:table-header-group;
+ }
+
+ .title {
+ font-size:16;
+ font-weight: bold;
+ }
+
+ td.company_logo{
+ width : 100%;
+ padding-top: 20px;
+ padding-bottom: 5px;
+ }
+ .company_address{
+ width : 100%;
+ text-align: right;
+ font-family: Arial,Verdana, Sans, Serif;
+ font-size: 13;
+ }
+
+ .company_data {
+ width : 100%;
+ text-align: left;
+ font-family: Arial,Verdana, Sans, Serif;
+ font-size: 13;
+
+ }
+
+ .company_footer {
+ font-family: Arial,Verdana, Sans, Serif;
+ font-size: 8.4;
+ font-style : italic;
+ }
+ .footer {
+ border-top: 1px solid black;
+ width: 100%;
+ border:0; margin: 0;
+ padding-bottom: 300px;
+ }
+
+ .data {
+ padding : 5px 10px 10px 10px;
+ border:0; margin: 0;
+ }
+
+ .footer_table {
+ width: 100%;
+ padding-bottom: 150px;
+ border-top: 1px solid black;
+ }
+
+ .slogan {
+ font-family: Arial,Verdana, Sans, Serif;
+ font-size: 10;
+ font-style : italic;
+ color : #888888;
+ }
+
+ #notes_table {
+ font-family: Arial,Verdana, Sans, Serif;
+ font-size: 12;
+ font-style : italic;
+ width:65%;
+ border-collapse:separate;
+ border-spacing:10px;
+ }
+ #notes_table td{
+ background-color: #eee;
+ padding: 10px
+ }
+
+ .document_data {
+ font-family: Arial,Verdana, Sans, Serif;
+ font-size: 13;
+ }
+
+ #data-table tbody tr.even td {
+ background-color: #eee;
+ }
+ #data-table tbody tr.odd td {
+ background-color: #fff;
+ }
+
+ .notes{
+ padding-top : 0px;
+ margin-left: 5px;
+ font-style : italic;
+ }
+ #desc_col{
+ width : 440px;
+ }
+ #desc_col_po{
+ width : 380px;
+ }
+ ]]>
+ </field>
+ <field name="html"><![CDATA[
+<html>
+ <head>
+ <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
+ <script>
+ function subst() {
+ var vars={};
+ var x=document.location.search.substring(1).split('&');
+ for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
+ var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
+ for(var i in x) {
+ var y = document.getElementsByClassName(x[i]);
+ for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
+ }
+ }
+ </script>
+ <style type="text/css">
+ ${css}
+ </style>
+ </head>
+ <body class = "header" onload="subst()">
+ <table class="header-table" cellspacing = "3">
+ <tbody>
+ <tr>
+ <td class="company_logo">
+ ${helper.embed_logo_by_name('default_logo', height=40, width=150)|n}
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table class="company_data">
+ <tr class = "title">
+ <td>${company.partner_id.name or '-'}</td>
+ <td>${_("Address")}</td>
+ </tr>
+ <tr>
+ <td>${_("ID Num")}: ${company.company_registry or '-'}</td>
+ <td>${company.partner_id.street or '-'}</td>
+ </tr>
+ <tr>
+ <td>${_("Tel-fax")}: ${company.partner_id.phone or '-'}</td>
+ <td>${company.partner_id.zip or ''} ${company.partner_id.city or ''}</td>
+ </tr>
+ <tr>
+ <td>${_("E-mail")}: ${company.partner_id.email or '-'}</td>
+ %if company.partner_id.country_id :
+ <td>${company.partner_id.state_id.name or ''|entity}, ${company.partner_id.country_id.name or ''} </td>
+ %else:
+ <td> </td>
+ %endif
+ </tr>
+ <tr>
+ <td>${_("Web")}: ${company.website or '-'}</td>
+ <td></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ <p class = "slogan">${company.rml_header1}</p>
+ <hr />${_debug or ''|n} </body>
+</html>]]></field>
+ <field name="footer_html"><![CDATA[
+<html>
+ <head>
+ <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
+ <script>
+ function subst() {
+ var vars={};
+ var x=document.location.search.substring(1).split('&');
+ for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
+ var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
+ for(var i in x) {
+ var y = document.getElementsByClassName(x[i]);
+ for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
+ }
+ }
+ </script>
+ <style type="text/css">
+ ${css}
+ </style>
+ </head>
+ <body class = "footer" onload="subst()">
+ <table class = "footer_table">
+ <tr>
+ <td colspan="2"><p class ="company_footer">Favor realizar pagos a nombre de ${company.name} cédula jurídica ${company.company_registry}. CUENTAS BANCARIAS: ${company.accounts_footer}</p></td>
+ </tr>
+ <tr>
+ <td colspan="2"><p class ="company_footer">Si realiza el pago en colones (CRC), por favor utilizar el tipo de cambio al día de la fecha de pago del BCCR.</p></td>
+ </tr>
+ <tr>
+ <td><p class ="company_footer">Emitida conforme lo establecido en la resolución de Facturación Electrónica, N° DGT-22-07 del diecisiete de setiembre de dos mil siete de la Dirección General de Tributación </p></td>
+ <td style="text-align:right;font-size:10;">Página <span class="page"/></td><td style="text-align:left;font-size:10;"> de <span class="topage"/></td>
+ </tr>
+ </table>
+ </body>
+</html> ]]></field>
+ </record>
+ </data>
+</openerp>
\ No newline at end of file
=== removed file 'account_invoice_webkit_report/i18n/ccorp_account.pot'
--- account_invoice_webkit_report/i18n/ccorp_account.pot 2012-06-30 22:41:06 +0000
+++ account_invoice_webkit_report/i18n/ccorp_account.pot 1970-01-01 00:00:00 +0000
@@ -1,179 +0,0 @@
-# Translation of OpenERP Server.
-# This file contains the translation of the following modules:
-# * ccorp_account
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: OpenERP Server 5.0.12\n"
-"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
-"POT-Creation-Date: 2010-08-23 20:49:00+0000\n"
-"PO-Revision-Date: 2010-08-23 20:49:00+0000\n"
-"Last-Translator: <>\n"
-"Language-Team: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: \n"
-"Plural-Forms: \n"
-
-#. module: ccorp_account
-#: model:ir.module.module,description:ccorp_account.module_meta_information
-msgid "ClearCorp 'account' modifications:\n"
-" Reports:\n"
-" * Invoice\n"
-" "
-msgstr ""
-
-#. module: ccorp_account
-#: model:ir.module.module,shortdesc:ccorp_account.module_meta_information
-msgid "ClearCorp account module modifications"
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Electronic Invoice"
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "PRO-FORMA"
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Draft Invoice"
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Cancelled Invoice"
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Supplier Refund"
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Supplier Invoice"
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Num.: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Date: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "ID Num.: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Tel-fax: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Email: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Web: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Address:"
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Phone: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Fax: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Salesman: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Payment tems: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Due date: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Exchange rate: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Page: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Thank you for choosing us."
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Qty."
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Description / (Taxes)"
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Disc."
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Unit Price"
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Total Price"
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Subtotal"
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Discount"
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Taxes"
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "TOTAL"
-msgstr ""
=== removed file 'account_invoice_webkit_report/i18n/ccorp_account_webkit.pot'
--- account_invoice_webkit_report/i18n/ccorp_account_webkit.pot 2012-06-30 22:41:06 +0000
+++ account_invoice_webkit_report/i18n/ccorp_account_webkit.pot 1970-01-01 00:00:00 +0000
@@ -1,190 +0,0 @@
-# Translation of OpenERP Server.
-# This file contains the translation of the following modules:
-# * ccorp_account
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: OpenERP Server 6.0.2\n"
-"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
-"POT-Creation-Date: 2011-10-06 19:15+0000\n"
-"PO-Revision-Date: 2011-10-06 19:15+0000\n"
-"Last-Translator: <>\n"
-"Language-Team: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: \n"
-"Plural-Forms: \n"
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:93
-#: report:report.account.invoice.layout_ccorp:98
-msgid "Sub Total"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:39
-msgid "Date:"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:36
-msgid "ID Num."
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:47
-msgid "Payment tems"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:81
-msgid "Note"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:23
-msgid "Supplier Invoice"
-msgstr ""
-
-#. module: ccorp_account
-#: model:ir.module.module,description:ccorp_account.module_meta_information
-msgid "ClearCorp 'account' modifications:\n"
-" Reports:\n"
-" * Invoice\n"
-" "
-msgstr "ClearCorp 'account' modifications:\n"
-" Reports:\n"
-" * Invoice\n"
-" "
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:63
-msgid "Disc.(%)"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:48
-msgid "Email"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:63
-#: report:report.account.invoice.layout_ccorp:65
-msgid "Total Price"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:17
-msgid "PROFORMA"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:44
-msgid "Fax"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:94
-msgid "Discount"
-msgstr ""
-
-#. module: ccorp_account
-#: model:ir.actions.report.xml,name:ccorp_account.account_invoice_ccorp
-msgid "Invoice HTML"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:21
-msgid "Canceled Invoice"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:40
-msgid "Phone"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:107
-msgid "Invoice Note"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:63
-#: report:report.account.invoice.layout_ccorp:65
-msgid "[Code] Description / (Taxes)"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:19
-msgid "Draft Inovice"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:55
-msgid "Address"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:15
-msgid "Electronic Invoice"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:95
-#: report:report.account.invoice.layout_ccorp:99
-msgid "Taxes"
-msgstr ""
-
-#. module: ccorp_account
-#: model:ir.module.module,shortdesc:ccorp_account.module_meta_information
-msgid "ClearCorp account module modifications"
-msgstr "ClearCorp account module modifications"
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:110
-msgid "Payment Note"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:25
-msgid "Refund"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:43
-msgid "Due date"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:63
-#: report:report.account.invoice.layout_ccorp:65
-msgid "Qty"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:63
-#: report:report.account.invoice.layout_ccorp:65
-msgid "Unit Price"
-msgstr ""
-
-#. module: ccorp_account
-#: view:account.account:0
-msgid "Inactive Accounts"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:27
-msgid "Supplier Refund"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:96
-#: report:report.account.invoice.layout_ccorp:100
-msgid "Total"
-msgstr ""
-
-#. module: ccorp_account
-#: report:report.account.invoice.layout_ccorp:51
-msgid "Salesman"
-msgstr ""
-
=== removed file 'account_invoice_webkit_report/i18n/es.po'
--- account_invoice_webkit_report/i18n/es.po 2012-06-30 22:41:06 +0000
+++ account_invoice_webkit_report/i18n/es.po 1970-01-01 00:00:00 +0000
@@ -1,182 +0,0 @@
-# Spanish translation for openerp-ccorp-addons
-# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
-# This file is distributed under the same license as the openerp-ccorp-addons package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: openerp-ccorp-addons\n"
-"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
-"POT-Creation-Date: 2010-08-23 20:49+0000\n"
-"PO-Revision-Date: 2011-11-16 05:10+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Spanish <es@xxxxxx>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2011-11-29 06:07+0000\n"
-"X-Generator: Launchpad (build 14399)\n"
-
-#. module: ccorp_account
-#: model:ir.module.module,description:ccorp_account.module_meta_information
-msgid ""
-"ClearCorp 'account' modifications:\n"
-" Reports:\n"
-" * Invoice\n"
-" "
-msgstr ""
-
-#. module: ccorp_account
-#: model:ir.module.module,shortdesc:ccorp_account.module_meta_information
-msgid "ClearCorp account module modifications"
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Electronic Invoice"
-msgstr "Factura Electrónica"
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "PRO-FORMA"
-msgstr "Proforma"
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Draft Invoice"
-msgstr "Factura BORRADOR"
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Cancelled Invoice"
-msgstr "Factura CANCELADA"
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Supplier Refund"
-msgstr "Nota de crédito PROVEEDOR"
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Supplier Invoice"
-msgstr "Factura PROVEEDOR"
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Num.: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Date: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "ID Num.: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Tel-fax: "
-msgstr "Tel-fax: "
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Email: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Web: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Address:"
-msgstr "Dirección:"
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Phone: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Fax: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Salesman: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Payment tems: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Due date: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Exchange rate: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Page: "
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Thank you for choosing us."
-msgstr "Gracias por escoger nuestros servicios."
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Qty."
-msgstr "Cant."
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Description / (Taxes)"
-msgstr ""
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Disc."
-msgstr "Desc."
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Unit Price"
-msgstr "Precio Unit."
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Total Price"
-msgstr "Precio Total"
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Subtotal"
-msgstr "Subtotal"
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Discount"
-msgstr "Descuento"
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "Taxes"
-msgstr "Impuestos"
-
-#. module: ccorp_account
-#: rml:account.invoice.layout_ccorp:0
-msgid "TOTAL"
-msgstr "TOTAL"
=== modified file 'account_invoice_webkit_report/i18n/es_CR.po'
--- account_invoice_webkit_report/i18n/es_CR.po 2012-12-04 18:01:04 +0000
+++ account_invoice_webkit_report/i18n/es_CR.po 2013-11-06 21:08:00 +0000
@@ -4,10 +4,10 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: OpenERP Server 6.1\n"
+"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-12-04 17:11+0000\n"
-"PO-Revision-Date: 2012-12-04 17:11+0000\n"
+"POT-Creation-Date: 2013-04-30 16:38+0000\n"
+"PO-Revision-Date: 2013-04-30 16:38+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -16,15 +16,15 @@
"Plural-Forms: \n"
#. module: account_invoice_webkit_report
-#: report:addons/account_invoice_webkit_report/report/invoice.mako:93
-#: report:addons/account_invoice_webkit_report/report/invoice.mako:98
+#: report:addons/account_invoice_webkit_report/report/invoice.mako:94
+#: report:addons/account_invoice_webkit_report/report/invoice.mako:99
msgid "Sub Total"
-msgstr "Sub Total"
+msgstr "Subtotal"
#. module: account_invoice_webkit_report
#: field:res.company,use_email_invoice:0
msgid "Use user email"
-msgstr "Usar email del usuario logueado"
+msgstr "Usar email del usuario"
#. module: account_invoice_webkit_report
#: report:addons/account_invoice_webkit_report/report/invoice.mako:39
@@ -32,19 +32,14 @@
msgstr "Fecha:"
#. module: account_invoice_webkit_report
-#: constraint:res.company:0
-msgid "Error! You can not create recursive companies."
-msgstr "¡Error! No puede crear compañías recursivas."
+#: report:addons/account_invoice_webkit_report/report/invoice.mako:36
+msgid "ID Num."
+msgstr "Código cliente"
#. module: account_invoice_webkit_report
#: report:addons/account_invoice_webkit_report/report/invoice.mako:47
msgid "Payment tems"
-msgstr "Plazo de pago"
-
-#. module: account_invoice_webkit_report
-#: report:addons/account_invoice_webkit_report/report/invoice.mako:81
-msgid "Note"
-msgstr "Nota"
+msgstr "Condiciones de pago"
#. module: account_invoice_webkit_report
#: report:addons/account_invoice_webkit_report/report/invoice.mako:23
@@ -65,7 +60,7 @@
#. module: account_invoice_webkit_report
#: report:addons/account_invoice_webkit_report/report/invoice.mako:48
msgid "Email"
-msgstr "Email"
+msgstr "Correo electrónico"
#. module: account_invoice_webkit_report
#: report:addons/account_invoice_webkit_report/report/invoice.mako:63
@@ -86,12 +81,7 @@
#. module: account_invoice_webkit_report
#: report:addons/account_invoice_webkit_report/report/invoice.mako:40
msgid "Phone"
-msgstr "Phone"
-
-#. module: account_invoice_webkit_report
-#: model:ir.actions.report.xml,name:account_invoice_webkit_report.account_invoice_ccorp
-msgid "Invoice HTML"
-msgstr "Facturas"
+msgstr "Teléfono"
#. module: account_invoice_webkit_report
#: report:addons/account_invoice_webkit_report/report/invoice.mako:21
@@ -99,12 +89,12 @@
msgstr "Factura cancelada"
#. module: account_invoice_webkit_report
-#: report:addons/account_invoice_webkit_report/report/invoice.mako:94
+#: report:addons/account_invoice_webkit_report/report/invoice.mako:95
msgid "Discount"
msgstr "Descuento"
#. module: account_invoice_webkit_report
-#: report:addons/account_invoice_webkit_report/report/invoice.mako:107
+#: report:addons/account_invoice_webkit_report/report/invoice.mako:108
msgid "Invoice Note"
msgstr "Nota de factura"
@@ -112,12 +102,7 @@
#: report:addons/account_invoice_webkit_report/report/invoice.mako:63
#: report:addons/account_invoice_webkit_report/report/invoice.mako:65
msgid "[Code] Description / (Taxes)"
-msgstr "[Cód.] Descripción / (Imp.)"
-
-#. module: account_invoice_webkit_report
-#: sql_constraint:res.company:0
-msgid "The company name must be unique !"
-msgstr "¡El nombre de la compañía debe ser único!"
+msgstr "[Código] Descripción / (Impuestos)"
#. module: account_invoice_webkit_report
#: report:addons/account_invoice_webkit_report/report/invoice.mako:19
@@ -125,11 +110,6 @@
msgstr "Factura borrador"
#. module: account_invoice_webkit_report
-#: report:addons/account_invoice_webkit_report/report/invoice.mako:36
-msgid "ID Num."
-msgstr "ID Num."
-
-#. module: account_invoice_webkit_report
#: report:addons/account_invoice_webkit_report/report/invoice.mako:55
msgid "Address"
msgstr "Dirección"
@@ -145,35 +125,35 @@
msgstr "Factura electrónica"
#. module: account_invoice_webkit_report
-#: report:addons/account_invoice_webkit_report/report/invoice.mako:95
-#: report:addons/account_invoice_webkit_report/report/invoice.mako:99
+#: report:addons/account_invoice_webkit_report/report/invoice.mako:96
+#: report:addons/account_invoice_webkit_report/report/invoice.mako:100
msgid "Taxes"
msgstr "Impuestos"
#. module: account_invoice_webkit_report
#: help:res.company,use_email_invoice:0
msgid "In the invoice, if it is selected appears the user's mail is logged in. If not selected, do not appear any associated email"
-msgstr "En la factura, si está seleccionado aparece el email del usuario logueado. Si no está seleccionado no aparece ningún email"
+msgstr "En la factura, si está seleccionada, aparece el correo del usuario logueado. Si no está seleccionado, no aparece ningún correo asociado."
#. module: account_invoice_webkit_report
#: view:res.company:0
msgid "Configuration Report"
-msgstr "Configuración de reportes"
+msgstr "Configuración de reporte"
#. module: account_invoice_webkit_report
-#: report:addons/account_invoice_webkit_report/report/invoice.mako:111
+#: report:addons/account_invoice_webkit_report/report/invoice.mako:112
msgid "Payment Note"
msgstr "Nota de pago"
#. module: account_invoice_webkit_report
#: report:addons/account_invoice_webkit_report/report/invoice.mako:25
msgid "Refund"
-msgstr "Reembolso"
+msgstr "Nota de crédito"
#. module: account_invoice_webkit_report
#: report:addons/account_invoice_webkit_report/report/invoice.mako:43
msgid "Due date"
-msgstr "Vence"
+msgstr "Fecha de vencimiento"
#. module: account_invoice_webkit_report
#: view:res.company:0
@@ -194,11 +174,11 @@
#. module: account_invoice_webkit_report
#: report:addons/account_invoice_webkit_report/report/invoice.mako:27
msgid "Supplier Refund"
-msgstr "Reembolso de proveedor"
+msgstr "Nota de débito"
#. module: account_invoice_webkit_report
-#: report:addons/account_invoice_webkit_report/report/invoice.mako:96
-#: report:addons/account_invoice_webkit_report/report/invoice.mako:100
+#: report:addons/account_invoice_webkit_report/report/invoice.mako:97
+#: report:addons/account_invoice_webkit_report/report/invoice.mako:101
msgid "Total"
msgstr "Total"
=== modified file 'account_invoice_webkit_report/report/__init__.py'
--- account_invoice_webkit_report/report/__init__.py 2012-06-30 22:41:06 +0000
+++ account_invoice_webkit_report/report/__init__.py 2013-11-06 21:08:00 +0000
@@ -1,35 +1,23 @@
-# -*- encoding: utf-8 -*-
+# -*- coding: utf-8 -*-
##############################################################################
#
-# __init__.py
-# ccorp_account
-# First author: Carlos Vásquez <carlos.vasquez@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
-# Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without modification, are
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice, this list of
-# conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice, this list
-# of conditions and the following disclaimer in the documentation and/or other materials
-# provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation are those of the
-# authors and should not be interpreted as representing official policies, either expressed
-# or implied, of ClearCorp S.A..
-#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
##############################################################################
-import invoice
+import account_invoice_report
=== added file 'account_invoice_webkit_report/report/account_invoice_report.mako'
--- account_invoice_webkit_report/report/account_invoice_report.mako 1970-01-01 00:00:00 +0000
+++ account_invoice_webkit_report/report/account_invoice_report.mako 2013-11-06 21:08:00 +0000
@@ -0,0 +1,137 @@
+<html>
+<head>
+ <style type="text/css">
+ ${css}
+ </style>
+</head>
+<body class = "data">
+ %for inv in objects :
+ <% setLang(inv.partner_id.lang) %>
+ <div id="wrapper">
+ <table width = "100%" class = "document_data">
+ <tr class = "title">
+ <td class = "document_data">
+ %if inv.type == 'out_invoice' and (inv.state == 'open' or inv.state == 'paid') :
+ <span class="title">${_("Electronic Invoice")} ${inv.number or ''|entity}</span>
+ %elif inv.type == 'out_invoice' and inv.state == 'proforma2' :
+ <span class="title">${_("Proforma")} ${inv.number or ''|entity}</span>
+ %elif inv.type == 'out_invoice' and inv.state == 'draft' :
+ <span class="title">${_("Draft Inovice")} ${inv.number or ''|entity}</span>
+ %elif inv.type == 'out_invoice' and inv.state == 'cancel':
+ <span class="title">${_("Canceled Invoice")} ${inv.number or ''|entity}</span>
+ %elif inv.type == 'in_invoice' :
+ <span class="title">${_("Supplier Invoice")} ${inv.number or ''|entity}</span>
+ %elif inv.type == 'out_refund' :
+ <span class="title">${_("Refund")} ${inv.number or ''|entity}</span>
+ %elif inv.type == 'in_refund' :
+ <span class="title">${_("Supplier Refund")} ${inv.number or ''|entity}</span>
+ %endif
+ </td>
+ <td>
+ ${inv.partner_id.name}
+ </td>
+ </tr>
+ <tr>
+ <td>${inv.name or '-'}</td>
+ <td>${_("ID Num.")}: ${inv.partner_id.ref or '-'}</td>
+ </tr>
+ <tr>
+ <td>${_("Date:")} ${formatLang(inv.date_invoice, date=True)|entity}</td>
+ <td>${_("Phone")}:${inv.partner_id.phone or '-'}</td>
+ </tr>
+ <tr>
+ <td>${_("Due date")}: ${formatLang(inv.date_due, date=True)|entity}</td>
+ <td>${_("Fax")}: ${inv.partner_id.fax or '-'}</td>
+ </tr>
+ <tr>
+ <td>${_("Payment tems")}: ${inv.payment_term.name or '-'}</td>
+ <td colspan = "2">${_("Email")}: ${inv.partner_id.email or '-'}</td><td> </td>
+ </tr>
+ <tr>
+ <td>${_("Salesman")}: ${inv.partner_id.user_id.name or '-'}</td>
+ <td> </td>
+ </tr>
+ <tr class = "zone_break"><td> </td><td> </td></tr>
+ <tr class = "title"><td>${_("Address")}</td><td> </td></tr>
+ <tr><td>${inv.partner_id.street or ''}</td><td> </td></tr>
+ <tr><td>${inv.partner_id.street2 or ''}</td><td> </td></tr>
+ <tr><td>${(inv.partner_id.zip and format(inv.partner_id.zip) + ((inv.partner_id.city or inv.partner_id.state_id or inv.partner_id.country_id) and ' ' or '') or '') + (inv.partner_id.city and format(inv.partner_id.city) + ((inv.partner_id.state_id or inv.partner_id.country_id) and ', ' or '') or '') + (inv.partner_id.state_id and format(inv.partner_id.state_id.name) + (inv.partner_id.country_id and ', ' or '') or '') + (inv.partner_id.country_id and format(inv.partner_id.country_id.name) or '')}</td><td> </td></tr>
+ <tr><td> </td><td> </td></tr>
+ </table>
+ <table id ="data-table" cellspacing = "3">
+ %if inv.amount_discounted != 0:
+ <thead><th>${_("Qty")}</th><th>${_("[Code] Description / (Taxes)")}</th><th>${_("Disc.(%)")}</th><th>${_("Unit Price")}</th><th>${_("Total Price")}</th></thead>
+ %else:
+ <thead><th>${_("Qty")}</th><th>${_("[Code] Description / (Taxes)")}</th><th>${_("Unit Price")}</th><th>${_("Total Price")}</th></thead>
+ %endif
+ <tbody>
+ <%i = 0 %>
+ %for line in inv.invoice_line :
+ %if i% 2 == 0:
+ <tr class = "even">
+ %else:
+ <tr class = "odd">
+ %endif
+ %if line.uos_id:
+ <td valign = "top">${formatLang(line.quantity)} ${format(line.uos_id.name)}</td>
+ %else:
+ <td valign = "top">${formatLang(line.quantity)}</td>
+ %endif
+ <td valign = "top" id="desc_col">${line.name}
+ %if line.invoice_line_tax_id != []:
+ ${ ', '.join([ tax.name or '' for tax in line.invoice_line_tax_id ])|entity}
+ %endif
+ </td>
+ %if inv.amount_discounted != 0:
+ <td valign = "top" style="text-align:right;">${line.discount and formatLang(line.discount) + '%' or '-'}</td>
+ %endif
+ %if inv.currency_id.position == 'before':
+ <td style="text-align:right;" valign = "top">${inv.currency_id.symbol or ''|entity } ${formatLang(line.price_unit)}</td>
+ <td style="text-align:right;" valign = "top">${inv.currency_id.symbol or ''|entity } ${formatLang(line.price_subtotal_not_discounted)}</td>
+ %else:
+ <td style="text-align:right;" valign = "top">${formatLang(line.price_unit)} ${inv.currency_id.symbol or ''|entity } </td>
+ <td style="text-align:right;" valign = "top">${formatLang(line.price_subtotal_not_discounted)} ${inv.currency_id.symbol or ''|entity }</td>
+ %endif
+ </tr>
+ <%i += 1%>
+ %endfor
+ %if inv.amount_discounted != 0:
+ %if inv.currency_id.position == 'before':
+ <tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"/><td style="border-top:2px solid"><b>${_("Sub Total")}:</b></td><td style="border-top:2px solid;text-align:right">${inv.currency_id.symbol or ''|entity} ${formatLang(inv.amount_untaxed_not_discounted)}</td></tr>
+ <tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"><b>${_("Discount")}:</b></td><td style="text-align:right">${inv.currency_id.symbol or ''|entity} ${formatLang(inv.amount_discounted)}</td></tr>
+ <tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"><b>${_("Taxes")}:</b></td><td style="text-align:right">${inv.currency_id.symbol or ''|entity} ${formatLang(inv.amount_tax)}</td></tr>
+ <tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"/><td style="border-top:2px solid"><b>${_("Total")}:</b></td><td style="border-top:2px solid;text-align:right">${inv.currency_id.symbol or ''|entity} ${formatLang(inv.amount_total)}</td></tr>
+ %else:
+ <tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"/><td style="border-top:2px solid"><b>${_("Sub Total")}:</b></td><td style="border-top:2px solid;text-align:right">${formatLang(inv.amount_untaxed_not_discounted)} ${inv.currency_id.symbol or ''|entity}</td></tr>
+ <tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"><b>${_("Discount")}:</b></td><td style="text-align:right">${formatLang(inv.amount_discounted)} ${inv.currency_id.symbol or ''|entity}</td></tr>
+ <tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"><b>${_("Taxes")}:</b></td><td style="text-align:right">${formatLang(inv.amount_tax)} ${inv.currency_id.symbol or ''|entity}</td></tr>
+ <tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"/><td style="border-top:2px solid"><b>${_("Total")}:</b></td><td style="border-top:2px solid;text-align:right">${formatLang(inv.amount_total)} ${inv.currency_id.symbol or ''|entity}</td></tr>
+ %endif
+ %else:
+ %if inv.currency_id.position == 'before':
+ <tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-top:2px solid"><b>${_("Sub Total")}:</b></td><td style="border-top:2px solid;text-align:right">${inv.currency_id.symbol or ''|entity} ${formatLang(inv.amount_untaxed_not_discounted)}</td></tr>
+ <tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"><b>${_("Taxes")}:</b></td><td style="text-align:right">${inv.currency_id.symbol or ''|entity} ${formatLang(inv.amount_tax)}</td></tr>
+ <tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-top:2px solid"><b>${_("Total")}:</b></td><td style="border-top:2px solid;text-align:right">${inv.currency_id.symbol or ''|entity} ${formatLang(inv.amount_total)}</td></tr>
+ %else:
+ <tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-top:2px solid"><b>${_("Sub Total")}:</b></td><td style="border-top:2px solid;text-align:right">${formatLang(inv.amount_untaxed_not_discounted)} ${inv.currency_id.symbol or ''|entity}</td></tr>
+ <tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"><b>${_("Taxes")}:</b></td><td style="text-align:right">${formatLang(inv.amount_tax)} ${inv.currency_id.symbol or ''|entity}</td></tr>
+ <tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-top:2px solid"><b>${_("Total")}:</b></td><td style="border-top:2px solid;text-align:right">${formatLang(inv.amount_total)} ${inv.currency_id.symbol or ''|entity}</td></tr>
+ %endif
+ %endif
+ </tbody>
+ </table>
+ <table id = "notes_table">
+ %if inv.comment:
+ <tr><td><b>${_("Invoice Note")}:</b><br />
+ ${format(inv.comment)}</td></tr>
+ %endif
+ %if inv.payment_term and inv.payment_term.note:
+ <tr><td><b>${_("Payment Note")}:</b><br />
+ ${format(inv.payment_term and inv.payment_term.note)}</td></tr>
+ %endif
+ </table>
+ </div>
+ <p style="page-break-after:always"></p>
+ %endfor
+</body>
+</html>
=== added file 'account_invoice_webkit_report/report/account_invoice_report.py'
--- account_invoice_webkit_report/report/account_invoice_report.py 1970-01-01 00:00:00 +0000
+++ account_invoice_webkit_report/report/account_invoice_report.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import time
+import pooler
+import locale
+from report import report_sxw
+
+class account_invoice_ccorp(report_sxw.rml_parse):
+ def __init__(self, cr, uid, name, context):
+ super(account_invoice_ccorp, self).__init__(cr, uid, name, context=context)
+ self.localcontext.update({
+ 'time': time,
+ 'cr' : cr,
+ 'uid': uid,
+ })
+
+report_sxw.report_sxw(
+ 'report.account.invoice.layout_ccorp',
+ 'account.invoice',
+ 'addons/account_invoice_webkit_report/report/account_invoice_report.mako',
+ parser=account_invoice_ccorp)
=== removed file 'account_invoice_webkit_report/report/invoice.mako'
--- account_invoice_webkit_report/report/invoice.mako 2012-12-03 20:31:03 +0000
+++ account_invoice_webkit_report/report/invoice.mako 1970-01-01 00:00:00 +0000
@@ -1,123 +0,0 @@
-<html>
-<head>
- <style type="text/css">
- ${css}
- </style>
-</head>
-<body class = "data">
- %for inv in objects :
- <% setLang(inv.partner_id.lang) %>
- <div id="wrapper">
- <table width = "100%" class = "document_data">
- <tr class = "title">
- <td class = "document_data">
- %if inv.type == 'out_invoice' and (inv.state == 'open' or inv.state == 'paid') :
- <span class="title">${_("Electronic Invoice")} ${inv.number or ''|entity}</span>
- %elif inv.type == 'out_invoice' and inv.state == 'proforma2' :
- <span class="title">${_("PROFORMA")} ${inv.number or ''|entity}</span>
- %elif inv.type == 'out_invoice' and inv.state == 'draft' :
- <span class="title">${_("Draft Inovice")} ${inv.number or ''|entity}</span>
- %elif inv.type == 'out_invoice' and inv.state == 'cancel':
- <span class="title">${_("Canceled Invoice")} ${inv.number or ''|entity}</span>
- %elif inv.type == 'in_invoice' :
- <span class="title">${_("Supplier Invoice")} ${inv.number or ''|entity}</span>
- %elif inv.type == 'out_refund' :
- <span class="title">${_("Refund")} ${inv.number or ''|entity}</span>
- %elif inv.type == 'in_refund' :
- <span class="title">${_("Supplier Refund")} ${inv.number or ''|entity}</span>
- %endif
- </td>
- <td>
- ${inv.partner_id.name}
- </td>
- </tr>
- <tr>
- <td>${inv.name or '' |entity}</td>
- <td>${_("ID Num.")}: ${inv.partner_id.ref or '-'|entity}</td>
- </tr>
- <tr>
- <td>${_("Date:")} ${formatLang(inv.date_invoice, date=True)|entity}</td>
- <td>${_("Phone")}:${inv.address_invoice_id.phone or '-'|entity}</td>
- </tr>
- <tr>
- <td>${_("Due date")}: ${formatLang(inv.date_due, date=True)|entity}</td>
- <td>${_("Fax")}: ${inv.address_invoice_id.fax or '-' | entity}</td>
- </tr>
- <tr>
- <td>${_("Payment tems")}: ${inv.payment_term.name or '-' |entity}</td>
- <td colspan = "2">${_("Email")}: ${inv.address_invoice_id.email or '-'|entity}</td><td> </td>
- </tr>
- <tr>
- <td>${_("Salesman")}: ${inv.partner_id.user_id.name or ' '|entity}</td>
- <td> </td>
- </tr>
- <tr class = "zone_break"><td> </td><td> </td></tr>
- <tr class = "title"><td>${_("Address")}</td><td> </td></tr>
- <tr><td>${inv.address_invoice_id.street or ''}</td><td> </td></tr>
- <tr><td>${inv.address_invoice_id.street2 or ''}</td><td> </td></tr>
- <tr><td>${(inv.address_invoice_id.zip and format(inv.address_invoice_id.zip) + ((inv.address_invoice_id.city or inv.address_invoice_id.state_id or inv.address_invoice_id.country_id) and ' ' or '') or '') + (inv.address_invoice_id.city and format(inv.address_invoice_id.city) + ((inv.address_invoice_id.state_id or inv.address_invoice_id.country_id) and ', ' or '') or '') + (inv.address_invoice_id.state_id and format(inv.address_invoice_id.state_id.name) + (inv.address_invoice_id.country_id and ', ' or '') or '') + (inv.address_invoice_id.country_id and format(inv.address_invoice_id.country_id.name) or '')}</td><td> </td></tr>
- <tr><td> </td><td> </td></tr>
- </table>
- <table id ="data-table" cellspacing = "3">
- %if inv.amount_discounted != 0:
- <thead><th>${_("Qty")}</th><th>${_("[Code] Description / (Taxes)")}</th><th>${_("Disc.(%)")}</th><th>${_("Unit Price")}</th><th>${_("Total Price")}</th></thead>
- %else:
- <thead><th>${_("Qty")}</th><th>${_("[Code] Description / (Taxes)")}</th><th>${_("Unit Price")}</th><th>${_("Total Price")}</th></thead>
- %endif
- <tbody>
- <%i = 0 %>
- %for line in inv.invoice_line :
- %if i% 2 == 0:
- <tr class = "even">
- %else:
- <tr class = "odd">
- %endif
- %if line.uos_id:
- <td valign = "top">${formatLang(line.quantity)} ${format(line.uos_id.name)}</td>
- %else:
- <td valign = "top">${formatLang(line.quantity)}</td>
- %endif
- <td valign = "top" id="desc_col">${line.name}
- %if line.invoice_line_tax_id != []:
- ${ ', '.join([ tax.name or '' for tax in line.invoice_line_tax_id ])|entity}
- %endif
- %if line.note :
- <br/><span class = "notes"><b>${_("Note")}:</b> ${format(line.note)}</span>
- %endif
- </td>
- %if inv.amount_discounted != 0:
- <td valign = "top" style="text-align:right;">${line.discount and formatLang(line.discount) + '%' or '-'}</td>
- %endif
- <td style="text-align:right;" valign = "top">${inv.currency_id.symbol_prefix or ''|entity } ${formatLang(line.price_unit)} ${inv.currency_id.symbol_suffix or ''|entity }</td>
- <td style="text-align:right;" valign = "top">${inv.currency_id.symbol_prefix or ''|entity } ${formatLang(line.price_subtotal_not_discounted)} ${inv.currency_id.symbol_suffix or ''|entity }</td>
- </tr>
- <%i += 1%>
- %endfor
- %if inv.amount_discounted != 0:
- <tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"/><td style="border-top:2px solid"><b>${_("Sub Total")}:</b></td><td style="border-top:2px solid;text-align:right">${inv.currency_id.symbol_prefix or ''|entity} ${formatLang(inv.amount_untaxed_not_discounted)} ${inv.currency_id.symbol_suffix or ''|entity}</td></tr>
- <tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"><b>${_("Discount")}:</b></td><td style="text-align:right">${inv.currency_id.symbol_prefix or ''|entity} ${formatLang(inv.amount_discounted)} ${inv.currency_id.symbol_suffix or ''|entity}</td></tr>
- <tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"><b>${_("Taxes")}:</b></td><td style="text-align:right">${inv.currency_id.symbol_prefix or ''|entity} ${formatLang(inv.amount_tax)} ${inv.currency_id.symbol_suffix or ''|entity}</td></tr>
- <tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"/><td style="border-top:2px solid"><b>${_("Total")}:</b></td><td style="border-top:2px solid;text-align:right">${inv.currency_id.symbol_prefix or ''|entity} ${formatLang(inv.amount_total)} ${inv.currency_id.symbol_suffix or ''|entity}</td></tr>
- %else:
- <tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-top:2px solid"><b>${_("Sub Total")}:</b></td><td style="border-top:2px solid;text-align:right">${inv.currency_id.symbol_prefix or ''|entity} ${formatLang(inv.amount_untaxed_not_discounted)} ${inv.currency_id.symbol_suffix or ''|entity}</td></tr>
- <tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-style:none"><b>${_("Taxes")}:</b></td><td style="text-align:right">${inv.currency_id.symbol_prefix or ''|entity} ${formatLang(inv.amount_tax)} ${inv.currency_id.symbol_suffix or ''|entity}</td></tr>
- <tr><td style="border-style:none"/><td style="border-style:none"/><td style="border-top:2px solid"><b>${_("Total")}:</b></td><td style="border-top:2px solid;text-align:right">${inv.currency_id.symbol_prefix or ''|entity} ${formatLang(inv.amount_total)} ${inv.currency_id.symbol_suffix or ''|entity}</td></tr>
- %endif
-
- </tbody>
- </table>
- <table id = "notes_table">
- %if inv.comment:
- <tr><td><b>${_("Invoice Note")}:</b><br />
- ${format(inv.comment)}</td></tr>
- %endif
- %if inv.payment_term and inv.payment_term.note:
- <tr><td><b>${_("Payment Note")}:</b><br />
- ${format(inv.payment_term and inv.payment_term.note)}</td></tr>
- %endif
- </table>
- </div>
- <p style="page-break-after:always"></p>
- %endfor
-</body>
-</html>
=== removed file 'account_invoice_webkit_report/report/invoice.py'
--- account_invoice_webkit_report/report/invoice.py 2012-06-30 22:41:06 +0000
+++ account_invoice_webkit_report/report/invoice.py 1970-01-01 00:00:00 +0000
@@ -1,54 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# invoice.py
-# ccorp_account
-# First author: Carlos Vásquez <carlos.vasquez@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
-# Second author: Mag Guevara <mag.guevara@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
-# Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without modification, are
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice, this list of
-# conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice, this list
-# of conditions and the following disclaimer in the documentation and/or other materials
-# provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation are those of the
-# authors and should not be interpreted as representing official policies, either expressed
-# or implied, of ClearCorp S.A..
-#
-##############################################################################
-
-import time
-import pooler
-from report import report_sxw
-import locale
-
-class account_invoice_ccorp(report_sxw.rml_parse):
- def __init__(self, cr, uid, name, context):
- super(account_invoice_ccorp, self).__init__(cr, uid, name, context=context)
- self.localcontext.update({
- 'time': time,
- 'cr' : cr,
- 'uid': uid,
- })
-
-report_sxw.report_sxw(
- 'report.account.invoice.layout_ccorp',
- 'account.invoice',
- 'addons/account_invoice_webkit_report/report/invoice.mako',
- parser=account_invoice_ccorp)
=== added file 'account_invoice_webkit_report/report/report.xml'
--- account_invoice_webkit_report/report/report.xml 1970-01-01 00:00:00 +0000
+++ account_invoice_webkit_report/report/report.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<openerp>
+ <data>
+ <report
+ auto = "False"
+ id = "account.account_invoices"
+ model = "account.invoice"
+ name = "account.invoice.layout_ccorp"
+ file = "account_invoice_webkit_report/report/account_invoice_report.mako"
+ string = "Account Invoice"
+ report_type = "webkit"
+ webkit_header = "invoice_header_webkit"/>
+ </data>
+</openerp>
=== modified file 'account_journal_extended_code/__init__.py'
--- account_journal_extended_code/__init__.py 2012-06-30 22:41:06 +0000
+++ account_journal_extended_code/__init__.py 2013-11-06 21:08:00 +0000
@@ -1,35 +1,25 @@
-# -*- encoding: utf-8 -*-
+# -*- coding: utf-8 -*-
##############################################################################
#
-# __init__.py
-# account_journal_extended_code
-# First author: Carlos Vásquez <carlos.vasquez@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
-# Copyright (c) 2011-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without modification, are
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice, this list of
-# conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice, this list
-# of conditions and the following disclaimer in the documentation and/or other materials
-# provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation are those of the
-# authors and should not be interpreted as representing official policies, either expressed
-# or implied, of ClearCorp S.A..
-#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
##############################################################################
import account_journal_extended_code
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'account_journal_extended_code/__openerp__.py'
--- account_journal_extended_code/__openerp__.py 2012-06-30 22:41:06 +0000
+++ account_journal_extended_code/__openerp__.py 2013-11-06 21:08:00 +0000
@@ -1,50 +1,40 @@
-# -*- encoding: utf-8 -*-
+# -*- coding: utf-8 -*-
##############################################################################
#
-# __openerp__.py
-# account_journal_extended_code
-# First author: Carlos Vásquez <carlos.vasquez@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
-# Copyright (c) 2011-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without modification, are
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice, this list of
-# conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice, this list
-# of conditions and the following disclaimer in the documentation and/or other materials
-# provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation are those of the
-# authors and should not be interpreted as representing official policies, either expressed
-# or implied, of ClearCorp S.A..
-#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
##############################################################################
{
- 'name': 'Journal code extended',
- 'version': '0.1',
- 'author': 'ClearCorp S.A.',
- 'website': 'http://clearcorp.co.cr',
- 'category': 'General Modules/Accounting',
- 'description': """Enables up to 64 chars in a journal code
- """,
- 'depends': ['account'],
- 'init_xml': [],
- 'demo_xml': [],
- 'update_xml': [],
- 'license': 'Other OSI approved licence',
- 'installable': True,
- 'active': False,
+ 'name': 'Journal code extended',
+ 'version': '1.0',
+ 'author': 'ClearCorp S.A.',
+ 'website': 'http://clearcorp.co.cr',
+ 'category': 'General Modules/Accounting',
+ 'description': """Enables up to 64 chars in a journal code
+ """,
+ 'depends': ['account'],
+ 'init_xml': [],
+ 'demo_xml': [],
+ 'update_xml': [],
+ 'license': 'AGPL-3',
+ 'installable': True,
+ 'active': False,
}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'account_journal_extended_code/account_journal_extended_code.py'
--- account_journal_extended_code/account_journal_extended_code.py 2012-06-30 22:41:06 +0000
+++ account_journal_extended_code/account_journal_extended_code.py 2013-11-06 21:08:00 +0000
@@ -1,47 +1,36 @@
-# -*- encoding: utf-8 -*-
+# -*- coding: utf-8 -*-
##############################################################################
#
-# account_journal_extended_code.py
-# account_journal_extended_code
-# First author: Carlos Vásquez <carlos.vasquez@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
-# Copyright (c) 2011-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without modification, are
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice, this list of
-# conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice, this list
-# of conditions and the following disclaimer in the documentation and/or other materials
-# provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation are those of the
-# authors and should not be interpreted as representing official policies, either expressed
-# or implied, of ClearCorp S.A..
-#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
##############################################################################
from osv import osv,fields
-class journal(osv.osv):
- '''
- Adds up to 64 chars to a journal code
- '''
- _name = 'account.journal'
- _inherit = 'account.journal'
-
- _columns = {
+class AccountJournal(osv.osv):
+ '''
+ Adds up to 64 chars to a journal code
+ '''
+ _name = 'account.journal'
+ _inherit = 'account.journal'
+
+ _columns = {
'code': fields.char('Code', size=64, required=True, help="The code will be used to generate the numbers of the journal entries of this journal."),
- }
-journal()
+ }
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'account_journal_period_report/__openerp__.py'
--- account_journal_period_report/__openerp__.py 2013-01-17 19:12:32 +0000
+++ account_journal_period_report/__openerp__.py 2013-11-06 21:08:00 +0000
@@ -29,11 +29,12 @@
'complexity': 'normal',
'description': """This module modifies the account journal period report """,
'depends': [
- 'account',
+ 'account','account_report_lib',
],
'init_xml': [],
'demo_xml': [],
- 'update_xml': ['report/report.xml',],
+ 'update_xml': ['wizard/account_journal_period_report_wizard_view.xml',
+ 'report/report.xml',],
'license': 'AGPL-3',
'installable': True,
'active': False,
=== added directory 'account_journal_period_report/i18n'
=== renamed directory 'account_journal_period_report/i18n' => 'account_journal_period_report/i18n.moved'
=== added file 'account_journal_period_report/i18n/es_CR.po'
--- account_journal_period_report/i18n/es_CR.po 1970-01-01 00:00:00 +0000
+++ account_journal_period_report/i18n/es_CR.po 2013-11-06 21:08:00 +0000
@@ -0,0 +1,105 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * account_journal_period_report
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-05-05 03:02+0000\n"
+"PO-Revision-Date: 2013-05-05 03:02+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:62
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:70
+msgid "Account"
+msgstr "Cuenta"
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:108
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:118
+msgid "TOTAL"
+msgstr "TOTAL"
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:31
+msgid "Chart of Accounts: "
+msgstr "Catálogo contable: "
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:33
+msgid "Selected period: "
+msgstr "Períodos seleccionados: "
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:34
+msgid "Entries Sorted By:"
+msgstr "Apuntes ordenados por:"
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:60
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:68
+msgid "Move"
+msgstr "Asiento"
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:61
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:69
+msgid "Date"
+msgstr "Fecha"
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:66
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:74
+msgid "Credit"
+msgstr "Crédito"
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:75
+msgid "Amount Currency"
+msgstr "Monto divisa"
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:24
+msgid "Journal Report "
+msgstr "Reporte de Diario(s) "
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:35
+msgid "Target Moves: "
+msgstr "Movimientos destino: "
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:65
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:73
+msgid "Debit"
+msgstr "Débito"
+
+#. module: account_journal_period_report
+#: model:ir.model,name:account_journal_period_report.model_account_print_journal
+msgid "Account Print Journal"
+msgstr "Contabilidad. Imprimir diario"
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:63
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:71
+msgid "Partner"
+msgstr "Empresa"
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:64
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:72
+msgid "Label"
+msgstr "Etiqueta"
+
+#. module: account_journal_period_report
+#: report:addons/account_journal_period_report/report/account_journal_period_report.mako:32
+msgid "Fiscal Year: "
+msgstr "Año fiscal: "
+
=== modified file 'account_journal_period_report/report/account_journal_period_report.mako'
--- account_journal_period_report/report/account_journal_period_report.mako 2013-03-19 22:31:39 +0000
+++ account_journal_period_report/report/account_journal_period_report.mako 2013-11-06 21:08:00 +0000
@@ -7,7 +7,7 @@
</style>
</head>
<body>
- <%setLang(user.context_lang)%>
+ <%setLang(user.lang)%>
<%
fiscalyear = get_fiscalyear(data)
company = get_account(data)
@@ -18,13 +18,14 @@
%>
<div class="table header">
<div class="table-row">
- <div class="table-cell logo">${helper.embed_logo_by_name('internal_reports_logo', height=100)|n}</div>
+ <div class="table-cell logo">${helper.embed_logo_by_name('default_logo', height=100)|n}</div>
<br/>
<div class="table-cell text">
<p class="title">${_('Journal Report ')}</p>
</div>
</div>
</div>
+ <br/><br/>
<div class="table list">
<div class="table-header">
<div class="table-row labels no-wrap">
=== modified file 'account_journal_period_report/report/report.xml'
--- account_journal_period_report/report/report.xml 2013-01-17 19:12:32 +0000
+++ account_journal_period_report/report/report.xml 2013-11-06 21:08:00 +0000
@@ -6,14 +6,12 @@
<field name="report_type">webkit</field>
<field name="report_name">account_journal_period_print_inherit</field>
<field eval="[(6,0,[])]" name="groups_id"/>
- <field eval="0" name="multi"/>
- <field eval="0" name="auto"/>
- <field eval="1" name="header"/>
<field name="model">account.print.journal</field>
<field name="type">ir.actions.report.xml</field>
<field name="name">Journal</field>
<field name="report_rml">account_journal_period_report/report/account_journal_period_report.mako</field>
<field name="report_file">account_journal_period_report/report/account_journal_period_report.mako</field>
+ <field name="webkit_header" ref="report_webkit_lib.webkit_header_clearcorp_official_portrait"/>
</record>
</data>
</openerp>
=== modified file 'account_journal_period_report/wizard/__init__.py'
--- account_journal_period_report/wizard/__init__.py 2013-01-17 19:12:32 +0000
+++ account_journal_period_report/wizard/__init__.py 2013-11-06 21:08:00 +0000
@@ -20,5 +20,4 @@
#
##############################################################################
-
import account_journal_period_report_wizard
=== added file 'account_journal_period_report/wizard/account_journal_period_report_wizard_view.xml'
--- account_journal_period_report/wizard/account_journal_period_report_wizard_view.xml 1970-01-01 00:00:00 +0000
+++ account_journal_period_report/wizard/account_journal_period_report_wizard_view.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="account_report_print_journal_inherit" model="ir.ui.view">
+ <field name="name">account.report.print.journal.inherit</field>
+ <field name="model">account.print.journal</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="account.account_report_print_journal"/>
+ <field name="arch" type="xml">
+ <data>
+ <field name="fiscalyear_id" position="attributes">
+ <attribute name="required">True</attribute>
+ </field>
+ </data>
+ </field>
+ </record>
+ </data>
+</openerp>
=== removed directory 'account_journal_view_extended'
=== removed file 'account_journal_view_extended/__init__.py'
--- account_journal_view_extended/__init__.py 2012-06-30 22:41:06 +0000
+++ account_journal_view_extended/__init__.py 1970-01-01 00:00:00 +0000
@@ -1,34 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# __init__.py
-# account_journal_view_extended
-# First author: Carlos Vásquez <carlos.vasquez@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
-# Copyright (c) 2011-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without modification, are
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice, this list of
-# conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice, this list
-# of conditions and the following disclaimer in the documentation and/or other materials
-# provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation are those of the
-# authors and should not be interpreted as representing official policies, either expressed
-# or implied, of ClearCorp S.A..
-#
-##############################################################################
-
=== removed file 'account_journal_view_extended/__openerp__.py'
--- account_journal_view_extended/__openerp__.py 2012-06-30 22:41:06 +0000
+++ account_journal_view_extended/__openerp__.py 1970-01-01 00:00:00 +0000
@@ -1,51 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# __openerp__.py
-# account_journal_view_extended
-# First author: Carlos Vásquez <carlos.vasquez@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
-# Copyright (c) 2011-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without modification, are
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice, this list of
-# conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice, this list
-# of conditions and the following disclaimer in the documentation and/or other materials
-# provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation are those of the
-# authors and should not be interpreted as representing official policies, either expressed
-# or implied, of ClearCorp S.A..
-#
-##############################################################################
-
-{
- 'name': 'Journal View extended mode',
- 'version': '0.1',
- 'author': 'ClearCorp S.A.',
- 'website': 'http://clearcorp.co.cr',
- 'category': 'General Modules/Accounting',
- 'description': """Enables hidden and read-only fields on account journal views.
- This allows user to configure all properties of journal views.
- """,
- 'depends': ['account'],
- 'init_xml': [],
- 'demo_xml': [],
- 'update_xml': ['account_journal_view_extended_view.xml'],
- 'license': 'Other OSI approved licence',
- 'installable': True,
- 'active': False,
-}
=== removed file 'account_journal_view_extended/account_journal_view_extended_view.xml'
--- account_journal_view_extended/account_journal_view_extended_view.xml 2012-06-30 22:41:06 +0000
+++ account_journal_view_extended/account_journal_view_extended_view.xml 1970-01-01 00:00:00 +0000
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
- <data>
- <!--
- Resource: account.journal.column
- Shows hidden and readonly fields
- -->
- <record id="account_journal_view_extended_form" model="ir.ui.view">
- <field name="name">account.journal.column.form_ccorp1</field>
- <field name="model">account.journal.column</field>
- <field name="inherit_id" ref="account.view_journal_column_form"/>
- <field name="type">form</field>
- <field name="arch" type="xml">
- <field name="sequence" position="replace">
- <field name="sequence" readonly="False"/>
- <field name="required"/>
- <field name="readonly"/>
- </field>
- </field>
- </record>
- <record id="account_journal_view_extended_tree" model="ir.ui.view">
- <field name="name">account.journal.column.tree_ccorp1</field>
- <field name="model">account.journal.column</field>
- <field name="inherit_id" ref="account.view_journal_column_tree"/>
- <field name="type">tree</field>
- <field name="arch" type="xml">
- <field name="name" position="after">
- <field name="field"/>
- <field name="required"/>
- <field name="readonly"/>
- </field>
- </field>
- </record>
- </data>
-</openerp>
=== modified file 'account_move_reverse/account_move_reverse.py'
--- account_move_reverse/account_move_reverse.py 2013-10-31 21:14:04 +0000
+++ account_move_reverse/account_move_reverse.py 2013-11-06 21:08:00 +0000
@@ -27,9 +27,22 @@
_inherit = 'account.move'
+ #Add a reversed and reversion state to account.move.
+ #Reversed state is for moves that have been reverted.
+ #Reversion state is for moves that are created based on another move. It's the move reverse.
_columns = {
- 'move_reverse_id':fields.many2one('account.move','Move Reverse'),
- }
+ 'move_reverse_id':fields.many2one('account.move','Move Reverse'),
+ 'state': fields.selection(
+ [('draft','Unposted'),
+ ('posted','Posted'),
+ ('reversed','Reversed'),
+ ('reversion','Reversion')],
+ 'Status', required=True, readonly=True,
+ help='All manually created new journal entries are usually in the status \'Unposted\', but you can set the option to skip that status on the related journal. \
+ \n* In that case, they will behave as journal entries automatically created by the system on document validation (invoices, bank statements...) and will be created in \'Posted\' status. \
+ \n* The \'Reversed\' state is used the move have a move reversed \
+ \n* The \'Reversion\' state is used when the move is a move reverse that is created when the move is reverse.'),
+ }
def copy(self, cr, uid, id, default={}, context=None):
default.update({
@@ -142,7 +155,21 @@
#Posted move reverse
self.pool.get('account.move').post(cr, 1, [move_id, move_original.id], context={})
+
+ #Change in move state 8/7/2013 -> Diana Rodriguez
+ '''
+ A move that is reversed can't reverse again. A move that is create from a move is a reversion
+ and also can't reverse again. Write the states of move_id (reversion) and move_original (reversed).
+ '''
+ self.write(cr, uid, [move_id], {'state' : 'reversion'}, context=context)
+ self.write(cr, uid, [move_original.id], {'state' : 'reversed'}, context=context)
+
return True
+
+ #Action that is call in button.
+ def reverse_move_button(self, cr, uid, ids, context):
+ return self.reverse(cr, uid, ids,context=context)
+
class AccountJournal(orm.Model):
_inherit = 'account.journal'
=== modified file 'account_move_reverse/account_move_reverse_view.xml'
--- account_move_reverse/account_move_reverse_view.xml 2012-07-19 21:48:01 +0000
+++ account_move_reverse/account_move_reverse_view.xml 2013-11-06 21:08:00 +0000
@@ -12,5 +12,29 @@
</field>
</field>
</record>
+
+ <!-- Account Move -->
+ <record id="view_move_form_inherit" model="ir.ui.view">
+ <field name="name">account.move.form.inherit</field>
+ <field name="model">account.move</field>
+ <field name="inherit_id" ref="account.view_move_form"/>
+ <field name="arch" type="xml">
+ <xpath expr = "/form/header/field[@name='state']" position = "before">
+ <button name="reverse_move_button" string="Reverse" type="object" states="posted" confirm="Are you sure to reverse this record ?" groups="account.group_account_invoice"/>
+ </xpath>
+ </field>
+ </record>
+
+ <record id = "view_account_move_filter_inherit" model="ir.ui.view">
+ <field name="name">account.move.select.inherit</field>
+ <field name="model">account.move</field>
+ <field name="inherit_id" ref="account.view_account_move_filter"/>
+ <field name="arch" type="xml">
+ <filter string="Posted" position="after">
+ <filter icon="terp-camera_test" string="Reversed" domain="[('state','=','reversed')]" help="Reversed Journal Entries"/>
+ <filter icon="terp-camera_test" string="Reversion" domain="[('state','=','reversion')]" help="Reversion Journal Entries"/>
+ </filter>
+ </field>
+ </record>
</data>
</openerp>
=== removed file 'account_move_reverse/i18n/account_move_reverse.pot'
--- account_move_reverse/i18n/account_move_reverse.pot 2012-07-19 22:57:59 +0000
+++ account_move_reverse/i18n/account_move_reverse.pot 1970-01-01 00:00:00 +0000
@@ -1,83 +0,0 @@
-# Translation of OpenERP Server.
-# This file contains the translation of the following modules:
-# * account_move_reverse
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: OpenERP Server 6.1\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-07-19 22:20+0000\n"
-"PO-Revision-Date: 2012-07-19 22:20+0000\n"
-"Last-Translator: <>\n"
-"Language-Team: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: \n"
-"Plural-Forms: \n"
-
-#. module: account_move_reverse
-#: constraint:account.move:0
-msgid "You can not create more than one move per period on centralized journal"
-msgstr ""
-
-#. module: account_move_reverse
-#: code:addons/account_move_reverse/account_move_reverse.py:42
-#: code:addons/account_move_reverse/account_move_reverse.py:46
-#, python-format
-msgid "Error !"
-msgstr ""
-
-#. module: account_move_reverse
-#: model:ir.model,name:account_move_reverse.model_account_journal
-msgid "Journal"
-msgstr ""
-
-#. module: account_move_reverse
-#: field:account.move,move_reverse_id:0
-msgid "Move Reverse"
-msgstr ""
-
-#. module: account_move_reverse
-#: field:account.journal,update_reversed:0
-msgid "Allow Cancelling Reversed Entries"
-msgstr ""
-
-#. module: account_move_reverse
-#: sql_constraint:account.journal:0
-msgid "The name of the journal must be unique per company !"
-msgstr ""
-
-#. module: account_move_reverse
-#: code:addons/account_move_reverse/account_move_reverse.py:46
-#, python-format
-msgid "You can not modify a posted entry of this journal !\n"
-"You should set the journal to allow cancelling reversed entries if you want to do that."
-msgstr ""
-
-#. module: account_move_reverse
-#: constraint:account.journal:0
-msgid "Configuration error! The currency chosen should be shared by the default accounts too."
-msgstr ""
-
-#. module: account_move_reverse
-#: sql_constraint:account.journal:0
-msgid "The code of the journal must be unique per company !"
-msgstr ""
-
-#. module: account_move_reverse
-#: model:ir.model,name:account_move_reverse.model_account_move
-msgid "Account Entry"
-msgstr ""
-
-#. module: account_move_reverse
-#: help:account.journal,update_reversed:0
-msgid "Check this box if you want to allow the cancellation of the reversed entries related to this journal or of the invoice related to this journal"
-msgstr ""
-
-#. module: account_move_reverse
-#: code:addons/account_move_reverse/account_move_reverse.py:42
-#, python-format
-msgid "You can not modify a posted entry of this journal !\n"
-"You should set the journal to allow cancelling entries if you want to do that."
-msgstr ""
-
=== modified file 'account_move_reverse/i18n/es_CR.po'
--- account_move_reverse/i18n/es_CR.po 2012-07-19 22:57:59 +0000
+++ account_move_reverse/i18n/es_CR.po 2013-11-06 21:08:00 +0000
@@ -4,10 +4,10 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: OpenERP Server 6.1\n"
+"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-07-19 22:20+0000\n"
-"PO-Revision-Date: 2012-07-19 22:20+0000\n"
+"POT-Creation-Date: 2013-07-08 19:46+0000\n"
+"PO-Revision-Date: 2013-07-08 19:46+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -16,23 +16,38 @@
"Plural-Forms: \n"
#. module: account_move_reverse
-#: constraint:account.move:0
-msgid "You can not create more than one move per period on centralized journal"
-msgstr "No puede crear más de un movimiento por periodo en un diario centralizado"
+#: view:account.move:0
+msgid "Reversion Journal Entries"
+msgstr "Asientos de reversión"
#. module: account_move_reverse
-#: code:addons/account_move_reverse/account_move_reverse.py:42
-#: code:addons/account_move_reverse/account_move_reverse.py:46
+#: code:addons/account_move_reverse/account_move_reverse.py:55
+#: code:addons/account_move_reverse/account_move_reverse.py:59
#, python-format
msgid "Error !"
msgstr "Error !"
#. module: account_move_reverse
+#: view:account.move:0
+msgid "Reverse"
+msgstr "Revertir"
+
+#. module: account_move_reverse
+#: view:account.move:0
+msgid "Reversion"
+msgstr "Reversión"
+
+#. module: account_move_reverse
#: model:ir.model,name:account_move_reverse.model_account_journal
msgid "Journal"
msgstr "Diario"
#. module: account_move_reverse
+#: view:account.move:0
+msgid "Reversed Journal Entries"
+msgstr "Asientos revertidos"
+
+#. module: account_move_reverse
#: field:account.move,move_reverse_id:0
msgid "Move Reverse"
msgstr "Asiento Reverso"
@@ -43,12 +58,7 @@
msgstr "Permitir cancelación de los asientos invertidos"
#. module: account_move_reverse
-#: sql_constraint:account.journal:0
-msgid "The name of the journal must be unique per company !"
-msgstr "¡El nombre del diario debe ser único por compañía!"
-
-#. module: account_move_reverse
-#: code:addons/account_move_reverse/account_move_reverse.py:46
+#: code:addons/account_move_reverse/account_move_reverse.py:59
#, python-format
msgid "You can not modify a posted entry of this journal !\n"
"You should set the journal to allow cancelling reversed entries if you want to do that."
@@ -56,16 +66,6 @@
"Debe establecer el diario para permitir cancelar los asientos invertidos si quieres hacer eso."
#. module: account_move_reverse
-#: constraint:account.journal:0
-msgid "Configuration error! The currency chosen should be shared by the default accounts too."
-msgstr "¡Error de configuración! La moneda elegida debería ser también la misma en las cuentas por defecto"
-
-#. module: account_move_reverse
-#: sql_constraint:account.journal:0
-msgid "The code of the journal must be unique per company !"
-msgstr "¡El código del diario debe ser único por compañía!"
-
-#. module: account_move_reverse
#: model:ir.model,name:account_move_reverse.model_account_move
msgid "Account Entry"
msgstr "Asiento contable"
@@ -76,10 +76,25 @@
msgstr "Marque esta casilla si desea permitir la cancelación de los asientos invertidos relacionadas con estediario o de la factura relacionada con este diario"
#. module: account_move_reverse
-#: code:addons/account_move_reverse/account_move_reverse.py:42
+#: code:addons/account_move_reverse/account_move_reverse.py:55
#, python-format
msgid "You can not modify a posted entry of this journal !\n"
"You should set the journal to allow cancelling entries if you want to do that."
msgstr "No se puede modificar un asiento contabilizado de este diario !\n"
"Debe establecer el diario para permitir cancelar los asientos si quieres hacer eso."
+#. module: account_move_reverse
+#: view:account.move:0
+msgid "Reversed"
+msgstr "Revertido"
+
+#. module: account_move_reverse
+#: view:account.move:0
+msgid "Are you sure to reverse this record ?"
+msgstr "Está seguro de revertir este asiento ?"
+
+#. module: account_move_reverse
+#: view:account.move:0
+msgid "Posted"
+msgstr "Asentado"
+
=== added directory 'account_name_extended'
=== added file 'account_name_extended/__init__.py'
--- account_name_extended/__init__.py 1970-01-01 00:00:00 +0000
+++ account_name_extended/__init__.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import account_name_extended
=== added file 'account_name_extended/__openerp__.py'
--- account_name_extended/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_name_extended/__openerp__.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,56 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+
+{
+ "name" : 'Account name extended',
+ "version" : '1.0',
+ "author" : 'CLEARCORP S.A',
+ 'complexity': 'normal',
+ "description": """
+This module simply renames the financial account. It makes uses of the company shortcut (provided by "base_company_prefix" module) and the account shortcut field.
+
+The account will appear as:
+CP-CODE SRT2/SRT3/.../SRTn-1/NAME
+
+CP: Company prefix
+CODE: Account code
+SRT2: Account shortcut for the second parent (being the account without parent the first)
+SRTX: Next account shortcuts for the account hierarchy
+NAME: Account name
+
+Also, rename the journal, that add the company prefix in the name get and name search.
+ """,
+ "category": 'Accounting & Finance',
+ "sequence": 4,
+ "website" : "http://clearcorp.co.cr",
+ "images" : [],
+ "icon" : False,
+ "depends" : ["account","base_company_prefix"],
+ "init_xml" : [],
+ "demo_xml" : [],
+ "update_xml" : ["account_name_extended_view.xml"],
+ "test" : [],
+ "auto_install": False,
+ "application": False,
+ "installable": True,
+}
\ No newline at end of file
=== added file 'account_name_extended/account_name_extended.py'
--- account_name_extended/account_name_extended.py 1970-01-01 00:00:00 +0000
+++ account_name_extended/account_name_extended.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,393 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import re
+from osv import osv, fields
+from openerp.tools import translate
+
+class account_account(osv.osv):
+ _name = "account.account"
+ _inherit = "account.account"
+
+ #Change the way that the user can see the account when is search in a many2one field.
+ #Add the company prefix in the name of the company and the shortcurt of the parent's account.
+ def name_get(self, cr, uid, ids, context=None):
+ if not ids:
+ return []
+ res = []
+
+ #Avoid problem when only an account is selected
+ if isinstance(ids, int):
+ accounts = [self.browse(cr,uid,ids)]
+ else:
+ accounts = self.browse(cr,uid,ids)
+
+ for obj_account in accounts:
+ obj_company = self.pool.get('res.company').browse(cr,uid,obj_account.company_id.id)
+ #If the company of the account have prefix, add in the account's name.
+ prefix= obj_company.prefix
+ if prefix == False:
+ prefix = ''
+ data = []
+ account = obj_account.parent_id
+ #Add the parent's name shortcut.
+ if account.parent_id:
+ while account.parent_id:
+ data.insert(0,(account.shortcut or account.name))
+ account = account.parent_id
+ data.append(obj_account.name)
+ data = '/'.join(data)
+ data = obj_account.code + ' ' + data
+ data = prefix and prefix + '-' + data or data
+ else:
+ #If there not exist a parent, concat the account's name.
+ data.append(obj_account.name)
+ data = '/'.join(data)
+ data = prefix and prefix + ' ' + data or data
+ res.append((obj_account.id, data))
+ return res
+
+
+ #Add the company prefix and the regular expression that permit search include the special characteres.
+ def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100):
+ account_ids = company_ids = search_domains = []
+ dict_prefix = {}
+ regular_expresion_number = '^[0-9.-_]+$'
+
+ if not args:
+ args = []
+
+ #Code doesn't start with first word by numbers or special characters
+ #Name doesn't start with numbers.
+ if name:
+ piece_1 = piece_2 = piece_3 = ''
+ #Method partition return a tuple that contains the first part before the separator (in this case ' ') and the other position
+ #is the rest of the sentence.
+ temp_partition = name.partition(' ')
+ piece_1 = temp_partition[0]
+ piece_2 = temp_partition[2]
+
+ company_ids = self.pool.get('res.company').search(cr, uid, [])
+ companies = self.pool.get('res.company').browse(cr, uid, company_ids)
+
+ for company in companies:
+ if company.prefix:
+ dict_prefix[company.id] = company.prefix
+
+ #1. Si hay prefijos y compañía
+ # dict_prefix tiene el id de la compañía con su respectivo prefijo
+ if dict_prefix:
+ for id, prefix in dict_prefix.iteritems():
+ if piece_1.lower() in prefix.lower():
+ company_ids.append(id)
+ if company_ids: #compañías que coinciden con el prefijo
+ #Si el prefijo es un número
+ if re.match(regular_expresion_number, piece_1):
+ if piece_2: #Si se digita algo luego del prefijo.
+ piece_2_b = piece_2.partition(' ')[0]
+ #Si es un número
+ if re.match(regular_expresion_number, piece_2_b):
+ search_domains.append({
+ 'company_ids':company_ids,
+ 'code':piece_2_b,
+ 'name':piece_2.partition(' ')[2]
+ })
+ else:
+ #Si es cualquier otra cosa.
+ search_domains.append({
+ 'company_ids':company_ids,
+ 'name':piece_2
+ })
+ search_domains.append({'code': piece_1,
+ 'name':piece_2})
+
+ else:
+ #Si no se digita nada luego del prefijo
+ search_domains.append({'company_ids':company_ids})
+ search_domains.append({'code':piece_1})
+ else:
+ #Si el prefijo no es un número
+ #Si se digita algo luego del prefijo
+ if piece_2:
+ piece_2_b = piece_2.partition(' ')[0]
+ piece_3 = piece_2.partition(' ')[2]
+ #Si es un número
+ if re.match(regular_expresion_number, piece_2_b):
+ search_domains.append({
+ 'company_ids':company_ids,
+ 'code':piece_2_b,
+ 'name':piece_3
+ })
+ else:
+ #Si noes un número
+ search_domains.append({
+ 'company_ids':company_ids,
+ 'name':piece_2})
+
+ search_domains.append({'name':name})
+
+ else:
+ #Si no se digita luego del prefijo
+ search_domains.append({'company_ids':company_ids})
+ search_domains.append({'name':name})
+ else:
+ #Si el prefijo no es un número
+ if re.match(regular_expresion_number, piece_1):
+ search_domains.append({
+ 'code':piece_1,
+ 'name':piece_2
+ })
+ else:
+ search_domains.append({'name':name})
+ #Si no existe prefijo.
+ else:
+ if re.match(regular_expresion_number, piece_1):
+ search_domains.append({
+ 'code':piece_1,
+ 'name':piece_2
+ })
+ else:
+ search_domains.append({'name':name})
+
+ #Build the search domain for the account browser.
+ search_domain = []
+ regular_expresion = '%'
+ for domain in search_domains:
+ temp_domain = []
+ if 'company_ids' in domain.keys():
+ temp_domain.append(('company_id','in', domain['company_ids']))
+
+ if 'code' in domain.keys():
+ code = domain['code']
+ code = code.replace('-','').replace('_', '').replace('.','')
+ new_code = regular_expresion
+
+ for c in code:
+ new_code += c + regular_expresion
+
+ temp_domain.append(('code', '=like', new_code))
+
+ if 'name' in domain.keys():
+ if domain['name']:
+ temp_domain.append(('name', operator, domain['name']))
+
+ #Depend of the quantity of domain, add the & or the '|'
+ if len(temp_domain) == 1:
+ search_domain += temp_domain
+
+ elif len(temp_domain) == 2:
+ search_domain.append('&')
+ search_domain += temp_domain
+
+ else:
+ search_domain.append('&')
+ search_domain.append('&')
+ search_domain += temp_domain
+
+ number_or = (len(search_domains) / 2) - 1
+ cont = 0
+ while cont < number_or:
+ search_domain = ['|'] + search_domain
+ cont += 1
+
+ account_ids = self.pool.get('account.account').search(cr, uid, search_domain + args, limit=limit, context=context)
+
+ else:
+ account_ids = self.pool.get('account.account').search(cr, uid, [] +args, limit=limit, context=context)
+
+ return self.name_get(cr, uid, account_ids, context=context) #search the names that match with the ids.
+
+class account_journal(osv.osv):
+ _name = "account.journal"
+ _inherit = "account.journal"
+
+ #Add the company prefix to the journal name.
+
+ def name_get(self, cr, user, ids, context=None):
+
+ if not ids:
+ return []
+ if isinstance(ids, (int, long)):
+ ids = [ids]
+ result = self.browse(cr, user, ids, context=context)
+ res = []
+ for rs in result:
+ obj_company = self.pool.get('res.company').browse(cr,user,rs.company_id.id)
+ prefix= obj_company.prefix
+ if prefix == False:
+ prefix = ''
+ data = []
+ data.append(rs.code)
+ data.append(rs.name)
+ data = ' - '.join(data)
+ data = prefix and prefix + ' ' + data or data
+ res.append((rs.id, data))
+
+ return res
+
+
+ #Add company prefix to the journal search.
+ def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100):
+ #TODO: Pass comments to english
+ journal_ids = company_ids = search_domains = []
+ dict_prefix = {}
+
+ if not args:
+ args = []
+
+ if name:
+ piece_1 = piece_2 = ''
+ #Method partition return a tuple that contains the first part before the separator (in this case ' ') and the other position
+ #is the rest of the sentence.
+ temp_partition = name.partition(' ')
+ piece_1 = temp_partition[0]
+ piece_2 = temp_partition[2]
+
+ company_ids = self.pool.get('res.company').search(cr, uid, [])
+ companies = self.pool.get('res.company').browse(cr, uid, company_ids)
+
+ for company in companies:
+ if company.prefix:
+ dict_prefix[company.id] = company.prefix
+
+ #1. Si hay prefijos y compañía
+ # dict_prefix tiene el id de la compañía con su respectivo prefijo
+ for id, prefix in dict_prefix.iteritems():
+ if piece_1.lower() in prefix.lower():
+ company_ids.append(id)
+
+ #Se deben cumplir ambas condiciones para que tenga prefijo.
+ if dict_prefix and company_ids:
+ #P2 existe (siguieron "digitando" luego del prefijo)
+ if piece_2:
+ piece_2_b = piece_2.partition(' ')[0]
+ piece_3 = piece_2.partition(' ')[2]
+
+ #Domains
+ search_domains.append({
+ 'code':piece_2_b,
+ 'name':piece_3,
+ 'company_ids':company_ids
+ })
+
+ search_domains.append({'company_ids':company_ids,
+ 'name':piece_2})
+
+ search_domains.append({'name': name })
+ search_domains.append({
+ 'code':piece_1,
+ 'name':name,
+ })
+
+ else:
+ search_domains.append({
+ 'company_ids':company_ids,
+ 'name':piece_1,
+ 'code':piece_1})
+
+ #Si no existe prefijo ...
+ else:
+ if piece_2: #Si se siguió digitando
+ search_domains.append({'name': name })
+ search_domains.append({
+ 'code':piece_1,
+ 'name':piece_2,
+ })
+ #Si solo se digitó una palabra en el inicio de la búsqueda.
+ else:
+ search_domains.append({
+ 'code':piece_1,
+ 'name':piece_1,
+ })
+
+ #Build the search domain for the account browser.
+ search_domain = []
+ regular_expresion = '%'
+ for domain in search_domains:
+ temp_domain = []
+ if 'company_ids' in domain.keys():
+ temp_domain.append(('company_id','in', domain['company_ids']))
+
+ if 'code' in domain.keys():
+ code = domain['code']
+ code = code.replace('-','').replace('_', '').replace('.','')
+ new_code = regular_expresion
+
+ for c in code:
+ new_code += c + regular_expresion
+
+ #ilike toma en cuenta mayúsculas y minúsculas
+ temp_domain.append(('code', 'ilike', new_code))
+
+ if 'name' in domain.keys():
+ if domain['name']:
+ temp_domain.append(('name', operator, domain['name']))
+
+
+ #Depend of the quantity of domain, add the & or the '|'
+ #A diferencia de la cuenta, cualquiera puede coincidir por lo que se cambia el '&' por el '|'
+ if len(temp_domain) == 1:
+ search_domain += temp_domain
+
+ elif len(temp_domain) == 2:
+ search_domain.append('|')
+ search_domain += temp_domain
+
+ else:
+ search_domain.append('|')
+ search_domain.append('&')
+ search_domain += temp_domain
+
+ number_or = (len(search_domains) / 2) - 1
+ cont = 0
+ while cont < number_or:
+ search_domain = ['|'] + search_domain
+ cont += 1
+
+ journal_ids = self.pool.get('account.journal').search(cr, uid, search_domain + args, limit=limit, context=context)
+
+ else:
+ journal_ids = self.pool.get('account.journal').search(cr, uid, [] + args, limit=limit, context=context)
+
+ return self.name_get(cr, uid, journal_ids, context=context) #search the names that match with the ids.
+
+class account_fiscalyear(osv.osv):
+ '''
+ Adds up to 16 chars to a Fiscal year code
+ '''
+ _name = 'account.fiscalyear'
+ _inherit = 'account.fiscalyear'
+
+ _columns = {
+ 'code': fields.char('Code', size=16, required=True, help="The code will be used to generate the numbers of the journal entries of this journal."),
+ }
+
+class account_period(osv.osv):
+ '''
+ Adds up to 16 chars to a Fiscal year code
+ '''
+ _name = 'account.period'
+ _inherit = 'account.period'
+
+ _columns = {
+ 'code': fields.char('Code', size=16),
+ }
=== added file 'account_name_extended/account_name_extended_view.xml'
--- account_name_extended/account_name_extended_view.xml 1970-01-01 00:00:00 +0000
+++ account_name_extended/account_name_extended_view.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,37 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<openerp>
+ <data>
+
+ <record model = "ir.ui.view" id = "account_rename_tree_view">
+ <field name = "name">account.account.tree</field>
+ <field name = "model">account.account</field>
+ <field name = "type">tree</field>
+ <field name="inherit_id" ref="account.view_account_list"/>
+ <field name = "arch" type = "xml">
+ <data>
+ <field name = "name" position = "after">
+ <field name = "shortcut"/>
+ </field>
+ <field name = "company_currency_id" position = "after">
+ <field name = "currency_id"/>
+ </field>
+ </data>
+ </field>
+ </record>
+
+ <record model = "ir.ui.view" id = "account_rename_form_view">
+ <field name = "name">account.account.form</field>
+ <field name = "model">account.account</field>
+ <field name = "type">form</field>
+ <field name="inherit_id" ref="account.view_account_form"/>
+ <field name = "arch" type = "xml">
+ <data>
+ <field name = "user_type" position = "after">
+ <field name = "shortcut" />
+ </field>
+ </data>
+ </field>
+ </record>
+ </data>
+</openerp>
+
=== added directory 'account_period_attachment_doc'
=== added file 'account_period_attachment_doc/__init__.py'
--- account_period_attachment_doc/__init__.py 1970-01-01 00:00:00 +0000
+++ account_period_attachment_doc/__init__.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import account_period_attachment_doc
\ No newline at end of file
=== added file 'account_period_attachment_doc/__openerp__.py'
--- account_period_attachment_doc/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_period_attachment_doc/__openerp__.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+{
+ 'name': 'Account Period Attachment',
+ 'version': '1.0',
+ 'category': 'Accounting & Finance',
+ 'description':
+ """
+ Add interface to attachment documents to account period.
+ """,
+ 'author': 'CLEARCORP S.A.',
+ 'website': 'http://www.clearcorp.co.cr',
+ 'depends': [
+ 'account',
+ 'base',
+ ],
+ 'data': [
+ 'account_period_attachment_doc.xml'
+ ],
+ 'installable': True,
+ 'auto_install': False,
+}
=== added file 'account_period_attachment_doc/account_period_attachment_doc.py'
--- account_period_attachment_doc/account_period_attachment_doc.py 1970-01-01 00:00:00 +0000
+++ account_period_attachment_doc/account_period_attachment_doc.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,40 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import fields, osv, orm
+from openerp.tools.translate import _
+
+class accountPeriodinherit(orm.Model):
+ _name = 'account.period'
+ _inherit = 'account.period'
+
+ def _get_reports_account_period(self, cr, uid, ids, field_name, arg, context=None):
+ period = self.browse(cr, uid, ids[0], context)
+ result = {}
+
+ result[period.id] = self.pool.get('ir.attachment').search(cr, uid, [('res_model','=','account.period'),('res_id','=',period.id)])
+
+ return result
+
+ _columns = {
+ 'file_ids': fields.function(_get_reports_account_period, type='one2many', obj = 'ir.attachment', string='Attachments', readonly=True),
+ }
=== added file 'account_period_attachment_doc/account_period_attachment_doc.xml'
--- account_period_attachment_doc/account_period_attachment_doc.xml 1970-01-01 00:00:00 +0000
+++ account_period_attachment_doc/account_period_attachment_doc.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,94 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<openerp>
+ <data>
+ <!-- Period -->
+ <record id="view_account_period_form_inherit_doc" model="ir.ui.view">
+ <field name = "name">account.period.form.inherit.doc</field>
+ <field name = "model">account.period</field>
+ <field name = "type">form</field>
+ <field name = "inherit_id" ref="account.view_account_period_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="/form/header" position="replace">
+ <header>
+ <field name="state" widget="statusbar" nolabel="1"/>
+ </header>
+ </xpath>
+ <field name="name" position="attributes">
+ <attribute name= "readonly">1</attribute>
+ </field>
+ <field name="fiscalyear_id" position="attributes">
+ <attribute name= "readonly">1</attribute>
+ </field>
+ <field name="date_start" position="attributes">
+ <attribute name= "readonly">1</attribute>
+ </field>
+ <field name="date_stop" position="attributes">
+ <attribute name= "readonly">1</attribute>
+ </field>
+ <field name="code" position="attributes">
+ <attribute name= "readonly">1</attribute>
+ </field>
+ <field name="special" position="attributes">
+ <attribute name= "readonly">1</attribute>
+ </field>
+ <field name="company_id" position="attributes">
+ <attribute name= "readonly">1</attribute>
+ </field>
+
+ <xpath expr="/form/sheet" position="inside">
+ <group>
+ <separator colspan="4" string="Attachments"/>
+ <field name="file_ids" nolabel="1">
+ <tree editable="bottom" string="Attachments">
+ <field name="datas_fname" />
+ <field name="datas" filename="datas_fname"/>
+ </tree>
+ </field>
+ </group>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="view_account_period_tree" model="ir.ui.view">
+ <field name="name">account.period.tree</field>
+ <field name="model">account.period</field>
+ <field name="arch" type="xml">
+ <tree colors="blue:state == 'draft';gray:state == 'done' " string="Period">
+ <field name="name"/>
+ <field name="code"/>
+ <field name="date_start"/>
+ <field name="date_stop"/>
+ <field name="special"/>
+ <field name="state"/>
+ </tree>
+ </field>
+ </record>
+
+ <record id="view_account_period_search_inherit_doc" model="ir.ui.view">
+ <field name="name">account.period.search.inherit.doc</field>
+ <field name="model">account.period</field>
+ <field name="arch" type="xml">
+ <search string="Search Period">
+ <field name="name" filter_domain="['|', ('name','ilike',self), ('code','ilike',self)]" string="Period"/>
+ <filter string="To Close" name="draft" domain="[('state','=','draft')]" icon="terp-dialog-close"/>
+ </search>
+ </field>
+ </record>
+
+ <record id="action_account_period_inherit_doc" model="ir.actions.act_window">
+ <field name="name">Attachment Documents for Periods</field>
+ <field name="res_model">account.period</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">tree,form</field>
+ <field name="context">{'search_default_draft': 1}</field>
+ <field name="help" type="html">
+ <p class="oe_view_nocontent_create">
+ Click to add a attachment to fiscal period.
+ </p>
+ </field>
+ </record>
+
+ <menuitem id="menu_action_account_period_inherit_doc" action="action_account_period_inherit_doc" parent="account.menu_finance_periodical_processing" sequence="200"/>
+
+ </data>
+</openerp>
=== added directory 'account_period_attachment_doc/i18n'
=== added file 'account_period_attachment_doc/i18n/es_CR.po'
--- account_period_attachment_doc/i18n/es_CR.po 1970-01-01 00:00:00 +0000
+++ account_period_attachment_doc/i18n/es_CR.po 2013-11-06 21:08:00 +0000
@@ -0,0 +1,66 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * account_period_attachment_doc
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-06-28 21:24+0000\n"
+"PO-Revision-Date: 2013-06-28 21:24+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: account_period_attachment_doc
+#: view:account.period:0
+#: field:account.period,file_ids:0
+msgid "Attachments"
+msgstr "Adjuntos"
+
+#. module: account_period_attachment_doc
+#: model:ir.model,name:account_period_attachment_doc.model_account_period
+#: model:ir.model,name:account_period_attachment_doc.model_account_period_attachment
+msgid "Account period"
+msgstr "Período contable"
+
+#. module: account_period_attachment_doc
+#: view:account.period:0
+msgid "Period"
+msgstr "Período"
+
+#. module: account_period_attachment_doc
+#: model:ir.actions.act_window,name:account_period_attachment_doc.action_account_period_inherit_doc
+#: model:ir.ui.menu,name:account_period_attachment_doc.menu_action_account_period_inherit_doc
+msgid "Attachment Documents for Periods"
+msgstr "Documentos adjuntos para los períodos"
+
+#. module: account_period_attachment_doc
+#: view:account.period:0
+msgid "Search Period"
+msgstr "Buscar periodo"
+
+#. module: account_period_attachment_doc
+#: view:account.period:0
+msgid "To Close"
+msgstr "Para cerrar"
+
+#. module: account_period_attachment_doc
+#: model:ir.actions.act_window,help:account_period_attachment_doc.action_account_period_inherit_doc
+msgid "<p class=\"oe_view_nocontent_create\">\n"
+" Click to add a attachment to fiscal period.\n"
+" </p>\n"
+" "
+msgstr "<p class=\"oe_view_nocontent_create\">\n"
+" Añadir un nuevo adjunto al período fiscal.\n"
+" </p>\n"
+" "
+
+#. module: account_period_attachment_doc
+#: model:ir.model,name:account_period_attachment_doc.model_ir_attachment
+msgid "ir.attachment"
+msgstr "ir.adjunto"
+
=== added directory 'account_report_lib'
=== added file 'account_report_lib/__init__.py'
--- account_report_lib/__init__.py 1970-01-01 00:00:00 +0000
+++ account_report_lib/__init__.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,26 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+import wizard
+import account_report_base
+import account_common_library
+import account_financial_report_build
+import tools
=== added file 'account_report_lib/__openerp__.py'
--- account_report_lib/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_report_lib/__openerp__.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,45 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+
+{
+ 'name': 'Account Report Library',
+ 'description': """ Generic module that is the base for the reports. """,
+ 'version': '1.0',
+ 'author': 'CLEARCORP S.A.',
+ 'category': 'Hidden',
+ 'website': "http://clearcorp.co.cr",
+ 'images': [],
+ 'depends': ['account', 'report_webkit_lib'],
+ 'init_xml': [],
+ 'demo' : [],
+ 'data': [
+ 'security/ir.model.access.csv',
+ 'data/account_base_type.xml',
+ 'tools/tools_modules_extended.xml',
+ 'wizard/account_report_wizard.xml',
+ ],
+ 'test': [],
+ 'active': False,
+ 'installable': True,
+ 'license': 'AGPL-3',
+}
=== added file 'account_report_lib/account_common_library.py'
--- account_report_lib/account_common_library.py 1970-01-01 00:00:00 +0000
+++ account_report_lib/account_common_library.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,383 @@
+#-*- coding:utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# d$
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import copy
+import netsvc
+from osv import fields, orm
+import tools
+
+class AccountWebkitReportLibrary(orm.Model):
+
+ _name = "account.webkit.report.library"
+ _description = "Account Webkit Reporting Library"
+
+ def get_move_lines(self, cr, uid, account_ids, filter_type='', filter_data=None, fiscalyear=None, target_move='all', unreconcile = False, historic_strict=False, special_period =False, order_by=None, context=None):
+ ''' Get the move lines of the accounts provided and filtered.
+ Arguments:
+ 'account_ids': List of accounts ids.
+ 'filter_type': Filter used, possibles values: 'filter_date', 'filter_period' or ''.
+ 'filter_data': If filter is by date then filter_data is a list of strings with the initial date and the ending date, if filter is by period then
+ filter_data is a list of browse record with the initial period and the ending period.
+ 'fiscalyear': Browse record of the fiscal year selected.
+ 'target_move': Target moves of the report, possibles values: 'all' or 'posted'.
+ 'unreconcile': If True then get the move lines unreconciled.
+ 'historic_strict': Used when unreconcile = True, forces to include move lines that where not reconciled at the end date of the filter but are now.
+ 'order_by': Used to the lines return order by specific order. asc or desc are the acepted words.
+
+ '''
+ """
+ Previosly, method get_move_lines only was used in Conciliation Bank Report. This report doesn't used start period as parameter, so method
+ didn't include start_period in method get_move_lines. start_period parameter is necessary for many reports, for example in Bank Account Balance Report.
+ For that reason, it's neccesary maked a change in Conciliation Bank Report, that change is initialize start_period in None and changes Conciliation
+ Bank report doesn't consider start_period as parameter.
+
+ In standard library it's necessary, also, specified if start_period is None, doesn't consider as parameter or if it has information, take as
+ start_period parameter and put with other filters in method. start_period is used to build periods range and pass it to method.
+
+ It modifies Conciliation Bank Report and standard library for both work only with final period or with a range of periods (as Bank Account Balance Report).
+ In the case of dates, it works at the same way (The balances of Bank Account Balance Report takes start_date as parameter)
+
+ If's sequences were eliminated and they were replaced for a unique domain. This action increase method's preformance
+ """
+
+ account_obj = self.pool.get('account.account')
+ move_line_obj = self.pool.get('account.move.line')
+ move_line_ids = []
+ list_tuples = []
+
+# search domains are constructed in a list of tuples. It makes a search domaind depend of parameters
+# search domain is builted for get account.move.lines that match with final search domain.
+
+ #*******************************BUILD SEARCH DOMAINS***************************#
+# if filter_data and filter_type are None (they don't have data) and fiscal_year doesn't exist
+# the method takes accounts that match with target_move parameter.
+
+ #********account_ids ******#
+ domain = ('account_id', 'in', account_ids)
+ list_tuples.append(domain)
+
+ #********target_mvove ******#
+ if not target_move == 'all':
+ domain = ('move_id.state', '=', target_move)
+ list_tuples.append(domain)
+
+ #********Filter by date, period or filter_type = '' *********#
+ if filter_type == 'filter_date':
+ if filter_data[0] is None: #it takes only final_date.
+ date_stop = filter_data[1]
+ domain = ('date', '<=', date_stop)
+ list_tuples.append(domain)
+ else:
+ domain_start_date = ('date', '>=', filter_data[0])
+ domain_stop_date = ('date', '<=', filter_data[1])
+ list_tuples.append(domain_start_date)
+ list_tuples.append(domain_stop_date)
+
+ elif filter_type == 'filter_period':
+ period_domain_list = []
+ date_stop = ('date_stop', '<=', filter_data[1].date_stop)
+ period_domain_list.append(date_stop)
+ #It is considered fiscal_year and special_period.
+ if fiscalyear:
+ fiscal_year = ('fiscalyear_id', '=', fiscalyear.id)
+ period_domain_list.append(fiscal_year)
+ if special_period == False:
+ special = ('special', '=', False)
+ else:
+ special = ('special', '=', True)
+ period_domain_list.append(special)
+
+ if filter_data[0]:
+ #This case is for reports that take initial_period or initial_date as parameter
+ date_start = ('date_start', '>=', filter_data[0].date_start)
+ period_domain_list.append(date_start)
+
+ #In final search domain, it takes fiscal_year, special periods, and start/end period
+ periods_ids = self.pool.get('account.period').search(cr, uid,period_domain_list, context=context)
+
+ #Get periods with previous ids.
+ domain_period = ('period_id.id', 'in', periods_ids)
+ list_tuples.append(domain_period)
+
+ #If filter doesn't exist, but fiscal_year exist, get periods that match with fiscal_year
+ #special_period parameter indicates that special periods are considered.
+ elif filter_type == '' and fiscalyear:
+ if special_period is True:
+ periods_ids = self.pool.get('account.period').search(cr, uid, [('special', '=', True),('fiscalyear_id', '=', fiscalyear.id)], context=context)
+ else:
+ periods_ids = self.pool.get('account.period').search(cr, uid, [('special', '=', False),('fiscalyear_id', '=', fiscalyear.id)], context=context)
+ domain_period = ('period_id.id', 'in', periods_ids)
+ list_tuples.append(domain_period)
+
+ #**********************************************************************************************#
+
+ if unreconcile == False:
+ move_line_ids = move_line_obj.search(cr, uid, list_tuples,order = order_by,context=context)
+
+ else:
+ #list_tuples + [domain_unreconciled] -> With this syntax doesn't change the variable
+ #list_tuples, the + makes a complete list with domain_unreconciled. Add [] for make as a format list.
+
+ #First, move line ids without reconcile_id (without conciliation)
+ domain_unreconciled = ('reconcile_id', '=', None)
+ unreconciled_move_line_ids = move_line_obj.search(cr, uid, list_tuples + [domain_unreconciled], context=context)
+
+ #historict_strict = If user needs a historic strict (this option obtains all move lines
+ #without conciliation to the date requested in report.)
+ if historic_strict == False:
+ move_line_ids = unreconciled_move_line_ids
+
+ #Mark historic_strict as True
+ else:
+ #Get maximal conciliation date to get move lines.
+ if filter_type == 'filter_date':
+ #maximal conciliation date is date selected
+ max_reconciled_date = filter_data[1]
+ elif filter_type == 'filter_period':
+ #maximal conciliation date is final date of selected period
+ max_reconciled_date = filter_data[1].date_stop
+ elif fiscalyear:
+ #If only fiscalyear exists, it takes end_date as maximal conciliation date
+ max_reconciled_date = fiscalyear.date_end
+ else:
+ max_reconciled_date = False
+
+ #If maximal date exists, get move lines without conciliation
+ #It is to compare unreconciled lines vrs reconciled lines.
+ #If any date_crete in unreconciled lines is more than maximal date of conciliation,
+ # add in list of unreconciled lines.
+ if max_reconciled_date:
+ domain_reconciled = ('reconcile_id', '<>', None)
+ reconciled_move_line_ids = move_line_obj.search(cr, uid, list_tuples + [domain_reconciled], context=context)
+ reconciled_move_lines = move_line_obj.browse(cr, uid, reconciled_move_line_ids, context=context)
+ for line in reconciled_move_lines:
+ if line.reconcile_id:
+ if line.reconcile_id.create_date > max_reconciled_date:
+ unreconciled_move_line_ids.append(line.id)
+
+ move_line_ids = unreconciled_move_line_ids
+
+ move_lines = move_line_ids and move_line_obj.browse(cr, uid, move_line_ids, context=context) or []
+
+ return move_lines
+
+ def get_account_balance(self, cr, uid,
+ account_ids,
+ field_names,
+ initial_balance=False,
+ company_id=False,
+ fiscal_year_id=False,
+ all_fiscal_years=False,
+ state='all',
+ start_date=False,
+ end_date=False,
+ start_period_id=False,
+ end_period_id=False,
+ period_ids=False,
+ journal_ids=False,
+ chart_account_id=False,
+ filter_type = '',
+ context={}):
+ ''' Get the balance for the provided account ids with the provided filters
+ Arguments:
+ account_ids: [int], required, account ids
+ field_names: ['balance', 'debit', 'credit', 'foreign_balance'], the fields to compute
+ initial_balance: bool, True if the return must be the initial balance for the period of time specified, not the ending balance.
+ company_id: int, id for the company
+ fiscal_year_id: int, id for the fiscal year
+ all_fiscal_years: bool, True if all fiscal years must be used, including the closed ones. (usefull for receivable for ex.)
+ state: selection of: draft, posted, all; the state of the move lines used in the calculation
+ start_date: date string, start date
+ end_date: date string, end date
+ start_period_id: int, start period id
+ end_period_id: int, end period id
+ period_ids: list of int, list of periods ids used
+ journal_ids: list of int, list of journal ids used
+ chart_account_id: int, chart of account used
+ filter_type: string, tipo de filtro seleccionado.
+
+ If there is an end_period without a start_period, all precedent moves for the end period will be used.
+ If there isn't a fiscal year, all open fiscal years will be used. To include all closed fiscal years, the all_fiscal_years must be True.
+ '''
+ account_obj = self.pool.get('account.account')
+ period_obj = self.pool.get('account.period')
+ context_copy = copy.copy(context)
+ context = {}
+
+ if company_id:
+ context.update({'company_id':company_id})
+ if fiscal_year_id:
+ context.update({'fiscalyear':fiscal_year_id})
+ if all_fiscal_years:
+ context.update({'all_fiscalyear':all_fiscal_years})
+ if state:
+ context.update({'state':state})
+ if start_date:
+ context.update({'date_from':start_date})
+ if end_date:
+ context.update({'date_to':end_date})
+ if journal_ids:
+ context.update({'journal_ids':journal_ids})
+ if chart_account_id:
+ context.update({'chart_account_id':chart_account_id})
+
+ """
+ Variable initial_balance = True, if it is necessary get initial balance. If initial_balance is false is an "ordinary" balance.
+ If user needs initial balance, there are two options:
+ 1. Get initial balance with a range of periods: Gets previous period to period selected and previous period needs match with fiscal year (end_period_id variable).
+ 2. Get initial balance with only end period: Gets a period list until final period, those ids are period_ids variable. end_period_id is open period.
+
+ If user needs ordinary balance, there are two options:
+ 1. If start period and end period exist, get periods list between them and fiscal_year
+ 2. If only exist end_period: Get fiscal_year and end_period_id is period selected.
+ """
+
+ #fiscal_year
+ fiscal_year = self.pool.get('account.fiscalyear').browse(cr,uid,fiscal_year_id)
+
+ if start_period_id:
+ start_period = self.pool.get('account.period').browse(cr,uid,start_period_id)
+ if end_period_id:
+ end_period = self.pool.get('account.period').browse(cr,uid,end_period_id)
+
+ if filter_type == 'filter_period':
+ #Get initial_balance
+ if initial_balance == True:
+ # If start period and end period exist -> Calculate the list of periods until the initial period selected. The start_period_id
+ # is period before period selected.
+ if start_period_id and end_period_id:
+ start_period_id = self.pool.get('account.period').get_start_previous_period(cr, uid, start_period=start_period, fiscal_year=fiscal_year)
+ start_period = self.pool.get('account.period').browse(cr, uid, start_period_id)
+ period_ids = self.pool.get('account.period').get_interval_period(cr, uid, start_period=start_period, end_period = end_period, fiscal_year=fiscal_year_id, initial_balance=True)
+
+ # If only final period is selected -> Get range of periods until the period end.
+ # end_period_id = The "oldest" opening period in fiscal_year
+ if (not start_period_id and end_period_id):
+ period_ids = self.get_interval_period(cr, uid, end_period=end_period, fiscal_year=fiscal_year_id,initial_balance=True)
+
+ #Ordinary balance
+ else:
+ #only select a period: End period
+ if not period_ids and fiscal_year_id and not start_period_id and end_period_id:
+ end_period = period_obj.browse(cr, uid, end_period_id)
+ period_ids = period_obj.search(cr, uid, ['&',('fiscalyear_id','=',fiscal_year_id),('date_stop', '<=', end_period.date_stop)], context=context)
+
+ #Selected both periods
+ if not period_ids and fiscal_year_id and start_period_id and end_period_id:
+ start_period = period_obj.browse(cr, uid, start_period_id)
+ end_period = period_obj.browse(cr, uid, end_period_id)
+ period_ids = period_obj.get_interval_period(cr, uid, start_period=start_period, end_period=end_period, fiscal_year=fiscal_year_id)
+
+ #Only ordinary period needs start_period.
+ if start_period_id:
+ context.update({'period_from':start_period_id})
+
+ # If there are no filters, find the first special period of fiscal
+ if filter_type == '':
+ if initial_balance:
+ period_ids = [self.pool.get('account.period').search(cr, uid, [('fiscalyear_id','=',fiscal_year_id),('special','=',True)],order='date_start asc')[0]]
+ else:
+ period_ids = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id','=', fiscal_year_id)] )
+
+ #####################################################################
+
+ if end_period_id:
+ context.update({'period_to':end_period_id})
+
+ if period_ids:
+ context.update({'periods':period_ids})
+
+ '''
+ Description for the __compute method:
+ Get the balance for the provided account ids with the provided filters
+ Arguments:
+ `account_ids`: list, account ids
+ `field_names`: list, the fields to compute (valid values:
+ 'balance', 'debit', 'credit', foreign_balance)
+ `query`: additional query filter (as a string)
+ `query_params`: parameters for the provided query string
+ (__compute will handle their escaping) as a
+ tuple
+ 'context': The context have the filters for the move lines, to see the proper keys and values that should be used check
+ the method _query_get of account_move_line
+ initial_bal: bool, True if the return must be the initial balance for the period of time specified, not the ending balance.
+ company_id: int, id for the company, if provided only moves for that company will be used
+ fiscalyear: int, id for the fiscal year, if provided only moves for that fiscal year will be used
+ all_fiscalyear: bool, True if all fiscal years must be used, including the closed ones. (usefull for receivable for ex.)
+ state: selection of: draft, posted, all; the state of the move lines used in the calculation
+ date_from: date string, start date
+ date_to: date string, end date
+ period_from: int, start period id
+ period_to: int, end period id
+ periods: list of int, list of periods ids used
+ journal_ids: list of int, list of journal ids used
+ chart_account_id: int, chart of account used
+ '''
+ res = account_obj._account_account__compute(cr, uid, account_ids, field_names, context=context)
+ context = context_copy
+
+ return res
+
+ def get_balance_tmp(self, cr, uid, account_ids, field_names, arg=None, context=None,
+ query='', query_params=()):
+ ''' Get the balance for the provided account ids
+ Arguments:
+ `ids`: account ids
+ `field_names`: the fields to compute (a list of any of
+ 'balance', 'debit' and 'credit')
+ `arg`: unused fields.function stuff
+ `query`: additional query filter (as a string)
+ `query_params`: parameters for the provided query string
+ (__compute will handle their escaping) as a
+ tuple
+ 'context': The context have the filters for the move lines, to see the proper keys and values that should be used check
+ the method _query_get of account_move_line
+ '''
+ account_obj = self.pool.get('account.account')
+
+ res = account_obj._account_account__compute(cr, uid, account_ids, field_names, arg=arg, context=context,
+ query=query, query_params=query_params)
+
+ return res
+
+ def get_account_child_ids(self, cr, uid, account_ids, context={}):
+ if isinstance(account_ids, orm.browse_record):
+ account_ids = [account_ids.id]
+ elif isinstance(account_ids, int):
+ account_ids = [account_ids]
+ return self.pool.get('account.account')._get_children_and_consol(cr, uid, account_ids, context=context)
+
+ # returns amount of the currency symbol + position
+ def format_lang_currency (self, cr, uid, amount_currency, currency):
+ format_currency = ''
+
+ if currency:
+ if currency.symbol_prefix:
+ format_currency = currency.symbol_prefix + ' ' + amount_currency
+ else:
+ format_currency = amount_currency+ ' ' + currency.symbol_sufix
+ else:
+ format_currency = amount_currency
+
+ return format_currency
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'account_report_lib/account_financial_report_build.py'
--- account_report_lib/account_financial_report_build.py 1970-01-01 00:00:00 +0000
+++ account_report_lib/account_financial_report_build.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,123 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import fields, orm
+from collections import OrderedDict
+
+class accountFinancialreport(orm.Model):
+
+ _name = "account.financial.report"
+ _inherit = "account.financial.report"
+
+ '''
+ This method obtain the structure for a account_financial_report (must be view type).
+ Return a dictionary with a complete structure and the values.
+ The report's parses receive this structure and work with the data and return the
+ structure that must print the mako.
+
+ @param acc_financial_id: Account financial report ID. Comes from the wizard of the report and must be view type.
+
+ '''
+ def get_structure_account_financial_report(self, cr, uid, acc_financial_id=None, context=None):
+
+ account_obj = self.pool.get('account.account')
+ account_type_obj = self.pool.get('account.account.type')
+ library_obj = self.pool.get('account.webkit.report.library')
+
+ #Use OrderedDict() to dictionary respect alphabetic order for account_type code
+ #http://docs.python.org/2/library/collections.html#collections.OrderedDict
+ account_types_child = OrderedDict()
+ order_dict = OrderedDict()
+ account_child = OrderedDict()
+
+ #Main dictionary structure.
+ main_structure = {
+ 'name': '', #account.financial.report name
+ 'type':'', #type (sum, accounts, account_type, account_report)
+ 'display_type':'', #display type (no_detail, detail_flat, detail_with_hierarch)
+ 'style': '',
+ 'child':[], #If the account_financial_report selected is parent of another records
+ 'account_type': [], #If the account_financial_report selected is account_type type
+ 'account_type_child': {}, #Dictionary: (id of account_type is the key) list of accounts that match with the account_type
+ 'accounts': [], #List of accounts selected for account_financial_report
+ 'account_child': {} #Dictionary: (id of account_type is the key) list of accounts that match with the account
+ }
+
+ #1. Search the account_financial_report that match with acc_financial_id
+ parent_acc_fin_report = self.browse(cr, uid, acc_financial_id, context=context)
+
+ #2. Build the main dictionary
+ for parent in [parent_acc_fin_report]:
+ main_structure['name'] = parent.name
+ main_structure['code'] = parent.id
+ main_structure['type'] = parent.type
+ main_structure['display_detail'] = parent.display_detail
+ main_structure['style'] = parent.style_overwrite
+
+ '''TODO: Implement account_report (Valor en informe)'''
+ #3. Two cases: Type accounts or accounts. View is ignore.
+ if parent.type == 'account_type':
+ #Search the accounts that match with id type
+ for type in parent.account_type_ids:
+ #Create order_dict to sort account_type by code.
+ order_dict[type.code] = type
+ main_structure['account_type'].append(type)
+
+ #Search all the accounts that match with type selected. (Sort list by code)
+ for key in order_dict.keys():
+ #With OrderedDict(), keep alphabetic order.
+ account_type = order_dict[key]
+ accounts_ids = account_obj.search(cr, uid, [('user_type','=',account_type.id)])
+ accounts = account_obj.browse(cr, uid, accounts_ids)
+ account_types_child[account_type] = accounts
+
+ main_structure['account_type_child'] = account_types_child
+
+ elif parent.type == 'accounts':
+ #Check if display_type is detail_with_hierarch, get the child's account
+ for account in parent.account_ids:
+ order_dict[account.code] = account
+ main_structure['accounts'].append(account)
+
+ #Get all the child for account selected.
+ #if parent.display_detail == 'detail_with_hierarchy':
+ for key in order_dict.keys():
+ #With OrderedDict(), keep alphabetic order.
+ account = order_dict[key]
+ child_ids = library_obj.get_account_child_ids(cr, uid, account.id,context)
+ child_obj = account_obj.browse(cr, uid, child_ids)
+ account_child[account] = child_obj
+ main_structure['account_child'] = account_child
+
+ ########################################################################################
+
+ #4. Create a recursive method. Check if the account_financial_report have children.
+ account_financial_child = self.search(cr, uid, [('parent_id.id','=', acc_financial_id)], order='sequence asc')
+
+ if len(account_financial_child) > 0:
+ account_financial_child_obj = self.browse(cr, uid, account_financial_child)
+
+ for child in account_financial_child_obj:
+ main_structure['child'].append(self.get_structure_account_financial_report(cr, uid, child.id))
+
+ return main_structure
+
\ No newline at end of file
=== added file 'account_report_lib/account_report_base.py'
--- account_report_lib/account_report_base.py 1970-01-01 00:00:00 +0000
+++ account_report_lib/account_report_base.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,138 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import time
+import pooler
+from report import report_sxw
+import locale
+from openerp.tools.translate import _
+
+class accountReportbase(report_sxw.rml_parse):
+
+ """
+ This class is the base for the reports. Contains all the basic functions
+ to extract info that the reports needs
+ """
+ def __init__(self, cr, uid, name, context):
+ super(accountReportbase, self).__init__(cr, uid, name, context=context)
+ self.localcontext.update({
+ 'time': time,
+ 'cr' : cr,
+ 'uid': uid,
+ 'get_start_period': self.get_start_period,
+ 'get_end_period':self.get_end_period,
+ 'get_fiscal_year':self.get_fiscalyear,
+ 'get_chart_account_id': self.get_chart_account_id,
+ 'get_filter': self.get_filter,
+ 'get_target_move': self.get_target_move,
+ 'get_date_from': self.get_date_from,
+ 'get_date_to': self.get_date_to,
+ 'get_accounts_ids': self.get_accounts_ids,
+ 'get_historic_strict': self.get_historic_strict,
+ 'get_special_period': self.get_special_period,
+ 'display_target_move':self.get_display_target_move,
+ 'get_signatures_report': self.get_signatures_report,
+ 'get_amount_currency':self.get_amount_currency,
+ 'get_account_base_report':self.get_account_base_report,
+ })
+
+ #####################################BASIC FUNCTIONS ##############################
+
+ #Basic function that extract the id of the wizard and return the object (model)
+
+ '''
+ The method _get_info return a browse (return the complete model)
+ '''
+ def _get_info(self, data, field, model):
+ info = data.get('form', {}).get(field)
+ if info:
+ return self.pool.get(model).browse(self.cr, self.uid, info)
+ return False
+
+ '''
+ The method _get_form_param return the real value in the wizard.
+ '''
+ def _get_form_param(self, param, data, default=False):
+ return data.get('form', {}).get(param, default)
+
+ #########################################################################
+
+ def get_start_period(self, data):
+ return self._get_info(data,'period_from', 'account.period')
+
+ def get_end_period(self, data):
+ return self._get_info(data,'period_to', 'account.period')
+
+ def get_fiscalyear(self, data):
+ return self._get_info(data,'fiscalyear_id', 'account.fiscalyear')
+
+ def get_chart_account_id(self, data):
+ return self._get_info(data, 'chart_account_id', 'account.account')
+
+ def get_filter(self, data):
+ return self._get_form_param('filter', data)
+
+ def get_target_move(self, data):
+ return self._get_form_param('target_move', data)
+
+ def get_date_from(self, data):
+ return self._get_form_param('date_from', data)
+
+ def get_date_to(self, data):
+ return self._get_form_param('date_to', data)
+
+ #Case special for conciliation bank -> account_ids is an unicode.
+ def get_accounts_ids (self, cr, uid, data):
+ if isinstance(data['form']['account_ids'], unicode):
+ return self.pool.get('account.account').browse(cr, uid, [int(data['form']['account_ids'])])[0]
+
+ return self._get_info(data,'account_ids', 'account.account')
+
+ def get_historic_strict (self, data):
+ return self._get_form_param('historic_strict', data)
+
+ def get_special_period (self, data):
+ return self._get_form_param('special_period', data)
+
+ def get_amount_currency (self, data):
+ return self._get_form_param('amount_currency', data)
+
+ def get_account_base_report(self, data):
+ return self._get_info(data, 'account_base_report', 'account.financial.report')
+
+ ################################## INFO DISPLAY ###########################
+
+ def get_display_target_move(self, data):
+ val = self._get_form_param('target_move', data)
+ if val == 'posted':
+ return _('All Posted Entries')
+ elif val == 'all':
+ return _('All Entries')
+ else:
+ return val
+
+ ##################### SIGNATURES ############################
+ #Return the users that can sign the report.
+ def get_signatures_report(self, cr, uid, report_name):
+ report_id = self.pool.get('ir.actions.report.xml').search(cr, uid,[('name','=', report_name)])
+ report_obj = self.pool.get('ir.actions.report.xml').browse(cr, uid, report_id)
+ return report_obj[0].signature_users
\ No newline at end of file
=== added directory 'account_report_lib/data'
=== added file 'account_report_lib/data/account_base_type.xml'
--- account_report_lib/data/account_base_type.xml 1970-01-01 00:00:00 +0000
+++ account_report_lib/data/account_base_type.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="account_financial_report_type_asset" model="account.financial.report.type">
+ <field name="name">Balance de Comprobación</field>
+ <field name="code">TRIBAL</field>
+ </record>
+
+ <record id="account_financial_report_type_liability" model="account.financial.report.type">
+ <field name="name">Balance de Situación</field>
+ <field name="code">SITBAL</field>
+ </record>
+
+ <record id="account_financial_report_type_income" model="account.financial.report.type">
+ <field name="name">Estado de Resultados</field>
+ <field name="code">PROSTA</field>
+ </record>
+
+ <record id="account_financial_report_type_equity" model="account.financial.report.type">
+ <field name="name">Estado de Cambios de Patrimonio</field>
+ <field name="code">STCHEQ</field>
+ </record>
+
+ </data>
+</openerp>
=== added directory 'account_report_lib/i18n'
=== added file 'account_report_lib/i18n/es_CR.po'
--- account_report_lib/i18n/es_CR.po 1970-01-01 00:00:00 +0000
+++ account_report_lib/i18n/es_CR.po 2013-11-06 21:08:00 +0000
@@ -0,0 +1,300 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * account_report_lib
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-08-12 22:21+0000\n"
+"PO-Revision-Date: 2013-08-12 22:21+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: account_report_lib
+#: field:account.financial.report.type,name:0
+msgid "Type Name"
+msgstr "Nombre del tipo"
+
+#. module: account_report_lib
+#: model:ir.model,name:account_report_lib.model_account_financial_report_type
+msgid "Account Financial Report Type"
+msgstr "Tipo de Informe Financiero"
+
+#. module: account_report_lib
+#: field:res.company,property_expense_view_account:0
+msgid "Expense view account"
+msgstr "Cuenta de gasto"
+
+#. module: account_report_lib
+#: field:res.company,property_equity_view_account:0
+msgid "Equity view account"
+msgstr "Cuenta de patrimonio"
+
+#. module: account_report_lib
+#: help:account.report.wiz,amount_currency:0
+msgid "It adds the currency column on report if the currency differs from the company currency."
+msgstr "Añade una columna de moneda en el reporte si la moneda es diferente de la moneda de la compañía."
+
+#. module: account_report_lib
+#: view:account.report.wiz:0
+msgid "Print"
+msgstr "Imprimir"
+
+#. module: account_report_lib
+#: field:account.financial.report,account_type:0
+msgid "Base Catalog Account Type"
+msgstr "Tipo de cuenta de la base del catálogo"
+
+#. module: account_report_lib
+#: help:account.report.wiz,historic_strict:0
+msgid "If selected, will display a historical unreconciled lines, taking into account the end of the period or date selected"
+msgstr "Si se selecciona, se mostrarán las líneas sin conciliar históricas, teniendo en cuenta el final del período o la fecha seleccionada"
+
+#. module: account_report_lib
+#: field:res.company,property_liability_view_account:0
+msgid "Liability view account"
+msgstr "Cuenta de pasivo"
+
+#. module: account_report_lib
+#: help:account.account,report_currency_id:0
+msgid "Currency to show in the reports."
+msgstr "Moneda a mostrar en los reportes."
+
+#. module: account_report_lib
+#: view:account.report.wiz:0
+msgid "or"
+msgstr "o"
+
+#. module: account_report_lib
+#: field:account.account,report_currency_id:0
+msgid "Report Currency"
+msgstr "Moneda en reportes"
+
+#. module: account_report_lib
+#: view:account.report.wiz:0
+msgid "Historic strict"
+msgstr "Histórico estricto"
+
+#. module: account_report_lib
+#: field:account.report.wiz,special_period:0
+msgid "Special period"
+msgstr "Período especial"
+
+#. module: account_report_lib
+#: field:account.report.wiz,target_move:0
+msgid "Target Moves"
+msgstr "Movimientos destino"
+
+#. module: account_report_lib
+#: model:ir.model,name:account_report_lib.model_account_period
+msgid "Account period"
+msgstr "Período contable"
+
+#. module: account_report_lib
+#: view:account.report.wiz:0
+#: field:account.report.wiz,amount_currency:0
+msgid "With Currency"
+msgstr "Con moneda"
+
+#. module: account_report_lib
+#: selection:account.report.wiz,filter:0
+msgid "Date"
+msgstr "Fecha"
+
+#. module: account_report_lib
+#: field:account.report.wiz,chart_account_id:0
+msgid "Chart of Account"
+msgstr "Catálogo de cuentas"
+
+#. module: account_report_lib
+#: view:res.company:0
+msgid "Configuration"
+msgstr "Configuración"
+
+#. module: account_report_lib
+#: view:account.report.wiz:0
+#: field:account.report.wiz,journal_ids:0
+msgid "Journals"
+msgstr "Diarios"
+
+#. module: account_report_lib
+#: field:res.company,property_income_view_account:0
+msgid "Income view account"
+msgstr "Cuenta de ingreso"
+
+#. module: account_report_lib
+#: view:account.report.wiz:0
+msgid "Report Options"
+msgstr "Opciones de impresión de reporte"
+
+#. module: account_report_lib
+#: help:account.report.wiz,chart_account_id:0
+msgid "Select Charts of Accounts"
+msgstr "Seleccione el catálogo de cuentas"
+
+#. module: account_report_lib
+#: field:account.report.wiz,date_to:0
+msgid "End Date"
+msgstr "Fecha final"
+
+#. module: account_report_lib
+#: model:ir.model,name:account_report_lib.model_account_account
+msgid "Account"
+msgstr "Cuenta"
+
+#. module: account_report_lib
+#: field:account.report.wiz,period_from:0
+msgid "Start Period"
+msgstr "Período inicial"
+
+#. module: account_report_lib
+#: selection:account.report.wiz,target_move:0
+#: code:addons/account_report_lib/account_report_base.py:127
+#, python-format
+msgid "All Posted Entries"
+msgstr "Todos los apuntes publicados"
+
+#. module: account_report_lib
+#: model:ir.model,name:account_report_lib.model_res_company
+msgid "Companies"
+msgstr "Compañías"
+
+#. module: account_report_lib
+#: view:account.report.wiz:0
+msgid "General Options"
+msgstr "Opciones generales"
+
+#. module: account_report_lib
+#: help:account.report.wiz,fiscalyear_id:0
+msgid "Keep empty for all open fiscal year"
+msgstr "Mantenga vacío para todo el año fiscal abierto"
+
+#. module: account_report_lib
+#: field:account.report.wiz,period_to:0
+msgid "End Period"
+msgstr "Período final"
+
+#. module: account_report_lib
+#: view:account.report.wiz:0
+msgid "Account Financial Report"
+msgstr "Informe Financiero"
+
+#. module: account_report_lib
+#: field:account.report.wiz,historic_strict:0
+msgid "Strict History"
+msgstr "Histórico estricto"
+
+#. module: account_report_lib
+#: selection:account.report.wiz,filter:0
+msgid "No Filters"
+msgstr "Sin filtros"
+
+#. module: account_report_lib
+#: view:account.report.wiz:0
+msgid "Advanced options"
+msgstr "Opciones avanzadas"
+
+#. module: account_report_lib
+#: view:res.company:0
+msgid "Account Report Configuration"
+msgstr "Configuración de cuentas para los reportes"
+
+#. module: account_report_lib
+#: model:ir.model,name:account_report_lib.model_account_report_wiz
+msgid "Account Common Wizard"
+msgstr "Asistente común para las cuentas"
+
+#. module: account_report_lib
+#: field:account.report.wiz,date_from:0
+msgid "Start Date"
+msgstr "Fecha de inicio"
+
+#. module: account_report_lib
+#: field:account.report.wiz,fiscalyear_id:0
+msgid "Fiscal Year"
+msgstr "Año fiscal"
+
+#. module: account_report_lib
+#: field:account.financial.report.type,code:0
+msgid "Code"
+msgstr "Código"
+
+#. module: account_report_lib
+#: model:ir.actions.act_window,name:account_report_lib.action_account_report_wizard_menu
+msgid "Common Report Wizard"
+msgstr "Asistente de creación de reportes"
+
+#. module: account_report_lib
+#: code:addons/account_report_lib/tools/tools_modules_extended.py:192
+#, python-format
+msgid "No period found"
+msgstr "No existe período"
+
+#. module: account_report_lib
+#: field:account.report.wiz,account_base_report:0
+msgid "Account Base Report"
+msgstr "Informe financiero base"
+
+#. module: account_report_lib
+#: model:ir.model,name:account_report_lib.model_account_financial_report
+msgid "Account Report"
+msgstr "Informe financiero"
+
+#. module: account_report_lib
+#: field:res.company,property_asset_view_account:0
+msgid "Asset view account"
+msgstr "Cuenta de activo"
+
+#. module: account_report_lib
+#: help:account.report.wiz,special_period:0
+msgid "Include special period"
+msgstr "Includir período especial"
+
+#. module: account_report_lib
+#: view:account.report.wiz:0
+#: field:account.report.wiz,account_ids:0
+msgid "Accounts"
+msgstr "Cuentas"
+
+#. module: account_report_lib
+#: selection:account.report.wiz,filter:0
+msgid "Periods"
+msgstr "Períodos"
+
+#. module: account_report_lib
+#: view:account.report.wiz:0
+msgid "Filters"
+msgstr "Filtros"
+
+#. module: account_report_lib
+#: view:account.report.wiz:0
+msgid "Cancel"
+msgstr "Cancelar"
+
+#. module: account_report_lib
+#: model:ir.model,name:account_report_lib.model_account_webkit_report_library
+msgid "Account Webkit Reporting Library"
+msgstr "Account Webkit Reporting Library"
+
+#. module: account_report_lib
+#: field:account.report.wiz,filter:0
+msgid "Filter by"
+msgstr "Filtrar por"
+
+#. module: account_report_lib
+#: field:account.report.wiz,company_id:0
+msgid "Company"
+msgstr "Compañía"
+
+#. module: account_report_lib
+#: selection:account.report.wiz,target_move:0
+#: code:addons/account_report_lib/account_report_base.py:129
+#, python-format
+msgid "All Entries"
+msgstr "Todos los apuntes"
+
=== added directory 'account_report_lib/security'
=== added file 'account_report_lib/security/ir.model.access.csv'
--- account_report_lib/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
+++ account_report_lib/security/ir.model.access.csv 2013-11-06 21:08:00 +0000
@@ -0,0 +1,2 @@
+id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
+access_account_financial_report_type,account.financial.report.type,model_account_financial_report_type,account.group_account_user,1,1,1,1
=== added directory 'account_report_lib/tools'
=== added file 'account_report_lib/tools/__init__.py'
--- account_report_lib/tools/__init__.py 1970-01-01 00:00:00 +0000
+++ account_report_lib/tools/__init__.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import tools_new_models
+import tools_modules_extended
+import tools_amount_to_text
\ No newline at end of file
=== added file 'account_report_lib/tools/tools_amount_to_text.py'
--- account_report_lib/tools/tools_amount_to_text.py 1970-01-01 00:00:00 +0000
+++ account_report_lib/tools/tools_amount_to_text.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,129 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+UNIDADES = (
+ '',
+ 'UN ',
+ 'DOS ',
+ 'TRES ',
+ 'CUATRO ',
+ 'CINCO ',
+ 'SEIS ',
+ 'SIETE ',
+ 'OCHO ',
+ 'NUEVE ',
+ 'DIEZ ',
+ 'ONCE ',
+ 'DOCE ',
+ 'TRECE ',
+ 'CATORCE ',
+ 'QUINCE ',
+ 'DIECISEIS ',
+ 'DIECISIETE ',
+ 'DIECIOCHO ',
+ 'DIECINUEVE ',
+ 'VEINTE '
+)
+DECENAS = (
+ 'VENTI',
+ 'TREINTA ',
+ 'CUARENTA ',
+ 'CINCUENTA ',
+ 'SESENTA ',
+ 'SETENTA ',
+ 'OCHENTA ',
+ 'NOVENTA ',
+ 'CIEN '
+)
+CENTENAS = (
+ 'CIENTO ',
+ 'DOSCIENTOS ',
+ 'TRESCIENTOS ',
+ 'CUATROCIENTOS ',
+ 'QUINIENTOS ',
+ 'SEISCIENTOS ',
+ 'SETECIENTOS ',
+ 'OCHOCIENTOS ',
+ 'NOVECIENTOS '
+)
+
+def number_to_text_es(number_in,currency,join_dec=' Y ',separator=',',decimal_point='.'):
+
+ converted = ''
+ if currency == False:
+ currency = ''
+
+ if currency == None:
+ currency = ''
+
+ if type(number_in) != 'str':
+ number = str(number_in)
+ else:
+ number = number_in
+
+ number_str=number
+ #if we are using the coma as separator we need to remove them from the string
+ try:
+ number_str = number_str.replace(separator,'')
+ except ValueError:
+ print 'The separator used for the thousands its not supported'
+
+ #debug(number_str)
+
+ try:
+ number_int, number_dec = number_str.split(decimal_point)
+ except ValueError:
+ number_int = number_str
+ number_dec = ""
+
+ number_str = number_int.zfill(9)
+ millones = number_str[:3]
+ miles = number_str[3:6]
+ cientos = number_str[6:]
+
+ if(millones):
+ if(millones == '001'):
+ converted += 'UN MILLON '
+ elif(int(millones) > 0):
+ converted += '%sMILLONES ' % __convertNumber(millones)
+
+ if(miles):
+ if(miles == '001'):
+ converted += 'MIL '
+ elif(int(miles) > 0):
+ converted += '%sMIL ' % __convertNumber(miles)
+ if(cientos):
+ if(cientos == '001'):
+ converted += 'UN '
+ elif(int(cientos) > 0):
+ converted += '%s ' % __convertNumber(cientos)
+
+ if number_dec == "":
+ number_dec = "00"
+ if (len(number_dec) < 2 ):
+ number_dec+='0'
+
+ has_decimal = float(number_dec) != 0 and join_dec + number_dec + "/100" or ' EXACTOS'
+ converted += currency + has_decimal
+
+
+ return converted
+
+def __convertNumber(n):
+ output = ''
+
+ if(n == '100'):
+ output = "CIEN "
+ elif(n[0] != '0'):
+ output = CENTENAS[int(n[0])-1]
+
+ k = int(n[1:])
+ if(k <= 20):
+ output += UNIDADES[k]
+ else:
+ if((k > 30) & (n[2] != '0')):
+ output += '%sY %s' % (DECENAS[int(n[1])-2], UNIDADES[int(n[2])])
+ else:
+ output += '%s%s' % (DECENAS[int(n[1])-2], UNIDADES[int(n[2])])
+
+ return output
=== added file 'account_report_lib/tools/tools_modules_extended.py'
--- account_report_lib/tools/tools_modules_extended.py 1970-01-01 00:00:00 +0000
+++ account_report_lib/tools/tools_modules_extended.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,171 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import fields, orm, osv
+from tools.translate import _
+
+class toolsModulesextendedAccountFinancialReport(orm.Model):
+ """
+ This class extend functions of account.financial.report model.
+ """
+ _name = "account.financial.report"
+ _inherit = "account.financial.report"
+
+ _columns = {
+ 'account_type': fields.many2many('account.financial.report.type', 'account_financial_report_type_rel', string = "Base Catalog Account Type"),
+ }
+
+class toolsModulesextendedAccount(orm.Model):
+
+ """
+ This class extend functions of account.account model.
+ """
+
+ _name = "account.account"
+ _inherit = "account.account"
+
+ _columns = {
+ 'report_currency_id': fields.many2one('res.currency', 'Report Currency', help="Currency to show in the reports."),
+ }
+
+
+class toolsModulesextendedAccountPeriod(orm.Model):
+
+ """
+ This class extend functions of account.period model.
+ """
+ _name = "account.period"
+ _inherit = "account.period"
+
+ """
+ @param start_period: Initial period, can be optional in the filters
+ @param end_period: Final period, is required
+ @param fiscal_year: Fiscal year, is required
+ @return: A id list of periods
+
+ All of param are objects
+ """
+
+ def get_interval_period (self, cr, uid, start_period=None, end_period=None, fiscal_year=None, initial_balance=False):
+
+ period_obj = self.pool.get('account.period')
+ period_list = []
+
+ #si se solicita el intervalo para obtener el balance inicial
+ if initial_balance:
+ if start_period and end_period:
+ #el start_period_id es el periodo anterior al escogido
+ period_list = period_obj.search(cr, uid, [('fiscalyear_id', '=', fiscal_year),('date_stop','<=',start_period.date_stop)])
+
+ elif not start_period and end_period:
+ #se busca el primer periodo especial del año
+ period_list = period_obj.search(cr, uid, [('fiscalyear_id','=',fiscal_year),('special','=',True)],order='date_start asc')[0]
+
+ #si es un balance "corriente"
+ else:
+ if start_period and end_period:
+ #se buscan los periodos que coincidan con el intervalo
+ period_list = period_obj.search(cr, uid, [('fiscalyear_id','=',fiscal_year), ('date_start','>=',start_period.date_start),('date_stop','<=',end_period.date_start)])
+
+ elif not start_period and end_period:
+ #todos los periodos hacia "atras" del periodo final
+ period_list = period_obj.search(cr, uid, [('fiscalyear_id', '=', fiscal_year),('date_stop','<=',end_period.date_stop)])
+
+ return period_list
+
+ """
+ @param start_period: Initial period, can be optional in the filters
+ @param end_period: Final period, is required
+ @param fiscal_year: Fiscal year, is required
+ @return: The previous period for start_period
+ All of param are objects
+ """
+ def get_start_previous_period(self, cr, uid, start_period=None, fiscal_year=None):
+
+ account_period_obj = self.pool.get('account.period')
+
+ pevious_period = account_period_obj.search(cr, uid, [('fiscalyear_id', '=', fiscal_year.id), ('date_stop', '<', start_period.date_stop)], order='date_stop DESC')[0]
+
+ return pevious_period
+
+ ############################ METHOD THAT USED THE PERIOD AS PRINCIPAL REFERENCE ################
+ #Openning period for fiscal year take the selected period as reference.
+ def get_opening_period(self, cr, uid, select_period, context=None):
+ fiscalyear = select_period.fiscalyear_id
+ period_obj = self.pool.get('account.period')
+ opening_period_id = period_obj.search(cr, uid, [('fiscalyear_id','=',fiscalyear.id),('special','=',True)], order='date_start asc', context=context)[0]
+ opening_period = period_obj.browse(cr, uid, opening_period_id, context=context)
+ return opening_period
+
+
+ #Last period of fiscal year when the period is not special and take the fiscalyear as reference
+ def get_last_period_fiscalyear(self, cr, uid, fiscalyear):
+ account_period_obj = self.pool.get('account.period')
+ period_ids = account_period_obj.search(cr, uid, [('fiscalyear_id', '=', fiscalyear.id), ('special', '=', False)])
+ periods = account_period_obj.browse(cr, uid, period_ids)
+ period_select = periods[0]
+ for current_period in periods:
+ if current_period.date_start > period_select.date_start:
+ period_select = current_period
+ return period_select
+
+ #Last period of fiscal year when the period is not special and take the start_period as reference
+ def get_last_period(self, cr, uid, start_period):
+ account_period_obj = self.pool.get('account.period')
+ period_ids = account_period_obj.search(cr, uid, [('fiscalyear_id', '=', start_period.fiscalyear_id.id), ('special', '=', False)])
+ periods = account_period_obj.browse(cr, uid, period_ids)
+ period_select = start_period
+ for period in periods:
+ if (period.date_start < start_period.date_start and period.date_start > period_select.date_start) or (period.date_start < start_period.date_start and start_period == period_select):
+ period_select = period
+ if period_select == start_period:
+ fiscalyear = start_period.fiscalyear_id
+ fiscalyear_select = fiscalyear
+ account_fiscalyear_obj = self.pool.get('account.fiscalyear')
+ all_fiscalyears_ids = account_fiscalyear_obj.search(cr, uid, [])
+ all_fiscalyears = account_fiscalyear_obj.browse(cr, uid, all_fiscalyears_ids)
+ for current_fiscalyear in all_fiscalyears:
+ if (current_fiscalyear.date_start < fiscalyear.date_start and current_fiscalyear.date_start > fiscalyear_select.date_start) or (current_fiscalyear.date_start < fiscalyear.date_start and fiscalyear == fiscalyear_select):
+ fiscalyear_select = current_fiscalyear
+ if fiscalyear_select == fiscalyear:
+ #raise osv.except_osv(_('Error fiscal year'),_('There is no previous period to compare'))
+ period_select = start_period
+ else:
+ period_select = self.get_last_period_fiscalyear(cr, uid, fiscalyear_select)
+ return period_select
+
+ ############################ METHOD THAT USED THE FISCAL YEAR AS PRINCIPAL REFERENCE ################
+
+ #Method that return the first and last period, take as reference the fiscal year, the order
+ #determinate if wants the first (ASC) or last (DESC)
+ #Can change if need the special or not (special parameter)
+ def get_first_last_fiscalyear_period(self, fiscalyear, special=False, order='ASC'):
+ period_obj = self.pool.get('account.period')
+ p_id = period_obj.search(self.cursor,
+ self.uid,
+ [('special','=', special),
+ ('fiscalyear_id', '=', fiscalyear.id)],
+ limit=1,
+ order='date_start %s' % (order,))
+ if not p_id:
+ raise osv.except_osv(_('No period found'),'')
+ return period_obj.browse(self.cursor, self.uid, p_id[0])
\ No newline at end of file
=== added file 'account_report_lib/tools/tools_modules_extended.xml'
--- account_report_lib/tools/tools_modules_extended.xml 1970-01-01 00:00:00 +0000
+++ account_report_lib/tools/tools_modules_extended.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <!-- Accounts -->
+ <record id="view_account_form_inherit" model="ir.ui.view">
+ <field name="name">view.account.form.inherit</field>
+ <field name="model">account.account</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="account.view_account_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <field name = "currency_mode" position = "after">
+ <field name="report_currency_id" attrs="{'required':[('type','in', ('payable', 'receivable', 'liquidity'))]}"/>
+ </field>
+ </data>
+ </field>
+ </record>
+ <!-- End Accounts -->
+
+ <!-- Account Financial Report -->
+ <record id="view_account_financial_report_form_inherit" model="ir.ui.view">
+ <field name="name">account.financial.report.form.inherit</field>
+ <field name="model">account.financial.report</field>
+ <field name="inherit_id" ref="account.view_account_financial_report_form"/>
+ <field name="arch" type="xml">
+ <field name="style_overwrite" position="after">
+ <field name="account_type" widget="many2many_tags" attrs="{'invisible':[('type','!=','sum')], 'required':[('type','=','sum')]}"/>
+ </field>
+ </field>
+ </record>
+ </data>
+</openerp>
=== added file 'account_report_lib/tools/tools_new_models.py'
--- account_report_lib/tools/tools_new_models.py 1970-01-01 00:00:00 +0000
+++ account_report_lib/tools/tools_new_models.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import fields, orm, osv
+from tools.translate import _
+
+class accountFinancialreportType(orm.Model):
+
+ _name = "account.financial.report.type"
+ _description = "Account Financial Report Type"
+
+ _columns = {
+ 'name': fields.char('Type Name', size=128),
+ 'code': fields.char('Code', size=128),
+ }
+
+
+
\ No newline at end of file
=== added directory 'account_report_lib/wizard'
=== added file 'account_report_lib/wizard/__init__.py'
--- account_report_lib/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ account_report_lib/wizard/__init__.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import account_report_wizard
\ No newline at end of file
=== added file 'account_report_lib/wizard/account_report_wizard.py'
--- account_report_lib/wizard/account_report_wizard.py 1970-01-01 00:00:00 +0000
+++ account_report_lib/wizard/account_report_wizard.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,105 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import fields, osv
+
+class accountCommonwizard (osv.osv_memory):
+
+ """
+ This class is the base for the wizard report. If is necessary
+ add another field, add for this class.
+ The fields that add for the account.common.report inherit are:
+ chart_account_id, company_id, fiscalyear_id, filter, period_from, period_to, journal_ids,
+ date_from, date_to, target_move.
+
+ Also, add the methods:
+ onchange_chart_id, _check_company_id, fields_view_get, onchange_filter, _get_account, _get_fiscalyear
+ _get_all_journal, _build_contexts, _print_report, check_report
+
+ """
+ _name = "account.report.wiz"
+ _inherit = "account.common.report"
+ _description = "Account Common Wizard"
+
+ #This fields are added, because the account.common.report doesn't have this by default
+
+ _columns = {
+ 'account_ids': fields.many2many('account.account', string='Accounts'),
+ 'historic_strict': fields.boolean('Strict History', help="If selected, will display a historical unreconciled lines, taking into account the end of the period or date selected"),
+ 'special_period': fields.boolean('Special period', help="Include special period"),
+ 'amount_currency': fields.boolean('With Currency', help="It adds the currency column on report if the currency differs from the company currency."),
+ 'account_base_report':fields.many2one('account.financial.report', string="Account Base Report"), #Filter by account.financial.report only that are sum (view)
+ }
+
+ #Redefine this method, because in the "original" take both periods (start and end) and some report
+ #Add the new fields that not included in the account.common.report.
+ def _build_contexts(self, cr, uid, ids, data, context=None):
+ if context is None:
+ context = {}
+ result = {}
+ result['fiscalyear'] = 'fiscalyear_id' in data['form'] and data['form']['fiscalyear_id'] or False
+ result['journal_ids'] = 'journal_ids' in data['form'] and data['form']['journal_ids'] or False
+ result['chart_account_id'] = 'chart_account_id' in data['form'] and data['form']['chart_account_id'] or False
+
+ #new fields
+ result['account_ids'] = 'account_ids' in data['form'] and data['form']['account_ids'] or False
+ result['historic_strict'] = 'historic_strict' in data['form'] and data['form']['historic_strict'] or False
+ result['special_period'] = 'special_period' in data['form'] and data['form']['special_period'] or False
+ result['amount_currency'] = 'amount_currency' in data['form'] and data['form']['amount_currency'] or False
+ result['account_base_report'] = 'account_base_report' in data['form'] and data['form']['account_base_report'] or False
+
+ if data['form']['filter'] == 'filter_date':
+ result['date_from'] = data['form']['date_from']
+ result['date_to'] = data['form']['date_to']
+
+ elif data['form']['filter'] == 'filter_period':
+ result['period_from'] = data['form']['period_from']
+ result['period_to'] = data['form']['period_to']
+
+ return result
+
+ #Add the new fields
+ def check_report(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
+ data = {}
+ data['ids'] = context.get('active_ids', [])
+ data['model'] = context.get('active_model', 'ir.ui.menu')
+ #include new fields
+ data['form'] = self.read(cr, uid, ids, ['account_base_report','amount_currency','special_period','historic_strict','account_ids','date_from', 'date_to', 'fiscalyear_id', 'journal_ids', 'period_from', 'period_to', 'filter', 'chart_account_id', 'target_move'], context=context)[0]
+ #The fields that are relations (many2one, many2many, one2many needs extracted
+ # the id and work with the id in the form)
+ for field in ['fiscalyear_id', 'chart_account_id', 'period_from', 'period_to','account_ids','account_base_report']:
+ if isinstance(data['form'][field], tuple):
+ data['form'][field] = data['form'][field][0]
+
+ #Check if the fields exist, otherwise put false in the field.
+ used_context = self._build_contexts(cr, uid, ids, data, context=context)
+
+ data['form']['periods'] = used_context.get('periods', False) and used_context['periods'] or []
+ data['form']['used_context'] = used_context
+
+ #In each report redefine the _print_report, that receive the data and
+ #print the report in each module. The data argument is already build
+ return self._print_report(cr, uid, ids, data, context=context)
+
+
\ No newline at end of file
=== added file 'account_report_lib/wizard/account_report_wizard.xml'
--- account_report_lib/wizard/account_report_wizard.xml 1970-01-01 00:00:00 +0000
+++ account_report_lib/wizard/account_report_wizard.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,60 @@
+<openerp>
+ <data>
+
+ <record id="account_report_lib_wizard_view" model="ir.ui.view">
+ <field name="name">Common Report Wizard</field>
+ <field name="model">account.report.wiz</field>
+ <field name="arch" type="xml">
+ <form string="Report Options" version="7.0">
+ <label string=""/> <!-- binding for inherited views -->
+ <group col="6" string="General Options">
+ <field name="chart_account_id" widget='selection' on_change="onchange_chart_id(chart_account_id, context)"/>
+ <field name="company_id" invisible="1"/>
+ <field name="fiscalyear_id" domain="[('company_id','=',company_id)]"/>
+ <field name="target_move"/>
+ </group>
+ <group col="4" string="Account Financial Report">
+ <field name="account_base_report" widget='selection'/>
+ </group>
+ <group string="Filters">
+ <field name="filter" on_change="onchange_filter(filter, fiscalyear_id)"/>
+ <group colspan="4" name="Dates" attrs="{'invisible':[('filter', '!=', 'filter_date')], 'required':[('filter', '=', 'filter_date')]}">
+ <field name="date_from" />
+ <field name="date_to" />
+ </group>
+ <group colspan="4" name="Periods" attrs="{'invisible':[('filter','!=','filter_period')], 'required':[('filter', '=', 'filter_period')]}">
+ <field name="period_from" domain="[('fiscalyear_id', '=', fiscalyear_id)]"/>
+ <field name="period_to" domain="[('fiscalyear_id', '=', fiscalyear_id)]"/>
+ <field name="special_period" />
+ </group>
+ </group>
+ <group col="4" string="Accounts">
+ <field name="account_ids"/>
+ </group>
+ <group col="4" string="Journals">
+ <field name="journal_ids"/>
+ </group>
+ <group col="4" string="Advanced options">
+ <field name="historic_strict" string="Historic strict"/>
+ <field name="amount_currency" string="With Currency"/>
+ </group>
+ <footer>
+ <button name="check_report" string="Print" type="object" default_focus="1" class="oe_highlight"/>
+ or
+ <button string="Cancel" class="oe_link" special="cancel" />
+ </footer>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_account_report_wizard_menu" model="ir.actions.act_window">
+ <field name="name">Common Report Wizard</field>
+ <field name="res_model">account.report.wiz</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="account_report_lib_wizard_view"/>
+ <field name="target">new</field>
+ </record>
+
+ </data>
+</openerp>
=== added directory 'account_report_signatures'
=== added file 'account_report_signatures/__init__.py'
--- account_report_signatures/__init__.py 1970-01-01 00:00:00 +0000
+++ account_report_signatures/__init__.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import account_report_signatures
\ No newline at end of file
=== added file 'account_report_signatures/__openerp__.py'
--- account_report_signatures/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_report_signatures/__openerp__.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,40 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+{
+ 'name': 'Account report signatures',
+ 'version': '0.1',
+ 'url': 'http://launchpad.net/openerp-ccorp-addons',
+ 'author': 'ClearCorp S.A',
+ 'website': 'http://clearcorp.co.cr',
+ 'category': 'Generic Modules/Base',
+ 'description': """ Add the users that can signature the reports.""",
+ 'depends': ['base', 'account','hr'],
+ 'init_xml': [],
+ 'demo_xml': [],
+ 'data': [ 'security/account_report_signatures_security.xml',
+ 'account_report_signatures.xml',
+ 'account_report_signature_menu.xml'],
+ 'license': 'Other OSI approved licence',
+ 'installable': True,
+ 'active': False,
+}
=== added file 'account_report_signatures/account_report_signature_menu.xml'
--- account_report_signatures/account_report_signature_menu.xml 1970-01-01 00:00:00 +0000
+++ account_report_signatures/account_report_signature_menu.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,11 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<openerp>
+ <data>
+ <menuitem id="account_report_signature_menu"
+ action="action_report_signature"
+ parent="account.menu_finance_reports"
+ name="Configuration signature report"
+ sequence="200"
+ />
+ </data>
+</openerp>
=== added file 'account_report_signatures/account_report_signatures.py'
--- account_report_signatures/account_report_signatures.py 1970-01-01 00:00:00 +0000
+++ account_report_signatures/account_report_signatures.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,35 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import osv, fields, orm
+
+class accountReportsignatures(orm.Model):
+ _name = "ir.actions.report.xml"
+ _inherit = "ir.actions.report.xml"
+
+ #add to report the check if the report have signatures
+ _columns = {
+ 'include_signature': fields.boolean(string = "Add signatures to report"),
+ 'signature_users': fields.many2many('hr.employee', string ='Employees that can signature this report')
+ }
+
+
\ No newline at end of file
=== added file 'account_report_signatures/account_report_signatures.xml'
--- account_report_signatures/account_report_signatures.xml 1970-01-01 00:00:00 +0000
+++ account_report_signatures/account_report_signatures.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,73 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<openerp>
+ <data>
+ <record model = "ir.ui.view" id = "act_report_xml_view_inherit">
+ <field name = "name">ir.actions.report.xml.inherit</field>
+ <field name = "model">ir.actions.report.xml</field>
+ <field name = "type">form</field>
+ <field name="inherit_id" ref="base.act_report_xml_view"/>
+ <field name = "arch" type = "xml">
+ <notebook position="inside">
+ <page string = "Configuration signature reports">
+ <group string="Report Signatures">
+ <field name = "include_signature"/>
+ </group>
+ <group string="Employees">
+ <field name = "signature_users" widget="many2many_tags"/>
+ </group>
+ </page>
+ </notebook>
+ </field>
+ </record>
+
+ <!-- New view to add the diferent users that can signature the report -->
+ <record id="act_signature_report_view_form" model="ir.ui.view">
+ <field name="name">ir.actions.report.xml.signatures</field>
+ <field name="model">ir.actions.report.xml</field>
+ <field name="arch" type="xml">
+ <form string="Signatures Report" version="7.0">
+ <group string="Users can signature the report: ">
+ <field colspan="4" name="signature_users" nolabel="1" widget="many2many_tags"/>
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="act_report_signature_view_tree" model="ir.ui.view">
+ <field name="name">ir.actions.report.xml.signature.tree</field>
+ <field name="model">ir.actions.report.xml</field>
+ <field name="arch" type="xml">
+ <tree string="Report signatures">
+ <field name="name"/>
+ <field name="model"/>
+ <field name="type"/>
+ <field name="report_name"/>
+ <field name="report_type"/>
+ </tree>
+ </field>
+ </record>
+
+ <record id="action_report_signature" model="ir.actions.act_window">
+ <field name="name">Reports signature</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">ir.actions.report.xml</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="domain">[('include_signature', '=', True)]</field>
+ </record>
+
+ <record model="ir.actions.act_window.view" id="action_signature_report_tree">
+ <field name="view_mode">tree</field>
+ <field name="view_id" ref="act_report_signature_view_tree"/>
+ <field name="act_window_id" ref="action_report_signature"/>
+ </record>
+
+ <record model="ir.actions.act_window.view" id="action_signature_report_form">
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="act_signature_report_view_form"/>
+ <field name="act_window_id" ref="action_report_signature"/>
+ </record>
+
+
+ </data>
+</openerp>
=== added directory 'account_report_signatures/i18n'
=== added file 'account_report_signatures/i18n/es_CR.po'
--- account_report_signatures/i18n/es_CR.po 1970-01-01 00:00:00 +0000
+++ account_report_signatures/i18n/es_CR.po 2013-11-06 21:08:00 +0000
@@ -0,0 +1,72 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * account_report_signatures
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-04-17 21:47+0000\n"
+"PO-Revision-Date: 2013-04-17 21:47+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: account_report_signatures
+#: field:ir.actions.report.xml,include_signature:0
+msgid "Add signatures to report"
+msgstr "Añadir firmas al reporte"
+
+#. module: account_report_signatures
+#: model:ir.actions.act_window,name:account_report_signatures.action_report_signature
+msgid "Reports signature"
+msgstr "Firmantes del reporte"
+
+#. module: account_report_signatures
+#: field:ir.actions.report.xml,signature_users:0
+msgid "Employees that can signature this report"
+msgstr "Empleados que pueden firmar este reporte"
+
+#. module: account_report_signatures
+#: view:ir.actions.report.xml:0
+msgid "Report signatures"
+msgstr "Firmantes del reporte"
+
+#. module: account_report_signatures
+#: view:ir.actions.report.xml:0
+msgid "Employees"
+msgstr "Empleados"
+
+#. module: account_report_signatures
+#: model:ir.ui.menu,name:account_report_signatures.account_report_signature_menu
+msgid "Configuration signature report"
+msgstr "Configuración de firmas para reportes"
+
+#. module: account_report_signatures
+#: view:ir.actions.report.xml:0
+msgid "Users can signature the report: "
+msgstr "Usuarios que pueden firmar este reporte: "
+
+#. module: account_report_signatures
+#: view:ir.actions.report.xml:0
+msgid "Report Signatures"
+msgstr "Firmantes del reporte"
+
+#. module: account_report_signatures
+#: view:ir.actions.report.xml:0
+msgid "Signatures Report"
+msgstr "Firmantes del reporte"
+
+#. module: account_report_signatures
+#: view:ir.actions.report.xml:0
+msgid "Configuration signature reports"
+msgstr "Configuración de firmas del reporte"
+
+#. module: account_report_signatures
+#: model:ir.model,name:account_report_signatures.model_ir_actions_report_xml
+msgid "ir.actions.report.xml"
+msgstr "ir.acciones.informe.xml"
+
=== added directory 'account_report_signatures/security'
=== added file 'account_report_signatures/security/account_report_signatures_security.xml'
--- account_report_signatures/security/account_report_signatures_security.xml 1970-01-01 00:00:00 +0000
+++ account_report_signatures/security/account_report_signatures_security.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="ir_model_access_signaturereportupdate0" model="ir.model.access">
+ <field name="model_id" ref="model_ir_actions_report_xml"/>
+ <field eval="1" name="perm_read"/>
+ <field eval=""""Ir action report xml"""" name="name"/>
+ <field eval="0" name="perm_unlink"/>
+ <field eval="0" name="perm_write"/>
+ <field eval="0" name="perm_create"/>
+ <field name="group_id" ref="account.group_account_invoice"/>
+ </record>
+ </data>
+ <data>
+ <record id="ir_model_access_signaturereportupdate1" model="ir.model.access">
+ <field name="model_id" ref="model_ir_actions_report_xml"/>
+ <field eval="1" name="perm_read"/>
+ <field eval=""""Ir action report xml"""" name="name"/>
+ <field eval="1" name="perm_unlink"/>
+ <field eval="1" name="perm_write"/>
+ <field eval="1" name="perm_create"/>
+ <field name="group_id" ref="account.group_account_manager"/>
+ </record>
+ </data>
+</openerp>
=== modified file 'account_voucher_payment_method/__init__.py'
--- account_voucher_payment_method/__init__.py 2012-06-30 22:41:06 +0000
+++ account_voucher_payment_method/__init__.py 2013-11-06 21:08:00 +0000
@@ -1,1 +1,23 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
import account_voucher_payment_method
=== modified file 'account_voucher_payment_method/__openerp__.py'
--- account_voucher_payment_method/__openerp__.py 2012-06-30 22:41:06 +0000
+++ account_voucher_payment_method/__openerp__.py 2013-11-06 21:08:00 +0000
@@ -1,7 +1,29 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
{
"name" : "Account Voucher Payment Method",
"author" : "CLEARCORP S.A",
"version" : "0.1",
+ "description": """ Add diferent payment methods in the journal.""",
"depends" : ["account_voucher"],
"init_xml" : [],
"update_xml" : [
=== modified file 'account_voucher_payment_method/account_voucher_payment_method.py'
--- account_voucher_payment_method/account_voucher_payment_method.py 2013-01-17 17:51:13 +0000
+++ account_voucher_payment_method/account_voucher_payment_method.py 2013-11-06 21:08:00 +0000
@@ -1,7 +1,9 @@
-# -*- encoding: utf-8 -*-
+# -*- coding: utf-8 -*-
##############################################################################
#
-# Author: Frank Carvajal. Copyright ClearCorp SA
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@@ -18,189 +20,16 @@
#
##############################################################################
-from osv import osv, fields
-#from tools import debug
-
-class account_journal(osv.osv):
- _name = "account.journal"
- _inherit = "account.journal"
- _columns = {
- #'type': fields.selection([('sale', 'Sale'),
- # ('sale_refund','Sale Refund'),
- # ('purchase', 'Purchase'),
- # ('purchase_refund','Purchase Refund'),
- # ('cash', 'Cash'),
- # ('bank', 'Bank and Cheques'),
- # ('general', 'General'),
- # ('situation', 'Opening/Closing Situation'),
- # ('payment','Payment method')], 'Type', size=32, required=True,
- # help="Select 'Sale' for Sale journal to be used at the time of making invoice."\
- # " Select 'Purchase' for Purchase Journal to be used at the time of approving purchase order."\
- # " Select 'Cash' to be used at the time of making payment."\
- # " Select 'General' for miscellaneous operations."\
- # " Select 'Opening/Closing Situation' to be used at the time of new fiscal year creation or end of year entries generation."),
- 'payment_method_customer' : fields.boolean('Payment Method Customer'),
- 'payment_method_supplier' : fields.boolean('Payment Method Supplier'),
- 'payment_verification' : fields.boolean('Payment Verification'),
- 'transfers' : fields.boolean('Transfers'),
- 'check' : fields.boolean('Check'),
-
- }
-account_journal()
-
-class account_voucher_journal_payment(osv.osv):
- _name = 'account.voucher'
- _inherit = 'account.voucher'
- _description = 'Accounting Voucher'
-
- def _compute_writeoff_amount(self, cr, uid, line_dr_ids, line_cr_ids, amount):
- debit = credit = 0.0
- for l in line_dr_ids:
- debit += l['amount']
- for l in line_cr_ids:
- credit += l['amount']
- return abs(amount - abs(credit - debit))
-
- #def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=None):
- #"""price
- #Returns a dict that contains new values and context
-
- #@param partner_id: latest value from user input for field partner_id
- #@param args: other arguments
- #@param context: context arguments, like lang, time zone
-
- #@return: Returns a dict which contains new values, and context
- #"""
- #if context is None:
- #context = {}
- #if not journal_id:
- #return {}
- #context_multi_currency = context.copy()
- #if date:
- #context_multi_currency.update({'date': date})
-
- #line_pool = self.pool.get('account.voucher.line')
- #line_ids = ids and line_pool.search(cr, uid, [('voucher_id', '=', ids[0])]) or False
- #if line_ids:
- #line_pool.unlink(cr, uid, line_ids)
-
- #currency_pool = self.pool.get('res.currency')
- #move_line_pool = self.pool.get('account.move.line')
- #partner_pool = self.pool.get('res.partner')
- #journal_pool = self.pool.get('account.journal')
-
- #vals = self.onchange_journal(cr, uid, ids, journal_id, [], False, partner_id, False, False, False, False, context)
- #vals = vals.get('value')
- #currency_id = vals.get('currency_id', currency_id)
- #default = {
- #'value':{'line_ids':[], 'line_dr_ids':[], 'line_cr_ids':[], 'pre_line': False, 'currency_id':currency_id},
- #}
-
- #if not partner_id:
- ##debug("DEFAULT EN EL IF SIN PARTNER")
- ##debug(default)
- #return default
-
- #if not partner_id and ids:
- #line_ids = line_pool.search(cr, uid, [('voucher_id', '=', ids[0])])
- #if line_ids:
- #line_pool.unlink(cr, uid, line_ids)
- #return default
-
- #journal = journal_pool.browse(cr, uid, journal_id, context=context)
- #partner = partner_pool.browse(cr, uid, partner_id, context=context)
- #account_id = False
- #if journal.type in ('sale','sale_refund'):
- #account_id = partner.property_account_receivable.id
- #elif journal.type in ('purchase', 'purchase_refund','expense'):
- #account_id = partner.property_account_payable.id
- #else:
- #account_id = journal.default_credit_account_id.id or journal.default_debit_account_id.id
-
- #default['value']['account_id'] = account_id
-
- #if journal.type not in ('cash', 'bank','payment'):
- ##debug("DEFAULT EN EL IF journal no de dinero banco o pagos")
- ##debug(default)
- #return default
-
- #total_credit = 0.0
- #total_debit = 0.0
- #account_type = 'receivable'
- #if ttype == 'payment':
- #account_type = 'payable'
- #total_debit = price or 0.0
- #else:
- #total_credit = price or 0.0
- #account_type = 'receivable'
-
- #if not context.get('move_line_ids', False):
- #domain = [('state','=','valid'), ('account_id.type', '=', account_type), ('reconcile_id', '=', False), ('partner_id', '=', partner_id), ('journal_id.payment_method','=',False)]
- #if context.get('invoice_id', False):
- #domain.append(('invoice', '=', context['invoice_id']))
- #ids = move_line_pool.search(cr, uid, domain, context=context)
- ##debug("no encuentra movelines en el contexto")
- ##debug(ids)
- #else:
- #ids = context['move_line_ids']
- ##debug("SI encuentra movelines en el contexto")
- ##debug(ids)
- #ids.reverse()
- #moves = move_line_pool.browse(cr, uid, ids, context=context)
-
- #company_currency = journal.company_id.currency_id.id
- #if company_currency != currency_id and ttype == 'payment':
- #total_debit = currency_pool.compute(cr, uid, currency_id, company_currency, total_debit, context=context_multi_currency)
- #elif company_currency != currency_id and ttype == 'receipt':
- #total_credit = currency_pool.compute(cr, uid, currency_id, company_currency, total_credit, context=context_multi_currency)
-
- #for line in moves:
- #if line.credit and line.reconcile_partial_id and ttype == 'receipt':
- #continue
- #if line.debit and line.reconcile_partial_id and ttype == 'payment':
- #continue
- #total_credit += line.credit or 0.0
- #total_debit += line.debit or 0.0
- #for line in moves:
- #if line.credit and line.reconcile_partial_id and ttype == 'receipt':
- #continue
- #if line.debit and line.reconcile_partial_id and ttype == 'payment':
- #continue
- #original_amount = line.credit or line.debit or 0.0
- #amount_unreconciled = currency_pool.compute(cr, uid, line.currency_id and line.currency_id.id or company_currency, currency_id, abs(line.amount_residual_currency), context=context_multi_currency)
- #rs = {
- #'name':line.move_id.name,
- #'type': line.credit and 'dr' or 'cr',
- #'move_line_id':line.id,
- #'account_id':line.account_id.id,
- #'amount_original': currency_pool.compute(cr, uid, line.currency_id and line.currency_id.id or company_currency, currency_id, line.currency_id and abs(line.amount_currency) or original_amount, context=context_multi_currency),
- #'date_original':line.date,
- #'date_due':line.date_maturity,
- #'amount_unreconciled': amount_unreconciled,
- #}
-
- #if line.credit:
- #amount = min(amount_unreconciled, currency_pool.compute(cr, uid, company_currency, currency_id, abs(total_debit), context=context_multi_currency))
- #rs['amount'] = amount
- #total_debit -= amount
- #else:
- #amount = min(amount_unreconciled, currency_pool.compute(cr, uid, company_currency, currency_id, abs(total_credit), context=context_multi_currency))
- #rs['amount'] = amount
- #total_credit -= amount
-
- #default['value']['line_ids'].append(rs)
- #if rs['type'] == 'cr':
- #default['value']['line_cr_ids'].append(rs)
- #else:
- #default['value']['line_dr_ids'].append(rs)
-
- #if ttype == 'payment' and len(default['value']['line_cr_ids']) > 0:
- #default['value']['pre_line'] = 1
- #elif ttype == 'receipt' and len(default['value']['line_dr_ids']) > 0:
- #default['value']['pre_line'] = 1
- #default['value']['writeoff_amount'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price)
- ##debug(price)
- ##debug(default)
- #return default
-
-account_voucher_journal_payment()
+from osv import osv, fields, orm
+
+class AccountJournal(osv.osv):
+ _name = "account.journal"
+ _inherit = "account.journal"
+ _columns = {
+ 'payment_method_customer' : fields.boolean('Payment Method Customer'),
+ 'payment_method_supplier' : fields.boolean('Payment Method Supplier'),
+ 'payment_verification' : fields.boolean('Payment Verification'),
+ 'transfers' : fields.boolean('Transfers'),
+ 'check' : fields.boolean('Check'),
+
+ }
=== modified file 'account_voucher_payment_method/account_voucher_payment_method.xml'
--- account_voucher_payment_method/account_voucher_payment_method.xml 2013-01-17 17:51:13 +0000
+++ account_voucher_payment_method/account_voucher_payment_method.xml 2013-11-06 21:08:00 +0000
@@ -52,11 +52,13 @@
<field name="target">current</field>
<field name="help">Sales payment allows you to register the payments you receive from your customers. In order to record a payment, you must enter the customer, the payment method (=the journal) and the payment amount. OpenERP will propose to you automatically the reconciliation of this payment with the open invoices or sales receipts.</field>
</record>
+
<record id="action_vendor_reciept_tree" model="ir.actions.act_window.view">
<field eval="1" name="sequence"/>
<field name="view_mode">tree</field>
<field name="act_window_id" ref="action_vendor_reciept2"/>
</record>
+
<record id="action_vendor_reciept_form" model="ir.actions.act_window.view">
<field eval="2" name="sequence"/>
<field name="view_mode">form</field>
@@ -67,8 +69,7 @@
<record id="account_voucher.menu_action_vendor_receipt" model="ir.ui.menu">
<field name="action" ref="action_vendor_reciept2"/>
</record>
-
-
+
<record id="action_vendor_payment2" model="ir.actions.act_window">
<field name="name">Supplier Payment</field>
<field name="res_model">account.voucher</field>
@@ -80,11 +81,13 @@
<field name="target">current</field>
<field name="help">The supplier payment form allows you to track the payment you do to your suppliers. When you select a supplier, the payment method and an amount for the payment, OpenERP will propose to reconcile your payment with the open supplier invoices or bills.</field>
</record>
+
<record id="action_vendor_payment_tree" model="ir.actions.act_window.view">
<field eval="1" name="sequence"/>
<field name="view_mode">tree</field>
<field name="act_window_id" ref="action_vendor_payment2"/>
</record>
+
<record id="action_vendor_payment_form" model="ir.actions.act_window.view">
<field eval="2" name="sequence"/>
<field name="view_mode">form</field>
@@ -108,12 +111,12 @@
<field name = "inherit_id" ref = "account_voucher.view_vendor_receipt_form"/>
<field name = "arch" type = "xml">
<data>
- <xpath expr = "//field[@name='line_cr_ids']//field[@name='amount_original']" position = "after">
- <field name = "currency_id"/>
- </xpath>
- <xpath expr = "//field[@name='line_dr_ids']//field[@name='amount_original']" position = "after">
- <field name = "currency_id"/>
- </xpath>
+ <xpath expr = "//field[@name='line_cr_ids']//field[@name='amount_original']" position = "after">
+ <field name = "currency_id"/>
+ </xpath>
+ <xpath expr = "//field[@name='line_dr_ids']//field[@name='amount_original']" position = "after">
+ <field name = "currency_id"/>
+ </xpath>
</data>
</field>
</record>
@@ -125,18 +128,12 @@
<field name = "inherit_id" ref = "account_voucher.view_vendor_payment_form"/>
<field name = "arch" type = "xml">
<data>
- <xpath expr = "//field[@name='line_cr_ids']//field[@name='amount_original']" position = "replace">
- <field name = "currency_id"/>
- </xpath>
- <xpath expr = "//field[@name='line_dr_ids']//field[@name='amount_original']" position = "replace">
- <field name = "currency_id"/>
- </xpath>
- <!--<xpath expr = "//field[@name='line_cr_ids']//field[@name='amount_original']" position = "after">
- <field name = "currency_id"/>
- </xpath>
- <xpath expr = "//field[@name='line_dr_ids']//field[@name='amount_original']" position = "after">
- <field name = "currency_id"/>
- </xpath>-->
+ <xpath expr = "//field[@name='line_cr_ids']//field[@name='amount_original']" position = "replace">
+ <field name = "currency_id"/>
+ </xpath>
+ <xpath expr = "//field[@name='line_dr_ids']//field[@name='amount_original']" position = "replace">
+ <field name = "currency_id"/>
+ </xpath>
</data>
</field>
</record>
@@ -155,7 +152,7 @@
<data>
<field name = "type" position = "after">
<group colspan = "2" col = "4">
- <separator string = "Payment Options"/>
+ <separator string = "Payment Options" colspan="4"/>
<newline/>
<field name = "payment_method_customer"/>
<field name = "payment_method_supplier"/>
=== modified file 'account_voucher_reverse/account_voucher_reverse_view.xml'
--- account_voucher_reverse/account_voucher_reverse_view.xml 2012-08-09 20:22:03 +0000
+++ account_voucher_reverse/account_voucher_reverse_view.xml 2013-11-06 21:08:00 +0000
@@ -8,13 +8,13 @@
<field name="inherit_id" ref="account_voucher.view_vendor_receipt_form"/>
<field name="arch" type="xml">
<data>
- <xpath expr = "/form/group/field[@name='state']" position = "after">
- <button name="reverse_voucher" string="Reverse" type="object" states="posted" invisible="context.get('line_type', False)" icon="STOCK_REVERT_TO_SAVED" confirm="Are you sure to reverse this record ?"/>
+ <xpath expr = "/form/header/field[@name='state']" position = "before">
+ <button name="reverse_voucher" string="Reverse" type="object" states="posted" invisible="context.get('line_type', False)" confirm="Are you sure to reverse this record ?"/>
</xpath>
- <xpath expr = "/form/notebook/page[@string='Journal Items']" position = "attributes">
+ <xpath expr = "/form/sheet/notebook/page[@string='Journal Items']" position = "attributes">
<attribute name="attrs">{'invisible': [('state','in',['draft', 'proforma', 'cancel'])]}</attribute>
</xpath>
- <xpath expr = "/form/notebook/page/field[@name='move_ids']" position = "after">
+ <xpath expr = "/form/sheet/notebook/page[@string='Journal Items']/field[@name='move_ids']" position = "after">
<field name="move_line_reverse_ids" colspan="4" nolabel="1" readonly="1" attrs = "{'invisible' : [('state','!=','reverse')]}" >
<tree string="Journal Items Reverse">
<field name="move_id"/>
@@ -44,13 +44,13 @@
<field name="inherit_id" ref="account_voucher.view_vendor_payment_form"/>
<field name="arch" type="xml">
<data>
- <xpath expr = "/form/group/field[@name='state']" position = "after">
+ <xpath expr = "/form/header/field[@name='state']" position = "before">
<button name="reverse_voucher" string="Reverse" type="object" states="posted" invisible="context.get('line_type', False)" icon="STOCK_REVERT_TO_SAVED" confirm="Are you sure to reverse this record ?"/>
</xpath>
- <xpath expr = "/form/notebook/page[@string='Journal Items']" position="attributes">
+ <xpath expr = "/form/sheet/notebook/page[@string='Journal Items']" position="attributes">
<attribute name="attrs">{'invisible': [('state','in',['draft', 'proforma', 'cancel'])]}</attribute>
</xpath>
- <xpath expr = "/form/notebook/page/field[@name='move_ids']" position = "after">
+ <xpath expr = "/form/sheet/notebook/page[@string='Journal Items']/field[@name='move_ids']" position = "after">
<field name="move_line_reverse_ids" colspan="4" nolabel="1" readonly="1" attrs = "{'invisible' : [('state','!=','reverse')]}" >
<tree string="Journal Items Reverse">
<field name="move_id"/>
=== added directory 'account_withholding_tax_comissions'
=== added file 'account_withholding_tax_comissions/__init__.py'
--- account_withholding_tax_comissions/__init__.py 1970-01-01 00:00:00 +0000
+++ account_withholding_tax_comissions/__init__.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+
+import account_withholding_tax
+import account_journal_withholding_tax
+import account_voucher_withholding_tax
+import account_move_withholding_tax
\ No newline at end of file
=== added file 'account_withholding_tax_comissions/__openerp__.py'
--- account_withholding_tax_comissions/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_withholding_tax_comissions/__openerp__.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,48 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+{
+ 'name': 'Account Withholding Tax',
+ 'version': '1.0',
+ 'category': 'Accounting & Finance',
+ 'description': """
+ 1. Add object account.withholding.tax
+ 2. Manage account.withholding tax for accounts.
+ """,
+ 'author': 'CLEARCORP S.A.',
+ 'website': 'http://www.clearcorp.co.cr',
+ 'depends': [
+ 'account',
+ 'account_voucher',
+ 'account_move_reverse',
+ 'account_voucher_reverse'],
+ 'data': [
+ 'account_withholding_tax.xml',
+ 'account_journal_withholding_tax.xml',
+ 'account_voucher_withholding_tax.xml',],
+ 'installable': True,
+ 'auto_install': False,
+}
+
+
+
+
=== added file 'account_withholding_tax_comissions/account_journal_withholding_tax.py'
--- account_withholding_tax_comissions/account_journal_withholding_tax.py 1970-01-01 00:00:00 +0000
+++ account_withholding_tax_comissions/account_journal_withholding_tax.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,58 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import fields, osv, orm
+from openerp.tools.translate import _
+
+class accountJournalwithholdingTax(orm.Model):
+
+ _name = "account.journal"
+ _inherit = "account.journal"
+
+ _columns = {
+ 'withholding_tax_required': fields.many2many('account.withholding.tax', 'withholding_tax_journal_required', string="Required Withholding Tax"),
+ 'withholding_tax_optional': fields.many2many('account.withholding.tax', 'withholding_tax_journal_optional', string="Optional Withholding Tax"),
+ }
+
+ #Check if the required withholding tax are in optional withholding tax
+ def _check_withholding_tax(self, cr, uid, ids, context=None):
+ withholding_journal_obj = self.browse(cr, uid, ids[0],context)
+
+ list_required = []
+ list_optional = []
+
+ for required in withholding_journal_obj.withholding_tax_required:
+ list_required.append(required.id)
+
+ for optional in withholding_journal_obj.withholding_tax_optional:
+ list_optional.append(optional.id)
+
+ for element in list_required:
+ if element in list_optional:
+ return False
+
+ return True
+
+ _constraints = [
+ (_check_withholding_tax,'Withholding tax can not be the same for required and optional!',['withholding_tax_required']),
+ ]
+
\ No newline at end of file
=== added file 'account_withholding_tax_comissions/account_journal_withholding_tax.xml'
--- account_withholding_tax_comissions/account_journal_withholding_tax.xml 1970-01-01 00:00:00 +0000
+++ account_withholding_tax_comissions/account_journal_withholding_tax.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="view_account_journal_form_inherit" model="ir.ui.view">
+ <field name="name">view.account.journal.form.inherit</field>
+ <field name="model">account.journal</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="account.view_account_journal_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <page string="Cash Registers" position="after">
+ <page string="Withholding tax">
+ <group>
+ <separator colspan="4" string="Required withholding tax"/>
+ <field name="withholding_tax_required" nolabel="1"/>
+ <separator colspan="4" string="Optional withholding tax"/>
+ <field name="withholding_tax_optional" nolabel="1"/>
+ </group>
+ </page>
+ </page>
+ </data>
+ </field>
+ </record>
+ </data>
+</openerp>
=== added file 'account_withholding_tax_comissions/account_move_withholding_tax.py'
--- account_withholding_tax_comissions/account_move_withholding_tax.py 1970-01-01 00:00:00 +0000
+++ account_withholding_tax_comissions/account_move_withholding_tax.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,31 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import fields, osv, orm
+
+class accountMoveinherit(orm.Model):
+ _name = 'account.move'
+ _inherit = 'account.move'
+
+ _columns = {
+ 'withholding_voucher_id': fields.many2one('account.voucher', 'Account voucher')
+ }
\ No newline at end of file
=== added file 'account_withholding_tax_comissions/account_voucher_withholding_tax.py'
--- account_withholding_tax_comissions/account_voucher_withholding_tax.py 1970-01-01 00:00:00 +0000
+++ account_withholding_tax_comissions/account_voucher_withholding_tax.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,357 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import fields, osv, orm
+
+class accountVoucherinherit(orm.Model):
+
+ _name = "account.voucher"
+ _inherit = "account.voucher"
+
+ #Get move_lines for withholding tax
+ def _get_withholding_move_lines(self, cr, uid, ids, *a):
+ res = {}
+ move_ids = []
+
+ for voucher in self.browse(cr, uid, ids):
+ for move in voucher.withholding_move_ids:
+ move_ids.append(move.id)
+
+ move_line_ids = self.pool.get('account.move.line').search(cr, uid, [('move_id','in',move_ids)])
+ res[voucher.id] = move_line_ids
+
+ return res
+
+ #Get move_lines reverse for withholding tax reverse
+ def _get_withholding_move_lines_reverse(self, cr, uid, ids, *a):
+ res = {}
+ move_ids = []
+
+ for voucher in self.browse(cr, uid, ids):
+ for move in voucher.withholding_move_ids:
+ if move.move_reverse_id:
+ move_ids.append(move.move_reverse_id.id)
+
+ move_line_ids = self.pool.get('account.move.line').search(cr, uid, [('move_id','in',move_ids)])
+ res[voucher.id] = move_line_ids
+
+ return res
+
+ #Create a method that set the withholding tax from journal to voucher.
+ def onchange_journal(self, cr, uid, ids, journal_id, line_ids, tax_id, partner_id, date, amount, ttype, company_id, context=None):
+
+ vals = super(accountVoucherinherit, self).onchange_journal(cr, uid, ids, journal_id, line_ids, tax_id, partner_id, date, amount, ttype, company_id, context)
+
+ required_list = []
+ optional_list = []
+
+ if journal_id:
+ #Get complete object to extract withholding tax.
+ journal_obj = self.pool.get('account.journal').browse(cr, uid, journal_id, context)
+
+ #Get ids for m2m fields
+ for required in journal_obj.withholding_tax_required:
+ required_list.append(required.id)
+
+ for optional in journal_obj.withholding_tax_optional:
+ optional_list.append(optional.id)
+
+ #Pass values to account.voucher
+ #Put the same values in voucher_withholding_tax_required_vis and voucher_withholding_tax_required_inv
+ #Because when the journal change, both change too and they have the same value at the same time.
+ vals['value'].update({'withholding_tax_required_view': required_list})
+ vals['value'].update({'withholding_tax_required': required_list})
+ vals['value'].update({'withholding_tax_optional': optional_list})
+
+ else:
+ #Remove the previous values in case that don't exist journal selected
+ vals = {'value':{} }
+ vals['value'].update({'withholding_tax_required_view': required_list})
+ vals['value'].update({'withholding_tax_required': required_list})
+ vals['value'].update({'withholding_tax_optional': optional_list})
+
+ return vals
+
+ """
+ IMPORTANT: Withholding tax required are readonly. Because it is readonly, the field doesn't save normally, in the moment of push
+ button save. So, create a workarrond with two fields with the same relation in database (same name, in this case, voucher_withholding_tax_required), and
+ two fields are the same.
+
+ In the xml, voucher_withholding_tax_required_vis has attribute readonly and voucher_withholding_tax_required_inv has the attribute invisible, the user
+ sees the field voucher_withholding_tax_required_vis and in the moment to save the record, both point to same relation (voucher_withholding_tax_required)
+ and the user sees that he put in the field, is readonly and the field store in database.
+
+ """
+
+ _columns = {
+ 'withholding_tax_optional': fields.many2many('account.withholding.tax', 'voucher_withholding_tax_optional', string="Optional Withholding Tax"),
+
+ #Both fields have the same relation name in database (voucher_withholding_tax_required) that's the magic of the trick
+ #One field that user sees and other with the same value that store the value in database.
+ 'withholding_tax_required_view': fields.many2many('account.withholding.tax', 'voucher_withholding_tax_required', string="Required Withholding Tax"),
+ 'withholding_tax_required': fields.many2many('account.withholding.tax', 'voucher_withholding_tax_required', string="Required Withholding Tax"),
+
+ 'withholding_move_ids':fields.one2many('account.move', 'withholding_voucher_id', 'Withholding Move'),
+ 'withholding_move_line_ids':fields.function(_get_withholding_move_lines, string='Account Move Lines Withholding Tax', type='one2many', relation='account.move.line'),
+ 'withholding_move_line_ids_reverse':fields.function(_get_withholding_move_lines_reverse, string='Account Move Lines Reverse Withholding Tax', type='one2many', relation='account.move.line'),
+ }
+
+ #Check if the required withholding tax are in optional withholding tax
+ def _check_duplicate_withholding_tax(self, cr, uid, ids, context=None):
+
+ withholding_voucher_obj = self.browse(cr, uid, ids[0],context)
+
+ list_required = []
+ list_optional = []
+
+ for required in withholding_voucher_obj.withholding_tax_required:
+ list_required.append(required.id)
+
+ for optional in withholding_voucher_obj.withholding_tax_optional:
+ list_optional.append(optional.id)
+
+ for element in list_required:
+ if element in list_optional:
+ return False
+
+ return True
+
+ _constraints = [
+ (_check_duplicate_withholding_tax,'Withholding tax can not be the same for required and optional !',['voucher_withholding_tax_optional']),
+ ]
+
+ #Method that create the move and move lines from withholding tax
+ def action_move_line_create(self, cr, uid, ids, context=None):
+
+ #1. Super of action_move_line_create
+ res = super(accountVoucherinherit, self).action_move_line_create(cr, uid, ids, context)
+
+ for voucher in self.browse(cr, uid, ids, context=context):
+ # Currency of voucher and company
+ company_currency = self._get_company_currency(cr, uid, voucher.id, context)
+ current_currency = self._get_current_currency(cr, uid, voucher.id, context)
+
+ # For each withholding tax, keep amount or percentage.
+
+ #*****************REQUIRED WITHHOLDING TAX
+ # For required withholding tax, use voucher_withholding_tax_required_inv field
+ for withholding in voucher.withholding_tax_required:
+
+ #********************MOVE
+ #Create move_id (the method account_move_get return a dictionary)
+
+ move_id_name = voucher.move_id.ref + ' ' + withholding.code
+ move_dict = self.account_move_get(cr, uid, voucher.id, context=context)
+
+ move_dict['name'] = '/'
+ move_dict['journal_id'] = withholding.journal_id.id
+ move_dict['ref'] = move_id_name
+ move_dict['narration'] = move_id_name
+
+ #Associate voucher with move
+ move_dict['withholding_voucher_id'] = voucher.id
+
+ move_id = self.pool.get('account.move').create(cr, uid, move_dict, context=context)
+
+ ##*******************AMOUNTS
+ if company_currency <> current_currency:
+ if withholding.type == 'percentage':
+ withholding_amount = voucher.amount * (withholding.amount / 100)
+ amount_currency = withholding_amount
+ else:
+ withholding_amount = withholding.amount
+ amount_currency = (withholding.amount * voucher.paid_amount_in_company_currency) / voucher.amount
+ else:
+ #For each withholding tax, create two move lines
+ #Get amount or percentage associate to withholding tax
+ if withholding.type == 'percentage':
+ withholding_amount = voucher.paid_amount_in_company_currency * (withholding.amount / 100)
+ else:
+ withholding_amount = withholding.amount
+
+ amount_currency = 0.0
+ #**************************
+
+ #********************ACCOUNTS
+ #Get account to associate the move line and debit or credit
+ if voucher.type in ('purchase', 'payment'):
+ account_debit = voucher.account_id
+ account_credit = withholding.journal_id.default_credit_account_id
+
+ elif voucher.type in ('sale', 'receipt'):
+ account_debit = withholding.journal_id.default_debit_account_id
+ account_credit = voucher.account_id
+ #****************************
+
+ #Line name
+ line_name = voucher.move_id.ref + ' ' + withholding.code
+
+ #create move_lines (2 for each withhlding):
+ move_line_debit = {
+ 'name': line_name,
+ 'debit': withholding_amount,
+ 'credit': 0.0,
+ 'account_id': account_debit.id,
+ 'move_id': move_id,
+ 'journal_id': withholding.journal_id.id,
+ 'period_id': voucher.period_id.id,
+ 'partner_id': voucher.partner_id.id,
+ 'currency_id': company_currency <> current_currency and current_currency or False,
+ 'amount_currency': amount_currency,
+ 'date': voucher.date,
+ 'date_maturity': voucher.date_due
+ }
+
+ move_line_credit = {
+ 'name': line_name,
+ 'debit': 0.0,
+ 'credit': withholding_amount,
+ 'account_id': account_credit.id,
+ 'move_id': move_id,
+ 'journal_id': withholding.journal_id.id,
+ 'period_id': voucher.period_id.id,
+ 'partner_id': voucher.partner_id.id,
+ 'currency_id': company_currency <> current_currency and current_currency or False,
+ 'amount_currency': amount_currency,
+ 'currency_id': 0.0,
+ 'amount_currency':0.0,
+ 'date': voucher.date,
+ 'date_maturity': voucher.date_due
+ }
+
+ #Create move_lines
+ self.pool.get('account.move.line').create(cr, uid, move_line_credit, context)
+
+ self.pool.get('account.move.line').create(cr, uid, move_line_debit, context)
+
+
+ #*****************OPTIONAL WITHHOLDING TAX
+ # For required withholding tax, use voucher_withholding_tax_required_inv field
+ for withholding in voucher.withholding_tax_optional:
+
+ #********************MOVE
+ #Create move_id (the method account_move_get return a dictionary)
+
+ move_id_name = voucher.move_id.ref + ' ' + withholding.code
+ move_dict = self.account_move_get(cr, uid, voucher.id, context=context)
+
+ move_dict['name'] = '/'
+ move_dict['journal_id'] = withholding.journal_id.id
+ move_dict['ref'] = move_id_name
+ move_dict['narration'] = move_id_name
+
+ #Associate voucher with move
+ move_dict['withholding_voucher_id'] = voucher.id
+
+ move_id = self.pool.get('account.move').create(cr, uid, move_dict, context=context)
+
+ ##*******************AMOUNTS
+ #Check if voucher currency is diferent that currency company
+ if company_currency <> current_currency:
+ if withholding.type == 'percentage':
+ withholding_amount = voucher.amount * (withholding.amount / 100)
+ amount_currency = withholding_amount
+ else:
+ withholding_amount = withholding.amount
+ amount_currency = (withholding.amount * voucher.paid_amount_in_company_currency) / voucher.amount
+
+ else:
+ if withholding.type == 'percentage':
+ withholding_amount = voucher.paid_amount_in_company_currency * (withholding.amount / 100)
+
+ else:
+ withholding_amount = withholding.amount
+
+ amount_currency = 0.0
+
+ #**************************
+
+ #********************ACCOUNTS
+ #Get account to associate the move line and debit or credit
+ if voucher.type in ('purchase', 'payment'):
+ account_debit = voucher.account_id
+ account_credit = withholding.journal_id.default_credit_account_id
+
+ elif voucher.type in ('sale', 'receipt'):
+ account_debit = withholding.journal_id.default_debit_account_id
+ account_credit = voucher.account_id
+
+ #****************************
+
+ #Line name
+ line_name = voucher.move_id.ref + ' ' + withholding.code
+
+ #create move_lines (2 for each withhlding):
+ move_line_debit = {
+ 'name': line_name,
+ 'debit': withholding_amount,
+ 'credit': 0.0,
+ 'account_id': account_debit.id,
+ 'move_id': move_id,
+ 'journal_id': withholding.journal_id.id,
+ 'period_id': voucher.period_id.id,
+ 'partner_id': voucher.partner_id.id,
+ 'currency_id': company_currency <> current_currency and current_currency or False,
+ 'amount_currency': amount_currency,
+ 'date': voucher.date,
+ 'date_maturity': voucher.date_due
+ }
+
+ move_line_credit = {
+ 'name': line_name,
+ 'debit': 0.0,
+ 'credit': withholding_amount,
+ 'account_id': account_credit.id,
+ 'move_id': move_id,
+ 'journal_id': withholding.journal_id.id,
+ 'period_id': voucher.period_id.id,
+ 'partner_id': voucher.partner_id.id,
+ 'currency_id': company_currency <> current_currency and current_currency or False,
+ 'amount_currency': amount_currency,
+ 'currency_id': 0.0,
+ 'amount_currency':0.0,
+ 'date': voucher.date,
+ 'date_maturity': voucher.date_due
+ }
+
+ #Create move_lines
+ self.pool.get('account.move.line').create(cr, uid, move_line_credit, context)
+
+ self.pool.get('account.move.line').create(cr, uid, move_line_debit, context)
+
+ return True
+
+ #When the voucher reverse, the account move for withholding tax reverse too.
+ def reverse_voucher(self, cr, uid, ids, context=None):
+
+ reverse_withholing_list = []
+
+ #Reverse "normal" voucher.
+ res = super(accountVoucherinherit, self).reverse_voucher(cr, uid, ids, context)
+
+ #Reverse "withholding voucher"
+ for voucher in self.browse(cr, uid, ids, context=context):
+ for withholding_move in voucher.withholding_move_ids:
+ self.pool.get('account.move').reverse(cr, uid, [withholding_move.id], context=context)
+ self.write(cr, uid, [voucher.id], {'state' : 'reverse'}, context=context)
+
+ return res
\ No newline at end of file
=== added file 'account_withholding_tax_comissions/account_voucher_withholding_tax.xml'
--- account_withholding_tax_comissions/account_voucher_withholding_tax.xml 1970-01-01 00:00:00 +0000
+++ account_withholding_tax_comissions/account_voucher_withholding_tax.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<openerp>
+ <data>
+ <!--Account Voucher -->
+ <record id="view_vendor_payment_form_inherit" model="ir.ui.view">
+ <field name = "name">view.vendor.payment.form.inherit</field>
+ <field name = "model">account.voucher</field>
+ <field name = "type">form</field>
+ <field name = "inherit_id" ref="account_voucher.view_vendor_payment_form"/>
+ <field name = "arch" type = "xml">
+ <xpath expr="/form/sheet/notebook/page[@string='Payment Information']/group/group[1]" position="inside">
+ <group col="2">
+ <separator colspan="2" string="Required withholding tax"/>
+ <!--
+ Both fields have the same relation name in database (voucher_withholding_tax_required) that's the magic of the trick
+ One field that user sees and other with the same value that store the value in database.
+ -->
+ <field name="withholding_tax_required_view" nolabel="1" widget="many2many_tags" readonly="True" />
+ <field name="withholding_tax_required" nolabel="1" widget="many2many_tags" invisible="True"/>
+ <separator colspan="2" string="Optional withholding tax"/>
+ <field name="withholding_tax_optional" nolabel="1" widget="many2many_tags"/>
+ </group>
+ </xpath>
+ <xpath expr="/form/sheet/notebook/page[@string='Journal Items']/field[@name='move_ids']" position="after">
+ <separator colspan="2" string="Journal Items Withholding Tax"/>
+ <field name="withholding_move_line_ids" readonly="1">
+ <tree string="Journal Items">
+ <field name="move_id"/>
+ <field name="ref"/>
+ <field name="date"/>
+ <field name="statement_id"/>
+ <field name="partner_id"/>
+ <field name="account_id"/>
+ <field name="name"/>
+ <field name="debit"/>
+ <field name="credit"/>
+ <field name="state"/>
+ <field name="reconcile_id"/>
+ <field name="amount_currency" groups="base.group_multi_currency"/>
+ <field name="currency_id" groups="base.group_multi_currency"/>
+ </tree>
+ </field>
+ </xpath>
+ <xpath expr = "/form/sheet/notebook/page[@string='Journal Items']/field[@name='withholding_move_line_ids']" position = "after">
+ <separator colspan="2" string="Journal Items Reverse Withholding Tax" attrs = "{'invisible' : [('state','!=','reverse')]}"/>
+ <field name="withholding_move_line_ids_reverse" colspan="4" nolabel="1" readonly="1" attrs = "{'invisible' : [('state','!=','reverse')]}" >
+ <tree string="Journal Items Withholding Tax Reverse">
+ <field name="move_id"/>
+ <field name="ref"/>
+ <field name="date"/>
+ <field name="statement_id"/>
+ <field name="partner_id"/>
+ <field name="account_id"/>
+ <field name="name"/>
+ <field name="debit"/>
+ <field name="credit"/>
+ <field name="state"/>
+ <field name="reconcile_id"/>
+ <field name="amount_currency" groups="base.group_multi_currency"/>
+ <field name="currency_id" groups="base.group_multi_currency"/>
+ </tree>
+ </field>
+ </xpath>
+ </field>
+ </record>
+
+ <!-- Wizard that comes for invoice-->
+ <record id="view_vendor_receipt_dialog_form_inherit" model="ir.ui.view">
+ <field name = "name">view.vendor.receipt.dialog.form.inherit</field>
+ <field name = "model">account.voucher</field>
+ <field name = "type">form</field>
+ <field name = "inherit_id" ref="account_voucher.view_vendor_receipt_dialog_form"/>
+ <field name = "arch" type = "xml">
+ <xpath expr="/form[@string='Payment']/group" position="inside">
+ <group col="2">
+ <!--
+ Both fields have the same relation name in database (voucher_withholding_tax_required) that's the magic of the trick
+ One field that user sees and other with the same value that store the value in database.
+ -->
+ <field name="withholding_tax_required_view" widget="many2many_tags" readonly="True" />
+ <field name="withholding_tax_required" widget="many2many_tags" invisible="True"/>
+ <field name="withholding_tax_optional" widget="many2many_tags"/>
+ </group>
+ </xpath>
+ </field>
+ </record>
+ </data>
+</openerp>
=== added file 'account_withholding_tax_comissions/account_withholding_tax.py'
--- account_withholding_tax_comissions/account_withholding_tax.py 1970-01-01 00:00:00 +0000
+++ account_withholding_tax_comissions/account_withholding_tax.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,72 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import fields, osv, orm
+import openerp.addons.decimal_precision as dp
+
+class accountWithholdingtax(orm.Model):
+ _name = "account.withholding.tax"
+ _description = "Account Withholding Tax"
+
+ _columns = {
+ 'name': fields.char('Name', size=128),
+ 'code': fields.char('Code', size=64),
+ 'type': fields.selection([('percentage', 'Percent'),
+ ('numeric', 'Numeric')], 'Withholding Tax Type',
+ help="""Select here the kind of withholding tax. If you select percentage, you can't exceed 100%"""),
+
+ 'amount': fields.float('Amount/Percentage', digits_compute=dp.get_precision('Account')),
+ 'journal_id': fields.many2one('account.journal', 'Journal'),
+ }
+
+ _sql_constraints = [
+ ('name_unique', 'UNIQUE(name)', 'Unfortunately this name is already used, please choose a unique one'),
+ ('code_unique', 'UNIQUE(code)', 'Unfortunately this code is already used, please choose a unique one')
+ ]
+
+ #Check amount
+ def _check_amount(self, cr, uid, ids, context=None):
+ withholding_obj = self.browse(cr, uid, ids[0], context=context)
+
+ #percentage over 100%
+ if withholding_obj.type == 'percentage' and withholding_obj.amount > 100:
+ return False
+
+ #negative number
+ if withholding_obj.amount < 0:
+ return False
+
+ return True
+
+ #Journal must have default_debit_account and default_credit_account.
+ def _check_debit_credit_accounts(self, cr, uid, ids, context=None):
+ withholding_obj = self.browse(cr, uid, ids[0], context=context)
+
+ if not withholding_obj.journal_id.default_credit_account_id and not withholding_obj.journal_id.default_debit_account_id:
+ return False
+ return True
+
+ _constraints = [
+ (_check_amount, 'Error!\nThe amount are invalid. Negative numbers and percentage over 100 are not allowed.', ['amount']),
+ (_check_debit_credit_accounts, 'Error!\n The journal select must have default debit and default credit account', ['journal_id']),
+ ]
+
\ No newline at end of file
=== added file 'account_withholding_tax_comissions/account_withholding_tax.xml'
--- account_withholding_tax_comissions/account_withholding_tax.xml 1970-01-01 00:00:00 +0000
+++ account_withholding_tax_comissions/account_withholding_tax.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="view_account_withholding_tax_tree" model="ir.ui.view">
+ <field name="name">account.withholding.tax.tree</field>
+ <field name="model">account.withholding.tax</field>
+ <field name="arch" type="xml">
+ <tree string="Withholding Taxes">
+ <field name="code" />
+ <field name="name" />
+ <field name="type" />
+ <field name="amount"/>
+ </tree>
+ </field>
+ </record>
+
+ <record id="view_account_withholding_tax_form" model="ir.ui.view">
+ <field name="name">account.withholding.tax.form</field>
+ <field name="model">account.withholding.tax</field>
+ <field name="arch" type="xml">
+ <form string="Withholding Taxes" version="7.0">
+ <sheet>
+ <group col="4" string="General">
+ <field name="name" required="True"/>
+ <field name="code" required="True"/>
+ <field name="journal_id" required="True" />
+ </group>
+ <group col="4" string="Values">
+ <field name="type" required="True" />
+ <div>
+ <label string="Value" for="amount" />
+ <field name="amount" required="True" class="oe_inline"/>
+ <label string="%%" for="amount" attrs="{'invisible': [('type', '!=', 'percentage')]}"/>
+ </div>
+ </group>
+ </sheet>
+ </form>
+ </field>
+ </record>
+
+ <record id="view_account_withholding_tax_search" model="ir.ui.view">
+ <field name="name">account.withholding.tax.search</field>
+ <field name="model">account.withholding.tax</field>
+ <field name="arch" type="xml">
+ <search string="Search Withholding Tax">
+ <field name="name" filter_domain="[('name','ilike',self)]" string="Name"/>
+ <field name="code" filter_domain="['('code','ilike',self)]" string="Code"/>
+ <group expand="0" string="Group By...">
+ <filter string="Tipo" icon="terp-folder-orange" domain="[]" context="{'group_by':'type'}"/>
+ </group>
+ </search>
+ </field>
+ </record>
+
+ <record id="action_account_withholding_tax_tree" model="ir.actions.act_window">
+ <field name="name">Withholding Tax</field>
+ <field name="res_model">account.withholding.tax</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">tree,form</field>
+ <field name="view_id" ref="view_account_withholding_tax_tree"/>
+ <field name="search_view_id" ref="view_account_withholding_tax_search"/>
+ <field name="help" type="html">
+ <p class="oe_view_nocontent_create">
+ Click to record a new withholding tax
+ </p>
+ </field>
+ </record>
+
+ <menuitem action="action_account_withholding_tax_tree" id="menu_action_withholding_tax_tree" parent="account.menu_configuration_misc"/>
+
+ </data>
+</openerp>
=== added directory 'account_withholding_tax_comissions/i18n'
=== added file 'account_withholding_tax_comissions/i18n/es_CR.po'
--- account_withholding_tax_comissions/i18n/es_CR.po 1970-01-01 00:00:00 +0000
+++ account_withholding_tax_comissions/i18n/es_CR.po 2013-11-06 21:08:00 +0000
@@ -0,0 +1,236 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * account_withholding_tax_comissions
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-07-05 20:45+0000\n"
+"PO-Revision-Date: 2013-07-05 20:45+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: account_withholding_tax_comissions
+#: view:account.withholding.tax:0
+msgid "Tipo"
+msgstr "Tipo"
+
+#. module: account_withholding_tax_comissions
+#: selection:account.withholding.tax,type:0
+msgid "Percent"
+msgstr "Porcentaje"
+
+#. module: account_withholding_tax_comissions
+#: view:account.withholding.tax:0
+msgid "Group By..."
+msgstr "Agrupar por..."
+
+#. module: account_withholding_tax_comissions
+#: field:account.withholding.tax,type:0
+msgid "Withholding Tax Type"
+msgstr "Tipo de retención"
+
+#. module: account_withholding_tax_comissions
+#: constraint:account.journal:0
+msgid "Withholding tax can not be the same for required and optional!"
+msgstr "Las retenciones no pueden ser las mismas en requeridas y opcionales!"
+
+#. module: account_withholding_tax_comissions
+#: field:account.voucher,withholding_move_line_ids_reverse:0
+msgid "Account Move Lines Reverse Withholding Tax"
+msgstr "Apuntes Contables de Retenciones Reversas"
+
+#. module: account_withholding_tax_comissions
+#: view:account.journal:0
+msgid "Cash Registers"
+msgstr "Registros de caja"
+
+#. module: account_withholding_tax_comissions
+#: field:account.withholding.tax,amount:0
+msgid "Amount/Percentage"
+msgstr "Monto/Porcentaje"
+
+#. module: account_withholding_tax_comissions
+#: sql_constraint:account.withholding.tax:0
+msgid "Unfortunately this name is already used, please choose a unique one"
+msgstr "Este nombre ya se encuentra asignado, por favor escoja un nombre único"
+
+#. module: account_withholding_tax_comissions
+#: field:account.voucher,withholding_move_line_ids:0
+msgid "Account Move Lines Withholding Tax"
+msgstr "Apuntes contables de Retenciones"
+
+#. module: account_withholding_tax_comissions
+#: field:account.withholding.tax,journal_id:0
+#: model:ir.model,name:account_withholding_tax_comissions.model_account_journal
+msgid "Journal"
+msgstr "Diario"
+
+#. module: account_withholding_tax_comissions
+#: constraint:account.withholding.tax:0
+msgid "Error!\n"
+" The journal select must have default debit and default credit account"
+msgstr "Error!\n"
+" El diario seleccionado debe tener una cuenta de débito y crédito por defecto"
+
+#. module: account_withholding_tax_comissions
+#: field:account.journal,withholding_tax_required:0
+#: field:account.voucher,withholding_tax_required:0
+#: field:account.voucher,withholding_tax_required_view:0
+msgid "Required Withholding Tax"
+msgstr "Retenciones obligatorias"
+
+#. module: account_withholding_tax_comissions
+#: constraint:account.withholding.tax:0
+msgid "Error!\n"
+"The amount are invalid. Negative numbers and percentage over 100 are not allowed."
+msgstr "Error!\n"
+"El monto es inválido. No se permiten números negativos y porcentajes mayores a 100%"
+
+#. module: account_withholding_tax_comissions
+#: view:account.voucher:0
+msgid "Journal Items"
+msgstr "Apuntes contables"
+
+#. module: account_withholding_tax_comissions
+#: model:ir.actions.act_window,help:account_withholding_tax_comissions.action_account_withholding_tax_tree
+msgid "<p class=\"oe_view_nocontent_create\">\n"
+" Click to record a new withholding tax\n"
+" </p>\n"
+" "
+msgstr "<p class=\"oe_view_nocontent_create\">\n"
+" Empiece aquí para añadir una nueva retención\n"
+" </p>\n"
+" "
+
+#. module: account_withholding_tax_comissions
+#: view:account.withholding.tax:0
+msgid "Value"
+msgstr "Valor"
+
+#. module: account_withholding_tax_comissions
+#: model:ir.actions.act_window,name:account_withholding_tax_comissions.action_account_withholding_tax_tree
+#: model:ir.ui.menu,name:account_withholding_tax_comissions.menu_action_withholding_tax_tree
+msgid "Withholding Tax"
+msgstr "Retenciones"
+
+#. module: account_withholding_tax_comissions
+#: view:account.withholding.tax:0
+#: field:account.withholding.tax,name:0
+msgid "Name"
+msgstr "Nombre"
+
+#. module: account_withholding_tax_comissions
+#: help:account.withholding.tax,type:0
+msgid "Select here the kind of withholding tax. If you select percentage, you can't exceed 100%"
+msgstr "Seleccione el tipo de retención. Si selecciona porcentage, no puede exceder el 100%"
+
+#. module: account_withholding_tax_comissions
+#: model:ir.model,name:account_withholding_tax_comissions.model_account_withholding_tax
+msgid "Account Withholding Tax"
+msgstr "Account Withholding Tax"
+
+#. module: account_withholding_tax_comissions
+#: field:account.journal,withholding_tax_optional:0
+#: field:account.voucher,withholding_tax_optional:0
+msgid "Optional Withholding Tax"
+msgstr "Retenciones opcionales"
+
+#. module: account_withholding_tax_comissions
+#: view:account.voucher:0
+msgid "Journal Items Reverse Withholding Tax"
+msgstr "Apuntes contables Retenciones Reversos"
+
+#. module: account_withholding_tax_comissions
+#: view:account.withholding.tax:0
+msgid "Values"
+msgstr "Valores"
+
+#. module: account_withholding_tax_comissions
+#: view:account.journal:0
+#: view:account.voucher:0
+msgid "Optional withholding tax"
+msgstr "Retenciones opcionales"
+
+#. module: account_withholding_tax_comissions
+#: view:account.voucher:0
+msgid "Journal Items Withholding Tax"
+msgstr "Apuntes Contables Retenciones"
+
+#. module: account_withholding_tax_comissions
+#: view:account.journal:0
+msgid "Withholding tax"
+msgstr "Retenciones"
+
+#. module: account_withholding_tax_comissions
+#: field:account.voucher,withholding_move_ids:0
+msgid "Withholding Move"
+msgstr "Asiento de retención"
+
+#. module: account_withholding_tax_comissions
+#: sql_constraint:account.withholding.tax:0
+msgid "Unfortunately this code is already used, please choose a unique one"
+msgstr "Este código ya se encuentra en uso, por favor escoja uno diferente"
+
+#. module: account_withholding_tax_comissions
+#: view:account.withholding.tax:0
+#: field:account.withholding.tax,code:0
+msgid "Code"
+msgstr "Código"
+
+#. module: account_withholding_tax_comissions
+#: model:ir.model,name:account_withholding_tax_comissions.model_account_move
+msgid "Account Entry"
+msgstr "Asiento contable"
+
+#. module: account_withholding_tax_comissions
+#: view:account.voucher:0
+msgid "Journal Items Withholding Tax Reverse"
+msgstr "Apuntes Contables Retenciones Reversos"
+
+#. module: account_withholding_tax_comissions
+#: model:ir.model,name:account_withholding_tax_comissions.model_account_voucher
+msgid "Accounting Voucher"
+msgstr "Comprobantes contables"
+
+#. module: account_withholding_tax_comissions
+#: constraint:account.voucher:0
+msgid "Withholding tax can not be the same for required and optional !"
+msgstr "Retenciones no pueden ser las mismas en requeridas y opcionales !"
+
+#. module: account_withholding_tax_comissions
+#: selection:account.withholding.tax,type:0
+msgid "Numeric"
+msgstr "Numérico"
+
+#. module: account_withholding_tax_comissions
+#: view:account.withholding.tax:0
+msgid "General"
+msgstr "General"
+
+#. module: account_withholding_tax_comissions
+#: view:account.withholding.tax:0
+msgid "Search Withholding Tax"
+msgstr "Buscar Retenciones"
+
+#. module: account_withholding_tax_comissions
+#: view:account.journal:0
+#: view:account.voucher:0
+msgid "Required withholding tax"
+msgstr "Retenciones obligatorias"
+
+#. module: account_withholding_tax_comissions
+#: field:account.move,withholding_voucher_id:0
+msgid "Account voucher"
+msgstr "Asiento"
+
+#. module: account_withholding_tax_comissions
+#: view:account.withholding.tax:0
+msgid "Withholding Taxes"
+msgstr "Retenciones"
+
=== modified file 'base_company_prefix/base_company_prefix.py'
--- base_company_prefix/base_company_prefix.py 2012-06-30 22:41:06 +0000
+++ base_company_prefix/base_company_prefix.py 2013-11-06 21:08:00 +0000
@@ -18,12 +18,11 @@
#
##############################################################################
-from osv import osv
-from osv import fields
+from osv import fields, osv, orm
import os
import tools
-class res_company(osv.osv):
+class res_company(orm.Model):
_name = "res.company"
_description = 'Companies'
_inherit = 'res.company'
@@ -41,7 +40,5 @@
obj_company_name += obj_company.name
res.append((obj_company.id,obj_company_name))
return res
-
-
-
+
res_company()
=== modified file 'base_company_prefix/base_company_prefix.xml'
--- base_company_prefix/base_company_prefix.xml 2012-06-30 22:41:06 +0000
+++ base_company_prefix/base_company_prefix.xml 2013-11-06 21:08:00 +0000
@@ -1,6 +1,5 @@
<openerp>
- <data>
-
+ <data>
<record id="base_company_prefix.view_company_form" model="ir.ui.view">
<field name="name">res.company.form</field>
<field name="model">res.company</field>
@@ -17,8 +16,6 @@
</field>
</record>
-
-
<record id="base_company_prefix.view_company_tree" model="ir.ui.view">
<field name="name">res.company.tree</field>
<field name="model">res.company</field>
@@ -34,8 +31,6 @@
</field>
</record>
-
-
</data>
</openerp>
=== modified file 'base_currency_symbol/__init__.py'
--- base_currency_symbol/__init__.py 2012-06-30 22:41:06 +0000
+++ base_currency_symbol/__init__.py 2013-11-06 21:08:00 +0000
@@ -1,35 +1,23 @@
-# -*- encoding: utf-8 -*-
+# -*- coding: utf-8 -*-
##############################################################################
#
-# __init__.py
-# base_currency_symbol
-# First author: Carlos Vásquez <carlos.vasquez@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
-# Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without modification, are
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice, this list of
-# conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice, this list
-# of conditions and the following disclaimer in the documentation and/or other materials
-# provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation are those of the
-# authors and should not be interpreted as representing official policies, either expressed
-# or implied, of ClearCorp S.A..
-#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
##############################################################################
import base_currency_symbol
=== added file 'base_currency_symbol/__openerp__.py'
--- base_currency_symbol/__openerp__.py 1970-01-01 00:00:00 +0000
+++ base_currency_symbol/__openerp__.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,43 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+{
+ 'name': 'Base currency symbol',
+ 'version': '1.0',
+ 'url': 'http://launchpad.net/openerp-ccorp-addons',
+ 'author': 'ClearCorp S.A.',
+ 'website': 'http://clearcorp.co.cr',
+ 'category': 'General Modules/Base',
+ 'description': """Adds symbol to currency:
+ Use symbol_prefix and symbol_suffix depending on the currency standard.
+ """,
+ 'depends': ['base'],
+ 'init_xml': [],
+ 'demo_xml': [],
+ 'update_xml': [
+ 'base_currency_symbol_data.xml',
+ 'base_currency_symbol_view.xml',
+ ],
+ 'license': 'Other OSI approved licence',
+ 'installable': True,
+ 'active': False,
+}
=== removed file 'base_currency_symbol/__terp__.py'
--- base_currency_symbol/__terp__.py 2012-06-30 22:41:06 +0000
+++ base_currency_symbol/__terp__.py 1970-01-01 00:00:00 +0000
@@ -1,55 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# __terp__.py
-# base_currency_symbol
-# First author: Carlos Vásquez <carlos.vasquez@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
-# Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without modification, are
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice, this list of
-# conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice, this list
-# of conditions and the following disclaimer in the documentation and/or other materials
-# provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation are those of the
-# authors and should not be interpreted as representing official policies, either expressed
-# or implied, of ClearCorp S.A..
-#
-##############################################################################
-
-{
- 'name': 'Base currency symbol',
- 'version': '0.1',
- 'url': 'http://launchpad.net/openerp-ccorp-addons',
- 'author': 'ClearCorp S.A.',
- 'website': 'http://clearcorp.co.cr',
- 'category': 'General Modules/Base',
- 'description': """Adds symbol to currency:
-Use symbol_prefix and symbol_suffix depending on the currency standard.
- """,
- 'depends': ['base'],
- 'init_xml': [],
- 'demo_xml': [],
- 'update_xml': [
- 'base_currency_symbol_data.xml',
- 'base_currency_symbol_view.xml',
- ],
- 'license': 'Other OSI approved licence',
- 'installable': True,
- 'active': True,
-}
=== modified file 'base_currency_symbol/base_currency_symbol.py'
--- base_currency_symbol/base_currency_symbol.py 2012-06-30 22:41:06 +0000
+++ base_currency_symbol/base_currency_symbol.py 2013-11-06 21:08:00 +0000
@@ -1,35 +1,23 @@
-# -*- encoding: utf-8 -*-
+# -*- coding: utf-8 -*-
##############################################################################
#
-# base_currency_symbol.py
-# base_currency_symbol
-# First author: Carlos Vásquez <carlos.vasquez@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
-# Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without modification, are
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice, this list of
-# conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice, this list
-# of conditions and the following disclaimer in the documentation and/or other materials
-# provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation are those of the
-# authors and should not be interpreted as representing official policies, either expressed
-# or implied, of ClearCorp S.A..
-#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
##############################################################################
from osv import osv,fields
=== renamed file 'base_import_exchange_rates/__terp__.py' => 'base_import_exchange_rates/__openerp__.py'
--- base_import_exchange_rates/__terp__.py 2013-07-29 22:54:07 +0000
+++ base_import_exchange_rates/__openerp__.py 2013-11-06 21:08:00 +0000
@@ -43,16 +43,29 @@
'website': 'http://clearcorp.co.cr',
'category': 'Generic Modules/Base',
'description': """Import exchange rates from XML web service.
- Configuration:
- 1) Install the module.
- 2) Go to Administration > Company, open the company you want to syncronize.
- 3) in the page ´Currency auto update configuration´ you can configure wich webservice you wan to use
- the company the currency is related to, and the currecy.
- 4) You have to go to Administration>Configuration>Planification , and configure the interval you want for the method to syncronize.
-
-
-
-
+<<<<<<< TREE
+ Configuration:
+ 1) Install the module.
+ 2) Go to Administration > Company, open the company you want to syncronize.
+ 3) in the page ´Currency auto update configuration´ you can configure wich webservice you wan to use
+ the company the currency is related to, and the currecy.
+ 4) You have to go to Administration>Configuration>Planification , and configure the interval you want for the method to syncronize.
+
+
+
+
+=======
+ Configuration:
+ 1) Install the module.
+ 2) Go to Administration > Company, open the company you want to syncronize.
+ 3) in the page ´Currency auto update configuration´ you can configure wich webservice you wan to use
+ the company the currency is related to, and the currecy.
+ 4) You have to go to Administration>Configuration>Planification , and configure the interval you want for the method to syncronize.
+
+
+
+
+>>>>>>> MERGE-SOURCE
""",
'depends': [
'account',
=== modified file 'base_import_exchange_rates/company.py'
--- base_import_exchange_rates/company.py 2012-06-30 22:41:06 +0000
+++ base_import_exchange_rates/company.py 2013-11-06 21:08:00 +0000
@@ -31,7 +31,7 @@
import netsvc
from osv import fields, osv
-class res_company(osv.osv):
+class ResCompany(osv.osv):
"""
override company to add currency udate
"""
@@ -170,5 +170,3 @@
for comp in compagnies :
self.write(cr, uid, comp,{'interval_type':interval})
return {}
-
-res_company()
=== modified file 'base_import_exchange_rates/company_view.xml'
--- base_import_exchange_rates/company_view.xml 2012-06-30 22:41:06 +0000
+++ base_import_exchange_rates/company_view.xml 2013-11-06 21:08:00 +0000
@@ -1,23 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
- <record model="ir.ui.view" id="currency_auto_comp">
+
+ <record id="currency_auto_comp" model="ir.ui.view">
<field name="name">res.company.form.inherit</field>
<field name="model">res.company</field>
- <field name="inherit_id" ref="base.view_company_form"/>
- <field name="type">form</field>
+ <field name="inherit_id" ref="base.view_company_form" />
<field name="arch" type="xml">
<notebook position="inside">
<page string="Currency auto update configuration">
- <field name="auto_currency_up" on_change="on_change_auto_currency_up(auto_currency_up)"/>
- <field name="interval_type" on_change="on_change_intervall(interval_type)"/>
- <field name="multi_company_currency_enable"/>
- <separator string="Currency updates services" colspan="4"/>
- <field name="services_to_use" colspan="4" nolabel="1"/>
- <button name="button_refresh_currency" string="Refresh currencies" type='object' />
+ <group>
+ <field name="auto_currency_up" on_change="on_change_auto_currency_up(auto_currency_up)"/>
+ <field name="interval_type" on_change="on_change_intervall(interval_type)"/>
+ <field name="multi_company_currency_enable"/>
+ </group>
+ <group>
+ <separator string="Currency updates services" colspan="4"/>
+ <field name="services_to_use" colspan="4" nolabel="1"/>
+ <button name="button_refresh_currency" string="Refresh currencies" type='object' />
+ </group>
</page>
</notebook>
</field>
</record>
+
</data>
</openerp>
=== modified file 'base_import_exchange_rates/currency_rate_update.py'
=== added directory 'budget'
=== added file 'budget/__init__.py'
--- budget/__init__.py 1970-01-01 00:00:00 +0000
+++ budget/__init__.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,31 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import account_move
+import budget
+import wizard
+import res_partner
+import account_invoice
+import account
+import hr_expense
+#import purchase
+#import sale
\ No newline at end of file
=== added file 'budget/__openerp__.py'
--- budget/__openerp__.py 1970-01-01 00:00:00 +0000
+++ budget/__openerp__.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,64 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+{
+ 'name': 'Public Budget',
+ 'version': '0.1',
+ 'url': 'http://launchpad.net/openerp-ccorp-addons',
+ 'author': 'ClearCorp S.A.',
+ 'website': 'http://clearcorp.co.cr',
+ 'category': 'Generic Modules/Base',
+ 'description': """ This module adds the logic for Public Budget management and it's different processes
+ """,
+ 'depends': [
+ 'base',
+ 'account',
+ 'purchase',
+ 'sale',
+ 'purchase_order_discount',
+ 'hr_payroll',
+ 'hr_expense',
+ 'account_account_extended_ccorp'
+ ],
+ 'data': [
+ 'security/security.xml',
+ 'security/ir.model.access.csv',
+ 'budget_workflow.xml',
+ 'wizard/budget_program_populate_view.xml',
+ 'budget_view.xml',
+ 'wizard/budget_import_catalog_view.xml',
+ 'res_partner_view.xml',
+ 'budget_sequence.xml',
+ 'account_invoice_view.xml',
+ 'account_view.xml',
+ 'account_move_line.xml',
+ 'hr_expense_view.xml',
+ 'hr_expense_workflow.xml',
+# 'purchase_view.xml',
+# 'purchase_workflow.xml',
+# 'sale_view.xml'
+ ],
+ 'license': 'AGPL-3',
+ 'installable': True,
+ 'active': False,
+ 'application': True,
+
+}
=== added file 'budget/account.py'
--- budget/account.py 1970-01-01 00:00:00 +0000
+++ budget/account.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,679 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from osv import fields, osv
+from openerp import netsvc
+import decimal_precision as dp
+from tools.translate import _
+from datetime import datetime
+from copy import copy
+
+class AccountMoveReconcile(osv.Model):
+ _inherit = 'account.move.reconcile'
+
+ def unlink(self, cr, uid, ids, context={}):
+ dist_obj = self.pool.get('account.move.line.distribution')
+ bud_mov_obj = self.pool.get('budget.move')
+ wf_service = netsvc.LocalService("workflow")
+ dist_ids = dist_obj.search(cr, uid, [('reconcile_ids.id','in',ids)], context=context)
+ dists = dist_obj.browse(cr, uid, dist_ids, context=context)
+ budget_move_ids = []
+ for dist in dists:
+ if dist.target_budget_move_line_id and \
+ dist.target_budget_move_line_id.budget_move_id and \
+ dist.target_budget_move_line_id.budget_move_id.id not in budget_move_ids:
+ budget_move_ids.append(dist.target_budget_move_line_id.budget_move_id.id)
+ dist_obj.unlink(cr, uid, dist_ids, context=context)
+
+ if budget_move_ids:
+ bud_mov_obj.recalculate_values(cr, uid, budget_move_ids, context=context)
+ for mov_id in budget_move_ids:
+ bud_mov_obj._workflow_signal(cr, uid, [mov_id], 'button_check_execution', context=context)
+ return super(AccountMoveReconcile, self).unlink(cr, uid, ids, context=context)
+
+ def create(self, cr, uid, vals, context=None):
+ reconcile_id = super(AccountMoveReconcile, self).create(cr, uid, vals, context=context)
+ self.reconcile_budget_check(cr, uid, [reconcile_id], context=context)
+ return reconcile_id
+
+ def split_debit_credit(self,cr, uid, move_line_ids,context=None):
+ #takes a list of given account move lines and classifies them in credit or debit
+ #returns a dictionary with two keys('debit' and 'credit') and for values lists of account move line ids
+ result ={}
+ credit = []
+ debit = []
+ acc_move_line = self.pool.get('account.move.line')
+ for line in acc_move_line.browse(cr, uid, move_line_ids,context=context):
+ if line.credit > 0:
+ credit.append(line.id)
+ elif line.debit > 0:
+ debit.append(line.id)
+ elif line.debit == 0 and line.credit == 0:
+ if line.amount_currency > 0:
+ debit.append(line.id)
+ else:
+ credit.append(line.id)
+ result ['debit'] = debit
+ result ['credit'] = credit
+ return result
+
+ def split_move_noncash(self,cr, uid, move_ids,context=None):
+ #Classifies every move line of the account move in cash or non cash
+ #for a move, returns a dictionary, with the id of the move line as the key and 'cash' or 'non_cash' for values
+ result ={}
+# acc_move_line = self.pool.get('account.move.line')
+ acc_move_obj = self.pool.get('account.move')
+
+ for move in acc_move_obj.browse(cr, uid, move_ids, context=context):
+ cash = False
+ for line in move.line_id:
+ if line.account_id.moves_cash:
+ cash = True
+ if cash:
+ result[move.id] = 'cash'
+ else:
+ result[move.id] = 'non_cash'
+ return result
+
+ def move_in_voucher(self,cr, uid, move_ids, context=None):
+ #Checks if a move is in a voucher, returns the id of the voucher or -1 in case that is not in any
+ acc_move_obj = self.pool.get('account.move')
+ acc_vouch_obj = self.pool.get('account.voucher')
+ for move_id in move_ids:
+ voucher_search = acc_vouch_obj.search(cr, uid, [('move_id','=',move_id)], context=context)
+ if len(voucher_search) > 0:
+ return voucher_search[0]
+ else:
+ return -1
+
+ def move_in_invoice(self,cr, uid, move_ids, context=None):
+ #checks if a move is in an invoice, returns the id of the invoice or -1 in case that is not in any
+ acc_move_obj = self.pool.get('account.move')
+ acc_inv_obj = self.pool.get('account.invoice')
+ for move_id in move_ids:
+ invoice_search = acc_inv_obj.search(cr, uid, [('move_id','=',move_id)], context=context)
+ if len(invoice_search) > 0:
+ return invoice_search[0]
+ else:
+ return -1
+
+ def line_in_move(self,cr, uid, line_ids, context=None):
+ #checks if a move is in an invoice, returns the id of the invoice or -1 in case that is not in any
+ mov_line_obj = self.pool.get('account.move.line')
+ for line in mov_line_obj.browse(cr, uid, line_ids, context=context):
+ return line.move_id.id
+ return -1
+
+ def create_budget_account_reconcile(self, cr, uid, invoice_id, payment_move_line_id, payment_reconcile_id, reconcile_ids, context=None):
+ acc_inv_obj = self.pool.get('account.invoice')
+ acc_vouch_obj = self.pool.get('account.voucher')
+ move_line_obj = self.pool.get('account.move.line')
+ amld = self.pool.get('account.move.line.distribution')
+ bud_move_obj = self.pool.get('budget.move')
+ bud_move_line_obj = self.pool.get('budget.move.line')
+
+ currency_id = None
+ amount = 0
+ for line in move_line_obj.browse(cr, uid, [payment_move_line_id],context=context):
+ if line.credit > 0:
+ amount = line.credit
+ elif line.debit > 0:
+ amount = line.debit
+ elif line.debit == 0 and line.credit == 0:
+ amount = line.amount_currency
+ currency_id = line.currency_id
+ if currency_id:
+ print 'TODO'
+ #amount = how to get the equivalent in system currency?
+ invoice = acc_inv_obj.browse(cr, uid,[invoice_id],context = context)[0]
+
+ bud_move = invoice.budget_move_id
+ i=0
+ sum = 0
+ for line in bud_move.move_lines:
+ # amld.clean_reconcile_entries(cr, uid, [payment_move_line_id], context=None)
+ if i < len(bud_move.move_lines)-1:
+ perc = line.fixed_amount/bud_move.fixed_amount or 0
+ amld.create(cr, uid, {'budget_move_id': bud_move.id,
+ 'budget_move_line_id': line.id,
+ 'account_move_line_id': payment_move_line_id,
+ 'account_move_reconcile_id': payment_reconcile_id,
+ 'amount' : amount * perc
+ })
+ sum += amount * perc
+ i+=1
+
+ amld.create(cr, uid, {'budget_move_id': bud_move.id,
+ 'budget_move_line_id': bud_move.move_lines[i].id,
+ 'account_move_line_id': payment_move_line_id,
+ 'account_move_reconcile_id': payment_reconcile_id,
+ 'amount' : amount - sum
+ })
+ bud_move_line_obj.write(cr, uid, [line.id],{'date': line.date}, context=context)
+ bud_move_obj.write(cr, uid , [bud_move.id], {'code': bud_move.code}, context=context)
+
+
+ def _get_move_counterparts(self, cr, uid, line, context={}):
+ is_debit = True if line.debit else False
+ res = []
+ for move_line in line.move_id.line_id:
+ if (is_debit and move_line.credit) or (not is_debit and move_line.debit):
+ res.append(move_line)
+ return res
+
+ def _get_reconcile_counterparts(self, cr, uid, line, context={}):
+ is_debit = True if line.debit else False
+ reconcile_ids = []
+
+ if line.reconcile_id:
+ reconcile_lines = line.reconcile_id.line_id if line.reconcile_id and line.reconcile_id.line_id else []
+ reconcile_ids.append(line.reconcile_id.id)
+ elif line.reconcile_partial_id:
+ reconcile_lines = line.reconcile_partial_id.line_partial_ids if line.reconcile_partial_id and line.reconcile_partial_id.line_partial_ids else []
+ reconcile_ids.append(line.reconcile_partial_id.id)
+ else:
+ reconcile_lines = []
+
+ res = []
+ if reconcile_lines:
+ for move_line in reconcile_lines:
+ if (is_debit and move_line.credit) or (not is_debit and move_line.debit):
+ res.append(move_line)
+ return reconcile_ids, res
+
+ def _adjust_distributed_values(self, cr, uid, dist_ids, amount, context = {}):
+ dist_obj = self.pool.get('account.move.line.distribution')
+ distributed_amount = 0.0
+ dists = dist_obj.browse(cr, uid, dist_ids, context = context)
+
+ if amount <= 0.0:
+ dist_obj.unlink(cr, uid, dist_ids, context = context)
+ return True
+
+ for dist in dists:
+ distributed_amount += dist.distribution_amount
+ if distributed_amount and distributed_amount > amount:
+ for dist in dists:
+ vals = {
+ 'distribution_percentage':dist.distribution_percentage * amount / distributed_amount,
+ 'distribution_amount':dist.distribution_amount * amount / distributed_amount,
+ }
+ dist_obj.write(cr, uid, [dist.id], vals, context = context)
+ return True
+ return False
+
+ def _recursive_liquid_get_auto_distribution(self, cr, uid, original_line, actual_line = None, checked_lines = [], amount_to_dist = 0.0, original_amount_to_dist = 0.0, reconcile_ids = [], continue_reconcile = False, context={}):
+ """
+ Receives an account.move.line that moves liquid and was found creating a reconcile.
+ This method starts at this line and "travels" through the moves and reconciles line counterparts
+ to try to find a budget move to match with.
+ Returns the list of account.move.line.distribution created, or an empty list.
+ """
+
+ dist_obj = self.pool.get('account.move.line.distribution')
+
+ # Check if not first call and void type line. This kind of lines only can be navigated when called first by the main method.
+ if actual_line and actual_line.move_id.budget_type == 'void':
+ return []
+
+ # Check if first call and not liquid or void line
+ if not actual_line and not original_line.account_id.moves_cash:
+ return []
+
+ # Check for first call
+ if not actual_line:
+ dist_search = dist_obj.search(cr, uid, [('account_move_line_id','=',original_line.id)],context=context)
+ dist_obj.unlink(cr,uid,dist_search,context=context)
+ actual_line = original_line
+ amount_to_dist = original_line.debit + original_line.credit
+ original_amount_to_dist = amount_to_dist
+ checked_lines = [actual_line.id]
+
+ if not amount_to_dist:
+ return []
+
+ budget_lines = {}
+ liquid_lines = {}
+ none_lines = {}
+
+ budget_amounts = {}
+ liquid_amounts = {}
+
+ budget_total = 0.0
+ liquid_total = 0.0
+ none_total = 0.0
+
+ amount_total = 0.0
+
+ new_reconcile_ids = copy(reconcile_ids)
+ # Get line counterparts, if the reconcile flag is on, the counterparts are looked in the reconcile, if not move is used
+ if continue_reconcile:
+ line_reconcile_ids, counterparts = self._get_reconcile_counterparts(cr, uid, actual_line, context=context)
+ new_reconcile_ids += line_reconcile_ids
+ else:
+ counterparts = self._get_move_counterparts(cr, uid, actual_line, context=context)
+
+ for counterpart in counterparts:
+ if counterpart.id not in checked_lines:
+ if counterpart.move_id.budget_type == 'budget':
+ budget_lines[counterpart.id] = counterpart
+ budget_amounts[counterpart.id] = counterpart.debit + counterpart.credit
+ budget_total += counterpart.debit + counterpart.credit
+ amount_total += counterpart.debit + counterpart.credit
+ elif counterpart.account_id.moves_cash:
+ liquid_lines[counterpart.id] = counterpart
+ liquid_amounts[counterpart.id] = counterpart.debit + counterpart.credit
+ liquid_total += counterpart.debit + counterpart.credit
+ amount_total += counterpart.debit + counterpart.credit
+ else:
+ none_lines[counterpart.id] = counterpart
+ none_total += counterpart.debit + counterpart.credit
+ amount_total += counterpart.debit + counterpart.credit
+ checked_lines.append(counterpart.id)
+
+ if not (budget_lines or liquid_lines or none_lines):
+ return []
+
+ if amount_total and amount_total > amount_to_dist:
+ budget_amount_to_dist = budget_total * amount_to_dist / amount_total
+ liquid_amount_to_dist = liquid_total * amount_to_dist / amount_total
+ none_amount_to_dist = amount_to_dist - budget_amount_to_dist - liquid_amount_to_dist
+ elif amount_total:
+ budget_amount_to_dist = budget_total
+ liquid_amount_to_dist = liquid_total
+ none_amount_to_dist = none_total
+ else:
+ # Nothing to distribute
+ return []
+
+ none_res = []
+ if none_total:
+ for line in none_lines.values():
+ line_amount_to_dist = (none_amount_to_dist if line.debit + line.credit >= none_amount_to_dist else line.debit + line.credit)
+ # Use none_amount_to_dist with all lines as we don't know which ones will find something
+ none_res += self._recursive_liquid_get_auto_distribution(cr, uid, original_line,
+ actual_line = line,
+ checked_lines = checked_lines,
+ amount_to_dist = line_amount_to_dist,
+ original_amount_to_dist = original_amount_to_dist,
+ reconcile_ids = new_reconcile_ids,
+ continue_reconcile = (not continue_reconcile),
+ context = context)
+
+ # Check if there is budget, void or liquid lines, if not return none_res, even if its empty.
+ budget_res = []
+ liquid_res = []
+ budget_distributed = 0.0
+ liquid_distributed = 0.0
+ bud_move_obj = self.pool.get('budget.move')
+ if budget_lines or liquid_lines:
+ # Write dists and build lists
+
+ #dist_obj = self.pool.get('account.move.line.distribution')
+
+ # Budget list
+ budget_total = 0.0
+ budget_budget_move_line_ids = []
+ budget_budget_move_lines = []
+ for line in budget_lines.values():
+ budget_budget_move_lines += (line.move_id.budget_move_line_ids if line.move_id.budget_move_line_ids else [])
+ for line in budget_budget_move_lines:
+ budget_budget_move_line_ids.append(line.id)
+ budget_total += line.compromised
+ for line in budget_budget_move_lines:
+ distribution_amount = line.compromised
+ # If the resulting total of budget plus liquid lines is more than available, the amount has to be fractioned.
+ if budget_total + liquid_amount_to_dist > amount_to_dist:
+ distribution_amount = distribution_amount * amount_to_dist / budget_total + liquid_amount_to_dist
+ budget_distributed += distribution_amount
+ vals = {
+ 'account_move_line_id': original_line.id,
+ 'distribution_amount': distribution_amount,
+ 'distribution_percentage': 100 * distribution_amount / original_amount_to_dist,
+ 'target_budget_move_line_id': line.id,
+ 'reconcile_ids': [(6, 0, new_reconcile_ids)],
+ 'type': 'auto',
+ 'account_move_line_type': 'liquid',
+ }
+ budget_res.append(dist_obj.create(cr, uid, vals, context = context))
+ bud_move_obj._workflow_signal(cr, uid, [line.budget_move_id.id], 'button_check_execution', context=context)
+
+
+ # Liquid list
+ for line in liquid_lines.values():
+ distribution_amount = liquid_amounts[line.id]
+ liquid_distributed += distribution_amount
+ vals = {
+ 'account_move_line_id': original_line.id,
+ 'distribution_amount': distribution_amount,
+ 'distribution_percentage': 100 * distribution_amount / original_amount_to_dist,
+ 'target_account_move_line_id': line.id,
+ 'reconcile_ids': [(6, 0, new_reconcile_ids)],
+ 'type': 'auto',
+ }
+ liquid_res.append(dist_obj.create(cr, uid, vals, context = context))
+ bud_move_obj._workflow_signal(cr, uid, [line.budget_move_id.id], 'button_check_execution', context=context)
+
+ distributed_amount = budget_distributed + liquid_distributed
+
+ # Check if some dists are returned to adjust their values
+ if none_res:
+ self._adjust_distributed_values(cr, uid, none_res, amount_to_dist - distributed_amount, context = context)
+
+ return budget_res + liquid_res + none_res
+
+ def _recursive_void_get_auto_distribution(self, cr, uid, original_line, actual_line = None, checked_lines = [], amount_to_dist = 0.0, original_amount_to_dist = 0.0, reconcile_ids = [], continue_reconcile = False, context={}):
+ """
+ Receives an account.move.line that is marked as void for budget moves and was found creating a reconcile.
+ This method starts at this line and "travels" through the moves and reconciles line counterparts
+ to try to find a budget move to match with.
+ Returns the list of account.move.line.distribution created, or an empty list.
+ """
+
+ # Check if not first call and void type line. This kind of lines only can be navigated when called first by the main method.
+ if actual_line and actual_line.move_id.budget_type == 'void':
+ return []
+
+ # Check if first call and not void line
+ if not actual_line and not actual_line.move_id.budget_type == 'void':
+ return []
+
+ # Check for first call
+ if not actual_line:
+ actual_line = original_line
+ amount_to_dist = original_line.debit + original_line.credit
+ original_amount_to_dist = amount_to_dist
+ checked_lines.append(actual_line.id)
+
+ if not amount_to_dist:
+ return []
+
+ budget_lines = {}
+ none_lines = {}
+
+ budget_amounts = {}
+
+ budget_total = 0.0
+ none_total = 0.0
+
+ amount_total = 0.0
+
+ new_reconcile_ids = copy(reconcile_ids)
+ # Get line counterparts, if the reconcile flag is on, the counterparts are looked in the reconcile, if not move is used
+ if continue_reconcile:
+ line_reconcile_ids, counterparts = self._get_reconcile_counterparts(cr, uid, actual_line, context=context)
+ new_reconcile_ids += line_reconcile_ids
+ else:
+ counterparts = self._get_move_counterparts(cr, uid, actual_line, context=context)
+
+ for counterpart in counterparts:
+ if counterpart.id not in checked_lines:
+ if counterpart.move_id.budget_type == 'budget':
+ budget_lines[counterpart.id] = counterpart
+ budget_amounts[counterpart.id] = counterpart.debit + counterpart.credit
+ budget_total += counterpart.debit + counterpart.credit
+ amount_total += counterpart.debit + counterpart.credit
+ elif not counterpart.account_id.moves_cash and counterpart.move_id.budget_type != 'void':
+ none_lines[counterpart.id] = counterpart
+ none_total += counterpart.debit + counterpart.credit
+ amount_total += counterpart.debit + counterpart.credit
+ checked_lines.append(counterpart.id)
+
+ if not (budget_lines or none_lines):
+ return []
+
+ if amount_total and amount_total > amount_to_dist:
+ budget_amount_to_dist = budget_total * amount_to_dist / amount_total
+ none_amount_to_dist = amount_to_dist - budget_amount_to_dist
+ elif amount_total:
+ budget_amount_to_dist = budget_total
+ none_amount_to_dist = none_total
+ else:
+ # Nothing to distribute
+ return []
+
+ none_res = []
+ if none_total:
+ for line in none_lines.values():
+ line_amount_to_dist = (none_amount_to_dist if line.debit + line.credit >= none_amount_to_dist else line.debit + line.credit)
+ # Use none_amount_to_dist with all lines as we don't know which ones will find something
+ none_res += self._recursive_void_get_auto_distribution(cr, uid, original_line,
+ actual_line = line,
+ checked_lines = checked_lines,
+ amount_to_dist = line_amount_to_dist,
+ reconcile_ids = new_reconcile_ids,
+ continue_reconcile = (not continue_reconcile),
+ context = context)
+
+ budget_res = []
+ budget_distributed = 0.0
+ # Check if there is budget, void or liquid lines, if not return none_res, even if its empty.
+ if budget_lines:
+ # Write dists and build lists
+
+ dist_obj = self.pool.get('account.move.line.distribution')
+
+ # Budget list
+ budget_total = 0.0
+ budget_budget_move_line_ids = []
+ budget_budget_move_lines = []
+ bud_move_obj = self.pool.get('budget.move')
+ for line in budget_lines.values():
+ budget_budget_move_lines += (line.move_id.budget_move_line_ids if line.move_id.budget_move_line_ids else [])
+ for line in budget_budget_move_lines:
+ budget_budget_move_line_ids.append(line.id)
+ budget_total += line.compromised
+ for line in budget_budget_move_lines:
+ distribution_amount = line.compromised
+ # If the resulting total of budget plus liquid lines is more than available, the amount has to be fractioned.
+ if budget_total > amount_to_dist:
+ distribution_amount = distribution_amount * amount_to_dist / budget_total
+ budget_distributed += distribution_amount
+ vals = {
+ 'account_move_line_id': original_line.id,
+ 'distribution_amount': distribution_amount,
+ 'distribution_percentage': 100 * distribution_amount / original_amount_to_dist,
+ 'target_budget_move_line_id': line.id,
+ 'reconcile_ids': [(6, 0, new_reconcile_ids)],
+ 'type': 'auto',
+ 'account_move_line_type': 'liquid',
+ }
+ budget_res.append(dist_obj.create(cr, uid, vals, context = context))
+ bud_move_obj._workflow_signal(cr, uid, [line.budget_move_id.id], 'button_check_execution', context=context)
+
+ distributed_amount = budget_distributed
+
+ # Check if some dists are returned to adjust their values
+ if none_res:
+ self._adjust_distributed_values(cr, uid, none_res, amount_to_dist - distributed_amount, context = context)
+
+ return budget_res + none_res
+
+ def _check_auto_distributions(self, cr, uid, line, dist_ids, context = {}):
+ # Check for exact value computation
+ if line and dist_ids:
+ dist_obj = self.pool.get('account.move.line.distribution')
+ dists = dist_obj.browse(cr, uid, dist_ids, context = context)
+ distribution_amount = 0.0
+ distribution_percentage = 0.0
+ for dist in dists:
+ distribution_amount += dist.distribution_amount
+ distribution_percentage += dist.distribution_percentage
+ last_dist = dists[-1]
+ last_dist_distribution_amount = last_dist.distribution_amount
+ last_dist_distribution_percentage = last_dist.distribution_percentage
+ amount = line.debit + line.credit
+
+ vals = {}
+ if distribution_amount > amount:
+ if (distribution_amount - amount) > last_dist_distribution_amount:
+ # Bad dists, the difference is bigger than the adjustment line (last line)
+ dist_obj.unlink(cr, uid, dist_ids, context=context)
+ return []
+ else:
+ # Adjust difference
+ vals['distribution_amount'] = amount - (distribution_amount - last_dist_distribution_amount)
+ elif distribution_amount < amount:
+ vals['distribution_amount'] = amount - (distribution_amount - last_dist_distribution_amount)
+
+ if 'distribution_amount' in vals:
+ if last_dist.target_account_move_line_id and \
+ vals['distribution_amount'] > (last_dist.target_account_move_line_id.debit + last_dist.target_account_move_line_id.credit):
+ # New value is bigger than allowed value
+ dist_obj.unlink(cr, uid, dist_ids, context=context)
+ return []
+ elif last_dist.target_budget_move_line_id and \
+ vals['distribution_amount'] > last_dist.target_budget_move_line_id.compromised:
+ # New value is bigger than allowed value
+ dist_obj.unlink(cr, uid, dist_ids, context=context)
+ return []
+
+ if distribution_percentage > 100:
+ if (distribution_percentage - 100) > last_dist_distribution_percentage:
+ # Bad dists, the difference is bigger than the adjustment line (last line)
+ dist_obj.unlink(cr, uid, dist_ids, context=context)
+ return []
+ else:
+ # Adjust difference
+ vals['distribution_percentage'] = 100 - (distribution_percentage - last_dist_distribution_percentage)
+ elif distribution_percentage < 100:
+ vals['distribution_percentage'] = 100 - (distribution_percentage - last_dist_distribution_percentage)
+
+ dist_obj.write(cr, uid, last_dist.id, vals, context=context)
+ return dist_ids
+
+ def reconcile_budget_check(self, cr, uid, ids, context={}):
+ done_lines = []
+ res = {}
+ for reconcile in self.browse(cr, uid, ids, context=context):
+ # Check if reconcile "touches" a move that touches a liquid account on any of its move lines
+
+ # First get the moves of the reconciled lines
+ if reconcile.line_id:
+ moves = [line.move_id for line in reconcile.line_id]
+ else:
+ moves = [line.move_id for line in reconcile.line_partial_ids]
+ # Then get all the lines of those moves, reconciled and counterparts
+ move_lines = [line for move in moves for line in move.line_id]
+ # Check if the account if marked as moves_cash
+ for line in move_lines:
+ if (line.id not in done_lines) and line.account_id and line.account_id.moves_cash:
+ dist_ids = self._recursive_liquid_get_auto_distribution(cr, uid, line, context=context)
+ checked_dist_ids = self._check_auto_distributions(cr, uid, line, dist_ids, context=context)
+ if checked_dist_ids:
+ res[line.id] = checked_dist_ids
+ elif (line.id not in done_lines) and line.move_id.budget_type == 'void':
+ dist_ids = self._recursive_void_get_auto_distribution(cr, uid, line, context=context)
+ checked_dist_ids = self._check_auto_distributions(cr, uid, line, dist_ids, context=context)
+ if checked_dist_ids:
+ res[line.id] = checked_dist_ids
+ done_lines.append(line.id)
+
+ # Recalculate budget move values
+ if res:
+ budget_move_ids = []
+ dist_obj = self.pool.get('account.move.line.distribution')
+ dist_ids = [dist_id for dist_ids in res.values() for dist_id in dist_ids]
+ dists = dist_obj.browse(cr, uid, dist_ids)
+ for dist in dists:
+ if dist.target_budget_move_line_id and dist.target_budget_move_line_id.budget_move_id:
+ budget_move_ids.append(dist.target_budget_move_line_id.budget_move_id.id)
+ if budget_move_ids:
+ budget_move_obj = self.pool.get('budget.move')
+ budget_move_obj.recalculate_values(cr, uid, budget_move_ids, context = context)
+ return res
+
+# def on_create_budget_check(self, cr, uid, ids, visited_reconciles,trace_reconciled_ids, passing_through, context=None):
+# voucher_obj = self.pool.get('account.voucher')
+# acc_move_obj = self.pool.get('account.move')
+# voucher_present = False
+# invoice_present = False
+#
+# for reconcile in self.browse(cr, uid, ids, context=context):
+# local_trace_reconciled_ids = trace_reconciled_ids
+# local_trace_reconciled_ids.append(reconcile.id)
+# local_visited_reconciles = visited_reconciles
+# lines = []
+# line_ids = []
+# move_ids = []
+#
+# #choosing between partial or total reconcile
+# if reconcile.line_id:
+# lines = reconcile.line_id
+# elif reconcile.line_partial_ids:
+# lines = reconcile.line_partial_ids
+#
+# #getting move_line_ids from reconcile lines
+# reconcile_line_ids = map(lambda x: x.id, lines)
+# #getting move_ids from reconcile lines
+# move_ids = map(lambda x: x.move_id.id, lines)
+#
+#
+# cash_moves = self.split_move_noncash(cr, uid, move_ids, context=context)
+#
+# if 'cash' in cash_moves.values():
+# for move in acc_move_obj.browse( cr, uid, move_ids, context=context):
+# if cash_moves[move.id] == 'cash': #if it moves cash and
+# voucher_id = self.move_in_voucher(cr, uid, [move.id], context=context)
+# #if voucher_id != -1: #is a voucher
+# classified_reconciled_lines = self.split_debit_credit(cr, uid, reconcile_line_ids, context)
+# for line in move.line_id:
+# reconcile_id = line.reconcile_id or line.reconcile_partial_id
+# if line.id in reconcile_line_ids:
+# reconcile_counterpart_ids = self.get_counterparts(cr, uid, line.id, classified_reconciled_lines, context)
+# for counter_id in reconcile_counterpart_ids:
+# move_counter_id = self.line_in_move(cr, uid, [counter_id], context)
+# invoice_id = self.move_in_invoice(cr, uid, [move_counter_id], context=context)
+# if invoice_id != -1:
+# self.create_budget_account_reconcile(cr, uid, invoice_id, line.id, reconcile_id.id, local_trace_reconciled_ids, context=context)
+# else:
+# print ("else if no t in invoice")
+#
+#
+# elif passing_through:
+# print ("TODO PASS THROUGH")
+
+class AccountMoveLine(osv.Model):
+ _inherit = 'account.move.line'
+
+ _columns = {
+ 'distribution_ids' : fields.one2many('account.move.line.distribution', 'account_move_line_id', 'Distributions'),
+ }
+
+class AccountMove(osv.Model):
+ _inherit = 'account.move'
+
+ OPTIONS = [
+ ('void', 'Voids budget move'),
+ ('budget', 'Budget move'),
+ ]
+
+ _columns = {
+ 'budget_move_line_ids': fields.one2many('budget.move.line', 'account_move_id', 'Budget move lines'),
+ 'budget_type': fields.selection(OPTIONS, 'budget_type', readonly=True),
+ }
+
+class Account(osv.Model):
+ _inherit = 'account.account'
+
+ _columns = {
+ 'default_budget_program_line' : fields.many2one('budget.program.line','Default budget program line'),
+ }
=== added file 'budget/account_invoice.py'
--- budget/account_invoice.py 1970-01-01 00:00:00 +0000
+++ budget/account_invoice.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,166 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from osv import fields, osv
+import netsvc
+import decimal_precision as dp
+
+class account_invoice(osv.osv):
+ _name = 'account.invoice'
+ _inherit = 'account.invoice'
+
+ def _check_from_order(self, cr, uid, context=None):
+ if context is None:
+ context = {}
+ res = context.get('from_order', False)
+ return res
+
+ _columns= {
+ 'budget_move_id': fields.many2one('budget.move', 'Budget move', readonly=True, ),
+ 'from_order': fields.boolean('From order')
+ }
+ _defaults={
+ 'from_order': _check_from_order
+ }
+
+
+ def create_budget_move(self,cr, uid, ids, context=None):
+ bud_move_obj = self.pool.get('budget.move')
+ acc_inv_obj = self.pool.get('account.invoice')
+ for invoice in acc_inv_obj.browse(cr, uid, ids, context=context):
+ if invoice.type in ('in_invoice','out_refund'):
+ type = 'manual_invoice_in'
+ if invoice.type in ('out_invoice','in_refund'):
+ type = 'manual_invoice_out'
+ move_id = bud_move_obj.create(cr, uid, { 'type': type }, context=context)
+ return move_id
+
+
+ def create_budget_move_line(self, cr, uid, line_id, context=None):
+ acc_inv_obj = self.pool.get('account.invoice')
+ acc_move_obj = self.pool.get('account.move')
+ inv_line_obj = self.pool.get('account.invoice.line')
+ bud_move_obj = self.pool.get('budget.move')
+ bud_line_obj = self.pool.get('budget.move.line')
+ fixed_amount = 0.0
+ invoice_line = inv_line_obj.browse(cr, uid, [line_id], context=context)[0]
+ invoice = acc_inv_obj.browse(cr, uid, [invoice_line.invoice_id.id], context=context)[0]
+ move_id = invoice.budget_move_id.id
+ refund = False
+ budget_type = ""
+
+ if invoice.type in ('in_invoice', 'out_refund'):
+ fixed_amount = invoice_line.subtotal_discounted_taxed
+ if invoice.type == 'out_refund':
+ refund = True
+ if invoice.type in ('out_invoice', 'in_refund'):
+ fixed_amount = invoice_line.subtotal_discounted_taxed * -1 # should be negative because it is an income
+ if invoice.type == 'in_refund':
+ refund = True
+
+
+ bud_line = bud_line_obj.create(cr, uid, {'budget_move_id': move_id,
+ 'origin' : invoice_line.name,
+ 'program_line_id': invoice_line.program_line_id.id,
+ 'fixed_amount': fixed_amount ,
+ 'inv_line_id': line_id,
+ 'account_move_id': invoice.move_id.id
+ }, context=context)
+ if refund :
+ budget_type = 'void'
+ else:
+ budget_type = 'budget'
+
+ acc_move_obj.write(cr , uid, [invoice.move_id.id], {'budget_type': budget_type}, context=context)
+
+ return bud_line
+
+ def invoice_validate(self, cr, uid, ids, context=None):
+ obj_bud_move = self.pool.get('budget.move')
+ validate_result = super(account_invoice,self).invoice_validate(cr, uid, ids, context=context)
+
+ if not self._check_from_order(cr, uid, context=context):
+ for order in self.browse(cr,uid,ids, context=context):
+ move_id = self.create_budget_move(cr, uid, ids, context=context)
+ self.write(cr, uid, [order.id], {'budget_move_id' :move_id }, context=context)
+ for line in order.invoice_line:
+ if not line.invoice_id.from_order:
+ created_line_id = self.create_budget_move_line(cr, uid, line.id, context=context)
+ obj_bud_move.write(cr, uid, [move_id], {'origin': order.name , 'fixed_amount':order.amount_total, 'arch_compromised':order.amount_total}, context=context)
+ #cr.commit()
+ obj_bud_move._workflow_signal(cr, uid, [move_id], 'button_execute', context=context)
+ return validate_result
+
+class account_invoice_line(osv.osv):
+ _name = 'account.invoice.line'
+ _inherit = 'account.invoice.line'
+
+ def _check_from_order(self, cr, uid, ids, field_name, args, context=None):
+ result = False
+ res = {}
+ for line in self.browse(cr, uid, ids, context=context):
+ if line.invoice_id:
+ res[line.id] = line.invoice_id.from_order
+ else:
+ res[line.id] = context.get('from_order', False)
+ return res
+
+ def on_change_program_line(self, cr, uid, ids, program_line, context=None):
+ for line in self.pool.get('budget.program.line').browse(cr, uid,[program_line], context=context):
+ return {'value': {'line_available':line.available_budget},}
+ return {'value': {}}
+
+ def on_change_account_id(self, cr, uid, ids, account_id, context=None):
+ if account_id:
+ for account in self.pool.get('account.account').browse(cr, uid,[account_id], context=context):
+ if account.default_budget_program_line.id:
+ return {'value': {'program_line_id':account.default_budget_program_line.id},}
+ return {'value': {}}
+
+ def _subtotal_discounted_taxed(self, cr, uid, ids, field_name, args, context=None):
+ res = {}
+ for line in self.browse(cr, uid, ids, context=context):
+ if line.discount > 0:
+ price_unit_discount = line.price_unit - (line.price_unit * (line.discount / 100) )
+ else:
+ price_unit_discount = line.price_unit
+ #-----taxes---------------#
+ #taxes must be calculated with unit_price - discount
+ amount_discounted_taxed = self.pool.get('account.tax').compute_all(cr, uid, line.invoice_line_tax_id, price_unit_discount, line.quantity, line.product_id.id, line.invoice_id.partner_id)['total_included']
+ res[line.id]= amount_discounted_taxed
+ return res
+
+
+ _columns= {
+ 'program_line_id': fields.many2one('budget.program.line', 'Program line', ),
+ 'invoice_from_order': fields.function(_check_from_order, type='boolean', method=True, string='From order',readonly=True, store=True),
+ 'line_available':fields.float('Line available',digits_compute=dp.get_precision('Account'),readonly=True),
+ 'subtotal_discounted_taxed': fields.function(_subtotal_discounted_taxed, digits_compute= dp.get_precision('Account'), string='Subtotal', ),
+ }
+
+ _defaults = {}
+
+ def write(self, cr, uid, ids, vals, context=None):
+ inv_obj = self.pool.get('account.invoice')
+ result = super(account_invoice_line, self).write(cr, uid, ids, vals, context=context)
+ for line in self.browse(cr, uid, ids, context=context):
+ inv_obj.write(cr, uid, [line.invoice_id.id], {'name':line.invoice_id.name },context=context)
+
=== added file 'budget/account_invoice_view.xml'
--- budget/account_invoice_view.xml 1970-01-01 00:00:00 +0000
+++ budget/account_invoice_view.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="budget_account_invoice_supplier_form" model="ir.ui.view" >
+ <field name="name">budget.account.invoice.supplier.form</field>
+ <field name="model">account.invoice</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="account.invoice_supplier_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <field name="journal_id" position="after" >
+ <field name="budget_move_id" />
+ <field name="from_order" readonly="True" />
+ </field>
+ <xpath expr="/form/sheet/notebook/page[@string='Invoice']/field/tree/field[@name='price_unit']" position="after">
+ <field name="invoice_from_order" invisible="True"/>
+ <field name="program_line_id" domain="[('type','=','budget')]" attrs="{ 'invisible':[('invoice_from_order','=',True),] }"/>
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+ <record id="budget_account_invoice_form" model="ir.ui.view" >
+ <field name="name">budget.account.invoice.form</field>
+ <field name="model">account.invoice</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="account.invoice_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <field name="account_id" position="after" >
+ <field name="budget_move_id" />
+ <field name="from_order" readonly="True" />
+ </field>
+
+ <xpath expr="/form/sheet/notebook/page[@string='Invoice Lines']/field/tree/field[@name='price_unit']" position="after">
+ <field name="invoice_from_order" invisible="True"/>
+ <field name="program_line_id" domain="[('type','=','budget')]" attrs="{ 'required':[('invoice_from_order','=',False)] }"/>
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+
+ <record id="budget_account_invoice_line_form" model="ir.ui.view" >
+ <field name="name">budget.account.invoice.line.form</field>
+ <field name="model">account.invoice.line</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="account.view_invoice_line_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <field name="account_id" position="attributes" >
+ <attribute name="on_change">on_change_account_id(account_id)</attribute>
+ </field>
+
+
+
+ <field name="discount" position="after" >
+ <field name="invoice_from_order" invisible="True"/>
+ <field name="program_line_id" domain="[('type','=','budget')]" on_change="on_change_program_line(program_line_id)" attrs="{ 'required':[('invoice_from_order','=',False),] }"/>
+ <field name="line_available"/>
+ </field>
+ </data>
+ </field>
+ </record>
+ </data>
+</openerp>
\ No newline at end of file
=== added file 'budget/account_move.py'
--- budget/account_move.py 1970-01-01 00:00:00 +0000
+++ budget/account_move.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,109 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from openerp.osv import fields, osv, orm
+
+class accountMove(orm.Model):
+ _inherit = "account.move"
+
+ def post(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
+ invoice = context.get('invoice', False)
+ valid_moves = self.validate(cr, uid, ids, context)
+
+ if not valid_moves:
+ raise osv.except_osv(_('Error!'), _('You cannot validate a non-balanced entry.\nMake sure you have configured payment terms properly.\nThe latest payment term line should be of the "Balance" type.'))
+
+ obj_sequence = self.pool.get('ir.sequence')
+
+ #=============================================================================#
+ check_lines = []
+ next_step = False
+ amount = 0.0
+ percentage = 0.0
+ obj_move_line = self.pool.get('account.move.line')
+
+ #Check if this account.move has distributions lines and check (only in valid_moves -> is a account.move object)
+ for move in self.browse(cr, uid, valid_moves, context=context):
+ move_lines = obj_move_line.search(cr, uid, [('move_id','=',move.id)])
+
+ for line in obj_move_line.browse(cr, uid, move_lines):
+ if line.account_id.moves_cash:
+ check_lines.append(line)
+
+ #Check amount in line.distribution (if there exist any line.id)
+ if len(check_lines) > 0:
+ for line in check_lines:
+ distribution_lines = self.pool.get('account.move.line.distribution').search(cr, uid, [('account_move_line_id', '=', line.id)])
+
+ if len(distribution_lines) > 0:
+ #Sum distribution_amount. This amount is equal to line.amount (debit or credit).
+ for distribution in self.pool.get('account.move.line.distribution').browse(cr, uid, distribution_lines):
+ amount += distribution.distribution_amount
+ percentage += distribution.distribution_percentage
+
+ #Find amount (debit or credit) and compare.
+ if line.debit > 0:
+ amount_check = line.debit
+ else:
+ amount_check = line.credit
+
+ #Continue with normal process
+ if (amount_check == amount) and (percentage == 100):
+ next_step = True
+
+ else:
+ next_step = False
+ return {'value': {'account_move_line_id': line.id},
+ 'warning':{'title':'Warning','message':'Distribution amount for this move line does not match with original amount line'}}
+
+ #Continue with normal process
+ else:
+ next_step = True
+
+ else:
+ next_step = True
+
+ #=============================================================================#
+ if next_step:
+ for move in self.browse(cr, uid, valid_moves, context=context):
+ if move.name =='/':
+ new_name = False
+ journal = move.journal_id
+
+ if invoice and invoice.internal_number:
+ new_name = invoice.internal_number
+ else:
+ if journal.sequence_id:
+ c = {'fiscalyear_id': move.period_id.fiscalyear_id.id}
+ new_name = obj_sequence.next_by_id(cr, uid, journal.sequence_id.id, c)
+ else:
+ raise osv.except_osv(_('Error!'), _('Please define a sequence on the journal.'))
+
+ if new_name:
+ self.write(cr, uid, [move.id], {'name':new_name})
+
+ cr.execute('UPDATE account_move '\
+ 'SET state=%s '\
+ 'WHERE id IN %s',
+ ('posted', tuple(valid_moves),))
+ return True
=== added file 'budget/account_move_line.xml'
--- budget/account_move_line.xml 1970-01-01 00:00:00 +0000
+++ budget/account_move_line.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="account_move_line_inherit" model="ir.ui.view" >
+ <field name="name">account.move.line.inherit</field>
+ <field name="model">account.move.line</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="account.view_move_line_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <page string="Analytic Lines" position="after">
+ <page string="Distribution Budget Lines">
+ <field name="distribution_ids" widget="one2many_list" nolabel="1" colspan="4">
+ <tree colors="blue:type == 'auto';red:type == 'manual'" string="Distribution Budget Lines" editable="bottom" >
+ <field name="target_budget_move_line_id" required="True"/>
+ <field name="distribution_percentage" />
+ <field name="distribution_amount" />
+ <field name="type" readonly="True" required="True" />
+ </tree>
+ </field>
+ </page>
+ </page>
+ </data>
+ </field>
+ </record>
+ </data>
+</openerp>
+
+
\ No newline at end of file
=== added file 'budget/account_view.xml'
--- budget/account_view.xml 1970-01-01 00:00:00 +0000
+++ budget/account_view.xml 2013-11-06 21:08:00 +0000
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="budget_view_account_form" model="ir.ui.view">
+ <field name="name">budget.account.account.form</field>
+ <field name="model">account.account</field>
+ <field name="inherit_id" ref="account.view_account_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <field name="active" position="after">
+ <field name="default_budget_program_line"/>
+ </field>
+ </data>
+ </field>
+ </record>
+
+
+
+ </data>
+</openerp>
\ No newline at end of file
=== added file 'budget/budget.py'
--- budget/budget.py 1970-01-01 00:00:00 +0000
+++ budget/budget.py 2013-11-06 21:08:00 +0000
@@ -0,0 +1,1370 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from operator import itemgetter
+from tools.translate import _
+from datetime import datetime
+from dateutil.relativedelta import relativedelta
+import time
+import logging
+import netsvc
+import decimal_precision as dp
+
+from osv import fields, osv, orm
+
+
+######################################################
+
+
+
+##
+#PLAN
+##
+class budget_plan(osv.osv):
+ _name = 'budget.plan'
+ _description = 'Plan'
+
+ STATE_SELECTION = [
+ ('draft', 'Draft'),
+ ('confirmed', 'Waiting Approval'),
+ ('approved', 'Approved'),
+ ('closed', 'Closed'),
+ ('cancel', 'Cancelled'),
+ ]
+ _columns ={
+ 'name': fields.char('Name', size=64, required=True),
+ 'year_id': fields.many2one('budget.year','Year',required=True),
+ 'state':fields.selection(STATE_SELECTION, 'State', readonly=True,
+ help="The state of the bugdet. A budget that is still under planning is in a 'Draft' state. Then the plan has to be confirmed by the user in order to be approved, the state switch to 'Confirmed'. Then the manager must confirm the budget plan to change the state to 'Approved'. If a plan will not be approved it must be cancelled.", select=True),
+ 'program_ids':fields.one2many('budget.program','plan_id','Programs'),
+ }
+
+ _defaults ={
+ 'state': 'draft'
+ }
+
+ _sql_constraints = [
+ ('name', 'unique(name)','The name must be unique !'),
+ ]
+
+ def action_draft(self, cr, uid, ids, context=None):
+ self.write(cr, uid, ids, {'state': 'draft'})
+ return True
+
+ def check_programs(self, cr, uid, ids, context=None):
+ for plan in self.browse(cr, uid, ids,context=context):
+ if plan.program_ids.__len__() == 0:
+ raise osv.except_osv(_('Error!'), _('At least one program should be asociated to this plan\n'))
+ return True
+
+ def check_no_orphan_accounts(self, cr, uid, ids, context=None):
+ #Verifies that every active budget account is included in the plan
+ for plan_id in ids:
+ res = self.read(cr,uid,[plan_id],['program_ids'],context=context)[0]
+ program_ids = res['program_ids']
+ for program_id in program_ids:
+ query = 'SELECT BA.id, BA.code, BA.name FROM '\
+ 'budget_account BA '\
+ 'WHERE BA.account_type = \'%(account_type)s\' ' \
+ 'AND active = true '\
+ 'EXCEPT '\
+ 'SELECT BA.id, BA.code , BA.name FROM '\
+ 'budget_account BA INNER JOIN budget_program_line BPL ON BA.ID = BPL.account_id '\
+ 'INNER JOIN budget_program BP ON BPL.program_id = BP.id '\
+ 'WHERE BP.id = %(program_id)d' % {'program_id':program_id, 'account_type':'budget'}
+ cr.execute(query)
+ result = cr.fetchall()
+ account_list = ''
+ if result.__len__() > 0:
+ for line in result:
+ account_list = account_list + '%s - %s \n' % (line[1],line[2])
+ program_obj = self.pool.get('budget.program').browse(cr,uid,[program_id],context=context)[0]
+ raise osv.except_osv(_('Error!'), _('The following budget accounts are not listed in this program: \n '+ program_obj.name+ ": " + account_list ))
+ return True
+
+ def check_no_consolidated_orphans(self, cr, uid, ids, context=None):
+ query = 'SELECT code, name FROM budget_account '\
+ 'WHERE id IN( '\
+ 'SELECT id FROM budget_account '\
+ 'WHERE account_type = \'budget\' '\
+ 'EXCEPT '\
+ 'SELECT DISTINCT consol_child_id '\
+ 'FROM budget_account_consol_rel) '
+ cr.execute(query)
+ result = cr.fetchall()
+ account_list = ''
+ if result.__len__() > 0:
+ for line in result:
+ account_list = account_list + '%s - %s \n' % (line[0],line[1])
+ raise osv.except_osv(_('Error!'), _('The following budget accounts are not consolidated children of any consolidation view: \n ' + account_list ))
+ return True
+
+ def action_confirm(self, cr, uid, ids, context=None):
+ if self.check_programs(cr, uid, ids, context=context):
+ self.write(cr, uid, ids, {'state': 'confirmed'})
+ return True
+
+ def action_approve(self, cr, uid, ids, context=None):
+ self.write(cr, uid, ids, {'state': 'approved'})
+ return True
+
+ def action_close(self, cr, uid, ids, context=None):
+ self.write(cr, uid, ids, {'state': 'closed'})
+ return True
+
+ def action_cancel(self, cr, uid, ids, context=None):
+ self.write(cr, uid, ids, {'state': 'cancel'})
+ return True
+
+ def unlink(self, cr, uid, ids, context=None):
+ for plan in self.browse(cr, uid,ids, context=context):
+ if plan.state in ('approved','closed'):
+ raise osv.except_osv(_('Error!'), _('You cannot delete an approved or closed plan'))
+ return super(budget_plan, self).unlink(cr, uid, ids, context=context)
+
+
+
+##
+#Program
+##
+class budget_program(osv.osv):
+ _name = 'budget.program'
+ _description = 'Program'
+
+ _columns ={
+ 'code': fields.char('Code', size=64),
+ 'name': fields.char('Name', size=64, required=True),
+ 'plan_id': fields.many2one('budget.plan', 'Budget plan', required=True),
+ 'program_lines':fields.one2many('budget.program.line','program_id','Lines'),
+ 'previous_program_id': fields.many2one('budget.program', 'Previous program'),
+ 'state':fields.related('plan_id','state', type='char', relation='budget.plan',readonly=True ),
+ }
+
+ _sql_constraints = [
+ ('name', 'unique(name,plan_id)','The name must be unique for this budget!'),
+ ]
+
+# def bulk_line_create(self, cr, uid, ids, context=None):
+# line_obj = self.pool.get('budget.program.line')
+# account_obj = self.pool.get('budget.account')
+# for program in self.browse(cr, uid, ids, context=context):
+# current_lines = len(program.program_lines)
+# if current_lines > 0:
+# raise osv.except_osv(_('Error!'), _('This program already contains program lines'))
+# account_ids= account_obj.search(cr,uid,[('active','=','true'),('account_type','=','budget')])
+# for account in account_obj.browse(cr,uid,account_ids):
+## line_name = '[' + account.composite_code + ']-' + account.name
+# line_name = '[' + account.code + ']-' + account.name
+# line_account_id = account.id
+# line_program_id = program.id
+# line_obj.create(cr,uid,{
+# 'name':line_name,
+# 'account_id':line_account_id,
+# 'program_id':line_program_id,
+# })
+# return True
+ def make_composite_name(self,cr,uid,str):
+ lst = []
+ composite_name = ""
+ space_pos = str.find(' ')
+ if space_pos != -1:
+ lst.append(str[0:space_pos])
+ lst.append(str[space_pos+1:len(str)-1])
+ else:
+ lst.append(str[0:len(str)-1])
+ for word in lst:
+ if len(word)>=3:
+ composite_name = composite_name + word[0:3] +'-'
+ else:
+ composite_name = composite_name + word +'-'
+ return composite_name[0:-1]
+
+
+ def create(self, cr, uid, vals, context={}):
+ plan_obj = self.pool.get('budget.plan')
+ plan = plan_obj.browse(cr, uid, [vals['plan_id']],context=context)[0]
+
+ code = plan.year_id.code + '-' + self.make_composite_name(cr,uid,vals['name'])
+ vals['code'] = code
+ res = super(budget_program, self).create(cr, uid, vals, context)
+ return res
+
+
+
+######################################################
+
+##
+#program LINE
+##
+class budget_program_line(osv.osv):
+ _name = 'budget.program.line'
+ _description = 'Program line'
+ _order = "parent_left"
+ _parent_order = "name"
+ _parent_store = True
+
+ def _get_children_and_consol(self, cr, uid, ids, context=None):
+ #this function search for all the children and all consolidated children (recursively) of the given line ids
+ if ids:
+ ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)
+ else:
+ ids2 = []
+ ids3 = []
+ for rec in self.browse(cr, uid, ids2, context=context):
+ for child in rec.child_consol_ids:
+ ids3.append(child.id)
+ if ids3:
+ ids3 = self._get_children_and_consol(cr, uid, ids3, context)
+ return ids2 + ids3
+
+# def get_assigned(self, cr, uid, ids, field_name, args, context=None):
+# test = {}
+# for line in self.browse(cr, uid, ids,context=context):
+# children_and_consolidated = self._get_children_and_consol(cr, uid,[line.id],context=context)
+# request = ("SELECT SUM(assigned_amount) " +\
+# " FROM budget_program_line l" \
+# " WHERE l.id IN %s ")
+# params = (tuple(children_and_consolidated),)
+# cr.execute(request, params)
+# result = cr.fetchall()
+#
+# if len(result) > 0:
+# for row in result:
+# test[line.id]=row[0]
+# return test
+
+
+ def add_unique(self,list_to_add, list):
+ for item in list_to_add:
+ if item not in list:
+ list += [item]
+ return list
+
+ def __compute(self, cr, uid, ids, field_names, args, context=None):
+
+ field_names = self.add_unique(['total_assigned','executed_amount','reserved_amount','modified_amount','extended_amount','compromised_amount'],field_names)
+ children_and_consolidated = self._get_children_and_consol(cr, uid, ids, context=context)
+ prg_lines = {}
+ res = {}
+ null_result = dict((fn, 0.0) for fn in field_names)
+ if children_and_consolidated:
+
+ mapping={
+ 'total_assigned':'COALESCE(MAX(BPL.assigned_amount),0.0) AS total_assigned',
+ 'executed':'COALESCE(SUM(BML.executed),0.0) AS executed_amount',
+ 'reserved':'COALESCE(SUM(BML.reserved),0.0) AS reserved_amount',
+ 'modified':'COALESCE(SUM(BML.modified),0.0) AS modified_amount',
+ 'extended':'COALESCE(SUM(BML.extended),0.0) AS extended_amount',
+ 'compromised':'COALESCE(SUM(BML.compromised),0.0) AS compromised_amount',
+ }
+ request = ('SELECT BPL.id, ' +\
+ ', '.join(mapping.values()) +
+ ' FROM budget_program_line BPL'\
+ ' LEFT OUTER JOIN budget_move_line BML ON BPL.id = BML.program_line_id'\
+ ' WHERE BPL.id IN %s'\
+ ' GROUP BY BPL.id')
+# params = (tuple(ids),)
+ params = (tuple(children_and_consolidated),)
+ cr.execute(request, params)
+ for row in cr.dictfetchall():
+ prg_lines[row['id']] = row
+
+ children_and_consolidated.reverse()
+ brs = list(self.browse(cr, uid, children_and_consolidated, context=context))
+ sums = {}
+ currency_obj = self.pool.get('res.currency')
+ while brs:
+ current = brs.pop(0)
+
+ for fn in field_names:
+ sums.setdefault(current.id, {})[fn] = prg_lines.get(current.id, {}).get(fn, 0.0)
+ for child in current.child_id:
+ if child.company_id.currency_id.id == current.company_id.currency_id.id:
+ sums[current.id][fn] += sums[child.id][fn]
+ # Thera are 2 types of available:
+ # 1-) available budget = assigned - opening + modifications + extensions - compromised - reserved - executed.
+ # 2-) available cash = assigned - opening + modifications + extensions - executed
+
+ if 'available_cash' in field_names or 'available_budget' in field_names or'execution_percentage' in field_names:
+ available_budget = sums[current.id].get('total_assigned', 0.0) + sums[current.id].get('modified_amount', 0.0) + sums[current.id].get('extended_amount', 0.0) - sums[current.id].get('compromised_amount', 0.0) - sums[current.id].get('reserved_amount', 0.0) - sums[current.id].get('executed_amount', 0.0)
+ available_cash = sums[current.id].get('total_assigned', 0.0) + sums[current.id].get('modified_amount', 0.0) + sums[current.id].get('extended_amount', 0.0) - sums[current.id].get('executed_amount', 0.0)
+
+ grand_total = (sums[current.id].get('total_assigned', 0.0) + sums[current.id].get('modified_amount', 0.0) + sums[current.id].get('extended_amount', 0.0))
+ exc_perc = grand_total != 0.0 and ((sums[current.id].get('executed_amount', 0.0)*100) /grand_total) or 0.0
+ sums[current.id].update({'available_cash': available_cash, 'available_budget': available_budget, 'execution_p