[MERGE] merged with trunk-development-branch

bzr revid: hmo@tinyerp.com-20111214090813-wovai3ttsawuup6t
This commit is contained in:
Harry (OpenERP)
2011-12-14 14:38:13 +05:30
95 changed files with 931 additions and 1220 deletions
+1 -1
View File
@@ -25,7 +25,7 @@
</xpath>
<group colspan="8" position="inside">
<group colspan="4" width="600">
<field name="charts"/>
<field name="charts"/>
<group colspan="4" groups="account.group_account_user">
<separator col="4" colspan="4" string="Configure Fiscal Year"/>
<field name="has_default_company" invisible="1" />
+3
View File
@@ -2487,6 +2487,9 @@
<field eval="5" name="sequence"/>
<field name="code">
act_window_ids = pool.get('ir.actions.act_window').search(cr, uid,[('name', 'in', ('Accounting Chart Configuration', 'Generate Chart of Accounts from a Chart Template'))], context=context)
ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'action_account_configuration_installer')
if ref:
act_window_ids += [ref[1]]
todo_ids = pool.get('ir.actions.todo').search(cr, uid, [('action_id', 'in', act_window_ids)], context=context)
pool.get('ir.actions.todo').write(cr, uid, todo_ids, {'state':'open'}, context=context)
action = pool.get('res.config').next(cr, uid, [], context)
+6
View File
@@ -24,6 +24,7 @@ import time
import datetime
from dateutil.relativedelta import relativedelta
from operator import itemgetter
from os.path import join as opj
from tools.translate import _
from osv import fields, osv
@@ -111,6 +112,11 @@ class account_installer(osv.osv_memory):
context = {}
fy_obj = self.pool.get('account.fiscalyear')
for res in self.read(cr, uid, ids, context=context):
if 'charts' in res and res['charts'] == 'configurable':
#load generic chart of account
fp = tools.file_open(opj('account', 'configurable_account_chart.xml'))
tools.convert_xml_import(cr, 'account', fp, {}, 'init', True, None)
fp.close()
if 'date_start' in res and 'date_stop' in res:
f_ids = fy_obj.search(cr, uid, [('date_start', '<=', res['date_start']), ('date_stop', '>=', res['date_stop']), ('company_id', '=', res['company_id'][0])], context=context)
if not f_ids:
+6 -3
View File
@@ -2,14 +2,17 @@
<openerp><data>
<record id="group_account_invoice" model="res.groups">
<field name="name">Accounting / Invoicing &amp; Payments</field>
<field name="name">Invoicing &amp; Payments</field>
<field name="category_id" ref="base.module_category_accounting_and_finance"/>
</record>
<record id="group_account_user" model="res.groups" context="{'noadmin':True}">
<field name="name">Accounting / Accountant</field>
<field name="name">Accountant</field>
<field name="category_id" ref="base.module_category_accounting_and_finance"/>
<field name="implied_ids" eval="[(4, ref('group_account_invoice'))]"/>
</record>
<record id="group_account_manager" model="res.groups" context="{'noadmin':True}">
<field name="name">Accounting / Manager</field>
<field name="name">Manager</field>
<field name="category_id" ref="base.module_category_accounting_and_finance"/>
<field name="implied_ids" eval="[(4, ref('group_account_user'))]"/>
</record>
+63 -53
View File
@@ -8,19 +8,19 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2010-12-23 15:17+0000\n"
"Last-Translator: Olivier Dony (OpenERP) <Unknown>\n"
"PO-Revision-Date: 2011-12-13 15:21+0000\n"
"Last-Translator: Milan Milosevic <Unknown>\n"
"Language-Team: Serbian latin <sr@latin@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: 2011-11-05 05:22+0000\n"
"X-Generator: Launchpad (build 14231)\n"
"X-Launchpad-Export-Date: 2011-12-14 04:45+0000\n"
"X-Generator: Launchpad (build 14487)\n"
#. module: account_payment
#: field:payment.order,date_scheduled:0
msgid "Scheduled date if fixed"
msgstr "Zakazani datum ako je fiskno"
msgstr "Zakazani datum ako je fiksiran"
#. module: account_payment
#: field:payment.line,currency:0
@@ -30,7 +30,7 @@ msgstr "Valuta partnera"
#. module: account_payment
#: view:payment.order:0
msgid "Set to draft"
msgstr "Postavi za obradu"
msgstr "Postavi kao pripremu"
#. module: account_payment
#: help:payment.order,mode:0
@@ -41,7 +41,7 @@ msgstr "Odaberite način plaćanja koji će biti primenjen."
#: view:payment.mode:0
#: view:payment.order:0
msgid "Group By..."
msgstr "Grupirano po"
msgstr "Grupiši po..."
#. module: account_payment
#: model:ir.module.module,description:account_payment.module_meta_information
@@ -52,6 +52,11 @@ msgid ""
"* a basic mechanism to easily plug various automated payment.\n"
" "
msgstr ""
"\n"
"Ovaj modul omogućava:\n"
"*efikasniji način za upravljanje isplaćivanja faktura\n"
"*osnovni mehanizam za lako obrađivanje automatizovanih načina isplate\n"
" "
#. module: account_payment
#: field:payment.order,line_ids:0
@@ -98,7 +103,7 @@ msgstr "Zeljeni Datum"
#. module: account_payment
#: selection:payment.line,state:0
msgid "Free"
msgstr "slobodno"
msgstr "Slobodno"
#. module: account_payment
#: field:payment.order.create,entries:0
@@ -108,18 +113,18 @@ msgstr "Stavke"
#. module: account_payment
#: report:payment.order:0
msgid "Used Account"
msgstr "Koristeni Nalog"
msgstr "Korišteni nalog"
#. module: account_payment
#: field:payment.line,ml_maturity_date:0
#: field:payment.order.create,duedate:0
msgid "Due Date"
msgstr "Datum dospeća"
msgstr "Krajnji rok"
#. module: account_payment
#: constraint:account.move.line:0
msgid "You can not create move line on closed account."
msgstr ""
msgstr "Ne možete da napravite poteznu liniju na zatvorenim računima."
#. module: account_payment
#: view:account.move.line:0
@@ -135,7 +140,7 @@ msgstr "_Dodaj u nalog za plaćanje"
#: model:ir.actions.act_window,name:account_payment.action_account_payment_populate_statement
#: model:ir.actions.act_window,name:account_payment.action_account_populate_statement_confirm
msgid "Payment Populate statement"
msgstr "Ispuna sadrzaja fakture"
msgstr "Ispunjavanje sadržaja fakture"
#. module: account_payment
#: report:payment.order:0
@@ -146,12 +151,12 @@ msgstr "Iznos"
#. module: account_payment
#: sql_constraint:account.move.line:0
msgid "Wrong credit or debit value in accounting entry !"
msgstr ""
msgstr "Pogrešna vrednost kredita ili debita u ulazu računa !"
#. module: account_payment
#: view:payment.order:0
msgid "Total in Company Currency"
msgstr "Ukupno u valuti preduzeca"
msgstr "Ukupno u valuti preduzeća"
#. module: account_payment
#: selection:payment.order,state:0
@@ -172,7 +177,7 @@ msgstr "Referenca"
#. module: account_payment
#: sql_constraint:payment.line:0
msgid "The payment line name must be unique!"
msgstr ""
msgstr "Red plaćanja mora biti jedinstven!"
#. module: account_payment
#: model:ir.actions.act_window,name:account_payment.action_payment_order_tree
@@ -212,7 +217,7 @@ msgstr "Efektivni datum fakture"
#. module: account_payment
#: report:payment.order:0
msgid "Execution Type"
msgstr "Tip Izuzetka"
msgstr "Tip Izvršavanja"
#. module: account_payment
#: selection:payment.line,state:0
@@ -229,7 +234,7 @@ msgstr "Stanje"
#: view:payment.line:0
#: view:payment.order:0
msgid "Transaction Information"
msgstr "Informacije Transakcije"
msgstr "Informacije o transakciji"
#. module: account_payment
#: model:ir.actions.act_window,name:account_payment.action_payment_mode_form
@@ -257,8 +262,8 @@ msgid ""
"by you.'Directly' stands for the direct execution.'Due date' stands for the "
"scheduled date of execution."
msgstr ""
"Odaberite opciju za nalog za plaćanje: \"Fiksno\" znači datum naveden od "
"vaše strane. \"Direktno\" znači direktno izvršenje. \"Datum odgode\" znači "
"Odaberite opciju za nalog za plaćanje: \"Fiksirano\" znači datum naveden s "
"Vaše strane. \"Direktno\" znači direktno izvršenje. \"Datum odgode\" znači "
"zakazan datum izvršenja."
#. module: account_payment
@@ -280,12 +285,12 @@ msgstr "Datum izvršenja"
#. module: account_payment
#: help:payment.mode,journal:0
msgid "Bank or Cash Journal for the Payment Mode"
msgstr ""
msgstr "Dnevnik banke ili keša za način plaćanja"
#. module: account_payment
#: selection:payment.order,date_prefered:0
msgid "Fixed date"
msgstr "Fiksni datum"
msgstr "Fiksirani datum"
#. module: account_payment
#: field:payment.line,info_partner:0
@@ -301,18 +306,19 @@ msgstr "Ciljni račun"
#. module: account_payment
#: view:payment.order:0
msgid "Search Payment Orders"
msgstr "Pretrazi naloge za placanje"
msgstr "Pretraži naloge za plaćanje"
#. module: account_payment
#: constraint:account.move.line:0
msgid ""
"You can not create move line on receivable/payable account without partner"
msgstr ""
"Ne možete napraviti poteznu liniju na primaćem/platežnom računu bez partnera"
#. module: account_payment
#: field:payment.line,create_date:0
msgid "Created"
msgstr "Kreirano"
msgstr "Napravljeno"
#. module: account_payment
#: view:payment.order:0
@@ -327,17 +333,17 @@ msgstr "Ukupni iznos valute"
#. module: account_payment
#: view:payment.order:0
msgid "Make Payments"
msgstr "Napravite plaćanja"
msgstr "Izvršite plaćanja"
#. module: account_payment
#: field:payment.line,state:0
msgid "Communication Type"
msgstr "Tip Komunikacije"
msgstr "Tip komunikacije"
#. module: account_payment
#: model:ir.module.module,shortdesc:account_payment.module_meta_information
msgid "Payment Management"
msgstr "Menadzment Plaćanja"
msgstr "Upravljanje plaćanjem"
#. module: account_payment
#: field:payment.line,bank_statement_line_id:0
@@ -347,7 +353,7 @@ msgstr "Red Izvoda iz Banke"
#. module: account_payment
#: selection:payment.order,date_prefered:0
msgid "Due date"
msgstr "Krajnji Rok"
msgstr "Krajnji rok"
#. module: account_payment
#: field:account.invoice,amount_to_pay:0
@@ -391,7 +397,7 @@ msgstr "Način plaćanja"
#. module: account_payment
#: report:payment.order:0
msgid "Value Date"
msgstr "Datum"
msgstr "Datum valute"
#. module: account_payment
#: report:payment.order:0
@@ -412,23 +418,23 @@ msgstr "Priprema"
#. module: account_payment
#: help:payment.line,communication2:0
msgid "The successor message of Communication."
msgstr "Nasljedna poruka komunikacije."
msgstr "Naredna poruka komunikacije."
#. module: account_payment
#: code:addons/account_payment/account_move_line.py:110
#, python-format
msgid "No partner defined on entry line"
msgstr "Partner nije definisan"
msgstr "Partner nije definisan na redu stavke"
#. module: account_payment
#: help:payment.line,info_partner:0
msgid "Address of the Ordering Customer."
msgstr "Adresa kupca naručitelja."
msgstr "Adresa naručitelja."
#. module: account_payment
#: view:account.payment.populate.statement:0
msgid "Populate Statement:"
msgstr "Popuni sadrzaj:"
msgstr "Popuni sadržaj:"
#. module: account_payment
#: view:account.move.line:0
@@ -438,7 +444,7 @@ msgstr "Ukupno potražuje"
#. module: account_payment
#: help:payment.order,date_scheduled:0
msgid "Select a date if you have chosen Preferred Date to be fixed."
msgstr "Odaberite datum ako ste odabrali fiksni željeni datum"
msgstr "Odaberite datum ako ste odabrali fiksirani željeni datum"
#. module: account_payment
#: field:payment.order,user_id:0
@@ -454,12 +460,12 @@ msgstr "Redovi plaćanja"
#. module: account_payment
#: model:ir.model,name:account_payment.model_account_move_line
msgid "Journal Items"
msgstr "Sadrzaj Dnevnika"
msgstr "Stavke dnevnika"
#. module: account_payment
#: constraint:account.move.line:0
msgid "Company must be same for its related account and period."
msgstr ""
msgstr "Preduzeće mora biti isto za sve vezane račune i periode."
#. module: account_payment
#: help:payment.line,move_line_id:0
@@ -492,12 +498,12 @@ msgstr "Ukupno:"
#. module: account_payment
#: field:payment.order,date_created:0
msgid "Creation date"
msgstr "Datum kreiranja"
msgstr "Datum pravljenja"
#. module: account_payment
#: view:account.payment.populate.statement:0
msgid "ADD"
msgstr "Dodaj"
msgstr "DODAJ"
#. module: account_payment
#: view:account.bank.statement:0
@@ -517,22 +523,22 @@ msgstr "Iznos u valuti preduzeca"
#. module: account_payment
#: help:payment.line,partner_id:0
msgid "The Ordering Customer"
msgstr "Kupac naručitelj"
msgstr "Naručitelj"
#. module: account_payment
#: model:ir.model,name:account_payment.model_account_payment_make_payment
msgid "Account make payment"
msgstr "Izvrsi placanje naloga"
msgstr "Izvrši plaćanje naloga"
#. module: account_payment
#: report:payment.order:0
msgid "Invoice Ref"
msgstr "Referenca fakture"
msgstr "Ref. fakture"
#. module: account_payment
#: field:payment.line,name:0
msgid "Your Reference"
msgstr "Vaše veze"
msgstr "Vaš poziv na broj"
#. module: account_payment
#: field:payment.order,mode:0
@@ -578,7 +584,7 @@ msgstr "Otkaži"
#: view:payment.line:0
#: view:payment.order:0
msgid "Information"
msgstr "Informacija"
msgstr "Informacije"
#. module: account_payment
#: model:ir.actions.act_window,help:account_payment.action_payment_order_tree
@@ -588,6 +594,10 @@ msgid ""
"that should be done, keep track of all payment orders and mention the "
"invoice reference and the partner the payment should be done for."
msgstr ""
"Nalog za plaćanje je zahtev za plaćanje od strane Vašeg preduzeća za isplatu "
"faktura nabavke ili kupaca. Ovde možete snimiti sve naloge za plaćanje na "
"čekanju, pratite sve naloge za plaćanje i pomenete poziv na broj za datu "
"fakturu i kom partneru treba izvršiti isplatu."
#. module: account_payment
#: help:payment.line,amount:0
@@ -612,12 +622,12 @@ msgstr "Komunikacija 2"
#. module: account_payment
#: field:payment.line,bank_id:0
msgid "Destination Bank account"
msgstr "Destinacioni bankovni račun"
msgstr "Ciljni bankovni račun"
#. module: account_payment
#: view:account.payment.make.payment:0
msgid "Are you sure you want to make payment?"
msgstr "Jeste li sigurni da zelite da izvrsite isplatu?"
msgstr "Jeste li sigurni da želite da izvršite isplatu?"
#. module: account_payment
#: view:payment.mode:0
@@ -639,7 +649,7 @@ msgstr "Potvrdi plaćanja"
#: field:payment.line,company_currency:0
#: report:payment.order:0
msgid "Company Currency"
msgstr "Valuta preduzeca"
msgstr "Valuta preduzeća"
#. module: account_payment
#: model:ir.ui.menu,name:account_payment.menu_main_payment
@@ -651,7 +661,7 @@ msgstr "Isplata"
#. module: account_payment
#: report:payment.order:0
msgid "Payment Order / Payment"
msgstr "Isplata Faktura / Placanje"
msgstr "Isplata Faktura / Plaćanje"
#. module: account_payment
#: field:payment.line,move_line_id:0
@@ -664,13 +674,13 @@ msgid ""
"Used as the message between ordering customer and current company. Depicts "
"'What do you want to say to the recipient about this order ?'"
msgstr ""
"Koristi se kao poruka izmedju narucioca i date kompanije. Objasnjava ' Sta "
"ste to hteli reci kupcu o ovoj narudzbi?'"
"Koristi se kao poruka između naručioca i date kompanije. Prikazuje ' Šta "
"želite reći kupcu o ovoj narudžbini?'"
#. module: account_payment
#: field:payment.mode,name:0
msgid "Name"
msgstr "Ime"
msgstr "Naziv"
#. module: account_payment
#: report:payment.order:0
@@ -681,7 +691,7 @@ msgstr "Bankovni račun"
#: view:payment.line:0
#: view:payment.order:0
msgid "Entry Information"
msgstr "Unos Informacije"
msgstr "Informacije o unosu"
#. module: account_payment
#: model:ir.model,name:account_payment.model_payment_order_create
@@ -702,7 +712,7 @@ msgstr "Ukupno"
#: view:account.payment.make.payment:0
#: model:ir.actions.act_window,name:account_payment.action_account_payment_make_payment
msgid "Make Payment"
msgstr "Izvrsi placanje"
msgstr "Izvrši placanje"
#. module: account_payment
#: field:payment.line,partner_id:0
@@ -713,7 +723,7 @@ msgstr "Partner"
#. module: account_payment
#: model:ir.actions.act_window,name:account_payment.action_create_payment_order
msgid "Populate Payment"
msgstr "Popuni Placanje"
msgstr "Popuni plaćanje"
#. module: account_payment
#: help:payment.mode,bank_id:0
@@ -723,7 +733,7 @@ msgstr "Bankovni račun za način plaćanja"
#. module: account_payment
#: constraint:account.move.line:0
msgid "You can not create move line on view account."
msgstr ""
msgstr "Ne možete napraviti poteznu liniju na računu po viđenju"
#~ msgid "Invalid model name in the action definition."
#~ msgstr "Pogrešno ime modela u definiciji akcije."
@@ -16,6 +16,7 @@
</record>
<record id="group_analytic_accounting" model="res.groups" context="{'noadmin':True}">
<field name="name">Useability / Analytic Accounting</field>
<field name="name">Analytic Accounting</field>
<field name="category_id" ref="base.module_category_usability"/>
</record>
</data></openerp>
+10 -2
View File
@@ -2,11 +2,19 @@
<openerp>
<data noupdate="0">
<record model="ir.module.category" id="module_category_auction">
<field name="name">Auction</field>
<field name="parent_id" ref="base.module_category_specific_industry_applications"/>
<field name="sequence">26</field>
</record>
<record id="group_auction_user" model="res.groups">
<field name="name">Auction / User</field>
<field name="name">User</field>
<field name="category_id" ref="module_category_auction"/>
</record>
<record id="group_auction_manager" model="res.groups">
<field name="name">Auction / Manager</field>
<field name="name">Manager</field>
<field name="category_id" ref="module_category_auction"/>
<field name="implied_ids" eval="[(4, ref('group_auction_user'))]"/>
</record>
-1
View File
@@ -45,7 +45,6 @@ Pay attention that this module converts the existing addresses into "addresses +
'depends': ['base','process'],
'init_xml': [],
'update_xml': [
'security/base_contact_security.xml',
'security/ir.model.access.csv',
'base_contact_view.xml',
'base_contact_installer_view.xml',
@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">
<record id="base.group_sale_salesman" model="res.groups">
<field name="name">Sales / User</field>
</record>
<record id="base.group_sale_manager" model="res.groups">
<field name="name">Sales / Manager</field>
</record>
</data>
</openerp>
+6 -3
View File
@@ -3,16 +3,19 @@
<data noupdate="0">
<record id="base.group_sale_salesman" model="res.groups">
<field name="name">Sales / User - Own Leads Only</field>
<field name="name">User - Own Leads Only</field>
<field name="category_id" ref="base.module_category_sales_management"/>
</record>
<record id="base.group_sale_salesman_all_leads" model="res.groups">
<field name="name">Sales / User - All Leads</field>
<field name="name">User - All Leads</field>
<field name="category_id" ref="base.module_category_sales_management"/>
<field name="implied_ids" eval="[(4, ref('base.group_sale_salesman'))]"/>
</record>
<record id="base.group_sale_manager" model="res.groups">
<field name="name">Sales / Manager</field>
<field name="name">Manager</field>
<field name="category_id" ref="base.module_category_sales_management"/>
<field name="implied_ids" eval="[(4, ref('base.group_sale_salesman_all_leads'))]"/>
</record>
+1 -1
View File
@@ -39,7 +39,7 @@ It also has been merged with the earlier CRM & SRM segmentation tool because the
'website': 'http://www.openerp.com',
'depends': ['base', 'crm'],
'init_xml': [],
'update_xml': ['security/ir.model.access.csv', 'crm_profiling_view.xml'],
'update_xml': ['security/ir.model.access.csv', 'wizard/open_questionnaire_view.xml', 'crm_profiling_view.xml'],
'demo_xml': ['crm_profiling_demo.xml'],
'test': [
#'test/process/profiling.yml', #TODO:It's not debuging because problem to write data for open.questionnaire from partner section.
+5 -35
View File
@@ -159,30 +159,6 @@ class questionnaire(osv.osv):
_name="crm_profiling.questionnaire"
_description= "Questionnaire"
def build_form(self, cr, uid, data, context=None):
"""
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@param data: Get Data
@param context: A standard dictionary for contextual values """
query = """
select name, id
from crm_profiling_question
where id in ( select question from profile_questionnaire_quest_rel where questionnaire = %s)"""
res = cr.execute(query, (data['form']['questionnaire_name'],))
result = cr.fetchall()
quest_fields={}
quest_form='''<?xml version="1.0"?>
<form string="%s">''' % _('Questionnaire')
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>'''
return quest_form, quest_fields
_columns = {
'name': fields.char("Questionnaire",size=128, required=True),
'description':fields.text("Description", required=True),
@@ -210,25 +186,19 @@ class partner(osv.osv):
"partner","answer","Answers"),
}
def _questionnaire_compute(self, cr, uid, data, context=None):
def _questionnaire_compute(self, cr, uid, answers, context=None):
"""
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@param data: Get Data
@param context: A standard dictionary for contextual values """
temp = []
for x in data['form']:
if x.startswith("quest_form") and data['form'][x] != 0 :
temp.append(data['form'][x])
partner_id = context.get('active_id')
query = "select answer from partner_question_rel where partner=%s"
cr.execute(query, (data['id'],))
cr.execute(query, (partner_id,))
for x in cr.fetchall():
temp.append(x[0])
self.write(cr, uid, [data['id']], {'answers_ids':[[6, 0, temp]]}, context=context)
answers.append(x[0])
self.write(cr, uid, [partner_id], {'answers_ids': [[6, 0, answers]]}, context=context)
return {}
+1 -8
View File
@@ -2,13 +2,6 @@
<openerp>
<data>
<wizard
string="Using a questionnaire"
model="crm_profiling.questionnaire"
name="open_questionnaire"
menu="False"
id="wizard_open_questionnaire"/>
<record model="ir.actions.act_window" id="open_questionnaires">
<field name="name">Questionnaires</field>
<field name="res_model">crm_profiling.questionnaire</field>
@@ -140,7 +133,7 @@
<notebook position="inside">
<page string="Profiling">
<button string="Use a questionnaire"
name="%(wizard_open_questionnaire)d" type="action" colspan="1"
name="%(action_open_questionnaire)d" type="action" colspan="1"
icon="gtk-justify-fill" />
<newline/>
<field name="answers_ids" colspan="4" nolabel="1"/>
@@ -1,5 +0,0 @@
<?xml version="1.0"?>
<openerp>
<data>
</data>
</openerp>
@@ -1,10 +1,69 @@
- |
I check segmentation which allows users to perform segmentation within partners.
-
I check segmentation which allows users to perform segmentation within partners
and set the category according to question, so first compute questions(answers)
scenario with parther and check that category set according to questions.
I create a crm profiling question record.
-
!record {model: crm_profiling.question, id: crm_profiling_question_openerppartner0}:
answers_ids:
- name: 'no'
name: OpenERP partner?
-
I create a crm profiling answer record.
-
!record {model: crm_profiling.answer, id: crm_profiling_answer_openerppartner0}:
name: 'yes'
question_id: crm_profiling_question_openerppartner0
-
I create Partner category Customers.
-
!record {model: res.partner.category, id: res_partner_category_customers0}:
name: Customers
- |
I'm creating new partner "John" with his email "info@mycustomer.com".
-
!record {model: res.partner, id: res_partner_john0}:
address:
- city: Bruxelles
country_id: base.be
street: Rue des Palais 51, bte 33
type: default
zip: '1000'
email: 'info@mycustomer.com'
name: John
category_id:
- res_partner_category_customers0
-
Define the answers and category to partner.
-
!python {model: res.partner}: |
data ={'form': {'quest_form3': ref("partner_quality3"), 'quest_form2': ref("nb_employees2"),'quest_form1': ref("sector1"),'questionnaire_name': ref('questionnaire1')}, 'ids': [ref('base.res_partner_ericdubois0')], 'report_type': 'pdf', 'model': 'res.partner', 'id': ref('base.res_partner_ericdubois0')}
data = self._questionnaire_compute(cr, uid, data, context)
partner = self.browse(cr, uid, ref('base.res_partner_ericdubois0'))
assert partner.category_id[0].id == ref("base.res_partner_category_17"), "Category not assign properly"
data ={'form': {'questionnaire_name': ref('res_partner_john0')}, 'ids': [ref('res_partner_john0')], 'report_type': 'pdf', 'model': 'res.partner', 'id': ref('res_partner_john0')}
context['active_id'] = ref('res_partner_john0')
self._questionnaire_compute(cr, uid, [ref('crm_profiling_answer_openerppartner0')], context)
- |
I start by creating new Questionnaire.
-
!record {model: crm_profiling.questionnaire, id: crm_profiling_questionnaire_basequestionnaire0}:
description: First questionnaire.
name: Base questionnaire
questions_ids:
- crm_profiling.activity_sector
- crm_profiling.nb_employees
- crm_profiling.partner_level
-
I create a segmentation record.
-
!record {model: crm.segmentation, id: crm_segmentation_test1}:
answer_yes:
- crm_profiling_answer_openerppartner0
categ_id: res_partner_category_customers0
name: test
parent_id: crm_profiling.crm_segmentation0
profiling_active: true
som_interval: 0.0
- |
I continue the process of segmentation.
-
!python {model: crm.segmentation}: |
self.process_continue(cr, uid, [ref('crm_segmentation_test1')], start=False)
@@ -18,50 +18,72 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import pooler
import wizard
from tools import UpdateableStr, UpdateableDict
_QUEST_FORM = UpdateableStr()
_QUEST_FIELDS=UpdateableDict()
from osv import osv, fields
from tools.translate import _
class open_questionnaire(wizard.interface):
def _questionnaire_compute(self, cr, uid, data, context):
pooler.get_pool(cr.dbname).get(data['model'])._questionnaire_compute(cr, uid, data, context)
return {}
def build_form(self, cr, uid, data, context):
quest_form, quest_fields = pooler.get_pool(cr.dbname).get('crm_profiling.questionnaire').build_form(cr, uid, data, context)
_QUEST_FORM. __init__(quest_form)
_QUEST_FIELDS.__init__(quest_fields)
return{}
_questionnaire_choice_arch = '''<?xml version="1.0"?>
<form string="Questionnaire">
<field name="questionnaire_name"/>
</form>'''
_questionnaire_choice_fields = {
'questionnaire_name': {'string': 'Questionnaire name', 'type': 'many2one', 'relation': 'crm_profiling.questionnaire', 'required': True },
class open_questionnaire_line(osv.osv_memory):
_name = 'open.questionnaire.line'
_rec_name = 'question_id'
_columns = {
'question_id': fields.many2one('crm_profiling.question','Question', required=True),
'answer_id': fields.many2one('crm_profiling.answer', 'Answer'),
'wizard_id': fields.many2one('open.questionnaire', 'Questionnaire'),
}
states = {
'init': {
'actions': [],
'result': {'type': 'form', 'arch': _questionnaire_choice_arch, 'fields': _questionnaire_choice_fields, 'state':[('end', 'Cancel','gtk-cancel'), ('open', 'Open Questionnaire','terp-camera_test')]}
},
'open': {
'actions': [build_form],
'result': {'type': 'form', 'arch':_QUEST_FORM, 'fields': _QUEST_FIELDS, 'state':[('end', 'Cancel','gtk-cancel'), ('compute', 'Save Data','terp-stock_format-scientific')]}
},
'compute': {
'actions': [],
'result': {'type': 'action', 'action': _questionnaire_compute, 'state':'end'}
open_questionnaire_line()
class open_questionnaire(osv.osv_memory):
_name = 'open.questionnaire'
_columns = {
'questionnaire_id': fields.many2one('crm_profiling.questionnaire', 'Questionnaire name'),
'question_ans_ids': fields.one2many('open.questionnaire.line', 'wizard_id', 'Question / Answers'),
}
def default_get(self, cr, uid, fields, context=None):
if context is None: context = {}
res = super(open_questionnaire, self).default_get(cr, uid, fields, context=context)
questionnaire_id = context.get('questionnaire_id', False)
if questionnaire_id and 'question_ans_ids' in fields:
query = """
select question as question_id from profile_questionnaire_quest_rel where questionnaire = %s"""
cr.execute(query, (questionnaire_id,))
result = cr.dictfetchall()
res.update(question_ans_ids=result)
return res
def questionnaire_compute(self, cr, uid, ids, context=None):
""" Adds selected answers in partner form """
model = context.get('active_model')
answers = []
if model == 'res.partner':
data = self.browse(cr, uid, ids[0], context=context)
for d in data.question_ans_ids:
if d.answer_id:
answers.append(d.answer_id.id)
self.pool.get(model)._questionnaire_compute(cr, uid, answers, context=context)
return {'type': 'ir.actions.act_window_close'}
def build_form(self, cr, uid, ids, context=None):
""" Dynamically generates form according to selected questionnaire """
models_data = self.pool.get('ir.model.data')
result = models_data._get_id(cr, uid, 'crm_profiling', 'open_questionnaire_form')
res_id = models_data.browse(cr, uid, result, context=context).res_id
datas = self.browse(cr, uid, ids[0], context=context)
context.update({'questionnaire_id': datas.questionnaire_id.id})
return {
'name': _('Questionnaire'),
'view_type': 'form',
'view_mode': 'form',
'res_model': 'open.questionnaire',
'type': 'ir.actions.act_window',
'views': [(res_id,'form')],
'target': 'new',
'context': context
}
}
open_questionnaire('open_questionnaire')
open_questionnaire()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,86 @@
<?xml version="1.0" ?>
<openerp>
<data>
<record id="view_open_questionnaire_form" model="ir.ui.view">
<field name="name">Open Questionnaires</field>
<field name="model">open.questionnaire</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Questionnaires">
<field name="questionnaire_id" required="1"/>
<newline/>
<separator string="" colspan="4"/>
<group col="4" colspan="4">
<group col="2" colspan="2"/>
<button special="cancel" icon="gtk-cancel" string="Cancel"/>
<button name="build_form" string="Open Questionnaire" icon="terp-camera_test" type="object"/>
</group>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_open_questionnaire">
<field name="name">Open Questionnaire</field>
<field name="res_model">open.questionnaire</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="view_open_questionnaire_form"/>
<field name="target">new</field>
</record>
<record id="open_questionnaire_form" model="ir.ui.view">
<field name="name">open.questionnaire.form</field>
<field name="model">open.questionnaire</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form>
<separator colspan="4" string="Questionnaire"/>
<field name="question_ans_ids" colspan="4" nolabel="1" mode="tree,form" width="550" height="200"/>
<separator string="" colspan="4" />
<label string="" colspan="2"/>
<group col="2" colspan="2">
<button icon='gtk-cancel' special="cancel" string="_Cancel" />
<button name="questionnaire_compute" string="Save Data" icon="terp-stock_format-scientific" colspan="1" type="object"/>
</group>
</form>
</field>
</record>
<record id="view_open_questionnaire_line_tree" model="ir.ui.view">
<field name="name">open.questionnaire.line.list</field>
<field name="model">open.questionnaire.line</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree editable="bottom" string="Questionnaire">
<field name="question_id"/>
<field name="answer_id" domain="[('question_id', '=', question_id)]"/>
</tree>
</field>
</record>
<record id="view_open_questionnaire_line_form" model="ir.ui.view">
<field name="name">open.questionnaire.line.form</field>
<field name="model">open.questionnaire.line</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Questionnaire">
<field name="question_id"/>
<field name="answer_id" domain="[('question_id', '=', question_id)]"/>
</form>
</field>
</record>
<!-- Questionnaire form view -->
<!--<act_window
context="{}"
id="act_open_questionnaire"
name="Using a Questionnaire"
res_model="open.questionnaire"
src_model="crm_profiling.questionnaire"
view_id="view_open_questionnaire_form"
target="new"
view_mode="form"/>-->
</data>
</openerp>
@@ -3,7 +3,8 @@
<data noupdate="0">
<record id="base.group_document_user" model="res.groups">
<field name="name">Knowledge / User</field>
<field name="name">User</field>
<field name="category_id" ref="base.module_category_knowledge_management"/>
</record>
<!-- <record id="group_document_manager" model="res.groups">-->
+5 -2
View File
@@ -42,7 +42,6 @@ Note that:
'depends': ['crm', 'base_contact', 'account', 'marketing', 'mail'],
'init_xml': [],
'update_xml': [
'security/event_security.xml',
'security/ir.model.access.csv',
'wizard/event_confirm_registration_view.xml',
'wizard/event_confirm_view.xml',
@@ -54,7 +53,11 @@ Note that:
'res_partner_view.xml',
],
'demo_xml': ['event_demo.xml'],
'test': ['test/test_event.yml'],
'test': ['test/process/event_confirm2done.yml',
'test/process/event_draft2cancel.yml',
'test/process/partner_register2invoice.yml',
'test/ui/duplicate_event.yml',
'test/ui/demo_data.yml'],
'installable': True,
'active': False,
'certificate': '0083059161581',
+15 -2
View File
@@ -61,6 +61,8 @@
<field eval="time.strftime('%Y-%m-01 23:05:15')" name="date_end"/>
<field name="product_id" ref="event_product_0"/>
<field name="unit_price">68.00</field>
<field name="mail_auto_registr">True</field>
<field name="mail_auto_confirm">True</field>
<field name="user_id" ref="base.user_root"/>
<field name="register_max">500</field>
<field name="type" ref="event_type_1"/>
@@ -74,9 +76,9 @@
<field name="unit_price">24.00</field>
<field name="type" ref="event_type_1"/>
<field name="user_id" ref="base.user_root"/>
<field name="register_min">50</field>
<field name="register_max">350</field>
</record>
<function model="event.event" name="button_confirm" eval="[ref('event_1')]"/>
<record id="event_2" model="event.event">
<field name="name">Conference on ERP Buisness</field>
<field eval="time.strftime('%Y-%m-05 14:00:00')" name="date_begin"/>
@@ -92,7 +94,7 @@
<field name="mail_confirm">Thanks for registration. The conference will begin at 2 PM and will be given by Mr. Pinckaers.</field>
</record>
<function model="event.event" name="button_confirm" eval="[ref('event_2')]"/>
<function model="event.event" name="button_done" eval="[ref('event_2')]"/>
<function model="event.event" name="button_confirm" eval="[ref('event_2')]"/>
<!-- Demo data for Event Registration-->
<record id="reg_1_1" model="event.registration">
@@ -126,5 +128,16 @@
<function model="event.registration" name="check_confirm" eval="[ref('reg_0_1')]"/>
<record id="reg_0_2" model="event.registration">
<field name="event_id" ref="event_2"/>
<field name="partner_id" ref="base.res_partner_c2c"/>
<field name="partner_invoice_id" ref="base.res_partner_c2c"/>
<field name="nb_register">5</field>
<field name="event_product">Ticket for Conference</field>
<field name="unit_price">20</field>
</record>
<function model="event.registration" name="check_confirm" eval="[ref('reg_0_2')]"/>
</data>
</openerp>
-23
View File
@@ -1,23 +0,0 @@
<?xml version="1.0"?>
<openerp>
<data>
<record id="marketing.group_marketing_user" model="res.groups">
<field name="name">Marketing / User</field>
</record>
<record id="marketing.group_marketing_manager" model="res.groups">
<field name="name">Marketing / Manager</field>
<field name="implied_ids" eval="[(4, ref('marketing.group_marketing_user'))]"/>
</record>
<record id="base.group_sale_manager" model="res.groups">
<field name="name">Sales / Manager</field>
</record>
<record id="base.group_sale_salesman" model="res.groups">
<field name="name">Sales / User</field>
</record>
</data>
</openerp>
@@ -0,0 +1,22 @@
-
I want to organize one conference event on "OpenERP Business", Customer subscribe/join
into "Conference on OpenERP Business" with 6 tickets, first I confim this event.
-
!python {model: event.event}: |
self.button_confirm(cr, uid, [ref("event_0")])
-
I Check that Event is "confirmed", and Its automatically sending mail to registered
partner which joined to this event.
-
!assert {model: event.event, id: event_0}:
- state == 'confirm', "Event should be confirmed."
-
After completed event, I close this event.
-
!python {model: event.event}: |
self.button_done(cr, uid, [ref("event_0")])
-
Check that conference is in "close" state.
-
!assert {model: event.event, id: event_0}:
- state == 'done', "Event should be Closed."
@@ -0,0 +1,22 @@
-
I want to organize event and its need Minimum 50 Registrations to confirm/start
this Event, but Only 10 registration confirm for this event, I confirm this event.
-
!python {model: event.event}: |
self.button_confirm(cr, uid, [ref("event_1")])
-
Now I cheked for event and It should not be confirm because registrations for
this event is below limit.
-
!assert {model: event.event, id: event_1}:
- state == 'confirm', "Event should be confirm."
-
So I cancel this Event
-
!python {model: event.event}: |
self.button_cancel(cr, uid, [ref("event_1")])
-
I check event should be cancel.
-
!assert {model: event.event, id: event_1}:
- state == 'cancel', "Event should be cancel"
@@ -0,0 +1,62 @@
-
I want to organize one conference event, First I registered partner for event
with 5 tickets.
-
!python {model: partner.event.registration}: |
context.update({'active_model': 'res.partner', 'active_ids': [ref("base.res_partner_ericdubois0")], 'active_id': ref("base.res_partner_ericdubois0")})
register = self.create(cr, uid, {'event_id': ref('event_1'),'nb_register': 5}, context=context)
self.open_registration(cr, uid, [register], context=context)
-
Now I check for registration created base on partner.
-
!python {model: event.registration}: |
ids = self.search(cr, uid, [('partner_id','=',ref("base.res_partner_ericdubois0")), ('event_id', '=', ref('event_1'))])
assert ids, "Registration should be create here."
-
I confirm registration process.
-
!python {model: event.registration}: |
self.check_confirm(cr, uid, [ref("reg_1_1")])
-
I Check that Registration is confirm.
-
!assert {model: event.registration, id: reg_1_1}:
- state == 'open', "Registration should be open here."
-
After confirmation of partner, I create invoice base on costing of event.
-
!python {model: event.registration}: |
self.action_invoice_create(cr, uid, [ref("reg_1_1")])
-
Now I Check for Invoice is created and Registration should be closed after invoice generated.
-
!python {model: event.registration}: |
record = self.browse(cr, uid, [ref("reg_1_1")])[0]
assert record.invoice_id, "Invoice should be generated"
assert record.invoice_id.state == "draft", "Invoice state should be draft"
assert record.invoice_id.partner_id == record.partner_id, "Customer is not correspond with registration"
assert record.invoice_id.type == 'out_invoice', "Invoice type is not correct"
assert record.invoice_id.origin == record.event_product, "Invoice origin is not correct"
assert record.invoice_id.amount_total == record.price_subtotal, "Invoice amount is not correct"
assert record.state == "done", "Registration should be closed after invoice generated"
-
Now I check for same partner registration for two diffrent event and I create group invoices for same partner.
-
!python {model: event.make.invoice}: |
context.update({'active_model': 'event.make.invoice', 'active_ids': [ref("reg_0_1"), ref("reg_0_2")], 'active_id': ref("reg_0_1")})
invoice = self.create(cr, uid, {'grouped': True}, context=context)
self.make_invoice(cr, uid, [invoice], context=context)
-
Now I Check for group Invoice is created with total amount of both registration
and Registration should be closed after invoice generated.
-
!python {model: event.registration}: |
reg_data_1 = self.browse(cr, uid, [ref("reg_0_1")])[0]
reg_data_2 = self.browse(cr, uid, [ref("reg_0_2")])[0]
assert reg_data_1.invoice_id, "Invoice should be generated"
assert reg_data_1.invoice_id.state == "draft", "Invoice state should be draft"
assert reg_data_1.invoice_id.partner_id == reg_data_1.partner_id, "Customer is not correspond with registration"
assert reg_data_1.invoice_id.type == 'out_invoice', "Invoice type is not correct"
assert reg_data_1.invoice_id.origin == reg_data_1.event_product, "Invoice origin is not correct"
assert reg_data_1.invoice_id.amount_total == (reg_data_1.price_subtotal + reg_data_2.price_subtotal), "Invoice total amount is not correct"
assert reg_data_1.state == "done", "Registration should be closed after invoice generated"
-172
View File
@@ -1,172 +0,0 @@
- |
In order to test the "Event Organisation" in Association system.
- |
I want to organize one conference event on "OpenERP Business".
- |
I'm creating new product "Conference Ticket" to specify registration Cost of conference.
-
!record {model: product.product, id: product_product_ticketforconcert0}:
categ_id: product.cat1
list_price: 68.0
name: Conference Ticket
- |
I'm creating Event type "Conference".
-
!record {model: event.type, id: event_type_conference0}:
name: Conferences
- |
I'm creating one Event "Conference on OpenERP Business" which will last from 1st of this month to 10th of this month.
-
!record {model: event.event, id: event_event_conference0}:
date_begin: !eval time.strftime('%Y-%m-01')
date_end: !eval time.strftime('%Y-%m-10')
name: Conference on OpenERP Business.
product_id: 'product_product_ticketforconcert0'
type: 'event_type_conference0'
reply_to: 'info@customer.com'
- |
Check that the new conference event is "Draft" or not.
-
!assert {model: event.event, id: event_event_conference0}:
- state == 'draft', "Event should be in draft by default when first time created"
- |
Need Minimum 10 Registrations to confirm/start this Conference Event and does not allowed more than 100 Registrations.
- |
So I set Minimum and Maximum Registrations limit.
-
!python {model: event.event}: |
self.write(cr, uid, [ref('event_event_conference0')], {'register_max': 100, 'register_min': 10})
- |
I'm doing to confirm that conference event.
-
!python {model: event.event}: |
self.button_confirm(cr, uid, [ref("event_event_conference0")])
- |
But this conference event need minimum 10 Confirmed Registrations. so Check that Event is not "confirmed".
-
!assert {model: event.event, id: event_event_conference0}:
- state != 'confirm', "Event should not confirmed if minimum registrations does not reached"
- |
"Mark Johnson" want to subscribe/join into "Conference on OpenERP Business" with 10 tickets.
- |
I'm creating new partner "Mark Johnson" with his email "info@mycustomer.com".
-
!record {model: res.partner, id: res_partner_markjohnson0}:
address:
- city: Bruxelles
country_id: base.be
job_ids:
- contact_id: base_contact.res_partner_contact_jacot0
function: CTO
name: base.res_partner_maxtor
sequence_partner: 0.0
state: current
street: Rue des Palais 51, bte 33
type: default
zip: '1000'
email: 'info@mycustomer.com'
name: Mark Johnson
- |
I'm creating Registration for "Mark Johnson" on "Conference on OpenERP Business" with 10 tickets.
-
!record {model: event.registration, id: event_registration_registrationjacot0}:
contact_id: base_contact.res_partner_contact_jacot0
event_id: event.event_event_conference0
partner_id: event.res_partner_markjohnson0
partner_invoice_id: event.res_partner_markjohnson0
event_product: Conference Ticket
unit_price: 68.0
nb_register: 10
- |
I'm going to Open that Registration.
-
!python {model: event.registration}: |
self.check_confirm(cr, uid, [ref("event_registration_registrationjacot0")])
- |
Check that Registration is in "Open" state or not.
-
!assert {model: event.registration, id: event_registration_registrationjacot0}:
- state == 'open', "Registration should be open here."
- |
I'm again trying to confirm that conference event.
-
!python {model: event.event}: |
self.button_confirm(cr, uid, [ref("event_event_conference0")])
- |
Now Minimum requirement of Registration is fulfil. so Check that Event is "confirmed" or not.
-
!assert {model: event.event, id: event_event_conference0}:
- state == 'confirm', "Event should be confirmed here."
- |
I'm creating invoice of Registration of "Mark Johnson" on "Conference on OpenERP Business".
-
!python {model: event.registration}: |
self.action_invoice_create(cr, uid, [ref("event_registration_registrationjacot0")])
- |
Check Invoice of Registration of "Mark Johnson" is created or not.
-
!assert {model: event.registration, id: event_registration_registrationjacot0}:
- invoice_id != False, "Invoice should be generated"
- |
Check Registration of "Mark Johnson" is closed or not after invoice generated.
-
!assert {model: event.registration, id: event_registration_registrationjacot0}:
- state != 'done', "Registration should be closed after invoice generated"
- |
Now "Mark Johnson" want to another registration on "Conference on OpenERP Business" with 120 tickets.
- |
I'm creating new registration for "Mark Johnson" with 100 tickets.
-
!record {model: event.registration, id: event_registration_registrationzen0}:
event_id: event.event_event_conference0
partner_id: event.res_partner_markjohnson0
partner_invoice_id: event.res_partner_markjohnson0
event_product: Conference Ticket
unit_price: 68.0
nb_register: 100
- |
I'm going to open "Mark Johnson" registration.
-
!python {model: event.registration}: |
self.check_confirm(cr, uid, [ref("event_registration_registrationzen0")])
- |
But conference event does not allow more than 100 Registrations. so Check that registration is not in "open" state.
-
!assert {model: event.registration, id: event_registration_registrationzen0}:
- state == 'draft', "Registration should be in draft by default."
- |
Now I'm modifying number of tickets of "Mark Johnson"'s registration with 90 tickets.
-
!python {model: event.registration}: |
self.write(cr, uid, [ref("event_registration_registrationzen0")], {'nb_register': 90})
- |
I'm again try to open "Mark Johnson" registration.
-
!python {model: event.registration}: |
self.check_confirm(cr, uid, [ref("event_registration_registrationzen0")])
- |
Check that registration "open" or not.
-
!assert {model: event.registration, id: event_registration_registrationzen0}:
- state == 'open', "Registration should be open here."
- |
I'm closing "Conference on OpenERP Business" Conference event
-
!python {model: event.event}: |
self.button_done(cr, uid, [ref("event_event_conference0")])
- |
Check that conference is in "close" state or not.
-
!assert {model: event.event, id: event_event_conference0}:
- state == 'done', "Registration should be Closed here."
+32
View File
@@ -0,0 +1,32 @@
-
I create event registation record to call event onchange and partner onchange.
-
!record {model: event.registration, id: reg_0_1}:
event_id: event_0
partner_id: base.res_partner_asus
name: 'Ticket for Concert'
-
I create event record to call product onchange and team onchange.
-
!record {model: event.event, id: event_2}:
product_id: event_product_2
section_id: crm.section_sales_department
name: 'Conference on ERP Buisness'
-
I call onchange event from event registration wizard.
-
!python {model: partner.event.registration}: |
context.update({'active_id': ref("base.res_partner_ericdubois0")})
self.onchange_event_id(cr, uid, 1, ref("event_1"), context=context)
-
I confirm event from wizard.
-
!python {model: event.confirm}: |
context.update({'event_ids': [ref("event_2")]})
id = self.create(cr, uid , {})
self.confirm(cr, uid, [id], context=context)
-
I call close registration process.
-
!python {model: event.registration}: |
self.button_reg_close(cr, uid, [ref("reg_0_2")])
+16
View File
@@ -0,0 +1,16 @@
-
Copy of event.
-
!python {model: event.event}: |
try:
self.copy(cr, uid, ref("event_2"))
except:
pass
-
Copy of event registarion.
-
!python {model: event.registration}: |
try:
self.copy(cr, uid, ref("reg_1_1"))
except:
pass
@@ -34,8 +34,8 @@ class partner_event_registration(osv.osv_memory):
'event_id': fields.many2one('event.event', 'Event'),
'event_type': fields.many2one('event.type', 'Type', readonly=True),
'unit_price': fields.float('Registration Cost', digits_compute=dp.get_precision('Sale Price')),
'start_date': fields.datetime('Start date', required=True, help="Beginning Date of Event", readonly=True),
'end_date': fields.datetime('Closing date', required=True, help="Closing Date of Event", readonly=True),
'start_date': fields.datetime('Start date', help="Beginning Date of Event", readonly=True),
'end_date': fields.datetime('Closing date', help="Closing Date of Event", readonly=True),
'nb_register': fields.integer('Number of Registration'),
}
_defaults = {
+4 -2
View File
@@ -3,11 +3,13 @@
<data noupdate="1">
<record id="base.group_hr_user" model="res.groups">
<field name="name">Human Resources / HR Officer</field>
<field name="name">HR Officer</field>
<field name="category_id" ref="base.module_category_human_resources"/>
<field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
</record>
<record id="base.group_hr_manager" model="res.groups">
<field name="name">Human Resources / HR Manager</field>
<field name="name">HR Manager</field>
<field name="category_id" ref="base.module_category_human_resources"/>
<field name="implied_ids" eval="[(4, ref('base.group_hr_user'))]"/>
</record>
<record id="hr_dept_comp_rule" model="ir.rule">
+3 -2
View File
@@ -62,8 +62,9 @@ re-invoice your customer's expenses if your work by project.
'demo_xml': [
'hr_expense_demo.xml',
],
'test': ['test/test_hr_expense.yml',
'test/hr_expense_report.yml',
'test': [
'test/expense_demo.yml',
'test/expense_process.yml',
],
'installable': True,
'active': False,
+1
View File
@@ -87,6 +87,7 @@ class hr_expense_expense(osv.osv):
\nIf the admin accepts it, the state is \'Accepted\'.\n If an invoice is made for the expense request, the state is \'Invoiced\'.\n If the expense is paid to user, the state is \'Reimbursed\'.'),
}
_defaults = {
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'hr.employee', context=c),
'date': lambda *a: time.strftime('%Y-%m-%d'),
'state': 'draft',
'employee_id': _employee_get,
+1 -13
View File
@@ -8,18 +8,6 @@
<field name="parent_id" ref="product.cat0"/>
<field name="name">Expenses</field>
</record>
<record id="product_product_expense_car" model="product.product">
<field name="list_price">0.32</field>
<field name="standard_price">0.32</field>
<field name="uom_id" ref="product.product_uom_km"/>
<field name="uom_po_id" ref="product.product_uom_km"/>
<field name="type">consu</field>
<field name="name">Travel Expenses</field>
<field name="default_code">TRA</field>
<field name="categ_id" ref="hr_expense.cat_expense"/>
<field name="hr_expense_ok" eval="True" />
</record>
</data>
</openerp>
</openerp>
+50 -57
View File
@@ -2,95 +2,88 @@
<openerp>
<data noupdate="1">
<record id="product_product_expense_air" model="product.product">
<field name="list_price">1.0</field>
<field name="standard_price">1.0</field>
<field name="uom_id" ref="product.product_uom_unit"/>
<field name="uom_po_id" ref="product.product_uom_unit"/>
<record id="hr.employee4" model="hr.employee">
<field name="address_home_id" ref="base.res_partner_address_1"/>
</record>
<record id="car_travel" model="product.product">
<field name="list_price">0.32</field>
<field name="type">service</field>
<field name="name">Car Travel Expenses</field>
<field name="default_code">CarTRA</field>
<field name="categ_id" ref="hr_expense.cat_expense"/>
<field name="hr_expense_ok" eval="True" />
</record>
<record id="air_ticket" model="product.product">
<field name="list_price">700.0</field>
<field name="type">service</field>
<field name="name">Air Ticket</field>
<field name="default_code">AT</field>
<field name="categ_id" ref="product.cat2"/>
<field name="categ_id" ref="hr_expense.cat_expense"/>
<field name="hr_expense_ok" eval="True" />
</record>
<record id="product_product_expense_hotel" model="product.product">
<field name="list_price">1.0</field>
<field name="standard_price">1.0</field>
<field name="uom_id" ref="product.product_uom_unit"/>
<field name="uom_po_id" ref="product.product_uom_unit"/>
<record id="hotel_rent" model="product.product">
<field name="list_price">400.0</field>
<field name="type">service</field>
<field name="name">Hotel Accommodation</field>
<field name="default_code">HA0</field>
<field name="categ_id" ref="product.cat2"/>
<field name="categ_id" ref="hr_expense.cat_expense"/>
<field name="hr_expense_ok" eval="True" />
</record>
<record id="hr_expense_expense_septemberexpenses0" model="hr.expense.expense">
<field name="currency_id" ref="base.EUR"/>
<field name="employee_id" ref="hr.employee1"/>
<field name="user_id" ref="base.user_root"/>
<field name="name">May Expenses</field>
<field name="company_id" ref="base.main_company"/>
<field name="date" eval="time.strftime('%Y-%m-03')"/>
<field name="state">draft</field>
<record id="expenses0" model="hr.expense.expense">
<field name="name">Expenses</field>
<field name="date" eval="time.strftime('%Y-08-25')"/>
</record>
<record id="expenses_line0" model="hr.expense.line">
<field name="name">Travel Expenses</field>
<field name="date_value" eval="time.strftime('%Y-08-10')"/>
<field name="analytic_account" ref="account.analytic_consultancy"/>
<field name="expense_id" ref="expenses0"/>
<field eval="200.0" name="unit_amount"/>
<field name="uom_id" ref="product.product_uom_unit"/>
<field eval="1.0" name="unit_quantity"/>
</record>
<record id="hr_expense_line_travelbycarcustomerseagatedouble0" model="hr.expense.line">
<record id="sep_expenses" model="hr.expense.expense">
<field name="employee_id" ref="hr.employee4"/>
<field name="name">September Expenses</field>
<field name="date" eval="time.strftime('%Y-09-28')"/>
</record>
<record id="travel_by_air_sep" model="hr.expense.line">
<field name="name">Travel by Air</field>
<field name="date_value" eval="time.strftime('%Y-%m-03')"/>
<field name="date_value" eval="time.strftime('%Y-09-03')"/>
<field name="analytic_account" ref="account.analytic_consultancy"/>
<field name="product_id" ref="product_product_expense_air"/>
<field model="hr.expense.expense" name="expense_id" search="[('name', '=', u'May Expenses')]"/>
<field name="product_id" ref="air_ticket"/>
<field name="expense_id" ref="sep_expenses"/>
<field eval="700.0" name="unit_amount"/>
<field name="uom_id" ref="product.product_uom_unit"/>
<field eval="1.0" name="unit_quantity"/>
</record>
<record id="hr_expense_line_basicpcserverforseagate0" model="hr.expense.line">
<field name="name">Basic PC - Server for Seagate</field>
<field name="date_value" eval="time.strftime('%Y-%m-03')"/>
<field name="analytic_account" ref="account.analytic_seagate_p2"/>
<field name="product_id" ref="product.product_product_pc4"/>
<field model="hr.expense.expense" name="expense_id" search="[('name', '=', u'May Expenses')]"/>
<field eval="1200.0" name="unit_amount"/>
<field name="uom_id" ref="product.product_uom_unit"/>
<field eval="1.0" name="unit_quantity"/>
</record>
</data>
<data noupdate="1">
<record id="hr_expense_expense_septemberexpenses1" model="hr.expense.expense">
<field name="currency_id" ref="base.EUR"/>
<field name="employee_id" ref="hr.employee1"/>
<field name="user_id" ref="base.user_root"/>
<field name="name">Travel Expenses</field>
<field name="company_id" ref="base.main_company"/>
<field name="date" eval="time.strftime('%Y-%m-20')"/>
<field name="state">draft</field>
</record>
<record id="hr_expense_line_hotelexpensesthymbra0" model="hr.expense.line">
<record id="hotel_bill_sep" model="hr.expense.line">
<field name="name">Hotel Expenses - Thymbra</field>
<field name="date_value" eval="time.strftime('%Y-%m-03')"/>
<field name="date_value" eval="time.strftime('%Y-09-20')"/>
<field name="analytic_account" ref="account.analytic_thymbra"/>
<field name="product_id" ref="product_product_expense_hotel"/>
<field model="hr.expense.expense" name="expense_id" search="[('name', '=', u'Travel Expenses')]"/>
<field name="product_id" ref="hotel_rent"/>
<field name="expense_id" ref="sep_expenses"/>
<field eval="400.0" name="unit_amount"/>
<field name="uom_id" ref="product.product_uom_unit"/>
<field eval="5.0" name="unit_quantity"/>
</record>
<record id="hr_expense_line_car_travel" model="hr.expense.line">
<record id="car_travel_sep" model="hr.expense.line">
<field name="name">Bruxelles - Paris</field>
<field name="date_value" eval="time.strftime('%Y-%m-03')"/>
<field name="date_value" eval="time.strftime('%Y-09-15')"/>
<field name="analytic_account" ref="account.analytic_thymbra"/>
<field name="product_id" ref="product_product_expense_car"/>
<field model="hr.expense.expense" name="expense_id" search="[('name', '=', u'Travel Expenses')]"/>
<field name="product_id" ref="car_travel"/>
<field name="expense_id" ref="sep_expenses"/>
<field eval="0.30" name="unit_amount"/>
<field name="uom_id" ref="product.product_uom_km"/>
<field eval="622.0" name="unit_quantity"/>
</record>
</data>
</openerp>
+11
View File
@@ -0,0 +1,11 @@
-
!record {model: hr.expense.expense, id: sep_expenses}:
employee_id: hr.employee4
name : 'John Smith'
-
!record {model: product.product, id: car_travel}:
hr_expense_ok: 'True'
-
!record {model: hr.expense.line, id: expense_line}:
product_id: car_travel
name: 'Car Travel Expenses'
@@ -0,0 +1,60 @@
-
In order to test the process of "Employee Expenses" by processing the expenses, I confirm Expense Bill of an employee for September month.
-
!workflow {model: hr.expense.expense, action: confirm, ref: sep_expenses}
-
I check that state is 'Confirm'.
-
!assert {model: hr.expense.expense, id: sep_expenses, severity: error, string: Expense should be in Confirm state}:
- state == 'confirm'
-
I approve the September expenses.
-
!workflow {model: hr.expense.expense, action: validate, ref: sep_expenses}
-
I check that state is 'Approved'
-
!assert {model: hr.expense.expense, id: sep_expenses, severity: error, string: Expense should be in Approved state}:
- state == 'accepted'
-
I make Invoice for the expense.
-
!python {model: hr.expense.expense}: |
self.invoice(cr, uid, [ref('sep_expenses')])
-
I check invoice details.
-
!python {model: hr.expense.expense}: |
sep_expenses = self.browse(cr, uid, ref("sep_expenses"), context=context)
assert sep_expenses.state == 'invoiced', "Expense should be in 'Invoiced' state."
assert sep_expenses.invoice_id, "Expense should have link of Invoice."
assert sep_expenses.invoice_id.currency_id == sep_expenses.currency_id,"Invoice currency is not correspond with supplier invoice currency"
assert sep_expenses.invoice_id.origin == sep_expenses.name,"Invoice origin is not correspond with supplier invoice"
assert sep_expenses.invoice_id.type == 'in_invoice', "Invoice type is not supplier invoice"
assert sep_expenses.invoice_id.amount_total == sep_expenses.amount,"Invoice total amount is not correspond with supplier invoice total"
assert len(sep_expenses.invoice_id.invoice_line) == len(sep_expenses.line_ids),"Lines of Invoice and supplier invoice Line are not correspond"
#TODO: check invoice line details with Expenses lines
-
I pay the expenses.
-
!python {model: hr.expense.expense}: |
self.expense_paid(cr, uid, [ref('sep_expenses')])
-
I check that state of expenses is 'Paid'.
-
!assert {model: hr.expense.expense, id: sep_expenses, severity: error, string: Expense should be in Paid state}:
- state == 'paid'
-
I duplicate the expenses and cancel duplicated.
-
!python {model: hr.expense.expense}: |
duplicate_id = self.copy(cr, uid, ref('sep_expenses'), context=context)
self.expense_canceled(cr, uid, [duplicate_id])
-
I print a report of the expenses.
-
!python {model: hr.expense.expense}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.hr.expense').create(cr, uid, [ref('hr_expense.sep_expenses')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'hr_expense-report.'+format), 'wb+').write(data)
@@ -1,8 +0,0 @@
-
In order to test the PDF reports defined on a HR Expense, we will print a HR Expense
-
!python {model: hr.expense.expense}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.hr.expense').create(cr, uid, [ref('hr_expense.hr_expense_expense_septemberexpenses0'),ref('hr_expense.hr_expense_expense_septemberexpenses1')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'hr_expense-report.'+format), 'wb+').write(data)
-121
View File
@@ -1,121 +0,0 @@
-
In order to test hr_expenses for OpenERP, I create expenses for employee and manage employee's expenses.
-
I create an unit of measure category "Working Time".
-
!record {model: product.uom.categ, id: product_uom_categ_workingtime0}:
name: Working Time.
-
I create a new employee.
-
!record {model: hr.employee, id: hr.employee}:
address_home_id: base.res_partner_address_1
address_id: base.main_address
-
I assign home address to employee.
-
!record {model: hr.employee, id: hr.employee1}:
address_home_id: base.res_partner_address_1
address_id: base.main_address
-
I create product unit of measure "Hour".
-
!record {model: product.uom, id: product_uom_hour0}:
category_id: 'product_uom_categ_workingtime0'
factor: 8.0
name: Hour
rounding: 0.01
-
I Create a product "travel".
-
!record {model: product.product, id: product_product_travel0}:
categ_id: product.product_category_services
cost_method: standard
list_price: 800.0
mes_type: fixed
name: Travel
procure_method: make_to_stock
standard_price: 700.0
supply_method: buy
type: product
uom_id: 'product_uom_hour0'
uom_po_id: 'product_uom_hour0'
volume: 0.0
warranty: 0.0
weight: 0.0
weight_net: 0.0
-
I mark this product for expenses.
-
!python {model: product.product}: |
self.on_change_hr_expense_ok(cr, uid, [ref('product_product_travel0')], True)
-
I create an expense.
-
!record {model: hr.expense.expense, id: hr_expense_expense_september0}:
company_id: base.main_company
date: !eval "'%s-05-05' %(datetime.now().year)"
name: September Expenses
line_ids:
- date_value: !eval "'%s-05-27' %(datetime.now().year)"
name: Travel
product_id: 'product_product_travel0'
sequence: 0.0
uom_id: product.product_uom_unit
unit_amount: 700.0
user_id: base.user_root
-
I check that expense is in "Draft" state.
-
!assert {model: hr.expense.expense, id: hr_expense_expense_september0}:
- state == 'draft'
-
I change the employee on expense form.
-
!python {model: hr.expense.expense}: |
res = self.onchange_employee_id(cr, uid, [ref('hr_expense_expense_september0')], ref('hr.employee1'), None)
values = dict([('employee_id', ref('hr.employee1'))] + res['value'].items())
self.write(cr, uid, [ref('hr_expense_expense_september0')], values, None)
-
Now I change the related product on expense line.
-
!python {model: hr.expense.expense}: |
exp_line_obj = self.pool.get('hr.expense.line')
exp_obj = self.browse(cr, uid, ref('hr_expense_expense_september0'), None)
line_ids = [line.id for line in exp_obj.line_ids]
res = exp_line_obj.onchange_product_id(cr, uid, line_ids, ref('product_product_expense_air'), False, ref('hr.employee1'), None)
values = dict([('product_id', ref('product_product_expense_air'))] + res['value'].items())
exp_line_obj.write(cr, uid, line_ids, values, None)
-
I confirm this expenses by click on "Confirm" button.
-
!workflow {model: hr.expense.expense, action: confirm, ref: hr_expense_expense_september0}
-
I check that state is "Waiting Confirmation".
-
!assert {model: hr.expense.expense, id: hr_expense_expense_september0}:
- state == 'confirm'
-
I accept this expense by click on "Accept" button.
-
!workflow {model: hr.expense.expense, action: validate, ref: hr_expense_expense_september0}
-
I invoiced this expense by click on "Invoice" button.
-
!python {model: hr.expense.expense}: |
self.invoice(cr, uid, [ref('hr_expense_expense_september0')], None)
-
I check that state is "Invoiced".
-
!assert {model: hr.expense.expense, id: hr_expense_expense_september0}:
- state == 'invoiced'
-
I check that Invoice is created for the expense.
-
!python {model: hr.expense.expense}: |
exp = self.browse(cr, uid, [ref('hr_expense_expense_september0')])[0]
assert exp.invoice_id, "Invoice should be created"
+4 -2
View File
@@ -3,10 +3,12 @@
<data>
<record model="res.groups" id="base.group_tool_user">
<field name="name">Tools / User</field>
<field name="name">User</field>
<field name="category_id" ref="base.module_category_tools"/>
</record>
<record model="res.groups" id="base.group_tool_manager">
<field name="name">Tools / Manager</field>
<field name="name">Manager</field>
<field name="category_id" ref="base.module_category_tools"/>
<field name="implied_ids" eval="[(4, ref('base.group_tool_user'))]"/>
</record>
@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">
<record id="base.group_sale_manager" model="res.groups">
<field name="name">Sales / Manager</field>
</record>
<record id="base.group_document_user" model="res.groups">
<field name="name">Knowledge / User</field>
</record>
<record id="base.group_document_user" model="res.groups">
<field name="name">User</field>
<field name="category_id" ref="base.module_category_knowledge_management"/>
</record>
</data>
</openerp>
+1 -1
View File
@@ -24,7 +24,7 @@
"version" : "1.0",
"author" : "conexus.at",
"website" : "http://www.conexus.at",
"category" : "Localization",
"category" : "Localization/Account Charts",
"depends" : ["account_chart", 'base_vat'],
"description": "This module provides the standard Accounting Chart for Austria which is based on the Template from BMF.gv.at. Please keep in mind that you should review and adapt it with your Accountant, before using it in a live Environment.",
"demo_xml" : [],
+1 -1
View File
@@ -20,7 +20,7 @@
##############################################################################
{ 'name': 'Belgium - Accounting',
'version': '1.1',
'category': 'Localization',
'category': 'Localization/Account Charts',
'description': """
This is the base module to manage the accounting chart for Belgium in OpenERP.
==============================================================================
+1 -1
View File
@@ -20,7 +20,7 @@
{
'name': 'Brazilian - Accounting',
'category': 'Localization',
'category': 'Localization/Account Charts',
'description': """
Base module for the Brazilian localization
==========================================
+1 -1
View File
@@ -23,7 +23,7 @@
"version" : "1.0",
"author" : "Savoir-faire Linux",
"website" : "http://www.savoirfairelinux.com",
"category" : "Localization",
"category" : "Localization/Account Charts",
"description": """
This is the module to manage the English and French - Canadian accounting chart in OpenERP.
===========================================================================================
+1 -1
View File
@@ -63,7 +63,7 @@ TODO :
""",
"version" : "6.1",
"author" : "Camptocamp",
'category': 'Localization',
'category': 'Localization/Account Charts',
"website": "http://www.camptocamp.com",
"depends" : [
+1 -1
View File
@@ -20,7 +20,7 @@
{
"name" : "中国会计科目表 - Accounting",
"version" : "1.0",
"category": "Localization",
"category": "Localization/Account Charts",
"author" : "openerp-china.org",
"maintainer":"openerp-china.org",
"website":"http://openerp-china.org",
+1 -1
View File
@@ -38,7 +38,7 @@
'url': 'http://launchpad.net/openerp-costa-rica',
'author': 'ClearCorp S.A.',
'website': 'http://clearcorp.co.cr',
'category': 'Localization',
'category': 'Localization/Account Charts',
'description': """
Chart of accounts for Costa Rica.
=================================
+1 -1
View File
@@ -125,7 +125,7 @@
"version" : "1.0",
"author" : "openbig.org",
"website" : "http://www.openbig.org",
"category" : "Localization",
"category" : "Localization/Account Charts",
"description": """
Dieses Modul beinhaltet einen deutschen Kontenrahmen basierend auf dem SKR03.
==============================================================================
+1 -1
View File
@@ -20,7 +20,7 @@
{
'name': 'Ecuador - Accounting',
'version': '1.1',
'category': 'Localization',
'category': 'Localization/Account Charts',
'description': """
This is the base module to manage the accounting chart for Ecuador in OpenERP.
==============================================================================
+1 -1
View File
@@ -26,7 +26,7 @@
"version" : "3.0",
"author" : "Spanish Localization Team",
'website' : 'https://launchpad.net/openerp-spain',
"category" : "Localization",
"category" : "Localization/Account Charts",
"description": """
Spanish Charts of Accounts (PGCE 2008).
=======================================
+1 -1
View File
@@ -30,7 +30,7 @@
"version" : "1.0",
"author" : "OpenERP SA",
"website": "http://www.openerp.com",
"category" : "Localization",
"category" : "Localization/Account Charts",
"description": """
This is the module to manage the accounting chart for France in OpenERP.
========================================================================
+1 -1
View File
@@ -24,7 +24,7 @@
"version" : "0.2",
"author" : "P. Christeas, OpenERP SA.",
"website": "http://openerp.hellug.gr/",
"category" : "Localization",
"category" : "Localization/Account Charts",
"description": """
This is the base module to manage the accounting chart for Greece.
==================================================================
+1 -1
View File
@@ -35,7 +35,7 @@
{
'name': 'Guatemala - Accounting',
'version': '3.0',
'category': 'Localization',
'category': 'Localization/Account Charts',
'description': """
This is the base module to manage the accounting chart for Guatemala.
=====================================================================
+1 -1
View File
@@ -35,7 +35,7 @@
{
'name': 'Honduras - Accounting',
'version': '0.1',
'category': 'Localization',
'category': 'Localization/Account Charts',
'description': """Agrega una nomenclatura contable para Honduras. También incluye impuestos y la moneda Lempira. -- Adds accounting chart for Honduras. It also includes taxes and the Lempira currency""",
'author': 'Salvatore Josue Trimarchi Pinto',
'website': 'http://trimarchi.co.cc',
+1 -1
View File
@@ -29,7 +29,7 @@ Indian Accounting : Chart of Account.
Indian accounting chart and localization.
""",
"author": ['OpenERP SA', 'Axelor'],
"category": "Localization",
"category": "Localization/Account Charts",
"depends": [
"account",
"account_chart"
+1 -1
View File
@@ -39,7 +39,7 @@ Piano dei conti italiano di un'impresa generica.
Italian accounting chart and localization.
""",
"license": "AGPL-3",
"category" : "Localization",
"category" : "Localization/Account Charts",
'website': 'http://www.openerp-italia.org/',
'init_xml': [
],
+1 -1
View File
@@ -23,7 +23,7 @@
{
'name': 'Luxembourg - Accounting',
'version': '1.0',
'category': 'Localization',
'category': 'Localization/Account Charts',
'description': """
This is the base module to manage the accounting chart for Luxembourg.
======================================================================
+1 -1
View File
@@ -23,7 +23,7 @@
"name" : "Maroc - Accounting",
"version" : "1.0",
"author" : "kazacube",
"category" : "Localization",
"category" : "Localization/Account Charts",
"description": """
This is the base module to manage the accounting chart for Maroc.
=================================================================
+1 -1
View File
@@ -23,7 +23,7 @@
"name" : "Mexico - Accounting",
"version" : "1.0",
"author" : "RelTek Mexico",
"category" : "Localization",
"category" : "Localization/Account Charts",
"description": """
This is the module to manage the accounting chart for Mexico in OpenERP.
========================================================================
+1 -1
View File
@@ -88,7 +88,7 @@
{
"name" : "Netherlands - Accounting",
"version" : "1.5",
"category": "Localization",
"category": "Localization/Account Charts",
"description": """
This is the module to manage the accounting chart for Netherlands in OpenERP.
=============================================================================
+1 -1
View File
@@ -25,7 +25,7 @@
"version" : "1.0",
"author" : "Grzegorz Grzelak (Cirrus)",
"website": "http://www.cirrus.pl",
"category" : "Localization",
"category" : "Localization/Account Charts",
"description": """
This is the module to manage the accounting chart and taxes for Poland in OpenERP.
==================================================================================
+1 -1
View File
@@ -24,7 +24,7 @@
"version" : "1.1",
"author" : "filsys",
"website": "http://www.filsystem.ro",
"category" : "Localization",
"category" : "Localization/Account Charts",
"depends" : ["account_chart", 'base_vat'],
"description": """
This is the module to manage the accounting chart, VAT structure and Registration Number for Romania in OpenERP.
+1 -1
View File
@@ -23,7 +23,7 @@
"name" : "OHADA - Accounting",
"version" : "1.0",
"author" : "Baamtu Senegal",
"category" : "Localization",
"category" : "Localization/Account Charts",
"description": """This module implements the accounting chart for OHADA area.
It allows any company or association to manage its financial accounting.
Countries that use OHADA are the following:
+1 -1
View File
@@ -22,7 +22,7 @@
{
'name': 'Thailand - Accounting',
'version': '1.0',
'category': 'Localization',
'category': 'Localization/Account Charts',
'description': """
Chart of Accounts for Thailand.
===============================
+1 -1
View File
@@ -22,7 +22,7 @@
{
'name': 'UK - Accounting',
'version': '1.0',
'category': 'Localization',
'category': 'Localization/Account Charts',
'description': """This is the latest UK OpenERP localisation necesary to run OpenERP accounting for UK SME's with:
- a CT600-ready chart of accounts
- VAT100-ready tax structure
+1 -1
View File
@@ -26,7 +26,7 @@
"name" : "Venezuela - Accounting",
"version" : "1.0",
"author" : ['OpenERP SA', "Netquatro"],
"category" : "Localization",
"category" : "Localization/Account Charts",
"description":
'''
This is the module to manage the accounting chart for Venezuela in OpenERP.
+4 -2
View File
@@ -3,10 +3,12 @@
<data noupdate="0">
<record model="res.groups" id="base.group_tool_user">
<field name="name">Tools / User</field>
<field name="name">User</field>
<field name="category_id" ref="base.module_category_tools"/>
</record>
<record model="res.groups" id="base.group_tool_manager">
<field name="name">Tools / Manager</field>
<field name="name">Manager</field>
<field name="category_id" ref="base.module_category_tools"/>
<field name="implied_ids" eval="[(4, ref('base.group_tool_user'))]"/>
</record>
@@ -2,11 +2,13 @@
<openerp>
<data>
<record id="marketing.group_marketing_user" model="res.groups">
<field name="name">Marketing / User</field>
<field name="name">User</field>
<field name="category_id" ref="base.module_category_marketing"/>
</record>
<record id="marketing.group_marketing_manager" model="res.groups">
<field name="name">Marketing / Manager</field>
<field name="name">Manager</field>
<field name="category_id" ref="base.module_category_marketing"/>
<field name="implied_ids" eval="[(4, ref('marketing.group_marketing_user'))]"/>
</record>
+4 -2
View File
@@ -3,10 +3,12 @@
<data noupdate="0">
<record id="group_mrp_user" model="res.groups">
<field name="name">Manufacturing / User</field>
<field name="name">User</field>
<field name="category_id" ref="base.module_category_manufacturing"/>
</record>
<record id="group_mrp_manager" model="res.groups">
<field name="name">Manufacturing / Manager</field>
<field name="name">Manager</field>
<field name="category_id" ref="base.module_category_manufacturing"/>
<field name="implied_ids" eval="[(4, ref('group_mrp_user'))]"/>
</record>
@@ -3,10 +3,12 @@
<data noupdate="1">
<record id="group_pos_user" model="res.groups">
<field name="name">Point of Sale / User</field>
<field name="name">User</field>
<field name="category_id" ref="base.module_category_point_of_sale"/>
</record>
<record id="group_pos_manager" model="res.groups">
<field name="name">Point of Sale / Manager</field>
<field name="name">Manager</field>
<field name="category_id" ref="base.module_category_point_of_sale"/>
<field name="implied_ids" eval="[(4, ref('group_pos_user')), (4, ref('stock.group_stock_user'))]"/>
</record>
+10 -2
View File
@@ -1,13 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record model="ir.module.category" id="module_category_portal">
<field name="name">Portal</field>
<field name="parent_id" ref="base.module_category_tools"/>
<field name="sequence">25</field>
</record>
<record id="group_portal_officer" model="res.groups">
<field name="name">Portal / Officer</field>
<field name="name">Officer</field>
<field name="comment">Portal officers can create new portal users with the portal wizard.</field>
<field name="category_id" ref="module_category_portal"/>
</record>
<record id="group_portal_manager" model="res.groups">
<field name="name">Portal / Manager</field>
<field name="name">Manager</field>
<field name="comment">Portal managers have access to the portal definitions, and can easily configure the users, access rights and menus of portal users.</field>
<field name="category_id" ref="module_category_portal"/>
<field name="implied_ids" eval="[(4, ref('group_portal_officer'))]"/>
</record>
</data>
+4 -9
View File
@@ -3,14 +3,8 @@
<data noupdate="1">
<record id="group_uos" context="{'noadmin':True}" model="res.groups">
<field name="name">Useability / Product UoS View</field>
</record>
<record id="base.group_sale_manager" model="res.groups">
<field name="name">Sales / Manager</field>
</record>
<record id="base.group_sale_salesman" model="res.groups">
<field name="name">Sales / User</field>
<field name="name">Product UoS View</field>
<field name="category_id" ref="base.module_category_usability"/>
</record>
<record id="product_comp_rule" model="ir.rule">
@@ -21,7 +15,8 @@
</record>
<record id="group_product_variant" model="res.groups" context="{'noadmin':True}">
<field name="name">Useability / Product Variant</field>
<field name="name">Product Variant</field>
<field name="category_id" ref="base.module_category_usability"/>
</record>
<record model="ir.rule" id="product_pricelist_comp_rule">
+3 -2
View File
@@ -62,8 +62,9 @@ Dashboard for project members that includes:
'project_demo.xml',
],
'test':[
'test/test_project.yml',
'test/test_project_delegation.yml',
'test/project_demo.yml',
'test/project_process.yml',
'test/task_process.yml',
],
'installable': True,
'active': False,
+3 -2
View File
@@ -114,6 +114,7 @@ class project(osv.osv):
if task.project_id: result[task.project_id.id] = True
return result.keys()
#dead code
def _get_project_work(self, cr, uid, ids, context=None):
result = {}
for work in self.pool.get('project.task.work').browse(cr, uid, ids, context=context):
@@ -360,7 +361,7 @@ def Project():
working_days = %s
resource = %s
""" % (
project.id,
project.id,
project.date_start, working_days,
'|'.join(['User_'+str(x) for x in puids])
)
@@ -1100,7 +1101,7 @@ class account_analytic_account(osv.osv):
if vals.get('child_ids', False) and context.get('analytic_project_copy', False):
vals['child_ids'] = []
return super(account_analytic_account, self).create(cr, uid, vals, context=context)
def unlink(self, cr, uid, ids, *args, **kwargs):
project_obj = self.pool.get('project.project')
analytic_ids = project_obj.search(cr, uid, [('analytic_account_id','in',ids)])
+4 -6
View File
@@ -3,18 +3,16 @@
<data noupdate="1">
<record id="group_project_user" model="res.groups">
<field name="name">Project / User</field>
<field name="name">User</field>
<field name="category_id" ref="base.module_category_project_management"/>
</record>
<record id="group_project_manager" model="res.groups">
<field name="name">Project / Manager</field>
<field name="name">Manager</field>
<field name="category_id" ref="base.module_category_project_management"/>
<field name="implied_ids" eval="[(4, ref('group_project_user'))]"/>
</record>
<record id="base.group_sale_salesman" model="res.groups">
<field name="name">Sales / User</field>
</record>
<record model="ir.ui.menu" id="menu_definitions">
<field name="groups_id" eval="[(6,0,[ref('group_project_manager')])]"/>
</record>
+12
View File
@@ -0,0 +1,12 @@
-
!record {model: project.project, id: project_integrate_openerp, view: False}:
partner_id: base.res_partner_agrolait
-
!record {model: project.task, id: project_task_1, view: False}:
remaining_hours: 10.00
-
!record {model: project.task, id: project_task_1, view: False}:
planned_hours: 10.00
-
!record {model: project.task, id: project_task_1, view: False}:
project_id: project_integrate_openerp
+70
View File
@@ -0,0 +1,70 @@
-
In order to Test Process of Project Management,
-
I create duplicate template.
-
!python {model: project.project}: |
new_template = self.duplicate_template(cr, uid, [ref("project_integrate_openerp")])
assert new_template, "duplicate template is not created"
template = self.browse(cr, uid, new_template['res_id'], context=context)
assert template.state == 'open', "Duplicate template must be in open state."
-
I convert template into real Project.
-
!python {model: project.project}: |
self.reset_project(cr, uid, [ref("project_integrate_openerp")])
-
I check project details after convert from template.
-
!assert {model: project.project, id: project_integrate_openerp, severity: error, string: Project should be active}:
- state == "open"
-
I put project in pending.
-
!python {model: project.project}: |
self.set_pending(cr, uid, [ref("project_integrate_openerp")])
-
I check state after put in pending.
-
!assert {model: project.project, id: project_integrate_openerp, severity: error, string: Project should be in pending state}:
- state == "pending"
-
I re-open the project.
-
!python {model: project.project}: |
self.set_open(cr, uid, [ref("project_integrate_openerp")])
-
I check state after reopen.
-
!assert {model: project.project, id: project_integrate_openerp, severity: error, string: Project should be open.}:
- state == "open"
-
I close the project.
-
!python {model: project.project}: |
self.set_done(cr, uid, [ref("project_integrate_openerp")])
-
I check state after closed.
-
!assert {model: project.project, id: project_integrate_openerp, severity: error, string: Project should be close.}:
- state == "close"
-
I set project into template.
-
!python {model: project.project}: |
self.set_template(cr, uid, [ref("project_integrate_openerp")])
-
I schedule tasks of project.
-
!python {model: project.project}: |
self.schedule_tasks(cr, uid, [ref("project_integrate_openerp")], context=context)
-
I copy the tasks of project.
-
!python {model: project.project}: |
self.template_copy(cr, uid, ref("project_integrate_openerp"))
-
I cancel Project.
-
!python {model: project.project}: |
self.set_cancel(cr, uid, [ref("project_project_9")])
+76
View File
@@ -0,0 +1,76 @@
-
I put task in pending due to specification is not clear.
-
!python {model: project.task}: |
self.do_pending(cr, uid, [ref("project_task_1")])
context.update({"active_id": ref("project_task_1")})
-
I check state of task after put in pending.
-
!assert {model: project.task, id: project_task_1, severity: error, string: task should be in pending state}:
- state == "pending"
-
!record {model: project.task.delegate, id: delegate_id}:
user_id: res_users_analyst
planned_hours: 12.0
planned_hours_me: 2.0
-
Now I delegate task to team member.
-
!python {model: project.task.delegate}: |
self.delegate(cr, uid, [ref("delegate_id")], {"active_id": ref("project_task_1")})
-
I check delegated task details.
-
!python {model: project.task}: |
task = self.browse(cr, uid, ref("project_task_1"), context=context)
assert task.planned_hours == 2.0, "Planning hours is not correct after delegated."
assert task.state == "pending", "Task should be in Pending after delegated."
-
I re-open the task.
-
!python {model: project.task}: |
self.do_reopen(cr, uid, [ref("project_task_1")])
-
I check reopened task details.
-
!assert {model: project.task, id: project_task_1, severity: error, string: task should be open.}:
- state == "open"
-
I change the stage of task to next stage.
-
!python {model: project.task}: |
self.next_type(cr, uid, [ref("project_task_1")])
-
!record {model: project.task.reevaluate, id: reevaluate_id}:
remaining_hours : 120
-
I reevaluate task with remaining hours.
-
!python {model: project.task.reevaluate}: |
self.compute_hours(cr, uid, [ref("reevaluate_id")], {"active_id": ref("project_task_1")})
-
I check remaining hours after reevaluated task.
-
!assert {model: project.task, id: project_task_1, severity: error, string: task should be reevaluated}:
- remaining_hours == 120.0
-
I close the task.
-
!python {model: project.task}: |
self.action_close(cr, uid, [ref("project_task_1")])
-
I check state after closed.
-
!assert {model: project.task, id: project_task_1, severity: error, string: task is in open state}:
- state == "done"
-
I change the stage of task to previous stage.
-
!python {model: project.task}: |
self.prev_type(cr, uid, [ref("project_task_1")])
-
I cancel Task.
-
!python {model: project.task}: |
self.do_cancel(cr, uid, [ref("project_task_2")])
-296
View File
@@ -1,296 +0,0 @@
-
Test project template feature
-
Create project 'OpenERP Training Programme'
-
!record {model: project.project, id: project_project_openerptrainingprogramme0}:
company_id: base.main_company
name: OpenERP Training Programme
-
Create task 'Technical Training' for this project
-
!record {model: project.task, id: project_task_technicaltraining0}:
date_start: !eval time.strftime('%Y-%m-%d %H:%M:%S')
name: Technical Training
planned_hours: 30.0
project_id: project_project_openerptrainingprogramme0
remaining_hours: 30.0
state: draft
-
Create task 'Functional Training' for this project
-
!record {model: project.task, id: project_task_functionaltraining0}:
date_start: !eval time.strftime('%Y-%m-%d %H:%M:%S')
name: Functional Training
planned_hours: 30.0
project_id: project_project_openerptrainingprogramme0
remaining_hours: 30.0
state: draft
-
Set project as project template
-
!python {model: project.project}: |
self.set_template(cr, uid, [ref("project_project_openerptrainingprogramme0")],
{"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_open_view_project_all")],
"tz": False, "active_id": ref("project.menu_open_view_project_all"), })
-
Check if project in template state
-
!assert {model: project.project, id: project_project_openerptrainingprogramme0, severity: error, string: Project is in template state}:
- state == "template"
-
Create new project based on this template
-
!python {model: project.project}: |
new_prj = self.duplicate_template(cr, uid, [ref("project_project_openerptrainingprogramme0")],
{"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_open_view_project_all")],
"tz": False, "active_id": ref("project.menu_open_view_project_all"), })
if not new_prj:
raise Exception( "New project based on template not created")
new_id = new_prj['res_id']
new_prj = self.read(cr, uid, [new_id], ['name', 'state'])[0]
state = new_prj['state']
name = new_prj['name']
assert state == 'open', "Project in %s state. Project created from template project must be in open state"%state
-
Reset project template to normal project
-
!python {model: project.project}: |
self.reset_project(cr, uid, [ref("project_project_openerptrainingprogramme0")], {"lang": "en_US", "active_ids":
[ref("project.menu_open_view_project_all")], "tz": False, "active_model":
"ir.ui.menu", "project_id": False, "active_id": ref("project.menu_open_view_project_all"),
})
-
Check if project in open state
-
!assert {model: project.project, id: project_project_openerptrainingprogramme0, severity: error, string: Project is in open state}:
- state == "open"
-
Test for different project-states
-
Keep project pending
-
!python {model: project.project}: |
self.set_pending(cr, uid, [ref("project_project_openerptrainingprogramme0")], {"lang": "en_US", "active_ids":
[ref("project.menu_open_view_project_all")], "tz": False, "active_model":
"ir.ui.menu", "project_id": False, "active_id": ref("project.menu_open_view_project_all"),
})
-
Check if project in pending state
-
!assert {model: project.project, id: project_project_openerptrainingprogramme0, severity: error, string: Project is in pending state}:
- state == "pending"
-
Cancel the project
-
!python {model: project.project}: |
self.set_cancel(cr, uid, [ref("project_project_openerptrainingprogramme0")], {"lang": "en_US", "active_ids":
[ref("project.menu_open_view_project_all")], "tz": False, "active_model":
"ir.ui.menu", "project_id": False, "active_id": ref("project.menu_open_view_project_all"),
})
-
Check if project in cancel state
-
!assert {model: project.project, id: project_project_openerptrainingprogramme0, severity: error, string: Project is in cancel state}:
- state == "cancelled"
-
Re-open the project
-
!python {model: project.project}: |
self.set_open(cr, uid, [ref("project_project_openerptrainingprogramme0")], {"lang": "en_US", "active_ids": [ref("project.menu_open_view_project_all")],
"tz": False, "active_model": "ir.ui.menu", "project_id": False, "active_id":
ref("project.menu_open_view_project_all"), })
-
Check if project in open state
-
!assert {model: project.project, id: project_project_openerptrainingprogramme0, severity: error, string: Project is in open state}:
- state == "open"
-
Test for task work allocation
-
As i cancelled my project before, i check if the task 'Technical Training' is in cancelled state
-
!assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: Task is in cancelled state}:
- state == "cancelled"
-
Now in order to reactivate the task 'Technical Training', i click on the "Reactivate" button and fill the remaining hour field
-
!record {model: project.task.reevaluate, id: project_task_technicaltraining_remainingwiz0}:
remaining_hours: 30.0
- |
I click the apply button
-
!python {model: project.task.reevaluate}: |
self.compute_hours(cr, uid, [ref('project_task_technicaltraining_remainingwiz0')], {'active_id': ref("project_task_technicaltraining0"),'button_reactivate': True})
- |
Check if task 'Technical Training' in open state and for other initial values
-
!assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: Project is in open state}:
- state == "open"
- planned_hours == 30
- remaining_hours == 30
- delay_hours == 0.0
- effective_hours == 0.0
-
Make a work task entry 'Training on OpenERP modules, models and classes' of 10 hours
-
!record {model: project.task, id: project_task_technicaltraining0, context:{'no_analytic_entry':True}}:
work_ids:
- date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
hours: 10.0
name: Training on OpenERP modules, models and classes
user_id: base.user_root
-
Check for effective hours and remaining hours, effective_hours must be equal to 10
-
!assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: After work task of 10 hours effective_hours must be equal to 10}:
- remaining_hours == 20
- effective_hours == 10.0
-
Make a work task entry 'Training on OpenERP xml views' of 10 hours
-
!record {model: project.task, id: project_task_technicaltraining0, context:{'no_analytic_entry':True}}:
work_ids:
- date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
hours: 10.0
name: Training on OpenERP xml views
user_id: base.user_root
-
Check for effective hours and remaining hours, effective_hours must be equal to 20
-
!assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: After one more work task of 10 hours effective_hours must be equal to 20}:
- remaining_hours == 10
- effective_hours == 20.0
-
Make a work task entry 'Training on workflows' of 10 hours
-
!record {model: project.task, id: project_task_technicaltraining0, context:{'no_analytic_entry':True}}:
work_ids:
- date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
hours: 10.0
name: Training on workflows
user_id: base.user_root
-
Check for effective hours and remaining hours, effective_hours must be equal to 30
-
!assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: After one more work task of 10 hours effective_hours must be equal to 30}:
- remaining_hours == 0
- effective_hours == 30.0
-
Set remaining hours of 10 hours for reevaluating the task
-
!record {model: project.task.reevaluate, id: config_compute_remaining_0}:
remaining_hours: 10.0
-
Reevaluate the task
-
!python {model: project.task.reevaluate}: |
self.compute_hours(cr, uid, [ref("config_compute_remaining_0")], {"lang": "en_US",
"project_id": False, "tz": False, "active_model": "project.task", "search_default_project_id":
False, "search_default_user_id": 1, "search_default_current": 1, "active_ids":
[ref("project_task_technicaltraining0")], "active_id": ref("project_task_technicaltraining0"), })
-
Check for effective hours and remaining hours, remaining_hours must be 10 while planned_hours remains 30
-
!assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: After reevaluating the task with 10 hours remaining_hours must be 10 while planned_hours remains 30}:
- planned_hours == 30
- remaining_hours == 10.0
- effective_hours == 30.0
-
Make a work task entry 'Training on reports and wizards' of 10 hours
-
!record {model: project.task, id: project_task_technicaltraining0, context:{'no_analytic_entry':True}}:
work_ids:
- date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
hours: 10.0
name: Training on reports and wizards
user_id: base.user_root
-
Check for effective hours and remaining hours
-
!assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: After one more work task of 10 hours effective_hours must be equal to 40 while planned_hours remains 30}:
- planned_hours == 30
- remaining_hours == 0
- effective_hours == 40.0
-
Close the task
-
!python {model: project.task}: |
self.do_close(cr, uid, [ref("project_task_technicaltraining0")], {'mail_send': False})
-
Check if task in done state
-
!assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: Task is in done state}:
- state == "done"
-
Test for task reactivation
-
Reactivate task
-
!record {model: project.task.reevaluate, id: config_compute_remaining_1}:
remaining_hours: 10.0
-
Reevaluate the task with 10 hours remaining
-
!python {model: project.task.reevaluate}: |
self.compute_hours(cr, uid, [ref("config_compute_remaining_1")], {"lang": "en_US",
"project_id": False, "tz": False, "button_reactivate": True, "active_model":
"project.task", "search_default_project_id": False, "search_default_user_id":
1, "search_default_current": 1, "active_ids": [ref("project_task_technicaltraining0")], "active_id": ref("project_task_technicaltraining0"),
})
-
Check for effective hours and remaining hours, remaining_hours must be 10 while planned_hours remains 30
-
!assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: After reevaluating the task with 10 hours remaining_hours must be 10 while planned_hours remains 30}:
- planned_hours == 30
- remaining_hours == 10.0
- effective_hours == 40.0
-
Make a work task entry 'Training on yml' of 5 hours
-
!record {model: project.task, id: project_task_technicaltraining0, context:{'no_analytic_entry':True}}:
work_ids:
- date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
hours: 5.0
name: Training on yml
user_id: base.user_root
-
Check for effective hours and remaining hours, remaining_hours must be 5, effective_hours must be 45
-
!assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: After work task of 5 hours effective_hours must be equal to 45 and remaining_hours is 5}:
- planned_hours == 30
- remaining_hours == 5.0
- effective_hours == 45.0
-
Close the task
-
!python {model: project.task}: |
self.do_close(cr, uid, [ref("project_task_technicaltraining0")], {'mail_send': False})
-
Check if task in done state
-
!assert {model: project.task, id: project_task_technicaltraining0, severity: error}:
- state == "done"
-
Check for effective hours and remaining hours
-
!assert {model: project.task, id: project_task_technicaltraining0, severity: error, string: After closing the task planned_hours must remain 30 effective_hours must be 45 and remaining hours must be 0}:
- planned_hours == 30
- remaining_hours == 0.0
- effective_hours == 45.0
-
Close project 'OpenERP Training Programme'
-
!python {model: project.project}: |
self.set_done(cr, uid, [ref("project_project_openerptrainingprogramme0")], {"lang": "en_US", "active_ids": [ref("project.menu_open_view_project_all")],
"tz": False, "active_model": "ir.ui.menu", "project_id": False, "active_id":
ref("project.menu_open_view_project_all"), })
-
Check if project in close state
-
!assert {model: project.project, id: project_project_openerptrainingprogramme0, severity: error, string: "Project must be in closed state"}:
- state == "close"
@@ -1,230 +0,0 @@
-
This scenario tests the delegation process. Closing all the delegated tasks(task delegation at multiple levels) transits the parent task from pending to open state.
-
Creating a project OpenERP Documentation
-
!record {model: project.project, id: project_project_openerpdocumentation0}:
company_id: base.main_company
name: OpenERP Documentation
-
Creating a task 'Develop book for Technical and Functional reference'
-
!record {model: project.task, id: project_task_documentation_book}:
name: Develop book for Technical and Functional reference
planned_hours: 20.0
project_id: project_project_openerpdocumentation0
remaining_hours: 20.0
state: draft
-
Open the task
-
!python {model: project.task}: |
self.do_open(cr, uid, [ref("project_task_documentation_book")],
{"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
"tz": False, "active_id": ref("project.menu_action_view_task"), })
-
Creating a task 'Publish the References'
-
!record {model: project.task, id: project_task_publish_book}:
name: Publish the References
planned_hours: 10.0
project_id: project_project_openerpdocumentation0
remaining_hours: 10.0
state: draft
-
Open the task
-
!python {model: project.task}: |
self.do_open(cr, uid, [ref("project_task_publish_book")],
{"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
"tz": False, "active_id": ref("project.menu_action_view_task"), })
-
Test the delegate wizard
-
Creating a delegate task 'Publish the References' of 15 hours, renaming parent task to 'CHECK Publish the References' of 1 hour
-
!record {model: project.task.delegate, id: project_task_publish_book_delegate}:
name: Publish the References
new_task_description: aaa
planned_hours: 15.0
planned_hours_me: 1.0
prefix: 'CHECK: Publish the References'
state: pending
user_id: base.user_demo
-
Validating the delegate task
-
!python {model: project.task.delegate}: |
self.delegate(cr, uid, [ref("project_task_publish_book_delegate")],
{"lang": "en_US", "active_model": "project.task", "tz": False, "record_id":
4, "active_ids": [ref("project_task_publish_book")], "active_id": ref("project_task_publish_book"),
})
-
Check if parent task 'CHECK Publish the References' is in pending state
-
!assert {model: project.task, id: project_task_publish_book, severity: error, string: "Task must be in pending state after delegation"}:
- state == "pending"
-
Creating a delegate task 'Prepare a book that gives functional overview of OpenERP'
-
!record {model: project.task, id: project_task_delegate_openerp_tutorial}:
name: Prepare a book that gives functional overview of OpenERP
planned_hours: 30.0
project_id: project.project_project_openerpdocumentation0
remaining_hours: 30.0
state: draft
-
Open the task
-
!python {model: project.task}: |
self.do_open(cr, uid, [ref("project_task_delegate_openerp_tutorial")],
{"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
"tz": False, "active_id": ref("project.menu_action_view_task"), })
-
Creating a delegate task 'Prepare a technical reference for creating your modules'
-
!record {model: project.task, id: project_task_delegate_developer_book}:
name: Prepare a technical reference for creating your modules
planned_hours: 30.0
project_id: project_project_openerpdocumentation0
remaining_hours: 30.0
state: draft
-
Open the task
-
!python {model: project.task}: |
self.do_open(cr, uid, [ref("project_task_delegate_developer_book")],
{"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
"tz": False, "active_id": ref("project.menu_action_view_task"), })
-
Delegate task 'Develop book for Technical and Functional reference' to these tasks and make it pending
-
!record {model: project.task, id: project_task_documentation_book}:
child_ids:
- project.project_task_delegate_openerp_tutorial
- project.project_task_delegate_developer_book
planned_hours: 20.0
state: pending
-
Creating a delegate task 'Prepare documentation for Module Development'
-
!record {model: project.task, id: project_task_delegate_module_develop}:
name: Prepare documentation for Module Development
planned_hours: 30.0
project_id: project.project_project_openerpdocumentation0
remaining_hours: 30.0
state: draft
-
Creating a delegate 'Prepare documentation for Business Process Development'
-
!record {model: project.task, id: project_task_delegate_business_process_develop}:
name: Prepare documentation for Business Process Development
planned_hours: 30.0
project_id: project_project_openerpdocumentation0
remaining_hours: 30.0
state: draft
-
Delegate task 'Prepare a technical reference for creating your modules' to these tasks and make it pending
-
!record {model: project.task, id: project_task_delegate_developer_book}:
child_ids:
- project.project_task_delegate_module_develop
- project.project_task_delegate_business_process_develop
planned_hours: 20.0
state: pending
-
Open the task
-
!python {model: project.task}: |
self.do_open(cr, uid, [ref("project_task_delegate_module_develop")],
{"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
"tz": False, "active_id": ref("project.menu_action_view_task"), })
-
Open the task
-
!python {model: project.task}: |
self.do_open(cr, uid, [ref("project_task_delegate_business_process_develop")],
{"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
"tz": False, "active_id": ref("project.menu_action_view_task"), })
-
Check if 'Prepare a technical reference for creating your modules' in pending state
-
!assert {model: project.task, id: project_task_delegate_developer_book, severity: error, string: Task must be in pending state}:
- state == "pending"
-
Close the child task 'Prepare documentation for Module Development'
-
!python {model: project.task}: |
self.do_close(cr, uid, [ref("project_task_delegate_module_develop")], {"lang": "en_US",
"active_ids": [ref("project.menu_action_view_task")], "tz": False, "active_model":
"ir.ui.menu", "section_id": False, "search_default_project_id": False, "search_default_user_id":
1, "search_default_current": 1, "mail_send": False, "active_id": ref("project.menu_action_view_task"),
})
-
Close the child task 'Prepare documentation for Business Process Development'
-
!python {model: project.task}: |
self.do_close(cr, uid, [ref("project_task_delegate_business_process_develop")], {"lang": "en_US",
"active_ids": [ref("project.menu_action_view_task")], "tz": False, "active_model":
"ir.ui.menu", "section_id": False, "search_default_project_id": False, "search_default_user_id":
1, "search_default_current": 1, "mail_send": False, "active_id": ref("project.menu_action_view_task"),
})
-
Parent task 'Prepare a technical reference for creating your modules' task must now be in open state
-
!assert {model: project.task, id: project_task_delegate_developer_book, severity: error, string: Task is in done state}:
- state == "open"
-
Check if task 'Develop book for Technical and Functional reference' in pending state
-
!assert {model: project.task, id: project_task_documentation_book, severity: error, string: Task is in pending state}:
- state == "pending"
-
Close the child task 'Prepare a technical reference for creating your modules'
-
!python {model: project.task}: |
self.do_close(cr, uid, [ref("project_task_delegate_developer_book")], {"lang": "en_US",
"active_ids": [ref("project.menu_action_view_task")], "tz": False, "active_model":
"ir.ui.menu", "section_id": False, "search_default_project_id": False, "search_default_user_id":
1, "search_default_current": 1, "mail_send": False, "active_id": ref("project.menu_action_view_task"),
})
-
Close the child task 'Prepare a book that gives functional overview of OpenERP'
-
!python {model: project.task}: |
self.do_close(cr, uid, [ref("project_task_delegate_openerp_tutorial")], {"lang": "en_US",
"active_ids": [ref("project.menu_action_view_task")], "tz": False, "active_model":
"ir.ui.menu", "section_id": False, "search_default_project_id": False, "search_default_user_id":
1, "search_default_current": 1, "mail_send": False, "active_id": ref("project.menu_action_view_task"),
})
-
Parent task 'Develop book for Technical and Functional reference' must be now in open state
-
!assert {model: project.task, id: project_task_documentation_book, severity: error, string: Task is in done state}:
- state == "open"
+1
View File
@@ -44,6 +44,7 @@ Features
"demo_xml": ["project_long_term_demo.xml"],
"test": [
'test/phase_process.yml',
'test/task_process.yml',
],
"update_xml": [
"security/ir.model.access.csv",
@@ -72,12 +72,13 @@ class project_phase(osv.osv):
if phase['date_start'] and phase['date_end'] and phase['date_start'] > phase['date_end']:
return False
return True
#dead code
def _get_default_uom_id(self, cr, uid):
model_data_obj = self.pool.get('ir.model.data')
model_data_id = model_data_obj._get_id(cr, uid, 'product', 'uom_hour')
return model_data_obj.read(cr, uid, [model_data_id], ['res_id'])[0]['res_id']
#dead code
def _compute_progress(self, cr, uid, ids, field_name, arg, context=None):
res = {}
if not ids:
@@ -0,0 +1,19 @@
-
I create a record to compute the tasks of project.
-
!record {model: project.compute.tasks, id: project_compute_tasks0}:
project_id: project.project_integrate_openerp
-
I compute and shedule the tasks.
-
!python {model: project.compute.tasks}: |
self.compute_date(cr, uid, [ref("project_compute_tasks0")])
-
Check if tasks scheduled, check that either of task's start_date, end_date and user_id is not null
-
!python {model: project.project}: |
prj = self.browse(cr, uid, [ref("project.project_integrate_openerp")])[0]
for task in prj.tasks:
if task.state in ('done','cancelled'):
continue
assert task.user_id and task.date_start and task.date_end, "Project tasks not scheduled"
@@ -3,10 +3,12 @@
<data noupdate="1">
<record id="group_purchase_user" model="res.groups">
<field name="name">Purchases / User</field>
<field name="name">User</field>
<field name="category_id" ref="base.module_category_purchase_management"/>
</record>
<record id="group_purchase_manager" model="res.groups">
<field name="name">Purchases / Manager</field>
<field name="name">Manager</field>
<field name="category_id" ref="base.module_category_purchase_management"/>
<field name="implied_ids" eval="[(4, ref('group_purchase_user'))]"/>
</record>
@@ -2,12 +2,20 @@
<openerp>
<data noupdate="1">
<record model="ir.module.category" id="module_category_purchase_requisition">
<field name="name">Purchase Requisition</field>
<field name="parent_id" ref="base.module_category_purchase_management"/>
<field name="sequence">9</field>
</record>
<record id="group_purchase_requisition_user" model="res.groups">
<field name="name">Purchase Requisition / User</field>
<field name="name">User</field>
<field name="category_id" ref="module_category_purchase_requisition"/>
</record>
<record id="group_purchase_requisition_manager" model="res.groups">
<field name="name">Purchase Requisition / Manager</field>
<field name="name">Manager</field>
<field name="category_id" ref="module_category_purchase_requisition"/>
<field name="implied_ids" eval="[(4, ref('group_purchase_requisition_user'))]"/>
</record>
+6 -3
View File
@@ -3,16 +3,19 @@
<data noupdate="0">
<record id="base.group_sale_salesman" model="res.groups">
<field name="name">Sales / User - Own Leads Only</field>
<field name="name">User - Own Leads Only</field>
<field name="category_id" ref="base.module_category_sales_management"/>
</record>
<record id="base.group_sale_salesman_all_leads" model="res.groups">
<field name="name">Sales / User - All Leads</field>
<field name="name">User - All Leads</field>
<field name="category_id" ref="base.module_category_sales_management"/>
<field name="implied_ids" eval="[(4, ref('base.group_sale_salesman'))]"/>
</record>
<record id="base.group_sale_manager" model="res.groups">
<field name="name">Sales / Manager</field>
<field name="name">Manager</field>
<field name="category_id" ref="base.module_category_sales_management"/>
<field name="implied_ids" eval="[(4, ref('base.group_sale_salesman_all_leads'))]"/>
<field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>
-1
View File
@@ -39,7 +39,6 @@ It adds sales name and sales Reference on production order.
'depends': ['mrp', 'sale'],
'init_xml': [],
'update_xml': [
'security/sale_mrp_security.xml',
'security/ir.model.access.csv',
'sale_mrp_view.xml',
],
@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">
<record id="base.group_sale_manager" model="res.groups">
<field name="name">Sales / Manager</field>
</record>
<record id="base.group_sale_salesman" model="res.groups">
<field name="name">Sales / User</field>
</record>
</data>
</openerp>
+7 -1
View File
@@ -26,7 +26,13 @@ class res_groups(osv.osv):
_columns = {
'share': fields.boolean('Share Group', readonly=True,
help="Group created to set access rights for sharing data with some users.")
}
}
def __init__(self, pool, cr):
super(res_groups, self).__init__(pool, cr)
# add domain in get_groups_by_application()
self.groups_by_application_domain.append(('share', '=', False))
res_groups()
class res_users(osv.osv):
-12
View File
@@ -21,18 +21,6 @@
<field name="name">Users</field>
<field name="context">{'search_default_no_share': 1}</field>
</record>
<record id="view_users_form_share" model="ir.ui.view">
<field name="name">res.users.form</field>
<field name="model">res.users</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page//field[@name='groups_id']" position="attributes">
<attribute name="context">{'search_default_no_share':1}</attribute>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="res_groups_search_sharing">
<field name="name">res.groups.search.share</field>
+9 -2
View File
@@ -1,10 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record model="ir.module.category" id="module_category_share">
<field name="name">Sharing</field>
<field name="parent_id" ref="base.module_category_tools"/>
<field name="sequence">26</field>
</record>
<record id="group_share_user" model="res.groups">
<field name="name">Sharing / User</field>
<field name="name">User</field>
<field name="comment">
Members of this groups have access to the sharing wizard, which allows them to invite external users to view or edit some of their documents.</field>
<field name="category_id" ref="module_category_share"/>
</record>
</data>
</openerp>
</openerp>
+4 -2
View File
@@ -3,10 +3,12 @@
<data noupdate="0">
<record id="group_stock_user" model="res.groups">
<field name="name">Warehouse / User</field>
<field name="name">User</field>
<field name="category_id" ref="base.module_category_warehouse_management"/>
</record>
<record id="group_stock_manager" model="res.groups">
<field name="name">Warehouse / Manager</field>
<field name="name">Manager</field>
<field name="category_id" ref="base.module_category_warehouse_management"/>
<field name="implied_ids" eval="[(4, ref('group_stock_user'))]"/>
</record>
+2 -2
View File
@@ -1616,8 +1616,8 @@
<group colspan="2" col="2">
<separator colspan="2" string="Move Information"/>
<field name="name" string="Reason"/>
<field name="product_uos_qty" groups="product.group_uos" on_change="onchange_uos_quantity(product_id, product_uos_qty, product_uos, product_uom)" colspan="4"/>
<field name="product_uos" groups="product.group_uos" colspan="4"/>
<field name="product_uos_qty" groups="product.group_uos" on_change="onchange_uos_quantity(product_id, product_uos_qty, product_uos, product_uom)"/>
<field name="product_uos" groups="product.group_uos"/>
</group>
<group colspan="2" col="2">
@@ -3,10 +3,12 @@
<data noupdate="0">
<record model="res.groups" id="base.group_tool_user">
<field name="name">Tools / User</field>
<field name="name">User</field>
<field name="category_id" ref="base.module_category_tools"/>
</record>
<record model="res.groups" id="base.group_tool_manager">
<field name="name">Tools / Manager</field>
<field name="name">Manager</field>
<field name="category_id" ref="base.module_category_tools"/>
<field name="implied_ids" eval="[(4, ref('base.group_tool_user'))]"/>
</record>
+4 -2
View File
@@ -2,10 +2,12 @@
<openerp>
<data noupdate="0">
<record model="res.groups" id="base.group_tool_user">
<field name="name">Tools / User</field>
<field name="name">User</field>
<field name="category_id" ref="base.module_category_tools"/>
</record>
<record model="res.groups" id="base.group_tool_manager">
<field name="name">Tools / Manager</field>
<field name="name">Manager</field>
<field name="category_id" ref="base.module_category_tools"/>
<field name="implied_ids" eval="[(4, ref('base.group_tool_user'))]"/>
</record>
<record model="res.groups" id="base.group_survey_user">
+2 -7
View File
@@ -2,14 +2,9 @@
<openerp>
<data noupdate="0">
<record id="base.group_sale_manager" model="res.groups">
<field name="name">Sales / Manager</field>
</record>
<record id="base.group_sale_salesman" model="res.groups">
<field name="name">Sales / User</field>
</record>
<record id="base.group_document_user" model="res.groups">
<field name="name">Knowledge / User</field>
<field name="name">User</field>
<field name="category_id" ref="base.module_category_knowledge_management"/>
</record>
</data>