← Back to team overview

avanzosc team mailing list archive

[Merge] lp:avanzosc/addons-6.1 into lp:avanzosc

 

Ainara has proposed merging lp:avanzosc/addons-6.1 into lp:avanzosc.

Requested reviews:
  Avanzosc Developers (avanzosc)

For more details, see:
https://code.launchpad.net/~avanzosc/avanzosc/addons-6.1/+merge/146075

Prueba de merge proposal
-- 
The attached diff has been truncated due to its size.
https://code.launchpad.net/~avanzosc/avanzosc/addons-6.1/+merge/146075
Your team Avanzosc Developers is requested to review the proposed merge of lp:avanzosc/addons-6.1 into lp:avanzosc.
=== added file '.directory'
--- .directory	1970-01-01 00:00:00 +0000
+++ .directory	2013-02-01 09:33:03 +0000
@@ -0,0 +1,2 @@
+[Dolphin]
+Timestamp=2012,11,15,17,19,22

=== added directory 'account_invoicing'
=== added file 'account_invoicing/__init__.py'
--- account_invoicing/__init__.py	1970-01-01 00:00:00 +0000
+++ account_invoicing/__init__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,31 @@
+##############################################################################
+#
+# Copyright (c) 2008-2009 SIA "KN dati". (http://kndati.lv) All Rights Reserved.
+#                    General contacts <info@xxxxxxxxx>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+##############################################################################
+
+import invoicing
+import inv_added_fields
+import wizard

=== added file 'account_invoicing/__openerp__.py'
--- account_invoicing/__openerp__.py	1970-01-01 00:00:00 +0000
+++ account_invoicing/__openerp__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,28 @@
+{
+    "name" : "Invoicing / Billing",
+    "version" : "1.0",
+    "author" : "KN dati, SIA, Avanzosc",
+    "description" : """Complete universal addon for issuing bills on any type of TinyERP/OpenERP data objects (models). Setup agreements for automatic customer billing on scheduld intervals.
+    Features:
+    * user frienly yet powerfull;
+    * fully automatic creation of analytic journal entries for further invoicing;
+    * definition of various methodologies - business logic;
+    * choose code constructor (Python) for fast deployment or manual expressions for advanced business logic or combine both of them;
+    * unlimited count of methodologies per virtual service;
+    
+    Suitable for billing (non exaustive list):
+    * Hosting (e-mail, web-hosting etc.);
+    * Utilities;
+    * Telecom;
+    * Service;
+    """,
+    "website" : "http://kndati.lv";,
+    "license" : "GPL-2",
+    "category" : "Generic Modules/Accounting",
+    "depends" : ["base", "product", "account", "hr", "hr_timesheet_invoice"],
+    "init_xml" : [],
+    "demo_xml" : [],
+    "update_xml" : ["invoicing.xml", "invoicing_menu.xml", "data/invoicing_data.xml", "inv_wizard.xml", "security/ir.model.access.csv"],
+    "active":False,
+    "installable":True,
+}

=== added directory 'account_invoicing/data'
=== added file 'account_invoicing/data/invoicing_data.xml'
--- account_invoicing/data/invoicing_data.xml	1970-01-01 00:00:00 +0000
+++ account_invoicing/data/invoicing_data.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,219 @@
+<?xml version="1.0"?>
+<openerp>
+<data noupdate="1">
+
+	<!--
+	Sequences types for agreement
+	-->
+	<record model="ir.sequence.type" id="seq_type_agreement">
+		<field name="name">Agreement Sequence</field>
+		<field name="code">agreement.invoice.sequence</field>
+	</record>
+	
+	<!--
+	Sequences for agreement
+	-->
+	<record model="ir.sequence" id="seq_agreement">
+		<field name="name">Agreement Sequence</field>
+		<field name="code">agreement.invoice.sequence</field>
+		<field name="padding" eval="3"/>
+		<field name="prefix">AG-%(year)s-N</field>
+	</record>
+
+	<record model="inv.rec_type" id="inv_rec_type_int_betw" >
+		<field name="type">[integer]</field>
+		<field name="value">between</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_int_nbetw" >
+		<field name="type">[integer]</field>
+		<field name="value">not between</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_int_eq" >
+		<field name="type">[integer]</field>
+		<field name="value">equal to</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_int_nq" >
+		<field name="type">[integer]</field>
+		<field name="value">not equal to</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_int_gt" >
+		<field name="type">[integer]</field>
+		<field name="value">greater than</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_int_ls" >
+		<field name="type">[integer]</field>
+		<field name="value">less than</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_int_gteq" >
+		<field name="type">[integer]</field>
+		<field name="value">greater than or equal to</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_int_lseq" >
+		<field name="type">[integer]</field>
+		<field name="value">less than or equal to</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_ch_eq" >
+		<field name="type">[char]</field>
+		<field name="value">equal to</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_ch_nq" >
+		<field name="type">[char]</field>
+		<field name="value">not equal to</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_ch_regexp" >
+		<field name="type">[char]</field>
+		<field name="value">regexp</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_select_eq" >
+		<field name="type">[selection]</field>
+		<field name="value">equal to</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_select_nq" >
+		<field name="type">[selection]</field>
+		<field name="value">not equal to</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_many2many_in" >
+		<field name="type">[many2many]</field>
+		<field name="value">in</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_many2many_notin" >
+		<field name="type">[many2many]</field>
+		<field name="value">not in</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_one2many_in" >
+		<field name="type">[one2many]</field>
+		<field name="value">in</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_one2many_notin" >
+		<field name="type">[one2many]</field>
+		<field name="value">not in</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_many2one_in" >
+		<field name="type">[many2one]</field>
+		<field name="value">in</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_many2one_notin" >
+		<field name="type">[many2one]</field>
+		<field name="value">not in</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_float_betw" >
+		<field name="type">[float]</field>
+		<field name="value">between</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_float_nbetw" >
+		<field name="type">[float]</field>
+		<field name="value">not between</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_float_eq" >
+		<field name="type">[float]</field>
+		<field name="value">equal to</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_float_nq" >
+		<field name="type">[float]</field>
+		<field name="value">not equal to</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_float_gt" >
+		<field name="type">[float]</field>
+		<field name="value">greater than</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_float_ls" >
+		<field name="type">[float]</field>
+		<field name="value">less than</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_float_gteq" >
+		<field name="type">[float]</field>
+		<field name="value">greater than or equal to</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_float_lseq" >
+		<field name="type">[float]</field>
+		<field name="value">less than or equal to</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_date_betw" >
+		<field name="type">[date]</field>
+		<field name="value">between</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_date_nbetw" >
+		<field name="type">[date]</field>
+		<field name="value">not between</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_date_eq" >
+		<field name="type">[date]</field>
+		<field name="value">equal to</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_date_nq" >
+		<field name="type">[date]</field>
+		<field name="value">not equal to</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_date_gt" >
+		<field name="type">[date]</field>
+		<field name="value">greater than</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_date_ls" >
+		<field name="type">[date]</field>
+		<field name="value">less than</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_date_gteq" >
+		<field name="type">[date]</field>
+		<field name="value">greater than or equal to</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_date_lseq" >
+		<field name="type">[date]</field>
+		<field name="value">less than or equal to</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_datetime_betw" >
+		<field name="type">[datetime]</field>
+		<field name="value">between</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_datetime_nbetw" >
+		<field name="type">[datetime]</field>
+		<field name="value">not between</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_datetime_eq" >
+		<field name="type">[datetime]</field>
+		<field name="value">equal to</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_datetime_nq" >
+		<field name="type">[datetime]</field>
+		<field name="value">not equal to</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_datetime_gt" >
+		<field name="type">[datetime]</field>
+		<field name="value">greater than</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_datetime_ls" >
+		<field name="type">[datetime]</field>
+		<field name="value">less than</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_datetime_gteq" >
+		<field name="type">[datetime]</field>
+		<field name="value">greater than or equal to</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_datetime_lseq" >
+		<field name="type">[datetime]</field>
+		<field name="value">less than or equal to</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_bl_eq" >
+		<field name="type">[boolean]</field>
+		<field name="value">equal to</field>
+	</record>
+	<record model="inv.rec_type" id="inv_rec_type_bl_nq" >
+		<field name="type">[boolean]</field>
+		<field name="value">not equal to</field>
+	</record>
+
+	<record model="ir.cron" id="it_cron_prolong_check">
+		<field name="name">Prolong Check for Agreements</field>
+		<field name="interval_number">1</field>
+		<field name="priority">10</field>
+		<field name="interval_type">days</field>
+		<field name="numbercall">-1</field>
+		<field name="doall" eval="False"/>
+		<field name="model" eval="'inv.agreement'"/>
+		<field name="function" eval="'_prolong_optimized'"/>
+		<field name="args" eval="'()'"/>
+	</record>
+
+
+</data>
+</openerp>
+

=== added directory 'account_invoicing/i18n'
=== added file 'account_invoicing/i18n/account_invoicing.pot'
--- account_invoicing/i18n/account_invoicing.pot	1970-01-01 00:00:00 +0000
+++ account_invoicing/i18n/account_invoicing.pot	2013-02-01 09:33:03 +0000
@@ -0,0 +1,1155 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* account_invoicing
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 5.0.9\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2010-05-25 10:51:44+0000\n"
+"PO-Revision-Date: 2010-05-25 10:51:44+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_invoicing
+#: model:ir.actions.act_window,name:account_invoicing.act_uninvoiced_analytics
+msgid "Uninvoiced Analytic Entries"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.agreement,service:0
+#: selection:inv.calc,product_type:0
+#: view:inv.service:0
+#: model:ir.actions.act_window,name:account_invoicing.inv_config_service_form
+#: model:ir.ui.menu,name:account_invoicing.service
+msgid "Service"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.agreement,number:0
+msgid "Agreement Number"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Stop"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.agreement,prolong:0
+msgid "Prolong"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value1_int:0
+msgid "Integer1"
+msgstr ""
+
+#. module: account_invoicing
+#: constraint:ir.actions.act_window:0
+msgid "Invalid model name in the action definition."
+msgstr ""
+
+#. module: account_invoicing
+#: help:inv.agreement,recurr_unit_number:0
+msgid "Time before current validity expires to prolong the agreement for the next term."
+msgstr ""
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "This Agreement is not operable, some \"Invoice Log\" entries are in \"Error\" state. Please check \"Invoice Log\" tab."
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.agreement,recurr_unit_number:0
+msgid "Number of Units"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.service,cron_offset:0
+msgid "Cron offset(hours)"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "res_list - List of calculation results"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.service,journal_id:0
+msgid "Analytic Journal"
+msgstr ""
+
+#. module: account_invoicing
+#: model:ir.module.module,shortdesc:account_invoicing.module_meta_information
+msgid "Invoicing / Billing"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Set to Draft"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "obj_ids - list of the filtred records (identifiers)"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.calc,description:0
+msgid "Calculation Date"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.agreement,cron_id:0
+msgid "Scheduler"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.agreement,analytic_entries:0
+#: field:inv.date_list,analytic_entries:0
+msgid "Entries"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "count - number of filtred records"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc_filter:0
+msgid "Calc filter"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "agr_id - current Agreement ID field value"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.calc,quantity:0
+msgid "Total Count"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.agreement,repeat:0
+msgid "Repeat missed"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.service,analytic_account_branch:0
+msgid "Analytic account branch"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.method:0
+msgid "contact_ids - contacts IDs of current partner in Methodology"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.rec_type,value:0
+msgid "Value"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.calc_filter,var:0
+#: field:inv.rec_filter,var:0
+msgid "Variable"
+msgstr ""
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Error!"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.agreement,prolong:0
+msgid "Fixed Term"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.rec_filter_cond:0
+msgid "Record filter condition"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "re - object for regural expressions (have attribute match)"
+msgstr ""
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_service
+msgid "inv.service"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "desc - variable which will be used as a expression result"
+msgstr ""
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_calc_filter
+msgid "inv.calc_filter"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.method:0
+msgid "Test source"
+msgstr ""
+
+#. module: account_invoicing
+#: model:ir.ui.menu,name:account_invoicing.inv_config
+msgid "Configuration"
+msgstr ""
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_rec_type
+msgid "inv.rec_type"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: field:inv.calc_filter,calc_id:0
+#: field:inv.method,calc_ids:0
+msgid "Calculation"
+msgstr ""
+
+#. module: account_invoicing
+#: wizard_view:inv.agreement.wizard,init:0
+msgid "Run agreement(s)"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.date_list,status:0
+msgid "Partially Invoiced"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.agreement,analytic_account:0
+msgid "Analytic Account"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.calc_filter,state:0
+#: selection:inv.rec_filter,state:0
+msgid "Defined"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.agreement,recurr_unit:0
+#: selection:inv.service,interval_unit:0
+msgid "Month(s)"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.service,invoicing:0
+msgid "Trigger"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Technical info:"
+msgstr ""
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Warning!"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.agreement,partner_id:0
+#: selection:inv.method,ref:0
+msgid "Partner"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value1_date:0
+msgid "Date1"
+msgstr ""
+
+#. module: account_invoicing
+#: help:inv.agreement,signed_date:0
+msgid "Date when agreement was signed."
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value2_date:0
+msgid "Date2"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.service,int_unit_number:0
+msgid "Invoice Every"
+msgstr ""
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_method
+msgid "inv.method"
+msgstr ""
+
+#. module: account_invoicing
+#: model:ir.actions.act_window,name:account_invoicing.act_all_analytics
+msgid "All Analytic Entries"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.calc_filter,temp_var:0
+#: field:inv.rec_filter,temp_var:0
+msgid "Temp Variable"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.method,source:0
+msgid "Source"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,name:0
+msgid "Filter coditions"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,cond_type:0
+msgid "Condition type"
+msgstr ""
+
+#. module: account_invoicing
+#: model:ir.actions.act_window,name:account_invoicing.act_agreements
+#: model:ir.actions.act_window,name:account_invoicing.act_all_agreements
+msgid "Agreements"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "self - objects pointer"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.calc_filter,field_type:0
+#: field:inv.rec_filter,field_type:0
+msgid "Ttype"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.service,pricelist_id:0
+msgid "Sale Pricelist"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.rec_type,type:0
+msgid "Type"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.agreement,payment:0
+msgid "In advance"
+msgstr ""
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "\"Number of Units\" field cannot be less than 1 !"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.service,purch_pricelist_id:0
+msgid "Purchase Pricelist"
+msgstr ""
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Code it is impossible tested, because there is not an agreement!"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.calc_filter,temp_field_id:0
+#: field:inv.rec_filter,temp_field_id:0
+msgid "Temp Field"
+msgstr ""
+
+#. module: account_invoicing
+#: field:account.analytic.line,agr_id:0
+#: view:inv.agreement:0
+#: field:inv.date_list,agreement_id:0
+#: model:ir.actions.act_window,name:account_invoicing.inv_agreement_form
+#: model:ir.ui.menu,name:account_invoicing.agreement
+msgid "Agreement"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.method,calc_base:0
+msgid "Calculation base"
+msgstr ""
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Field \"Value of\" not defined !"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.agreement,recurr_unit:0
+#: field:inv.service,interval_unit:0
+msgid "Interval Unit"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "d_list - Invoice Log object"
+msgstr ""
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Invalid action !"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.agreement,state:0
+msgid "Done"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.calc,product_type:0
+msgid "Consumable"
+msgstr ""
+
+#. module: account_invoicing
+#: wizard_view:inv.agreement.wizard,init:0
+msgid "Do you want set to process selected agreement(s) ?"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "Advanced"
+msgstr ""
+
+#. module: account_invoicing
+#: constraint:ir.cron:0
+msgid "Invalid arguments"
+msgstr ""
+
+#. module: account_invoicing
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "quant - variable which will be used as a expression result"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.calc_filter,state:0
+#: selection:inv.rec_filter,state:0
+msgid "Undefined"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "model - current model name in Methodology"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Manage Prolongation:"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.calc,manual:0
+#: field:inv.method,manual:0
+msgid "Manual"
+msgstr ""
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_agreement
+msgid "inv.agreement"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.method,ref:0
+msgid "Contact"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.service:0
+#: field:inv.service,req_users:0
+msgid "Work Team"
+msgstr ""
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Cannot delete agreement(s) which are already running !"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "pdate1 - period date from"
+msgstr ""
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_date_list
+msgid "inv.date_list"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.agreement,state:0
+#: field:inv.calc_filter,state:0
+#: field:inv.date_list,state:0
+#: field:inv.date_list,status:0
+#: field:inv.method,state:0
+#: field:inv.rec_filter,state:0
+#: field:inv.rec_filter_cond,state:0
+msgid "State"
+msgstr ""
+
+#. module: account_invoicing
+#: model:ir.actions.act_window,name:account_invoicing.act_all_invoices
+msgid "Invoices"
+msgstr ""
+
+#. module: account_invoicing
+#: help:inv.agreement,init_effect_date:0
+msgid "Date of initial validity of the agreement."
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.agreement,cron_prolong:0
+msgid "Cron prolong"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value1_char:0
+msgid "Char"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.agreement,recurr_unit:0
+#: selection:inv.service,interval_unit:0
+msgid "Week(s)"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.date_list,status:0
+msgid "Ready to be invoiced"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "mas_after - List of id's of record after filtration"
+msgstr ""
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Input data error!"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.date_list,status:0
+msgid "Invoiced"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value2_int:0
+msgid "Integer2"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.method:0
+msgid "mas_aft - list for the ID of the filtered records"
+msgstr ""
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_calc
+msgid "inv.calc"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.cond_value:0
+#: view:inv.rec_filter_cond:0
+#: field:inv.rec_filter_cond,cond_value:0
+msgid "Condition value"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "agre - current Agreement objects record"
+msgstr ""
+
+#. module: account_invoicing
+#: wizard_button:inv.agreement.wizard,init,end:0
+msgid "No"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.rec_type:0
+msgid "Record types"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.agreement,state:0
+msgid "Draft"
+msgstr ""
+
+#. module: account_invoicing
+#: help:inv.agreement,prolong:0
+msgid "Sets whether to prolong the agreement for the next term or not."
+msgstr ""
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Cannot set Waiting while field \"Analitic Entries\" not empty !"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.calc,model_id:0
+#: field:inv.method,model_id:0
+msgid "Model"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.calc,description:0
+#: selection:inv.date_list,state:0
+msgid "Empty"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "rec_id - Id of current record after filtration"
+msgstr ""
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_rec_filter_cond
+msgid "inv.rec_filter_cond"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "Available global variables:"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.date_list,state:0
+#: selection:inv.date_list,status:0
+msgid "Processing"
+msgstr ""
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "No field value!"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.agreement,active:0
+msgid "Active"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.method:0
+msgid "Create"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.calc_filter,condition_id:0
+#: field:inv.rec_filter,condition_id:0
+msgid "Condition"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.calc_filter,temp_var:0
+#: selection:inv.calc_filter,var:0
+#: selection:inv.method,calc_base:0
+#: selection:inv.rec_filter,temp_var:0
+#: selection:inv.rec_filter,var:0
+msgid "Count"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "calc_id - current Calculation ID field value"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.agreement,prolong:0
+msgid "Prolongation"
+msgstr ""
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_rec_filter
+msgid "inv.rec_filter"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.date_list,pdate2:0
+msgid "Period Date2"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.date_list,pdate1:0
+msgid "Period Date1"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,calc_filter_id:0
+#: field:inv.rec_filter_cond,rec_filter_id:0
+msgid "Filter"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.date_list,date:0
+msgid "Date"
+msgstr ""
+
+#. module: account_invoicing
+#: model:ir.module.module,description:account_invoicing.module_meta_information
+msgid "Complete universal addon for issuing bills on any type of TinyERP/OpenERP data objects (models). Setup agreements for automatic customer billing on scheduld intervals.\n"
+"    Features:\n"
+"    * user frienly yet powerfull;\n"
+"    * fully automatic creation of analytic journal entries for further invoicing;\n"
+"    * definition of various methodologies - business logic;\n"
+"    * choose code constructor (Python) for fast deployment or manual expressions for advanced business logic or combine both of them;\n"
+"    * unlimited count of methodologies per virtual service;\n"
+"    \n"
+"    Suitable for billing (non exaustive list):\n"
+"    * Hosting (e-mail, web-hosting etc.);\n"
+"    * Utilities;\n"
+"    * Telecom;\n"
+"    * Service;\n"
+"    "
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Manage State:"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "pdate2 - period date to"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.agreement,state:0
+#: selection:inv.date_list,status:0
+msgid "Error"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.method:0
+msgid "partner_id - current partner ID in Methodology"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: field:inv.calc,descr_express:0
+#: selection:inv.calc,description:0
+#: selection:inv.calc,quantity:0
+#: field:inv.calc,quantity_express:0
+msgid "Expression"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.calc,product_type:0
+msgid "Stockable Product"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "Quantity"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.agreement,uninv_entries_count:0
+msgid "Uninvoiced analytic entries"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.calc,code:0
+#: field:inv.rec_filter_cond,code:0
+msgid "Code"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Process"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.calc,descr_field:0
+#: field:inv.calc,quantity_field:0
+msgid "Value of"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.date_list,period:0
+#: selection:inv.service,invoicing:0
+msgid "Period"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "General"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.date_list,state:0
+msgid "Filled"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.agreement,prolong:0
+msgid "Unlimited Term"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.agreement,cur_effect_date:0
+msgid "Current Validity Date"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.calc,product_type:0
+msgid "Product Type"
+msgstr ""
+
+#. module: account_invoicing
+#: help:inv.agreement,cur_effect_date:0
+msgid "Resembles the current validity period."
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "calc_date - calculation date"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.method,state:0
+msgid "Close"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.calc,quantity:0
+msgid "Set quantity"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.method,state:0
+msgid "Open"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value1_float:0
+msgid "Float1"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value2_float:0
+msgid "Float2"
+msgstr ""
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Information"
+msgstr ""
+
+#. module: account_invoicing
+#: constraint:ir.model:0
+msgid "The Object name must start with x_ and not contain any special character !"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "cr - database cursor"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.agreement,init_effect_date:0
+msgid "Initial Validity Date"
+msgstr ""
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Agreement not possible running !"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.calc,description:0
+#: selection:inv.calc,quantity:0
+#: field:inv.calc_filter,field_id:0
+#: selection:inv.calc_filter,temp_var:0
+#: selection:inv.calc_filter,var:0
+#: selection:inv.method,calc_base:0
+#: field:inv.method,partner_field:0
+#: field:inv.method,ref:0
+#: field:inv.rec_filter,field_id:0
+#: selection:inv.rec_filter,temp_var:0
+#: selection:inv.rec_filter,var:0
+msgid "Field"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.calc,method_id:0
+#: field:inv.calc_filter,method_id:0
+#: view:inv.method:0
+#: field:inv.rec_filter,method_id:0
+#: model:ir.actions.act_window,name:account_invoicing.inv_config_method_form
+#: model:ir.ui.menu,name:account_invoicing.methodology
+msgid "Methodology"
+msgstr ""
+
+#. module: account_invoicing
+#: model:ir.actions.wizard,name:account_invoicing.inv_agr_run
+msgid "Run agreement"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.agreement,signed_date:0
+msgid "Signed on"
+msgstr ""
+
+#. module: account_invoicing
+#: help:inv.agreement,uninv_entries_count:0
+msgid "Number of uninvoiced analytic entries."
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.agreement,recurr_unit:0
+#: selection:inv.service,interval_unit:0
+msgid "Day(s)"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.agreement,calls:0
+msgid "Number of invoices"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "Constructor:"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "meth_id - current Methodology ID field value"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.agreement,name:0
+#: view:inv.calc:0
+msgid "Description"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.agreement,payment:0
+msgid "After"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.date_list:0
+msgid "-"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Validity"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.agreement,state:0
+msgid "Running"
+msgstr ""
+
+#. module: account_invoicing
+#: help:inv.agreement,number:0
+msgid "Leave empty to get the number assigned by a sequence."
+msgstr ""
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "\"Invoice Every\" field cannot be less than 1!"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.date_list,status:0
+msgid "Waiting"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.agreement,payment:0
+msgid "Payment"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.date_list:0
+msgid "From:"
+msgstr ""
+
+#. module: account_invoicing
+#: help:inv.agreement,calls:0
+msgid "Number of invoices to be written."
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.calc,description:0
+msgid "Set description"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.rec_filter:0
+msgid "Record filter"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.service:0
+#: field:inv.service,method_ids:0
+msgid "Methodologies"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.method,name:0
+#: field:inv.service,name:0
+msgid "Name"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.calc,product_id:0
+msgid "Product"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.method:0
+msgid "invoice_date - next invoice date"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.date_list:0
+msgid "Renew"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.calc,calculations:0
+msgid "Calculation lines"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.agreement,recurr_unit:0
+#: selection:inv.service,interval_unit:0
+msgid "Year(s)"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.calc,sequence:0
+msgid "Calculation Sequence"
+msgstr ""
+
+#. module: account_invoicing
+#: field:account.analytic.line,invlog_id:0
+#: view:inv.agreement:0
+#: field:inv.agreement,date_list:0
+#: view:inv.date_list:0
+msgid "Invoice Log"
+msgstr ""
+
+#. module: account_invoicing
+#: wizard_button:inv.agreement.wizard,init,start:0
+msgid "Yes"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.calc,invoicing_id:0
+#: model:ir.ui.menu,name:account_invoicing.inv_main_menu
+msgid "Invoicing"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.agreement,cron_nextdate:0
+msgid "Set next date"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.service,invoicing:0
+msgid "Invoicing based on"
+msgstr ""
+
+#. module: account_invoicing
+#: help:inv.agreement,analytic_account:0
+msgid "Leave empty to let the system create an account in a branch defined by the Service."
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value1_datetime:0
+msgid "DateTime1"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value2_datetime:0
+msgid "DateTime2"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.calc,quantity:0
+msgid "One"
+msgstr ""
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Cannot renew while Agreement not in Draft !"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value1_bool:0
+msgid "Boolean"
+msgstr ""
+
+#. module: account_invoicing
+#: selection:inv.calc,description:0
+msgid "Calculation Period"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "uid - current user ID"
+msgstr ""
+
+#. module: account_invoicing
+#: field:inv.calc_filter,filters:0
+#: field:inv.method,rec_filter_ids:0
+#: field:inv.rec_filter,filters:0
+msgid "Filters"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Analytic Entries"
+msgstr ""
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Get number"
+msgstr ""
+

=== added file 'account_invoicing/i18n/ca_ES.po'
--- account_invoicing/i18n/ca_ES.po	1970-01-01 00:00:00 +0000
+++ account_invoicing/i18n/ca_ES.po	2013-02-01 09:33:03 +0000
@@ -0,0 +1,1169 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# 	* account_invoicing
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 5.0.3\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2010-05-07 11:36:24+0000\n"
+"PO-Revision-Date: 2010-05-07 18:45+0100\n"
+"Last-Translator: Jordi Esteve (Zikzakmedia) <jesteve@xxxxxxxxxxxxxxx>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+
+#. module: account_invoicing
+#: model:ir.actions.act_window,name:account_invoicing.act_uninvoiced_analytics
+msgid "Uninvoiced Analytic Entries"
+msgstr "Entrades analítiques sense facturar"
+
+#. module: account_invoicing
+#: field:inv.agreement,service:0
+#: selection:inv.calc,product_type:0
+#: view:inv.service:0
+#: model:ir.actions.act_window,name:account_invoicing.inv_config_service_form
+#: model:ir.ui.menu,name:account_invoicing.service
+msgid "Service"
+msgstr "Servei"
+
+#. module: account_invoicing
+#: field:inv.agreement,number:0
+msgid "Agreement Number"
+msgstr "Número de contracte"
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Stop"
+msgstr "Atura"
+
+#. module: account_invoicing
+#: selection:inv.agreement,prolong:0
+msgid "Prolong"
+msgstr "Prolongació"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value1_int:0
+msgid "Integer1"
+msgstr "Enter1"
+
+#. module: account_invoicing
+#: constraint:ir.actions.act_window:0
+msgid "Invalid model name in the action definition."
+msgstr "Nom de model no vàlid en la definició de l'acció."
+
+#. module: account_invoicing
+#: help:inv.agreement,recurr_unit_number:0
+msgid "Time before current validity expires to prolong the agreement for the next term."
+msgstr "Temps abans de que expiri la validesa actual per a prolongar el contracte per el pròxim període."
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "This Agreement is not operable, some \"Invoice Log\" entries are in \"Error\" state. Please check \"Invoice Log\" tab."
+msgstr "Aquest contracte no està operatiu, algunes entrades del \"Registre de factures\" estan en estat \"Error\". Si us plau comproveu la pestanya \"Registre de factures\"."
+
+#. module: account_invoicing
+#: field:inv.agreement,recurr_unit_number:0
+msgid "Number of Units"
+msgstr "Nombre d'unitats"
+
+#. module: account_invoicing
+#: field:inv.service,cron_offset:0
+msgid "Cron offset(hours)"
+msgstr "Desfase planificador o cron (hores)"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "res_list - List of calculation results"
+msgstr "res_list - Llista dels resultats del càlcul"
+
+#. module: account_invoicing
+#: field:inv.service,journal_id:0
+msgid "Analytic Journal"
+msgstr "Diari analític"
+
+#. module: account_invoicing
+#: model:ir.module.module,shortdesc:account_invoicing.module_meta_information
+msgid "Invoicing / Billing"
+msgstr "Facturació / Emissió de factures automàtiques"
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Set to Draft"
+msgstr "Canvia a esborrany"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "obj_ids - list of the filtred records (identifiers)"
+msgstr "obj_ids - Llista dels registres filtrats (identificadors)"
+
+#. module: account_invoicing
+#: selection:inv.calc,description:0
+msgid "Calculation Date"
+msgstr "Càlcul de data"
+
+#. module: account_invoicing
+#: field:inv.agreement,cron_id:0
+msgid "Scheduler"
+msgstr "Planificador"
+
+#. module: account_invoicing
+#: field:inv.agreement,analytic_entries:0
+#: field:inv.date_list,analytic_entries:0
+msgid "Entries"
+msgstr "Entrades"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "count - number of filtred records"
+msgstr "count - Número de registres filtrats"
+
+#. module: account_invoicing
+#: view:inv.calc_filter:0
+msgid "Calc filter"
+msgstr "Filtre del càlcul"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "agr_id - current Agreement ID field value"
+msgstr "agr_id - Valor del camp ID del contracte actual"
+
+#. module: account_invoicing
+#: selection:inv.calc,quantity:0
+msgid "Total Count"
+msgstr "Total recompte"
+
+#. module: account_invoicing
+#: field:inv.agreement,repeat:0
+msgid "Repeat missed"
+msgstr "Repeteix omesos"
+
+#. module: account_invoicing
+#: field:inv.service,analytic_account_branch:0
+msgid "Analytic account branch"
+msgstr "Branca de compte analític"
+
+#. module: account_invoicing
+#: view:inv.method:0
+msgid "contact_ids - contacts IDs of current partner in Methodology"
+msgstr "contact_ids - IDs dels contactes de la empresa actual en la metodologia"
+
+#. module: account_invoicing
+#: field:inv.rec_type,value:0
+msgid "Value"
+msgstr "Valor"
+
+#. module: account_invoicing
+#: field:inv.calc_filter,var:0
+#: field:inv.rec_filter,var:0
+msgid "Variable"
+msgstr "Variable"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Error!"
+msgstr "Error!"
+
+#. module: account_invoicing
+#: selection:inv.agreement,prolong:0
+msgid "Fixed Term"
+msgstr "Període de temps fix"
+
+#. module: account_invoicing
+#: view:inv.rec_filter_cond:0
+msgid "Record filter condition"
+msgstr "Condició filtre de registres"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "re - object for regural expressions (have attribute match)"
+msgstr "re - Objecte per a expressions regulars (té concordança atributs)"
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_service
+msgid "inv.service"
+msgstr "inv.service"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "desc - variable which will be used as a expression result"
+msgstr "desc - Variable que s'utilitzarà com una expressió del resultat"
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_calc_filter
+msgid "inv.calc_filter"
+msgstr "inv.calc_filter"
+
+#. module: account_invoicing
+#: view:inv.method:0
+msgid "Test source"
+msgstr "Prova"
+
+#. module: account_invoicing
+#: model:ir.ui.menu,name:account_invoicing.inv_config
+msgid "Configuration"
+msgstr "Configuració"
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_rec_type
+msgid "inv.rec_type"
+msgstr "inv.rec_type"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: field:inv.calc_filter,calc_id:0
+#: field:inv.method,calc_ids:0
+msgid "Calculation"
+msgstr "Càlcul"
+
+#. module: account_invoicing
+#: wizard_view:inv.agreement.wizard,init:0
+msgid "Run agreement(s)"
+msgstr "Processa contracte(s)"
+
+#. module: account_invoicing
+#: selection:inv.date_list,status:0
+msgid "Partially Invoiced"
+msgstr "Parcialment facturat"
+
+#. module: account_invoicing
+#: field:inv.agreement,analytic_account:0
+msgid "Analytic Account"
+msgstr "Compte analític"
+
+#. module: account_invoicing
+#: selection:inv.calc_filter,state:0
+#: selection:inv.rec_filter,state:0
+msgid "Defined"
+msgstr "Definit"
+
+#. module: account_invoicing
+#: selection:inv.agreement,recurr_unit:0
+#: selection:inv.service,interval_unit:0
+msgid "Month(s)"
+msgstr "Mes(es)"
+
+#. module: account_invoicing
+#: selection:inv.service,invoicing:0
+msgid "Trigger"
+msgstr "Disparador"
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Technical info:"
+msgstr "Informació tècnica:"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Warning!"
+msgstr "Avís!"
+
+#. module: account_invoicing
+#: field:inv.agreement,partner_id:0
+#: selection:inv.method,ref:0
+msgid "Partner"
+msgstr "Empresa"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value1_date:0
+msgid "Date1"
+msgstr "Data1"
+
+#. module: account_invoicing
+#: help:inv.agreement,signed_date:0
+msgid "Date when agreement was signed."
+msgstr "Data en que es va firmar el contracte"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value2_date:0
+msgid "Date2"
+msgstr "Data2"
+
+#. module: account_invoicing
+#: field:inv.service,int_unit_number:0
+msgid "Invoice Every"
+msgstr "Factura cada"
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_method
+msgid "inv.method"
+msgstr "inv.method"
+
+#. module: account_invoicing
+#: model:ir.actions.act_window,name:account_invoicing.act_all_analytics
+msgid "All Analytic Entries"
+msgstr "Totes les entrades analítiques"
+
+#. module: account_invoicing
+#: field:inv.calc_filter,temp_var:0
+#: field:inv.rec_filter,temp_var:0
+msgid "Temp Variable"
+msgstr "Variable temporal"
+
+#. module: account_invoicing
+#: field:inv.method,source:0
+msgid "Source"
+msgstr "Origen"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,name:0
+msgid "Filter coditions"
+msgstr "Condicions del filtre"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,cond_type:0
+msgid "Condition type"
+msgstr "Tipus de condició"
+
+#. module: account_invoicing
+#: model:ir.actions.act_window,name:account_invoicing.act_agreements
+#: model:ir.actions.act_window,name:account_invoicing.act_all_agreements
+msgid "Agreements"
+msgstr "Contractes"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "self - objects pointer"
+msgstr "self - Punter dels objectes"
+
+#. module: account_invoicing
+#: field:inv.calc_filter,field_type:0
+#: field:inv.rec_filter,field_type:0
+msgid "Ttype"
+msgstr "Tipus"
+
+#. module: account_invoicing
+#: field:inv.service,pricelist_id:0
+msgid "Sale Pricelist"
+msgstr "Tarifa de venda"
+
+#. module: account_invoicing
+#: field:inv.rec_type,type:0
+msgid "Type"
+msgstr "Tipus"
+
+#. module: account_invoicing
+#: selection:inv.agreement,payment:0
+msgid "In advance"
+msgstr "Per avançat"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "\"Number of Units\" field cannot be less than 1 !"
+msgstr "El camp \"Nombre d'unitats\" no pot ser menor a 1!"
+
+#. module: account_invoicing
+#: field:inv.service,purch_pricelist_id:0
+msgid "Purchase Pricelist"
+msgstr "Tarifa de compra"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Code it is impossible tested, because there is not an agreement!"
+msgstr "És impossible testejar el codi perquè no hi ha cap contracte!"
+
+#. module: account_invoicing
+#: field:inv.calc_filter,temp_field_id:0
+#: field:inv.rec_filter,temp_field_id:0
+msgid "Temp Field"
+msgstr "Camp temporal"
+
+#. module: account_invoicing
+#: field:account.analytic.line,agr_id:0
+#: view:inv.agreement:0
+#: field:inv.date_list,agreement_id:0
+#: model:ir.actions.act_window,name:account_invoicing.inv_agreement_form
+#: model:ir.ui.menu,name:account_invoicing.agreement
+msgid "Agreement"
+msgstr "Contracte"
+
+#. module: account_invoicing
+#: field:inv.method,calc_base:0
+msgid "Calculation base"
+msgstr "Càlcul base"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Field \"Value of\" not defined !"
+msgstr "El camp \"Valor de\" no està definit!"
+
+#. module: account_invoicing
+#: field:inv.agreement,recurr_unit:0
+#: field:inv.service,interval_unit:0
+msgid "Interval Unit"
+msgstr "Unitat d'interval"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "d_list - Invoice Log object"
+msgstr "d_list - Objecte registre factures"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Invalid action !"
+msgstr "Acció no vàlida!"
+
+#. module: account_invoicing
+#: selection:inv.agreement,state:0
+msgid "Done"
+msgstr "Finalitzat"
+
+#. module: account_invoicing
+#: selection:inv.calc,product_type:0
+msgid "Consumable"
+msgstr "Consumible"
+
+#. module: account_invoicing
+#: wizard_view:inv.agreement.wizard,init:0
+msgid "Do you want set to process selected agreement(s) ?"
+msgstr "Voleu processar els contracte(s) seleccionat(s)?"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "Advanced"
+msgstr "Avançat"
+
+#. module: account_invoicing
+#: constraint:ir.cron:0
+msgid "Invalid arguments"
+msgstr "Arguments no vàlids"
+
+#. module: account_invoicing
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr "XML no vàlid per a la estructura de la vista!"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "quant - variable which will be used as a expression result"
+msgstr "quant - Variable que s'utilitzarà com una expressió del resultat"
+
+#. module: account_invoicing
+#: selection:inv.calc_filter,state:0
+#: selection:inv.rec_filter,state:0
+msgid "Undefined"
+msgstr "Indefinit"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "model - current model name in Methodology"
+msgstr "model - Nom del model actual en metodologia"
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Manage Prolongation:"
+msgstr "Gestiona prolongació:"
+
+#. module: account_invoicing
+#: field:inv.calc,manual:0
+#: field:inv.method,manual:0
+msgid "Manual"
+msgstr "Manual"
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_agreement
+msgid "inv.agreement"
+msgstr "inv.agreement"
+
+#. module: account_invoicing
+#: selection:inv.method,ref:0
+msgid "Contact"
+msgstr "Contacte"
+
+#. module: account_invoicing
+#: view:inv.service:0
+#: field:inv.service,req_users:0
+msgid "Work Team"
+msgstr "Equip de treball"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Cannot delete agreement(s) which are already running !"
+msgstr "No es poden eliminar contracte(s) que ja estiguin en procés!"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "pdate1 - period date from"
+msgstr "pdate1 - Data període inicial"
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_date_list
+msgid "inv.date_list"
+msgstr "nv.date_list"
+
+#. module: account_invoicing
+#: field:inv.agreement,state:0
+#: field:inv.calc_filter,state:0
+#: field:inv.date_list,state:0
+#: field:inv.date_list,status:0
+#: field:inv.method,state:0
+#: field:inv.rec_filter,state:0
+#: field:inv.rec_filter_cond,state:0
+msgid "State"
+msgstr "Estat"
+
+#. module: account_invoicing
+#: model:ir.actions.act_window,name:account_invoicing.act_all_invoices
+msgid "Invoices"
+msgstr "Factures"
+
+#. module: account_invoicing
+#: help:inv.agreement,init_effect_date:0
+msgid "Date of initial validity of the agreement."
+msgstr "Data de validesa inicial del contracte."
+
+#. module: account_invoicing
+#: field:inv.agreement,cron_prolong:0
+msgid "Cron prolong"
+msgstr "Planificador de prolongació"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value1_char:0
+msgid "Char"
+msgstr "Caràcter"
+
+#. module: account_invoicing
+#: selection:inv.agreement,recurr_unit:0
+#: selection:inv.service,interval_unit:0
+msgid "Week(s)"
+msgstr "Setmana(s)"
+
+#. module: account_invoicing
+#: selection:inv.date_list,status:0
+msgid "Ready to be invoiced"
+msgstr "Llest per a ser facturat"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "mas_after - List of id's of record after filtration"
+msgstr "mas_after - Llista d'IDs de registres després del filtrat"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Input data error!"
+msgstr "Error entrada de dades!"
+
+#. module: account_invoicing
+#: selection:inv.date_list,status:0
+msgid "Invoiced"
+msgstr "Facturat"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value2_int:0
+msgid "Integer2"
+msgstr "Enter2"
+
+#. module: account_invoicing
+#: view:inv.method:0
+msgid "mas_aft - list for the ID of the filtered records"
+msgstr "mas_aft - Llista d'IDs dels registres filtrats"
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_calc
+msgid "inv.calc"
+msgstr "inv.calc"
+
+#. module: account_invoicing
+#: view:inv.cond_value:0
+#: view:inv.rec_filter_cond:0
+#: field:inv.rec_filter_cond,cond_value:0
+msgid "Condition value"
+msgstr "Valor condició"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "agre - current Agreement objects record"
+msgstr "agre - Registre de l'objecte contracte actual"
+
+#. module: account_invoicing
+#: wizard_button:inv.agreement.wizard,init,end:0
+msgid "No"
+msgstr "No"
+
+#. module: account_invoicing
+#: view:inv.rec_type:0
+msgid "Record types"
+msgstr "Tipus de registre"
+
+#. module: account_invoicing
+#: selection:inv.agreement,state:0
+msgid "Draft"
+msgstr "Esborrany"
+
+#. module: account_invoicing
+#: help:inv.agreement,prolong:0
+msgid "Sets whether to prolong the agreement for the next term or not."
+msgstr "Indica si el contracte ha de ser renovat o no al finalitzar el període inicial de validesa."
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Cannot set Waiting while field \"Analitic Entries\" not empty !"
+msgstr "No es pot posar En espera mentre el camp \"Entrades analítiques\" no estigui buit!"
+
+#. module: account_invoicing
+#: field:inv.calc,model_id:0
+#: field:inv.method,model_id:0
+msgid "Model"
+msgstr "Model"
+
+#. module: account_invoicing
+#: selection:inv.calc,description:0
+#: selection:inv.date_list,state:0
+msgid "Empty"
+msgstr "Buit"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "rec_id - Id of current record after filtration"
+msgstr "rec_id - ID del registre actual després del filtrat"
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_rec_filter_cond
+msgid "inv.rec_filter_cond"
+msgstr "nv.rec_filter_cond"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "Available global variables:"
+msgstr "Variables globals disponibles:"
+
+#. module: account_invoicing
+#: selection:inv.date_list,state:0
+#: selection:inv.date_list,status:0
+msgid "Processing"
+msgstr "En procés"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "No field value!"
+msgstr "Falta camp Valor!"
+
+#. module: account_invoicing
+#: field:inv.agreement,active:0
+msgid "Active"
+msgstr "Actiu"
+
+#. module: account_invoicing
+#: view:inv.method:0
+msgid "Create"
+msgstr "Crea"
+
+#. module: account_invoicing
+#: field:inv.calc_filter,condition_id:0
+#: field:inv.rec_filter,condition_id:0
+msgid "Condition"
+msgstr "Condició"
+
+#. module: account_invoicing
+#: selection:inv.calc_filter,temp_var:0
+#: selection:inv.calc_filter,var:0
+#: selection:inv.method,calc_base:0
+#: selection:inv.rec_filter,temp_var:0
+#: selection:inv.rec_filter,var:0
+msgid "Count"
+msgstr "Compta"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "calc_id - current Calculation ID field value"
+msgstr "calc_id - Valor del camp ID del càlcul actual"
+
+#. module: account_invoicing
+#: field:inv.agreement,prolong:0
+msgid "Prolongation"
+msgstr "Prolongació"
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_rec_filter
+msgid "inv.rec_filter"
+msgstr "inv.rec_filter"
+
+#. module: account_invoicing
+#: field:inv.date_list,pdate2:0
+msgid "Period Date2"
+msgstr "Data període2"
+
+#. module: account_invoicing
+#: field:inv.date_list,pdate1:0
+msgid "Period Date1"
+msgstr "Data període1"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,calc_filter_id:0
+#: field:inv.rec_filter_cond,rec_filter_id:0
+msgid "Filter"
+msgstr "Filtre"
+
+#. module: account_invoicing
+#: field:inv.date_list,date:0
+msgid "Date"
+msgstr "Data"
+
+#. module: account_invoicing
+#: model:ir.module.module,description:account_invoicing.module_meta_information
+msgid ""
+"Complete universal addon for issuing bills on any type of TinyERP/OpenERP data objects (models). Setup agreements for automatic customer billing on scheduld intervals.\n"
+"    Features:\n"
+"    * user frienly yet powerfull;\n"
+"    * fully automatic creation of analytic journal entries for further invoicing;\n"
+"    * definition of various methodologies - business logic;\n"
+"    * choose code constructor (Python) for fast deployment or manual expressions for advanced business logic or combine both of them;\n"
+"    * unlimited count of methodologies per virtual service;\n"
+"    \n"
+"    Suitable for billing (non exaustive list):\n"
+"    * Hosting (e-mail, web-hosting etc.);\n"
+"    * Utilities;\n"
+"    * Telecom;\n"
+"    * Service;\n"
+"    "
+msgstr ""
+"Mòdul complet universal per a la generació de factures a partir de qualsevol tipus d'objectes de dades (models) d'OpenERP. Permet definir contractes per a la facturació automàtica de clients en intervals planificats.\n"
+"    Característiques:\n"
+"    * Fàcil d'usar encara potent\n"
+"    * Creació automàtica completa de entrades analítiques per a posterior facturació\n"
+"    * Definició de diferents metodologies - la lògica de negoci\n"
+"    * Permet usar un constructor de codi (Python) per a la posta a punt ràpida o bé expressions manuals per a lògiques de negoci avançades o combinar ambdós sistemes\n"
+"    * Ilimitat número de metodologies per cada servei virtual\n"
+"   \n"
+"    Aquest mòdul es indicat per a la facturació (llista no exhaustiva) de:\n"
+"    * Allotjament (correu electrònic, allotjament web, ...)\n"
+"    * Suport\n"
+"    * Telecomunicacions\n"
+"    * Serveis\n"
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Manage State:"
+msgstr "Gestiona estat:"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "pdate2 - period date to"
+msgstr "pdate2 - data període final"
+
+#. module: account_invoicing
+#: selection:inv.agreement,state:0
+#: selection:inv.date_list,status:0
+msgid "Error"
+msgstr "Error"
+
+#. module: account_invoicing
+#: view:inv.method:0
+msgid "partner_id - current partner ID in Methodology"
+msgstr "partner_id - ID empresa actual en metodologia"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: field:inv.calc,descr_express:0
+#: selection:inv.calc,description:0
+#: selection:inv.calc,quantity:0
+#: field:inv.calc,quantity_express:0
+msgid "Expression"
+msgstr "Expressió"
+
+#. module: account_invoicing
+#: selection:inv.calc,product_type:0
+msgid "Stockable Product"
+msgstr "Producte emmagatzemable"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "Quantity"
+msgstr "Quantitat"
+
+#. module: account_invoicing
+#: field:inv.agreement,uninv_entries_count:0
+msgid "Uninvoiced analytic entries"
+msgstr "Entrades analítiques sense facturar"
+
+#. module: account_invoicing
+#: field:inv.calc,code:0
+#: field:inv.rec_filter_cond,code:0
+msgid "Code"
+msgstr "Codi"
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Process"
+msgstr "Processa"
+
+#. module: account_invoicing
+#: field:inv.calc,descr_field:0
+#: field:inv.calc,quantity_field:0
+msgid "Value of"
+msgstr "Valor de"
+
+#. module: account_invoicing
+#: field:inv.date_list,period:0
+#: selection:inv.service,invoicing:0
+msgid "Period"
+msgstr "Període"
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "General"
+msgstr "General"
+
+#. module: account_invoicing
+#: selection:inv.date_list,state:0
+msgid "Filled"
+msgstr "Omplenat"
+
+#. module: account_invoicing
+#: selection:inv.agreement,prolong:0
+msgid "Unlimited Term"
+msgstr "Període de temps indeterminat"
+
+#. module: account_invoicing
+#: field:inv.agreement,cur_effect_date:0
+msgid "Current Validity Date"
+msgstr "Data actual de validesa"
+
+#. module: account_invoicing
+#: field:inv.calc,product_type:0
+msgid "Product Type"
+msgstr "Tipus de producte"
+
+#. module: account_invoicing
+#: help:inv.agreement,cur_effect_date:0
+msgid "Resembles the current validity period."
+msgstr "Semblant al període actual de validesa"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "calc_date - calculation date"
+msgstr "calc_date - Data del càlcul"
+
+#. module: account_invoicing
+#: selection:inv.method,state:0
+msgid "Close"
+msgstr "Tanca"
+
+#. module: account_invoicing
+#: field:inv.calc,quantity:0
+msgid "Set quantity"
+msgstr "Estableix quantitat"
+
+#. module: account_invoicing
+#: selection:inv.method,state:0
+msgid "Open"
+msgstr "Obre"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value1_float:0
+msgid "Float1"
+msgstr "Real1"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value2_float:0
+msgid "Float2"
+msgstr "Real2"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Information"
+msgstr "Informació"
+
+#. module: account_invoicing
+#: constraint:ir.model:0
+msgid "The Object name must start with x_ and not contain any special character !"
+msgstr "El nom de l'object ha de començar amb x_ y no ha de contenir caràcters especials!"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "cr - database cursor"
+msgstr "cr - Cursor de la base de dades"
+
+#. module: account_invoicing
+#: field:inv.agreement,init_effect_date:0
+msgid "Initial Validity Date"
+msgstr "Data inicial de validesa"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Agreement not possible running !"
+msgstr "El contracte no es pot posar En procés!"
+
+#. module: account_invoicing
+#: selection:inv.calc,description:0
+#: selection:inv.calc,quantity:0
+#: field:inv.calc_filter,field_id:0
+#: selection:inv.calc_filter,temp_var:0
+#: selection:inv.calc_filter,var:0
+#: selection:inv.method,calc_base:0
+#: field:inv.method,partner_field:0
+#: field:inv.method,ref:0
+#: field:inv.rec_filter,field_id:0
+#: selection:inv.rec_filter,temp_var:0
+#: selection:inv.rec_filter,var:0
+msgid "Field"
+msgstr "Camp"
+
+#. module: account_invoicing
+#: field:inv.calc,method_id:0
+#: field:inv.calc_filter,method_id:0
+#: view:inv.method:0
+#: field:inv.rec_filter,method_id:0
+#: model:ir.actions.act_window,name:account_invoicing.inv_config_method_form
+#: model:ir.ui.menu,name:account_invoicing.methodology
+msgid "Methodology"
+msgstr "Metodologia"
+
+#. module: account_invoicing
+#: model:ir.actions.wizard,name:account_invoicing.inv_agr_run
+msgid "Run agreement"
+msgstr "Processa contracte"
+
+#. module: account_invoicing
+#: field:inv.agreement,signed_date:0
+msgid "Signed on"
+msgstr "Firmat el"
+
+#. module: account_invoicing
+#: help:inv.agreement,uninv_entries_count:0
+msgid "Number of uninvoiced analytic entries."
+msgstr "Nombre d'entrades analítiques sense facturar."
+
+#. module: account_invoicing
+#: selection:inv.agreement,recurr_unit:0
+#: selection:inv.service,interval_unit:0
+msgid "Day(s)"
+msgstr "Dia(s)"
+
+#. module: account_invoicing
+#: field:inv.agreement,calls:0
+msgid "Number of invoices"
+msgstr "Número de factures"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "Constructor:"
+msgstr "Constructor:"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "meth_id - current Methodology ID field value"
+msgstr "meth_id - Valor del camp ID de la metodologia actual"
+
+#. module: account_invoicing
+#: field:inv.agreement,name:0
+#: view:inv.calc:0
+msgid "Description"
+msgstr "Descripció"
+
+#. module: account_invoicing
+#: selection:inv.agreement,payment:0
+msgid "After"
+msgstr "Període vençut"
+
+#. module: account_invoicing
+#: view:inv.date_list:0
+msgid "-"
+msgstr "-"
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Validity"
+msgstr "Validesa"
+
+#. module: account_invoicing
+#: selection:inv.agreement,state:0
+msgid "Running"
+msgstr "En procés"
+
+#. module: account_invoicing
+#: help:inv.agreement,number:0
+msgid "Leave empty to get the number assigned by a sequence."
+msgstr "Deixar-lo buit per a obtenir un número assignat per una seqüència."
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "\"Invoice Every\" field cannot be less than 1!"
+msgstr "El camp \"Factura cada\" no pot ser menor a 1!"
+
+#. module: account_invoicing
+#: selection:inv.date_list,status:0
+msgid "Waiting"
+msgstr "En espera"
+
+#. module: account_invoicing
+#: field:inv.agreement,payment:0
+msgid "Payment"
+msgstr "Pagament"
+
+#. module: account_invoicing
+#: view:inv.date_list:0
+msgid "From:"
+msgstr "Des de:"
+
+#. module: account_invoicing
+#: help:inv.agreement,calls:0
+msgid "Number of invoices to be written."
+msgstr "Número de factures a crear."
+
+#. module: account_invoicing
+#: field:inv.calc,description:0
+msgid "Set description"
+msgstr "Estableix descripció"
+
+#. module: account_invoicing
+#: view:inv.rec_filter:0
+msgid "Record filter"
+msgstr "Filtrat de registres"
+
+#. module: account_invoicing
+#: view:inv.service:0
+#: field:inv.service,method_ids:0
+msgid "Methodologies"
+msgstr "Metodologies"
+
+#. module: account_invoicing
+#: field:inv.method,name:0
+#: field:inv.service,name:0
+msgid "Name"
+msgstr "Nom"
+
+#. module: account_invoicing
+#: field:inv.calc,product_id:0
+msgid "Product"
+msgstr "Producte"
+
+#. module: account_invoicing
+#: view:inv.method:0
+msgid "invoice_date - next invoice date"
+msgstr "invoice_date - Propera data de facturació"
+
+#. module: account_invoicing
+#: view:inv.date_list:0
+msgid "Renew"
+msgstr "Renova"
+
+#. module: account_invoicing
+#: field:inv.calc,calculations:0
+msgid "Calculation lines"
+msgstr "Línies de càlcul"
+
+#. module: account_invoicing
+#: selection:inv.agreement,recurr_unit:0
+#: selection:inv.service,interval_unit:0
+msgid "Year(s)"
+msgstr "Any(s)"
+
+#. module: account_invoicing
+#: field:inv.calc,sequence:0
+msgid "Calculation Sequence"
+msgstr "Seqüència de càlcul"
+
+#. module: account_invoicing
+#: field:account.analytic.line,invlog_id:0
+#: view:inv.agreement:0
+#: field:inv.agreement,date_list:0
+#: view:inv.date_list:0
+msgid "Invoice Log"
+msgstr "Registre de factures"
+
+#. module: account_invoicing
+#: wizard_button:inv.agreement.wizard,init,start:0
+msgid "Yes"
+msgstr "Si"
+
+#. module: account_invoicing
+#: field:inv.calc,invoicing_id:0
+#: model:ir.ui.menu,name:account_invoicing.inv_main_menu
+msgid "Invoicing"
+msgstr "Facturació"
+
+#. module: account_invoicing
+#: field:inv.agreement,cron_nextdate:0
+msgid "Set next date"
+msgstr "Estableix propera data"
+
+#. module: account_invoicing
+#: field:inv.service,invoicing:0
+msgid "Invoicing based on"
+msgstr "Facturació basada en"
+
+#. module: account_invoicing
+#: help:inv.agreement,analytic_account:0
+msgid "Leave empty to let the system create an account in a branch defined by the Service."
+msgstr "Deixar-lo buit per a que el sistema generi automàticament un compte en la branca definida pel servei."
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value1_datetime:0
+msgid "DateTime1"
+msgstr "DataHora1"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value2_datetime:0
+msgid "DateTime2"
+msgstr "DataHora2"
+
+#. module: account_invoicing
+#: selection:inv.calc,quantity:0
+msgid "One"
+msgstr "Un"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Cannot renew while Agreement not in Draft !"
+msgstr "No es pot renovar mentre el contracte no estigui en Esborrany!"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value1_bool:0
+msgid "Boolean"
+msgstr "Booleà"
+
+#. module: account_invoicing
+#: selection:inv.calc,description:0
+msgid "Calculation Period"
+msgstr "Càlcul de període"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "uid - current user ID"
+msgstr "uid - ID usuari actual"
+
+#. module: account_invoicing
+#: field:inv.calc_filter,filters:0
+#: field:inv.method,rec_filter_ids:0
+#: field:inv.rec_filter,filters:0
+msgid "Filters"
+msgstr "Filtres"
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Analytic Entries"
+msgstr "Entrades analítiques"
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Get number"
+msgstr "Obtenir número"
+

=== added file 'account_invoicing/i18n/es_ES.po'
--- account_invoicing/i18n/es_ES.po	1970-01-01 00:00:00 +0000
+++ account_invoicing/i18n/es_ES.po	2013-02-01 09:33:03 +0000
@@ -0,0 +1,1169 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# 	* account_invoicing
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 5.0.3\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2010-05-07 11:36:24+0000\n"
+"PO-Revision-Date: 2010-05-07 18:45+0100\n"
+"Last-Translator: Jordi Esteve (Zikzakmedia) <jesteve@xxxxxxxxxxxxxxx>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+
+#. module: account_invoicing
+#: model:ir.actions.act_window,name:account_invoicing.act_uninvoiced_analytics
+msgid "Uninvoiced Analytic Entries"
+msgstr "Entradas analíticas sin facturar"
+
+#. module: account_invoicing
+#: field:inv.agreement,service:0
+#: selection:inv.calc,product_type:0
+#: view:inv.service:0
+#: model:ir.actions.act_window,name:account_invoicing.inv_config_service_form
+#: model:ir.ui.menu,name:account_invoicing.service
+msgid "Service"
+msgstr "Servicio"
+
+#. module: account_invoicing
+#: field:inv.agreement,number:0
+msgid "Agreement Number"
+msgstr "Número de contrato"
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Stop"
+msgstr "Detener"
+
+#. module: account_invoicing
+#: selection:inv.agreement,prolong:0
+msgid "Prolong"
+msgstr "Prolongación"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value1_int:0
+msgid "Integer1"
+msgstr "Entero1"
+
+#. module: account_invoicing
+#: constraint:ir.actions.act_window:0
+msgid "Invalid model name in the action definition."
+msgstr "Nombre de modelo no válido en la definición de la acción."
+
+#. module: account_invoicing
+#: help:inv.agreement,recurr_unit_number:0
+msgid "Time before current validity expires to prolong the agreement for the next term."
+msgstr "Tiempo antes de que expire la validez actual para prolongar el contrato para el próximo período."
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "This Agreement is not operable, some \"Invoice Log\" entries are in \"Error\" state. Please check \"Invoice Log\" tab."
+msgstr "Este contrato no está operativo, algunas entradas del \"Registro de facturas\" están en estado \"Error\". Por favor compruebe la pestaña \"Registro de facturas\"."
+
+#. module: account_invoicing
+#: field:inv.agreement,recurr_unit_number:0
+msgid "Number of Units"
+msgstr "Número de unidades"
+
+#. module: account_invoicing
+#: field:inv.service,cron_offset:0
+msgid "Cron offset(hours)"
+msgstr "Desfase planificador o cron (horas)"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "res_list - List of calculation results"
+msgstr "res_list - Lista de los resultados del cálculo"
+
+#. module: account_invoicing
+#: field:inv.service,journal_id:0
+msgid "Analytic Journal"
+msgstr "Diario analítico"
+
+#. module: account_invoicing
+#: model:ir.module.module,shortdesc:account_invoicing.module_meta_information
+msgid "Invoicing / Billing"
+msgstr "Facturación / Emisión de facturas automáticas"
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Set to Draft"
+msgstr "Cambiar a borrador"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "obj_ids - list of the filtred records (identifiers)"
+msgstr "obj_ids - Lista de los registros filtrados (identificadores)"
+
+#. module: account_invoicing
+#: selection:inv.calc,description:0
+msgid "Calculation Date"
+msgstr "Cálculo de fecha"
+
+#. module: account_invoicing
+#: field:inv.agreement,cron_id:0
+msgid "Scheduler"
+msgstr "Planificador"
+
+#. module: account_invoicing
+#: field:inv.agreement,analytic_entries:0
+#: field:inv.date_list,analytic_entries:0
+msgid "Entries"
+msgstr "Entradas"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "count - number of filtred records"
+msgstr "count - Número de registros filtrados"
+
+#. module: account_invoicing
+#: view:inv.calc_filter:0
+msgid "Calc filter"
+msgstr "Filtro del cálculo"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "agr_id - current Agreement ID field value"
+msgstr "agr_id - Valor del campo ID del contrato actual"
+
+#. module: account_invoicing
+#: selection:inv.calc,quantity:0
+msgid "Total Count"
+msgstr "Total conteo"
+
+#. module: account_invoicing
+#: field:inv.agreement,repeat:0
+msgid "Repeat missed"
+msgstr "Repetir omitidos"
+
+#. module: account_invoicing
+#: field:inv.service,analytic_account_branch:0
+msgid "Analytic account branch"
+msgstr "Rama de cuenta analítica"
+
+#. module: account_invoicing
+#: view:inv.method:0
+msgid "contact_ids - contacts IDs of current partner in Methodology"
+msgstr "contact_ids - IDs de los contactos de la empresa actual en la metodología"
+
+#. module: account_invoicing
+#: field:inv.rec_type,value:0
+msgid "Value"
+msgstr "Valor"
+
+#. module: account_invoicing
+#: field:inv.calc_filter,var:0
+#: field:inv.rec_filter,var:0
+msgid "Variable"
+msgstr "Variable"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Error!"
+msgstr "¡Error!"
+
+#. module: account_invoicing
+#: selection:inv.agreement,prolong:0
+msgid "Fixed Term"
+msgstr "Período de tiempo fijo"
+
+#. module: account_invoicing
+#: view:inv.rec_filter_cond:0
+msgid "Record filter condition"
+msgstr "Condición filtro de registros"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "re - object for regural expressions (have attribute match)"
+msgstr "re - Objeto para expresiones regulares (tiene concordancia atributos)"
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_service
+msgid "inv.service"
+msgstr "inv.service"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "desc - variable which will be used as a expression result"
+msgstr "desc - Variable que se utilizará como una expresión del resultado"
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_calc_filter
+msgid "inv.calc_filter"
+msgstr "inv.calc_filter"
+
+#. module: account_invoicing
+#: view:inv.method:0
+msgid "Test source"
+msgstr "Probar"
+
+#. module: account_invoicing
+#: model:ir.ui.menu,name:account_invoicing.inv_config
+msgid "Configuration"
+msgstr "Configuración"
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_rec_type
+msgid "inv.rec_type"
+msgstr "inv.rec_type"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: field:inv.calc_filter,calc_id:0
+#: field:inv.method,calc_ids:0
+msgid "Calculation"
+msgstr "Cálculo"
+
+#. module: account_invoicing
+#: wizard_view:inv.agreement.wizard,init:0
+msgid "Run agreement(s)"
+msgstr "Procesar contrato(s)"
+
+#. module: account_invoicing
+#: selection:inv.date_list,status:0
+msgid "Partially Invoiced"
+msgstr "Parcialmente facturado"
+
+#. module: account_invoicing
+#: field:inv.agreement,analytic_account:0
+msgid "Analytic Account"
+msgstr "Cuenta analítica"
+
+#. module: account_invoicing
+#: selection:inv.calc_filter,state:0
+#: selection:inv.rec_filter,state:0
+msgid "Defined"
+msgstr "Definido"
+
+#. module: account_invoicing
+#: selection:inv.agreement,recurr_unit:0
+#: selection:inv.service,interval_unit:0
+msgid "Month(s)"
+msgstr "Mes(es)"
+
+#. module: account_invoicing
+#: selection:inv.service,invoicing:0
+msgid "Trigger"
+msgstr "Disparador"
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Technical info:"
+msgstr "Información técnica:"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Warning!"
+msgstr "¡Aviso!"
+
+#. module: account_invoicing
+#: field:inv.agreement,partner_id:0
+#: selection:inv.method,ref:0
+msgid "Partner"
+msgstr "Empresa"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value1_date:0
+msgid "Date1"
+msgstr "Fecha1"
+
+#. module: account_invoicing
+#: help:inv.agreement,signed_date:0
+msgid "Date when agreement was signed."
+msgstr "Fecha en que se firmó el contrato"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value2_date:0
+msgid "Date2"
+msgstr "Fecha2"
+
+#. module: account_invoicing
+#: field:inv.service,int_unit_number:0
+msgid "Invoice Every"
+msgstr "Facturar cada"
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_method
+msgid "inv.method"
+msgstr "inv.method"
+
+#. module: account_invoicing
+#: model:ir.actions.act_window,name:account_invoicing.act_all_analytics
+msgid "All Analytic Entries"
+msgstr "Todas las entradas analíticas"
+
+#. module: account_invoicing
+#: field:inv.calc_filter,temp_var:0
+#: field:inv.rec_filter,temp_var:0
+msgid "Temp Variable"
+msgstr "Variable temporal"
+
+#. module: account_invoicing
+#: field:inv.method,source:0
+msgid "Source"
+msgstr "Origen"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,name:0
+msgid "Filter coditions"
+msgstr "Condiciones del filtro"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,cond_type:0
+msgid "Condition type"
+msgstr "Tipo de condición"
+
+#. module: account_invoicing
+#: model:ir.actions.act_window,name:account_invoicing.act_agreements
+#: model:ir.actions.act_window,name:account_invoicing.act_all_agreements
+msgid "Agreements"
+msgstr "Contratos"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "self - objects pointer"
+msgstr "self - Puntero de los objetos"
+
+#. module: account_invoicing
+#: field:inv.calc_filter,field_type:0
+#: field:inv.rec_filter,field_type:0
+msgid "Ttype"
+msgstr "Tipo"
+
+#. module: account_invoicing
+#: field:inv.service,pricelist_id:0
+msgid "Sale Pricelist"
+msgstr "Tarifa de venta"
+
+#. module: account_invoicing
+#: field:inv.rec_type,type:0
+msgid "Type"
+msgstr "Tipo"
+
+#. module: account_invoicing
+#: selection:inv.agreement,payment:0
+msgid "In advance"
+msgstr "Por adelantado"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "\"Number of Units\" field cannot be less than 1 !"
+msgstr "¡El campo \"Número de unidades\" no puede ser menor a 1!"
+
+#. module: account_invoicing
+#: field:inv.service,purch_pricelist_id:0
+msgid "Purchase Pricelist"
+msgstr "Tarifa de compra"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Code it is impossible tested, because there is not an agreement!"
+msgstr "¡Es imposible testear el código porqué no hay ningún contrato!"
+
+#. module: account_invoicing
+#: field:inv.calc_filter,temp_field_id:0
+#: field:inv.rec_filter,temp_field_id:0
+msgid "Temp Field"
+msgstr "Campo temporal"
+
+#. module: account_invoicing
+#: field:account.analytic.line,agr_id:0
+#: view:inv.agreement:0
+#: field:inv.date_list,agreement_id:0
+#: model:ir.actions.act_window,name:account_invoicing.inv_agreement_form
+#: model:ir.ui.menu,name:account_invoicing.agreement
+msgid "Agreement"
+msgstr "Contrato"
+
+#. module: account_invoicing
+#: field:inv.method,calc_base:0
+msgid "Calculation base"
+msgstr "Cálculo base"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Field \"Value of\" not defined !"
+msgstr "¡El campo \"Valor de\" no está definido!"
+
+#. module: account_invoicing
+#: field:inv.agreement,recurr_unit:0
+#: field:inv.service,interval_unit:0
+msgid "Interval Unit"
+msgstr "Unidad de intervalo"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "d_list - Invoice Log object"
+msgstr "d_list - Objeto registro facturas"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Invalid action !"
+msgstr "¡Acción no válida!"
+
+#. module: account_invoicing
+#: selection:inv.agreement,state:0
+msgid "Done"
+msgstr "Finalizado"
+
+#. module: account_invoicing
+#: selection:inv.calc,product_type:0
+msgid "Consumable"
+msgstr "Consumible"
+
+#. module: account_invoicing
+#: wizard_view:inv.agreement.wizard,init:0
+msgid "Do you want set to process selected agreement(s) ?"
+msgstr "¿Desea procesar los contrato(s) seleccionado(s)?"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "Advanced"
+msgstr "Avanzado"
+
+#. module: account_invoicing
+#: constraint:ir.cron:0
+msgid "Invalid arguments"
+msgstr "Argumentos no válidos"
+
+#. module: account_invoicing
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr "¡XML no válido para la estructura de la vista!"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "quant - variable which will be used as a expression result"
+msgstr "quant - Variable que se utilizará como una expresión del resultado"
+
+#. module: account_invoicing
+#: selection:inv.calc_filter,state:0
+#: selection:inv.rec_filter,state:0
+msgid "Undefined"
+msgstr "Indefinido"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "model - current model name in Methodology"
+msgstr "model - Nombre del modelo actual en metodología"
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Manage Prolongation:"
+msgstr "Gestionar prolongación:"
+
+#. module: account_invoicing
+#: field:inv.calc,manual:0
+#: field:inv.method,manual:0
+msgid "Manual"
+msgstr "Manual"
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_agreement
+msgid "inv.agreement"
+msgstr "inv.agreement"
+
+#. module: account_invoicing
+#: selection:inv.method,ref:0
+msgid "Contact"
+msgstr "Contacto"
+
+#. module: account_invoicing
+#: view:inv.service:0
+#: field:inv.service,req_users:0
+msgid "Work Team"
+msgstr "Equipo de trabajo"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Cannot delete agreement(s) which are already running !"
+msgstr "¡No se pueden eliminar contrato(s) que ya están en proceso!"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "pdate1 - period date from"
+msgstr "pdate1 - Fecha período inicial"
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_date_list
+msgid "inv.date_list"
+msgstr "nv.date_list"
+
+#. module: account_invoicing
+#: field:inv.agreement,state:0
+#: field:inv.calc_filter,state:0
+#: field:inv.date_list,state:0
+#: field:inv.date_list,status:0
+#: field:inv.method,state:0
+#: field:inv.rec_filter,state:0
+#: field:inv.rec_filter_cond,state:0
+msgid "State"
+msgstr "Estado"
+
+#. module: account_invoicing
+#: model:ir.actions.act_window,name:account_invoicing.act_all_invoices
+msgid "Invoices"
+msgstr "Facturas"
+
+#. module: account_invoicing
+#: help:inv.agreement,init_effect_date:0
+msgid "Date of initial validity of the agreement."
+msgstr "Fecha de validez inicial del contrato."
+
+#. module: account_invoicing
+#: field:inv.agreement,cron_prolong:0
+msgid "Cron prolong"
+msgstr "Planificador de prolongación"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value1_char:0
+msgid "Char"
+msgstr "Carácter"
+
+#. module: account_invoicing
+#: selection:inv.agreement,recurr_unit:0
+#: selection:inv.service,interval_unit:0
+msgid "Week(s)"
+msgstr "Semana(s)"
+
+#. module: account_invoicing
+#: selection:inv.date_list,status:0
+msgid "Ready to be invoiced"
+msgstr "Listo para ser facturado"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "mas_after - List of id's of record after filtration"
+msgstr "mas_after - Lista de IDs de registros después del filtrado"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Input data error!"
+msgstr "¡Error entrada de datos!"
+
+#. module: account_invoicing
+#: selection:inv.date_list,status:0
+msgid "Invoiced"
+msgstr "Facturado"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value2_int:0
+msgid "Integer2"
+msgstr "Entero2"
+
+#. module: account_invoicing
+#: view:inv.method:0
+msgid "mas_aft - list for the ID of the filtered records"
+msgstr "mas_aft - Lista de IDs de los registros filtrados"
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_calc
+msgid "inv.calc"
+msgstr "inv.calc"
+
+#. module: account_invoicing
+#: view:inv.cond_value:0
+#: view:inv.rec_filter_cond:0
+#: field:inv.rec_filter_cond,cond_value:0
+msgid "Condition value"
+msgstr "Valor condición"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "agre - current Agreement objects record"
+msgstr "agre - Registro del objeto contrato actual"
+
+#. module: account_invoicing
+#: wizard_button:inv.agreement.wizard,init,end:0
+msgid "No"
+msgstr "No"
+
+#. module: account_invoicing
+#: view:inv.rec_type:0
+msgid "Record types"
+msgstr "Tipos de registro"
+
+#. module: account_invoicing
+#: selection:inv.agreement,state:0
+msgid "Draft"
+msgstr "Borrador"
+
+#. module: account_invoicing
+#: help:inv.agreement,prolong:0
+msgid "Sets whether to prolong the agreement for the next term or not."
+msgstr "Indica si el contrato debe ser renovado o no al finalizar el período inicial de validez."
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Cannot set Waiting while field \"Analitic Entries\" not empty !"
+msgstr "¡No se puede poner En espera mientras el campo \"Entradas analíticas\" no está vacío!"
+
+#. module: account_invoicing
+#: field:inv.calc,model_id:0
+#: field:inv.method,model_id:0
+msgid "Model"
+msgstr "Modelo"
+
+#. module: account_invoicing
+#: selection:inv.calc,description:0
+#: selection:inv.date_list,state:0
+msgid "Empty"
+msgstr "Vacío"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "rec_id - Id of current record after filtration"
+msgstr "rec_id - ID del registro actual después del filtrado"
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_rec_filter_cond
+msgid "inv.rec_filter_cond"
+msgstr "nv.rec_filter_cond"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "Available global variables:"
+msgstr "Variables globales disponibles:"
+
+#. module: account_invoicing
+#: selection:inv.date_list,state:0
+#: selection:inv.date_list,status:0
+msgid "Processing"
+msgstr "En proceso"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "No field value!"
+msgstr "¡Falta campo Valor!"
+
+#. module: account_invoicing
+#: field:inv.agreement,active:0
+msgid "Active"
+msgstr "Activo"
+
+#. module: account_invoicing
+#: view:inv.method:0
+msgid "Create"
+msgstr "Crear"
+
+#. module: account_invoicing
+#: field:inv.calc_filter,condition_id:0
+#: field:inv.rec_filter,condition_id:0
+msgid "Condition"
+msgstr "Condición"
+
+#. module: account_invoicing
+#: selection:inv.calc_filter,temp_var:0
+#: selection:inv.calc_filter,var:0
+#: selection:inv.method,calc_base:0
+#: selection:inv.rec_filter,temp_var:0
+#: selection:inv.rec_filter,var:0
+msgid "Count"
+msgstr "Contar"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "calc_id - current Calculation ID field value"
+msgstr "calc_id - Valor del campo ID del cálculo actual"
+
+#. module: account_invoicing
+#: field:inv.agreement,prolong:0
+msgid "Prolongation"
+msgstr "Prolongación"
+
+#. module: account_invoicing
+#: model:ir.model,name:account_invoicing.model_inv_rec_filter
+msgid "inv.rec_filter"
+msgstr "inv.rec_filter"
+
+#. module: account_invoicing
+#: field:inv.date_list,pdate2:0
+msgid "Period Date2"
+msgstr "Fecha período2"
+
+#. module: account_invoicing
+#: field:inv.date_list,pdate1:0
+msgid "Period Date1"
+msgstr "Fecha período1"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,calc_filter_id:0
+#: field:inv.rec_filter_cond,rec_filter_id:0
+msgid "Filter"
+msgstr "Filtro"
+
+#. module: account_invoicing
+#: field:inv.date_list,date:0
+msgid "Date"
+msgstr "Fecha"
+
+#. module: account_invoicing
+#: model:ir.module.module,description:account_invoicing.module_meta_information
+msgid ""
+"Complete universal addon for issuing bills on any type of TinyERP/OpenERP data objects (models). Setup agreements for automatic customer billing on scheduld intervals.\n"
+"    Features:\n"
+"    * user frienly yet powerfull;\n"
+"    * fully automatic creation of analytic journal entries for further invoicing;\n"
+"    * definition of various methodologies - business logic;\n"
+"    * choose code constructor (Python) for fast deployment or manual expressions for advanced business logic or combine both of them;\n"
+"    * unlimited count of methodologies per virtual service;\n"
+"    \n"
+"    Suitable for billing (non exaustive list):\n"
+"    * Hosting (e-mail, web-hosting etc.);\n"
+"    * Utilities;\n"
+"    * Telecom;\n"
+"    * Service;\n"
+"    "
+msgstr ""
+"Módulo completo universal para la generación de facturas a partir de cualquier tipo de objetos de datos (modelos) de OpenERP. Permite definir contratos para la facturación automática de clientes en intervalos planificados.\n"
+"    Características:\n"
+"    * Fácil de usar aunque potente\n"
+"    * Creación automática completa de entradas analíticas para posterior facturación\n"
+"    * Definición de distintas metodologías - la lógica de negocio\n"
+"    * Permite usar un constructor de código (Python) para la puesta a punto rápida o bien expresiones manuales para lógicas de negocio avanzadas o combinar ambos sistemas\n"
+"    * Ilimitado número de metodologías por cada servicio virtual\n"
+"   \n"
+"    Este módulo es indicado para la facturación (lista no exhaustiva) de:\n"
+"    * Alojamiento (correo electrónico, alojamiento web, ...)\n"
+"    * Soporte\n"
+"    * Telecomunicaciones\n"
+"    * Servicios\n"
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Manage State:"
+msgstr "Gestionar estado:"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "pdate2 - period date to"
+msgstr "pdate2 - Fecha período final"
+
+#. module: account_invoicing
+#: selection:inv.agreement,state:0
+#: selection:inv.date_list,status:0
+msgid "Error"
+msgstr "Error"
+
+#. module: account_invoicing
+#: view:inv.method:0
+msgid "partner_id - current partner ID in Methodology"
+msgstr "partner_id - ID empresa actual en metodología"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: field:inv.calc,descr_express:0
+#: selection:inv.calc,description:0
+#: selection:inv.calc,quantity:0
+#: field:inv.calc,quantity_express:0
+msgid "Expression"
+msgstr "Expresión"
+
+#. module: account_invoicing
+#: selection:inv.calc,product_type:0
+msgid "Stockable Product"
+msgstr "Producto almacenable"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "Quantity"
+msgstr "Cantidad"
+
+#. module: account_invoicing
+#: field:inv.agreement,uninv_entries_count:0
+msgid "Uninvoiced analytic entries"
+msgstr "Entradas analíticas sin facturar"
+
+#. module: account_invoicing
+#: field:inv.calc,code:0
+#: field:inv.rec_filter_cond,code:0
+msgid "Code"
+msgstr "Código"
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Process"
+msgstr "Procesar"
+
+#. module: account_invoicing
+#: field:inv.calc,descr_field:0
+#: field:inv.calc,quantity_field:0
+msgid "Value of"
+msgstr "Valor de"
+
+#. module: account_invoicing
+#: field:inv.date_list,period:0
+#: selection:inv.service,invoicing:0
+msgid "Period"
+msgstr "Período"
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "General"
+msgstr "General"
+
+#. module: account_invoicing
+#: selection:inv.date_list,state:0
+msgid "Filled"
+msgstr "Relleno"
+
+#. module: account_invoicing
+#: selection:inv.agreement,prolong:0
+msgid "Unlimited Term"
+msgstr "Período de tiempo indeterminado"
+
+#. module: account_invoicing
+#: field:inv.agreement,cur_effect_date:0
+msgid "Current Validity Date"
+msgstr "Fecha actual de validez"
+
+#. module: account_invoicing
+#: field:inv.calc,product_type:0
+msgid "Product Type"
+msgstr "Tipo de producto"
+
+#. module: account_invoicing
+#: help:inv.agreement,cur_effect_date:0
+msgid "Resembles the current validity period."
+msgstr "Parecido al período actual de validez"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "calc_date - calculation date"
+msgstr "calc_date - Fecha del cálculo"
+
+#. module: account_invoicing
+#: selection:inv.method,state:0
+msgid "Close"
+msgstr "Cerrar"
+
+#. module: account_invoicing
+#: field:inv.calc,quantity:0
+msgid "Set quantity"
+msgstr "Establecer cantidad"
+
+#. module: account_invoicing
+#: selection:inv.method,state:0
+msgid "Open"
+msgstr "Abrir"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value1_float:0
+msgid "Float1"
+msgstr "Real1"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value2_float:0
+msgid "Float2"
+msgstr "Real2"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Information"
+msgstr "Información"
+
+#. module: account_invoicing
+#: constraint:ir.model:0
+msgid "The Object name must start with x_ and not contain any special character !"
+msgstr "¡El nombre del objeto debe comenzar con x_ y no debe contener caracteres especiales!"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "cr - database cursor"
+msgstr "cr - Cursor de la base de datos"
+
+#. module: account_invoicing
+#: field:inv.agreement,init_effect_date:0
+msgid "Initial Validity Date"
+msgstr "Fecha inicial de validez"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Agreement not possible running !"
+msgstr "¡El contrato no se puede poner En proceso!"
+
+#. module: account_invoicing
+#: selection:inv.calc,description:0
+#: selection:inv.calc,quantity:0
+#: field:inv.calc_filter,field_id:0
+#: selection:inv.calc_filter,temp_var:0
+#: selection:inv.calc_filter,var:0
+#: selection:inv.method,calc_base:0
+#: field:inv.method,partner_field:0
+#: field:inv.method,ref:0
+#: field:inv.rec_filter,field_id:0
+#: selection:inv.rec_filter,temp_var:0
+#: selection:inv.rec_filter,var:0
+msgid "Field"
+msgstr "Campo"
+
+#. module: account_invoicing
+#: field:inv.calc,method_id:0
+#: field:inv.calc_filter,method_id:0
+#: view:inv.method:0
+#: field:inv.rec_filter,method_id:0
+#: model:ir.actions.act_window,name:account_invoicing.inv_config_method_form
+#: model:ir.ui.menu,name:account_invoicing.methodology
+msgid "Methodology"
+msgstr "Metodología"
+
+#. module: account_invoicing
+#: model:ir.actions.wizard,name:account_invoicing.inv_agr_run
+msgid "Run agreement"
+msgstr "Procesar contrato"
+
+#. module: account_invoicing
+#: field:inv.agreement,signed_date:0
+msgid "Signed on"
+msgstr "Firmado el"
+
+#. module: account_invoicing
+#: help:inv.agreement,uninv_entries_count:0
+msgid "Number of uninvoiced analytic entries."
+msgstr "Numero de entradas analíticas sin facturar."
+
+#. module: account_invoicing
+#: selection:inv.agreement,recurr_unit:0
+#: selection:inv.service,interval_unit:0
+msgid "Day(s)"
+msgstr "Día(s)"
+
+#. module: account_invoicing
+#: field:inv.agreement,calls:0
+msgid "Number of invoices"
+msgstr "Número de facturas"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "Constructor:"
+msgstr "Constructor:"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+msgid "meth_id - current Methodology ID field value"
+msgstr "meth_id - Valor del campo ID de la metodología actual"
+
+#. module: account_invoicing
+#: field:inv.agreement,name:0
+#: view:inv.calc:0
+msgid "Description"
+msgstr "Descripción"
+
+#. module: account_invoicing
+#: selection:inv.agreement,payment:0
+msgid "After"
+msgstr "Período vencido"
+
+#. module: account_invoicing
+#: view:inv.date_list:0
+msgid "-"
+msgstr "-"
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Validity"
+msgstr "Validez"
+
+#. module: account_invoicing
+#: selection:inv.agreement,state:0
+msgid "Running"
+msgstr "En proceso"
+
+#. module: account_invoicing
+#: help:inv.agreement,number:0
+msgid "Leave empty to get the number assigned by a sequence."
+msgstr "Dejarlo vacío para obtener un número asignado por una secuencia."
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "\"Invoice Every\" field cannot be less than 1!"
+msgstr "¡El campo \"Facturar cada\" no puede ser menor a 1!"
+
+#. module: account_invoicing
+#: selection:inv.date_list,status:0
+msgid "Waiting"
+msgstr "En espera"
+
+#. module: account_invoicing
+#: field:inv.agreement,payment:0
+msgid "Payment"
+msgstr "Pago"
+
+#. module: account_invoicing
+#: view:inv.date_list:0
+msgid "From:"
+msgstr "Desde:"
+
+#. module: account_invoicing
+#: help:inv.agreement,calls:0
+msgid "Number of invoices to be written."
+msgstr "Número de facturas a crear."
+
+#. module: account_invoicing
+#: field:inv.calc,description:0
+msgid "Set description"
+msgstr "Establecer descripción"
+
+#. module: account_invoicing
+#: view:inv.rec_filter:0
+msgid "Record filter"
+msgstr "Filtrado de registros"
+
+#. module: account_invoicing
+#: view:inv.service:0
+#: field:inv.service,method_ids:0
+msgid "Methodologies"
+msgstr "Metodologías"
+
+#. module: account_invoicing
+#: field:inv.method,name:0
+#: field:inv.service,name:0
+msgid "Name"
+msgstr "Nombre"
+
+#. module: account_invoicing
+#: field:inv.calc,product_id:0
+msgid "Product"
+msgstr "Producto"
+
+#. module: account_invoicing
+#: view:inv.method:0
+msgid "invoice_date - next invoice date"
+msgstr "invoice_date - Próxima fecha de facturación"
+
+#. module: account_invoicing
+#: view:inv.date_list:0
+msgid "Renew"
+msgstr "Renovar"
+
+#. module: account_invoicing
+#: field:inv.calc,calculations:0
+msgid "Calculation lines"
+msgstr "Líneas de cálculo"
+
+#. module: account_invoicing
+#: selection:inv.agreement,recurr_unit:0
+#: selection:inv.service,interval_unit:0
+msgid "Year(s)"
+msgstr "Año(s)"
+
+#. module: account_invoicing
+#: field:inv.calc,sequence:0
+msgid "Calculation Sequence"
+msgstr "Secuencia de cálculo"
+
+#. module: account_invoicing
+#: field:account.analytic.line,invlog_id:0
+#: view:inv.agreement:0
+#: field:inv.agreement,date_list:0
+#: view:inv.date_list:0
+msgid "Invoice Log"
+msgstr "Registro de facturas"
+
+#. module: account_invoicing
+#: wizard_button:inv.agreement.wizard,init,start:0
+msgid "Yes"
+msgstr "Sí"
+
+#. module: account_invoicing
+#: field:inv.calc,invoicing_id:0
+#: model:ir.ui.menu,name:account_invoicing.inv_main_menu
+msgid "Invoicing"
+msgstr "Facturación"
+
+#. module: account_invoicing
+#: field:inv.agreement,cron_nextdate:0
+msgid "Set next date"
+msgstr "Establecer próxima fecha"
+
+#. module: account_invoicing
+#: field:inv.service,invoicing:0
+msgid "Invoicing based on"
+msgstr "Facturación basada en"
+
+#. module: account_invoicing
+#: help:inv.agreement,analytic_account:0
+msgid "Leave empty to let the system create an account in a branch defined by the Service."
+msgstr "Dejarlo vacío para que el sistema genere automáticamente una cuenta en la rama definida por el servicio."
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value1_datetime:0
+msgid "DateTime1"
+msgstr "FechaHora1"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value2_datetime:0
+msgid "DateTime2"
+msgstr "FechaHora2"
+
+#. module: account_invoicing
+#: selection:inv.calc,quantity:0
+msgid "One"
+msgstr "Uno"
+
+#. module: account_invoicing
+#: code:addons/account_invoicing/invoicing.py:0
+#, python-format
+msgid "Cannot renew while Agreement not in Draft !"
+msgstr "¡No se puede renovar mientras el contrato no esté en Borrador!"
+
+#. module: account_invoicing
+#: field:inv.rec_filter_cond,value1_bool:0
+msgid "Boolean"
+msgstr "Booleano"
+
+#. module: account_invoicing
+#: selection:inv.calc,description:0
+msgid "Calculation Period"
+msgstr "Cálculo de período"
+
+#. module: account_invoicing
+#: view:inv.calc:0
+#: view:inv.method:0
+msgid "uid - current user ID"
+msgstr "uid - ID usuario actual"
+
+#. module: account_invoicing
+#: field:inv.calc_filter,filters:0
+#: field:inv.method,rec_filter_ids:0
+#: field:inv.rec_filter,filters:0
+msgid "Filters"
+msgstr "Filtros"
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Analytic Entries"
+msgstr "Entradas analíticas"
+
+#. module: account_invoicing
+#: view:inv.agreement:0
+msgid "Get number"
+msgstr "Obtener número"
+

=== added file 'account_invoicing/inv_added_fields.py'
--- account_invoicing/inv_added_fields.py	1970-01-01 00:00:00 +0000
+++ account_invoicing/inv_added_fields.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,74 @@
+##############################################################################
+#
+# Copyright (c) 2008-2009 SIA "KN dati". (http://kndati.lv) All Rights Reserved.
+#                    General contacts <info@xxxxxxxxx>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+##############################################################################
+
+from osv import fields,osv
+
+class rec_filter_cond(osv.osv):
+    _name = 'inv.rec_filter_cond'
+    _inherit = 'inv.rec_filter_cond'
+
+    _columns = {
+            'rec_filter_id': fields.many2one('inv.rec_filter', 'Filter'),
+            'calc_filter_id': fields.many2one('inv.calc_filter', 'Filter'),
+    }
+
+rec_filter_cond()
+
+class rec_filter(osv.osv):
+    _name = 'inv.rec_filter'
+    _inherit = 'inv.rec_filter'
+
+    _columns = {
+            'condition_id': fields.one2many('inv.rec_filter_cond', 'rec_filter_id', 'Condition'),
+    }
+
+rec_filter()
+
+class calc_filter(osv.osv):
+    _name = 'inv.calc_filter'
+    _inherit = 'inv.calc_filter'
+
+    _columns = {
+            'calc_id': fields.many2one('inv.calc', 'Calculation'),
+            'condition_id': fields.one2many('inv.rec_filter_cond', 'calc_filter_id', 'Condition', required=True),
+    }
+
+calc_filter()
+
+class account_analytic_line(osv.osv):
+    _name = 'account.analytic.line'
+    _inherit = 'account.analytic.line'
+
+    _columns = {
+        'agr_id' : fields.many2one('inv.agreement', 'Agreement'),
+        'invlog_id' : fields.many2one('inv.date_list', 'Invoice Log'),
+    }
+
+account_analytic_line()
+
+

=== added file 'account_invoicing/inv_wizard.xml'
--- account_invoicing/inv_wizard.xml	1970-01-01 00:00:00 +0000
+++ account_invoicing/inv_wizard.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<openerp>
+	<data>
+		<wizard
+			string="Run agreement"
+			id="inv_agr_run"
+			model="inv.agreement"
+			name="inv.agreement.wizard"
+			menu="False"/>
+	</data>
+</openerp>

=== added file 'account_invoicing/invoicing.py'
--- account_invoicing/invoicing.py	1970-01-01 00:00:00 +0000
+++ account_invoicing/invoicing.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,1922 @@
+##############################################################################
+#
+# Copyright (c) 2008-2009 SIA "KN dati". (http://kndati.lv) All Rights Reserved.
+#                    General contacts <info@xxxxxxxxx>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+##############################################################################
+
+from osv import fields,osv
+import netsvc
+import tools
+import math
+import re
+from tools.translate import _
+from mx import DateTime
+from mx.DateTime import now
+import time, locale
+import traceback, sys
+
+def _change_state(self, cr, uid, ids, field, field_type, field_id, value1_char, value1_bool, \
+        value1_int, value2_int, value1_float, value2_float, value1_date, value2_date, value1_datetime, value2_datetime, cond_value):
+    data = {}
+    if field_id:
+        field_name = self.pool.get('ir.model.fields').browse(cr, uid, field_id, {}).name
+    else:
+        field_name = 'count'
+    if not field:
+        return {'value':{},'state':False}
+    else:
+        cond_type = self.pool.get('inv.rec_type').browse(cr, uid, field).value
+        data['state'] = self.pool.get('inv.rec_type').browse(cr, uid, field).type
+        value = self.pool.get('inv.rec_type').browse(cr, uid, field).value
+        if data['state']!='[many2one]' and data['state']!='[one2many]' and data['state']!='[many2many]' and data['state']!='[boolean]' \
+                and data['state']!='[char]' and data['state']!='[selection]':
+            if value=='between' or value=='not between':
+                data['state'] += '|2|'
+            else:
+                data['state'] += '|1|'
+        if value!='between' and value!='not between':
+            data['value2_int'] = 0
+            data['value2_float'] = 0
+            data['value2_date'] = ''
+            data['value2_datetime'] = ''
+
+        res = ''
+        if cond_type == 'equal to':
+            operator = ' == '
+        elif cond_type == 'not equal to':
+            operator = ' != '
+        elif cond_type == 'greater than':
+            operator = ' > '
+        elif cond_type == 'less than':
+            operator = ' < '
+        elif cond_type == 'greater than or equal to':
+            operator = ' >= '
+        elif cond_type == 'less than or equal to':
+            operator = ' <= '
+        elif cond_type == 'regexp':
+            operator = ' match '
+        else:
+            operator = ''
+
+        if cond_type!='between' and cond_type!='not between':
+            if field_type == '[char]' or field_type == '[selection]':
+                res = field_name + operator + "'"+(value1_char and unicode(value1_char, "UTF-8") or '')+"'" or ''
+            elif field_type == '[boolean]':
+                res = field_name + operator + str(value1_bool) or ''
+            elif field_type == '[integer]':
+                res = field_name + operator + str(value1_int) or ''
+            elif field_type == '[float]':
+                res = field_name + operator + str(value1_float) or ''
+            elif field_type == '[date]':
+                res = field_name + operator + str(value1_date) or ''
+            elif field_type == '[datetime]':
+                res = field_name + operator + str(value1_datetime) or ''
+        elif cond_type=='between':
+            if field_type == '[integer]':
+                res = '(' + field_name + ' >= ' + str(value1_int)+')'
+                if value2_int != None:
+                    res += ' and ('+field_name+ ' <= ' + str(value2_int)+')' or ''
+            elif field_type == '[float]':
+                res = '(' + field_name + ' >= ' + str(value1_float)+')'
+                if value2_float != None:
+                    res += ' and ('+field_name+ ' <= ' + str(value2_float)+')' or ''
+            elif field_type == '[date]':
+                res = '(' + field_name + ' >= ' + str(value1_date)+')'
+                if value2_date:
+                    res += ' and ('+field_name+ ' <= ' + str(value2_date)+')' or ''
+            elif field_type == '[datetime]':
+                res += '(' + field_name + ' >= ' + str(value1_datetime)+')'
+                if value2_datetime:
+                    res += ' and ('+field_name+ ' <= ' + str(value2_datetime)+')' or ''
+        elif cond_type=='not between':
+            if field_type == '[integer]':
+                res = '(' + field_name + ' <= ' + str(value1_int)+')' or ''
+                if value2_int != None:
+                    res += ' and ('+field_name+ ' >= ' + str(value2_int)+')' or ''
+            elif field_type == '[float]':
+                res = '(' + field_name + ' <= ' + str(value1_float)+')'
+                if value2_float != None:
+                    res += ' and ('+field_name+ ' >= ' + str(value2_float)+')' or ''
+            elif field_type == '[date]':
+                res = '(' + field_name + ' <= \'' + str(value1_date)+'\')'
+                if value2_date:
+                    res += ' and ('+field_name+ ' >= \'' + str(value2_date)+'\')' or ''
+            elif field_type == '[datetime]':
+                res = '(' + field_name + ' <= \'' + str(value1_datetime)+'\')'
+                if value2_datetime:
+                    res += ' and ('+field_name+ ' >= \'' + str(value2_datetime)+'\')' or ''
+
+        if cond_type=='in' or cond_type=='not in':
+            res = field_name + ' ' + cond_type
+            if cond_value and cond_value != None:
+                res += ' ['+cond_value+']' or ''
+        data['name'] = res
+    return data
+
+#def convert_date(self, date):
+#    return time.strftime(locale.nl_langinfo(locale.D_FMT), time.strptime(date, '%Y-%m-%d'))
+
+def convert_date(self, date):
+    if len(date)==10:
+        return date[8:10]+'.'+date[5:7]+'.'+date[:4]+'.'
+    elif len(date)==7:
+        return date[5:7]+'.'+date[:4]+'.'
+    return date+'.'
+
+def reconvert_date(self, date):
+    try:
+        if len(date)==11:
+            retval = date[6:10]+'-'+date[3:5]+'-'+date[:2]
+            DateTime.strptime(retval, '%Y-%m-%d')
+            return retval
+        elif len(date)==8:
+            retval = date[3:7]+'-'+date[:2]+'-01'
+            DateTime.strptime(retval, '%Y-%m-%d')
+            return retval
+        else:
+            retval = date[:4]+'-01-01'
+            DateTime.strptime(retval, '%Y-%m-%d')
+            return retval
+    except Exception, e:
+        return '1900-01-01'
+
+def find_req_users(self, cr, uid, service):
+    result = []
+    admin_id = self.pool.get('res.users').search(cr, uid, [('login','=','admin')])[0]
+    srv = self.pool.get('inv.service').browse(cr, uid, service, {})
+    tgroup = map(int, srv.req_users)
+    #Structure changes in 6.0. Commented 5 lines
+    #tg_obj = self.pool.get('hr.timesheet.group')
+    #for wt in tgroup:
+    #    user = tg_obj.browse(cr, uid, wt, {}).manager.id
+    #    if user not in result:
+    #        result.append(user)
+
+    tg_obj = self.pool.get('hr.employee')
+    wts = tg_obj.search(cr, uid, [('user_id', 'in', tgroup)])
+    for emp in tg_obj.browse(cr, uid, wts, {}):
+        if emp.department_id:
+            if emp.department_id.manager_id and emp.id == emp.department_id.manager_id.id:
+                user = emp.department_id.manager_id.id
+                if user not in result:
+                    result.append(user)
+    #emp_obj = self.pool.get('hr.employee')
+    #emp_ids = emp_obj.search(cr, uid, [])
+    #for id in emp_ids:
+    #    emp_rec = emp_obj.browse(cr, uid, id, {})
+    #    for r in map(int, srv.req_users):
+    #        if r in map(int, emp_rec.workgroups):
+    #            user = emp_rec.user_id.id
+    #            if user not in result:
+    #                result.append(emp_rec.user_id.id)
+    if result and result[0]:
+        return result
+    else:
+        return [admin_id]
+
+def create_request(self, cr, uid, subject, req_text, service):
+    req_users = find_req_users(self, cr, uid, service)
+    admin_id = self.pool.get('res.users').search(cr, uid, [('login','=','admin')])[0]
+    for user_id in req_users:
+        req_values = {'name':subject,'act_from':admin_id,'act_to':user_id,'date_sent':time.strftime('%Y-%m-%d %H:%M:%S'),'body':req_text,'state':'waiting','priority':'2'}
+        id = self.pool.get('res.request').create(cr, uid, req_values)
+        cr.execute('select act_from,act_to,body,date_sent from res_request where id=%s', (id,))
+        values = cr.dictfetchone()
+        if len(values['body']) > 128:
+            values['name'] = values['body'][:125] + '...'
+        else:
+            values['name'] = values['body'] or '/'
+        values['req_id'] = id
+        self.pool.get('res.request.history').create(cr, uid, values)
+    return True
+
+class rec_type(osv.osv):
+    _name = "inv.rec_type"
+    _rec_name = "value"
+
+    _columns = {
+        'type': fields.char('Type', size=64, required=True),
+        'value': fields.char('Value', size=64, required=True),
+    }
+
+rec_type()
+
+class method(osv.osv):
+    _name = "inv.method"
+    _rec_name = "name"
+
+    _columns = {
+        'name': fields.char('Name', size=64, required=True),
+        'model_id': fields.many2one('ir.model', 'Model', states={'close':[('readonly',True)]}, required=True),
+        'partner_field': fields.many2one('ir.model.fields', 'Field', domain="[('model_id', '=', model_id),('relation','=', ref)]", required=True),
+        'ref': fields.selection([('res.partner','Partner'),('res.partner.address','Contact')], 'Field', required=True),
+        'rec_filter_ids': fields.one2many('inv.rec_filter', 'method_id', 'Filters',  states={'open':[('readonly',True)]}),
+        'calc_base': fields.selection([('field','Field'),('count','Count')], 'Calculation base', required=True),
+        'calc_ids': fields.one2many('inv.calc', 'method_id', 'Calculation', ondelete='cascade', states={'open':[('readonly',True)]}),
+        'state': fields.selection([('open', 'Open'),('close','Close')], 'State', select=True, readonly=True),
+        'manual': fields.boolean('Manual', states={'open':[('readonly',True)]}),
+        'source': fields.text('Source', states={'open':[('readonly',True)]}),
+    }
+
+    def _get_source(self, cr, uid, ids):
+        filter_obj = self.pool.get('inv.rec_filter')
+        cond_obj = self.pool.get('inv.rec_filter_cond')
+        for p in self.browse(cr, uid, ids, {}):
+            if p.manual:
+                return True
+            model = p.model_id.model
+            result = 'obj = self.pool.get(\''+model+'\')\n'
+            if p.ref == 'res.partner.address':
+                result += 'model_ids = obj.search(cr, uid, [(\''+p.partner_field.name+'\', \'in\', contact_ids)])\n'
+            else:
+                result += 'model_ids = obj.search(cr, uid, [(\''+p.partner_field.name+'\', \'=\', partner_id)])\n'
+            filter_ids = filter_obj.search(cr, uid, [('method_id','=',p.id)])
+            result += "for cur_object in obj.browse(cr, uid, model_ids, {}):\n\tresult = True\n"
+            for r in filter_obj.browse(cr, uid, filter_ids, {}):
+                cond_ids = cond_obj.search(cr, uid, [('rec_filter_id','=',r.id)])
+                if r.var == 'count': continue
+                for s in cond_obj.browse(cr, uid, cond_ids, {}):
+                    result += s.code
+            result += '\n\tif result:\n\t\tmas_aft.append(cur_object.id)\n'
+
+            for r in filter_obj.browse(cr, uid, filter_ids, {}):
+                cond_ids = cond_obj.search(cr, uid, [('rec_filter_id','=',r.id)])
+                if r.var == 'field': continue
+                result += '\ncount = len(model_ids)\n'
+                for s in cond_obj.browse(cr, uid, cond_ids, {}):
+                    result += s.code
+
+        cr.execute("""
+                UPDATE inv_method
+                SET source = %s
+                WHERE id in (%s)
+               """, (result, ','.join(map(str,ids))))
+        return True
+
+    def on_model_change(self, cr, uid, ids, field):
+        return {'value':{'partner_field':False}}
+
+    def action_create_meth(self, cr, uid, ids, *args):
+        self.write(cr, uid, ids, {'state':'close'})
+        wf_service = netsvc.LocalService("workflow")
+        for inv_id in ids:
+            wf_service.trg_create(uid, 'inv.metod', inv_id, cr)
+        return True
+
+    def action_test_source(self, cr, uid, ids, *args):
+        mas_before = []
+        mas_after = []
+        agr = self.pool.get('inv.agreement')
+        agr_ids = agr.search(cr, uid, [])
+        if agr_ids == []:
+            raise osv.except_osv(_('Warning!'), _('Code it is impossible tested, because there is not an agreement!'))
+        for p in self.browse(cr, uid, ids, {}):
+            if p.source:
+                for r in agr.browse(cr, uid, agr_ids, {}):
+                    localspace = {"self":self,"cr":cr,"uid":uid,"re":re,"mas_aft":mas_after,"partner_id":r.partner_id.id,"contact_ids":map(int, r.partner_id.address)}
+                    try:
+                        exec p.source in localspace
+                        mas_before = localspace['model_ids']
+                        mas_after = localspace['mas_aft']
+                        rec = 'Number of records before: ' + str(len(mas_before)) + '\nNumber of records after: ' + str(len(mas_after))
+                        raise osv.except_osv(_('Information'),_(rec))
+                        break
+                    except (SyntaxError, NameError, IndexError), exc:
+                        raise osv.except_osv(_('Error!'), _(exc))
+                    #except Exception, e:
+                    #    tb_s = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback))
+                    #    create_request(self, cr, uid, tb_s, r.service.id)
+                    #    break
+
+        return True
+
+    def sort_calc_list(self, cr, uid, calc_ids):
+        res_list = {}
+        for l in self.pool.get('inv.calc').browse(cr, uid, calc_ids, {}):
+            res_list[l.sequence] = l.id
+        res = res_list.items()
+        res.sort()
+        return [r[1] for r in res]
+
+    def _run_filters(self, cr, uid, ids, agr_id, context={}):
+        acc_lines = []
+        agr = self.pool.get('inv.agreement')
+        r = agr.browse(cr, uid, agr_id, {})
+        d_list = self.pool.get('inv.date_list')
+        current_date = now().strftime('%Y-%m-%d')
+        if r.service.invoicing == 'period':
+            full_date_list = map(int, r.date_list)
+            date_list1 = d_list.search(cr, uid, [('id','in',full_date_list),('status','=','wait')])
+            date_list2 = d_list.search(cr, uid, [('id','in',full_date_list),('status','=','process')])
+            date_list = date_list2 + date_list1
+            if not date_list: return True
+            date_list.reverse()
+            date_id = date_list.pop()
+            date = d_list.browse(cr, uid, date_id, {}).date
+            pdate1 = DateTime.strptime(d_list.browse(cr, uid, date_id, {}).pdate1, '%Y-%m-%d')
+            pdate2 = DateTime.strptime(d_list.browse(cr, uid, date_id, {}).pdate2, '%Y-%m-%d')
+        else:
+            date = current_date
+            date_id = False
+            pdate1 = False
+            pdate2 = False
+            date_list = []
+        try:
+            if date <= current_date and r.service.invoicing=='period':
+                d_list.write(cr, uid, date_id, {'status':'process'})
+            for p in self.browse(cr, uid, ids, {}):
+                mas_after = []
+                localspace = {"self":self,"cr":cr,"uid":uid,"re":re,"mas_aft":mas_after,"partner_id":r.partner_id.id,"contact_ids":map(int, r.partner_id.address),"pdate1":pdate1,"pdate2":pdate2,"invoice_date":date,"agre":r}
+                exec p.source in localspace
+                mas_after = localspace['mas_aft']
+                if len(mas_after) > 0:
+                    calc_ids = map(int, p.calc_ids)
+                    calc_seq = self.sort_calc_list(cr, uid, calc_ids)
+                    calc_res = False
+                    for c_id in calc_seq:
+                        c = self.pool.get('inv.calc').browse(cr, uid, c_id, {})
+                        #if c.var == 'count':
+                        calc_localspace = {"self":self,"cr":cr,"uid":uid,"re":re,"obj_ids":mas_after,"count":len(mas_after),"pdate1":pdate1,"pdate2":pdate2,"calc_date":date,"agre":r}
+                        exec c.code in calc_localspace
+                        pos = 0
+                        for result in calc_localspace['res_list']:
+                            if result:
+                                calc_res = True
+                                line = {"agr_id":agr_id,"user_id":uid,"amount":0}
+                                # Analityc Entries, field Description
+                                if c.description == 'empty':
+                                    line['name'] = ' '
+                                elif c.description == 'date':
+                                    line['name'] = convert_date(self, current_date)
+                                elif c.description == 'period':
+                                    period = d_list.browse(cr, uid, date_id, {}).period
+                                    line['name'] = period
+                                elif c.description == 'field' and c.descr_field:
+                                    line['name'] = ''
+                                    rec_id = mas_after[pos]
+                                    #for rec_id in mas_after:
+                                    localspace = {"self":self,"cr":cr,"uid":uid,"model":p.model_id.model,"rec_id":rec_id,"pdate1":pdate1,"pdate2":pdate2,"calc_date":date,'d_list':d_list,"agre":r}
+                                    cr.execute("SELECT ttype, relation FROM ir_model_fields WHERE name='"+c.descr_field.name+"' and model='"+p.model_id.model+"'")
+                                    query_res = cr.fetchone()
+                                    if query_res[0] == 'many2one':
+                                        field_value = "ids = self.pool.get('"+p.model_id.model+"').browse(cr, uid, rec_id, {})."+c.descr_field.name+".id\n"
+                                        field_value += "field_val = self.pool.get('"+query_res[1]+"').name_get(cr, uid, [ids], {})"
+                                    elif query_res[0] == 'one2many' or query_res[0] == 'many2many':
+                                        field_value = "ids = map(int, self.pool.get('"+p.model_id.model+"').browse(cr, uid, rec_id, {})."+c.descr_field.name+")\n"
+                                        field_value += "field_val = self.pool.get('"+query_res[1]+"').name_get(cr, uid, ids, {})"
+                                    else:
+                                        field_value = "field_val = self.pool.get('"+p.model_id.model+"').browse(cr, uid, rec_id, {})."+c.descr_field.name
+                                    exec field_value in localspace
+                                    if query_res[0] == 'many2one' or query_res[0] == 'one2many' or query_res[0] == 'many2many':
+                                        res = ''
+                                        for n in localspace['field_val']:
+                                            if n != localspace['field_val'][0]:
+                                                res += '; '
+                                            if n[1][0]!='(' and n[1][-1]!=')':
+                                                name = "'"+n[1]+"'"
+                                            else:
+                                                name = n[1]
+                                            temp = 'name='+name
+                                            exec temp in localspace
+                                            if type(localspace['name'])==tuple:
+                                                res += localspace['name'][0][1]
+                                            else:
+                                                res += localspace['name']
+                                        line['name'] += res
+                                    else:
+                                        line['name'] += str(localspace['field_val'])
+                                    #if rec_id!=mas_after[-1] and localspace['field_val']: line['name'] += '; '
+
+                                elif c.description == 'expression':
+                                    if (c.descr_express).find('rec_id') != -1:
+                                        line['name'] = ''
+                                        #for rec_id in mas_after:
+                                        rec_id = mas_after[pos]
+                                        localspace = {"self":self,"cr":cr,"uid":uid,"model":p.model_id.model,"rec_id":rec_id,"agr_id":r.id,"meth_id":p.id,"calc_id":c.id,"desc":'','convert_date':convert_date,'now':now,'d_list':d_list,'date_id':date_id,'pdate1':pdate1,'pdate2':pdate2,"calc_date":date,"agre":r}
+                                        exec c.descr_express in localspace
+                                        if type(localspace['desc'])==list:
+                                            for l in localspace['desc']:
+                                                line['name'] += l[1]
+                                                if l != localspace['desc'][-1]: line['name'] += '; '
+                                        else:
+                                            line['name'] += localspace['desc']
+                                        #if rec_id!=mas_after[-1]: line['name'] += '; '
+                                    else:
+                                        rec_id = mas_after[pos]
+                                        localspace = {"self":self,"cr":cr,"uid":uid,"model":p.model_id.model,"rec_id":rec_id,"agr_id":r.id,"meth_id":p.id,"calc_id":c.id,"desc":'','convert_date':convert_date,'now':now,'d_list':d_list,'date_id':date_id,'pdate1':pdate1,'pdate2':pdate2,"calc_date":date,"agre":r}
+                                        exec c.descr_express in localspace
+                                        line['name'] = localspace['desc']
+                                else:
+                                    line['name'] = ' '
+                                # Analityc Entries, field Quantity
+                                if c.quantity == 'eqone':
+                                    line['unit_amount'] = 1
+                                elif c.quantity == 'count':
+                                    line['unit_amount'] = len(mas_after)
+                                elif c.quantity == 'expression' or c.quantity == 'field':
+                                    if (c.quantity_express).find('rec_id') != -1:
+                                        line['unit_amount'] = 0
+                                        rec_id = mas_after[pos]
+                                        #for rec_id in mas_after:
+                                        localspace = {"self":self,"cr":cr,"uid":uid,"model":p.model_id.model,"rec_id":rec_id,"agr_id":r.id,"meth_id":p.id,"calc_id":c.id,"pdate1":pdate1,"pdate2":pdate2,"calc_date":date,"agre":r,"quant":''}
+                                        exec c.quantity_express in localspace
+                                        if type(localspace['quant'])==list:
+                                            for l in localspace['quant']:
+                                                line['unit_amount'] += l[1]
+                                        else:
+                                            line['unit_amount'] = localspace['quant']
+                                    else:
+                                        rec_id = mas_after[pos]
+                                        localspace = {"self":self,"cr":cr,"uid":uid,"model":p.model_id.model,"rec_id":rec_id,'mas_after':mas_after,"agr_id":r.id,"meth_id":p.id,"calc_id":c.id,"pdate1":pdate1,"pdate2":pdate2,"calc_date":date,"agre":r,"quant":''}
+                                        exec c.quantity_express in localspace
+                                        line['unit_amount'] = localspace['quant']
+                                else:
+                                    line['unit_amount'] = 0
+                                # Analityc Entries, field Analytic Account
+                                line['account_id'] = r.analytic_account.id
+                                # Analityc Entries, field Analytic journal
+                                line['journal_id'] = r.service.journal_id.id
+                                # Analityc Entries, field General account
+                                #if r.partner_id.property_account_receivable:
+                                line['general_account_id'] = c.product_id.product_tmpl_id.property_account_expense.id or c.product_id.categ_id.property_account_expense_categ.id
+                                # Analityc Entries, field Product
+                                line['product_id'] = c.product_id.id
+                                # Analityc Entries, field Product UoM
+                                line['product_uom_id'] = c.product_id.uom_id.id
+                                # Analityc Entries, field Invoicing
+                                line['to_invoice'] = c.invoicing_id.id
+                                if r.service.purch_pricelist_id:
+                                    ppl = r.service.purch_pricelist_id.id
+                                    line['amount'] = -self.pool.get('product.pricelist').price_get(cr, uid, [ppl], line['product_id'], line['unit_amount'] or 1.0, r.partner_id.id)[ppl]
+                                elif r.service.pricelist_id:
+                                    spl = r.service.pricelist_id.id
+                                    line['sale_amount'] = self.pool.get('product.pricelist').price_get(cr, uid, [spl], line['product_id'], line['unit_amount'] or 1.0, r.partner_id.id)[spl]
+                                if r.service.invoicing == 'trigger':
+                                    date_id = d_list.create(cr, uid, {'agreement_id':r.id,'status':'inv','date':date,'state':'filled'})
+                                    line['invlog_id'] = date_id
+                                    acc_lines.append(self.pool.get('account.analytic.line').create(cr, uid, line))
+                                else:
+                                    line['invlog_id'] = date_id
+                                if date <= current_date and r.service.invoicing=='period':
+                                    cr.rollback()
+                                    acc_lines.append(self.pool.get('account.analytic.line').create(cr, uid, line))
+                                    d_list.write(cr, uid, date_id, {'status':'inv'})
+                                    cr.commit()
+                            pos += 1
+                    if not calc_res and date_id:
+                        d_list.write(cr, uid, date_id, {'status':'error'})
+                        agr.write(cr, uid, [agr_id], {'state':'error'})
+                        req_body = '- Methodology: '+p.name+'\n- Calculation:\n'+c.code+'\n- Calculation result: False'
+                        create_request(self, cr, uid, 'Calculation result is False', req_body, r.service.id)
+        except Exception, e:
+            cr.rollback()
+            if date <= current_date and r.service.invoicing=='period':
+                d_list.write(cr, uid, date_id, {'status':'error'})
+                agr.write(cr, uid, [agr_id], {'state':'error'})
+                cr.commit()
+            tb_s = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback))
+            create_request(self, cr, uid, 'Error in executed code', tb_s, r.service.id)
+        return acc_lines
+
+    _defaults = {
+        'calc_base' : lambda *a: 'count',
+        'state': lambda *a: 'open',
+        'ref': lambda *a: 'res.partner',
+    }
+
+    _constraints = [
+            (_get_source, '', ['source']),
+        ]
+
+method()
+
+class rec_filter(osv.osv):
+    _name = "inv.rec_filter"
+    _rec_name = "filters"
+
+    def _get_field_type(self, cr, uid, ids, field_name, arg=None, context={}):
+        res={}
+        for p in self.browse(cr, uid, ids, context):
+            if p.field_id:
+                temp = p.field_id.ttype
+                res[p.id]='['+temp+']'
+            else:
+                res[p.id]='[integer]'
+        return res
+
+    def _get_filters(self, cr, uid, ids, field, arg=None, context={}):
+        res = {}
+        obj = self.pool.get('inv.rec_filter_cond')
+        for p in self.browse(cr, uid, ids, context):
+            temp = ''
+            cond_ids = map(int, p.condition_id)
+            if cond_ids == []:
+                if p.field_id:
+                    temp = p.field_id.name
+                else:
+                    temp = 'count'
+            for r in obj.browse(cr, uid, cond_ids, context):
+                if r.id == cond_ids[0]:
+                    if len(cond_ids) > 1:
+                        temp = '('+r.name+')'
+                    else:
+                        temp = r.name
+                else:
+                    temp += ' or ('+r.name+')'
+            res[p.id] = temp
+        return res
+
+    _columns = {
+        'filters': fields.function(_get_filters, method=True, string='Filters', type='char', size=128),
+        'method_id': fields.many2one('inv.method', 'Methodology'),
+        'field_id': fields.many2one('ir.model.fields', 'Field', domain="[('model_id', '=', parent.model_id),('ttype','!=','binary')]", states={'def':[('readonly',True)],'undef1':[('readonly',True)]}),
+        #'condition_id': fields.one2many('inv.rec_filter_cond', 'rec_filter_id', 'Condition'),
+        'field_type': fields.function(_get_field_type, method=True, string='Ttype', type='char'),
+        'state': fields.selection([('def', 'Defined'),('undef1', 'Undefined'),('undef2', 'Undefined')], 'State', readonly=True),
+        'var': fields.selection([('field', 'Field'),('count', 'Count')], 'Variable', states={'def':[('readonly',True)]}),
+        'temp_field_id': fields.many2one('ir.model.fields', 'Temp Field', domain="[('model_id', '=', parent.model_id),('ttype','!=','selection'),('ttype','!=','binary')]"),
+        'temp_var': fields.selection([('field', 'Field'),('count', 'Count')], 'Temp Variable'),
+    }
+
+    def change_field_type(self, cr, uid, ids, field, var):
+        data = {}
+        if not field:
+            return {'value':{}}
+        elif var == 'count':
+            data['field_id'] = False
+        else:
+            data['field_type'] = '['+self.pool.get('ir.model.fields').browse(cr, uid, field).ttype+']'
+            data['filters'] = self.pool.get('ir.model.fields').browse(cr, uid, field).name
+        return {'value':data}
+
+    def change_var(self, cr, uid, ids, field):
+        data = {}
+        if not field:
+            return {'value':{}}
+        elif field == 'count':
+            data['field_type'] = '[integer]'
+            data['field_id'] = False
+            data['state'] = 'undef1'
+        else:
+            data['field_type'] = ''
+            data['state'] = 'undef2'
+        return {'value':data}
+
+    def change_condition(self, cr, uid, ids, condition_id, field_id, var, relation):
+        data = {}
+        temp = ''
+        obj = self.pool.get('inv.rec_filter_cond')
+        for r in condition_id:
+            if r[2] != {}:
+                if r == condition_id[0]:
+                    if len(condition_id) > 1:
+                        temp = '('+r[2]['name']+')'
+                    else:
+                        temp = r[2]['name']
+                else:
+                    temp += ' or ('+r[2]['name']+')'
+        data['filters'] = temp
+        if relation:
+            data['state'] = 'def'
+        else:
+            data['state'] = 'def'
+        data['temp_field_id'] = field_id
+        data['temp_var'] = var
+        return {'value':data}
+
+    def name_get(self, cr, user, ids, context={}):
+        if not len(ids):
+            return []
+        res = []
+        for r in self.read(cr, user, ids, ['method_id', 'field_id', 'calc_id']):
+            if r['field_id']:
+                if r['method_id']:
+                    name = str(r['method_id'][1])
+                    name +=', '
+                else:
+                    name = str(r['calc_id'][1])
+                    name +=', '
+                name += str(r['field_id'][1])
+                res.append((r['id'], name))
+        return res
+
+    def create(self, cr, uid, vals, context={}):
+        if not context:
+            context={}
+        vals=vals.copy()
+        vals['state'] = 'def'
+        vals['var'] = vals['temp_var']
+        vals['field_id'] = vals['temp_field_id']
+        c = context.copy()
+        c['novalidate'] = True
+        result = super(rec_filter, self).create(cr, uid, vals, c)
+        return result
+
+    def write(self, cr, uid, ids, vals, context=None):
+        if not context:
+            context={}
+        for r in self.browse(cr, uid, ids, {}):
+            vals=vals.copy()
+            vals['state'] = 'def'
+        return super(rec_filter, self).write(cr, uid, ids, vals, context=context)
+
+    def unlink(self, cr, uid, ids, context):
+        conditions = map(int, self.browse(cr, uid, ids[0], {}).condition_id)
+        self.pool.get('inv.rec_filter_cond').unlink(cr, uid, conditions, context)
+        osv.osv.unlink(self, cr, uid, ids, context)
+        return True
+
+    _defaults = {
+        'var' : lambda *a: 'field',
+        'state' : lambda *a: 'undef2',
+        'field_type' : lambda *a: '[integer]',
+    }
+
+rec_filter()
+
+class calc_filter(osv.osv):
+    _name = 'inv.calc_filter'
+    _inherit = 'inv.rec_filter'
+
+    def _get_var(self, cr, uid, context={}):
+        if 'calc_base' in context.keys():
+            return context['calc_base']
+        return 'count'
+
+    _columns = {
+        #'calc_id': fields.many2one('inv.calc', 'Calculation'),
+        #'condition_id': fields.one2many('inv.rec_filter_cond', 'calc_filter_id', 'Condition'),
+    }
+
+    def create(self, cr, uid, vals, context={}):
+        if not context:
+            context={}
+        vals=vals.copy()
+        vals['state'] = 'def'
+        vals['var'] = vals['temp_var']
+        vals['field_id'] = vals['temp_field_id']
+        c = context.copy()
+        c['novalidate'] = True
+        result = super(calc_filter, self).create(cr, uid, vals, c)
+        return result
+
+    def write(self, cr, uid, ids, vals, context=None):
+        if not context:
+            context={}
+        for r in self.browse(cr, uid, ids, {}):
+            vals=vals.copy()
+            vals['state'] = 'def'
+        return super(calc_filter, self).write(cr, uid, ids, vals, context=context)
+
+    _defaults = {
+        'var' : _get_var,
+        'state' : lambda *a: 'undef1',
+    }
+
+calc_filter()
+
+class rec_filter_cond(osv.osv):
+    _name = "inv.rec_filter_cond"
+    _rec_name = "rec_filter_id"
+
+#    def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False):
+#        result = super(osv.osv, self).fields_view_get(cr, uid, view_id,view_type,context)
+#        return result
+
+    def _change_state(self, cr, uid, ids, field, arg=None, context={}):
+        res = {}
+        for p in self.browse(cr, uid, ids, context):
+            if p:
+                if p.rec_filter_id:
+                    filter_id = p.rec_filter_id
+                elif p.calc_filter_id:
+                    filter_id = p.calc_filter_id
+                ctype = filter_id.field_type
+                value = p.cond_type.value
+                if ctype!='[many2one]' and ctype!='[one2many]' and ctype!='[many2many]' and ctype!='[boolean]' \
+                        and ctype!='[char]' and ctype!='[selection]':
+                    if value=='between' or value=='not between':
+                        res[p.id] = ctype + '|2|'
+                    else:
+                        res[p.id] = ctype + '|1|'
+                else:
+                    res[p.id] = ctype
+        return res
+
+    def _get_name(self, cr, uid, ids, field, arg=None, context={}):
+        res = {}
+        for r in self.browse(cr, uid, ids, context):
+            if r.rec_filter_id:
+                filter_id = r.rec_filter_id
+                model = 'inv.rec_filter'
+            elif r.calc_filter_id:
+                filter_id = r.calc_filter_id
+                model = 'inv.calc_filter'
+            if filter_id.var != 'count':
+                field = filter_id.field_id.name
+                filter_field_type = self.pool.get(model).browse(cr, uid, filter_id.id, {}).field_type
+            else:
+                field = 'count'
+                filter_field_type = '[integer]'
+            if r.cond_type.value == 'equal to':
+                operator = ' == '
+            elif r.cond_type.value == 'not equal to':
+                operator = ' != '
+            elif r.cond_type.value == 'greater than':
+                operator = ' > '
+            elif r.cond_type.value == 'less than':
+                operator = ' < '
+            elif r.cond_type.value == 'greater than or equal to':
+                operator = ' >= '
+            elif r.cond_type.value == 'less than or equal to':
+                operator = ' <= '
+            elif r.cond_type.value == 'regexp':
+                operator = ' match '
+            else:
+                operator = ''
+                
+            if r.cond_type.value!='between' and r.cond_type.value!='not between':
+                if filter_field_type == '[char]' or filter_field_type == '[selection]':
+                    res[r.id] = field + operator + "'"+r.value1_char+"'" or ''
+                elif filter_field_type == '[boolean]':
+                    res[r.id] = field + operator + str(r.value1_bool) or ''
+                elif filter_field_type == '[integer]':
+                    res[r.id] = field + operator + str(r.value1_int) or ''
+                elif filter_field_type == '[float]':
+                    res[r.id] = field + operator + str(r.value1_float) or ''
+                elif filter_field_type == '[date]':
+                    res[r.id] = field + operator + str(r.value1_date) or ''
+                elif filter_field_type == '[datetime]':
+                    res[r.id] = field + operator + str(r.value1_datetime) or ''
+            elif r.cond_type.value=='between':
+                if filter_field_type == '[integer]':
+                    res[r.id] = '(' + field + ' >= ' + str(r.value1_int)+')'
+                    if r.value2_int != None:
+                        res[r.id] += ' and ('+field+ ' <= ' + str(r.value2_int)+')' or ''
+                elif filter_field_type == '[float]':
+                    res[r.id] = '(' + field + ' >= ' + str(r.value1_float)+')'
+                    if r.value2_float != None:
+                        res[r.id] += ' and ('+field+ ' <= ' + str(r.value2_float)+')' or ''
+                elif filter_field_type == '[date]':
+                    res[r.id] = '(' + field + ' >= ' + str(r.value1_date)+')'
+                    if r.value2_date:
+                        res[r.id] += ' and ('+field+ ' <= ' + str(r.value2_date)+')' or ''
+                elif filter_field_type == '[datetime]':
+                    res[r.id] += '(' + field + ' >= ' + str(r.value1_datetime)+')'
+                    if r.value2_datetime:
+                        res[r.id] += ' and ('+field+ ' <= ' + str(r.value2_datetime)+')' or ''
+            elif r.cond_type.value=='not between':
+                if filter_field_type == '[integer]':
+                    res[r.id] = '(' + field + ' <= ' + str(r.value1_int)+')' or ''
+                    if r.value2_int != None:
+                        res[r.id] += ' and ('+field+ ' >= ' + str(r.value2_int)+')' or ''
+                elif filter_field_type == '[float]':
+                    res[r.id] = '(' + field + ' <= ' + str(r.value1_float)+')'
+                    if r.value2_float != None:
+                        res[r.id] += ' and ('+field+ ' >= ' + str(r.value2_float)+')' or ''
+                elif filter_field_type == '[date]':
+                    res[r.id] = '(' + field + ' <= \'' + str(r.value1_date)+'\')'
+                    if r.value2_date:
+                        res[r.id] += ' and ('+field+ ' >= \'' + str(r.value2_date)+'\')' or ''
+                elif filter_field_type == '[datetime]':
+                    res[r.id] = '(' + field + ' <= \'' + str(r.value1_datetime)+'\')'
+                    if r.value2_datetime:
+                        res[r.id] += ' and ('+field+ ' >= \'' + str(r.value2_datetime)+'\')' or ''
+    
+            if r.cond_type.value=='in' or r.cond_type.value=='not in':
+                res[r.id] = field + ' ' + r.cond_type.value
+                if r.cond_value and r.cond_value != None:
+                    res[r.id] += ' ['+r.cond_value+']' or ''
+        
+        return res
+
+    def _get_code(self, cr, uid, ids, field, arg=None, context={}):
+        res = {}
+        comment = {}
+        for r in self.browse(cr, uid, ids, context):
+            if r.rec_filter_id:
+                filter_id = r.rec_filter_id
+                filter_model = 'inv.rec_filter'
+            elif r.calc_filter_id:
+                filter_id = r.calc_filter_id
+                filter_model = 'inv.calc_filter'
+            rec_filter = self.pool.get(filter_model).browse(cr, uid, filter_id.id, {})
+            if rec_filter.var == 'count':
+                filter_field_type = '[integer]'
+            else:
+                filter_field_type = rec_filter.field_type
+            if r.cond_type.value == 'equal to':
+                operator = ' == '
+            elif r.cond_type.value == 'not equal to':
+                operator = ' != '
+            elif r.cond_type.value == 'greater than':
+                operator = ' > '
+            elif r.cond_type.value == 'less than':
+                operator = ' < '
+            elif r.cond_type.value == 'greater than or equal to':
+                operator = ' >= '
+            elif r.cond_type.value == 'less than or equal to':
+                operator = ' <= '
+            elif r.cond_type.value == 'regexp':
+                operator = 'match'
+            else:
+                operator = ''
+
+            if rec_filter.var == 'count':
+                if r.id != ids[0]:
+                    res[r.id] = 'if '+r.name+' :\n'
+                    res[r.id] += '\tresult &= True\nelse:\n\tresult &= False\n'
+                else:
+                    res[r.id] = 'result = True\n'
+                    res[r.id] += 'if '+r.name+' :\n'
+                    res[r.id] += '\tresult &= True\nelse:\n\tresult &= False\n'
+                continue
+
+            if filter_id.field_id.ttype == 'many2one':
+                if filter_id.filters != comment:
+                    comment = filter_id.filters
+                    field = "#"+len(filter_id.filters)*'-'+"#\n# "+filter_id.filters+"\n\tif cur_object."+filter_id.field_id.name+".id "+r.cond_type.value+" ["+r.cond_value+"]:\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n"
+                else:
+                    field = "\tif cur_object."+filter_id.field_id.name+".id "+r.cond_type.value+" ["+r.cond_value+"]:\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n"
+                res[r.id] = field
+            elif filter_id.field_id.ttype == 'many2many' or filter_id.field_id.ttype == 'one2many':
+                if filter_id.filters != comment:
+                    comment = filter_id.filters
+                    field = "#"+len(filter_id.filters)*'-'+"#\n# "+filter_id.filters
+                    if r.cond_type.value == 'in':
+                        field += "\n\ttemp = 0"
+                        field += "\n\tfor x in ["+r.cond_value+"]:\n\t\tif x "+r.cond_type.value+" map(int, cur_object."+filter_id.field_id.name+"):\n\t\t\ttemp += 1\n\tresult &= bool(temp)\n"
+                    else:
+                        field += "\n\tfor x in ["+r.cond_value+"]:\n\t\tif x "+r.cond_type.value+" map(int, cur_object."+filter_id.field_id.name+"):\n\t\t\tresult &= True\n\t\telse:\n\t\t\tresult &= False\n"
+                else:
+                    field = "\tfor x in ["+r.cond_value+"]:\n\t\tif x "+r.cond_type.value+" map(int, cur_object."+filter_id.field_id.name+"):\n\t\t\tresult &= True\n\t\telse:\n\t\t\tresult &= False\n"
+                res[r.id] = field
+            else:
+                field = 'cur_object.'+filter_id.field_id.name
+                
+            if r.cond_type.value!='between' and r.cond_type.value!='not between':
+                if filter_field_type == '[char]' and operator == 'match':
+                    if comment != filter_id.filters:
+                        comment = filter_id.filters
+                        res[r.id] = "#"+len(comment)*'-'+"#\n# "+comment+"\n\tif re." + operator + "('"+r.value1_char+"', "+field+") != None:\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n" or ''
+                    else:
+                        res[r.id] = "\tif re." + operator + "('"+r.value1_char+"', "+field+") != None:\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n" or ''
+                elif filter_field_type == '[char]' or filter_field_type == '[selection]':
+                    if comment != filter_id.filters:
+                        comment = filter_id.filters
+                        res[r.id] = "#"+len(comment)*'-'+"#\n# "+comment+"\n\tif " + field + operator + "'"+r.value1_char+"':\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n" or ''
+                    else:
+                        res[r.id] = "\tif " + field + operator + "'"+r.value1_char+"':\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n" or ''
+                elif filter_field_type == '[boolean]':
+                    if comment != filter_id.filters:
+                        comment = filter_id.filters
+                        res[r.id] = "#"+len(comment)*'-'+"#\n# "+comment+"\n\tif " + field + operator + str(r.value1_bool)+":\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n" or ''
+                    else:
+                        res[r.id] = "\tif " + field + operator + str(r.value1_bool)+":\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n" or ''
+                elif filter_field_type == '[integer]':
+                    if comment != filter_id.filters:
+                        comment = filter_id.filters
+                        res[r.id] = "#"+len(comment)*'-'+"#\n# "+comment+"\n\tif " + field + operator + str(r.value1_int)+":\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n" or ''
+                    else:
+                        res[r.id] = "\tif " + field + operator + str(r.value1_int)+":\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n" or ''
+                elif filter_field_type == '[float]':
+                    if comment != filter_id.filters:
+                        comment = filter_id.filters
+                        res[r.id] = "#"+len(comment)*'-'+"#\n# "+comment+"\n\tif " + field + operator + str(r.value1_float)+":\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n" or ''
+                    else:
+                        res[r.id] = "\tif " + field + operator + str(r.value1_float)+":\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n" or ''
+                elif filter_field_type == '[date]':
+                    if comment != filter_id.filters:
+                        comment = filter_id.filters
+                        res[r.id] = "#"+len(comment)*'-'+"#\n# "+comment+"\n\tif " + field + operator + '\'' + str(r.value1_date)+"\':\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n" or ''
+                    else:
+                        res[r.id] = "\tif " + field + operator + '\'' + str(r.value1_date)+"\':\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n" or ''
+                elif filter_field_type == '[datetime]':
+                    if comment != filter_id.filters:
+                        comment = filter_id.filters
+                        res[r.id] = "#"+len(comment)*'-'+"#\n# "+comment+"\n\tif " + field + operator + '\'' + str(r.value1_datetime)+"\':\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n" or ''
+                    else:
+                        res[r.id] = "\tif " + field + operator + '\'' + str(r.value1_datetime)+"\':\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n" or ''
+            elif r.cond_type.value=='between':
+                if filter_field_type == '[integer]':
+                    res[r.id] = '#'+len(filter_id.filters)*'-'+"#\n# "+filter_id.filters+'\n\tif (' + field + ' >= ' + str(r.value1_int)+')'
+                    if r.value2_int != None:
+                        res[r.id] += ' and ('+field+ ' <= ' + str(r.value2_int)+')'+':\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n' or ''
+                elif filter_field_type == '[float]':
+                    res[r.id] = '#'+len(filter_id.filters)*'-'+"#\n# "+filter_id.filters+'\n\tif (' + field + ' >= ' + str(r.value1_float)+')'
+                    if r.value2_float != None:
+                        res[r.id] += ' and ('+field+ ' <= ' + str(r.value2_float)+')'+':\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n' or ''
+                elif filter_field_type == '[date]':
+                    res[r.id] = '#'+len(filter_id.filters)*'-'+"#\n# "+filter_id.filters+'\n\tif (' + field + ' >= \'' + str(r.value1_date)+'\')'
+                    if r.value2_date:
+                        res[r.id] += ' and ('+field+ ' <= \'' + str(r.value2_date)+'\'):\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n' or ''
+                elif filter_field_type == '[datetime]':
+                    res[r.id] += '#'+len(filter_id.filters)*'-'+"#\n# "+filter_id.filters+'\n\tif (' + field + ' >= \'' + str(r.value1_datetime)+'\')'
+                    if r.value2_datetime:
+                        res[r.id] += ' and ('+field+ ' <= \'' + str(r.value2_datetime)+'\')'+':\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n' or ''
+            elif r.cond_type.value=='not between':
+                if filter_field_type == '[integer]':
+                    res[r.id] = '#'+len(filter_id.filters)*'-'+"#\n# "+filter_id.filters+'\n\tif (' + field + ' <= ' + str(r.value1_int)+')'
+                    if r.value2_int != None:
+                        res[r.id] += ' and ('+field+ ' >= ' + str(r.value2_int)+')'+':\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n' or ''
+                elif filter_field_type == '[float]':
+                    res[r.id] = '#'+len(filter_id.filters)*'-'+"#\n# "+filter_id.filters+'\n\tif (' + field + ' <= ' + str(r.value1_float)+')'
+                    if r.value2_float != None:
+                        res[r.id] += ' and ('+field+ ' >= ' + str(r.value2_float)+')'+':\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n' or ''
+                elif filter_field_type == '[date]':
+                    res[r.id] = '#'+len(filter_id.filters)*'-'+"#\n# "+filter_id.filters+'\n\tif (' + field + ' <= \'' + str(r.value1_date)+'\')'
+                    if r.value2_date:
+                        res[r.id] += ' and ('+field+ ' >= \'' + str(r.value2_date)+'\')'+':\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n' or ''
+                elif filter_field_type == '[datetime]':
+                    res[r.id] = '#'+len(filter_id.filters)*'-'+"#\n# "+filter_id.filters+'\n\tif (' + field + ' <= \'' + str(r.value1_datetime)+'\')'
+                    if r.value2_datetime:
+                        res[r.id] += ' and ('+field+ ' >= \'' + str(r.value2_datetime)+'\')'+':\n\t\tresult &= True\n\telse:\n\t\tresult &= False\n' or ''
+        return res
+
+    _columns = {
+        'name': fields.function(_get_name, method=True, string='Filter coditions', type='char', size=128),
+        'code': fields.function(_get_code, method=True, string='Code', type='char', size=128),
+        #'rec_filter_id': fields.many2one('inv.rec_filter', 'Filter'),
+        'cond_type': fields.many2one('inv.rec_type', 'Condition type', domain="[('type', '=', parent.field_type)]", required=True),
+        'state': fields.function(_change_state, method=True, string='State', type='char', size=128),
+        #'cond_value': fields.one2many('inv.cond_value', 'rec_filter_cond_id', 'Condition value', states={'[many2many]':[('readonly',False)],'[many2one]':[('readonly',False)],'[one2many]':[('readonly',False)]},readonly=True),
+        'cond_value': fields.char('Condition value', size=128, states={'[many2many]':[('readonly',False),('required',True)],'[many2one]':[('readonly',False),('required',True)],'[one2many]':[('readonly',False),('required',True)]},readonly=True),
+        'value1_char': fields.char('Char', size=256, states={'[char]':[('readonly',False),('required',True)],'[selection]':[('readonly',False),('required',True)]}, readonly=True),
+        'value1_bool': fields.boolean('Boolean', states={'[boolean]':[('readonly',False),('required',True)]}, readonly=True),
+        'value1_int': fields.integer('Integer1', states={'[integer]|1|':[('readonly',False),('required',True)],'[integer]|2|':[('readonly',False),('required',True)]}, readonly=True),
+        'value2_int': fields.integer('Integer2', states={'[integer]|2|':[('readonly',False),('required',True)]}, readonly=True),
+        'value1_float': fields.float('Float1', states={'[float]|1|':[('readonly',False)],'[float]|2|':[('readonly',False),('required',True)]}, readonly=True),
+        'value2_float': fields.float('Float2', states={'[float]|2|':[('readonly',False),('required',True)]}, readonly=True),
+        'value1_date': fields.date('Date1', states={'[date]|1|':[('readonly',False),('required',True)],'[date]|2|':[('readonly',False),('required',True)]}, readonly=True),
+        'value2_date': fields.date('Date2', states={'[date]|2|':[('readonly',False),('required',True)]}, readonly=True),
+        'value1_datetime': fields.date('DateTime1', states={'[datetime]|1|':[('readonly',False),('required',True)],'[datetime]|2|':[('readonly',False),('required',True)]}, readonly=True),
+        'value2_datetime': fields.date('DateTime2', states={'[datetime]|2|':[('readonly',False),('required',True)]}, readonly=True),
+    }
+
+    def on_change_state(self, cr, uid, ids, field, field_type, field_id, value1_char, value1_bool, \
+            value1_int, value2_int, value1_float, value2_float, value1_date, value2_date, value1_datetime, value2_datetime, cond_value):
+        data = _change_state(self, cr, uid, ids, field, field_type, field_id, value1_char, value1_bool, \
+            value1_int, value2_int, value1_float, value2_float, value1_date, value2_date, value1_datetime, value2_datetime, cond_value)
+        return {'value':data}
+
+rec_filter_cond()
+
+class service(osv.osv):
+    _name = "inv.service"
+    _rec_name = "name"
+
+    _columns = {
+        'name': fields.char('Name', size=64, required=True),
+        'method_ids': fields.many2many('inv.method', 'inv_serv_meth_rel', 'service_id', 'method_id', 'Methodologies'),
+        'journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal', required=True),
+        'analytic_account_branch': fields.many2one('account.analytic.account', 'Analytic account branch', required=True),
+        'pricelist_id': fields.many2one('product.pricelist', 'Sale Pricelist', domain="[('type','=','sale')]"),
+        'purch_pricelist_id': fields.many2one('product.pricelist', 'Purchase Pricelist', domain="[('type','=','purchase')]"),
+        'invoicing': fields.selection([('trigger','Trigger'),('period','Period')], 'Invoicing based on'),
+        'interval_unit': fields.selection([('days','Day(s)'),('weeks','Week(s)'),('months','Month(s)'),('years','Year(s)')], 'Interval Unit'),
+        'int_unit_number': fields.integer('Invoice Every'),
+        'cron_offset': fields.integer('Cron offset(hours)'),
+        'req_users': fields.many2many('res.users', 'inv_req_users_rel', 'inv_id', 'tgroup_id', 'Work Team'),
+    }
+
+    def _test_int_unit_number(self, cr, uid, ids):
+        for x in self.browse(cr, uid, ids, {}):
+            if x.int_unit_number < 1:
+                raise osv.except_osv(_('Input data error!'), _('"Invoice Every" field cannot be less than 1!'))
+                return False
+        return True
+
+    _defaults = {
+        'invoicing' : lambda *a: 'period',
+        'interval_unit' : lambda *a: 'months',
+        'int_unit_number' : lambda *a: 1,
+    }
+
+    _constraints = [
+            (_test_int_unit_number, '', ['int_unit_number']),
+        ]
+
+service()
+
+class calc(osv.osv):
+    _name = "inv.calc"
+    _rec_name = "method_id"
+
+    def _get_model(self, cr, uid, context={}):
+        if 'model_id' in context.keys():
+            return context['model_id']
+        return ''
+
+    def _get_invoice_factor(self, cr, uid, context):
+        obj = self.pool.get('hr_timesheet_invoice.factor')
+        ids = obj.search(cr, uid, [])
+        for r in obj.browse(cr, uid, ids, {}):
+            if r.factor == 0.0:
+                return r.id
+        return False
+
+    _columns = {
+        'method_id': fields.many2one('inv.method', 'Methodology', ondelete='cascade'),
+        'product_id': fields.many2one('product.product', 'Product', domain="[('type','=',product_type)]", required=True),
+        'invoicing_id': fields.many2one('hr_timesheet_invoice.factor', 'Invoicing', required=True),
+        'sequence': fields.integer('Calculation Sequence'),
+        'calculations': fields.one2many('inv.calc_filter', 'calc_id', 'Calculation lines'),
+        'description': fields.many2one('inv.description', 'Description', domain="[('id','=', False)]", ondelete="cascade", required=True),
+        'quantity': fields.many2one('inv.quantity', 'Quantity',  domain="[('id','=', False)]", ondelete='cascade', required=True),
+        'descr_express': fields.text('Expression'),
+        'descr_field': fields.many2one('ir.model.fields', 'Value of', domain="[('model_id','=', parent.model_id)]"),
+        'quantity_express': fields.text('Expression'),
+        'quantity_field': fields.many2one('ir.model.fields', 'Value of', domain="[('model_id','=', parent.model_id)]"),
+        'description': fields.selection([('empty', 'Empty'),('date', 'Calculation Date'),('period', 'Calculation Period'),('field','Field'),('expression','Expression')],'Set description', required=True),
+        'quantity': fields.selection([('eqone','One'),('count','Total Count'),('field','Field'),('expression','Expression')], 'Set quantity', required=True),
+        'product_type': fields.selection([('product','Stockable Product'),('consu', 'Consumable'),('service','Service')], 'Product Type', required=True),
+        'code': fields.text('Code'),
+        'manual': fields.boolean('Manual', select=False),
+        'model_id': fields.many2one('ir.model', 'Model', domain="[('id','=', parent.model_id)]", required=True),
+    }
+
+    _defaults = {
+        'sequence' : lambda *a: 99,
+        'invoicing_id': _get_invoice_factor,
+        'description': lambda *a: 'date',
+        'quantity': lambda *a: 'eqone',
+        'product_type': lambda *a: 'service',
+        'model_id': _get_model,
+    }
+
+    _order = 'sequence'
+
+    def _field_value(self, cr, uid, value_id, method_id, res_var):
+        method = self.pool.get('inv.method')
+        p = method.browse(cr, uid, method_id, {})
+        value = self.pool.get('ir.model.fields').browse(cr, uid, value_id, {}).name
+        if value_id:
+            cr.execute("SELECT ttype, relation FROM ir_model_fields WHERE name='"+value+"' and model='"+p.model_id.model+"'")
+            query_res = cr.fetchone()
+            if query_res[0] == 'many2one':
+                field_value = "ids = self.pool.get('"+p.model_id.model+"').browse(cr, uid, rec_id, {})."+value+".id\n"
+                field_value += res_var+" = self.pool.get('"+query_res[1]+"').name_get(cr, uid, [ids], {})"
+            elif query_res[0] == 'one2many' or query_res[0] == 'many2many':
+                field_value = "ids = map(int, self.pool.get('"+p.model_id.model+"').browse(cr, uid, rec_id, {})."+value+")\n"
+                field_value += res_var+" = self.pool.get('"+query_res[1]+"').name_get(cr, uid, ids, {})"
+            else:
+                field_value = res_var+" = self.pool.get('"+p.model_id.model+"').browse(cr, uid, rec_id, {})."+value
+
+        return field_value
+
+    def change_descr(self, cr, uid, ids, field, value_id, method_id):
+        data = {}
+        if not field:
+            return {'value':{}}
+        else:
+            if field=='empty':
+                data['descr_express'] = ''
+                data['descr_field'] = False
+            elif field=='expression':
+                data['descr_field'] = False
+            elif field=='field' and value_id:
+                data['descr_express'] = self._field_value(cr, uid, value_id, method_id, 'desc')
+            elif field=='field':
+                data['descr_express'] = ''
+            elif field=='date':
+                data['descr_field'] = False
+                data['descr_express'] = "desc = convert_date(self, now().strftime('%Y-%m-%d'))"
+            elif field=='period':
+                data['descr_field'] = False
+                data['descr_express'] = "desc = d_list.browse(cr, uid, date_id, {}).period"
+        return {'value':data}
+
+    def change_quant(self, cr, uid, ids, field, value_id, method_id):
+        data = {}
+        if not field:
+            return {'value':{}}
+        else:
+            if field=='eqone':
+                data['quantity_express'] = 'quant = 1'
+                data['quantity_field'] = False
+            elif field=='count':
+                data['quantity_express'] = 'quant = len(mas_after)'
+                data['quantity_field'] = False
+            elif field=='expression':
+                data['quantity_field'] = False
+            elif field=='field' and value_id:
+                data['quantity_express'] = self._field_value(cr, uid, value_id, method_id, 'quant')
+        return {'value':data}
+
+    def _test_fields(self, cr, uid, ids):
+        result = ''
+        cur_id = "".join(map(str, ids))
+        obj = self.browse(cr, uid, int(cur_id), {})
+        if (obj.description == 'field' and not obj.descr_field) or (obj.quantity == 'field' and not obj.quantity_field):
+            raise osv.except_osv(_('No field value!'), _('Field "Value of" not defined !'))
+            return False
+        return True
+
+    def _get_code(self, cr, uid, ids):
+        result = ''
+        cur_id = "".join(map(str, ids))
+        obj = self.browse(cr, uid, int(cur_id), {})
+        if not obj.method_id or obj.manual:
+            return True
+        calc_filter_obj = self.pool.get('inv.calc_filter')
+        cond_obj = self.pool.get('inv.rec_filter_cond')
+        calc_filter_ids = calc_filter_obj.search(cr, uid, [('calc_id','=',obj.id)])
+        model = obj.method_id.model_id.model
+        result += 'obj = self.pool.get(\''+model+'\')\nres_list = []\n'
+        result += "for cur_object in obj.browse(cr, uid, obj_ids, {}):\n\tresult = True\n"
+        for s in calc_filter_obj.browse(cr, uid, calc_filter_ids, {}):
+            if s.var == 'count': continue
+            for c in map(int, s.condition_id):
+                result += cond_obj.browse(cr, uid, c, {}).code
+        result += '\n'
+        for s in calc_filter_obj.browse(cr, uid, calc_filter_ids, {}):
+            if s.var == 'field': continue
+            for c in map(int, s.condition_id):
+                result += cond_obj.browse(cr, uid, c, {}).code
+        result += "\tres_list.append(result)\n"
+        cr.execute("""
+                UPDATE inv_calc
+                SET code = %s
+                WHERE id in (%s)
+               """, (result, ','.join(map(str,ids))))
+        return True
+
+    def write(self, cr, uid, ids, vals, context=None):
+        if not context:
+            context={}
+        vals=vals.copy()
+        if 'description' in vals and (vals['description']=='empty' or vals['description']=='date' or vals['description']=='period'):
+            vals['descr_field'] = False
+        elif 'description' in vals and vals['description']=='expression':
+            vals['descr_field'] = False
+        if 'quantity' in vals and (vals['quantity']=='one' or vals['quantity']=='count'):
+            vals['quantity_field'] = False
+        elif 'quantity' in vals and vals['quantity']=='expression':
+            vals['quantity_field'] = False
+        return super(calc, self).write(cr, uid, ids, vals, context=context)
+
+    def create(self, cr, uid, vals, context={}):
+        if not context:
+            context={}
+        maxseq = 1
+        ids = self.search(cr, uid, [])
+        if ids == []:
+            vals=vals.copy()
+            vals['sequence'] = maxseq
+        for r in self.browse(cr, uid, ids, {}):
+            if r.sequence >= maxseq:
+                maxseq = r.sequence
+                vals=vals.copy()
+                vals['sequence'] = maxseq + 1
+        c = context.copy()
+        c['novalidate'] = True
+        result = super(calc, self).create(cr, uid, vals, c)
+        return result
+
+    def calc_field_type(self, cr, uid, ids, field1, field2):
+        data = {}
+        if field2 == 'count':
+            data['field_type'] = '[integer]'
+            data['field'] = False
+            return {'value':data}
+        elif not field1:
+            data['field_type'] = ''
+            return {'value':data}
+        else:
+            data['field_type'] = '['+self.pool.get('ir.model.fields').browse(cr, uid, field1).ttype+']'
+        return {'value':data}
+
+    _constraints = [
+            (_get_code, '', ['code']),
+        (_test_fields, '', ['descr_field', 'quantity_field']),
+        ]
+
+calc()
+
+class agreement(osv.osv):
+    _name = "inv.agreement"
+    _rec_name = "name"
+
+    def _number_of_calls(self, cr, uid, ids, field, arg=None, context={}):
+        res = {}
+        remaining = 0
+
+        for r in self.browse(cr, uid, ids, context):
+            if r.service.invoicing == 'trigger':
+                res[r.id] = -1
+                continue
+            if r.signed_date < now().strftime('%Y-%m-%d'):
+                signed_date = now().strftime('%Y-%m-%d')
+            else:
+                signed_date = r.signed_date
+            if r.state != 'done' and r.service.invoicing == 'period':
+                if r.cron_id:
+                    cron_ids = r.cron_id.id
+                    remaining = self.pool.get('ir.cron').browse(cr, uid, cron_ids, {}).numbercall
+                elif r.cur_effect_date and signed_date and r.service.interval_unit and r.service.int_unit_number:
+                    period = DateTime.strptime(r.cur_effect_date, '%Y-%m-%d') - DateTime.strptime(signed_date , '%Y-%m-%d')
+                    if r.service.interval_unit == 'days':
+                        remaining = int(period.day / r.service.int_unit_number)
+                    elif r.service.interval_unit == 'weeks':
+                        remaining = int(period.day / 7.0 / r.service.int_unit_number)
+                    elif r.service.interval_unit == 'months':
+                        remaining = int(round(period.day / 30.0 / r.service.int_unit_number))
+                    elif r.service.interval_unit == 'years':
+                        remaining = int(period.day / 365.0 / r.service.int_unit_number)
+                        if r.payment == 'start': 
+                            remaining += 1
+            res[r.id] = remaining
+        return res
+
+    def _number_of_uninv_entries(self, cr, uid, ids, field, arg=None, context={}):
+        res = {}
+
+        lines_obj = self.pool.get('account.analytic.line')
+        for r in self.browse(cr, uid, ids, context):
+            count = len(lines_obj.search(cr, uid, [('agr_id', '=', r.id),('invoice_id','=',False)], context=context))
+            if arg:
+                statement = "if count"
+                for a in arg:
+                    if a[1]=='=': a[1]='=='
+                    statement += a[1]+str(a[2])
+                    if a!=arg[-1]:
+                        statement += " and count"
+                statement+=':\n\tres = count'
+                localspace = {"count":count,'res':False}
+                exec statement in localspace
+                if localspace['res']:
+                    res[r.id] = localspace['res']
+            else:    
+                res[r.id] = count
+        return res
+
+    _columns = {
+        'name': fields.char('Description', size=64, states={'running':[('readonly',True)],'done':[('readonly',True)]}),
+        'number': fields.char('Agreement Number', size=32, help="Leave empty to get the number assigned by a sequence.", states={'running':[('readonly',True)],'done':[('readonly',True)]}, required=False),
+        'partner_id': fields.many2one('res.partner', 'Partner', states={'running':[('readonly',True)],'done':[('readonly',True)]}),
+        'state': fields.selection([('draft','Draft'),('running','Running'), ('done','Done'), ('error', 'Error')], 'State', required=True),
+        'signed_date': fields.date('Start Date', help="Date when agreement was signed.", states={'running':[('readonly',True)],'done':[('readonly',True)]}),
+        'partner_signed_date': fields.date('Signed on', help="Date when agreement was signed.", states={'running':[('readonly',True)],'done':[('readonly',True)]}),
+        'init_effect_date': fields.date('Period End Date', readonly=True),
+        'period_unit_number': fields.integer('Period', help="Period time to prolong the next agreement", states={'running':[('readonly',True)],'done':[('readonly',True)]}),
+        'period_unit': fields.selection([('days','Day(s)'),('weeks','Week(s)'),('months','Month(s)'),('years','Year(s)')], 'Unit', states={'running':[('readonly',True)],'done':[('readonly',True)]}),
+        'cur_effect_date': fields.date('Expire Date', help="Resembles the current validity period.", states={'running':[('readonly',True)], 'done':[('readonly',True)]}),
+        'analytic_account': fields.many2one('account.analytic.account', 'Analytic Account', help='Leave empty to let the system create an account in a branch defined by the Service.', states={'running':[('readonly',True)],'done':[('readonly',True)]}),
+        'service': fields.many2one('inv.service', 'Service', states={'running':[('readonly',True)],'done':[('readonly',True)]}, required=True),
+        'analytic_entries': fields.one2many('account.analytic.line', 'agr_id', 'Entries', readonly=True),
+        'date_list': fields.one2many('inv.date_list', 'agreement_id', 'Invoice Log',states={'running':[('readonly',True)],'done':[('readonly',True)]}),
+        'prolong': fields.selection([('recurrs','Prolong'),('unlimited','Unlimited Term'),('fixed','Fixed Term')], 'Prolongation', help="Sets whether to prolong the agreement for the next term or not.", states={'running':[('readonly',True)],'done':[('readonly',True)]}),
+        'recurr_unit_number': fields.integer('Interval', help="Time before current validity expires to prolong the agreement for the next term.", states={'running':[('readonly',True)],'done':[('readonly',True)]}),
+        'recurr_unit': fields.selection([('days','Day(s)'),('weeks','Week(s)'),('months','Month(s)'),('years','Year(s)')], 'Unit', states={'running':[('readonly',True)],'done':[('readonly',True)]}),
+        'payment': fields.selection([('start','In advance'),('end','After')], 'Payment', states={'running':[('readonly',True)],'done':[('readonly',True)]}),
+        'cron_id': fields.many2one('ir.cron', 'Scheduler'),
+        'cron_nextdate': fields.many2one('ir.cron', 'Set next date'),
+        'repeat' : fields.boolean('Repeat missed', states={'running':[('readonly',True)],'done':[('readonly',True)]}),
+        'active' : fields.boolean('Active', states={'running':[('readonly',True)]}),
+        'calls': fields.function(_number_of_calls, method=True, string='Number of invoices', help="Number of invoices to be written.", type='integer'),
+        'uninv_entries_count': fields.function(_number_of_uninv_entries, method=True, string='Uninvoiced analytic entries', help="Number of uninvoiced analytic entries.", type='integer'),
+    }
+
+    def _test_recurr_unit_number(self, cr, uid, ids):
+        for x in self.browse(cr, uid, ids, {}):
+            if x.recurr_unit_number < 1:
+                raise osv.except_osv(_('Input data error!'), _('"Number of Units" field cannot be less than 1 !'))
+                return False
+        return True
+
+    _defaults = {
+        'state' : lambda *a: 'draft',
+        'payment' : lambda *a: 'end',
+        'recurr_unit_number' : lambda *a: 1,
+        'recurr_unit' : lambda *a: 'months',
+        'prolong' : lambda *a: 'recurrs',
+        'repeat': lambda *a: True,
+        'active': lambda *a: True,
+        'signed_date' : lambda *a: now().strftime('%Y-%m-%d'),
+        'period_unit_number': lambda *a: 1,
+        'period_unit': lambda *a: 'months',
+    }
+
+    _constraints = [
+            (_test_recurr_unit_number, '', ['recurr_unit_number']),
+        ]
+
+    def name_get(self, cr, uid, ids, context=None):
+        res = []
+        for agr in self.browse(cr, uid, ids):
+            if agr.name and agr.number:
+                res.append((agr.id, agr.number + '/' + agr.name))
+            elif not agr.name and agr.number:
+                res.append((agr.id, agr.number))
+            elif not agr.number and agr.name:
+                res.append((agr.id, agr.name))
+            else:
+                res.append((agr.id, agr.partner_id.name))
+        return res
+
+    def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
+        if context is None:
+            context = {}
+
+        domain = []
+        for a in args:
+            if 'uninv_entries_count' in a:
+                domain.append(a)
+        limit1=None
+        ids = super(agreement,self).search(cr, uid, [], offset, limit1, order, context=context, count=count)
+        if domain:
+            uninv_entries_count = self._number_of_uninv_entries(cr, uid, ids, 'uninv_entries_count', domain, context=context)
+            res_ids = []
+            for rec in uninv_entries_count:
+                res_ids.append(rec)
+            args.append(['id','in',res_ids])
+        return super(agreement,self).search(cr, uid, args, offset, limit, order, context=context, count=count)
+
+    def _set_next_date(self, cr, uid, id, context={}):
+        obj = self.browse(cr, uid, id, {})
+        self.pool.get('ir.cron').unlink(cr, uid, [obj.cron_nextdate.id])
+        if obj.payment == 'start' and obj.service.invoicing != 'trigger':
+            if obj.signed_date < now().strftime('%Y-%m-%d'):
+                signed_date = now().strftime('%Y-%m-%d')
+            else:
+                signed_date = obj.signed_date
+            temp = DateTime.strptime(signed_date, '%Y-%m-%d')
+            if temp.day != 1 and obj.cron_id:
+                if obj.service.interval_unit == 'days':
+                    temp = temp + DateTime.RelativeDateTime(days=1)
+                elif obj.service.interval_unit == 'weeks':
+                    temp = temp + DateTime.RelativeDateTime(weekday=(DateTime.Monday,0), days=7)
+                elif obj.service.interval_unit == 'months':
+                    temp = temp + DateTime.RelativeDateTime(months=1, days=-temp.day+1)
+                elif obj.service.interval_unit == 'years':
+                    temp = temp + DateTime.RelativeDateTime(months=12-temp.month+1, days=-temp.day+1)
+                temp += DateTime.RelativeDateTime(hours=obj.service.cron_offset)
+            self.pool.get('ir.cron').write(cr, uid, obj.cron_id.id, {'nextcall':temp.strftime('%Y-%m-%d %H:%M:%S')})
+        return True
+
+    def _make_invoice_log(self, cr, uid, row, start_date, numbercall, increment_size, context={}):
+        d_list = self.pool.get('inv.date_list')
+        start_numbercall = numbercall
+        while(numbercall > 0):
+            date = start_date.strftime('%Y-%m-%d')
+###########################################################
+            if row.payment == 'end':
+                if row.service.interval_unit == 'days':
+                    date12 = DateTime.strptime(date, '%Y-%m-%d')
+                    date1 = date12 - DateTime.RelativeDateTime(days=row.service.int_unit_number)
+                    if date1.strftime('%Y-%m-%d') < row.signed_date:
+                        date1 = DateTime.strptime(row.signed_date, '%Y-%m-%d')
+                    date2 = date12 - DateTime.RelativeDateTime(days=1)
+                    pdate1 = date1.strftime('%Y-%m-%d')
+                    pdate2 = date2.strftime('%Y-%m-%d')
+                    if row.service.int_unit_number > 1:
+                        period = convert_date(self, pdate1) + ' - ' + convert_date(self, pdate2)
+                    else:
+                        period = convert_date(self, date1.strftime('%Y-%m-%d'))
+                elif row.service.interval_unit == 'weeks':
+                    date12 = DateTime.strptime(date, '%Y-%m-%d')
+                    date1 = date12 - DateTime.RelativeDateTime(days=row.service.int_unit_number*7)
+                    if date1.strftime('%Y-%m-%d') < row.signed_date:
+                        date1 = DateTime.strptime(row.signed_date, '%Y-%m-%d')
+                    date2 = date12 - DateTime.RelativeDateTime(days=1)
+                    if date2.strftime('%Y-%m-%d') > row.cur_effect_date or date2.strftime('%Y-%m-%d') > row.init_effect_date:
+                        date2 = DateTime.strptime(row.cur_effect_date or row.init_effect_date, '%Y-%m-%d')
+                    pdate1 = date1.strftime('%Y-%m-%d')
+                    pdate2 = date2.strftime('%Y-%m-%d')
+                    period = convert_date(self, date1.strftime('%Y-%m-%d')) + ' - ' + convert_date(self, date2.strftime('%Y-%m-%d'))
+                elif row.service.interval_unit == 'months':
+                    date_one = DateTime.strptime(date, '%Y-%m-%d')-DateTime.RelativeDateTime(months=row.service.int_unit_number)
+                    date2 = date_one + DateTime.RelativeDateTime(months=row.service.int_unit_number)
+                    date1 = date_one
+                    date2 -= DateTime.RelativeDateTime(days=1)
+                    pdate1 = date1.strftime('%Y-%m-%d')
+                    pdate2 = date2.strftime('%Y-%m-%d')
+                    if row.service.int_unit_number > 1:
+                        period = convert_date(self, pdate1) + ' - ' + convert_date(self, pdate2)
+                    else:
+                        period = convert_date(self, date_one.strftime('%Y-%m'))
+                elif row.service.interval_unit == 'years':
+                    date1 = DateTime.strptime(date, '%Y-%m-%d')
+                    date2 = date1 + DateTime.RelativeDateTime(months=12*row.service.int_unit_number, days=-1)
+                    pdate1 = date1.strftime('%Y-%m-%d')
+                    pdate2 = date2.strftime('%Y-%m-%d')
+                    if pdate2 > row.cur_effect_date or pdate2 > row.init_effect_date:
+                        pdate2 = row.cur_effect_date or row.init_effect_date
+                    period = convert_date(self, pdate1) + ' - ' + convert_date(self, pdate2)
+            elif row.payment == 'start':
+                if row.service.interval_unit == 'days':
+                    date12 = DateTime.strptime(date, '%Y-%m-%d')
+                    date1 = date12
+                    date2 = date12 + DateTime.RelativeDateTime(days=row.service.int_unit_number-1)
+                    pdate1 = date1.strftime('%Y-%m-%d')
+                    pdate2 = date2.strftime('%Y-%m-%d')
+                    if row.service.int_unit_number > 1:
+                        period = convert_date(self, pdate1) + ' - ' + convert_date(self, pdate2)
+                    else:
+                        period = convert_date(self, pdate1)
+                elif row.service.interval_unit == 'weeks':
+                    date12 = DateTime.strptime(date, '%Y-%m-%d')
+                    date1 = date12
+                    date2 = date12 + DateTime.RelativeDateTime(weekday=(DateTime.Sunday,0), days=row.service.int_unit_number*7-7)
+                    pdate1 = date1.strftime('%Y-%m-%d')
+                    pdate2 = date2.strftime('%Y-%m-%d')
+                    period = convert_date(self, pdate1) + ' - ' + convert_date(self, pdate2)
+                elif row.service.interval_unit == 'months':
+                    date1 = DateTime.strptime(date, '%Y-%m-%d')
+                    date2 = date1 + DateTime.RelativeDateTime(months=row.service.int_unit_number, day=1, days=-1)
+#                    if date2.strftime('%Y-%m-%d') > row.cur_effect_date:# or date2.strftime('%Y-%m-%d') > row.init_effect_date:
+#                        date2 = DateTime.strptime(row.cur_effect_date or row.init_effect_date, '%Y-%m-%d')
+                    pdate1 = date1.strftime('%Y-%m-%d')
+                    pdate2 = date2.strftime('%Y-%m-%d')
+                    if row.service.int_unit_number > 1:
+                        period = convert_date(self, pdate1) + ' - ' + convert_date(self, pdate2)
+                    else:
+                        date2 = date1 + DateTime.RelativeDateTime(months=1, day=1, days=-1)
+#                        pdate1 = date1.strftime('%Y-%m-%d')
+                        period = convert_date(self, date1.strftime('%Y-%m'))
+                elif row.service.interval_unit == 'years':
+                    date1 = DateTime.strptime(date, '%Y-%m-%d')
+                    date2 = date1 + DateTime.RelativeDateTime(months=12*row.service.int_unit_number, days=-1)
+                    pdate1 = date1.strftime('%Y-%m-%d')
+                    pdate2 = date2.strftime('%Y-%m-%d')
+                    period = convert_date(self, pdate1) + ' - ' + convert_date(self, pdate2)
+#######################################################
+            d_list.create(cr, uid, {'agreement_id':row.id, 'date':start_date.strftime('%Y-%m-%d'), 'period':period, 'pdate1':pdate1, 'pdate2':pdate2})
+            if row.service.interval_unit == 'weeks' and numbercall==start_numbercall:
+                start_date = DateTime.strptime(start_date.strftime('%Y-%m-%d'), '%Y-%m-%d')+DateTime.RelativeDateTime(weekday=(DateTime.Monday,0))
+            elif row.service.interval_unit == 'months' and numbercall==start_numbercall:
+                start_date = DateTime.strptime(start_date.strftime('%Y-%m-%d'), '%Y-%m-%d')+DateTime.RelativeDateTime(day=1)
+            start_date += increment_size
+            numbercall -= 1
+        return start_date
+
+    def _prolong_optimized(self, cr, uid, context={}):
+        ids = self.search(cr, uid, [])
+        for obj in self.browse(cr, uid, ids, context=context):
+            if obj.state != 'running':
+                continue
+            if obj.prolong == 'recurrs':
+                if obj.service.interval_unit == 'days':
+                    inc = {'days':obj.service.int_unit_number}
+                elif obj.service.interval_unit == 'weeks':
+                    inc = {'days':7*obj.service.int_unit_number}
+                elif obj.service.interval_unit == 'months':
+                    inc = {'months':obj.service.int_unit_number}
+                elif obj.service.interval_unit == 'years':
+                    inc = {'months':12*obj.service.int_unit_number}
+                    
+                if 'days' in inc:
+                    increment=DateTime.RelativeDateTime(days=inc['days'])
+                elif 'months' in inc:
+                    increment=DateTime.RelativeDateTime(months=inc['months'])
+                    
+                next_start_date = self._get_start_date(cr, uid, obj)
+                next_start_date = next_start_date - DateTime.RelativeDateTime(days=next_start_date.day-1)
+                temp = now()
+                numbercall = 0
+                
+                if next_start_date < temp:
+                    period = temp - next_start_date
+                    
+                    if obj.service.interval_unit == 'days':
+                        numbercall = int(round(period.day / obj.service.int_unit_number))
+                        last_date = next_start_date + DateTime.RelativeDateTime(days=numbercall*inc['days'])
+                    elif obj.service.interval_unit == 'weeks':
+                        numbercall = int(round(period.day / 7.0 / obj.service.int_unit_number))
+                        last_date = next_start_date + DateTime.RelativeDateTime(days=numbercall*inc['days'])
+                    elif obj.service.interval_unit == 'months':
+                        numbercall = int(math.ceil(period.day / 30.0 / obj.service.int_unit_number))
+                        last_date = next_start_date + DateTime.RelativeDateTime(months=numbercall*inc['months'])
+                    elif obj.service.interval_unit == 'years':
+                        numbercall = int(round(period.day / 365.0 / obj.service.int_unit_number))
+                        last_date = next_start_date + DateTime.RelativeDateTime(months=numbercall*inc['months'])
+                else:
+                    last_date = next_start_date
+                
+                period = last_date - temp
+                    
+                if (obj.recurr_unit == 'days' and period.days <= obj.recurr_unit_number) or \
+                   (obj.recurr_unit == 'weeks' and period.days <= 7*obj.recurr_unit_number) or \
+                   (obj.recurr_unit == 'months' and period.days <= 30*obj.recurr_unit_number) or \
+                   (obj.recurr_unit == 'years' and period.days <= 365*obj.recurr_unit_number):
+                    numbercall += 1
+                
+                if numbercall > 0:
+                    next_start_date = self._make_invoice_log(cr, uid, obj, next_start_date, numbercall, increment, context=context)
+                    self.write(cr, uid, [obj.id], {'cur_effect_date': next_start_date})
+                    
+            elif obj.prolong == 'unlimited':
+                if (obj.recurr_unit == 'days' and t.day <= obj.recurr_unit_number) or \
+                   (obj.recurr_unit == 'weeks' and t.day <= 7*obj.recurr_unit_number) or \
+                   (obj.recurr_unit == 'months' and t.day <= 30*obj.recurr_unit_number) or \
+                   (obj.recurr_unit == 'years' and t.day <= 365*obj.recurr_unit_number):
+                    self.write(cr, uid, [id], {'cur_effect_date':'2099-01-01'})
+#                    self.pool.get('ir.cron').write(cr, uid, obj.cron_id.id, {'numbercall':-1,'active':True})
+            elif obj.prolong == 'fixed':
+                inv_log = self.pool.get('inv.date_list')
+                date_ids = map(int, obj.date_list)
+                if not inv_log.search(cr, uid, [('id','in',date_ids),('status','!=','inv')]):
+                    self.set_done(cr, uid, [obj.id], context=context) 
+        return True
+
+    def onchange_payment(self, cr, uid, ids, signed_date, cur_effect_date, service_id, payment):
+        res = {}
+        if signed_date < now().strftime('%Y-%m-%d'):
+            signed_date = now().strftime('%Y-%m-%d')
+        if service_id:
+            obj = self.pool.get('inv.service').browse(cr, uid, service_id, {})
+            if cur_effect_date and signed_date and obj.interval_unit and obj.int_unit_number:
+                period = DateTime.strptime(cur_effect_date, '%Y-%m-%d') - DateTime.strptime(signed_date, '%Y-%m-%d')
+                if obj.interval_unit == 'days':
+                    res['calls'] = int(period.day / obj.int_unit_number)
+                elif obj.interval_unit == 'weeks':
+                    res['calls'] = int(period.day / 7.0 / obj.int_unit_number)
+                elif obj.interval_unit == 'months':
+                    res['calls'] = int(round(period.day / 30.0 / obj.int_unit_number))
+                elif obj.interval_unit == 'years':
+                    res['calls'] = int(period.day / 365.0 / obj.int_unit_number)
+                    if payment == 'start': 
+                        res['calls'] += 1
+        return {'value':res}
+
+    def _get_start_date(self, cr, uid, rec):
+        if rec.service.invoicing == 'period':
+            date_list = map(int, rec.date_list)
+            dl_ids = self.pool.get('inv.date_list').search(cr, uid, [('id','in',date_list)])
+            start_date = self.pool.get('inv.date_list').browse(cr, uid, dl_ids.pop(), {}).date
+
+            if rec.service.interval_unit == 'days':
+                increment_size = DateTime.RelativeDateTime(days=rec.service.int_unit_number)
+            elif rec.service.interval_unit == 'weeks':
+                increment_size = DateTime.RelativeDateTime(days=7*rec.service.int_unit_number)
+            elif rec.service.interval_unit == 'months':
+                increment_size = DateTime.RelativeDateTime(months=rec.service.int_unit_number)
+            elif rec.service.interval_unit == 'years':
+                increment_size = DateTime.RelativeDateTime(months=12*rec.service.int_unit_number)
+
+            start_date = DateTime.strptime(start_date, '%Y-%m-%d')+increment_size
+
+        if rec.service.invoicing == 'trigger':
+            start_date = DateTime.strptime(rec.signed_date, '%Y-%m-%d')
+        return start_date
+    
+    def _get_last_date(self, cr, uid, rec):
+        if rec.service.invoicing == 'period':
+            date_list = map(int, rec.date_list)
+            dl_ids = self.pool.get('inv.date_list').search(cr, uid, [('id','in',date_list)])
+            start_date = self.pool.get('inv.date_list').browse(cr, uid, dl_ids.pop(), {}).date
+            start_date = DateTime.strptime(start_date, '%Y-%m-%d')
+        return start_date
+    
+    def _calc_period(self,cr, uid, obj):
+        if obj:
+            if obj.period_unit == 'days':
+                increment_size = DateTime.RelativeDateTime(days=obj.period_unit_number)
+            elif obj.period_unit == 'weeks':
+                increment_size = DateTime.RelativeDateTime(days=7*obj.period_unit_number)
+            elif obj.period_unit == 'months':
+                increment_size = DateTime.RelativeDateTime(months=obj.period_unit_number)
+            elif obj.period_unit == 'years':
+                increment_size = DateTime.RelativeDateTime(months=12*obj.period_unit_number)
+
+            return DateTime.strptime(obj.signed_date, '%Y-%m-%d')+increment_size
+        else:
+            return False
+
+    def set_process(self, cr, uid, ids, context={}):
+        for row in self.browse(cr, uid, ids, {}):
+            obj = self.browse(cr, uid, row.id, {})
+            agr_period_data = self._calc_period(cr, uid, obj)
+            if not agr_period_data:
+                raise osv.except_osv(_('Invalid action !'), _('System could not calculate period range !'))
+            else:
+                self.write(cr, uid, [row.id], {'init_effect_date': agr_period_data.strftime('%Y-%m-%d')})                
+            d_list = self.pool.get('inv.date_list')
+            date_list = map(int, row.date_list)
+            date_error_ids = d_list.search(cr, uid, [('id','in',date_list),('status','=','error')])
+            if date_error_ids:
+                raise osv.except_osv(_('Invalid action !'), _('This Agreement is not operable, some "Invoice Log" entries are in "Error" state. Please check "Invoice Log" tab.'))
+            ids1 = map(int, obj.service.method_ids)
+            if type(row.name)==unicode:
+                name=row.name
+            else:
+                name=unicode(row.name or '', "UTF-8")
+            res = {'name':name, 'model':'inv.method', 'args':[ids1,row.id], 'function':'_run_filters', 'user_id':uid, 'interval_type':row.service.interval_unit, 'interval_number':row.service.int_unit_number, 'doall':row.repeat}
+            if res['name']:
+                if type(row.partner_id.name)==unicode:
+                    partner_name = row.partner_id.name
+                else:
+                    partner_name = unicode(row.partner_id.name or '', "UTF-8")
+                res['name'] = partner_name+', '+name
+                if len(res['name']) > 60:
+                    res['name'] = res['name'][:57]+'...'
+            else:
+                res['name'] = row.partner_id.name
+
+            if not row.repeat and row.signed_date < now().strftime('%Y-%m-%d'):
+                signed_date = now().strftime('%Y-%m-%d')
+            else:
+                signed_date = row.signed_date
+                
+            if row.cur_effect_date and row.state == 'draft': # set to 'draft', never is going to be 'running' inside this method
+                period = DateTime.strptime(row.cur_effect_date, '%Y-%m-%d') - DateTime.strptime(signed_date, '%Y-%m-%d')
+            else:
+                period = DateTime.strptime(row.init_effect_date, '%Y-%m-%d') - DateTime.strptime(signed_date, '%Y-%m-%d')
+                
+            if row.service.interval_unit == 'days':
+                res['numbercall'] = int(period.day / row.service.int_unit_number)
+                increment_size = DateTime.RelativeDateTime(days=res['interval_number'])
+                if row.payment == 'end':
+                    nextcall = DateTime.strptime(signed_date, '%Y-%m-%d') + increment_size
+                elif row.payment == 'start':
+                    nextcall = DateTime.strptime(signed_date, '%Y-%m-%d')
+            elif row.service.interval_unit == 'weeks':
+                res['numbercall'] = int(round(period.day / (7.0 * row.service.int_unit_number)))
+                if period.day % (7.0 * row.service.int_unit_number) != 0:
+                    res['numbercall'] += 1
+                increment_size = DateTime.RelativeDateTime(days=7*res['interval_number'])
+                if row.payment == 'end':
+                    nextcall = DateTime.strptime(signed_date, '%Y-%m-%d') + increment_size
+                    nextcall = nextcall + DateTime.RelativeDateTime(weekday=(DateTime.Monday,0))
+                elif row.payment == 'start':
+                    nextcall = DateTime.strptime(signed_date, '%Y-%m-%d') + DateTime.RelativeDateTime(weekday=(DateTime.Monday,0))
+            elif row.service.interval_unit == 'months':
+                res['numbercall'] = int(math.ceil(period.day / 30.0 / row.service.int_unit_number))
+                increment_size = DateTime.RelativeDateTime(months=res['interval_number'])
+                if row.payment == 'end':
+                    nextcall = DateTime.strptime(signed_date, '%Y-%m-%d') + increment_size
+                    nextcall = nextcall + DateTime.RelativeDateTime(days=-nextcall.day+1)
+                elif row.payment == 'start':
+                    nextcall = DateTime.strptime(signed_date, '%Y-%m-%d')+DateTime.RelativeDateTime(day=1)
+            elif row.service.interval_unit == 'years':
+                val = period.day / 365.0 / row.service.int_unit_number
+                res['numbercall'] = int(round(val))
+                #if row.payment == 'end' and period.day % (365.0 * row.service.int_unit_number) != 0 and val > round(val):
+                #    res['numbercall'] += 1
+                increment_size = DateTime.RelativeDateTime(months=12*res['interval_number'])
+                #if row.payment == 'start': 
+                #    res['numbercall'] += 1
+                res['interval_type'] = 'months'
+                res['interval_number'] = 12*res['interval_number']
+                if row.payment == 'end':
+                    nextcall = DateTime.strptime(signed_date, '%Y-%m-%d') + DateTime.RelativeDateTime(months=res['interval_number'])
+                    nextcall = nextcall + DateTime.RelativeDateTime(months=-nextcall.month+1, days=-nextcall.day+1)
+                elif row.payment == 'start':
+                    nextcall = DateTime.strptime(signed_date, '%Y-%m-%d') + DateTime.RelativeDateTime(month=1,day=1)
+            nextcalldate = DateTime.strptime(nextcall.strftime('%Y-%m-%d'), '%Y-%m-%d')+DateTime.RelativeDateTime(hours=row.service.cron_offset)
+            res['nextcall'] = nextcalldate.strftime('%Y-%m-%d %H:%M:%S')
+
+            if row.service.invoicing == 'period':
+                if row.payment == 'end':
+                    start_date = nextcalldate
+                else:
+                    start_date = DateTime.strptime(signed_date, '%Y-%m-%d')
+                #d_list = self.pool.get('inv.date_list')
+                #date_list = map(int, row.date_list)
+                date_list_ids = d_list.search(cr, uid, [('id','in',date_list),('status','=','wait')])
+                
+                if not date_list:
+                    start_date = self._make_invoice_log(cr, uid, row, start_date, res['numbercall'], increment_size, context=context)
+                else:
+                    dl_ids = d_list.search(cr, uid, [('id','in',date_list)])
+                    start_date = d_list.browse(cr, uid, dl_ids.pop(), {}).date
+                    start_date = DateTime.strptime(start_date, '%Y-%m-%d')+increment_size
+
+                if date_list_ids:
+                    res['numbercall'] = len(date_list_ids)
+                    date_list_ids.reverse()
+                    res['nextcall'] = d_list.browse(cr, uid, date_list_ids.pop(), {}).date
+
+            if row.service.invoicing == 'trigger':
+                res['interval_type'] = 'minutes'
+                res['interval_number'] = 5
+                res['doall'] = 0
+                res['numbercall'] = -1
+                res['nextcall'] = now().strftime('%Y-%m-%d %H:%M:%S')
+                start_date = DateTime.strptime(signed_date, '%Y-%m-%d')
+
+            if not obj.analytic_account:
+                analyt_acc_ids = self.pool.get('account.analytic.account').search(cr, uid, [('name','=',obj.partner_id.name),('parent_id','=',obj.service.analytic_account_branch.id)], limit=1)
+                if analyt_acc_ids:
+                    analyt_acc_id = analyt_acc_ids[0]
+                else:
+                    invoice_factor = self.pool.get('hr_timesheet_invoice.factor').search(cr, uid, [('factor','=',0)], limit=1)
+                    invoice_factor = invoice_factor and invoice_factor[0] or False
+                    analytic_account_data = {'name':obj.partner_id.name,
+                                 'parent_id':obj.service.analytic_account_branch.id,
+                                 'partner_id':obj.partner_id.id,
+                                 'to_invoice':invoice_factor,
+                                 }
+                    if obj.service.pricelist_id:
+                        analytic_account_data['pricelist_id'] = obj.service.pricelist_id.id
+                    elif obj.service.analytic_account_branch.pricelist_id:
+                        analytic_account_data['pricelist_id'] = obj.service.analytic_account_branch.pricelist_id.id
+                    elif obj.partner_id.property_product_pricelist:
+                        analytic_account_data['pricelist_id'] = obj.partner_id.property_product_pricelist.id
+                    analyt_acc_id = self.pool.get('account.analytic.account').create(cr, uid, analytic_account_data)
+                self.write(cr, uid, [row.id], {'analytic_account':analyt_acc_id})
+            #    self.write(cr, uid, [row.id], {'cron_id':id,'cron_nextdate':nextdate_id,'analytic_account':analyt_acc_id,'cur_effect_date':cur_date})
+            #else:
+            #    self.write(cr, uid, [row.id], {'cron_id':id,'cron_nextdate':nextdate_id,'cur_effect_date':cur_date})
+
+            self.write(cr, uid, [row.id], {'state':'running'})
+            if not row.cron_id:
+                id = self.pool.get('ir.cron').create(cr, uid, res)
+            else:
+                if row.service.invoicing == 'period':
+                    cron = self.pool.get('ir.cron').browse(cr, uid, row.cron_id.id, {})
+                    nextcall = (DateTime.strptime(res['nextcall'][:10], '%Y-%m-%d')+DateTime.RelativeDateTime(hours=row.service.cron_offset)).strftime('%Y-%m-%d %H:%M:%S')
+                    cr.execute("UPDATE ir_cron SET nextcall=%s WHERE id=%s", (nextcall, row.cron_id.id))
+                    del res['nextcall']
+                res['active'] = True
+                res['doall'] = row.repeat
+                self.pool.get('ir.cron').write(cr, uid, row.cron_id.id, res)
+                id = row.cron_id.id
+            self.write(cr, uid, [row.id], {'cron_id':id})
+
+            if row.service.invoicing == 'period':
+                res['name'] = 'Set next call date'
+                res['nextcall'] = (now()+DateTime.RelativeDateTime(minutes=1)).strftime('%Y-%m-%d %H:%M:%S')
+                res['priority'] = 10
+                res['numbercall'] = 1
+                res['interval_type'] = 'days'
+                res['interval_number'] = 1
+                res['model'] = 'inv.agreement'
+                res['args'] = [row.id]
+                res['function'] = '_set_next_date'
+                if not row.cron_nextdate:
+                    nextdate_id = self.pool.get('ir.cron').create(cr, uid, res)
+                else:
+                    nextdate_id = row.cron_nextdate.id
+            else: nextdate_id = False
+            
+            if row.cur_effect_date and not map(int, row.date_list):
+                cur_date = row.cur_effect_date
+            elif not row.cur_effect_date or (row.cur_effect_date and row.cur_effect_date < row.init_effect_date):
+                cur_date = row.init_effect_date
+            else:
+                cur_date = row.cur_effect_date
+
+            self.write(cr, uid, [row.id], {'cron_id':id,'cron_nextdate':nextdate_id,'cur_effect_date':cur_date})
+            if self.read(cr, uid, [row.id], ['state'])[0]['state']=='draft':
+                raise osv.except_osv(_('Invalid action !'), _('Agreement not possible running !'))
+            else:
+                d_list = self.pool.get('inv.date_list')
+                d_list_ids = d_list.search(cr, uid, [('agreement_id','=',row.id)])
+                d_list.write(cr, uid, d_list_ids, {'state':'process'})
+                
+        return True
+
+    def set_done(self, cr, uid, ids, context={}):
+        for r in self.browse(cr, uid, ids, {}):
+	    if r.cron_id:
+	      self.pool.get('ir.cron').write(cr, uid, r.cron_id.id, {'active':False})
+        self.write(cr, uid, ids, {'state':'done'})
+        return True
+
+    def set_draft(self, cr, uid, ids, context={}):
+        d_list = self.pool.get('inv.date_list')
+        for r in self.browse(cr, uid, ids, {}):
+            for id in map(int, r.date_list):
+                if d_list.browse(cr, uid, id, {}).analytic_entries:
+                    d_list.write(cr, uid, id, {'state':'filled'})
+                else:
+                    d_list.write(cr, uid, id, {'state':'empty'})
+        #    unlink_ids = map(int, r.date_list)
+        #    d_list.unlink(cr, uid, unlink_ids)
+        self.write(cr, uid, ids, {'state':'draft'})
+        return True
+
+    def get_number(self, cr, uid, ids, context={}):
+        self.write(cr, uid, ids, {})
+        return True
+
+    def write(self, cr, uid, ids, vals, context=None):
+        if not context:
+            context={}
+        log_obj = self.pool.get('inv.date_list')
+        for r in self.browse(cr, uid, ids, {}):
+            ################# if change payment #################
+            if 'payment' in vals:
+                log_ids = log_obj.search(cr, uid, [('id','in',map(int, r.date_list)),('status','=','wait')])
+                if log_ids:
+                    cr.execute("""
+                            SELECT id
+                            FROM inv_date_list
+                            WHERE date=(SELECT min(date)
+                                FROM inv_date_list
+                                WHERE id in (%s))
+                           """ % ','.join(map(str,log_ids))
+                           )
+                    min_date_id = cr.fetchone()[0]
+                    if vals['payment']=='start':
+                        pdate1 = log_obj.read(cr, uid, min_date_id, ['pdate1'])['pdate1']
+                        pdate1 = DateTime.strptime(pdate1, '%Y-%m-%d') + DateTime.RelativeDateTime(hours=r.service.cron_offset)
+                        self.pool.get('ir.cron').write(cr, uid, r.cron_id.id, {'nextcall':pdate1.strftime('%Y-%m-%d %H:%M:%S')})
+                        for log_data in log_obj.read(cr, uid, log_ids, ['pdate1']):
+                            temp = DateTime.strptime(log_data['pdate1'], '%Y-%m-%d') + DateTime.RelativeDateTime(hours=r.service.cron_offset)
+                            res = log_obj.write(cr, uid, log_data['id'], {'date':temp.strftime('%Y-%m-%d')})
+                    elif vals['payment']=='end':
+                        log_obj.read(cr, uid, min_date_id, ['pdate2'])['pdate2']
+                        pdate2 = log_obj.read(cr, uid, min_date_id, ['pdate2'])['pdate2']
+                        pdate2 = DateTime.strptime(pdate2, '%Y-%m-%d') + DateTime.RelativeDateTime(hours=r.service.cron_offset, days=1)
+                        self.pool.get('ir.cron').write(cr, uid, r.cron_id.id, {'nextcall':pdate2.strftime('%Y-%m-%d %H:%M:%S')})
+                        for log_data in log_obj.read(cr, uid, log_ids, ['pdate2']):
+                            temp = DateTime.strptime(log_data['pdate2'], '%Y-%m-%d') + DateTime.RelativeDateTime(hours=r.service.cron_offset, days=1) 
+                            res = log_obj.write(cr, uid, log_data['id'], {'date':temp.strftime('%Y-%m-%d')})
+            #####################################################
+            if ('number' in vals and not vals['number']) or ('number' not in vals and not r.number):
+                vals=vals.copy()
+                vals['number'] = self.pool.get('ir.sequence').get(cr, uid, 'agreement.invoice.sequence')
+        return super(agreement, self).write(cr, uid, ids, vals, context=context)
+
+    def unlink(self, cr, uid, ids, context=None):
+        agreements = self.read(cr, uid, ids, ['state', 'cron_id', 'cron_nextdate'])
+        unlink_ids = []
+        for agr in agreements:
+            if agr['state'] == 'draft':
+                unlink_ids.append(agr['id'])
+                cron_ids = []
+                if 'cron_id' in agr and agr['cron_id']:
+                    cron_ids.append(agr['cron_id'][0])
+                if 'cron_nextdate' in agr and agr['cron_nextdate']:
+                    cron_ids.append(agr['cron_nextdate'][0])
+                self.pool.get('ir.cron').unlink(cr, uid, cron_ids)
+            else:
+                raise osv.except_osv(_('Invalid action !'), _('Cannot delete agreement(s) which are already running !'))
+        osv.osv.unlink(self, cr, uid, unlink_ids)
+        return True
+
+agreement()
+
+class date_list(osv.osv):
+    _name = "inv.date_list"
+    _rec_name = "date"
+
+    _columns = {
+        'agreement_id':  fields.many2one('inv.agreement', 'Agreement'),
+        'date': fields.date('Date', required=True, states={'filled':[('readonly',True)],'process':[('readonly',True)]}),
+        'pdate1': fields.date('Period Date1', states={'filled':[('readonly',True)],'process':[('readonly',True)]}),
+        'pdate2': fields.date('Period Date2', states={'filled':[('readonly',True)],'process':[('readonly',True)]}),
+        #'status': fields.selection([('inv','Invoiced'),('wait','Waiting'),('process','Processing'),('error','Error')], 'State', states={'filled':[('readonly',True)],'process':[('readonly',True)]}),
+        'status': fields.selection([('inv','Ready to be invoiced'),('part_inv','Partially Invoiced'),('inv_done','Invoiced'),('wait','Waiting'),('process','Processing'),('error','Error')],
+             'State', states={'filled':[('readonly',True)],'process':[('readonly',True)]}),
+        'state': fields.selection([('empty','Empty'),('filled','Filled'),('process','Processing')], 'State'),
+        'analytic_entries': fields.one2many('account.analytic.line', 'invlog_id', 'Entries', states={'process':[('readonly',True)]}),
+        'period': fields.char('Period', size=32, states={'filled':[('readonly',True)],'process':[('readonly',True)]}),
+    }
+
+    def _renew(self, cr, uid, ids, context={}):
+        for r in self.browse(cr, uid, ids, {}):
+            if r.agreement_id.state != 'draft':
+                raise osv.except_osv(_('Invalid action !'), _('Cannot renew while Agreement not in Draft !'))
+            if r.analytic_entries==[]:
+                self.write(cr, uid, r.id, {'state':'empty','status':'wait'})
+        return True
+
+    def _change_state(self, cr, uid, ids, field, state):
+        if field and state=='wait':
+            raise osv.except_osv(_('Invalid action !'), _('Cannot set Waiting while field "Analitic Entries" not empty !'))
+        return {}
+
+    def write(self, cr, uid, ids, vals, context=None):
+        if not context:
+            context={}
+        vals=vals.copy()
+        keys=vals.keys()
+        if 'analytic_entries' in keys and 'state' in keys and 'status' in keys and vals['analytic_entries'] and vals['status']=='wait':
+            vals['status'] = 'inv'
+            if vals['analytic_entries']: vals['state'] = 'filled'
+        #if 'analytic_entries' not in keys:
+        #    vals['state'] = 'empty'
+        return super(date_list, self).write(cr, uid, ids, vals, context=context)
+
+    _defaults = {
+        'status' : lambda *a: 'wait',
+        'state' : lambda *a: 'empty',
+    }
+
+date_list()
+

=== added file 'account_invoicing/invoicing.xml'
--- account_invoicing/invoicing.xml	1970-01-01 00:00:00 +0000
+++ account_invoicing/invoicing.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,603 @@
+<?xml version="1.0"?>
+<openerp>
+	<data>
+		==========================================================
+		Methodology
+		==========================================================
+		<record model="ir.ui.view" id="view_inv_method_tree">
+			<field name="name">inv.method.tree</field>
+			<field name="model">inv.method</field>
+			<field name="type">tree</field>
+			<field name="arch" type="xml">
+				<tree string="Methodology">
+					<field name="name" />
+					<field name="model_id" />
+					<field name="partner_field" />
+					<field name="rec_filter_ids" />
+					<field name="calc_ids" />
+				</tree>
+			</field>
+		</record>
+		<record model="ir.ui.view" id="view_inv_method_form">
+			<field name="name">inv.method.form</field>
+			<field name="model">inv.method</field>
+			<field name="type">form</field>
+			<field name="arch" type="xml">
+				<form string="Methodology">
+					<notebook>
+						<page string="General">
+							<field name="name" select="1" />
+							<field name="model_id" select="1" on_change="on_model_change(model_id)" />
+							<field name="ref" select="2" on_change="on_model_change(model_id)" />
+							<field name="partner_field" select="1" nolabel="1" colspan="2" />
+							<field name="calc_base" select="1" />
+							<field name="rec_filter_ids" select="2" nolabel="1"
+								colspan="4" />
+							<field name="calc_ids" select="2" nolabel="1" colspan="4"
+								context="{'calc_base':calc_base,'model_id':model_id}" />
+							<field name="state" select="2" />
+							<button name="action_create_meth" string="Create" states="open"
+								type="object" colspan="2" />
+						</page>
+						<page string="Advanced">
+							<field name="manual" select="2" />
+							<field name="source" colspan="4" nolabel="1" select="2"
+								attrs="{'readonly': [('manual','=', False)]}" />
+							<separator string="Available global variables:"
+								colspan="4" />
+							<label string="self - objects pointer" align="0.0" colspan="2" />
+							<label string="mas_aft - list for the ID of the filtered records"
+								align="0.0" colspan="2" />
+							<label string="uid - current user ID" align="0.0" colspan="2" />
+							<label string="partner_id - current partner ID in Methodology"
+								align="0.0" colspan="2" />
+							<label string="cr - database cursor" align="0.0" colspan="2" />
+							<label
+								string="contact_ids - contacts IDs of current partner in Methodology"
+								align="0.0" colspan="2" />
+							<label string="pdate1 - period date from" align="0.0"
+								colspan="2" />
+							<label string="pdate2 - period date to" align="0.0"
+								colspan="2" />
+							<label string="invoice_date - next invoice date" align="0.0"
+								colspan="2" />
+							<label string="agre - current Agreement objects record"
+								align="0.0" colspan="2" />
+							<newline />
+							<button name="action_test_source" string="Test source"
+								states="close" type="object" colspan="2" />
+						</page>
+					</notebook>
+				</form>
+			</field>
+		</record>
+		==========================================================
+		Service
+		==========================================================
+		<record model="ir.ui.view" id="view_inv_service_tree">
+			<field name="name">inv.service.tree</field>
+			<field name="model">inv.service</field>
+			<field name="type">tree</field>
+			<field name="arch" type="xml">
+				<tree string="Service">
+					<field name="name" />
+				</tree>
+			</field>
+		</record>
+		<record model="ir.ui.view" id="view_inv_service_form">
+			<field name="name">inv.service.form</field>
+			<field name="model">inv.service</field>
+			<field name="type">form</field>
+			<field name="arch" type="xml">
+				<form string="Service">
+					<field name="name" select="1" />
+					<field name="analytic_account_branch" select="1" />
+					<field name="journal_id" select="1" />
+					<field name="pricelist_id" select="1" />
+					<field name="purch_pricelist_id" select="2" />
+					<field name="invoicing" select="2" />
+					<field name="interval_unit" select="2" />
+					<field name="int_unit_number" select="2" />
+					<field name="cron_offset" select="2" />
+					<separator string="Methodologies" colspan="4" />
+					<field name="method_ids" nolabel="1" colspan="4" widget="many2many"
+						select="2" />
+					<separator string="Work Team" colspan="4" />
+					<field name="req_users" nolabel="1" colspan="4" select="2" />
+				</form>
+			</field>
+		</record>
+		==========================================================
+		Record filter
+		==========================================================
+		<record model="ir.ui.view" id="view_inv_rec_filter_tree">
+			<field name="name">inv.rec_filter.tree</field>
+			<field name="model">inv.rec_filter</field>
+			<field name="type">tree</field>
+			<field name="arch" type="xml">
+				<tree string="Record filter">
+					<field name="filters" />
+				</tree>
+			</field>
+		</record>
+		<record model="ir.ui.view" id="view_inv_rec_filter_form">
+			<field name="name">inv.rec_filter.form</field>
+			<field name="model">inv.rec_filter</field>
+			<field name="type">form</field>
+			<field name="arch" type="xml">
+				<form string="Record filter">
+					<field name="method_id" invisible="1" />
+					<field name="filters" invisible="1" />
+					<field name="field_id" select="1"
+						on_change="change_field_type(field_id, var)" />
+					<field name="field_type" select="1" />
+					<field name="var" select="2" on_change="change_var(var)" />
+					<separator colspan="4" />
+					<field name="temp_field_id" invisible="1" />
+					<field name="temp_var" invisible="1" />
+					<field name="condition_id" select="1" nolabel="1" colspan="4"
+						on_change="change_condition(condition_id, field_id, var, method_id)"
+						context="{'type':field_type}" />
+					<field name="state" colspan="2" />
+				</form>
+			</field>
+		</record>
+		==========================================================
+		Calc filter
+		==========================================================
+		<record model="ir.ui.view" id="view_inv_calc_filter_tree">
+			<field name="name">inv.calc_filter.tree</field>
+			<field name="model">inv.calc_filter</field>
+			<field name="type">tree</field>
+			<field name="arch" type="xml">
+				<tree string="Calc filter">
+					<field name="filters" />
+				</tree>
+			</field>
+		</record>
+		<record model="ir.ui.view" id="view_inv_calc_filter_form">
+			<field name="name">inv.calc_filter.form</field>
+			<field name="model">inv.calc_filter</field>
+			<field name="type">form</field>
+			<field name="arch" type="xml">
+				<form string="Calc filter">
+					<field name="calc_id" invisible="1" />
+					<field name="filters" invisible="1" />
+					<field name="field_id" select="1"
+						on_change="change_field_type(field_id, var)" />
+					<field name="field_type" select="1" />
+					<field name="var" select="2" on_change="change_var(var)" />
+					<separator colspan="4" />
+					<field name="temp_field_id" invisible="1" />
+					<field name="temp_var" invisible="1" />
+					<field name="condition_id" select="1" nolabel="1" colspan="4"
+						on_change="change_condition(condition_id, field_id, var, calc_id)" />
+					<field name="state" colspan="2" />
+				</form>
+			</field>
+		</record>
+		==========================================================
+		Record types
+		==========================================================
+		<record model="ir.ui.view" id="view_inv_rec_types_tree">
+			<field name="name">inv.rec_type.tree</field>
+			<field name="model">inv.rec_type</field>
+			<field name="type">tree</field>
+			<field name="arch" type="xml">
+				<tree string="Record types">
+					<field name="type" />
+					<field name="value" />
+				</tree>
+			</field>
+		</record>
+		<record model="ir.ui.view" id="view_inv_rec_types_form">
+			<field name="name">inv.rec_type.form</field>
+			<field name="model">inv.rec_type</field>
+			<field name="type">form</field>
+			<field name="arch" type="xml">
+				<form string="Record types">
+					<field name="type" select="1" />
+					<field name="value" select="1" />
+				</form>
+			</field>
+		</record>
+		==========================================================
+		Record filter condition
+		==========================================================
+		<record model="ir.ui.view" id="view_inv_rec_filter_cond_tree">
+			<field name="name">inv.rec_filter_cond.tree</field>
+			<field name="model">inv.rec_filter_cond</field>
+			<field name="type">tree</field>
+			<field name="arch" type="xml">
+				<tree string="Record filter condition">
+					<!--<field name="rec_filter_id"/> -->
+					<field name="name" />
+				</tree>
+			</field>
+		</record>
+		<record model="ir.ui.view" id="view_inv_rec_filter_cond_form">
+			<field name="name">inv.rec_filter_cond.form</field>
+			<field name="model">inv.rec_filter_cond</field>
+			<field name="type">form</field>
+			<field name="arch" type="xml">
+				<form string="Record filter condition">
+					<field name="rec_filter_id" invisible="1" />
+					<field name="name" invisible="1" />
+					<field name="state" invisible="1" />
+					<group colspan="4">
+						<field name="cond_type" select="1"
+							on_change="on_change_state(cond_type, parent.field_type, parent.field_id, value1_char, value1_bool,
+						value1_int, value2_int, value1_float, value2_float, value1_date, value2_date, value1_datetime, value2_datetime, cond_value)" />
+					</group>
+					<separator string="Condition value" colspan="4" />
+					<group states="[char],[selection]" colspan="2">
+						<field name="value1_char" select="2"
+							on_change="on_change_state(cond_type, parent.field_type, parent.field_id, value1_char, value1_bool,
+						value1_int, value2_int, value1_float, value2_float, value1_date, value2_date, value1_datetime, value2_datetime, cond_value)" />
+					</group>
+					<group states="[boolean]" colspan="4">
+						<field name="value1_bool" select="2"
+							on_change="on_change_state(cond_type, parent.field_type, parent.field_id, value1_char, value1_bool,
+						value1_int, value2_int, value1_float, value2_float, value1_date, value2_date, value1_datetime, value2_datetime, cond_value)" />
+					</group>
+					<group states="[integer]|1|,[integer]|2|" colspan="2">
+						<field name="value1_int" select="2"
+							on_change="on_change_state(cond_type, parent.field_type, parent.field_id, value1_char, value1_bool,
+						value1_int, value2_int, value1_float, value2_float, value1_date, value2_date, value1_datetime, value2_datetime, cond_value)" />
+					</group>
+					<group states="[integer]|2|" colspan="2">
+						<field name="value2_int" select="2"
+							on_change="on_change_state(cond_type, parent.field_type, parent.field_id, value1_char, value1_bool,
+						value1_int, value2_int, value1_float, value2_float, value1_date, value2_date, value1_datetime, value2_datetime, cond_value)" />
+					</group>
+					<group states="[float]|1|,[float]|2|" colspan="2">
+						<field name="value1_float" select="2"
+							on_change="on_change_state(cond_type, parent.field_type, parent.field_id, value1_char, value1_bool,
+						value1_int, value2_int, value1_float, value2_float, value1_date, value2_date, value1_datetime, value2_datetime, cond_value)" />
+					</group>
+					<group states="[float]|2|" colspan="2">
+						<field name="value2_float" select="2"
+							on_change="on_change_state(cond_type, parent.field_type, parent.field_id, value1_char, value1_bool,
+						value1_int, value2_int, value1_float, value2_float, value1_date, value2_date, value1_datetime, value2_datetime, cond_value)" />
+					</group>
+					<group states="[date]|1|,[date]|2|" colspan="2">
+						<field name="value1_date" select="2"
+							on_change="on_change_state(cond_type, parent.field_type, parent.field_id, value1_char, value1_bool,
+						value1_int, value2_int, value1_float, value2_float, value1_date, value2_date, value1_datetime, value2_datetime, cond_value)" />
+					</group>
+					<group states="[date]|2|" colspan="2">
+						<field name="value2_date" select="2"
+							on_change="on_change_state(cond_type, parent.field_type, parent.field_id, value1_char, value1_bool,
+						value1_int, value2_int, value1_float, value2_float, value1_date, value2_date, value1_datetime, value2_datetime, cond_value)" />
+					</group>
+					<group states="[datetime]|1|,[datetime]|2|" colspan="2">
+						<field name="value1_datetime" select="2"
+							on_change="on_change_state(cond_type, parent.field_type, parent.field_id, value1_char, value1_bool,
+						value1_int, value2_int, value1_float, value2_float, value1_date, value2_date, value1_datetime, value2_datetime, cond_value)" />
+					</group>
+					<group states="[datetime]|2|" colspan="2">
+						<field name="value2_datetime" select="2"
+							on_change="on_change_state(cond_type, parent.field_type, parent.field_id, value1_char, value1_bool,
+						value1_int, value2_int, value1_float, value2_float, value1_date, value2_date, value1_datetime, value2_datetime, cond_value)" />
+					</group>
+					<group states="[many2many],[many2one],[one2many]" colspan="2">
+						<field name="cond_value" select="1" colspan="4"
+							on_change="on_change_state(cond_type, parent.field_type, parent.field_id, value1_char, value1_bool,
+						value1_int, value2_int, value1_float, value2_float, value1_date, value2_date, value1_datetime, value2_datetime, cond_value)" />
+					</group>
+				</form>
+			</field>
+		</record>
+		==========================================================
+		Condition value
+		==========================================================
+		<record model="ir.ui.view" id="view_inv_cond_value_tree">
+			<field name="name">inv.cond_value.tree</field>
+			<field name="model">inv.cond_value</field>
+			<field name="type">tree</field>
+			<field name="arch" type="xml">
+				<tree string="Condition value">
+					<!--<field name="rec_filter_cond_id"/> -->
+					<field name="object" />
+				</tree>
+			</field>
+		</record>
+		<record model="ir.ui.view" id="view_inv_cond_value_form">
+			<field name="name">inv.cond_value.form</field>
+			<field name="model">inv.cond_value</field>
+			<field name="type">form</field>
+			<field name="arch" type="xml">
+				<form string="Condition value">
+					<!--<field name="rec_filter_cond_id"/> -->
+					<field name="object" select="1" />
+				</form>
+			</field>
+		</record>
+		==========================================================
+		Calculation
+		==========================================================
+		<record model="ir.ui.view" id="view_inv_calc_tree">
+			<field name="name">inv.calc.tree</field>
+			<field name="model">inv.calc</field>
+			<field name="type">tree</field>
+			<field name="arch" type="xml">
+				<tree string="Calculation">
+					<field name="sequence" />
+					<field name="product_id" />
+					<field name="calculations" />
+					<field name="manual" />
+				</tree>
+			</field>
+		</record>
+		<record model="ir.ui.view" id="view_inv_calc_form">
+			<field name="name">inv.calc.form</field>
+			<field name="model">inv.calc</field>
+			<field name="type">form</field>
+			<field name="arch" type="xml">
+				<form string="Calculation">
+					<notebook>
+						<page string="General">
+							<field name="product_type" select="2" />
+							<field name="product_id" select="1" />
+							<field name="invoicing_id" select="1" />
+							<field name="model_id" select="2" invisible="1" />
+							<field name="method_id" invisible="1" />
+							<separator string="Constructor:" colspan="4" />
+							<field name="sequence" select="1" colspan="2" />
+							<field name="calculations" select="2" colspan="4" nolabel="1"
+								context="{'calc_base':context.get('calc_base', False)}" />
+						</page>
+						<page string="Advanced">
+							<field name="manual" select="2" />
+							<separator string="Expression" colspan="4" />
+							<field name="code" select="2" nolabel="1" colspan="4"
+								attrs="{'readonly': [('manual','=', False)]}" />
+							<separator string="Available global variables:"
+								colspan="4" />
+							<label string="self - objects pointer" align="0.0" colspan="4" />
+							<label string="cr - database cursor" align="0.0" colspan="4" />
+							<label string="uid - current user ID" align="0.0" colspan="4" />
+							<label
+								string="re - object for regural expressions (have attribute match)"
+								align="0.0" colspan="4" />
+							<label string="obj_ids - list of the filtred records (identifiers)"
+								align="0.0" colspan="4" />
+							<label string="count - number of filtred records" align="0.0"
+								colspan="4" />
+							<label string="pdate1 - period date from" align="0.0"
+								colspan="4" />
+							<label string="pdate2 - period date to" align="0.0"
+								colspan="4" />
+							<label string="calc_date - calculation date" align="0.0"
+								colspan="4" />
+							<label string="agre - current Agreement objects record"
+								align="0.0" colspan="4" />
+							<label string="res_list - List of calculation results"
+								align="0.0" colspan="4" />
+						</page>
+						<page string="Description">
+							<field name="description" select="2"
+								on_change="change_descr(description, descr_field, parent.id)" />
+							<field name="descr_field" select="1"
+								on_change="change_descr(description, descr_field, parent.id)"
+								attrs="{'readonly': [('description','!=', 'field')],
+							'required': [('description','=', 'field')]}" />
+							<separator string="Expression" colspan="4" />
+							<field name="descr_express" select="1" nolabel="1" colspan="4"
+								attrs="{'readonly': [('description','!=', 'expression')]}" />
+							<separator string="Available global variables:"
+								colspan="4" />
+							<label string="self - objects pointer" align="0.0" colspan="4" />
+							<label string="cr - database cursor" align="0.0" colspan="4" />
+							<label string="uid - current user ID" align="0.0" colspan="4" />
+							<label string="model - current model name in Methodology"
+								align="0.0" colspan="4" />
+							<label string="agr_id - current Agreement ID field value"
+								align="0.0" colspan="4" />
+							<label string="meth_id - current Methodology ID field value"
+								align="0.0" colspan="4" />
+							<label string="calc_id - current Calculation ID field value"
+								align="0.0" colspan="4" />
+							<label string="pdate1 - period date from" align="0.0"
+								colspan="4" />
+							<label string="pdate2 - period date to" align="0.0"
+								colspan="4" />
+							<label string="calc_date - calculation date" align="0.0"
+								colspan="4" />
+							<label string="agre - current Agreement objects record"
+								align="0.0" colspan="4" />
+							<label string="d_list - Invoice Log object" align="0.0"
+								colspan="4" />
+							<label string="rec_id - Id of current record after filtration"
+								align="0.0" colspan="4" />
+							<label
+								string="desc - variable which will be used as a expression result"
+								align="0.0" colspan="4" />
+						</page>
+						<page string="Quantity">
+							<field name="quantity" select="2"
+								on_change="change_quant(quantity, quantity_field, parent.id)" />
+							<field name="quantity_field" select="1"
+								on_change="change_quant(quantity, quantity_field, parent.id)"
+								attrs="{'readonly': [('quantity','!=', 'field')],
+							'required': [('quantity','=', 'field')]}" />
+							<separator string="Expression" colspan="4" />
+							<field name="quantity_express" select="1" nolabel="1"
+								colspan="4" attrs="{'readonly': [('quantity','!=', 'expression')]}" />
+							<separator string="Available global variables:"
+								colspan="4" />
+							<label string="self - objects pointer" align="0.0" colspan="4" />
+							<label string="cr - database cursor" align="0.0" colspan="4" />
+							<label string="uid - current user ID" align="0.0" colspan="4" />
+							<label string="model - current model name in Methodology"
+								align="0.0" colspan="4" />
+							<label string="agr_id - current Agreement ID field value"
+								align="0.0" colspan="4" />
+							<label string="meth_id - current Methodology ID field value"
+								align="0.0" colspan="4" />
+							<label string="calc_id - current Calculation ID field value"
+								align="0.0" colspan="4" />
+							<label string="pdate1 - period date from" align="0.0"
+								colspan="4" />
+							<label string="pdate2 - period date to" align="0.0"
+								colspan="4" />
+							<label string="calc_date - calculation date" align="0.0"
+								colspan="4" />
+							<label string="mas_after - List of id's of record after filtration"
+								align="0.0" colspan="4" />
+							<label string="rec_id - Id of current record after filtration"
+								align="0.0" colspan="4" />
+							<label string="agre - current Agreement objects record"
+								align="0.0" colspan="4" />
+							<label
+								string="quant - variable which will be used as a expression result"
+								align="0.0" colspan="4" />
+						</page>
+
+					</notebook>
+				</form>
+			</field>
+		</record>
+		==========================================================
+		Invoice Log
+		==========================================================
+		<record model="ir.ui.view" id="view_date_list_tree">
+			<field name="name">inv.date_list.tree</field>
+			<field name="model">inv.date_list</field>
+			<field name="type">tree</field>
+			<field name="arch" type="xml">
+				<tree string="Invoice Log">
+					<field name="date" width="250" />
+					<field name="period" width="250" />
+					<field name="status" />
+				</tree>
+			</field>
+		</record>
+		<record model="ir.ui.view" id="view_date_list_form">
+			<field name="name">inv.date_list.form</field>
+			<field name="model">inv.date_list</field>
+			<field name="type">form</field>
+			<field name="arch" type="xml">
+				<form string="Invoice Log">
+					<field name="date" select="1" />
+					<field name="status" select="1"
+						on_change="_change_state(analytic_entries, status)" />
+					<label string="From:" align="0.0" />
+					<field name="pdate1" select="1" nolabel="1" />
+					<label string="-" />
+					<field name="pdate2" select="1" nolabel="1" />
+					<field name="period" select="1" />
+					<newline />
+					<button name="_renew" states="empty,filled" string="Renew"
+						type="object" colspan="2" />
+					<field name="analytic_entries" select="2" colspan="4"
+						nolabel="1" />
+					<field name="state" invisible="1" />
+				</form>
+			</field>
+		</record>
+		==========================================================
+		Agreement
+		==========================================================
+		<record model="ir.ui.view" id="view_inv_agreement_tree">
+			<field name="name">inv.agreement.tree</field>
+			<field name="model">inv.agreement</field>
+			<field name="type">tree</field>
+			<field name="arch" type="xml">
+				<tree string="Agreement">
+					<field name="number" />
+					<field name="partner_id" />
+					<field name="service" />
+					<field name="state" />
+					<field name="uninv_entries_count" />
+					<field name="signed_date" />
+					<field name="cur_effect_date" />
+				</tree>
+			</field>
+		</record>
+		<record model="ir.ui.view" id="view_inv_agreemente_form">
+			<field name="name">inv.agreement.form</field>
+			<field name="model">inv.agreement</field>
+			<field name="type">form</field>
+			<field name="arch" type="xml">
+				<form string="Agreement">
+					<field name="partner_id" select="1" required="1" />
+					<!--<group states="running" attrs="{'invisible': [('name','=', False)]}"> -->
+					<field name="service" select="1" />
+					<!--</group> -->
+					<!--<group attrs="{'invisible': [('name','!=', False)]}"> -->
+					<field name="number" select="1" />
+					<!--</group> -->
+					<button name="get_number" states="draft" string="Get number"
+						type="object" colspan="2" />
+					<field name="name" select="1" />
+					<field name="active" select="2" />
+					<notebook colspan="4">
+						<page string="General">
+							<field name="payment" select="2"
+								on_change="onchange_payment(signed_date, cur_effect_date, service, payment)" />
+							<field name="analytic_account" select="2" />
+							<field name="repeat" select="2" />
+							<separator string="Technical info:" colspan="4" />
+							<field name="cron_id" colspan="2" readonly="1" />
+							<field name="calls" select="2" />
+						</page>
+						<page string="Validity">
+							<field name="signed_date" select="1"
+								on_change="onchange_payment(signed_date, cur_effect_date, service, payment)"
+								required="1" />
+							<field name="init_effect_date" select="2"
+								on_change="onchange_payment(signed_date, init_effect_date, service, payment)"
+								invisible="1"/>
+							<field name="cur_effect_date" select="2" />
+							<field name="partner_signed_date" />
+							<separator string="Manage Prolongation:" colspan="4" />
+							<field name="prolong" select="2" />
+							<newline />
+							<group attrs="{'invisible': [('prolong','!=', 'recurrs')]}"
+								colspan="4" col="4">
+								<field name="recurr_unit_number" select="2" />
+								<field name="recurr_unit" select="2" />
+								<field name="period_unit_number" />
+								<field name="period_unit" />
+							</group>
+						</page>
+						<page string="Analytic Entries">
+							<field name="analytic_entries" select="2" widget="one2many_list"
+								colspan="4" nolabel="1" />
+							<field name="uninv_entries_count" invisible="1" select="2" />
+						</page>
+						<page string="Invoice Log">
+							<field name="date_list" select="2" colspan="4" nolabel="1" />
+						</page>
+					</notebook>
+					<separator string="Manage State:" colspan="4" />
+					<newline />
+					<field name="state" select="1" readonly="1" />
+					<group col="3" colspan="2">
+						<button name="set_process" states="draft" string="Process"
+							type="object" />
+						<button name="set_done" states="running,error" string="Stop"
+							type="object" />
+						<button name="set_draft" states="done" string="Set to Draft"
+							type="object" />
+					</group>
+				</form>
+			</field>
+		</record>
+
+		<act_window name="Agreements" domain="[('service', '=', active_id)]"
+			res_model="inv.agreement" src_model="inv.service" id="act_agreements" />
+
+		<act_window name="Invoices" domain="[('partner_id', '=', partner_id)]"
+			res_model="account.invoice" src_model="inv.agreement" id="act_all_invoices" />
+
+		<act_window name="All Analytic Entries" domain="[('agr_id', '=', active_id)]"
+			res_model="account.analytic.line" src_model="inv.agreement" id="act_all_analytics" />
+
+		<act_window name="Uninvoiced Analytic Entries"
+			domain="[('agr_id', '=', active_id),('invoice_id','=',False)]"
+			res_model="account.analytic.line" src_model="inv.agreement"
+			id="act_uninvoiced_analytics" />
+	</data>
+</openerp>

=== added file 'account_invoicing/invoicing_menu.xml'
--- account_invoicing/invoicing_menu.xml	1970-01-01 00:00:00 +0000
+++ account_invoicing/invoicing_menu.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<openerp>
+	<data>
+        <menuitem name="Invoicing" icon="STOCK_PRINT" id="inv_main_menu"/>
+        <menuitem id="inv_config" name="Configuration" parent="inv_main_menu" sequence="1"/>
+	
+		<record model="ir.actions.act_window" id="inv_config_method_form">
+			<field name="name">Methodology</field>
+			<field name="res_model">inv.method</field>
+			<field name="view_type">form</field>
+			<field name="view_mode">tree,form</field>
+		</record>
+
+		<record model="ir.actions.act_window" id="inv_config_service_form">
+			<field name="name">Service</field>
+			<field name="res_model">inv.service</field>
+			<field name="view_type">form</field>
+			<field name="view_mode">tree,form</field>
+		</record>
+
+		<record model="ir.actions.act_window" id="inv_agreement_form">
+			<field name="name">Agreement</field>
+			<field name="res_model">inv.agreement</field>
+			<field name="view_type">form</field>
+			<field name="view_mode">tree,form</field>
+		</record>
+
+        <menuitem id="methodology" action="inv_config_method_form" parent="inv_config" />
+        <menuitem id="service" action="inv_config_service_form" parent="inv_config" />
+        <menuitem id="agreement" action="inv_agreement_form" parent="inv_main_menu"/>
+
+	</data>
+</openerp>
+

=== added directory 'account_invoicing/security'
=== added file 'account_invoicing/security/ir.model.access.csv'
--- account_invoicing/security/ir.model.access.csv	1970-01-01 00:00:00 +0000
+++ account_invoicing/security/ir.model.access.csv	2013-02-01 09:33:03 +0000
@@ -0,0 +1,10 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_inv_rec_type","inv.rec_type","model_inv_rec_type","account.group_account_invoice",1,1,1,1
+"access_inv_method","inv.method","model_inv_method","account.group_account_invoice",1,1,1,1
+"access_inv_rec_filter","inv.rec_filter","model_inv_rec_filter","account.group_account_invoice",1,1,1,1
+"access_inv_calc_filter","inv.calc_filter","model_inv_calc_filter","account.group_account_invoice",1,1,1,1
+"access_inv_rec_filter_cond","inv.rec_filter_cond","model_inv_rec_filter_cond","account.group_account_invoice",1,1,1,1
+"access_inv_service","inv.service","model_inv_service","account.group_account_invoice",1,1,1,1
+"access_inv_calc","inv.calc","model_inv_calc","account.group_account_invoice",1,1,1,1
+"access_inv_agreement","inv.agreement","model_inv_agreement","account.group_account_invoice",1,1,1,1
+"access_inv_date_list","inv.date_list","model_inv_date_list","account.group_account_invoice",1,1,1,1

=== added directory 'account_invoicing/wizard'
=== added file 'account_invoicing/wizard/__init__.py'
--- account_invoicing/wizard/__init__.py	1970-01-01 00:00:00 +0000
+++ account_invoicing/wizard/__init__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,29 @@
+##############################################################################
+#
+# Copyright (c) 2008-2009 SIA "KN dati". (http://kndati.lv) All Rights Reserved.
+#                    General contacts <info@xxxxxxxxx>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+##############################################################################
+
+import inv_agreement_wizard

=== added file 'account_invoicing/wizard/inv_agreement_wizard.py'
--- account_invoicing/wizard/inv_agreement_wizard.py	1970-01-01 00:00:00 +0000
+++ account_invoicing/wizard/inv_agreement_wizard.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,59 @@
+##############################################################################
+#
+# Copyright (c) 2008-2009 SIA "KN dati". (http://kndati.lv) All Rights Reserved.
+#                    General contacts <info@xxxxxxxxx>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+##############################################################################
+
+import wizard
+import pooler
+
+class agreement_wizard(wizard.interface):
+    _create_form = """<?xml version="1.0"?>
+    <form string="Run agreement(s)">
+        <label string="Do you want set to process selected agreement(s) ?" colspan="4"/>
+    </form>"""
+
+    def _set_process(self, cr, uid, data, context):
+        pool = pooler.get_pool(cr.dbname)
+        agr_obj = pool.get('inv.agreement')
+        for r in agr_obj.browse(cr, uid, data['ids'], {}):
+            if r.state=='draft':
+                agr_obj.set_process(cr, uid, [r.id])
+        return {}
+
+    _create_fields = {}
+
+    states = {
+        'init' : {
+            'actions' : [], 
+            'result' : {'type':'form', 'arch':_create_form, 'fields':_create_fields, 'state': [('end','No'),('start','Yes')]},
+        },
+        'start' : {
+            'actions' : [],
+            'result' : {'type':'action', 'action':_set_process, 'state':'end'},
+        },
+    }
+agreement_wizard('inv.agreement.wizard')
+

=== added file 'account_invoicing/wizard/inv_filter_wizard.py'
--- account_invoicing/wizard/inv_filter_wizard.py	1970-01-01 00:00:00 +0000
+++ account_invoicing/wizard/inv_filter_wizard.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,124 @@
+##############################################################################
+#
+# Copyright (c) 2008-2009 SIA "KN dati". (http://kndati.lv) All Rights Reserved.
+#                    General contacts <info@xxxxxxxxx>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+##############################################################################
+
+import time
+import wizard
+import osv
+import pooler
+
+
+section_form_stage1 = '''<?xml version="1.0"?>
+<form string="Record filter">
+    <field name="method_id" readonly="1"/>
+    <field name="field_id"/>
+    <field name="cond_type"/>
+</form>'''
+
+section_form_stage2 = '''<?xml version="1.0"?>
+<form string="Record filter condition">
+    <field name="rec_filter_id"/>
+    <field name="cond_value" colspan="4" nolabel="1"/>
+</form>'''
+
+def _field_type_get(self, cr, uid, context={}):
+    #pool = pooler.get_pool(cr.dbname)
+    #obj = pool.get('inv.rec_filter')
+    #ids = obj.search(cr, uid, [])
+    #rec = obj.browse(cr, uid, ids, context)
+    if data['form']['domain']:
+        return [('eq','equal to'), ('nq','not equal to'), ('rxp', 'regexp')]
+    return []
+
+section_fields_stage1 = {
+    'method_id': {'string':'Methodology', 'type':'many2one', 'relation':'inv.method', 'required':True},
+    'field_id': {'string':'Fields', 'type':'many2one', 'relation':'ir.model.fields', 'required':True, 'domain':"[('model_id','=',domain)]"},
+    'cond_type': {'string':'Condition type', 'type':'selection', 'selection':[], 'required':True},
+    'domain': {'string':'Domain field', 'type':'many2one', 'relation':'ir.model'},
+    #'condition_id': {'string':'Condition', 'type':'one2many', 'relation':'inv.rec_filter_cond', 'required':True},
+}
+
+section_fields_stage2 = {
+    'rec_filter_id': {'string':'Filter', 'type':'many2one', 'relation':'inv.rec_filter', 'required':True},
+    'cond_value': {'string':'Condition value', 'type':'one2many', 'relation':'inv.cond_value', 'required':True},
+}
+
+def load_data1(self, cr, uid, data, context):
+    pool = pooler.get_pool(cr.dbname)
+    obj = pool.get('inv.method')
+    method = obj.browse(cr, uid, data['id'], context)
+    data['form']['domain'] = method.model_id.id
+    data['form']['method_id'] = method.id
+    form = data['form']
+    return data['form']
+
+def load_data2(self, cr, uid, data, context):
+    pool = pooler.get_pool(cr.dbname)
+    obj = pool.get('inv.rec_filter')
+
+    #recfilter = obj.browse(cr, uid, data['id'], context)
+    #data['form']['rec_filter_id'] = recfilter.id
+    #ids = obj.search(cr, uid, [])
+    #new_id = ",".join(map(str,ids))
+    #recfilter = obj.read(cr, uid, ids, ['id'], context)
+    #data['form']['rec_filter_id'] = recfilter[0]['id']
+    return data['form']
+
+def save_data(self, cr, uid, data, context):
+    pool = pooler.get_pool(cr.dbname)
+    rec_filter = pool.get('inv.rec_filter')
+    rec_filter_cond = pool.get('inv.rec_filter_cond')
+    #rec = rec_filter.browse(cr, uid, data['id'], context)
+    #ids = rec_filter.search(cr, uid, [])
+
+    #cr.execute("select nextval('"+rec_filter._sequence+"')")
+    #id_new = cr.fetchone()[0]
+    #rec_filter.write(cr, uid, ids, {'method_id':data['form']['method_id'], 'field_id':data['form']['field_id']})
+    field_id = rec_filter.browse(cr, uid, data['form']['field_id'])
+
+    rec_filter.create(cr, uid, {'method_id': data['form']['method_id'],'field_id': field_id.id})
+
+    return {}
+
+class wizard_rec_filter(wizard.interface):
+    states = {
+        'init': {
+            'actions': [load_data1], 
+            'result': {'type':'form', 'arch':section_form_stage1, 'fields':section_fields_stage1, 'state':[('end','Cancel'),('next','Next')]}
+        },
+        'next': {
+            'actions': [load_data2], 
+            'result': {'type':'form', 'arch':section_form_stage2, 'fields':section_fields_stage2, 'state':[('end','Cancel'),('init','Back'),('save','Save')]}
+        },
+        'save': {
+            'actions': [save_data],
+            'result': {'type':'state', 'state':'end'}
+        }
+    }
+
+wizard_rec_filter('inv.rec_filter.menu')
+

=== added directory 'analytic_department'
=== added file 'analytic_department/__init__.py'
--- analytic_department/__init__.py	1970-01-01 00:00:00 +0000
+++ analytic_department/__init__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,32 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Camptocamp SA (http://www.camptocamp.com) 
+# All Right Reserved
+#
+# Author : Joel Grand-guillaume (Camptocamp)
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+##############################################################################
+
+import analytic

=== added file 'analytic_department/__openerp__.py'
--- analytic_department/__openerp__.py	1970-01-01 00:00:00 +0000
+++ analytic_department/__openerp__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,55 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Camptocamp SA (http://www.camptocamp.com) 
+# All Right Reserved
+#
+# Author : Joel Grand-guillaume (Camptocamp)
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+##############################################################################
+
+{
+    "name" : "Analytic Account Department Categorization",
+    "version" : "1.0",
+    "author" : "Camptocamp",
+    "category" : "Generic Modules/Projects & Services",
+    "description":
+"""
+    Add the department on Analytic Account and Analytical line as well as the related filter and button in the search form of
+    both object.
+    
+""",
+    "website": "http://camptocamp.com";,
+    "depends" : [
+        "account",
+        "hr",
+                ],
+    "init_xml" : [],
+    "demo_xml" : [],
+    "update_xml" : [
+        "analytic_view.xml",
+    ],
+    "active": False,
+    "installable": True
+}

=== added file 'analytic_department/analytic.py'
--- analytic_department/analytic.py	1970-01-01 00:00:00 +0000
+++ analytic_department/analytic.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,58 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) 
+# All Right Reserved
+#
+# Author : Joel Grand-guillaume (Camptocamp)
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+##############################################################################
+
+from osv import osv
+from osv import fields
+
+class analytic_account(osv.osv):
+    _inherit = "account.analytic.account"
+
+    _columns = {
+        'department_id': fields.many2one('hr.department', 'Department'),
+    }
+    _defaults = {
+        'department_id': lambda s,cr,uid,c: s.pool.get('res.users').browse(cr,uid,uid).context_department_id.id,
+    }
+
+analytic_account()
+
+class analytic_line(osv.osv):
+    _inherit = "account.analytic.line"
+
+    _columns = {
+        'department_id': fields.many2one('hr.department', 'Department'),
+    }
+    _defaults = {
+        'department_id': lambda s,cr,uid,c: s.pool.get('res.users').browse(cr,uid,uid).context_department_id.id,
+    }
+
+analytic_line()
+

=== added file 'analytic_department/analytic_view.xml'
--- analytic_department/analytic_view.xml	1970-01-01 00:00:00 +0000
+++ analytic_department/analytic_view.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,84 @@
+<openerp>
+    <data>
+        
+        
+        <record id="view_account_analytic_account_search" model="ir.ui.view">
+            <field name="name">account.analytic.account.search</field>
+            <field name="model">account.analytic.account</field>
+            <field name="inherit_id" ref="account.view_account_analytic_account_search" />
+            <field name="type">search</field>
+            <field name="arch" type="xml">
+                <xpath expr="/search/group/field[@name='user_id']" position="after">
+                    <field name="department_id" widget="selection" />
+                </xpath>
+                <xpath expr="/search/group/filter[@string='Manager']" position="after">
+                    <filter string="Department" icon="terp-folder-orange" domain="[]" context="{'group_by':'department_id'}"/>
+                </xpath>
+            </field>
+        </record>
+
+        <record id="view_account_analytic_account_tree" model="ir.ui.view">
+            <field name="name">account.analytic.account.tree</field>
+            <field name="model">account.analytic.account</field>
+            <field name="inherit_id" ref="account.view_account_analytic_account_tree" />
+            <field name="type">tree</field>
+            <field name="arch" type="xml">
+                <xpath expr="/tree/field[@name='code']" position="after">
+                    <field name="department_id" />
+                </xpath>
+            </field>
+        </record>
+        
+        <record id="view_account_analytic_account_form" model="ir.ui.view">
+            <field name="name">account.analytic.account.form</field>
+            <field name="model">account.analytic.account</field>
+            <field name="inherit_id" ref="account.view_account_analytic_account_form" />
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <xpath expr="/form//field[@name='partner_id']" position="after">
+                    <field name="department_id" />
+                </xpath>
+            </field>
+        </record>
+        
+        
+        <record id="view_account_analytic_line_form" model="ir.ui.view">
+            <field name="name">account.analytic.line.form</field>
+            <field name="model">account.analytic.line</field>
+            <field name="inherit_id" ref="account.view_account_analytic_line_form" />
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <xpath expr="/form/group/field[@name='company_id']" position="after">
+                    <field name="department_id" />
+                </xpath>
+            </field>
+        </record>
+        
+        <record id="view_account_analytic_line_tree" model="ir.ui.view">
+            <field name="name">account.analytic.line.tree</field>
+            <field name="model">account.analytic.line</field>
+            <field name="inherit_id" ref="account.view_account_analytic_line_tree" />
+            <field name="type">tree</field>
+            <field name="arch" type="xml">
+                <xpath expr="/tree/field[@name='user_id']" position="after">
+                    <field name="department_id" />
+                </xpath>
+            </field>
+        </record>
+        <record id="view_account_analytic_line_filter" model="ir.ui.view">
+            <field name="name">account.analytic.line.select</field>
+            <field name="model">account.analytic.line</field>
+            <field name="inherit_id" ref="account.view_account_analytic_line_filter" />
+            <field name="type">search</field>
+            <field name="arch" type="xml">
+                <xpath expr="/search/group/field[@name='user_id']" position="before">
+                    <field name="department_id" widget="selection" />
+                </xpath>
+                <xpath expr="/search/group/filter[@string='User']" position="after">
+                    <filter string="Department" icon="terp-folder-orange" domain="[]" context="{'group_by':'department_id'}"/>
+                </xpath>
+            </field>
+        </record>
+        
+    </data>
+</openerp>

=== added directory 'analytic_department/i18n'
=== added file 'analytic_department/i18n/analytic_department.pot'
--- analytic_department/i18n/analytic_department.pot	1970-01-01 00:00:00 +0000
+++ analytic_department/i18n/analytic_department.pot	2013-02-01 09:33:03 +0000
@@ -0,0 +1,24 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* analytic_department
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.1\n"
+"Report-Msgid-Bugs-To: amos.oviedo@xxxxxxxx\n"
+"POT-Creation-Date: 2011-03-02 12:04:59+0000\n"
+"PO-Revision-Date: 2011-03-02 12:19+0100\n"
+"Last-Translator: Amós Oviedo <amos.oviedo@xxxxxxxxx>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+
+#. module: analytic_department
+#: field:account.analytic.account,department_id:0
+#: view:account.analytic.account:0
+#: field:account.analytic.line,department_id:0
+#: view:account.analytic.line:0
+msgid "Department"
+msgstr ""
\ No newline at end of file

=== added file 'analytic_department/i18n/es.po'
--- analytic_department/i18n/es.po	1970-01-01 00:00:00 +0000
+++ analytic_department/i18n/es.po	2013-02-01 09:33:03 +0000
@@ -0,0 +1,26 @@
+# Spanish translation for openobject-addons
+# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2011-03-02 12:04+0000\n"
+"PO-Revision-Date: 2011-03-14 09:43+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-06-15 06:01+0000\n"
+"X-Generator: Launchpad (build 13168)\n"
+
+#. module: analytic_department
+#: field:account.analytic.account,department_id:0
+#: view:account.analytic.account:0
+#: field:account.analytic.line,department_id:0
+#: view:account.analytic.line:0
+msgid "Department"
+msgstr ""

=== added file 'analytic_department/i18n/fi.po'
--- analytic_department/i18n/fi.po	1970-01-01 00:00:00 +0000
+++ analytic_department/i18n/fi.po	2013-02-01 09:33:03 +0000
@@ -0,0 +1,26 @@
+# Finnish translation for openobject-addons
+# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2011-03-02 12:04+0000\n"
+"PO-Revision-Date: 2011-06-28 06:56+0000\n"
+"Last-Translator: Juha Kotamäki <Unknown>\n"
+"Language-Team: Finnish <fi@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-09-14 05:14+0000\n"
+"X-Generator: Launchpad (build 13921)\n"
+
+#. module: analytic_department
+#: field:account.analytic.account,department_id:0
+#: view:account.analytic.account:0
+#: field:account.analytic.line,department_id:0
+#: view:account.analytic.line:0
+msgid "Department"
+msgstr "Osasto"

=== added directory 'analytic_department/security'
=== added directory 'avanzosc_account_extension'
=== renamed directory 'avanzosc_account_extension' => 'avanzosc_account_extension.moved'
=== added file 'avanzosc_account_extension/__init__.py'
--- avanzosc_account_extension/__init__.py	1970-01-01 00:00:00 +0000
+++ avanzosc_account_extension/__init__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,26 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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 invoice
+import account_move
+import account_move_line
+import analytic
\ No newline at end of file

=== added file 'avanzosc_account_extension/__openerp__.py'
--- avanzosc_account_extension/__openerp__.py	1970-01-01 00:00:00 +0000
+++ avanzosc_account_extension/__openerp__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,42 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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": "Avanzosc Account Extension",
+    "version" : "1.0",
+    "description" : """ This module provides:
+        Invoice: New wizard to unreconcile invoices account move.
+        Account move line: On delete, also deletes the associated analytical lines.
+        Account move: - When create lines, copies the previous line as before, without name and the account set as journals debit account.
+                      - New button to apply moves changes into lines.
+                      - New constraint to verify if the date is in the period specified.
+        """,    
+    "author": "AvanzOSC",
+    "website" : "http://www.avanzosc.com";,
+    "depends" : ["account_payment", "analytic"],
+    "category" : "Generic Modules",
+    "init_xml" : [],
+    "demo_xml" : [],
+    "update_xml" : ["wizard/invoiced_unreconcile_view.xml",
+                    "account_move.xml",
+                    "account_invoice_view.xml"],
+    "active" : False,
+    "installable" : True  
+}
\ No newline at end of file

=== added file 'avanzosc_account_extension/account_invoice_view.xml'
--- avanzosc_account_extension/account_invoice_view.xml	1970-01-01 00:00:00 +0000
+++ avanzosc_account_extension/account_invoice_view.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+	<data>
+	
+		<record id="invoice_tree_inh_33" model="ir.ui.view">
+			<field name="name">account.invoice.tree.inh.33</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">
+				<xpath expr="/tree" position="attributes">
+					<attribute name="colors">blue:state in ('draft');#23A83B:type in ('in_refund','out_refund');gray:state in ('cancel')</attribute>
+				</xpath>
+				<xpath expr="/tree/field[@name='state']" position="replace" />
+				<xpath expr="/tree/field[@name='company_id']" position="replace">
+					<!--<field name="reference" />-->
+					<field name="state" />
+					<field name="type" invisible="1" />
+				</xpath>
+				<xpath expr="/tree/field[@name='residual']" position="replace">
+					<field name="residual_ref" sum="Residual Amount" />
+				</xpath>
+				<xpath expr="/tree/field[@name='amount_untaxed']" position="replace">
+					<field name="amount_untaxed_ref" sum="Untaxed Amount" />
+					<field name="amount_tax_ref" sum="Tax Amount" />
+				</xpath>
+				<xpath expr="/tree/field[@name='amount_total']" position="replace">
+					<field name="amount_total_ref" sum="Total Amount" />
+				</xpath>
+			</field>
+		</record>
+
+		<record id="action_customer_invoices" model="ir.actions.act_window">
+			<field name="name">All customer invoices</field>
+			<field name="res_model">account.invoice</field>
+			<field name="view_type">form</field>
+			<field name="view_mode">tree,form,calendar,graph</field>
+			<field eval="False" name="view_id" />
+			<field name="domain">[('type','in',('out_invoice', 'out_refund'))]
+			</field>
+			<field name="context">{'journal_type': ('sale_refund', 'sale'),
+				'type':('out_invoice', 'out_refund')}</field>
+			<field name="help">With Customer Invoices you can create and manage
+				sales invoices issued to your customers. OpenERP can also generate
+				draft invoices automatically from sales orders or deliveries. You
+				should only confirm them before sending them to your customers.
+			</field>
+		</record>
+
+		<record id="action_customer_invoices_view1" model="ir.actions.act_window.view">
+			<field eval="1" name="sequence" />
+			<field name="view_mode">tree</field>
+			<field name="view_id" ref="invoice_tree_inh_33"/>
+			<field name="act_window_id" ref="action_customer_invoices" />
+		</record>
+
+		<record id="action_customer_invoices_view2" model="ir.actions.act_window.view">
+			<field eval="2" name="sequence" />
+			<field name="view_mode">form</field>
+			<field name="view_id" ref="account.invoice_form" />
+			<field name="act_window_id" ref="action_customer_invoices" />
+		</record>
+
+		<menuitem action="action_customer_invoices" id="menu_action_customer_invoices"
+			parent="account.menu_finance_receivables" string="All customer invoices" />
+
+		<record id="action_supplier_invoices" model="ir.actions.act_window">
+			<field name="name">All supplier invoices</field>
+			<field name="res_model">account.invoice</field>
+			<field name="view_type">form</field>
+			<field name="view_mode">tree,form,calendar,graph</field>
+			<field eval="False" name="view_id" />
+			<field name="domain">[('type','in',('in_invoice', 'in_refund'))]</field>
+			<field name="context">{'journal_type': ('purchase_refund', 'purchase'),
+				'type':('in_invoice', 'in_refund')}</field>
+		</record>
+
+		<record id="action_supplier_invoices_view1" model="ir.actions.act_window.view">
+			<field eval="1" name="sequence" />
+			<field name="view_mode">tree</field>
+			<field name="view_id" ref="invoice_tree_inh_33"/>
+			<field name="act_window_id" ref="action_supplier_invoices" />
+		</record>
+
+		<record id="action_supplier_invoices_view2" model="ir.actions.act_window.view">
+			<field eval="2" name="sequence" />
+			<field name="view_mode">form</field>
+			<field name="view_id" ref="account.invoice_supplier_form" />
+			<field name="act_window_id" ref="action_supplier_invoices" />
+		</record>
+
+
+
+		<menuitem action="action_supplier_invoices" id="menu_action_supplier_invoices"
+			parent="account.menu_finance_payables" string="All supplier invoices" />
+
+		<act_window
+			context="{'search_default_partner_id':[active_id], 'type':('out_invoice', 'out_refund'), 'journal_type': ('sale', 'sale_refund')}"
+			id="act_res_partner_2_account_invoice_opened" domain="[('type','in',('out_invoice', 'out_refund'))]"
+			name="Customer Invoices" res_model="account.invoice" src_model="res.partner"
+			view_type="form" view_mode="tree,form,calendar,graph" />
+		<act_window
+			context="{'search_default_partner_id':[active_id], 'type':('in_invoice', 'in_refund'), 'journal_type': ('purchase', 'purchase_refund')}"
+			id="act_partner_2_account_supinvoice" domain="[('type','in',('in_invoice', 'in_refund'))]"
+			name="Supplier Invoices" res_model="account.invoice" src_model="res.partner"
+			view_type="form" view_mode="tree,form,calendar,graph" />
+
+		<record id="action_customer_invoices_view4" model="ir.actions.act_window.view">
+			<field eval="1" name="sequence" />
+			<field name="view_mode">tree</field>
+			<field name="view_id" ref="invoice_tree_inh_33"/>
+			<field name="act_window_id" ref="act_res_partner_2_account_invoice_opened" />
+		</record>
+
+		<record id="action_supplier_invoices_view4" model="ir.actions.act_window.view">
+			<field eval="1" name="sequence" />
+			<field name="view_mode">tree</field>
+			<field name="view_id" ref="invoice_tree_inh_33"/>
+			<field name="act_window_id" ref="act_partner_2_account_supinvoice" />
+		</record>
+
+		<record id="action_customer_invoices_view3" model="ir.actions.act_window.view">
+			<field eval="2" name="sequence" />
+			<field name="view_mode">form</field>
+			<field name="view_id" ref="account.invoice_form" />
+			<field name="act_window_id" ref="act_res_partner_2_account_invoice_opened" />
+		</record>
+
+		<record id="action_supplier_invoices_view3" model="ir.actions.act_window.view">
+			<field eval="2" name="sequence" />
+			<field name="view_mode">form</field>
+			<field name="view_id" ref="account.invoice_supplier_form" />
+			<field name="act_window_id" ref="act_partner_2_account_supinvoice" />
+		</record>
+
+
+		
+		
+		<record id="view_account_invoice_filter_inh_33" model="ir.ui.view">
+			<field name="name">account.invoice.select.inh.33</field>
+			<field name="model">account.invoice</field>
+			<field name="inherit_id" ref="account.view_account_invoice_filter"/>
+			<field name="type">search</field>
+			<field name="arch" type="xml">
+					<field name="period_id" position="after"> <field
+					name="reference" select="1"/> </field>
+			</field>
+		</record>
+
+	</data>
+</openerp>

=== added file 'avanzosc_account_extension/account_move.py'
--- avanzosc_account_extension/account_move.py	1970-01-01 00:00:00 +0000
+++ avanzosc_account_extension/account_move.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,61 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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
+from datetime import datetime
+from operator import itemgetter
+
+import netsvc
+from osv import fields, osv
+from tools.translate import _
+import decimal_precision as dp
+import tools
+
+class account_move(osv.osv):
+    _inherit = 'account.move'
+    
+    def apply_changes(self, cr, uid, ids, context=None):
+        res = {}
+        lines = []
+        account_move_line_obj = self.pool.get('account.move.line')
+        account_move = self.browse(cr, uid, ids)[0]
+        if account_move:
+            line_ids = account_move_line_obj.search(cr,uid,[('move_id', '=', account_move.id)])
+            account_move_line_obj.write(cr, uid, line_ids, {'journal_id': account_move.journal_id.id, 'period_id':account_move.period_id.id, 'date':account_move.date}, context, False, True)
+        return True
+    
+    def write(self, cr, uid, ids, vals, context=None):
+        if context is None:
+            context = {}
+        c = context.copy()
+        c['novalidate'] = True
+        result = super(osv.osv, self).write(cr, uid, ids, vals, c)
+        return result
+
+    def _check_period_journal(self, cursor, user, ids, context=None):
+        return True
+    
+    _constraints = [
+        (_check_period_journal,
+            'You cannot create entries on different periods/journals in the same move',
+            ['line_id']),
+    ]
+account_move()
\ No newline at end of file

=== added file 'avanzosc_account_extension/account_move.xml'
--- avanzosc_account_extension/account_move.xml	1970-01-01 00:00:00 +0000
+++ avanzosc_account_extension/account_move.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<openerp>
+	<data>
+			<record model="ir.ui.view" id="account_move_inh_form_view">
+                <field name="name">account.move.inh.form</field>
+                <field name="model">account.move</field>
+                <field name="type">form</field>
+                <field name="inherit_id" ref="account.view_move_form"/>
+                <field name="arch" type="xml"> 
+                <field name="amount" position="after">
+                	<button name="apply_changes" states="draft" string="Apply changes" type="object" icon="gtk-execute"/>
+                </field> 
+                </field>
+            </record>
+            
+			<record model="ir.ui.view" id="account_move_reconcile_inh_form_view">
+                <field name="name">account.move.reconcile.inh.form</field>
+                <field name="model">account.move</field>
+                <field name="type">form</field>
+                <field name="inherit_id" ref="account.view_move_reconcile_form"/>
+                <field name="arch" type="xml"> 
+                <field name="type" position="after">
+                	<button name="apply_changes" states="draft" string="Apply changes" type="object" icon="gtk-execute"/>
+                </field>   
+                </field>
+            </record>
+	</data>
+</openerp>
\ No newline at end of file

=== added file 'avanzosc_account_extension/account_move_line.py'
--- avanzosc_account_extension/account_move_line.py	1970-01-01 00:00:00 +0000
+++ avanzosc_account_extension/account_move_line.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,72 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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
+from datetime import datetime
+from operator import itemgetter
+
+import netsvc
+from osv import fields, osv
+from tools.translate import _
+import decimal_precision as dp
+import tools
+
+class account_move_line(osv.osv):
+    
+    _inherit = 'account.move.line'
+    
+    def _default_get(self, cr, uid, fields, context=None):
+        res = {}
+        journal_obj = self.pool.get('account.journal')
+        res = super(account_move_line, self)._default_get(cr, uid, fields, context=context)
+        if res:
+            if res.has_key('journal_id'):
+                journal = journal_obj.browse(cr,uid,[res['journal_id']])
+                if journal:
+                    journal = journal[0]
+                    acc = False
+                    if journal.default_debit_account_id:
+                        acc = journal.default_debit_account_id.id
+                    elif journal.default_credit_account_id:
+                        acc = journal.default_debit_account_id.id
+                    res['account_id'] = acc
+            res['name'] = False
+        return res
+    
+    def unlink(self, cr, uid, ids, context=None, check=True):
+            a_line_obj = self.pool.get('account.analytic.line')
+            if context is None:
+                context = {}
+            move_obj = self.pool.get('account.move')
+            self._update_check(cr, uid, ids, context)
+            result = False
+            for line in self.browse(cr, uid, ids, context=context):
+                a_line_list = a_line_obj.search(cr,uid,[('move_id', '=', line.id)], context=context)
+                if a_line_list:
+                    a_line_obj.unlink(cr,uid,a_line_list, context=context)
+                context['journal_id'] = line.journal_id.id
+                context['period_id'] = line.period_id.id
+                result = super(account_move_line, self).unlink(cr, uid, [line.id], context=context)
+                if check:
+                    move_obj.validate(cr, uid, [line.move_id.id], context=context)
+            return result
+        
+account_move_line()
\ No newline at end of file

=== added file 'avanzosc_account_extension/analytic.py'
--- avanzosc_account_extension/analytic.py	1970-01-01 00:00:00 +0000
+++ avanzosc_account_extension/analytic.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,97 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    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
+from lxml import etree
+import decimal_precision as dp
+
+import netsvc
+import pooler
+from osv import fields, osv, orm
+from tools.translate import _
+
+class account_analytic_account(osv.osv):
+    _inherit = 'account.analytic.account'
+    
+    def name_get(self, cr, uid, ids, context=None):
+        if not ids:
+            return []
+        res = []
+        for account in self.browse(cr, uid, ids, context=context):
+            if account.code:
+                res.append((account.id, account.code))
+            else:
+                data = []
+                acc = account
+                while acc:
+                    data.insert(0, acc.name)
+                    acc = acc.parent_id
+                data = ' / '.join(data)
+                res.append((account.id, data))
+        return res
+    def name_get2(self, cr, uid, ids, context=None):
+        if not ids:
+            return []
+        res = []
+        for account in self.browse(cr, uid, ids, context=context):
+            
+            data = []
+            acc = account
+            while acc:
+                data.insert(0, acc.name)
+                acc = acc.parent_id
+            data = ' / '.join(data)
+            res.append((account.id, data))
+        return res
+    def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100):
+        if not args:
+            args = []
+        if context is None:
+            context = {}
+        
+        args = args[:]
+#        if context.get('current_model') == 'project.project':
+#            cr.execute("select analytic_account_id from project_project ")
+#            project_ids = [x[0] for x in cr.fetchall()]
+#            # We cannot return here with normal project_ids, the following process also has to be followed.
+#            # The search should consider the name inhere, earlier it was just bypassing it.
+#            # Hence, we added the args and let the below mentioned procedure do the trick
+#            # Let the search method manage this.
+#            args += [('id', 'in', project_ids)]
+#            return self.name_get(cr, uid, project_ids, context=context)
+        account = self.search(cr, uid, [('code', 'ilike', '%%%s%%' % name)]+args, limit=limit, context=context)
+        if not account:
+            account = self.search(cr, uid, [('name', 'ilike', '%%%s%%' % name)]+args, limit=limit, context=context)
+            newacc = account
+            while newacc:
+                newacc = self.search(cr, uid, [('parent_id', 'in', newacc)]+args, limit=limit, context=context)
+                account += newacc
+
+        return self.name_get(cr, uid, account, context=context)
+    
+    
+    def _complete_name_calc(self, cr, uid, ids, prop, unknow_none, unknow_dict):
+        res = self.name_get2(cr, uid, ids)
+        return dict(res)
+    
+    _columns = {'complete_name': fields.function(_complete_name_calc, method=True, type='char', string='Full Account Name'),
+                 }
+account_analytic_account()
\ No newline at end of file

=== added file 'avanzosc_account_extension/invoice.py'
--- avanzosc_account_extension/invoice.py	1970-01-01 00:00:00 +0000
+++ avanzosc_account_extension/invoice.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,157 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    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
+from lxml import etree
+import decimal_precision as dp
+
+import netsvc
+import pooler
+from osv import fields, osv, orm
+from tools.translate import _
+
+
+class account_invoice(osv.osv):
+    _inherit = 'account.invoice'
+    
+    def _amount_residual_ref(self, cr, uid, ids, name, args, context=None):
+        res = {}
+        for invoice in self.browse(cr, uid, ids, context=context):
+            residual = invoice.residual
+            if invoice.type in ('in_refund', 'out_refund'):
+                res[invoice.id] = residual * -1
+            else:
+                res[invoice.id] = residual  
+        return res
+    
+    
+    def _amount_untaxed_ref(self, cr, uid, ids, name, args, context=None):
+        res = {}
+        for invoice in self.browse(cr, uid, ids, context=context):
+            untaxed = invoice.amount_untaxed
+            if invoice.type in ('in_refund', 'out_refund'):
+                res[invoice.id] = untaxed * -1
+            else:
+                res[invoice.id] = untaxed  
+        return res
+    
+    
+    def _amount_all_ref(self, cr, uid, ids, name, args, context=None):
+        res = {}
+        for invoice in self.browse(cr, uid, ids, context=context):
+            amount = invoice.amount_total
+            if invoice.type in ('in_refund', 'out_refund'):
+                res[invoice.id] = amount * -1
+            else:
+                res[invoice.id] = amount  
+        return res
+    
+    def _amount_tax_ref(self, cr, uid, ids, name, args, context=None):
+        res = {}
+        for invoice in self.browse(cr, uid, ids, context=context):
+            tax = invoice.amount_tax
+            if invoice.type in ('in_refund', 'out_refund'):
+                res[invoice.id] = tax * -1
+            else:
+                res[invoice.id] = tax  
+        return res
+    
+    _columns= {
+               'residual_ref':fields.function(_amount_residual_ref, method=True, digits_compute=dp.get_precision('Account'), string='Residual',store=False),
+               'amount_untaxed_ref':fields.function(_amount_untaxed_ref, method=True, digits_compute=dp.get_precision('Account'), string='Untaxed',store=False),
+               'amount_total_ref':fields.function(_amount_all_ref, method=True, digits_compute=dp.get_precision('Account'), string='Total', store=False),
+               'amount_tax_ref':fields.function(_amount_tax_ref, method=True, digits_compute=dp.get_precision('Account'), string='Tax', store=False),
+               'origin': fields.char('Source Document', size=500, help="Reference of the document that produced this invoice.", readonly=True, states={'draft':[('readonly',False)]}),
+               }
+    
+    def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
+        res = {}
+        journal = False
+        if context.has_key('journal_type'):
+            journal = context['journal_type']
+            if isinstance(journal,(str, unicode)):
+                journal=[journal]
+            if len(journal) == 1:
+                res = super(account_invoice, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
+            else:
+                journal_obj = self.pool.get('account.journal')
+                if context is None:
+                    context = {}
+        
+                if context.get('active_model', '') in ['res.partner'] and context.get('active_ids', False) and context['active_ids']:
+                    partner = self.pool.get(context['active_model']).read(cr, uid, context['active_ids'], ['supplier','customer'])[0]
+                    if not view_type:
+                        view_id = self.pool.get('ir.ui.view').search(cr, uid, [('name', '=', 'account.invoice.tree')])
+                        view_type = 'tree'
+                    if view_type == 'form':
+                        if partner['supplier'] and not partner['customer']:
+                            view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name', '=', 'account.invoice.supplier.form')])
+                        else:
+                            view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name', '=', 'account.invoice.form')])
+                if view_id and isinstance(view_id, (list, tuple)):
+                    view_id = view_id[0]
+                res = super(account_invoice,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
+        
+                type = context.get('journal_type', 'sale')
+                for field in res['fields']:
+                    if field == 'journal_id':
+                        journal_select = journal_obj._name_search(cr, uid, '', [('type', 'in', type)], context=context, limit=None, name_get_uid=1)
+                        res['fields'][field]['selection'] = journal_select
+        
+                if view_type == 'tree':
+                    doc = etree.XML(res['arch'])
+                    nodes = doc.xpath("//field[@name='partner_id']")
+                    partner_string = _('Customer')
+                    if context.get('type', 'out_invoice') in ('in_invoice', 'in_refund'):
+                        partner_string = _('Supplier')
+                    for node in nodes:
+                        node.set('string', partner_string)
+                    res['arch'] = etree.tostring(doc)
+        else:
+            res = super(account_invoice, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
+        return res
+
+
+account_invoice()
+
+class account_invoice_refund(osv.osv_memory):
+
+    """Refunds invoice"""
+
+    _inherit = "account.invoice.refund"
+    
+    def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
+        journal_obj = self.pool.get('account.journal')
+        res = super(account_invoice_refund,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
+        type = context.get('journal_type', 'sale_refund')
+        if type in ('sale', 'sale_refund'):
+            type = 'sale_refund'
+        elif type[0] in ('sale', 'sale_refund'):
+            type = 'sale_refund'
+        else:
+            type = 'purchase_refund'
+        for field in res['fields']:
+            if field == 'journal_id':
+                journal_select = journal_obj._name_search(cr, uid, '', [('type', '=', type)], context=context, limit=None, name_get_uid=1)
+                res['fields'][field]['selection'] = journal_select
+        return res
+    
+account_invoice_refund()
\ No newline at end of file

=== added directory 'avanzosc_account_extension/wizard'
=== added file 'avanzosc_account_extension/wizard/__init__.py'
--- avanzosc_account_extension/wizard/__init__.py	1970-01-01 00:00:00 +0000
+++ avanzosc_account_extension/wizard/__init__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,22 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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_unreconcile
\ No newline at end of file

=== added file 'avanzosc_account_extension/wizard/invoice_unreconcile.py'
--- avanzosc_account_extension/wizard/invoice_unreconcile.py	1970-01-01 00:00:00 +0000
+++ avanzosc_account_extension/wizard/invoice_unreconcile.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,44 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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
+from tools.translate import _
+
+class invoice_unreconcile(osv.osv_memory):
+    
+    _name = 'invoice.unreconcile'
+
+    
+    def unreconcile_invoices(self, cr, uid, ids, context=None):
+        inv_obj = self.pool.get('account.invoice')
+        move_obj = self.pool.get('account.move')
+        line_obj = self.pool.get('account.move.line')
+        invoice_ids =  context.get('active_ids',[])
+        inv_ids = inv_obj.browse(cr,uid, invoice_ids)
+        if inv_ids:
+            for inv in inv_ids:
+                move = move_obj.browse(cr, uid, inv.move_id.id)
+                for line in move.line_id:
+                    if line.reconcile_id:
+                        line_obj._remove_move_reconcile(cr, uid, [line.id])
+        return {'type': 'ir.actions.act_window.close()'}
+    
+invoice_unreconcile()
\ No newline at end of file

=== added file 'avanzosc_account_extension/wizard/invoiced_unreconcile_view.xml'
--- avanzosc_account_extension/wizard/invoiced_unreconcile_view.xml	1970-01-01 00:00:00 +0000
+++ avanzosc_account_extension/wizard/invoiced_unreconcile_view.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+    <data>
+		
+		 <record id="view_invoice_unreconcile" model="ir.ui.view">
+            <field name="name">view.invoice.unreconcile</field>
+            <field name="model">invoice.unreconcile</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+               <form string="Unreconcile invoice">
+                    <separator string="Are you sure you want to unreconcile?" colspan="4"/>                 
+                    <!--<separator string="" colspan="4" />-->
+                    <button special="cancel" string="Cancel" icon="gtk-cancel"/>
+                    <button name="unreconcile_invoices" string="Unreconcile" type="object" icon="gtk-convert"/>
+                </form>
+            </field>
+        </record>
+   
+         <act_window name="Unreconcile invoice"            
+            res_model="invoice.unreconcile"
+            src_model="account.invoice"
+            view_mode="form"
+            target="new"
+            multi="True"        
+            key2="client_action_multi"    
+            groups="base.group_extended"
+            id="action_invoice_reconcile"/>    
+          
+    </data>
+</openerp>
\ No newline at end of file

=== added directory 'avanzosc_agreement_fixed_price'
=== renamed directory 'avanzosc_agreement_fixed_price' => 'avanzosc_agreement_fixed_price.moved'
=== added file 'avanzosc_agreement_fixed_price/__init__.py'
--- avanzosc_agreement_fixed_price/__init__.py	1970-01-01 00:00:00 +0000
+++ avanzosc_agreement_fixed_price/__init__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,25 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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_analytic_account
+import agreement
+import invoicing
+import sale_order

=== added file 'avanzosc_agreement_fixed_price/__openerp__.py'
--- avanzosc_agreement_fixed_price/__openerp__.py	1970-01-01 00:00:00 +0000
+++ avanzosc_agreement_fixed_price/__openerp__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,45 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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": "Avanzosc Agreement fixed price",
+    "version": "1.0",
+    "depends": [
+                "account_invoice_analytics",
+    ],
+    "author": "AvanzOSC",
+    "website" : "http://www.avanzosc.com";,
+    "category": "Custom Module",
+    "description": """
+        This module adds new fields:
+            * fixed price, in invoice agreement.
+            * ref field in the analytic search view 
+            * product field in the analytic tree view    """,
+    "init_xml": [],
+    'update_xml': [
+                   "agreement_view.xml",
+                   "account_analytic_account_view.xml",
+                   "account_analytic_line_view_inh.xml",
+                   ],
+    'demo_xml': [],
+    'installable': True,
+    'active': False,
+}

=== added file 'avanzosc_agreement_fixed_price/account_analytic_account.py'
--- avanzosc_agreement_fixed_price/account_analytic_account.py	1970-01-01 00:00:00 +0000
+++ avanzosc_agreement_fixed_price/account_analytic_account.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,33 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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 tools.translate import _
+
+
+class account_analytic_account(osv.osv):
+    _inherit = "account.analytic.account"
+    
+    _columns = {
+        'crm_extra_code':fields.char('Crm Extra Code', size=64)
+    }
+    
+account_analytic_account()
\ No newline at end of file

=== added file 'avanzosc_agreement_fixed_price/account_analytic_account_view.xml'
--- avanzosc_agreement_fixed_price/account_analytic_account_view.xml	1970-01-01 00:00:00 +0000
+++ avanzosc_agreement_fixed_price/account_analytic_account_view.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+	<data>
+	
+		<record model="ir.ui.view" id="account_analytic_account_form_view">
+			<field name="name">account.analytic.account.form.view</field>
+			<field name="model">account.analytic.account</field>
+			<field name="type">form</field>
+			<field name="inherit_id" ref="account.view_account_analytic_account_form" />
+			<field name="arch" type="xml">
+				<xpath expr="/form/group/field[@name='type']" position="after">
+					<field name="crm_extra_code" />
+				</xpath>
+			</field>
+		</record>
+		
+	</data>
+</openerp>
\ No newline at end of file

=== added file 'avanzosc_agreement_fixed_price/account_analytic_line_view_inh.xml'
--- avanzosc_agreement_fixed_price/account_analytic_line_view_inh.xml	1970-01-01 00:00:00 +0000
+++ avanzosc_agreement_fixed_price/account_analytic_line_view_inh.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<openerp>
+    <data>
+
+	<record model="ir.ui.view" id="account_analytic_line_search_view">
+		<field name="name">account.analytic.line.search.view</field>
+		<field name="model">account.analytic.line</field>
+		<field name="type">search</field>
+		<field name="inherit_id" ref="account.view_account_analytic_line_filter" />
+		<field name="arch" type="xml">
+			<field name="date" position="after">
+					<field name="ref" />
+			</field>
+		</field>
+	</record>
+
+	<record model="ir.ui.view" id="account_analytic_line_tree_view">
+		<field name="name">account.analytic.line.tree.view</field>
+		<field name="model">account.analytic.line</field>
+		<field name="type">tree</field>
+		<field name="inherit_id" ref="account.view_account_analytic_line_tree" />
+		<field name="arch" type="xml">
+			<field name="product_id" position="replace"/>
+			<field name="name" position ="after">
+				<field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)" />
+			</field>
+			<field name="unit_amount" position ="attributes">
+				<attribute name="invisible">0</attribute>
+			</field>	
+		</field>
+	</record>
+    
+    </data>
+</openerp>
\ No newline at end of file

=== added file 'avanzosc_agreement_fixed_price/agreement.py'
--- avanzosc_agreement_fixed_price/agreement.py	1970-01-01 00:00:00 +0000
+++ avanzosc_agreement_fixed_price/agreement.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,49 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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 tools
+import re
+from tools.translate import _
+from mx import DateTime
+from mx.DateTime import now
+import time, locale
+import traceback, sys
+
+
+class agreement(osv.osv):
+    _inherit = "inv.agreement"
+    
+    _columns = {
+        'fixed_price':fields.float('Fixed Price', digits=(10,3)),
+        'sale_order_line':fields.many2one('sale.order.line', 'Sale order line', required=False)
+    }
+    
+    def update_analytic_lines(self, cr, uid, ids, context=None):
+        analytic_line_obj = self.pool.get('account.analytic.line')
+        for agreement in self.browse(cr, uid, ids):
+            for analytic_line in agreement.analytic_entries:
+                if not analytic_line.invoice_id:
+                    analytic_line_obj.write(cr, uid, [analytic_line.id], {'sale_amount': agreement.fixed_price})
+        return True
+    
+agreement()

=== added file 'avanzosc_agreement_fixed_price/agreement_view.xml'
--- avanzosc_agreement_fixed_price/agreement_view.xml	1970-01-01 00:00:00 +0000
+++ avanzosc_agreement_fixed_price/agreement_view.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<openerp>
+	<data>	
+		<record id="inv_agreement_inherit" model="ir.ui.view">
+			<field name="name">inv.agreement.inherit</field>
+			<field name="type">form</field>
+			<field name="model">inv.agreement</field>
+			<field name="inherit_id" ref="account_invoicing.view_inv_agreemente_form"/>
+			<field name="arch" type="xml">
+				<xpath expr ="/form/notebook/page[@string='General']/field[@name='repeat']" position="before">
+					<field name="fixed_price"/>				
+				</xpath>
+				<xpath expr ="/form/notebook/page[@string='General']/field[@name='repeat']" position="after">
+					<button name="update_analytic_lines" string="Update Price" type="object" icon="gtk-apply" colspan="2"/>			
+				</xpath>			
+			</field>		
+		</record>	
+	</data>	
+</openerp>
\ No newline at end of file

=== added directory 'avanzosc_agreement_fixed_price/i18n'
=== added file 'avanzosc_agreement_fixed_price/i18n/avanzosc_agreement_fixed_price.pot'
--- avanzosc_agreement_fixed_price/i18n/avanzosc_agreement_fixed_price.pot	1970-01-01 00:00:00 +0000
+++ avanzosc_agreement_fixed_price/i18n/avanzosc_agreement_fixed_price.pot	2013-02-01 09:33:03 +0000
@@ -0,0 +1,77 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* avanzosc_agreement_fixed_price
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.2\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2011-09-15 10:24+0000\n"
+"PO-Revision-Date: 2011-09-15 10: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: avanzosc_agreement_fixed_price
+#: selection:inv.agreement,period_unit:0
+msgid "Day(s)"
+msgstr "Day(s)"
+
+#. module: avanzosc_agreement_fixed_price
+#: help:inv.agreement,partner_signed_date:0
+msgid "Date when agreement was signed."
+msgstr "Date when agreement was signed."
+
+#. module: avanzosc_agreement_fixed_price
+#: selection:inv.agreement,period_unit:0
+msgid "Week(s)"
+msgstr "Week(s)"
+
+#. module: avanzosc_agreement_fixed_price
+#: model:ir.model,name:avanzosc_agreement_fixed_price.model_inv_method
+msgid "inv.method"
+msgstr "inv.method"
+
+#. module: avanzosc_agreement_fixed_price
+#: field:inv.agreement,period_unit_number:0
+msgid "Period"
+msgstr "Period"
+
+#. module: avanzosc_agreement_fixed_price
+#: selection:inv.agreement,period_unit:0
+msgid "Year(s)"
+msgstr "Year(s)"
+
+#. module: avanzosc_agreement_fixed_price
+#: model:ir.model,name:avanzosc_agreement_fixed_price.model_inv_agreement
+msgid "inv.agreement"
+msgstr "inv.agreement"
+
+#. module: avanzosc_agreement_fixed_price
+#: selection:inv.agreement,period_unit:0
+msgid "Month(s)"
+msgstr "Month(s)"
+
+#. module: avanzosc_agreement_fixed_price
+#: help:inv.agreement,period_unit_number:0
+msgid "Period time to prolong the next agreement"
+msgstr "Period time to prolong the next agreement"
+
+#. module: avanzosc_agreement_fixed_price
+#: field:inv.agreement,period_unit:0
+msgid "Unit"
+msgstr "Unit"
+
+#. module: avanzosc_agreement_fixed_price
+#: field:inv.agreement,partner_signed_date:0
+msgid "Signed on"
+msgstr "Signed on"
+
+#. module: avanzosc_agreement_fixed_price
+#: field:inv.agreement,fixed_price:0
+msgid "Fixed Price"
+msgstr "Fixed Price"
+

=== added file 'avanzosc_agreement_fixed_price/i18n/es.po'
--- avanzosc_agreement_fixed_price/i18n/es.po	1970-01-01 00:00:00 +0000
+++ avanzosc_agreement_fixed_price/i18n/es.po	2013-02-01 09:33:03 +0000
@@ -0,0 +1,78 @@
+# Spanish translation for avanzosc
+# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
+# This file is distributed under the same license as the avanzosc package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: avanzosc\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2011-09-15 10:24+0000\n"
+"PO-Revision-Date: 2011-09-15 14:48+0000\n"
+"Last-Translator: Daniel Campos <Unknown>\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: 2012-06-06 05:12+0000\n"
+"X-Generator: Launchpad (build 15353)\n"
+
+#. module: avanzosc_agreement_fixed_price
+#: selection:inv.agreement,period_unit:0
+msgid "Day(s)"
+msgstr "Día(s)"
+
+#. module: avanzosc_agreement_fixed_price
+#: help:inv.agreement,partner_signed_date:0
+msgid "Date when agreement was signed."
+msgstr "Fecha de firma del acuerdo."
+
+#. module: avanzosc_agreement_fixed_price
+#: selection:inv.agreement,period_unit:0
+msgid "Week(s)"
+msgstr "Semana(s)"
+
+#. module: avanzosc_agreement_fixed_price
+#: model:ir.model,name:avanzosc_agreement_fixed_price.model_inv_method
+msgid "inv.method"
+msgstr "inv.method"
+
+#. module: avanzosc_agreement_fixed_price
+#: field:inv.agreement,period_unit_number:0
+msgid "Period"
+msgstr "Período"
+
+#. module: avanzosc_agreement_fixed_price
+#: selection:inv.agreement,period_unit:0
+msgid "Year(s)"
+msgstr "Año(s)"
+
+#. module: avanzosc_agreement_fixed_price
+#: model:ir.model,name:avanzosc_agreement_fixed_price.model_inv_agreement
+msgid "inv.agreement"
+msgstr "inv.agreement"
+
+#. module: avanzosc_agreement_fixed_price
+#: selection:inv.agreement,period_unit:0
+msgid "Month(s)"
+msgstr "Mes(es)"
+
+#. module: avanzosc_agreement_fixed_price
+#: help:inv.agreement,period_unit_number:0
+msgid "Period time to prolong the next agreement"
+msgstr "Período de prolongación del siguiente acuerdo"
+
+#. module: avanzosc_agreement_fixed_price
+#: field:inv.agreement,period_unit:0
+msgid "Unit"
+msgstr "Unidad"
+
+#. module: avanzosc_agreement_fixed_price
+#: field:inv.agreement,partner_signed_date:0
+msgid "Signed on"
+msgstr "Conectado"
+
+#. module: avanzosc_agreement_fixed_price
+#: field:inv.agreement,fixed_price:0
+msgid "Fixed Price"
+msgstr "Precio fijo"

=== added file 'avanzosc_agreement_fixed_price/i18n/eu.po'
--- avanzosc_agreement_fixed_price/i18n/eu.po	1970-01-01 00:00:00 +0000
+++ avanzosc_agreement_fixed_price/i18n/eu.po	2013-02-01 09:33:03 +0000
@@ -0,0 +1,78 @@
+# Basque translation for avanzosc
+# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
+# This file is distributed under the same license as the avanzosc package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: avanzosc\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2011-09-15 10:24+0000\n"
+"PO-Revision-Date: 2011-10-04 09:43+0000\n"
+"Last-Translator: Urtzi Odriozola <Unknown>\n"
+"Language-Team: Basque <eu@xxxxxx>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2012-06-06 05:12+0000\n"
+"X-Generator: Launchpad (build 15353)\n"
+
+#. module: avanzosc_agreement_fixed_price
+#: selection:inv.agreement,period_unit:0
+msgid "Day(s)"
+msgstr "Egun(ak)"
+
+#. module: avanzosc_agreement_fixed_price
+#: help:inv.agreement,partner_signed_date:0
+msgid "Date when agreement was signed."
+msgstr "Kontratua siñatua izan zen egunaren data."
+
+#. module: avanzosc_agreement_fixed_price
+#: selection:inv.agreement,period_unit:0
+msgid "Week(s)"
+msgstr "Aste(ak)"
+
+#. module: avanzosc_agreement_fixed_price
+#: model:ir.model,name:avanzosc_agreement_fixed_price.model_inv_method
+msgid "inv.method"
+msgstr "inv.method"
+
+#. module: avanzosc_agreement_fixed_price
+#: field:inv.agreement,period_unit_number:0
+msgid "Period"
+msgstr "Denboraldia"
+
+#. module: avanzosc_agreement_fixed_price
+#: selection:inv.agreement,period_unit:0
+msgid "Year(s)"
+msgstr "Urte(ak)"
+
+#. module: avanzosc_agreement_fixed_price
+#: model:ir.model,name:avanzosc_agreement_fixed_price.model_inv_agreement
+msgid "inv.agreement"
+msgstr "inv.agreement"
+
+#. module: avanzosc_agreement_fixed_price
+#: selection:inv.agreement,period_unit:0
+msgid "Month(s)"
+msgstr "Hilabete(ak)"
+
+#. module: avanzosc_agreement_fixed_price
+#: help:inv.agreement,period_unit_number:0
+msgid "Period time to prolong the next agreement"
+msgstr "Hurrengo kontratua eraberritzeko denbora tartea."
+
+#. module: avanzosc_agreement_fixed_price
+#: field:inv.agreement,period_unit:0
+msgid "Unit"
+msgstr "Unitatea"
+
+#. module: avanzosc_agreement_fixed_price
+#: field:inv.agreement,partner_signed_date:0
+msgid "Signed on"
+msgstr "Sinadura data"
+
+#. module: avanzosc_agreement_fixed_price
+#: field:inv.agreement,fixed_price:0
+msgid "Fixed Price"
+msgstr "Salneurri finkoa"

=== added file 'avanzosc_agreement_fixed_price/invoicing.py'
--- avanzosc_agreement_fixed_price/invoicing.py	1970-01-01 00:00:00 +0000
+++ avanzosc_agreement_fixed_price/invoicing.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,392 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2010 - 2011 Avanzosc <http://www.avanzosc.com>
+#
+#    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 tools
+import re
+from tools.translate import _
+from mx import DateTime
+from mx.DateTime import now
+import time, locale
+import traceback, sys
+
+def _change_state(self, cr, uid, ids, field, field_type, field_id, value1_char, value1_bool, \
+        value1_int, value2_int, value1_float, value2_float, value1_date, value2_date, value1_datetime, value2_datetime, cond_value):
+    data = {}
+    if field_id:
+        field_name = self.pool.get('ir.model.fields').browse(cr, uid, field_id, {}).name
+    else:
+        field_name = 'count'
+    if not field:
+        return {'value':{},'state':False}
+    else:
+        cond_type = self.pool.get('inv.rec_type').browse(cr, uid, field).value
+        data['state'] = self.pool.get('inv.rec_type').browse(cr, uid, field).type
+        value = self.pool.get('inv.rec_type').browse(cr, uid, field).value
+        if data['state']!='[many2one]' and data['state']!='[one2many]' and data['state']!='[many2many]' and data['state']!='[boolean]' \
+                and data['state']!='[char]' and data['state']!='[selection]':
+            if value=='between' or value=='not between':
+                data['state'] += '|2|'
+            else:
+                data['state'] += '|1|'
+        if value!='between' and value!='not between':
+            data['value2_int'] = 0
+            data['value2_float'] = 0
+            data['value2_date'] = ''
+            data['value2_datetime'] = ''
+
+        res = ''
+        if cond_type == 'equal to':
+            operator = ' == '
+        elif cond_type == 'not equal to':
+            operator = ' != '
+        elif cond_type == 'greater than':
+            operator = ' > '
+        elif cond_type == 'less than':
+            operator = ' < '
+        elif cond_type == 'greater than or equal to':
+            operator = ' >= '
+        elif cond_type == 'less than or equal to':
+            operator = ' <= '
+        elif cond_type == 'regexp':
+            operator = ' match '
+        else:
+            operator = ''
+
+        if cond_type!='between' and cond_type!='not between':
+            if field_type == '[char]' or field_type == '[selection]':
+                res = field_name + operator + "'"+(value1_char and unicode(value1_char, "UTF-8") or '')+"'" or ''
+            elif field_type == '[boolean]':
+                res = field_name + operator + str(value1_bool) or ''
+            elif field_type == '[integer]':
+                res = field_name + operator + str(value1_int) or ''
+            elif field_type == '[float]':
+                res = field_name + operator + str(value1_float) or ''
+            elif field_type == '[date]':
+                res = field_name + operator + str(value1_date) or ''
+            elif field_type == '[datetime]':
+                res = field_name + operator + str(value1_datetime) or ''
+        elif cond_type=='between':
+            if field_type == '[integer]':
+                res = '(' + field_name + ' >= ' + str(value1_int)+')'
+                if value2_int != None:
+                    res += ' and ('+field_name+ ' <= ' + str(value2_int)+')' or ''
+            elif field_type == '[float]':
+                res = '(' + field_name + ' >= ' + str(value1_float)+')'
+                if value2_float != None:
+                    res += ' and ('+field_name+ ' <= ' + str(value2_float)+')' or ''
+            elif field_type == '[date]':
+                res = '(' + field_name + ' >= ' + str(value1_date)+')'
+                if value2_date:
+                    res += ' and ('+field_name+ ' <= ' + str(value2_date)+')' or ''
+            elif field_type == '[datetime]':
+                res += '(' + field_name + ' >= ' + str(value1_datetime)+')'
+                if value2_datetime:
+                    res += ' and ('+field_name+ ' <= ' + str(value2_datetime)+')' or ''
+        elif cond_type=='not between':
+            if field_type == '[integer]':
+                res = '(' + field_name + ' <= ' + str(value1_int)+')' or ''
+                if value2_int != None:
+                    res += ' and ('+field_name+ ' >= ' + str(value2_int)+')' or ''
+            elif field_type == '[float]':
+                res = '(' + field_name + ' <= ' + str(value1_float)+')'
+                if value2_float != None:
+                    res += ' and ('+field_name+ ' >= ' + str(value2_float)+')' or ''
+            elif field_type == '[date]':
+                res = '(' + field_name + ' <= \'' + str(value1_date)+'\')'
+                if value2_date:
+                    res += ' and ('+field_name+ ' >= \'' + str(value2_date)+'\')' or ''
+            elif field_type == '[datetime]':
+                res = '(' + field_name + ' <= \'' + str(value1_datetime)+'\')'
+                if value2_datetime:
+                    res += ' and ('+field_name+ ' >= \'' + str(value2_datetime)+'\')' or ''
+
+        if cond_type=='in' or cond_type=='not in':
+            res = field_name + ' ' + cond_type
+            if cond_value and cond_value != None:
+                res += ' ['+cond_value+']' or ''
+        data['name'] = res
+    return data
+
+#def convert_date(self, date):
+#    return time.strftime(locale.nl_langinfo(locale.D_FMT), time.strptime(date, '%Y-%m-%d'))
+
+def convert_date(self, date):
+    if len(date)==10:
+        return date[8:10]+'.'+date[5:7]+'.'+date[:4]+'.'
+    elif len(date)==7:
+        return date[5:7]+'.'+date[:4]+'.'
+    return date+'.'
+
+def reconvert_date(self, date):
+    try:
+        if len(date)==11:
+            retval = date[6:10]+'-'+date[3:5]+'-'+date[:2]
+            DateTime.strptime(retval, '%Y-%m-%d')
+            return retval
+        elif len(date)==8:
+            retval = date[3:7]+'-'+date[:2]+'-01'
+            DateTime.strptime(retval, '%Y-%m-%d')
+            return retval
+        else:
+            retval = date[:4]+'-01-01'
+            DateTime.strptime(retval, '%Y-%m-%d')
+            return retval
+    except Exception, e:
+        return '1900-01-01'
+
+def find_req_users(self, cr, uid, service):
+    result = []
+    admin_id = self.pool.get('res.users').search(cr, uid, [('login','=','admin')])[0]
+    srv = self.pool.get('inv.service').browse(cr, uid, service, {})
+    tgroup = map(int, srv.req_users)
+    #Structure changes in 6.0. Commented 5 lines
+    #tg_obj = self.pool.get('hr.timesheet.group')
+    #for wt in tgroup:
+    #    user = tg_obj.browse(cr, uid, wt, {}).manager.id
+    #    if user not in result:
+    #        result.append(user)
+
+    tg_obj = self.pool.get('hr.employee')
+    wts = tg_obj.search(cr, uid, [('user_id', 'in', tgroup)])
+    for emp in tg_obj.browse(cr, uid, wts, {}):
+        if emp.department_id:
+            if emp.department_id.manager_id and emp.id == emp.department_id.manager_id.id:
+                user = emp.department_id.manager_id.id
+                if user not in result:
+                    result.append(user)
+    #emp_obj = self.pool.get('hr.employee')
+    #emp_ids = emp_obj.search(cr, uid, [])
+    #for id in emp_ids:
+    #    emp_rec = emp_obj.browse(cr, uid, id, {})
+    #    for r in map(int, srv.req_users):
+    #        if r in map(int, emp_rec.workgroups):
+    #            user = emp_rec.user_id.id
+    #            if user not in result:
+    #                result.append(emp_rec.user_id.id)
+    if result and result[0]:
+        return result
+    else:
+        return [admin_id]
+
+def create_request(self, cr, uid, subject, req_text, service):
+    req_users = find_req_users(self, cr, uid, service)
+    admin_id = self.pool.get('res.users').search(cr, uid, [('login','=','admin')])[0]
+    for user_id in req_users:
+        req_values = {'name':subject,'act_from':admin_id,'act_to':user_id,'date_sent':time.strftime('%Y-%m-%d %H:%M:%S'),'body':req_text,'state':'waiting','priority':'2'}
+        id = self.pool.get('res.request').create(cr, uid, req_values)
+        cr.execute('select act_from,act_to,body,date_sent from res_request where id=%s', (id,))
+        values = cr.dictfetchone()
+        if len(values['body']) > 128:
+            values['name'] = values['body'][:125] + '...'
+        else:
+            values['name'] = values['body'] or '/'
+        values['req_id'] = id
+        self.pool.get('res.request.history').create(cr, uid, values)
+    return True
+
+class method(osv.osv):
+    _inherit = 'inv.method'
+ 
+    def _run_filters(self, cr, uid, ids, agr_id, context={}):
+        acc_lines = []
+        agr = self.pool.get('inv.agreement')
+        r = agr.browse(cr, uid, agr_id, {})
+        d_list = self.pool.get('inv.date_list')
+        current_date = now().strftime('%Y-%m-%d')
+        if r.service.invoicing == 'period':
+            full_date_list = map(int, r.date_list)
+            date_list1 = d_list.search(cr, uid, [('id','in',full_date_list),('status','=','wait')])
+            date_list2 = d_list.search(cr, uid, [('id','in',full_date_list),('status','=','process')])
+            date_list = date_list2 + date_list1
+            if not date_list: return True
+            date_list.reverse()
+            date_id = date_list.pop()
+            date = d_list.browse(cr, uid, date_id, {}).date
+            pdate1 = DateTime.strptime(d_list.browse(cr, uid, date_id, {}).pdate1, '%Y-%m-%d')
+            pdate2 = DateTime.strptime(d_list.browse(cr, uid, date_id, {}).pdate2, '%Y-%m-%d')
+        else:
+            date = current_date
+            date_id = False
+            pdate1 = False
+            pdate2 = False
+            date_list = []
+        try:
+            if date <= current_date and r.service.invoicing=='period':
+                d_list.write(cr, uid, date_id, {'status':'process'})
+            for p in self.browse(cr, uid, ids, {}):
+                mas_after = []
+                localspace = {"self":self,"cr":cr,"uid":uid,"re":re,"mas_aft":mas_after,"partner_id":r.partner_id.id,"contact_ids":map(int, r.partner_id.address),"pdate1":pdate1,"pdate2":pdate2,"invoice_date":date,"agre":r}
+                exec p.source in localspace
+                mas_after = localspace['mas_aft']
+                if len(mas_after) > 0:
+                    calc_ids = map(int, p.calc_ids)
+                    calc_seq = self.sort_calc_list(cr, uid, calc_ids)
+                    calc_res = False
+                    for c_id in calc_seq:
+                        c = self.pool.get('inv.calc').browse(cr, uid, c_id, {})
+                        #if c.var == 'count':
+                        calc_localspace = {"self":self,"cr":cr,"uid":uid,"re":re,"obj_ids":mas_after,"count":len(mas_after),"pdate1":pdate1,"pdate2":pdate2,"calc_date":date,"agre":r}
+                        exec c.code in calc_localspace
+                        pos = 0
+                        for result in calc_localspace['res_list']:
+                            if result:
+                                calc_res = True
+                                line = {"agr_id":agr_id,"user_id":uid,"amount":0}
+                                # Analityc Entries, field Description
+                                if c.description == 'empty':
+                                    line['name'] = ' '
+                                elif c.description == 'date':
+                                    line['name'] = convert_date(self, current_date)
+                                elif c.description == 'period':
+                                    period = d_list.browse(cr, uid, date_id, {}).period
+                                    line['name'] = period
+                                elif c.description == 'field' and c.descr_field:
+                                    line['name'] = ''
+                                    rec_id = mas_after[pos]
+                                    #for rec_id in mas_after:
+                                    localspace = {"self":self,"cr":cr,"uid":uid,"model":p.model_id.model,"rec_id":rec_id,"pdate1":pdate1,"pdate2":pdate2,"calc_date":date,'d_list':d_list,"agre":r}
+                                    cr.execute("SELECT ttype, relation FROM ir_model_fields WHERE name='"+c.descr_field.name+"' and model='"+p.model_id.model+"'")
+                                    query_res = cr.fetchone()
+                                    if query_res[0] == 'many2one':
+                                        field_value = "ids = self.pool.get('"+p.model_id.model+"').browse(cr, uid, rec_id, {})."+c.descr_field.name+".id\n"
+                                        field_value += "field_val = self.pool.get('"+query_res[1]+"').name_get(cr, uid, [ids], {})"
+                                    elif query_res[0] == 'one2many' or query_res[0] == 'many2many':
+                                        field_value = "ids = map(int, self.pool.get('"+p.model_id.model+"').browse(cr, uid, rec_id, {})."+c.descr_field.name+")\n"
+                                        field_value += "field_val = self.pool.get('"+query_res[1]+"').name_get(cr, uid, ids, {})"
+                                    else:
+                                        field_value = "field_val = self.pool.get('"+p.model_id.model+"').browse(cr, uid, rec_id, {})."+c.descr_field.name
+                                    exec field_value in localspace
+                                    if query_res[0] == 'many2one' or query_res[0] == 'one2many' or query_res[0] == 'many2many':
+                                        res = ''
+                                        for n in localspace['field_val']:
+                                            if n != localspace['field_val'][0]:
+                                                res += '; '
+                                            if n[1][0]!='(' and n[1][-1]!=')':
+                                                name = "'"+n[1]+"'"
+                                            else:
+                                                name = n[1]
+                                            temp = 'name='+name
+                                            exec temp in localspace
+                                            if type(localspace['name'])==tuple:
+                                                res += localspace['name'][0][1]
+                                            else:
+                                                res += localspace['name']
+                                        line['name'] += res
+                                    else:
+                                        line['name'] += str(localspace['field_val'])
+                                    #if rec_id!=mas_after[-1] and localspace['field_val']: line['name'] += '; '
+
+                                elif c.description == 'expression':
+                                    if (c.descr_express).find('rec_id') != -1:
+                                        line['name'] = ''
+                                        #for rec_id in mas_after:
+                                        rec_id = mas_after[pos]
+                                        localspace = {"self":self,"cr":cr,"uid":uid,"model":p.model_id.model,"rec_id":rec_id,"agr_id":r.id,"meth_id":p.id,"calc_id":c.id,"desc":'','convert_date':convert_date,'now':now,'d_list':d_list,'date_id':date_id,'pdate1':pdate1,'pdate2':pdate2,"calc_date":date,"agre":r}
+                                        exec c.descr_express in localspace
+                                        if type(localspace['desc'])==list:
+                                            for l in localspace['desc']:
+                                                line['name'] += l[1]
+                                                if l != localspace['desc'][-1]: line['name'] += '; '
+                                        else:
+                                            line['name'] += localspace['desc']
+                                        #if rec_id!=mas_after[-1]: line['name'] += '; '
+                                    else:
+                                        rec_id = mas_after[pos]
+                                        localspace = {"self":self,"cr":cr,"uid":uid,"model":p.model_id.model,"rec_id":rec_id,"agr_id":r.id,"meth_id":p.id,"calc_id":c.id,"desc":'','convert_date':convert_date,'now':now,'d_list':d_list,'date_id':date_id,'pdate1':pdate1,'pdate2':pdate2,"calc_date":date,"agre":r}
+                                        exec c.descr_express in localspace
+                                        line['name'] = localspace['desc']
+                                else:
+                                    line['name'] = ' '
+                                # Analityc Entries, field Quantity
+                                if c.quantity == 'eqone':
+                                    line['unit_amount'] = 1
+                                elif c.quantity == 'count':
+                                    line['unit_amount'] = len(mas_after)
+                                elif c.quantity == 'expression' or c.quantity == 'field':
+                                    if (c.quantity_express).find('rec_id') != -1:
+                                        line['unit_amount'] = 0
+                                        rec_id = mas_after[pos]
+                                        #for rec_id in mas_after:
+                                        localspace = {"self":self,"cr":cr,"uid":uid,"model":p.model_id.model,"rec_id":rec_id,"agr_id":r.id,"meth_id":p.id,"calc_id":c.id,"pdate1":pdate1,"pdate2":pdate2,"calc_date":date,"agre":r,"quant":''}
+                                        exec c.quantity_express in localspace
+                                        if type(localspace['quant'])==list:
+                                            for l in localspace['quant']:
+                                                line['unit_amount'] += l[1]
+                                        else:
+                                            line['unit_amount'] = localspace['quant']
+                                    else:
+                                        rec_id = mas_after[pos]
+                                        localspace = {"self":self,"cr":cr,"uid":uid,"model":p.model_id.model,"rec_id":rec_id,'mas_after':mas_after,"agr_id":r.id,"meth_id":p.id,"calc_id":c.id,"pdate1":pdate1,"pdate2":pdate2,"calc_date":date,"agre":r,"quant":''}
+                                        exec c.quantity_express in localspace
+                                        line['unit_amount'] = localspace['quant']
+                                else:
+                                    line['unit_amount'] = 0
+                                # Analityc Entries, field Analytic Account
+                                line['account_id'] = r.analytic_account.id
+                                # Analityc Entries, field Analytic journal
+                                line['journal_id'] = r.service.journal_id.id
+                                # Analityc Entries, field General account
+                                #if r.partner_id.property_account_receivable:
+                                line['general_account_id'] = c.product_id.product_tmpl_id.property_account_expense.id or c.product_id.categ_id.property_account_expense_categ.id
+                                # Analityc Entries, field Product
+                                line['product_id'] = c.product_id.id
+                                # Analityc Entries, field Product UoM
+                                line['product_uom_id'] = c.product_id.uom_id.id
+                                # Analityc Entries, field Invoicing
+                                line['to_invoice'] = c.invoicing_id.id
+#                                if r.service.purch_pricelist_id:
+#                                    ppl = r.service.purch_pricelist_id.id
+#                                    line['amount'] = -self.pool.get('product.pricelist').price_get(cr, uid, [ppl], line['product_id'], line['unit_amount'] or 1.0, r.partner_id.id)[ppl]
+#                                elif r.fixed_price != 0:
+                                line['sale_amount'] = r.fixed_price
+#                                elif r.service.pricelist_id:
+#                                    spl = r.service.pricelist_id.id
+#                                    line['sale_amount'] = self.pool.get('product.pricelist').price_get(cr, uid, [spl], line['product_id'], line['unit_amount'] or 1.0, r.partner_id.id)[spl]
+                                if r.service.invoicing == 'trigger':
+                                    date_id = d_list.create(cr, uid, {'agreement_id':r.id,'status':'inv','date':date,'state':'filled'})
+                                    line['invlog_id'] = date_id
+                                    acc_lines.append(self.pool.get('account.analytic.line').create(cr, uid, line))
+                                else:
+                                    line['invlog_id'] = date_id
+                                if date <= current_date and r.service.invoicing=='period':
+                                    cr.rollback()
+                                    acc_lines.append(self.pool.get('account.analytic.line').create(cr, uid, line))
+                                    d_list.write(cr, uid, date_id, {'status':'inv'})
+                                    cr.commit()
+                            pos += 1
+                    if not calc_res and date_id:
+                        d_list.write(cr, uid, date_id, {'status':'error'})
+                        agr.write(cr, uid, [agr_id], {'state':'error'})
+                        req_body = '- Methodology: '+p.name+'\n- Calculation:\n'+c.code+'\n- Calculation result: False'
+                        create_request(self, cr, uid, 'Calculation result is False', req_body, r.service.id)
+        except Exception, e:
+            cr.rollback()
+            if date <= current_date and r.service.invoicing=='period':
+                d_list.write(cr, uid, date_id, {'status':'error'})
+                agr.write(cr, uid, [agr_id], {'state':'error'})
+                cr.commit()
+            tb_s = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback))
+            create_request(self, cr, uid, 'Error in executed code', tb_s, r.service.id)
+        return acc_lines
+
+method()

=== added file 'avanzosc_agreement_fixed_price/sale_order.py'
--- avanzosc_agreement_fixed_price/sale_order.py	1970-01-01 00:00:00 +0000
+++ avanzosc_agreement_fixed_price/sale_order.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,113 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2010 - 2011 Avanzosc <http://www.avanzosc.com>
+#
+#    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
+from mx import DateTime
+
+from osv import osv
+from osv import fields
+from tools.translate import _
+
+class sale_order(osv.osv):
+    _inherit = 'sale.order'
+ 
+    def action_create_analytic_lines(self, cr, uid, ids, context=None):
+        res = False
+        values = {}
+        obj_sale_order_line = self.pool.get('sale.order.line')
+        obj_account_analytic_line = self.pool.get('account.analytic.line')
+        obj_factor = self.pool.get('hr_timesheet_invoice.factor')
+        obj_agreement = self.pool.get('inv.agreement')
+        if context is None:
+            context = {}
+        for order in self.browse(cr, uid, ids, context=context):
+            analytic_account = order.project_id.id
+            factor = obj_factor.search(cr, uid, [('factor', '=', 0)])[0]
+            for line in order.order_line:
+                if not line.analytic_created:
+                    if line.product_id.property_account_income:
+                        general_account = line.product_id.property_account_income.id
+                    else:
+                        general_account = line.product_id.categ_id.property_account_income_categ.id
+                    if not line.invoice_date:
+                        raise osv.except_osv(_('User error'), _('Invoice Date not found for: %s') %(line.product_id.name))
+                    values = {
+                            'date': line.invoice_date,
+                            'account_id': analytic_account,
+                            'unit_amount': line.product_uom_qty,
+                            'name': line.name,
+                            'sale_amount':line.price_subtotal,
+                            'general_account_id': general_account,
+                            'product_id': line.product_id.id,
+                            'product_uom_id': line.product_id.uom_id.id,
+                            'ref': order.name,
+                            'to_invoice': factor,
+                            'journal_id': 1,
+                            'sale_id': order.id,
+                        }
+                    if line.invoice_mode == 'once':   
+                        values.update({
+                            'sale_amount': line.price_subtotal,
+                        })
+                        obj_account_analytic_line.create(cr,uid,values)
+                    elif line.invoice_mode == 'installments':
+                        amount = line.price_subtotal / line.installments
+                        values.update({
+                            'sale_amount': amount,
+                        })
+                        if line.installment_unit == 'days':
+                            increment_size = DateTime.RelativeDateTime(days=1)
+                        elif line.installment_unit == 'weeks':
+                            increment_size = DateTime.RelativeDateTime(days=7)
+                        elif line.installment_unit == 'months':
+                            increment_size = DateTime.RelativeDateTime(months=1)
+                        elif line.installment_unit == 'years':
+                            increment_size = DateTime.RelativeDateTime(months=12)
+                        cont = line.installments
+                        while cont > 0:
+                            obj_account_analytic_line.create(cr,uid,values)
+                            next_date = DateTime.strptime(values['date'], '%Y-%m-%d') + increment_size
+                            values.update({
+                                'date': next_date.strftime('%Y-%m-%d'),
+                            })
+                            cont-=1
+                    elif line.invoice_mode == 'recur':
+                        values = {
+                            'partner_id': order.partner_id.id,
+                            'service': line.product_id.recur_service.id,
+                            'signed_date': line.invoice_date,
+                            'cur_effect_date': line.expire_date,
+                            'partner_signed_date': line.partner_signed_date or line.invoice_date,
+                            'analytic_account': analytic_account,
+                            'payment': line.payment,
+                            'recurr_unit_number': line.interval,
+                            'recurr_unit': line.interval_unit,
+                            'period_unit_number': line.period,
+                            'period_unit': line.period_unit,
+                            #'fixed_price': line.price_subtotal,
+                            'fixed_price': line.price_unit,
+                            'sale_order_line':line.id,
+                        }
+                        id = obj_agreement.create(cr, uid, values)
+                        self.write(cr, uid, [order.id], {'agreement': id})
+                        obj_agreement.get_number(cr, uid, [id])
+                        obj_agreement.set_process(cr, uid, [id])     
+        return res
+sale_order()

=== added directory 'avanzosc_analytic_invoice_ext'
=== renamed directory 'avanzosc_analytic_invoice_ext' => 'avanzosc_analytic_invoice_ext.moved'
=== added file 'avanzosc_analytic_invoice_ext/__init__.py'
--- avanzosc_analytic_invoice_ext/__init__.py	1970-01-01 00:00:00 +0000
+++ avanzosc_analytic_invoice_ext/__init__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,22 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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 hr_timesheet_invoice
+import agreement

=== added file 'avanzosc_analytic_invoice_ext/__openerp__.py'
--- avanzosc_analytic_invoice_ext/__openerp__.py	1970-01-01 00:00:00 +0000
+++ avanzosc_analytic_invoice_ext/__openerp__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,39 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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": "Avanzosc analytic invoice extension",
+    "version": "1.0",
+    "depends": ["account_invoicing"],
+    "author": "AvanzOSC",
+    "website" : "http://www.avanzosc.com";,
+    "category": "Custom modules",
+    "description": """
+    
+    """,
+    "init_xml": [],
+    'update_xml': ['invoicing_type_data.xml'],
+    'demo_xml': [],
+    'installable': True,
+    'active': False,
+#    'certificate': 'certificate',
+}
\ No newline at end of file

=== added file 'avanzosc_analytic_invoice_ext/agreement.py'
--- avanzosc_analytic_invoice_ext/agreement.py	1970-01-01 00:00:00 +0000
+++ avanzosc_analytic_invoice_ext/agreement.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,47 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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 tools
+import re
+from tools.translate import _
+from mx import DateTime
+from mx.DateTime import now
+import time, locale
+import traceback, sys
+
+
+class agreement(osv.osv):
+    _inherit = "inv.agreement"
+    
+    def set_done(self, cr, uid, ids, context={}):
+        for r in self.browse(cr, uid, ids, {}):
+            self.pool.get('ir.cron').write(cr, uid, [r.cron_id.id], {'active':False})
+            
+            inv_type = self.pool.get('hr_timesheet_invoice.factor').search(cr,uid,[('canceled','=',True)])[0]
+            for line in r.analytic_entries:
+                if not line.invoice_id:
+                    self.pool.get('account.analytic.line').write(cr,uid,line.id,{'to_invoice':inv_type})
+        self.write(cr, uid, ids, {'state':'done'})
+        return True
+    
+agreement()
\ No newline at end of file

=== added file 'avanzosc_analytic_invoice_ext/hr_timesheet_invoice.py'
--- avanzosc_analytic_invoice_ext/hr_timesheet_invoice.py	1970-01-01 00:00:00 +0000
+++ avanzosc_analytic_invoice_ext/hr_timesheet_invoice.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,37 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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 tools
+import re
+from tools.translate import _
+from mx import DateTime
+from mx.DateTime import now
+import time, locale
+import traceback, sys
+
+class hr_timesheet_invoice_factor(osv.osv):
+    _inherit = "hr_timesheet_invoice.factor"
+    _columns = {
+                'canceled': fields.boolean('Canceled'),
+                }
+hr_timesheet_invoice_factor()
\ No newline at end of file

=== added file 'avanzosc_analytic_invoice_ext/invoicing_type_data.xml'
--- avanzosc_analytic_invoice_ext/invoicing_type_data.xml	1970-01-01 00:00:00 +0000
+++ avanzosc_analytic_invoice_ext/invoicing_type_data.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data noupdate="1">
+        <record id="timesheet_invoice_factor_canceled" model="hr_timesheet_invoice.factor">
+            <field name="name">Canceled</field>
+            <field name="canceled">True</field>
+            <field name="customer_name">Cancel</field>
+            <field name="factor">100.0</field>
+        </record>
+   </data>
+</openerp>
\ No newline at end of file

=== added directory 'avanzosc_asset_amortize'
=== renamed directory 'avanzosc_asset_amortize' => 'avanzosc_asset_amortize.moved'
=== added file 'avanzosc_asset_amortize/__init__.py'
--- avanzosc_asset_amortize/__init__.py	1970-01-01 00:00:00 +0000
+++ avanzosc_asset_amortize/__init__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,24 @@
+
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution    
+#    Copyright (C) 2008-2012 Daniel (AvanzOSC). All Rights Reserved
+#    20/08/2012
+#
+#    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 General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+import asset_amortize
\ No newline at end of file

=== added file 'avanzosc_asset_amortize/__openerp__.py'
--- avanzosc_asset_amortize/__openerp__.py	1970-01-01 00:00:00 +0000
+++ avanzosc_asset_amortize/__openerp__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,43 @@
+
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution    
+#    Copyright (C) 2008-2012 Daniel (AvanzOSC). All Rights Reserved
+#    11/07/2012
+#
+#    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 General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+
+{
+    'name': 'Asset Amortize',
+    'version': "1.4",
+    'category': "Generic Modules",
+    'author': 'AvanzOSC',
+    'website': 'www.avanzosc.com',
+    'depends': ['l10n_es_account_asset'],
+    'init_xml': [],
+    'update_xml': ['asset_view.xml',
+                   ],
+    'demo_xml': [],
+    'installable': True,
+    'active': False,
+    'description': """
+                    This module allows to depreciate as percentage.
+                    Adds fiscal depreciation Board
+ 		""",
+}
+

=== added file 'avanzosc_asset_amortize/asset_amortize.py'
--- avanzosc_asset_amortize/asset_amortize.py	1970-01-01 00:00:00 +0000
+++ avanzosc_asset_amortize/asset_amortize.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,269 @@
+
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution    
+#    Copyright (C) 2008-2012 Daniel (AvanzOSC). All Rights Reserved
+#    
+#    
+#    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 General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+from osv import fields, osv
+from datetime import datetime, timedelta
+from dateutil.relativedelta import relativedelta
+import calendar
+
+class account_asset_asset(osv.osv):
+    
+    _description = 'Asset'
+    _inherit = 'account.asset.asset'
+    
+    _columns = {
+                'percent': fields.integer('Percent of Depreciation', help="If the percent is more than 0, the depreciation will be used as percent."),
+                'fiscal_pcnt': fields.integer('Fiscal Percent of Depreciation', help="If the percent is more than 0, the depreciation will be used as percent."),
+                'fiscal_deprec_line_ids': fields.one2many('account.asset.fiscal.depreciation.line', 'asset_id', 'Depreciation Lines', readonly=True, states={'draft':[('readonly',False)],'open':[('readonly',False)]}),
+                }
+    
+    def onchange_percent(self, cr, uid, ids, percent, context=None):
+        values =  {}
+        if percent > 0:
+            years = 100 / percent
+            month = 100 % percent
+            values =  {'method_number' : years,
+                       'method_period' : 12
+                       }
+        return {'value' :values}
+
+    def compute_depreciation_board(self, cr, uid, ids, context=None):
+        data = self.browse(cr, uid, ids[0], context=context)
+        depreciation_lin_obj = self.pool.get('account.asset.depreciation.line')
+        if data.percent <= 0 :
+            super (account_asset_asset , self).compute_depreciation_board (cr, uid, ids, context)
+        else:
+            for asset in self.browse(cr, uid, ids, context=context):
+                if asset.value_residual == 0.0:
+                    continue
+                posted_depreciation_line_ids = depreciation_lin_obj.search(cr, uid, [('asset_id', '=', asset.id), ('move_check', '=', True)])
+                old_depreciation_line_ids = depreciation_lin_obj.search(cr, uid, [('asset_id', '=', asset.id), ('move_id', '=', False)])
+                if old_depreciation_line_ids:
+                    depreciation_lin_obj.unlink(cr, uid, old_depreciation_line_ids, context=context)
+            
+                amount_to_depr = residual_amount = asset.value_residual
+
+                depreciation_date = datetime.strptime(self._get_last_depreciation_date(cr, uid, [asset.id], context)[asset.id], '%Y-%m-%d')
+                day = depreciation_date.day
+                month = depreciation_date.month
+                year = depreciation_date.year
+                total_days = (year % 4) and 365 or 366
+
+                undone_dotation_number = self._compute_board_undone_dotation_nb(cr, uid, asset, depreciation_date, total_days, context=context)
+                for x in range(len(posted_depreciation_line_ids), undone_dotation_number):
+                    i = x + 1
+                    amount_virt = self._compute_board_amount(cr, uid, asset, i, residual_amount, amount_to_depr, undone_dotation_number, posted_depreciation_line_ids, total_days, depreciation_date, context=context)
+                    amount = amount_virt
+                    residual_amount -= amount
+                    if asset.compute_at_end_period:
+                        #if asset.prorata and asset.method_period == 12:
+                        if asset.method_period == 12:
+                            depreciation_date = depreciation_date.replace(year, 12, 31)
+                        else:
+                            last_month_day = calendar.monthrange(year, month)[1]
+                            depreciation_date = depreciation_date.replace(year, month, last_month_day)
+
+                    vals = {
+                            'amount': amount,
+                            'asset_id': asset.id,
+                            'sequence': i,
+                            'name': str(asset.id) + '/' + str(i),
+                            'remaining_value': residual_amount,
+                            'depreciated_value': (asset.purchase_value - asset.salvage_value) - (residual_amount + amount),
+                            'depreciation_date': depreciation_date.strftime('%Y-%m-%d'),
+                     }
+                    depreciation_lin_obj.create(cr, uid, vals, context=context)
+                    # Considering Depr. Period as months
+                    depreciation_date = (datetime(year, month, day) + relativedelta(months= +asset.method_period))
+                    day = depreciation_date.day
+                    month = depreciation_date.month
+                    year = depreciation_date.year
+        return True
+    
+    def _compute_board_amount(self, cr, uid, asset, i, residual_amount, amount_to_depr, undone_dotation_number, posted_depreciation_line_ids, total_days, depreciation_date, context=None):
+        #by default amount = 0
+        amount = 0
+        if i == undone_dotation_number:
+            amount = residual_amount
+        else:
+            percent = asset.percent
+            if percent <= 0:
+                amount = super(account_asset_asset , self)._compute_board_amount (cr, uid, asset, i, residual_amount, amount_to_depr, undone_dotation_number, posted_depreciation_line_ids, total_days, depreciation_date, context=None)
+            else :
+                if asset.method == 'linear':
+                    amount = amount_to_depr / (undone_dotation_number - len(posted_depreciation_line_ids))
+                    if asset.prorata:
+                        percent = asset.percent * 0.01
+                        amount = amount_to_depr * percent
+                        days = (total_days - float(depreciation_date.strftime('%j')))+1
+                        if i == 1:
+                            amount = (amount_to_depr * asset.percent * 0.01) / total_days * days
+                        elif i == undone_dotation_number:
+                            amount = (amount_to_depr * asset.percent * 0.01) / total_days * (total_days - days)
+        return amount
+    
+    def compute_fiscal_depreciation_board(self, cr, uid, ids, context=None):
+        data = self.browse(cr, uid, ids[0], context=context)
+        depreciation_lin_obj = self.pool.get('account.asset.fiscal.depreciation.line')
+        if data.fiscal_pcnt <= 0 :
+            for asset in self.browse(cr, uid, ids, context=context):
+                if asset.value_residual == 0.0:
+                    continue
+                posted_depreciation_line_ids = depreciation_lin_obj.search(cr, uid, [('asset_id', '=', asset.id), ('move_check', '=', True)])
+                old_depreciation_line_ids = depreciation_lin_obj.search(cr, uid, [('asset_id', '=', asset.id), ('move_id', '=', False)])
+                if old_depreciation_line_ids:
+                    depreciation_lin_obj.unlink(cr, uid, old_depreciation_line_ids, context=context)
+            
+                amount_to_depr = residual_amount = asset.value_residual
+
+                depreciation_date = datetime.strptime(self._get_last_depreciation_date(cr, uid, [asset.id], context)[asset.id], '%Y-%m-%d')
+                day = depreciation_date.day
+                month = depreciation_date.month
+                year = depreciation_date.year
+                total_days = (year % 4) and 365 or 366
+
+                undone_dotation_number = self._compute_board_undone_dotation_nb(cr, uid, asset, depreciation_date, total_days, context=context)
+                for x in range(len(posted_depreciation_line_ids), undone_dotation_number):
+                    i = x + 1
+                    amount = self._compute_fiscal_board_amount(cr, uid, asset, i, residual_amount, amount_to_depr, undone_dotation_number, posted_depreciation_line_ids, total_days, depreciation_date, context=context)
+                    residual_amount -= amount
+                    if asset.compute_at_end_period:
+                        if asset.method_period == 12:
+                        #if asset.prorata and asset.method_period == 12:
+                            depreciation_date = depreciation_date.replace(year, 12, 31)
+                        else:
+                            last_month_day = calendar.monthrange(year,month)[1]
+                            depreciation_date = depreciation_date.replace(year, month, last_month_day)
+
+                    vals = {
+                            'amount': amount,
+                            'asset_id': asset.id,
+                            'sequence': i,
+                            'name': str(asset.id) +'/' + str(i),
+                            'remaining_value': residual_amount,
+                            'depreciated_value': (asset.purchase_value - asset.salvage_value) - (residual_amount + amount),
+                            'depreciation_date': depreciation_date.strftime('%Y-%m-%d'),
+                            }
+                    depreciation_lin_obj.create(cr, uid, vals, context=context)
+                    # Considering Depr. Period as months
+                    depreciation_date = (datetime(year, month, day) + relativedelta(months=+asset.method_period))
+                    day = depreciation_date.day
+                    month = depreciation_date.month
+                    year = depreciation_date.year
+        else:
+            for asset in self.browse(cr, uid, ids, context=context):
+                if asset.value_residual == 0.0:
+                    continue
+                posted_depreciation_line_ids = depreciation_lin_obj.search(cr, uid, [('asset_id', '=', asset.id), ('move_check', '=', True)])
+                old_depreciation_line_ids = depreciation_lin_obj.search(cr, uid, [('asset_id', '=', asset.id), ('move_id', '=', False)])
+                if old_depreciation_line_ids:
+                    depreciation_lin_obj.unlink(cr, uid, old_depreciation_line_ids, context=context)
+            
+                amount_to_depr = residual_amount = asset.value_residual
+
+                depreciation_date = datetime.strptime(self._get_last_depreciation_date(cr, uid, [asset.id], context)[asset.id], '%Y-%m-%d')
+                day = depreciation_date.day
+                month = depreciation_date.month
+                year = depreciation_date.year
+                total_days = (year % 4) and 365 or 366
+
+                undone_dotation_number = self._compute_board_undone_dotation_nb(cr, uid, asset, depreciation_date, total_days, context=context)
+                for x in range(len(posted_depreciation_line_ids), undone_dotation_number):
+                    i = x + 1
+                    amount_virt = self._compute_fiscal_board_amount(cr, uid, asset, i, residual_amount, amount_to_depr, undone_dotation_number, posted_depreciation_line_ids, total_days, depreciation_date, context=context)
+                    amount = amount_virt
+                    residual_amount -= amount
+                    if asset.compute_at_end_period:
+                        #if asset.prorata and asset.method_period == 12:
+                        if asset.method_period == 12:
+                            depreciation_date = depreciation_date.replace(year, 12, 31)
+                        else:
+                            last_month_day = calendar.monthrange(year, month)[1]
+                            depreciation_date = depreciation_date.replace(year, month, last_month_day)
+
+                    vals = {
+                            'amount': amount,
+                            'asset_id': asset.id,
+                            'sequence': i,
+                            'name': str(asset.id) + '/' + str(i),
+                            'remaining_value': residual_amount,
+                            'depreciated_value': (asset.purchase_value - asset.salvage_value) - (residual_amount + amount),
+                            'depreciation_date': depreciation_date.strftime('%Y-%m-%d'),
+                     }
+                    depreciation_lin_obj.create(cr, uid, vals, context=context)
+                    # Considering Depr. Period as months
+                    depreciation_date = (datetime(year, month, day) + relativedelta(months= +asset.method_period))
+                    day = depreciation_date.day
+                    month = depreciation_date.month
+                    year = depreciation_date.year
+        return True
+    
+    def _compute_fiscal_board_amount(self, cr, uid, asset, i, residual_amount, amount_to_depr, undone_dotation_number, posted_depreciation_line_ids, total_days, depreciation_date, context=None):
+        #by default amount = 0
+        amount = 0
+        if i == undone_dotation_number:
+            amount = residual_amount
+        else:
+            percent = asset.fiscal_pcnt
+            if percent <= 0:                
+                if asset.method == 'linear':
+                    amount = amount_to_depr / (undone_dotation_number - len(posted_depreciation_line_ids))
+                    if asset.prorata:
+                        amount = amount_to_depr / asset.method_number
+                        days = (total_days - float(depreciation_date.strftime('%j')))+1
+                        if i == 1:
+                            amount = (amount_to_depr / asset.method_number) / total_days * days
+                        elif i == undone_dotation_number:
+                            amount = (amount_to_depr / asset.method_number) / total_days * (total_days - days)
+                elif asset.method == 'degressive':
+                    amount = residual_amount * asset.method_progress_factor
+                    if asset.prorata:
+                        days = total_days - float(depreciation_date.strftime('%j'))
+                        if i == 1:
+                            amount = (residual_amount * asset.method_progress_factor) / total_days * days
+                        elif i == undone_dotation_number:
+                            amount = (residual_amount * asset.method_progress_factor) / total_days * (total_days - days)
+            else :
+                if asset.method == 'linear':
+                    amount = amount_to_depr / (undone_dotation_number - len(posted_depreciation_line_ids))
+                    if asset.prorata:
+                        percent = asset.fiscal_pcnt * 0.01
+                        amount = amount_to_depr * percent
+                        days = (total_days - float(depreciation_date.strftime('%j')))+1
+                        if i == 1:
+                            amount = (amount_to_depr * asset.fiscal_pcnt * 0.01) / total_days * days
+                        elif i == undone_dotation_number:
+                            amount = (amount_to_depr * asset.fiscal_pcnt * 0.01) / total_days * (total_days - days)
+                        
+        return amount
+    
+account_asset_asset()
+
+class account_asset_fiscal_depreciation_line(osv.osv):
+    _name = 'account.asset.fiscal.depreciation.line'
+    _inherit = 'account.asset.depreciation.line'
+    _description = 'Asset depreciation line'
+
+account_asset_fiscal_depreciation_line()
+
+

=== added file 'avanzosc_asset_amortize/asset_view.xml'
--- avanzosc_asset_amortize/asset_view.xml	1970-01-01 00:00:00 +0000
+++ avanzosc_asset_amortize/asset_view.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+    <data>
+    
+	<record id="account_asset_asset_form_inh" model="ir.ui.view">
+		<field name="name">account.asset.asset.form.inherit</field>
+		<field name="model">account.asset.asset</field>
+		<field name="inherit_id" ref="l10n_es_account_asset.view_account_asset_asset_form" />
+		<field name="type">form</field>
+		<field name="arch" type="xml">
+			<xpath expr="/form/notebook/page[@string='General']/group/field[@name='method_end']" position="after">
+				<field name="percent" on_change="onchange_percent(percent)"/>
+			</xpath>
+			
+			<xpath expr="/form/notebook/page[@string='Depreciation board']" position="after">
+				<page string="Fiscal Depreciation board">
+                    <field name="fiscal_deprec_line_ids" colspan="4" nolabel="1" mode="tree,graph">
+                       <tree string="Depreciation Lines" colors="blue:(move_check == False);black:(move_check == True)">
+                          <field name="depreciation_date"/>
+                          <field name="sequence" invisible="1"/>
+                          <field name="depreciated_value" readonly="1"/>
+                          <field name="amount"/>
+                          <field name="remaining_value" readonly="1"/>
+                          <field name="move_check" readonly="1"/>
+                          <field name="parent_state" invisible="1"/>
+<!--                          <button name="create_move" attrs="{'invisible':['|',('move_check','!=',False),('parent_state','!=','open')]}" icon="gtk-execute" string="Create Move" type="object"/>  -->
+                       </tree>
+                       <graph type="bar">
+                          <field name="name"/>
+                          <field name="amount"/>
+                          <field name="depreciated_value"/>
+                       </graph>
+                    </field>
+                    <button type="object" name="compute_fiscal_depreciation_board" string="Compute" icon="terp-stock_format-scientific" colspan="2" attrs="{'invisible':[('state','=','close')]}"/>
+                    <field name="fiscal_pcnt" on_change="onchange_percent(fiscal_pcnt)"/>
+                 </page>
+			</xpath>
+			
+    	</field>
+    </record>
+   
+	</data>
+</openerp> 
\ No newline at end of file

=== added directory 'avanzosc_claim_filter_add'
=== added file 'avanzosc_claim_filter_add/__init__.py'
--- avanzosc_claim_filter_add/__init__.py	1970-01-01 00:00:00 +0000
+++ avanzosc_claim_filter_add/__init__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,23 @@
+
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution    
+#    Copyright (C) 2008-2012 Daniel (AvanzOSC). All Rights Reserved
+#    
+#    
+#    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 General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+

=== added file 'avanzosc_claim_filter_add/__openerp__.py'
--- avanzosc_claim_filter_add/__openerp__.py	1970-01-01 00:00:00 +0000
+++ avanzosc_claim_filter_add/__openerp__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,45 @@
+
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution    
+#    Copyright (C) 2008-2012 Daniel (AvanzOSC). All Rights Reserved
+#    
+#    
+#    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 General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+
+
+{
+    "name" : "Avanzosc Claim mod",
+    "version" : "1.0",
+    "description": """ 
+                This module adds:
+                 - Filter for team group
+                    """,
+    "author" : "AvanzOSC",
+    "website" : "www.avanzosc.com",
+    "depends" : ["base"],
+    "category" : "Generic Modules",
+    "init_xml" : [],
+    "demo_xml" : [],
+    "update_xml" : ["claim_mod_view.xml",
+                    ],
+    "active" : False,
+    "installable" : True
+    
+}
+

=== added file 'avanzosc_claim_filter_add/claim_mod.py'
--- avanzosc_claim_filter_add/claim_mod.py	1970-01-01 00:00:00 +0000
+++ avanzosc_claim_filter_add/claim_mod.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,23 @@
+
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution    
+#    Copyright (C) 2008-2012 Daniel (AvanzOSC). All Rights Reserved
+#    
+#    
+#    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 General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+

=== added file 'avanzosc_claim_filter_add/claim_mod_view.xml'
--- avanzosc_claim_filter_add/claim_mod_view.xml	1970-01-01 00:00:00 +0000
+++ avanzosc_claim_filter_add/claim_mod_view.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,39 @@
+<openerp>
+	<data>
+
+	<!-- CRM Claim tree view inherit-->
+	<record id="crm_case_claims_tree_view_inherit" model="ir.ui.view">
+		<field name="name">CRM - Claims Tree.inherit</field>
+		<field name="model">crm.claim</field>
+		<field name="inherit_id" ref="crm_claim.crm_case_claims_tree_view" />
+		<field name="arch" type="xml">
+			<data>
+				<xpath expr="/tree/field[@name='user_id']" position="after">
+					<field name="section_id" select="1"/>
+				</xpath>
+			</data>
+		</field>
+	</record>
+
+
+	<!-- CRM Claim Search view inherit-->
+	<record id="crm_case_claims_search_view_inherit" model="ir.ui.view">
+		<field name="name">CRM - Claims Search.inherit</field>
+		<field name="model">crm.claim</field>
+		<field name="inherit_id" ref="crm_claim.view_crm_case_claims_filter" />
+		<field name="arch" type="xml">
+			<data>
+				<xpath expr="/search/field[@name='partner_id']" position="after">
+					<field name="section_id" widget="selection"/>
+				</xpath>
+				<xpath expr="/search/group/filter[@string='Partner']" position="after">
+					<filter string="Sales Team" icon="terp-partner"
+                            domain="[]" help="Sales Team"
+                            context="{'group_by':'section_id'}" />
+				</xpath>
+			</data>
+		</field>
+	</record>
+	
+	</data>
+</openerp>
\ No newline at end of file

=== added directory 'avanzosc_crm_call_ext'
=== renamed directory 'avanzosc_crm_call_ext' => 'avanzosc_crm_call_ext.moved'
=== added file 'avanzosc_crm_call_ext/__init__.py'
--- avanzosc_crm_call_ext/__init__.py	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/__init__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,27 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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 crm_phonecall
+import crm_helpdesk
+import crm_claim
+import crm_opportunity
+import crm_meeting
+import wizard
\ No newline at end of file

=== added file 'avanzosc_crm_call_ext/__openerp__.py'
--- avanzosc_crm_call_ext/__openerp__.py	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/__openerp__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,59 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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": "Avanzosc CRM Call Extension",
+    "version": "1.0",
+    "depends": ["base",
+                "crm",
+                "crm_helpdesk",
+                "crm_claim",
+                "sale",
+                "sale_crm",
+                ],
+    "author": "AvanzOSC",
+    "website" : "http://www.avanzosc.com";,
+    "category": "Custom Module",
+    "website" : "www.avanzosc.com",
+    "description": """
+    This module provide 2 buttons to record:
+        * Technical incidence from the CRM input form.
+        * Administrative incidence from the CRM input form
+    
+    The state of the new incidence will be 'pending' and as a responsible of the case, the corresponding responsible of the technical/administrative team will be stablished as default.
+    """,
+    "init_xml": [],
+    'update_xml': ["wizard/crm_phonecall_to_technicalcase_view.xml",
+                   "wizard/crm_phonecall_to_admincase_view.xml",
+                   "wizard/crm_phonecall_to_lead_view.xml",
+                   "wizard/crm_meeting_state_change.xml",
+                   "wizard/crm_meeting_responsible_change.xml",
+                   "wizard/crm_claim_to_meeting.xml",
+                   "crm_phonecall_view.xml",
+                   "crm_opportunity_view.xml",
+                   "crm_helpdesk_view.xml",
+                   "crm_claim_view.xml",
+                   "crm_meeting_view.xml",
+                   ],
+    'demo_xml': [],
+    'installable': True,
+    'active': False,
+}
\ No newline at end of file

=== added file 'avanzosc_crm_call_ext/crm_claim.py'
--- avanzosc_crm_call_ext/crm_claim.py	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/crm_claim.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,70 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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 crm import crm
+from osv import fields, osv
+
+class crm_claim(crm.crm_case, osv.osv):
+    _inherit = 'crm.claim'
+    
+    _columns = {
+        'credit': fields.float('Total Receivable'),
+        'invoice2pay': fields.integer('Invoices to pay'),
+        'last_invoice': fields.date('Last Invoice'),
+        'last_payment': fields.date('Last Payment'),
+    }
+    
+    def onchange_partner_id(self, cr, uid, ids, part, email=False):
+        invoice_obj = self.pool.get('account.invoice')
+        voucher_obj = self.pool.get('account.voucher')
+        res = super(crm_claim, self).onchange_partner_id(cr, uid, ids, part, email)
+        if part:
+            partner = self.pool.get('res.partner').browse(cr, uid, part)
+            unpaid_invoice_ids = invoice_obj.search(cr, uid, [('partner_id', '=', part), ('state', '=', 'open')])
+            invoice_ids = invoice_obj.search(cr, uid, [('partner_id', '=', part)])
+            voucher_ids = voucher_obj.search(cr, uid, [('partner_id', '=', part)])
+            if invoice_ids:
+                last_invoice = invoice_obj.browse(cr, uid, invoice_ids[0])
+                for invoice in invoice_obj.browse(cr, uid, invoice_ids):
+                    if invoice.date_invoice > last_invoice.date_invoice and invoice.date_invoice != False:
+                        last_invoice = invoice
+                    elif last_invoice.date_invoice == False:
+                        last_invoice = invoice
+                res['value'].update({
+                       'last_invoice': last_invoice.date_invoice,
+                })  
+            if voucher_ids:
+                last_voucher = voucher_obj.browse(cr, uid, voucher_ids[0])
+                for voucher in voucher_obj.browse(cr, uid, voucher_ids):
+                    if voucher.date > last_voucher.date and voucher.date != False:
+                        last_voucher = voucher
+                    elif last_voucher.date == False:
+                        last_voucher = voucher
+                res['value'].update({
+                       'last_payment': last_voucher.date,
+                })   
+            res['value'].update({
+                'credit': partner.credit,
+                'invoice2pay': int(len(unpaid_invoice_ids)),
+            })
+        return res
+    
+crm_claim()
\ No newline at end of file

=== added file 'avanzosc_crm_call_ext/crm_claim_view.xml'
--- avanzosc_crm_call_ext/crm_claim_view.xml	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/crm_claim_view.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+	<data>
+
+		<!-- ================================ CRM Claim Form Inheritance ================================ -->
+
+		<record model="ir.ui.view" id="crm_claim_form_view_inh">
+			<field name="name">crm.claim.inh</field>
+			<field name="model">crm.claim</field>
+			<field name="type">form</field>
+			<field name="inherit_id" ref="crm_claim.crm_case_claims_form_view" />
+			<field name="arch" type="xml">
+				<xpath expr="/form/group/notebook/page/group[2]" position="after">
+					<group col="2" colspan="2">
+						<separator colspan="2" string="Accounting Information" />
+						<field name="credit" />
+						<field name="invoice2pay" />
+						<field name="last_invoice" />
+						<field name="last_payment" />
+					</group>
+				</xpath>
+				 <field name="date" position="after">
+				 	<group colspan="2" col="4">
+			 			<group colspan="1" col="4">
+			 				<button name="%(claim_to_meeting_act)d" string="Create meeting" type="action" icon="gtk-jump-to" />
+			 			</group>
+			 		</group>
+				 </field>
+			</field>
+		</record>
+
+		<record model="ir.ui.view" id="crm_claim_tree_view_inh">
+			<field name="name">crm.claim.tree.inh</field>
+			<field name="model">crm.claim</field>
+			<field name="type">tree</field>
+			<field name="inherit_id" ref="crm_claim.crm_case_claims_tree_view" />
+			<field name="arch" type="xml">
+				<field name="stage_id" position="attributes">
+					<attribute name="invisible">0</attribute>
+				</field>
+			</field>
+		</record>
+
+		<record model="ir.ui.view" id="crm_claim_search_view_inh">
+			<field name="name">crm.claim.search.inh</field>
+			<field name="model">crm.claim</field>
+			<field name="type">search</field>
+			<field name="inherit_id" ref="crm_claim.view_crm_case_claims_filter" />
+			<field name="arch" type="xml">
+				<field name="partner_id" position="after">
+					<field name="section_id" widget="selection" />
+				</field>
+				<field name="name" position="after">
+					<field name="stage_id" widget="selection" />
+					<!-- domain="[('type', '=', 'claim')]" -->
+				</field>
+			</field>
+		</record>
+
+	</data>
+</openerp>
\ No newline at end of file

=== added file 'avanzosc_crm_call_ext/crm_helpdesk.py'
--- avanzosc_crm_call_ext/crm_helpdesk.py	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/crm_helpdesk.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,70 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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 crm import crm
+from osv import fields, osv
+
+class crm_helpdesk(crm.crm_case, osv.osv):
+    _inherit = 'crm.helpdesk'
+    
+    _columns = {
+        'credit': fields.float('Total Receivable'),
+        'invoice2pay': fields.integer('Invoices to pay'),
+        'last_invoice': fields.date('Last Invoice'),
+        'last_payment': fields.date('Last Payment'),
+    }
+    
+    def onchange_partner_id(self, cr, uid, ids, part, email=False):
+        invoice_obj = self.pool.get('account.invoice')
+        voucher_obj = self.pool.get('account.voucher')
+        res = super(crm_helpdesk, self).onchange_partner_id(cr, uid, ids, part, email)
+        if part:
+            partner = self.pool.get('res.partner').browse(cr, uid, part)
+            unpaid_invoice_ids = invoice_obj.search(cr, uid, [('partner_id', '=', part), ('state', '=', 'open')])
+            invoice_ids = invoice_obj.search(cr, uid, [('partner_id', '=', part)])
+            voucher_ids = voucher_obj.search(cr, uid, [('partner_id', '=', part)])
+            if invoice_ids:
+                last_invoice = invoice_obj.browse(cr, uid, invoice_ids[0])
+                for invoice in invoice_obj.browse(cr, uid, invoice_ids):
+                    if invoice.date_invoice > last_invoice.date_invoice and invoice.date_invoice != False:
+                        last_invoice = invoice
+                    elif last_invoice.date_invoice == False:
+                        last_invoice = invoice
+                res['value'].update({
+                       'last_invoice': last_invoice.date_invoice,
+                })  
+            if voucher_ids:
+                last_voucher = voucher_obj.browse(cr, uid, voucher_ids[0])
+                for voucher in voucher_obj.browse(cr, uid, voucher_ids):
+                    if voucher.date > last_voucher.date and voucher.date != False:
+                        last_voucher = voucher
+                    elif last_voucher.date == False:
+                        last_voucher = voucher
+                res['value'].update({
+                       'last_payment': last_voucher.date,
+                })            
+            res['value'].update({
+                'credit': partner.credit,
+                'invoice2pay': int(len(unpaid_invoice_ids)),
+            })
+        return res
+    
+crm_helpdesk()
\ No newline at end of file

=== added file 'avanzosc_crm_call_ext/crm_helpdesk_view.xml'
--- avanzosc_crm_call_ext/crm_helpdesk_view.xml	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/crm_helpdesk_view.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+	<data>
+
+		<!--
+		================================ 
+		CRM HelpDesk Form Inheritance
+		================================
+		-->
+
+		<record model="ir.ui.view" id="crm_helpdesk_form_view_inh">
+			<field name="name">crm.helpdesk.inh</field>
+			<field name="model">crm.helpdesk</field>
+			<field name="type">form</field>
+			<field name="inherit_id" ref="crm_helpdesk.crm_case_form_view_helpdesk" />
+			<field name="arch" type="xml">
+				<xpath expr="/form/notebook/page/group[2]"
+					position="after" >
+					<group col="2" colspan="2">
+						<separator colspan="2" string="Accounting Information" />
+						<field name="credit"/>
+						<field name="invoice2pay"/>
+						<field name="last_invoice"/>
+						<field name="last_payment"/>
+					</group>
+	            </xpath>
+			</field>
+		</record>
+
+	</data>
+</openerp>
\ No newline at end of file

=== added file 'avanzosc_crm_call_ext/crm_meeting.py'
--- avanzosc_crm_call_ext/crm_meeting.py	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/crm_meeting.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,80 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2010 - 2011 Avanzosc <http://www.avanzosc.com>
+#
+#    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
+from osv import fields
+from tools.translate import _
+from base_calendar import base_calendar
+
+
+class crm_meeting(osv.osv):
+    _inherit = 'crm.meeting'
+    
+    _columns = {
+        'sale_order_id': fields.many2one('sale.order', 'Sale Order', states={'done': [('readonly', True)]}),
+        'crm_claim_id': fields.many2one('crm.claim', 'Claim',  states={'done': [('readonly', True)]}),
+        'partner_phone': fields.char('Phone', size=64,  states={'done': [('readonly', True)]}),
+        'state': fields.selection([('open', 'Confirmed'),
+                                    ('draft', 'Unconfirmed'),
+                                    ('cancel', 'Cancelled'),
+                                    ('done', 'Done'),
+                                    ('released', 'Released')], 'State', \
+                                    size=16, readonly=True),
+    }
+ 
+    def onchange_team(self, cr, uid, ids, team_id, context=None):
+        res = {}
+        section_obj = self.pool.get('crm.case.section')
+        if team_id:
+            team = section_obj.browse(cr, uid, team_id)
+            res = {
+                'user_id': team.user_id.id,
+                'organizer': team.user_id.user_email,
+            }
+        return {'value': res}
+    
+    def case_released(self, cr, uid, ids, *args):
+        """Releases Case
+        @param self: The object pointer
+        @param cr: the current row, from the database cursor,
+        @param uid: the current user’s ID for security checks,
+        @param ids: List of case Ids
+        @param *args: Tuple Value for additional Params
+        """
+        cases = self.browse(cr, uid, ids)
+        cases[0].state # to fill the browse record cache
+        self.message_append(cr, uid, cases, _('Released'))
+        self.write(cr, uid, ids, {'state': 'released'})
+        #
+        # We use the cache of cases to keep the old case state
+        #
+        self._action(cr, uid, cases, 'released')
+        return True
+    
+    def onchange_partner_address_id(self, cr, uid, ids, add, email=False):
+        
+        res = super(crm_meeting, self).onchange_partner_address_id(cr,uid,ids,add,email)
+        if add:
+            add_obj = self.pool.get('res.partner.address').browse(cr,uid,add)
+            phone = self.pool.get('res.partner').browse(cr, uid,add_obj.partner_id.id).phone
+            res.update({'value':{'partner_phone':phone}})
+        return res
+crm_meeting()
\ No newline at end of file

=== added file 'avanzosc_crm_call_ext/crm_meeting_view.xml'
--- avanzosc_crm_call_ext/crm_meeting_view.xml	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/crm_meeting_view.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+	<data>
+
+		<record model="ir.ui.view" id="crm_meeting_tree_view_inh">
+			<field name="name">crm.meeting.tree.view.inh</field>
+			<field name="model">crm.meeting</field>
+			<field name="type">tree</field>
+			<field name="inherit_id" ref="crm.crm_case_tree_view_meet" />
+			<field name="arch" type="xml">
+				<field name="name" position="after">
+					<field name="sale_order_id" />					
+				</field>
+				<field name="partner_id" position="after">
+					<field name="partner_phone"/>
+				</field>
+			</field>
+		</record>
+
+		<record model="ir.ui.view" id="crm_meeting_form_view_inh">
+			<field name="name">crm.meeting.form.view.inh</field>
+			<field name="model">crm.meeting</field>
+			<field name="type">form</field>
+			<field name="inherit_id" ref="crm.crm_case_form_view_meet" />
+			<field name="arch" type="xml">
+				<field name="allday" position="replace">
+					<field name="sale_order_id" />
+				</field>
+				<field name="alarm_id" position="after">
+					<field name="crm_claim_id" />
+				<!--</field>
+				<field name="edit_all" position="after">-->
+					<field name="allday" on_change="onchange_dates(date,False,False,allday)" />
+				</field>
+				<field name="email_from" position="after">
+					<field name="partner_phone"/>
+				</field>
+				<field name="section_id" position="attributes">
+					<attribute name="on_change">onchange_team(section_id)</attribute>
+				</field>
+				<xpath expr="/form/notebook/page/group/button[@name='case_close']" position="replace">
+				  	<button name="case_close" string="Done"
+                            states="open,released" type="object"
+                            icon="gtk-jump-to" />
+				  	<button name="case_released" string="Release"
+                            states="open" type="object"
+                            icon="gtk-jump-to" />
+                </xpath>
+                <xpath expr="/form/notebook/page/group/button[@name='case_reset']" position="replace">
+                 	<button name="case_reset" string="Reset to Unconfirmed"
+                            states="open,done,released" type="object"
+                            icon="gtk-convert" />
+                </xpath>
+			</field>
+		</record>
+
+		<record model="ir.ui.view" id="crm_meeting_search_view_inh">
+			<field name="name">crm.meeting.search.view.inh</field>
+			<field name="model">crm.meeting</field>
+			<field name="type">search</field>
+			<field name="inherit_id" ref="crm.view_crm_case_meetings_filter" />
+			<field name="arch" type="xml">
+				<field name="name" position="before">
+					<filter string="Draft" icon="terp-document-new" domain="[('state', '=', 'draft')]" />
+					<filter string="Open" icon="terp-emblem-documents" domain="[('state', '=', 'open')]" />
+					<filter string="Done" icon="terp-check" domain="[('state', '=', 'done')]" />
+					<separator orientation="vertical" />
+				</field>
+				<field name="user_id" position="before">
+					<filter string="Sales Team" icon="terp-personal" domain="[]"
+						context="{'group_by':'section_id'}" />
+				</field>
+				<field name="user_id" position="after">
+					<filter string="Location" icon="terp-go-home" domain="[]"
+						context="{'group_by':'location'}" />
+					<field name="partner_phone"/>
+				</field>
+			</field>
+		</record>
+
+	</data>
+</openerp>

=== added file 'avanzosc_crm_call_ext/crm_opportunity.py'
--- avanzosc_crm_call_ext/crm_opportunity.py	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/crm_opportunity.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,167 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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
+
+from crm import crm
+from osv import fields, osv
+from tools.translate import _
+
+class crm_opportunity(osv.osv):
+    _inherit = 'crm.lead'
+    
+    _columns = {
+        'credit': fields.float('Total Receivable'),
+        'invoice2pay': fields.integer('Invoices to pay'),
+        'last_invoice': fields.date('Last Invoice'),
+        'last_payment': fields.date('Last Payment'),
+    }
+    
+    def onchange_partner_id(self, cr, uid, ids, part, email=False):
+        invoice_obj = self.pool.get('account.invoice')
+        voucher_obj = self.pool.get('account.voucher')
+        res = super(crm_opportunity, self).onchange_partner_id(cr, uid, ids, part, email)
+        if part:
+            partner = self.pool.get('res.partner').browse(cr, uid, part)
+            unpaid_invoice_ids = invoice_obj.search(cr, uid, [('partner_id', '=', part), ('state', '=', 'open')])
+            invoice_ids = invoice_obj.search(cr, uid, [('partner_id', '=', part)])
+            voucher_ids = voucher_obj.search(cr, uid, [('partner_id', '=', part)])
+            if invoice_ids:
+                last_invoice = invoice_obj.browse(cr, uid, invoice_ids[0])
+                for invoice in invoice_obj.browse(cr, uid, invoice_ids):
+                    if invoice.date_invoice > last_invoice.date_invoice and invoice.date_invoice != False:
+                        last_invoice = invoice
+                    elif last_invoice.date_invoice == False:
+                        last_invoice = invoice
+                res['value'].update({
+                       'last_invoice': last_invoice.date_invoice,
+                })  
+            if voucher_ids:
+                last_voucher = voucher_obj.browse(cr, uid, voucher_ids[0])
+                for voucher in voucher_obj.browse(cr, uid, voucher_ids):
+                    if voucher.date > last_voucher.date and voucher.date != False:
+                        last_voucher = voucher
+                    elif last_voucher.date == False:
+                        last_voucher = voucher
+                res['value'].update({
+                       'last_payment': last_voucher.date,
+                })            
+            res['value'].update({
+                'credit': partner.credit,
+                'invoice2pay': int(len(unpaid_invoice_ids)),
+            })
+        return res
+    
+crm_opportunity()
+
+class crm_make_sale(osv.osv_memory):
+
+    _inherit = "crm.make.sale"
+    
+    def makeOrder(self, cr, uid, ids, context=None):
+        """
+        This function  create Quotation on given case.
+        @param self: The object pointer
+        @param cr: the current row, from the database cursor,
+        @param uid: the current user’s ID for security checks,
+        @param ids: List of crm make sales' ids
+        @param context: A standard dictionary for contextual values
+        @return: Dictionary value of created sales order.
+        """
+        if context is None:
+            context = {}
+
+        case_obj = self.pool.get('crm.lead')
+        sale_obj = self.pool.get('sale.order')
+        partner_obj = self.pool.get('res.partner')
+        address_obj = self.pool.get('res.partner.address')
+        data = context and context.get('active_ids', []) or []
+
+        for make in self.browse(cr, uid, ids, context=context):
+            partner = make.partner_id
+            partner_addr = partner_obj.address_get(cr, uid, [partner.id],
+                    ['default', 'invoice', 'delivery', 'contact'])
+            pricelist = partner.property_product_pricelist.id
+            fpos = partner.property_account_position and partner.property_account_position.id or False
+            new_ids = []
+            for case in case_obj.browse(cr, uid, data, context=context):
+                if not partner and case.partner_id:
+                    partner = case.partner_id
+                    fpos = partner.property_account_position and partner.property_account_position.id or False
+                    partner_addr = partner_obj.address_get(cr, uid, [partner.id],
+                            ['default', 'invoice', 'delivery', 'contact'])
+                    pricelist = partner.property_product_pricelist.id
+                if False in partner_addr.values():
+                    raise osv.except_osv(_('Data Insufficient!'), _('Customer has no addresses defined!'))
+                
+                def_address = address_obj.browse(cr, uid, partner_addr['default'])
+                
+                if not def_address.analytic:
+                    raise osv.except_osv(_('Data Insufficient!'), _('Customer has no analytic account defined!'))
+                vals = {
+                    'origin': _('Opportunity: %s') % str(case.id),
+                    'section_id': case.section_id and case.section_id.id or False,
+                    'shop_id': make.shop_id.id,
+                    'partner_id': partner.id,
+                    'pricelist_id': pricelist,
+                    'partner_invoice_id': partner_addr['invoice'],
+                    'partner_order_id': partner_addr['contact'],
+                    'partner_shipping_id': partner_addr['delivery'],
+                    'project_id': def_address.analytic and def_address.analytic.id or False,
+                    'date_order': time.strftime('%Y-%m-%d'),
+                    'fiscal_position': fpos,
+                }
+                if partner.id:
+                    vals['user_id'] = partner.user_id and partner.user_id.id or uid
+                new_id = sale_obj.create(cr, uid, vals)
+                case_obj.write(cr, uid, [case.id], {'ref': 'sale.order,%s' % new_id})
+                new_ids.append(new_id)
+                message = _('Opportunity ') + " '" + case.name + "' "+ _("is converted to Quotation.")
+                self.log(cr, uid, case.id, message)
+                case_obj.message_append(cr, uid, [case], _("Converted to Sales Quotation(id: %s).") % (new_id))
+
+            if make.close:
+                case_obj.case_close(cr, uid, data)
+            if not new_ids:
+                return {'type': 'ir.actions.act_window_close'}
+            if len(new_ids)<=1:
+                value = {
+                    'domain': str([('id', 'in', new_ids)]),
+                    'view_type': 'form',
+                    'view_mode': 'form',
+                    'res_model': 'sale.order',
+                    'view_id': False,
+                    'type': 'ir.actions.act_window',
+                    'res_id': new_ids and new_ids[0]
+                }
+            else:
+                value = {
+                    'domain': str([('id', 'in', new_ids)]),
+                    'view_type': 'form',
+                    'view_mode': 'tree,form',
+                    'res_model': 'sale.order',
+                    'view_id': False,
+                    'type': 'ir.actions.act_window',
+                    'res_id': new_ids
+                }
+            return value
+    
+crm_make_sale()

=== added file 'avanzosc_crm_call_ext/crm_opportunity_view.xml'
--- avanzosc_crm_call_ext/crm_opportunity_view.xml	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/crm_opportunity_view.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+	<data>
+
+		<!--
+		================================ 
+		CRM Opportunity Form Inheritance
+		================================
+		-->
+
+		<record model="ir.ui.view" id="crm_oppor_form_view_inh">
+			<field name="name">crm.lead.oppor.inh</field>
+			<field name="model">crm.lead</field>
+			<field name="type">form</field>
+			<field name="inherit_id" ref="crm.crm_case_form_view_oppor" />
+			<field name="arch" type="xml">
+				<xpath expr="/form/notebook/page/group[2]"
+					position="after" >
+					<group col="2" colspan="2">
+						<separator colspan="2" string="Accounting Information" />
+						<field name="credit"/>
+						<field name="invoice2pay"/>
+						<field name="last_invoice"/>
+						<field name="last_payment"/>
+					</group>
+	            </xpath>
+			</field>
+		</record>
+
+	</data>
+</openerp>

=== added file 'avanzosc_crm_call_ext/crm_phonecall.py'
--- avanzosc_crm_call_ext/crm_phonecall.py	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/crm_phonecall.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,146 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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 crm import crm
+from osv import fields, osv
+
+from datetime import datetime
+import time
+from tools.translate import _
+
+class crm_phonecall(crm.crm_case, osv.osv):
+    _inherit = ['crm.phonecall','mail.thread']
+    _name = "crm.phonecall"
+        
+    _columns = {
+        'credit': fields.float('Total Receivable'),
+        'invoice2pay': fields.integer('Invoices to pay'),
+        'last_invoice': fields.date('Last Invoice'),
+        'last_payment': fields.date('Last Payment'),
+        'lead_id' : fields.many2one('crm.lead', 'Lead'),
+        'helpdesk_id' : fields.many2one('crm.helpdesk', 'Help Desk'),
+        'claim_id' : fields.many2one('crm.claim', 'Claim'),
+        'canal_id': fields.many2one('crm.case.channel','Canal'),
+        'message_ids': fields.one2many('mail.message', 'res_id', 'Messages', domain=[('model','=',_name)]),
+
+    }
+    
+    def onchange_partner_id(self, cr, uid, ids, part, email=False):
+        invoice_obj = self.pool.get('account.invoice')
+        voucher_obj = self.pool.get('account.voucher')
+        res = super(crm_phonecall, self).onchange_partner_id(cr, uid, ids, part, email)
+        if part:
+            partner = self.pool.get('res.partner').browse(cr, uid, part)
+            unpaid_invoice_ids = invoice_obj.search(cr, uid, [('partner_id', '=', part), ('state', '=', 'open')])
+            invoice_ids = invoice_obj.search(cr, uid, [('partner_id', '=', part)])
+            voucher_ids = voucher_obj.search(cr, uid, [('partner_id', '=', part)])
+            if invoice_ids:
+                last_invoice = invoice_obj.browse(cr, uid, invoice_ids[0])
+                for invoice in invoice_obj.browse(cr, uid, invoice_ids):
+                    if invoice.date_invoice > last_invoice.date_invoice and invoice.date_invoice != False:
+                        last_invoice = invoice
+                    elif last_invoice.date_invoice == False:
+                        last_invoice = invoice
+                res['value'].update({
+                       'last_invoice': last_invoice.date_invoice,
+                })  
+            if voucher_ids:
+                last_voucher = voucher_obj.browse(cr, uid, voucher_ids[0])
+                for voucher in voucher_obj.browse(cr, uid, voucher_ids):
+                    if voucher.date > last_voucher.date and voucher.date != False:
+                        last_voucher = voucher
+                    elif last_voucher.date == False:
+                        last_voucher = voucher
+                res['value'].update({
+                       'last_payment': last_voucher.date,
+                })
+            if unpaid_invoice_ids:
+                res['value'].update({
+                    'invoice2pay': int(len(unpaid_invoice_ids)),
+                })          
+            res['value'].update({
+                'credit': partner.credit,
+            })
+        return res
+    
+    def case_close(self, cr, uid, ids, *args):
+        """Overrides close for crm_case for setting close date
+        """
+        res = True
+        for phone in self.browse(cr, uid, ids):
+            phone_id = phone.id
+            data = {'date_closed': time.strftime('%Y-%m-%d %H:%M:%S'),
+                    'state':'done'}
+            self.write(cr, uid, ids, {'duration': 0.0, 'state':'open'})
+            if phone.duration <=0:
+                duration = datetime.now() - datetime.strptime(phone.date, '%Y-%m-%d %H:%M:%S')
+                data.update({'duration': duration.seconds/float(60)})
+            #res = super(crm_phonecall, self).case_close(cr, uid, [phone_id], args)
+            self.write(cr, uid, [phone_id], data)
+        return res
+    
+    def action_make_meeting(self, cr, uid, ids, context=None):
+        """
+        This opens Meeting's calendar view to schedule meeting on current Phonecall
+        @return : Dictionary value for created Meeting view
+        """
+        value = {}
+        for phonecall in self.browse(cr, uid, ids, context=context):
+            data_obj = self.pool.get('ir.model.data')
+
+            # Get meeting views
+            result = data_obj._get_id(cr, uid, 'crm', 'view_crm_case_meetings_filter')
+            res = data_obj.read(cr, uid, result, ['res_id'])
+            id1 = data_obj._get_id(cr, uid, 'crm', 'crm_case_calendar_view_meet')
+            id2 = data_obj._get_id(cr, uid, 'crm', 'crm_case_form_view_meet')
+            id3 = data_obj._get_id(cr, uid, 'crm', 'crm_case_tree_view_meet')
+            if id1:
+                id1 = data_obj.browse(cr, uid, id1, context=context).res_id
+            if id2:
+                id2 = data_obj.browse(cr, uid, id2, context=context).res_id
+            if id3:
+                id3 = data_obj.browse(cr, uid, id3, context=context).res_id
+
+            context = {
+                        'default_phonecall_id': phonecall.id,
+                        'default_partner_id': phonecall.partner_id and phonecall.partner_id.id or False,
+                        'default_email': phonecall.email_from ,
+                        'default_name': phonecall.name
+                    }
+
+            value = {
+                'name': _('Meetings'),
+                'domain' : "[('user_id','=',%s)]" % (uid),
+                'context': context,
+                'view_type': 'form',
+                'view_mode': 'calendar,form,tree',
+                'res_model': 'crm.meeting',
+                'view_id': False,
+                'views': [(id1, 'calendar'), (id2, 'form'), (id3, 'tree')],
+                'type': 'ir.actions.act_window',
+                'search_view_id': res['res_id'],
+                'nodestroy': True
+                }
+
+        return value
+    
+    
+crm_phonecall()
\ No newline at end of file

=== added file 'avanzosc_crm_call_ext/crm_phonecall_view.xml'
--- avanzosc_crm_call_ext/crm_phonecall_view.xml	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/crm_phonecall_view.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+	<data>
+
+		<!--
+		======================== 
+		CRM Form Inheritance
+		========================
+		-->
+
+		<record model="ir.ui.view" id="crm_case_inbound_phone_form_view_inh">
+			<field name="name">CRM - Inbound Phone Call Form Inherit</field>
+			<field name="model">crm.phonecall</field>
+			<field name="type">form</field>
+			<field name="inherit_id" ref="crm.crm_case_phone_form_view" />
+			<field name="arch" type="xml">
+				<xpath expr="/form/group"
+					position="replace" >
+					<group col="8" colspan="8">
+						<group col="6" colspan="6">
+		                    <field name="name" required="1"/>
+		                    <field name="partner_phone"/>
+		                    <field name="duration" widget="float_time"/>
+		                    <field name="date" required="1"/>
+		                    <field name="user_id"/>
+		                    <field name="section_id" colspan="1" widget="selection" />
+		                    <separator string="Description" colspan="6" />
+		                	<field name="description" nolabel="1" colspan="6" />
+		                </group>
+		                <group col="1" colspan="2">
+							<button string="Schedule a Meeting"
+	                        	name="action_make_meeting"
+	                        	icon="gtk-redo"
+	                        	type="object" />
+							<button string="Convert to Lead" name="%(phonecall_to_lead_act)d"
+								icon="gtk-index" type="action" attrs="{'invisible':[('lead_id','!=',False)]}"/>
+							<button string="Convert to Opportunity"
+		                        name="%(crm.phonecall2opportunity_act)d"
+		                        icon="gtk-index" type="action"
+		                        attrs="{'invisible':[('opportunity_id','!=',False)]}" />
+							<button string="Convert to Helpdesk" name="%(phonecall_to_technicalcase_act)d"
+								icon="terp-tools" type="action" attrs="{'invisible':[('helpdesk_id','!=',False)]}"/>	
+							<button string="Convert to Claim" name="%(phonecall_to_admincase_act)d"
+								icon="terp-administration" type="action" attrs="{'invisible':[('helpdesk_id','!=',False)]}"/>
+		                    <button string="Schedule Other Call"
+		                    	icon="terp-call-start"
+		                    	name="%(crm.phonecall_to_phonecall_act)d"
+		                    	type="action"  />
+						</group>
+					</group>
+	            </xpath>
+	            <xpath expr="/form/group[2]"
+					position="after">
+					<group col="2" colspan="2">
+						<separator colspan="2" string="Accounting Information" />
+						<field name="credit"/>
+						<field name="invoice2pay"/>
+						<field name="last_invoice"/>
+						<field name="last_payment"/>
+					</group>
+				</xpath>
+				<!--<xpath expr="/form/group/field[@name='priority']"
+					position="before">
+					<field name="canal_id"/>
+				</xpath>-->
+				<xpath expr="/form/group/field[@name='opportunity_id']"
+					position="before">
+					<field name="lead_id"/>
+				</xpath>
+				<xpath expr="/form/group/field[@name='opportunity_id']"
+					position="after">
+					<field name="helpdesk_id"/>
+					<field name="claim_id"/>
+				</xpath>
+				<xpath expr="/form/separator" position="replace" />
+				<xpath expr="/form/field" position="replace" />
+			</field>
+		</record>
+
+		<!--
+		========================
+		CRM Tree Inheritance
+		========================
+		-->
+
+		<record model="ir.ui.view" id="crm_case_inbound_phone_tree_view_inh">
+			<field name="name">CRM - Inbound Phone Calls Tree</field>
+			<field name="model">crm.phonecall</field>
+			<field name="type">tree</field>
+			<field name="inherit_id" ref="crm.crm_case_inbound_phone_tree_view" />
+			<field name="arch" type="xml">
+				<xpath expr="/tree/button[@string='Convert to Opportunity']"
+					position="after">
+					<button string="Register technical issue" name="%(phonecall_to_technicalcase_act)d"
+						icon="terp-tools" type="action" attrs="{'invisible':[('helpdesk_id','!=',False)]}"/>
+					<label colspan="6" string="" />
+					<button string="Register administrative issue" name="%(phonecall_to_admincase_act)d"
+						icon="terp-administration" type="action" attrs="{'invisible':[('helpdesk_id','!=',False)]}"/>
+				</xpath>
+			</field>
+		</record>
+
+	</data>
+</openerp>

=== added directory 'avanzosc_crm_call_ext/i18n'
=== added file 'avanzosc_crm_call_ext/i18n/avanzosc_crm_call_ext.pot'
--- avanzosc_crm_call_ext/i18n/avanzosc_crm_call_ext.pot	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/i18n/avanzosc_crm_call_ext.pot	2013-02-01 09:33:03 +0000
@@ -0,0 +1,367 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* avanzosc_crm_call_ext
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.2\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2011-09-15 10:25+0000\n"
+"PO-Revision-Date: 2011-09-15 10:25+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: avanzosc_crm_call_ext
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_admincase.py:60
+#, python-format
+msgid "Phone Call without Description Could not convert into Administration Case"
+msgstr "Phone Call without Description Could not convert into Administration Case"
+
+#. module: avanzosc_crm_call_ext
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_lead.py:57
+#, python-format
+msgid "Closed/Cancelled Phone Call Could not convert into Lead"
+msgstr "Closed/Cancelled Phone Call Could not convert into Lead"
+
+#. module: avanzosc_crm_call_ext
+#: field:crm.phonecall2admincase,name:0
+#: field:crm.phonecall2technicalcase,name:0
+msgid "Case Summary"
+msgstr "Case Summary"
+
+#. module: avanzosc_crm_call_ext
+#: model:ir.model,name:avanzosc_crm_call_ext.model_crm_helpdesk
+msgid "Helpdesk"
+msgstr "Helpdesk"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Responsible"
+msgstr "Responsible"
+
+#. module: avanzosc_crm_call_ext
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_technicalcase.py:63
+#, python-format
+msgid "Phone Call without Sale Team Could not convert into Technical Case"
+msgstr "Phone Call without Sale Team Could not convert into Technical Case"
+
+#. module: avanzosc_crm_call_ext
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_admincase.py:63
+#, python-format
+msgid "Phone Call without Sale Team Could not convert into Administration Case"
+msgstr "Phone Call without Sale Team Could not convert into Administration Case"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.claim:0
+#: view:crm.helpdesk:0
+#: view:crm.lead:0
+#: view:crm.phonecall:0
+msgid "Accounting Information"
+msgstr "Accounting Information"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall:0
+msgid "Convert to Claim"
+msgstr "Convert to Claim"
+
+#. module: avanzosc_crm_call_ext
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_admincase.py:122
+#, python-format
+msgid "Administration Case"
+msgstr "Administration Case"
+
+#. module: avanzosc_crm_call_ext
+#: field:res.partner,helpdesk_ids:0
+msgid "HelpDesks"
+msgstr "HelpDesks"
+
+#. module: avanzosc_crm_call_ext
+#: field:crm.claim,last_invoice:0
+#: field:crm.helpdesk,last_invoice:0
+#: field:crm.lead,last_invoice:0
+#: field:crm.phonecall,last_invoice:0
+msgid "Last Invoice"
+msgstr "Last Invoice"
+
+#. module: avanzosc_crm_call_ext
+#: model:ir.model,name:avanzosc_crm_call_ext.model_crm_phonecall2technicalcase
+msgid "Phonecall To Technical case"
+msgstr "Phonecall To Technical case"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall2admincase:0
+#: view:crm.phonecall2lead:0
+#: view:crm.phonecall2technicalcase:0
+msgid " "
+msgstr " "
+
+#. module: avanzosc_crm_call_ext
+#: model:ir.model,name:avanzosc_crm_call_ext.model_crm_phonecall2lead
+msgid "Phonecall To Lead"
+msgstr "Phonecall To Lead"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall2technicalcase:0
+msgid "Convert To Technical Case "
+msgstr "Convert To Technical Case "
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall:0
+msgid "Description"
+msgstr "Description"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall:0
+msgid "Convert to Lead"
+msgstr "Convert to Lead"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall:0
+msgid "Schedule Other Call"
+msgstr "Schedule Other Call"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall2admincase:0
+#: view:crm.phonecall2lead:0
+#: view:crm.phonecall2technicalcase:0
+msgid "_Convert"
+msgstr "_Convert"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Date"
+msgstr "Date"
+
+#. module: avanzosc_crm_call_ext
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_technicalcase.py:57
+#, python-format
+msgid "Closed/Cancelled Phone Call Could not convert into Technical Case"
+msgstr "Closed/Cancelled Phone Call Could not convert into Technical Case"
+
+#. module: avanzosc_crm_call_ext
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_lead.py:115
+#: field:crm.phonecall,lead_id:0
+#, python-format
+msgid "Lead"
+msgstr "Lead"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall:0
+msgid "Register administrative issue"
+msgstr "Register administrative issue"
+
+#. module: avanzosc_crm_call_ext
+#: field:crm.phonecall,helpdesk_id:0
+msgid "Help Desk"
+msgstr "Help Desk"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "End Date"
+msgstr "End Date"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall:0
+msgid "Schedule a Meeting"
+msgstr "Schedule a Meeting"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Meetings"
+msgstr "Meetings"
+
+#. module: avanzosc_crm_call_ext
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_technicalcase.py:122
+#, python-format
+msgid "Technical Case"
+msgstr "Technical Case"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall2lead:0
+#: model:ir.actions.act_window,name:avanzosc_crm_call_ext.phonecall_to_lead_act
+msgid "Convert To Lead"
+msgstr "Convert To Lead"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall:0
+msgid "Convert to Helpdesk"
+msgstr "Convert to Helpdesk"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall:0
+msgid "Convert to Opportunity"
+msgstr "Convert to Opportunity"
+
+#. module: avanzosc_crm_call_ext
+#: model:ir.model,name:avanzosc_crm_call_ext.model_crm_phonecall2admincase
+msgid "Phonecall To Administration case"
+msgstr "Phonecall To Administration case"
+
+#. module: avanzosc_crm_call_ext
+#: model:ir.model,name:avanzosc_crm_call_ext.model_crm_lead
+msgid "crm.lead"
+msgstr "crm.lead"
+
+#. module: avanzosc_crm_call_ext
+#: field:crm.claim,last_payment:0
+#: field:crm.helpdesk,last_payment:0
+#: field:crm.lead,last_payment:0
+#: field:crm.phonecall,last_payment:0
+msgid "Last Payment"
+msgstr "Last Payment"
+
+#. module: avanzosc_crm_call_ext
+#: field:res.partner,claim_ids:0
+msgid "Claims"
+msgstr "Claims"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall:0
+msgid "Register technical issue"
+msgstr "Register technical issue"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Not Held"
+msgstr "Not Held"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Phone Calls"
+msgstr "Phone Calls"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "History"
+msgstr "History"
+
+#. module: avanzosc_crm_call_ext
+#: field:crm.phonecall,claim_id:0
+#: model:ir.model,name:avanzosc_crm_call_ext.model_crm_claim
+msgid "Claim"
+msgstr "Claim"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Type"
+msgstr "Type"
+
+#. module: avanzosc_crm_call_ext
+#: field:crm.phonecall2lead,name:0
+msgid "Lead Summary"
+msgstr "Lead Summary"
+
+#. module: avanzosc_crm_call_ext
+#: field:crm.claim,invoice2pay:0
+#: field:crm.helpdesk,invoice2pay:0
+#: field:crm.lead,invoice2pay:0
+#: field:crm.phonecall,invoice2pay:0
+msgid "Invoices to pay"
+msgstr "Invoices to pay"
+
+#. module: avanzosc_crm_call_ext
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_admincase.py:57
+#, python-format
+msgid "Closed/Cancelled Phone Call Could not convert into Administration Case"
+msgstr "Closed/Cancelled Phone Call Could not convert into Administration Case"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "CRM Cases"
+msgstr "CRM Cases"
+
+#. module: avanzosc_crm_call_ext
+#: model:ir.model,name:avanzosc_crm_call_ext.model_crm_phonecall
+msgid "crm.phonecall"
+msgstr "crm.phonecall"
+
+#. module: avanzosc_crm_call_ext
+#: field:crm.claim,credit:0
+#: field:crm.helpdesk,credit:0
+#: field:crm.lead,credit:0
+#: field:crm.phonecall,credit:0
+msgid "Total Receivable"
+msgstr "Total Receivable"
+
+#. module: avanzosc_crm_call_ext
+#: model:ir.actions.act_window,name:avanzosc_crm_call_ext.phonecall_to_admincase_act
+msgid "Convert To Administration Case"
+msgstr "Convert To Administration Case"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Held"
+msgstr "Held"
+
+#. module: avanzosc_crm_call_ext
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_technicalcase.py:60
+#, python-format
+msgid "Phone Call without Description Could not convert into Technical Case"
+msgstr "Phone Call without Description Could not convert into Technical Case"
+
+#. module: avanzosc_crm_call_ext
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_admincase.py:57
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_admincase.py:60
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_admincase.py:63
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_lead.py:57
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_technicalcase.py:57
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_technicalcase.py:60
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_technicalcase.py:63
+#, python-format
+msgid "Warning"
+msgstr "Warning"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Call Summary"
+msgstr "Call Summary"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall2admincase:0
+msgid "Convert To Administration Case "
+msgstr "Convert To Administration Case "
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall2admincase:0
+#: view:crm.phonecall2lead:0
+#: view:crm.phonecall2technicalcase:0
+msgid "_Cancel"
+msgstr "_Cancel"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Cancel"
+msgstr "Cancel"
+
+#. module: avanzosc_crm_call_ext
+#: field:crm.phonecall2admincase,partner_id:0
+#: field:crm.phonecall2lead,partner_id:0
+#: field:crm.phonecall2technicalcase,partner_id:0
+#: model:ir.model,name:avanzosc_crm_call_ext.model_res_partner
+msgid "Partner"
+msgstr "Partner"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Start Date"
+msgstr "Start Date"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Open"
+msgstr "Open"
+
+#. module: avanzosc_crm_call_ext
+#: model:ir.actions.act_window,name:avanzosc_crm_call_ext.phonecall_to_technicalcase_act
+msgid "Convert To Technical Case"
+msgstr "Convert To Technical Case"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Subject"
+msgstr "Subject"
+

=== added file 'avanzosc_crm_call_ext/i18n/es.po'
--- avanzosc_crm_call_ext/i18n/es.po	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/i18n/es.po	2013-02-01 09:33:03 +0000
@@ -0,0 +1,371 @@
+# Spanish translation for avanzosc
+# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
+# This file is distributed under the same license as the avanzosc package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: avanzosc\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2011-09-15 10:25+0000\n"
+"PO-Revision-Date: 2011-11-15 09:41+0000\n"
+"Last-Translator: Urtzi Odriozola <Unknown>\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: 2012-06-06 05:12+0000\n"
+"X-Generator: Launchpad (build 15353)\n"
+
+#. module: avanzosc_crm_call_ext
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_admincase.py:60
+#, python-format
+msgid ""
+"Phone Call without Description Could not convert into Administration Case"
+msgstr ""
+
+#. module: avanzosc_crm_call_ext
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_lead.py:57
+#, python-format
+msgid "Closed/Cancelled Phone Call Could not convert into Lead"
+msgstr ""
+
+#. module: avanzosc_crm_call_ext
+#: field:crm.phonecall2admincase,name:0
+#: field:crm.phonecall2technicalcase,name:0
+msgid "Case Summary"
+msgstr "Resumen de Casos"
+
+#. module: avanzosc_crm_call_ext
+#: model:ir.model,name:avanzosc_crm_call_ext.model_crm_helpdesk
+msgid "Helpdesk"
+msgstr "Asistencia/Ayuda"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Responsible"
+msgstr "Responsable"
+
+#. module: avanzosc_crm_call_ext
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_technicalcase.py:63
+#, python-format
+msgid "Phone Call without Sale Team Could not convert into Technical Case"
+msgstr ""
+
+#. module: avanzosc_crm_call_ext
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_admincase.py:63
+#, python-format
+msgid ""
+"Phone Call without Sale Team Could not convert into Administration Case"
+msgstr ""
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.claim:0
+#: view:crm.helpdesk:0
+#: view:crm.lead:0
+#: view:crm.phonecall:0
+msgid "Accounting Information"
+msgstr "Información contable"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall:0
+msgid "Convert to Claim"
+msgstr "Convertir a Reclamación"
+
+#. module: avanzosc_crm_call_ext
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_admincase.py:122
+#, python-format
+msgid "Administration Case"
+msgstr "Caso Administrativo"
+
+#. module: avanzosc_crm_call_ext
+#: field:res.partner,helpdesk_ids:0
+msgid "HelpDesks"
+msgstr ""
+
+#. module: avanzosc_crm_call_ext
+#: field:crm.claim,last_invoice:0
+#: field:crm.helpdesk,last_invoice:0
+#: field:crm.lead,last_invoice:0
+#: field:crm.phonecall,last_invoice:0
+msgid "Last Invoice"
+msgstr "Última Factura"
+
+#. module: avanzosc_crm_call_ext
+#: model:ir.model,name:avanzosc_crm_call_ext.model_crm_phonecall2technicalcase
+msgid "Phonecall To Technical case"
+msgstr "Llamada a Caso Técnico"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall2admincase:0
+#: view:crm.phonecall2lead:0
+#: view:crm.phonecall2technicalcase:0
+msgid " "
+msgstr " "
+
+#. module: avanzosc_crm_call_ext
+#: model:ir.model,name:avanzosc_crm_call_ext.model_crm_phonecall2lead
+msgid "Phonecall To Lead"
+msgstr "Llamada a Iniciativa"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall2technicalcase:0
+msgid "Convert To Technical Case "
+msgstr "Convertir a Caso Técnico "
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall:0
+msgid "Description"
+msgstr "Descripción"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall:0
+msgid "Convert to Lead"
+msgstr "Convertir a Iniciativa"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall:0
+msgid "Schedule Other Call"
+msgstr "Planificar otra llamada"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall2admincase:0
+#: view:crm.phonecall2lead:0
+#: view:crm.phonecall2technicalcase:0
+msgid "_Convert"
+msgstr "_Convertir"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Date"
+msgstr "Fecha"
+
+#. module: avanzosc_crm_call_ext
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_technicalcase.py:57
+#, python-format
+msgid "Closed/Cancelled Phone Call Could not convert into Technical Case"
+msgstr ""
+
+#. module: avanzosc_crm_call_ext
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_lead.py:115
+#: field:crm.phonecall,lead_id:0
+#, python-format
+msgid "Lead"
+msgstr "Iniciativa"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall:0
+msgid "Register administrative issue"
+msgstr "Registrar incidencia administrativa"
+
+#. module: avanzosc_crm_call_ext
+#: field:crm.phonecall,helpdesk_id:0
+msgid "Help Desk"
+msgstr "Centro de Ayuda"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "End Date"
+msgstr "Fecha Final"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall:0
+msgid "Schedule a Meeting"
+msgstr "Planificar una reunión"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Meetings"
+msgstr "Reuniones"
+
+#. module: avanzosc_crm_call_ext
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_technicalcase.py:122
+#, python-format
+msgid "Technical Case"
+msgstr "Caso Técnico"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall2lead:0
+#: model:ir.actions.act_window,name:avanzosc_crm_call_ext.phonecall_to_lead_act
+msgid "Convert To Lead"
+msgstr "Convertir a Iniciativa"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall:0
+msgid "Convert to Helpdesk"
+msgstr "Convertir a Soporte Técnico"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall:0
+msgid "Convert to Opportunity"
+msgstr "Convertir a oportunidad"
+
+#. module: avanzosc_crm_call_ext
+#: model:ir.model,name:avanzosc_crm_call_ext.model_crm_phonecall2admincase
+msgid "Phonecall To Administration case"
+msgstr "Llamada a Caso Administrativo"
+
+#. module: avanzosc_crm_call_ext
+#: model:ir.model,name:avanzosc_crm_call_ext.model_crm_lead
+msgid "crm.lead"
+msgstr "crm.iniciativa"
+
+#. module: avanzosc_crm_call_ext
+#: field:crm.claim,last_payment:0
+#: field:crm.helpdesk,last_payment:0
+#: field:crm.lead,last_payment:0
+#: field:crm.phonecall,last_payment:0
+msgid "Last Payment"
+msgstr "Último pago"
+
+#. module: avanzosc_crm_call_ext
+#: field:res.partner,claim_ids:0
+msgid "Claims"
+msgstr "Reclamaciones"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall:0
+msgid "Register technical issue"
+msgstr "Registrar incidencia técnica"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Not Held"
+msgstr "Pendiente"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Phone Calls"
+msgstr "Llamadas Telefónicas"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "History"
+msgstr "Historial"
+
+#. module: avanzosc_crm_call_ext
+#: field:crm.phonecall,claim_id:0
+#: model:ir.model,name:avanzosc_crm_call_ext.model_crm_claim
+msgid "Claim"
+msgstr "Reclamación"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Type"
+msgstr "Tipo"
+
+#. module: avanzosc_crm_call_ext
+#: field:crm.phonecall2lead,name:0
+msgid "Lead Summary"
+msgstr "Resumén de Iniciativa"
+
+#. module: avanzosc_crm_call_ext
+#: field:crm.claim,invoice2pay:0
+#: field:crm.helpdesk,invoice2pay:0
+#: field:crm.lead,invoice2pay:0
+#: field:crm.phonecall,invoice2pay:0
+msgid "Invoices to pay"
+msgstr "Facturas para pagar"
+
+#. module: avanzosc_crm_call_ext
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_admincase.py:57
+#, python-format
+msgid ""
+"Closed/Cancelled Phone Call Could not convert into Administration Case"
+msgstr ""
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "CRM Cases"
+msgstr "Casos CRM"
+
+#. module: avanzosc_crm_call_ext
+#: model:ir.model,name:avanzosc_crm_call_ext.model_crm_phonecall
+msgid "crm.phonecall"
+msgstr "crm.llamadateléfono"
+
+#. module: avanzosc_crm_call_ext
+#: field:crm.claim,credit:0
+#: field:crm.helpdesk,credit:0
+#: field:crm.lead,credit:0
+#: field:crm.phonecall,credit:0
+msgid "Total Receivable"
+msgstr "Total a cobrar"
+
+#. module: avanzosc_crm_call_ext
+#: model:ir.actions.act_window,name:avanzosc_crm_call_ext.phonecall_to_admincase_act
+msgid "Convert To Administration Case"
+msgstr "Convertir a Caso Administrativo"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Held"
+msgstr "Realizada"
+
+#. module: avanzosc_crm_call_ext
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_technicalcase.py:60
+#, python-format
+msgid "Phone Call without Description Could not convert into Technical Case"
+msgstr ""
+
+#. module: avanzosc_crm_call_ext
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_admincase.py:57
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_admincase.py:60
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_admincase.py:63
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_lead.py:57
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_technicalcase.py:57
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_technicalcase.py:60
+#: code:addons/avanzosc_crm_call_ext/wizard/crm_phonecall_to_technicalcase.py:63
+#, python-format
+msgid "Warning"
+msgstr "Aviso"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Call Summary"
+msgstr "Resumen de llamadas"
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall2admincase:0
+msgid "Convert To Administration Case "
+msgstr "Convertir a Caso Administrativo "
+
+#. module: avanzosc_crm_call_ext
+#: view:crm.phonecall2admincase:0
+#: view:crm.phonecall2lead:0
+#: view:crm.phonecall2technicalcase:0
+msgid "_Cancel"
+msgstr "_Cancelar"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Cancel"
+msgstr "Cancelar"
+
+#. module: avanzosc_crm_call_ext
+#: field:crm.phonecall2admincase,partner_id:0
+#: field:crm.phonecall2lead,partner_id:0
+#: field:crm.phonecall2technicalcase,partner_id:0
+#: model:ir.model,name:avanzosc_crm_call_ext.model_res_partner
+msgid "Partner"
+msgstr "Empresa"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Start Date"
+msgstr "Fecha de inicio"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Open"
+msgstr "Abierto"
+
+#. module: avanzosc_crm_call_ext
+#: model:ir.actions.act_window,name:avanzosc_crm_call_ext.phonecall_to_technicalcase_act
+msgid "Convert To Technical Case"
+msgstr "Convertir a Caso Técnico"
+
+#. module: avanzosc_crm_call_ext
+#: view:res.partner:0
+msgid "Subject"
+msgstr "Asunto"

=== added directory 'avanzosc_crm_call_ext/wizard'
=== added file 'avanzosc_crm_call_ext/wizard/__init__.py'
--- avanzosc_crm_call_ext/wizard/__init__.py	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/wizard/__init__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,27 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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 crm_phonecall_to_technicalcase
+import crm_phonecall_to_admincase
+import crm_phonecall_to_lead
+import crm_meeting_state_change
+import crm_claim_to_meeting
+import crm_meeting_reponsible_change
\ No newline at end of file

=== added file 'avanzosc_crm_call_ext/wizard/crm_claim_to_meeting.py'
--- avanzosc_crm_call_ext/wizard/crm_claim_to_meeting.py	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/wizard/crm_claim_to_meeting.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,188 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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
+from tools.translate import _
+import time, datetime
+
+class crm_claim2meeting(osv.osv_memory):
+    """ Converts Claim to Meeting"""
+
+    _name = 'crm.claim2meeting'
+    _description = 'Claim to meeting'
+    
+    
+    def action_cancel(self, cr, uid, ids, context=None):
+        """
+        Closes Claim to Meeting form
+        @param self: The object pointer
+        @param cr: the current row, from the database cursor,
+        @param uid: the current user’s ID for security checks,
+        @param ids: List of Claim to Meeting IDs
+        @param context: A standard dictionary for contextual values
+        """
+
+        return {'type':'ir.actions.act_window_close'}
+
+    def view_init(self, cr, uid, fields, context=None):
+        """
+        This function checks for precondition before wizard executes
+        @param self: The object pointer
+        @param cr: the current row, from the database cursor,
+        @param uid: the current user’s ID for security checks,
+        @param fields: List of fields for default value
+        @param context: A standard dictionary for contextual values
+
+        """
+        claim_obj = self.pool.get('crm.claim')
+        record_id = context and context.get('active_id', False) or False
+        claim = claim_obj.browse(cr, uid, record_id, context=context)
+        meeting_obj = self.pool.get('crm.meeting').search(cr, uid, [])
+        for meeting in meeting_obj:
+            o_meeting = self.pool.get('crm.meeting').browse(cr,uid,meeting)
+            if (o_meeting.crm_claim_id.id == claim.id):
+                raise osv.except_osv(_("Warning"), _("Already created a meeting for this claim.\n Meeting ref: %s")%(o_meeting.name))
+
+
+    def action_apply(self, cr, uid, ids, context=None):
+        """
+        This converts Claim to Meeting and opens Meeting view
+        @param self: The object pointer
+        @param cr: the current row, from the database cursor,
+        @param uid: the current user’s ID for security checks,
+        @param ids: List of Claim to Meeting IDs
+        @param context: A standard dictionary for contextual values
+        """
+        record_id = context and context.get('active_id', False) or False
+        if record_id:
+            meet_obj = self.pool.get('crm.meeting')
+            claim_obj = self.pool.get('crm.claim')
+            case = claim_obj.browse(cr, uid, record_id, context=context)
+            data_obj = self.pool.get('ir.model.data')
+#            result = data_obj._get_id(cr, uid, 'crm', 'view_crm_case_opportunities_filter')
+#            res = data_obj.read(cr, uid, result, ['res_id'])
+            id2 = data_obj._get_id(cr, uid, 'crm', 'crm_case_form_view_meet')
+            id3 = data_obj._get_id(cr, uid, 'crm', 'crm_case_tree_view_meet')
+            id4 = data_obj._get_id(cr, uid, 'crm', 'crm_case_calendar_view_meet')
+            id5 = data_obj._get_id(cr, uid, 'crm', 'crm_case_gantt_view_meet')
+            if id2:
+                id2 = data_obj.browse(cr, uid, id2, context=context).res_id
+            if id3:
+                id3 = data_obj.browse(cr, uid, id3, context=context).res_id
+            if id4:
+                id4 = data_obj.browse(cr, uid, id4, context=context).res_id
+            if id5:
+                id5 = data_obj.browse(cr, uid, id5, context=context).res_id
+            
+            
+            for this in self.browse(cr, uid, ids, context=context):
+                address = None
+                user = this.user_id.id                
+                organizer=""
+                if user:
+                    user_obj=self.pool.get('res.users').browse(cr, uid, user)
+                    organizer = user_obj.name
+                    if user_obj.user_email:
+                        organizer = organizer + '<' + user_obj.user_email + '>' 
+                if case.partner_id:
+                    address_id = self.pool.get('res.partner').address_get(cr, uid, [case.partner_id.id])
+                    if address_id['default']:
+                        address = self.pool.get('res.partner.address').browse(cr, uid, address_id['default'], context=context)
+                new_meet_id = meet_obj.create(cr, uid, {
+                                'state':'draft',
+                                'name': _('Claim: ') + case.name,
+                                'partner_id': case.partner_id and case.partner_id.id or False,
+                                'partner_address_id': address and address.id or False, 
+                                'section_id': this.section_id.id or False,
+                                'user_id': this.user_id.id or False,
+                                'description': case.description or False,
+                                'crm_claim_id': case.id,
+                                'partner_phone':case.partner_id.phone or False,
+                                'email_from':case.partner_id.email or False,
+                                'categ_id': this.meeting_type.id,
+                                'date':this.date,
+                                'date_deadline':this.deadline,
+                                'organizer':organizer,
+                            })
+                vals = {
+                            'categ_id' : this.claim_category.id,
+                            }
+                claim_obj.write(cr, uid, [case.id], vals)
+
+        value = {
+            'name': _('Meeting'),
+            'view_type': 'form',
+            'view_mode': 'form,tree,calendar',
+            'res_model': 'crm.meeting',
+            'res_id': int(new_meet_id),
+            'view_id': False,
+            'views': [(id2, 'form'), (id3, 'tree'), (id4, 'calendar'), (id5, 'graph')],
+            'type': 'ir.actions.act_window',
+#            'search_view_id': res['res_id']
+        }
+        return value
+
+    _columns = {
+        'date' : fields.datetime('Start date',required=True),
+        'deadline': fields.datetime('End date', required=True),
+        'claim_category': fields.many2one('crm.case.categ', 'Claim category', required=True),
+        'meeting_type': fields.many2one('crm.case.categ', 'Meeting Type', required=True),
+        'user_id':fields.many2one('res.users', 'Manager'),
+        'section_id':fields.many2one('crm.case.section', 'Sales Team'), 
+        
+        
+    }
+
+    def default_get(self, cr, uid, fields, context=None):
+        """
+        This function gets default values
+        @param self: The object pointer
+        @param cr: the current row, from the database cursor,
+        @param uid: the current user’s ID for security checks,
+        @param fields: List of fields for default value
+        @param context: A standard dictionary for contextual values
+
+        @return : default values of fields.
+        """
+        record_id = context and context.get('active_id', False) or False
+        res = super(crm_claim2meeting, self).default_get(cr, uid, fields, context=context)
+        if record_id:
+            claim = self.pool.get('crm.claim').browse(cr, uid, record_id, context=context)
+            if 'date' in fields:
+                res.update({'date': time.strftime('%Y-%m-%d %H:%M:%S')})
+            if 'deadline' in fields:
+                if claim.date_deadline:
+                    deadline = time.strftime('%Y-%m-%d %H:%M:%S', time.strptime(claim.date_deadline, '%Y-%m-%d'))
+                else:
+                    deadline = time.strftime('%Y-%m-%d %H:%M:%S')
+                res.update({'deadline':deadline })
+            if 'claim_category' in fields:
+                res.update({'claim_category': claim.categ_id.id or False})
+            if 'user_id' in fields:
+                user = self.pool.get('res.users').search(cr,uid,[])
+                res.update({'user_id': user[0] or False})
+            if 'section_id' in fields:
+                section = self.pool.get('crm.case.section').search(cr,uid,[('name', 'like', 'Dpto Instalaciones')])
+                if section:
+                    res.update({'section_id': section[0] or False})
+        return res
+
+crm_claim2meeting()
\ No newline at end of file

=== added file 'avanzosc_crm_call_ext/wizard/crm_claim_to_meeting.xml'
--- avanzosc_crm_call_ext/wizard/crm_claim_to_meeting.xml	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/wizard/crm_claim_to_meeting.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+    <data>
+
+<!-- Claim to meeting view -->
+    
+        <record model="ir.ui.view" id="claim_to_meeting_view">
+            <field name="name">crm.claim2meeting.form</field>
+            <field name="model">crm.claim2meeting</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <form string="Convert To Meeting">
+					<group colspan="4" col="8">
+						<group colspan="4">
+						<separator colspan="4" string="Start date"/>
+						<field name="date" nolabel="1"/>
+						</group>
+						<group colspan="4">
+						<separator colspan="4" string="End date"/>
+						<field name="deadline" nolabel="1"/>
+						</group>
+					</group>
+					<group colspan="4" col="8">
+						<group colspan="4">
+						<separator colspan="4" string="Manager"/>
+						<field name="user_id" widget="selection" nolabel="1"/>
+						</group>
+						<group colspan="4">
+						<separator colspan="4" string="Sales team"/>
+						<field name="section_id" widget="selection" nolabel="1"/>
+						</group>
+					</group>
+					<group colspan="4" col="8">
+						<group colspan="4">
+						<separator colspan="4" string="Claim Category:"/>
+						<field name="claim_category" widget="selection" domain="[('object_id.model', '=', 'crm.claim')]" nolabel="1"/>
+						</group>
+						<group colspan="4">
+						<separator colspan="4" string="Meeting Type:"/>
+						<field name="meeting_type" widget="selection" domain="[('object_id.model', '=', 'crm.meeting')]" nolabel="1"/>
+						</group>
+					</group>
+					<separator string=" " colspan="4"/>
+                    <group colspan="4" col="3" >
+                    	<label string=" " />
+                        <button name="action_cancel" string="_Cancel" icon="gtk-cancel" special="cancel" />
+                        <button name="action_apply" type="object" string="_Convert" icon="gtk-convert" />
+                    </group>
+                </form>
+            </field>
+        </record>
+
+<!-- Claim to Meeting action -->
+
+        <record model="ir.actions.act_window" id="claim_to_meeting_act">
+            <field name="name">Convert To Meeting</field>
+            <field name="res_model">crm.claim2meeting</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">form</field>
+            <field name="view_id" ref="claim_to_meeting_view"/>
+            <field name="target">new</field>
+        </record>
+
+    </data>
+</openerp>  
\ No newline at end of file

=== added file 'avanzosc_crm_call_ext/wizard/crm_meeting_reponsible_change.py'
--- avanzosc_crm_call_ext/wizard/crm_meeting_reponsible_change.py	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/wizard/crm_meeting_reponsible_change.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,44 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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
+from tools.translate import _
+
+class crm_meeting_responsible_change(osv.osv_memory):
+    
+    _name = 'crm.meeting.responsible.change'
+    _description = 'Provides to change responsible for many meetings.'
+    
+    
+    _columns = {
+                'next_responsible':fields.many2one('res.users', 'Next responsible', size=16, required=True),
+                }
+
+    
+    def change_responsible(self, cr, uid, ids, context=None):
+        
+        meeting_ids =  context.get('active_ids',[])
+        responsible = self.browse(cr,uid,ids[0]).next_responsible
+        if meeting_ids:
+            for meeting in meeting_ids:
+                self.pool.get('crm.meeting').write(cr,uid,[meeting], {'user_id':responsible.id})
+        return {'type': 'ir.actions.act_window.close()'}
+    
+crm_meeting_responsible_change()    

=== added file 'avanzosc_crm_call_ext/wizard/crm_meeting_responsible_change.xml'
--- avanzosc_crm_call_ext/wizard/crm_meeting_responsible_change.xml	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/wizard/crm_meeting_responsible_change.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<openerp>
+    <data>
+		
+		 <record id="view_crm_meeting_responsible_change" model="ir.ui.view">
+            <field name="name">view.crm.meeting.responsible.change</field>
+            <field name="model">crm.meeting.responsible.change</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+               <form string="Change meeting responsible">
+                    <separator string="Select next responsible" colspan="4"/>
+                    <field name="next_responsible" nolabel="1" colspan="4"/>                  
+                    <separator string="" colspan="4" />
+                    <button special="cancel" string="Cancel" icon="gtk-cancel"/>
+                    <button name="change_responsible" string="Change" type="object" icon="gtk-convert"/>
+                </form>
+            </field>
+        </record>
+   
+         <act_window name="Change meeting responsible"            
+            res_model="crm.meeting.responsible.change"
+            src_model="crm.meeting"
+            view_mode="form"
+            target="new"
+            multi="True"        
+            key2="client_action_multi"    
+            groups="base.group_extended"
+            id="action_crm_meeting_responsible_change"/>    
+                        
+         
+    </data>
+</openerp>

=== added file 'avanzosc_crm_call_ext/wizard/crm_meeting_state_change.py'
--- avanzosc_crm_call_ext/wizard/crm_meeting_state_change.py	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/wizard/crm_meeting_state_change.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,77 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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
+from tools.translate import _
+
+class crm_meeting_state_change(osv.osv_memory):
+    
+    _name = 'crm.meeting.state.change'
+    _description = 'Provides to change state for many meetings.'
+    
+    def view_init(self, cr, uid, fields, context=None):
+        
+        if context is None:
+            context={}
+
+        meeting_ids =  context.get('active_ids',[])
+        if meeting_ids:
+            meetings = self.pool.get('crm.meeting').browse(cr,uid,meeting_ids)
+            state = meetings[0].state
+            for meeting in meetings:
+                if (meeting.state != state ):
+                    raise osv.except_osv(_('Error!'), _('All meetings should have the same state.'))
+        return False
+    
+    def _get_selection(self, cr, uid,context=None):
+        if context is None:
+            context={}
+        res=[]
+        meeting_ids =  context.get('active_ids',[])
+        if meeting_ids:
+            meetings = self.pool.get('crm.meeting').browse(cr,uid,meeting_ids)
+            state = meetings[0].state
+            if state=='draft':
+                res=[('open', 'Confirmed')]
+            elif state=='open':
+                res=[('done', 'Done'),('released', 'Released'), ('draft', 'Unconfirmed')]
+            elif state=='cancel':    
+                res=[('draft', 'Unconfirmed')]
+            elif state=='done':
+                res=[('draft', 'Unconfirmed')]
+            elif state=='released':
+                res=[('done', 'Done'),('draft','Unconfirmed')]
+        return res
+    
+    _columns = {
+                'next_state':fields.selection(_get_selection, 'Next state', size=16, required=True),
+                }
+
+    
+    def change_state(self, cr, uid, ids, context=None):
+        
+        meeting_ids =  context.get('active_ids',[])
+        state = self.browse(cr,uid,ids[0]).next_state
+        if meeting_ids:
+            for meeting in meeting_ids:
+                self.pool.get('crm.meeting').write(cr,uid,[meeting], {'state':state})
+        return {'type': 'ir.actions.act_window.close()'}
+    
+crm_meeting_state_change()    

=== added file 'avanzosc_crm_call_ext/wizard/crm_meeting_state_change.xml'
--- avanzosc_crm_call_ext/wizard/crm_meeting_state_change.xml	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/wizard/crm_meeting_state_change.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<openerp>
+    <data>
+		
+		 <record id="view_crm_meeting_state_change" model="ir.ui.view">
+            <field name="name">view.crm.meeting.state.change</field>
+            <field name="model">crm.meeting.state.change</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+               <form string="Change meeting state">
+                    <separator string="Select next state" colspan="4"/>
+                    <field name="next_state"/>
+                    <newline/>                    
+                    <separator string="" colspan="4" />
+                    <button special="cancel" string="Cancel" icon="gtk-cancel"/>
+                    <button name="change_state" string="Change meeting state" type="object" icon="gtk-convert"/>
+                </form>
+            </field>
+        </record>
+   
+         <act_window name="Change meeting state"            
+            res_model="crm.meeting.state.change"
+            src_model="crm.meeting"
+            view_mode="form"
+            target="new"
+            multi="True"        
+            key2="client_action_multi"    
+            groups="base.group_extended"
+            id="action_crm_meeting_state_change"/>    
+                        
+         
+    </data>
+</openerp>

=== added file 'avanzosc_crm_call_ext/wizard/crm_phonecall_to_admincase.py'
--- avanzosc_crm_call_ext/wizard/crm_phonecall_to_admincase.py	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/wizard/crm_phonecall_to_admincase.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,161 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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
+from tools.translate import _
+
+class crm_phonecall2admincase(osv.osv_memory):
+    """ Converts Phonecall to Administration case"""
+
+    _name = 'crm.phonecall2admincase'
+    _description = 'Phonecall To Administration case'
+
+    def action_cancel(self, cr, uid, ids, context=None):
+        """
+        Closes Phonecall to Opportunity form
+        @param self: The object pointer
+        @param cr: the current row, from the database cursor,
+        @param uid: the current user’s ID for security checks,
+        @param ids: List of Phonecall to Administration case IDs
+        @param context: A standard dictionary for contextual values
+        """
+
+        return {'type':'ir.actions.act_window_close'}
+
+    def view_init(self, cr, uid, fields, context=None):
+        """
+        This function checks for precondition before wizard executes
+        @param self: The object pointer
+        @param cr: the current row, from the database cursor,
+        @param uid: the current user’s ID for security checks,
+        @param fields: List of fields for default value
+        @param context: A standard dictionary for contextual values
+
+        """
+        phonecall_obj = self.pool.get('crm.phonecall')
+        record_id = context and context.get('active_id', False) or False
+        case = phonecall_obj.browse(cr, uid, record_id, context=context)
+        if case.state in ['done', 'cancel']:
+                raise osv.except_osv(_("Warning"), _("Closed/Cancelled Phone \
+Call Could not convert into Administration Case"))
+        if not case.description:
+                raise osv.except_osv(_("Warning"), _("Phone \
+Call without Description Could not convert into Administration Case"))
+        if not case.section_id:
+                raise osv.except_osv(_("Warning"), _("Phone \
+Call without Sale Team Could not convert into Administration Case"))
+
+
+    def action_apply(self, cr, uid, ids, context=None):
+        """
+        This converts Phonecall to Administration case and opens Phonecall view
+        @param self: The object pointer
+        @param cr: the current row, from the database cursor,
+        @param uid: the current user’s ID for security checks,
+        @param ids: List of Phonecall to Administration case IDs
+        @param context: A standard dictionary for contextual values
+
+        @return : Dictionary value for created Opportunity form
+        """
+        record_id = context and context.get('active_id', False) or False
+        if record_id:
+            claim_obj = self.pool.get('crm.claim')
+            phonecall_obj = self.pool.get('crm.phonecall')
+            case = phonecall_obj.browse(cr, uid, record_id, context=context)
+            data_obj = self.pool.get('ir.model.data')
+#            result = data_obj._get_id(cr, uid, 'crm', 'view_crm_case_opportunities_filter')
+#            res = data_obj.read(cr, uid, result, ['res_id'])
+#            id2 = data_obj._get_id(cr, uid, 'crm', 'crm_case_form_view_oppor')
+#            id3 = data_obj._get_id(cr, uid, 'crm', 'crm_case_tree_view_oppor')
+#            if id2:
+#                id2 = data_obj.browse(cr, uid, id2, context=context).res_id
+#            if id3:
+#                id3 = data_obj.browse(cr, uid, id3, context=context).res_id
+
+            for this in self.browse(cr, uid, ids, context=context):
+                address = None
+                if this.partner_id:
+                    address_id = self.pool.get('res.partner').address_get(cr, uid, [this.partner_id.id])
+                    if address_id['default']:
+                        address = self.pool.get('res.partner.address').browse(cr, uid, address_id['default'], context=context)
+                new_admin_id = claim_obj.create(cr, uid, {
+                                'name': this.name,
+                                'partner_id': this.partner_id and this.partner_id.id or False,
+                                'partner_address_id': address and address.id, 
+                                'phone': address and address.phone,
+                                'mobile': address and address.mobile,
+                                'section_id': case.section_id and case.section_id.id,
+                                'description': case.description or False,
+                                'phonecall_id': case.id,
+                                'canal_id': case.canal_id.id,
+                                'priority': case.priority,
+                                'user_id': case.section_id.user_id.id,
+                                'phone': case.partner_phone or False,
+                            })
+                vals = {
+                            'partner_id': this.partner_id.id,
+                            'claim_id' : new_admin_id,
+                            }
+                phonecall_obj.write(cr, uid, [case.id], vals)
+                phonecall_obj.case_close(cr, uid, [case.id])
+                claim_obj.case_open(cr, uid, [new_admin_id])
+
+        value = {
+            'name': _('Administration Case'),
+            'view_type': 'form',
+            'view_mode': 'form,tree',
+            'res_model': 'crm.claim',
+            'res_id': int(new_admin_id),
+            'view_id': False,
+#            'views': [(id2, 'form'), (id3, 'tree'), (False, 'calendar'), (False, 'graph')],
+            'type': 'ir.actions.act_window',
+#            'search_view_id': res['res_id']
+        }
+        return value
+
+    _columns = {
+        'name' : fields.char('Case Summary', size=64, required=True, select=1),
+        'partner_id': fields.many2one('res.partner', 'Partner', required=True),
+    }
+
+    def default_get(self, cr, uid, fields, context=None):
+        """
+        This function gets default values
+        @param self: The object pointer
+        @param cr: the current row, from the database cursor,
+        @param uid: the current user’s ID for security checks,
+        @param fields: List of fields for default value
+        @param context: A standard dictionary for contextual values
+
+        @return : default values of fields.
+        """
+        record_id = context and context.get('active_id', False) or False
+        res = super(crm_phonecall2admincase, self).default_get(cr, uid, fields, context=context)
+
+        if record_id:
+            phonecall = self.pool.get('crm.phonecall').browse(cr, uid, record_id, context=context)
+            if 'name' in fields:
+                res.update({'name': phonecall.name})
+            if 'partner_id' in fields:
+                res.update({'partner_id': phonecall.partner_id and phonecall.partner_id.id or False})
+        return res
+
+crm_phonecall2admincase()
\ No newline at end of file

=== added file 'avanzosc_crm_call_ext/wizard/crm_phonecall_to_admincase_view.xml'
--- avanzosc_crm_call_ext/wizard/crm_phonecall_to_admincase_view.xml	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/wizard/crm_phonecall_to_admincase_view.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+
+<!-- Phonecall to Administration view -->
+    
+        <record model="ir.ui.view" id="phonecall_to_admincase_view">
+            <field name="name">crm.phonecall2admincase.form</field>
+            <field name="model">crm.phonecall2admincase</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <form string="Convert To Administration Case ">
+                		<field name="name"/>
+						<field name="partner_id" />
+					<separator string=" " colspan="4"/>
+                    <group colspan="4" col="3" >
+                    	<label string=" " />
+                        <button name="action_cancel" string="_Cancel" icon="gtk-cancel" special="cancel" />
+                        <button name="action_apply" type="object" string="_Convert" icon="gtk-convert" />
+                    </group>
+                </form>
+            </field>
+        </record>
+
+<!-- Phonecall to Administration action -->
+
+        <record model="ir.actions.act_window" id="phonecall_to_admincase_act">
+            <field name="name">Convert To Administration Case</field>
+            <field name="res_model">crm.phonecall2admincase</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">form</field>
+            <field name="view_id" ref="phonecall_to_admincase_view"/>
+            <field name="target">new</field>
+        </record>
+
+    </data>
+</openerp>  
\ No newline at end of file

=== added file 'avanzosc_crm_call_ext/wizard/crm_phonecall_to_lead.py'
--- avanzosc_crm_call_ext/wizard/crm_phonecall_to_lead.py	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/wizard/crm_phonecall_to_lead.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,154 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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
+from tools.translate import _
+
+class crm_phonecall2lead(osv.osv_memory):
+    """ Converts Phonecall to Lead"""
+
+    _name = 'crm.phonecall2lead'
+    _description = 'Phonecall To Lead'
+
+    def action_cancel(self, cr, uid, ids, context=None):
+        """
+        Closes Phonecall to Lead form
+        @param self: The object pointer
+        @param cr: the current row, from the database cursor,
+        @param uid: the current user’s ID for security checks,
+        @param ids: List of Phonecall to Lead IDs
+        @param context: A standard dictionary for contextual values
+        """
+
+        return {'type':'ir.actions.act_window_close'}
+
+    def view_init(self, cr, uid, fields, context=None):
+        """
+        This function checks for precondition before wizard executes
+        @param self: The object pointer
+        @param cr: the current row, from the database cursor,
+        @param uid: the current user’s ID for security checks,
+        @param fields: List of fields for default value
+        @param context: A standard dictionary for contextual values
+
+        """
+        phonecall_obj = self.pool.get('crm.phonecall')
+        record_id = context and context.get('active_id', False) or False
+        case = phonecall_obj.browse(cr, uid, record_id, context=context)
+        if case.state in ['done', 'cancel']:
+                raise osv.except_osv(_("Warning"), _("Closed/Cancelled Phone \
+Call Could not convert into Lead"))
+
+
+    def action_apply(self, cr, uid, ids, context=None):
+        """
+        This converts Phonecall to Lead and opens Phonecall view
+        @param self: The object pointer
+        @param cr: the current row, from the database cursor,
+        @param uid: the current user’s ID for security checks,
+        @param ids: List of Phonecall to Lead IDs
+        @param context: A standard dictionary for contextual values
+
+        @return : Dictionary value for created Opportunity form
+        """
+        record_id = context and context.get('active_id', False) or False
+        if record_id:
+            lead_obj = self.pool.get('crm.lead')
+            phonecall_obj = self.pool.get('crm.phonecall')
+            case = phonecall_obj.browse(cr, uid, record_id, context=context)
+            data_obj = self.pool.get('ir.model.data')
+#            result = data_obj._get_id(cr, uid, 'crm', 'view_crm_case_opportunities_filter')
+#            res = data_obj.read(cr, uid, result, ['res_id'])
+            id2 = data_obj._get_id(cr, uid, 'crm', 'crm_case_form_view_leads')
+            id3 = data_obj._get_id(cr, uid, 'crm', 'crm_case_tree_view_leads')
+            if id2:
+                id2 = data_obj.browse(cr, uid, id2, context=context).res_id
+            if id3:
+                id3 = data_obj.browse(cr, uid, id3, context=context).res_id
+
+            for this in self.browse(cr, uid, ids, context=context):
+                address = None
+                if this.partner_id:
+                    address_id = self.pool.get('res.partner').address_get(cr, uid, [this.partner_id.id])
+                    if address_id['default']:
+                        address = self.pool.get('res.partner.address').browse(cr, uid, address_id['default'], context=context)
+                new_lead_id = lead_obj.create(cr, uid, {
+                                'name': this.name,
+                                'partner_id': this.partner_id and this.partner_id.id or False,
+                                'partner_address_id': address and address.id or False, 
+                                'phone': address and address.phone,
+                                'mobile': address and address.mobile,
+                                'section_id': case.section_id and case.section_id.id or False,
+                                'description': case.description or False,
+                                'phonecall_id': case.id,
+                                'canal_id': case.canal_id.id,
+                                'priority': case.priority,
+                                'phone': case.partner_phone or False,
+                            })
+                vals = {
+                            'partner_id': this.partner_id.id,
+                            'lead_id' : new_lead_id,
+                            }
+                phonecall_obj.write(cr, uid, [case.id], vals)
+                phonecall_obj.case_close(cr, uid, [case.id])
+                lead_obj.case_open(cr, uid, [new_lead_id])
+
+        value = {
+            'name': _('Lead'),
+            'view_type': 'form',
+            'view_mode': 'form,tree',
+            'res_model': 'crm.lead',
+            'res_id': int(new_lead_id),
+            'view_id': False,
+            'views': [(id2, 'form'), (id3, 'tree'), (False, 'calendar'), (False, 'graph')],
+            'type': 'ir.actions.act_window',
+#            'search_view_id': res['res_id']
+        }
+        return value
+
+    _columns = {
+        'name' : fields.char('Lead Summary', size=64, required=True, select=1),
+        'partner_id': fields.many2one('res.partner', 'Partner'),
+    }
+
+    def default_get(self, cr, uid, fields, context=None):
+        """
+        This function gets default values
+        @param self: The object pointer
+        @param cr: the current row, from the database cursor,
+        @param uid: the current user’s ID for security checks,
+        @param fields: List of fields for default value
+        @param context: A standard dictionary for contextual values
+
+        @return : default values of fields.
+        """
+        record_id = context and context.get('active_id', False) or False
+        res = super(crm_phonecall2lead, self).default_get(cr, uid, fields, context=context)
+
+        if record_id:
+            phonecall = self.pool.get('crm.phonecall').browse(cr, uid, record_id, context=context)
+            if 'name' in fields:
+                res.update({'name': phonecall.name})
+            if 'partner_id' in fields:
+                res.update({'partner_id': phonecall.partner_id and phonecall.partner_id.id or False})
+        return res
+
+crm_phonecall2lead()
\ No newline at end of file

=== added file 'avanzosc_crm_call_ext/wizard/crm_phonecall_to_lead_view.xml'
--- avanzosc_crm_call_ext/wizard/crm_phonecall_to_lead_view.xml	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/wizard/crm_phonecall_to_lead_view.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+
+<!-- Phonecall to Lead view -->
+    
+        <record model="ir.ui.view" id="phonecall_to_lead_view">
+            <field name="name">crm.phonecall2lead.form</field>
+            <field name="model">crm.phonecall2lead</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <form string="Convert To Lead">
+                		<field name="name"/>
+						<field name="partner_id" />
+					<separator string=" " colspan="4"/>
+                    <group colspan="4" col="3" >
+                    	<label string=" " />
+                        <button name="action_cancel" string="_Cancel" icon="gtk-cancel" special="cancel" />
+                        <button name="action_apply" type="object" string="_Convert" icon="gtk-convert" />
+                    </group>
+                </form>
+            </field>
+        </record>
+
+<!-- Phonecall to Lead action -->
+
+        <record model="ir.actions.act_window" id="phonecall_to_lead_act">
+            <field name="name">Convert To Lead</field>
+            <field name="res_model">crm.phonecall2lead</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">form</field>
+            <field name="view_id" ref="phonecall_to_lead_view"/>
+            <field name="target">new</field>
+        </record>
+
+    </data>
+</openerp>  
\ No newline at end of file

=== added file 'avanzosc_crm_call_ext/wizard/crm_phonecall_to_technicalcase.py'
--- avanzosc_crm_call_ext/wizard/crm_phonecall_to_technicalcase.py	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/wizard/crm_phonecall_to_technicalcase.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,161 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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
+from tools.translate import _
+
+class crm_phonecall2technicalcase(osv.osv_memory):
+    """ Converts Phonecall to Technical case"""
+
+    _name = 'crm.phonecall2technicalcase'
+    _description = 'Phonecall To Technical case'
+
+    def action_cancel(self, cr, uid, ids, context=None):
+        """
+        Closes Phonecall to Opportunity form
+        @param self: The object pointer
+        @param cr: the current row, from the database cursor,
+        @param uid: the current user’s ID for security checks,
+        @param ids: List of Phonecall to Technical case IDs
+        @param context: A standard dictionary for contextual values
+        """
+
+        return {'type':'ir.actions.act_window_close'}
+
+    def view_init(self, cr, uid, fields, context=None):
+        """
+        This function checks for precondition before wizard executes
+        @param self: The object pointer
+        @param cr: the current row, from the database cursor,
+        @param uid: the current user’s ID for security checks,
+        @param fields: List of fields for default value
+        @param context: A standard dictionary for contextual values
+
+        """
+        phonecall_obj = self.pool.get('crm.phonecall')
+        record_id = context and context.get('active_id', False) or False
+        case = phonecall_obj.browse(cr, uid, record_id, context=context)
+        if case.state in ['done', 'cancel']:
+                raise osv.except_osv(_("Warning"), _("Closed/Cancelled Phone \
+Call Could not convert into Technical Case"))
+        if not case.description:
+                raise osv.except_osv(_("Warning"), _("Phone \
+Call without Description Could not convert into Technical Case"))
+        if not case.section_id:
+                raise osv.except_osv(_("Warning"), _("Phone \
+Call without Sale Team Could not convert into Technical Case"))
+
+
+    def action_apply(self, cr, uid, ids, context=None):
+        """
+        This converts Phonecall to Technical case and opens Phonecall view
+        @param self: The object pointer
+        @param cr: the current row, from the database cursor,
+        @param uid: the current user’s ID for security checks,
+        @param ids: List of Phonecall to Technical case IDs
+        @param context: A standard dictionary for contextual values
+
+        @return : Dictionary value for created Opportunity form
+        """
+        record_id = context and context.get('active_id', False) or False
+        if record_id:
+            tech_obj = self.pool.get('crm.helpdesk')
+            phonecall_obj = self.pool.get('crm.phonecall')
+            case = phonecall_obj.browse(cr, uid, record_id, context=context)
+            data_obj = self.pool.get('ir.model.data')
+#            result = data_obj._get_id(cr, uid, 'crm', 'view_crm_case_opportunities_filter')
+#            res = data_obj.read(cr, uid, result, ['res_id'])
+#            id2 = data_obj._get_id(cr, uid, 'crm', 'crm_case_form_view_oppor')
+#            id3 = data_obj._get_id(cr, uid, 'crm', 'crm_case_tree_view_oppor')
+#            if id2:
+#                id2 = data_obj.browse(cr, uid, id2, context=context).res_id
+#            if id3:
+#                id3 = data_obj.browse(cr, uid, id3, context=context).res_id
+
+            for this in self.browse(cr, uid, ids, context=context):
+                address = None
+                if this.partner_id:
+                    address_id = self.pool.get('res.partner').address_get(cr, uid, [this.partner_id.id])
+                    if address_id['default']:
+                        address = self.pool.get('res.partner.address').browse(cr, uid, address_id['default'], context=context)
+                new_technical_id = tech_obj.create(cr, uid, {
+                                'name': this.name,
+                                'partner_id': this.partner_id and this.partner_id.id or False,
+                                'partner_address_id': address and address.id, 
+                                'phone': address and address.phone,
+                                'mobile': address and address.mobile,
+                                'section_id': case.section_id and case.section_id.id,
+                                'description': case.description or False,
+                                'phonecall_id': case.id,
+                                'canal_id': case.canal_id.id,
+                                'priority': case.priority,
+                                'user_id': case.section_id.user_id.id,
+                                'phone': case.partner_phone or False,
+                            })
+                vals = {
+                            'partner_id': this.partner_id.id,
+                            'helpdesk_id' : new_technical_id,
+                            }
+                phonecall_obj.write(cr, uid, [case.id], vals)
+                phonecall_obj.case_close(cr, uid, [case.id])
+                tech_obj.case_open(cr, uid, [new_technical_id])
+
+        value = {
+            'name': _('Technical Case'),
+            'view_type': 'form',
+            'view_mode': 'form,tree',
+            'res_model': 'crm.helpdesk',
+            'res_id': int(new_technical_id),
+            'view_id': False,
+#            'views': [(id2, 'form'), (id3, 'tree'), (False, 'calendar'), (False, 'graph')],
+            'type': 'ir.actions.act_window',
+#            'search_view_id': res['res_id']
+        }
+        return value
+
+    _columns = {
+        'name' : fields.char('Case Summary', size=64, required=True, select=1),
+        'partner_id': fields.many2one('res.partner', 'Partner', required=True),
+    }
+
+    def default_get(self, cr, uid, fields, context=None):
+        """
+        This function gets default values
+        @param self: The object pointer
+        @param cr: the current row, from the database cursor,
+        @param uid: the current user’s ID for security checks,
+        @param fields: List of fields for default value
+        @param context: A standard dictionary for contextual values
+
+        @return : default values of fields.
+        """
+        record_id = context and context.get('active_id', False) or False
+        res = super(crm_phonecall2technicalcase, self).default_get(cr, uid, fields, context=context)
+
+        if record_id:
+            phonecall = self.pool.get('crm.phonecall').browse(cr, uid, record_id, context=context)
+            if 'name' in fields:
+                res.update({'name': phonecall.name})
+            if 'partner_id' in fields:
+                res.update({'partner_id': phonecall.partner_id and phonecall.partner_id.id or False})
+        return res
+
+crm_phonecall2technicalcase()
\ No newline at end of file

=== added file 'avanzosc_crm_call_ext/wizard/crm_phonecall_to_technicalcase_view.xml'
--- avanzosc_crm_call_ext/wizard/crm_phonecall_to_technicalcase_view.xml	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext/wizard/crm_phonecall_to_technicalcase_view.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+
+<!-- Phonecall to Technical view -->
+    
+        <record model="ir.ui.view" id="phonecall_to_technicalcase_view">
+            <field name="name">crm.phonecall2technicalcase.form</field>
+            <field name="model">crm.phonecall2technicalcase</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <form string="Convert To Technical Case ">
+                		<field name="name"/>
+						<field name="partner_id" />
+					<separator string=" " colspan="4"/>
+                    <group colspan="4" col="3" >
+                    	<label string=" " />
+                        <button name="action_cancel" string="_Cancel" icon="gtk-cancel" special="cancel" />
+                        <button name="action_apply" type="object" string="_Convert" icon="gtk-convert" />
+                    </group>
+                </form>
+            </field>
+        </record>
+
+<!-- Phonecall to Technical action -->
+
+        <record model="ir.actions.act_window" id="phonecall_to_technicalcase_act">
+            <field name="name">Convert To Technical Case</field>
+            <field name="res_model">crm.phonecall2technicalcase</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">form</field>
+            <field name="view_id" ref="phonecall_to_technicalcase_view"/>
+            <field name="target">new</field>
+        </record>
+
+    </data>
+</openerp>  
\ No newline at end of file

=== added directory 'avanzosc_crm_call_ext_partner'
=== added file 'avanzosc_crm_call_ext_partner/__init__.py'
--- avanzosc_crm_call_ext_partner/__init__.py	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext_partner/__init__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,22 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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 partner

=== added file 'avanzosc_crm_call_ext_partner/__openerp__.py'
--- avanzosc_crm_call_ext_partner/__openerp__.py	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext_partner/__openerp__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,45 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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": "Avanzosc CRM Call Extension Partner",
+    "version": "1.0",
+    "depends": ["account_invoicing",
+                ],
+    "author": "AvanzOSC",
+    "website" : "http://www.avanzosc.com";,
+    "category": "Custom Module",
+    "website" : "www.avanzosc.com",
+    "description": """
+    This module provide 2 buttons to record:
+        * Technical incidence from the CRM input form.
+        * Administrative incidence from the CRM input form
+    
+    The state of the new incidence will be 'pending' and as a responsible of the case, the corresponding responsible of the technical/administrative team will be stablished as default.
+    """,
+    "init_xml": [],
+    'update_xml': [
+                   "partner/partner_view.xml",
+                   ],
+    'demo_xml': [],
+    'installable': True,
+    'active': False,
+}
\ No newline at end of file

=== added directory 'avanzosc_crm_call_ext_partner/partner'
=== added file 'avanzosc_crm_call_ext_partner/partner/__init__.py'
--- avanzosc_crm_call_ext_partner/partner/__init__.py	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext_partner/partner/__init__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,22 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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 partner
\ No newline at end of file

=== added file 'avanzosc_crm_call_ext_partner/partner/partner.py'
--- avanzosc_crm_call_ext_partner/partner/partner.py	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext_partner/partner/partner.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,65 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2010 - 2011 Avanzosc <http://www.avanzosc.com>
+#
+#    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
+from osv import fields
+
+class res_partner(osv.osv):
+    _inherit = 'res.partner'
+ 
+ 
+    def _calculate_running_agree_num(self, cr, uid, ids, field_name, arg, context=None):
+        res={}
+        agreement_obj = self.pool.get('inv.agreement')
+        for id in ids:
+            res[id] = len(agreement_obj.search(cr, uid, [('partner_id', '=', id), ('state', '=', 'running')]))
+        return res
+    
+    def _calculate_done_agree_num(self, cr, uid, ids, field_name, arg, context=None):
+        res={}
+        agreement_obj = self.pool.get('inv.agreement')
+        for id in ids:
+            res[id] = len(agreement_obj.search(cr, uid, [('partner_id', '=', id), ('state', '=', 'done')]))
+        return res
+    
+    def _calculate_inactive_service_num(self, cr, uid, ids, field_name, arg, context=None):
+        res={}
+        service_obj = self.pool.get('stock.production.lot')
+        for id in ids:
+            res[id] = len(service_obj.search(cr, uid, [('customer', '=', id), ('state', '=', 'inactive'), ('is_service','=',True)]))
+        return res
+    
+    def _calculate_active_service_num(self, cr, uid, ids, field_name, arg, context=None):
+        res={}
+        service_obj = self.pool.get('stock.production.lot')
+        for id in ids:
+            res[id] = len(service_obj.search(cr, uid, [('customer', '=', id), ('state', '=', 'active'), ('is_service','=', True)]))
+        return res
+    
+    _columns = {
+            'helpdesk_ids': fields.one2many('crm.helpdesk', 'partner_id', 'HelpDesks'),
+            'claim_ids': fields.one2many('crm.claim', 'partner_id', 'Claims'),
+            'running_agree_num':fields.function(_calculate_running_agree_num, method=True, type='integer', string='Nº Running agreement'),
+            'done_agree_num':fields.function(_calculate_done_agree_num, method=True, type='integer', string='Nº Done agreement'),
+            'inactive_service_num':fields.function(_calculate_inactive_service_num, method=True, type='integer', string='Nº Inactive Service'),
+            'active_service_num':fields.function(_calculate_active_service_num, method=True, type='integer', string='Nº Active Service'),
+        }
+res_partner()
\ No newline at end of file

=== added file 'avanzosc_crm_call_ext_partner/partner/partner_view.xml'
--- avanzosc_crm_call_ext_partner/partner/partner_view.xml	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_call_ext_partner/partner/partner_view.xml	2013-02-01 09:33:03 +0000
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+	<data>
+
+		<record model="ir.ui.view" id="res_partner_form_crmcases_inherit_view">
+			<field name="name">res.partner.form.crmcases.inherit</field>
+			<field name="model">res.partner</field>
+			<field name="type">form</field>
+			<field name="inherit_id" ref="crm.view_crm_partner_info_form1" />
+			<field name="arch" type="xml">
+				<xpath expr="/form/notebook/page/field[@name='phonecall_ids']"
+					position="replace" />
+				<xpath expr="/form/notebook/page/field[@name='meeting_ids']"
+					position="replace" />
+			</field>
+		</record>
+
+		<record model="ir.ui.view" id="res_partner_agreement_form_inherit_view">
+			<field name="name">res.partner.agreement.form.inherit</field>
+			<field name="model">res.partner</field>
+			<field name="type">form</field>
+			<field name="inherit_id" ref="res_partner_form_crmcases_inherit_view" />
+			<field name="arch" type="xml">
+				<page string="History" position="after">
+					<page string="CRM Cases">
+						<field name="phonecall_ids" nolabel="1" colspan="4" context="{'default_partner_id': active_id}">
+							<tree string="Phone Calls"
+								colors="gray:state in ('draft', 'cancel','done','pending')">
+								<field name="date" string="Date" />
+								<field name="name" string="Call Summary" />
+								<field name="categ_id" string="Type" widget="selection" />
+								<field name="user_id" />
+								<field name="state" />
+								<button name="case_cancel" string="Cancel" states="draft,open,pending"
+									type="object" icon="gtk-cancel" />
+								<button name="case_open" string="Open" states="draft,pending"
+									type="object" icon="gtk-go-forward" />
+								<button name="case_close" string="Held" states="open,draft,pending"
+									type="object" icon="gtk-jump-to" />
+								<button name="case_pending" string="Not Held" states="open"
+									type="object" icon="gtk-media-pause" />
+							</tree>
+						</field>
+						<field name="helpdesk_ids" nolabel="1" colspan="4" context="{'default_partner_id': active_id}"/>
+						<field name="claim_ids" nolabel="1" colspan="4" context="{'default_partner_id': active_id}"/>
+						<field name="meeting_ids" nolabel="1" colspan="4" context="{'default_partner_id': active_id}">
+							<tree string="Meetings"
+								colors="gray:state in ('draft', 'cancel','done','pending')">
+								<field name="user_id" string="Responsible" />
+								<field name="name" string="Subject" />
+								<field name="date" string="Start Date" />
+								<field name="date_deadline" string="End Date" />
+								<field name="state" invisible="1" />
+							</tree>
+						</field>
+					</page>
+				</page>
+			</field>
+		</record>
+		
+		<record model="ir.ui.view" id="res_partner_count_fields_inherit_view">
+			<field name="name">res.partner.count.tree.inherit</field>
+			<field name="model">res.partner</field>
+			<field name="type">tree</field>
+			<field name="inherit_id" ref="base.view_partner_tree" />
+			<field name="arch" type="xml">
+				<xpath expr="/tree/field[@name='user_id']" position="after">
+					<field name="running_agree_num"/>
+					<field name="done_agree_num"/>
+					<field name="inactive_service_num"/>
+					<field name="active_service_num"/>
+				</xpath>
+			</field>
+		</record>
+		
+	</data>
+</openerp>
\ No newline at end of file

=== added directory 'avanzosc_crm_claim_sale_order'
=== renamed directory 'avanzosc_crm_claim_sale_order' => 'avanzosc_crm_claim_sale_order.moved'
=== added file 'avanzosc_crm_claim_sale_order/__init__.py'
--- avanzosc_crm_claim_sale_order/__init__.py	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_claim_sale_order/__init__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,23 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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 crm_claim

=== added file 'avanzosc_crm_claim_sale_order/__openerp__.py'
--- avanzosc_crm_claim_sale_order/__openerp__.py	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_claim_sale_order/__openerp__.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,41 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avanzosc - Avanced Open Source Consulting
+#    Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
+#
+#    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": "Avanzosc crm claim sale order",
+    "version": "1.0",
+    "depends": ["crm_claim", "sale"],
+    "author": "AvanzOSC",
+    "website" : "http://www.avanzosc.com";,
+    "category": "Custom Module",
+    "description": """
+    This module provide :
+    Shows a wizard to create a claim from sale order
+    """,
+    "init_xml": [],
+    'update_xml': [
+                   "wizard/crm_claim_create_wizard_view.xml", 
+                   "crm_claim_view.xml"],
+    'demo_xml': [],
+    'installable': True,
+    'active': False,
+}
+

=== added file 'avanzosc_crm_claim_sale_order/crm_claim.py'
--- avanzosc_crm_claim_sale_order/crm_claim.py	1970-01-01 00:00:00 +0000
+++ avanzosc_crm_claim_sale_order/crm_claim.py	2013-02-01 09:33:03 +0000
@@ -0,0 +1,54 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Avan