diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py
index cf2dfef7f78..abd3d1f459d 100644
--- a/addons/account/__openerp__.py
+++ b/addons/account/__openerp__.py
@@ -46,14 +46,18 @@ module named account_voucherss
'security/account_security.xml',
'security/ir.model.access.csv',
'account_menuitem.xml',
+ 'account_wizard.xml',
+ 'wizard/account_statement_from_invoice_view.xml',
+ 'wizard/account_move_bank_reconcile_view.xml',
+ 'wizard/account_use_model_view.xml',
+ 'account_view.xml',
+ 'account_report.xml',
'wizard/account_invoice_refund_view.xml',
'wizard/account_period_close_view.xml',
'wizard/account_fiscalyear_close_state.xml',
'wizard/account_chart_view.xml',
- 'wizard/account_move_bank_reconcile_view.xml',
- 'wizard/account_move_line_reconcile_select_view.xml',
'wizard/account_move_journal_view.xml',
- 'account_wizard.xml',
+ 'wizard/account_move_line_reconcile_select_view.xml',
'wizard/account_open_closed_fiscalyear_view.xml',
'wizard/account_move_line_unreconcile_select_view.xml',
'wizard/account_vat_view.xml',
@@ -66,17 +70,19 @@ module named account_voucherss
'wizard/account_journal_select_view.xml',
'wizard/account_change_currency_view.xml',
'wizard/account_validate_move_view.xml',
- 'wizard/account_statement_from_invoice_view.xml',
'wizard/account_pay_invoice_view.xml',
'wizard/account_unreconcile_view.xml',
+ 'wizard/account_general_ledger_report_view.xml',
'wizard/account_invoice_state_view.xml',
- 'wizard/account_use_model_view.xml',
'wizard/account_partner_balance_report_view.xml',
+ 'wizard/account_balance_report_view.xml',
+ 'wizard/account_move_line_select_view.xml',
+ 'wizard/account_aged_trial_balance_view.xml',
+ 'wizard/account_compare_account_balance_report_view.xml',
+ 'wizard/account_third_party_ledger.xml',
'project/wizard/project_account_analytic_line_view.xml',
- 'account_view.xml',
'account_end_fy.xml',
'account_invoice_view.xml',
- 'account_report.xml',
'partner_view.xml',
'data/account_invoice.xml',
'data/account_data2.xml',
diff --git a/addons/account/account.py b/addons/account/account.py
index 12868487c49..b7dcb6a3b8d 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -291,7 +291,7 @@ class account_account(osv.osv):
"special effects in Open ERP: view can not have entries, consolidation are accounts that "\
"can have children accounts for multi-company consolidations, payable/receivable are for "\
"partners accounts (for debit/credit computations), closed for depreciated accounts."),
- 'user_type': fields.many2one('account.account.type', 'Account Type', required=True,
+ 'user_type': fields.many2one('account.account.type', 'Account Type', required=True,
help="These types are defined according to your country. The type contains more information "\
"about the account and its specificities."),
'parent_id': fields.many2one('account.account', 'Parent', ondelete='cascade'),
@@ -437,18 +437,18 @@ class account_account(osv.osv):
elif method == 'unlink':
raise osv.except_osv(_('Error !'), _('You cannot remove an account which has account entries!. '))
return True
-
+
def write(self, cr, uid, ids, vals, context=None):
if not context:
context = {}
if 'active' in vals and not vals['active']:
self._check_moves(cr, uid, ids, "write", context)
return super(account_account, self).write(cr, uid, ids, vals, context=context)
-
+
def unlink(self, cr, uid, ids, context={}):
self._check_moves(cr, uid, ids, "unlink", context)
return super(account_account, self).unlink(cr, uid, ids, context)
-
+
account_account()
class account_journal_view(osv.osv):
@@ -791,7 +791,7 @@ class account_move(osv.osv):
for id in ids:
result.setdefault(id, 0.0)
return result
-
+
def _search_amount(self, cr, uid, obj, name, args, context):
ids = []
cr.execute('select move_id,sum(debit) from account_move_line group by move_id')
@@ -801,10 +801,10 @@ class account_move(osv.osv):
if item[1] == '>=':
res = [('id', 'in', [k for k,v in result.iteritems() if v >= item[2]])]
else:
- res = [('id', 'in', [k for k,v in result.iteritems() if v <= item[2]])]
+ res = [('id', 'in', [k for k,v in result.iteritems() if v <= item[2]])]
ids += res
- if not ids:
+ if not ids:
return [('id', '>', '0')]
return ids
@@ -1056,7 +1056,13 @@ class account_move(osv.osv):
if line.account_id.currency_id.id != line.currency_id.id and (line.account_id.currency_id.id != line.account_id.company_id.currency_id.id or line.currency_id):
raise osv.except_osv(_('Error'), _("""Couldn't create move with currency different from the secondary currency of the account "%s - %s". Clear the secondary currency field of the account definition if you want to accept all currencies.""" % (line.account_id.code, line.account_id.name)))
- if abs(amount) < 0.0001:
+ # Check that the move balances, the tolerance for debit/credit must
+ # be smaller than the smallest value according to price accuracy
+ # (hence the +1 below)
+ # Example:
+ # difference == 0.01 is OK iff price_accuracy <= 1!
+ # difference == 0.0001 is OK iff price_accuracy <= 3!
+ if abs(amount) < 10 ** -(int(config['price_accuracy'])):
if not len(line_draft_ids):
continue
self.pool.get('account.move.line').write(cr, uid, line_draft_ids, {
@@ -1126,7 +1132,7 @@ class account_move_reconcile(osv.osv):
'name': lambda self,cr,uid,ctx={}: self.pool.get('ir.sequence').get(cr, uid, 'account.reconcile') or '/',
}
def reconcile_partial_check(self, cr, uid, ids, type='auto', context={}):
- total = 0.0
+ total = 0.0
for rec in self.browse(cr, uid, ids, context):
for line in rec.line_partial_ids:
total += (line.debit or 0.0) - (line.credit or 0.0)
@@ -1880,7 +1886,7 @@ account_account_template()
class account_add_tmpl_wizard(osv.osv_memory):
"""Add one more account from the template.
-
+
With the 'nocreate' option, some accounts may not be created. Use this to add them later."""
_name = 'account.addtmpl.wizard'
@@ -1906,7 +1912,7 @@ class account_add_tmpl_wizard(osv.osv_memory):
_defaults = {
'cparent_id': _get_def_cparent,
}
-
+
def action_create(self,cr,uid,ids,context=None):
acc_obj=self.pool.get('account.account')
tmpl_obj=self.pool.get('account.account.template')
@@ -1933,7 +1939,7 @@ class account_add_tmpl_wizard(osv.osv_memory):
# print "Creating:", vals
new_account = acc_obj.create(cr,uid,vals)
return {'type':'state', 'state': 'end' }
-
+
def action_cancel(self,cr,uid,ids,context=None):
return { 'type': 'state', 'state': 'end' }
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index a386901a083..9ace27294fa 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -1382,14 +1382,14 @@
[('account_id','child_of', [active_id]),('state','<>','draft')]{'account_id':active_id}
-
-
-
-
- Account Entries
-
-
-
+
+
+
+
+
+
+
+
diff --git a/addons/account/account_wizard.xml b/addons/account/account_wizard.xml
index e5825f6b2da..cdd14780256 100644
--- a/addons/account/account_wizard.xml
+++ b/addons/account/account_wizard.xml
@@ -1,12 +1,12 @@
-
+
+
+
+
+
+
@@ -71,19 +71,21 @@
-->
-
-
-
+
-
+
+
+
+
+
-
-
@@ -105,11 +107,11 @@
-
-
+
+
-
-
+
+
+
+
+
-
+
+
+ res.alarm.formres.alarmform
@@ -121,36 +143,230 @@
-
- res.alarm.tree
- res.alarm
- tree
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ res.alarm.tree
+ res.alarm
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+ Available Alarmsir.actions.act_windowres.alarmformtree,form
-
-
-
-
+
-
-
+
+
+
+ Event Form
+ calendar.event
+ form
+
+
+
+
+
+
+
+
+ Event Tree
+ calendar.event
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Events Calendar
+ calendar.event
+ calendar
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Events
+ ir.actions.act_window
+ calendar.event
+ form
+ tree,form,calendar
+
+
+
+
+
+
+
diff --git a/addons/base_calendar/test/base_calendar_test.yml b/addons/base_calendar/test/base_calendar_test.yml
new file mode 100644
index 00000000000..14bf162f23a
--- /dev/null
+++ b/addons/base_calendar/test/base_calendar_test.yml
@@ -0,0 +1,77 @@
+- |
+ In Order to test base_calendar, I will first create One Simple Event with real data
+-
+ !record {model: calendar.event, id: calendar_event_technicalpresentation0}:
+ class: private
+ date: '2010-04-30 16:00:00'
+ date_deadline: '2010-04-30 18:30:00'
+ description: The Technical Presentation will cover following topics:\n* Creating OpenERP
+ class\n* Views\n* Wizards\n* Workflows
+ duration: 2.5
+ location: OpenERP S.A.
+ name: Technical Presentation
+ rrule_type: none
+- |
+ Now I will set recurrence for this event to occure monday and friday of week
+-
+ !python {model: calendar.event}: |
+ self.write(cr, uid, [ref("calendar_event_technicalpresentation0")], {'fr': 1, 'mo': 1, 'interval': 1, 'freq': 'weekly', 'rrule_type': 'custom'})
+- |
+ In order to check that recurrent events are views successfully in calenadar view,
+ I will open calendar view of events
+-
+ !python {model: calendar.event}: |
+ self.fields_view_get(cr, uid, False, 'calendar', context)
+- |
+ In order to check that recurrent events are views successfully in calenadar view,
+ I will search for one of the recurrent event and count the number of events
+-
+ !python {model: calendar.event}: |
+ ids = self.search(cr, uid, [('date', '>=', '2010-05-01 00:00:00'), ('date', '<=', '2010-05-31 00:00:00')] )
+ assert len(ids) == 9
+- |
+ Now I will make All day event and test it
+-
+ !record {model: calendar.event, id: calendar_event_alldaytestevent0}:
+ allday: 1
+ class: confidential
+ date: '2010-04-30 00:00:00'
+ date_deadline: '2010-04-30 00:00:00'
+ description: 'All day technical test '
+ location: School
+ name: All day test event
+ rrule_type: none
+- |
+ In order to check reminder I will first create reminder
+-
+ !record {model: res.alarm, id: res_alarm_daybeforeeventstarts0}:
+ name: 1 Day before event starts
+ trigger_duration: 1
+ trigger_interval: days
+ trigger_occurs: before
+ trigger_related: start
+- |
+ Now I will assign this reminder to all day event
+-
+ !python {model: calendar.event}: |
+ self.write(cr, uid, [ref("calendar_event_alldaytestevent0")], {'alarm_id': ref("res_alarm_daybeforeeventstarts0")})
+- |
+ In order to assign attendee I will invite Demo user
+-
+ !record {model: base_calendar.invite.attendee, id: base_calendar_invite_attendee_0}:
+ type: internal
+ partner_id: base.res_partner_9 # Put bcz of problem in read
+ user_ids:
+ - base.user_demo
+- |
+ Then I click on Invite Button
+-
+ !python {model: base_calendar.invite.attendee}: |
+ self.do_invite(cr, uid, [ref("base_calendar_invite_attendee_0")], {'active_id': ref("calendar_event_alldaytestevent0"), 'model' : 'calendar.event', 'attendee_field':'attendee_ids'})
+- |
+ Now I will Accept this invitation
+-
+ !python {model: calendar.attendee}: |
+ ids = self.search(cr, uid, [('ref', '=', 'calendar.event' + ',' + str(ref("calendar_event_alldaytestevent0")))])
+ if ids:
+ self.do_accept(cr, uid, ids, context=context)
diff --git a/addons/base_module_quality/i18n/et.po b/addons/base_module_quality/i18n/et.po
index bdaff69d207..d770836ddcd 100644
--- a/addons/base_module_quality/i18n/et.po
+++ b/addons/base_module_quality/i18n/et.po
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-11-09 16:43+0000\n"
-"Last-Translator: Fabien (Open ERP) \n"
+"PO-Revision-Date: 2010-04-23 09:48+0000\n"
+"Last-Translator: lyyser \n"
"Language-Team: Estonian \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 04:20+0000\n"
+"X-Launchpad-Export-Date: 2010-04-24 03:53+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: base_module_quality
@@ -42,22 +42,22 @@ msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Detail"
-msgstr ""
+msgstr "Detail"
#. module: base_module_quality
#: field:module.quality.detail,note:0
msgid "Note"
-msgstr ""
+msgstr "Märkus"
#. module: base_module_quality
#: field:module.quality.detail,state:0
msgid "State"
-msgstr ""
+msgstr "Olek"
#. module: base_module_quality
#: field:module.quality.detail,detail:0
msgid "Details"
-msgstr ""
+msgstr "Detailid"
#. module: base_module_quality
#: field:module.quality.detail,ponderation:0
@@ -75,12 +75,12 @@ msgstr ""
#: view:module.quality.check:0
#: field:module.quality.check,check_detail_ids:0
msgid "Tests"
-msgstr ""
+msgstr "Testid"
#. module: base_module_quality
#: selection:module.quality.detail,state:0
msgid "Skipped"
-msgstr ""
+msgstr "Vahele jäetud"
#. module: base_module_quality
#: help:module.quality.detail,state:0
@@ -102,17 +102,17 @@ msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,name:0
msgid "Name"
-msgstr ""
+msgstr "Nimi"
#. module: base_module_quality
#: wizard_field:quality_detail_save,init,module_file:0
msgid "Save report"
-msgstr ""
+msgstr "Salvesta aruanne"
#. module: base_module_quality
#: wizard_field:quality_detail_save,init,name:0
msgid "File name"
-msgstr ""
+msgstr "Failinimi"
#. module: base_module_quality
#: field:module.quality.detail,score:0
@@ -122,13 +122,13 @@ msgstr ""
#. module: base_module_quality
#: help:quality_detail_save,init,name:0
msgid "Save report as .html format"
-msgstr ""
+msgstr "Salvesta aruanne .html vormingus"
#. module: base_module_quality
#: view:module.quality.detail:0
#: field:module.quality.detail,summary:0
msgid "Summary"
-msgstr ""
+msgstr "Kokkuvõte"
#. module: base_module_quality
#: model:ir.actions.wizard,name:base_module_quality.quality_detail_save
@@ -143,7 +143,7 @@ msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Save Report"
-msgstr ""
+msgstr "Aruande salvestamine"
#. module: base_module_quality
#: model:ir.actions.wizard,name:base_module_quality.create_quality_check_id
@@ -158,25 +158,25 @@ msgstr ""
#. module: base_module_quality
#: selection:module.quality.detail,state:0
msgid "Done"
-msgstr ""
+msgstr "Valmis"
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
-msgstr ""
+msgstr "Tulemus"
#. module: base_module_quality
#: wizard_button:quality_detail_save,init,end:0
msgid "Cancel"
-msgstr ""
+msgstr "Katkesta"
#. module: base_module_quality
#: field:module.quality.detail,message:0
msgid "Message"
-msgstr ""
+msgstr "Sõnum"
#. module: base_module_quality
#: field:module.quality.detail,quality_check_id:0
msgid "Quality"
-msgstr ""
+msgstr "Kvaliteet"
diff --git a/addons/base_report_creator/i18n/ru.po b/addons/base_report_creator/i18n/ru.po
index 7eeef699005..f61c7019e69 100644
--- a/addons/base_report_creator/i18n/ru.po
+++ b/addons/base_report_creator/i18n/ru.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-02-11 18:58+0000\n"
-"Last-Translator: Auduf <5097@mail.ru>\n"
+"PO-Revision-Date: 2010-04-23 16:38+0000\n"
+"Last-Translator: Nikita Shehov \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 04:16+0000\n"
+"X-Launchpad-Export-Date: 2010-04-24 03:52+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: base_report_creator
@@ -23,6 +23,8 @@ msgid ""
"records.\n"
" e.g. res_partner.id=3"
msgstr ""
+"Введите параметр для поиска нужных записей.\n"
+"Например: res_partner.id=3"
#. module: base_report_creator
#: field:base_report_creator.report,view_graph_type:0
@@ -408,6 +410,11 @@ msgid ""
"After installing the module, it adds a menu to define custom report in\n"
"the \"Dashboard\" menu.\n"
msgstr ""
+"С помощью этих модулей вы сможете создать статистический отчет\n"
+"выбранных объектов. Это создатель и браузер SQL-запросов для пользователей.\n"
+"\n"
+"После установки модуля, в главном меню появится ссылка для выбора отчета по "
+"умолчанию.\n"
#. module: base_report_creator
#: selection:base_report_creator.report.fields,calendar_mode:0
diff --git a/addons/crm/crm.py b/addons/crm/crm.py
index 30e1db744cc..85a27bb5d55 100644
--- a/addons/crm/crm.py
+++ b/addons/crm/crm.py
@@ -432,11 +432,20 @@ class crm_case(osv.osv):
"""
if not context:
context = {}
+
+ hist_obj = self.pool.get('crm.case.history')
+ log_obj = self.pool.get('crm.case.log')
for case in self.browse(cr, uid, ids, context):
if (not case.section_id.allow_unlink) and (case.state <> 'draft'):
raise osv.except_osv(_('Warning !'),
_('You can not delete this case. You should better cancel it.'))
+
+ # Also removing history and logs
+ history_ids = map(lambda x: x.id, case.history_line)
+ log_ids = map(lambda x: x.id, case.log_ids)
+ hist_obj.unlink(cr, uid, history_ids, context=context)
+ log_obj.unlink(cr, uid, log_ids, context=context)
return super(crm_case, self).unlink(cr, uid, ids, context)
def stage_next(self, cr, uid, ids, context=None):
diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py
index e0b968a1808..495eb9f351a 100644
--- a/addons/crm/crm_meeting.py
+++ b/addons/crm/crm_meeting.py
@@ -51,7 +51,7 @@ class crm_meeting(osv.osv):
),
'phonecall_id': fields.many2one ('crm.phonecall', 'Phonecall'),
'opportunity_id': fields.many2one ('crm.opportunity', 'Opportunity'),
- 'attendee_ids': fields.many2many('calendar.attendee', 'event_attendee_rel',\
+ 'attendee_ids': fields.many2many('calendar.attendee', 'meeting_attendee_rel',\
'event_id', 'attendee_id', 'Attendees'),
'date_closed': fields.datetime('Closed', readonly=True),
'date_deadline': fields.datetime('Deadline'),
@@ -115,16 +115,13 @@ class calendar_attendee(osv.osv):
_description = 'Calendar Attendee'
def _compute_data(self, cr, uid, ids, name, arg, context):
-
"""
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@param ids: List of compute data’s IDs
@param context: A standard dictionary for contextual values
-
"""
-
name = name[0]
result = super(calendar_attendee, self)._compute_data(cr, uid, ids, name, arg, context)
@@ -132,7 +129,7 @@ class calendar_attendee(osv.osv):
id = attdata.id
result[id] = {}
if name == 'categ_id':
- if attdata.ref:
+ if attdata.ref and 'categ_id' in attdata.ref._columns:
result[id][name] = (attdata.ref.categ_id.id, attdata.ref.categ_id.name,)
else:
result[id][name] = False
diff --git a/addons/delivery/i18n/ru.po b/addons/delivery/i18n/ru.po
index c59e964b00a..fa64529594b 100644
--- a/addons/delivery/i18n/ru.po
+++ b/addons/delivery/i18n/ru.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-11-18 06:25+0000\n"
-"Last-Translator: Fabien (Open ERP) \n"
+"PO-Revision-Date: 2010-04-23 09:08+0000\n"
+"Last-Translator: grisha \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 03:58+0000\n"
+"X-Launchpad-Export-Date: 2010-04-24 03:52+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: delivery
@@ -42,7 +42,7 @@ msgstr "Назначение"
#. module: delivery
#: model:product.template,name:delivery.delivery_product_product_template
msgid "Delivery by Poste"
-msgstr ""
+msgstr "Доставка почтой"
#. module: delivery
#: constraint:ir.ui.view:0
@@ -52,7 +52,7 @@ msgstr "Неправильный XML для просмотра архитект
#. module: delivery
#: constraint:res.partner:0
msgid "Error ! You can not create recursive associated members."
-msgstr ""
+msgstr "Ошибка! Вы не можете создать рекурсивных связанных участников."
#. module: delivery
#: field:delivery.grid,state_ids:0
@@ -62,7 +62,7 @@ msgstr "Cостояния"
#. module: delivery
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Недопустимое имя модели в определении действия"
#. module: delivery
#: help:res.partner,property_delivery_carrier:0
@@ -72,7 +72,7 @@ msgstr ""
#. module: delivery
#: model:ir.model,name:delivery.model_delivery_grid
msgid "Delivery Grid"
-msgstr ""
+msgstr "Расценки на доставку"
#. module: delivery
#: field:delivery.grid,zip_from:0
@@ -119,12 +119,12 @@ msgstr ""
#. module: delivery
#: field:delivery.grid.line,grid_id:0
msgid "Grid"
-msgstr ""
+msgstr "Расценка"
#. module: delivery
#: view:res.partner:0
msgid "Deliveries Properties"
-msgstr ""
+msgstr "Свойства доставки"
#. module: delivery
#: field:delivery.carrier,active:0
@@ -151,7 +151,7 @@ msgstr "="
#. module: delivery
#: field:delivery.carrier,product_id:0
msgid "Delivery Product"
-msgstr ""
+msgstr "Услуга или изделие, соответствующее доставке"
#. module: delivery
#: view:delivery.grid.line:0
@@ -166,7 +166,7 @@ msgstr ""
#. module: delivery
#: field:delivery.grid.line,standard_price:0
msgid "Cost Price"
-msgstr ""
+msgstr "Себестоимость"
#. module: delivery
#: field:delivery.grid.line,name:0
@@ -177,6 +177,8 @@ msgstr "Название"
#: constraint:product.template:0
msgid "Error: UOS must be in a different category than the UOM"
msgstr ""
+"Ошибка. Единицы продажи и единицы измерения должны принадлежать к разным "
+"категориям."
#. module: delivery
#: field:delivery.grid,country_ids:0
@@ -323,7 +325,7 @@ msgstr "Ошибка: Неправильный штрих-код"
#. module: delivery
#: view:delivery.grid:0
msgid "Delivery grids"
-msgstr ""
+msgstr "Расценки на доставку"
#. module: delivery
#: wizard_button:delivery.sale.order,init,end:0
diff --git a/addons/document_email/document_email.py b/addons/document_email/document_email.py
index a4406f7a4d5..e4e94fa6c1f 100644
--- a/addons/document_email/document_email.py
+++ b/addons/document_email/document_email.py
@@ -79,7 +79,7 @@ class email_to_document(osv.osv):
if file_ext[1] not in ext:
logger.notifyChannel('document', netsvc.LOG_WARNING, 'file type %s is not allows to process for directory %s' % (file_ext[1], dr.directory_id.name))
continue
-
+
data_attach = {
'name': attactment,
'datas':binascii.b2a_base64(str(attachents.get(attactment))),
diff --git a/addons/document_email/document_email.xml b/addons/document_email/document_email.xml
index 9dd550acd7c..bfcde49816a 100644
--- a/addons/document_email/document_email.xml
+++ b/addons/document_email/document_email.xml
@@ -93,11 +93,11 @@
[]
-
+
+
+
+
+
diff --git a/addons/fetchmail/fetchmail.py b/addons/fetchmail/fetchmail.py
index feb88b57136..611b7c178fb 100644
--- a/addons/fetchmail/fetchmail.py
+++ b/addons/fetchmail/fetchmail.py
@@ -320,12 +320,22 @@ class email_server(osv.osv):
return res_id
+ def __fetch_mail(self, cr, uid, ids, context={}):
+ sendmail_thread = threading.Thread(target=self.fetch_mail, args=(cr, uid, ids))
+ sendmail_thread.start()
+ return True
+
def _fetch_mails(self, cr, uid, ids=False, context={}):
if not ids:
ids = self.search(cr, uid, [])
return self.fetch_mail(cr, uid, ids, context)
def fetch_mail(self, cr, uid, ids, context={}):
+
+ fp = os.popen('ping www.google.com -c 1 -w 5',"r")
+ if not fp.read():
+ logger.notifyChannel('imap', netsvc.LOG_WARNING, 'lost internet connection !')
+
for server in self.browse(cr, uid, ids, context):
logger.notifyChannel('imap', netsvc.LOG_INFO, 'fetchmail start checking for new emails on %s' % (server.name))
@@ -356,7 +366,7 @@ class email_server(osv.osv):
pop_server = POP3_SSL(server.server, int(server.port))
else:
pop_server = POP3(server.server, int(server.port))
-
+
#TODO: use this to remove only unread messages
#pop_server.user("recent:"+server.user)
pop_server.user(server.user)
@@ -373,9 +383,10 @@ class email_server(osv.osv):
pop_server.quit()
logger.notifyChannel('imap', netsvc.LOG_INFO, 'fetchmail fetch %s email(s) from %s' % (numMsgs, server.name))
-
+
+ self.write(cr, uid, [server.id], {'state':'done'})
except Exception, e:
- logger.notifyChannel('IMAP', netsvc.LOG_WARNING, '%s' % (e))
+ logger.notifyChannel(server.type, netsvc.LOG_WARNING, '%s' % (e))
return True
diff --git a/addons/fetchmail/fetchmail_view.xml b/addons/fetchmail/fetchmail_view.xml
index 80d0b60a74f..a3a8534b559 100644
--- a/addons/fetchmail/fetchmail_view.xml
+++ b/addons/fetchmail/fetchmail_view.xml
@@ -58,8 +58,7 @@
-
-
+
diff --git a/addons/hr_recruitment/__openerp__.py b/addons/hr_recruitment/__openerp__.py
index a19ef25515b..14557c33c42 100644
--- a/addons/hr_recruitment/__openerp__.py
+++ b/addons/hr_recruitment/__openerp__.py
@@ -39,14 +39,15 @@ system to store and search in your CV base.
'hr_recruitment_data.xml'
],
'update_xml': [
- 'hr_recruitment_wizard.xml',
+ 'wizard/hr_recruitment_phonecall_view.xml',
'hr_recruitment_view.xml',
'hr_recruitment_menu.xml',
# 'report_hr_recruitment_view.xml',
'security/hr_recruitment_security.xml',
'security/ir.model.access.csv',
'board_hr_recruitment_statistical_view.xml',
- 'report/hr_recruitment_report_view.xml'
+ 'report/hr_recruitment_report_view.xml',
+ 'wizard/hr_recruitment_create_partner_job_view.xml',
],
'demo_xml': [
'hr_recruitment_demo.xml'
diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml
index 64c9ed934b7..beb9467814c 100644
--- a/addons/hr_recruitment/hr_recruitment_view.xml
+++ b/addons/hr_recruitment/hr_recruitment_view.xml
@@ -78,7 +78,7 @@
+ name="%(action_hr_recruitment_phonecall)d" icon="gtk-redo" type="action"/>
diff --git a/addons/hr_recruitment/wizard/__init__.py b/addons/hr_recruitment/wizard/__init__.py
index 48e225c5a54..c946ed7264f 100644
--- a/addons/hr_recruitment/wizard/__init__.py
+++ b/addons/hr_recruitment/wizard/__init__.py
@@ -20,10 +20,8 @@
##############################################################################
-import hr_recruitment_wizard
-
-
-
+import hr_recruitment_phonecall
+import hr_recruitment_create_partner_job
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_recruitment/wizard/hr_recruitment_create_partner_job.py b/addons/hr_recruitment/wizard/hr_recruitment_create_partner_job.py
new file mode 100644
index 00000000000..4627751f731
--- /dev/null
+++ b/addons/hr_recruitment/wizard/hr_recruitment_create_partner_job.py
@@ -0,0 +1,92 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved
+# $Id$
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+from osv import osv, fields
+from tools.translate import _
+
+class hr_recruitment_partner_create(osv.osv_memory):
+ _name = 'hr.recruitment.partner.create'
+ _description = 'Create Partner from job application'
+ _columns = {
+ 'close': fields.boolean('Close job request'),
+ }
+
+ def view_init(self, cr , uid , fields_list, context=None):
+ case_obj = self.pool.get('hr.applicant')
+ for case in case_obj.browse(cr, uid, context['active_ids']):
+ if case.partner_id:
+ raise osv.except_osv(_('Warning !'),
+ _('A partner is already defined on this job request.'))
+ pass
+
+ def make_order(self, cr, uid, ids, context=None):
+ mod_obj = self.pool.get('ir.model.data')
+ partner_obj = self.pool.get('res.partner')
+ contact_obj = self.pool.get('res.partner.address')
+ case_obj = self.pool.get('hr.applicant')
+
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids, [], context)[0]
+ result = mod_obj._get_id(cr, uid, 'base', 'view_res_partner_filter')
+ res = mod_obj.read(cr, uid, result, ['res_id'])
+
+ for case in case_obj.browse(cr, uid, context['active_ids']):
+ partner_id = partner_obj.search(cr, uid, [('name', '=', case.partner_name or case.name)])
+ if partner_id:
+ raise osv.except_osv(_('Warning !'),_('A partner is already existing with the same name.'))
+ else:
+ partner_id = partner_obj.create(cr, uid, {
+ 'name': case.partner_name or case.name,
+ 'user_id': case.user_id.id,
+ 'comment': case.description,
+ })
+ contact_id = contact_obj.create(cr, uid, {
+ 'partner_id': partner_id,
+ 'name': case.partner_name,
+ 'phone': case.partner_phone,
+ 'mobile': case.partner_mobile,
+ 'email': case.email_from
+ })
+
+ case_obj.write(cr, uid, context['active_ids'], {
+ 'partner_id': partner_id,
+ 'partner_address_id': contact_id
+ })
+ if data['close']:
+ case_obj.case_close(cr, uid, context['active_ids'])
+
+ value = {
+ 'domain': "[]",
+ 'view_type': 'form',
+ 'view_mode': 'form,tree',
+ 'res_model': 'res.partner',
+ 'res_id': int(partner_id),
+ 'view_id': False,
+ 'type': 'ir.actions.act_window',
+ 'search_view_id': res['res_id']
+ }
+ return value
+
+hr_recruitment_partner_create()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_recruitment/wizard/hr_recruitment_create_partner_job_view.xml b/addons/hr_recruitment/wizard/hr_recruitment_create_partner_job_view.xml
new file mode 100644
index 00000000000..1eaaa2fefdd
--- /dev/null
+++ b/addons/hr_recruitment/wizard/hr_recruitment_create_partner_job_view.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+ hr.recruitment.partner.create.form
+ hr.recruitment.partner.create
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Create Partner
+ ir.actions.act_window
+ hr.recruitment.partner.create
+ form
+ form
+ new
+
+
+
+
+
+ Create Partner
+ client_action_multi
+
+ action
+ hr.applicant
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_recruitment/wizard/hr_recruitment_phonecall_view.xml b/addons/hr_recruitment/wizard/hr_recruitment_phonecall_view.xml
new file mode 100644
index 00000000000..f7c162594d2
--- /dev/null
+++ b/addons/hr_recruitment/wizard/hr_recruitment_phonecall_view.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+ hr.recruitment.job2phonecall.form
+ hr.recruitment.job2phonecall
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Schedule Phone Call
+ ir.actions.act_window
+ hr.recruitment.job2phonecall
+ form
+ form
+ new
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_timesheet_invoice/__openerp__.py b/addons/hr_timesheet_invoice/__openerp__.py
index 3f4aecb9d3f..72148b83f63 100644
--- a/addons/hr_timesheet_invoice/__openerp__.py
+++ b/addons/hr_timesheet_invoice/__openerp__.py
@@ -40,6 +40,9 @@ reports, eso.""",
'report/report_analytic_view.xml',
'report/hr_timesheet_invoice_report_view.xml',
'wizard/hr_timesheet_invoice_analytic_cost_ledger_view.xml',
+ 'wizard/hr_timesheet_analytic_profit_view.xml',
+ 'wizard/hr_timesheet_invoice_create_view.xml',
+ 'wizard/hr_timesheet_invoice_create_final_view.xml',
],
'demo_xml': ['hr_timesheet_invoice_demo.xml'],
'installable': True,
diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice_report.xml b/addons/hr_timesheet_invoice/hr_timesheet_invoice_report.xml
index bed54ff7d0d..f2d9f5a8c4a 100644
--- a/addons/hr_timesheet_invoice/hr_timesheet_invoice_report.xml
+++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice_report.xml
@@ -24,7 +24,7 @@
rml="hr_timesheet_invoice/report/account_analytic_profit.rml"
string="Timesheet Profit"/>
-
+ groups="hr.group_hr_manager"/>-->
diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice_wizard.xml b/addons/hr_timesheet_invoice/hr_timesheet_invoice_wizard.xml
index 350f30c780d..50ca292d39d 100644
--- a/addons/hr_timesheet_invoice/hr_timesheet_invoice_wizard.xml
+++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice_wizard.xml
@@ -1,8 +1,8 @@
-
-
-
+
+
+
diff --git a/addons/hr_timesheet_invoice/wizard/__init__.py b/addons/hr_timesheet_invoice/wizard/__init__.py
index b3921b01008..6dce6a7b651 100644
--- a/addons/hr_timesheet_invoice/wizard/__init__.py
+++ b/addons/hr_timesheet_invoice/wizard/__init__.py
@@ -20,7 +20,7 @@
##############################################################################
import hr_timesheet_invoice_create
-import account_analytic_profit
+import hr_timesheet_analytic_profit
import hr_timesheet_final_invoice_create
import hr_timesheet_analytic_cost_ledger_report
diff --git a/addons/hr_timesheet_invoice/wizard/account_analytic_profit.py b/addons/hr_timesheet_invoice/wizard/account_analytic_profit.py
deleted file mode 100644
index 90861b6f5a9..00000000000
--- a/addons/hr_timesheet_invoice/wizard/account_analytic_profit.py
+++ /dev/null
@@ -1,99 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import wizard
-import datetime
-import pooler
-from tools.translate import _
-
-form='''
-
-
-
-
-
-
'''
-
-class wizard_report(wizard.interface):
- def _date_from(*a):
- return datetime.datetime.today().strftime('%Y-%m-1')
-
- def _date_to(*a):
- return datetime.datetime.today().strftime('%Y-%m-%d')
-
- def _check(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- line_obj = pool.get('account.analytic.line')
- product_obj = pool.get('product.product')
- price_obj = pool.get('product.pricelist')
- ids = line_obj.search(cr, uid, [
- ('date', '>=', data['form']['date_from']),
- ('date', '<=', data['form']['date_to']),
- ('journal_id', 'in', data['form']['journal_ids'][0][2]),
- ('user_id', 'in', data['form']['employee_ids'][0][2]),
- ])
- if not ids:
- raise wizard.except_wizard(_('Data Insufficient!'), _('No Records Found for Report!'))
-
- return data['form']
-
-
- fields={
- 'date_from':{
- 'string':'From',
- 'type':'date',
- 'required':True,
- 'default':_date_from,
- },
- 'date_to':{
- 'string':'To',
- 'type':'date',
- 'required':True,
- 'default':_date_to,
- },
- 'journal_ids':{
- 'string':'Journal',
- 'type':'many2many',
- 'relation':'account.analytic.journal',
- 'required':True,
- },
- 'employee_ids':{
- 'string':'Employee',
- 'type':'many2many',
- 'relation':'res.users',
- 'required':True,
- },
- }
-
- states={
- 'init':{
- 'actions':[],
- 'result':{'type':'form', 'arch':form, 'fields':fields, 'state':[('end', 'Cancel', 'gtk-cancel'), ('report', 'Print', 'gtk-ok')]}
- },
- 'report':{
- 'actions':[_check],
- 'result':{'type':'print', 'report':'account.analytic.profit', 'state':'end'}
- }
- }
-wizard_report('account.analytic.profit')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py
new file mode 100644
index 00000000000..f5b37256a02
--- /dev/null
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py
@@ -0,0 +1,79 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+import datetime
+
+from osv import osv, fields
+from tools.translate import _
+
+class account_analytic_profit(osv.osv_memory):
+ _name = 'hr.timesheet.analytic.profit'
+ _description = 'Print Timesheet Profit'
+ _columns = {
+ 'date_from': fields.date('From', required=True),
+ 'date_to': fields.date('To', required=True),
+ 'journal_ids': fields.many2many('account.analytic.journal', 'analytic_profit_journal_rel', 'analytic_id', 'journal_id', 'Journal', required=True),
+ 'employee_ids': fields.many2many('res.users', 'analytic_profit_emp_rel', 'analytic_id', 'emp_id', 'Employee', required=True),
+ }
+
+ def _date_from(*a):
+ return datetime.datetime.today().strftime('%Y-%m-1')
+
+ def _date_to(*a):
+ return datetime.datetime.today().strftime('%Y-%m-%d')
+
+ _defaults = {
+ 'date_from': _date_from,
+ 'date_to': _date_to
+ }
+
+ def print_report(self, cr, uid, ids, context=None):
+ line_obj = self.pool.get('account.analytic.line')
+ product_obj = self.pool.get('product.product')
+ price_obj = self.pool.get('product.pricelist')
+ data = {}
+ data['form'] = self.read(cr, uid , ids, [], context=context)[0]
+ if context is None:
+ context = {}
+ ids_chk = line_obj.search(cr, uid, [
+ ('date', '>=', data['form']['date_from']),
+ ('date', '<=', data['form']['date_to']),
+ ('journal_id', 'in', data['form']['journal_ids']),
+ ('user_id', 'in', data['form']['employee_ids']),
+ ])
+ if not ids_chk:
+ raise osv.except_osv(_('Data Insufficient!'), _('No Records Found for Report!'))
+
+ data['form']['journal_ids'] = [(6, 0, data['form']['journal_ids'])] # Improve me => Change the rml/sxw so that it can support withou [0][2]
+ data['form']['employee_ids'] = [(6, 0, data['form']['employee_ids'])]
+ datas = {
+ 'ids': [],
+ 'model': 'account.analytic.line',
+ 'form': data['form']
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.analytic.profit',
+ 'datas': datas,
+ }
+
+account_analytic_profit()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit_view.xml b/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit_view.xml
new file mode 100644
index 00000000000..f79cae2eef8
--- /dev/null
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit_view.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+ Timesheet Profit
+ hr.timesheet.analytic.profit
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Timesheet Profit
+ ir.actions.act_window
+ hr.timesheet.analytic.profit
+ form
+ form
+ new
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py
index 1f9efe9641f..e8309d84921 100644
--- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,15 +15,14 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
-import wizard
-import pooler
import time
-from tools.translate import _
+from osv import osv, fields
+from tools.translate import _
#
# Create an final invoice based on selected timesheet lines
#
@@ -31,26 +30,37 @@ from tools.translate import _
#
# TODO: check unit of measure !!!
#
-class final_invoice_create(wizard.interface):
- def _get_defaults(self, cr, uid, data, context):
- return {}
+class final_invoice_create(osv.osv_memory):
+ _name = 'hr.timesheet.invoice.create.final'
+ _description = 'Create invoice from timesheet final'
+ _columns = {
+ 'date': fields.boolean('Date', help='Display date in the history of works'),
+ 'time': fields.boolean('Time spent', help='Display time in the history of works'),
+ 'name': fields.boolean('Name of entry', help='Display detail of work in the invoice line.'),
+ 'price': fields.boolean('Cost', help='Display cost of the item you reinvoice'),
+ 'balance_product': fields.many2one('product.product', 'Balance product', help='The product that will be used to invoice the remaining amount'),
+ }
- def _do_create(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- mod_obj = pool.get('ir.model.data')
+ def do_create(self, cr, uid, ids, context=None):
+ mod_obj = self.pool.get('ir.model.data')
+ analytic_account_obj = self.pool.get('account.analytic.account')
+ res_partner_obj = self.pool.get('res.partner')
+ account_payment_term_obj = self.pool.get('account.payment.term')
+ invoices = []
+
+ if context is None:
+ context = {}
result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
res = mod_obj.read(cr, uid, result, ['res_id'])
- analytic_account_obj = pool.get('account.analytic.account')
- res_partner_obj = pool.get('res.partner')
- account_payment_term_obj = pool.get('account.payment.term')
- account_ids = data['ids']
- invoices = []
+ data = self.read(cr, uid, ids, [], context)[0]
+ account_ids = 'active_ids' in context and context['active_ids'] or []
+
for account in analytic_account_obj.browse(cr, uid, account_ids, context):
partner = account.partner_id
amount_total=0.0
if (not partner) or not (account.pricelist_id):
- raise wizard.except_wizard(_('Analytic account incomplete'),
+ raise osv.except_osv(_('Analytic account incomplete'),
_('Please fill in the partner and pricelist field '
'in the analytic account:\n%s') % (account.name,))
@@ -67,15 +77,15 @@ class final_invoice_create(wizard.interface):
curr_invoice = {
'name': time.strftime('%D')+' - '+account.name,
'partner_id': account.partner_id.id,
- 'address_contact_id': pool.get('res.partner').address_get(cr, uid, [account.partner_id.id], adr_pref=['contact'])['contact'],
- 'address_invoice_id': pool.get('res.partner').address_get(cr, uid, [account.partner_id.id], adr_pref=['invoice'])['invoice'],
+ 'address_contact_id': self.pool.get('res.partner').address_get(cr, uid, [account.partner_id.id], adr_pref=['contact'])['contact'],
+ 'address_invoice_id': self.pool.get('res.partner').address_get(cr, uid, [account.partner_id.id], adr_pref=['invoice'])['invoice'],
'payment_term': partner.property_payment_term.id or False,
'account_id': partner.property_account_receivable.id,
'currency_id': account.pricelist_id.currency_id.id,
'date_due': date_due,
'fiscal_position': account.partner_id.property_account_position.id
}
- last_invoice = pool.get('account.invoice').create(cr, uid, curr_invoice)
+ last_invoice = self.pool.get('account.invoice').create(cr, uid, curr_invoice)
invoices.append(last_invoice)
context2=context.copy()
@@ -106,14 +116,14 @@ class final_invoice_create(wizard.interface):
line.product_uom_id,
move_line.ref""", (account.id,))
for product_id, amount, account_id, product_uom_id, ref in cr.fetchall():
- product = pool.get('product.product').browse(cr, uid, product_id, context2)
+ product = self.pool.get('product.product').browse(cr, uid, product_id, context2)
if product:
taxes = product.taxes_id
else:
taxes = []
- tax = pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id.property_account_position, taxes)
+ tax = self.pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id.property_account_position, taxes)
curr_line = {
'price_unit': -amount,
'quantity': 1.0,
@@ -126,14 +136,14 @@ class final_invoice_create(wizard.interface):
'account_id': account_id,
'account_analytic_id': account.id
}
- pool.get('account.invoice.line').create(cr, uid, curr_line)
+ self.pool.get('account.invoice.line').create(cr, uid, curr_line)
- if not data['form']['balance_product']:
- raise wizard.except_wizard(_('Balance product needed'), _('Please fill a Balance product in the wizard'))
- product = pool.get('product.product').browse(cr, uid, data['form']['balance_product'], context2)
+ if not data['balance_product']:
+ raise osv.except_osv(_('Balance product needed'), _('Please fill a Balance product in the wizard'))
+ product = self.pool.get('product.product').browse(cr, uid, data['balance_product'], context2)
taxes = product.taxes_id
- tax = pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id.property_account_position, taxes)
+ tax = self.pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id.property_account_position, taxes)
account_id = product.product_tmpl_id.property_account_income.id or product.categ_id.property_account_income_categ.id
curr_line = {
'price_unit': account.amount_max - amount_total,
@@ -147,9 +157,9 @@ class final_invoice_create(wizard.interface):
'account_id': account_id,
'account_analytic_id': account.id
}
- pool.get('account.invoice.line').create(cr, uid, curr_line)
+ self.pool.get('account.invoice.line').create(cr, uid, curr_line)
if account.amount_max < amount_total:
- pool.get('account.invoice').write(cr, uid, [last_invoice], {'type': 'out_refund',})
+ self.pool.get('account.invoice').write(cr, uid, [last_invoice], {'type': 'out_refund',})
cr.execute('update account_analytic_line set invoice_id=%s where invoice_id is null and account_id=%s', (last_invoice, account.id))
return {
@@ -161,40 +171,9 @@ class final_invoice_create(wizard.interface):
'view_id': False,
'context': "{'type':'out_invoice'}",
'type': 'ir.actions.act_window',
- 'search_view_id': res['res_id']
- }
+ 'search_view_id': res['res_id']
+ }
+final_invoice_create()
- _create_form = """
-
-
-
-
-
-
-
-
-
"""
-
- _create_fields = {
- 'date': {'string':'Date', 'type':'boolean', 'help':"Display date in the history of works"},
- 'time': {'string':'Time spent', 'type':'boolean', 'help':"Display time in the history of works"},
- 'name': {'string':'Name of entry', 'type':'boolean', 'help':"Display detail of work in the invoice line."},
- 'price': {'string':'Cost', 'type':'boolean', 'help':"Display cost of the item you reinvoice"},
- 'balance_product': {'string':'Balance product', 'type': 'many2one', 'relation':'product.product', 'help':"The product that will be used to invoice the remaining amount."},
- }
-
- states = {
- 'init' : {
- 'actions' : [_get_defaults],
- 'result' : {'type':'form', 'arch':_create_form, 'fields':_create_fields, 'state': [('end','Cancel', 'gtk-cancel'),('create','Create invoices', 'gtk-ok')]},
- },
- 'create' : {
- 'actions' : [],
- 'result' : {'type':'action', 'action':_do_create, 'state':'end'},
- },
- }
-final_invoice_create('hr.timesheet.final.invoice.create')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
index 7e5edca5474..89ff5e92697 100644
--- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
@@ -19,52 +19,69 @@
#
##############################################################################
-import wizard
-import pooler
import time
+
+from osv import osv, fields
from tools.translate import _
-#
-# Create an invoice based on selected timesheet lines
+## Create an invoice based on selected timesheet lines
#
#
# TODO: check unit of measure !!!
#
-class invoice_create(wizard.interface):
- def _get_accounts(self, cr, uid, data, context):
- if not len(data['ids']):
+class hr_timesheet_invoice_create(osv.osv_memory):
+
+ _name = 'hr.timesheet.invoice.create'
+ _description = 'Create invoice from timesheet'
+ _columns = {
+ 'accounts': fields.many2many('account.analytic.account', 'invoice_id', 'account_id', 'Analytic Accounts', required=True),
+ 'date': fields.boolean('Date', help='The real date of each work will be displayed on the invoice'),
+ 'time': fields.boolean('Time spent', help='The time of each work done will be displayed on the invoice'),
+ 'name': fields.boolean('Name of entry', help='The detail of each work done will be displayed on the invoice'),
+ 'price': fields.boolean('Cost', help='The cost of each work done will be displayed on the invoice. You probably don\'t want to check this'),
+ 'product': fields.many2one('product.product', 'Product', help='Complete this field only if you want to force to use a specific product. Keep empty to use the real product that comes from the cost.'),
+ }
+
+ def _get_accounts(self, cr, uid, context=None):
+ if context is None:
+ context = {}
+ if not len(context['active_ids']):
return {}
#Checking whether the analytic line is invoiced or not
- pool = pooler.get_pool(cr.dbname)
- analytic_line_obj = pool.get('account.analytic.line').browse(cr, uid, data['ids'], context)
+ analytic_line_obj = self.pool.get('account.analytic.line').browse(cr, uid, context['active_ids'], context)
for obj_acc in analytic_line_obj:
if obj_acc.invoice_id and obj_acc.invoice_id.state !='cancel':
- raise wizard.except_wizard(_('Warning'),_('The analytic entry "%s" is already invoiced!')%(obj_acc.name,))
-
- cr.execute("SELECT distinct(account_id) from account_analytic_line where id =ANY(%s)",(data['ids'],))
- account_ids = cr.fetchall()
- return {'accounts': [x[0] for x in account_ids]}
+ raise osv.except_osv(_('Warning'),_('The analytic entry "%s" is already invoiced!')%(obj_acc.name,))
+
+ cr.execute("SELECT distinct(account_id) from account_analytic_line where id =ANY(%s)",(context['active_ids'],))
+ account_ids = cr.fetchall()
+ return [x[0] for x in account_ids]
+
+ _defaults = {
+ 'accounts': _get_accounts
+ }
+
+ def do_create(self, cr, uid, ids, context=None):
+ mod_obj = self.pool.get('ir.model.data')
+ analytic_account_obj = self.pool.get('account.analytic.account')
+ res_partner_obj = self.pool.get('res.partner')
+ account_payment_term_obj = self.pool.get('account.payment.term')
+ invoices = []
- def _do_create(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- mod_obj = pool.get('ir.model.data')
result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
res = mod_obj.read(cr, uid, result, ['res_id'])
- analytic_account_obj = pool.get('account.analytic.account')
- res_partner_obj = pool.get('res.partner')
- account_payment_term_obj = pool.get('account.payment.term')
- account_ids = data['form']['accounts'][0][2]
- invoices = []
+ data = self.read(cr, uid, ids, [], context)[0]
+ account_ids = data['accounts']
for account in analytic_account_obj.browse(cr, uid, account_ids, context):
partner = account.partner_id
if (not partner) or not (account.pricelist_id):
- raise wizard.except_wizard(_('Analytic Account incomplete'),
+ raise osv.except_osv(_('Analytic Account incomplete'),
_('Please fill in the Associate Partner and Sale Pricelist fields in the Analytic Account:\n%s') % (account.name,))
if not partner.address:
- raise wizard.except_wizard(_('Partner incomplete'),
+ raise osv.except_osv(_('Partner incomplete'),
_('Please fill in the Address field in the Partner: %s.') % (partner.name,))
date_due = False
@@ -90,7 +107,7 @@ class invoice_create(wizard.interface):
'date_due': date_due,
'fiscal_position': account.partner_id.property_account_position.id
}
- last_invoice = pool.get('account.invoice').create(cr, uid, curr_invoice)
+ last_invoice = self.pool.get('account.invoice').create(cr, uid, curr_invoice)
invoices.append(last_invoice)
context2=context.copy()
@@ -99,26 +116,26 @@ class invoice_create(wizard.interface):
"FROM account_analytic_line as line " \
"WHERE account_id = %s " \
"AND id =ANY(%s) AND to_invoice IS NOT NULL " \
- "GROUP BY product_id,to_invoice", (account.id,data['ids'],))
+ "GROUP BY product_id,to_invoice", (account.id,context['active_ids'],))
for product_id,factor_id,qty in cr.fetchall():
product = pool.get('product.product').browse(cr, uid, product_id, context2)
if not product:
- raise wizard.except_wizard(_('Error'), _('At least one line has no product !'))
+ raise osv.except_osv(_('Error'), _('At least one line has no product !'))
factor_name = ''
factor = pool.get('hr_timesheet_invoice.factor').browse(cr, uid, factor_id, context2)
- if not data['form']['product']:
+ if not data['product']:
if factor.customer_name:
factor_name = product.name+' - '+factor.customer_name
else:
factor_name = product.name
else:
- factor_name = pool.get('product.product').name_get(cr, uid, [data['form']['product']], context=context)[0][1]
+ factor_name = pool.get('product.product').name_get(cr, uid, [data['product']], context=context)[0][1]
if account.pricelist_id:
pl = account.pricelist_id.id
- price = pool.get('product.pricelist').price_get(cr,uid,[pl], data['form']['product'] or product_id, qty or 1.0, account.partner_id.id)[pl]
+ price = pool.get('product.pricelist').price_get(cr,uid,[pl], data['product'] or product_id, qty or 1.0, account.partner_id.id)[pl]
else:
price = 0.0
@@ -132,7 +149,7 @@ class invoice_create(wizard.interface):
'invoice_line_tax_id': [(6,0,tax )],
'invoice_id': last_invoice,
'name': factor_name,
- 'product_id': data['form']['product'] or product_id,
+ 'product_id': data['product'] or product_id,
'invoice_line_tax_id': [(6,0,tax)],
'uos_id': product.uom_id.id,
'account_id': account_id,
@@ -149,27 +166,27 @@ class invoice_create(wizard.interface):
for line in line_ids:
# set invoice_line_note
details = []
- if data['form']['date']:
+ if data['date']:
details.append(line['date'])
- if data['form']['time']:
+ if data['time']:
if line['product_uom_id']:
details.append("%s %s" % (line['unit_amount'], pool.get('product.uom').browse(cr, uid, [line['product_uom_id']])[0].name))
else:
details.append("%s" % (line['unit_amount'], ))
- if data['form']['name']:
+ if data['name']:
details.append(line['name'])
- #if data['form']['price']:
+ #if data['price']:
# details.append(abs(line['amount']))
note.append(u' - '.join(map(lambda x: unicode(x) or '',details)))
curr_line['note'] = "\n".join(map(lambda x: unicode(x) or '',note))
pool.get('account.invoice.line').create(cr, uid, curr_line)
- cr.execute("update account_analytic_line set invoice_id=%s WHERE account_id = %s and id =ANY(%s)" ,(last_invoice,account.id,data['ids']))
+ cr.execute("update account_analytic_line set invoice_id=%s WHERE account_id = %s and id =ANY(%s)" ,(last_invoice, account.id,data['ids']))
- pool.get('account.invoice').button_reset_taxes(cr, uid, [last_invoice], context)
+ self.pool.get('account.invoice').button_reset_taxes(cr, uid, [last_invoice], context)
- mod_obj = pooler.get_pool(cr.dbname).get('ir.model.data')
- act_obj = pooler.get_pool(cr.dbname).get('ir.actions.act_window')
+ mod_obj = self.pool.get('ir.model.data')
+ act_obj = self.pool.get('ir.actions.act_window')
mod_id = mod_obj.search(cr, uid, [('name', '=', 'action_invoice_tree1')])[0]
res_id = mod_obj.read(cr, uid, mod_id, ['res_id'])['res_id']
@@ -190,45 +207,8 @@ class invoice_create(wizard.interface):
# 'search_view_id': res['res_id']
# }
- _create_form = """
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
"""
- _create_fields = {
- 'accounts': {'string':'Analytic Accounts', 'type':'many2many', 'required':'true', 'relation':'account.analytic.account'},
- 'date': {'string':'Date', 'type':'boolean', 'help':'The real date of each work will be displayed on the invoice'},
- 'time': {'string':'Time spent', 'type':'boolean', 'help':'The time of each work done will be displayed on the invoice'},
- 'name': {'string':'Name of entry', 'type':'boolean', 'help':'The detail of each work done will be displayed on the invoice'},
- 'price': {'string':'Cost', 'type':'boolean', 'help':'The cost of each work done will be displayed on the invoice. You probably don\'t want to check this.'},
- 'product': {'string':'Product', 'type':'many2one', 'relation': 'product.product', 'help':"Complete this field only if you want to force to use a specific product. Keep empty to use the real product that comes from the cost."},
- }
-
- states = {
- 'init' : {
- 'actions' : [_get_accounts],
- 'result' : {'type':'form', 'arch':_create_form, 'fields':_create_fields, 'state': [('end','Cancel', 'gtk-cancel'),('create','Create Invoices', 'gtk-ok')]},
- },
- 'create' : {
- 'actions' : [],
- 'result' : {'type':'action', 'action':_do_create, 'state':'end'},
- },
- }
-invoice_create('hr.timesheet.invoice.create')
+hr_timesheet_invoice_create()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_final_view.xml b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_final_view.xml
new file mode 100644
index 00000000000..7b3f5ed4d6a
--- /dev/null
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_final_view.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+ hr.timesheet.invoice.create.final.form
+ hr.timesheet.invoice.create.final
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Final Invoice
+ ir.actions.act_window
+ hr.timesheet.invoice.create.final
+ form
+ form
+ new
+
+
+
+
+
+ Final Invoice
+ client_action_multi
+
+ action
+ account.analytic.account
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_view.xml b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_view.xml
new file mode 100644
index 00000000000..7ddf3bc99a7
--- /dev/null
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create_view.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+ hr.timesheet.invoice.create.form
+ hr.timesheet.invoice.create
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Invoice analytic lines
+ ir.actions.act_window
+ hr.timesheet.invoice.create
+ form
+ form
+ new
+
+
+
+
+
+ Invoice analytic lines
+ client_action_multi
+
+ action
+ account.analytic.line
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_timesheet_sheet/wizard/__init__.py b/addons/hr_timesheet_sheet/wizard/__init__.py
index f6fba6021af..485bfbe5db2 100644
--- a/addons/hr_timesheet_sheet/wizard/__init__.py
+++ b/addons/hr_timesheet_sheet/wizard/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,12 +15,11 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
-import wizard_timesheet_current
-import wizard_timesheet_department
+import hr_timesheet_current
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_timesheet_sheet/wizard/wizard_timesheet_current.py b/addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py
similarity index 73%
rename from addons/hr_timesheet_sheet/wizard/wizard_timesheet_current.py
rename to addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py
index 8613df3bc82..4d9998014c8 100644
--- a/addons/hr_timesheet_sheet/wizard/wizard_timesheet_current.py
+++ b/addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,27 +15,27 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
-
-
-import wizard
-import netsvc
import time
-import pooler
-from osv import osv
+
+from osv import osv, fields
from tools.translate import _
-class wiz_timesheet_open(wizard.interface):
- def _open_timesheet(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- user_ids = pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)])
- if not len(user_ids):
- raise wizard.except_wizard(_('Error !'), _('No employee defined for your user !'))
- ts = pool.get('hr_timesheet_sheet.sheet')
- ids = ts.search(cr, uid, [('user_id','=',uid),('state','=','draft'),('date_from','<=',time.strftime('%Y-%m-%d')), ('date_to','>=',time.strftime('%Y-%m-%d'))])
+class hr_timesheet_current_open(osv.osv_memory):
+ _name = 'hr.timesheet.current.open'
+ _description = 'hr.timesheet.current.open'
+
+ def open_timesheet(self, cr, uid, ids, context=None):
+ ts = self.pool.get('hr_timesheet_sheet.sheet')
view_type = 'form,tree'
+
+ user_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)])
+ if not len(user_ids):
+ raise osv.except_osv(_('Error !'), _('No employee defined for your user !'))
+ ids = ts.search(cr, uid, [('user_id','=',uid),('state','=','draft'),('date_from','<=',time.strftime('%Y-%m-%d')), ('date_to','>=',time.strftime('%Y-%m-%d'))])
+
if len(ids) > 1:
view_type = 'tree,form'
domain = "[('id','in',["+','.join(map(str, ids))+"]),('user_id', '=', uid)]"
@@ -46,7 +46,7 @@ class wiz_timesheet_open(wizard.interface):
domain = "[('user_id', '=', uid)]"
value = {
'domain': domain,
- 'name': 'Open timesheet',
+ 'name': 'Open Timesheet',
'view_type': 'form',
'view_mode': view_type,
'res_model': 'hr_timesheet_sheet.sheet',
@@ -57,14 +57,6 @@ class wiz_timesheet_open(wizard.interface):
value['res_id'] = ids[0]
return value
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type':'action', 'action':_open_timesheet, 'state':'end'}
- }
- }
-wiz_timesheet_open('hr_timesheet_sheet.current.open')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+hr_timesheet_current_open()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_timesheet_sheet/wizard/wizard_timesheet_department.py b/addons/hr_timesheet_sheet/wizard/wizard_timesheet_department.py
deleted file mode 100644
index 93aa12045ba..00000000000
--- a/addons/hr_timesheet_sheet/wizard/wizard_timesheet_department.py
+++ /dev/null
@@ -1,114 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-
-import wizard
-import netsvc
-import time
-import pooler
-from osv import osv
-
-class wiz_timesheet_open(wizard.interface):
- def _open_timesheet(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- dep_ids = pool.get('hr.department').search(cr, uid, [('manager_id','=',uid)])
- user_ids = {}
- for dep in pool.get('hr.department').browse(cr, uid, dep_ids, context):
- for user in dep.member_ids:
- user_ids[user.id] = 1
- value = {
- 'domain': "[('user_id', 'in', "+str(user_ids.keys())+")]",
- 'name': 'Timesheets',
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'hr_timesheet_sheet.sheet',
- 'view_id': False,
- 'type': 'ir.actions.act_window'
- }
- return value
-
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type':'action', 'action':_open_timesheet, 'state':'end'}
- }
- }
-wiz_timesheet_open('hr_timesheet_sheet.department.open')
-
-class wiz_timesheet_confirm_open(wizard.interface):
- def _open_timesheet(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- dep_ids = pool.get('hr.department').search(cr, uid, [('manager_id','=',uid)])
- user_ids = {}
- for dep in pool.get('hr.department').browse(cr, uid, dep_ids, context):
- for user in dep.member_ids:
- user_ids[user.id] = 1
- value = {
- 'domain': "[('user_id', 'in', "+str(user_ids.keys())+"),('state','=','draft')]",
- 'name': 'Timesheets',
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'hr_timesheet_sheet.sheet',
- 'view_id': False,
- 'type': 'ir.actions.act_window'
- }
- return value
-
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type':'action', 'action':_open_timesheet, 'state':'end'}
- }
- }
-wiz_timesheet_confirm_open('hr_timesheet_sheet.department.confirm.open')
-
-
-class wiz_timesheet_validate_open(wizard.interface):
- def _open_timesheet(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- dep_ids = pool.get('hr.department').search(cr, uid, [('manager_id','=',uid)])
- user_ids = {}
- for dep in pool.get('hr.department').browse(cr, uid, dep_ids, context):
- for user in dep.member_ids:
- user_ids[user.id] = 1
- value = {
- 'domain': "[('user_id', 'in', "+str(user_ids.keys())+"),('state','=','confirm')]",
- 'name': 'Timesheets',
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'hr_timesheet_sheet.sheet',
- 'view_id': False,
- 'type': 'ir.actions.act_window'
- }
- return value
-
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type':'action', 'action':_open_timesheet, 'state':'end'}
- }
- }
-wiz_timesheet_validate_open('hr_timesheet_sheet.department.validate.open')
-
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py
index 429a3497634..675c4a73bb0 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -162,16 +162,25 @@ class mrp_bom(osv.osv):
"""
result = {}
bom_obj = self.pool.get('mrp.bom')
+ bom_id = context and context.get('active_id', False) or False
+ cr.execute('select id from mrp_bom')
+ if all(bom_id != r[0] for r in cr.fetchall()):
+ ids.sort()
+ bom_id = ids[0]
+ bom_parent = bom_obj.browse(cr, uid, bom_id)
for bom in self.browse(cr, uid, ids, context=context):
- result[bom.id] = map(lambda x: x.id, bom.bom_lines)
+ if (bom_parent and bom_parent.multi_level_bom) or bom.id == bom_id:
+ result[bom.id] = map(lambda x: x.id, bom.bom_lines)
+ else:
+ result[bom.id] = []
if bom.bom_lines:
continue
ok = ((name=='child_complete_ids') and (bom.product_id.supply_method=='produce'))
- if bom.type=='phantom' or ok:
+ if (bom.type=='phantom' or ok) and bom_parent.multi_level_bom:
sids = bom_obj.search(cr, uid, [('bom_id','=',False),('product_id','=',bom.product_id.id)])
if sids:
bom2 = bom_obj.browse(cr, uid, sids[0], context=context)
- result[bom.id] += map(lambda x: x.id, bom2.bom_lines)
+ result[bom.id] += map(lambda x: x.id, bom2.bom_lines)
return result
@@ -267,7 +276,7 @@ class mrp_bom(osv.osv):
v['name'] = prod.name
return {'value': v}
return {}
-
+
def _bom_find(self, cr, uid, product_id, product_uom, properties=[]):
""" Finds BoM for particular product and product uom.
@param product_id: Selected product.
diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml
index 7f36a3688a1..5b8b7c41084 100644
--- a/addons/mrp/mrp_view.xml
+++ b/addons/mrp/mrp_view.xml
@@ -253,13 +253,13 @@
-
+
-
+
diff --git a/addons/olap/__openerp__.py b/addons/olap/__openerp__.py
index 933463638cc..bdca188a08f 100644
--- a/addons/olap/__openerp__.py
+++ b/addons/olap/__openerp__.py
@@ -46,7 +46,8 @@
"data/olap_security.xml",
'security/ir.model.access.csv'
],
- "demo_xml" : ["data/olap_demo.xml"],
+ "demo_xml" : ["data/olap_demo.xml",
+ "test/olap_test00.yml"],
"active": False,
"installable": True
}
diff --git a/addons/olap/data/olap_fact_view.xml b/addons/olap/data/olap_fact_view.xml
index 0dc543ace1e..f01db863f6e 100755
--- a/addons/olap/data/olap_fact_view.xml
+++ b/addons/olap/data/olap_fact_view.xml
@@ -41,10 +41,7 @@
-
-
@@ -277,7 +274,7 @@
-
+
@@ -325,7 +322,7 @@
-
+
@@ -340,9 +337,5 @@
id="menu_view_olap_application_field_form"
parent="menu_bi_conf_known_application"/>
-
-
-
-
diff --git a/addons/olap/olap.py b/addons/olap/olap.py
index 338d61f81fa..6097c6dbf14 100644
--- a/addons/olap/olap.py
+++ b/addons/olap/olap.py
@@ -96,8 +96,8 @@ class olap_fact_database(osv.osv):
raise osv.except_osv('Error (cx_Oracle) : ', e)
except Exception,e:
- raise osv.except_osv('BI Error !', e)
-
+ raise osv.except_osv('Error !', e)
+ raise osv.except_osv('Message', 'Connection Successful !')
return True
_columns = {
diff --git a/addons/olap/test/olap_test00.yml b/addons/olap/test/olap_test00.yml
new file mode 100644
index 00000000000..af87950468f
--- /dev/null
+++ b/addons/olap/test/olap_test00.yml
@@ -0,0 +1,111 @@
+-
+ In order to check olap module which is used to configure BI from OpenERP client.I create olap fact database record.
+-
+ !record {model: olap.fact.database, id: olap_fact_database_openerp0}:
+ connection_type: port
+ db_host: localhost
+ db_login: postgres
+ db_name: tiny
+ db_password: '123456'
+ db_port: 5432
+ name: OpenERP
+ type: postgres
+-
+ I will check the connection for successful login. >>>>>>(Problem)
+# !python {model: olap.fact.database}: |
+ # self.test_connection(cr, uid,[ref('olap_fact_database_openerp0')], context)
+-
+ In order to test schema,I create a new schema record.
+-
+ !record {model: olap.schema, id: olap_schema_Partners0}:
+ database_id: olap_fact_database_openerp0
+ name: Partners
+-
+ I press "Connect to Database" and I see that the Schema State is "Database Connected" now
+-
+ !workflow {model: olap.schema, action: dbconnect, ref: olap_schema_Partners0}
+-
+ Now I will load the structure of the database. by structure we mean tables, columns and the relations. This will help in defining cube easily.
+-
+ !record {model: bi.load.db.wizard, id: bi_load_db_wizard_0}:
+ db_name: OpenERP
+ fact_table: Partners
+-
+ I can see two buttons for Configuration one for manually and the other is for Automatically.I press "Configure Automatically".After configuration I can see that the Boolean Configuring Data-structure is True now Schema State is "The Structure is Configured" and there is one button "Mark as Configured"
+-
+ !record {model: bi.auto.configure.wizard, id: bi_auto_configure_wizard_Partners0}:
+ name: Partners
+-
+ Performing a workflow action load on module olap.schema
+-
+ !workflow {model: olap.schema, action: dbload, ref: olap_schema_Partners0}
+-
+ Performing a workflow action configure on module olap.schema
+-
+ !workflow {model: olap.schema, action: dbconfigure, ref: olap_schema_Partners0}
+-
+ Performing a workflow action dbready on module olap.schema
+-
+ !workflow {model: olap.schema, action: dbready, ref: olap_schema_Partners0}
+-
+ In order to create Cube I first define the fact table.Fact table are the key tables in which measures are stored and we can branch to other tables for other parameters.
+-
+ !record {model: olap.database.tables, id: database_table_res_partner}:
+ active: True
+ fact_database_id: fact_database_terp
+ name: res_partner
+ table_db_name: res_partner
+-
+ I create cube table and select ID of as Relational Column.Then I select related record in Joined tables.
+-
+ !record {model: olap.cube.table, id: olap_cube_table_partnercubetable0}:
+ column_link_id: olap.columns_res_partner_id
+ name: Partner cube table
+ available_table_ids:
+ - olap.columns_res_partner_date
+ - olap.columns_res_partner_id
+ - olap.columns_res_partner_credit_limit
+ - olap.columns_res_partner_user_id
+
+-
+ I can configure Cube from BI Cube Designer.I make sure that OpenERP BI web-client is running.From Configuration I click on "Cube Designer" and It will open Cube Designer in my system browser.I can see that the schema "Partners" is visible through Cube Designer.
+-
+ Creating olap cube
+-
+ !record {model: olap.cube, id: olap_cube_partnercube0}:
+ name: Partner cube
+ query_log: true
+ schema_id: olap_schema_Partners0
+ table_id: olap_cube_table_partnercubetable0
+-
+ After cube we can decide upon the dimensions to be used for the cube.In order to analyze Partner I create one dimension.
+-
+ !record {model: olap.dimension, id: olap_dimension_products0}:
+ name: Products
+ cube_id: olap_cube_partnercube0
+-
+ After adding the dimension I create hierarchy.
+-
+ !record {model: olap.hierarchy, id: olap_hierarchy_allproducts0}:
+ dimension_id: olap_dimension_products0
+ name: All Products
+ sequence: 1
+ table_id: olap_cube_table_partnercubetable0
+-
+ After adding the hierarchy I create level.I select Product's default_code as Columns Name that is loaded in Fact columns.
+-
+ !record {model: olap.level, id: olap_level_productscode0}:
+ column_id_name: name
+ column_name: olap.columns_res_user_name
+ hierarchy_id: olap_hierarchy_allproducts0
+ name: Products code
+ sequence: 1
+ table_name: res_users
+ type: normal
+-
+ I will check that columns is loaded in Fact Table.
+-
+ !python {model: olap.load.column}: |
+ ids = self.search(cr, uid, [])
+ self.get_table_data(cr, uid, ids, {'active_ids': [ref('olap_cube_table_partnercubetable0')]})
+
diff --git a/addons/olap/wizard/olap_load_column.py b/addons/olap/wizard/olap_load_column.py
index 422a50abcff..65517626d62 100644
--- a/addons/olap/wizard/olap_load_column.py
+++ b/addons/olap/wizard/olap_load_column.py
@@ -26,7 +26,6 @@ class olap_load_column(osv.osv_memory):
_description = "Olap Load Column"
def get_table_data(self, cr, uid, ids, context={}):
-
"""
This function load column
@param cr: the current row, from the database cursor,
diff --git a/addons/scrum/scrum_view.xml b/addons/scrum/scrum_view.xml
index 0697b086e28..329a77bc56d 100644
--- a/addons/scrum/scrum_view.xml
+++ b/addons/scrum/scrum_view.xml
@@ -313,7 +313,7 @@
-
+
diff --git a/addons/stock_invoice_directly/i18n/ru.po b/addons/stock_invoice_directly/i18n/ru.po
index b0015c39163..6e9c05f8114 100644
--- a/addons/stock_invoice_directly/i18n/ru.po
+++ b/addons/stock_invoice_directly/i18n/ru.po
@@ -7,16 +7,16 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-04-10 14:08+0000\n"
-"Last-Translator: <>\n"
+"PO-Revision-Date: 2010-04-25 14:27+0000\n"
+"Last-Translator: Andrey Kulakov \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 04:20+0000\n"
+"X-Launchpad-Export-Date: 2010-04-26 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: stock_invoice_directly
#: model:ir.module.module,shortdesc:stock_invoice_directly.module_meta_information
msgid "Invoice Picking Directly"
-msgstr ""
+msgstr "Напрямую выставляемый счет"
diff --git a/addons/survey/__openerp__.py b/addons/survey/__openerp__.py
index 367e6af5b8d..ee4099828f2 100644
--- a/addons/survey/__openerp__.py
+++ b/addons/survey/__openerp__.py
@@ -44,6 +44,9 @@
'wizard/survey_print.xml',
'wizard/survey_send_invitation.xml'],
'demo_xml': ['survey_demo.xml'],
+ 'test': [
+ 'test/survey00.yml',
+ ],
'installable': True,
'active': False,
}
diff --git a/addons/survey/test/survey00.yml b/addons/survey/test/survey00.yml
new file mode 100644
index 00000000000..7bfe8a5320d
--- /dev/null
+++ b/addons/survey/test/survey00.yml
@@ -0,0 +1,159 @@
+- |
+ Survey Scenario:
+ In order to check the survey module in OpenERP.
+-
+ I Create the one survey and give survey title "Partner Feedback" and define the survey pages and survey question.
+-
+ I Create "Partner Feedback" survey.
+-
+ !record {model: 'survey', id: survey_partner_0}:
+ title: 'Partner Feedback'
+ max_response_limit: 20
+-
+ I Create "Who are you?" page in "Partner Feedback" survey with title .
+-
+ !record {model: 'survey.page', id: survey_partner_page_0}:
+ title: 'Who are you?'
+ survey_id: survey_partner_0
+-
+ I Create "What is your company name?" question in "Who are you" survey page.
+-
+ !record {model: 'survey.question', id: survey_p_question_0}:
+ question: 'What is your company name?'
+ type: single_textbox
+ sequence: 1
+ page_id: survey_partner_page_0
+-
+ I Create "What is your company size?" question in "Who are you" survey page.
+-
+ !record {model: 'survey.question', id: survey_p_question_1}:
+ question: 'What is your company size?'
+ type: multiple_choice_only_one_ans
+ sequence: 2
+ is_require_answer: true
+ page_id: survey_partner_page_0
+-
+ I Create "1-50" answer in question "What is your company size?"
+-
+ !record {model: 'survey.answer', id: survey_p_1_1}:
+ answer: '1 - 50'
+ sequence: 1
+ question_id : survey_p_question_1
+-
+ I Create "51 - 100" answer in question "What is your company size?"
+-
+ !record {model: 'survey.answer', id: survey_p_1_2}:
+ answer: '51 - 100'
+ sequence: 2
+ question_id : survey_p_question_1
+-
+ I Create "100 - 500" answer in question "What is your company size?"
+-
+ !record {model: 'survey.answer', id: survey_p_1_3}:
+ answer: '100 - 500'
+ sequence: 3
+ question_id : survey_p_question_1
+-
+ I Create "500 - 1000" answer in question "What is your company size?"
+-
+ !record {model: 'survey.answer', id: survey_p_1_4}:
+ answer: '500 - 1000'
+ sequence: 4
+ question_id : survey_p_question_1
+-
+ I Create "> 1000" answer in question "What is your company size?"
+-
+ !record {model: 'survey.answer', id: survey_p_1_5}:
+ answer: '> 1000'
+ sequence: 5
+ question_id : survey_p_question_1
+-
+ I Create another "Contract" page in "Partner Feedback" survey.
+-
+ !record {model: 'survey.page', id: survey_partner_page_1}:
+ title: 'Contract'
+ survey_id: survey_partner_0
+-
+ I Create "Which maintenance contract do you sell to your customers." question in "Contract" survey page.
+-
+ !record {model: 'survey.question', id: survey_p_question_3}:
+ question: 'Which maintenance contract do you sell to your customers.'
+ type: multiple_choice_only_one_ans
+ sequence: 1
+ page_id: survey_partner_page_1
+-
+ I Create "OpenERP maintenance contract" answer in question "Which maintenance contract do you sell to your customers."
+-
+ !record {model: 'survey.answer', id: survey_p_3_1}:
+ answer: 'OpenERP maintenance contract'
+ sequence: 1
+ question_id : survey_p_question_3
+-
+ I Create "Your own contract, but you buy an OpenERP one" answer in question "Which maintenance contract do you sell to your customers."
+-
+ !record {model: 'survey.answer', id: survey_p_3_2}:
+ answer: 'Your own contract, but you buy an OpenERP one'
+ sequence: 2
+ question_id : survey_p_question_3
+-
+ I Create "Your own contract without buying an OpenERP one" answer in question "Which maintenance contract do you sell to your customers."
+-
+ !record {model: 'survey.answer', id: survey_p_3_3}:
+ answer: 'Your own contract without buying an OpenERP one'
+ sequence: 3
+ question_id : survey_p_question_3
+-
+ I Create "When do you propose a maintenance contract to your customers?" question in "Contract" survey page.
+-
+ !record {model: 'survey.question', id: survey_p_question_4}:
+ question: When do you propose a maintenance contract to your customers?
+ type: multiple_choice_only_one_ans
+ sequence: 2
+ comment_field_type: text
+ comment_label: Why?
+ is_require_answer: true
+ is_comment_require: true
+ page_id: survey_partner_page_1
+-
+ I Create "With each integration" answer in question "When do you propose a maintenance contract to your customers?"
+-
+ !record {model: 'survey.answer', id: survey_p_4_1}:
+ answer: 'With each integration'
+ sequence: 1
+ question_id : survey_p_question_4
+-
+ I Create "Sometimes" answer in question "When do you propose a maintenance contract to your customers?"
+-
+ !record {model: 'survey.answer', id: survey_p_4_2}:
+ answer: 'Sometimes'
+ sequence: 2
+ question_id : survey_p_question_4
+-
+ I Create "Never... " answer in question "When do you propose a maintenance contract to your customers?"
+-
+ !record {model: 'survey.answer', id: survey_p_4_3}:
+ answer: 'Never... '
+ sequence: 3
+ question_id : survey_p_question_4
+-
+ Now Survey set in open state.
+-
+ !python {model: survey}: |
+ self.survey_open(cr, uid, [ref("survey_partner_0")], context)
+-
+ Give answer of the survey, Run "Answer a Survey" wizard and select the survey and press on start button then run the selected survey.
+-
+ !python {model: survey.name.wiz}: |
+ ids = self.create(cr, uid, {'survey_id': ref("survey_partner_0")})
+ self.action_next(cr, uid, [ids], context)
+-
+ Give answer of the first and second page in "Partner Feedback" suvey.
+-
+ !python {model: survey.question.wiz}: |
+ ids = self.create(cr, uid, {str(ref("survey_p_question_0")) +"_single" :'Tiny' , str(ref("survey_p_question_1")) + "_selection" :int(ref("survey_p_1_1"))}, context)
+ ids = self.create(cr, uid, {str(ref("survey_p_question_3")) +"_selection" : int(ref("survey_p_3_1")), str(ref("survey_p_question_4")) +"_selection": int(ref("survey_p_4_1"))},context)
+-
+ Set the value in "Total start survey" field.
+-
+ !python {model: survey}: |
+ ids = self.write(cr, uid, ref("survey_partner_0"), {'tot_start_survey' : 1}, context)
diff --git a/addons/wiki/__openerp__.py b/addons/wiki/__openerp__.py
index 033060ad1a7..65a4212c289 100644
--- a/addons/wiki/__openerp__.py
+++ b/addons/wiki/__openerp__.py
@@ -42,7 +42,8 @@
'data/wiki_main.xml',
'security/ir.model.access.csv'
],
- 'demo_xml': [],
+ 'demo_xml': ['test/wiki_test00.yml'],
+ # 'demo_xml': [],
'installable': True,
'active': False,
'certificate': '0086363630317',
diff --git a/addons/wiki/test/wiki_test00.yml b/addons/wiki/test/wiki_test00.yml
new file mode 100755
index 00000000000..cdaa28c1829
--- /dev/null
+++ b/addons/wiki/test/wiki_test00.yml
@@ -0,0 +1,72 @@
+-
+ In order to test the wiki in OpenERP, I create a new wiki group on Select Display Method Tree
+-
+ !record {model: wiki.groups, id: wiki_groups_wikigrouptest0}:
+ method: tree
+ name: Wiki Group Test
+ notes: I can Generate New Group for Select Display method = Tree.
+-
+ Now I will create new wikipage and assign Group test to this page
+-
+ !record {model: wiki.wiki, id: wiki_wiki_openerpwikiediting0}:
+ group_id: wiki.wiki_groups_wikigrouptest0
+ name: OpenERP Wiki Test
+ section: '1.1'
+ text_area: '=The Open ERP wiki=
+
+ The Open ERP wiki allows you to manage your enterprise contents using wiki
+
+ restructured texts. This module provides a collaborative way to manage internal
+
+ FAQs, quality manuals, technical references, etc.
+
+ '
+-
+ I Get Help on this current page by clicking on "Basic wiki Editing" wizard
+-
+ !python {model: wiki.wiki}: |
+ self.open_wiki_page(cr, uid, [ref("wiki_wiki_openerpwikiediting0")], context)
+-
+ I create Index on this current page by clicking on "Create Index" wizard
+-
+ !python {model: wiki.make.index}: |
+ ids = self.search(cr, uid, [])
+ self.wiki_do_index(cr, uid, ids , {'active_ids': [ref('wiki_wiki_openerpwikiediting0')]})
+-
+ # Remaining Act window
+ I check the page history for the current page by clicking on "Page History".After that find difference between history.
+-
+ I create a new wiki group on the Given Home Page
+-
+ !record {model: wiki.groups, id: wiki_groups_wikigroupediting0}:
+ name: Wiki Group Editing
+ home: wiki.wiki_wiki_quickstart0
+-
+ I open a wiki page on this given group and page by clicking on Open wiki Page wizard.
+-
+ !python {model: wiki.wiki.page.open}: |
+ ids = self.search(cr, uid, [])
+ self.open_wiki_page(cr, uid, ids, {'active_ids': [ref('wiki_groups_wikigroupediting0')]})
+-
+ # Remaining beacuse of Act window (I search the page by clicking on the "search page".)
+ In order to create a menu I will create wizard data
+-
+ !record {model: wiki.groups, id: wiki.wiki_groups_wikiformatting0}:
+ home: wiki.wiki_wiki_main
+-
+ I create a Menu by clicking on "create menu" button.
+ # The folowing is not running properly because of osv memory problem
+-
+ !record {model: wiki.create.menu, id: wiki_create_menu_0}:
+ menu_name: Wiki Test menu
+ menu_parent_id: base.menu_base_partner
+ page: wiki.wiki_wiki_openerpwikiediting0
+-
+ #I will check that menu is generated properly
+-
+ # Remaining because some problem occur
+ #!python {model: wiki.create.menu}: |
+ # ids = self.search(cr, uid, [])
+ # self.wiki_menu_create(cr, uid, ids, context)
+
+