[MERGE]: merging from the trunk
bzr revid: mga@tinyerp.com-20100405155743-wh7wl66ly71bmaxb
This commit is contained in:
@@ -46,7 +46,17 @@ module named account_voucherss
|
||||
'security/account_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'account_menuitem.xml',
|
||||
'wizard/account_invoice_refund_view.xml',
|
||||
'wizard/account_period_close_view.xml',
|
||||
'wizard/account_fiscalyear_close_state.xml',
|
||||
'wizard/account_chart_view.xml',
|
||||
'wizard/account_move_bank_reconcile_view.xml',
|
||||
'wizard/account_move_line_reconcile_select_view.xml',
|
||||
'wizard/account_move_journal_view.xml',
|
||||
'account_wizard.xml',
|
||||
'wizard/account_move_line_unreconcile_select_view.xml',
|
||||
'wizard/account_subscription_generate_view.xml',
|
||||
'project/wizard/project_account_analytic_line_view.xml',
|
||||
'account_view.xml',
|
||||
'account_end_fy.xml',
|
||||
'account_invoice_view.xml',
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
<field name="period_id" groups="base.group_user"/>
|
||||
<group colspan="2" col="1" groups="base.group_user">
|
||||
<label align="0.0" string="(keep empty to use the current period)"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Invoice">
|
||||
|
||||
@@ -24,3 +24,4 @@
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
||||
@@ -668,9 +668,9 @@
|
||||
<field eval="True" name="object"/>
|
||||
</record>
|
||||
|
||||
<wizard id="action_move_journal_line_form" menu="False" model="account.move.line" name="account.move.journal" string="Entries by Line"/>
|
||||
<!-- <wizard id="action_move_journal_line_form" menu="False" model="account.move.line" name="account.move.journal" string="Entries by Line"/>
|
||||
<menuitem icon="STOCK_JUSTIFY_FILL" action="action_move_journal_line_form" id="menu_action_move_journal_line_form" parent="account.menu_finance_entries" type="wizard" sequence="5"/>
|
||||
|
||||
-->
|
||||
<!--
|
||||
Entries lines
|
||||
-->
|
||||
@@ -1007,9 +1007,9 @@
|
||||
<menuitem action="action_move_line_search" id="menu_action_move_line_search" parent="account.next_id_29"/>
|
||||
|
||||
<menuitem id="menu_finance_charts" name="Charts" parent="account.menu_finance" sequence="4"/>
|
||||
<wizard id="wizard_account_chart" menu="False" model="account.account" name="account.chart" string="Chart of Accounts"/>
|
||||
<!-- <wizard id="wizard_account_chart" menu="False" model="account.account" name="account.chart" string="Chart of Accounts"/>
|
||||
<menuitem icon="STOCK_INDENT" action="wizard_account_chart" id="menu_action_account_tree2" parent="account.menu_finance_charts" type="wizard"/>
|
||||
|
||||
-->
|
||||
|
||||
|
||||
<record id="view_bank_statement_reconcile_form" model="ir.ui.view">
|
||||
@@ -1079,8 +1079,14 @@
|
||||
groups="group_account_user"/>
|
||||
|
||||
<menuitem action="action_bank_statement_reconciliation_form" id="menu_action_account_bank_reconcile_tree" parent="next_id_30"/>
|
||||
<wizard id="action_account_bank_reconcile_tree" menu="False" model="account.move.line" name="account.move.bank.reconcile" string="Bank reconciliation"/>
|
||||
<menuitem action="action_account_bank_reconcile_tree" id="menu_action_account_bank_reconcile_check_tree" parent="account.next_id_30" type="wizard"/>
|
||||
<!-- <wizard id="action_account_bank_reconcile_tree" menu="False" model="account.move.line" name="account.move.bank.reconcile" string="Bank reconciliation"/> -->
|
||||
<!-- <menuitem action="action_account_bank_reconcile_tree" id="menu_action_account_bank_reconcile_check_tree" parent="account.next_id_30" type="wizard"/> -->
|
||||
|
||||
<!-- bank reconsilation -->
|
||||
<menuitem action="action_account_bank_reconcile_tree"
|
||||
id="menu_action_account_bank_reconcile_check_tree"
|
||||
parent="account.next_id_30" />
|
||||
|
||||
|
||||
<act_window
|
||||
domain="[('account_id', '=', active_id)]"
|
||||
|
||||
@@ -7,7 +7,14 @@
|
||||
name="account.balance.account.balance.report"
|
||||
keyword="client_print_multi"
|
||||
id="wizard_account_balance_compare_report"/>
|
||||
<wizard id="wizard_invoice_refund" model="account.invoice" name="account.invoice.refund" string="Credit Note" groups="base.group_user"/>
|
||||
|
||||
<!-- <wizard id="wizard_invoice_refund" model="account.invoice" name="account.invoice.refund" string="Credit Note" groups="base.group_user"/> -->
|
||||
|
||||
<!-- <wizard id="wizard_invoice_refund" model="account.invoice" name="account.invoice.refund" string="Credit Note" groups="base.group_user"/>-->
|
||||
|
||||
<!-- for test only -->
|
||||
|
||||
|
||||
|
||||
<wizard id="wizard_invoice_pay" model="account.invoice" name="account.invoice.pay" string="Pay invoice" groups="base.group_user"/>
|
||||
|
||||
@@ -21,8 +28,9 @@
|
||||
type="wizard"
|
||||
sequence="1"/>
|
||||
|
||||
<wizard id="wizard_fiscalyear_close_state" menu="False" model="account.fiscalyear" name="account.fiscalyear.close.state" string="Close a Fiscal Year"/>
|
||||
<!-- <wizard id="wizard_fiscalyear_close_state" menu="False" model="account.fiscalyear" name="account.fiscalyear.close.state" string="Close a Fiscal Year"/>
|
||||
<menuitem action="wizard_fiscalyear_close_state" id="menu_wizard_fy_close_state" parent="menu_account_end_year_treatments" type="wizard"/>
|
||||
-->
|
||||
|
||||
<wizard
|
||||
id="wizard_open_closed_fiscalyear"
|
||||
@@ -35,12 +43,19 @@
|
||||
id="menu_wizard_open_closed_fy"
|
||||
sequence="2"
|
||||
parent="account.menu_account_end_year_treatments" type="wizard"/>
|
||||
<!-- period close
|
||||
|
||||
<wizard id="wizard_period_close" model="account.period" name="account.period.close" string="Close a Period"/>
|
||||
|
||||
<wizard id="wizard_period_close" model="account.period" name="account.period.close" string="Close a Period"/>
|
||||
|
||||
<wizard id="action_account_period_close" model="account.period" name="account.period.close" string="Close a Period"/>
|
||||
|
||||
|
||||
-->
|
||||
<!-- automatic reconcile -->
|
||||
<wizard id="wizard_automatic_reconcile" menu="False" model="account.account" name="account.automatic.reconcile" string="Automatic reconciliation"/>
|
||||
<menuitem id="next_id_20" name="Reconciliation" parent="menu_finance_periodical_processing"/><menuitem action="wizard_automatic_reconcile" id="menu_automatic_reconcile" parent="next_id_20" type="wizard"/>
|
||||
<menuitem id="next_id_20" name="Reconciliation" parent="menu_finance_periodical_processing"/>
|
||||
<menuitem action="wizard_automatic_reconcile" id="menu_automatic_reconcile" parent="next_id_20" type="wizard"/>
|
||||
|
||||
<!-- Import entry in statement -->
|
||||
|
||||
@@ -57,19 +72,24 @@
|
||||
<wizard id="wizard_reconcile_unreconcile" model="account.move.reconcile" name="account.reconcile.unreconcile" string="Unreconcile Entries"/>
|
||||
|
||||
|
||||
<wizard id="wizard_reconcile_select" menu="False" model="account.move.line" name="account.move.line.reconcile.select" string="Reconcile entries"/>
|
||||
<!-- <wizard id="wizard_reconcile_select" menu="False" model="account.move.line" name="account.move.line.reconcile.select" string="Reconcile entries"/>
|
||||
<menuitem action="wizard_reconcile_select" id="menu_reconcile_select" parent="account.next_id_20" type="wizard"/>
|
||||
-->
|
||||
|
||||
<!-- unreconcile -->
|
||||
<wizard id="wizard_unreconcile" model="account.move.line" name="account.move.line.unreconcile" string="Unreconcile Entries"/>
|
||||
|
||||
<!-- unreconcile
|
||||
|
||||
<wizard id="wizard_unreconcile_select" menu="False" model="account.move.line" name="account.move.line.unreconcile.select" string="Unreconcile entries"/>
|
||||
<menuitem action="wizard_unreconcile_select" id="menu_unreconcile_select" parent="account.next_id_20" type="wizard"/>
|
||||
-->
|
||||
|
||||
<!-- subscriptions -->
|
||||
<!--
|
||||
<wizard id="wizard_generate_subscription" menu="False" model="account.subscription" name="account.subscription.generate" string="Create subscription entries"/>
|
||||
<menuitem action="wizard_generate_subscription" id="menu_generate_subscription" parent="account.menu_finance_periodical_processing" type="wizard"/>
|
||||
|
||||
-->
|
||||
<!-- Aged partner balance -->
|
||||
<wizard id="wizard_aged_trial_balance" menu="False" model="res.partner" name="account.aged.trial.balance" string="Aged Partner Balance"/>
|
||||
<menuitem id="next_id_22" name="Partner Accounts" parent="menu_finance_generic_reporting" sequence="1"/>
|
||||
|
||||
@@ -13,7 +13,7 @@ msgstr ""
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-02 03:42+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-03 03:54+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: account
|
||||
|
||||
@@ -7,13 +7,13 @@ msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 5.0.0\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
|
||||
"PO-Revision-Date: 2010-04-01 17:22+0000\n"
|
||||
"PO-Revision-Date: 2010-04-02 07:16+0000\n"
|
||||
"Last-Translator: Ferdinand @ ChriCar <Unknown>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-02 03:42+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-03 03:54+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: account
|
||||
|
||||
@@ -7,13 +7,13 @@ msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 5.0.0\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
|
||||
"PO-Revision-Date: 2010-03-02 15:44+0000\n"
|
||||
"Last-Translator: Nikolay Chesnokov <chesnokov_n@msn.com>\n"
|
||||
"PO-Revision-Date: 2010-04-03 16:42+0000\n"
|
||||
"Last-Translator: Alexandr Mitev <Unknown>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2010-03-30 04:03+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-04 03:52+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: account
|
||||
@@ -323,7 +323,7 @@ msgstr "Происхождение"
|
||||
#. module: account
|
||||
#: rml:account.analytic.account.journal:0
|
||||
msgid "Move Name"
|
||||
msgstr ""
|
||||
msgstr "Имя перемещения"
|
||||
|
||||
#. module: account
|
||||
#: xsl:account.transfer:0
|
||||
@@ -355,7 +355,7 @@ msgstr "Налог"
|
||||
#. module: account
|
||||
#: rml:account.general.journal:0
|
||||
msgid "Debit Trans."
|
||||
msgstr ""
|
||||
msgstr "Дебитовая сделка"
|
||||
|
||||
#. module: account
|
||||
#: field:account.analytic.line,account_id:0
|
||||
@@ -608,7 +608,7 @@ msgstr ""
|
||||
#. module: account
|
||||
#: view:account.journal:0
|
||||
msgid "Entry Controls"
|
||||
msgstr ""
|
||||
msgstr "Контроль проводки"
|
||||
|
||||
#. module: account
|
||||
#: help:account.model.line,sequence:0
|
||||
@@ -642,7 +642,7 @@ msgstr "Условия платежа партнера"
|
||||
#. module: account
|
||||
#: view:account.move.reconcile:0
|
||||
msgid "Account Entry Reconcile"
|
||||
msgstr ""
|
||||
msgstr "Согласование проводки по счету"
|
||||
|
||||
#. module: account
|
||||
#: wizard_button:account.move.bank.reconcile,init,open:0
|
||||
@@ -734,7 +734,7 @@ msgstr "Строки финансового документа"
|
||||
#. module: account
|
||||
#: model:process.transition,name:account.process_transition_supplieranalyticcost0
|
||||
msgid "Analytic Invoice"
|
||||
msgstr ""
|
||||
msgstr "Аналитический счет"
|
||||
|
||||
#. module: account
|
||||
#: field:account.journal.column,field:0
|
||||
@@ -981,7 +981,7 @@ msgstr "Проводки по выражениям"
|
||||
#. module: account
|
||||
#: model:process.transition,name:account.process_transition_analyticinvoice0
|
||||
msgid "analytic Invoice"
|
||||
msgstr ""
|
||||
msgstr "aналитический счет"
|
||||
|
||||
#. module: account
|
||||
#: wizard_field:account.automatic.reconcile,init,period_id:0
|
||||
|
||||
@@ -204,10 +204,14 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_account_analytic_line_tree"/>
|
||||
</record>
|
||||
<wizard id="action_account_analytic_line" menu="False" model="account.analytic.line" name="account.analytic.line" string="Entries by Line"/>
|
||||
<wizard id="action_account_analytic_line" menu="False" model="account.analytic.line" name="account.analytic.line" string="Entries by Line"/>
|
||||
<menuitem id="next_id_41" name="Analytic Entries" parent="account.menu_finance_entries"/>
|
||||
<menuitem type="wizard" icon="STOCK_JUSTIFY_FILL" action="action_account_analytic_line" id="account_entries_analytic_entries" parent="next_id_41"/>
|
||||
<!-- Entries by Line -->
|
||||
|
||||
<menuitem icon="STOCK_JUSTIFY_FILL"
|
||||
action="action_project_account_analytic_line_form"
|
||||
id="account_entries_analytic_entries"
|
||||
parent="next_id_41"/>
|
||||
|
||||
<record id="action_account_tree1" model="ir.actions.act_window">
|
||||
<field name="name">Analytic Entries</field>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
@@ -15,7 +15,7 @@
|
||||
# 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/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -25,7 +25,7 @@ import wizard_account_analytic_inverted_balance_report
|
||||
import wizard_account_analytic_cost_ledger_report
|
||||
import wizard_account_analytic_cost_ledger_for_journal_report
|
||||
import wizard_account_analytic_analytic_check
|
||||
import wizard_account_analytic_line
|
||||
import project_account_analytic_line
|
||||
import wizard_analytic_account_chart
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
# -*- 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
|
||||
class project_account_analytic_line(osv.osv_memory):
|
||||
_name = "project.account.analytic.line"
|
||||
_description = "Analytic Entries by line"
|
||||
_columns = {
|
||||
'from_date': fields.date('From'),
|
||||
'to_date': fields.date('To'),
|
||||
}
|
||||
|
||||
def action_open_window(self, cr, uid, ids, context={}):
|
||||
mod_obj =self.pool.get('ir.model.data')
|
||||
domain = []
|
||||
for data in self.read(cr, uid, ids, context=context):
|
||||
from_date = data['from_date']
|
||||
to_date = data['to_date']
|
||||
if from_date and to_date:
|
||||
domain = [('date','>=',from_date), ('date','<=',to_date)]
|
||||
elif from_date:
|
||||
domain = [('date','>=',from_date)]
|
||||
elif to_date:
|
||||
domain = [('date','<=',to_date)]
|
||||
result = mod_obj._get_id(cr, uid, 'account', 'view_account_analytic_line_filter')
|
||||
id = mod_obj.read(cr, uid, result, ['res_id'], context=context)
|
||||
return {
|
||||
'name': _('Analytic Entries by line'),
|
||||
'view_type': 'form',
|
||||
"view_mode": 'tree,form',
|
||||
'res_model': 'account.analytic.line',
|
||||
'type': 'ir.actions.act_window',
|
||||
'domain': domain,
|
||||
'search_view_id': id['res_id'],
|
||||
}
|
||||
|
||||
project_account_analytic_line()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_project_account_analytic_line_form" model="ir.ui.view">
|
||||
<field name="name">project.account.analytic.line.form</field>
|
||||
<field name="model">project.account.analytic.line</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="View Account Analytic Lines">
|
||||
<group colspan="4" >
|
||||
<field name="from_date"/>
|
||||
<newline/>
|
||||
<field name="to_date" />
|
||||
</group>
|
||||
<label string ="(Keep empty to open the current situation)" />
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-execute" string="Open Entries" name="action_open_window" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_project_account_analytic_line_form" model="ir.actions.act_window">
|
||||
<field name="name">Entries By Line</field>
|
||||
<field name="res_model">project.account.analytic.line</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_project_account_analytic_line_form"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,84 +0,0 @@
|
||||
# -*- 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 wizard
|
||||
import pooler
|
||||
import time
|
||||
from tools.translate import _
|
||||
|
||||
def _action_open_window(self, cr, uid, data, context):
|
||||
domain = []
|
||||
from_date = data['form']['from_date']
|
||||
to_date = data['form']['to_date']
|
||||
if from_date and to_date:
|
||||
domain = [('date','>=',from_date),('date','<=',to_date)]
|
||||
elif from_date:
|
||||
domain = [('date','>=',from_date)]
|
||||
elif to_date:
|
||||
domain = [('date','<=',to_date)]
|
||||
mod_obj = pooler.get_pool(cr.dbname).get('ir.model.data')
|
||||
result = mod_obj._get_id(cr, uid, 'account', 'view_account_analytic_line_filter')
|
||||
id = mod_obj.read(cr, uid, result, ['res_id'])
|
||||
|
||||
return {
|
||||
'name': _('Analytic Entries by line'),
|
||||
'view_type': 'form',
|
||||
"view_mode": 'tree,form',
|
||||
'res_model': 'account.analytic.line',
|
||||
'type': 'ir.actions.act_window',
|
||||
'domain': domain,
|
||||
'search_view_id': id['res_id'],}
|
||||
|
||||
|
||||
class account_analytic_line(wizard.interface):
|
||||
form1 = '''<?xml version="1.0"?>
|
||||
<form string="View Account Analytic Lines">
|
||||
<separator string="Account Analytic Lines Analysis" colspan="4"/>
|
||||
<field name="from_date"/>
|
||||
<newline/>
|
||||
<field name="to_date"/>
|
||||
<newline/>
|
||||
<label string=""/>
|
||||
<label string="(Keep empty to open the current situation)" align="0.0" colspan="3"/>
|
||||
</form>'''
|
||||
form1_fields = {
|
||||
'from_date': {
|
||||
'string': 'From',
|
||||
'type': 'date',
|
||||
},
|
||||
'to_date': {
|
||||
'string': 'To',
|
||||
'type': 'date',
|
||||
},
|
||||
}
|
||||
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type': 'form', 'arch':form1, 'fields':form1_fields, 'state': [('end', 'Cancel','gtk-cancel'),('open', 'Open Entries','gtk-ok')]}
|
||||
},
|
||||
'open': {
|
||||
'actions': [],
|
||||
'result': {'type': 'action', 'action': _action_open_window, 'state':'end'}
|
||||
}
|
||||
}
|
||||
account_analytic_line('account.analytic.line')
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
@@ -15,40 +15,36 @@
|
||||
# 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/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import wizard_automatic_reconcile
|
||||
import wizard_reconcile_select
|
||||
import wizard_unreconcile_select
|
||||
import account_move_line_reconcile_select
|
||||
import account_move_line_unreconcile_select
|
||||
import wizard_reconcile
|
||||
import wizard_unreconcile
|
||||
import wizard_refund
|
||||
import account_invoice_refund
|
||||
import wizard_pay_invoice
|
||||
|
||||
import wizard_journal
|
||||
import account_move_journal
|
||||
import wizard_journal_select
|
||||
import wizard_bank_reconcile
|
||||
import wizard_subscription_generate
|
||||
|
||||
import account_move_bank_reconcile
|
||||
import account_subscription_generate
|
||||
import wizard_aged_trial_balance
|
||||
import wizard_general_ledger_report
|
||||
import wizard_third_party_ledger
|
||||
import wizard_account_balance_report
|
||||
import wizard_partner_balance_report
|
||||
|
||||
import wizard_period_close
|
||||
import account_period_close
|
||||
import wizard_fiscalyear_close
|
||||
import wizard_fiscalyear_close_state
|
||||
import account_fiscalyear_close_state
|
||||
import wizard_open_closed_fiscalyear
|
||||
|
||||
import wizard_vat
|
||||
import wizard_compare_account_balance_report
|
||||
|
||||
import wizard_invoice_state
|
||||
import wizard_account_duplicate
|
||||
import wizard_account_chart
|
||||
import account_chart
|
||||
import wizard_move_line_select
|
||||
|
||||
import wizard_validate_account_move
|
||||
@@ -64,5 +60,4 @@ import wizard_change_currency
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
# -*- 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import tools
|
||||
|
||||
class account_chart(osv.osv_memory):
|
||||
"""
|
||||
For Chart of Accounrs
|
||||
"""
|
||||
_name = "account.chart"
|
||||
_description = "chart"
|
||||
_columns = {
|
||||
'fiscalyear': fields.many2one('account.fiscalyear', \
|
||||
'Fiscal year', \
|
||||
help = 'Keep empty for all open fiscal years'),
|
||||
'target_move': fields.selection([
|
||||
('all', 'All Entries'),
|
||||
('posted', 'All Posted Entries'),
|
||||
], 'Target Moves', required = True),
|
||||
|
||||
}
|
||||
def _get_defaults(self, cr, uid, context={}):
|
||||
"""Return default Fiscalyear value"""
|
||||
fiscalyear_obj = self.pool.get('account.fiscalyear')
|
||||
fiscalyear = fiscalyear_obj.find(cr, uid)
|
||||
return fiscalyear
|
||||
|
||||
def account_chart_open_window(self, cr, uid, ids, context={}):
|
||||
"""
|
||||
Opens chart of Accounts
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of account chart’s IDs
|
||||
@return: dictionary of Open account chart window on given fiscalyear and all Entries or posted entries
|
||||
"""
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
act_obj = self.pool.get('ir.actions.act_window')
|
||||
for data in self.read(cr, uid, ids,context=context):
|
||||
result = mod_obj._get_id(cr, uid, 'account', 'action_account_tree')
|
||||
id = mod_obj.read(cr, uid, [result], ['res_id'],context=context)[0]['res_id']
|
||||
result = act_obj.read(cr, uid, [id], context=context)[0]
|
||||
result['context'] = str({'fiscalyear': data['fiscalyear'], \
|
||||
'state': data['target_move']})
|
||||
if data['fiscalyear']:
|
||||
result['name'] += ':' + self.pool.get('account.fiscalyear').read(cr, uid, [data['fiscalyear']],context=context)[0]['code']
|
||||
return result
|
||||
|
||||
|
||||
_defaults = {
|
||||
'fiscalyear': _get_defaults,
|
||||
'target_move': lambda * a: 'all'
|
||||
}
|
||||
account_chart()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_account_chart" model="ir.ui.view">
|
||||
<field name="name">account.chart.form</field>
|
||||
<field name="model">account.chart</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Account charts">
|
||||
<group colspan="4" >
|
||||
<field name="fiscalyear"/>
|
||||
<label align="0.7" colspan="6" string="(If you do not select Fiscal year it will take all open fiscal years)"/>
|
||||
<field name="target_move"/>
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel" />
|
||||
<button icon="gtk-open" string="Open Charts"
|
||||
name="account_chart_open_window" type="object" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_chart" model="ir.actions.act_window">
|
||||
<field name="name">Chart of Accounts</field>
|
||||
<field name="res_model">account.chart</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_account_chart"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem icon="STOCK_INDENT" action="action_account_chart"
|
||||
id="menu_action_account_tree2"
|
||||
parent="account.menu_finance_charts" />
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,65 @@
|
||||
# -*- 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import tools
|
||||
|
||||
class account_fiscalyear_close_state(osv.osv_memory):
|
||||
"""
|
||||
Closes Account Fiscalyear
|
||||
"""
|
||||
_name = "account.fiscalyear.close.state"
|
||||
_description = "Fiscalyear Close state"
|
||||
_columns = {
|
||||
'fy_id': fields.many2one('account.fiscalyear', \
|
||||
'Fiscal Year to close', required=True),
|
||||
'sure': fields.boolean('Check this box', required=False)
|
||||
}
|
||||
|
||||
def data_save(self, cr, uid, ids, context={}):
|
||||
"""
|
||||
This function close account fiscalyear
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of Account fiscalyear close state’s IDs
|
||||
|
||||
"""
|
||||
for data in self.read(cr, uid, ids,context=context):
|
||||
if not data['sure']:
|
||||
raise osv.except_osv(_('UserError'), _('Closing of states \
|
||||
cancelled, please check the box !'))
|
||||
fy_id = data['fy_id']
|
||||
|
||||
cr.execute('UPDATE account_journal_period ' \
|
||||
'SET state = %s ' \
|
||||
'WHERE period_id IN (SELECT id FROM account_period \
|
||||
WHERE fiscalyear_id = %s)',
|
||||
('done', fy_id))
|
||||
cr.execute('UPDATE account_period SET state = %s ' \
|
||||
'WHERE fiscalyear_id = %s', ('done', fy_id))
|
||||
cr.execute('UPDATE account_fiscalyear ' \
|
||||
'SET state = %s WHERE id = %s', ('done', fy_id))
|
||||
return {}
|
||||
|
||||
account_fiscalyear_close_state()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_account_fiscalyear_close_state" model="ir.ui.view">
|
||||
<field name="name">account.fiscalyear.close.state.form</field>
|
||||
<field name="model">account.fiscalyear.close.state</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Close states of Fiscal year and periods">
|
||||
<group colspan="4" >
|
||||
<field name="fy_id" domain = "[('state','=','draft')]"/>
|
||||
<separator string="Are you sure you want to close the fiscal year ?" colspan="4"/>
|
||||
<field name="sure"/>
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-close" string="Close states" name="data_save" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_fiscalyear_close_state" model="ir.actions.act_window">
|
||||
<field name="name">Close a Fiscal Year</field>
|
||||
<field name="res_model">account.fiscalyear.close.state</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_account_fiscalyear_close_state"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_account_fiscalyear_close_state"
|
||||
id="menu_wizard_fy_close_state"
|
||||
parent="menu_account_end_year_treatments" />
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,191 @@
|
||||
# -*- 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import tools
|
||||
import netsvc
|
||||
|
||||
|
||||
class account_invoice_refund(osv.osv_memory):
|
||||
|
||||
"""Refunds invoice."""
|
||||
|
||||
_name = "account.invoice.refund"
|
||||
_description = "Invoice Refund"
|
||||
_columns = {
|
||||
'date': fields.date('Operation date', required=False),
|
||||
'period': fields.many2one('account.period', 'Force period', required=False),
|
||||
'description': fields.char('Description', size=150, required=True),
|
||||
}
|
||||
|
||||
def compute_refund(self, cr, uid, ids, mode, context={}):
|
||||
"""
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: the account invoice refund’s ID or list of IDs
|
||||
|
||||
"""
|
||||
inv_obj = self.pool.get('account.invoice')
|
||||
reconcile_obj = self.pool.get('account.move.reconcile')
|
||||
account_m_line_obj = self.pool.get('account.move.line')
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
act_obj = self.pool.get('ir.actions.act_window')
|
||||
for form in self.read(cr, uid, ids,context=context):
|
||||
created_inv = []
|
||||
date = False
|
||||
period = False
|
||||
description = False
|
||||
for inv in inv_obj.browse(cr, uid, context['active_ids'],context=context):
|
||||
if inv.state in ['draft', 'proforma2', 'cancel']:
|
||||
raise osv.except_osv(_('Error !'), _('Can not %s draft/proforma/cancel invoice.') % (mode))
|
||||
if form['period'] :
|
||||
period = form['period']
|
||||
else:
|
||||
period = inv.period_id and inv.period_id.id or False
|
||||
|
||||
if form['date'] :
|
||||
date = form['date']
|
||||
if not form['period'] :
|
||||
cr.execute("select name from ir_model_fields \
|
||||
where model = 'account.period' \
|
||||
and name = 'company_id'")
|
||||
result_query = cr.fetchone()
|
||||
if result_query:
|
||||
cr.execute("""SELECT id
|
||||
from account_period where date('%s')
|
||||
between date_start AND date_stop \
|
||||
and company_id = %s limit 1 """,
|
||||
(form['date'], self.pool.get('res.users').browse(cr, uid, uid,context=context).company_id.id,))
|
||||
else:
|
||||
cr.execute("""SELECT id
|
||||
from account_period where date('%s')
|
||||
between date_start AND date_stop \
|
||||
limit 1 """, (form['date'],))
|
||||
res = cr.fetchone()
|
||||
if res:
|
||||
period = res[0]
|
||||
else:
|
||||
date = inv.date_invoice
|
||||
|
||||
if form['description'] :
|
||||
description = form['description']
|
||||
else:
|
||||
description = inv.name
|
||||
|
||||
if not period:
|
||||
raise osv.except_osv(_('Data Insufficient !'), \
|
||||
_('No Period found on Invoice!'))
|
||||
|
||||
refund_id = inv_obj.refund(cr, uid, [inv.id], date, period, description)
|
||||
refund = inv_obj.browse(cr, uid, refund_id[0],context=context)
|
||||
inv_obj.write(cr, uid, [refund.id], {'date_due': date,
|
||||
'check_total': inv.check_total})
|
||||
inv_obj.button_compute(cr, uid, refund_id)
|
||||
|
||||
created_inv.append(refund_id[0])
|
||||
if mode in ('cancel', 'modify'):
|
||||
movelines = inv.move_id.line_id
|
||||
to_reconcile_ids = {}
|
||||
for line in movelines :
|
||||
if line.account_id.id == inv.account_id.id :
|
||||
to_reconcile_ids[line.account_id.id] = [line.id]
|
||||
if type(line.reconcile_id) != osv.orm.browse_null :
|
||||
reconcile_obj.unlink(cr, uid, line.reconcile_id.id)
|
||||
wf_service = netsvc.LocalService('workflow')
|
||||
wf_service.trg_validate(uid, 'account.invoice', \
|
||||
refund.id, 'invoice_open', cr)
|
||||
refund = inv_obj.browse(cr, uid, refund_id[0],context=context)
|
||||
for tmpline in refund.move_id.line_id :
|
||||
if tmpline.account_id.id == inv.account_id.id :
|
||||
to_reconcile_ids[tmpline.account_id.id].append(tmpline.id)
|
||||
for account in to_reconcile_ids :
|
||||
account_m_line_obj.reconcile(cr, uid, to_reconcile_ids[account],
|
||||
writeoff_period_id=period,
|
||||
writeoff_journal_id=inv.journal_id.id,
|
||||
writeoff_acc_id=inv.account_id.id
|
||||
)
|
||||
if mode == 'modify' :
|
||||
invoice = inv_obj.read(cr, uid, [inv.id],
|
||||
['name', 'type', 'number', 'reference',
|
||||
'comment', 'date_due', 'partner_id',
|
||||
'address_contact_id', 'address_invoice_id',
|
||||
'partner_insite', 'partner_contact',
|
||||
'partner_ref', 'payment_term', 'account_id',
|
||||
'currency_id', 'invoice_line', 'tax_line',
|
||||
'journal_id', 'period_id'],context=context)
|
||||
invoice = invoice[0]
|
||||
del invoice['id']
|
||||
invoice_lines = self.pool.get('account.invoice.line').read(cr, uid, invoice['invoice_line'],context=context)
|
||||
invoice_lines = inv_obj._refund_cleanup_lines(cr, uid, invoice_lines)
|
||||
tax_lines = self.pool.get('account.invoice.tax').read(
|
||||
cr, uid, invoice['tax_line'],context=context)
|
||||
tax_lines = inv_obj._refund_cleanup_lines(cr, uid, tax_lines)
|
||||
|
||||
invoice.update({
|
||||
'type': inv.type,
|
||||
'date_invoice': date,
|
||||
'state': 'draft',
|
||||
'number': False,
|
||||
'invoice_line': invoice_lines,
|
||||
'tax_line': tax_lines,
|
||||
'period_id': period,
|
||||
'name': description
|
||||
})
|
||||
|
||||
for field in ('address_contact_id', 'address_invoice_id', 'partner_id',
|
||||
'account_id', 'currency_id', 'payment_term', 'journal_id'):
|
||||
invoice[field] = invoice[field] and invoice[field][0]
|
||||
|
||||
inv_id = inv_obj.create(cr, uid, invoice, {})
|
||||
if inv.payment_term.id:
|
||||
data = inv_obj.onchange_payment_term_date_invoice(cr, uid, [inv_id], inv.payment_term.id, date)
|
||||
if 'value' in data and data['value']:
|
||||
inv_obj.write(cr, uid, [inv_id], data['value'])
|
||||
created_inv.append(inv_id)
|
||||
|
||||
if inv.type == 'out_invoice':
|
||||
xml_id = 'action_invoice_tree1'
|
||||
elif inv.type == 'in_invoice':
|
||||
xml_id = 'action_invoice_tree2'
|
||||
elif type == 'out_refund':
|
||||
xml_id = 'action_invoice_tree3'
|
||||
else:
|
||||
xml_id = 'action_invoice_tree4'
|
||||
result = mod_obj._get_id(cr, uid, 'account', xml_id)
|
||||
id = mod_obj.read(cr, uid, result, ['res_id'],context=context)['res_id']
|
||||
result = act_obj.read(cr, uid, id,context=context)
|
||||
result['res_id'] = created_inv
|
||||
|
||||
return result
|
||||
|
||||
def invoice_refund(self, cr, uid, ids, context={}):
|
||||
return self.compute_refund(cr, uid, ids, 'refund', context=context)
|
||||
|
||||
def invoice_cancel(self, cr, uid, ids, context={}):
|
||||
return self.compute_refund(cr, uid, ids, 'cancel', context=context)
|
||||
|
||||
def invoice_modify(self, cr, uid, ids, context={}):
|
||||
return self.compute_refund(cr, uid, ids, 'modify', context=context)
|
||||
|
||||
account_invoice_refund()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_account_invoice_refund" model="ir.ui.view">
|
||||
<field name="name">account.invoice.refund.form</field>
|
||||
<field name="model">account.invoice.refund</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Credit Note">
|
||||
<group colspan="4" >
|
||||
<label string="Are you sure you want to refund this invoice ?" colspan="2"/>
|
||||
<newline/>
|
||||
<field name="date"/>
|
||||
<field name="period"/>
|
||||
<field name="description"/>
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-redo" string="Refund Invoice" name="invoice_refund" type="object"/>
|
||||
<button icon="gtk-ok" string="Cancel Invoice" name="invoice_cancel" type="object"/>
|
||||
<button icon="gtk-undo" string="Modify Invoice" name="invoice_modify" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_invoice_refund" model="ir.actions.act_window">
|
||||
<field name="name">Credit Note</field>
|
||||
<field name="res_model">account.invoice.refund</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_account_invoice_refund"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<act_window id="action_account_invoice_refund"
|
||||
key2 = "client_action_multi" name="Credit Note"
|
||||
res_model="account.invoice.refund" src_model="account.invoice"
|
||||
view_mode="form" target="new" view_type="form" />
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,63 @@
|
||||
# -*- 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 tools
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
|
||||
|
||||
class account_move_bank_reconcile(osv.osv_memory):
|
||||
"""
|
||||
Bank Reconciliation
|
||||
"""
|
||||
_name = "account.move.bank.reconcile"
|
||||
_description = "Move bank reconcile"
|
||||
_columns = {
|
||||
'journal_id': fields.many2one('account.journal', 'Journal', required=True),
|
||||
}
|
||||
|
||||
def action_open_window(self, cr, uid, ids, context={}):
|
||||
"""
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: account move bank reconcile’s ID or list of IDs
|
||||
@return: dictionary of Open account move line on given journal_id.
|
||||
"""
|
||||
for data in self.read(cr, uid, ids,context=context):
|
||||
cr.execute('select default_credit_account_id \
|
||||
from account_journal where id=%s', (data['journal_id'],))
|
||||
account_id = cr.fetchone()[0]
|
||||
if not account_id:
|
||||
raise osv.except_osv(_('Error'), _('You have to define \
|
||||
the bank account\nin the journal definition for reconciliation.'))
|
||||
return {
|
||||
'domain': "[('journal_id','=',%d), ('account_id','=',%d), ('state','<>','draft')]" % (data['journal_id'], account_id),
|
||||
'name': _('Standard Encoding'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'account.move.line',
|
||||
'view_id': False,
|
||||
'context': "{'journal_id': %d}" % (data['journal_id'],),
|
||||
'type': 'ir.actions.act_window'
|
||||
}
|
||||
|
||||
account_move_bank_reconcile()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_account_move_bank_reconcile" model="ir.ui.view">
|
||||
<field name="name">account.move.bank.reconcile.form</field>
|
||||
<field name="model">account.move.bank.reconcile</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Bank reconciliation">
|
||||
<group colspan="4" >
|
||||
<field name="journal_id"/>
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-open" string="Open for bank reconciliation" name="action_open_window" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_bank_reconcile_tree" model="ir.actions.act_window">
|
||||
<field name="name">Bank reconciliation</field>
|
||||
<field name="res_model">account.move.bank.reconcile</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_account_move_bank_reconcile"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,98 @@
|
||||
# -*- 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import tools
|
||||
|
||||
class account_move_journal(osv.osv_memory):
|
||||
_name = "account.move.journal"
|
||||
_description = "Move journal"
|
||||
|
||||
_columns = {
|
||||
'journal_id': fields.many2one('account.journal', 'Journal', required=True),
|
||||
'period_id': fields.many2one('account.period', 'Period', required=True),
|
||||
}
|
||||
|
||||
|
||||
def _get_period(self, cr, uid, context={}):
|
||||
"""Return default account period value"""
|
||||
ids = self.pool.get('account.period').find(cr, uid, context=context)
|
||||
period_id = False
|
||||
if len(ids):
|
||||
period_id = ids[0]
|
||||
return period_id
|
||||
|
||||
def action_open_window(self, cr, uid, ids, context={}):
|
||||
"""
|
||||
This function Open action move line window on given period and Journal/Payment Mode
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: account move journal’s ID or list of IDs
|
||||
@return: dictionary of Open action move line window on given period and Journal/Payment Mode
|
||||
|
||||
"""
|
||||
jp = self.pool.get('account.journal.period')
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
for data in self.read(cr, uid, ids, ['journal_id', 'period_id'],context=context):
|
||||
cr.execute('select id,name from ir_ui_view where model=%s and type=%s', ('account.move.line', 'form'))
|
||||
view_res = cr.fetchone()
|
||||
journal_id = data['journal_id']
|
||||
period_id = data['period_id']
|
||||
|
||||
ids = jp.search(cr, uid, [('journal_id', '=', journal_id), \
|
||||
('period_id', '=', period_id)],context=context)
|
||||
|
||||
if not len(ids):
|
||||
name = self.pool.get('account.journal').read(cr, uid, [journal_id])[0]['name']
|
||||
state = self.pool.get('account.period').read(cr, uid, [period_id])[0]['state']
|
||||
if state == 'done':
|
||||
raise osv.except_osv(_('UserError'), _('This period is already closed !'))
|
||||
company = self.pool.get('account.period').read(cr, uid, [period_id])[0]['company_id'][0]
|
||||
jp.create(cr, uid, {'name': name, 'period_id': period_id, 'journal_id': journal_id, 'company_id': company},context=context)
|
||||
|
||||
ids = jp.search(cr, uid, [('journal_id', '=', journal_id), ('period_id', '=', period_id)],context=context)
|
||||
jp = jp.browse(cr, uid, ids, context=context)[0]
|
||||
name = (jp.journal_id.code or '') + ':' + (jp.period_id.code or '')
|
||||
|
||||
result = mod_obj._get_id(cr, uid, 'account', 'view_account_move_line_filter')
|
||||
res = mod_obj.read(cr, uid, result, ['res_id'],context=context)
|
||||
|
||||
return {
|
||||
'domain': "[('journal_id','=',%d), ('period_id','=',%d)]" % (journal_id, period_id),
|
||||
'name': name,
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'account.move.line',
|
||||
'view_id': view_res,
|
||||
'context': "{'journal_id': %d, 'period_id': %d}" % (journal_id, period_id),
|
||||
'type': 'ir.actions.act_window',
|
||||
'search_view_id': res['res_id']
|
||||
}
|
||||
|
||||
|
||||
_defaults = {
|
||||
'period_id': _get_period
|
||||
}
|
||||
|
||||
account_move_journal()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_account_move_journal_form" model="ir.ui.view">
|
||||
<field name="name">account.move.journal.form</field>
|
||||
<field name="model">account.move.journal</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Standard entries">
|
||||
<group colspan="4" >
|
||||
<field name="journal_id"/>
|
||||
<newline/>
|
||||
<field name="period_id" />
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-open" string="Open Journal" name="action_open_window" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_move_journal_line_form" model="ir.actions.act_window">
|
||||
<field name="name">Entries by Line</field>
|
||||
<field name="res_model">account.move.journal</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_account_move_journal_form"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem icon="STOCK_JUSTIFY_FILL"
|
||||
action="action_account_move_journal_line_form"
|
||||
id="menu_action_move_journal_line_form"
|
||||
parent="account.menu_finance_entries" sequence="5" />
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,58 @@
|
||||
# -*- 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import tools
|
||||
|
||||
|
||||
class account_move_line_reconcile_select(osv.osv_memory):
|
||||
_name = "account.move.line.reconcile.select"
|
||||
_description = "Move line reconcile select"
|
||||
_columns = {
|
||||
'account_id': fields.many2one('account.account', 'Account', \
|
||||
domain = [('reconcile', '=', 1)], required=True),
|
||||
}
|
||||
|
||||
def action_open_window(self, cr, uid, ids, context={}):
|
||||
"""
|
||||
This function Open account move line window for reconcile on given account id
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: account move line reconcile select’s ID or list of IDs
|
||||
@return: dictionary of Open account move line window for reconcile on given account id
|
||||
|
||||
"""
|
||||
for data in self.read(cr, uid, ids,context=context):
|
||||
|
||||
return {
|
||||
'domain': "[('account_id','=',%d),('reconcile_id','=',False),('state','<>','draft')]" % data['account_id'],
|
||||
'name': _('Reconciliation'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'view_id': False,
|
||||
'res_model': 'account.move.line',
|
||||
'type': 'ir.actions.act_window'
|
||||
}
|
||||
|
||||
account_move_line_reconcile_select()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_account_move_line_reconcile_select" model="ir.ui.view">
|
||||
<field name="name">account.move.line.reconcile.select.form</field>
|
||||
<field name="model">account.move.line.reconcile.select</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Reconciliation">
|
||||
<group colspan="4" >
|
||||
<field name="account_id"/>
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel" />
|
||||
<button icon="gtk-open"
|
||||
string="Open for reconciliation" name="action_open_window"
|
||||
type="object" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_reconcile_select" model="ir.actions.act_window">
|
||||
<field name="name">Reconcile entries</field>
|
||||
<field name="res_model">account.move.line.reconcile.select</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_account_move_line_reconcile_select"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="next_id_20" name="Reconciliation"
|
||||
parent="menu_finance_periodical_processing" />
|
||||
|
||||
<menuitem action="action_account_reconcile_select"
|
||||
id="menu_reconcile_select" parent="account.next_id_20" />
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
+26
-35
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
@@ -15,47 +15,38 @@
|
||||
# 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/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import wizard
|
||||
import netsvc
|
||||
import pooler
|
||||
#field name="confirm_en"/>
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import tools
|
||||
|
||||
take_form = """<?xml version="1.0"?>
|
||||
<form title="Confirm">
|
||||
<separator string="Confirmation enable taken away" colspan="4"/>
|
||||
<newline/>
|
||||
</form>
|
||||
"""
|
||||
|
||||
take_fields = {
|
||||
'confirm_en': {'string':'Catalog Number', 'type':'integer'},
|
||||
}
|
||||
class account_move_line_unreconcile_select(osv.osv_memory):
|
||||
|
||||
def _confirm_enable(self,cr,uid,data,context={}):
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
pool.get('auction.lots').write(cr,uid,data['ids'],{'ach_emp':False})
|
||||
return {}
|
||||
_name = "account.move.line.unreconcile.select"
|
||||
_description = "Unreconciliation"
|
||||
_columns ={
|
||||
'account_id': fields.many2one('account.account','Account',required=True),
|
||||
|
||||
}
|
||||
|
||||
def action_open_window(self, cr, uid, ids, context={}):
|
||||
for data in self.read(cr, uid, ids):
|
||||
return {
|
||||
'domain': "[('account_id','=',%d),('reconcile_id','<>',False),('state','<>','draft')]" % data['account_id'],
|
||||
'name': 'Unreconciliation',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'view_id': False,
|
||||
'res_model': 'account.move.line',
|
||||
'type': 'ir.actions.act_window'
|
||||
}
|
||||
|
||||
account_move_line_unreconcile_select()
|
||||
|
||||
class enable_take_away(wizard.interface):
|
||||
states = {
|
||||
'init' : {
|
||||
'actions' : [],
|
||||
'result' : {
|
||||
'type' : 'form',
|
||||
'arch' : take_form,
|
||||
'fields' : take_fields,
|
||||
'state' : [ ('end', 'Cancel'),('go', 'Enable Taken away')]}
|
||||
},
|
||||
'go' : {
|
||||
'actions' : [_confirm_enable],
|
||||
'result' : {'type' : 'state', 'state' : 'end'}
|
||||
},
|
||||
}
|
||||
enable_take_away('auction.lots.enable')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_account_move_line_unreconcile_select" model="ir.ui.view">
|
||||
<field name="name">account.move.line.unreconcile.select.form</field>
|
||||
<field name="model">account.move.line.unreconcile.select</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Unreconciliation">
|
||||
<group colspan="4" >
|
||||
<field name="account_id"/>
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel" />
|
||||
<button icon="gtk-open"
|
||||
string="Open for Unreconciliation" name="action_open_window"
|
||||
type="object" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_unreconcile_select" model="ir.actions.act_window">
|
||||
<field name="name">Unreconcile entries</field>
|
||||
<field name="res_model">account.move.line.unreconcile.select</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_account_move_line_unreconcile_select"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_account_unreconcile_select"
|
||||
id="menu_unreconcile_select" parent="account.next_id_20" />
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,54 @@
|
||||
# -*- 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import tools
|
||||
|
||||
class account_period_close(osv.osv_memory):
|
||||
"""
|
||||
close period
|
||||
"""
|
||||
_name = "account.period.close"
|
||||
_description = "period close"
|
||||
_columns = {
|
||||
'sure': fields.boolean('Check this box', required=False),
|
||||
}
|
||||
|
||||
def data_save(self, cr, uid, ids, context={}):
|
||||
"""
|
||||
This function close period
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: account period close’s ID or list of IDs
|
||||
"""
|
||||
|
||||
mode = 'done'
|
||||
for form in self.read(cr, uid, ids,context=context):
|
||||
if form['sure']:
|
||||
for id in context['active_ids']:
|
||||
cr.execute('update account_journal_period set state=%s where period_id=%s', (mode, id))
|
||||
cr.execute('update account_period set state=%s where id=%s', (mode, id))
|
||||
return {}
|
||||
|
||||
account_period_close()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_account_period_close" model="ir.ui.view">
|
||||
<field name="name">account.period.close.form</field>
|
||||
<field name="model">account.period.close</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Close Period">
|
||||
<group colspan="4" >
|
||||
<separator string="Are you sure ?" colspan="4"/>
|
||||
<field name="sure"/>
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-close" string="Close Period" name="data_save" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_period_close" model="ir.actions.act_window">
|
||||
<field name="name">Close a Period</field>
|
||||
<field name="res_model">account.period.close</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_account_period_close"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<record id="action_idea_post_vote_values" model="ir.values">
|
||||
<field name="model_id" ref="model_account_period" />
|
||||
<field name="object" eval="1" />
|
||||
<field name="name"></field>
|
||||
<field name="key2">client_action_multi</field>
|
||||
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_period_close'))"/>
|
||||
<field name="key">action</field>
|
||||
<field name="model">account.period</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,43 @@
|
||||
# -*- 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 osv import fields, osv
|
||||
|
||||
class account_subscription_generate(osv.osv_memory):
|
||||
|
||||
_name = "account.subscription.generate"
|
||||
_description = "Subscription Compute"
|
||||
_columns = {
|
||||
'date': fields.date('Date', required=True),
|
||||
}
|
||||
_defaults = {
|
||||
'date': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
}
|
||||
def action_generate(self, cr, uid, ids, context={}):
|
||||
for data in self.read(cr, uid, ids, context=context):
|
||||
cr.execute('select id from account_subscription_line where date<%s and move_id is null', (data['date'],))
|
||||
ids = map(lambda x: x[0], cr.fetchall())
|
||||
self.pool.get('account.subscription.line').move_create(cr, uid, ids, context=context)
|
||||
return {}
|
||||
|
||||
account_subscription_generate()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_account_subscription_generate" model="ir.ui.view">
|
||||
<field name="name">account.subscription.generate.form</field>
|
||||
<field name="model">account.subscription.generate</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Subscription Compute">
|
||||
<group colspan="4" >
|
||||
<separator string="Generate entries before:" colspan="4"/>
|
||||
<field name="date"/>
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel" />
|
||||
<button icon="gtk-execute" string="Compute Entry Dates"
|
||||
name="action_generate" type="object" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_subscription_generate" model="ir.actions.act_window">
|
||||
<field name="name">Create Subscription Entries</field>
|
||||
<field name="res_model">account.subscription.generate</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_account_subscription_generate"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_account_subscription_generate" id="menu_generate_subscription" parent="account.menu_finance_periodical_processing" />
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,80 +0,0 @@
|
||||
# -*- 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 wizard
|
||||
import pooler
|
||||
|
||||
class wizard_account_chart(wizard.interface):
|
||||
_account_chart_arch = '''<?xml version="1.0"?>
|
||||
<form string="Open account charts">
|
||||
<field name="fiscalyear"/>
|
||||
<label align="0.7" colspan="6" string="(If you do not select Fiscal year it will take all open fiscal years)"/>
|
||||
<field name="target_move"/>
|
||||
</form>'''
|
||||
|
||||
_account_chart_fields = {
|
||||
'fiscalyear': {
|
||||
'string': 'Fiscal year',
|
||||
'type': 'many2one',
|
||||
'relation': 'account.fiscalyear',
|
||||
'help': 'Keep empty for all open fiscal years',
|
||||
},
|
||||
'target_move': {
|
||||
'string': 'Target Moves',
|
||||
'type': 'selection',
|
||||
'selection': [('all','All Entries'),('posted','All Posted Entries')],
|
||||
'required': True,
|
||||
'default': lambda *a:"all",
|
||||
},
|
||||
}
|
||||
|
||||
def _get_defaults(self, cr, uid, data, context):
|
||||
fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
|
||||
data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
|
||||
return data['form']
|
||||
|
||||
|
||||
def _account_chart_open_window(self, cr, uid, data, context):
|
||||
mod_obj = pooler.get_pool(cr.dbname).get('ir.model.data')
|
||||
act_obj = pooler.get_pool(cr.dbname).get('ir.actions.act_window')
|
||||
|
||||
result = mod_obj._get_id(cr, uid, 'account', 'action_account_tree')
|
||||
id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
|
||||
result = act_obj.read(cr, uid, [id], context=context)[0]
|
||||
result['context'] = str({'fiscalyear': data['form']['fiscalyear'],'state':data['form']['target_move']})
|
||||
if data['form']['fiscalyear']:
|
||||
result['name']+=':'+pooler.get_pool(cr.dbname).get('account.fiscalyear').read(cr,uid,[data['form']['fiscalyear']])[0]['code']
|
||||
return result
|
||||
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [_get_defaults],
|
||||
'result': {'type': 'form', 'arch':_account_chart_arch, 'fields':_account_chart_fields, 'state': [('end', 'Cancel', 'gtk-cancel'), ('open', 'Open', 'gtk-ok')]}
|
||||
},
|
||||
'open': {
|
||||
'actions': [],
|
||||
'result': {'type': 'action', 'action':_account_chart_open_window, 'state':'end'}
|
||||
}
|
||||
}
|
||||
wizard_account_chart('account.chart')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
# -*- 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 wizard
|
||||
from tools.translate import _
|
||||
|
||||
_journal_form = '''<?xml version="1.0"?>
|
||||
<form string="%s">
|
||||
<field name="journal_id"/>
|
||||
</form>''' % ('Open Bank reconciliation',)
|
||||
|
||||
_journal_fields = {
|
||||
'journal_id': {'string':'Journal', 'type':'many2one', 'relation':'account.journal', 'required':True},
|
||||
}
|
||||
|
||||
def _action_open_window(self, cr, uid, data, context):
|
||||
form = data['form']
|
||||
cr.execute('select default_credit_account_id from account_journal where id=%s', (form['journal_id'],))
|
||||
account_id = cr.fetchone()[0]
|
||||
if not account_id:
|
||||
raise wizard.except_wizard(_('Error'), _('You have to define the bank account\nin the journal definition for reconciliation.'))
|
||||
return {
|
||||
'domain': "[('journal_id','=',%d), ('account_id','=',%d), ('state','<>','draft')]" % (form['journal_id'],account_id),
|
||||
'name': _('Standard Encoding'),
|
||||
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'account.move.line',
|
||||
'view_id': False,
|
||||
'context': "{'journal_id':%d}" % (form['journal_id'],),
|
||||
'type': 'ir.actions.act_window'
|
||||
}
|
||||
|
||||
class wiz_journal(wizard.interface):
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type': 'form', 'arch':_journal_form, 'fields':_journal_fields, 'state':[('end','Cancel', 'gtk-cancel'),('open','Open', 'gtk-ok')]}
|
||||
},
|
||||
'open': {
|
||||
'actions': [],
|
||||
'result': {'type': 'action', 'action': _action_open_window, 'state':'end'}
|
||||
}
|
||||
}
|
||||
wiz_journal('account.move.bank.reconcile')
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
# -*- 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 wizard
|
||||
import osv
|
||||
import pooler
|
||||
from tools.translate import _
|
||||
|
||||
_transaction_form = '''<?xml version="1.0"?>
|
||||
<form string=" Close states of Fiscal year and periods">
|
||||
<field name="fy_id"/>
|
||||
<separator string="Are you sure you want to close the fiscal year ?" colspan="4"/>
|
||||
<field name="sure"/>
|
||||
</form>'''
|
||||
|
||||
_transaction_fields = {
|
||||
'fy_id': {'string':'Fiscal Year to close', 'type':'many2one', 'relation': 'account.fiscalyear','required':True, 'domain':[('state','=','draft')]},
|
||||
'sure': {'string':'Check this box', 'type':'boolean'},
|
||||
}
|
||||
|
||||
def _data_save(self, cr, uid, data, context):
|
||||
if not data['form']['sure']:
|
||||
raise wizard.except_wizard(_('UserError'), _('Closing of states cancelled, please check the box !'))
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
|
||||
fy_id = data['form']['fy_id']
|
||||
|
||||
cr.execute('UPDATE account_journal_period ' \
|
||||
'SET state = %s ' \
|
||||
'WHERE period_id IN (SELECT id FROM account_period WHERE fiscalyear_id = %s)',
|
||||
('done',fy_id))
|
||||
cr.execute('UPDATE account_period SET state = %s ' \
|
||||
'WHERE fiscalyear_id = %s', ('done',fy_id))
|
||||
cr.execute('UPDATE account_fiscalyear ' \
|
||||
'SET state = %s WHERE id = %s', ('done', fy_id))
|
||||
return {}
|
||||
|
||||
class wiz_journal_close_state(wizard.interface):
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type': 'form', 'arch':_transaction_form, 'fields':_transaction_fields, 'state':[('end','Cancel', 'gtk-cancel'),('close','Close states', 'gtk-ok')]}
|
||||
},
|
||||
'close': {
|
||||
'actions': [_data_save],
|
||||
'result': {'type': 'state', 'state':'end'}
|
||||
}
|
||||
}
|
||||
wiz_journal_close_state('account.fiscalyear.close.state')
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
# -*- 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 wizard
|
||||
from osv import osv
|
||||
import pooler
|
||||
from tools.translate import _
|
||||
|
||||
_journal_form = '''<?xml version="1.0"?>
|
||||
<form string="Standard entries">
|
||||
<field name="journal_id"/>
|
||||
<newline/>
|
||||
<field name="period_id"/>
|
||||
</form>'''
|
||||
|
||||
def _period_get(self, cr, uid, datas, ctx={}):
|
||||
try:
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
ids = pool.get('account.period').find(cr, uid, context=ctx)
|
||||
return {'period_id': ids[0]}
|
||||
except:
|
||||
return {}
|
||||
|
||||
_journal_fields = {
|
||||
'journal_id': {'string':'Journal', 'type':'many2one', 'relation':'account.journal', 'required':True},
|
||||
'period_id': {
|
||||
'string':'Period',
|
||||
'type':'many2one',
|
||||
'relation':'account.period',
|
||||
'required':True,
|
||||
}
|
||||
}
|
||||
|
||||
def _action_open_window(self, cr, uid, data, context):
|
||||
form = data['form']
|
||||
cr.execute('select id,name from ir_ui_view where model=%s and type=%s', ('account.move.line', 'form'))
|
||||
view_res = cr.fetchone()
|
||||
jp = pooler.get_pool(cr.dbname).get('account.journal.period')
|
||||
ids = jp.search(cr, uid, [('journal_id','=',form['journal_id']), ('period_id','=',form['period_id'])])
|
||||
if not len(ids):
|
||||
name = pooler.get_pool(cr.dbname).get('account.journal').read(cr, uid, [form['journal_id']])[0]['name']
|
||||
state = pooler.get_pool(cr.dbname).get('account.period').read(cr, uid, [form['period_id']])[0]['state']
|
||||
if state == 'done':
|
||||
raise wizard.except_wizard(_('UserError'), _('This period is already closed !'))
|
||||
company = pooler.get_pool(cr.dbname).get('account.period').read(cr, uid, [form['period_id']])[0]['company_id'][0]
|
||||
jp.create(cr, uid, {'name':name, 'period_id': form['period_id'], 'journal_id':form['journal_id'], 'company_id':company})
|
||||
ids = jp.search(cr, uid, [('journal_id','=',form['journal_id']), ('period_id','=',form['period_id'])])
|
||||
jp = jp.browse(cr, uid, ids, context=context)[0]
|
||||
name = (jp.journal_id.code or '') + ':' + (jp.period_id.code or '')
|
||||
|
||||
mod_obj = pooler.get_pool(cr.dbname).get('ir.model.data')
|
||||
result = mod_obj._get_id(cr, uid, 'account', 'view_account_move_line_filter')
|
||||
id = mod_obj.read(cr, uid, result, ['res_id'])
|
||||
return {
|
||||
'domain': "[('journal_id','=',%d), ('period_id','=',%d)]" % (form['journal_id'],form['period_id']),
|
||||
'name': name,
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'account.move.line',
|
||||
'view_id': view_res,
|
||||
'context': "{'journal_id':%d, 'period_id':%d}" % (form['journal_id'],form['period_id']),
|
||||
'type': 'ir.actions.act_window',
|
||||
'search_view_id': id['res_id']
|
||||
}
|
||||
|
||||
class wiz_journal(wizard.interface):
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [_period_get],
|
||||
'result': {'type': 'form', 'arch':_journal_form, 'fields':_journal_fields, 'state':[('end','Cancel', 'gtk-cancel'),('open','Open Journal', 'gtk-ok')]}
|
||||
},
|
||||
'open': {
|
||||
'actions': [],
|
||||
'result': {'type': 'action', 'action': _action_open_window, 'state':'end'}
|
||||
}
|
||||
}
|
||||
wiz_journal('account.move.journal')
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
# -*- 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 wizard
|
||||
|
||||
_transaction_form = '''<?xml version="1.0"?>
|
||||
<form string="Close Period">
|
||||
<separator string="Are you sure ?" colspan="4"/>
|
||||
<field name="sure"/>
|
||||
</form>'''
|
||||
|
||||
_transaction_fields = {
|
||||
'sure': {'string':'Check this box', 'type':'boolean'},
|
||||
}
|
||||
|
||||
def _data_save(self, cr, uid, data, context):
|
||||
mode = 'done'
|
||||
if data['form']['sure']:
|
||||
for id in data['ids']:
|
||||
cr.execute('update account_journal_period set state=%s where period_id=%s', (mode, id))
|
||||
cr.execute('update account_period set state=%s where id=%s', (mode, id))
|
||||
return {}
|
||||
|
||||
class wiz_journal_close(wizard.interface):
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type': 'form', 'arch':_transaction_form, 'fields':_transaction_fields, 'state':[('end','Cancel', 'gtk-cancel'),('close','Close Period', 'gtk-ok')]}
|
||||
},
|
||||
'close': {
|
||||
'actions': [_data_save],
|
||||
'result': {'type': 'state', 'state':'end'}
|
||||
}
|
||||
}
|
||||
wiz_journal_close('account.period.close')
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
# -*- 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 wizard
|
||||
from tools.translate import _
|
||||
|
||||
|
||||
_journal_form = '''<?xml version="1.0"?>
|
||||
<form string="%s">
|
||||
<field name="account_id"/>
|
||||
</form>''' % ('Reconciliation',)
|
||||
|
||||
_journal_fields = {
|
||||
'account_id': {'string':'Account', 'type':'many2one', 'relation':'account.account','domain': [('reconcile','=',1)], 'required':True},
|
||||
}
|
||||
|
||||
def _action_open_window(self, cr, uid, data, context):
|
||||
return {
|
||||
'domain': "[('account_id','=',%d),('reconcile_id','=',False),('state','<>','draft')]" % data['form']['account_id'],
|
||||
'name': _('Reconciliation'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'view_id': False,
|
||||
'res_model': 'account.move.line',
|
||||
'type': 'ir.actions.act_window'
|
||||
}
|
||||
|
||||
class wiz_rec_select(wizard.interface):
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type': 'form', 'arch':_journal_form, 'fields':_journal_fields, 'state':[('end','Cancel'),('open','Open for reconciliation')]}
|
||||
},
|
||||
'open': {
|
||||
'actions': [],
|
||||
'result': {'type': 'action', 'action': _action_open_window, 'state':'end'}
|
||||
}
|
||||
}
|
||||
wiz_rec_select('account.move.line.reconcile.select')
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -1,226 +0,0 @@
|
||||
# -*- 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 wizard
|
||||
import pooler
|
||||
import osv
|
||||
import netsvc
|
||||
import time
|
||||
from tools.translate import _
|
||||
|
||||
sur_form = '''<?xml version="1.0"?>
|
||||
<form string="Credit Note">
|
||||
<label string="Are you sure you want to refund this invoice ?" colspan="2"/>
|
||||
<newline />
|
||||
<field name="date" />
|
||||
<field name="period" />
|
||||
<field name="description" width="150" />
|
||||
</form>'''
|
||||
|
||||
sur_fields = {
|
||||
'date': {'string':'Operation date','type':'date', 'required':'False'},
|
||||
'period':{'string': 'Force period', 'type': 'many2one',
|
||||
'relation': 'account.period', 'required': False},
|
||||
'description':{'string':'Description', 'type':'char', 'required':'True'},
|
||||
}
|
||||
|
||||
|
||||
class wiz_refund(wizard.interface):
|
||||
|
||||
def _invoice_refund(self, cr, uid, data, context):
|
||||
return self._compute_refund(cr, uid, data, 'refund', context)
|
||||
|
||||
def _invoice_cancel(self, cr, uid, data, context):
|
||||
return self._compute_refund(cr, uid, data, 'cancel', context)
|
||||
|
||||
def _invoice_modify(self, cr, uid, data, context):
|
||||
return self._compute_refund(cr, uid, data, 'modify', context)
|
||||
|
||||
def _compute_refund(self, cr, uid, data, mode, context):
|
||||
form = data['form']
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
reconcile_obj = pool.get('account.move.reconcile')
|
||||
account_m_line_obj = pool.get('account.move.line')
|
||||
created_inv = []
|
||||
date = False
|
||||
period = False
|
||||
description = False
|
||||
for inv in pool.get('account.invoice').browse(cr, uid, data['ids']):
|
||||
if inv.state in ['draft', 'proforma2', 'cancel']:
|
||||
raise wizard.except_wizard(_('Error !'), _('Can not %s draft/proforma/cancel invoice.') % (mode))
|
||||
if form['period'] :
|
||||
period = form['period']
|
||||
else:
|
||||
period = inv.period_id and inv.period_id.id or False
|
||||
|
||||
if form['date'] :
|
||||
date = form['date']
|
||||
if not form['period'] :
|
||||
cr.execute("select name from ir_model_fields where model='account.period' and name='company_id'")
|
||||
result_query = cr.fetchone()
|
||||
if result_query:
|
||||
#in multi company mode
|
||||
cr.execute("""SELECT id
|
||||
from account_period where date('%s')
|
||||
between date_start AND date_stop and company_id = %s limit 1 """,
|
||||
(form['date'],pool.get('res.users').browse(cr,uid,uid).company_id.id,))
|
||||
else:
|
||||
#in mono company mode
|
||||
cr.execute("""SELECT id
|
||||
from account_period where date('%s')
|
||||
between date_start AND date_stop limit 1 """,
|
||||
(form['date'],))
|
||||
res = cr.fetchone()
|
||||
if res:
|
||||
period = res[0]
|
||||
else:
|
||||
date = inv.date_invoice
|
||||
|
||||
if form['description'] :
|
||||
description = form['description']
|
||||
else:
|
||||
description = inv.name
|
||||
|
||||
if not period:
|
||||
raise wizard.except_wizard(_('Data Insufficient !'), _('No Period found on Invoice!'))
|
||||
|
||||
refund_id = pool.get('account.invoice').refund(cr, uid, [inv.id],date, period, description)
|
||||
refund = pool.get('account.invoice').browse(cr, uid, refund_id[0])
|
||||
# we compute due date
|
||||
#!!!due date = date inv date on formdate
|
||||
pool.get('account.invoice').write(cr, uid, [refund.id],{'date_due':date,'check_total':inv.check_total})
|
||||
# to make the taxes calculated
|
||||
pool.get('account.invoice').button_compute(cr, uid, refund_id)
|
||||
|
||||
created_inv.append(refund_id[0])
|
||||
#if inv is paid we unreconcile
|
||||
if mode in ('cancel','modify'):
|
||||
movelines = inv.move_id.line_id
|
||||
#we unreconcile the lines
|
||||
to_reconcile_ids = {}
|
||||
for line in movelines :
|
||||
#if the account of the line is the as the one in the invoice
|
||||
#we reconcile
|
||||
if line.account_id.id == inv.account_id.id :
|
||||
to_reconcile_ids[line.account_id.id] =[line.id]
|
||||
if type(line.reconcile_id) != osv.orm.browse_null :
|
||||
reconcile_obj.unlink(cr,uid, line.reconcile_id.id)
|
||||
#we advance the workflow of the refund to open
|
||||
wf_service = netsvc.LocalService('workflow')
|
||||
wf_service.trg_validate(uid, 'account.invoice', refund.id, 'invoice_open', cr)
|
||||
#we reload the browse record
|
||||
refund = pool.get('account.invoice').browse(cr, uid, refund_id[0])
|
||||
#we match the line to reconcile
|
||||
for tmpline in refund.move_id.line_id :
|
||||
if tmpline.account_id.id == inv.account_id.id :
|
||||
to_reconcile_ids[tmpline.account_id.id].append(tmpline.id)
|
||||
for account in to_reconcile_ids :
|
||||
account_m_line_obj.reconcile(cr, uid, to_reconcile_ids[account],
|
||||
writeoff_period_id=period,
|
||||
writeoff_journal_id=inv.journal_id.id,
|
||||
writeoff_acc_id=inv.account_id.id
|
||||
)
|
||||
#we create a new invoice that is the copy of the original
|
||||
if mode == 'modify' :
|
||||
invoice = pool.get('account.invoice').read(cr, uid, [inv.id],
|
||||
['name', 'type', 'number', 'reference',
|
||||
'comment', 'date_due', 'partner_id', 'address_contact_id',
|
||||
'address_invoice_id', 'partner_insite','partner_contact',
|
||||
'partner_ref', 'payment_term', 'account_id', 'currency_id',
|
||||
'invoice_line', 'tax_line', 'journal_id','period_id'
|
||||
]
|
||||
)
|
||||
invoice = invoice[0]
|
||||
del invoice['id']
|
||||
invoice_lines = pool.get('account.invoice.line').read(cr, uid, invoice['invoice_line'])
|
||||
invoice_lines = pool.get('account.invoice')._refund_cleanup_lines(cr, uid, invoice_lines)
|
||||
tax_lines = pool.get('account.invoice.tax').read(
|
||||
cr, uid, invoice['tax_line'])
|
||||
tax_lines = pool.get('account.invoice')._refund_cleanup_lines(cr, uid, tax_lines)
|
||||
|
||||
invoice.update({
|
||||
'type': inv.type,
|
||||
'date_invoice': date,
|
||||
'state': 'draft',
|
||||
'number': False,
|
||||
'invoice_line': invoice_lines,
|
||||
'tax_line': tax_lines,
|
||||
'period_id': period,
|
||||
'name':description
|
||||
})
|
||||
|
||||
#take the id part of the tuple returned for many2one fields
|
||||
for field in ('address_contact_id', 'address_invoice_id', 'partner_id',
|
||||
'account_id', 'currency_id', 'payment_term', 'journal_id'):
|
||||
invoice[field] = invoice[field] and invoice[field][0]
|
||||
|
||||
# create the new invoice
|
||||
inv_id = pool.get('account.invoice').create(cr, uid, invoice,{})
|
||||
# we compute due date
|
||||
if inv.payment_term.id:
|
||||
data = pool.get('account.invoice').onchange_payment_term_date_invoice(cr, uid, [inv_id],inv.payment_term.id,date)
|
||||
if 'value' in data and data['value']:
|
||||
pool.get('account.invoice').write(cr, uid, [inv_id],data['value'])
|
||||
created_inv.append(inv_id)
|
||||
|
||||
#we get the view id
|
||||
mod_obj = pool.get('ir.model.data')
|
||||
act_obj = pool.get('ir.actions.act_window')
|
||||
if inv.type == 'out_invoice':
|
||||
xml_id = 'action_invoice_tree5'
|
||||
elif inv.type == 'in_invoice':
|
||||
xml_id = 'action_invoice_tree8'
|
||||
elif type == 'out_refund':
|
||||
xml_id = 'action_invoice_tree10'
|
||||
else:
|
||||
xml_id = 'action_invoice_tree12'
|
||||
#we get the model
|
||||
result = mod_obj._get_id(cr, uid, 'account', xml_id)
|
||||
id = mod_obj.read(cr, uid, result, ['res_id'])['res_id']
|
||||
# we read the act window
|
||||
result = act_obj.read(cr, uid, id)
|
||||
result['res_id'] = created_inv
|
||||
|
||||
return result
|
||||
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type':'form', 'arch':sur_form, 'fields':sur_fields, 'state':[('end','Cancel'),('refund','Refund Invoice'),('cancel_invoice','Cancel Invoice'),('modify_invoice','Modify Invoice')]}
|
||||
},
|
||||
'refund': {
|
||||
'actions': [],
|
||||
'result': {'type':'action', 'action':_invoice_refund, 'state':'end'},
|
||||
},
|
||||
'cancel_invoice': {
|
||||
'actions': [],
|
||||
'result': {'type':'action', 'action':_invoice_cancel, 'state':'end'},
|
||||
},
|
||||
'modify_invoice': {
|
||||
'actions': [],
|
||||
'result': {'type':'action', 'action':_invoice_modify, 'state':'end'},
|
||||
},
|
||||
|
||||
}
|
||||
wiz_refund('account.invoice.refund')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
# -*- 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
|
||||
import wizard
|
||||
import pooler
|
||||
|
||||
#
|
||||
# TODO: add an intermediate screen for checks
|
||||
#
|
||||
|
||||
_subscription_form = '''<?xml version="1.0"?>
|
||||
<form string="%s">
|
||||
<separator string="Generate entries before:" colspan="4"/>
|
||||
<field name="date"/>
|
||||
</form>''' % ('Subscription Compute',)
|
||||
|
||||
_subscription_fields = {
|
||||
'date': {'string':'Date', 'type':'date', 'default':lambda *a: time.strftime('%Y-%m-%d'), 'required':True},
|
||||
}
|
||||
|
||||
class wiz_subscription(wizard.interface):
|
||||
def _action_generate(self, cr, uid, data, context={}):
|
||||
cr.execute('select id from account_subscription_line where date<%s and move_id is null', (data['form']['date'],))
|
||||
ids = map(lambda x: x[0], cr.fetchall())
|
||||
pooler.get_pool(cr.dbname).get('account.subscription.line').move_create(cr, uid, ids)
|
||||
return {}
|
||||
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type': 'form', 'arch':_subscription_form, 'fields':_subscription_fields, 'state':[('end','Cancel', 'gtk-cancel'),('generate','Compute', 'gtk-ok')]}
|
||||
},
|
||||
'generate': {
|
||||
'actions': [_action_generate],
|
||||
'result': {'type': 'state', 'state':'end'}
|
||||
}
|
||||
}
|
||||
wiz_subscription('account.subscription.generate')
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
# -*- 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 wizard
|
||||
|
||||
_journal_form = '''<?xml version="1.0"?>
|
||||
<form string="%s">
|
||||
<field name="account_id"/>
|
||||
</form>''' % ('Unreconciliation',)
|
||||
|
||||
_journal_fields = {
|
||||
'account_id': {'string':'Account', 'type':'many2one', 'relation':'account.account', 'required':True},
|
||||
}
|
||||
|
||||
def _action_open_window(self, cr, uid, data, context):
|
||||
return {
|
||||
'domain': "[('account_id','=',%d),('reconcile_id','<>',False),('state','<>','draft')]" % data['form']['account_id'],
|
||||
'name': 'Unreconciliation',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'view_id': False,
|
||||
'res_model': 'account.move.line',
|
||||
'type': 'ir.actions.act_window'
|
||||
}
|
||||
|
||||
class wiz_unrec_select(wizard.interface):
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type': 'form', 'arch':_journal_form, 'fields':_journal_fields, 'state':[('end','Cancel', 'gtk-cancel'),('open','Open for unreconciliation', 'gtk-ok')]}
|
||||
},
|
||||
'open': {
|
||||
'actions': [],
|
||||
'result': {'type': 'action', 'action': _action_open_window, 'state':'end'}
|
||||
}
|
||||
}
|
||||
wiz_unrec_select('account.move.line.unreconcile.select')
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -38,6 +38,8 @@
|
||||
'init_xml': ['auction_sequence.xml'],
|
||||
'update_xml': [
|
||||
'security/ir.model.access.csv',
|
||||
# 'wizard/auction_lots_cancel_view.xml',
|
||||
# 'wizard/auction_transfer_unsold_object_view.xml',
|
||||
'wizard/auction_lots_able_view.xml',
|
||||
'wizard/auction_lots_enable_view.xml',
|
||||
'wizard/auction_lots_make_invoice_buyer_view.xml',
|
||||
|
||||
+23
-18
@@ -95,15 +95,17 @@ class auction_dates(osv.osv):
|
||||
RETURN: True
|
||||
"""
|
||||
# objects vendus mais non factures
|
||||
#TODO: convert this query to tiny API
|
||||
lots_obj = self.pool.get('auction.lots')
|
||||
cr.execute('select count(*) as c from auction_lots where auction_id =ANY(%s) and state=%s and obj_price>0', (ids,'draft',))
|
||||
nbr = cr.fetchone()[0]
|
||||
ach_uids = {}
|
||||
cr.execute('select id from auction_lots where auction_id =ANY(%s) and state=%s and obj_price>0', (ids,'draft',))
|
||||
r=self.pool.get('auction.lots').lots_invoice(cr, uid, [x[0] for x in cr.fetchall()],{},None)
|
||||
r = lots_obj.lots_invoice(cr, uid, [x[0] for x in cr.fetchall()],{},None)
|
||||
cr.execute('select id from auction_lots where auction_id =ANY(%s) and obj_price>0',(ids,))
|
||||
ids2 = [x[0] for x in cr.fetchall()]
|
||||
# for auction in auction_ids:
|
||||
c=self.pool.get('auction.lots').seller_trans_create(cr, uid, ids2,{})
|
||||
c = lots_obj.seller_trans_create(cr, uid, ids2,{})
|
||||
self.write(cr, uid, ids, {'state':'closed'}) #close the auction
|
||||
return True
|
||||
auction_dates()
|
||||
@@ -508,14 +510,14 @@ class auction_lots(osv.osv):
|
||||
##CHECKME: est-ce que ca vaudrait la peine de faire des groupes de lots qui ont les memes couts pour passer des listes de lots a compute?
|
||||
taxes = []
|
||||
amount=0.0
|
||||
# pt_tax=pool.get('account.tax')
|
||||
pt_tax = self.pool.get('account.tax')
|
||||
for lot in lots:
|
||||
taxes = lot.product_id.taxes_id
|
||||
if lot.author_right:
|
||||
taxes.append(lot.author_right)
|
||||
elif lot.auction_id:
|
||||
taxes += lot.auction_id.buyer_costs
|
||||
tax=self.pool.get('account.tax').compute(cr,uid,taxes,lot.obj_price,1)
|
||||
tax=pt_tax.compute(cr,uid,taxes,lot.obj_price,1)
|
||||
for t in tax:
|
||||
amount+=t['amount']
|
||||
#amount+=lot.obj_price*0.2
|
||||
@@ -630,18 +632,20 @@ class auction_lots(osv.osv):
|
||||
|
||||
def buyer_proforma(self,cr,uid,ids,context):
|
||||
invoices = {}
|
||||
inv_ref=self.pool.get('account.invoice')
|
||||
inv_ref = self.pool.get('account.invoice')
|
||||
partner_r = self.pool.get('res.partner')
|
||||
inv_line_obj = self.pool.get('account.invoice.line')
|
||||
wf_service = netsvc.LocalService('workflow')
|
||||
# acc_receiv=self.pool.get('account.account').search([cr,uid,[('code','=','4010')]])
|
||||
for lot in self.browse(cr,uid,ids,context):
|
||||
if not lot.obj_price>0:
|
||||
continue
|
||||
partner_r=self.pool.get('res.partner')
|
||||
if not lot.ach_uid.id:
|
||||
raise orm.except_orm(_('Missed buyer !'), _('The object "%s" has no buyer assigned.') % (lot.name,))
|
||||
else:
|
||||
partner_ref =lot.ach_uid.id
|
||||
lot_name = lot.obj_num
|
||||
res = self.pool.get('res.partner').address_get(cr, uid, [partner_ref], ['contact', 'invoice'])
|
||||
res = partner_r.address_get(cr, uid, [partner_ref], ['contact', 'invoice'])
|
||||
contact_addr_id = res['contact']
|
||||
invoice_addr_id = res['invoice']
|
||||
if not invoice_addr_id:
|
||||
@@ -675,12 +679,11 @@ class auction_lots(osv.osv):
|
||||
'account_id': lot.auction_id.acc_income.id,
|
||||
'price_unit': lot.obj_price,
|
||||
}
|
||||
self.pool.get('account.invoice.line').create(cr, uid, inv_line,context)
|
||||
inv_line_obj.create(cr, uid, inv_line,context)
|
||||
# inv_ref.button_compute(cr, uid, [inv_id])
|
||||
# wf_service = netsvc.LocalService('workflow')
|
||||
# wf_service.trg_validate(uid, 'account.invoice', inv_id, 'invoice_open', cr)
|
||||
inv_ref.button_compute(cr, uid, invoice.values())
|
||||
wf_service = netsvc.LocalService('workflow')
|
||||
wf_service.trg_validate(uid, 'account.invoice', inv_id, 'invoice_proforma', cr)
|
||||
return invoices.values()
|
||||
|
||||
@@ -694,6 +697,9 @@ class auction_lots(osv.osv):
|
||||
# use each list of object in turn
|
||||
invoices = {}
|
||||
inv_ref=self.pool.get('account.invoice')
|
||||
partner_obj = self.pool.get('res.partner')
|
||||
inv_line_obj = self.pool.get('account.invoice.line')
|
||||
wf_service = netsvc.LocalService('workflow')
|
||||
for lot in self.browse(cr,uid,ids,context):
|
||||
partner_id = lot.bord_vnd_id.partner_id.id
|
||||
if not lot.auction_id.id:
|
||||
@@ -702,7 +708,7 @@ class auction_lots(osv.osv):
|
||||
if lot.bord_vnd_id.id in invoices:
|
||||
inv_id = invoices[lot.bord_vnd_id.id]
|
||||
else:
|
||||
res = self.pool.get('res.partner').address_get(cr, uid, [lot.bord_vnd_id.partner_id.id], ['contact', 'invoice'])
|
||||
res = partner_obj.address_get(cr, uid, [lot.bord_vnd_id.partner_id.id], ['contact', 'invoice'])
|
||||
contact_addr_id = res['contact']
|
||||
invoice_addr_id = res['invoice']
|
||||
inv = {
|
||||
@@ -734,13 +740,12 @@ class auction_lots(osv.osv):
|
||||
'account_id': lot.auction_id.acc_expense.id,
|
||||
'price_unit': lot.obj_price,
|
||||
}
|
||||
self.pool.get('account.invoice.line').create(cr, uid, inv_line,context)
|
||||
inv_line_obj.create(cr, uid, inv_line,context)
|
||||
inv_ref.button_compute(cr, uid, invoices.values())
|
||||
for inv in inv_ref.browse(cr, uid, invoices.values(), context):
|
||||
inv_ref.write(cr, uid, [inv.id], {
|
||||
'check_total': inv.amount_total
|
||||
})
|
||||
wf_service = netsvc.LocalService('workflow')
|
||||
wf_service.trg_validate(uid, 'account.invoice', inv.id, 'invoice_open', cr)
|
||||
return invoices.values()
|
||||
|
||||
@@ -756,13 +761,15 @@ class auction_lots(osv.osv):
|
||||
RETURN: id of generated invoice
|
||||
"""
|
||||
dt = time.strftime('%Y-%m-%d')
|
||||
inv_ref=self.pool.get('account.invoice')
|
||||
inv_ref = self.pool.get('account.invoice')
|
||||
partner_r = self.pool.get('res.partner')
|
||||
inv_line_obj = self.pool.get('account.invoice.line')
|
||||
wf_service = netsvc.LocalService('workflow')
|
||||
invoices={}
|
||||
for lot in self.browse(cr, uid, ids,context):
|
||||
# partner_ref = lot.ach_uid.id
|
||||
if not lot.auction_id.id:
|
||||
continue
|
||||
partner_r=self.pool.get('res.partner')
|
||||
if not lot.ach_uid.id:
|
||||
raise orm.except_orm(_('Missed buyer !'), _('The object "%s" has no buyer assigned.') % (lot.name,))
|
||||
if (lot.auction_id.id,lot.ach_uid.id) in invoices:
|
||||
@@ -773,13 +780,12 @@ class auction_lots(osv.osv):
|
||||
raise orm.except_orm(_('Missed Address !'), _('The Buyer has no Invoice Address.'))
|
||||
price = lot.obj_price or 0.0
|
||||
lot_name =lot.obj_num
|
||||
inv={
|
||||
inv = {
|
||||
'name':lot.auction_id.name or '',
|
||||
'reference': lot.ach_login,
|
||||
'journal_id': lot.auction_id.journal_id.id,
|
||||
'partner_id': lot.ach_uid.id,
|
||||
'type': 'out_invoice',
|
||||
|
||||
}
|
||||
if invoice_number:
|
||||
inv['number'] = invoice_number
|
||||
@@ -804,12 +810,11 @@ class auction_lots(osv.osv):
|
||||
'account_id': lot.auction_id.acc_income.id,
|
||||
'price_unit': lot.obj_price,
|
||||
}
|
||||
self.pool.get('account.invoice.line').create(cr, uid, inv_line,context)
|
||||
inv_line_obj.create(cr, uid, inv_line,context)
|
||||
# inv_ref.button_compute(cr, uid, [inpq tu dis cav_id])
|
||||
# inv_ref.button_compute(cr, uid, [inv_id])
|
||||
inv_ref.button_compute(cr, uid, [inv_id])
|
||||
for l in inv_ref.browse(cr, uid, invoices.values(), context):
|
||||
wf_service = netsvc.LocalService('workflow')
|
||||
# wf_service.trg_validate(uid, 'account.invoice',l.id, 'invoice_proforma', cr)
|
||||
wf_service.trg_validate(uid, 'account.invoice',l.id, 'invoice_open', cr)
|
||||
return invoices.values()
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
<data>
|
||||
<menuitem name="Auction Management" id="auction_menu_root" icon="terp-purchase"/>
|
||||
<menuitem name="Configuration" parent="auction_menu_root" id="auction_config_menu" sequence="7"/>
|
||||
|
||||
<menuitem name="Tools Bar Codes" id="auction_outils_menu" parent="auction_menu_root" sequence="5" />
|
||||
<menuitem name="Deliveries Management" action="action_auction_taken" id="menu_wizard_emporte" parent="auction_outils_menu"/>
|
||||
=======================================================
|
||||
Auction Management/Configuration/artist
|
||||
=======================================================
|
||||
@@ -203,6 +204,7 @@
|
||||
<field name="lot_est2"/>
|
||||
<field name="product_id"/>
|
||||
<field name="state" readonly="1"/>
|
||||
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
@@ -277,7 +279,7 @@
|
||||
<separator string="Description" colspan="4"/>
|
||||
<field name="obj_desc" colspan="4" nolabel="1" select="2"/>
|
||||
<field name="state" colspan="1" select="2"/>
|
||||
<group col="4" colspan="2">
|
||||
<group col="8" colspan="2">
|
||||
<button name="button_bought" string="Sold" states="draft" type="object" icon="gtk-jump-to"/>
|
||||
<button name="button_not_bought" string="Not sold" states="draft" type="object" icon="gtk-undo"/>
|
||||
<button name="button_taken_away" string="Taken away" states="sold" type="object" icon="gtk-goto-last"/>
|
||||
@@ -330,7 +332,6 @@
|
||||
<field name="date"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
</page>
|
||||
<page string="Bids">
|
||||
<field name="bid_lines" colspan="4" nolabel="1" editable="top">
|
||||
@@ -340,9 +341,7 @@
|
||||
<field name="call"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
</page>
|
||||
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<!--<delete model="ir.actions.wizard" search="[('wiz_name','like','auction.lots.')]"/>-->
|
||||
|
||||
<!-- Following wizard is remaining to implement in osv_memory-->
|
||||
<!--
|
||||
<wizard string="Send to website"
|
||||
model="auction.lots"
|
||||
name="auction.lots.send.aie"
|
||||
@@ -20,45 +20,6 @@
|
||||
multi="1"
|
||||
id="wizard_map_user"/>
|
||||
|
||||
<wizard string="Change Auction Date"
|
||||
model="auction.lots"
|
||||
name="auction.lots.auction_move"
|
||||
multi="1"
|
||||
id="wizard_change_auction"/>
|
||||
|
||||
<!--wizard string="Pay objects of the seller"
|
||||
model="auction.lots"
|
||||
name="auction.pay.sel"
|
||||
id="wizard_lots_pay"/-->
|
||||
<wizard string="Pay objects of the buyer"
|
||||
model="auction.lots"
|
||||
name="auction.pay.buy"
|
||||
id="wizard_pay"/>
|
||||
|
||||
<wizard
|
||||
string="Gestion emporte"
|
||||
model="auction.dates"
|
||||
name="auction.taken"
|
||||
multi="1"
|
||||
id="wizard_emporte"/>
|
||||
|
||||
<menuitem name="Tools Bar Codes"
|
||||
id="auction_outils_menu"
|
||||
parent="auction_menu_root" sequence="5"
|
||||
/>
|
||||
|
||||
<menuitem name="Deliveries Management"
|
||||
action="wizard_emporte"
|
||||
type="wizard"
|
||||
id="menu_wizard_emporte"
|
||||
parent="auction_outils_menu"
|
||||
/>
|
||||
|
||||
<!--wizard string="Cancel payment"
|
||||
model="auction.lots"
|
||||
name="auction.lots.cancel"
|
||||
multi="1"
|
||||
id="wizard_cancel_pay"/-->
|
||||
|
||||
<wizard string="Numerotation (per lot)"
|
||||
model="auction.lots"
|
||||
@@ -72,56 +33,13 @@
|
||||
multi="1"
|
||||
id="wizard_numerotate_automatic"/>
|
||||
|
||||
<wizard string="SMS Send"
|
||||
model="auction.lots"
|
||||
name="auction.lots.sms_send"
|
||||
multi="1"
|
||||
id="wizard_sms"/>
|
||||
|
||||
<!--wizard string="Invoice"
|
||||
model="auction.lots"
|
||||
name="auction.lots.invoice"
|
||||
multi="1"
|
||||
id="wizard_invoicing"/-->
|
||||
|
||||
|
||||
<wizard string="Invoice Seller objects"
|
||||
model="auction.lots"
|
||||
name="auction.lots.make_invoice"
|
||||
multi="1"
|
||||
id="wizard_invoice"/>
|
||||
|
||||
<wizard string="Invoice Buyer objects"
|
||||
model="auction.lots"
|
||||
name="auction.lots.make_invoice_buyer"
|
||||
id="wizard_invoice_buyer1"/>
|
||||
|
||||
<wizard string="Unmark as taken away"
|
||||
model="auction.lots"
|
||||
name="auction.lots.enable"
|
||||
multi="1"
|
||||
id="auction_wizard_enable_taken"/>
|
||||
|
||||
<wizard string="Mark as taken away"
|
||||
model="auction.lots"
|
||||
name="auction.lots.able"
|
||||
multi="1"
|
||||
id="auction_wizard_able_taken"/>
|
||||
|
||||
<wizard
|
||||
id="auction_catalog_flagy"
|
||||
string="Auction Catalog Flagey"
|
||||
model="auction.dates"
|
||||
name="auction.catalog.flagey"
|
||||
keyword="client_print_multi"/>
|
||||
|
||||
<wizard string="Mark as paid for seller"
|
||||
model="auction.lots"
|
||||
name="auction.payer.sel"
|
||||
multi="1"
|
||||
id="auction_wizard_payer_sel"/>
|
||||
|
||||
|
||||
-->
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -29,7 +29,8 @@ import auction_pay_buy
|
||||
import auction_payer_sel
|
||||
import auction_lots_sms_send
|
||||
import auction_catalog_flagey_report
|
||||
|
||||
#import auction_lots_cancel
|
||||
#import auction_transfer_unsold_object
|
||||
#import auction_aie_send_result
|
||||
import auction_lots_buyer_map
|
||||
|
||||
|
||||
@@ -40,9 +40,21 @@ class auction_catalog_flagey(osv.osv_memory):
|
||||
return res
|
||||
|
||||
def view_init(self, cr, uid, fields, context):
|
||||
current_auction = self.pool.get('auction.dates').browse(cr,uid,context.get('active_ids', []))
|
||||
v_lots = self.pool.get('auction.lots').search(cr,uid,[('auction_id','=',current_auction.id)])
|
||||
v_ids = self.pool.get('auction.lots').browse(cr,uid,v_lots)
|
||||
"""
|
||||
Creates view dynamically, adding fields at runtime, raises exception
|
||||
at the time of initialization of view.
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param fields: List of fields for which we want default values
|
||||
@param context: A standard dictionary
|
||||
@return: New arch of view with new columns.
|
||||
"""
|
||||
lots_obj = self.pool.get('auction.lots')
|
||||
auc_dates_obj = self.pool.get('auction.dates')
|
||||
current_auction = auc_dates_obj.browse(cr,uid,context.get('active_ids', []))
|
||||
v_lots = lots_obj.search(cr,uid,[('auction_id','=',current_auction.id)])
|
||||
v_ids = lots_obj.browse(cr,uid,v_lots)
|
||||
for ab in v_ids:
|
||||
if not ab.auction_id :
|
||||
raise osv.except_osv('Error!','No Lots belong to this Auction Date')
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
# -*- 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import netsvc
|
||||
import pooler
|
||||
import time
|
||||
import tools
|
||||
import wizard
|
||||
|
||||
class auction_lots_able(osv.osv_memory):
|
||||
|
||||
_name = "auction.lots.able"
|
||||
_description = "Lots able"
|
||||
|
||||
def confirm_able(self, cr, uid, ids, context={}):
|
||||
"""
|
||||
This function Update auction lots object and set taken away field true.
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of auction lots able’s IDs.
|
||||
"""
|
||||
self.pool.get('auction.lots').write(cr, uid, context['active_ids'], {'ach_emp':True})
|
||||
return {}
|
||||
|
||||
auction_lots_able()
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_auction_lots_able" model="ir.ui.view">
|
||||
<field name="name">auction.lots.able.form</field>
|
||||
<field name="model">auction.lots.able</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Confirm">
|
||||
<group colspan="4" >
|
||||
<separator string="Confirmation set taken away" colspan="4"/>
|
||||
<newline/>
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-goto-last" string="Able Taken away" name="confirm_able" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<act_window name="Mark as taken away"
|
||||
res_model="auction.lots.able"
|
||||
src_model="auction.lots"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_action_multi"
|
||||
id="action_auction_lots_able"/>
|
||||
</data>
|
||||
</openerp>
|
||||
+12
-12
@@ -32,16 +32,16 @@ class auction_lots_auction_move(osv.osv_memory):
|
||||
_name = "auction.lots.auction.move"
|
||||
_description = "Auction move "
|
||||
_columns= {
|
||||
'auction_id':fields.many2one('auction.dates', 'Auction Date', required=True),
|
||||
}
|
||||
'auction_id':fields.many2one('auction.dates', 'Auction Date', required=True),
|
||||
}
|
||||
|
||||
def _top(self, cr, uid, ids, context={}):
|
||||
refs = self.pool.get('auction.lots')
|
||||
rec_ids = refs.browse(cr, uid, context['active_ids'])
|
||||
for rec in rec_ids:
|
||||
if not rec.auction_id:
|
||||
raise osv.except_osv('Error !', 'You can not move a lot that has no auction date')
|
||||
return {}
|
||||
# def _top(self, cr, uid, ids, context={}):
|
||||
# refs = self.pool.get('auction.lots')
|
||||
# rec_ids = refs.browse(cr, uid, context['active_ids'])
|
||||
# for rec in rec_ids:
|
||||
# if not rec.auction_id:
|
||||
# raise osv.except_osv('Error !', 'You can not move a lot that has no auction date')
|
||||
# return {}
|
||||
|
||||
def auction_move_set(self, cr, uid, ids, context={}):
|
||||
"""
|
||||
@@ -56,13 +56,13 @@ class auction_lots_auction_move(osv.osv_memory):
|
||||
auction_bid_line_obj = self.pool.get('auction.bid_line')
|
||||
auction_lot_history_obj = self.pool.get('auction.lot.history')
|
||||
auction_lots_obj = self.pool.get('auction.lots')
|
||||
rec_ids = refs.browse(cr, uid, context['active_ids'])
|
||||
for datas in self.read(cr, uid, ids):
|
||||
if not (datas['auction_id'] and len(context['active_ids'])) :
|
||||
return {}
|
||||
|
||||
rec_ids = refs.browse(cr, uid, context['active_ids'])
|
||||
line_ids = auction_bid_line_obj.search(cr, uid, [('lot_id', 'in', context['active_ids'])])
|
||||
# pooler.get_pool(cr.dbname).get('auction.bid_line').unlink(cr, uid, line_ids)
|
||||
# line_ids = auction_bid_line_obj.search(cr, uid, [('lot_id', 'in', context['active_ids'])])
|
||||
# pooler.get_pool(cr.dbname).get('auction.bid_line').unlink(cr, uid, line_ids)
|
||||
for rec in rec_ids:
|
||||
new_id = auction_lot_history_obj.create(cr, uid, {
|
||||
'auction_id': rec.auction_id.id,
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_auction_lots_auction_move" model="ir.ui.view">
|
||||
<field name="name">auction.lots.auction.move.form</field>
|
||||
<field name="model">auction.lots.auction.move</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Change Auction Date">
|
||||
<group colspan="4" >
|
||||
<label string="Warning, this will erase the object adjudication price and its buyer !" colspan="2"/>
|
||||
<newline/>
|
||||
<field name="auction_id"/>
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-redo" string="Move to Auction date" name="auction_move_set" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<act_window name="Change Auction Date"
|
||||
res_model="auction.lots.auction.move"
|
||||
src_model="auction.lots"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_action_multi"
|
||||
id="action_auction_lots_auction_move"/>
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -107,18 +107,21 @@ class wiz_auc_lots_buyer_map(osv.osv_memory):
|
||||
res = super(wiz_auc_lots_buyer_map, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
|
||||
lots_obj = self.pool.get('auction.lots')
|
||||
if record_ids:
|
||||
for lots in lots_obj.browse(cr, uid, record_ids):
|
||||
if lots.ach_uid:
|
||||
res['arch'] = """
|
||||
<form title="Mapping Result">
|
||||
<group col="2" colspan="2">
|
||||
<label string="All objects are assigned to buyers !"/>
|
||||
<newline/>
|
||||
<button icon='gtk-cancel' special="cancel"
|
||||
string="Done" />
|
||||
</group>
|
||||
</form>
|
||||
"""
|
||||
try:
|
||||
for lots in lots_obj.browse(cr, uid, record_ids):
|
||||
if lots.ach_uid:
|
||||
res['arch'] = """
|
||||
<form title="Mapping Result">
|
||||
<group col="2" colspan="2">
|
||||
<label string="All objects are assigned to buyers !"/>
|
||||
<newline/>
|
||||
<button icon='gtk-cancel' special="cancel"
|
||||
string="Done" />
|
||||
</group>
|
||||
</form>
|
||||
"""
|
||||
except:
|
||||
return res
|
||||
return res
|
||||
|
||||
wiz_auc_lots_buyer_map()
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
# -*- 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import osv
|
||||
from osv import fields
|
||||
|
||||
class auction_lots_cancel(osv.osv):
|
||||
'''
|
||||
Open ERP Model
|
||||
'''
|
||||
_name = 'auction.lots.cancel'
|
||||
_description = 'To cancel auction lots.'
|
||||
|
||||
def cancel(self, cr, uid, ids, context):
|
||||
"""
|
||||
To cancel the auction lot
|
||||
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param ids: List of IDs selected
|
||||
@param context: A standard dictionary
|
||||
@return:
|
||||
"""
|
||||
|
||||
lots_obj = self.pool.get('auction.lots')
|
||||
invoice_obj = self.pool.get('account.invoice')
|
||||
lot = lots_obj.browse(cr,uid,context['active_id'],context)
|
||||
if lot.ach_inv_id:
|
||||
supplier_refund_inv_id = invoice_obj.refund(cr, uid,[lot.ach_inv_id.id])
|
||||
if lot.sel_inv_id:
|
||||
customer_refund_inv_id = invoice_obj.refund(cr, uid,[lot.sel_inv_id.id])
|
||||
return {}
|
||||
|
||||
_columns = {
|
||||
}
|
||||
auction_lots_cancel()
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="name_form" model="ir.ui.view">
|
||||
<field name="name">auction.lots.cancel.form</field>
|
||||
<field name="model">auction.lots.cancel</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Cancel Payment">
|
||||
<label string="Are you sure you want to refund this invoice ?"/>
|
||||
<button icon='gtk-cancel' special="cancel"
|
||||
string="Cancel" />
|
||||
<button name="cancel" string="Cancel Payment"
|
||||
colspan="1" type="object" icon="gtk-ok" />
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<act_window name="Cancel ittttttt"
|
||||
res_model="auction.lots.cancel"
|
||||
src_model="auction.lots"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_action_multi"
|
||||
id="action_auction_lots_cancel"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,41 @@
|
||||
# -*- 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
from osv import fields, osv
|
||||
|
||||
class auction_lots_enable(osv.osv_memory):
|
||||
_name = "auction.lots.enable"
|
||||
_description = "Lots Enable"
|
||||
|
||||
_columns= {
|
||||
'confirm_en':fields.integer('Catalog Number')
|
||||
}
|
||||
|
||||
def confirm_enable(self, cr, uid, ids, context={}):
|
||||
"""
|
||||
This function Update auction lots object and set taken away field False.
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of auction lots enable’s IDs.
|
||||
"""
|
||||
self.pool.get('auction.lots').write(cr, uid, context['active_id'], {'ach_emp':False})
|
||||
return {}
|
||||
|
||||
auction_lots_enable()
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_auction_lots_enable" model="ir.ui.view">
|
||||
<field name="name">auction.lots.enable.form</field>
|
||||
<field name="model">auction.lots.enable</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Confirm">
|
||||
<group colspan="4" >
|
||||
<separator string="Confirmation enable taken away" colspan="4"/>
|
||||
<newline/>
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-goto-last" string="Enable Taken away" name="confirm_enable" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<act_window name="Unmark as taken away"
|
||||
res_model="auction.lots.enable"
|
||||
src_model="auction.lots"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_action_multi"
|
||||
id="action_auction_lots_enable"/>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
+35
-42
@@ -27,20 +27,29 @@ import tools
|
||||
import wizard
|
||||
|
||||
class auction_lots_make_invoice(osv.osv_memory):
|
||||
_name = "auction.lots.make.invoice"
|
||||
_description = "Make invoice"
|
||||
|
||||
_columns = {
|
||||
'amount': fields.float('Invoiced Amount', required =True, readonly=True),
|
||||
'objects':fields.integer('# of objects', required =True, readonly=True),
|
||||
'number':fields.char('Invoice Number', size=64),
|
||||
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'number': lambda *a: False,
|
||||
}
|
||||
|
||||
def default_get(self, cr, uid, fields, context):
|
||||
"""
|
||||
To get default values for the object.
|
||||
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param fields: List of fields for which we want default values
|
||||
@param context: A standard dictionary
|
||||
|
||||
@return: A dictionary which of fields with values.
|
||||
|
||||
To get default values for the object.
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param fields: List of fields for which we want default values
|
||||
@param context: A standard dictionary
|
||||
@return: A dictionary which of fields with values.
|
||||
"""
|
||||
res = super(auction_lots_make_invoice, self).default_get(cr, uid, fields, context=context)
|
||||
for lot in self.pool.get('auction.lots').browse(cr, uid, context.get('active_ids', [])):
|
||||
@@ -53,7 +62,7 @@ class auction_lots_make_invoice(osv.osv_memory):
|
||||
|
||||
def makeInvoices(self, cr, uid, ids, context):
|
||||
"""
|
||||
seller invoice :Create an invoice.
|
||||
Seller invoice :Create an invoice.
|
||||
@param cr: the current row, from the database cursor.
|
||||
@param uid: the current user’s ID for security checks.
|
||||
@param ids: List of Auction lots make invoice’s IDs
|
||||
@@ -61,36 +70,20 @@ class auction_lots_make_invoice(osv.osv_memory):
|
||||
"""
|
||||
order_obj = self.pool.get('auction.lots')
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
|
||||
for data in self.read(cr, uid, ids):
|
||||
result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
|
||||
id = mod_obj.read(cr, uid, result, ['res_id'])
|
||||
newinv = []
|
||||
ids = order_obj.seller_trans_create(cr, uid, context['active_ids'], context)
|
||||
cr.commit()
|
||||
return {
|
||||
'domain': "[('id','in', ["+','.join(map(str, ids))+"])]",
|
||||
'name': 'Seller invoices',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'account.invoice',
|
||||
'view_id': False,
|
||||
'context': "{'type':'out_refund'}",
|
||||
'type': 'ir.actions.act_window',
|
||||
'search_view_id': id['res_id']
|
||||
}
|
||||
result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
|
||||
id = mod_obj.read(cr, uid, result, ['res_id'])
|
||||
lots_ids = order_obj.seller_trans_create(cr, uid, context['active_ids'], context)
|
||||
cr.commit()
|
||||
return {
|
||||
'domain': "[('id','in', ["+','.join(map(str, lots_ids))+"])]",
|
||||
'name': 'Seller invoices',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'account.invoice',
|
||||
'view_id': False,
|
||||
'context': "{'type':'out_refund'}",
|
||||
'type': 'ir.actions.act_window',
|
||||
'search_view_id': id['res_id']
|
||||
}
|
||||
|
||||
_name = "auction.lots.make.invoice"
|
||||
_description = "Make invoice"
|
||||
_columns= {
|
||||
'amount': fields.float('Invoiced Amount', required =True, readonly=True),
|
||||
'objects':fields.integer('# of objects', required =True, readonly=True),
|
||||
'number':fields.char('Invoice Number', size=64),
|
||||
|
||||
}
|
||||
_defaults={
|
||||
'number':lambda *a: False,
|
||||
|
||||
}
|
||||
|
||||
auction_lots_make_invoice()
|
||||
+26
-37
@@ -19,27 +19,31 @@
|
||||
#
|
||||
##############################################################################
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import netsvc
|
||||
import pooler
|
||||
import time
|
||||
import tools
|
||||
import wizard
|
||||
|
||||
class auction_lots_make_invoice_buyer(osv.osv_memory):
|
||||
_name = "auction.lots.make.invoice.buyer"
|
||||
_description = "Make invoice buyer "
|
||||
|
||||
_columns= {
|
||||
'amount': fields.float('Invoiced Amount', required =True, readonly=True),
|
||||
'objects':fields.integer('# of objects', required =True, readonly=True),
|
||||
'number':fields.char('Invoice Number', size=64),
|
||||
'buyer_id':fields.many2one('res.partner', 'Buyer', required=True),
|
||||
}
|
||||
|
||||
_defaults={
|
||||
'number': lambda *a: False,
|
||||
}
|
||||
|
||||
def default_get(self, cr, uid, fields, context):
|
||||
"""
|
||||
To get default values for the object.
|
||||
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param fields: List of fields for which we want default values
|
||||
@param context: A standard dictionary
|
||||
|
||||
@return: A dictionary which of fields with values.
|
||||
|
||||
To get default values for the object.
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param fields: List of fields for which we want default values
|
||||
@param context: A standard dictionary
|
||||
@return: A dictionary which of fields with values.
|
||||
"""
|
||||
res = super(auction_lots_make_invoice_buyer, self).default_get(cr, uid, fields, context=context)
|
||||
for lot in self.pool.get('auction.lots').browse(cr, uid, context.get('active_ids', [])):
|
||||
@@ -59,22 +63,19 @@ class auction_lots_make_invoice_buyer(osv.osv_memory):
|
||||
@param ids: List of Auction lots make invoice buyer’s IDs
|
||||
@return: dictionary of account invoice form.
|
||||
"""
|
||||
newinv = []
|
||||
|
||||
order_obj = self.pool.get('auction.lots')
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
|
||||
result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
|
||||
id = mod_obj.read(cr, uid, result, ['res_id'])
|
||||
lots = order_obj.browse(cr, uid, context['active_ids'])
|
||||
for data in self.read(cr, uid, ids):
|
||||
result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
|
||||
id = mod_obj.read(cr, uid, result, ['res_id'])
|
||||
lots = order_obj.browse(cr, uid, context['active_ids'])
|
||||
invoice_number = data['number']
|
||||
for lot in lots:
|
||||
up_auction = order_obj.write(cr, uid, [lot.id], {'ach_uid':data['buyer_id']})
|
||||
ids = order_obj.lots_invoice(cr, uid, context['active_ids'], context, data['number'])
|
||||
up_auction = order_obj.write(cr, uid, [lot.id], {'ach_uid': data['buyer_id']})
|
||||
lots_ids = order_obj.lots_invoice(cr, uid, context['active_ids'], context, data['number'])
|
||||
cr.commit()
|
||||
return {
|
||||
'domain': "[('id','in', ["+','.join(map(str, ids))+"])]",
|
||||
'domain': "[('id','in', ["+','.join(map(str, lots_ids))+"])]",
|
||||
'name': 'Buyer invoices',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
@@ -84,17 +85,5 @@ class auction_lots_make_invoice_buyer(osv.osv_memory):
|
||||
'type': 'ir.actions.act_window',
|
||||
'search_view_id': id['res_id']
|
||||
}
|
||||
|
||||
_name = "auction.lots.make.invoice.buyer"
|
||||
_description = "Make invoice buyer "
|
||||
_columns= {
|
||||
'amount': fields.float('Invoiced Amount', required =True, readonly=True),
|
||||
'objects':fields.integer('# of objects', required =True, readonly=True),
|
||||
'number':fields.char('Invoice Number', size=64),
|
||||
'buyer_id':fields.many2one('res.partner', 'Buyer', required=True),
|
||||
}
|
||||
_defaults={
|
||||
'number':lambda *a: False,
|
||||
}
|
||||
|
||||
auction_lots_make_invoice_buyer()
|
||||
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_auction_lots_make_invoice_buyer" model="ir.ui.view">
|
||||
<field name="name">auction.lots.make.invoice.buyer.form</field>
|
||||
<field name="model">auction.lots.make.invoice.buyer</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Paid">
|
||||
<group colspan="4" >
|
||||
<field name="amount"/>
|
||||
<field name="objects"/>
|
||||
<field name="number"/>
|
||||
<label string="(Keep empty for automatic number)" colspan="2"/>
|
||||
<field name="buyer_id"/>
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-ok" string="Create invoices" name="makeInvoices" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<act_window name="Invoice Buyer objects"
|
||||
res_model="auction.lots.make.invoice.buyer"
|
||||
src_model="auction.lots"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_action_multi"
|
||||
id="action_auction_lots_make_invoice_buyer"/>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_auction_lots_make_invoice" model="ir.ui.view">
|
||||
<field name="name">auction.lots.make.invoice.form</field>
|
||||
<field name="model">auction.lots.make.invoice</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Paid">
|
||||
<group colspan="4" >
|
||||
<field name="amount"/>
|
||||
<field name="objects"/>
|
||||
<field name="number" colspan="3"/>
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-ok" string="Create invoices" name="makeInvoices" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<act_window name="Invoice Seller objects"
|
||||
res_model="auction.lots.make.invoice"
|
||||
src_model="auction.lots"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_action_multi"
|
||||
id="action_auction_lots_make_invoice"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_auction_lots_sms_send" model="ir.ui.view">
|
||||
<field name="name">auction.lots.sms.send.form</field>
|
||||
<field name="model">auction.lots.sms.send</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="SMS - Gateway: clickatell','Bulk SMS send">
|
||||
<group colspan="4" >
|
||||
<separator string="SMS - Gateway: clickatell','Bulk SMS send" colspan="4"/>
|
||||
<field name="app_id"/>
|
||||
<newline/>
|
||||
<field name="user"/>
|
||||
<field name="password"/>
|
||||
<newline/>
|
||||
<field name="text" colspan="3"/>
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-go-back" string="Send SMS" name="sms_send" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<act_window name="SMS Send"
|
||||
res_model="auction.lots.sms.send"
|
||||
src_model="auction.lots"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_action_multi"
|
||||
id="action_auction_lots_sms_send"/>
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -21,26 +21,33 @@
|
||||
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import netsvc
|
||||
import pooler
|
||||
import time
|
||||
import tools
|
||||
import wizard
|
||||
|
||||
class auction_pay_buy(osv.osv_memory):
|
||||
_name = "auction.pay.buy"
|
||||
_description = "Pay buy"
|
||||
|
||||
_columns= {
|
||||
'amount': fields.float('Amount paid', digits= (16, int(tools.config['price_accuracy']))),
|
||||
'buyer_id':fields.many2one('res.partner', 'Buyer'),
|
||||
'statement_id1':fields.many2one('account.bank.statement', 'Statement', required=True),
|
||||
'amount2': fields.float('Amount paid', digits= (16, int(tools.config['price_accuracy']))),
|
||||
'statement_id2':fields.many2one('account.bank.statement', 'Statement'),
|
||||
'amount3': fields.float('Amount paid', digits = (16, int(tools.config['price_accuracy']))),
|
||||
'statement_id3':fields.many2one('account.bank.statement', 'Statement'),
|
||||
'total': fields.float('Amount paid', digits = (16, int(tools.config['price_accuracy'])), readonly =True),
|
||||
}
|
||||
|
||||
def default_get(self, cr, uid, fields, context):
|
||||
"""
|
||||
To get default values for the object.
|
||||
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param fields: List of fields for which we want default values
|
||||
@param context: A standard dictionary
|
||||
|
||||
@return: A dictionary which of fields with values.
|
||||
|
||||
To get default values for the object.
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param fields: List of fields for which we want default values
|
||||
@param context: A standard dictionary
|
||||
@return: A dictionary which of fields with values.
|
||||
"""
|
||||
res = super(auction_pay_buy, self).default_get(cr, uid, fields, context=context)
|
||||
for lot in self.pool.get('auction.lots').browse(cr, uid, context.get('active_ids', [])):
|
||||
@@ -54,13 +61,12 @@ class auction_pay_buy(osv.osv_memory):
|
||||
|
||||
def pay_and_reconcile(self, cr, uid, ids, context):
|
||||
"""
|
||||
Pay and Reconcile
|
||||
|
||||
@param cr: the current row, from the database cursor.
|
||||
@param uid: the current user’s ID for security checks.
|
||||
@param ids: the ID or list of IDs
|
||||
@param context: A standard dictionary
|
||||
@return:
|
||||
Pay and Reconcile
|
||||
@param cr: the current row, from the database cursor.
|
||||
@param uid: the current user’s ID for security checks.
|
||||
@param ids: the ID or list of IDs
|
||||
@param context: A standard dictionary
|
||||
@return:
|
||||
"""
|
||||
lot_obj = self.pool.get('auction.lots')
|
||||
bank_statement_line_obj = self.pool.get('account.bank.statement.line')
|
||||
@@ -94,22 +100,8 @@ class auction_pay_buy(osv.osv_memory):
|
||||
for lot in lots:
|
||||
lot_obj.write(cr, uid, [lot.id], {'statement_id':[(4, new_id)]})
|
||||
return {}
|
||||
|
||||
_name = "auction.pay.buy"
|
||||
_description = "Pay buy"
|
||||
_columns= {
|
||||
'amount': fields.float('Amount paid', digits= (16, int(tools.config['price_accuracy']))),
|
||||
'buyer_id':fields.many2one('res.partner', 'Buyer'),
|
||||
'statement_id1':fields.many2one('account.bank.statement', 'Statement', required=True),
|
||||
'amount2': fields.float('Amount paid', digits= (16, int(tools.config['price_accuracy']))),
|
||||
'statement_id2':fields.many2one('account.bank.statement', 'Statement'),
|
||||
'amount3': fields.float('Amount paid', digits = (16, int(tools.config['price_accuracy']))),
|
||||
'statement_id3':fields.many2one('account.bank.statement', 'Statement'),
|
||||
'total': fields.float('Amount paid', digits = (16, int(tools.config['price_accuracy'])), readonly =True),
|
||||
}
|
||||
|
||||
auction_pay_buy()
|
||||
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_auction_pay_buy" model="ir.ui.view">
|
||||
<field name="name">auction.pay.buy.form</field>
|
||||
<field name="model">auction.pay.buy</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Pay objects">
|
||||
<group colspan="4" >
|
||||
<field name="amount"/>
|
||||
<field name="statement_id1" domain="[('state','=','draft')]"/>
|
||||
<field name="amount2"/>
|
||||
<field name="statement_id2" domain="[('state','=','draft')]"/>
|
||||
<field name="amount3"/>
|
||||
<field name="statement_id3" domain="[('state','=','draft')]"/>
|
||||
<newline/>
|
||||
<field name="buyer_id"/>
|
||||
<field name="total"/>
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-yes" string="Pay" name="pay_and_reconcile" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<act_window name="Pay objects of the buyer"
|
||||
res_model="auction.pay.buy"
|
||||
src_model="auction.lots"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_action_multi"
|
||||
id="action_auction_pay_buy"/>
|
||||
</data>
|
||||
</openerp>
|
||||
+12
-18
@@ -20,33 +20,27 @@
|
||||
##############################################################################
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import netsvc
|
||||
import pooler
|
||||
import time
|
||||
import tools
|
||||
import wizard
|
||||
|
||||
class auction_pay_sel(osv.osv_memory):
|
||||
|
||||
_name = "auction.pay.sel"
|
||||
_description = "Pay Invoice"
|
||||
|
||||
_columns= {
|
||||
'amount': fields.float('Amount paid', digits= (16, int(tools.config['price_accuracy'])), required=True),
|
||||
'dest_account_id':fields.many2one('account.account', 'Payment to Account', required=True, domain= [('type', '=', 'cash')]),
|
||||
'journal_id':fields.many2one('account.journal', 'Journal', required=True),
|
||||
'period_id':fields.many2one('account.period', 'Period', required=True),
|
||||
}
|
||||
'amount': fields.float('Amount paid', digits= (16, int(tools.config['price_accuracy'])), required=True),
|
||||
'dest_account_id':fields.many2one('account.account', 'Payment to Account', required=True, domain= [('type', '=', 'cash')]),
|
||||
'journal_id':fields.many2one('account.journal', 'Journal', required=True),
|
||||
'period_id':fields.many2one('account.period', 'Period', required=True),
|
||||
}
|
||||
|
||||
def pay_and_reconcile(self, cr, uid, ids, context):
|
||||
|
||||
"""
|
||||
Pay and Reconcile
|
||||
|
||||
@param cr: the current row, from the database cursor.
|
||||
@param uid: the current user’s ID for security checks.
|
||||
@param ids: the ID or list of IDs
|
||||
@param context: A standard dictionary
|
||||
@return:
|
||||
Pay and Reconcile
|
||||
@param cr: the current row, from the database cursor.
|
||||
@param uid: the current user’s ID for security checks.
|
||||
@param ids: the ID or list of IDs
|
||||
@param context: A standard dictionary
|
||||
@return:
|
||||
"""
|
||||
lot = self.pool.get('auction.lots').browse(cr, uid, context['active_id'], context)
|
||||
invoice_obj = self.pool.get('account.invoice')
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_auction_pay_sel" model="ir.ui.view">
|
||||
<field name="name">auction.pay.sel.form</field>
|
||||
<field name="model">auction.pay.sel</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Pay invoice">
|
||||
<group colspan="4" >
|
||||
<field name="amount"/>
|
||||
<field name="dest_account_id"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="period_id"/>
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-yes" string="Pay" name="pay_and_reconcile" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_auction_pay_sel" model="ir.actions.act_window">
|
||||
<field name="name">Pay objects of the seller</field>
|
||||
<field name="res_model">auction.pay.sel</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_auction_pay_sel"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
+28
-36
@@ -19,43 +19,35 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import wizard
|
||||
import netsvc
|
||||
import pooler
|
||||
take_form = """<?xml version="1.0"?>
|
||||
<form title="Confirm">
|
||||
<separator string="Confirmation set taken away" colspan="4"/>
|
||||
<newline/>
|
||||
</form>
|
||||
"""
|
||||
|
||||
take_fields = {
|
||||
# 'confirm_en': {'string':'Catalog Number', 'type':'integer'},
|
||||
}
|
||||
|
||||
def _confirm_able(self,cr,uid,data,context={}):
|
||||
res={}
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
pool.get('auction.lots').write(cr,uid,data['ids'],{'ach_emp':True})
|
||||
return {}
|
||||
|
||||
class able_take_away(wizard.interface):
|
||||
states = {
|
||||
'init' : {
|
||||
'actions' : [],
|
||||
'result' : {
|
||||
'type' : 'form',
|
||||
'arch' : take_form,
|
||||
'fields' : take_fields,
|
||||
'state' : [('end', 'Cancel'),('go', 'Able Taken away')]}
|
||||
},
|
||||
'go' : {
|
||||
'actions' : [_confirm_able],
|
||||
'result' : {'type' : 'state', 'state' : 'end'}
|
||||
},
|
||||
}
|
||||
able_take_away('auction.lots.able')
|
||||
from osv import fields, osv
|
||||
|
||||
class auction_payer(osv.osv_memory):
|
||||
_name = "auction.payer"
|
||||
_description = "Auction payer"
|
||||
|
||||
def payer(self, cr, uid, ids, context):
|
||||
self.pool.get('auction.lots').write(cr, uid, context['active_ids'], {'is_ok':True, 'state':'paid'})
|
||||
return {}
|
||||
|
||||
auction_payer()
|
||||
|
||||
class auction_payer_sel(osv.osv_memory):
|
||||
"""
|
||||
For Mark as payment for seller
|
||||
"""
|
||||
_name = "auction.payer.sel"
|
||||
_description = "Auction payment for seller"
|
||||
|
||||
def payer_sel(self, cr, uid, ids, context):
|
||||
"""
|
||||
This function Update auction lots object and seller paid true.
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of auction payer sel’s IDs.
|
||||
"""
|
||||
self.pool.get('auction.lots').write(cr, uid, context['active_ids'], {'paid_vnd':True})
|
||||
return {}
|
||||
|
||||
auction_payer_sel()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_auction_payer" model="ir.ui.view">
|
||||
<field name="name">auction.payer.form</field>
|
||||
<field name="model">auction.payer</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Check payment for buyer">
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="2">
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon = "gtk-yes" string="Pay" name="payer" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_auction_payer_sel" model="ir.ui.view">
|
||||
<field name="name">auction.payer.sel.form</field>
|
||||
<field name="model">auction.payer.sel</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Check payment for seller">
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-yes" string="Pay" name="payer_sel" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<act_window name="Mark as paid for seller"
|
||||
res_model="auction.payer.sel"
|
||||
src_model="auction.lots"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_action_multi"
|
||||
id="action_auction_payer_sel"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -32,10 +32,10 @@ class auction_taken(osv.osv_memory):
|
||||
"""
|
||||
_name = "auction.taken"
|
||||
_description = "Auction taken"
|
||||
|
||||
_columns = {
|
||||
'lot_ids':fields.many2many('auction.lots', 'auction_taken_rel', 'taken_id', 'lot_id', 'Lots Emportes'),
|
||||
|
||||
}
|
||||
'lot_ids':fields.many2many('auction.lots', 'auction_taken_rel', 'taken_id', 'lot_id', 'Lots Emportes'),
|
||||
}
|
||||
|
||||
def _to_xml(s):
|
||||
return s.replace('&','&').replace('<','<').replace('>','>')
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_auction_taken" model="ir.ui.view">
|
||||
<field name="name">auction.taken.form</field>
|
||||
<field name="model">auction.taken</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Mark Lots">
|
||||
<group colspan="4" >
|
||||
<label string="Select lots which are Sold" colspan="4"/>
|
||||
<field name="lot_ids" nolabel="1" colspan="4" domain="[('state','=','sold')]"/>
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<button icon="gtk-ok" string="OK" name="process" type="object" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_auction_taken" model="ir.actions.act_window">
|
||||
<field name="name">Gestion emporte</field>
|
||||
<field name="res_model">auction.taken</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_auction_taken"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<!-- <menuitem name="Tools Bar Codes"
|
||||
id="auction_outils_menu"
|
||||
parent="auction_menu_root" sequence="5"
|
||||
/>
|
||||
<menuitem name="Deliveries Management"
|
||||
action="action_auction_taken"
|
||||
id="menu_wizard_emporte"
|
||||
parent="auction_outils_menu"
|
||||
/> -->
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,86 @@
|
||||
# -*- 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import osv
|
||||
from osv import fields
|
||||
|
||||
class auction_transfer_unsold_object(osv.osv):
|
||||
'''
|
||||
Open ERP Model
|
||||
'''
|
||||
_name = 'auction.transfer.unsold.object'
|
||||
_description = 'To transfer unsold objects'
|
||||
|
||||
_columns = {
|
||||
'auction_id_from':fields.many2one('auction.dates', 'From Auction Date', required=True),
|
||||
'auction_id_to':fields.many2one('auction.dates', 'To Auction Date', required=True),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'auction_id_from': _start,
|
||||
}
|
||||
|
||||
def _start(self, cr, uid, context):
|
||||
"""
|
||||
To initialize auction_id_from
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param ids: List of IDs selected
|
||||
@param context: A standard dictionary
|
||||
@return: auction_id_from
|
||||
"""
|
||||
lots_obj = self.pool.get('auction.lots')
|
||||
rec = lots_obj.browse(cr, uid, context['active_id'], context)
|
||||
auction_from = rec and rec.auction_id.id or False
|
||||
return auction_from
|
||||
|
||||
def transfer_unsold_object(self, cr, uid, ids, context):
|
||||
"""
|
||||
To Transfer the unsold object
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param ids: List of IDs selected
|
||||
@param context: A standard dictionary
|
||||
@return:
|
||||
"""
|
||||
bid_line_obj = self.pool.get('auction.bid_line')
|
||||
lots_obj = self.pool.get('auction.lots')
|
||||
lot_history_obj = self.pool.get('auction.lot.history')
|
||||
line_ids= bid_line_obj.search(cr,uid,[('lot_id','in',context['active_ids'])])
|
||||
bid_line_obj.unlink(cr, uid, line_ids)
|
||||
|
||||
res = self.browse(cr, uid, ids)
|
||||
unsold_ids = lots_obj.search(cr,uid,[('auction_id','=',res[0].auction_id_from.id),('state','=','unsold')])
|
||||
for rec in lots_obj.browse(cr, uid, unsold_ids, context):
|
||||
new_id = lot_history_obj.create(cr,uid,{'auction_id':rec.auction_id.id,'lot_id':rec.id,'price': rec.obj_ret, 'name': rec.auction_id.auction1})
|
||||
up_auction = lots_obj.write(cr,uid,[rec.id],{'auction_id': res[0].auction_id_to.id,
|
||||
'obj_ret':None,
|
||||
'obj_price':None,
|
||||
'ach_login':None,
|
||||
'ach_uid':None,
|
||||
'ach_inv_id':None,
|
||||
'sel_inv_id':None,
|
||||
'state':'draft'})
|
||||
return {}
|
||||
|
||||
auction_transfer_unsold_object()
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="name_form" model="ir.ui.view">
|
||||
<field name="name">auction.transfer.unsold.object.form</field>
|
||||
<field name="model">auction.transfer.unsold.object</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Draft To Posted">
|
||||
<group col="1" colspan="2">
|
||||
<separator colspan="4" string="Transfer unsold Object: Current auction date to another " />
|
||||
</group>
|
||||
<newline/>
|
||||
<field name="auction_id_from" select="1"/>
|
||||
<newline/>
|
||||
<field name="auction_id_to" select="1"/>
|
||||
<button icon='gtk-cancel' special="cancel"
|
||||
string="Cancel" />
|
||||
<button name="transfer_unsold_object" string="Transfer"
|
||||
colspan="1" type="object" icon="gtk-ok" />
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,91 +0,0 @@
|
||||
# -*- 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 wizard
|
||||
import netsvc
|
||||
import pooler
|
||||
|
||||
paid_form = '''<?xml version="1.0"?>
|
||||
<form string="Cancel Payment">
|
||||
<label string="Are you sure you want to refund this invoice ?"/>
|
||||
</form>'''
|
||||
fields_ask = {
|
||||
}
|
||||
#
|
||||
#def _get_value(self,cr,uid, datas,context={}):
|
||||
## service = netsvc.LocalService("object_proxy")
|
||||
# lots=pool.get('auction.lots').browse(cr,uid,data['id'],context)
|
||||
#
|
||||
#
|
||||
## lots = service.execute(cr.dbname,uid, 'auction.lots', 'read', datas['ids'])
|
||||
#
|
||||
# ids = []
|
||||
# pay_ids = {}
|
||||
# price = 0.0
|
||||
# price_paid = 0.0
|
||||
# uid = False
|
||||
#
|
||||
##TODO: refuse if several payments?
|
||||
# for lot in lots:
|
||||
# price += lot['obj_price']
|
||||
#
|
||||
# # add all the buyer costs
|
||||
# costs = service.execute(cr.dbname,uid, 'auction.lots', 'compute_buyer_costs', [lot['id']])
|
||||
# for cost in costs:
|
||||
# price += cost['amount']
|
||||
#
|
||||
##TODO: pr bien faire, faudrait leur poser la question: continue anyway?
|
||||
# if len(ids)<len(datas['ids']):
|
||||
# raise wizard.except_wizard('UserError', ('Some object(s) are not paid !', 'init'))
|
||||
#
|
||||
# return {'objects':len(ids), 'amount_total':price, 'amount_paid':price_paid}
|
||||
#
|
||||
#def _cancel(self, uid, datas):
|
||||
# service = netsvc.LocalService("object_proxy")
|
||||
# lots = service.execute(cr.dbname,uid, 'auction.lots', 'lots_cancel_payment', datas['ids'])
|
||||
# return {}
|
||||
#
|
||||
|
||||
def _cancel(self,cr,uid,data,context):
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
lot = pool.get('auction.lots').browse(cr,uid,data['id'],context)
|
||||
if lot.ach_inv_id:
|
||||
p=pool.get('account.invoice').refund(['lot.ach_inv_id.id'],context)
|
||||
if lot.vnd_inv_id:
|
||||
p=pool.get('account.invoice').refund(['lot.vnd_inv_id.id'],context)
|
||||
return {}
|
||||
|
||||
class wiz_auc_lots_cancel(wizard.interface):
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type': 'form', 'arch':paid_form, 'fields': fields_ask, 'state':[('make_cancel','Cancel Payment'), ('end','Cancel')]}
|
||||
},
|
||||
'make_cancel': {
|
||||
'actions': [_cancel],
|
||||
'result': {'type': 'state', 'state':'end'}
|
||||
}
|
||||
}
|
||||
wiz_auc_lots_cancel('auction.lots.cancel');
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
# -*- 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 wizard
|
||||
import netsvc
|
||||
import netsvc
|
||||
import osv
|
||||
import time
|
||||
import pooler
|
||||
|
||||
pay_form = '''<?xml version="1.0"?>
|
||||
<form string="Check payment for buyer">
|
||||
</form>'''
|
||||
pay_fields = {
|
||||
}
|
||||
|
||||
|
||||
pay_form1 = '''<?xml version="1.0"?>
|
||||
<form string="Check payment for seller">
|
||||
</form>'''
|
||||
pay_fields1 = {
|
||||
}
|
||||
def _payer(self, cr, uid, data, context):
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
pool.get('auction.lots').write(cr,uid,data['ids'],{'is_ok':True, 'state':'paid'})
|
||||
return {}
|
||||
|
||||
|
||||
def _payer_sel(self, cr, uid, data, context):
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
pool.get('auction.lots').write(cr,uid,data['ids'],{'paid_vnd':True})
|
||||
return {}
|
||||
|
||||
|
||||
class wiz_auc_pay(wizard.interface):
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type': 'form', 'arch':pay_form, 'fields': pay_fields, 'state':[('end','Cancel'),('pay','Pay')]}
|
||||
},
|
||||
'pay': {
|
||||
'actions': [_payer],
|
||||
'result': {'type': 'state', 'state':'end'}
|
||||
}}
|
||||
wiz_auc_pay('auction.payer')
|
||||
|
||||
|
||||
class wiz_auc_pay_sel(wizard.interface):
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type': 'form', 'arch':pay_form1, 'fields': pay_fields1, 'state':[('end','Cancel'),('pay2','Pay')]}
|
||||
},
|
||||
'pay2': {
|
||||
'actions': [_payer_sel],
|
||||
'result': {'type': 'state', 'state':'end'}
|
||||
}}
|
||||
wiz_auc_pay_sel('auction.payer.sel')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
# -*- 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
|
||||
import wizard
|
||||
import netsvc
|
||||
import pooler
|
||||
from osv.orm import browse_record
|
||||
import sql_db
|
||||
|
||||
transfer_unsold_object_form = """<?xml version="1.0"?>
|
||||
<form string="Draft To Posted">
|
||||
<group col="1" colspan="2">
|
||||
<separator colspan="4" string="Transfer unsold Object: Current auction date to another " />
|
||||
</group>
|
||||
<newline/>
|
||||
<field name="auction_id_from"/>
|
||||
<newline/>
|
||||
<field name="auction_id_to"/>
|
||||
</form>
|
||||
"""
|
||||
|
||||
transfer_unsold_object_fields = {
|
||||
'auction_id_from': {'string':'From Auction Date', 'type':'many2one', 'required':True, 'relation':'auction.dates'},
|
||||
'auction_id_to': {'string':'To Auction Date', 'type':'many2one', 'required':True, 'relation':'auction.dates'},
|
||||
}
|
||||
|
||||
def _start(self,cr,uid,data,context):
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
rec=pool.get('auction.lots').browse(cr,uid,data['id'],context)
|
||||
auction_from= rec and rec.auction_id.id or False
|
||||
return {'auction_id_from':auction_from}
|
||||
|
||||
def _transfer_unsold_object(self, cr, uid, data, context):
|
||||
#if not (data['form']['auction_id_to']) :
|
||||
# return {}
|
||||
#Historique de l objet + changement de l auction date + supp des bid line
|
||||
line_ids= pooler.get_pool(cr.dbname).get('auction.bid_line').search(cr,uid,[('lot_id','in',data['ids'])])
|
||||
pooler.get_pool(cr.dbname).get('auction.bid_line').unlink(cr, uid, line_ids)
|
||||
|
||||
obj_pool = pooler.get_pool(cr.dbname).get('auction.lots')
|
||||
ids= obj_pool.search(cr,uid,[('auction_id','=',data['form']['auction_id_from']),('state','=','unsold')])
|
||||
for rec in obj_pool.browse(cr, uid, ids, context):
|
||||
new_id=pooler.get_pool(cr.dbname).get('auction.lot.history').create(cr,uid,{'auction_id':rec.auction_id.id,'lot_id':rec.id,'price': rec.obj_ret, 'name': 'reasons'+rec.auction_id.auction1})
|
||||
up_auction=pooler.get_pool(cr.dbname).get('auction.lots').write(cr,uid,[rec.id],{'auction_id':data['form']['auction_id_to'],
|
||||
'obj_ret':None,
|
||||
'obj_price':None,
|
||||
'ach_login':None,
|
||||
'ach_uid':None,
|
||||
'ach_inv_id':None,
|
||||
'sel_inv_id':None,
|
||||
'state':'draft'})
|
||||
|
||||
# new_id = self.pool.get('auction.lot.history').copy(cr, uid, m.id, {'price': recs.obj_ret, 'name': 'reasons'+recs.auction_id.name})
|
||||
# new_id=pooler.get_pool(cr.dbname).get('auction.lot.history').create(cr,uid,{'auction_id':rec.auction_id,'lot_id':rec.name,'price': rec.obj_ret, 'name': 'reasons'+rec.auction_id.auction1})
|
||||
return {}
|
||||
|
||||
class transfer_object(wizard.interface):
|
||||
states = {
|
||||
'init' : {
|
||||
'actions' : [_start],
|
||||
'result' : {'type' : 'form',
|
||||
'arch' : transfer_unsold_object_form,
|
||||
'fields' :transfer_unsold_object_fields,
|
||||
'state' : [('transfer', 'Transfer'),('end', 'Cancel') ]}
|
||||
},
|
||||
'transfer' : {
|
||||
'actions' : [_transfer_unsold_object],
|
||||
'result' : {'type' : 'state','state' : 'end'}
|
||||
},
|
||||
}
|
||||
transfer_object('auction.lots.transfer.unsold.object')
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -37,12 +37,17 @@ months = {
|
||||
|
||||
def get_recurrent_dates(rrulestring, exdate, startdate=None):
|
||||
"""
|
||||
Get recurrent dates
|
||||
Get recurrent dates based on Rule string considering exdate and start date
|
||||
@param rrulestring: Rulestring
|
||||
@param exdate: List of exception dates for rrule
|
||||
@param startdate: Startdate for computing recurrent dates
|
||||
@return: List of Recurrent dates
|
||||
"""
|
||||
|
||||
def todate(date):
|
||||
val = parser.parse(''.join((re.compile('\d')).findall(date)))
|
||||
return val
|
||||
|
||||
if not startdate:
|
||||
startdate = datetime.now()
|
||||
rset1 = rrule.rrulestr(rrulestring, dtstart=startdate, forceset=True)
|
||||
@@ -55,12 +60,14 @@ def get_recurrent_dates(rrulestring, exdate, startdate=None):
|
||||
|
||||
def base_calendar_id2real_id(base_calendar_id=None, with_date=False):
|
||||
"""
|
||||
Convert base calendar id into real id.
|
||||
@return: base calendar id
|
||||
This function converts virtual event id into real id of actual event
|
||||
@param base_calendar_id: Id of calendar
|
||||
@param with_date: If value passed to this param it will return dates based on value of withdate + base_calendar_id
|
||||
"""
|
||||
|
||||
if base_calendar_id and isinstance(base_calendar_id, (str, unicode)):
|
||||
res = base_calendar_id.split('-')
|
||||
|
||||
if len(res) >= 2:
|
||||
real_id = res[0]
|
||||
if with_date:
|
||||
@@ -70,11 +77,14 @@ def base_calendar_id2real_id(base_calendar_id=None, with_date=False):
|
||||
end = start + timedelta(hours=with_date)
|
||||
return (int(real_id), real_date, end.strftime("%Y-%m-%d %H:%M:%S"))
|
||||
return int(real_id)
|
||||
|
||||
return base_calendar_id and int(base_calendar_id) or base_calendar_id
|
||||
|
||||
def real_id2base_calendar_id(real_id, recurrent_date):
|
||||
"""
|
||||
Convert real id into base_calendar_id.
|
||||
Convert real id of record into virtual id using recurrent_date
|
||||
e.g. real id is 1 and recurrent_date is 01-12-2009 10:00:00 then it will return
|
||||
1-20091201100000
|
||||
@return: real id with recurrent date.
|
||||
"""
|
||||
|
||||
@@ -609,6 +619,7 @@ are both optional, but if one occurs, so MUST the other"""),
|
||||
cr.execute('Update %s set base_calendar_alarm_id=%s, alarm_id=%s \
|
||||
where id=%s' % (model_obj._table, \
|
||||
alarm_id, basic_alarm.id, data.id))
|
||||
cr.commit()
|
||||
return True
|
||||
|
||||
def do_alarm_unlink(self, cr, uid, ids, model, context={}):
|
||||
@@ -812,6 +823,82 @@ class calendar_event(osv.osv):
|
||||
value['date_deadline'] = end.strftime("%Y-%m-%d %H:%M:%S")
|
||||
return {'value': value}
|
||||
|
||||
def _set_rrulestring(self, cr, uid, id, name, value, arg, context):
|
||||
"""
|
||||
Set rule string.
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param id: List of calendar event's ids.
|
||||
@param context: A standard dictionary for contextual values
|
||||
@return: dictionary of rrule value.
|
||||
"""
|
||||
cr.execute("UPDATE %s set freq='',interval=0,count=0,end_date=Null,\
|
||||
mo=False,tu=False,we=False,th=False,fr=False,sa=False,su=False,\
|
||||
day=0,select1=False,month_list=0 ,byday=False where id=%s" % (self._table, id))
|
||||
|
||||
if not value:
|
||||
return True
|
||||
val = {}
|
||||
for part in value.split(';'):
|
||||
if part.lower().__contains__('freq') and len(value.split(';')) <=2:
|
||||
rrule_type = part.lower()[5:]
|
||||
break
|
||||
else:
|
||||
rrule_type = 'custom'
|
||||
break
|
||||
ans = value.split(';')
|
||||
for i in ans:
|
||||
val[i.split('=')[0].lower()] = i.split('=')[1].lower()
|
||||
if int(val.get('interval')) > 1: #If interval is other than 1 rule is custom
|
||||
rrule_type = 'custom'
|
||||
|
||||
qry = "UPDATE %(table)s set rrule_type=\'%(rule_type)s\' "
|
||||
|
||||
if rrule_type == 'custom':
|
||||
new_val = val.copy()
|
||||
for k, v in val.items():
|
||||
if val['freq'] == 'weekly' and val.get('byday'):
|
||||
for day in val['byday'].split(','):
|
||||
new_val[day] = True
|
||||
val.pop('byday')
|
||||
|
||||
if val.get('until'):
|
||||
until = parser.parse(''.join((re.compile('\d')).findall(val.get('until'))))
|
||||
new_val['end_date'] = until.strftime('%Y-%m-%d')
|
||||
val.pop('until')
|
||||
new_val.pop('until')
|
||||
|
||||
if val.get('bymonthday'):
|
||||
new_val['day'] = val.get('bymonthday')
|
||||
val.pop('bymonthday')
|
||||
new_val['select1'] = 'date'
|
||||
new_val.pop('bymonthday')
|
||||
|
||||
if val.get('byday'):
|
||||
d = val.get('byday')
|
||||
new_val['byday'] = d[:1]
|
||||
new_val['week_list'] = d[1:].upper()
|
||||
new_val['select1'] = 'day'
|
||||
|
||||
if val.get('bymonth'):
|
||||
new_val['month_list'] = val.get('bymonth')
|
||||
val.pop('bymonth')
|
||||
new_val.pop('bymonth')
|
||||
|
||||
for k, v in new_val.items():
|
||||
temp = ", %s='%s'" % (k, v)
|
||||
qry += temp
|
||||
|
||||
whr = " where id=%(id)s"
|
||||
qry = qry + whr
|
||||
val.update({
|
||||
'table': self._table,
|
||||
'rule_type': rrule_type,
|
||||
'id': id,
|
||||
})
|
||||
cr.execute(qry % val)
|
||||
return True
|
||||
|
||||
def _get_rulestring(self, cr, uid, ids, name, arg, context=None):
|
||||
"""
|
||||
Get rule string.
|
||||
@@ -823,7 +910,7 @@ class calendar_event(osv.osv):
|
||||
"""
|
||||
result = {}
|
||||
for event in ids:
|
||||
|
||||
|
||||
datas = self.read(cr, uid, event)
|
||||
if datas.get('rrule_type'):
|
||||
if datas.get('rrule_type') == 'none':
|
||||
@@ -859,7 +946,7 @@ class calendar_event(osv.osv):
|
||||
'exrule': fields.char('Exception Rule', size=352, help="defines a \
|
||||
rule or repeating pattern for anexception to a recurrence set"),
|
||||
'rrule': fields.function(_get_rulestring, type='char', size=124, method=True,\
|
||||
string='Recurrent Rule', store=True),
|
||||
string='Recurrent Rule', store=True, fnct_inv=_set_rrulestring),
|
||||
'rrule_type': fields.selection([('none', ''), ('daily', 'Daily'), \
|
||||
('weekly', 'Weekly'), ('monthly', 'Monthly'), \
|
||||
('yearly', 'Yearly'), ('custom', 'Custom')], 'Recurrency'),
|
||||
@@ -1060,9 +1147,12 @@ class calendar_event(osv.osv):
|
||||
freq = datas.get('freq')
|
||||
if freq == 'None':
|
||||
return ''
|
||||
|
||||
if datas.get('interval') < 1:
|
||||
raise osv.except_osv(_('Error!'), ("Please select proper Interval"))
|
||||
|
||||
if freq == 'weekly':
|
||||
|
||||
|
||||
byday = map(lambda x: x.upper(), filter(lambda x: datas.get(x) and x in weekdays, datas))
|
||||
if byday:
|
||||
weekstring = ';BYDAY=' + ','.join(byday)
|
||||
@@ -1096,6 +1186,7 @@ class calendar_event(osv.osv):
|
||||
# End logic
|
||||
return rrule_string
|
||||
|
||||
|
||||
def search(self, cr, uid, args, offset=0, limit=100, order=None,
|
||||
context=None, count=False):
|
||||
"""
|
||||
@@ -1446,10 +1537,8 @@ class virtual_report_spool(web_services.report_spool):
|
||||
new_ids = []
|
||||
for id in ids:
|
||||
new_ids.append(base_calendar_id2real_id(id))
|
||||
if datas is None:
|
||||
datas = {}
|
||||
if datas.get('id',False):
|
||||
datas['id'] = base_calendar_id2real_id(datas['id'])
|
||||
if datas.get('id', False):
|
||||
datas['id'] = base_calendar_id2real_id(datas['id'])
|
||||
return super(virtual_report_spool, self).exp_report(db, uid, object, new_ids, datas, context)
|
||||
|
||||
virtual_report_spool()
|
||||
@@ -1506,4 +1595,3 @@ class res_users(osv.osv):
|
||||
res_users()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -8,13 +8,13 @@ msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
|
||||
"PO-Revision-Date: 2009-09-08 13:58+0000\n"
|
||||
"Last-Translator: ekodaq <ceo@ekosdaq.com>\n"
|
||||
"PO-Revision-Date: 2010-04-04 03:13+0000\n"
|
||||
"Last-Translator: Bundo <bundo@bundo.biz>\n"
|
||||
"Language-Team: Korean <ko@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2010-03-30 03:59+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-05 03:53+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: base_contact
|
||||
@@ -31,7 +31,7 @@ msgstr ""
|
||||
#: constraint:ir.model:0
|
||||
msgid ""
|
||||
"The Object name must start with x_ and not contain any special character !"
|
||||
msgstr ""
|
||||
msgstr "오브젝트 이름은 x_로 시작해야 하며, 특수 문자를 포함하면 안 됩니다 !"
|
||||
|
||||
#. module: base_contact
|
||||
#: field:res.partner.job,function_id:0
|
||||
@@ -81,12 +81,12 @@ msgstr ""
|
||||
#. module: base_contact
|
||||
#: constraint:ir.actions.act_window:0
|
||||
msgid "Invalid model name in the action definition."
|
||||
msgstr ""
|
||||
msgstr "액션 정의에서 유효하지 않은 모델 이름"
|
||||
|
||||
#. module: base_contact
|
||||
#: model:process.transition,name:base_contact.process_transition_partnertoaddress0
|
||||
msgid "Partner to address"
|
||||
msgstr ""
|
||||
msgstr "파트너 주소"
|
||||
|
||||
#. module: base_contact
|
||||
#: view:res.partner.address:0
|
||||
@@ -126,7 +126,7 @@ msgstr "연락처와 기능 정의"
|
||||
#. module: base_contact
|
||||
#: field:res.partner.contact,title:0
|
||||
msgid "Title"
|
||||
msgstr "타이틀"
|
||||
msgstr "제목"
|
||||
|
||||
#. module: base_contact
|
||||
#: view:res.partner.job:0
|
||||
@@ -189,12 +189,12 @@ msgstr "주업"
|
||||
#. module: base_contact
|
||||
#: view:res.partner:0
|
||||
msgid "Categories"
|
||||
msgstr "카테고리"
|
||||
msgstr "항목"
|
||||
|
||||
#. module: base_contact
|
||||
#: field:res.partner.contact,function_id:0
|
||||
msgid "Main Function"
|
||||
msgstr ""
|
||||
msgstr "주요 기능"
|
||||
|
||||
#. module: base_contact
|
||||
#: model:process.transition,note:base_contact.process_transition_partnertoaddress0
|
||||
@@ -204,7 +204,7 @@ msgstr "파트너와 주소 정의"
|
||||
#. module: base_contact
|
||||
#: constraint:ir.ui.view:0
|
||||
msgid "Invalid XML for View Architecture!"
|
||||
msgstr ""
|
||||
msgstr "유효하지 않은 아키텍처를 위한 XML 보기!"
|
||||
|
||||
#. module: base_contact
|
||||
#: model:process.process,name:base_contact.process_process_basecontactprocess0
|
||||
@@ -219,17 +219,17 @@ msgstr "시퀀스"
|
||||
#. module: base_contact
|
||||
#: field:res.partner.job,extension:0
|
||||
msgid "Extension"
|
||||
msgstr "익스텐션"
|
||||
msgstr "확장기능"
|
||||
|
||||
#. module: base_contact
|
||||
#: field:res.partner.contact,mobile:0
|
||||
msgid "Mobile"
|
||||
msgstr "모바일"
|
||||
msgstr "휴대전화"
|
||||
|
||||
#. module: base_contact
|
||||
#: help:res.partner.job,extension:0
|
||||
msgid "Internal/External extension phone number"
|
||||
msgstr "내부/외부 익스텐션 전화 번호"
|
||||
msgstr "내부/외부 확장 전화 번호"
|
||||
|
||||
#. module: base_contact
|
||||
#: model:process.node,note:base_contact.process_node_contacts0
|
||||
@@ -239,7 +239,7 @@ msgstr "함께 일하는 사람들"
|
||||
#. module: base_contact
|
||||
#: view:res.partner.contact:0
|
||||
msgid "Extra Information"
|
||||
msgstr "기타 정보"
|
||||
msgstr "추가 정보"
|
||||
|
||||
#. module: base_contact
|
||||
#: view:res.partner.contact:0
|
||||
@@ -255,7 +255,7 @@ msgstr "활성"
|
||||
#. module: base_contact
|
||||
#: field:res.partner.job,contact_id:0
|
||||
msgid "Contact"
|
||||
msgstr "연락"
|
||||
msgstr "연락처"
|
||||
|
||||
#. module: base_contact
|
||||
#: model:process.node,note:base_contact.process_node_partners0
|
||||
@@ -270,7 +270,7 @@ msgstr "주 고용자"
|
||||
#. module: base_contact
|
||||
#: model:process.transition,name:base_contact.process_transition_functiontoaddress0
|
||||
msgid "Function to address"
|
||||
msgstr ""
|
||||
msgstr "기능 주소"
|
||||
|
||||
#. module: base_contact
|
||||
#: model:ir.actions.act_window,name:base_contact.act_res_partner_jobs
|
||||
|
||||
@@ -48,6 +48,7 @@ between mails and Open ERP.""",
|
||||
'process',
|
||||
'mail_gateway',
|
||||
'base_calendar',
|
||||
'resource',
|
||||
],
|
||||
'init_xml': ['crm_data.xml',
|
||||
'crm_meeting_data.xml',
|
||||
@@ -73,7 +74,6 @@ between mails and Open ERP.""",
|
||||
|
||||
'wizard/crm_send_email_view.xml',
|
||||
'wizard/crm_email_add_cc_view.xml',
|
||||
'crm_wizard.xml',
|
||||
'crm_view.xml',
|
||||
|
||||
'crm_action_rule_view.xml',
|
||||
|
||||
+21
-24
@@ -63,6 +63,7 @@ class crm_case_section(osv.osv):
|
||||
in the 'Reply-To' of all emails sent by Open ERP about cases in this sales team"),
|
||||
'parent_id': fields.many2one('crm.case.section', 'Parent Section'),
|
||||
'child_ids': fields.one2many('crm.case.section', 'parent_id', 'Child Sections'),
|
||||
'resource_calendar_id': fields.many2one('resource.calendar', "Resource's Calendar"),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
@@ -130,7 +131,7 @@ class crm_case_categ(osv.osv):
|
||||
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
|
||||
'object_id': fields.many2one('ir.model', 'Object Name'),
|
||||
}
|
||||
|
||||
|
||||
def _find_object_id(self, cr, uid, context=None):
|
||||
|
||||
"""
|
||||
@@ -143,8 +144,8 @@ class crm_case_categ(osv.osv):
|
||||
object_id = context and context.get('object_id', False) or False
|
||||
ids = self.pool.get('ir.model').search(cr, uid, [('model', '=', object_id)])
|
||||
return ids and ids[0]
|
||||
|
||||
_defaults = {
|
||||
|
||||
_defaults = {
|
||||
'object_id' : _find_object_id
|
||||
}
|
||||
#
|
||||
@@ -163,7 +164,7 @@ class crm_case_resource_type(osv.osv):
|
||||
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
|
||||
'object_id': fields.many2one('ir.model', 'Object Name'),
|
||||
}
|
||||
|
||||
|
||||
def _find_object_id(self, cr, uid, context=None):
|
||||
"""
|
||||
@param self: The object pointer
|
||||
@@ -203,7 +204,7 @@ class crm_case_stage(osv.osv):
|
||||
help="Change Probability on next and previous stages."),
|
||||
'requirements': fields.text('Requirements')
|
||||
}
|
||||
|
||||
|
||||
def _find_object_id(self, cr, uid, context=None):
|
||||
|
||||
"""
|
||||
@@ -352,7 +353,7 @@ class crm_case(osv.osv):
|
||||
\nIf the case needs to be reviewed then the state is set to \'Pending\'.'),
|
||||
'company_id': fields.many2one('res.company', 'Company'),
|
||||
}
|
||||
|
||||
|
||||
def _get_default_partner_address(self, cr, uid, context):
|
||||
|
||||
"""
|
||||
@@ -502,8 +503,8 @@ class crm_case(osv.osv):
|
||||
s[section] = dict([(v, k) for (k, v) in s[section].iteritems()])
|
||||
if st in s[section]:
|
||||
self.write(cr, uid, [case.id], {'stage_id': s[section][st]})
|
||||
return True
|
||||
|
||||
return True
|
||||
|
||||
def history(self, cr, uid, ids, keyword, history=False, email=False, details=None, context={}):
|
||||
"""
|
||||
@param self: The object pointer
|
||||
@@ -551,7 +552,7 @@ class crm_case(osv.osv):
|
||||
(case.section_id and case.section_id.reply_to) or \
|
||||
(case.user_id and case.user_id.address_id and \
|
||||
case.user_id.address_id.email) or tools.config.get('email_from',False)
|
||||
res = obj.create(cr, uid, data, context)
|
||||
res = obj.create(cr, uid, data, context)
|
||||
return True
|
||||
_history = __history
|
||||
|
||||
@@ -630,7 +631,7 @@ class crm_case(osv.osv):
|
||||
self.__history(cr, uid, cases, _('Send'), history=True, email=False)
|
||||
for case in cases:
|
||||
self.write(cr, uid, [case.id], {
|
||||
'description': False,
|
||||
'description': False,
|
||||
})
|
||||
emails = [case.email_from] + (case.email_cc or '').split(',')
|
||||
emails = filter(None, emails)
|
||||
@@ -644,11 +645,11 @@ class crm_case(osv.osv):
|
||||
_("No E-Mail ID Found for your Company address!"))
|
||||
|
||||
tools.email_send(
|
||||
emailfrom,
|
||||
emails,
|
||||
'[' + str(case.id) + '] ' + case.name,
|
||||
self.format_body(body),
|
||||
reply_to = case.section_id.reply_to,
|
||||
emailfrom,
|
||||
emails,
|
||||
'[' + str(case.id) + '] ' + case.name,
|
||||
self.format_body(body),
|
||||
reply_to = case.section_id.reply_to,
|
||||
openobject_id = str(case.id)
|
||||
)
|
||||
self.__history(cr, uid, [case], _('Send'), history=True, email=emails, details=body, email_from=emailfrom)
|
||||
@@ -687,7 +688,6 @@ class crm_case(osv.osv):
|
||||
return {'value': data}
|
||||
|
||||
def case_close(self, cr, uid, ids, *args):
|
||||
|
||||
"""
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@@ -707,7 +707,6 @@ class crm_case(osv.osv):
|
||||
return True
|
||||
|
||||
def case_escalate(self, cr, uid, ids, *args):
|
||||
|
||||
"""
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@@ -734,7 +733,6 @@ class crm_case(osv.osv):
|
||||
|
||||
|
||||
def case_open(self, cr, uid, ids, *args):
|
||||
|
||||
"""
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@@ -755,7 +753,6 @@ class crm_case(osv.osv):
|
||||
|
||||
|
||||
def case_cancel(self, cr, uid, ids, *args):
|
||||
|
||||
"""
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@@ -816,11 +813,11 @@ class crm_case_log(osv.osv):
|
||||
_order = "id desc"
|
||||
_columns = {
|
||||
'name': fields.char('Status', size=64),
|
||||
'date': fields.datetime('Date'),
|
||||
'section_id': fields.many2one('crm.case.section', 'Section'),
|
||||
'user_id': fields.many2one('res.users', 'User Responsible', readonly=True),
|
||||
'model_id': fields.many2one('ir.model', "Model"),
|
||||
'res_id': fields.integer('Resource ID'),
|
||||
'date': fields.datetime('Date'),
|
||||
'section_id': fields.many2one('crm.case.section', 'Section'),
|
||||
'user_id': fields.many2one('res.users', 'User Responsible', readonly=True),
|
||||
'model_id': fields.many2one('ir.model', "Model"),
|
||||
'res_id': fields.integer('Resource ID'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
|
||||
+82
-71
@@ -23,6 +23,8 @@ from osv import fields, osv, orm
|
||||
from datetime import datetime, timedelta
|
||||
import crm
|
||||
import math
|
||||
import time
|
||||
from mx import DateTime
|
||||
from tools.translate import _
|
||||
|
||||
class crm_lead(osv.osv):
|
||||
@@ -33,8 +35,26 @@ class crm_lead(osv.osv):
|
||||
_order = "priority desc, id desc"
|
||||
_inherit = ['res.partner.address', 'crm.case']
|
||||
|
||||
def _compute_openday(self, cr, uid, ids, name, args, context={}):
|
||||
def case_open(self, cr, uid, ids, *args):
|
||||
"""
|
||||
@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's Ids
|
||||
@param *args: Give Tuple Value
|
||||
"""
|
||||
|
||||
cases = self.browse(cr, uid, ids)
|
||||
for case in cases:
|
||||
data = {'state': 'open', 'active': True}
|
||||
if not case.user_id:
|
||||
data['user_id'] = uid
|
||||
data.update({'date_open': time.strftime('%Y-%m-%d %H:%M:%S')})
|
||||
self.write(cr, uid, ids, data)
|
||||
self._action(cr, uid, cases, 'open')
|
||||
return True
|
||||
|
||||
def _compute_day(self, cr, uid, ids, fields, args, context={}):
|
||||
"""
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@@ -42,77 +62,68 @@ class crm_lead(osv.osv):
|
||||
@return: difference between current date and log date
|
||||
@param context: A standard dictionary for contextual values
|
||||
"""
|
||||
log_obj = self.pool.get('crm.case.log')
|
||||
model_obj = self.pool.get('ir.model')
|
||||
cal_obj = self.pool.get('resource.calendar')
|
||||
|
||||
result = {}
|
||||
for r in self.browse(cr, uid, ids , context):
|
||||
result[r.id] = 0
|
||||
model_id = self.pool.get('ir.model').search(cr, uid, [('model', '=', 'crm.lead')])
|
||||
log_obj = self.pool.get('crm.case.log')
|
||||
hist_id = log_obj.search(cr, uid, [('model_id', '=', model_id[0]), \
|
||||
('res_id', '=', r.id), \
|
||||
('name', '=', 'Open')])
|
||||
model_ids = model_obj.search(cr, uid, [('model', '=', self._name)])
|
||||
model_id = False
|
||||
if len(model_ids):
|
||||
model_id = model_ids[0]
|
||||
|
||||
if hist_id:
|
||||
# Considering last log for opening case
|
||||
log = log_obj.browse(cr, uid, hist_id[-1])
|
||||
date_lead_open = datetime.strptime(r.create_date, "%Y-%m-%d %H:%M:%S")
|
||||
date_log_open = datetime.strptime(log.date, "%Y-%m-%d %H:%M:%S")
|
||||
ans = date_lead_open - date_log_open
|
||||
duration = float(ans.days) + (float(ans.seconds) / 86400)
|
||||
result[r.id] = abs(int(duration))
|
||||
return result
|
||||
res = {}
|
||||
for lead in self.browse(cr, uid, ids , context):
|
||||
for field in fields:
|
||||
res[lead.id] = {}
|
||||
duration = 0
|
||||
if field == 'day_open':
|
||||
if lead.date_open:
|
||||
date_create = datetime.strptime(lead.create_date, "%Y-%m-%d %H:%M:%S")
|
||||
date_open = datetime.strptime(lead.date_open, "%Y-%m-%d %H:%M:%S")
|
||||
|
||||
def _compute_closeday(self, cr, uid, ids, name, args, context={}):
|
||||
ans = date_open - date_create
|
||||
duration = float(ans.days) + (float(ans.seconds) / 86400)
|
||||
|
||||
"""
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of closeday’s IDs
|
||||
@param context: A standard dictionary for contextual values
|
||||
@return: difference between current date and closed date
|
||||
"""
|
||||
elif field == 'day_close':
|
||||
if lead.date_closed:
|
||||
date_create = datetime.strptime(lead.create_date, "%Y-%m-%d %H:%M:%S")
|
||||
date_close = datetime.strptime(lead.date_closed, "%Y-%m-%d %H:%M:%S")
|
||||
|
||||
result = {}
|
||||
for r in self.browse(cr, uid, ids , context):
|
||||
result[r.id] = 0
|
||||
|
||||
if r.date_closed:
|
||||
date_create = datetime.strptime(r.create_date, "%Y-%m-%d %H:%M:%S")
|
||||
date_close = datetime.strptime(r.date_closed, "%Y-%m-%d %H:%M:%S")
|
||||
ans = date_close - date_create
|
||||
duration = float(ans.days) + (float(ans.seconds) / 86400)
|
||||
result[r.id] = abs(int(duration))
|
||||
return result
|
||||
ans = date_close - date_create
|
||||
duration = float(ans.days) + (float(ans.seconds) / 86400)
|
||||
res[lead.id][field] = abs(int(duration))
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
|
||||
'categ_id': fields.many2one('crm.case.categ', 'Lead Source', \
|
||||
domain="[('section_id','=',section_id),\
|
||||
('object_id.model', '=', 'crm.opportunity')]"),
|
||||
('object_id.model', '=', 'crm.opportunity')]"),
|
||||
'type_id': fields.many2one('crm.case.resource.type', 'Lead Type', \
|
||||
domain="[('section_id','=',section_id),\
|
||||
('object_id.model', '=', 'crm.lead')]"),
|
||||
'partner_name': fields.char("Contact Name", size=64),
|
||||
('object_id.model', '=', 'crm.lead')]"),
|
||||
'partner_name': fields.char("Contact Name", size=64),
|
||||
|
||||
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
|
||||
'date_closed': fields.datetime('Closed', readonly=True),
|
||||
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
|
||||
'date_closed': fields.datetime('Closed', readonly=True),
|
||||
'stage_id': fields.many2one('crm.case.stage', 'Stage', \
|
||||
domain="[('section_id','=',section_id),\
|
||||
('object_id.model', '=', 'crm.lead')]"),
|
||||
'opportunity_id': fields.many2one('crm.opportunity', 'Opportunity'),
|
||||
('object_id.model', '=', 'crm.lead')]"),
|
||||
'opportunity_id': fields.many2one('crm.opportunity', 'Opportunity'),
|
||||
|
||||
'user_id': fields.many2one('res.users', 'Salesman'),
|
||||
'referred': fields.char('Referred By', size=32),
|
||||
'day_open': fields.function(_compute_openday, string='Days to Open', \
|
||||
method=True, type="integer", store=True),
|
||||
'day_close': fields.function(_compute_closeday, string='Days to Close', \
|
||||
method=True, type="integer", store=True),
|
||||
'function_name' : fields.char('Function', size=64),
|
||||
'user_id': fields.many2one('res.users', 'Salesman'),
|
||||
'referred': fields.char('Referred By', size=32),
|
||||
'date_open': fields.datetime('Opened', readonly=True),
|
||||
'day_open': fields.function(_compute_day, string='Days to Open', \
|
||||
method=True, multi='day_open', type="integer", store=True),
|
||||
'day_close': fields.function(_compute_day, string='Days to Close', \
|
||||
method=True, multi='day_close', type="integer", store=True),
|
||||
'function_name': fields.char('Function', size=64),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.lead', context=c),
|
||||
'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
|
||||
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.lead', context=c),
|
||||
'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
|
||||
}
|
||||
|
||||
|
||||
@@ -144,29 +155,29 @@ class crm_lead(osv.osv):
|
||||
if data_id:
|
||||
view_id1 = data_obj.browse(cr, uid, data_id, context=context).res_id
|
||||
value = {
|
||||
'name': _('Create Partner'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form,tree',
|
||||
'res_model': 'crm.lead2opportunity.partner',
|
||||
'view_id': False,
|
||||
'context': context,
|
||||
'views': [(view_id1, 'form')],
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
'name': _('Create Partner'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form,tree',
|
||||
'res_model': 'crm.lead2opportunity.partner',
|
||||
'view_id': False,
|
||||
'context': context,
|
||||
'views': [(view_id1, 'form')],
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
'nodestroy': True
|
||||
}
|
||||
break
|
||||
else:
|
||||
value = {
|
||||
'name': _('Create Opportunity'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form,tree',
|
||||
'res_model': 'crm.lead2opportunity',
|
||||
'view_id': False,
|
||||
'context': context,
|
||||
'views': [(view_id, 'form')],
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
'name': _('Create Opportunity'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form,tree',
|
||||
'res_model': 'crm.lead2opportunity',
|
||||
'view_id': False,
|
||||
'context': context,
|
||||
'views': [(view_id, 'form')],
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
'nodestroy': True
|
||||
}
|
||||
return value
|
||||
|
||||
@@ -13,13 +13,12 @@
|
||||
<field eval="'Luc Latour'" name="name"/>
|
||||
<field eval="'open'" name="state"/>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field eval="'Michel Lafont'" name="partner_name2"/>
|
||||
<field eval="'(726) 782-0636'" name="partner_mobile"/>
|
||||
<field eval="'(726) 782-0636'" name="mobile"/>
|
||||
<field eval="1" name="active"/>
|
||||
<field name="categ_id" ref="crm.categ_oppor6"/>
|
||||
<field name="stage_id" ref="crm.stage_lead1"/>
|
||||
<field eval="'The Oil Company'" name="partner_name"/>
|
||||
<field eval="'(769) 703-274'" name="partner_phone"/>
|
||||
<field eval="'(769) 703-274'" name="phone"/>
|
||||
</record>
|
||||
<record id="crm_case_electonicgoodsdealer0" model="crm.lead">
|
||||
<field name="type_id" ref="crm.type_lead7"/>
|
||||
@@ -28,13 +27,12 @@
|
||||
<field eval="'Marc Dufour'" name="name"/>
|
||||
<field eval="'open'" name="state"/>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field eval="'Luc Latour'" name="partner_name2"/>
|
||||
<field eval="'(392) 895-7917'" name="partner_mobile"/>
|
||||
<field eval="'(392) 895-7917'" name="mobile"/>
|
||||
<field eval="1" name="active"/>
|
||||
<field name="categ_id" ref="crm.categ_oppor2"/>
|
||||
<field name="stage_id" ref="crm.stage_lead2"/>
|
||||
<field eval="'Le Club SARL'" name="partner_name"/>
|
||||
<field eval="'(956) 293-2595'" name="partner_phone"/>
|
||||
<field eval="'(956) 293-2595'" name="phone"/>
|
||||
</record>
|
||||
<record id="crm_case_developingwebapplications0" model="crm.lead">
|
||||
<field name="type_id" ref="crm.type_lead5"/>
|
||||
@@ -43,13 +41,12 @@
|
||||
<field eval="'Fabien Pinckaers'" name="name"/>
|
||||
<field eval="'done'" name="state"/>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field eval="'Mike Gardner'" name="partner_name2"/>
|
||||
<field eval="'(820) 167-3208'" name="partner_mobile"/>
|
||||
<field eval="'(820) 167-3208'" name="mobile"/>
|
||||
<field eval="1" name="active"/>
|
||||
<field name="categ_id" ref="crm.categ_oppor4"/>
|
||||
<field name="stage_id" ref="crm.stage_lead4"/>
|
||||
<field eval="'TheKompany'" name="partner_name"/>
|
||||
<field eval="'(079) 681-2139'" name="partner_phone"/>
|
||||
<field eval="'(079) 681-2139'" name="phone"/>
|
||||
<field eval="'contact@tecsas.fr'" name="email_from"/>
|
||||
</record>
|
||||
<record id="crm_case_qrecorp0" model="crm.lead">
|
||||
@@ -59,12 +56,12 @@
|
||||
<field eval="'Henry Mc Coy'" name="name"/>
|
||||
<field eval="'draft'" name="state"/>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field eval="'(077) 582-4035'" name="partner_mobile"/>
|
||||
<field eval="'(077) 582-4035'" name="mobile"/>
|
||||
<field eval="1" name="active"/>
|
||||
<field name="categ_id" ref="crm.categ_oppor1"/>
|
||||
<field name="stage_id" ref="crm.stage_lead1"/>
|
||||
<field eval="'The Gas Company'" name="partner_name"/>
|
||||
<field eval="'(514) 698-4118'" name="partner_phone"/>
|
||||
<field eval="'(514) 698-4118'" name="phone"/>
|
||||
</record>
|
||||
<record id="crm_case_itdeveloper0" model="crm.lead">
|
||||
<field name="type_id" ref="crm.type_lead4"/>
|
||||
@@ -73,13 +70,12 @@
|
||||
<field eval="'Carrie Helle'" name="name"/>
|
||||
<field eval="'pending'" name="state"/>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field eval="'Sam Stone'" name="partner_name2"/>
|
||||
<field eval="'(333) 715-1450'" name="partner_mobile"/>
|
||||
<field eval="'(333) 715-1450'" name="mobile"/>
|
||||
<field eval="1" name="active"/>
|
||||
<field name="categ_id" ref="crm.categ_oppor6"/>
|
||||
<field name="stage_id" ref="crm.stage_lead3"/>
|
||||
<field eval="'Stonage IT'" name="partner_name"/>
|
||||
<field eval="'(855) 924-4364'" name="partner_phone"/>
|
||||
<field eval="'(855) 924-4364'" name="phone"/>
|
||||
</record>
|
||||
<record id="crm_case_mgroperations0" model="crm.lead">
|
||||
<field name="partner_address_id" ref="base.res_partner_address_1"/>
|
||||
@@ -91,12 +87,11 @@
|
||||
<field eval="'Tina Pinero'" name="name"/>
|
||||
<field eval="'cancel'" name="state"/>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field eval="'Benoit Mortier'" name="partner_name2"/>
|
||||
<field eval="'(468) 017-2684'" name="partner_mobile"/>
|
||||
<field eval="'(468) 017-2684'" name="mobile"/>
|
||||
<field name="categ_id" ref="crm.categ_oppor8"/>
|
||||
<field name="stage_id" ref="crm.stage_lead6"/>
|
||||
<field eval="'Opensides SPRL'" name="partner_name"/>
|
||||
<field eval="'(373) 907-1009'" name="partner_phone"/>
|
||||
<field eval="'(373) 907-1009'" name="phone"/>
|
||||
<field eval="'info@opensides.be'" name="email_from"/>
|
||||
</record>
|
||||
<record id="crm_case_vpoperations0" model="crm.lead">
|
||||
@@ -107,12 +102,11 @@
|
||||
<field eval="'Wendi Baltz'" name="name"/>
|
||||
<field eval="'done'" name="state"/>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field eval="'Will Smith'" name="partner_name2"/>
|
||||
<field eval="'(463) 014-1208'" name="partner_mobile"/>
|
||||
<field eval="'(463) 014-1208'" name="mobile"/>
|
||||
<field name="categ_id" ref="crm.categ_oppor4"/>
|
||||
<field name="stage_id" ref="crm.stage_lead4"/>
|
||||
<field eval="'Gardner Group'" name="partner_name"/>
|
||||
<field eval="'(282) 603-7489'" name="partner_phone"/>
|
||||
<field eval="'(282) 603-7489'" name="phone"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -45,8 +45,8 @@
|
||||
name="convert_opportunity"
|
||||
string="Convert"
|
||||
help="Convert into Opportunity"
|
||||
icon="gtk-index"
|
||||
type="object"
|
||||
icon="gtk-index"
|
||||
type="object"
|
||||
attrs="{'invisible':[('opportunity_id','!=',False)]}"/>
|
||||
<newline />
|
||||
<field name="section_id" colspan="1"
|
||||
@@ -131,8 +131,8 @@
|
||||
<form string="Communication history">
|
||||
<group col="7" colspan="4">
|
||||
<field name="date"/>
|
||||
<field name="email_to"/>
|
||||
<field name="email_from"/>
|
||||
<field name="email_to"/>
|
||||
<field name="email_from"/>
|
||||
<button
|
||||
string="Add a CC"
|
||||
name="%(crm.action_view_crm_email_add_cc_wizard)d"
|
||||
@@ -174,6 +174,7 @@
|
||||
<field name="create_date"/>
|
||||
<field name="write_date"/>
|
||||
<field name="date_closed"/>
|
||||
<field name="date_open"/>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Statistics" colspan="2" col="2"/>
|
||||
|
||||
@@ -55,10 +55,8 @@
|
||||
<group col="8" colspan="4">
|
||||
<field name="freq" />
|
||||
<field name="interval" />
|
||||
<field name="count"
|
||||
attrs="{'required' : [('end_date','=',False)]}" />
|
||||
<field name="end_date"
|
||||
attrs="{'required' : [('count','<=',0), ('freq', '!=', 'None')]}" />
|
||||
<field name="count" />
|
||||
<field name="end_date" />
|
||||
</group>
|
||||
<group col="14" colspan="4" name="Select weekdays"
|
||||
attrs="{'invisible' : [('freq','!=','weekly')]}">
|
||||
|
||||
@@ -23,6 +23,7 @@ from datetime import datetime
|
||||
from osv import fields,osv,orm
|
||||
from tools.translate import _
|
||||
import crm
|
||||
import time
|
||||
|
||||
AVAILABLE_STATES = [
|
||||
('draft','New'),
|
||||
@@ -40,8 +41,26 @@ class crm_opportunity(osv.osv):
|
||||
_order = "id desc"
|
||||
_inherit = 'crm.case'
|
||||
|
||||
def _compute_openday(self, cr, uid, ids, name, args, context={}):
|
||||
def case_open(self, cr, uid, ids, *args):
|
||||
"""
|
||||
@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's Ids
|
||||
@param *args: Give Tuple Value
|
||||
"""
|
||||
|
||||
cases = self.browse(cr, uid, ids)
|
||||
for case in cases:
|
||||
data = {'state': 'open', 'active': True}
|
||||
if not case.user_id:
|
||||
data['user_id'] = uid
|
||||
data.update({'date_open': time.strftime('%Y-%m-%d %H:%M:%S')})
|
||||
self.write(cr, uid, ids, data)
|
||||
self._action(cr, uid, cases, 'open')
|
||||
return True
|
||||
|
||||
def _compute_day(self, cr, uid, ids, fields, args, context={}):
|
||||
"""
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@@ -49,45 +68,37 @@ class crm_opportunity(osv.osv):
|
||||
@return: difference between current date and log date
|
||||
@param context: A standard dictionary for contextual values
|
||||
"""
|
||||
result = {}
|
||||
for r in self.browse(cr, uid, ids , context):
|
||||
result[r.id] = 0
|
||||
model_id = self.pool.get('ir.model').search(cr, uid, [('model', '=', 'crm.opportunity')])
|
||||
log_obj = self.pool.get('crm.case.log')
|
||||
hist_id = log_obj.search(cr, uid, [('model_id', '=', model_id[0]), \
|
||||
('res_id', '=', r.id), \
|
||||
('name', '=', 'Open')])
|
||||
log_obj = self.pool.get('crm.case.log')
|
||||
model_obj = self.pool.get('ir.model')
|
||||
cal_obj = self.pool.get('resource.calendar')
|
||||
|
||||
if hist_id:
|
||||
# Considering last log for opening case
|
||||
log = log_obj.browse(cr, uid, hist_id[-1])
|
||||
date_lead_open = datetime.strptime(r.create_date, "%Y-%m-%d %H:%M:%S")
|
||||
date_log_open = datetime.strptime(log.date, "%Y-%m-%d %H:%M:%S")
|
||||
ans = date_lead_open - date_log_open
|
||||
duration = float(ans.days) + (float(ans.seconds) / 86400)
|
||||
result[r.id] = abs(int(duration))
|
||||
return result
|
||||
model_ids = model_obj.search(cr, uid, [('model', '=', self._name)])
|
||||
model_id = False
|
||||
if len(model_ids):
|
||||
model_id = model_ids[0]
|
||||
|
||||
def _compute_closeday(self, cr, uid, ids, name, args, context={}):
|
||||
res = {}
|
||||
for opportunity in self.browse(cr, uid, ids , context):
|
||||
for field in fields:
|
||||
res[opportunity.id] = {}
|
||||
duration = 0
|
||||
if field == 'day_open':
|
||||
if opportunity.date_open:
|
||||
date_create = datetime.strptime(opportunity.create_date, "%Y-%m-%d %H:%M:%S")
|
||||
date_open = datetime.strptime(opportunity.date_open, "%Y-%m-%d %H:%M:%S")
|
||||
|
||||
"""
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of closeday’s IDs
|
||||
@return: difference between current date and closed date
|
||||
@param context: A standard dictionary for contextual values
|
||||
"""
|
||||
result = {}
|
||||
for r in self.browse(cr, uid, ids , context):
|
||||
result[r.id] = 0
|
||||
ans = date_open - date_create
|
||||
duration = float(ans.days) + (float(ans.seconds) / 86400)
|
||||
|
||||
if r.date_closed:
|
||||
date_create = datetime.strptime(r.create_date, "%Y-%m-%d %H:%M:%S")
|
||||
date_close = datetime.strptime(r.date_closed, "%Y-%m-%d %H:%M:%S")
|
||||
ans = date_close - date_create
|
||||
duration = float(ans.days) + (float(ans.seconds) / 86400)
|
||||
result[r.id] = abs(int(duration))
|
||||
return result
|
||||
elif field == 'day_close':
|
||||
if opportunity.date_closed:
|
||||
date_create = datetime.strptime(opportunity.create_date, "%Y-%m-%d %H:%M:%S")
|
||||
date_close = datetime.strptime(opportunity.date_closed, "%Y-%m-%d %H:%M:%S")
|
||||
|
||||
ans = date_close - date_create
|
||||
duration = float(ans.days) + (float(ans.seconds) / 86400)
|
||||
res[opportunity.id][field] = abs(int(duration))
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'stage_id': fields.many2one ('crm.case.stage', 'Stage', \
|
||||
@@ -113,11 +124,12 @@ class crm_opportunity(osv.osv):
|
||||
\nWhen the case is over, the state is set to \'Done\'.\
|
||||
\nIf the case needs to be reviewed then the state is set to \'Pending\'.'),
|
||||
|
||||
'day_open': fields.function(_compute_openday, string='Days to Open', \
|
||||
method=True, type="integer", store=True),
|
||||
'day_close': fields.function(_compute_closeday, string='Days to Close', \
|
||||
method=True, type="integer", store=True),
|
||||
}
|
||||
'date_open': fields.datetime('Opened', readonly=True),
|
||||
'day_open': fields.function(_compute_day, string='Days to Open', \
|
||||
method=True, multi='day_open', type="integer", store=True),
|
||||
'day_close': fields.function(_compute_day, string='Days to Close', \
|
||||
method=True, multi='day_close', type="integer", store=True),
|
||||
}
|
||||
|
||||
def onchange_stage_id(self, cr, uid, ids, stage_id, context={}):
|
||||
|
||||
|
||||
@@ -11,13 +11,11 @@
|
||||
<field eval="60" name="probability"/>
|
||||
<field name="partner_address_id" ref="base.res_partner_address_zen"/>
|
||||
<field eval="1" name="active"/>
|
||||
<field eval="17.0" name="duration"/>
|
||||
<field name="type_id" ref="crm.type_oppor1"/>
|
||||
<field name="partner_id" ref="base.res_partner_3"/>
|
||||
<field eval=""3"" name="priority"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field eval=""open"" name="state"/>
|
||||
<field eval="75000.0" name="planned_cost"/>
|
||||
<field eval="85000.0" name="planned_revenue"/>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field eval="time.strftime('%Y-%m-07 10:05:15')" name="date"/>
|
||||
@@ -33,10 +31,8 @@
|
||||
<field eval=""3"" name="priority"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field eval=""draft"" name="state"/>
|
||||
<field eval="30000.0" name="planned_cost"/>
|
||||
<field eval="45000.0" name="planned_revenue"/>
|
||||
<field eval="50" name="probability"/>
|
||||
<field eval="8.0" name="duration"/>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field eval="time.strftime('%Y-%m-05 12:25:15')" name="date"/>
|
||||
<field name="categ_id" ref="crm.categ_oppor5"/>
|
||||
@@ -52,10 +48,8 @@
|
||||
<field eval=""3"" name="priority"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field eval=""pending"" name="state"/>
|
||||
<field eval="50000.0" name="planned_cost"/>
|
||||
<field eval="55000.0" name="planned_revenue"/>
|
||||
<field eval="70" name="probability"/>
|
||||
<field eval="10.0" name="duration"/>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field eval="time.strftime('%Y-%m-14 13:55:10')" name="date"/>
|
||||
<field name="categ_id" ref="crm.categ_oppor7"/>
|
||||
@@ -72,9 +66,7 @@
|
||||
<field eval=""3"" name="priority"/>
|
||||
<field name="user_id" ref="base.user_demo"/>
|
||||
<field eval=""open"" name="state"/>
|
||||
<field eval="50000.0" name="planned_cost"/>
|
||||
<field eval="45000.0" name="planned_revenue"/>
|
||||
<field eval="24.0" name="duration"/>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field eval="time.strftime('%Y-%m-23 16:32:23')" name="date"/>
|
||||
<field name="categ_id" ref="crm.categ_oppor5"/>
|
||||
@@ -86,12 +78,10 @@
|
||||
<field eval="80" name="probability"/>
|
||||
<field name="partner_address_id" ref="base.res_partner_address_wong"/>
|
||||
<field eval="1" name="active"/>
|
||||
<field eval="2.25" name="duration"/>
|
||||
<field name="partner_id" ref="base.res_partner_maxtor"/>
|
||||
<field eval=""3"" name="priority"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field eval=""done"" name="state"/>
|
||||
<field eval="25000.0" name="planned_cost"/>
|
||||
<field eval="42000.0" name="planned_revenue"/>
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field eval="time.strftime('%Y-%m-25 16:05:15')" name="date"/>
|
||||
|
||||
@@ -138,12 +138,14 @@
|
||||
<field name="create_date"/>
|
||||
<field name="write_date"/>
|
||||
<field name="date_closed"/>
|
||||
<field name="date_open"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Misc" colspan="2"/>
|
||||
<field name="active"/>
|
||||
<field name="day_open"/>
|
||||
<field name="day_close"/>
|
||||
|
||||
</group>
|
||||
<separator colspan="4" string="References"/>
|
||||
<field name="ref"/>
|
||||
@@ -246,7 +248,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Opportunity by Categories" type="bar" orientation="horizontal">
|
||||
<field name="categ_id"/>
|
||||
<field name="planned_cost" operator="+"/>
|
||||
<field name="planned_revenue" operator="+"/>
|
||||
<field name="state" group="True"/>
|
||||
</graph>
|
||||
</field>
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<field name="parent_id" select="2" widget="selection"/>
|
||||
<field name="allow_unlink" select="2"/>
|
||||
<field name="reply_to" select="2"/>
|
||||
<field name="resource_calendar_id"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
@@ -363,7 +364,7 @@
|
||||
<separator colspan="4" string="Action Information"/>
|
||||
<field colspan="4" name="name"/>
|
||||
<field name="date" select="2"/>
|
||||
<field name="user_id" select="2"/>
|
||||
<field name="user_id" select="2"/>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
@@ -376,7 +377,7 @@
|
||||
<group col="7" colspan="4">
|
||||
<field name="date"/>
|
||||
<field name="email_to"/>
|
||||
<field name="email_from"/>
|
||||
<field name="email_from"/>
|
||||
<button
|
||||
string="Add a CC"
|
||||
name="%(crm.action_view_crm_email_add_cc_wizard)d"
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
+65
-62
@@ -8,13 +8,13 @@ msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2010-01-05 05:59+0000\n"
|
||||
"PO-Revision-Date: 2010-04-01 15:06+0000\n"
|
||||
"PO-Revision-Date: 2010-04-04 12:10+0000\n"
|
||||
"Last-Translator: smii <Unknown>\n"
|
||||
"Language-Team: Finnish <fi@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-02 03:42+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-05 03:53+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: crm
|
||||
@@ -2950,12 +2950,12 @@ msgstr ""
|
||||
#. module: crm
|
||||
#: model:crm.case.category2,name:crm.categ2_fund4
|
||||
msgid "Demand Draft"
|
||||
msgstr ""
|
||||
msgstr "Vaatimusluonnos"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.case,id:0
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
msgstr "ID"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.case,log_ids:0
|
||||
@@ -2966,7 +2966,7 @@ msgstr "Lokihistoriat"
|
||||
#: wizard_field:crm.lead.opportunity_set,opportunity,name:0
|
||||
#: wizard_field:crm.phonecall.opportunity_set,opportunity,name:0
|
||||
msgid "Opportunity Summary"
|
||||
msgstr ""
|
||||
msgstr "Mahdollisuuksien yhteenveto"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.case:0
|
||||
@@ -2997,22 +2997,22 @@ msgstr "Viimeisin tapahtuma"
|
||||
#. module: crm
|
||||
#: field:crm.case,duration:0
|
||||
msgid "Duration"
|
||||
msgstr ""
|
||||
msgstr "Kesto"
|
||||
|
||||
#. module: crm
|
||||
#: model:ir.model,name:crm.model_report_crm_case_section_categ_stage
|
||||
msgid "Cases by section, Category and stage"
|
||||
msgstr ""
|
||||
msgstr "Tapahtumat osion, kategorian ja vaiheen mukaan"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.job:0
|
||||
msgid "Candidate Hired"
|
||||
msgstr ""
|
||||
msgstr "Ehdokas palkattu"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.menu.config_wizard,jobs:0
|
||||
msgid "Jobs Hiring Process"
|
||||
msgstr ""
|
||||
msgstr "Rekrytointiprosessi"
|
||||
|
||||
#. module: crm
|
||||
#: model:ir.ui.menu,name:crm.next_id_52
|
||||
@@ -3052,12 +3052,12 @@ msgstr ""
|
||||
#: view:crm.segmentation:0
|
||||
#: field:crm.segmentation.line,segmentation_id:0
|
||||
msgid "Segmentation"
|
||||
msgstr ""
|
||||
msgstr "Segmentointi"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.fundraising:0
|
||||
msgid "Funds Form"
|
||||
msgstr ""
|
||||
msgstr "Varat -lomake"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.meeting:0
|
||||
@@ -3073,12 +3073,12 @@ msgstr ""
|
||||
#. module: crm
|
||||
#: field:crm.case,company_id:0
|
||||
msgid "Company"
|
||||
msgstr ""
|
||||
msgstr "Yritys"
|
||||
|
||||
#. module: crm
|
||||
#: model:crm.case.stage,name:crm.stage_lead3
|
||||
msgid "In Process"
|
||||
msgstr ""
|
||||
msgstr "Työn alla"
|
||||
|
||||
#. module: crm
|
||||
#: selection:crm.segmentation,state:0
|
||||
@@ -3094,18 +3094,18 @@ msgstr ""
|
||||
#: wizard_field:crm.job.reschedule_phone_call,init,note:0
|
||||
#: wizard_field:crm.opportunity.reschedule_phone_call,init,note:0
|
||||
msgid "Goals"
|
||||
msgstr ""
|
||||
msgstr "Tavoitteet"
|
||||
|
||||
#. module: crm
|
||||
#: model:ir.ui.menu,name:crm.menu_crm_case_section_categ_tree
|
||||
#: view:report.crm.case.section.categ2:0
|
||||
msgid "Cases by Section and Type"
|
||||
msgstr ""
|
||||
msgstr "Tapahtumat osion ja tyypin mukaan"
|
||||
|
||||
#. module: crm
|
||||
#: model:ir.ui.menu,name:crm.menu_aftersale
|
||||
msgid "After-Sale Services"
|
||||
msgstr ""
|
||||
msgstr "Jälkimyyntipalvelut"
|
||||
|
||||
#. module: crm
|
||||
#: wizard_button:caldav.crm.export,init,end:0
|
||||
@@ -3113,12 +3113,12 @@ msgstr ""
|
||||
#: wizard_button:caldav.crm.subscribe,display,end:0
|
||||
#: view:crm.email.add.cc:0
|
||||
msgid "Ok"
|
||||
msgstr ""
|
||||
msgstr "Ok"
|
||||
|
||||
#. module: crm
|
||||
#: wizard_field:caldav.crm.export,init,name:0
|
||||
msgid "File name"
|
||||
msgstr ""
|
||||
msgstr "Tiedostonimi"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.lead:0
|
||||
@@ -3148,7 +3148,7 @@ msgstr ""
|
||||
#: model:ir.actions.act_window,name:crm.crm_case_categ0_act_job
|
||||
#: model:ir.ui.menu,name:crm.menu_crm_case_categ0_act_job
|
||||
msgid "All Jobs Requests"
|
||||
msgstr ""
|
||||
msgstr "Kaikki työpaikkapyynnöt"
|
||||
|
||||
#. module: crm
|
||||
#: selection:crm.case,state:0
|
||||
@@ -3160,7 +3160,7 @@ msgstr ""
|
||||
#: selection:report.crm.case.section.categ2,state:0
|
||||
#: selection:report.crm.case.section.stage,state:0
|
||||
msgid "Cancelled"
|
||||
msgstr ""
|
||||
msgstr "Peruutettu"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.job:0
|
||||
@@ -3177,7 +3177,7 @@ msgstr ""
|
||||
#. module: crm
|
||||
#: view:crm.phonecall:0
|
||||
msgid "Relevant"
|
||||
msgstr ""
|
||||
msgstr "Oleellinen"
|
||||
|
||||
#. module: crm
|
||||
#: wizard_field:crm.case.opportunity.partner_opportunity,init,name:0
|
||||
@@ -3192,7 +3192,7 @@ msgstr ""
|
||||
#. module: crm
|
||||
#: wizard_view:caldav.crm.import,init:0
|
||||
msgid "Import ICS"
|
||||
msgstr ""
|
||||
msgstr "Tuo ICS-tiedosto"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.phonecall:0
|
||||
@@ -3212,7 +3212,7 @@ msgstr "Kommunikaatio Historia"
|
||||
#. module: crm
|
||||
#: model:ir.ui.menu,name:crm.menu_action_report_crm_case_oppor_categ
|
||||
msgid "Cases by Opportunities and Type"
|
||||
msgstr ""
|
||||
msgstr "Tapahtumat mahdollisuuden ja tyypin mukaan"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.case.rule:0
|
||||
@@ -3256,7 +3256,7 @@ msgstr ""
|
||||
#. module: crm
|
||||
#: model:crm.case.stage,name:crm.stage_lead1
|
||||
msgid "New"
|
||||
msgstr ""
|
||||
msgstr "Uusi"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.case,description:0
|
||||
@@ -3275,7 +3275,7 @@ msgstr "Sähköposti"
|
||||
#: field:crm.case,canal_id:0
|
||||
#: field:crm.case.log,canal_id:0
|
||||
msgid "Channel"
|
||||
msgstr ""
|
||||
msgstr "Kanava"
|
||||
|
||||
#. module: crm
|
||||
#: help:crm.case.rule,act_mail_to_email:0
|
||||
@@ -3295,7 +3295,7 @@ msgstr "Sähköpostimuistuttajat (sisältää asiasisällön)"
|
||||
#. module: crm
|
||||
#: model:ir.ui.menu,name:crm.menu_action_report_crm_case_lead_stage
|
||||
msgid "Cases by Leads and Stage"
|
||||
msgstr ""
|
||||
msgstr "Tapahtumat ohjauksen ja vaiheen mukaan"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.meeting,exdate:0
|
||||
@@ -3315,7 +3315,7 @@ msgstr ""
|
||||
#. module: crm
|
||||
#: model:ir.ui.menu,name:crm.next_id_64
|
||||
msgid "Reporting"
|
||||
msgstr ""
|
||||
msgstr "Raportointi"
|
||||
|
||||
#. module: crm
|
||||
#: code:addons/crm/crm.py:0
|
||||
@@ -3336,7 +3336,7 @@ msgstr ""
|
||||
#: selection:report.crm.case.section.stage,state:0
|
||||
#, python-format
|
||||
msgid "Pending"
|
||||
msgstr ""
|
||||
msgstr "Odottaa"
|
||||
|
||||
#. module: crm
|
||||
#: model:process.transition,name:crm.process_transition_leadopportunity0
|
||||
@@ -3346,12 +3346,12 @@ msgstr ""
|
||||
#. module: crm
|
||||
#: view:crm.job:0
|
||||
msgid "Expected Salary"
|
||||
msgstr ""
|
||||
msgstr "Oletettu palkka"
|
||||
|
||||
#. module: crm
|
||||
#: model:ir.ui.menu,name:crm.menu_crm_configuration
|
||||
msgid "Configuration"
|
||||
msgstr ""
|
||||
msgstr "Asetukset"
|
||||
|
||||
#. module: crm
|
||||
#: model:ir.actions.wizard,name:crm.wizard_crm_new_send_mail
|
||||
@@ -3361,7 +3361,7 @@ msgstr ""
|
||||
#. module: crm
|
||||
#: constraint:ir.cron:0
|
||||
msgid "Invalid arguments"
|
||||
msgstr ""
|
||||
msgstr "Virheelliset argumentit"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.meeting,transparent:0
|
||||
@@ -3377,43 +3377,43 @@ msgstr ""
|
||||
#: model:crm.case.categ,name:crm.categ_lead7
|
||||
#: model:crm.case.categ,name:crm.categ_oppor7
|
||||
msgid "Word of mouth"
|
||||
msgstr ""
|
||||
msgstr "Suusanallinen"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.lead:0
|
||||
msgid "Lead Subject"
|
||||
msgstr ""
|
||||
msgstr "Ohjausaihe"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.lead:0
|
||||
#: view:crm.phonecall:0
|
||||
msgid "Convert to Opportunity"
|
||||
msgstr ""
|
||||
msgstr "Muunna mahdollisuudeksi"
|
||||
|
||||
#. module: crm
|
||||
#: model:crm.case.stage,name:crm.stage_phone1
|
||||
msgid "Planned"
|
||||
msgstr ""
|
||||
msgstr "Suunniteltu"
|
||||
|
||||
#. module: crm
|
||||
#: model:crm.case.category2,name:crm.category_meet3
|
||||
msgid "Customer Office"
|
||||
msgstr ""
|
||||
msgstr "Asiakkaan toimisto"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.job:0
|
||||
msgid "Candidate Email"
|
||||
msgstr ""
|
||||
msgstr "Ehdokkaan sähköposti"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.opportunity:0
|
||||
msgid "Sales Stage: "
|
||||
msgstr ""
|
||||
msgstr "Myyntien vaihe: "
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.claim:0
|
||||
msgid "Type of Action"
|
||||
msgstr ""
|
||||
msgstr "Toiminnon tyyppi"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.case.rule,act_user_id:0
|
||||
@@ -3423,7 +3423,7 @@ msgstr "Aseta vastaava"
|
||||
#. module: crm
|
||||
#: view:crm.job:0
|
||||
msgid "Meeting With Candidates"
|
||||
msgstr ""
|
||||
msgstr "Ehdokkaiden tapaaminen"
|
||||
|
||||
#. module: crm
|
||||
#: help:crm.segmentation,som_interval:0
|
||||
@@ -3447,7 +3447,7 @@ msgstr ""
|
||||
#: selection:report.crm.case.section.categ2,month:0
|
||||
#: selection:report.crm.case.section.stage,month:0
|
||||
msgid "December"
|
||||
msgstr ""
|
||||
msgstr "Joulukuu"
|
||||
|
||||
#. module: crm
|
||||
#: view:report.crm.case.section.categ.categ2:0
|
||||
@@ -3467,7 +3467,7 @@ msgstr "Lähetä sähköpostia"
|
||||
#. module: crm
|
||||
#: view:crm.fundraising:0
|
||||
msgid "Funds Tree"
|
||||
msgstr ""
|
||||
msgstr "Varojen puu"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.case.rule,act_method:0
|
||||
@@ -3477,24 +3477,24 @@ msgstr "Kutsu objektia"
|
||||
#. module: crm
|
||||
#: model:ir.actions.act_window,name:crm.crm_case_category_act_fund_all1
|
||||
msgid "All Funds"
|
||||
msgstr ""
|
||||
msgstr "Kaikki varat"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.case.section,calendar:0
|
||||
#: view:crm.meeting:0
|
||||
#: model:ir.ui.menu,name:crm.menu_crm_case_category_act_meetings
|
||||
msgid "Calendar"
|
||||
msgstr ""
|
||||
msgstr "Kalenteri"
|
||||
|
||||
#. module: crm
|
||||
#: model:crm.case.categ,name:crm.categ_job1
|
||||
msgid "Salesman"
|
||||
msgstr ""
|
||||
msgstr "Myyjä"
|
||||
|
||||
#. module: crm
|
||||
#: model:crm.case.section,name:crm.section_support_help
|
||||
msgid "HelpDesk"
|
||||
msgstr ""
|
||||
msgstr "HelpDesk"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.case,ref2:0
|
||||
@@ -3511,12 +3511,12 @@ msgstr "Ostomyynti"
|
||||
#: model:ir.actions.wizard,name:crm.wizard_crm_job_meeting_set
|
||||
#: model:ir.actions.wizard,name:crm.wizard_crm_phonecall_meeting_set
|
||||
msgid "Schedule Meeting"
|
||||
msgstr ""
|
||||
msgstr "Ajoita tapaaminen"
|
||||
|
||||
#. module: crm
|
||||
#: model:crm.case.categ,name:crm.categ_fund4
|
||||
msgid "Arts And Culture"
|
||||
msgstr ""
|
||||
msgstr "Taide ja Kulttuuri"
|
||||
|
||||
#. module: crm
|
||||
#: model:crm.case.categ,name:crm.categ_phone2
|
||||
@@ -3524,7 +3524,7 @@ msgstr ""
|
||||
#: model:ir.actions.act_window,name:crm.crm_case_categ_phone_outgoing0
|
||||
#: model:ir.ui.menu,name:crm.menu_crm_case_phone_outbound
|
||||
msgid "Outbound"
|
||||
msgstr ""
|
||||
msgstr "Lähtevä"
|
||||
|
||||
#. module: crm
|
||||
#: code:addons/crm/crm.py:0
|
||||
@@ -3535,7 +3535,7 @@ msgstr "Historioi"
|
||||
#. module: crm
|
||||
#: view:crm.meeting:0
|
||||
msgid "Confirmed"
|
||||
msgstr ""
|
||||
msgstr "Vahvistettu"
|
||||
|
||||
#. module: crm
|
||||
#: selection:crm.segmentation,state:0
|
||||
@@ -3547,7 +3547,7 @@ msgstr "Ei toiminnassa"
|
||||
#: wizard_field:crm.lead.opportunity_set,opportunity,probability:0
|
||||
#: wizard_field:crm.phonecall.opportunity_set,opportunity,probability:0
|
||||
msgid "Success Probability"
|
||||
msgstr ""
|
||||
msgstr "Onnistunut mahdollisuus"
|
||||
|
||||
#. module: crm
|
||||
#: code:addons/crm/crm.py:0
|
||||
@@ -3585,7 +3585,7 @@ msgstr "Aseta osio"
|
||||
#: selection:crm.case.rule,trg_priority_from:0
|
||||
#: selection:crm.case.rule,trg_priority_to:0
|
||||
msgid "Normal"
|
||||
msgstr ""
|
||||
msgstr "Normaali"
|
||||
|
||||
#. module: crm
|
||||
#: code:addons/crm/crm.py:0
|
||||
@@ -3594,6 +3594,7 @@ msgstr ""
|
||||
#, python-format
|
||||
msgid "You must put a Partner eMail to use this action!"
|
||||
msgstr ""
|
||||
"Sinun täytyy laittaa kumppanin sähköpostiosoite käyttääksesi tätä toimintoa!"
|
||||
|
||||
#. module: crm
|
||||
#: wizard_view:crm.job.partner_create,init:0
|
||||
@@ -3602,7 +3603,7 @@ msgstr ""
|
||||
#: wizard_view:crm.phonecall.opportunity_set,create_partner:0
|
||||
#: wizard_view:crm.phonecall.partner_create,init:0
|
||||
msgid "You may have to verify that this partner does not exist already."
|
||||
msgstr ""
|
||||
msgstr "Sinun täytyy varmistaa ettei tämä kumppani ole jo olemassa."
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.job:0
|
||||
@@ -3622,14 +3623,14 @@ msgstr ""
|
||||
#: field:report.crm.case.section.categ2,user_id:0
|
||||
#: field:report.crm.case.section.stage,user_id:0
|
||||
msgid "User"
|
||||
msgstr ""
|
||||
msgstr "Käyttäjä"
|
||||
|
||||
#. module: crm
|
||||
#: model:ir.ui.menu,name:crm.menu_action_report_crm_case_lead_categ_categ2
|
||||
#: model:ir.ui.menu,name:crm.menu_crm_case_section_categ_categ2_tree
|
||||
#: view:report.crm.case.section.categ.categ2:0
|
||||
msgid "Cases by Section, Category and Type"
|
||||
msgstr ""
|
||||
msgstr "Tapahtumat osion, kategorian ja tyypin mukaan"
|
||||
|
||||
#. module: crm
|
||||
#: selection:report.crm.case.section.categ.categ2,month:0
|
||||
@@ -3637,12 +3638,12 @@ msgstr ""
|
||||
#: selection:report.crm.case.section.categ2,month:0
|
||||
#: selection:report.crm.case.section.stage,month:0
|
||||
msgid "November"
|
||||
msgstr ""
|
||||
msgstr "Marraskuu"
|
||||
|
||||
#. module: crm
|
||||
#: model:crm.case.category2,name:crm.category_job2
|
||||
msgid "Licenced"
|
||||
msgstr ""
|
||||
msgstr "Lisensöity"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.case.section,parent_id:0
|
||||
@@ -3658,7 +3659,7 @@ msgstr "Yläosio"
|
||||
#: model:ir.actions.wizard,name:crm.wizard_crm_job_reschedule_phone_call
|
||||
#: model:ir.actions.wizard,name:crm.wizard_crm_opportunity_reschedule_phone_call
|
||||
msgid "Schedule Phone Call"
|
||||
msgstr ""
|
||||
msgstr "Ajoita puhelinsoitto"
|
||||
|
||||
#. module: crm
|
||||
#: code:addons/crm/crm.py:0
|
||||
@@ -3666,6 +3667,8 @@ msgstr ""
|
||||
msgid ""
|
||||
"Can not send mail with empty body,you should have description in the body"
|
||||
msgstr ""
|
||||
"Sähköpostia ei voi lähettää tyhjällä viesti -kentällä. Sinulla tulisi olla "
|
||||
"kuvaus viesti -kentässä"
|
||||
|
||||
#. module: crm
|
||||
#: selection:report.crm.case.section.categ.categ2,month:0
|
||||
@@ -3673,7 +3676,7 @@ msgstr ""
|
||||
#: selection:report.crm.case.section.categ2,month:0
|
||||
#: selection:report.crm.case.section.stage,month:0
|
||||
msgid "January"
|
||||
msgstr ""
|
||||
msgstr "Tammikuu"
|
||||
|
||||
#. module: crm
|
||||
#: model:process.process,name:crm.process_process_contractprocess0
|
||||
@@ -3693,7 +3696,7 @@ msgstr "Suunniteltu tuotto"
|
||||
#. module: crm
|
||||
#: model:crm.case.categ,name:crm.categ_fund3
|
||||
msgid "Healthcare"
|
||||
msgstr ""
|
||||
msgstr "Terveydenhoito"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.case:0
|
||||
@@ -3717,7 +3720,7 @@ msgstr "Kumppanin Yhteystiedot"
|
||||
#. module: crm
|
||||
#: model:crm.case.category2,name:crm.category_meet1
|
||||
msgid "Office"
|
||||
msgstr ""
|
||||
msgstr "Toimisto"
|
||||
|
||||
#. module: crm
|
||||
#: model:ir.model,name:crm.model_crm_fundraising
|
||||
@@ -3727,7 +3730,7 @@ msgstr ""
|
||||
#. module: crm
|
||||
#: model:ir.model,name:crm.model_crm_case_stage
|
||||
msgid "Stage of case"
|
||||
msgstr ""
|
||||
msgstr "Tapahtuman vaihe"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.case:0
|
||||
|
||||
@@ -76,8 +76,15 @@ class crm_opportunity_report(osv.osv):
|
||||
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
|
||||
from
|
||||
crm_opportunity c
|
||||
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'),\
|
||||
c.state, c.user_id,c.section_id,c.stage_id,c.categ_id,c.partner_id,company_id
|
||||
group by
|
||||
to_char(c.create_date, 'YYYY'),
|
||||
to_char(c.create_date, 'MM'),
|
||||
c.state,
|
||||
c.user_id,
|
||||
c.section_id,
|
||||
c.stage_id,
|
||||
c.categ_id,
|
||||
c.partner_id,company_id
|
||||
)""")
|
||||
|
||||
crm_opportunity_report()
|
||||
|
||||
@@ -41,13 +41,14 @@
|
||||
'depends': ['crm', 'base_contact', 'account'],
|
||||
'init_xml': ['event_data.xml'],
|
||||
'update_xml': [
|
||||
'event_wizard.xml',
|
||||
'wizard/event_confirm_registration_view.xml',
|
||||
'event_view.xml',
|
||||
'event_sequence.xml',
|
||||
'security/event_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'wizard/event_registration_view.xml',
|
||||
'wizard/event_registrations_partner.xml',
|
||||
'wizard/event_make_invoice_view.xml',
|
||||
],
|
||||
'demo_xml': ['event_demo.xml'],
|
||||
'installable': True,
|
||||
|
||||
+27
-2
@@ -151,6 +151,31 @@ event()
|
||||
|
||||
class event_registration(osv.osv):
|
||||
|
||||
def check_confirm(self, cr, uid, ids, context):
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
current_registration = self.browse(cr, uid, [ids[0]])[0]
|
||||
total_confirmed = current_registration.event_id.register_current + current_registration.nb_register
|
||||
if total_confirmed <= current_registration.event_id.register_max or current_registration.event_id.register_max == 0:
|
||||
self.write(cr, uid, [ids[0]], {'state':'open'}, context=context)
|
||||
self._history(cr, uid, [ids[0]], 'Open', history=True)
|
||||
self.mail_user(cr, uid, [ids[0]])
|
||||
return True
|
||||
else:
|
||||
model_data_ids = mod_obj.search(cr,uid,[('model','=','ir.ui.view'),('name','=','view_event_confirm_registration')], context=context)
|
||||
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
|
||||
context.update({'reg_id': ids[0]})
|
||||
return {
|
||||
'name': _('Confirm Registration'),
|
||||
'context': context,
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'event.confirm.registration',
|
||||
'views': [(resource_id,'form')],
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
'nodestroy': True
|
||||
}
|
||||
|
||||
def _history(self, cr, uid,ids,keyword, history=False, email=False, context={}):
|
||||
for case in self.browse(cr, uid, ids):
|
||||
if not case.case_id:
|
||||
@@ -244,14 +269,14 @@ class event_registration(osv.osv):
|
||||
"invoice_id":fields.many2one("account.invoice","Invoice"),
|
||||
'date_closed': fields.datetime('Closed', readonly=True),
|
||||
'ref' : fields.reference('Reference', selection=crm._links_get, size=128),
|
||||
'ref2' : fields.reference('Reference 2', selection=crm._links_get, size=128),
|
||||
'ref2' : fields.reference('Reference 2', selection=crm._links_get, size=128),
|
||||
'categ_id': fields.many2one('crm.case.categ','Category', domain="[('section_id','=',section_id)]"),
|
||||
'canal_id': fields.many2one('res.partner.canal', 'Channel',help="The channels represent the different communication modes available with the customer." \
|
||||
" With each commercial opportunity, you can indicate the canall which is this opportunity source."),
|
||||
'som': fields.many2one('res.partner.som', 'State of Mind', help="The minds states allow to define a value scale which represents" \
|
||||
"the partner mentality in relation to our services.The scale has" \
|
||||
"to be created with a factor for each level from 0 (Very dissatisfied) to 10 (Extremely satisfied)."),
|
||||
|
||||
|
||||
}
|
||||
_defaults = {
|
||||
'nb_register': lambda *a: 1,
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Registration">
|
||||
<field name="id"/>
|
||||
<field name="date"/>
|
||||
<field name="create_date"/>
|
||||
<field name="event_id"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="nb_register"/>
|
||||
@@ -203,7 +203,7 @@
|
||||
<group col="8" colspan="4">
|
||||
<field name="state" select="1" colspan="2"/>
|
||||
<button name="button_reg_close" string="Registration Invoiced" states="open" type="object" icon="gtk-print"/>
|
||||
<button name="%(event_confirm_registration)d" string="Confirm Registration" states="draft" type="action" icon="gtk-apply"/>
|
||||
<button name="check_confirm" string="Confirm Registration" states="draft" type="object" icon="gtk-apply"/>
|
||||
<button name="button_reg_cancel" string="Cancel Registration" states="draft,open" type="object" icon="gtk-cancel"/>
|
||||
</group>
|
||||
</page>
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" ?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- <wizard
|
||||
string="Registrations"
|
||||
model="event.event"
|
||||
name="wizard_event_registration"
|
||||
id="wizard_event_registration"/> -->
|
||||
|
||||
<!-- <wizard
|
||||
string="List Register Partners"
|
||||
model="event.event"
|
||||
name="event.event_reg_partners"
|
||||
id="wizard_event_reg_partners"/> -->
|
||||
|
||||
<wizard string="Make Invoice"
|
||||
model="event.registration"
|
||||
name="event.reg_make_invoice"
|
||||
id="event_reg_invoice"
|
||||
menu="True"
|
||||
/>
|
||||
|
||||
<wizard string="Confirm Registration"
|
||||
model="event.registration"
|
||||
name="event.confirm_registration"
|
||||
id="event_confirm_registration"
|
||||
menu="False"
|
||||
/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -20,7 +20,7 @@
|
||||
##############################################################################
|
||||
|
||||
import event_registration
|
||||
import make_invoice
|
||||
import event_make_invoice
|
||||
import event_registrations_partner
|
||||
import confirm_registration
|
||||
import event_confirm_registration
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -1,80 +0,0 @@
|
||||
# -*- 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
|
||||
import wizard
|
||||
import ir
|
||||
import pooler
|
||||
from osv.osv import except_osv
|
||||
from osv import fields,osv
|
||||
import netsvc
|
||||
|
||||
ARCH = '''<?xml version="1.0"?>
|
||||
<form string="Registration Confirmation">
|
||||
<label string="The event limit is reached. What do you want to do?" colspan="4"/>
|
||||
</form>'''
|
||||
|
||||
ARCH_fields={}
|
||||
|
||||
def _confirm(self, cr, uid, data, context):
|
||||
registration_obj = pooler.get_pool(cr.dbname).get('event.registration')
|
||||
current_registration = registration_obj.browse(cr, uid, [data['id']])[0]
|
||||
|
||||
total_confirmed = current_registration.event_id.register_current + current_registration.nb_register
|
||||
if total_confirmed <= current_registration.event_id.register_max or current_registration.event_id.register_max == 0:
|
||||
return 'confirm'
|
||||
return 'split'
|
||||
|
||||
|
||||
def _check_confirm(self, cr, uid, data, context):
|
||||
registration_obj = pooler.get_pool(cr.dbname).get('event.registration')
|
||||
registration_obj.write(cr, uid, [data['id']], {'state':'open',})
|
||||
registration_obj._history(cr, uid, [data['id']], 'Open', history=True)
|
||||
registration_obj.mail_user(cr,uid,[data['id']])
|
||||
return {}
|
||||
|
||||
|
||||
class confirm_registration(wizard.interface):
|
||||
states = {
|
||||
'init' : {
|
||||
'actions' : [],
|
||||
'result' : {'type' : 'choice', 'next_state' : _confirm}
|
||||
},
|
||||
|
||||
'split' : {
|
||||
'actions' : [],
|
||||
'result' : {'type' : 'form',
|
||||
'arch' : ARCH,'fields':ARCH_fields,
|
||||
'state' : [('end', 'Cancel'),('confirm', 'Confirm Anyway') ]}
|
||||
},
|
||||
|
||||
'confirm' : {
|
||||
'actions' : [],
|
||||
'result' : {'type' : 'action', 'action': _check_confirm, 'state' : 'end'}
|
||||
},
|
||||
'end' : {
|
||||
'actions' : [],
|
||||
'result': {'type': 'state', 'state': 'end'},
|
||||
},
|
||||
}
|
||||
|
||||
confirm_registration('event.confirm_registration')
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,47 @@
|
||||
# -*- 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
|
||||
class event_confirm_registration(osv.osv_memory):
|
||||
"""
|
||||
Confirm Event Registration
|
||||
"""
|
||||
_name = "event.confirm.registration"
|
||||
_description = "Event Registraion"
|
||||
_columns = {
|
||||
'msg': fields.text('Message', readonly=True),
|
||||
}
|
||||
_defaults={
|
||||
'msg':lambda *a:'The event limit is reached. What do you want to do?'
|
||||
}
|
||||
|
||||
def confirm(self, cr, uid, ids, context):
|
||||
registration_obj = self.pool.get('event.registration')
|
||||
reg_id = context.get('reg_id', False) or context.get('active_id', False)
|
||||
if reg_id:
|
||||
registration_obj.write(cr, uid, [reg_id], {'state':'open',})
|
||||
registration_obj._history(cr, uid, [reg_id], 'Open', history=True)
|
||||
registration_obj.mail_user(cr,uid,[reg_id])
|
||||
return {}
|
||||
|
||||
event_confirm_registration()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_event_confirm_registration" model="ir.ui.view">
|
||||
<field name="name">Registration Confirmation</field>
|
||||
<field name="model">event.confirm.registration</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Registration Confirmation">
|
||||
<field name="msg"/>
|
||||
<separator string="" colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<button icon="gtk-cancel" special="cancel" string="_Cancel"/>
|
||||
<button icon="gtk-ok" name="confirm" string="Confirm Anyway" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_event_confirm_registration" model="ir.actions.act_window">
|
||||
<field name="name">Registrations</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">event.confirm.registration</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_event_confirm_registration"/>
|
||||
<field name="context">{'record_id' : active_id}</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,140 @@
|
||||
# -*- 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
from osv import fields, osv
|
||||
|
||||
class event_make_invoice(osv.osv_memory):
|
||||
"""
|
||||
Make Invoices
|
||||
"""
|
||||
_name = "event.make.invoice"
|
||||
_description = "Event Make Invoice"
|
||||
_columns = {
|
||||
'inv_created': fields.char('Invoice Created', size=32, readonly=True),
|
||||
'inv_rejected': fields.char('Invoice Rejected', size=32, readonly=True),
|
||||
'inv_rej_reason': fields.text('Error Messages', readonly=True),
|
||||
# 'invoice_ids': fields.char('Invoice Ids', size=128), # Improve me
|
||||
}
|
||||
|
||||
def _makeInvoices(self, cr, uid, context={}):
|
||||
invoices = {}
|
||||
invoice_ids = []
|
||||
create_ids=[]
|
||||
tax_ids=[]
|
||||
inv_create = 0
|
||||
inv_reject = 0
|
||||
inv_rej_reason = ""
|
||||
list_inv = []
|
||||
obj_event_reg = self.pool.get('event.registration')
|
||||
obj_lines = self.pool.get('account.invoice.line')
|
||||
inv_obj = self.pool.get('account.invoice')
|
||||
data_event_reg = obj_event_reg.browse(cr,uid, context['active_ids'], context=context)
|
||||
|
||||
for reg in data_event_reg:
|
||||
if reg.state=='draft':
|
||||
inv_reject = inv_reject + 1
|
||||
inv_rej_reason += "ID "+str(reg.id)+": Invoice cannot be created if the registration is in draft state. \n"
|
||||
continue
|
||||
if (not reg.tobe_invoiced):
|
||||
inv_reject = inv_reject + 1
|
||||
inv_rej_reason += "ID "+str(reg.id)+": Registration is set as 'Cannot be invoiced'. \n"
|
||||
continue
|
||||
if reg.invoice_id:
|
||||
inv_reject = inv_reject + 1
|
||||
inv_rej_reason += "ID "+str(reg.id)+": Registration already has an invoice linked. \n"
|
||||
continue
|
||||
if not reg.event_id.product_id:
|
||||
inv_reject = inv_reject + 1
|
||||
inv_rej_reason += "ID "+str(reg.id)+": Event related doesn't have any product defined. \n"
|
||||
continue
|
||||
if not reg.partner_invoice_id:
|
||||
inv_reject = inv_reject + 1
|
||||
inv_rej_reason += "ID "+str(reg.id)+": Registration doesn't have any partner to invoice. \n"
|
||||
continue
|
||||
partner_address_list = reg.partner_invoice_id and self.pool.get('res.partner').address_get(cr, uid, [reg.partner_invoice_id.id], adr_pref=['invoice'])
|
||||
partner_address_id = partner_address_list['invoice']
|
||||
if not partner_address_id:
|
||||
inv_reject = inv_reject + 1
|
||||
inv_rej_reason += "ID "+str(reg.id)+": Registered partner doesn't have an address to make the invoice. \n"
|
||||
continue
|
||||
|
||||
inv_create = inv_create + 1
|
||||
value = obj_lines.product_id_change(cr, uid, [], reg.event_id.product_id.id,uom =False, partner_id=reg.partner_invoice_id.id, fposition_id=reg.partner_invoice_id.property_account_position.id)
|
||||
data_product = self.pool.get('product.product').browse(cr,uid,[reg.event_id.product_id.id])
|
||||
for tax in data_product[0].taxes_id:
|
||||
tax_ids.append(tax.id)
|
||||
|
||||
vals = value['value']
|
||||
vals.update({
|
||||
'name': reg.name,
|
||||
'price_unit': reg.unit_price,
|
||||
'quantity': reg.nb_register,
|
||||
'product_id':reg.event_id.product_id.id,
|
||||
'invoice_line_tax_id': [(6, 0, tax_ids)],
|
||||
})
|
||||
inv_line_ids = obj_event_reg._create_invoice_lines(cr, uid, [reg.id], vals)
|
||||
|
||||
inv = {
|
||||
'name': reg.invoice_label,
|
||||
'origin': reg.invoice_label,
|
||||
'type': 'out_invoice',
|
||||
'reference': False,
|
||||
'account_id': reg.partner_invoice_id.property_account_receivable.id,
|
||||
'partner_id': reg.partner_invoice_id.id,
|
||||
'address_invoice_id':partner_address_id,
|
||||
'address_contact_id':partner_address_id,
|
||||
'invoice_line': [(6,0,[inv_line_ids])],
|
||||
'currency_id' :reg.partner_invoice_id.property_product_pricelist.currency_id.id,
|
||||
'comment': "",
|
||||
'payment_term':reg.partner_invoice_id.property_payment_term.id,
|
||||
'fiscal_position': reg.partner_invoice_id.property_account_position.id
|
||||
}
|
||||
|
||||
inv_id = inv_obj.create(cr, uid, inv)
|
||||
list_inv.append(inv_id)
|
||||
obj_event_reg.write(cr, uid, reg.id, {'invoice_id': inv_id, 'state': 'done'})
|
||||
obj_event_reg._history(cr, uid, [reg.id], 'Invoiced', history=True)
|
||||
|
||||
# {'inv_created' : str(inv_create) , 'inv_rejected' : str(inv_reject), 'invoice_ids': str(list_inv), 'inv_rej_reason': inv_rej_reason}
|
||||
return {'inv_created' : str(inv_create) , 'inv_rejected' : str(inv_reject), 'inv_rej_reason': inv_rej_reason}
|
||||
|
||||
def default_get(self, cr, uid, fields_list, context=None):
|
||||
res = super(event_make_invoice, self).default_get(cr, uid, fields_list, context)
|
||||
res.update(self._makeInvoices(cr, uid, context=context))
|
||||
return res
|
||||
|
||||
def confirm(self, cr, uid, ids, context={}):
|
||||
obj_model = self.pool.get('ir.model.data')
|
||||
data_inv = self.read(cr, uid, ids, [], context)[0]
|
||||
model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','invoice_form')])
|
||||
resource_id = obj_model.read(cr,uid,model_data_ids,fields=['res_id'])[0]['res_id']
|
||||
return {
|
||||
# 'domain': "[('id','in', ["+','.join(map(str,data_inv['invoice_ids']))+"])]",
|
||||
'name': 'Invoices',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'account.invoice',
|
||||
'views': [(False,'tree'),(resource_id,'form')],
|
||||
'context': "{'type':'out_invoice'}",
|
||||
'type': 'ir.actions.act_window'
|
||||
}
|
||||
|
||||
event_make_invoice()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_event_make_invoice" model="ir.ui.view">
|
||||
<field name="name">event.make.invoice</field>
|
||||
<field name="model">event.make.invoice</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Make Invoices">
|
||||
<field name="inv_created" />
|
||||
<field name="inv_rejected" />
|
||||
<field name="inv_rej_reason" colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<button icon="gtk-cancel" special="cancel" string="_Ok"/>
|
||||
<button icon="gtk-ok" name="confirm" string="Open" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_event_confirm_registration" model="ir.actions.act_window">
|
||||
<field name="name">Make Invoices</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">event.make.invoice</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_event_make_invoice"/>
|
||||
<field name="context">{'record_id' : active_id}</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<act_window id="action_make_invoices"
|
||||
key2 = "client_action_multi" name="Make Invoice"
|
||||
res_model="event.make.invoice" src_model="event.registration"
|
||||
view_mode="form" target="new" view_type="form" />
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user