Merge with trunk addons
bzr revid: vir@tinyerp.com-20100201105309-3eqvn6n13gjbembs
This commit is contained in:
+14
-16
@@ -201,20 +201,19 @@ class account_account(osv.osv):
|
||||
}
|
||||
#get all the necessary accounts
|
||||
ids2 = self._get_children_and_consol(cr, uid, ids, context)
|
||||
acc_set = ",".join(map(str, ids2))
|
||||
#compute for each account the balance/debit/credit from the move lines
|
||||
accounts = {}
|
||||
if ids2:
|
||||
query = self.pool.get('account.move.line')._query_get(cr, uid,
|
||||
context=context)
|
||||
cr.execute(("SELECT l.account_id as id, " +\
|
||||
cr.execute("SELECT l.account_id as id, " +\
|
||||
' , '.join(map(lambda x: mapping[x], field_names)) +
|
||||
"FROM " \
|
||||
"account_move_line l " \
|
||||
"WHERE " \
|
||||
"l.account_id IN (%s) " \
|
||||
"l.account_id =ANY(%s) " \
|
||||
"AND " + query + " " \
|
||||
"GROUP BY l.account_id") % (acc_set, ))
|
||||
"GROUP BY l.account_id",(ids2,))
|
||||
|
||||
for res in cr.dictfetchall():
|
||||
accounts[res['id']] = res
|
||||
@@ -334,7 +333,7 @@ class account_account(osv.osv):
|
||||
if (obj_self in obj_self.child_consol_ids) or (p_id and (p_id is obj_self.id)):
|
||||
return False
|
||||
while(ids):
|
||||
cr.execute('select distinct child_id from account_account_consol_rel where parent_id in ('+','.join(map(str, ids))+')')
|
||||
cr.execute('select distinct child_id from account_account_consol_rel where parent_id =ANY(%s)',(ids,))
|
||||
child_ids = filter(None, map(lambda x: x[0], cr.fetchall()))
|
||||
c_ids = child_ids
|
||||
if (p_id and (p_id in c_ids)) or (obj_self.id in c_ids):
|
||||
@@ -774,7 +773,7 @@ class account_move(osv.osv):
|
||||
|
||||
def _amount_compute(self, cr, uid, ids, name, args, context, where =''):
|
||||
if not ids: return {}
|
||||
cr.execute('select move_id,sum(debit) from account_move_line where move_id in ('+','.join(map(str,map(int, ids)))+') group by move_id')
|
||||
cr.execute('select move_id,sum(debit) from account_move_line where move_id =ANY(%s) group by move_id',(ids,))
|
||||
result = dict(cr.fetchall())
|
||||
for id in ids:
|
||||
result.setdefault(id, 0.0)
|
||||
@@ -872,7 +871,7 @@ class account_move(osv.osv):
|
||||
if new_name:
|
||||
self.write(cr, uid, [move.id], {'name':new_name})
|
||||
|
||||
cr.execute('update account_move set state=%s where id in ('+','.join(map(str, ids))+')', ('posted',))
|
||||
cr.execute('update account_move set state=%s where id =ANY(%s) ',('posted',ids,))
|
||||
else:
|
||||
raise osv.except_osv(_('Integrity Error !'), _('You can not validate a non-balanced entry !'))
|
||||
return True
|
||||
@@ -885,7 +884,7 @@ class account_move(osv.osv):
|
||||
if not line.journal_id.update_posted:
|
||||
raise osv.except_osv(_('Error !'), _('You can not modify a posted entry of this journal !\nYou should set the journal to allow cancelling entries if you want to do that.'))
|
||||
if len(ids):
|
||||
cr.execute('update account_move set state=%s where id in ('+','.join(map(str, ids))+')', ('draft',))
|
||||
cr.execute('update account_move set state=%s where id =ANY(%s)',('draft',ids,))
|
||||
return True
|
||||
|
||||
def write(self, cr, uid, ids, vals, context={}):
|
||||
@@ -1155,23 +1154,22 @@ class account_tax_code(osv.osv):
|
||||
"""
|
||||
def _sum(self, cr, uid, ids, name, args, context, where =''):
|
||||
ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)])
|
||||
acc_set = ",".join(map(str, ids2))
|
||||
if context.get('based_on', 'invoices') == 'payments':
|
||||
cr.execute('SELECT line.tax_code_id, sum(line.tax_amount) \
|
||||
FROM account_move_line AS line, \
|
||||
account_move AS move \
|
||||
LEFT JOIN account_invoice invoice ON \
|
||||
(invoice.move_id = move.id) \
|
||||
WHERE line.tax_code_id in ('+acc_set+') '+where+' \
|
||||
WHERE line.tax_code_id =ANY(%s) '+where+' \
|
||||
AND move.id = line.move_id \
|
||||
AND ((invoice.state = \'paid\') \
|
||||
OR (invoice.id IS NULL)) \
|
||||
GROUP BY line.tax_code_id')
|
||||
GROUP BY line.tax_code_id',(ids2,))
|
||||
else:
|
||||
cr.execute('SELECT line.tax_code_id, sum(line.tax_amount) \
|
||||
FROM account_move_line AS line \
|
||||
WHERE line.tax_code_id in ('+acc_set+') '+where+' \
|
||||
GROUP BY line.tax_code_id')
|
||||
WHERE line.tax_code_id =ANY(%s) '+where+' \
|
||||
GROUP BY line.tax_code_id',(ids2,))
|
||||
res=dict(cr.fetchall())
|
||||
for record in self.browse(cr, uid, ids, context):
|
||||
def _rec_get(record):
|
||||
@@ -1246,7 +1244,7 @@ class account_tax_code(osv.osv):
|
||||
def _check_recursion(self, cr, uid, ids):
|
||||
level = 100
|
||||
while len(ids):
|
||||
cr.execute('select distinct parent_id from account_tax_code where id in ('+','.join(map(str, ids))+')')
|
||||
cr.execute('select distinct parent_id from account_tax_code where id =ANY(%s)',(ids,))
|
||||
ids = filter(None, map(lambda x:x[0], cr.fetchall()))
|
||||
if not level:
|
||||
return False
|
||||
@@ -1858,7 +1856,7 @@ class account_account_template(osv.osv):
|
||||
def _check_recursion(self, cr, uid, ids):
|
||||
level = 100
|
||||
while len(ids):
|
||||
cr.execute('select parent_id from account_account_template where id in ('+','.join(map(str, ids))+')')
|
||||
cr.execute('select parent_id from account_account_template where id =ANY(%s)',(ids,))
|
||||
ids = filter(None, map(lambda x:x[0], cr.fetchall()))
|
||||
if not level:
|
||||
return False
|
||||
@@ -1978,7 +1976,7 @@ class account_tax_code_template(osv.osv):
|
||||
def _check_recursion(self, cr, uid, ids):
|
||||
level = 100
|
||||
while len(ids):
|
||||
cr.execute('select distinct parent_id from account_tax_code_template where id in ('+','.join(map(str, ids))+')')
|
||||
cr.execute('select distinct parent_id from account_tax_code_template where id =ANY(%s)',(ids,))
|
||||
ids = filter(None, map(lambda x:x[0], cr.fetchall()))
|
||||
if not level:
|
||||
return False
|
||||
|
||||
@@ -327,14 +327,14 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Invoice">
|
||||
<group col="10" colspan="4">
|
||||
<filter icon="terp-account" string="Draft" domain="[('state','=','draft')]" help="Draft Invoices"/>
|
||||
<filter icon="terp-account" string="Draft" domain="[('state','=','draft')]" help="Draft Invoices"/>
|
||||
<filter icon="terp-account" string="Proforma" domain="[('state','=','proforma2')]" help="Proforma Invoices"/>
|
||||
<filter icon="terp-account" string="Unpaid" domain="[('state','in',('open','cancel'))]" help="Unpaid Invoices"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="number" select='1'/>
|
||||
<field name="partner_id" select='1'/>
|
||||
<field name="amount_total" string="Price" select='1'/>
|
||||
<field name="origin" select='1'/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="number" select='1'/>
|
||||
<field name="partner_id" select='1'/>
|
||||
<field name="amount_total" string="Price" select='1'/>
|
||||
<field name="origin" select='1'/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
@@ -349,18 +349,6 @@
|
||||
<field name="context">{'type':'out_invoice'}</field>
|
||||
<field name="search_view_id" ref="view_account_invoice_filter"/>
|
||||
</record>
|
||||
|
||||
<record id="action_invoice_tree_panding_invoice" model="ir.actions.act_window">
|
||||
<field name="name">Panding Invoice</field>
|
||||
<field name="res_model">account.invoice</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,calendar,graph</field>
|
||||
<field name="view_id" ref="invoice_tree"/>
|
||||
<field name="context">{'type':'out_invoice'}</field>
|
||||
<field name="domain">[('state','=','draft')]</field>
|
||||
<!-- <field name="search_view_id" ref="view_account_invoice_filter"/>-->
|
||||
</record>
|
||||
|
||||
<record id="action_invoice_tree_view1" model="ir.actions.act_window.view">
|
||||
<field eval="1" name="sequence"/>
|
||||
<field name="view_mode">tree</field>
|
||||
@@ -372,7 +360,7 @@
|
||||
<field name="view_id" ref="invoice_form"/>
|
||||
<field name="act_window_id" ref="action_invoice_tree"/>
|
||||
</record>
|
||||
<menuitem action="action_invoice_tree" id="menu_finance_invoice" parent="account.menu_finance" sequence="2"/>
|
||||
<menuitem name="Invoices" id="menu_finance_invoice" parent="account.menu_finance" sequence="2"/>
|
||||
|
||||
<record id="action_invoice_tree1" model="ir.actions.act_window">
|
||||
<field name="name">Customer Invoices</field>
|
||||
|
||||
@@ -258,7 +258,7 @@ class account_move_line(osv.osv):
|
||||
cursor.execute('SELECT l.id, i.id ' \
|
||||
'FROM account_move_line l, account_invoice i ' \
|
||||
'WHERE l.move_id = i.move_id ' \
|
||||
'AND l.id in (' + ','.join([str(x) for x in ids]) + ')')
|
||||
'AND l.id =ANY(%s)',(ids,))
|
||||
invoice_ids = []
|
||||
for line_id, invoice_id in cursor.fetchall():
|
||||
res[line_id] = invoice_id
|
||||
@@ -553,8 +553,6 @@ class account_move_line(osv.osv):
|
||||
return True
|
||||
|
||||
def reconcile(self, cr, uid, ids, type='auto', writeoff_acc_id=False, writeoff_period_id=False, writeoff_journal_id=False, context={}):
|
||||
id_set = ','.join(map(str, ids))
|
||||
|
||||
lines = self.browse(cr, uid, ids, context=context)
|
||||
unrec_lines = filter(lambda x: not x['reconcile_id'], lines)
|
||||
credit = debit = 0.0
|
||||
@@ -579,10 +577,10 @@ class account_move_line(osv.osv):
|
||||
|
||||
cr.execute('SELECT account_id, reconcile_id \
|
||||
FROM account_move_line \
|
||||
WHERE id IN ('+id_set+') \
|
||||
GROUP BY account_id,reconcile_id')
|
||||
WHERE id =ANY(%s) \
|
||||
GROUP BY account_id,reconcile_id',(ids,))
|
||||
r = cr.fetchall()
|
||||
#TODO: move this check to a constraint in the account_move_reconcile object
|
||||
#TODO: move this check to a constraint in the account_move_reconcile object
|
||||
if (len(r) != 1) and not context.get('fy_closing', False):
|
||||
raise osv.except_osv(_('Error'), _('Entries are not of the same account or already reconciled ! '))
|
||||
if not unrec_lines:
|
||||
|
||||
+37
-37
@@ -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-01-22 23:52+0000\n"
|
||||
"Last-Translator: Balint (eSolve) <Unknown>\n"
|
||||
"PO-Revision-Date: 2010-01-30 16:38+0000\n"
|
||||
"Last-Translator: Dukai Gábor <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-01-24 04:50+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-01-31 04:51+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: account
|
||||
@@ -910,7 +910,7 @@ msgstr ""
|
||||
#. module: account
|
||||
#: wizard_field:account.open_closed_fiscalyear,init,fyear_id:0
|
||||
msgid "Fiscal Year to Open"
|
||||
msgstr ""
|
||||
msgstr "Visszanyitandó üzleti év"
|
||||
|
||||
#. module: account
|
||||
#: view:account.config.wizard:0
|
||||
@@ -981,7 +981,7 @@ msgstr ""
|
||||
#: wizard_field:account.print.journal.report,init,period_id:0
|
||||
#: field:account.subscription,period_nbr:0
|
||||
msgid "Period"
|
||||
msgstr "Időszak"
|
||||
msgstr "Periódus"
|
||||
|
||||
#. module: account
|
||||
#: rml:account.partner.balance:0
|
||||
@@ -1172,7 +1172,7 @@ msgstr ""
|
||||
#. module: account
|
||||
#: wizard_view:account.fiscalyear.close.state,init:0
|
||||
msgid "Are you sure you want to close the fiscal year ?"
|
||||
msgstr ""
|
||||
msgstr "Biztos benne, hogy le akarja zárni az üzleti évet?"
|
||||
|
||||
#. module: account
|
||||
#: selection:account.move,type:0
|
||||
@@ -1212,7 +1212,7 @@ msgstr ""
|
||||
#. module: account
|
||||
#: field:account.account,company_currency_id:0
|
||||
msgid "Company Currency"
|
||||
msgstr ""
|
||||
msgstr "Cég pénzneme"
|
||||
|
||||
#. module: account
|
||||
#: model:ir.model,name:account.model_account_fiscal_position_account_template
|
||||
@@ -1332,7 +1332,7 @@ msgstr ""
|
||||
#: selection:account.analytic.account,type:0
|
||||
#: field:account.journal,view_id:0
|
||||
msgid "View"
|
||||
msgstr ""
|
||||
msgstr "nézet"
|
||||
|
||||
#. module: account
|
||||
#: selection:account.account.balance.report,checktype,display_account:0
|
||||
@@ -1471,7 +1471,7 @@ msgstr "Kötelezettség összesen"
|
||||
#. module: account
|
||||
#: wizard_button:account.fiscalyear.close.state,init,close:0
|
||||
msgid "Close states"
|
||||
msgstr ""
|
||||
msgstr "Állapotok zárása"
|
||||
|
||||
#. module: account
|
||||
#: model:ir.model,name:account.model_wizard_company_setup
|
||||
@@ -1707,7 +1707,7 @@ msgstr "Visszanyitás"
|
||||
#. module: account
|
||||
#: wizard_view:account.fiscalyear.close,init:0
|
||||
msgid "Are you sure you want to create entries?"
|
||||
msgstr ""
|
||||
msgstr "Biztos hogy létre akarja hozni ezeket a könyvelési tételeket?"
|
||||
|
||||
#. module: account
|
||||
#: field:account.tax,include_base_amount:0
|
||||
@@ -2071,7 +2071,7 @@ msgstr ""
|
||||
#. module: account
|
||||
#: wizard_field:account.fiscalyear.close,init,period_id:0
|
||||
msgid "Opening Entries Period"
|
||||
msgstr ""
|
||||
msgstr "Nyitóegyenleg periódusa"
|
||||
|
||||
#. module: account
|
||||
#: model:ir.actions.wizard,name:account.wizard_validate_account_moves
|
||||
@@ -2088,7 +2088,7 @@ msgstr ""
|
||||
#. module: account
|
||||
#: selection:account.aged.trial.balance,init,direction_selection:0
|
||||
msgid "Past"
|
||||
msgstr ""
|
||||
msgstr "múlt"
|
||||
|
||||
#. module: account
|
||||
#: field:account.analytic.account,company_currency_id:0
|
||||
@@ -2193,7 +2193,7 @@ msgstr "Tételes"
|
||||
#: selection:account.account,type:0
|
||||
#: selection:account.account.template,type:0
|
||||
msgid "Consolidation"
|
||||
msgstr "Konszolidáció"
|
||||
msgstr "konszolidáció"
|
||||
|
||||
#. module: account
|
||||
#: field:account.chart.template,account_root_id:0
|
||||
@@ -2236,7 +2236,7 @@ msgstr ""
|
||||
#. module: account
|
||||
#: wizard_field:account.fiscalyear.close,init,journal_id:0
|
||||
msgid "Opening Entries Journal"
|
||||
msgstr ""
|
||||
msgstr "Nyitóegyenleg naplója"
|
||||
|
||||
#. module: account
|
||||
#: view:account.config.wizard:0
|
||||
@@ -2711,7 +2711,7 @@ msgstr "Számla azonosító"
|
||||
#. module: account
|
||||
#: field:account.period,date_stop:0
|
||||
msgid "End of Period"
|
||||
msgstr "Időszak vége"
|
||||
msgstr "Periódus vége"
|
||||
|
||||
#. module: account
|
||||
#: wizard_button:populate_statement_from_inv,go,finish:0
|
||||
@@ -2765,7 +2765,7 @@ msgstr ""
|
||||
#. module: account
|
||||
#: wizard_field:account.aged.trial.balance,init,direction_selection:0
|
||||
msgid "Analysis Direction"
|
||||
msgstr ""
|
||||
msgstr "Elemzés iránya"
|
||||
|
||||
#. module: account
|
||||
#: wizard_button:populate_statement_from_inv,init,go:0
|
||||
@@ -3093,7 +3093,7 @@ msgstr ""
|
||||
#: selection:account.account.template,type:0
|
||||
#: selection:account.aged.trial.balance,init,result_selection:0
|
||||
msgid "Payable"
|
||||
msgstr ""
|
||||
msgstr "kötelezettségek"
|
||||
|
||||
#. module: account
|
||||
#: rml:account.invoice:0
|
||||
@@ -3110,7 +3110,7 @@ msgstr ""
|
||||
#: selection:account.account,type:0
|
||||
#: selection:account.account.template,type:0
|
||||
msgid "Others"
|
||||
msgstr ""
|
||||
msgstr "egyéb"
|
||||
|
||||
#. module: account
|
||||
#: selection:account.automatic.reconcile,init,power:0
|
||||
@@ -3250,7 +3250,7 @@ msgstr ""
|
||||
#: model:ir.actions.wizard,name:account.wizard_fiscalyear_close
|
||||
#: model:ir.ui.menu,name:account.menu_wizard_fy_close
|
||||
msgid "Generate Fiscal Year Opening Entries"
|
||||
msgstr ""
|
||||
msgstr "Nyitóegyenlegek készítése az üzleti évhez"
|
||||
|
||||
#. module: account
|
||||
#: model:ir.actions.wizard,name:account.wizard_reconcile
|
||||
@@ -3277,7 +3277,7 @@ msgstr "Adónév"
|
||||
#. module: account
|
||||
#: wizard_view:account.fiscalyear.close.state,init:0
|
||||
msgid " Close states of Fiscal year and periods"
|
||||
msgstr ""
|
||||
msgstr " Az üzleti év és a periódusok állapotainak zárása"
|
||||
|
||||
#. module: account
|
||||
#: model:account.payment.term,name:account.account_payment_term
|
||||
@@ -3565,7 +3565,7 @@ msgstr "Naplókód"
|
||||
#: wizard_button:account.fiscalyear.close,init,close:0
|
||||
#: view:account.model:0
|
||||
msgid "Create entries"
|
||||
msgstr ""
|
||||
msgstr "Tételek létrehozása"
|
||||
|
||||
#. module: account
|
||||
#: view:account.analytic.line:0
|
||||
@@ -3780,7 +3780,7 @@ msgstr ""
|
||||
#: selection:account.account,type:0
|
||||
#: selection:account.account.template,type:0
|
||||
msgid "Closed"
|
||||
msgstr ""
|
||||
msgstr "lezárt"
|
||||
|
||||
#. module: account
|
||||
#: model:process.node,name:account.process_node_paymententries0
|
||||
@@ -3878,7 +3878,7 @@ msgstr "Maximális mennyiség"
|
||||
#. module: account
|
||||
#: field:account.period,name:0
|
||||
msgid "Period Name"
|
||||
msgstr "Időszak"
|
||||
msgstr "Periódus"
|
||||
|
||||
#. module: account
|
||||
#: help:account.analytic.journal,type:0
|
||||
@@ -4294,7 +4294,7 @@ msgstr ""
|
||||
#: field:account.account,type:0
|
||||
#: field:account.account.template,type:0
|
||||
msgid "Internal Type"
|
||||
msgstr ""
|
||||
msgstr "Belső típus"
|
||||
|
||||
#. module: account
|
||||
#: selection:account.automatic.reconcile,init,power:0
|
||||
@@ -4333,7 +4333,7 @@ msgstr "Záró dátum"
|
||||
#: model:ir.actions.wizard,name:account.wizard_open_closed_fiscalyear
|
||||
#: model:ir.ui.menu,name:account.menu_wizard_open_closed_fy
|
||||
msgid "Cancel Opening Entries"
|
||||
msgstr ""
|
||||
msgstr "Nyitóegyenleg visszavonása"
|
||||
|
||||
#. module: account
|
||||
#: model:process.transition,name:account.process_transition_invoicemanually0
|
||||
@@ -4435,7 +4435,7 @@ msgstr ""
|
||||
#: view:account.fiscalyear:0
|
||||
#: view:account.period:0
|
||||
msgid "States"
|
||||
msgstr ""
|
||||
msgstr "Állapotok"
|
||||
|
||||
#. module: account
|
||||
#: view:account.move:0
|
||||
@@ -4560,7 +4560,7 @@ msgstr ""
|
||||
#. module: account
|
||||
#: wizard_field:account.aged.trial.balance,init,result_selection:0
|
||||
msgid "Filter on Partners"
|
||||
msgstr ""
|
||||
msgstr "Partnerek szűrése"
|
||||
|
||||
#. module: account
|
||||
#: field:account.tax,price_include:0
|
||||
@@ -4772,7 +4772,7 @@ msgstr ""
|
||||
#: selection:account.account.template,type:0
|
||||
#: selection:account.aged.trial.balance,init,result_selection:0
|
||||
msgid "Receivable"
|
||||
msgstr ""
|
||||
msgstr "követelések"
|
||||
|
||||
#. module: account
|
||||
#: model:ir.actions.report.xml,name:account.account_account_balance
|
||||
@@ -4909,12 +4909,12 @@ msgstr "Tételek"
|
||||
#. module: account
|
||||
#: field:account.period,date_start:0
|
||||
msgid "Start of Period"
|
||||
msgstr ""
|
||||
msgstr "Periódus kezdete"
|
||||
|
||||
#. module: account
|
||||
#: wizard_field:account.fiscalyear.close,init,report_name:0
|
||||
msgid "Name of new entries"
|
||||
msgstr ""
|
||||
msgstr "Új tételek neve"
|
||||
|
||||
#. module: account
|
||||
#: wizard_button:account_use_models,init_form,create:0
|
||||
@@ -5252,7 +5252,7 @@ msgstr ""
|
||||
#. module: account
|
||||
#: wizard_view:account.period.close,init:0
|
||||
msgid "Are you sure ?"
|
||||
msgstr ""
|
||||
msgstr "Biztos benne?"
|
||||
|
||||
#. module: account
|
||||
#: rml:account.invoice:0
|
||||
@@ -5320,7 +5320,7 @@ msgstr ""
|
||||
#. module: account
|
||||
#: selection:account.aged.trial.balance,init,result_selection:0
|
||||
msgid "Receivable and Payable"
|
||||
msgstr ""
|
||||
msgstr "követelések és kötelezettségek"
|
||||
|
||||
#. module: account
|
||||
#: rml:account.account.balance:0
|
||||
@@ -5468,7 +5468,7 @@ msgstr ""
|
||||
#: view:account.move:0
|
||||
#: view:account.move.line:0
|
||||
msgid "General Information"
|
||||
msgstr ""
|
||||
msgstr "Általános adatok"
|
||||
|
||||
#. module: account
|
||||
#: help:populate_statement_from_inv,init,journal_id:0
|
||||
@@ -5566,7 +5566,7 @@ msgstr ""
|
||||
#: wizard_field:account.fiscalyear.close,init,fy_id:0
|
||||
#: wizard_field:account.fiscalyear.close.state,init,fy_id:0
|
||||
msgid "Fiscal Year to close"
|
||||
msgstr ""
|
||||
msgstr "Lezárandó üzleti év"
|
||||
|
||||
#. module: account
|
||||
#: wizard_field:account.aged.trial.balance,init,date1:0
|
||||
@@ -5670,7 +5670,7 @@ msgstr "Árbevétel számla"
|
||||
#. module: account
|
||||
#: field:account.period,special:0
|
||||
msgid "Opening/Closing Period"
|
||||
msgstr ""
|
||||
msgstr "Nyitó/záró periódus"
|
||||
|
||||
#. module: account
|
||||
#: rml:account.analytic.account.balance:0
|
||||
@@ -5763,7 +5763,7 @@ msgstr "Pénzügyi év"
|
||||
#. module: account
|
||||
#: selection:account.aged.trial.balance,init,direction_selection:0
|
||||
msgid "Future"
|
||||
msgstr ""
|
||||
msgstr "jövő"
|
||||
|
||||
#. module: account
|
||||
#: help:account.account.balance.report,checktype,fiscalyear:0
|
||||
@@ -5893,7 +5893,7 @@ msgstr ""
|
||||
#: wizard_field:account.fiscalyear.close.state,init,sure:0
|
||||
#: wizard_field:account.period.close,init,sure:0
|
||||
msgid "Check this box"
|
||||
msgstr ""
|
||||
msgstr "Jelölje meg ezt a négyzetet"
|
||||
|
||||
#. module: account
|
||||
#: help:account.tax,price_include:0
|
||||
|
||||
+20
-15
@@ -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-01-17 16:07+0000\n"
|
||||
"Last-Translator: Davide Corio <davide.corio@domsense.com>\n"
|
||||
"PO-Revision-Date: 2010-01-29 14:02+0000\n"
|
||||
"Last-Translator: Carlo <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-01-18 04:44+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-01-30 04:39+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: account
|
||||
@@ -299,7 +299,7 @@ msgstr "Fisso"
|
||||
#: model:ir.actions.report.xml,name:account.account_overdue
|
||||
#: view:res.company:0
|
||||
msgid "Overdue Payments"
|
||||
msgstr ""
|
||||
msgstr "Ritardo Pagamenti"
|
||||
|
||||
#. module: account
|
||||
#: wizard_view:account.account.balance.report,checktype:0
|
||||
@@ -336,7 +336,7 @@ msgstr "Computazione del canone"
|
||||
#. module: account
|
||||
#: rml:account.central.journal:0
|
||||
msgid "Account Num."
|
||||
msgstr ""
|
||||
msgstr "Conto n."
|
||||
|
||||
#. module: account
|
||||
#: rml:account.analytic.account.analytic.check:0
|
||||
@@ -475,7 +475,7 @@ msgstr "Riconciliazione bancaria"
|
||||
#. module: account
|
||||
#: rml:account.invoice:0
|
||||
msgid "Disc.(%)"
|
||||
msgstr ""
|
||||
msgstr "Sconto (%)"
|
||||
|
||||
#. module: account
|
||||
#: rml:account.general.ledger:0
|
||||
@@ -497,6 +497,8 @@ msgid ""
|
||||
"Set if the amount of tax must be included in the base amount before "
|
||||
"computing the next taxes."
|
||||
msgstr ""
|
||||
"Selezionare se l'importo della tassa debba essere incluso nell'importo base "
|
||||
"prima di calcolare le prossime tasse"
|
||||
|
||||
#. module: account
|
||||
#: model:ir.ui.menu,name:account.menu_finance_periodical_processing
|
||||
@@ -506,7 +508,7 @@ msgstr "Elaborazioni periodiche"
|
||||
#. module: account
|
||||
#: view:report.hr.timesheet.invoice.journal:0
|
||||
msgid "Analytic Entries Stats"
|
||||
msgstr ""
|
||||
msgstr "Statistiche delle registrazioni analitiche"
|
||||
|
||||
#. module: account
|
||||
#: model:ir.actions.act_window,name:account.action_account_tax_code_template_form
|
||||
@@ -528,7 +530,7 @@ msgstr "Pagamento Riconciliato"
|
||||
#. module: account
|
||||
#: wizard_field:account.chart,init,target_move:0
|
||||
msgid "Target Moves"
|
||||
msgstr ""
|
||||
msgstr "Registrazioni:"
|
||||
|
||||
#. module: account
|
||||
#: model:ir.actions.act_window,name:account.action_account_tax_template_form
|
||||
@@ -549,7 +551,7 @@ msgstr "Metodo riapertura conti"
|
||||
#. module: account
|
||||
#: field:account.tax.template,include_base_amount:0
|
||||
msgid "Include in Base Amount"
|
||||
msgstr ""
|
||||
msgstr "Incluso nell'imponibile"
|
||||
|
||||
#. module: account
|
||||
#: field:account.tax,ref_base_code_id:0
|
||||
@@ -579,6 +581,9 @@ msgid ""
|
||||
"Number of days to add before computation of the day of month.If Date=15/01, "
|
||||
"Number of Days=22, Day of Month=-1, then the due date is 28/02."
|
||||
msgstr ""
|
||||
"Numero di giorni da aggiungere prima della computazione del giorno del mese. "
|
||||
"Se Data=15/01, Numero di giorni=22, Giorno del mese=-1, allora la scadenza "
|
||||
"sarà 28/02."
|
||||
|
||||
#. module: account
|
||||
#: model:ir.model,name:account.model_account_tax
|
||||
@@ -588,12 +593,12 @@ msgstr "account.tax"
|
||||
#. module: account
|
||||
#: rml:account.central.journal:0
|
||||
msgid "Printing Date"
|
||||
msgstr ""
|
||||
msgstr "Stampa Data"
|
||||
|
||||
#. module: account
|
||||
#: rml:account.general.ledger:0
|
||||
msgid "Mvt"
|
||||
msgstr ""
|
||||
msgstr "Reg. n."
|
||||
|
||||
#. module: account
|
||||
#: model:ir.actions.wizard,name:account.wizard_aged_trial_balance
|
||||
@@ -659,7 +664,7 @@ msgstr ""
|
||||
#. module: account
|
||||
#: help:account.fiscalyear,company_id:0
|
||||
msgid "Keep empty if the fiscal year belongs to several companies."
|
||||
msgstr ""
|
||||
msgstr "Lasciare vuoto se l'anno fiscale appartiene a più aziende"
|
||||
|
||||
#. module: account
|
||||
#: model:ir.ui.menu,name:account.menu_analytic_accounting
|
||||
@@ -669,7 +674,7 @@ msgstr "Contabilità Analitica"
|
||||
#. module: account
|
||||
#: rml:account.overdue:0
|
||||
msgid "Sub-Total :"
|
||||
msgstr ""
|
||||
msgstr "Sub-totale"
|
||||
|
||||
#. module: account
|
||||
#: field:account.analytic.account,line_ids:0
|
||||
@@ -687,12 +692,12 @@ msgstr "Mese"
|
||||
#. module: account
|
||||
#: field:account.analytic.account,partner_id:0
|
||||
msgid "Associated Partner"
|
||||
msgstr ""
|
||||
msgstr "Partner associato"
|
||||
|
||||
#. module: account
|
||||
#: field:account.invoice,comment:0
|
||||
msgid "Additional Information"
|
||||
msgstr ""
|
||||
msgstr "Informazioni Aggiuntive"
|
||||
|
||||
#. module: account
|
||||
#: selection:account.invoice,type:0
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -90,20 +90,20 @@ class res_partner(osv.osv):
|
||||
_description = 'Partner'
|
||||
def _credit_debit_get(self, cr, uid, ids, field_names, arg, context):
|
||||
query = self.pool.get('account.move.line')._query_get(cr, uid, context=context)
|
||||
cr.execute(("""select
|
||||
cr.execute("""select
|
||||
l.partner_id, a.type, sum(l.debit-l.credit)
|
||||
from
|
||||
account_move_line l
|
||||
left join
|
||||
account_account a on (l.account_id=a.id)
|
||||
where
|
||||
a.type in ('receivable','payable') and
|
||||
l.partner_id in (%s) and
|
||||
a.type =ANY(%s) and
|
||||
l.partner_id =ANY(%s) and
|
||||
l.reconcile_id is null and
|
||||
""" % (','.join(map(str, ids)),))+query+"""
|
||||
"""+query+"""
|
||||
group by
|
||||
l.partner_id, a.type
|
||||
""")
|
||||
""",(['receivable','payable'],ids,))
|
||||
tinvert = {
|
||||
'credit': 'receivable',
|
||||
'debit': 'payable'
|
||||
|
||||
@@ -34,7 +34,6 @@ class account_analytic_account(osv.osv):
|
||||
_description = 'Analytic Accounts'
|
||||
|
||||
def _credit_calc(self, cr, uid, ids, name, arg, context={}):
|
||||
acc_set = ",".join(map(str, ids))
|
||||
|
||||
where_date = ''
|
||||
if context.get('from_date',False):
|
||||
@@ -42,7 +41,7 @@ class account_analytic_account(osv.osv):
|
||||
if context.get('to_date',False):
|
||||
where_date += " AND l.date <= '" + context['to_date'] + "'"
|
||||
|
||||
cr.execute("SELECT a.id, COALESCE(SUM(l.amount),0) FROM account_analytic_account a LEFT JOIN account_analytic_line l ON (a.id=l.account_id %s) WHERE l.amount<0 and a.id IN (%s) GROUP BY a.id" % (where_date,acc_set))
|
||||
cr.execute("SELECT a.id, COALESCE(SUM(l.amount),0) FROM account_analytic_account a LEFT JOIN account_analytic_line l ON (a.id=l.account_id "+where_date+") WHERE l.amount<0 and a.id =ANY(%s) GROUP BY a.id",(ids,))
|
||||
r = dict(cr.fetchall())
|
||||
for i in ids:
|
||||
r.setdefault(i,0.0)
|
||||
@@ -50,15 +49,13 @@ class account_analytic_account(osv.osv):
|
||||
|
||||
def _debit_calc(self, cr, uid, ids, name, arg, context={}):
|
||||
|
||||
acc_set = ",".join(map(str, ids))
|
||||
|
||||
where_date = ''
|
||||
if context.get('from_date',False):
|
||||
where_date += " AND l.date >= '" + context['from_date'] + "'"
|
||||
if context.get('to_date',False):
|
||||
where_date += " AND l.date <= '" + context['to_date'] + "'"
|
||||
|
||||
cr.execute("SELECT a.id, COALESCE(SUM(l.amount),0) FROM account_analytic_account a LEFT JOIN account_analytic_line l ON (a.id=l.account_id %s) WHERE l.amount>0 and a.id IN (%s) GROUP BY a.id" % (where_date,acc_set))
|
||||
cr.execute("SELECT a.id, COALESCE(SUM(l.amount),0) FROM account_analytic_account a LEFT JOIN account_analytic_line l ON (a.id=l.account_id "+where_date+") WHERE l.amount>0 and a.id =ANY(%s) GROUP BY a.id" ,(ids,))
|
||||
r= dict(cr.fetchall())
|
||||
for i in ids:
|
||||
r.setdefault(i,0.0)
|
||||
@@ -67,12 +64,9 @@ class account_analytic_account(osv.osv):
|
||||
def _balance_calc(self, cr, uid, ids, name, arg, context={}):
|
||||
res = {}
|
||||
ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)])
|
||||
acc_set = ",".join(map(str, ids2))
|
||||
|
||||
for i in ids:
|
||||
res.setdefault(i,0.0)
|
||||
|
||||
if not acc_set:
|
||||
if not ids2:
|
||||
return res
|
||||
|
||||
where_date = ''
|
||||
@@ -81,12 +75,12 @@ class account_analytic_account(osv.osv):
|
||||
if context.get('to_date',False):
|
||||
where_date += " AND l.date <= '" + context['to_date'] + "'"
|
||||
|
||||
cr.execute("SELECT a.id, COALESCE(SUM(l.amount),0) FROM account_analytic_account a LEFT JOIN account_analytic_line l ON (a.id=l.account_id %s) WHERE a.id IN (%s) GROUP BY a.id" % (where_date,acc_set))
|
||||
cr.execute("SELECT a.id, COALESCE(SUM(l.amount),0) FROM account_analytic_account a LEFT JOIN account_analytic_line l ON (a.id=l.account_id "+where_date+") WHERE a.id =ANY(%s) GROUP BY a.id",(ids2,))
|
||||
|
||||
for account_id, sum in cr.fetchall():
|
||||
res[account_id] = sum
|
||||
|
||||
cr.execute("SELECT a.id, r.currency_id FROM account_analytic_account a INNER JOIN res_company r ON (a.company_id = r.id) where a.id in (%s)" % acc_set)
|
||||
cr.execute("SELECT a.id, r.currency_id FROM account_analytic_account a INNER JOIN res_company r ON (a.company_id = r.id) where a.id =ANY(%s)",(ids2,))
|
||||
|
||||
currency= dict(cr.fetchall())
|
||||
|
||||
@@ -131,7 +125,7 @@ class account_analytic_account(osv.osv):
|
||||
cr.execute('SELECT a.id, COALESCE(SUM(l.unit_amount), 0) \
|
||||
FROM account_analytic_account a \
|
||||
LEFT JOIN account_analytic_line l ON (a.id = l.account_id ' + where_date + ') \
|
||||
WHERE a.id IN ('+acc_set+') GROUP BY a.id')
|
||||
WHERE a.id =ANY(%s) GROUP BY a.id',(ids2,))
|
||||
|
||||
for account_id, sum in cr.fetchall():
|
||||
res[account_id] = sum
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -47,7 +47,7 @@ class account_analytic_balance(report_sxw.rml_parse):
|
||||
self.empty_acc = False
|
||||
self.acc_data_dict = {}# maintains a relation with an account with its successors.
|
||||
self.acc_sum_list = []# maintains a list of all ids
|
||||
|
||||
|
||||
def get_children(self, ids):
|
||||
ids2 = []
|
||||
read_data = self.pool.get('account.analytic.account').read(self.cr, self.uid, ids,['child_ids','code','complete_name','balance'])
|
||||
@@ -56,23 +56,23 @@ class account_analytic_balance(report_sxw.rml_parse):
|
||||
inculde_empty = True
|
||||
if (not self.empty_acc) and data['balance'] == 0.00:
|
||||
inculde_empty = False
|
||||
if inculde_empty:
|
||||
if inculde_empty:
|
||||
self.acc_ids.append(data['id'])
|
||||
self.read_data.append(data)
|
||||
if data['child_ids']:
|
||||
res = self.get_children(data['child_ids'])
|
||||
return True
|
||||
|
||||
|
||||
res = self.get_children(data['child_ids'])
|
||||
return True
|
||||
|
||||
|
||||
def _get_objects(self, empty_acc):
|
||||
if self.read_data:
|
||||
return self.read_data
|
||||
self.empty_acc = empty_acc
|
||||
self.read_data = []
|
||||
self.get_children(self.ids)
|
||||
|
||||
|
||||
return self.read_data
|
||||
|
||||
|
||||
def _lines_g(self, account_id, date1, date2):
|
||||
account_analytic_obj = self.pool.get('account.analytic.account')
|
||||
ids = account_analytic_obj.search(self.cr, self.uid,
|
||||
@@ -86,7 +86,7 @@ class account_analytic_balance(report_sxw.rml_parse):
|
||||
GROUP BY aal.general_account_id, aa.name, aa.code, aal.code \
|
||||
ORDER BY aal.code", (date1, date2))
|
||||
res = self.cr.dictfetchall()
|
||||
|
||||
|
||||
for r in res:
|
||||
if r['balance'] > 0:
|
||||
r['debit'] = r['balance']
|
||||
@@ -99,7 +99,7 @@ class account_analytic_balance(report_sxw.rml_parse):
|
||||
r['debit'] = 0.0
|
||||
r['credit'] = 0.0
|
||||
return res
|
||||
|
||||
|
||||
def _move_sum(self, account_id, date1, date2, option):
|
||||
if account_id not in self.acc_data_dict:
|
||||
account_analytic_obj = self.pool.get('account.analytic.account')
|
||||
@@ -107,24 +107,23 @@ class account_analytic_balance(report_sxw.rml_parse):
|
||||
self.acc_data_dict[account_id] = ids
|
||||
else:
|
||||
ids = self.acc_data_dict[account_id]
|
||||
|
||||
|
||||
if option == "credit" :
|
||||
self.cr.execute("SELECT -sum(amount) FROM account_analytic_line \
|
||||
WHERE account_id in ("+ ','.join(map(str, ids)) +") \
|
||||
AND date>=%s AND date<=%s AND amount<0",
|
||||
(date1, date2))
|
||||
WHERE account_id =ANY(%s) AND date>=%s AND date<=%s AND amount<0",
|
||||
(ids,date1, date2))
|
||||
elif option == "debit" :
|
||||
self.cr.execute("SELECT sum(amount) FROM account_analytic_line \
|
||||
WHERE account_id in ("+ ','.join(map(str, ids)) +") \
|
||||
WHERE account_id =ANY(%s)\
|
||||
AND date>=%s AND date<=%s AND amount>0",
|
||||
(date1, date2))
|
||||
(ids,date1, date2))
|
||||
elif option == "quantity" :
|
||||
self.cr.execute("SELECT sum(unit_amount) FROM account_analytic_line \
|
||||
WHERE account_id in ("+ ','.join(map(str, ids)) +") \
|
||||
WHERE account_id =ANY(%s)\
|
||||
AND date>=%s AND date<=%s",
|
||||
(date1, date2))
|
||||
(ids,date1, date2))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
|
||||
|
||||
|
||||
# def _move_sum_debit(self, account_id, date1, date2):
|
||||
# account_analytic_obj = self.pool.get('account.analytic.account')
|
||||
@@ -147,12 +146,12 @@ class account_analytic_balance(report_sxw.rml_parse):
|
||||
# AND date>=%s AND date<=%s AND amount<0",
|
||||
# (date1, date2))
|
||||
# return self.cr.fetchone()[0] or 0.0
|
||||
#
|
||||
#
|
||||
def _move_sum_balance(self, account_id, date1, date2):
|
||||
debit = self._move_sum(account_id, date1, date2, 'debit')
|
||||
debit = self._move_sum(account_id, date1, date2, 'debit')
|
||||
credit = self._move_sum(account_id, date1, date2, 'credit')
|
||||
return (debit-credit)
|
||||
|
||||
|
||||
# def _move_sum_quantity(self, account_id, date1, date2):
|
||||
# account_analytic_obj = self.pool.get('account.analytic.account')
|
||||
# ids = account_analytic_obj.search(self.cr, self.uid,
|
||||
@@ -166,7 +165,6 @@ class account_analytic_balance(report_sxw.rml_parse):
|
||||
|
||||
def _sum_all(self, accounts, date1, date2, option):
|
||||
ids = map(lambda x: x['id'], accounts)
|
||||
|
||||
if not len(ids):
|
||||
return 0.0
|
||||
|
||||
@@ -176,25 +174,21 @@ class account_analytic_balance(report_sxw.rml_parse):
|
||||
self.acc_sum_list = ids2
|
||||
else:
|
||||
ids2 = self.acc_sum_list
|
||||
|
||||
if option == "debit" :
|
||||
self.cr.execute("SELECT sum(amount) FROM account_analytic_line \
|
||||
WHERE account_id IN ("+','.join(map(str, ids2))+") \
|
||||
AND date>=%s AND date<=%s AND amount>0",
|
||||
(date1, date2))
|
||||
WHERE account_id =ANY(%s) AND date>=%s AND date<=%s AND amount>0",
|
||||
(ids,date1, date2,))
|
||||
elif option == "credit" :
|
||||
self.cr.execute("SELECT -sum(amount) FROM account_analytic_line \
|
||||
WHERE account_id IN ("+','.join(map(str, ids2))+") \
|
||||
AND date>=%s AND date<=%s AND amount<0",
|
||||
(date1, date2))
|
||||
WHERE account_id =ANY(%s) AND date>=%s AND date<=%s AND amount<0",
|
||||
(ids,date1, date2,))
|
||||
elif option == "quantity" :
|
||||
self.cr.execute("SELECT sum(unit_amount) FROM account_analytic_line \
|
||||
WHERE account_id IN ("+','.join(map(str, ids2))+") \
|
||||
AND date>=%s AND date<=%s",
|
||||
(date1, date2))
|
||||
WHERE account_id =ANY(%s)AND date>=%s AND date<=%s",
|
||||
(ids,date1, date2,))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
|
||||
|
||||
|
||||
# def _sum_debit(self, accounts, date1, date2):
|
||||
# ids = map(lambda x: x['id'], accounts)
|
||||
# if not len(ids):
|
||||
@@ -208,7 +202,7 @@ class account_analytic_balance(report_sxw.rml_parse):
|
||||
# AND date>=%s AND date<=%s AND amount>0",
|
||||
# (date1, date2))
|
||||
# return self.cr.fetchone()[0] or 0.0
|
||||
#
|
||||
#
|
||||
# def _sum_credit(self, accounts, date1, date2):
|
||||
# ids = map(lambda x: x['id'], accounts)
|
||||
# if not len(ids):
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -43,7 +43,6 @@ class account_analytic_analytic_check(report_sxw.rml_parse):
|
||||
def _lines_p(self, date1, date2):
|
||||
res = []
|
||||
acc_obj = self.pool.get('account.account')
|
||||
# print"3333333acc_obj3333333",acc_obj.read(self.cr, self.uid, self.ids, ['name', 'code','user_type'])
|
||||
|
||||
for a in acc_obj.read(self.cr, self.uid, self.ids, ['name', 'code']):
|
||||
self.cr.execute("SELECT sum(debit), sum(credit) \
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -85,7 +85,7 @@ class account_analytic_cost_ledger(report_sxw.rml_parse):
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
|
||||
def _account_sum_balance(self, account_id, date1, date2):
|
||||
debit = self._account_sum_debit(account_id, date1, date2)
|
||||
debit = self._account_sum_debit(account_id, date1, date2)
|
||||
credit = self._account_sum_credit(account_id, date1, date2)
|
||||
return (debit-credit)
|
||||
|
||||
@@ -93,7 +93,7 @@ class account_analytic_cost_ledger(report_sxw.rml_parse):
|
||||
ids = map(lambda x: x.id, accounts)
|
||||
if not len(ids):
|
||||
return 0.0
|
||||
self.cr.execute("SELECT sum(amount) FROM account_analytic_line WHERE account_id IN ("+','.join(map(str, ids))+") AND date>=%s AND date<=%s AND amount>0", (date1, date2))
|
||||
self.cr.execute("SELECT sum(amount) FROM account_analytic_line WHERE account_id =ANY(%s) AND date>=%s AND date<=%s AND amount>0", (ids, date1, date2,))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
|
||||
def _sum_credit(self, accounts, date1, date2):
|
||||
@@ -101,7 +101,7 @@ class account_analytic_cost_ledger(report_sxw.rml_parse):
|
||||
if not len(ids):
|
||||
return 0.0
|
||||
ids = map(lambda x: x.id, accounts)
|
||||
self.cr.execute("SELECT -sum(amount) FROM account_analytic_line WHERE account_id IN ("+','.join(map(str, ids))+") AND date>=%s AND date<=%s AND amount<0", (date1, date2))
|
||||
self.cr.execute("SELECT -sum(amount) FROM account_analytic_line WHERE account_id =ANY(%s) AND date>=%s AND date<=%s AND amount<0", (ids,date1, date2,))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
|
||||
def _sum_balance(self, accounts, date1, date2):
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -40,8 +40,8 @@ class account_inverted_analytic_balance(report_sxw.rml_parse):
|
||||
ids = map(lambda x: x.id, accounts)
|
||||
self.cr.execute("SELECT aa.name AS name, aa.code AS code, sum(aal.amount) AS balance, sum(aal.unit_amount) AS quantity, aa.id AS id \
|
||||
FROM account_analytic_line AS aal, account_account AS aa \
|
||||
WHERE (aal.general_account_id=aa.id) AND (aal.account_id IN ("+','.join(map(str, ids))+")) AND (date>=%s) AND (date<=%s) AND aa.active \
|
||||
GROUP BY aal.general_account_id, aa.name, aa.code, aal.code, aa.id ORDER BY aal.code", (date1, date2))
|
||||
WHERE (aal.general_account_id=aa.id) AND (aal.account_id =ANY(%s)) AND (date>=%s) AND (date<=%s) AND aa.active \
|
||||
GROUP BY aal.general_account_id, aa.name, aa.code, aal.code, aa.id ORDER BY aal.code", (ids,date1,date2,))
|
||||
res = self.cr.dictfetchall()
|
||||
|
||||
for r in res:
|
||||
@@ -60,8 +60,8 @@ class account_inverted_analytic_balance(report_sxw.rml_parse):
|
||||
ids = map(lambda x: x.id, accounts)
|
||||
self.cr.execute("SELECT sum(aal.amount) AS balance, sum(aal.unit_amount) AS quantity, aaa.code AS code, aaa.name AS name, account_id \
|
||||
FROM account_analytic_line AS aal, account_analytic_account AS aaa \
|
||||
WHERE aal.account_id=aaa.id AND aal.account_id IN ("+','.join(map(str, ids))+") AND aal.general_account_id=%s AND aal.date>=%s AND aal.date<=%s \
|
||||
GROUP BY aal.account_id, general_account_id, aaa.code, aaa.name ORDER BY aal.account_id", (general_account_id, date1, date2))
|
||||
WHERE aal.account_id=aaa.id AND aal.account_id =ANY(%s) AND aal.general_account_id=%s AND aal.date>=%s AND aal.date<=%s \
|
||||
GROUP BY aal.account_id, general_account_id, aaa.code, aaa.name ORDER BY aal.account_id", (ids,general_account_id, date1, date2,))
|
||||
res = self.cr.dictfetchall()
|
||||
|
||||
aaa_obj = self.pool.get('account.analytic.account')
|
||||
@@ -86,14 +86,14 @@ class account_inverted_analytic_balance(report_sxw.rml_parse):
|
||||
ids = map(lambda x: x.id, accounts)
|
||||
self.cr.execute("SELECT sum(amount) \
|
||||
FROM account_analytic_line \
|
||||
WHERE account_id IN ("+','.join(map(str, ids))+") AND date>=%s AND date<=%s AND amount>0", (date1, date2))
|
||||
WHERE account_id =ANY(%s) AND date>=%s AND date<=%s AND amount>0", (ids,date1, date2,))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
|
||||
|
||||
def _sum_credit(self, accounts, date1, date2):
|
||||
ids = map(lambda x: x.id, accounts)
|
||||
self.cr.execute("SELECT -sum(amount) \
|
||||
FROM account_analytic_line \
|
||||
WHERE account_id IN ("+','.join(map(str, ids))+") AND date>=%s AND date<=%s AND amount<0", (date1, date2))
|
||||
WHERE account_id =ANY(%s) AND date>=%s AND date<=%s AND amount<0", (ids,date1, date2,))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
|
||||
def _sum_balance(self, accounts, date1, date2):
|
||||
@@ -105,7 +105,7 @@ class account_inverted_analytic_balance(report_sxw.rml_parse):
|
||||
ids = map(lambda x: x.id, accounts)
|
||||
self.cr.execute("SELECT sum(unit_amount) \
|
||||
FROM account_analytic_line \
|
||||
WHERE account_id IN ("+','.join(map(str, ids))+") AND date>=%s AND date<=%s", (date1, date2))
|
||||
WHERE account_id =ANY(%s) AND date>=%s AND date<=%s", (ids,date1, date2,))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
|
||||
report_sxw.report_sxw('report.account.analytic.account.inverted.balance', 'account.analytic.account', 'addons/account/project/report/inverted_analytic_balance.rml',parser=account_inverted_analytic_balance, header=False)
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -52,10 +52,9 @@ class account_analytic_quantity_cost_ledger(report_sxw.rml_parse):
|
||||
WHERE (aal.account_id=%s) AND (aal.date>=%s) \
|
||||
AND (aal.date<=%s) AND (aal.general_account_id=aa.id) \
|
||||
AND aa.active \
|
||||
AND (aal.journal_id IN (" +
|
||||
','.join(map(str, journal_ids)) + ")) \
|
||||
AND (aal.journal_id =ANY(%s) ) \
|
||||
GROUP BY aa.code, aa.name, aa.id ORDER BY aa.code",
|
||||
(account_id, date1, date2))
|
||||
(account_id, date1, date2,journal_ids))
|
||||
res = self.cr.dictfetchall()
|
||||
return res
|
||||
|
||||
@@ -80,10 +79,9 @@ class account_analytic_quantity_cost_ledger(report_sxw.rml_parse):
|
||||
account_analytic_journal AS aaj \
|
||||
WHERE (aal.general_account_id=%s) AND (aal.account_id=%s) \
|
||||
AND (aal.date>=%s) AND (aal.date<=%s) \
|
||||
AND (aal.journal_id=aaj.id) AND (aaj.id IN (" +
|
||||
','.join(map(str, journal_ids)) + ")) \
|
||||
ORDER BY aal.date, aaj.code, aal.code",
|
||||
(general_account_id, account_id, date1, date2))
|
||||
AND (aal.journal_id=aaj.id) AND (aaj.id =ANY(%s)) \
|
||||
ORDER BY aal.date, aaj.code, aal.code",
|
||||
(general_account_id, account_id, date1, date2,journal_ids,))
|
||||
res = self.cr.dictfetchall()
|
||||
return res
|
||||
|
||||
@@ -98,9 +96,8 @@ class account_analytic_quantity_cost_ledger(report_sxw.rml_parse):
|
||||
self.cr.execute("SELECT sum(unit_amount) \
|
||||
FROM account_analytic_line \
|
||||
WHERE account_id = %s AND date >= %s AND date <= %s \
|
||||
AND journal_id IN (" +
|
||||
','.join(map(str, journal_ids)) + ")",
|
||||
(account_id, date1, date2))
|
||||
AND journal_id =ANY(%s)",
|
||||
(account_id, date1, date2,journal_ids,))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
|
||||
def _sum_quantity(self, accounts, date1, date2, journals):
|
||||
@@ -110,18 +107,14 @@ class account_analytic_quantity_cost_ledger(report_sxw.rml_parse):
|
||||
if not journals or not journals[0][2]:
|
||||
self.cr.execute("SELECT sum(unit_amount) \
|
||||
FROM account_analytic_line \
|
||||
WHERE account_id IN (" +
|
||||
','.join(map(str, ids)) + ") AND date>=%s AND date<=%s",
|
||||
(date1, date2))
|
||||
WHERE account_id =ANY(%s) AND date>=%s AND date<=%s",
|
||||
(date1, date2,ids,))
|
||||
else:
|
||||
journal_ids = journals[0][2]
|
||||
self.cr.execute("SELECT sum(unit_amount) \
|
||||
FROM account_analytic_line \
|
||||
WHERE account_id IN (" +
|
||||
','.join(map(str, ids)) + ") AND date >= %s AND date <= %s \
|
||||
AND journal_id IN (" +
|
||||
','.join(map(str, journal_ids)) + ")",
|
||||
(date1, date2))
|
||||
WHERE account_id =ANY(%s) AND date >= %s AND date <= %s \
|
||||
AND journal_id =ANY(%s)",(ids,date1, date2,journal_ids))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
|
||||
report_sxw.report_sxw('report.account.analytic.account.quantity_cost_ledger',
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -57,10 +57,10 @@ class account_balance(report_sxw.rml_parse):
|
||||
def get_periods(self, form):
|
||||
result=''
|
||||
if form.has_key('periods') and form['periods'][0][2]:
|
||||
period_ids = ",".join([str(x) for x in form['periods'][0][2] if x])
|
||||
self.cr.execute("select name from account_period where id in (%s)" % (period_ids))
|
||||
period_ids = form['periods'][0][2]
|
||||
self.cr.execute("select name from account_period where id =ANY(%s)" ,(period_ids))
|
||||
res = self.cr.fetchall()
|
||||
len_res = len(res)
|
||||
len_res = len(res)
|
||||
for r in res:
|
||||
if (r == res[len_res-1]):
|
||||
result+=r[0]+". "
|
||||
@@ -75,10 +75,10 @@ class account_balance(report_sxw.rml_parse):
|
||||
result+=r.name+". "
|
||||
else:
|
||||
result+=r.name+", "
|
||||
|
||||
|
||||
return str(result and result[:-1]) or ''
|
||||
|
||||
|
||||
|
||||
def lines(self, form, ids={}, done=None, level=1):
|
||||
if not ids:
|
||||
ids = self.ids
|
||||
@@ -98,7 +98,7 @@ class account_balance(report_sxw.rml_parse):
|
||||
ctx['periods'] = form['periods'][0][2]
|
||||
elif form['state']== 'bydate':
|
||||
ctx['date_from'] = form['date_from']
|
||||
ctx['date_to'] = form['date_to']
|
||||
ctx['date_to'] = form['date_to']
|
||||
elif form['state'] == 'all' :
|
||||
ctx['periods'] = form['periods'][0][2]
|
||||
ctx['date_from'] = form['date_from']
|
||||
@@ -165,7 +165,7 @@ class account_balance(report_sxw.rml_parse):
|
||||
#
|
||||
# result_acc += self.lines(form, ids2, done, level+1)
|
||||
return result_acc
|
||||
|
||||
|
||||
def _sum_credit(self):
|
||||
return self.sum_credit
|
||||
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -47,26 +47,26 @@ class aged_trial_report(rml_parse.rml_parse):
|
||||
def _get_lines(self, form):
|
||||
|
||||
if (form['result_selection'] == 'customer' ):
|
||||
self.ACCOUNT_TYPE = "('receivable')"
|
||||
self.ACCOUNT_TYPE = ['receivable']
|
||||
elif (form['result_selection'] == 'supplier'):
|
||||
self.ACCOUNT_TYPE = "('payable')"
|
||||
self.ACCOUNT_TYPE = ['payable']
|
||||
else:
|
||||
self.ACCOUNT_TYPE = "('payable','receivable')"
|
||||
self.ACCOUNT_TYPE = ['payable','receivable']
|
||||
|
||||
|
||||
res = []
|
||||
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
|
||||
self.line_query = account_move_line_obj._query_get(self.cr, self.uid, obj='line',
|
||||
context={'fiscalyear': form['fiscalyear']})
|
||||
self.cr.execute("""SELECT DISTINCT res_partner.id AS id,
|
||||
res_partner.name AS name
|
||||
FROM res_partner,account_move_line AS line, account_account
|
||||
WHERE (line.account_id=account_account.id)
|
||||
AND ((reconcile_id IS NULL)
|
||||
OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > '%s' )))
|
||||
AND (line.partner_id=res_partner.id)
|
||||
AND (account_account.company_id = %s)
|
||||
ORDER BY res_partner.name""" % (form['date1'],form['company_id']))
|
||||
self.cr.execute("""SELECT DISTINCT res_partner.id AS id,
|
||||
res_partner.name AS name
|
||||
FROM res_partner,account_move_line AS line, account_account
|
||||
WHERE (line.account_id=account_account.id)
|
||||
AND ((reconcile_id IS NULL)
|
||||
OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))
|
||||
AND (line.partner_id=res_partner.id)
|
||||
AND (account_account.company_id = %s)
|
||||
ORDER BY res_partner.name""" , (form['date1'],form['company_id']))
|
||||
partners = self.cr.dictfetchall()
|
||||
## mise a 0 du total
|
||||
for i in range(7):
|
||||
@@ -74,20 +74,20 @@ class aged_trial_report(rml_parse.rml_parse):
|
||||
#
|
||||
|
||||
# Build a string like (1,2,3) for easy use in SQL query
|
||||
partner_ids = '(' + ','.join( [str(x['id']) for x in partners] ) + ')'
|
||||
partner_ids = [x['id'] for x in partners]
|
||||
|
||||
# This dictionary will store the debit-credit for all partners, using partner_id as key.
|
||||
totals = {}
|
||||
self.cr.execute("""SELECT partner_id, SUM(debit-credit)
|
||||
self.cr.execute("""SELECT partner_id, SUM(debit-credit)
|
||||
FROM account_move_line AS line, account_account
|
||||
WHERE (line.account_id = account_account.id)
|
||||
AND (account_account.type IN %s)
|
||||
AND (partner_id in %s)
|
||||
WHERE (line.account_id = account_account.id)
|
||||
AND (account_account.type =ANY(%s))
|
||||
AND (partner_id =ANY (%s))
|
||||
AND ((reconcile_id IS NULL)
|
||||
OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > '%s' )))
|
||||
AND (account_account.company_id = %s)
|
||||
AND account_account.active
|
||||
GROUP BY partner_id""" % (self.ACCOUNT_TYPE, partner_ids,form['date1'],form['company_id']))
|
||||
OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))
|
||||
AND (account_account.company_id = %s)
|
||||
AND account_account.active
|
||||
GROUP BY partner_id""" , (self.ACCOUNT_TYPE, partner_ids,form['date1'],form['company_id'],))
|
||||
t = self.cr.fetchall()
|
||||
for i in t:
|
||||
totals[i[0]] = i[1]
|
||||
@@ -95,17 +95,17 @@ class aged_trial_report(rml_parse.rml_parse):
|
||||
# This dictionary will store the future or past of all partners
|
||||
future_past = {}
|
||||
if form['direction_selection'] == 'future':
|
||||
self.cr.execute("""SELECT partner_id, SUM(debit-credit)
|
||||
FROM account_move_line AS line, account_account
|
||||
WHERE (line.account_id=account_account.id)
|
||||
AND (account_account.type IN %s)
|
||||
AND (COALESCE(date_maturity,date) < '%s')
|
||||
AND (partner_id in %s)
|
||||
self.cr.execute("""SELECT partner_id, SUM(debit-credit)
|
||||
FROM account_move_line AS line, account_account
|
||||
WHERE (line.account_id=account_account.id)
|
||||
AND (account_account.type =ANY (%s))
|
||||
AND (COALESCE(date_maturity,date) < %s)
|
||||
AND (partner_id =ANY (%s))
|
||||
AND ((reconcile_id IS NULL)
|
||||
OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > '%s' )))
|
||||
AND (account_account.company_id = %s)
|
||||
AND account_account.active
|
||||
GROUP BY partner_id"""% (self.ACCOUNT_TYPE, form['date1'], partner_ids,form['date1'], form['company_id']))
|
||||
OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))
|
||||
AND (account_account.company_id = %s)
|
||||
AND account_account.active
|
||||
GROUP BY partner_id""", (self.ACCOUNT_TYPE, form['date1'], partner_ids,form['date1'], form['company_id'],))
|
||||
t = self.cr.fetchall()
|
||||
for i in t:
|
||||
future_past[i[0]] = i[1]
|
||||
@@ -113,14 +113,14 @@ class aged_trial_report(rml_parse.rml_parse):
|
||||
self.cr.execute("""SELECT partner_id, SUM(debit-credit)
|
||||
FROM account_move_line AS line, account_account
|
||||
WHERE (line.account_id=account_account.id)
|
||||
AND (account_account.type IN %s)
|
||||
AND (COALESCE(date_maturity,date) > '%s')
|
||||
AND (partner_id in %s)
|
||||
AND (account_account.type =ANY (%s))
|
||||
AND (COALESCE(date_maturity,date) > %s)
|
||||
AND (partner_id =ANY (%s))
|
||||
AND ((reconcile_id IS NULL)
|
||||
OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > '%s' )))
|
||||
OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))
|
||||
AND (account_account.company_id = %s)
|
||||
AND account_account.active
|
||||
GROUP BY partner_id""" % (self.ACCOUNT_TYPE, form['date1'], partner_ids, form['date1'], form['company_id']))
|
||||
GROUP BY partner_id""" , (self.ACCOUNT_TYPE, form['date1'], partner_ids, form['date1'], form['company_id'],))
|
||||
t = self.cr.fetchall()
|
||||
for i in t:
|
||||
future_past[i[0]] = i[1]
|
||||
@@ -132,14 +132,14 @@ class aged_trial_report(rml_parse.rml_parse):
|
||||
self.cr.execute("""SELECT partner_id, SUM(debit-credit)
|
||||
FROM account_move_line AS line, account_account
|
||||
WHERE (line.account_id=account_account.id)
|
||||
AND (account_account.type IN %s)
|
||||
AND (COALESCE(date_maturity,date) BETWEEN '%s' AND '%s')
|
||||
AND (partner_id in %s )
|
||||
AND (account_account.type =ANY (%s))
|
||||
AND (COALESCE(date_maturity,date) BETWEEN %s AND %s)
|
||||
AND (partner_id =ANY (%s))
|
||||
AND ((reconcile_id IS NULL)
|
||||
OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > '%s' )))
|
||||
OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))
|
||||
AND (account_account.company_id = %s)
|
||||
AND account_account.active
|
||||
GROUP BY partner_id""" % (self.ACCOUNT_TYPE, form[str(i)]['start'], form[str(i)]['stop'],partner_ids ,form['date1'] ,form['company_id']))
|
||||
GROUP BY partner_id""" , (self.ACCOUNT_TYPE, form[str(i)]['start'], form[str(i)]['stop'],partner_ids ,form['date1'] ,form['company_id'],))
|
||||
|
||||
t = self.cr.fetchall()
|
||||
d = {}
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -41,10 +41,10 @@ class journal_print(report_sxw.rml_parse):
|
||||
|
||||
def set_context(self, objects, data, ids, report_type = None):
|
||||
super(journal_print, self).set_context(objects, data, ids, report_type)
|
||||
self.cr.execute('select period_id, journal_id from account_journal_period where id in (' + ','.join([str(id) for id in ids]) + ')')
|
||||
self.cr.execute('select period_id, journal_id from account_journal_period where id =ANY(%s)',(ids,))
|
||||
res = self.cr.fetchall()
|
||||
self.period_ids = ','.join([str(x[0]) for x in res])
|
||||
self.journal_ids = ','.join([str(x[1]) for x in res])
|
||||
self.period_ids = map(lambda x:x[0],res)
|
||||
self.journal_ids = map(lambda x:x[1],res)
|
||||
|
||||
# returns a list of period objs
|
||||
def periods(self, journal_period_objs):
|
||||
@@ -74,7 +74,7 @@ class journal_print(report_sxw.rml_parse):
|
||||
periods.append(data.period_id.id)
|
||||
for period in periods:
|
||||
period_data = self.pool.get('account.period').browse(self.cr, self.uid, period)
|
||||
self.cr.execute('select j.code, j.name, sum(l.debit) as debit, sum(l.credit) as credit from account_move_line l left join account_journal j on (l.journal_id=j.id) where period_id=%s and journal_id in (' + ','.join(map(str, journal_id)) + ') and l.state<>\'draft\' group by j.id, j.code, j.name', (period,))
|
||||
self.cr.execute('select j.code, j.name, sum(l.debit) as debit, sum(l.credit) as credit from account_move_line l left join account_journal j on (l.journal_id=j.id) where period_id=%s and journal_id =ANY(%s) and l.state<>\'draft\' group by j.id, j.code, j.name', (period,journal_id,))
|
||||
res = self.cr.dictfetchall()
|
||||
res[0].update({'period_name':period_data.name})
|
||||
res[0].update({'pid':period})
|
||||
@@ -82,45 +82,45 @@ class journal_print(report_sxw.rml_parse):
|
||||
return lines_data
|
||||
if not self.journal_ids:
|
||||
return []
|
||||
self.cr.execute('select j.code, j.name, sum(l.debit) as debit, sum(l.credit) as credit from account_move_line l left join account_journal j on (l.journal_id=j.id) where period_id=%s and journal_id in (' + self.journal_ids + ') and l.state<>\'draft\' group by j.id, j.code, j.name', (period_id,))
|
||||
self.cr.execute('select j.code, j.name, sum(l.debit) as debit, sum(l.credit) as credit from account_move_line l left join account_journal j on (l.journal_id=j.id) where period_id=%s and journal_id =ANY(%s) and l.state<>\'draft\' group by j.id, j.code, j.name', (period_id,self.journal_ids,))
|
||||
res = self.cr.dictfetchall()
|
||||
return res
|
||||
|
||||
def _sum_debit_period(self, period_id,journal_id=None):
|
||||
if type(journal_id)==type([]):
|
||||
self.cr.execute('select sum(debit) from account_move_line where period_id=%s and journal_id in (' + ','.join(map(str, journal_id)) + ') and state<>\'draft\'', (period_id,))
|
||||
self.cr.execute('select sum(debit) from account_move_line where period_id=%s and journal_id =ANY(%s) and state<>\'draft\'', (period_id,journal_id,))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
if not self.journal_ids:
|
||||
return 0.0
|
||||
self.cr.execute('select sum(debit) from account_move_line where period_id=%s and journal_id in (' + self.journal_ids + ') and state<>\'draft\'', (period_id,))
|
||||
self.cr.execute('select sum(debit) from account_move_line where period_id=%s and journal_id =ANY(%s) and state<>\'draft\'', (period_id,self.journal_ids,))
|
||||
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
|
||||
def _sum_credit_period(self, period_id,journal_id=None):
|
||||
if type(journal_id)==type([]):
|
||||
self.cr.execute('select sum(credit) from account_move_line where period_id=%s and journal_id in (' + ','.join(map(str, journal_id)) + ') and state<>\'draft\'', (period_id,))
|
||||
self.cr.execute('select sum(credit) from account_move_line where period_id=%s and journal_id =ANY(%s) and state<>\'draft\'', (period_id,journal_id,))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
if not self.journal_ids:
|
||||
return 0.0
|
||||
self.cr.execute('select sum(credit) from account_move_line where period_id=%s and journal_id in (' + self.journal_ids + ') and state<>\'draft\'', (period_id,))
|
||||
self.cr.execute('select sum(credit) from account_move_line where period_id=%s and journal_id =ANY(%s) and state<>\'draft\'', (period_id,self.journal_ids,))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
|
||||
def _sum_debit(self,period_id=None,journal_id=None):
|
||||
if type(period_id)==type([]):
|
||||
self.cr.execute('select sum(debit) from account_move_line where period_id in (' + ','.join(map(str, period_id)) + ') and journal_id in (' + ','.join(map(str, journal_id)) + ') and state<>\'draft\'')
|
||||
self.cr.execute('select sum(debit) from account_move_line where period_id =ANY(%s) and journal_id =ANY(%s) and state<>\'draft\'',(period_id,journal_id,))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
if not self.journal_ids or not self.period_ids:
|
||||
return 0.0
|
||||
self.cr.execute('select sum(debit) from account_move_line where period_id in (' + self.period_ids + ') and journal_id in (' + self.journal_ids + ') and state<>\'draft\'')
|
||||
self.cr.execute('select sum(debit) from account_move_line where period_id =ANY(%s) and journal_id =ANY(%s) and state<>\'draft\'',(self.period_ids,self.journal_ids,))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
|
||||
def _sum_credit(self,period_id=None,journal_id=None):
|
||||
if type(period_id)==type([]):
|
||||
self.cr.execute('select sum(credit) from account_move_line where period_id in (' + ','.join(map(str, period_id)) + ') and journal_id in (' + ','.join(map(str, journal_id)) + ') and state<>\'draft\'')
|
||||
self.cr.execute('select sum(credit) from account_move_line where period_id =ANY(%s) and journal_id =ANY(%s) and state<>\'draft\'',(period_id,journal_id,))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
if not self.journal_ids or not self.period_ids:
|
||||
return 0.0
|
||||
self.cr.execute('select sum(credit) from account_move_line where period_id in (' + self.period_ids + ') and journal_id in (' + self.journal_ids + ') and state<>\'draft\'')
|
||||
self.cr.execute('select sum(credit) from account_move_line where period_id =ANY(%s) and journal_id =ANY(%s) and state<>\'draft\'',(self.period_ids,self.journal_ids,))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
report_sxw.report_sxw('report.account.general.journal', 'account.journal.period', 'addons/account/report/general_journal.rml',parser=journal_print)
|
||||
report_sxw.report_sxw('report.account.general.journal.wiz', 'account.journal.period', 'addons/account/report/wizard_general_journal.rml',parser=journal_print, header=False)
|
||||
|
||||
@@ -89,7 +89,7 @@ class general_ledger(rml_parse.rml_parse):
|
||||
# We have the account ID we will search all account move line from now until this time
|
||||
# We are in the case of we are on the top of the account move Line
|
||||
cr.execute('SELECT distinct(ac.code) as code_rest,ac.name as name_rest from account_account AS ac, account_move_line mv\
|
||||
where ac.id = mv.account_id and mv.move_id = ' + num_id_move +' and mv.account_id <> ' + account_id )
|
||||
where ac.id = mv.account_id and mv.move_id = %s and mv.account_id <> %s' ,(num_id_move,account_id,))
|
||||
res_mv = cr.dictfetchall()
|
||||
# we need a result more than 2 line to make the test so we will made the the on 1 because we have exclude the current line
|
||||
if (len(res_mv) >=1):
|
||||
@@ -120,15 +120,11 @@ class general_ledger(rml_parse.rml_parse):
|
||||
## This function will return the most aged date
|
||||
periods = form['periods'][0][2]
|
||||
if not periods:
|
||||
sql = """
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
|
||||
"""
|
||||
self.cr.execute("""
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = %s""",(form['fiscalyear'],))
|
||||
else:
|
||||
periods_id = ','.join(map(str, periods))
|
||||
sql = """
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id in ( """ + periods_id + """)
|
||||
"""
|
||||
self.cr.execute(sql)
|
||||
self.cr.execute("""
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id =ANY(%s)""",(periods,))
|
||||
res = self.cr.dictfetchall()
|
||||
borne_min = res[0]['start_date']
|
||||
borne_max = res[0]['stop_date']
|
||||
@@ -138,15 +134,11 @@ class general_ledger(rml_parse.rml_parse):
|
||||
elif form['state'] == 'all':
|
||||
periods = form['periods'][0][2]
|
||||
if not periods:
|
||||
sql = """
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
|
||||
"""
|
||||
self.cr.execute("""
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = %s""",(form['fiscalyear'],))
|
||||
else:
|
||||
periods_id = ','.join(map(str, periods))
|
||||
sql = """
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id in ( """ + periods_id + """)
|
||||
"""
|
||||
self.cr.execute(sql)
|
||||
self.cr.execute("""
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id =ANY(%s)""",(periods,))
|
||||
res = self.cr.dictfetchall()
|
||||
period_min = res[0]['start_date']
|
||||
period_max = res[0]['stop_date']
|
||||
@@ -230,8 +222,8 @@ class general_ledger(rml_parse.rml_parse):
|
||||
else:
|
||||
## We will now compute solde initiaux
|
||||
for move in res:
|
||||
SOLDEINIT = "SELECT sum(l.debit) AS sum_debit, sum(l.credit) AS sum_credit FROM account_move_line l WHERE l.account_id = " + str(move.id) + " AND l.date < '" + self.borne_date['max_date'] + "'" + " AND l.date > '" + self.borne_date['min_date'] + "'"
|
||||
self.cr.execute(SOLDEINIT)
|
||||
self.cr.execute("""SELECT sum(l.debit) AS sum_debit, sum(l.credit) AS sum_credit FROM account_move_line l \
|
||||
WHERE l.account_id = %s AND l.date < %s AND l.date > %s""",(move.id,self.borne_date['max_date'],self.borne_date['min_date']))
|
||||
resultat = self.cr.dictfetchall()
|
||||
if resultat[0] :
|
||||
if resultat[0]['sum_debit'] == None:
|
||||
@@ -284,7 +276,7 @@ class general_ledger(rml_parse.rml_parse):
|
||||
for l in res:
|
||||
line = self.pool.get('account.move.line').browse(self.cr, self.uid, l['id'])
|
||||
l['move'] = line.move_id.name
|
||||
self.cr.execute('Select id from account_invoice where move_id =%s'%(line.move_id.id))
|
||||
self.cr.execute('Select id from account_invoice where move_id =%s',(line.move_id.id,))
|
||||
tmpres = self.cr.dictfetchall()
|
||||
if len(tmpres) > 0 :
|
||||
inv = self.pool.get('account.invoice').browse(self.cr, self.uid, tmpres[0]['id'])
|
||||
@@ -312,7 +304,7 @@ class general_ledger(rml_parse.rml_parse):
|
||||
|
||||
self.cr.execute("SELECT sum(debit) "\
|
||||
"FROM account_move_line l "\
|
||||
"WHERE l.account_id = %s AND %s "%(account.id, self.query))
|
||||
"WHERE l.account_id = %s AND "+self.query,(account.id,))
|
||||
## Add solde init to the result
|
||||
#
|
||||
sum_debit = self.cr.fetchone()[0] or 0.0
|
||||
@@ -326,7 +318,7 @@ class general_ledger(rml_parse.rml_parse):
|
||||
|
||||
self.cr.execute("SELECT sum(credit) "\
|
||||
"FROM account_move_line l "\
|
||||
"WHERE l.account_id = %s AND %s "%(account.id,self.query))
|
||||
"WHERE l.account_id = %s AND "+ self.query,(account.id,))
|
||||
## Add solde init to the result
|
||||
#
|
||||
sum_credit = self.cr.fetchone()[0] or 0.0
|
||||
@@ -340,7 +332,7 @@ class general_ledger(rml_parse.rml_parse):
|
||||
def _sum_solde_account(self, account, form):
|
||||
self.cr.execute("SELECT (sum(debit) - sum(credit)) as tot_solde "\
|
||||
"FROM account_move_line l "\
|
||||
"WHERE l.account_id = %s AND %s"%(account.id,self.query))
|
||||
"WHERE l.account_id = %s AND "+ self.query,(account.id,))
|
||||
sum_solde = self.cr.fetchone()[0] or 0.0
|
||||
if form.get('soldeinit', False):
|
||||
sum_solde += account.init_debit - account.init_credit
|
||||
@@ -352,7 +344,7 @@ class general_ledger(rml_parse.rml_parse):
|
||||
return 0.0
|
||||
self.cr.execute("SELECT sum(debit) "\
|
||||
"FROM account_move_line l "\
|
||||
"WHERE l.account_id in ("+','.join(map(str, self.child_ids))+") AND "+self.query)
|
||||
"WHERE l.account_id =ANY(%s) AND "+ self.query,(self.child_ids,))
|
||||
sum_debit = self.cr.fetchone()[0] or 0.0
|
||||
return sum_debit
|
||||
|
||||
@@ -361,7 +353,7 @@ class general_ledger(rml_parse.rml_parse):
|
||||
return 0.0
|
||||
self.cr.execute("SELECT sum(credit) "\
|
||||
"FROM account_move_line l "\
|
||||
"WHERE l.account_id in ("+','.join(map(str, self.child_ids))+") AND "+self.query)
|
||||
"WHERE l.account_id =ANY(%s) AND "+ self.query,(self.child_ids,))
|
||||
## Add solde init to the result
|
||||
#
|
||||
sum_credit = self.cr.fetchone()[0] or 0.0
|
||||
@@ -372,14 +364,14 @@ class general_ledger(rml_parse.rml_parse):
|
||||
return 0.0
|
||||
self.cr.execute("SELECT (sum(debit) - sum(credit)) as tot_solde "\
|
||||
"FROM account_move_line l "\
|
||||
"WHERE l.account_id in ("+','.join(map(str, self.child_ids))+") AND "+self.query)
|
||||
"WHERE l.account_id =ANY(%s) AND "+ self.query,(self.child_ids,))
|
||||
sum_solde = self.cr.fetchone()[0] or 0.0
|
||||
return sum_solde
|
||||
|
||||
def _set_get_account_currency_code(self, account_id):
|
||||
self.cr.execute("SELECT c.code as code "\
|
||||
"FROM res_currency c,account_account as ac "\
|
||||
"WHERE ac.id = %s AND ac.currency_id = c.id"%(account_id))
|
||||
"WHERE ac.id = %s AND ac.currency_id = c.id",(account_id,))
|
||||
result = self.cr.fetchone()
|
||||
if result:
|
||||
self.account_currency = result[0]
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -83,14 +83,14 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
#
|
||||
#
|
||||
result[account_line.id] = ' '
|
||||
num_id_move = str(account_line.move_id.id)
|
||||
num_id_line = str(account_line.id)
|
||||
account_id = str(account_line.account_id.id)
|
||||
num_id_move = account_line.move_id.id
|
||||
num_id_line = account_line.id
|
||||
account_id = account_line.account_id.id
|
||||
# search the basic account
|
||||
# We have the account ID we will search all account move line from now until this time
|
||||
# We are in the case of we are on the top of the account move Line
|
||||
cr.execute('SELECT distinct(ac.code) as code_rest,ac.name as name_rest from account_account AS ac, account_move_line mv\
|
||||
where ac.id = mv.account_id and mv.move_id = ' + num_id_move +' and mv.account_id <> ' + account_id )
|
||||
where ac.id = mv.account_id and mv.move_id = %s and mv.account_id <> %s' , (num_id_move,account_id,))
|
||||
res_mv = cr.dictfetchall()
|
||||
# we need a result more than 2 line to make the test so we will made the the on 1 because we have exclude the current line
|
||||
if (len(res_mv) >=1):
|
||||
@@ -121,15 +121,12 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
## This function will return the most aged date
|
||||
periods = form['periods'][0][2]
|
||||
if not periods:
|
||||
sql = """
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
|
||||
"""
|
||||
self.cr.execute("""
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = %s""" ,(form['fiscalyear'],))
|
||||
else:
|
||||
periods_id = ','.join(map(str, periods))
|
||||
sql = """
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id in ( """ + periods_id + """)
|
||||
"""
|
||||
self.cr.execute(sql)
|
||||
self.cr.execute("""
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id =ANY(%s)""",(periods,))
|
||||
|
||||
res = self.cr.dictfetchall()
|
||||
borne_min = res[0]['start_date']
|
||||
borne_max = res[0]['stop_date']
|
||||
@@ -139,15 +136,12 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
elif form['state'] == 'all':
|
||||
periods = form['periods'][0][2]
|
||||
if not periods:
|
||||
sql = """
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
|
||||
"""
|
||||
self.cr.execute("""
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = = %s""" ,(form['fiscalyear'],))
|
||||
|
||||
else:
|
||||
periods_id = ','.join(map(str, periods))
|
||||
sql = """
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id in ( """ + periods_id + """)
|
||||
"""
|
||||
self.cr.execute(sql)
|
||||
self.cr.execute("""
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id =ANY(%s)""",(periods,))
|
||||
res = self.cr.dictfetchall()
|
||||
period_min = res[0]['start_date']
|
||||
period_max = res[0]['stop_date']
|
||||
@@ -178,8 +172,6 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
|
||||
|
||||
def get_children_accounts(self, account, form):
|
||||
|
||||
print self.ids
|
||||
self.child_ids = self.pool.get('account.account').search(self.cr, self.uid,
|
||||
[('parent_id', 'child_of', self.ids)])
|
||||
#
|
||||
@@ -233,8 +225,8 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
else:
|
||||
## We will now compute solde initiaux
|
||||
for move in res:
|
||||
SOLDEINIT = "SELECT sum(l.debit) AS sum_debit, sum(l.credit) AS sum_credit FROM account_move_line l WHERE l.account_id = " + str(move.id) + " AND l.date < '" + self.borne_date['max_date'] + "'" + " AND l.date > '" + self.borne_date['min_date'] + "'"
|
||||
self.cr.execute(SOLDEINIT)
|
||||
self.cr.execute("""SELECT sum(l.debit) AS sum_debit, sum(l.credit) AS sum_credit FROM account_move_line l \
|
||||
WHERE l.account_id = %s AND l.date < %s AND l.date > %s""",(move.id,self.borne_date['max_date'],self.borne_date['min_date']))
|
||||
resultat = self.cr.dictfetchall()
|
||||
if resultat[0] :
|
||||
if resultat[0]['sum_debit'] == None:
|
||||
@@ -287,7 +279,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
for l in res:
|
||||
line = self.pool.get('account.move.line').browse(self.cr, self.uid, l['id'])
|
||||
l['move'] = line.move_id.name
|
||||
self.cr.execute('Select id from account_invoice where move_id =%s'%(line.move_id.id))
|
||||
self.cr.execute('Select id from account_invoice where move_id =%s',(line.move_id.id,))
|
||||
tmpres = self.cr.dictfetchall()
|
||||
if len(tmpres) > 0 :
|
||||
inv = self.pool.get('account.invoice').browse(self.cr, self.uid, tmpres[0]['id'])
|
||||
@@ -315,7 +307,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
|
||||
self.cr.execute("SELECT sum(debit) "\
|
||||
"FROM account_move_line l "\
|
||||
"WHERE l.account_id = %s AND %s "%(account.id, self.query))
|
||||
"WHERE l.account_id = %s AND "+self.query,(account.id,))
|
||||
## Add solde init to the result
|
||||
#
|
||||
sum_debit = self.cr.fetchone()[0] or 0.0
|
||||
@@ -329,7 +321,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
|
||||
self.cr.execute("SELECT sum(credit) "\
|
||||
"FROM account_move_line l "\
|
||||
"WHERE l.account_id = %s AND %s "%(account.id,self.query))
|
||||
"WHERE l.account_id = %s AND "+self.query,(account.id,))
|
||||
## Add solde init to the result
|
||||
#
|
||||
sum_credit = self.cr.fetchone()[0] or 0.0
|
||||
@@ -343,7 +335,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
def _sum_solde_account(self, account, form):
|
||||
self.cr.execute("SELECT (sum(debit) - sum(credit)) as tot_solde "\
|
||||
"FROM account_move_line l "\
|
||||
"WHERE l.account_id = %s AND %s"%(account.id,self.query))
|
||||
"WHERE l.account_id = %s AND "+self.query,(account.id,))
|
||||
sum_solde = self.cr.fetchone()[0] or 0.0
|
||||
if form.get('soldeinit',False):
|
||||
sum_solde += account.init_debit - account.init_credit
|
||||
@@ -355,7 +347,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
return 0.0
|
||||
self.cr.execute("SELECT sum(debit) "\
|
||||
"FROM account_move_line l "\
|
||||
"WHERE l.account_id in ("+','.join(map(str, self.child_ids))+") AND "+self.query)
|
||||
"WHERE l.account_id =ANY(%s) AND "+self.query,(self.child_ids,))
|
||||
sum_debit = self.cr.fetchone()[0] or 0.0
|
||||
return sum_debit
|
||||
|
||||
@@ -364,7 +356,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
return 0.0
|
||||
self.cr.execute("SELECT sum(credit) "\
|
||||
"FROM account_move_line l "\
|
||||
"WHERE l.account_id in ("+','.join(map(str, self.child_ids))+") AND "+self.query)
|
||||
"WHERE l.account_id =ANY(%s) AND "+self.query,(self.child_ids,))
|
||||
## Add solde init to the result
|
||||
#
|
||||
sum_credit = self.cr.fetchone()[0] or 0.0
|
||||
@@ -375,14 +367,14 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
return 0.0
|
||||
self.cr.execute("SELECT (sum(debit) - sum(credit)) as tot_solde "\
|
||||
"FROM account_move_line l "\
|
||||
"WHERE l.account_id in ("+','.join(map(str, self.child_ids))+") AND "+self.query)
|
||||
"WHERE l.account_id =ANY(%s) AND "+self.query,(self.child_ids,))
|
||||
sum_solde = self.cr.fetchone()[0] or 0.0
|
||||
return sum_solde
|
||||
|
||||
def _set_get_account_currency_code(self, account_id):
|
||||
self.cr.execute("SELECT c.code as code "\
|
||||
"FROM res_currency c,account_account as ac "\
|
||||
"WHERE ac.id = %s AND ac.currency_id = c.id"%(account_id))
|
||||
"WHERE ac.id = %s AND ac.currency_id = c.id",(account_id,))
|
||||
result = self.cr.fetchone()
|
||||
if result:
|
||||
self.account_currency = result[0]
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -166,27 +166,26 @@ class partner_balance(report_sxw.rml_parse):
|
||||
##
|
||||
self.date_lst_string =''
|
||||
if self.date_lst:
|
||||
self.date_lst_string = '\'' + '\',\''.join(map(str, self.date_lst)) + '\''
|
||||
|
||||
self.date_lst_string = '\'' + '\',\''.join(map(str, self.date_lst)) + '\''
|
||||
|
||||
## Compute Code
|
||||
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
|
||||
#
|
||||
if (data['form']['result_selection'] == 'customer' ):
|
||||
self.ACCOUNT_TYPE = "('receivable')"
|
||||
self.ACCOUNT_TYPE = ['receivable']
|
||||
elif (data['form']['result_selection'] == 'supplier'):
|
||||
self.ACCOUNT_TYPE = "('payable')"
|
||||
self.ACCOUNT_TYPE = ['payable']
|
||||
else:
|
||||
self.ACCOUNT_TYPE = "('payable','receivable')"
|
||||
self.ACCOUNT_TYPE = ['payable','receivable']
|
||||
#
|
||||
self.cr.execute("SELECT a.id " \
|
||||
"FROM account_account a " \
|
||||
"LEFT JOIN account_account_type t " \
|
||||
"ON (a.type = t.code) " \
|
||||
"WHERE a.company_id = %s " \
|
||||
"AND a.type IN " + self.ACCOUNT_TYPE + " " \
|
||||
"AND a.active", (data['form']['company_id'],))
|
||||
self.account_ids = ','.join([str(a) for (a,) in self.cr.fetchall()])
|
||||
"AND a.type =ANY(%s) "\
|
||||
"AND a.active", (data['form']['company_id'],self.ACCOUNT_TYPE,))
|
||||
self.account_ids = [a for (a,) in self.cr.fetchall()]
|
||||
|
||||
super(partner_balance, self).set_context(objects, data, ids, report_type)
|
||||
|
||||
@@ -214,11 +213,11 @@ class partner_balance(report_sxw.rml_parse):
|
||||
") AS enlitige " \
|
||||
"FROM account_move_line l LEFT JOIN res_partner p ON (l.partner_id=p.id) " \
|
||||
"JOIN account_account ac ON (l.account_id = ac.id)" \
|
||||
"WHERE ac.type IN " + self.ACCOUNT_TYPE + " " \
|
||||
"WHERE ac.type =ANY(%s) "
|
||||
"AND l.date IN (" + self.date_lst_string + ") " \
|
||||
"AND ac.company_id = "+ str(data['form']['company_id']) +" " \
|
||||
"AND ac.company_id = %s" \
|
||||
"GROUP BY p.id, p.ref, p.name,l.account_id,ac.name,ac.code " \
|
||||
"ORDER BY l.account_id,p.name")
|
||||
"ORDER BY l.account_id,p.name",(self.ACCOUNT_TYPE,data['form']['company_id'],))
|
||||
res = self.cr.dictfetchall()
|
||||
for r in res:
|
||||
full_account.append(r)
|
||||
@@ -355,8 +354,8 @@ class partner_balance(report_sxw.rml_parse):
|
||||
self.cr.execute(
|
||||
"SELECT sum(debit) " \
|
||||
"FROM account_move_line AS l " \
|
||||
"WHERE l.account_id IN (" + self.account_ids + ") " \
|
||||
"AND l.date IN (" + self.date_lst_string + ") " )
|
||||
"WHERE l.account_id =ANY(%s)" \
|
||||
"AND l.date IN (" + self.date_lst_string + ")" ,(self.account_ids,))
|
||||
temp_res = float(self.cr.fetchone()[0] or 0.0)
|
||||
result_tmp = result_tmp + temp_res
|
||||
|
||||
@@ -373,8 +372,8 @@ class partner_balance(report_sxw.rml_parse):
|
||||
self.cr.execute(
|
||||
"SELECT sum(credit) " \
|
||||
"FROM account_move_line AS l " \
|
||||
"WHERE l.account_id IN (" + self.account_ids + ") " \
|
||||
"AND l.date IN (" + self.date_lst_string + ") " )
|
||||
"WHERE l.account_id =ANY(%s)" \
|
||||
"AND l.date IN (" + self.date_lst_string + ")" ,(self.account_ids,))
|
||||
temp_res = float(self.cr.fetchone()[0] or 0.0)
|
||||
result_tmp = result_tmp + temp_res
|
||||
|
||||
@@ -390,9 +389,9 @@ class partner_balance(report_sxw.rml_parse):
|
||||
self.cr.execute(
|
||||
"SELECT sum(debit-credit) " \
|
||||
"FROM account_move_line AS l " \
|
||||
"WHERE l.account_id IN (" + self.account_ids + ") " \
|
||||
"AND l.date IN (" + self.date_lst_string + ") " \
|
||||
"AND l.blocked=TRUE " )
|
||||
"WHERE l.account_id =ANY(%s)" \
|
||||
"AND l.date IN (" + self.date_lst_string + ")"\
|
||||
"AND l.blocked=TRUE " ,(self.account_ids,))
|
||||
temp_res = float(self.cr.fetchone()[0] or 0.0)
|
||||
result_tmp = result_tmp + temp_res
|
||||
|
||||
@@ -411,9 +410,9 @@ class partner_balance(report_sxw.rml_parse):
|
||||
"ELSE 0 " \
|
||||
"END " \
|
||||
"FROM account_move_line AS l " \
|
||||
"WHERE l.account_id IN (" + self.account_ids + ") " \
|
||||
"AND l.date IN (" + self.date_lst_string + ") " \
|
||||
"GROUP BY l.partner_id")
|
||||
"WHERE l.account_id =ANY(%s)" \
|
||||
"AND l.date IN (" + self.date_lst_string + ")" \
|
||||
"GROUP BY l.partner_id",(self.account_ids,))
|
||||
a = self.cr.fetchone()[0]
|
||||
|
||||
if self.cr.fetchone() != None:
|
||||
@@ -438,9 +437,9 @@ class partner_balance(report_sxw.rml_parse):
|
||||
"ELSE 0 " \
|
||||
"END " \
|
||||
"FROM account_move_line AS l " \
|
||||
"WHERE l.account_id IN (" + self.account_ids + ") " \
|
||||
"AND l.date IN (" + self.date_lst_string + ") " \
|
||||
"GROUP BY l.partner_id")
|
||||
"WHERE l.account_id =ANY(%s)" \
|
||||
"AND l.date IN (" + self.date_lst_string + ")" \
|
||||
"GROUP BY l.partner_id",(self.account_ids,))
|
||||
a = self.cr.fetchone()[0] or 0.0
|
||||
|
||||
if self.cr.fetchone() != None:
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -41,25 +41,25 @@ class tax_report(rml_parse.rml_parse):
|
||||
'get_lines' : self._get_lines,
|
||||
})
|
||||
|
||||
|
||||
|
||||
def _get_lines(self, based_on,period_list,company_id=False, parent=False, level=0):
|
||||
res = self._get_codes(based_on,company_id,parent,level,period_list)
|
||||
|
||||
|
||||
if period_list[0][2] :
|
||||
res = self._add_codes(based_on,res,period_list)
|
||||
else :
|
||||
self.cr.execute ("select id from account_fiscalyear")
|
||||
fy = self.cr.fetchall()
|
||||
self.cr.execute ("select id from account_period where fiscalyear_id = %d"%(fy[0][0]))
|
||||
self.cr.execute ("select id from account_period where fiscalyear_id = %s",(fy[0][0],))
|
||||
periods = self.cr.fetchall()
|
||||
for p in periods :
|
||||
period_list[0][2].append(p[0])
|
||||
res = self._add_codes(based_on,res,period_list)
|
||||
|
||||
|
||||
i = 0
|
||||
top_result = []
|
||||
while i < len(res):
|
||||
|
||||
|
||||
res_dict = { 'code' : res[i][1].code,
|
||||
'name' : res[i][1].name,
|
||||
'debit' : 0,
|
||||
@@ -69,7 +69,7 @@ class tax_report(rml_parse.rml_parse):
|
||||
'level' : res[i][0],
|
||||
'pos' : 0
|
||||
}
|
||||
|
||||
|
||||
top_result.append(res_dict)
|
||||
res_general = self._get_general(res[i][1].id,period_list,company_id,based_on)
|
||||
ind_general = 0
|
||||
@@ -89,7 +89,6 @@ class tax_report(rml_parse.rml_parse):
|
||||
|
||||
def _get_general(self, tax_code_id,period_list ,company_id, based_on):
|
||||
res=[]
|
||||
period_sql_list = ','.join(map(str, period_list[0][2]))
|
||||
if based_on == 'payments':
|
||||
self.cr.execute('SELECT SUM(line.tax_amount) AS tax_amount, \
|
||||
SUM(line.debit) AS debit, \
|
||||
@@ -108,11 +107,11 @@ class tax_report(rml_parse.rml_parse):
|
||||
AND line.account_id = account.id \
|
||||
AND account.company_id = %s \
|
||||
AND move.id = line.move_id \
|
||||
AND line.period_id IN ('+ period_sql_list +') \
|
||||
AND line.period_id =ANY(%s) \
|
||||
AND ((invoice.state = %s) \
|
||||
OR (invoice.id IS NULL)) \
|
||||
GROUP BY account.id,account.name,account.code', ('draft',tax_code_id,
|
||||
company_id, 'paid'))
|
||||
company_id, period_list[0][2],'paid',))
|
||||
|
||||
else :
|
||||
self.cr.execute('SELECT SUM(line.tax_amount) AS tax_amount, \
|
||||
@@ -128,14 +127,14 @@ class tax_report(rml_parse.rml_parse):
|
||||
AND line.tax_code_id = %s \
|
||||
AND line.account_id = account.id \
|
||||
AND account.company_id = %s \
|
||||
AND line.period_id IN ('+ period_sql_list +') \
|
||||
AND line.period_id =ANY(%s)\
|
||||
AND account.active \
|
||||
GROUP BY account.id,account.name,account.code', ('draft',tax_code_id,
|
||||
company_id))
|
||||
company_id,period_list[0][2],))
|
||||
res = self.cr.dictfetchall()
|
||||
|
||||
|
||||
#AND line.period_id IN ('+ period_sql_list +') \
|
||||
|
||||
|
||||
i = 0
|
||||
while i<len(res):
|
||||
res[i]['account'] = self.pool.get('account.account').browse(self.cr, self.uid, res[i]['account_id'])
|
||||
@@ -145,14 +144,14 @@ class tax_report(rml_parse.rml_parse):
|
||||
def _get_codes(self,based_on, company_id, parent=False, level=0,period_list=[]):
|
||||
tc = self.pool.get('account.tax.code')
|
||||
ids = tc.search(self.cr, self.uid, [('parent_id','=',parent),('company_id','=',company_id)])
|
||||
|
||||
|
||||
res = []
|
||||
for code in tc.browse(self.cr, self.uid, ids, {'based_on': based_on}):
|
||||
res.append(('.'*2*level,code))
|
||||
|
||||
|
||||
res += self._get_codes(based_on, company_id, code.id, level+1)
|
||||
return res
|
||||
|
||||
|
||||
def _add_codes(self,based_on, account_list=[],period_list=[]):
|
||||
res = []
|
||||
for account in account_list:
|
||||
@@ -162,19 +161,19 @@ class tax_report(rml_parse.rml_parse):
|
||||
for period_ind in period_list[0][2]:
|
||||
for code in tc.browse(self.cr, self.uid, ids, {'period_id':period_ind,'based_on': based_on}):
|
||||
sum_tax_add = sum_tax_add + code.sum_period
|
||||
|
||||
|
||||
code.sum_period = sum_tax_add
|
||||
|
||||
|
||||
res.append((account[0],code))
|
||||
return res
|
||||
|
||||
|
||||
|
||||
def _get_company(self, form):
|
||||
return pooler.get_pool(self.cr.dbname).get('res.company').browse(self.cr, self.uid, form['company_id']).name
|
||||
|
||||
def _get_currency(self, form):
|
||||
return pooler.get_pool(self.cr.dbname).get('res.company').browse(self.cr, self.uid, form['company_id']).currency_id.name
|
||||
|
||||
|
||||
def sort_result(self,accounts):
|
||||
# On boucle sur notre rapport
|
||||
result_accounts = []
|
||||
@@ -184,13 +183,13 @@ class tax_report(rml_parse.rml_parse):
|
||||
#
|
||||
account_elem = accounts[ind]
|
||||
#
|
||||
|
||||
|
||||
#
|
||||
# we will now check if the level is lower than the previous level, in this case we will make a subtotal
|
||||
if (account_elem['level'] < old_level):
|
||||
bcl_current_level = old_level
|
||||
bcl_rup_ind = ind - 1
|
||||
|
||||
|
||||
while (bcl_current_level >= int(accounts[bcl_rup_ind]['level']) and bcl_rup_ind >= 0 ):
|
||||
tot_elem = copy.copy(accounts[bcl_rup_ind])
|
||||
res_tot = { 'code' : accounts[bcl_rup_ind]['code'],
|
||||
@@ -202,21 +201,21 @@ class tax_report(rml_parse.rml_parse):
|
||||
'level' : 0,
|
||||
'pos' : 0
|
||||
}
|
||||
|
||||
|
||||
if res_tot['type'] == 1:
|
||||
# on change le type pour afficher le total
|
||||
res_tot['type'] = 2
|
||||
result_accounts.append(res_tot)
|
||||
bcl_current_level = accounts[bcl_rup_ind]['level']
|
||||
bcl_rup_ind -= 1
|
||||
|
||||
|
||||
old_level = account_elem['level']
|
||||
result_accounts.append(account_elem)
|
||||
ind+=1
|
||||
|
||||
|
||||
|
||||
|
||||
return result_accounts
|
||||
|
||||
|
||||
|
||||
report_sxw.report_sxw('report.account.vat.declaration', 'account.tax.code',
|
||||
'addons/account/report/tax_report.rml', parser=tax_report, header=False)
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -142,7 +142,8 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
if (data['model'] == 'res.partner'):
|
||||
## Si on imprime depuis les partenaires
|
||||
if ids:
|
||||
PARTNER_REQUEST = "AND line.partner_id IN (" + ','.join(map(str, ids)) + ")"
|
||||
#PARTNER_REQUEST = "AND line.partner_id IN (" + ','.join(map(str, ids)) + ")"
|
||||
PARTNER_REQUEST = "AND line.partner_id =ANY(%s)" %ids
|
||||
# Transformation des date
|
||||
#
|
||||
#
|
||||
@@ -166,11 +167,11 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
#
|
||||
#new_ids = [id for (id,) in self.cr.fetchall()]
|
||||
if data['form']['result_selection'] == 'supplier':
|
||||
self.ACCOUNT_TYPE = "('receivable')"
|
||||
self.ACCOUNT_TYPE = ['receivable']
|
||||
elif data['form']['result_selection'] == 'customer':
|
||||
self.ACCOUNT_TYPE = "('payable')"
|
||||
self.ACCOUNT_TYPE = ['payable']
|
||||
elif data['form']['result_selection'] == 'all':
|
||||
self.ACCOUNT_TYPE = "('payable','receivable')"
|
||||
self.ACCOUNT_TYPE = ['payable','receivable']
|
||||
|
||||
self.cr.execute(
|
||||
"SELECT a.id " \
|
||||
@@ -178,9 +179,9 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
"LEFT JOIN account_account_type t " \
|
||||
"ON (a.type=t.code) " \
|
||||
"WHERE a.company_id = %s " \
|
||||
'AND a.type IN ' + self.ACCOUNT_TYPE + " " \
|
||||
"AND a.active", (data['form']['company_id'],))
|
||||
self.account_ids = ','.join([str(a) for (a,) in self.cr.fetchall()])
|
||||
'AND a.type =ANY(%s)' \
|
||||
"AND a.active", (data['form']['company_id'],self.ACCOUNT_TYPE,))
|
||||
self.account_ids = [a for (a,) in self.cr.fetchall()]
|
||||
|
||||
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
|
||||
partner_to_use = []
|
||||
@@ -195,11 +196,11 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
"AND line.date >= %s " \
|
||||
"AND line.date <= %s " \
|
||||
"AND line.reconcile_id IS NULL " \
|
||||
"AND line.account_id IN (" + self.account_ids + ") " \
|
||||
"AND line.account_id =ANY(%s)" \
|
||||
" " + PARTNER_REQUEST + " " \
|
||||
"AND account.company_id = %s " \
|
||||
"AND account.active " ,
|
||||
(self.date_lst[0],self.date_lst[len(self.date_lst)-1],data['form']['company_id']))
|
||||
(self.date_lst[0],self.date_lst[len(self.date_lst)-1],self.account_ids,data['form']['company_id'],))
|
||||
# else:
|
||||
#
|
||||
# self.cr.execute(
|
||||
@@ -220,7 +221,8 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
partner_to_use.append(res_line['partner_id'])
|
||||
new_ids = partner_to_use
|
||||
|
||||
self.partner_ids = ','.join(map(str, new_ids))
|
||||
#self.partner_ids = ','.join(map(str, new_ids))
|
||||
self.partner_ids = new_ids
|
||||
objects = self.pool.get('res.partner').browse(self.cr, self.uid, new_ids)
|
||||
super(third_party_ledger, self).set_context(objects, data, new_ids, report_type)
|
||||
|
||||
@@ -259,11 +261,11 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
"LEFT JOIN account_journal j " \
|
||||
"ON (l.journal_id = j.id) " \
|
||||
"WHERE l.partner_id = %s " \
|
||||
"AND l.account_id IN (" + self.account_ids + ") " \
|
||||
"AND l.date IN (" + self.date_lst_string + ") " \
|
||||
"AND l.account_id =ANY(%s)"\
|
||||
"AND l.date IN (" + self.date_lst_string + ")"
|
||||
" " + RECONCILE_TAG + " "\
|
||||
"ORDER BY l.id",
|
||||
(partner.id,))
|
||||
(partner.id,self.account_ids,))
|
||||
res = self.cr.dictfetchall()
|
||||
sum = 0.0
|
||||
for r in res:
|
||||
@@ -286,10 +288,10 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
"SELECT sum(debit) " \
|
||||
"FROM account_move_line " \
|
||||
"WHERE partner_id = %s " \
|
||||
"AND account_id IN (" + self.account_ids + ") " \
|
||||
"AND account_id =ANY(%s)" \
|
||||
"AND reconcile_id IS NULL " \
|
||||
"AND date < %s " ,
|
||||
(partner.id, self.date_lst[0],))
|
||||
(partner.id, self.account_ids,self.date_lst[0],))
|
||||
contemp = self.cr.fetchone()
|
||||
if contemp != None:
|
||||
result_tmp = contemp[0] or 0.0
|
||||
@@ -301,10 +303,10 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
"SELECT sum(debit) " \
|
||||
"FROM account_move_line " \
|
||||
"WHERE partner_id = %s " \
|
||||
"AND account_id IN (" + self.account_ids + ") " \
|
||||
"AND account_id =ANY(%s)" \
|
||||
" " + RECONCILE_TAG + " " \
|
||||
"AND date IN (" + self.date_lst_string + ") " ,
|
||||
(partner.id,))
|
||||
"AND date IN (" + self.date_lst_string + ")" ,
|
||||
(partner.id,self.account_ids,))
|
||||
|
||||
contemp = self.cr.fetchone()
|
||||
if contemp != None:
|
||||
@@ -325,10 +327,10 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
"SELECT sum(credit) " \
|
||||
"FROM account_move_line " \
|
||||
"WHERE partner_id=%s " \
|
||||
"AND account_id IN (" + self.account_ids + ") " \
|
||||
"AND account_id =ANY(%s)" \
|
||||
"AND reconcile_id IS NULL " \
|
||||
"AND date < %s " ,
|
||||
(partner.id,self.date_lst[0],))
|
||||
(partner.id,self.account_ids,self.date_lst[0],))
|
||||
contemp = self.cr.fetchone()
|
||||
if contemp != None:
|
||||
result_tmp = contemp[0] or 0.0
|
||||
@@ -340,10 +342,10 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
"SELECT sum(credit) " \
|
||||
"FROM account_move_line " \
|
||||
"WHERE partner_id=%s " \
|
||||
"AND account_id IN (" + self.account_ids + ") " \
|
||||
"AND account_id =ANY(%s)" \
|
||||
" " + RECONCILE_TAG + " " \
|
||||
"AND date IN (" + self.date_lst_string + ") " ,
|
||||
(partner.id,))
|
||||
"AND date IN (" + self.date_lst_string + ")",
|
||||
(partner.id,self.account_ids,))
|
||||
|
||||
contemp = self.cr.fetchone()
|
||||
if contemp != None:
|
||||
@@ -365,11 +367,11 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
self.cr.execute(
|
||||
"SELECT sum(debit) " \
|
||||
"FROM account_move_line " \
|
||||
"WHERE partner_id IN (" + self.partner_ids + ") " \
|
||||
"AND account_id IN (" + self.account_ids + ") " \
|
||||
"WHERE partner_id =ANY(%s)" \
|
||||
"AND account_id =ANY(%s)" \
|
||||
"AND reconcile_id IS NULL " \
|
||||
"AND date < %s " ,
|
||||
(self.date_lst[0],))
|
||||
(self.partner_ids,self.account_ids,self.date_lst[0],))
|
||||
contemp = self.cr.fetchone()
|
||||
if contemp != None:
|
||||
result_tmp = contemp[0] or 0.0
|
||||
@@ -380,12 +382,10 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
self.cr.execute(
|
||||
"SELECT sum(debit) " \
|
||||
"FROM account_move_line " \
|
||||
"WHERE partner_id IN (" + self.partner_ids + ") " \
|
||||
"AND account_id IN (" + self.account_ids + ") " \
|
||||
"WHERE partner_id =ANY(%s)" \
|
||||
"AND account_id =ANY(%s)" \
|
||||
" " + RECONCILE_TAG + " " \
|
||||
"AND date IN (" + self.date_lst_string + ") "
|
||||
)
|
||||
|
||||
"AND date IN (" + self.date_lst_string + ")",(self.partner_ids,self.account_ids,))
|
||||
contemp = self.cr.fetchone()
|
||||
if contemp != None:
|
||||
result_tmp = contemp[0] or 0.0
|
||||
@@ -408,11 +408,11 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
self.cr.execute(
|
||||
"SELECT sum(credit) " \
|
||||
"FROM account_move_line " \
|
||||
"WHERE partner_id IN (" + self.partner_ids + ") " \
|
||||
"AND account_id IN (" + self.account_ids + ") " \
|
||||
"WHERE partner_id =ANY(%s)" \
|
||||
"AND account_id =ANY(%s)" \
|
||||
"AND reconcile_id IS NULL " \
|
||||
"AND date < %s " ,
|
||||
(self.date_lst[0],))
|
||||
(self.partner_ids,self.account_ids,self.date_lst[0],))
|
||||
contemp = self.cr.fetchone()
|
||||
if contemp != None:
|
||||
result_tmp = contemp[0] or 0.0
|
||||
@@ -423,11 +423,10 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
self.cr.execute(
|
||||
"SELECT sum(credit) " \
|
||||
"FROM account_move_line " \
|
||||
"WHERE partner_id IN (" + self.partner_ids + ") " \
|
||||
"AND account_id IN (" + self.account_ids + ") " \
|
||||
"WHERE partner_id =ANY(%s)" \
|
||||
"AND account_id =ANY(%s)" \
|
||||
" " + RECONCILE_TAG + " " \
|
||||
"AND date IN (" + self.date_lst_string + ") "
|
||||
)
|
||||
"AND date IN (" + self.date_lst_string + ")",(self.partner_ids,self.account_ids,))
|
||||
contemp = self.cr.fetchone()
|
||||
if contemp != None:
|
||||
result_tmp = contemp[0] or 0.0
|
||||
|
||||
@@ -37,13 +37,13 @@ class ir_sequence(osv.osv):
|
||||
_columns = {
|
||||
'fiscal_ids' : fields.one2many('account.sequence.fiscalyear', 'sequence_main_id', 'Sequences')
|
||||
}
|
||||
def get_id(self, cr, uid, sequence_id, test='id=%s', context={}):
|
||||
cr.execute('select id from ir_sequence where '+test+' and active=%s', (sequence_id, True,))
|
||||
def get_id(self, cr, uid, sequence_id, test='id', context={}):
|
||||
cr.execute('select id from ir_sequence where '+test+'=%s and active=%s', (sequence_id, True,))
|
||||
res = cr.dictfetchone()
|
||||
if res:
|
||||
for line in self.browse(cr, uid, res['id'], context=context).fiscal_ids:
|
||||
if line.fiscalyear_id.id==context.get('fiscalyear_id', False):
|
||||
return super(ir_sequence, self).get_id(cr, uid, line.sequence_id.id, test="id=%s", context=context)
|
||||
return super(ir_sequence, self).get_id(cr, uid, line.sequence_id.id, test="id", context=context)
|
||||
return super(ir_sequence, self).get_id(cr, uid, sequence_id, test, context)
|
||||
ir_sequence()
|
||||
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -102,7 +102,7 @@ class wizard_report(wizard.interface):
|
||||
# else :
|
||||
# data['form']['fiscalyear'] = 1
|
||||
return data['form']
|
||||
|
||||
|
||||
def _check_path(self, cr, uid, data, context):
|
||||
if data['model'] == 'account.account':
|
||||
return 'checktype'
|
||||
@@ -111,8 +111,8 @@ class wizard_report(wizard.interface):
|
||||
|
||||
def _check_date(self, cr, uid, data, context):
|
||||
sql = """
|
||||
SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where '%s' between f.date_start and f.date_stop """%(data['form']['date_from'])
|
||||
cr.execute(sql)
|
||||
SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where %s between f.date_start and f.date_stop """
|
||||
cr.execute(sql,(data['form']['date_from'],))
|
||||
res = cr.dictfetchall()
|
||||
if res:
|
||||
if (data['form']['date_to'] > res[0]['date_stop'] or data['form']['date_to'] < res[0]['date_start']):
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -56,14 +56,12 @@ def _data_save(self, cr, uid, data, context):
|
||||
|
||||
fy_id = data['form']['fy_id']
|
||||
period_ids = pool.get('account.period').search(cr, uid, [('fiscalyear_id', '=', fy_id)])
|
||||
fy_period_set = ','.join(map(str, period_ids))
|
||||
periods_fy2 = pool.get('account.period').search(cr, uid, [('fiscalyear_id', '=', data['form']['fy2_id'])])
|
||||
fy2_period_set = ','.join(map(str, periods_fy2))
|
||||
|
||||
period = pool.get('account.period').browse(cr, uid, data['form']['period_id'], context=context)
|
||||
new_fyear = pool.get('account.fiscalyear').browse(cr, uid, data['form']['fy2_id'], context=context)
|
||||
old_fyear = pool.get('account.fiscalyear').browse(cr, uid, data['form']['fy_id'], context=context)
|
||||
|
||||
|
||||
new_journal = data['form']['journal_id']
|
||||
new_journal = pool.get('account.journal').browse(cr, uid, new_journal, context=context)
|
||||
|
||||
@@ -89,7 +87,7 @@ def _data_save(self, cr, uid, data, context):
|
||||
ids = map(lambda x: x[0], cr.fetchall())
|
||||
for account in pool.get('account.account').browse(cr, uid, ids,
|
||||
context={'fiscalyear': fy_id}):
|
||||
|
||||
|
||||
accnt_type_data = account.user_type
|
||||
if not accnt_type_data:
|
||||
continue
|
||||
@@ -135,7 +133,7 @@ def _data_save(self, cr, uid, data, context):
|
||||
})
|
||||
offset += limit
|
||||
|
||||
#We have also to consider all move_lines that were reconciled
|
||||
#We have also to consider all move_lines that were reconciled
|
||||
#on another fiscal year, and report them too
|
||||
offset = 0
|
||||
limit = 100
|
||||
@@ -149,10 +147,10 @@ def _data_save(self, cr, uid, data, context):
|
||||
'WHERE b.account_id = %s ' \
|
||||
'AND b.reconcile_id is NOT NULL ' \
|
||||
'AND a.reconcile_id = b.reconcile_id ' \
|
||||
'AND b.period_id IN ('+fy_period_set+') ' \
|
||||
'AND a.period_id IN ('+fy2_period_set+') ' \
|
||||
'AND b.period_id =ANY(%s)'\
|
||||
'AND a.period_id =ANY(%s)' \
|
||||
'ORDER BY id ' \
|
||||
'LIMIT %s OFFSET %s', (account.id, limit, offset))
|
||||
'LIMIT %s OFFSET %s', (account.id,period_ids,periods_fy2,limit, offset))
|
||||
result = cr.dictfetchall()
|
||||
if not result:
|
||||
break
|
||||
@@ -180,7 +178,7 @@ def _data_save(self, cr, uid, data, context):
|
||||
'AND ' + query_line + ' ' \
|
||||
'ORDER BY id ' \
|
||||
'LIMIT %s OFFSET %s', (account.id, limit, offset))
|
||||
|
||||
|
||||
result = cr.dictfetchall()
|
||||
if not result:
|
||||
break
|
||||
@@ -210,7 +208,6 @@ def _data_save(self, cr, uid, data, context):
|
||||
cr.execute('UPDATE account_fiscalyear ' \
|
||||
'SET end_journal_period_id = %s ' \
|
||||
'WHERE id = %s', (ids[0], old_fyear.id))
|
||||
|
||||
return {}
|
||||
|
||||
class wiz_journal_close(wizard.interface):
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -46,7 +46,7 @@ period_form = '''<?xml version="1.0"?>
|
||||
<field name="sortbydate" required="True"/>
|
||||
|
||||
<field name="soldeinit" invisible="1"/>
|
||||
|
||||
|
||||
<field name="landscape"/>
|
||||
<field name="amount_currency"/>
|
||||
<newline/>
|
||||
@@ -65,10 +65,10 @@ period_form = '''<?xml version="1.0"?>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</form>'''
|
||||
|
||||
period_fields = {
|
||||
@@ -103,10 +103,10 @@ def _check(self, cr, uid, data, context):
|
||||
return 'report'
|
||||
|
||||
def _check_date(self, cr, uid, data, context):
|
||||
|
||||
|
||||
sql = """
|
||||
SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where '%s' between f.date_start and f.date_stop """%(data['form']['date_from'])
|
||||
cr.execute(sql)
|
||||
SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where %s between f.date_start and f.date_stop """
|
||||
cr.execute(sql,(data['form']['date_from'],))
|
||||
res = cr.dictfetchall()
|
||||
if res:
|
||||
if (data['form']['date_to'] > res[0]['date_stop'] or data['form']['date_to'] < res[0]['date_start']):
|
||||
@@ -116,14 +116,14 @@ def _check_date(self, cr, uid, data, context):
|
||||
|
||||
else:
|
||||
raise wizard.except_wizard(_('UserError'),_('Date not in a defined fiscal year'))
|
||||
|
||||
|
||||
def _check_state(self, cr, uid, data, context):
|
||||
|
||||
if data['form']['state'] == 'bydate':
|
||||
_check_date(self, cr, uid, data, context)
|
||||
# data['form']['fiscalyear'] = 0
|
||||
# else :
|
||||
#
|
||||
#
|
||||
# data['form']['fiscalyear'] = 1
|
||||
return data['form']
|
||||
|
||||
@@ -137,7 +137,7 @@ class wizard_report(wizard.interface):
|
||||
company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
|
||||
data['form']['company_id'] = company_id
|
||||
fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
|
||||
|
||||
|
||||
data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
|
||||
#periods_obj=pooler.get_pool(cr.dbname).get('account.period')
|
||||
#data['form']['periods'] =periods_obj.search(cr, uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -43,7 +43,7 @@ def _remove_entries(self, cr, uid, data, context):
|
||||
period_journal = data_fyear.end_journal_period_id
|
||||
ids_move = pool.get('account.move').search(cr,uid,[('journal_id','=',period_journal.journal_id.id),('period_id','=',period_journal.period_id.id)])
|
||||
if ids_move:
|
||||
cr.execute('delete from account_move where id in ('+','.join(map(str, ids_move))+')')
|
||||
cr.execute('delete from account_move where id =ANY(%s)',(ids_move,))
|
||||
#cr.execute('UPDATE account_journal_period ' \
|
||||
# 'SET state = %s ' \
|
||||
# 'WHERE period_id IN (SELECT id FROM account_period WHERE fiscalyear_id = %s)',
|
||||
@@ -60,17 +60,17 @@ class open_closed_fiscal(wizard.interface):
|
||||
'init' : {
|
||||
'actions' : [],
|
||||
'result': {
|
||||
'type': 'form',
|
||||
'type': 'form',
|
||||
'arch': form,
|
||||
'fields': fields,
|
||||
'fields': fields,
|
||||
'state':[('end','Cancel'),('open','Open')]
|
||||
}
|
||||
},
|
||||
'open': {
|
||||
'actions': [],
|
||||
'result': {
|
||||
'type':'action',
|
||||
'action':_remove_entries,
|
||||
'type':'action',
|
||||
'action':_remove_entries,
|
||||
'state':'end'
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -74,14 +74,14 @@ period_fields = {
|
||||
}
|
||||
|
||||
class wizard_report(wizard.interface):
|
||||
|
||||
|
||||
def _get_defaults(self,cr,uid,data,context):
|
||||
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
|
||||
if user.company_id:
|
||||
company_id = user.company_id.id
|
||||
else:
|
||||
company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
|
||||
|
||||
|
||||
fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
|
||||
periods_obj=pooler.get_pool(cr.dbname).get('account.period')
|
||||
data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
|
||||
@@ -91,25 +91,24 @@ class wizard_report(wizard.interface):
|
||||
data['form']['fiscalyear'] = False
|
||||
data['form']['result_selection'] = 'all'
|
||||
return data['form']
|
||||
|
||||
|
||||
def _check_state(self, cr, uid, data, context):
|
||||
|
||||
|
||||
if data['form']['state'] == 'bydate' :
|
||||
self._check_date(cr, uid, data, context)
|
||||
return data['form']
|
||||
|
||||
|
||||
def _check_date(self, cr, uid, data, context):
|
||||
|
||||
sql = """
|
||||
SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where '%s' between f.date_start and f.date_stop """%(data['form']['date1'])
|
||||
cr.execute(sql)
|
||||
SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where %s between f.date_start and f.date_stop """
|
||||
cr.execute(sql,(data['form']['date1'],))
|
||||
res = cr.dictfetchall()
|
||||
if res:
|
||||
if (data['form']['date2'] > res[0]['date_stop'] or data['form']['date2'] < res[0]['date_start']):
|
||||
raise wizard.except_wizard(_('UserError'),_('Date to must be set between %s and %s') % (str(res[0]['date_start']), str(res[0]['date_stop'])))
|
||||
else:
|
||||
return 'report'
|
||||
|
||||
|
||||
else:
|
||||
raise wizard.except_wizard(_('UserError'),_('Date not in a defined fiscal year'))
|
||||
|
||||
@@ -118,7 +117,7 @@ class wizard_report(wizard.interface):
|
||||
'actions': [_get_defaults],
|
||||
'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel','gtk-cancel'),('report','Print','gtk-print')]}
|
||||
},
|
||||
|
||||
|
||||
'report': {
|
||||
'actions': [_check_state],
|
||||
'result': {'type':'print', 'report':'account.partner.balance', 'state':'end'}
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -80,17 +80,14 @@ class wiz_refund(wizard.interface):
|
||||
#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
|
||||
))
|
||||
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'],
|
||||
))
|
||||
between date_start AND date_stop limit 1 """,
|
||||
(form['date'],))
|
||||
res = cr.fetchone()
|
||||
if res:
|
||||
period = res[0]
|
||||
@@ -101,10 +98,10 @@ class wiz_refund(wizard.interface):
|
||||
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
|
||||
@@ -112,7 +109,7 @@ class wiz_refund(wizard.interface):
|
||||
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'):
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -113,8 +113,8 @@ class wizard_report(wizard.interface):
|
||||
def _check_date(self, cr, uid, data, context):
|
||||
|
||||
sql = """
|
||||
SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where '%s' between f.date_start and f.date_stop """%(data['form']['date1'])
|
||||
cr.execute(sql)
|
||||
SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where %s between f.date_start and f.date_stop """
|
||||
cr.execute(sql,(data['form']['date1']))
|
||||
res = cr.dictfetchall()
|
||||
if res:
|
||||
if (data['form']['date2'] > res[0]['date_stop'] or data['form']['date2'] < res[0]['date_start']):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
@@ -15,14 +15,14 @@
|
||||
# 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 operator
|
||||
from osv import osv, fields
|
||||
from osv.orm import intersect
|
||||
import tools.sql
|
||||
import tools.sql
|
||||
from tools.translate import _
|
||||
|
||||
|
||||
@@ -34,14 +34,13 @@ class account_analytic_account(osv.osv):
|
||||
res = {}
|
||||
ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)])
|
||||
if ids2:
|
||||
acc_set = ",".join(map(str, ids2))
|
||||
cr.execute("select account_analytic_line.account_id, COALESCE(sum(amount),0.0) \
|
||||
from account_analytic_line \
|
||||
join account_analytic_journal \
|
||||
on account_analytic_line.journal_id = account_analytic_journal.id \
|
||||
where account_analytic_line.account_id IN (%s) \
|
||||
where account_analytic_line.account_id =ANY(%s) \
|
||||
and account_analytic_journal.type = 'sale' \
|
||||
group by account_analytic_line.account_id" % acc_set)
|
||||
group by account_analytic_line.account_id" ,(ids2,))
|
||||
for account_id, sum in cr.fetchall():
|
||||
res[account_id] = round(sum,2)
|
||||
for obj_id in ids:
|
||||
@@ -60,7 +59,6 @@ class account_analytic_account(osv.osv):
|
||||
ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)])
|
||||
if ids2:
|
||||
# Amount uninvoiced hours to invoice at sale price
|
||||
acc_set = ",".join(map(str, ids2))
|
||||
cr.execute("""SELECT account_analytic_account.id, \
|
||||
COALESCE(sum (product_template.list_price * \
|
||||
account_analytic_line.unit_amount * \
|
||||
@@ -77,11 +75,11 @@ class account_analytic_account(osv.osv):
|
||||
on account_analytic_account.id = account_analytic_line.account_id \
|
||||
JOIN hr_timesheet_invoice_factor \
|
||||
on hr_timesheet_invoice_factor.id = account_analytic_account.to_invoice \
|
||||
WHERE account_analytic_account.id IN (%s) \
|
||||
WHERE account_analytic_account.id =ANY(%s) \
|
||||
AND account_analytic_line.invoice_id is null \
|
||||
AND account_analytic_line.to_invoice IS NOT NULL \
|
||||
and account_analytic_journal.type in ('purchase','general') \
|
||||
GROUP BY account_analytic_account.id;"""%acc_set)
|
||||
GROUP BY account_analytic_account.id;""",(ids2,))
|
||||
for account_id, sum in cr.fetchall():
|
||||
res[account_id] = round(sum,2)
|
||||
|
||||
@@ -113,16 +111,15 @@ class account_analytic_account(osv.osv):
|
||||
res = {}
|
||||
ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)])
|
||||
if ids2:
|
||||
acc_set = ",".join(map(str, ids2))
|
||||
cr.execute("select account_analytic_line.account_id, COALESCE(sum(unit_amount),0.0) \
|
||||
from account_analytic_line \
|
||||
join account_analytic_journal \
|
||||
on account_analytic_line.journal_id = account_analytic_journal.id \
|
||||
where account_analytic_line.account_id IN (%s) \
|
||||
where account_analytic_line.account_id =ANY(%s) \
|
||||
and account_analytic_journal.type='general' \
|
||||
and invoice_id is null \
|
||||
AND to_invoice IS NOT NULL \
|
||||
GROUP BY account_analytic_line.account_id;"%acc_set)
|
||||
GROUP BY account_analytic_line.account_id;",(ids2,))
|
||||
for account_id, sum in cr.fetchall():
|
||||
res[account_id] = round(sum,2)
|
||||
for obj_id in ids:
|
||||
@@ -139,14 +136,13 @@ class account_analytic_account(osv.osv):
|
||||
res = {}
|
||||
ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)])
|
||||
if ids2:
|
||||
acc_set = ",".join(map(str, ids2))
|
||||
cr.execute("select account_analytic_line.account_id,COALESCE(SUM(unit_amount),0.0) \
|
||||
from account_analytic_line \
|
||||
join account_analytic_journal \
|
||||
on account_analytic_line.journal_id = account_analytic_journal.id \
|
||||
where account_analytic_line.account_id IN (%s) \
|
||||
where account_analytic_line.account_id =ANY(%s) \
|
||||
and account_analytic_journal.type='general' \
|
||||
GROUP BY account_analytic_line.account_id"%acc_set)
|
||||
GROUP BY account_analytic_line.account_id",(ids2,))
|
||||
ff = cr.fetchall()
|
||||
for account_id, sum in ff:
|
||||
res[account_id] = round(sum,2)
|
||||
@@ -164,14 +160,13 @@ class account_analytic_account(osv.osv):
|
||||
res = {}
|
||||
ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)])
|
||||
if ids2:
|
||||
acc_set = ",".join(map(str, ids2))
|
||||
cr.execute("""select account_analytic_line.account_id,COALESCE(sum(amount),0.0) \
|
||||
from account_analytic_line \
|
||||
join account_analytic_journal \
|
||||
on account_analytic_line.journal_id = account_analytic_journal.id \
|
||||
where account_analytic_line.account_id IN (%s) \
|
||||
where account_analytic_line.account_id =ANY(%s) \
|
||||
and amount<0 \
|
||||
GROUP BY account_analytic_line.account_id"""%acc_set)
|
||||
GROUP BY account_analytic_line.account_id""",(ids2,))
|
||||
for account_id, sum in cr.fetchall():
|
||||
res[account_id] = round(sum,2)
|
||||
for obj_id in ids:
|
||||
@@ -189,7 +184,6 @@ class account_analytic_account(osv.osv):
|
||||
res2 = {}
|
||||
ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)])
|
||||
if ids2:
|
||||
acc_set = ",".join(map(str, ids2))
|
||||
cr.execute("""select account_analytic_line.account_id as account_id, \
|
||||
COALESCE(sum((account_analytic_line.unit_amount * pt.list_price) \
|
||||
- (account_analytic_line.unit_amount * pt.list_price \
|
||||
@@ -205,10 +199,10 @@ class account_analytic_account(osv.osv):
|
||||
on (a.id=account_analytic_line.account_id) \
|
||||
join hr_timesheet_invoice_factor hr \
|
||||
on (hr.id=a.to_invoice) \
|
||||
where account_analytic_line.account_id IN (%s) \
|
||||
where account_analytic_line.account_id =ANY(%s) \
|
||||
and a.to_invoice IS NOT NULL \
|
||||
and account_analytic_journal.type in ('purchase','general')
|
||||
GROUP BY account_analytic_line.account_id"""%acc_set)
|
||||
GROUP BY account_analytic_line.account_id""",(ids2,))
|
||||
for account_id, sum in cr.fetchall():
|
||||
res2[account_id] = round(sum,2)
|
||||
|
||||
@@ -230,12 +224,11 @@ class account_analytic_account(osv.osv):
|
||||
res = {}
|
||||
ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)])
|
||||
if ids2:
|
||||
acc_set = ",".join(map(str, ids2))
|
||||
cr.execute("select account_analytic_line.account_id, max(date) \
|
||||
from account_analytic_line \
|
||||
where account_id IN (%s) \
|
||||
where account_id =ANY(%s) \
|
||||
and invoice_id is null \
|
||||
GROUP BY account_analytic_line.account_id" % acc_set)
|
||||
GROUP BY account_analytic_line.account_id" ,(ids2,))
|
||||
for account_id, sum in cr.fetchall():
|
||||
res[account_id] = sum
|
||||
for obj_id in ids:
|
||||
@@ -252,15 +245,14 @@ class account_analytic_account(osv.osv):
|
||||
res = {}
|
||||
ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)])
|
||||
if ids2:
|
||||
acc_set = ",".join(map(str, ids2))
|
||||
cr.execute ("select account_analytic_line.account_id, \
|
||||
date(max(account_invoice.date_invoice)) \
|
||||
from account_analytic_line \
|
||||
join account_invoice \
|
||||
on account_analytic_line.invoice_id = account_invoice.id \
|
||||
where account_analytic_line.account_id IN (%s) \
|
||||
where account_analytic_line.account_id =ANY(%s) \
|
||||
and account_analytic_line.invoice_id is not null \
|
||||
GROUP BY account_analytic_line.account_id"%acc_set)
|
||||
GROUP BY account_analytic_line.account_id",(ids2,))
|
||||
for account_id, sum in cr.fetchall():
|
||||
res[account_id] = sum
|
||||
for obj_id in ids:
|
||||
@@ -277,12 +269,11 @@ class account_analytic_account(osv.osv):
|
||||
res = {}
|
||||
ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)])
|
||||
if ids2:
|
||||
acc_set = ",".join(map(str, ids2))
|
||||
cr.execute("select account_analytic_line.account_id, max(date) \
|
||||
from account_analytic_line \
|
||||
where account_id IN (%s) \
|
||||
where account_id =ANY(%s) \
|
||||
and invoice_id is not null \
|
||||
GROUP BY account_analytic_line.account_id;"%acc_set)
|
||||
GROUP BY account_analytic_line.account_id;",(ids2,))
|
||||
for account_id, sum in cr.fetchall():
|
||||
res[account_id] = sum
|
||||
for obj_id in ids:
|
||||
@@ -373,8 +364,7 @@ class account_analytic_account(osv.osv):
|
||||
ids2 = self.search(cr, uid, [('parent_id', 'child_of', [id])])
|
||||
if ids2:
|
||||
cr.execute('SELECT DISTINCT(month_id) FROM account_analytic_analysis_summary_month ' \
|
||||
'WHERE account_id in (' + ','.join([str(x) for x in ids2]) + ') ' \
|
||||
'AND unit_amount <> 0.0')
|
||||
'WHERE account_id =ANY(%s) AND unit_amount <> 0.0',(ids2,))
|
||||
res[id] = [int(id * 1000000 + int(x[0])) for x in cr.fetchall()]
|
||||
else:
|
||||
res[id] = []
|
||||
@@ -388,11 +378,10 @@ class account_analytic_account(osv.osv):
|
||||
ids2 = self.search(cr, uid, [('parent_id', 'child_of', [id])])
|
||||
if ids2:
|
||||
cr.execute('SELECT DISTINCT("user") FROM account_analytic_analysis_summary_user ' \
|
||||
'WHERE account_id in (' + ','.join([str(x) for x in ids2]) + ') ' \
|
||||
'AND unit_amount <> 0.0')
|
||||
'WHERE account_id =ANY(%s) AND unit_amount <> 0.0',(ids2,))
|
||||
res[id] = [int((id * max_user) + x[0]) for x in cr.fetchall()]
|
||||
else:
|
||||
res[id] = []
|
||||
res[id] = []
|
||||
return res
|
||||
|
||||
_columns ={
|
||||
@@ -432,13 +421,11 @@ class account_analytic_account_summary_user(osv.osv):
|
||||
account_ids = [int(str(x/max_user - (x%max_user == 0 and 1 or 0))) for x in ids]
|
||||
user_ids = [int(str(x-((x/max_user - (x%max_user == 0 and 1 or 0)) *max_user))) for x in ids]
|
||||
account_ids2 = account_obj.search(cr, uid, [('parent_id', 'child_of', account_ids)])
|
||||
user_set = ','.join([str(x) for x in user_ids])
|
||||
if account_ids2:
|
||||
acc_set = ','.join([str(x) for x in account_ids2])
|
||||
cr.execute('SELECT id, unit_amount ' \
|
||||
'FROM account_analytic_analysis_summary_user ' \
|
||||
'WHERE account_id in (%s) ' \
|
||||
'AND "user" in (%s) ' % (acc_set, user_set))
|
||||
'WHERE account_id =ANY(%s) ' \
|
||||
'AND "user" =ANY(%s)',(account_ids2, user_ids,))
|
||||
for sum_id, unit_amount in cr.fetchall():
|
||||
res[sum_id] = unit_amount
|
||||
for obj_id in ids:
|
||||
@@ -599,14 +586,11 @@ class account_analytic_account_summary_month(osv.osv):
|
||||
account_ids = [int(str(int(x))[:-6]) for x in ids]
|
||||
month_ids = [int(str(int(x))[-6:]) for x in ids]
|
||||
account_ids2 = account_obj.search(cr, uid, [('parent_id', 'child_of', account_ids)])
|
||||
month_set = ','.join([str(x) for x in month_ids])
|
||||
if account_ids2:
|
||||
acc_set = ','.join([str(x) for x in account_ids2])
|
||||
cr.execute('SELECT id, unit_amount ' \
|
||||
'FROM account_analytic_analysis_summary_month ' \
|
||||
'WHERE account_id in (%s) ' \
|
||||
'AND month_id in (%s) ' % \
|
||||
(acc_set, month_set))
|
||||
'WHERE account_id =ANY(%s) ' \
|
||||
'AND month_id =ANY(%s) ',(account_ids2, month_ids,))
|
||||
for sum_id, unit_amount in cr.fetchall():
|
||||
res[sum_id] = unit_amount
|
||||
for obj_id in ids:
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -51,7 +51,7 @@ class account_budget_post(osv.osv):
|
||||
'sequence': lambda *a: 1,
|
||||
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.budget.post', context=c)
|
||||
}
|
||||
_order = "sequence, name"
|
||||
_order = "sequence, name"
|
||||
|
||||
def spread(self, cr, uid, ids, fiscalyear_id=False, amount=0.0):
|
||||
dobj = self.pool.get('account.budget.post.dotation')
|
||||
@@ -76,8 +76,10 @@ class account_budget_post_dotation(osv.osv):
|
||||
|
||||
total_days=strToDate(obj_period.date_stop) - strToDate(obj_period.date_start)
|
||||
budget_id=line.post_id and line.post_id.id or False
|
||||
query="select id from crossovered_budget_lines where general_budget_id= '"+ str(budget_id) + "' AND (date_from >='" +obj_period.date_start +"' and date_from <= '"+obj_period.date_stop + "') OR (date_to >='" +obj_period.date_start +"' and date_to <= '"+obj_period.date_stop + "') OR (date_from <'" +obj_period.date_start +"' and date_to > '"+obj_period.date_stop + "')"
|
||||
cr.execute(query)
|
||||
query="select id from crossovered_budget_lines where \
|
||||
general_budget_id= %s AND (date_from >=%s and date_from <= %s ) \
|
||||
OR (date_to >=%s and date_to <= %s) OR (date_from < %s and date_to > %s)"
|
||||
cr.execute(query,(budget_id,obj_period.date_start,obj_period.date_stop,obj_period.date_start,obj_period.date_stop,obj_period.date_start,obj_period.date_stop,))
|
||||
res1=cr.fetchall()
|
||||
|
||||
tot_planned=0.00
|
||||
@@ -175,10 +177,9 @@ class crossovered_budget_lines(osv.osv):
|
||||
date_from = context['wizard_date_from']
|
||||
if context.has_key('wizard_date_to'):
|
||||
date_to = context['wizard_date_to']
|
||||
|
||||
cr.execute("select sum(amount) from account_analytic_line where account_id=%%s and (date "
|
||||
"between to_date(%%s,'yyyy-mm-dd') and to_date(%%s,'yyyy-mm-dd')) and "
|
||||
"general_account_id in (%s)" % ",".join(map(str,acc_ids)), (line.analytic_account_id.id, date_from, date_to ))
|
||||
cr.execute("select sum(amount) from account_analytic_line where account_id=%s and (date "
|
||||
"between to_date(%s,'yyyy-mm-dd') and to_date(%s,'yyyy-mm-dd')) and "
|
||||
"general_account_id=ANY(%s)", (line.analytic_account_id.id, date_from, date_to,acc_ids,))
|
||||
result = cr.fetchone()[0]
|
||||
if result is None:
|
||||
result = 0.00
|
||||
@@ -213,7 +214,7 @@ class crossovered_budget_lines(osv.osv):
|
||||
elapsed = min(strToDate(line.date_to),strToDate(date_to)) - max(strToDate(line.date_from),strToDate(date_from))
|
||||
if strToDate(date_to) < strToDate(line.date_from):
|
||||
elapsed = strToDate(date_to) - strToDate(date_to)
|
||||
|
||||
|
||||
if total.days:
|
||||
theo_amt = float(elapsed.days/float(total.days))*line.planned_amount
|
||||
else:
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -65,13 +65,11 @@ class analytic_account_budget_report(report_sxw.rml_parse):
|
||||
if not b_line_ids:
|
||||
return []
|
||||
|
||||
bd_lines_ids = ','.join([str(x) for x in b_line_ids])
|
||||
|
||||
d_from=form['date_from']
|
||||
d_to=form['date_to']
|
||||
|
||||
# bd_ids = ','.join([str(x) for x in budget_lines])
|
||||
self.cr.execute('select distinct(crossovered_budget_id) from crossovered_budget_lines where id in (%s)'%(bd_lines_ids))
|
||||
self.cr.execute('select distinct(crossovered_budget_id) from crossovered_budget_lines where id =ANY(%s)',(b_line_ids,))
|
||||
budget_ids=self.cr.fetchall()
|
||||
|
||||
context={'wizard_date_from':d_from,'wizard_date_to':d_to}
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -71,10 +71,8 @@ class budget_report(report_sxw.rml_parse):
|
||||
if not budget_ids:
|
||||
return []
|
||||
|
||||
b_line_ids=','.join([str(x) for x in budget_ids])
|
||||
|
||||
# bd_ids = ','.join([str(x) for x in budget_lines])
|
||||
self.cr.execute('select distinct(analytic_account_id) from crossovered_budget_lines where id in (%s)'%(b_line_ids))
|
||||
self.cr.execute('select distinct(analytic_account_id) from crossovered_budget_lines where id =ANY(%s)',(budget_ids,))
|
||||
an_ids=self.cr.fetchall()
|
||||
|
||||
context={'wizard_date_from':d_from,'wizard_date_to':d_to}
|
||||
|
||||
@@ -7,16 +7,16 @@ 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: 2009-09-08 13:46+0000\n"
|
||||
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
|
||||
"PO-Revision-Date: 2010-01-29 07:09+0000\n"
|
||||
"Last-Translator: Stefano Prenna <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: 2009-12-16 05:27+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-01-30 04:40+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: account_chart
|
||||
#: model:ir.module.module,description:account_chart.module_meta_information
|
||||
msgid "Remove minimal account chart"
|
||||
msgstr ""
|
||||
msgstr "Rimuovi il grafico del conto minimo"
|
||||
|
||||
@@ -42,7 +42,7 @@ class account_move_line(osv.osv):
|
||||
WHERE move_line_id = ml.id
|
||||
AND po.state != 'cancel') as amount
|
||||
FROM account_move_line ml
|
||||
WHERE id in (%s)""" % (",".join(map(str,map(int, ids)))))
|
||||
WHERE id =ANY(%s)""" ,(ids,))
|
||||
r=dict(cr.fetchall())
|
||||
return r
|
||||
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -100,7 +100,7 @@ class payment_order(osv.osv):
|
||||
('draft', 'Draft'),
|
||||
('open','Confirmed'),
|
||||
('cancel','Cancelled'),
|
||||
('done','Done')], 'State', select=True,
|
||||
('done','Done')], 'State', select=True,
|
||||
help='When an order is placed the state is \'Draft\'.\n Once the bank is confirmed the state is set to \'Confirmed\'.\n Then the order is paid the state is \'Done\'.'),
|
||||
'line_ids': fields.one2many('payment.line','order_id','Payment lines',states={'done':[('readonly',True)]}),
|
||||
'total': fields.function(_total, string="Total", method=True,
|
||||
@@ -225,8 +225,8 @@ class payment_line(osv.osv):
|
||||
from account_move_line ml
|
||||
inner join payment_line pl
|
||||
on (ml.id = pl.move_line_id)
|
||||
where pl.id in (%s)"""%
|
||||
(self.translate(name), ','.join(map(str, ids))))
|
||||
where pl.id =ANY(%s)""",
|
||||
(self.translate(name),ids,))
|
||||
res = dict(cr.fetchall())
|
||||
|
||||
if name == 'partner_id':
|
||||
|
||||
@@ -406,7 +406,7 @@ class account_voucher(osv.osv):
|
||||
def action_number(self, cr, uid, ids, *args):
|
||||
cr.execute('SELECT id, type, number, move_id, reference ' \
|
||||
'FROM account_voucher ' \
|
||||
'WHERE id IN ('+','.join(map(str, ids))+')')
|
||||
'WHERE id =ANY(%s)',(ids,))
|
||||
for (id, invtype, number, move_id, reference) in cr.fetchall():
|
||||
if not number:
|
||||
number = self.pool.get('ir.sequence').get(cr, uid, invtype)
|
||||
@@ -417,13 +417,13 @@ class account_voucher(osv.osv):
|
||||
ref = self._convert_ref(cr, uid, number)
|
||||
|
||||
cr.execute('UPDATE account_voucher SET number=%s ' \
|
||||
'WHERE id=%d', (number, id))
|
||||
'WHERE id=%s', (number, id))
|
||||
cr.execute('UPDATE account_move_line SET ref=%s ' \
|
||||
'WHERE move_id=%d AND (ref is null OR ref = \'\')',
|
||||
'WHERE move_id=%s AND (ref is null OR ref = \'\')',
|
||||
(ref, move_id))
|
||||
cr.execute('UPDATE account_analytic_line SET ref=%s ' \
|
||||
'FROM account_move_line ' \
|
||||
'WHERE account_move_line.move_id = %d ' \
|
||||
'WHERE account_move_line.move_id = %s ' \
|
||||
'AND account_analytic_line.move_id = account_move_line.id',
|
||||
(ref, move_id))
|
||||
return True
|
||||
|
||||
@@ -95,12 +95,12 @@ class auction_dates(osv.osv):
|
||||
RETURN: True
|
||||
"""
|
||||
# objects vendus mais non factures
|
||||
cr.execute('select count(*) as c from auction_lots where auction_id in ('+','.join(map(str, ids))+') and state=%s and obj_price>0', ('draft',))
|
||||
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 in ('+','.join(map(str, ids))+') and state=%s and obj_price>0', ('draft',))
|
||||
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)
|
||||
cr.execute('select id from auction_lots where auction_id in ('+','.join(map(str, ids))+') and obj_price>0')
|
||||
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,{})
|
||||
@@ -113,7 +113,7 @@ auction_dates()
|
||||
# Deposits
|
||||
#----------------------------------------------------------
|
||||
def _inv_uniq(cr, ids):
|
||||
cr.execute('select name from auction_deposit where id in ('+','.join(map(lambda x: str(x), ids))+')')
|
||||
cr.execute('select name from auction_deposit where id =ANY(%s)',(ids,))
|
||||
for datas in cr.fetchall():
|
||||
cr.execute('select count(*) from auction_deposit where name=%s', (datas[0],))
|
||||
if cr.fetchone()[0]>1:
|
||||
@@ -229,7 +229,7 @@ def _type_get(self, cr, uid,ids):
|
||||
# Lots
|
||||
#----------------------------------------------------------
|
||||
def _inv_constraint(cr, ids):
|
||||
cr.execute('select id, bord_vnd_id, lot_num from auction_lots where id in ('+','.join(map(lambda x: str(x), ids))+')')
|
||||
cr.execute('select id, bord_vnd_id, lot_num from auction_lots where id =ANY(%s)', (ids,))
|
||||
for datas in cr.fetchall():
|
||||
cr.execute('select count(*) from auction_lots where bord_vnd_id=%s and lot_num=%s', (datas[1],datas[2]))
|
||||
if cr.fetchone()[0]>1:
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -54,7 +54,7 @@ class auction_total_rml(report_sxw.rml_parse):
|
||||
for lot_id in objects:
|
||||
auc_lot_ids.append(lot_id.id)
|
||||
self.total_obj=auc_lot_ids
|
||||
self.cr.execute('select auction_id from auction_lots where id in ('+','.join(map(str,auc_lot_ids))+') group by auction_id')
|
||||
self.cr.execute('select auction_id from auction_lots where id =ANY(%s) group by auction_id',(auc_lot_ids,))
|
||||
auc_date_ids = self.cr.fetchall()
|
||||
auct_dat=[]
|
||||
for ad_id in auc_date_ids:
|
||||
@@ -64,52 +64,52 @@ class auction_total_rml(report_sxw.rml_parse):
|
||||
|
||||
|
||||
def sum_taxes(self,auction_id):
|
||||
self.cr.execute("select count(1) from auction_lots where id in ("+",".join(map(str,self.total_obj))+") and auction_id=%s group by auction_id ", (auction_id,))
|
||||
self.cr.execute("select count(1) from auction_lots where id =ANY(%s) and auction_id=%s group by auction_id ", (self.total_obj,auction_id,))
|
||||
res = self.cr.fetchone()
|
||||
return res[0]
|
||||
def sold_item(self, object_id):
|
||||
self.cr.execute("select count(1) from auction_lots where id in ("+",".join(map(str,self.total_obj))+") and auction_id=%s and state in ('unsold') ", (object_id,))
|
||||
self.cr.execute("select count(1) from auction_lots where id =ANY(%s) and auction_id=%s and state in ('unsold') ", (self.total_obj,object_id,))
|
||||
res = self.cr.fetchone()
|
||||
return str(res[0])
|
||||
|
||||
|
||||
def sum_buyer(self, auction_id):
|
||||
self.cr.execute("select count(*) from auction_lots where id in ("+",".join(map(str,self.total_obj))+") and auction_id=%s and (ach_uid is not null or ach_login is not null) ", (auction_id,))
|
||||
self.cr.execute("select count(*) from auction_lots where id =ANY(%s) and auction_id=%s and (ach_uid is not null or ach_login is not null) ", (self.total_obj,auction_id,))
|
||||
res = self.cr.fetchone()
|
||||
return str(res[0])
|
||||
|
||||
|
||||
def sum_seller(self, auction_id):
|
||||
self.cr.execute("select count(distinct bord_vnd_id) from auction_lots where id in ("+",".join(map(str,self.total_obj))+") and auction_id=%s AND bord_vnd_id is not null ", (auction_id,))
|
||||
self.cr.execute("select count(distinct bord_vnd_id) from auction_lots where id =ANY(%s) and auction_id=%s AND bord_vnd_id is not null ", (self.total_obj,auction_id,))
|
||||
res = self.cr.fetchone()
|
||||
return res[0]
|
||||
|
||||
def sum_adj(self, auction_id):
|
||||
self.cr.execute("select sum(obj_price) from auction_lots where id in ("+",".join(map(str,self.total_obj))+") and auction_id=%s ", (auction_id,))
|
||||
self.cr.execute("select sum(obj_price) from auction_lots where id =ANY(%s) and auction_id=%s ", (self.total_obj,auction_id,))
|
||||
res = self.cr.fetchone()
|
||||
return str(res[0])
|
||||
|
||||
def count_take(self, auction_id):
|
||||
self.cr.execute("select count(*) from auction_lots where id in ("+",".join(map(str,self.total_obj))+") and auction_id=%s and ach_emp='True' ", (auction_id,))
|
||||
self.cr.execute("select count(*) from auction_lots where id =ANY(%s) and auction_id=%s and ach_emp='True' ", (self.total_obj,auction_id,))
|
||||
res = self.cr.fetchone()
|
||||
return str(res[0])
|
||||
|
||||
def chek_paid(self, auction_id):
|
||||
self.cr.execute("select count(1) from auction_lots where id in ("+",".join(map(str,self.total_obj))+") and auction_id=%s and ((paid_ach='T') or (is_ok='T')) ", (auction_id,))
|
||||
self.cr.execute("select count(1) from auction_lots where id =ANY(%s) and auction_id=%s and ((paid_ach='T') or (is_ok='T')) ", (self.total_obj,auction_id,))
|
||||
res = self.cr.fetchone()
|
||||
return str(res[0])
|
||||
def check_paid_seller(self,auction_id):
|
||||
self.cr.execute("select sum(seller_price) from auction_lots where id in ("+",".join(map(str,self.total_obj))+") and auction_id=%s and paid_vnd != 'T' ", (auction_id,))
|
||||
self.cr.execute("select sum(seller_price) from auction_lots where id =ANY(%s) and auction_id=%s and paid_vnd != 'T' ", (self.total_obj,auction_id,))
|
||||
res = self.cr.fetchone()
|
||||
return str(res[0]) or 0.0
|
||||
|
||||
def sum_credit(self,auction_id):
|
||||
self.cr.execute("select sum(buyer_price) from auction_lots where id in ("+",".join(map(str,self.total_obj))+") and auction_id=%s", (auction_id,))
|
||||
self.cr.execute("select sum(buyer_price) from auction_lots where id =ANY(%s) and auction_id=%s", (self.total_obj,auction_id,))
|
||||
res = self.cr.fetchone()
|
||||
return str(res[0])
|
||||
|
||||
def sum_debit_buyer(self,auction_id):
|
||||
self.cr.execute("select sum(buyer_price) from auction_lots where id in ("+",".join(map(str,self.total_obj))+") and auction_id=%s", (auction_id,))
|
||||
self.cr.execute("select sum(buyer_price) from auction_lots where id =ANY(%s) and auction_id=%s", (self.total_obj,auction_id,))
|
||||
res = self.cr.fetchone()
|
||||
return str(res[0] or 0)
|
||||
|
||||
@@ -121,27 +121,27 @@ class auction_total_rml(report_sxw.rml_parse):
|
||||
def sum_credit_seller(self, object_id):
|
||||
|
||||
|
||||
self.cr.execute("select sum(seller_price) from auction_lots where id in ("+",".join(map(str,self.total_obj))+") and auction_id=%s", (object_id,))
|
||||
self.cr.execute("select sum(seller_price) from auction_lots where id =ANY(%s) and auction_id=%s", (self.total_obj,object_id,))
|
||||
res = self.cr.fetchone()
|
||||
return str(res[0] or 0)
|
||||
|
||||
def sum_minadj(self, auction_id):
|
||||
self.cr.execute('select sum(lot_est1) from auction_lots where id in ('+','.join(map(str,self.total_obj))+') and auction_id=%s', (auction_id,))
|
||||
self.cr.execute('select sum(lot_est1) from auction_lots where id =ANY(%s) and auction_id=%s', (self.total_obj,auction_id,))
|
||||
res = self.cr.fetchone()
|
||||
return str(res[0]) or 0
|
||||
|
||||
def sum_maxadj(self, auction_id):
|
||||
self.cr.execute('select sum(lot_est2) from auction_lots where id in ('+','.join(map(str,self.total_obj))+') and auction_id=%s', (auction_id,))
|
||||
self.cr.execute('select sum(lot_est2) from auction_lots where id =ANY(%s) and auction_id=%s', (self.total_obj,auction_id,))
|
||||
res = self.cr.fetchone()
|
||||
return str(res[0]) or 0
|
||||
|
||||
def sum_buyer_paid(self, auction_id):
|
||||
self.cr.execute("select count(*) from auction_lots where id in ("+",".join(map(str,self.total_obj))+") and auction_id=%s and state = 'paid' ", (auction_id,))
|
||||
self.cr.execute("select count(*) from auction_lots where id =ANY(%s) and auction_id=%s and state = 'paid' ", (self.total_obj,auction_id,))
|
||||
res = self.cr.fetchone()
|
||||
return str(res[0])
|
||||
|
||||
def count_comm(self, auction_id):
|
||||
self.cr.execute("select count(*) from auction_lots where id in ("+",".join(map(str,self.total_obj))+") and auction_id=%s and obj_comm is not null ", (auction_id,))
|
||||
self.cr.execute("select count(*) from auction_lots where id =ANY(%s) and auction_id=%s and obj_comm is not null ", (self.total_obj,auction_id,))
|
||||
res = self.cr.fetchone()
|
||||
return str(res[0])
|
||||
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -49,7 +49,7 @@ class buyer_list(report_sxw.rml_parse):
|
||||
for lot_id in objects:
|
||||
auc_lot_ids.append(lot_id.id)
|
||||
self.auc_lot_ids=auc_lot_ids
|
||||
self.cr.execute('select auction_id from auction_lots where id in ('+','.join(map(str,auc_lot_ids))+') group by auction_id')
|
||||
self.cr.execute('select auction_id from auction_lots where id =ANY(%s) group by auction_id',(auc_lot_ids,))
|
||||
auc_date_ids = self.cr.fetchall()
|
||||
auct_dat=[]
|
||||
for ad_id in auc_date_ids:
|
||||
@@ -70,7 +70,7 @@ class buyer_list(report_sxw.rml_parse):
|
||||
auc_date_ids = self.pool.get('auction.dates').search(self.cr,self.uid,([('name','like',obj['name'])]))
|
||||
|
||||
# self.cr.execute('select ach_uid,count(1) as no_lot, sum(obj_price) as adj_price, sum(buyer_price)-sum(obj_price) as buyer_cost ,sum(buyer_price) as to_pay from auction_lots where id in ('+','.join(map(str,self.auc_lot_ids))+') and auction_id=%s and ach_uid is not null group by ach_uid ', (auc_date_ids[0],))
|
||||
self.cr.execute('select ach_login as ach_uid,count(1) as no_lot, sum(obj_price) as adj_price, sum(buyer_price)-sum(obj_price) as buyer_cost ,sum(buyer_price) as to_pay from auction_lots where id in ('+','.join(map(str,self.auc_lot_ids))+') and auction_id=%s and ach_login is not null group by ach_login order by ach_login', (auc_date_ids[0],))
|
||||
self.cr.execute('select ach_login as ach_uid,count(1) as no_lot, sum(obj_price) as adj_price, sum(buyer_price)-sum(obj_price) as buyer_cost ,sum(buyer_price) as to_pay from auction_lots where id =ANY(%s) and auction_id=%s and ach_login is not null group by ach_login order by ach_login', (self.auc_lot_ids,auc_date_ids[0],))
|
||||
res = self.cr.dictfetchall()
|
||||
for r in res:
|
||||
# if r['ach_uid']:
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -125,8 +125,8 @@ class auction_catalog(report_rml):
|
||||
auction_ids = []
|
||||
for test in ab:
|
||||
if test.has_key('auction_id'):
|
||||
auction_ids.append(str(test['auction_id'][0]))
|
||||
cr.execute('select * from auction_lots where auction_id in ('+ ','.join(auction_ids)+')')
|
||||
auction_ids.append(test['auction_id'][0])
|
||||
cr.execute('select * from auction_lots where auction_id =ANY(%s)',(auction_ids,))
|
||||
res = cr.dictfetchall()
|
||||
for cat in res:
|
||||
product =doc.createElement('product')
|
||||
|
||||
@@ -27,6 +27,7 @@ from tools.translate import _
|
||||
import base64
|
||||
import pooler
|
||||
import re
|
||||
import tools
|
||||
import vobject
|
||||
|
||||
# O-1 Optional and can come only once
|
||||
@@ -84,7 +85,7 @@ def get_attribute_mapping(cr, uid, calname, context={}):
|
||||
if not res.get('uid', None):
|
||||
res['uid'] = {}
|
||||
res['uid']['field'] = 'id'
|
||||
res[attr]['type'] = "integer"
|
||||
res['uid']['type'] = "integer"
|
||||
return res
|
||||
|
||||
def map_data(cr, uid, obj):
|
||||
@@ -170,17 +171,23 @@ class CalDAV(object):
|
||||
self.__attribute__[name][type] = None
|
||||
return True
|
||||
|
||||
def parse_ics(self, cr, uid, child):
|
||||
def parse_ics(self, cr, uid, child, cal_children=None, context=None):
|
||||
att_data = []
|
||||
for cal_data in child.getChildren():
|
||||
if cal_data.name.lower() == 'attendee':
|
||||
ctx = context.copy()
|
||||
if cal_children:
|
||||
ctx.update({'model': cal_children[cal_data.name.lower()]})
|
||||
attendee = self.pool.get('basic.calendar.attendee')
|
||||
att_data.append(attendee.import_cal(cr, uid, cal_data))
|
||||
att_data.append(attendee.import_cal(cr, uid, cal_data, context=ctx))
|
||||
self.ical_set(cal_data.name.lower(), att_data, 'value')
|
||||
continue
|
||||
if cal_data.name.lower() == 'valarm':
|
||||
alarm = self.pool.get('basic.calendar.alarm')
|
||||
vals = alarm.import_cal(cr, uid, cal_data)
|
||||
ctx = context.copy()
|
||||
if cal_children:
|
||||
ctx.update({'model': cal_children[cal_data.name.lower()]})
|
||||
vals = alarm.import_cal(cr, uid, cal_data, context=ctx)
|
||||
self.ical_set(cal_data.name.lower(), vals, 'value')
|
||||
continue
|
||||
if cal_data.name.lower() in self.__attribute__:
|
||||
@@ -190,9 +197,7 @@ class CalDAV(object):
|
||||
|
||||
def create_ics(self, cr, uid, datas, name, ical, context=None):
|
||||
if not datas:
|
||||
model = context.get('model', None)
|
||||
war_str = "No data available" + (model and " for " + model) or ""
|
||||
raise osv.except_osv(_('Warning !'), _(war_str))
|
||||
return
|
||||
for data in datas:
|
||||
vevent = ical.add(name)
|
||||
for field in self.__attribute__.keys():
|
||||
@@ -212,7 +217,8 @@ class CalDAV(object):
|
||||
r_ids = map(lambda x: x[0], cr.fetchall())
|
||||
if r_ids:
|
||||
rdata = self.pool.get(model).read(cr, uid, r_ids)
|
||||
rcal = self.export_cal(cr, uid, rdata, context=context)
|
||||
event_obj = self.pool.get('basic.calendar.event')
|
||||
rcal = event_obj.export_cal(cr, uid, rdata, context=context)
|
||||
for revents in rcal.contents['vevent']:
|
||||
ical.contents['vevent'].append(revents)
|
||||
if data.get('recurrent_uid', None):
|
||||
@@ -225,12 +231,14 @@ class CalDAV(object):
|
||||
data[map_field], vevent, context=context)
|
||||
elif field == 'valarm' and data[map_field]:
|
||||
model = self.__attribute__[field].get('object', False)
|
||||
ctx = context.copy()
|
||||
ctx.update({'model': model})
|
||||
alarm_obj = self.pool.get('basic.calendar.alarm')
|
||||
vevent = alarm_obj.export_cal(cr, uid, model, \
|
||||
data[map_field][0], vevent, context=context)
|
||||
data[map_field][0], vevent, context=ctx)
|
||||
elif data[map_field]:
|
||||
if map_type in ("char", "text"):
|
||||
vevent.add(field).value = str(data[map_field])
|
||||
vevent.add(field).value = tools.ustr(data[map_field])
|
||||
elif map_type in ('datetime', 'date') and data[map_field]:
|
||||
if field in ('exdate'):
|
||||
vevent.add(field).value = [parser.parse(data[map_field])]
|
||||
@@ -239,12 +247,12 @@ class CalDAV(object):
|
||||
elif map_type == "timedelta":
|
||||
vevent.add(field).value = timedelta(hours=data[map_field])
|
||||
elif map_type == "many2one":
|
||||
vevent.add(field).value = data.get(map_field)[1]
|
||||
vevent.add(field).value = tools.ustr(data.get(map_field)[1])
|
||||
elif map_type in ("float", "integer"):
|
||||
vevent.add(field).value = str(data.get(map_field))
|
||||
elif map_type == "selection":
|
||||
if not self.ical_get(field, 'mapping'):
|
||||
vevent.add(field).value = (data[map_field]).upper()
|
||||
vevent.add(field).value = (tools.ustr(data[map_field])).upper()
|
||||
else:
|
||||
for key1, val1 in self.ical_get(field, 'mapping').items():
|
||||
if val1 == data[map_field]:
|
||||
@@ -291,7 +299,7 @@ class CalDAV(object):
|
||||
res = []
|
||||
for child in parsedCal.getChildren():
|
||||
if child.name.lower() in ('vevent', 'vtodo'):
|
||||
vals = self.parse_ics(cr, uid, child)
|
||||
vals = self.parse_ics(cr, uid, child, context=context)
|
||||
else:
|
||||
vals = {}
|
||||
continue
|
||||
@@ -329,21 +337,18 @@ class Calendar(CalDAV, osv.osv):
|
||||
}
|
||||
|
||||
def export_cal(self, cr, uid, datas, vobj='vevent', context={}):
|
||||
try:
|
||||
cal = self.browse(cr, uid, datas[0])
|
||||
ical = vobject.iCalendar()
|
||||
for line in cal.line_ids:
|
||||
if line.name in ('alarm', 'attendee'):
|
||||
continue
|
||||
mod_obj = self.pool.get(line.object_id.model)
|
||||
data_ids = mod_obj.search(cr, uid, eval(line.domain), context=context)
|
||||
datas = mod_obj.read(cr, uid, data_ids, context=context)
|
||||
context.update({'model': line.object_id.model})
|
||||
self.__attribute__ = get_attribute_mapping(cr, uid, line.name, context)
|
||||
self.create_ics(cr, uid, datas, line.name, ical, context=context)
|
||||
return ical.serialize()
|
||||
except Exception, e:
|
||||
raise osv.except_osv(('Error !'), (str(e)))
|
||||
cal = self.browse(cr, uid, datas[0])
|
||||
ical = vobject.iCalendar()
|
||||
for line in cal.line_ids:
|
||||
if line.name in ('valarm', 'attendee'):
|
||||
continue
|
||||
mod_obj = self.pool.get(line.object_id.model)
|
||||
data_ids = mod_obj.search(cr, uid, eval(line.domain), context=context)
|
||||
datas = mod_obj.read(cr, uid, data_ids, context=context)
|
||||
context.update({'model': line.object_id.model})
|
||||
self.__attribute__ = get_attribute_mapping(cr, uid, line.name, context)
|
||||
self.create_ics(cr, uid, datas, line.name, ical, context=context)
|
||||
return ical.serialize()
|
||||
|
||||
def import_cal(self, cr, uid, content, data_id=None, context=None):
|
||||
ical_data = base64.decodestring(content)
|
||||
@@ -359,7 +364,7 @@ class Calendar(CalDAV, osv.osv):
|
||||
if child.name.lower() in cal_children:
|
||||
context.update({'model': cal_children[child.name.lower()]})
|
||||
self.__attribute__ = get_attribute_mapping(cr, uid, child.name.lower(), context=context)
|
||||
val = self.parse_ics(cr, uid, child)
|
||||
val = self.parse_ics(cr, uid, child, cal_children=cal_children, context=context)
|
||||
obj = self.pool.get(cal_children[child.name.lower()])
|
||||
if hasattr(obj, 'check_import'):
|
||||
obj.check_import(cr, uid, [val], context=context)
|
||||
@@ -374,7 +379,7 @@ class basic_calendar_line(osv.osv):
|
||||
_description = 'Calendar Lines'
|
||||
_columns = {
|
||||
'name': fields.selection([('vevent', 'Event'), ('vtodo', 'TODO'), \
|
||||
('alarm', 'Alarm'), \
|
||||
('valarm', 'Alarm'), \
|
||||
('attendee', 'Attendee')], \
|
||||
string="Type", size=64),
|
||||
'object_id': fields.many2one('ir.model', 'Object'),
|
||||
@@ -423,6 +428,51 @@ class basic_calendar_fields(osv.osv):
|
||||
_defaults = {
|
||||
'fn': lambda *a: 'field',
|
||||
}
|
||||
|
||||
def check_line(self, cr, uid, vals, name, context=None):
|
||||
f_obj = self.pool.get('ir.model.fields')
|
||||
field = f_obj.browse(cr, uid, vals['field_id'], context=context)
|
||||
relation = field.relation
|
||||
line_obj = self.pool.get('basic.calendar.lines')
|
||||
l_id = line_obj.search(cr, uid, [('name', '=', name)])
|
||||
if l_id:
|
||||
line = line_obj.browse(cr, uid, l_id, context=context)[0]
|
||||
line_rel = line.object_id.model
|
||||
if (relation != 'NULL') and (not relation == line_rel):
|
||||
raise osv.except_osv(_('Warning !'), _('Please provide proper configuration of "%s" in Calendar Lines' % (name)))
|
||||
return True
|
||||
|
||||
def create(self, cr, uid, vals, context={}):
|
||||
cr.execute('select name from basic_calendar_attributes \
|
||||
where id=%s' % (vals.get('name')))
|
||||
name = cr.fetchone()
|
||||
name = name[0]
|
||||
if name in ('valarm', 'attendee'):
|
||||
self.check_line(cr, uid, vals, name, context=context)
|
||||
cr.execute("Select count(id) from basic_calendar_fields \
|
||||
where name=%s and type_id=%s" % (vals.get('name'), vals.get('type_id')))
|
||||
res = cr.fetchone()
|
||||
if res:
|
||||
if res[0] > 0:
|
||||
raise osv.except_osv(_('Warning !'), _('Can not map same field more than once'))
|
||||
return super(basic_calendar_fields, self).create(cr, uid, vals, context=context)
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
if not vals:
|
||||
return
|
||||
for id in ids:
|
||||
field = self.browse(cr, uid, id, context=context)
|
||||
name = field.name.name
|
||||
if name in ('valarm', 'attendee'):
|
||||
self.check_line(cr, uid, vals, name, context=context)
|
||||
qry = "Select count(id) from basic_calendar_fields \
|
||||
where name=%s and type_id=%s" % (field.name.id, field.type_id.id)
|
||||
cr.execute(qry)
|
||||
res = cr.fetchone()
|
||||
if res:
|
||||
if res[0] > 1:
|
||||
raise osv.except_osv(_('Warning !'), _('Can not map same field more than once'))
|
||||
return super(basic_calendar_fields, self).write(cr, uid, ids, vals, context)
|
||||
|
||||
basic_calendar_fields()
|
||||
|
||||
@@ -584,11 +634,14 @@ class Alarm(CalDAV, osv.osv_memory):
|
||||
trigger.value = delta
|
||||
|
||||
# Compute other details
|
||||
valarm.add('DESCRIPTION').value = alarm_data['name']
|
||||
valarm.add('DESCRIPTION').value = alarm_data['name'] or 'OpenERP'
|
||||
valarm.add('ACTION').value = alarm_data['action']
|
||||
return vevent
|
||||
|
||||
def import_cal(self, cr, uid, ical_data):
|
||||
def import_cal(self, cr, uid, ical_data, context=None):
|
||||
ctx = context.copy()
|
||||
ctx.update({'model': context.get('model', None)})
|
||||
self.__attribute__ = get_attribute_mapping(cr, uid, self._calname, ctx)
|
||||
for child in ical_data.getChildren():
|
||||
if child.name.lower() == 'trigger':
|
||||
seconds = child.value.seconds
|
||||
@@ -638,7 +691,10 @@ class Attendee(CalDAV, osv.osv_memory):
|
||||
'language': None, # Use: 0-1 Specify the language for text values in a property or property parameter.
|
||||
}
|
||||
|
||||
def import_cal(self, cr, uid, ical_data):
|
||||
def import_cal(self, cr, uid, ical_data, context=None):
|
||||
ctx = context.copy()
|
||||
ctx.update({'model': context.get('model', None)})
|
||||
self.__attribute__ = get_attribute_mapping(cr, uid, self._calname, ctx)
|
||||
for para in ical_data.params:
|
||||
if para.lower() == 'cn':
|
||||
self.ical_set(para.lower(), ical_data.params[para][0]+':'+ \
|
||||
@@ -652,7 +708,9 @@ class Attendee(CalDAV, osv.osv_memory):
|
||||
|
||||
def export_cal(self, cr, uid, model, attendee_ids, vevent, context={}):
|
||||
attendee_object = self.pool.get(model)
|
||||
self.__attribute__ = get_attribute_mapping(cr, uid, self._calname, context)
|
||||
ctx = context.copy()
|
||||
ctx.update({'model': model})
|
||||
self.__attribute__ = get_attribute_mapping(cr, uid, self._calname, ctx)
|
||||
for attendee in attendee_object.read(cr, uid, attendee_ids, []):
|
||||
attendee_add = vevent.add('attendee')
|
||||
cn_val = ''
|
||||
@@ -662,9 +720,10 @@ class Attendee(CalDAV, osv.osv_memory):
|
||||
attendee_add.params[a_key] = [str(attendee[a_val['field']])]
|
||||
elif a_val['type'] == 'boolean':
|
||||
attendee_add.params[a_key] = [str(attendee[a_val['field']])]
|
||||
if a_val['field'] == 'cn':
|
||||
if a_val['field'] == 'cn' and attendee[a_val['field']]:
|
||||
cn_val = [str(attendee[a_val['field']])]
|
||||
attendee_add.params['CN'] = cn_val
|
||||
if cn_val:
|
||||
attendee_add.params['CN'] = cn_val
|
||||
return vevent
|
||||
|
||||
Attendee()
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<tree string="Attributes Mapping" editable="bottom">
|
||||
<field name="name" required="1" domain="[('type', '=', parent.name)]"/>
|
||||
<field name="fn" select="1" />
|
||||
<field name="field_id" select="1" domain="[('model_id', '=', parent.object_id)]" />
|
||||
<field name="field_id" select="1" required="1" domain="[('model_id', '=', parent.object_id)]" />
|
||||
<field name="expr" />
|
||||
</tree>
|
||||
<form string="Attributes Mapping">
|
||||
|
||||
@@ -66,13 +66,14 @@ class cal_event_subscribe_wizard(wizard.interface):
|
||||
model_obj = pooler.get_pool(cr.dbname).get(model)
|
||||
context.update({'url': data['form']['url_path'],
|
||||
'model': data.get('model')})
|
||||
vals = model_obj.import_cal(cr, uid, base64.encodestring(caldata), context)
|
||||
vals = model_obj.import_cal(cr, uid, base64.encodestring(caldata), \
|
||||
data['id'], context)
|
||||
if vals:
|
||||
cnt = vals['count']
|
||||
return {}
|
||||
|
||||
def _result_set(self, cr, uid, data, context=None):
|
||||
return {'msg': 'Subscribed %s Event(s)' % cnt}
|
||||
return {'msg': 'Import Sucessful.'}
|
||||
|
||||
states = {
|
||||
'init': {
|
||||
|
||||
@@ -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-10-08 08:06+0000\n"
|
||||
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
|
||||
"PO-Revision-Date: 2010-01-31 20:05+0000\n"
|
||||
"Last-Translator: Rinalds <rranny@gmail.com>\n"
|
||||
"Language-Team: Latvian <lv@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: 2009-12-16 05:08+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-02-01 04:45+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: base_contact
|
||||
@@ -195,7 +195,7 @@ msgstr "Kategorijas"
|
||||
#. module: base_contact
|
||||
#: field:res.partner.contact,function_id:0
|
||||
msgid "Main Function"
|
||||
msgstr ""
|
||||
msgstr "Pamatfunkcija"
|
||||
|
||||
#. module: base_contact
|
||||
#: model:process.transition,note:base_contact.process_transition_partnertoaddress0
|
||||
|
||||
@@ -14,7 +14,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-01-27 04:45+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-01-29 04:53+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: base_module_merge
|
||||
|
||||
@@ -14,7 +14,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-01-27 04:45+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-01-29 04:53+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: base_module_merge
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -45,8 +45,9 @@ This test checks the speed of the module. Note that at least 5 demo data is need
|
||||
|
||||
# remove osv_memory class becaz it does not have demo data
|
||||
if obj_list:
|
||||
cr.execute("select w.res_model from ir_actions_todo as t left join ir_act_window as w on t.action_id=w.id where w.res_model in ('%s')"% ("','".join(obj_list)))
|
||||
cr.execute("select w.res_model from ir_actions_todo as t left join ir_act_window as w on t.action_id=w.id where w.res_model =ANY(%s)",(obj_list,))
|
||||
res = cr.fetchall()
|
||||
print res
|
||||
for remove_obj in res:
|
||||
if remove_obj and (remove_obj[0] in obj_list):
|
||||
obj_list.remove(remove_obj[0])
|
||||
|
||||
@@ -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: 2009-09-08 14:11+0000\n"
|
||||
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
|
||||
"PO-Revision-Date: 2010-01-29 14:07+0000\n"
|
||||
"Last-Translator: Carlo <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: 2009-12-16 05:10+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-01-30 04:39+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: base_setup
|
||||
@@ -165,6 +165,9 @@ msgid ""
|
||||
"We suggest you to put bank information here:\n"
|
||||
"IBAN: BE74 1262 0121 6907 - SWIFT: CPDF BE71 - VAT: BE0477.472.701"
|
||||
msgstr ""
|
||||
"Questa frase apparirà al fondo dei report.\n"
|
||||
"Si possono inserire le coordinate bancarie qui:\n"
|
||||
"IBAN: BE74 1262 0121 6907 - SWIFT: CPDF BE71 - VAT: BE0477.472.701"
|
||||
|
||||
#. module: base_setup
|
||||
#: wizard_field:base_setup.base_setup,company,country_id:0
|
||||
@@ -270,7 +273,7 @@ msgstr "Logo"
|
||||
#. module: base_setup
|
||||
#: model:ir.module.module,shortdesc:base_setup.module_meta_information
|
||||
msgid "Base Setup"
|
||||
msgstr ""
|
||||
msgstr "Configurazione di base"
|
||||
|
||||
#. module: base_setup
|
||||
#: wizard_button:base_setup.base_setup,company,init:0
|
||||
|
||||
+16
-17
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -24,9 +24,9 @@ from osv import fields,osv
|
||||
|
||||
class board_board(osv.osv):
|
||||
_name = 'board.board'
|
||||
|
||||
|
||||
def create_view(self, cr, uid, ids, context):
|
||||
|
||||
|
||||
board = self.pool.get('board.board').browse(cr, uid, ids, context)
|
||||
left = []
|
||||
right = []
|
||||
@@ -52,23 +52,22 @@ class board_board(osv.osv):
|
||||
</child2>
|
||||
</hpaned>
|
||||
</form>""" % ('\n'.join(left), '\n'.join(right))
|
||||
|
||||
|
||||
return arch
|
||||
|
||||
def write(self, cr, uid, ids, vals, context={}):
|
||||
result = super(board_board, self).write(cr, uid, ids, vals, context)
|
||||
cr.commit()
|
||||
|
||||
|
||||
board = self.pool.get('board.board').browse(cr, uid, ids[0])
|
||||
|
||||
|
||||
view = self.create_view(cr, uid, ids[0], context)
|
||||
id = board.view_id.id
|
||||
|
||||
cr.execute("update ir_ui_view set arch='%s' where id=%s" % (view, id))
|
||||
cr.execute("update ir_ui_view set arch=%s where id=%s" , (view, id))
|
||||
cr.commit()
|
||||
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def create(self, cr, user, vals, context=None):
|
||||
if not 'name' in vals:
|
||||
return False
|
||||
@@ -84,31 +83,31 @@ class board_board(osv.osv):
|
||||
super(board_board, self).write(cr, user, [id], {'view_id': view_id}, context)
|
||||
|
||||
return id
|
||||
|
||||
|
||||
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
|
||||
res = {}
|
||||
res = super(board_board, self).fields_view_get(cr, user, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
|
||||
|
||||
|
||||
vids = self.pool.get('ir.ui.view.custom').search(cr, user, [('user_id','=',user), ('ref_id','=',view_id)])
|
||||
if vids:
|
||||
view_id = vids[0]
|
||||
arch = self.pool.get('ir.ui.view.custom').browse(cr, user, view_id)
|
||||
res['arch'] = arch.arch
|
||||
|
||||
|
||||
res['toolbar'] = {'print':[],'action':[],'relate':[]}
|
||||
return res
|
||||
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Dashboard', size=64, required=True),
|
||||
'view_id': fields.many2one('ir.ui.view', 'Board View'),
|
||||
'line_ids': fields.one2many('board.board.line', 'board_id', 'Action Views')
|
||||
}
|
||||
|
||||
|
||||
# the following lines added to let the button on dashboard work.
|
||||
_defaults = {
|
||||
'name': lambda *args: 'Dashboard'
|
||||
}
|
||||
|
||||
|
||||
board_board()
|
||||
|
||||
class board_line(osv.osv):
|
||||
|
||||
@@ -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: 2009-09-08 12:29+0000\n"
|
||||
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
|
||||
"PO-Revision-Date: 2010-01-29 14:08+0000\n"
|
||||
"Last-Translator: Carlo <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: 2009-12-16 05:20+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-01-30 04:40+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: board
|
||||
@@ -37,7 +37,7 @@ msgstr "Autore"
|
||||
#. module: board
|
||||
#: model:ir.module.module,shortdesc:board.module_meta_information
|
||||
msgid "Dashboard main module"
|
||||
msgstr ""
|
||||
msgstr "Modulo principale cruscotti"
|
||||
|
||||
#. module: board
|
||||
#: view:board.note:0
|
||||
@@ -53,7 +53,7 @@ msgstr "Larghezza"
|
||||
#. module: board
|
||||
#: constraint:ir.actions.act_window:0
|
||||
msgid "Invalid model name in the action definition."
|
||||
msgstr ""
|
||||
msgstr "Nome del modulo non valido nella definizione dell'azione."
|
||||
|
||||
#. module: board
|
||||
#: field:board.board.line,name:0
|
||||
@@ -137,7 +137,7 @@ msgstr "Dashboard"
|
||||
#. module: board
|
||||
#: model:ir.module.module,description:board.module_meta_information
|
||||
msgid "Base module for all dashboards."
|
||||
msgstr ""
|
||||
msgstr "Modulo base per tutti i cruscotti."
|
||||
|
||||
#. module: board
|
||||
#: field:board.board.line,position:0
|
||||
|
||||
+19
-5
@@ -215,6 +215,15 @@ request was delegated to"),
|
||||
def do_decline(self, cr, uid, ids, context=None, *args):
|
||||
self.write(cr, uid, ids, {'state': 'declined'}, context)
|
||||
|
||||
def create(self, cr, uid, vals, context={}):
|
||||
if not vals.get("email") and vals.get("cn"):
|
||||
cnval = vals.get("cn").split(':')
|
||||
email = filter(lambda x:x.__contains__('@'), cnval)
|
||||
vals['email'] = email[0]
|
||||
vals['cn'] = vals.get("cn")
|
||||
res = super(calendar_attendee, self).create(cr, uid, vals, context)
|
||||
return res
|
||||
|
||||
calendar_attendee()
|
||||
|
||||
class res_alarm(osv.osv):
|
||||
@@ -252,6 +261,9 @@ are both optional, but if one occurs, so MUST the other"""),
|
||||
model_obj = self.pool.get(model)
|
||||
for data in model_obj.browse(cr, uid, ids):
|
||||
basic_alarm = data.alarm_id
|
||||
if not context.get('alarm_id'):
|
||||
self.do_alarm_unlink(cr, uid, [data.id], model)
|
||||
return True
|
||||
self.do_alarm_unlink(cr, uid, [data.id], model)
|
||||
if basic_alarm:
|
||||
vals = {
|
||||
@@ -297,7 +309,7 @@ res_alarm()
|
||||
class calendar_alarm(osv.osv):
|
||||
_name = 'calendar.alarm'
|
||||
_description = 'Event alarm information'
|
||||
_inherits = {'res.alarm': "alarm_id"}
|
||||
_inherit = 'res.alarm'
|
||||
__attribute__ = {}
|
||||
|
||||
_columns = {
|
||||
@@ -616,6 +628,8 @@ rule or repeating pattern for anexception to a recurrence set"),
|
||||
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True):
|
||||
if not context:
|
||||
context = {}
|
||||
if isinstance(ids, (str, int, long)):
|
||||
select = [ids]
|
||||
else:
|
||||
@@ -626,9 +640,10 @@ rule or repeating pattern for anexception to a recurrence set"),
|
||||
if not id in new_ids:
|
||||
new_ids.append(id)
|
||||
res = super(calendar_event, self).write(cr, uid, new_ids, vals, context=context)
|
||||
if vals.has_key('alarm_id'):
|
||||
if vals.has_key('alarm_id') or vals.has_key('caldav_alarm_id'):
|
||||
alarm_obj = self.pool.get('res.alarm')
|
||||
alarm_obj.do_alarm_create(cr, uid, new_ids, self._name, 'date')
|
||||
context.update({'alarm_id': vals.get('alarm_id')})
|
||||
alarm_obj.do_alarm_create(cr, uid, new_ids, self._name, 'date', context=context)
|
||||
return res
|
||||
|
||||
def browse(self, cr, uid, ids, context=None, list_class=None, fields_process={}):
|
||||
@@ -849,8 +864,7 @@ class virtual_report_spool(web_services.report_spool):
|
||||
new_ids = []
|
||||
for id in ids:
|
||||
new_ids.append(caldav_id2real_id(id))
|
||||
datas['id'] = caldav_id2real_id(datas['id'])
|
||||
super(virtual_report_spool, self).exp_report(db, uid, object, new_ids, datas, context)
|
||||
datas['id'] = caldav_id2real_id(datas['id'])
|
||||
return super(virtual_report_spool, self).exp_report(db, uid, object, new_ids, datas, context)
|
||||
|
||||
virtual_report_spool()
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
</record>
|
||||
|
||||
<record model="basic.calendar.lines" id="calendar_lines_alarm">
|
||||
<field name="name">alarm</field>
|
||||
<field name="name">valarm</field>
|
||||
<field name="calendar_id" ref="base_calendar.basic_calendar1" />
|
||||
<field name="object_id" search="[('model','=','calendar.alarm')]" />
|
||||
</record>
|
||||
@@ -170,13 +170,6 @@
|
||||
<field name="fn">field</field>
|
||||
</record>
|
||||
|
||||
<record model="basic.calendar.fields" id="map_event_4">
|
||||
<field name="name" ref="base_calendar.field_event_attendee"/>
|
||||
<field name="type_id" ref="caldav.calendar_lines_event" />
|
||||
<field name="field_id" search="[('name','=','attendee_ids'),('model_id.model','=','calendar.event')]" />
|
||||
<field name="fn">field</field>
|
||||
</record>
|
||||
|
||||
<record model="basic.calendar.fields" id="map_event_5">
|
||||
<field name="name" ref="base_calendar.field_event_rrule"/>
|
||||
<field name="type_id" ref="caldav.calendar_lines_event" />
|
||||
@@ -198,13 +191,6 @@
|
||||
<field name="fn">field</field>
|
||||
</record>
|
||||
|
||||
<record model="basic.calendar.fields" id="map_event_8">
|
||||
<field name="name" ref="base_calendar.field_event_priority"/>
|
||||
<field name="type_id" ref="caldav.calendar_lines_event" />
|
||||
<field name="field_id" search="[('name','=','priority'),('model_id.model','=','calendar.event')]" />
|
||||
<field name="fn">field</field>
|
||||
</record>
|
||||
|
||||
<record model="basic.calendar.fields" id="map_event_9">
|
||||
<field name="name" ref="base_calendar.field_event_location"/>
|
||||
<field name="type_id" ref="caldav.calendar_lines_event" />
|
||||
@@ -219,13 +205,6 @@
|
||||
<field name="fn">field</field>
|
||||
</record>
|
||||
|
||||
<record model="basic.calendar.fields" id="map_event_11">
|
||||
<field name="name" ref="base_calendar.field_event_status"/>
|
||||
<field name="type_id" ref="caldav.calendar_lines_event" />
|
||||
<field name="field_id" search="[('name','=','state'),('model_id.model','=','calendar.event')]" />
|
||||
<field name="fn">field</field>
|
||||
</record>
|
||||
|
||||
<record model="basic.calendar.fields" id="map_event_12">
|
||||
<field name="name" ref="base_calendar.field_event_exdate"/>
|
||||
<field name="type_id" ref="caldav.calendar_lines_event" />
|
||||
@@ -284,13 +263,6 @@
|
||||
|
||||
|
||||
|
||||
<record model="basic.calendar.fields" id="map_todo_1">
|
||||
<field name="name" ref="base_calendar.field_todo_status"/>
|
||||
<field name="type_id" ref="caldav.calendar_lines_todo" />
|
||||
<field name="field_id" search="[('name','=','state'),('model_id.model','=','calendar.todo')]" />
|
||||
<field name="fn">field</field>
|
||||
</record>
|
||||
|
||||
<record model="basic.calendar.fields" id="map_todo_2">
|
||||
<field name="name" ref="base_calendar.field_todo_exdate"/>
|
||||
<field name="type_id" ref="caldav.calendar_lines_todo" />
|
||||
@@ -298,13 +270,6 @@
|
||||
<field name="fn">field</field>
|
||||
</record>
|
||||
|
||||
<record model="basic.calendar.fields" id="map_todo_3">
|
||||
<field name="name" ref="base_calendar.field_todo_attendee"/>
|
||||
<field name="type_id" ref="caldav.calendar_lines_todo" />
|
||||
<field name="field_id" search="[('name','=','attendee_ids'),('model_id.model','=','calendar.todo')]" />
|
||||
<field name="fn">field</field>
|
||||
</record>
|
||||
|
||||
<record model="basic.calendar.fields" id="map_todo_4">
|
||||
<field name="name" ref="base_calendar.field_todo_valarm"/>
|
||||
<field name="type_id" ref="caldav.calendar_lines_todo" />
|
||||
@@ -333,13 +298,6 @@
|
||||
<field name="fn">field</field>
|
||||
</record>
|
||||
|
||||
<record model="basic.calendar.fields" id="map_todo_9">
|
||||
<field name="name" ref="base_calendar.field_todo_percent"/>
|
||||
<field name="type_id" ref="caldav.calendar_lines_todo" />
|
||||
<field name="field_id" search="[('name','=','progress_rate'),('model_id.model','=','calendar.todo')]" />
|
||||
<field name="fn">field</field>
|
||||
</record>
|
||||
|
||||
<record model="basic.calendar.fields" id="map_todo_11">
|
||||
<field name="name" ref="base_calendar.field_todo_summary"/>
|
||||
<field name="type_id" ref="caldav.calendar_lines_todo" />
|
||||
@@ -347,13 +305,6 @@
|
||||
<field name="fn">field</field>
|
||||
</record>
|
||||
|
||||
<record model="basic.calendar.fields" id="map_todo_12">
|
||||
<field name="name" ref="base_calendar.field_todo_priority"/>
|
||||
<field name="type_id" ref="caldav.calendar_lines_todo" />
|
||||
<field name="field_id" search="[('name','=','priority'),('model_id.model','=','calendar.todo')]" />
|
||||
<field name="fn">field</field>
|
||||
</record>
|
||||
|
||||
<record model="basic.calendar.fields" id="map_todo_13">
|
||||
<field name="name" ref="base_calendar.field_todo_location"/>
|
||||
<field name="type_id" ref="caldav.calendar_lines_todo" />
|
||||
@@ -368,13 +319,6 @@
|
||||
<field name="fn">field</field>
|
||||
</record>
|
||||
|
||||
<record model="basic.calendar.fields" id="map_todo_15">
|
||||
<field name="name" ref="base_calendar.field_todo_duration"/>
|
||||
<field name="type_id" ref="caldav.calendar_lines_todo" />
|
||||
<field name="field_id" search="[('name','=','planned_hours'),('model_id.model','=','calendar.todo')]" />
|
||||
<field name="fn">hours</field>
|
||||
</record>
|
||||
|
||||
<record model="basic.calendar.fields" id="map_todo_16">
|
||||
<field name="name" ref="base_calendar.field_todo_dtstart"/>
|
||||
<field name="type_id" ref="caldav.calendar_lines_todo" />
|
||||
@@ -422,7 +366,7 @@
|
||||
<record model="basic.calendar.fields" id="map_alarm_3">
|
||||
<field name="name" ref="base_calendar.field_alarm_description"/>
|
||||
<field name="type_id" ref="caldav.calendar_lines_alarm" />
|
||||
<field name="field_id" search="[('name','=','name'),('model_id.model','=','calendar.alarm')]" />
|
||||
<field name="field_id" search="[('name','=','description'),('model_id.model','=','calendar.alarm')]" />
|
||||
<field name="fn">field</field>
|
||||
</record>
|
||||
|
||||
@@ -450,7 +394,7 @@
|
||||
<record model="basic.calendar.fields" id="map_alarm_7">
|
||||
<field name="name" ref="base_calendar.field_alarm_summary"/>
|
||||
<field name="type_id" ref="caldav.calendar_lines_alarm" />
|
||||
<field name="field_id" search="[('name','=','description'),('model_id.model','=','calendar.alarm')]" />
|
||||
<field name="field_id" search="[('name','=','name'),('model_id.model','=','calendar.alarm')]" />
|
||||
<field name="fn">field</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -260,5 +260,9 @@
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_attendee_invitations"
|
||||
name="My Invitations" parent="base_calendar.menu_calendar_configuration"
|
||||
sequence="10" action="action_view_attendee_form" />
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -85,7 +85,7 @@ between mails and Open ERP.""",
|
||||
'crm_helpdesk_menu.xml',
|
||||
#'crm_report.xml',
|
||||
'security/crm_security.xml',
|
||||
#'security/ir.model.access.csv',
|
||||
'security/ir.model.access.csv',
|
||||
|
||||
'process/crm_configuration_process.xml'
|
||||
],
|
||||
|
||||
+2
-3
@@ -79,7 +79,7 @@ class crm_case_section(osv.osv):
|
||||
def _check_recursion(self, cr, uid, ids):
|
||||
level = 100
|
||||
while len(ids):
|
||||
cr.execute('select distinct parent_id from crm_case_section where id in ('+','.join(map(str, ids))+')')
|
||||
cr.execute('select distinct parent_id from crm_case_section where id =ANY(%s)',(ids,))
|
||||
ids = filter(None, map(lambda x:x[0], cr.fetchall()))
|
||||
if not level:
|
||||
return False
|
||||
@@ -908,8 +908,7 @@ class users(osv.osv):
|
||||
_description = "Users"
|
||||
_columns = {
|
||||
'context_section_id': fields.selection(_section_get, 'Sales Section'),
|
||||
}
|
||||
|
||||
}
|
||||
users()
|
||||
|
||||
|
||||
|
||||
@@ -26,8 +26,9 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Helpdesk Support">
|
||||
<group colspan="4" col="7">
|
||||
<field colspan="2" name="name" select="1"/>
|
||||
<field colspan="1" name="section_id" widget="selection"/>
|
||||
<field colspan="4" name="name" select="1"/>
|
||||
<field name="section_id" widget="selection"/>
|
||||
<newline/>
|
||||
<field name="date" select="1"/>
|
||||
<field name="date_deadline" select="2"/>
|
||||
<field name="priority"/>
|
||||
@@ -127,7 +128,7 @@
|
||||
<field name="partner_id" string="Partner"/>
|
||||
<field name="planned_revenue"/>
|
||||
<field name="probability"/>
|
||||
<field name="date" string="Deadline"/>
|
||||
<field name="date_deadline"/>
|
||||
<field name="user_id"/>
|
||||
<field name="state"/>
|
||||
<button name="case_close" string="Done" states="open,draft,pending" type="object" icon="gtk-close"/>
|
||||
|
||||
@@ -46,7 +46,7 @@ class crm_lead(osv.osv):
|
||||
_order = "id desc"
|
||||
_inherit = 'crm.case'
|
||||
_columns = {
|
||||
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.lead')]"),
|
||||
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]"),
|
||||
'type_id': fields.many2one('crm.case.resource.type', 'Lead Type Name', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.lead')]"),
|
||||
'partner_name': fields.char("Employee's Name", size=64),
|
||||
'partner_name2': fields.char('Employee Email', size=64),
|
||||
|
||||
@@ -2,42 +2,7 @@
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
<record model="crm.case.categ" id="categ_lead1">
|
||||
<field name="name">Existing Customer</field>
|
||||
<field name="section_id" ref="section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
|
||||
</record>
|
||||
<record model="crm.case.categ" id="categ_lead2">
|
||||
<field name="name">Self Generated</field>
|
||||
<field name="section_id" ref="section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
|
||||
</record>
|
||||
<record model="crm.case.categ" id="categ_lead3">
|
||||
<field name="name">Employee</field>
|
||||
<field name="section_id" ref="section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
|
||||
</record>
|
||||
<record model="crm.case.categ" id="categ_lead4">
|
||||
<field name="name">Partner</field>
|
||||
<field name="section_id" ref="section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
|
||||
</record>
|
||||
<record model="crm.case.categ" id="categ_lead6">
|
||||
<field name="name">Website</field>
|
||||
<field name="section_id" ref="section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
|
||||
</record>
|
||||
<record model="crm.case.categ" id="categ_lead7">
|
||||
<field name="name">Word of mouth</field>
|
||||
<field name="section_id" ref="section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
|
||||
</record>
|
||||
<record model="crm.case.categ" id="categ_lead8">
|
||||
<field name="name">Other</field>
|
||||
<field name="section_id" ref="section_sales_department"/>
|
||||
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- CASE STATUS(stage_id) -->
|
||||
<record model="crm.case.stage" id="stage_lead1">
|
||||
<field name="name">New</field>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<field eval=""Michel Lafont"" name="partner_name2"/>
|
||||
<field eval=""(726) 782-0636"" name="partner_mobile"/>
|
||||
<field eval="1" name="active"/>
|
||||
<field name="categ_id" ref="crm.categ_lead6"/>
|
||||
<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"/>
|
||||
@@ -31,7 +31,7 @@
|
||||
<field eval=""Luc Latour"" name="partner_name2"/>
|
||||
<field eval=""(392) 895-7917"" name="partner_mobile"/>
|
||||
<field eval="1" name="active"/>
|
||||
<field name="categ_id" ref="crm.categ_lead2"/>
|
||||
<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"/>
|
||||
@@ -46,7 +46,7 @@
|
||||
<field eval=""Mike Gardner"" name="partner_name2"/>
|
||||
<field eval=""(820) 167-3208"" name="partner_mobile"/>
|
||||
<field eval="1" name="active"/>
|
||||
<field name="categ_id" ref="crm.categ_lead4"/>
|
||||
<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"/>
|
||||
@@ -61,7 +61,7 @@
|
||||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field eval=""(077) 582-4035"" name="partner_mobile"/>
|
||||
<field eval="1" name="active"/>
|
||||
<field name="categ_id" ref="crm.categ_lead1"/>
|
||||
<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"/>
|
||||
@@ -76,7 +76,7 @@
|
||||
<field eval=""Sam Stone"" name="partner_name2"/>
|
||||
<field eval=""(333) 715-1450"" name="partner_mobile"/>
|
||||
<field eval="1" name="active"/>
|
||||
<field name="categ_id" ref="crm.categ_lead6"/>
|
||||
<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"/>
|
||||
@@ -93,7 +93,7 @@
|
||||
<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 name="categ_id" ref="crm.categ_lead8"/>
|
||||
<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"/>
|
||||
@@ -109,7 +109,7 @@
|
||||
<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 name="categ_id" ref="crm.categ_lead4"/>
|
||||
<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"/>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<!-- MENU -->
|
||||
|
||||
<record model="ir.actions.act_window" id="crm_case_category_act_leads_all">
|
||||
<field name="name">All Leads</field>
|
||||
<field name="name">Leads</field>
|
||||
<field name="res_model">crm.lead</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="crm_case_tree_view_leads"/>
|
||||
|
||||
@@ -2,20 +2,8 @@
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
# ------------------------------------------------------
|
||||
# Leads Categories
|
||||
# ------------------------------------------------------
|
||||
|
||||
<record id="crm_lead_categ_action" model="ir.actions.act_window">
|
||||
<field name="name">Lead Categories</field>
|
||||
<field name="res_model">crm.case.categ</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="crm.crm_case_categ_tree-view"/>
|
||||
<field name="domain">[('object_id.model', '=', 'crm.lead')]</field>
|
||||
<field name="context">{'object_id':'crm.lead'}</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="crm_lead_categ_action" id="menu_crm_case_lead-act" parent="crm.menu_crm_case_categ"/>
|
||||
|
||||
# ------------------------------------------------------
|
||||
# Stage
|
||||
# ------------------------------------------------------
|
||||
@@ -41,8 +29,9 @@
|
||||
<group colspan="4" col="7">
|
||||
<field name="name" select="1" string="Lead Subject"/>
|
||||
<field name="section_id" colspan="1" widget="selection"/>
|
||||
<field name="user_id" select="2"/>
|
||||
<newline/>
|
||||
<field name="opportunity_id" string="Opportunity Case"/>
|
||||
<button string="Convert to Opportunity" name="%(wizard_crm_lead_opportunity_set)d" icon="gtk-index" type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}"/>
|
||||
|
||||
<label string="Stage: " align="1.0"/>
|
||||
<group colspan="1" col="2">
|
||||
<field name="stage_id" select="1" nolabel="1"/>
|
||||
@@ -50,10 +39,10 @@
|
||||
</group>
|
||||
<field name="categ_id" select="1" on_change="onchange_categ_id(categ_id)" string="Lead Source"/>
|
||||
<field name="type_id" string="Campaign Type" select="1"/>
|
||||
</group>
|
||||
<group colspan="2" col="4">
|
||||
<field name="opportunity_id" string="Opportunity Case"/>
|
||||
<button string="Convert to Opportunity" name="%(wizard_crm_lead_opportunity_set)d" icon="gtk-index" type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}"/>
|
||||
<newline/>
|
||||
<field name="date"/>
|
||||
<field name="date_deadline"/>
|
||||
<field name="user_id" select="2"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Leads">
|
||||
@@ -183,10 +172,6 @@
|
||||
domain="[('user_id','=',uid)]" help="My Leads"
|
||||
default="1"
|
||||
/>
|
||||
<filter icon="terp-crm"
|
||||
domain="[('user_id','child_of',[uid])]"
|
||||
help="My department's Leads"
|
||||
/>
|
||||
</field>
|
||||
<field name="state" select="1">
|
||||
<filter icon="gtk-new" domain="[('state','=','draft')]" help="Draft Leads"/>
|
||||
|
||||
@@ -22,6 +22,12 @@
|
||||
from osv import fields, osv
|
||||
import crm
|
||||
|
||||
class crm_opportunity(osv.osv):
|
||||
_name = 'crm.opportunity'
|
||||
crm_opportunity()
|
||||
class crm_phonecall(osv.osv):
|
||||
_name = 'crm.phonecall'
|
||||
crm_phonecall()
|
||||
class crm_meeting(osv.osv):
|
||||
_name = 'crm.meeting'
|
||||
_description = "Meeting Cases"
|
||||
@@ -36,6 +42,8 @@ class crm_meeting(osv.osv):
|
||||
help='Category related to the section.Subdivide the CRM cases \
|
||||
independently or section-wise.'),
|
||||
'attendee_ids': fields.many2many('calendar.attendee', 'event_attendee_rel', 'event_id', 'attendee_id', 'Attendees'),
|
||||
'phonecall_id':fields.many2one ('crm.phonecall', 'Phonecall'),
|
||||
'opportunity_id':fields.many2one ('crm.opportunity', 'Opportunity'),
|
||||
}
|
||||
|
||||
crm_meeting()
|
||||
|
||||
@@ -44,14 +44,14 @@
|
||||
</record>
|
||||
|
||||
|
||||
<record model="basic.calendar.fields" id="caldav.map_event_8">
|
||||
<record model="basic.calendar.fields" id="map_event_8">
|
||||
<field name="name" ref="base_calendar.field_event_priority"/>
|
||||
<field name="type_id" ref="caldav.calendar_lines_event" />
|
||||
<field name="field_id" search="[('name','=','priority'),('model_id.model','=','crm.meeting')]" />
|
||||
<field name="fn">field</field>
|
||||
</record>
|
||||
|
||||
<record model="basic.calendar.fields" id="caldav.map_event_11">
|
||||
<record model="basic.calendar.fields" id="map_event_11">
|
||||
<field name="name" ref="base_calendar.field_event_status"/>
|
||||
<field name="type_id" ref="caldav.calendar_lines_event" />
|
||||
<field name="field_id" search="[('name','=','state'),('model_id.model','=','crm.meeting')]" />
|
||||
|
||||
@@ -46,7 +46,8 @@
|
||||
icon="gtk-save-as" type="action" context="{'model' : 'crm.meeting'}"
|
||||
attrs="{'readonly': [('rrule_type','!=','custom')]}"
|
||||
/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Description">
|
||||
|
||||
@@ -2,9 +2,29 @@
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<!-- <menuitem id="menu_presale" name="Sales" parent="crm.menu_crm" sequence="4"/>-->
|
||||
|
||||
<act_window
|
||||
id="act_crm_opportunity_crm_meeting_new"
|
||||
name="Meeting Cases"
|
||||
res_model="crm.meeting"
|
||||
src_model="crm.opportunity"
|
||||
view_mode="calendar,graph"
|
||||
context="{'default_partner_id': active_id, 'default_duration': 4.0}"
|
||||
domain="[('opportunity_id','=',active_id)]"
|
||||
view_type="form"/>
|
||||
|
||||
<act_window
|
||||
id="act_crm_opportunity_crm_phonecall_new"
|
||||
name="Phone calls"
|
||||
res_model="crm.phonecall"
|
||||
src_model="crm.opportunity"
|
||||
view_mode="calendar,tree,form"
|
||||
context="{'default_partner_id': active_id, 'default_duration': 1.0}"
|
||||
domain="[('opportunity_id','=',active_id)]"
|
||||
view_type="form"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="crm_case_category_act_oppor11">
|
||||
<field name="name">All Opportunities</field>
|
||||
<field name="name">Opportunities</field>
|
||||
<field name="res_model">crm.opportunity</field>
|
||||
<field name="view_mode">tree,form,graph</field>
|
||||
<field name="view_id" ref="crm_case_tree_view_oppor"/>
|
||||
|
||||
@@ -51,12 +51,10 @@
|
||||
<field name="stage_id" select="1" nolabel="1"/>
|
||||
<button icon="gtk-go-forward" string="" name="stage_next" type="object"/>
|
||||
</group>
|
||||
<field name="date" string="Deadline"/>
|
||||
<group colspan="2">
|
||||
<field name="phonecall_id" select="1"/>
|
||||
</group>
|
||||
<button string="Schedule a Phone Call"
|
||||
name="%(wizard_crm_opportunity_reschedule_phone_call)d" icon="gtk-redo" type="action" attrs="{'invisible':[('phonecall_id','!=',False)]}" />
|
||||
<field name="date" />
|
||||
<field name="date_deadline"/>
|
||||
<button string="Schedule a Phone Call"
|
||||
name="%(wizard_crm_opportunity_reschedule_phone_call)d" icon="gtk-redo" type="action" />
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Description">
|
||||
@@ -153,7 +151,7 @@
|
||||
<field name="partner_id" string="Partner"/>
|
||||
<field name="planned_revenue"/>
|
||||
<field name="probability"/>
|
||||
<field name="date" string="Deadline"/>
|
||||
<field name="date_deadline"/>
|
||||
<field name="user_id"/>
|
||||
<field name="state"/>
|
||||
<button name="case_open" string="Open" states="draft,pending" type="object" icon="gtk-go-forward"/>
|
||||
|
||||
@@ -82,19 +82,19 @@
|
||||
<field name="name" string="Subject"/>
|
||||
<field name="section_id" colspan="1" widget="selection"/>
|
||||
<field name="user_id" string="Assigned to" select="2"/>
|
||||
<button string="Convert to Opportunity" name="%(wizard_crm_phonecall_opportunity_set)d" icon="gtk-index" type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}" />
|
||||
<newline/>
|
||||
<field name="date" string="Planned Date"/>
|
||||
<field name="duration"/>
|
||||
<group colspan="2">
|
||||
<field name="opportunity_id" on_change="onchange_case_id(case_id, name, partner_id)"
|
||||
context="{'default_name':name,'default_section_id':section_id,'default_user_id':user_id,'default_duration':duration,
|
||||
'default_partner_id':partner_id,'default_partner_address_id':partner_address_id,'default_partner_phone':partner_phone,
|
||||
'default_partner_mobile':partner_mobile,'default_categ_id':categ_id}"/>
|
||||
|
||||
</group>
|
||||
<button string="Schedule a Meeting"
|
||||
name="%(wizard_crm_phonecall_meeting_set)d" icon="gtk-redo" type="action" />
|
||||
|
||||
<newline/>
|
||||
<field name="date" string="Planned Date"/>
|
||||
<field name="duration"/>
|
||||
<field name="opportunity_id" on_change="onchange_case_id(case_id, name, partner_id)"
|
||||
context="{'default_name':name,'default_section_id':section_id,'default_user_id':user_id,'default_duration':duration,
|
||||
'default_partner_id':partner_id,'default_partner_address_id':partner_address_id,'default_partner_phone':partner_phone,
|
||||
'default_partner_mobile':partner_mobile,'default_categ_id':categ_id}"/>
|
||||
|
||||
|
||||
<button string="Convert to Opportunity" name="%(wizard_crm_phonecall_opportunity_set)d" icon="gtk-index" type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}" />
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="General">
|
||||
@@ -175,7 +175,6 @@
|
||||
<field name="name" select='1' string="Subject"/>
|
||||
<field name="user_id" select="1" widget="selection">
|
||||
<filter icon="terp-partner" domain="[('user_id','=',uid)]" help="My Phonecalls" default="1"/>
|
||||
<filter icon="terp-crm" domain="[('user_id','child_of',[uid])]" help="My department's Phonecalls"/>
|
||||
</field>
|
||||
<field name="state" select="1">
|
||||
<filter icon="gtk-index" domain="[('state','in',('open','draft' ))]" help="Current "/>
|
||||
|
||||
+80
-80
@@ -48,41 +48,41 @@
|
||||
<field name="view_id" ref="crm_case_section_view_tree"/>
|
||||
</record>
|
||||
|
||||
# ------------------------------------------------------
|
||||
# Stage
|
||||
# ------------------------------------------------------
|
||||
<record model="ir.ui.view" id="crm_case_stage_tree">
|
||||
<field name="name">crm.case.stage.tree</field>
|
||||
<field name="model">crm.case.stage</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Stages">
|
||||
<field name="sequence"/>
|
||||
<field name="name"/>
|
||||
<field name="section_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="crm_case_stage_form">
|
||||
<field name="name">crm.case.stage.form</field>
|
||||
<field name="model">crm.case.stage</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Stage">
|
||||
<field name="name" select="1"/>
|
||||
<field name="section_id" select="1" widget="selection"/>
|
||||
<field name="object_id" invisible="1" />
|
||||
<field name="sequence"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="crm_case_stage_act" model="ir.actions.act_window">
|
||||
<field name="name">Stages</field>
|
||||
<field name="res_model">crm.case.stage</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="crm_case_stage_tree"/>
|
||||
</record>
|
||||
<menuitem id="menu_crm_case_stage" name="Stages" parent="crm.menu_crm_configuration"/>
|
||||
# ------------------------------------------------------
|
||||
# Stage
|
||||
# ------------------------------------------------------
|
||||
<record model="ir.ui.view" id="crm_case_stage_tree">
|
||||
<field name="name">crm.case.stage.tree</field>
|
||||
<field name="model">crm.case.stage</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Stages">
|
||||
<field name="sequence"/>
|
||||
<field name="name"/>
|
||||
<field name="section_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="crm_case_stage_form">
|
||||
<field name="name">crm.case.stage.form</field>
|
||||
<field name="model">crm.case.stage</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Stage">
|
||||
<field name="name" select="1"/>
|
||||
<field name="section_id" select="1" widget="selection"/>
|
||||
<field name="object_id" invisible="1" />
|
||||
<field name="sequence"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="crm_case_stage_act" model="ir.actions.act_window">
|
||||
<field name="name">Stages</field>
|
||||
<field name="res_model">crm.case.stage</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="crm_case_stage_tree"/>
|
||||
</record>
|
||||
<menuitem id="menu_crm_case_stage" name="Stages" parent="crm.menu_crm_configuration"/>
|
||||
<!-- Case Categories -->
|
||||
<record id="crm_case_categ-view" model="ir.ui.view">
|
||||
<field name="name">crm.case.categ.form</field>
|
||||
@@ -92,7 +92,7 @@
|
||||
<form string="Case Category">
|
||||
<field name="name" select="1"/>
|
||||
<field name="section_id" select="1" widget="selection"/>
|
||||
<field name="object_id" invisible="1" />
|
||||
<field name="object_id" invisible="1" />
|
||||
<field name="probability"/>
|
||||
</form>
|
||||
</field>
|
||||
@@ -116,7 +116,7 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="crm_case_categ_tree-view"/>
|
||||
</record>
|
||||
<menuitem id="menu_crm_case_categ" name="Categories" parent="crm.menu_crm_configuration"/>
|
||||
<menuitem id="menu_crm_case_categ" name="Categories" parent="crm.menu_crm_configuration"/>
|
||||
|
||||
<menuitem action="crm_case_section_act" id="menu_crm_case_section_act" parent="crm.menu_crm_configuration"/>
|
||||
|
||||
@@ -185,8 +185,8 @@
|
||||
<separator colspan="4" string="Server Action to be Triggered"/>
|
||||
<field name="server_action_id"/>
|
||||
<!--
|
||||
<field name="act_method" colspan="4" readonly="1"/>
|
||||
-->
|
||||
<field name="act_method" colspan="4" readonly="1"/>
|
||||
-->
|
||||
</page>
|
||||
<page string="E-Mail Actions">
|
||||
<separator colspan="4" string="Template of Email to Send"/>
|
||||
@@ -243,11 +243,11 @@
|
||||
<separator string="" colspan="4"/>
|
||||
<newline/>
|
||||
<field name="user_id"
|
||||
attrs="{ 'required' : [('name','=','user')]}"
|
||||
on_change="change_email(user_id, partner_id)"/>
|
||||
attrs="{ 'required' : [('name','=','user')]}"
|
||||
on_change="change_email(user_id, partner_id)"/>
|
||||
<field name="partner_id"
|
||||
attrs="{'required' : [('name','=','partner')]}"
|
||||
on_change="change_email(user_id, partner_id)"/>
|
||||
attrs="{'required' : [('name','=','partner')]}"
|
||||
on_change="change_email(user_id, partner_id)"/>
|
||||
<field name="email"/>
|
||||
<button name="add_cc" string="Ok" type="object" icon="gtk-go-forward"/>
|
||||
</form>
|
||||
@@ -350,15 +350,15 @@
|
||||
<newline />
|
||||
<notebook colspan="4">
|
||||
<page string="General">
|
||||
<group col="8" colspan="4">
|
||||
<field colspan="4" name="partner_id" on_change="onchange_partner_id(partner_id, email_from)" select="1"/>
|
||||
<field colspan="3" name="partner_address_id" on_change="onchange_partner_address_id(partner_address_id, email_from)" select="2"/>
|
||||
<newline/>
|
||||
<field colspan="3" name="email_from" select="2"/>
|
||||
<button name="remind_partner" states="open,pending" string="Send Reminder" type="object" icon="gtk-go-forward"/>
|
||||
<field name="user_id" select="1"/>
|
||||
<button name="remind_user" states="open,pending" string="Send Reminder" type="object" icon="gtk-go-forward"/>
|
||||
</group>
|
||||
<group col="8" colspan="4">
|
||||
<field colspan="4" name="partner_id" on_change="onchange_partner_id(partner_id, email_from)" select="1"/>
|
||||
<field colspan="3" name="partner_address_id" on_change="onchange_partner_address_id(partner_address_id, email_from)" select="2"/>
|
||||
<newline/>
|
||||
<field colspan="3" name="email_from" select="2"/>
|
||||
<button name="remind_partner" states="open,pending" string="Send Reminder" type="object" icon="gtk-go-forward"/>
|
||||
<field name="user_id" select="1"/>
|
||||
<button name="remind_user" states="open,pending" string="Send Reminder" type="object" icon="gtk-go-forward"/>
|
||||
</group>
|
||||
<separator colspan="4" string="Description"/>
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
<separator colspan="4"/>
|
||||
@@ -402,8 +402,8 @@
|
||||
<field name="canal_id"/>
|
||||
<button
|
||||
string="Add a CC"
|
||||
name="%(crm.action_view_crm_email_add_cc_wizard)d"
|
||||
icon="gtk-add" type="action"/>
|
||||
name="%(crm.action_view_crm_email_add_cc_wizard)d"
|
||||
icon="gtk-add" type="action"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
@@ -430,8 +430,8 @@
|
||||
<search string="Search Case">
|
||||
<group col='6' colspan='4'>
|
||||
<filter icon="terp-partner" string="My Cases"
|
||||
domain="[('user_id','=',uid)]" separator="1"
|
||||
default="1" help="Cases Related to Current User"
|
||||
domain="[('user_id','=',uid)]" separator="1"
|
||||
default="1" help="Cases Related to Current User"
|
||||
/>
|
||||
<field name="state" select="1">
|
||||
<filter icon="gtk-new" domain="[('state','=','draft')]" help="Draft Cases"/>
|
||||
@@ -442,11 +442,11 @@
|
||||
<field name="name" select='1'/>
|
||||
<field name="user_id" select="1" widget="selection"/>
|
||||
</group>
|
||||
<field name="section_id" select="1" widget="selection" string="Section"/>
|
||||
<field name="section_id" select="1" widget="selection" string="Section"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="crm_case_categ0-act" model="ir.actions.act_window">
|
||||
<field name="name">Cases</field>
|
||||
<field name="res_model">crm.case</field>
|
||||
@@ -502,17 +502,17 @@
|
||||
<field name="model">crm.case.history</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Histories">
|
||||
<filter icon="terp-crm" string="My Histories" domain="[('user_id','=',uid)]" help="My Histories"/>
|
||||
<separator orientation="vertical"/>
|
||||
<search string="Search Histories">
|
||||
<filter icon="terp-crm" string="My Histories" domain="[('user_id','=',uid)]" help="My Histories"/>
|
||||
<separator orientation="vertical"/>
|
||||
<group col="6" colspan="2">
|
||||
<field name="date" select="1"/>
|
||||
<field name="date" select="1"/>
|
||||
<field name="user_id" select="1" widget="selection"/>
|
||||
<field name="section_id" select="1" widget="selection" string="Section"/>
|
||||
</group>
|
||||
<field name="section_id" select="1" widget="selection" string="Section"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="crm_case_history-act" model="ir.actions.act_window">
|
||||
<field name="name">Histories</field>
|
||||
@@ -634,30 +634,30 @@
|
||||
<!-- <act_window domain="[('user_id', '=', active_id),('state','<>','done'),('state','<>','cancel'),('state','<>','pending')]" id="act_res_users_2_crm_case_opened" name="Open cases" res_model="crm.case" src_model="res.users" view_mode="tree,form,calendar" view_type="form"/>-->
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_users_form_simple_modif_inherited1">
|
||||
<record model="ir.ui.view" id="view_users_form_simple_modif_inherited1">
|
||||
<field name="name">view.users.form.crm.modif.inherited1</field>
|
||||
<field name="model">res.users</field>
|
||||
<field name="inherit_id" ref="base.view_users_form_simple_modif" />
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<page string="Current Activity" position="inside">
|
||||
<page string="Current Activity" position="inside">
|
||||
<field name="context_section_id" completion="1"/>
|
||||
</page>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_users_form_simple_modif_inherited2" model="ir.ui.view">
|
||||
<field name="name">view.users.form.crm.modif.inherited2</field>
|
||||
<field name="model">res.users</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="base.view_users_form"/>
|
||||
<field eval="18" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="password" position="after">
|
||||
<field name="context_section_id" completion="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_users_form_simple_modif_inherited2" model="ir.ui.view">
|
||||
<field name="name">view.users.form.crm.modif.inherited2</field>
|
||||
<field name="model">res.users</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="base.view_users_form"/>
|
||||
<field eval="18" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="password" position="after">
|
||||
<field name="context_section_id" completion="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
+399
-176
File diff suppressed because it is too large
Load Diff
@@ -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-01-27 04:45+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-01-29 04:52+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: crm
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -55,9 +55,8 @@ class report_custom(report_int):
|
||||
minbenef = 999999999999999999999
|
||||
maxbenef = 0
|
||||
|
||||
cr.execute('select probability, planned_revenue, planned_cost, user_id, res_users.name as name from crm_case left join res_users on (crm_case.user_id=res_users.id) where crm_case.id in ('+','.join(map(str, ids))+') order by user_id')
|
||||
cr.execute('select probability, planned_revenue, planned_cost, user_id, res_users.name as name from crm_case left join res_users on (crm_case.user_id=res_users.id) where crm_case.id =ANY(%s) order by user_id',(ids,))
|
||||
res = cr.dictfetchall()
|
||||
|
||||
for row in res:
|
||||
proba = row['probability'] or 0 / 100.0
|
||||
cost = row['planned_cost'] or 0
|
||||
|
||||
@@ -18,94 +18,5 @@
|
||||
<!-- <field name="groups_id" eval="[(6,0,[ref('group_crm_manager')])]"/>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<!--rule for meeting-->
|
||||
<record model="ir.rule.group" id="crm_meeting_rule_group">
|
||||
<field name="name">crm.meeting.rule</field>
|
||||
<field name="model_id" search="[('model','=','crm.meeting')]" model="ir.model"/>
|
||||
<field name="global" eval="True"/>
|
||||
</record>
|
||||
|
||||
<record id="crm_meeting_rule" model="ir.rule">
|
||||
<field name="domain_force">['|',('section_id','=',False),('section_id','in',[user.context_section_id])]</field>
|
||||
<field name="rule_group" ref="crm_meeting_rule_group"/>
|
||||
</record>
|
||||
|
||||
<!--rule for Claims-->
|
||||
<record model="ir.rule.group" id="crm_claim_rule_group">
|
||||
<field name="name">crm.claim.rule</field>
|
||||
<field name="model_id" search="[('model','=','crm.claim')]" model="ir.model"/>
|
||||
<field name="global" eval="True"/>
|
||||
</record>
|
||||
<record id="crm_claim_rule" model="ir.rule">
|
||||
<field name="domain_force">['|',('section_id','=',False),('section_id','in',[user.context_section_id])]</field>
|
||||
<field name="rule_group" ref="crm_claim_rule_group"/>
|
||||
</record>
|
||||
|
||||
<!--rule for Fund Raising-->
|
||||
<record model="ir.rule.group" id="crm_fundraising_rule_group">
|
||||
<field name="name">crm.fundraising.rule</field>
|
||||
<field name="model_id" search="[('model','=','crm.fundraising')]" model="ir.model"/>
|
||||
<field name="global" eval="True"/>
|
||||
</record>
|
||||
<record id="crm_fundraising_rule" model="ir.rule">
|
||||
<field name="domain_force">['|',('section_id','=',False),('section_id','in',[user.context_section_id])]</field>
|
||||
<field name="rule_group" ref="crm_fundraising_rule_group"/>
|
||||
</record>
|
||||
|
||||
<!--rule for HelpDesk-->
|
||||
<record model="ir.rule.group" id="crm_helpdesk_rule_group">
|
||||
<field name="name">crm.helpdesk.rule</field>
|
||||
<field name="model_id" search="[('model','=','crm.helpdesk')]" model="ir.model"/>
|
||||
<field name="global" eval="True"/>
|
||||
</record>
|
||||
<record id="crm_helpdesk_rule" model="ir.rule">
|
||||
<field name="domain_force">['|',('section_id','=',False),('section_id','in',[user.context_section_id])]</field>
|
||||
<field name="rule_group" ref="crm_helpdesk_rule_group"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!--rule for leads-->
|
||||
<record model="ir.rule.group" id="crm_leads_rule_group">
|
||||
<field name="name">crm.leads.rule</field>
|
||||
<field name="model_id" search="[('model','=','crm.lead')]" model="ir.model"/>
|
||||
<field name="global" eval="True"/>
|
||||
</record>
|
||||
<record id="crm_leads_rule" model="ir.rule">
|
||||
<field name="domain_force">['|',('section_id','=',False),('section_id','in',[user.context_section_id])]</field>
|
||||
<field name="rule_group" ref="crm_leads_rule_group"/>
|
||||
</record>
|
||||
|
||||
<!--rule for business opportunities-->
|
||||
<record model="ir.rule.group" id="crm_opportunities_rule_group">
|
||||
<field name="name">crm.opportunities.rule</field>
|
||||
<field name="model_id" search="[('model','=','crm.opportunity')]" model="ir.model"/>
|
||||
<field name="global" eval="True"/>
|
||||
</record>
|
||||
<record id="crm_opportunities_rule" model="ir.rule">
|
||||
<field name="domain_force">['|',('section_id','=',False),('section_id','in',[user.context_section_id])]</field>
|
||||
<field name="rule_group" ref="crm_opportunities_rule_group"/>
|
||||
</record>
|
||||
|
||||
<!--rule for phone calls-->
|
||||
<record model="ir.rule.group" id="crm_phone_calls_rule_group">
|
||||
<field name="name">crm.phone.calls.rule</field>
|
||||
<field name="model_id" search="[('model','=','crm.phonecall')]" model="ir.model"/>
|
||||
<field name="global" eval="True"/>
|
||||
</record>
|
||||
<record id="crm_phone_calls_rule" model="ir.rule">
|
||||
<field name="domain_force">['|',('section_id','=',False),('section_id','in',[user.context_section_id])]</field>
|
||||
<field name="rule_group" ref="crm_phone_calls_rule_group"/>
|
||||
</record>
|
||||
|
||||
<!--rule for cases-->
|
||||
<record model="ir.rule.group" id="crm_case_rule_group">
|
||||
<field name="name">crm.case.rule</field>
|
||||
<field name="model_id" search="[('model','=','crm.case')]" model="ir.model"/>
|
||||
<field name="global" eval="True"/>
|
||||
</record>
|
||||
<record id="crm_case_rule" model="ir.rule">
|
||||
<field name="domain_force">['|',('section_id','=',False),('section_id','in',[user.context_section_id])]</field>
|
||||
<field name="rule_group" ref="crm_case_rule_group"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -6,6 +6,13 @@
|
||||
"access_crm_case_rule","crm.case.rule","model_crm_case_rule","crm.group_crm_user",1,0,0,0
|
||||
"access_crm_case_manger","crm.case manager","model_crm_case","crm.group_crm_user",1,1,1,1
|
||||
"access_crm_case","crm.case","model_crm_case","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_claim","crm.claim","model_crm_claim","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_fundraising","crm.fundraising","model_crm_fundraising","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_helpdesk","crm.helpdesk","model_crm_helpdesk","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_meeting","crm.meeting","model_crm_meeting","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_lead","crm.lead","model_crm_lead","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_opportunity","crm.opportunity","model_crm_opportunity","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_phonecall","crm.phonecall","model_crm_phonecall","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_case_log","crm.case.log","model_crm_case_log","crm.group_crm_user",1,1,1,1
|
||||
"access_crm_case_history","crm.case.history","model_crm_case_history","crm.group_crm_user",1,1,1,1
|
||||
"access_crm_case_section_manager","crm.case.section.manager","model_crm_case_section","crm.group_crm_manager",1,1,1,1
|
||||
@@ -16,12 +23,6 @@
|
||||
"access_crm_email_add_cc_manager","crm.email.add.cc","model_crm_email_add_cc","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_email_add_cc_user","crm.email.add.cc","model_crm_email_add_cc","crm.group_crm_user",1,0,0,0
|
||||
"access_crm_case_stage","crm.case.stage","model_crm_case_stage","crm.group_crm_user",1,0,0,0
|
||||
"access_report_crm_case_section_stage","report.crm.case.section.stage","model_report_crm_case_section_stage","crm.group_crm_manager",1,0,0,0
|
||||
"access_report_crm_case_section_categ_stage","report.crm.case.section.categ.stage","model_report_crm_case_section_categ_stage","crm.group_crm_manager",1,0,0,0
|
||||
"access_report_crm_case_section_categ_categ2","report.crm.case.section.categ.categ2","model_report_crm_case_section_categ_categ2","crm.group_crm_manager",1,0,0,
|
||||
"access_report_crm_case_section_categ2","report.crm.case.section.categ2","model_report_crm_case_section_categ2","crm.group_crm_manager",1,0,0,
|
||||
"access_crm_case_stage_manager","crm.case.stage","model_crm_case_stage","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_menu_config_wizard","crm config wizard manager","model_crm_menu_config_wizard","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_menu_config_wizard system","crm config wizard manager system","model_crm_menu_config_wizard","base.group_system",1,1,1,1
|
||||
"access_crm_case_category2_user","crm_case_category2 user","model_crm_case_category2","crm.group_crm_user",1,0,0,0
|
||||
"access_crm_case_category2_manager","crm_case_category2 manager","model_crm_case_category2","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_case_resource_type_user","crm_case_resource_type user","model_crm_case_resource_type","crm.group_crm_user",1,0,0,0
|
||||
"access_crm_case_resource_type_manager","crm_case_resource_type manager","model_crm_case_resource_type","crm.group_crm_manager",1,1,1,1
|
||||
|
||||
|
@@ -94,13 +94,11 @@ class opportunity2phonecall(wizard.interface):
|
||||
'section_id' : form['section_id'],
|
||||
'partner_id': opportunity.partner_id.id,
|
||||
'partner_address_id':opportunity.partner_address_id.id,
|
||||
'description':opportunity.description
|
||||
'description':opportunity.description,
|
||||
'opportunity_id':opportunity.id
|
||||
}, context=context)
|
||||
vals = {}
|
||||
if not opportunity.phonecall_id:
|
||||
vals.update({'phonecall_id' : new_case})
|
||||
opportunity_case_obj.write(cr, uid, [opportunity.id], vals)
|
||||
opportunity_case_obj.case_cancel(cr, uid, [opportunity.id])
|
||||
|
||||
phonecall_case_obj.case_open(cr, uid, [new_case])
|
||||
|
||||
value = {
|
||||
@@ -142,11 +140,11 @@ class opportunity2meeting(wizard.interface):
|
||||
'section_id' : opportunity.section_id and opportunity.section_id.id or False,
|
||||
'date_deadline': opportunity.date_deadline,
|
||||
'description':opportunity.description,
|
||||
'opportunity_id':opportunity.id
|
||||
})
|
||||
new_meeting = meeting_case_obj.browse(cr, uid, new_meeting_id)
|
||||
vals = {}
|
||||
opportunity_case_obj.write(cr, uid, [opportunity.id], vals)
|
||||
opportunity_case_obj.case_cancel(cr, uid, [opportunity.id])
|
||||
opportunity_case_obj.write(cr, uid, [opportunity.id], vals)
|
||||
meeting_case_obj.case_open(cr, uid, [new_meeting_id])
|
||||
data_obj = pool.get('ir.model.data')
|
||||
result = data_obj._get_id(cr, uid, 'crm', 'view_crm_case_meetings_filter')
|
||||
@@ -162,6 +160,7 @@ class opportunity2meeting(wizard.interface):
|
||||
id3 = data_obj.browse(cr, uid, id3, context=context).res_id
|
||||
return {
|
||||
'name': _('Meetings'),
|
||||
'domain' : "[('opportunity_id','in',%s)]"%(data['ids']),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'calendar,form,tree',
|
||||
'res_model': 'crm.meeting',
|
||||
|
||||
@@ -104,14 +104,14 @@ class phonecall2opportunity(wizard.interface):
|
||||
'probability': data['form']['probability'],
|
||||
'partner_id': data['form']['partner_id'],
|
||||
'section_id':phonecall.section_id.id,
|
||||
'description':phonecall.description,
|
||||
'description':phonecall.description,
|
||||
'phonecall_id': phonecall.id
|
||||
})
|
||||
new_opportunity = opportunity_case_obj.browse(cr, uid, new_opportunity_id)
|
||||
vals = {
|
||||
'partner_id': data['form']['partner_id'],
|
||||
}
|
||||
if not phonecall.opportunity_id:
|
||||
vals.update({'opportunity_id' : new_opportunity.id})
|
||||
'partner_id': data['form']['partner_id'],
|
||||
'opportunity_id' : new_opportunity_id,
|
||||
}
|
||||
phonecall_case_obj.write(cr, uid, [phonecall.id], vals)
|
||||
phonecall_case_obj.case_cancel(cr, uid, [phonecall.id])
|
||||
opportunity_case_obj.case_open(cr, uid, [new_opportunity_id])
|
||||
@@ -202,6 +202,7 @@ class phonecall2meeting(wizard.interface):
|
||||
'section_id' : phonecall.section_id and phonecall.section_id.id or False,
|
||||
'duration': phonecall.duration,
|
||||
'description':phonecall.description,
|
||||
'phonecall_id':phonecall.id
|
||||
})
|
||||
new_meeting = meeting_case_obj.browse(cr, uid, new_meeting_id)
|
||||
vals = {}
|
||||
@@ -222,6 +223,7 @@ class phonecall2meeting(wizard.interface):
|
||||
id3 = data_obj.browse(cr, uid, id3, context=context).res_id
|
||||
return {
|
||||
'name': _('Meetings'),
|
||||
'domain' : "[('phonecall_id','in',%s)]"%(data['ids']),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'calendar,form,tree',
|
||||
'res_model': 'crm.meeting',
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
'crm_hr_menu.xml',
|
||||
'report_crm_hr_view.xml',
|
||||
'security/crm_hr_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'board_crm_hr_statistical_view.xml',
|
||||
],
|
||||
'demo_xml': [
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
######################## JOB OPPORTUNITIES (menu) ###########################
|
||||
<record model="ir.actions.act_window" id="crm_case_categ0_act_job">
|
||||
<field name="name">All Jobs Requests</field>
|
||||
<field name="name">Jobs Requests</field>
|
||||
<field name="res_model">crm.job</field>
|
||||
<field name="view_mode">tree,calendar,form,graph</field>
|
||||
<field name="view_id" ref="crm_case_tree_view_job"/>
|
||||
|
||||
@@ -3,17 +3,6 @@
|
||||
<data noupdate="1">
|
||||
|
||||
|
||||
<!--rule for Jobs-->
|
||||
<record model="ir.rule.group" id="crm_job_rule_group">
|
||||
<field name="name">crm.meeting.rule</field>
|
||||
<field name="model_id" search="[('model','=','crm.job')]" model="ir.model"/>
|
||||
<field name="global" eval="True"/>
|
||||
</record>
|
||||
<record id="crm_job_rule" model="ir.rule">
|
||||
<field name="domain_force">['|',('section_id','=',False),('section_id','=',user.context_section_id)]</field>
|
||||
<field name="rule_group" ref="crm_job_rule_group"/>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_crm_job","crm.job","model_crm_job","crm.group_crm_manager",1,1,1,1
|
||||
"access_report_crm_job_user","report.crm.job.user","model_report_crm_job_user","crm.group_crm_manager",1,0,0,0
|
||||
"access_report_crm_job_categ","report.crm.job.categ","model_report_crm_job_categ","crm.group_crm_manager",1,0,0,0
|
||||
"access_repor_crm_job_section","report.crm.job.section","model_report_crm_job_section","crm.group_crm_manager",1,0,0,0
|
||||
|
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -28,17 +28,17 @@ def _get_answers(cr, uid, ids):
|
||||
query = """
|
||||
select distinct(answer)
|
||||
from profile_question_yes_rel
|
||||
where profile in (%s)"""% ','.join([str(i) for i in ids ])
|
||||
where profile=ANY(%s)"""
|
||||
|
||||
cr.execute(query)
|
||||
cr.execute(query,(ids,))
|
||||
ans_yes = [x[0] for x in cr.fetchall()]
|
||||
|
||||
query = """
|
||||
select distinct(answer)
|
||||
from profile_question_no_rel
|
||||
where profile in (%s)"""% ','.join([str(i) for i in ids ])
|
||||
where profile=ANY(%s)"""
|
||||
|
||||
cr.execute(query)
|
||||
cr.execute(query,(ids,))
|
||||
ans_no = [x[0] for x in cr.fetchall()]
|
||||
|
||||
return [ans_yes, ans_no]
|
||||
@@ -50,7 +50,7 @@ def _get_parents(cr, uid, ids):
|
||||
select distinct(parent_id)
|
||||
from crm_segmentation
|
||||
where parent_id is not null
|
||||
and id in (%s)""" % ','.join([str(i) for i in ids ]))
|
||||
and id=ANY(%s)""",(ids,))
|
||||
|
||||
parent_ids = [x[0] for x in cr.fetchall()]
|
||||
|
||||
@@ -88,17 +88,17 @@ def test_prof(cr, uid, seg_id, pid, answers_ids = []):
|
||||
def _recompute_categ(self, cr, uid, pid, answers_ids):
|
||||
ok = []
|
||||
cr.execute('''
|
||||
select r.category_id
|
||||
from res_partner_category_rel r left join crm_segmentation s on (r.category_id = s.categ_id)
|
||||
select r.category_id
|
||||
from res_partner_category_rel r left join crm_segmentation s on (r.category_id = s.categ_id)
|
||||
where r.partner_id = %s and (s.exclusif = false or s.exclusif is null)
|
||||
''', (pid,))
|
||||
for x in cr.fetchall():
|
||||
ok.append(x[0])
|
||||
|
||||
query = '''
|
||||
select id, categ_id
|
||||
from crm_segmentation
|
||||
where profiling_active = true'''
|
||||
select id, categ_id
|
||||
from crm_segmentation
|
||||
where profiling_active = true'''
|
||||
if ok != []:
|
||||
query = query +''' and categ_id not in(%s)'''% ','.join([str(i) for i in ok ])
|
||||
query = query + ''' order by id '''
|
||||
@@ -140,7 +140,7 @@ class questionnaire(osv.osv):
|
||||
for name, oid in result:
|
||||
quest_form = quest_form + '<field name="quest_form%d"/><newline/>' % (oid,)
|
||||
quest_fields['quest_form%d' % (oid,)] = {'string': name, 'type': 'many2one', 'relation': 'crm_profiling.answer', 'domain': [('question_id','=',oid)] }
|
||||
quest_form = quest_form + '''</form>'''
|
||||
quest_form = quest_form + '''</form>'''
|
||||
return quest_form, quest_fields
|
||||
|
||||
_columns = {
|
||||
@@ -213,7 +213,7 @@ class crm_segmentation(osv.osv):
|
||||
if categ['exclusif']:
|
||||
cr.execute('delete from res_partner_category_rel where category_id=%s', (categ['categ_id'][0],))
|
||||
|
||||
id = categ['id']
|
||||
id = categ['id']
|
||||
|
||||
cr.execute('select id from res_partner order by id ')
|
||||
partners = [x[0] for x in cr.fetchall()]
|
||||
|
||||
@@ -40,7 +40,8 @@
|
||||
'crm_feature_view.xml',
|
||||
'crm_feature_menu.xml',
|
||||
'report_crm_project_bug_view.xml',
|
||||
'security/crm_project_security.xml'
|
||||
'security/crm_project_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
],
|
||||
'demo_xml': ['crm_bugs_demo.xml'],
|
||||
'installable': True,
|
||||
|
||||
@@ -188,7 +188,6 @@
|
||||
<field name="name" select='1' string="Subject"/>
|
||||
<field name="user_id" select="1" widget="selection">
|
||||
<filter icon="terp-partner" domain="[('user_id','=',uid)]" help="My Bugs" default="1"/>
|
||||
<filter icon="terp-crm" domain="[('user_id','child_of',[uid])]" help="My department's Bugs"/>
|
||||
</field>
|
||||
<field name="state" select="1">
|
||||
<filter icon="gtk-new" domain="[('state','=','draft')]" help="Draft Bugs"/>
|
||||
|
||||
@@ -163,7 +163,6 @@
|
||||
<field name="name" select='1' string="Subject"/>
|
||||
<field name="user_id" select="1" widget="selection">
|
||||
<filter icon="terp-partner" domain="[('user_id','=',uid)]" help="My Future Requests" default="1"/>
|
||||
<filter icon="terp-crm" domain="[('user_id','child_of',[uid])]" help="My department's Future Requests"/>
|
||||
</field>
|
||||
<field name="state" select="1">
|
||||
<filter icon="gtk-new" domain="[('state','=','draft')]" help="Draft Future Requests"/>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_crm_project_bug","crm.project.bug","model_crm_project_bug","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_project_future","crm.project.future","model_crm_project_future","crm.group_crm_manager",1,1,1,1
|
||||
"access_report_crm_project_bug_user","report.crm.project.bug.user","model_report_crm_project_bug_user","crm.group_crm_manager",1,0,0,0
|
||||
"access_report_crm_project_bug_categ","report.crm.project.bug.categ","model_report_crm_project_bug_categ","crm.group_crm_manager",1,0,0,0
|
||||
"access_repor_crm_project_bug_section","report.crm.project.bug.section","model_report_crm_project_bug_section","crm.group_crm_manager",1,0,0,0
|
||||
|
@@ -169,18 +169,5 @@
|
||||
<field name="search_view_id" ref="stock.view_picking_out_search"/>
|
||||
</record>
|
||||
|
||||
<record id="action_picking_tree5" model="ir.actions.act_window">
|
||||
<field name="name">Generate Draft Invoices On Receptions</field>
|
||||
<field name="res_model">stock.picking</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('invoice_state','=','2binvoiced'),('state','=','done'),('type','=','in')]</field>
|
||||
<field name="filter" eval="True"/>
|
||||
<field name="context">{'contact_display': 'partner'}</field>
|
||||
<field name="search_view_id" ref="stock.view_picking_in_search"/>
|
||||
</record>
|
||||
<menuitem action="action_picking_tree5" id="menu_action_picking_tree5" parent="stock.menu_action_picking_tree4" groups="base.group_extended"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -36,6 +36,7 @@ import tools
|
||||
from tools.translate import _
|
||||
import nodes
|
||||
|
||||
|
||||
class document_file(osv.osv):
|
||||
_inherit = 'ir.attachment'
|
||||
_rec_name = 'datas_fname'
|
||||
@@ -129,12 +130,15 @@ class document_file(osv.osv):
|
||||
if len(res):
|
||||
return False
|
||||
return True
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
if not default:
|
||||
default ={}
|
||||
name = self.read(cr, uid, [id])[0]['name']
|
||||
default.update({'name': name+ " (copy)"})
|
||||
if 'name' not in default:
|
||||
name = self.read(cr, uid, [id])[0]['name']
|
||||
default.update({'name': name+ " (copy)"})
|
||||
return super(document_file,self).copy(cr,uid,id,default,context)
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
res=self.search(cr,uid,[('id','in',ids)])
|
||||
if not len(res):
|
||||
@@ -182,7 +186,8 @@ class document_file(osv.osv):
|
||||
import urllib
|
||||
datas=base64.encodestring(urllib.urlopen(vals['link']).read())
|
||||
else:
|
||||
datas=vals.get('datas',False)
|
||||
datas = vals.get('datas',False)
|
||||
|
||||
vals['file_size']= datas and len(datas) or 0
|
||||
if not self._check_duplication(cr,uid,vals):
|
||||
raise osv.except_osv(_('ValidateError'), _('File name must be unique!'))
|
||||
|
||||
@@ -65,6 +65,7 @@ class document_directory(osv.osv):
|
||||
objid=self.pool.get('ir.model.data')
|
||||
try:
|
||||
mid = objid._get_id(cr, uid, 'document', 'dir_root')
|
||||
return None # TODO: check why not display root dir
|
||||
if not mid:
|
||||
return None
|
||||
except Exception, e:
|
||||
|
||||
@@ -128,13 +128,27 @@
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_document_directory_form">
|
||||
<field name="name">Directories</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">document.directory</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<record id="action_dir_view1" model="ir.actions.act_window.view">
|
||||
<field eval="10" name="sequence"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="view_document_directory_tree"/>
|
||||
<field name="act_window_id" ref="action_document_directory_form"/>
|
||||
</record>
|
||||
<record id="action_dir_view2" model="ir.actions.act_window.view">
|
||||
<field eval="20" name="sequence"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_document_directory_form"/>
|
||||
<field name="act_window_id" ref="action_document_directory_form"/>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
name="Directories"
|
||||
action="action_document_directory_form"
|
||||
id="menu_document_directories"
|
||||
parent="menu_document_management_configuration"/>
|
||||
@@ -145,7 +159,7 @@
|
||||
<field name="name">Directorie's Structure</field>
|
||||
<field name="res_model">document.directory</field>
|
||||
<field name="view_type">tree</field>
|
||||
<field name="view_id" ref="view_document_directory_tree"/>
|
||||
<field name="view_id" ref="document.view_document_directory_tree"/>
|
||||
<field name="domain">[('ressource_parent_type_id','=',False),('parent_id','=',False)]</field>
|
||||
</record>
|
||||
<menuitem
|
||||
@@ -301,6 +315,11 @@
|
||||
res_model="ir.attachment"
|
||||
src_model="res.partner"/>
|
||||
|
||||
<act_window domain="[('parent_id', '=', active_id)]"
|
||||
id="zoom_directory" name="Related Documents"
|
||||
res_model="ir.attachment"
|
||||
src_model="document.directory"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
||||
@@ -184,13 +184,14 @@ class node_dir(node_class):
|
||||
dc2.update(self.dctx)
|
||||
dc2['dir_id'] = self.dir_id
|
||||
self.displayname = dirr.name
|
||||
for dfld in dirr.dctx_ids:
|
||||
try:
|
||||
self.dctx['dctx_' + dfld.field] = safe_eval(dfld.expr,dc2)
|
||||
except Exception,e:
|
||||
print "Cannot eval %s" % dfld.expr
|
||||
print e
|
||||
pass
|
||||
if dirr.dctx_ids:
|
||||
for dfld in dirr.dctx_ids:
|
||||
try:
|
||||
self.dctx['dctx_' + dfld.field] = safe_eval(dfld.expr,dc2)
|
||||
except Exception,e:
|
||||
print "Cannot eval %s" % dfld.expr
|
||||
print e
|
||||
pass
|
||||
|
||||
def children(self,cr):
|
||||
return self._child_get(cr) + self._file_get(cr)
|
||||
|
||||
@@ -1,53 +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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Integrated Document Management System',
|
||||
'version': '1.99',
|
||||
'category': 'Generic Modules/Others',
|
||||
'description': """
|
||||
The document_change module allows to track and manage process changes to
|
||||
update documents in directories, and keep track of these updates. You
|
||||
can define control points, phase of changes. This module has been
|
||||
developed for Caterpillar Belgium.
|
||||
""",
|
||||
'author': 'Tiny',
|
||||
'website': 'http://www.openerp.com',
|
||||
'depends': ['base', 'document_ftp','mail_gateway'],
|
||||
'init_xml': ['document_change_data.xml'],
|
||||
'update_xml': [
|
||||
'security/document_process_security.xml',
|
||||
'document_change_view.xml',
|
||||
'document_change_sequence.xml',
|
||||
'document_change_workflow.xml',
|
||||
'document_change_report_view.xml',
|
||||
'document_phase_workflow.xml',
|
||||
'document_process_workflow.xml',
|
||||
'cat_demo.xml'
|
||||
],
|
||||
'demo_xml': [ ],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': None,
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record model="ir.ui.menu" id="base.menu_base_partner">
|
||||
<field name="groups_id" eval="[(6,0,[ref('base.group_no_one')])]"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,356 +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 tools
|
||||
from osv import fields, osv
|
||||
import os
|
||||
import pooler
|
||||
import netsvc
|
||||
from tools.translate import _
|
||||
import time
|
||||
import datetime
|
||||
|
||||
class document_directory(osv.osv):
|
||||
_inherit = 'document.directory'
|
||||
def _level_compute(self, cr, uid, ids, field_name, arg, context):
|
||||
result = {}
|
||||
for d in self.browse(cr, uid, ids, context=context):
|
||||
result[d.id] = 0
|
||||
d2 = d
|
||||
while d2:
|
||||
d2 = d2.parent_id
|
||||
result[d.id] += 1
|
||||
return result
|
||||
_columns = {
|
||||
'level': fields.function(_level_compute, method=True,
|
||||
string='level', type='integer', store=True),
|
||||
}
|
||||
document_directory()
|
||||
|
||||
class document_change_process_phase_type(osv.osv):
|
||||
_name = "document.change.process.phase.type"
|
||||
document_change_process_phase_type()
|
||||
|
||||
class document_change_type(osv.osv):
|
||||
_name = "document.change.type"
|
||||
_description = "Document Type"
|
||||
_columns = {
|
||||
'name': fields.char("Document Type", size=64,required=True),
|
||||
'phase_type_ids': fields.many2many('document.change.process.phase.type','document_type_phase_type_rel','document_type_id','phase_type_id','Phase Type'),
|
||||
'directory_id' :fields.many2one('document.directory','Pending Directory'),
|
||||
'template_document_id':fields.many2one('ir.attachment','Template Document')
|
||||
}
|
||||
document_change_type()
|
||||
|
||||
class document_change_process_phase_type(osv.osv):
|
||||
_name = "document.change.process.phase.type"
|
||||
_description = "Process Phase Type"
|
||||
_columns = {
|
||||
'name': fields.char("Process Type", required=True, size=64),
|
||||
'sequence': fields.integer('Sequence'),
|
||||
'active': fields.boolean('Active'),
|
||||
'document_type_ids': fields.many2many('document.change.type','document_type_phase_type_rel','phase_type_id','document_type_id','Document Type'),
|
||||
}
|
||||
_defaults = {
|
||||
'active': lambda *a:1,
|
||||
}
|
||||
document_change_process_phase_type()
|
||||
|
||||
class document_change_process(osv.osv):
|
||||
_name = "document.change.process"
|
||||
document_change_process()
|
||||
|
||||
class document_change_process_phase(osv.osv):
|
||||
_name = "document.change.process.phase"
|
||||
_description = "Process Phase"
|
||||
_columns = {
|
||||
'name': fields.char("Phase Name", size=64, required=True),
|
||||
'process_id':fields.many2one('document.change.process','Process Change'),
|
||||
'sequence': fields.integer('Sequence'),
|
||||
'update_document': fields.selection([('at_endPhase', 'End Phase'),('at_endprocess', 'End Process')], 'Update Document', required=True),
|
||||
'type': fields.selection([('control_required', 'Control Required'),('no_control', 'No Control')], 'Type'),
|
||||
'date_control': fields.date('Control Date', select=True),
|
||||
'phase_type_id':fields.many2one('document.change.process.phase.type','Phase Type'),
|
||||
'state': fields.selection([('draft', 'Draft'),('in_process', 'Started'),('to_validate', 'To Validate'),('done', 'Done')], 'State',readonly=True),
|
||||
'phase_document_ids':fields.one2many('ir.attachment','process_phase_id','Documents'),
|
||||
}
|
||||
_defaults = {
|
||||
'state': lambda *a: 'draft',
|
||||
'update_document': lambda *a:'at_endPhase',
|
||||
'type':lambda *a: 'no_control',
|
||||
}
|
||||
def do_draft(self, cr, uid, ids, *args):
|
||||
self.write(cr, uid, ids, {'state':'draft'})
|
||||
return True
|
||||
|
||||
def do_confirm(self, cr, uid, ids, *args):
|
||||
self.write(cr, uid, ids, {'state':'to_validate'})
|
||||
return True
|
||||
|
||||
def do_start(self, cr, uid, ids, *args):
|
||||
self.write(cr, uid, ids, {'state':'in_process'})
|
||||
return True
|
||||
|
||||
def do_done(self, cr, uid, ids, *args):
|
||||
self.write(cr, uid, ids, {'state':'done'})
|
||||
return True
|
||||
def test_control_request(self, cr, uid, ids, context=None):
|
||||
return all(bool(process.type) =='control_required' for process in self.browse(cr, uid, ids, context=context))
|
||||
|
||||
def test_nocontrol_request(self, cr, uid, ids, context=None):
|
||||
return all(bool(process.type) =='no_control' for process in self.browse(cr, uid, ids, context=context))
|
||||
|
||||
document_change_process_phase()
|
||||
|
||||
class document_change_process_model(osv.osv):
|
||||
_name = "document.change.process.model"
|
||||
_description = "Process model"
|
||||
|
||||
_columns = {
|
||||
'name': fields.char("Model of Process", size=64,required=True),
|
||||
'sequence': fields.integer('Sequence'),
|
||||
'phase_type_ids':fields.many2many('document.change.process.phase.type','process_model_phase_type_rel','process_model_id','phase_type_id','Phase Type'),
|
||||
}
|
||||
document_change_process_model()
|
||||
|
||||
class document_change_process_type(osv.osv):
|
||||
_name = "document.change.process.type"
|
||||
_description = "Process Type"
|
||||
|
||||
_columns = {
|
||||
'name': fields.char("Changed Process Type", size=64),
|
||||
}
|
||||
document_change_process_type()
|
||||
|
||||
class document_change_process_email(osv.osv):
|
||||
_name = "document.change.process.mail"
|
||||
_description = "Process Email Notification"
|
||||
|
||||
_columns = {
|
||||
'name': fields.char("Email", size=64),
|
||||
'type':fields.selection([('start_end', 'Start/End Process '),('change_all', 'Change in All Document')], 'Notification Type'),
|
||||
'process_id':fields.many2one('document.change.process','Process Change'),
|
||||
}
|
||||
document_change_process_email()
|
||||
|
||||
class document_change_process(osv.osv):
|
||||
_name = "document.change.process"
|
||||
_description = "Process"
|
||||
|
||||
def _latestmodification(self, cr, uid, ids, field_name, arg, context={}):
|
||||
res = {}
|
||||
#TODOto calculate latest modified date from all related documents
|
||||
return res
|
||||
|
||||
def _get_document(self, cr, uid, ids, context={}, *arg):
|
||||
if not ids:
|
||||
return {}
|
||||
res = {}
|
||||
attach = self.pool.get('ir.attachment')
|
||||
directory_obj = self.pool.get('document.directory')
|
||||
for process_change in self.browse(cr, uid, ids):
|
||||
res1 = []
|
||||
for phase_id in process_change.process_phase_ids:
|
||||
res1 += map(lambda x:x.id, phase_id.phase_document_ids or [])
|
||||
res[process_change.id] = res1
|
||||
return res
|
||||
|
||||
def _get_progress(self, cr, uid, ids, field_name, arg, context={}):
|
||||
result = {}
|
||||
progress = 0.0
|
||||
for proc_change in self.browse(cr, uid, ids):
|
||||
update_docs = []
|
||||
result[proc_change.id] = 0.0
|
||||
for doc in proc_change.process_document_ids:
|
||||
if doc.state in ('to_update', 'change_propose'):
|
||||
update_docs.append(doc)
|
||||
progress = (float(len(update_docs))/float(len(proc_change.process_document_ids)))*100
|
||||
result[proc_change.id] = progress
|
||||
return result
|
||||
|
||||
def _get_current_phase(self, cr, uid, ids, field_name, arg, context={}):
|
||||
result = {}
|
||||
for proc in self.browse(cr, uid, ids):
|
||||
result[proc.id] = False
|
||||
for phase in proc.process_phase_ids:
|
||||
if phase.state in ('in_process','to_validate'):
|
||||
result[proc.id] = phase.id
|
||||
return result
|
||||
|
||||
_columns = {
|
||||
'name': fields.char("Process ID", size=64, required=True, select=True),
|
||||
'process_type_id' :fields.many2one('document.change.process.type','Type of Change'),
|
||||
'description': fields.char("Title", size=64, required=True),
|
||||
'change_description':fields.text('Changed Description'),
|
||||
'structure_id' :fields.many2one('document.directory','Directory', required=True),
|
||||
'process_model_id':fields.many2one('document.change.process.model','Process Model'),
|
||||
'user_id':fields.many2one('res.users','Owner',required=True),
|
||||
'create_date':fields.datetime('Creation',readonly=True),
|
||||
'latest_modified_date':fields.function(_latestmodification, method=True, type='datetime', string="Lastest Modification"), #TODO no year!
|
||||
'date_expected':fields.datetime('Expected Production'),
|
||||
'state':fields.selection([('draft', 'Draft'),('in_progress', 'In Progress'),('to_validate', 'To Validate'), ('pending', 'Pending'), ('done', 'Done'),('cancel','Cancelled')], 'State', readonly=True),
|
||||
'process_phase_ids':fields.one2many('document.change.process.phase','process_id','Phase'),
|
||||
'current_phase_id': fields.function(_get_current_phase, method=True, type='many2one', relation='document.change.process.phase', string='Current Phase'),
|
||||
'date_control': fields.related('current_phase_id','date_control', type='date', string='Control Date'),
|
||||
'progress': fields.function(_get_progress, method=True, type='float', string='Progress'),
|
||||
'process_document_ids': fields.many2many('ir.attachment','document_changed_process_rel','process_id','change_id','Document To Change'),
|
||||
}
|
||||
_defaults = {
|
||||
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'document.change.process'),
|
||||
'state': lambda *a: 'draft',
|
||||
'user_id': lambda laurence,henrion,est,cool: est
|
||||
}
|
||||
def do_start(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'in_progress'},context=context)
|
||||
return True
|
||||
|
||||
def do_pending(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'pending'},context=context)
|
||||
return True
|
||||
|
||||
def do_confirm(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'to_validate'},context=context)
|
||||
return True
|
||||
|
||||
def do_done(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'done'},context=context)
|
||||
return True
|
||||
|
||||
def do_cancel(self, cr, uid, ids, context={}):
|
||||
return self.write(cr, uid, ids, {'state':'cancel'},context=context)
|
||||
|
||||
def generate_phases(self, cr, uid, ids, *args):
|
||||
phase_obj = self.pool.get('document.change.process.phase')
|
||||
directory_obj = self.pool.get('document.directory')
|
||||
document_obj = self.pool.get('ir.attachment')
|
||||
new_doc_ids = []
|
||||
for process in self.browse(cr, uid, ids):
|
||||
if process.process_model_id:
|
||||
directory_ids = directory_obj.search(cr, uid, [('parent_id','child_of',process.structure_id and process.structure_id.id)])
|
||||
for phase_type_id in process.process_model_id.phase_type_ids:
|
||||
for document_type_id in phase_type_id.document_type_ids:
|
||||
document_ids = document_obj.search(cr, uid, [
|
||||
('parent_id','in',directory_ids),
|
||||
('change_type_id','=',document_type_id.id)])
|
||||
new_doc_ids = []
|
||||
for document_id in document_ids:
|
||||
vals = {}
|
||||
new_doc_ids.append(document_obj.copy(cr, uid, document_id, vals))
|
||||
phase_value = {
|
||||
'name' : '%s-%s' %(phase_type_id.name, process.name),
|
||||
'phase_type_id': phase_type_id.id,
|
||||
'process_id': process.id,
|
||||
'phase_document_ids': [(6,0,new_doc_ids)]
|
||||
}
|
||||
phase_obj.create(cr, uid, phase_value)
|
||||
|
||||
return True
|
||||
|
||||
document_change_process()
|
||||
|
||||
class document_file(osv.osv):
|
||||
_inherit = 'ir.attachment'
|
||||
_columns = {
|
||||
'change_type_id':fields.many2one('document.change.type','Document Type'),
|
||||
'state': fields.selection([('draft','To Create'),('in_production', 'In Production'), ('change_request', 'Change Requested'),('change_propose', 'Change Proposed'), ('to_update', 'To Update'), ('cancel', 'Cancel')], 'State'),
|
||||
'style': fields.selection([('run','Run'),('setup','Setup'),('pma','PMA'),('pmp','PMP')],'Document Style'),
|
||||
'target_document_id': fields.many2one('ir.attachment', 'Target Document'),
|
||||
'target':fields.binary('Target'),
|
||||
'process_phase_id' :fields.many2one('document.change.process.phase','Process Phase'),
|
||||
'progress': fields.float('Progress'), #TODO : functio field: calculate progress
|
||||
'change_process_id': fields.related('process_phase_id', 'process_id', type='many2one', relation='document.change.process', string='Change Process'),
|
||||
}
|
||||
_defaults = {
|
||||
'state': lambda *a: 'in_production',
|
||||
}
|
||||
|
||||
def _check_duplication(self, cr, uid, vals, ids=[], op='create'):
|
||||
name=vals.get('name',False)
|
||||
parent_id=vals.get('parent_id',False)
|
||||
res_model=vals.get('res_model',False)
|
||||
res_id=vals.get('res_id',0)
|
||||
type_id=vals.get('change_type_id',False)
|
||||
if op=='write':
|
||||
for file in self.browse(cr,uid,ids):
|
||||
if not name:
|
||||
name=file.name
|
||||
if not parent_id:
|
||||
parent_id=file.parent_id and file.parent_id.id or False
|
||||
if not res_model:
|
||||
res_model=file.res_model and file.res_model or False
|
||||
if not res_id:
|
||||
res_id=file.res_id and file.res_id or 0
|
||||
res=self.search(cr,uid,[('id','<>',file.id),('name','=',name),('parent_id','=',parent_id),('res_model','=',res_model),('res_id','=',res_id),('change_type_id','=',type_id)])
|
||||
if len(res):
|
||||
return False
|
||||
if op=='create':
|
||||
res=self.search(cr,uid,[('name','=',name),('parent_id','=',parent_id),('res_id','=',res_id),('res_model','=',res_model),('change_type_id','=',type_id)])
|
||||
if len(res):
|
||||
return False
|
||||
return True
|
||||
|
||||
def do_change_request(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'change_request'},context=context)
|
||||
return True
|
||||
|
||||
def do_change_propose(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'change_propose'},context=context)
|
||||
return True
|
||||
|
||||
def do_to_update(self, cr, uid, ids, context={}):
|
||||
for attach in self.browse(cr, uid, ids, context=context):
|
||||
if attach.change_type_id.directory_id.id:
|
||||
attach_ids = self.pool.get('ir.attachment').search(cr,uid, [('id', '=',attach.target_document_id.id)])
|
||||
read_data=self.read(cr,uid, attach_ids,['datas','datas_fname'])
|
||||
self.write(cr, uid, attach_ids, {'state':'to_update','datas':attach.datas,'datas_fname':attach.datas_fname},context=context)
|
||||
res={}
|
||||
for data in read_data:
|
||||
t=datetime.datetime.now()
|
||||
file_name=data['datas_fname'].split('.')
|
||||
new_name=str(file_name[0]+'.old'+time.strftime("%y%m%d")+'.'+file_name[1])
|
||||
res['name']=attach.name
|
||||
res['datas']=data['datas']
|
||||
res['datas_fname']=new_name
|
||||
res['parent_id']=attach.change_type_id.directory_id.id
|
||||
old_id = self.create(cr, uid, res)
|
||||
self.write(cr, uid, ids, {'state':'to_update'},context=context)
|
||||
return True
|
||||
|
||||
def do_production(self, cr, uid, ids, context={}):
|
||||
return self.write(cr, uid, ids, {'state':'in_production'},context=context)
|
||||
|
||||
def write(self, cr, uid, ids, data, context={}):
|
||||
for d in self.browse(cr, uid, ids, context=context):
|
||||
if d.state=='draft' and d.datas:
|
||||
super(document_file,self).write(cr,uid,[d.id],
|
||||
{'state':'in_production'},context=context)
|
||||
result = super(document_file,self).write(cr,uid,ids,data,context=context)
|
||||
return True
|
||||
|
||||
def do_draft(self, cr, uid, ids, context={}):
|
||||
return self.write(cr, uid, ids, {'state':'draft'},context=context)
|
||||
|
||||
def do_cancel(self, cr, uid, ids, context={}):
|
||||
return self.write(cr, uid, ids, {'state':'cancel'},context=context)
|
||||
|
||||
def test_change_request(self, cr, uid, ids, context=None):
|
||||
return all(bool(attch.target_document_id) != False for attch in self.browse(cr, uid, ids, context=context))
|
||||
|
||||
document_file()
|
||||
@@ -1,187 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
<!-- Structure Data -->
|
||||
<record model="document.directory" id="dir_root">
|
||||
<field name="name">Bat E</field>
|
||||
<field name="parent_id" eval="False"/>
|
||||
</record>
|
||||
<record model="document.directory" id="dir_bat_e">
|
||||
<field name="name">Commodity A</field>
|
||||
<field name="parent_id" ref="dir_root"/>
|
||||
</record>
|
||||
<record model="document.directory" id="dir_bat_z">
|
||||
<field name="name">Commodity B</field>
|
||||
<field name="parent_id" ref="dir_root"/>
|
||||
</record>
|
||||
|
||||
<record model="document.directory" id="dir_mq_section">
|
||||
<field name="name">MQ Section</field>
|
||||
<field name="parent_id" ref="dir_bat_e"/>
|
||||
</record>
|
||||
|
||||
<record model="document.directory" id="dir_section_x">
|
||||
<field name="name">Section X</field>
|
||||
<field name="parent_id" ref="dir_mq_section"/>
|
||||
</record>
|
||||
<record model="document.directory" id="dir_section_y">
|
||||
<field name="name">Section Y</field>
|
||||
<field name="parent_id" ref="dir_mq_section"/>
|
||||
</record>
|
||||
|
||||
<record model="document.directory" id="dir_ws_1bc">
|
||||
<field name="name">Work Station 1BC</field>
|
||||
<field name="parent_id" ref="dir_section_x"/>
|
||||
</record>
|
||||
<record model="document.directory" id="dir_ws_2bc">
|
||||
<field name="name">Work Station 2BC</field>
|
||||
<field name="parent_id" ref="dir_section_x"/>
|
||||
</record>
|
||||
<record model="document.directory" id="dir_ws_3bc">
|
||||
<field name="name">Work Station 3BC</field>
|
||||
<field name="parent_id" ref="dir_section_y"/>
|
||||
</record>
|
||||
|
||||
<record model="document.directory" id="dir_family1">
|
||||
<field name="name">Family 1</field>
|
||||
<field name="parent_id" ref="dir_ws_1bc"/>
|
||||
</record>
|
||||
<record model="document.directory" id="dir_family2">
|
||||
<field name="name">Family 2</field>
|
||||
<field name="parent_id" ref="dir_ws_1bc"/>
|
||||
</record>
|
||||
<record model="document.directory" id="dir_family3">
|
||||
<field name="name">Family 3</field>
|
||||
<field name="parent_id" ref="dir_ws_2bc"/>
|
||||
</record>
|
||||
<record model="document.directory" id="dir_family4">
|
||||
<field name="name">Family 4</field>
|
||||
<field name="parent_id" ref="dir_ws_3bc"/>
|
||||
</record>
|
||||
|
||||
<record model="document.directory" id="dir_vsm">
|
||||
<field name="name">MQ Section 2</field>
|
||||
<field name="parent_id" ref="dir_bat_z"/>
|
||||
</record>
|
||||
<record model="document.directory" id="dir_takt_time">
|
||||
<field name="name">MQ Section 3</field>
|
||||
<field name="parent_id" ref="dir_bat_z"/>
|
||||
</record>
|
||||
|
||||
<record model="document.directory" id="dir_template">
|
||||
<field name="name">Templates</field>
|
||||
<field name="parent_id" ref="dir_root"/>
|
||||
</record>
|
||||
|
||||
<!-- Document Templates -->
|
||||
<record model="ir.attachment" id="doc_FIE_template">
|
||||
<field name="name">FIE_template</field>
|
||||
<field name="datas_fname">FIE_template.xls</field>
|
||||
<field name="parent_id" ref="dir_template"/>
|
||||
</record>
|
||||
<record model="ir.attachment" id="doc_SFMEA_template">
|
||||
<field name="name">SFMEA_template</field>
|
||||
<field name="datas_fname">SFMEA_template.xls</field>
|
||||
<field name="parent_id" ref="dir_template"/>
|
||||
</record>
|
||||
<record model="ir.attachment" id="doc_ProjectCharter_Template">
|
||||
<field name="name">ProjectCharter_Template</field>
|
||||
<field name="datas_fname">ProjectCharter_Template.ppt</field>
|
||||
<field name="parent_id" ref="dir_template"/>
|
||||
</record>
|
||||
<record model="ir.attachment" id="doc_TaktTime_template">
|
||||
<field name="name">TaktTime_template</field>
|
||||
<field name="datas_fname">TaktTime_template.xls</field>
|
||||
<field name="parent_id" ref="dir_template"/>
|
||||
</record>
|
||||
|
||||
<!-- Document Change Types -->
|
||||
<record model="document.change.type" id="type_project_charter">
|
||||
<field name="name">Project Charter</field>
|
||||
<field name="template_document_id" ref="doc_ProjectCharter_Template"/>
|
||||
</record>
|
||||
<record model="document.change.type" id="type_vsm">
|
||||
<field name="name">VSM</field>
|
||||
</record>
|
||||
<record model="document.change.type" id="type_takt_time">
|
||||
<field name="name">Takt Time</field>
|
||||
<field name="template_document_id" ref="doc_TaktTime_template"/>
|
||||
</record>
|
||||
<record model="document.change.type" id="type_FIE">
|
||||
<field name="name">FIE</field>
|
||||
<field name="template_document_id" ref="doc_FIE_template"/>
|
||||
</record>
|
||||
<record model="document.change.type" id="type_SFMEA">
|
||||
<field name="name">SFMEA</field>
|
||||
<field name="template_document_id" ref="doc_SFMEA_template"/>
|
||||
</record>
|
||||
|
||||
<!-- Documents -->
|
||||
<record model="ir.attachment" id="doc_FIE_05466_001">
|
||||
<field name="name">FIE_05466_001</field>
|
||||
<field name="datas_fname">FIE_05466_001.xls</field>
|
||||
<field name="parent_id" ref="dir_family1"/>
|
||||
<field name="change_type_id" ref="type_FIE"/>
|
||||
</record>
|
||||
<record model="ir.attachment" id="doc_SFMEA_0581_001">
|
||||
<field name="name">SFMEA_0581_001</field>
|
||||
<field name="datas_fname">SFMEA_0581_001.xls</field>
|
||||
<field name="parent_id" ref="dir_family1"/>
|
||||
<field name="change_type_id" ref="type_SFMEA"/>
|
||||
</record>
|
||||
<record model="ir.attachment" id="doc_SFMEA_0581_002">
|
||||
<field name="name">SFMEA_0581_002</field>
|
||||
<field name="datas_fname">SFMEA_0581_002.xls</field>
|
||||
<field name="parent_id" ref="dir_family2"/>
|
||||
<field name="change_type_id" ref="type_SFMEA"/>
|
||||
</record>
|
||||
<record model="ir.attachment" id="doc_TaktTime_0549">
|
||||
<field name="name">TaktTime_0549</field>
|
||||
<field name="datas_fname">TaktTime_0549.xls</field>
|
||||
<field name="parent_id" ref="dir_takt_time"/>
|
||||
<field name="change_type_id" ref="type_takt_time"/>
|
||||
</record>
|
||||
|
||||
<!-- Phase Types -->
|
||||
<record model="document.change.process.phase.type" id="phase_type_concept">
|
||||
<field name="name">Concept</field>
|
||||
<field name="sequence">1</field>
|
||||
<field eval="[(6, 0, [ref('type_project_charter'),ref('type_vsm'),ref('type_takt_time')])]" name="document_type_ids"/>
|
||||
</record>
|
||||
<record model="document.change.process.phase.type" id="phase_type_development">
|
||||
<field name="name">Development</field>
|
||||
<field name="sequence">2</field>
|
||||
<field eval="[(6, 0, [ref('type_FIE'),ref('type_SFMEA')])]" name="document_type_ids"/>
|
||||
</record>
|
||||
<record model="document.change.process.phase.type" id="phase_type_validation">
|
||||
<field name="name">Validation</field>
|
||||
<field name="sequence">3</field>
|
||||
<field eval="[(6, 0, [ref('type_FIE'),ref('type_SFMEA')])]" name="document_type_ids"/>
|
||||
</record>
|
||||
|
||||
<!-- Change of Models Data -->
|
||||
<record model="document.change.process.model" id="model_NPI">
|
||||
<field name="name">NPI</field>
|
||||
<field eval="[(6, 0, [ref('phase_type_concept'),ref('phase_type_development'),ref('phase_type_validation')])]" name="phase_type_ids"/>
|
||||
</record>
|
||||
<record model="document.change.process.model" id="model_minor_change">
|
||||
<field name="name">Minor_change</field>
|
||||
<field eval="[(6, 0, [ref('phase_type_development')])]" name="phase_type_ids"/>
|
||||
</record>
|
||||
|
||||
<!-- Process Types -->
|
||||
<record model="document.change.process.type" id="process_quality_alert">
|
||||
<field name="name">Quality Alert</field>
|
||||
</record>
|
||||
<record model="document.change.process.type" id="process_new_product">
|
||||
<field name="name">New Product</field>
|
||||
</record>
|
||||
<record model="document.change.process.type" id="process_red_risk">
|
||||
<field name="name">Red Risk</field>
|
||||
</record>
|
||||
<record model="document.change.process.type" id="process_ci_card">
|
||||
<field name="name">CI Card</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -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 time
|
||||
import re
|
||||
import os
|
||||
|
||||
import mx.DateTime
|
||||
import base64
|
||||
|
||||
from tools.translate import _
|
||||
|
||||
import tools
|
||||
from osv import fields,osv,orm
|
||||
from osv.orm import except_orm
|
||||
|
||||
class document_file(osv.osv):
|
||||
_inherit = "ir.attachment"
|
||||
|
||||
_columns = {
|
||||
'email_notification_ids':fields.one2many('document.email.notes','document_id','Phase', readonly=True),
|
||||
}
|
||||
|
||||
def msg_new(self, cr, uid, msg):
|
||||
raise Exception(_('Sorry, Not Allowed to create document'))
|
||||
return False
|
||||
|
||||
def msg_update(self, cr, uid, id, msg, data={}, default_act='pending'):
|
||||
mailgate_obj = self.pool.get('mail.gateway')
|
||||
msg_actions, body_data = mailgate_obj.msg_act_get(msg)
|
||||
email_notify_data = {
|
||||
'name' : msg['Subject'],
|
||||
'description' : body_data,
|
||||
'email' : msg['From'],
|
||||
}
|
||||
data.update({
|
||||
'email_notification_ids': [(0, 0, email_notify_data)],
|
||||
})
|
||||
res = self.write(cr, uid, [id], data)
|
||||
return res
|
||||
|
||||
def emails_get(self, cr, uid, ids, context={}):
|
||||
res = []
|
||||
if isinstance(ids, (str, int, long)):
|
||||
select = [ids]
|
||||
else:
|
||||
select = ids
|
||||
for document in self.browse(cr, uid, select):
|
||||
user_email = (document.user_id and document.user_id.address_id and document.user_id.address_id.email) or False
|
||||
res += [(user_email, False, False, False)]
|
||||
if isinstance(ids, (str, int, long)):
|
||||
return len(res) and res[0] or False
|
||||
return res
|
||||
|
||||
def msg_send(self, cr, uid, id, *args, **argv):
|
||||
return True
|
||||
|
||||
document_file()
|
||||
|
||||
|
||||
class document_email_notes(osv.osv):
|
||||
_name = "document.email.notes"
|
||||
_description = "EMail Conversation Detail"
|
||||
|
||||
def _note_get(self, cursor, user, ids, name, arg, context=None):
|
||||
res = {}
|
||||
for hist in self.browse(cursor, user, ids, context or {}):
|
||||
res[hist.id] = (hist.email or '/') + ' (' + str(hist.create_date) + ')\n'
|
||||
res[hist.id] += (hist.description or '')
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'name': fields.char("Name", size=64, required=True, select=True),
|
||||
'description': fields.text('Description'),
|
||||
'note': fields.function(_note_get, method=True, string="Description", type="text"),
|
||||
'email': fields.char('Email', size=84),
|
||||
'create_date': fields.datetime('Created Date'),
|
||||
'action': fields.char('Action', size=64),
|
||||
'document_id': fields.many2one('ir.attachment','Document', required=True),
|
||||
}
|
||||
document_email_notes()
|
||||
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="seq_type_document_change_process" model="ir.sequence.type">
|
||||
<field name="name">Document Change Process</field>
|
||||
<field name="code">document.change.process</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.sequence" id="seq_document_change_process">
|
||||
<field name="name">Document Change Process</field>
|
||||
<field name="code">document.change.process</field>
|
||||
<field name="prefix">PC</field>
|
||||
<field name="padding">5</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -1,651 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<menuitem
|
||||
name="Process Changes"
|
||||
icon="terp-stock"
|
||||
id="menu_process_changes"/>
|
||||
<menuitem
|
||||
name="Process Changes"
|
||||
id="menu_document_process_changes"
|
||||
parent="menu_process_changes"
|
||||
sequence="1"/>
|
||||
<menuitem
|
||||
id="menu_documents"
|
||||
name="Documents"
|
||||
sequence="3"
|
||||
parent="menu_process_changes"/>
|
||||
<menuitem name="Change Control" id="menu_change_control" parent="menu_process_changes" sequence="5"/>
|
||||
<menuitem name="Reporting" id="menu_reporting" parent="menu_process_changes" sequence="10"/>
|
||||
<menuitem name="Configuration" id="menu_configuration" parent="menu_process_changes" sequence="15"/>
|
||||
|
||||
<record model="ir.ui.view" id="view_document_structure_form">
|
||||
<field name="name">document.directory</field>
|
||||
<field name="model">document.directory</field>
|
||||
<field name="type">form</field>
|
||||
<field name="priority">1</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Structure">
|
||||
<field name="parent_id" string="Work Station" select="1"/>
|
||||
<field name="name" string="Family" select="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_document_structure_tree">
|
||||
<field name="name">document.directory</field>
|
||||
<field name="model">document.directory</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Structure">
|
||||
<field name="parent_id" string="Work Station"/>
|
||||
<field name="name" string="Family"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_document_structure_form">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">document.directory</field>
|
||||
<field name="name">Directory Structure</field>
|
||||
<field name="view_type">tree</field>
|
||||
<field name="domain">[('parent_id','=',False)]</field>
|
||||
<field name="view_id" eval="False"/>
|
||||
</record>
|
||||
<menuitem name="Structure" id="menu_document_structure_config" parent="menu_configuration"/>
|
||||
|
||||
<menuitem action="action_document_structure_form" id="menu_structure_form" parent="menu_document_structure_config"/>
|
||||
|
||||
<act_window domain="[('structure_id', '=', active_id)]"
|
||||
id="act_structure_process_changes"
|
||||
name="Process Changes"
|
||||
res_model="document.change.process"
|
||||
src_model="document.directory"/>
|
||||
|
||||
<!--
|
||||
Document Types
|
||||
-->
|
||||
<record model="ir.ui.view" id="view_document_type_form">
|
||||
<field name="name">document.change.type.form</field>
|
||||
<field name="model">document.change.type</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Document Types">
|
||||
<field name="name" select="1"/>
|
||||
<newline/>
|
||||
<field name="directory_id"/>
|
||||
<field name ="template_document_id"/>
|
||||
<separator string="Associated Phase Types" colspan="4"/>
|
||||
<field name="phase_type_ids" colspan="4" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_document_type_tree">
|
||||
<field name="name">document.change.type.tree</field>
|
||||
<field name="model">document.change.type</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Document Types">
|
||||
<field name="name"/>
|
||||
<field name ="template_document_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_document_type_form">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">document.change.type</field>
|
||||
<field name="name">Document Types</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<menuitem
|
||||
name="Documents"
|
||||
id="menu_document_type_config"
|
||||
parent="menu_configuration"/>
|
||||
|
||||
<menuitem
|
||||
action="action_document_type_form"
|
||||
id="menu_document_type_form"
|
||||
parent="menu_document_type_config"/>
|
||||
|
||||
<record model="ir.ui.view" id="view_process_phase_type_form">
|
||||
<field name="name">document.change.process.phase.type.form</field>
|
||||
<field name="model">document.change.process.phase.type</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Phase Types">
|
||||
<group colspan="4" col="6">
|
||||
<field name="name" select="1" string="Phase Type"/>
|
||||
<field name="sequence"/>
|
||||
<field name="active"/>
|
||||
</group>
|
||||
<separator string="Associated Document Types" colspan="4"/>
|
||||
<field name="document_type_ids" colspan="4" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_process_phase_type_tree">
|
||||
<field name="name">document.change.process.phase.type.tree</field>
|
||||
<field name="model">document.change.process.phase.type</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Phase Types">
|
||||
<field name="sequence" invisible="1"/>
|
||||
<field name="name" string="Phase Type"/>
|
||||
<field name="document_type_ids"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_process_phase_type_form">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">document.change.process.phase.type</field>
|
||||
<field name="name">Types of Phases</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Process Changes"
|
||||
id="menu_process_changes_config"
|
||||
parent="menu_configuration"
|
||||
sequence="1"/>
|
||||
<menuitem
|
||||
action="action_process_phase_type_form"
|
||||
id="menu_phase_type_form"
|
||||
parent="menu_process_changes_config"
|
||||
sequence="4"/>
|
||||
|
||||
<!-- Document Change Process Type -->
|
||||
<record model="ir.ui.view" id="view_change_process_type_form">
|
||||
<field name="name">document.change.process.type.form</field>
|
||||
<field name="model">document.change.process.type</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Phase Types">
|
||||
<field name="name" select="1" string="Phase Type"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_change_processe_type_tree">
|
||||
<field name="name">document.change.process.type.tree</field>
|
||||
<field name="model">document.change.process.type</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Phase Types">
|
||||
<field name="name" string="Phase Type"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_change_process_type_form">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">document.change.process.type</field>
|
||||
<field name="name">Process Type</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_change_process_type_form" id="menu_change_process_type_form" parent="menu_process_changes_config"/>
|
||||
|
||||
<!--
|
||||
Model of Changes
|
||||
-->
|
||||
<record model="ir.ui.view" id="view_model_change_form">
|
||||
<field name="name">document.change.process.model.form</field>
|
||||
<field name="model">document.change.process.model</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Model of Changes">
|
||||
<field name="name" select="1"/>
|
||||
<field name="sequence"/>
|
||||
<separator string="Phase Type" colspan="4"/>
|
||||
<field name="phase_type_ids" colspan="4" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_model_change_tree">
|
||||
<field name="name">document.change.process.model.tree</field>
|
||||
<field name="model">document.change.process.model</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Model of Changes">
|
||||
<field name="sequence" invisible="1"/>
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_model_change_form">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">document.change.process.model</field>
|
||||
<field name="name">Model of Process</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<menuitem action="action_model_change_form" id="menu_model_change_form" parent="menu_process_changes_config"/>
|
||||
|
||||
<!--
|
||||
Documents
|
||||
-->
|
||||
<record model="ir.ui.view" id="view_document_form">
|
||||
<field name="name">ir.attachment.form</field>
|
||||
<field name="model">ir.attachment</field>
|
||||
<field name="priority" eval="-1"/>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Documents">
|
||||
<field name="name" select="1"/>
|
||||
<field name="parent_id" select="1"/>
|
||||
<field name="datas" filename="datas_fname" string="Content"/>
|
||||
<field name="change_type_id" widget="selection"/>
|
||||
<field name="datas_fname"/>
|
||||
<field name="style"/>
|
||||
<notebook colspan="4">
|
||||
<page string="Information">
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Creation" colspan="2"/>
|
||||
<field name="create_uid" readonly="1"/>
|
||||
<field name="create_date" readonly="1"/>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Latest Modification" colspan="2"/>
|
||||
<field name="write_uid" readonly="1"/>
|
||||
<field name="write_date" readonly="1"/>
|
||||
</group>
|
||||
</page><page string="Change Request">
|
||||
<separator string="Change Control" colspan="4"/>
|
||||
<group col="7" colspan="4">
|
||||
<field name="state" readonly="1"/>
|
||||
<button name="button_propose" states="change_request" string="Propose Change" icon="gtk-apply"/>
|
||||
<button name="button_confirm" states="change_propose" string="To Validate" icon="gtk-apply"/>
|
||||
<button name="button_validate" states="to_update" string="In Production" icon="gtk-apply"/>
|
||||
<button name="button_request" states="cancel,in_production" string="Request Change" icon="gtk-media-play"/>
|
||||
<button name="button_cancel" states="change_request,change_propose" string="Cancel" icon="gtk-cancel"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<field name="target_document_id"/>
|
||||
<field name="target"/>
|
||||
<newline/>
|
||||
<separator string="Change Note" colspan="4"/>
|
||||
<field colspan="4" name="description" nolabel="1"/>
|
||||
</page><page string="Email Notifications">
|
||||
<field name="email_notification_ids" colspan="4" mode="tree, form" readonly="1" widget="one2many_list" nolabel="1">
|
||||
<tree string="Notifications">
|
||||
<field name="email"/>
|
||||
<field name="create_date"/>
|
||||
</tree>
|
||||
<form string="Notifications">
|
||||
<field name="email"/>
|
||||
<field name="create_date"/>
|
||||
<field name="name" string="Subject" colspan="4"/>
|
||||
<separator string="Description" colspan="4"/>
|
||||
<field colspan="4" name="description" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_document_tree">
|
||||
<field name="name">ir.attachment.tree</field>
|
||||
<field name="model">ir.attachment</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="priority" eval="-1"/>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Documents">
|
||||
<field name="name" string="Document"/>
|
||||
<field name="parent_id" string="Directory"/>
|
||||
<field name="change_type_id"/>
|
||||
<field name="style"/>
|
||||
<field name="state"/>
|
||||
<field name="change_process_id"/>
|
||||
<field name="user_id" string="Owner"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_document_graph">
|
||||
<field name="name">ir.attachment.graph</field>
|
||||
<field name="model">ir.attachment</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Documents by type" type="bar" orientation="vertical">
|
||||
<field name="change_type_id"/>
|
||||
<field name="name" operator="+"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_document_search">
|
||||
<field name="name">ir.attachment.search</field>
|
||||
<field name="model">ir.attachment</field>
|
||||
<field name="type">search</field>
|
||||
<field name="priority" eval="1"/>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Documents">
|
||||
<group col="13" colspan="4">
|
||||
<filter domain="[('state','=','in_production')]" string="In Production" icon="gtk-apply"/>
|
||||
<filter domain="[('state','=','change_request')]" string="Change Req." icon="gtk-apply"/>
|
||||
<filter domain="[('state','=','change_propose')]" string="Change Proposed" icon="gtk-execute"/>
|
||||
<filter domain="[('state','=','to_update')]" string="To Update" icon="gtk-execute"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="change_type_id" widget="selection"/>
|
||||
<field name="parent_id"/>
|
||||
<field name="create_uid"/>
|
||||
</group>
|
||||
<group expand="1" string="Group By..." col="20" colspan="4">
|
||||
<filter domain="[]" string="By Owner" icon="terp-hr" context="{'group_by':'create_uid'}" help="Documents by owner"/>
|
||||
<filter domain="[]" string="By Directory" icon="terp-hr" context="{'group_by':'parent_id'}" help="Documents by directory"/>
|
||||
<filter domain="[]" string="By Type" icon="terp-hr" context="{'group_by':'change_type_id'}" help="Documents by type"/>
|
||||
<filter domain="[]" string="By State" icon="terp-hr" context="{'group_by':'state'}" help="Documents by type"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="action_document_form">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">ir.attachment</field>
|
||||
<field name="name">Search a Document</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,graph</field>
|
||||
<field name="search_view_id" ref="view_document_search"/>
|
||||
</record>
|
||||
<record id="action_document_tree_view" model="ir.actions.act_window.view">
|
||||
<field eval="1" name="sequence"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="view_document_tree"/>
|
||||
<field name="act_window_id" ref="action_document_form"/>
|
||||
</record>
|
||||
<record id="action_document_form_view" model="ir.actions.act_window.view">
|
||||
<field eval="2" name="sequence"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_document_form"/>
|
||||
<field name="act_window_id" ref="action_document_form"/>
|
||||
</record>
|
||||
<record id="action_document_graph_view" model="ir.actions.act_window.view">
|
||||
<field eval="3" name="sequence"/>
|
||||
<field name="view_mode">graph</field>
|
||||
<field name="view_id" ref="view_document_graph"/>
|
||||
<field name="act_window_id" ref="action_document_form"/>
|
||||
</record>
|
||||
<menuitem
|
||||
action="action_document_form"
|
||||
id="menu_documents_form"
|
||||
parent="menu_documents"
|
||||
sequence="20"/>
|
||||
<menuitem
|
||||
name="Documents by Directories"
|
||||
action="document.action_document_directory_form"
|
||||
sequence="1"
|
||||
id="menu_document_directories"
|
||||
parent="menu_documents"/>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_document_without_type_form">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">ir.attachment</field>
|
||||
<field name="name">Documents Without Type</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('change_type_id','=',False)]</field>
|
||||
</record>
|
||||
<menuitem action="action_document_without_type_form" id="menu_documents_without_type_form" parent="menu_change_control"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_document_to_update_form">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">ir.attachment</field>
|
||||
<field name="name">Documents to Update</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('state','=','to_update')]</field>
|
||||
</record>
|
||||
<menuitem action="action_document_to_update_form" id="menu_documents_to_update_form" parent="menu_change_control"/>
|
||||
|
||||
<!--
|
||||
Phases
|
||||
-->
|
||||
<record model="ir.ui.view" id="view_process_phase_form">
|
||||
<field name="name">document.change.process.phase.form</field>
|
||||
<field name="model">document.change.process.phase</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Phases">
|
||||
<group colspan="4" col="6">
|
||||
<field name="name" select="1"/>
|
||||
<field name="process_id" string="Process Change"/>
|
||||
<field name="sequence"/>
|
||||
<newline/>
|
||||
<field name="update_document" string="Update documents"/>
|
||||
<field name="type" string="Type"/>
|
||||
<field name="date_control" attrs="{'required':[('type','=','control_required')], 'invisible': [('type','!=','control_required')]}"/>
|
||||
<field name="phase_type_id" string="Phase Type"/>
|
||||
</group>
|
||||
<separator colspan="4" string="Documents"/>
|
||||
<field name="phase_document_ids" colspan="4" nolabel="1"/>
|
||||
<newline/>
|
||||
<group col="5" colspan="4">
|
||||
<field name="state"/>
|
||||
<button name="button_start" states="draft" string="Start" icon="gtk-go-forward"/>
|
||||
<button name="button_confirm" states="in_process" string="To Validate" icon="gtk-execute"/>
|
||||
<button name="button_end" states="to_validate" string="Done" icon="gtk-jump-to"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_process_phase_tree">
|
||||
<field name="name">document.change.process.phase.tree</field>
|
||||
<field name="model">document.change.process.phase</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Phases">
|
||||
<field name="sequence" invisible="1"/>
|
||||
<field name="process_id"/>
|
||||
<field name="name"/>
|
||||
<field name="phase_type_id"/>
|
||||
<field name="state"/>
|
||||
<button name="button_start" states="draft" string="Start" icon="gtk-go-forward"/>
|
||||
<button name="button_confirm" states="in_process" string="To Validate" icon="gtk-execute"/>
|
||||
<button name="button_end" states="to_validate" string="Done" icon="gtk-jump-to"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_process_phase_form">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">document.change.process.phase</field>
|
||||
<field name="name">Phases</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<menuitem action="action_process_phase_form" id="menu_phases_form" parent="menu_document_process_changes"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_process_phase_form_validate">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">document.change.process.phase</field>
|
||||
<field name="name">Phases to Validate</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('state','=','to_validate')]</field>
|
||||
</record>
|
||||
<menuitem action="action_process_phase_form_validate" id="menu_phases_to_validate_form" parent="menu_change_control"/>
|
||||
|
||||
<act_window domain="[('process_phase_id', '=', active_id)]"
|
||||
id="act_documents_phases"
|
||||
name="Documents"
|
||||
res_model="ir.attachment"
|
||||
src_model="document.change.process.phase"/>
|
||||
|
||||
<!--
|
||||
Process Change
|
||||
-->
|
||||
<record model="ir.ui.view" id="view_process_form">
|
||||
<field name="name">document.change.process.form</field>
|
||||
<field name="model">document.change.process</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Process Change">
|
||||
<group colspan="4" col="8">
|
||||
<field name="description" colspan="4"/>
|
||||
<field name="process_type_id" widget="selection"/>
|
||||
<field name="name" readonly="1"/>
|
||||
<newline/>
|
||||
<!-- Big Hack For Demo Purpose Caterpillar -->
|
||||
<field name="structure_id" colspan="4" domain="[('name','ilike','fam')]"/>
|
||||
<field name="process_model_id" widget="selection"/>
|
||||
<button name="generate_phases"
|
||||
string="Generate Phases" type="object"
|
||||
icon="gtk-convert" colspan="2"/>
|
||||
</group>
|
||||
|
||||
<notebook colspan="4">
|
||||
<page string="Process Definition">
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Responsibles" colspan="2"/>
|
||||
<field name="user_id"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Dates" colspan="2"/>
|
||||
<field name="create_date"/>
|
||||
<field name="latest_modified_date"/>
|
||||
<field name="date_expected"/>
|
||||
</group>
|
||||
<newline />
|
||||
<separator colspan="4" string="Change Description"/>
|
||||
<field name="change_description" colspan="4" nolabel="1"/>
|
||||
<newline/>
|
||||
<group col="6" colspan="4">
|
||||
<field name="state"/>
|
||||
<button name="button_start" states="draft,pending" string="Start" icon="gtk-go-forward"/>
|
||||
<button name="button_confirm" states="in_progress" string="Validate" icon="gtk-execute"/>
|
||||
<button name="button_pending" states="in_progress" string="Pending" icon="gtk-media-pause"/>
|
||||
<button name="button_done" states="to_validate" string="Done" icon="gtk-jump-to"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Phases">
|
||||
<field name="process_phase_ids" mode="tree,form" widget="one2many_list" nolabel="1">
|
||||
<tree string="Process Phases" editable="True">
|
||||
<field name="sequence" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="phase_document_ids"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
<form string="Process Phases">
|
||||
<field name="name"/>
|
||||
<field name="sequence"/>
|
||||
<field name="type"/>
|
||||
<field name="phase_document_ids" colspan="4"/>
|
||||
<field name="state"/>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_process_tree">
|
||||
<field name="name">document.change.process.tree</field>
|
||||
<field name="model">document.change.process</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Process Change">
|
||||
<field name="name"/>
|
||||
<field name="structure_id"/>
|
||||
<field name="user_id"/>
|
||||
<field name="current_phase_id"/>
|
||||
<field name="date_control"/>
|
||||
<field name="process_model_id"/>
|
||||
<field name="progress" widget="progressbar"/>
|
||||
<field name="process_document_ids" string="# Documents"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_process_graph">
|
||||
<field name="name">document.change.process.graph</field>
|
||||
<field name="model">document.change.process</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Process changes by month" type="bar" orientation="vertical">
|
||||
<field name="create_date"/>
|
||||
<field name="process_document_ids" operator="+"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_process_serach">
|
||||
<field name="name">document.change.process.search</field>
|
||||
<field name="model">document.change.process</field>
|
||||
<field name="type">search</field>
|
||||
<field name="priority" eval="1"/>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Process Changes">
|
||||
<group col="14" colspan="4">
|
||||
<filter domain="[('user_id','=',uid)]" string="My Process" icon="gtk-execute" help="My Process Changes"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter domain="[('state','in',('in_progress','draft','to_validate'))]"
|
||||
string="In Progress" icon="gtk-execute"
|
||||
default="1"
|
||||
help="Process changes having the next Phase to validate that is late"/>
|
||||
<filter domain="[('state','=','to_validate')]"
|
||||
string="To Validate"
|
||||
icon="gtk-apply"
|
||||
help="Process Changes to be validated"/>
|
||||
<filter domain="[('state','=','pending')]"
|
||||
string="Pending" icon="gtk-execute"
|
||||
help="Process changes having the next Phase to validate that is late"/>
|
||||
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" string="Process Change Title" select="1"/>
|
||||
<field name="process_type_id" select="1"/>
|
||||
<field name="structure_id" select="1"/>
|
||||
<field name="user_id" string="Owner" select="1"/>
|
||||
</group>
|
||||
<group expand="1" string="Group By..." col="20" colspan="4">
|
||||
<filter domain="[]" string="By Owner" icon="terp-hr" context="{'group_by':'user_id'}" help="Process Changes by owner"/>
|
||||
<filter domain="[]" string="By Directory" icon="terp-hr" context="{'group_by':'structure_id'}" help="Process Changes by directory"/>
|
||||
<filter domain="[]" string="By State" icon="terp-hr" context="{'group_by':'state'}" help="Process Changes by directory"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_process_form">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">document.change.process</field>
|
||||
<field name="name">Process Changes</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,graph</field>
|
||||
<field name="search_view_id" ref="view_process_serach"/>
|
||||
</record>
|
||||
<menuitem action="action_process_form" id="menu_process_changes_form" parent="menu_document_process_changes"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_process_change_form_validate">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">document.change.process</field>
|
||||
<field name="name">Process Changes to Validate</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('state','=','to_validate')]</field>
|
||||
</record>
|
||||
<menuitem action="action_process_change_form_validate" id="menu_process_to_validate_form" parent="menu_change_control"/>
|
||||
|
||||
<act_window domain="[('process_id', '=', active_id)]"
|
||||
id="act_phase_change_process"
|
||||
name="Phases"
|
||||
res_model="document.change.process.phase"
|
||||
src_model="document.change.process"/>
|
||||
|
||||
<act_window domain="[('change_process_id', '=', active_id)]"
|
||||
id="act_documents_change_process"
|
||||
name="Documents"
|
||||
res_model="ir.attachment"
|
||||
src_model="document.change.process"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,82 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="wkf_attachment" model="workflow">
|
||||
<field name="name">ir.attachment.basic</field>
|
||||
<field name="osv">ir.attachment</field>
|
||||
<field name="on_create">True</field>
|
||||
</record>
|
||||
|
||||
<!-- States -->
|
||||
<record id="act_document_production" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_attachment"/>
|
||||
<field name="flow_start">True</field>
|
||||
<field name="name">in_production</field>
|
||||
<field name="action">do_production()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
<record id="act_document_request" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_attachment"/>
|
||||
<field name="name">change_request</field>
|
||||
<field name="action">do_change_request()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
<record id="act_document_propose" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_attachment"/>
|
||||
<field name="name">change_propose</field>
|
||||
<field name="action">do_change_propose()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
<record id="act_document_confirm" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_attachment"/>
|
||||
<field name="name">to_update</field>
|
||||
<field name="action">do_to_update()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
<record id="act_document_cancel" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_attachment"/>
|
||||
<field name="name">cancel</field>
|
||||
<field name="action">do_cancel()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
|
||||
<!-- Transitions -->
|
||||
<record id="tran_document_production_to_request" model="workflow.transition">
|
||||
<field name="act_from" ref="act_document_production"/>
|
||||
<field name="act_to" ref="act_document_request"/>
|
||||
<field name="signal">button_request</field>
|
||||
</record>
|
||||
<record id="tran_document_request_to_propose" model="workflow.transition">
|
||||
<field name="act_from" ref="act_document_request"/>
|
||||
<field name="act_to" ref="act_document_propose"/>
|
||||
<field name="condition">test_change_request()</field>
|
||||
<field name="signal">button_propose</field>
|
||||
|
||||
</record>
|
||||
<record id="tran_document_request_to_cancel" model="workflow.transition">
|
||||
<field name="act_from" ref="act_document_request"/>
|
||||
<field name="act_to" ref="act_document_cancel"/>
|
||||
<field name="signal">button_cancel</field>
|
||||
</record>
|
||||
<record id="tran_document_propose_to_confirm" model="workflow.transition">
|
||||
<field name="act_from" ref="act_document_propose"/>
|
||||
<field name="act_to" ref="act_document_confirm"/>
|
||||
<field name="signal">button_confirm</field>
|
||||
</record>
|
||||
<record id="tran_document_propose_to_cancel" model="workflow.transition">
|
||||
<field name="act_from" ref="act_document_propose"/>
|
||||
<field name="act_to" ref="act_document_cancel"/>
|
||||
<field name="signal">button_cancel</field>
|
||||
</record>
|
||||
<record id="tran_document_cancel_to_request" model="workflow.transition">
|
||||
<field name="act_from" ref="act_document_cancel"/>
|
||||
<field name="act_to" ref="act_document_request"/>
|
||||
<field name="signal">button_request</field>
|
||||
</record>
|
||||
<record id="tran_document_confirm_to_production" model="workflow.transition">
|
||||
<field name="act_from" ref="act_document_confirm"/>
|
||||
<field name="act_to" ref="act_document_production"/>
|
||||
<field name="signal">button_validate</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,62 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="wkf_change_process_phase" model="workflow">
|
||||
<field name="name">document.change.process.phase.basic</field>
|
||||
<field name="osv">document.change.process.phase</field>
|
||||
<field name="on_create">True</field>
|
||||
</record>
|
||||
|
||||
<!-- States -->
|
||||
<record id="act_phase_draft" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_change_process_phase"/>
|
||||
<field name="flow_start">True</field>
|
||||
<field name="name">draft</field>
|
||||
</record>
|
||||
<record id="act_phase_start" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_change_process_phase"/>
|
||||
<field name="name">in_process</field>
|
||||
<field name="action">do_start()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
<record id="act_phase_confirm" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_change_process_phase"/>
|
||||
<field name="name">to_validate</field>
|
||||
<field name="action">do_confirm()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
<record id="act_phase_end" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_change_process_phase"/>
|
||||
<field name="name">done</field>
|
||||
<field name="action">do_done()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
|
||||
<!-- Transitions -->
|
||||
<record id="tran_phase_draft_to_start" model="workflow.transition">
|
||||
<field name="act_from" ref="act_phase_draft"/>
|
||||
<field name="act_to" ref="act_phase_start"/>
|
||||
<field name="signal">button_start</field>
|
||||
</record>
|
||||
<record id="tran_phase_start_to_confirm_control" model="workflow.transition">
|
||||
<field name="act_from" ref="act_phase_start"/>
|
||||
<field name="act_to" ref="act_phase_confirm"/>
|
||||
<field name="role_id" ref="role_NPPI" />
|
||||
<field name="condition">test_control_request()</field>
|
||||
<field name="signal">button_confirm</field>
|
||||
</record>
|
||||
<record id="tran_phase_start_to_confirm_not_control" model="workflow.transition">
|
||||
<field name="act_from" ref="act_phase_start"/>
|
||||
<field name="act_to" ref="act_phase_confirm"/>
|
||||
<field name="condition">test_nocontrol_request()</field>
|
||||
<field name="signal">button_confirm</field>
|
||||
</record>
|
||||
|
||||
<record id="tran_phase_confirm_to_end" model="workflow.transition">
|
||||
<field name="act_from" ref="act_phase_confirm"/>
|
||||
<field name="act_to" ref="act_phase_end"/>
|
||||
<field name="role_id" ref="role_NPPI" />
|
||||
<field name="signal">button_end</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,68 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="wkf_change_process" model="workflow">
|
||||
<field name="name">document.change.process.basic</field>
|
||||
<field name="osv">document.change.process</field>
|
||||
<field name="on_create">True</field>
|
||||
</record>
|
||||
|
||||
<!-- States -->
|
||||
<record id="act_process_draft" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_change_process"/>
|
||||
<field name="flow_start">True</field>
|
||||
<field name="name">draft</field>
|
||||
</record>
|
||||
<record id="act_process_in_progress" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_change_process"/>
|
||||
<field name="name">in_progress</field>
|
||||
<field name="action">do_start()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
<record id="act_process_pending" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_change_process"/>
|
||||
<field name="name">pending</field>
|
||||
<field name="action">do_pending()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
<record id="act_process_confirm" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_change_process"/>
|
||||
<field name="name">to_validate</field>
|
||||
<field name="action">do_confirm()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
<record id="act_process_done" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_change_process"/>
|
||||
<field name="name">done</field>
|
||||
<field name="action">do_done()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
|
||||
<!-- Transitions -->
|
||||
<record id="tran_process_draft_to_progress" model="workflow.transition">
|
||||
<field name="act_from" ref="act_process_draft"/>
|
||||
<field name="act_to" ref="act_process_in_progress"/>
|
||||
<field name="signal">button_start</field>
|
||||
</record>
|
||||
<record id="tran_process_progress_to_pending" model="workflow.transition">
|
||||
<field name="act_from" ref="act_process_in_progress"/>
|
||||
<field name="act_to" ref="act_process_pending"/>
|
||||
<field name="signal">button_pending</field>
|
||||
</record>
|
||||
<record id="tran_process_pending_to_progress" model="workflow.transition">
|
||||
<field name="act_from" ref="act_process_pending"/>
|
||||
<field name="act_to" ref="act_process_in_progress"/>
|
||||
<field name="signal">button_start</field>
|
||||
</record>
|
||||
<record id="tran_process_progress_to_confirm" model="workflow.transition">
|
||||
<field name="act_from" ref="act_process_in_progress"/>
|
||||
<field name="act_to" ref="act_process_confirm"/>
|
||||
<field name="signal">button_confirm</field>
|
||||
</record>
|
||||
<record id="tran_process_confirm_to_end" model="workflow.transition">
|
||||
<field name="act_from" ref="act_process_confirm"/>
|
||||
<field name="act_to" ref="act_process_done"/>
|
||||
<field name="signal">button_done</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="0">
|
||||
<record model="res.roles" id="role_NPPI">
|
||||
<field name="name">Document Change/ Phase Manager</field>
|
||||
</record>
|
||||
</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