[MERGE] merged latest fixes from 6.0 up to r.4556

Rev 4556 = revision-id: jvo@tinyerp.com-20110502133745-s1zyed65h6ojwkvk.

bzr revid: odo@openerp.com-20110502184643-d3qzosqdurscd51i
This commit is contained in:
Olivier Dony 2011-05-02 20:46:43 +02:00
commit 560915cb68
80 changed files with 900 additions and 241 deletions

View File

@ -1258,7 +1258,7 @@ class account_invoice_line(osv.osv):
t = t - (p * l[2].get('quantity')) t = t - (p * l[2].get('quantity'))
taxes = l[2].get('invoice_line_tax_id') taxes = l[2].get('invoice_line_tax_id')
if len(taxes[0]) >= 3 and taxes[0][2]: if len(taxes[0]) >= 3 and taxes[0][2]:
taxes = tax_obj.browse(cr, uid, taxes[0][2]) taxes = tax_obj.browse(cr, uid, list(taxes[0][2]))
for tax in tax_obj.compute_all(cr, uid, taxes, p,l[2].get('quantity'), context.get('address_invoice_id', False), l[2].get('product_id', False), context.get('partner_id', False))['taxes']: for tax in tax_obj.compute_all(cr, uid, taxes, p,l[2].get('quantity'), context.get('address_invoice_id', False), l[2].get('product_id', False), context.get('partner_id', False))['taxes']:
t = t - tax['amount'] t = t - tax['amount']
return t return t

View File

@ -214,4 +214,4 @@ report_sxw.report_sxw('report.account.balancesheet', 'account.account',
'addons/account/report/account_balance_sheet.rml',parser=report_balancesheet_horizontal, 'addons/account/report/account_balance_sheet.rml',parser=report_balancesheet_horizontal,
header='internal') header='internal')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -89,7 +89,7 @@ class account_invoice_report(osv.osv):
ai.payment_term as payment_term, ai.payment_term as payment_term,
ai.period_id as period_id, ai.period_id as period_id,
(case when u.uom_type not in ('reference') then (case when u.uom_type not in ('reference') then
(select name from product_uom where uom_type='reference' and category_id=u.category_id) (select name from product_uom where uom_type='reference' and active and category_id=u.category_id LIMIT 1)
else else
u.name u.name
end) as uom_name, end) as uom_name,

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################## ##############################################################################
# #

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- encoding: utf-8 -*- # -*- encoding: utf-8 -*-
############################################################################## ##############################################################################
# #

View File

@ -190,7 +190,7 @@ class crossovered_budget_lines(osv.osv):
_description = "Budget Line" _description = "Budget Line"
_columns = { _columns = {
'crossovered_budget_id': fields.many2one('crossovered.budget', 'Budget', ondelete='cascade', select=True, required=True), 'crossovered_budget_id': fields.many2one('crossovered.budget', 'Budget', ondelete='cascade', select=True, required=True),
'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account',required=False), 'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account',required=True),
'general_budget_id': fields.many2one('account.budget.post', 'Budgetary Position',required=True), 'general_budget_id': fields.many2one('account.budget.post', 'Budgetary Position',required=True),
'date_from': fields.date('Start Date', required=True), 'date_from': fields.date('Start Date', required=True),
'date_to': fields.date('End Date', required=True), 'date_to': fields.date('End Date', required=True),

View File

@ -162,6 +162,7 @@
<field name="date" select="1" invisible="context.get('line_type', False)" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/> <field name="date" select="1" invisible="context.get('line_type', False)" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="reference" select="1" invisible="context.get('line_type', False)" string="Payment Ref"/> <field name="reference" select="1" invisible="context.get('line_type', False)" string="Payment Ref"/>
<field name="name" colspan="2" invisible="context.get('line_type', False)"/> <field name="name" colspan="2" invisible="context.get('line_type', False)"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="account_id" <field name="account_id"
widget="selection" widget="selection"
invisible="True"/> invisible="True"/>
@ -221,7 +222,6 @@
</page> </page>
<page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}"> <page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}">
<group col="6" colspan="4"> <group col="6" colspan="4">
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
<field name="period_id"/> <field name="period_id"/>
<field name="audit"/> <field name="audit"/>
</group> </group>
@ -303,6 +303,7 @@
<field name="date" select="1" invisible="context.get('line_type', False)" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/> <field name="date" select="1" invisible="context.get('line_type', False)" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="reference" select="1" invisible="context.get('line_type', False)" string="Payment Ref"/> <field name="reference" select="1" invisible="context.get('line_type', False)" string="Payment Ref"/>
<field name="name" colspan="2" invisible="context.get('line_type', False)"/> <field name="name" colspan="2" invisible="context.get('line_type', False)"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="account_id" <field name="account_id"
widget="selection" widget="selection"
invisible="True"/> invisible="True"/>
@ -362,7 +363,6 @@
</page> </page>
<page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}"> <page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}">
<group col="6" colspan="4"> <group col="6" colspan="4">
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
<field name="period_id"/> <field name="period_id"/>
<field name="audit"/> <field name="audit"/>
</group> </group>

View File

@ -100,7 +100,8 @@
<field name="date" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/> <field name="date" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="journal_id" domain="[('type','in',['sale','sale_refund'])]" widget="selection" on_change="onchange_journal(journal_id, line_cr_ids, tax_id, partner_id)"/> <field name="journal_id" domain="[('type','in',['sale','sale_refund'])]" widget="selection" on_change="onchange_journal(journal_id, line_cr_ids, tax_id, partner_id)"/>
<field name="number"/> <field name="number"/>
<field name="name" colspan="4"/> <field name="name" colspan="2"/>
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
<field name="type" invisible="True"/> <field name="type" invisible="True"/>
<field name="currency_id"/> <field name="currency_id"/>
</group> </group>
@ -140,7 +141,6 @@
</page> </page>
<page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}"> <page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}">
<group col="6" colspan="4"> <group col="6" colspan="4">
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
<field name="period_id"/> <field name="period_id"/>
<field name="audit"/> <field name="audit"/>
</group> </group>
@ -228,6 +228,7 @@
<field name="number"/> <field name="number"/>
<field name="name" colspan="2"/> <field name="name" colspan="2"/>
<field name="reference" select="1"/> <field name="reference" select="1"/>
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
<field name="account_id" domain="[('type','=','other')]" invisible="True"/> <field name="account_id" domain="[('type','=','other')]" invisible="True"/>
<field name="type" invisible="True"/> <field name="type" invisible="True"/>
<field name="currency_id"/> <field name="currency_id"/>
@ -260,7 +261,6 @@
</page> </page>
<page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}"> <page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}">
<group col="6" colspan="4"> <group col="6" colspan="4">
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
<field name="period_id"/> <field name="period_id"/>
<field name="audit"/> <field name="audit"/>
</group> </group>

View File

@ -295,9 +295,8 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory):
eview = etree.fromstring(res['arch']) eview = etree.fromstring(res['arch'])
placeholder = eview.xpath("group[@name='placeholder1']") placeholder = eview.xpath("group[@name='placeholder1']")
placeholder = len(placeholder) and placeholder[0] or None if len(placeholder):
placeholder = placeholder[0]
if placeholder:
if step == 'new_window' and state == 'clear': if step == 'new_window' and state == 'clear':
# clicked in the menu and the fields are not anonymized: warn the admin that backuping the db is very important # clicked in the menu and the fields are not anonymized: warn the admin that backuping the db is very important
placeholder.addnext(etree.Element('field', {'name': 'msg', 'colspan': '4', 'nolabel': '1'})) placeholder.addnext(etree.Element('field', {'name': 'msg', 'colspan': '4', 'nolabel': '1'}))

View File

@ -406,13 +406,16 @@ class audittrail_objects_proxy(object_proxy):
cr.close() cr.close()
return res return res
else: else:
res_ids = args[0] res_ids = []
old_values = {} res = True
fields = [] if args:
if len(args)>1 and type(args[1]) == dict: res_ids = args[0]
fields = args[1].keys() old_values = {}
if type(res_ids) in (long, int): fields = []
res_ids = [res_ids] if len(args)>1 and type(args[1]) == dict:
fields = args[1].keys()
if type(res_ids) in (long, int):
res_ids = [res_ids]
if res_ids: if res_ids:
for resource in resource_pool.read(cr, uid, res_ids): for resource in resource_pool.read(cr, uid, res_ids):
resource_id = resource['id'] resource_id = resource['id']

View File

@ -41,6 +41,7 @@ from string import ascii_letters, digits
from osv import fields,osv from osv import fields,osv
import pooler import pooler
from tools.translate import _ from tools.translate import _
from service import security
magic_md5 = '$1$' magic_md5 = '$1$'
@ -184,7 +185,7 @@ class users(osv.osv):
cr.close() cr.close()
def _login(self, cr, db, login, password): def _login(self, cr, db, login, password):
cr.execute( 'SELECT password, id FROM res_users WHERE login=%s', cr.execute( 'SELECT password, id FROM res_users WHERE login=%s AND active',
(login.encode('utf-8'),)) (login.encode('utf-8'),))
if cr.rowcount: if cr.rowcount:
@ -220,6 +221,10 @@ class users(osv.osv):
return False return False
def check(self, db, uid, passwd): def check(self, db, uid, passwd):
if not passwd:
# empty passwords disallowed for obvious security reasons
raise security.ExceptionNoTb('AccessDenied')
# Get a chance to hash all passwords in db before using the uid_cache. # Get a chance to hash all passwords in db before using the uid_cache.
obj = pooler.get_pool(db).get('res.users') obj = pooler.get_pool(db).get('res.users')
if not hasattr(obj, "_salt_cache"): if not hasattr(obj, "_salt_cache"):
@ -245,7 +250,7 @@ class users(osv.osv):
raise security.ExceptionNoTb('AccessDenied') raise security.ExceptionNoTb('AccessDenied')
else: else:
salt = self._salt_cache[db][uid] salt = self._salt_cache[db][uid]
cr.execute('SELECT COUNT(*) FROM res_users WHERE id=%s AND password=%s', cr.execute('SELECT COUNT(*) FROM res_users WHERE id=%s AND password=%s AND active',
(int(uid), encrypt_md5(passwd, salt))) (int(uid), encrypt_md5(passwd, salt)))
res = cr.fetchone()[0] res = cr.fetchone()[0]
finally: finally:

View File

@ -6,21 +6,62 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n" "Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n" "Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-28 00:58+0000\n" "POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2010-01-26 11:45+0000\n" "PO-Revision-Date: 2011-04-03 13:20+0000\n"
"Last-Translator: Boris <boris.t.ivanov@gmail.com>\n" "Last-Translator: Vasil Bojilov Bovilov <Unknown>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-04-24 04:03+0000\n" "X-Launchpad-Export-Date: 2011-04-04 05:53+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build 12559)\n"
#. module: base_module_doc_rst
#: view:ir.module.module:0
msgid "You can save this image as .png file"
msgstr "Можете да запишете това изображение като .png файл"
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0 #: wizard_view:tech.guide.rst,init:0
msgid "Technical Guide in rst format" msgid "Technical Guide in rst format"
msgstr "Техническо ръководство във формат rst" msgstr "Техническо ръководство във формат rst"
#. module: base_module_doc_rst
#: wizard_button:create.relation.graph,init,end:0
msgid "Ok"
msgstr "Ok"
#. module: base_module_doc_rst
#: wizard_view:create.relation.graph,init:0
msgid "(Relationship Graphs generated)"
msgstr "(Генерирана е графика с релациите)"
#. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0
msgid "Please choose a file where the Technical Guide will be written."
msgstr "Изберете фйл в който Техническото ръководство ще бъде написано."
#. module: base_module_doc_rst
#: model:ir.module.module,description:base_module_doc_rst.module_meta_information
msgid ""
"\n"
" * This module generates the Technical Guides of selected modules in "
"Restructured Text format (RST)\n"
" * It uses the Sphinx (http://sphinx.pocoo.org) implementation of RST\n"
" * It creates a tarball (.tgz file suffix) containing an index file and "
"one file per module\n"
" * Generates Relationship Graph\n"
" "
msgstr ""
"\n"
" * В този модул се генерират технически ръководства на избрани модули в "
"преструктуриран текстов формат(RST)\n"
"* При него се използва сфинкс (http://sphinx.pocoo.org) прилагане на RST\n"
"* Това създава tarball (. наставка tgz файл), съдържащ индекс файл и файл на "
"модул\n"
"* Генерира Връзка Graph\n"
" "
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_field:tech.guide.rst,init,name:0 #: wizard_field:tech.guide.rst,init,name:0
msgid "filename" msgid "filename"
@ -32,9 +73,21 @@ msgid "Create RST Technical Guide"
msgstr "Създай ръководство във формат rst" msgstr "Създай ръководство във формат rst"
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0 #: model:ir.actions.wizard,name:base_module_doc_rst.wiz_gen_graph
msgid "Please choose a file where the Technical Guide will be written." msgid "Generate Relationship Graph"
msgstr "Изберете фйл в който Техническото ръководство ще бъде написано." msgstr "Генериране на графика за релациите"
#. module: base_module_doc_rst
#: wizard_view:create.relation.graph,init:0
#: view:ir.module.module:0
#: field:ir.module.module,file_graph:0
msgid "Relationship Graph"
msgstr "Диаграма на връзките"
#. module: base_module_doc_rst
#: model:ir.model,name:base_module_doc_rst.model_ir_module_module
msgid "Module"
msgstr "Модул"
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_field:tech.guide.rst,init,rst_file:0 #: wizard_field:tech.guide.rst,init,rst_file:0
@ -51,6 +104,11 @@ msgstr "Затвори"
msgid "Module Technical Guide in Restructured Text " msgid "Module Technical Guide in Restructured Text "
msgstr "Модул Техническо ръководство като преструктуриран текст " msgstr "Модул Техническо ръководство като преструктуриран текст "
#. module: base_module_doc_rst
#: model:ir.actions.report.xml,name:base_module_doc_rst.report_proximity_graph
msgid "Proximity graph"
msgstr "Графика на сближаване"
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0 #: wizard_view:tech.guide.rst,init:0
msgid "Create Technical Guide in rst format" msgid "Create Technical Guide in rst format"

View File

@ -6,22 +6,63 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n" "Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n" "Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-28 00:58+0000\n" "POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2010-01-26 11:45+0000\n" "PO-Revision-Date: 2011-03-26 18:22+0000\n"
"Last-Translator: Jordi Esteve - http://www.zikzakmedia.com " "Last-Translator: Jordi Esteve (www.zikzakmedia.com) "
"<jesteve@zikzakmedia.com>\n" "<jesteve@zikzakmedia.com>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-04-24 04:03+0000\n" "X-Launchpad-Export-Date: 2011-03-27 06:28+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build 12559)\n"
#. module: base_module_doc_rst
#: view:ir.module.module:0
msgid "You can save this image as .png file"
msgstr "Podeu desar aquesta imatge com un fitxer. png"
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0 #: wizard_view:tech.guide.rst,init:0
msgid "Technical Guide in rst format" msgid "Technical Guide in rst format"
msgstr "Guia tècnica en format RST" msgstr "Guia tècnica en format RST"
#. module: base_module_doc_rst
#: wizard_button:create.relation.graph,init,end:0
msgid "Ok"
msgstr "D'acord"
#. module: base_module_doc_rst
#: wizard_view:create.relation.graph,init:0
msgid "(Relationship Graphs generated)"
msgstr "(Gràfics de relacions generats)"
#. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0
msgid "Please choose a file where the Technical Guide will be written."
msgstr "Seleccioneu un fitxer on la guia tècnica serà escrita."
#. module: base_module_doc_rst
#: model:ir.module.module,description:base_module_doc_rst.module_meta_information
msgid ""
"\n"
" * This module generates the Technical Guides of selected modules in "
"Restructured Text format (RST)\n"
" * It uses the Sphinx (http://sphinx.pocoo.org) implementation of RST\n"
" * It creates a tarball (.tgz file suffix) containing an index file and "
"one file per module\n"
" * Generates Relationship Graph\n"
" "
msgstr ""
"\n"
" * Aquest mòdul genera les guies tècniques dels mòduls seleccionats en "
"RST (Restructured Text format).\n"
" * Utilitza la implementació Sphinx d'RST (http://sphinx.pocoo.org).\n"
" * Crea un arxiu comprimit (amb extensió .tgz) que conté un fitxer índex "
"i un fitxer per mòdul.\n"
" * Genera un gràfic de relacions.\n"
" "
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_field:tech.guide.rst,init,name:0 #: wizard_field:tech.guide.rst,init,name:0
msgid "filename" msgid "filename"
@ -33,9 +74,21 @@ msgid "Create RST Technical Guide"
msgstr "Crea guia tècnica RST" msgstr "Crea guia tècnica RST"
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0 #: model:ir.actions.wizard,name:base_module_doc_rst.wiz_gen_graph
msgid "Please choose a file where the Technical Guide will be written." msgid "Generate Relationship Graph"
msgstr "Seleccioneu un fitxer on la guia tècnica serà escrita." msgstr "Genera gràfic de relacions"
#. module: base_module_doc_rst
#: wizard_view:create.relation.graph,init:0
#: view:ir.module.module:0
#: field:ir.module.module,file_graph:0
msgid "Relationship Graph"
msgstr "Gràfic de relacions"
#. module: base_module_doc_rst
#: model:ir.model,name:base_module_doc_rst.model_ir_module_module
msgid "Module"
msgstr "Mòdul"
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_field:tech.guide.rst,init,rst_file:0 #: wizard_field:tech.guide.rst,init,rst_file:0
@ -52,6 +105,11 @@ msgstr "Tanca"
msgid "Module Technical Guide in Restructured Text " msgid "Module Technical Guide in Restructured Text "
msgstr "Guia tècnica d'un mòdul en text reestructurat (RST) " msgstr "Guia tècnica d'un mòdul en text reestructurat (RST) "
#. module: base_module_doc_rst
#: model:ir.actions.report.xml,name:base_module_doc_rst.report_proximity_graph
msgid "Proximity graph"
msgstr "Gràfic de proximitat"
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0 #: wizard_view:tech.guide.rst,init:0
msgid "Create Technical Guide in rst format" msgid "Create Technical Guide in rst format"

View File

@ -6,22 +6,63 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n" "Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n" "Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-28 00:58+0000\n" "POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2010-01-26 11:45+0000\n" "PO-Revision-Date: 2011-03-26 18:22+0000\n"
"Last-Translator: Jordi Esteve - http://www.zikzakmedia.com " "Last-Translator: Jordi Esteve (www.zikzakmedia.com) "
"<jesteve@zikzakmedia.com>\n" "<jesteve@zikzakmedia.com>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-04-24 04:03+0000\n" "X-Launchpad-Export-Date: 2011-03-27 06:28+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build 12559)\n"
#. module: base_module_doc_rst
#: view:ir.module.module:0
msgid "You can save this image as .png file"
msgstr "Puede guardar esta imagen como un archivo .png"
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0 #: wizard_view:tech.guide.rst,init:0
msgid "Technical Guide in rst format" msgid "Technical Guide in rst format"
msgstr "Guía técnica en formato RST" msgstr "Guía técnica en formato RST"
#. module: base_module_doc_rst
#: wizard_button:create.relation.graph,init,end:0
msgid "Ok"
msgstr "Aceptar"
#. module: base_module_doc_rst
#: wizard_view:create.relation.graph,init:0
msgid "(Relationship Graphs generated)"
msgstr "(Gráficos de relaciones generados)"
#. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0
msgid "Please choose a file where the Technical Guide will be written."
msgstr "Por favor, seleccione un archivo donde la guía técnica será escrita."
#. module: base_module_doc_rst
#: model:ir.module.module,description:base_module_doc_rst.module_meta_information
msgid ""
"\n"
" * This module generates the Technical Guides of selected modules in "
"Restructured Text format (RST)\n"
" * It uses the Sphinx (http://sphinx.pocoo.org) implementation of RST\n"
" * It creates a tarball (.tgz file suffix) containing an index file and "
"one file per module\n"
" * Generates Relationship Graph\n"
" "
msgstr ""
"\n"
" * Este módulo genera las guías técnicas de los módulos seleccionados en "
"RST (Restructured Text format).\n"
" * Utiliza la implementación Sphinx de RST (http://sphinx.pocoo.org).\n"
" * Crea un archivo comprimido (con extensión .tgz) que contiene un "
"archivo índice y un archivo por módulo.\n"
" * Genera un gráfico de relaciones.\n"
" "
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_field:tech.guide.rst,init,name:0 #: wizard_field:tech.guide.rst,init,name:0
msgid "filename" msgid "filename"
@ -33,9 +74,21 @@ msgid "Create RST Technical Guide"
msgstr "Crear guía técnica RST" msgstr "Crear guía técnica RST"
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0 #: model:ir.actions.wizard,name:base_module_doc_rst.wiz_gen_graph
msgid "Please choose a file where the Technical Guide will be written." msgid "Generate Relationship Graph"
msgstr "Por favor, seleccione un archivo donde la guía técnica será escrita." msgstr "Genera gráfico de relaciones"
#. module: base_module_doc_rst
#: wizard_view:create.relation.graph,init:0
#: view:ir.module.module:0
#: field:ir.module.module,file_graph:0
msgid "Relationship Graph"
msgstr "Gráfico de relaciones"
#. module: base_module_doc_rst
#: model:ir.model,name:base_module_doc_rst.model_ir_module_module
msgid "Module"
msgstr "Módulo"
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_field:tech.guide.rst,init,rst_file:0 #: wizard_field:tech.guide.rst,init,rst_file:0
@ -52,6 +105,11 @@ msgstr "Cerrar"
msgid "Module Technical Guide in Restructured Text " msgid "Module Technical Guide in Restructured Text "
msgstr "Guía técnica de un módulo en texto reestructurado (RST) " msgstr "Guía técnica de un módulo en texto reestructurado (RST) "
#. module: base_module_doc_rst
#: model:ir.actions.report.xml,name:base_module_doc_rst.report_proximity_graph
msgid "Proximity graph"
msgstr "Gráfico de proximidad"
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0 #: wizard_view:tech.guide.rst,init:0
msgid "Create Technical Guide in rst format" msgid "Create Technical Guide in rst format"

View File

@ -0,0 +1,116 @@
# Spanish (Paraguay) translation for openobject-addons
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2011-03-08 17:38+0000\n"
"Last-Translator: fadel <Unknown>\n"
"Language-Team: Spanish (Paraguay) <es_PY@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-03-09 06:12+0000\n"
"X-Generator: Launchpad (build 12351)\n"
#. module: base_module_doc_rst
#: view:ir.module.module:0
msgid "You can save this image as .png file"
msgstr "Puede guardar esta image como un archivo .png"
#. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0
msgid "Technical Guide in rst format"
msgstr "Guía técnica en formato RST"
#. module: base_module_doc_rst
#: wizard_button:create.relation.graph,init,end:0
msgid "Ok"
msgstr "Aceptar"
#. module: base_module_doc_rst
#: wizard_view:create.relation.graph,init:0
msgid "(Relationship Graphs generated)"
msgstr "(Generado gráfico de relaciones)"
#. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0
msgid "Please choose a file where the Technical Guide will be written."
msgstr "Por favor, seleccione un archivo donde la guía técnica será escrita."
#. module: base_module_doc_rst
#: model:ir.module.module,description:base_module_doc_rst.module_meta_information
msgid ""
"\n"
" * This module generates the Technical Guides of selected modules in "
"Restructured Text format (RST)\n"
" * It uses the Sphinx (http://sphinx.pocoo.org) implementation of RST\n"
" * It creates a tarball (.tgz file suffix) containing an index file and "
"one file per module\n"
" * Generates Relationship Graph\n"
" "
msgstr ""
"\n"
" Este módulo genera las guías técnicas de los módulos seleccionados en "
"RST\n"
"Utiliza la implementación Sphinx de RST (http://sphinx.pocoo.org) \n"
"Crea un archivo comprimido (con extensión .tgz) que contiene un archivo "
"índice y un archivo por módulo\n"
"Genera un gráfico de relaciones\n"
" "
#. module: base_module_doc_rst
#: wizard_field:tech.guide.rst,init,name:0
msgid "filename"
msgstr "Nombre de Archivo"
#. module: base_module_doc_rst
#: model:ir.actions.wizard,name:base_module_doc_rst.wiz_tech_guide_rst
msgid "Create RST Technical Guide"
msgstr "Crear guía técnica RST"
#. module: base_module_doc_rst
#: model:ir.actions.wizard,name:base_module_doc_rst.wiz_gen_graph
msgid "Generate Relationship Graph"
msgstr "Genera gráfico de relaciones"
#. module: base_module_doc_rst
#: wizard_view:create.relation.graph,init:0
#: view:ir.module.module:0
#: field:ir.module.module,file_graph:0
msgid "Relationship Graph"
msgstr "Gráfico de Relaciones"
#. module: base_module_doc_rst
#: model:ir.model,name:base_module_doc_rst.model_ir_module_module
msgid "Module"
msgstr "Módulo"
#. module: base_module_doc_rst
#: wizard_field:tech.guide.rst,init,rst_file:0
msgid "file"
msgstr "Archivo"
#. module: base_module_doc_rst
#: wizard_button:tech.guide.rst,init,end:0
msgid "Close"
msgstr "Cerrar"
#. module: base_module_doc_rst
#: model:ir.module.module,shortdesc:base_module_doc_rst.module_meta_information
msgid "Module Technical Guide in Restructured Text "
msgstr "Guía técnica de un módulo en texto reestructurado (RST) "
#. module: base_module_doc_rst
#: model:ir.actions.report.xml,name:base_module_doc_rst.report_proximity_graph
msgid "Proximity graph"
msgstr "Gráfico de proximidad"
#. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0
msgid "Create Technical Guide in rst format"
msgstr "Crear guía técnica en formato RST"

View File

@ -6,21 +6,62 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n" "Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n" "Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-28 00:58+0000\n" "POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2010-01-26 12:00+0000\n" "PO-Revision-Date: 2011-03-10 20:02+0000\n"
"Last-Translator: Freerk Kalsbeek (Mindswitch BV) <f.kalsbeek@mindswitch.nl>\n" "Last-Translator: Wouter Schrijvers <Unknown>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-04-24 04:03+0000\n" "X-Launchpad-Export-Date: 2011-03-11 06:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build 12559)\n"
#. module: base_module_doc_rst
#: view:ir.module.module:0
msgid "You can save this image as .png file"
msgstr "Deze weergave kan als .png bestand opgeslagen worden"
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0 #: wizard_view:tech.guide.rst,init:0
msgid "Technical Guide in rst format" msgid "Technical Guide in rst format"
msgstr "Techische handleiding in rst formaat" msgstr "Techische handleiding in rst formaat"
#. module: base_module_doc_rst
#: wizard_button:create.relation.graph,init,end:0
msgid "Ok"
msgstr "Ok"
#. module: base_module_doc_rst
#: wizard_view:create.relation.graph,init:0
msgid "(Relationship Graphs generated)"
msgstr "(Relatiegrafiek wordt gegenereerd)"
#. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0
msgid "Please choose a file where the Technical Guide will be written."
msgstr "Kies een bestand waar de Technische handleiding wordt opgeslagen"
#. module: base_module_doc_rst
#: model:ir.module.module,description:base_module_doc_rst.module_meta_information
msgid ""
"\n"
" * This module generates the Technical Guides of selected modules in "
"Restructured Text format (RST)\n"
" * It uses the Sphinx (http://sphinx.pocoo.org) implementation of RST\n"
" * It creates a tarball (.tgz file suffix) containing an index file and "
"one file per module\n"
" * Generates Relationship Graph\n"
" "
msgstr ""
"\n"
" * Deze module genereert de Technische Gids voor de geselecteerde modules "
"in Restructured Text format (RST)\n"
" * De Sphinx (http://sphinx.pocoo.org) RST-implementatie wordt gebruikt\n"
" * De gecreëerde tarball (.tgz bestandsextensie) bevat een index-bestand "
"en één bestand per module\n"
" * Genereert Relatiegrafiek\n"
" "
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_field:tech.guide.rst,init,name:0 #: wizard_field:tech.guide.rst,init,name:0
msgid "filename" msgid "filename"
@ -32,9 +73,21 @@ msgid "Create RST Technical Guide"
msgstr "RST Technische handleiding aanmaken" msgstr "RST Technische handleiding aanmaken"
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0 #: model:ir.actions.wizard,name:base_module_doc_rst.wiz_gen_graph
msgid "Please choose a file where the Technical Guide will be written." msgid "Generate Relationship Graph"
msgstr "Kies een bestand waar de Technische handleiding wordt opgeslagen" msgstr "Genereer Relatiegrafiek"
#. module: base_module_doc_rst
#: wizard_view:create.relation.graph,init:0
#: view:ir.module.module:0
#: field:ir.module.module,file_graph:0
msgid "Relationship Graph"
msgstr "Relatiegrafiek"
#. module: base_module_doc_rst
#: model:ir.model,name:base_module_doc_rst.model_ir_module_module
msgid "Module"
msgstr "Module"
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_field:tech.guide.rst,init,rst_file:0 #: wizard_field:tech.guide.rst,init,rst_file:0
@ -51,6 +104,11 @@ msgstr "Sluiten"
msgid "Module Technical Guide in Restructured Text " msgid "Module Technical Guide in Restructured Text "
msgstr "Module Technische Handleiding in Restructured Text (rst) " msgstr "Module Technische Handleiding in Restructured Text (rst) "
#. module: base_module_doc_rst
#: model:ir.actions.report.xml,name:base_module_doc_rst.report_proximity_graph
msgid "Proximity graph"
msgstr ""
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0 #: wizard_view:tech.guide.rst,init:0
msgid "Create Technical Guide in rst format" msgid "Create Technical Guide in rst format"

View File

@ -6,52 +6,111 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n" "Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n" "Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-28 00:58+0000\n" "POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2010-01-26 10:55+0000\n" "PO-Revision-Date: 2011-04-25 14:11+0000\n"
"Last-Translator: <>\n" "Last-Translator: Stanislav Hanzhin <Unknown>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-04-24 04:03+0000\n" "X-Launchpad-Export-Date: 2011-04-30 06:07+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build 12758)\n"
#. module: base_module_doc_rst
#: view:ir.module.module:0
msgid "You can save this image as .png file"
msgstr "Вы можете сохранить это изображение как PNG-файл"
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0 #: wizard_view:tech.guide.rst,init:0
msgid "Technical Guide in rst format" msgid "Technical Guide in rst format"
msgstr "" msgstr "Техническое руководство в формате RST"
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_field:tech.guide.rst,init,name:0 #: wizard_button:create.relation.graph,init,end:0
msgid "filename" msgid "Ok"
msgstr "" msgstr "OK"
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: model:ir.actions.wizard,name:base_module_doc_rst.wiz_tech_guide_rst #: wizard_view:create.relation.graph,init:0
msgid "Create RST Technical Guide" msgid "(Relationship Graphs generated)"
msgstr "" msgstr "(Графы отношений сгенерированны)"
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0 #: wizard_view:tech.guide.rst,init:0
msgid "Please choose a file where the Technical Guide will be written." msgid "Please choose a file where the Technical Guide will be written."
msgstr "" msgstr ""
"Пожалуйста, выберите файл, куда будет записано Техническое руководство"
#. module: base_module_doc_rst
#: model:ir.module.module,description:base_module_doc_rst.module_meta_information
msgid ""
"\n"
" * This module generates the Technical Guides of selected modules in "
"Restructured Text format (RST)\n"
" * It uses the Sphinx (http://sphinx.pocoo.org) implementation of RST\n"
" * It creates a tarball (.tgz file suffix) containing an index file and "
"one file per module\n"
" * Generates Relationship Graph\n"
" "
msgstr ""
"\n"
" * Этот модуль генерирует Техническое Руководство для выбранных модулей в "
"формате Restructured Text format (RST)\n"
" * Он использует реализацию RST из Sphinx (http://sphinx.pocoo.org)\n"
" * Это создает архив (с расширением .tgz), содержащий файл индекса и один "
"файл на каждый модуль\n"
" * Создает граф отношений\n"
" "
#. module: base_module_doc_rst
#: wizard_field:tech.guide.rst,init,name:0
msgid "filename"
msgstr "имя файла"
#. module: base_module_doc_rst
#: model:ir.actions.wizard,name:base_module_doc_rst.wiz_tech_guide_rst
msgid "Create RST Technical Guide"
msgstr "Создать Техническое Руководство в формате RST"
#. module: base_module_doc_rst
#: model:ir.actions.wizard,name:base_module_doc_rst.wiz_gen_graph
msgid "Generate Relationship Graph"
msgstr "Сгенерировать граф отношений"
#. module: base_module_doc_rst
#: wizard_view:create.relation.graph,init:0
#: view:ir.module.module:0
#: field:ir.module.module,file_graph:0
msgid "Relationship Graph"
msgstr "Граф отношений"
#. module: base_module_doc_rst
#: model:ir.model,name:base_module_doc_rst.model_ir_module_module
msgid "Module"
msgstr "Модуль"
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_field:tech.guide.rst,init,rst_file:0 #: wizard_field:tech.guide.rst,init,rst_file:0
msgid "file" msgid "file"
msgstr "" msgstr "файл"
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_button:tech.guide.rst,init,end:0 #: wizard_button:tech.guide.rst,init,end:0
msgid "Close" msgid "Close"
msgstr "" msgstr "Закрыть"
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: model:ir.module.module,shortdesc:base_module_doc_rst.module_meta_information #: model:ir.module.module,shortdesc:base_module_doc_rst.module_meta_information
msgid "Module Technical Guide in Restructured Text " msgid "Module Technical Guide in Restructured Text "
msgstr "" msgstr "Техническая документация модуля хранится в формате RST "
#. module: base_module_doc_rst
#: model:ir.actions.report.xml,name:base_module_doc_rst.report_proximity_graph
msgid "Proximity graph"
msgstr "Граф доступности"
#. module: base_module_doc_rst #. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0 #: wizard_view:tech.guide.rst,init:0
msgid "Create Technical Guide in rst format" msgid "Create Technical Guide in rst format"
msgstr "" msgstr "Создать Техническое Руководство в формате rst"

View File

@ -0,0 +1,108 @@
# Albanian translation for openobject-addons
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2011-03-28 15:34+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Albanian <sq@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-03-29 06:21+0000\n"
"X-Generator: Launchpad (build 12559)\n"
#. module: base_module_doc_rst
#: view:ir.module.module:0
msgid "You can save this image as .png file"
msgstr ""
#. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0
msgid "Technical Guide in rst format"
msgstr ""
#. module: base_module_doc_rst
#: wizard_button:create.relation.graph,init,end:0
msgid "Ok"
msgstr ""
#. module: base_module_doc_rst
#: wizard_view:create.relation.graph,init:0
msgid "(Relationship Graphs generated)"
msgstr ""
#. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0
msgid "Please choose a file where the Technical Guide will be written."
msgstr ""
#. module: base_module_doc_rst
#: model:ir.module.module,description:base_module_doc_rst.module_meta_information
msgid ""
"\n"
" * This module generates the Technical Guides of selected modules in "
"Restructured Text format (RST)\n"
" * It uses the Sphinx (http://sphinx.pocoo.org) implementation of RST\n"
" * It creates a tarball (.tgz file suffix) containing an index file and "
"one file per module\n"
" * Generates Relationship Graph\n"
" "
msgstr ""
#. module: base_module_doc_rst
#: wizard_field:tech.guide.rst,init,name:0
msgid "filename"
msgstr ""
#. module: base_module_doc_rst
#: model:ir.actions.wizard,name:base_module_doc_rst.wiz_tech_guide_rst
msgid "Create RST Technical Guide"
msgstr ""
#. module: base_module_doc_rst
#: model:ir.actions.wizard,name:base_module_doc_rst.wiz_gen_graph
msgid "Generate Relationship Graph"
msgstr ""
#. module: base_module_doc_rst
#: wizard_view:create.relation.graph,init:0
#: view:ir.module.module:0
#: field:ir.module.module,file_graph:0
msgid "Relationship Graph"
msgstr ""
#. module: base_module_doc_rst
#: model:ir.model,name:base_module_doc_rst.model_ir_module_module
msgid "Module"
msgstr ""
#. module: base_module_doc_rst
#: wizard_field:tech.guide.rst,init,rst_file:0
msgid "file"
msgstr ""
#. module: base_module_doc_rst
#: wizard_button:tech.guide.rst,init,end:0
msgid "Close"
msgstr ""
#. module: base_module_doc_rst
#: model:ir.module.module,shortdesc:base_module_doc_rst.module_meta_information
msgid "Module Technical Guide in Restructured Text "
msgstr ""
#. module: base_module_doc_rst
#: model:ir.actions.report.xml,name:base_module_doc_rst.report_proximity_graph
msgid "Proximity graph"
msgstr ""
#. module: base_module_doc_rst
#: wizard_view:tech.guide.rst,init:0
msgid "Create Technical Guide in rst format"
msgstr ""

View File

@ -24,7 +24,7 @@ from osv import fields, osv
from tools.translate import _ from tools.translate import _
import crm import crm
import time import time
from datetime import datetime, timedelta from datetime import datetime
class crm_phonecall(crm_case, osv.osv): class crm_phonecall(crm_case, osv.osv):
""" Phonecall Cases """ """ Phonecall Cases """
@ -110,14 +110,15 @@ class crm_phonecall(crm_case, osv.osv):
@param ids: List of case Ids @param ids: List of case Ids
@param *args: Tuple Value for additional Params @param *args: Tuple Value for additional Params
""" """
res = True
for phone in self.browse(cr, uid, ids): for phone in self.browse(cr, uid, ids):
phone_id= phone.id phone_id = phone.id
data = {'date_closed': time.strftime('%Y-%m-%d %H:%M:%S')} data = {'date_closed': time.strftime('%Y-%m-%d %H:%M:%S')}
if phone.duration <=0: if phone.duration <=0:
duration = datetime.now() - datetime.strptime(phone.date, '%Y-%m-%d %H:%M:%S') duration = datetime.now() - datetime.strptime(phone.date, '%Y-%m-%d %H:%M:%S')
data.update({'duration': duration.seconds/float(60)}) data.update({'duration': duration.seconds/float(60)})
res = super(crm_phonecall, self).case_close(cr, uid, [phone_id], args) res = super(crm_phonecall, self).case_close(cr, uid, [phone_id], args)
self.write(cr, uid, ids, data) self.write(cr, uid, [phone_id], data)
return res return res
def case_reset(self, cr, uid, ids, *args): def case_reset(self, cr, uid, ids, *args):

View File

@ -61,7 +61,7 @@
<group col="2" colspan="2"> <group col="2" colspan="2">
<separator colspan="4" string="Categorization"/> <separator colspan="4" string="Categorization"/>
<field name="priority"/> <field name="priority"/>
<field name="categ_id"/> <field name="categ_id" context="{'object_id':'crm.helpdesk'}"/>
<field name="canal_id"/> <field name="canal_id"/>
</group> </group>

View File

@ -49,6 +49,7 @@ class document_file(osv.osv):
It also establishes the parent_id NOT NULL constraint that ir.attachment It also establishes the parent_id NOT NULL constraint that ir.attachment
should have had (but would have failed if plain attachments contained null should have had (but would have failed if plain attachments contained null
values). values).
It also updates the File Size for the previously created attachments.
""" """
parent_id = self.pool.get('document.directory')._get_root_directory(cr,uid) parent_id = self.pool.get('document.directory')._get_root_directory(cr,uid)
@ -62,7 +63,11 @@ class document_file(osv.osv):
cr.execute("UPDATE ir_attachment " \ cr.execute("UPDATE ir_attachment " \
"SET parent_id = %s, db_datas = decode(encode(db_datas,'escape'), 'base64') " \ "SET parent_id = %s, db_datas = decode(encode(db_datas,'escape'), 'base64') " \
"WHERE parent_id IS NULL", (parent_id,)) "WHERE parent_id IS NULL", (parent_id,))
cr.execute("UPDATE ir_attachment SET file_size=length(db_datas) WHERE file_size = 0;")
cr.execute("ALTER TABLE ir_attachment ALTER parent_id SET NOT NULL") cr.execute("ALTER TABLE ir_attachment ALTER parent_id SET NOT NULL")
return True return True
def _get_filestore(self, cr): def _get_filestore(self, cr):

0
addons/document/odt2txt.py Normal file → Executable file
View File

0
addons/document/test_cindex.py Normal file → Executable file
View File

0
addons/document_ftp/ftpserver/ftpserver.py Normal file → Executable file
View File

0
addons/document_webdav/test_davclient.py Normal file → Executable file
View File

View File

@ -253,7 +253,7 @@ unless it is already specified in the From Email, e.g: John Doe <john@doe.com>",
except Exception, error: except Exception, error:
raise osv.except_osv( raise osv.except_osv(
_("Out going connection test failed"), _("Out going connection test failed"),
_("Reason: %s") % error _("Reason: %s") % tools.ustr(error)
) )
def do_approval(self, cr, uid, ids, context=None): def do_approval(self, cr, uid, ids, context=None):
@ -272,7 +272,7 @@ unless it is already specified in the From Email, e.g: John Doe <john@doe.com>",
try: try:
serv = self.get_outgoing_server(cursor, user, id, context) serv = self.get_outgoing_server(cursor, user, id, context)
except Exception, error: except Exception, error:
logger.notifyChannel(_("Email Template"), netsvc.LOG_ERROR, _("Mail from Account %s failed on login. Probable Reason:Could not login to server\nError: %s") % (id, error)) logger.notifyChannel(_("Email Template"), netsvc.LOG_ERROR, _("Mail from Account %s failed on login. Probable Reason:Could not login to server\nError: %s") % (id, tools.ustr(error)))
return False return False
#Everything is complete, now return the connection #Everything is complete, now return the connection
return serv return serv
@ -359,13 +359,13 @@ unless it is already specified in the From Email, e.g: John Doe <john@doe.com>",
Encoders.encode_base64(part) Encoders.encode_base64(part)
payload_part.attach(part) payload_part.attach(part)
except Exception, error: except Exception, error:
logger.notifyChannel(_("Email Template"), netsvc.LOG_ERROR, _("Mail from Account %s failed. Probable Reason:MIME Error\nDescription: %s") % (id, error)) logger.notifyChannel(_("Email Template"), netsvc.LOG_ERROR, _("Mail from Account %s failed. Probable Reason:MIME Error\nDescription: %s") % (id, tools.ustr(error)))
return {'error_msg': _("Server Send Error\nDescription: %s")%error} return {'error_msg': _("Server Send Error\nDescription: %s")%error}
try: try:
serv.sendmail(payload_part['From'], addresses_l['all-recipients'], payload_part.as_string()) serv.sendmail(payload_part['From'], addresses_l['all-recipients'], payload_part.as_string())
except Exception, error: except Exception, error:
logging.getLogger('email_template').error(_("Mail from Account %s failed. Probable Reason: Server Send Error\n Description: %s"), id, error, exc_info=True) logging.getLogger('email_template').error(_("Mail from Account %s failed. Probable Reason: Server Send Error\n Description: %s"), id, tools.ustr(error), exc_info=True)
return {'error_msg': _("Server Send Error\nDescription: %s")%error} return {'error_msg': _("Server Send Error\nDescription: %s") % tools.ustr(error)}
#The mail sending is complete #The mail sending is complete
serv.close() serv.close()
logger.notifyChannel(_("Email Template"), netsvc.LOG_INFO, _("Mail from Account %s successfully Sent.") % (id)) logger.notifyChannel(_("Email Template"), netsvc.LOG_INFO, _("Mail from Account %s successfully Sent.") % (id))
@ -427,7 +427,7 @@ unless it is already specified in the From Email, e.g: John Doe <john@doe.com>",
"Datetime Extraction failed.Date:%s \ "Datetime Extraction failed.Date:%s \
\tError:%s") % ( \tError:%s") % (
time_as_string, time_as_string,
e) tools.ustr(e))
) )
return date_as_date return date_as_date

10
addons/email_template/html2text.py Normal file → Executable file
View File

@ -444,11 +444,11 @@ if __name__ == "__main__":
encoding = 'utf8' encoding = 'utf8'
if len(sys.argv) > 2: if len(sys.argv) > 2:
encoding = sys.argv[2] encoding = sys.argv[2]
f = open(arg, 'r') f = open(arg, 'r')
try: try:
data = f.read().decode(encoding) data = f.read().decode(encoding)
finally: finally:
f.close() f.close()
else: else:
data = sys.stdin.read().decode('utf8') data = sys.stdin.read().decode('utf8')
wrapwrite(html2text(data, baseurl)) wrapwrite(html2text(data, baseurl))

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
#-*- coding:utf-8 -*- #-*- coding:utf-8 -*-
############################################################################## ##############################################################################
# #

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
#-*- coding:utf-8 -*- #-*- coding:utf-8 -*-
############################################################################## ##############################################################################
# #

View File

@ -206,7 +206,6 @@ class hr_employee(osv.osv):
_defaults = { _defaults = {
'active': 1, 'active': 1,
'photo': _get_photo, 'photo': _get_photo,
'address_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, c).address_id.id
} }
def _check_recursion(self, cr, uid, ids, context=None): def _check_recursion(self, cr, uid, ids, context=None):

View File

@ -21,7 +21,6 @@
import time import time
import netsvc
from osv import fields, osv from osv import fields, osv
from tools.translate import _ from tools.translate import _
import decimal_precision as dp import decimal_precision as dp
@ -216,7 +215,6 @@ class hr_expense_expense(osv.osv):
account_journal.write(cr, uid, [journal.id],{'analytic_journal_id':analytic_journal_ids[0]}) account_journal.write(cr, uid, [journal.id],{'analytic_journal_id':analytic_journal_ids[0]})
inv_id = invoice_obj.create(cr, uid, inv, {'type': 'in_invoice'}) inv_id = invoice_obj.create(cr, uid, inv, {'type': 'in_invoice'})
invoice_obj.button_compute(cr, uid, [inv_id], {'type': 'in_invoice'}, set_total=True) invoice_obj.button_compute(cr, uid, [inv_id], {'type': 'in_invoice'}, set_total=True)
self.write(cr, uid, [exp.id], {'invoice_id': inv_id, 'state': 'invoiced'}) self.write(cr, uid, [exp.id], {'invoice_id': inv_id, 'state': 'invoiced'})
res = inv_id res = inv_id
return res return res

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
#-*- coding:utf-8 -*- #-*- coding:utf-8 -*-
############################################################################## ##############################################################################

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
#-*- coding:utf-8 -*- #-*- coding:utf-8 -*-
############################################################################## ##############################################################################
@ -89,10 +88,3 @@ class salary_structure_report(report_sxw.rml_parse):
report_sxw.report_sxw('report.salary.structure', 'hr.employee', 'hr_payroll/report/report_emp_salary_structure.rml', parser=salary_structure_report) report_sxw.report_sxw('report.salary.structure', 'hr.employee', 'hr_payroll/report/report_emp_salary_structure.rml', parser=salary_structure_report)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
#-*- coding:utf-8 -*- #-*- coding:utf-8 -*-
############################################################################## ##############################################################################
@ -249,4 +248,3 @@ class employees_salary_report(report_sxw.rml_parse):
report_sxw.report_sxw('report.employees.salary', 'hr.payslip', 'hr_payroll/report/report_employees_detail.rml', parser=employees_salary_report,header='internal landscape') report_sxw.report_sxw('report.employees.salary', 'hr.payslip', 'hr_payroll/report/report_employees_detail.rml', parser=employees_salary_report,header='internal landscape')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
#-*- coding:utf-8 -*- #-*- coding:utf-8 -*-
############################################################################## ##############################################################################
@ -78,4 +77,4 @@ class payroll_advice_report(report_sxw.rml_parse):
report_sxw.report_sxw('report.payroll.advice', 'hr.payroll.advice', 'hr_payroll/report/report_payroll_advice.rml', parser=payroll_advice_report) report_sxw.report_sxw('report.payroll.advice', 'hr.payroll.advice', 'hr_payroll/report/report_payroll_advice.rml', parser=payroll_advice_report)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
#-*- coding:utf-8 -*- #-*- coding:utf-8 -*-
############################################################################## ##############################################################################
@ -106,4 +105,4 @@ report_sxw.report_sxw(
parser=report_payroll_register parser=report_payroll_register
) )
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
#-*- coding:utf-8 -*- #-*- coding:utf-8 -*-
############################################################################## ##############################################################################

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
#-*- coding:utf-8 -*- #-*- coding:utf-8 -*-
############################################################################## ##############################################################################
@ -119,4 +118,3 @@ class year_salary_report(report_sxw.rml_parse):
report_sxw.report_sxw('report.year.salary', 'hr.payslip', 'hr_payroll/report/report_year_report.rml', parser=year_salary_report,header='internal landscape') report_sxw.report_sxw('report.year.salary', 'hr.payslip', 'hr_payroll/report/report_year_report.rml', parser=year_salary_report,header='internal landscape')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -21,10 +21,9 @@
############################################################################## ##############################################################################
import time import time
import netsvc import netsvc
from datetime import date, datetime, timedelta from datetime import date, timedelta
from osv import fields, osv from osv import fields, osv
from tools import config
from tools.translate import _ from tools.translate import _
def prev_bounds(cdate=False): def prev_bounds(cdate=False):
@ -107,8 +106,6 @@ class payroll_register(osv.osv):
def compute_sheet(self, cr, uid, ids, context=None): def compute_sheet(self, cr, uid, ids, context=None):
emp_pool = self.pool.get('hr.employee') emp_pool = self.pool.get('hr.employee')
slip_pool = self.pool.get('hr.payslip') slip_pool = self.pool.get('hr.payslip')
func_pool = self.pool.get('hr.payroll.structure')
slip_line_pool = self.pool.get('hr.payslip.line')
wf_service = netsvc.LocalService("workflow") wf_service = netsvc.LocalService("workflow")
vals = self.browse(cr, uid, ids, context=context)[0] vals = self.browse(cr, uid, ids, context=context)[0]
emp_ids = emp_pool.search(cr, uid, []) emp_ids = emp_pool.search(cr, uid, [])
@ -295,10 +292,8 @@ class hr_payslip(osv.osv):
self.create_voucher(cr, uid, [slip.id], name, move_id) self.create_voucher(cr, uid, [slip.id], name, move_id)
name = "To %s account" % (slip.employee_id.name) name = "To %s account" % (slip.employee_id.name)
if not slip.employee_id.property_bank_account.id: if not slip.employee_id.property_bank_account.id:
raise osv.except_osv(_('Warning !'), _('Employee Bank Account is not defined for %s') % slip.employee_id.name) raise osv.except_osv(_('Warning !'), _('Employee Bank Account is not defined for %s') % slip.employee_id.name)
ded_rec = { ded_rec = {
'move_id': move_id, 'move_id': move_id,
'name': name, 'name': name,
@ -430,10 +425,10 @@ class hr_payslip(osv.osv):
partner_id = False partner_id = False
if not slip.employee_id.bank_account_id: if not slip.employee_id.bank_account_id:
raise osv.except_osv(_('Integrity Error !'), _('Please define bank account for %s !') % (slip.employee_id.name)) raise osv.except_osv(_('Configuration Error !'), _('Please define bank account for %s !') % (slip.employee_id.name))
if not slip.employee_id.bank_account_id.partner_id: if not slip.employee_id.bank_account_id.partner_id:
raise osv.except_osv(_('Integrity Error !'), _('Please define partner in bank account for %s !') % (slip.employee_id.name)) raise osv.except_osv(_('Configuration Error !'), _('Please define partner in bank account for %s !') % (slip.employee_id.name))
partner = slip.employee_id.bank_account_id.partner_id partner = slip.employee_id.bank_account_id.partner_id
partner_id = slip.employee_id.bank_account_id.partner_id.id partner_id = slip.employee_id.bank_account_id.partner_id.id
@ -467,10 +462,8 @@ class hr_payslip(osv.osv):
} }
move_id = move_pool.create(cr, uid, move, context=context) move_id = move_pool.create(cr, uid, move, context=context)
self.create_voucher(cr, uid, [slip.id], slip.name, move_id) self.create_voucher(cr, uid, [slip.id], slip.name, move_id)
if not slip.employee_id.salary_account.id: if not slip.employee_id.salary_account.id:
raise osv.except_osv(_('Warning !'), _('Please define Salary Account for %s.') % slip.employee_id.name) raise osv.except_osv(_('Warning !'), _('Please define Salary Account for %s.') % slip.employee_id.name)
line = { line = {
'move_id':move_id, 'move_id':move_id,
'name': "By Basic Salary / " + slip.employee_id.name, 'name': "By Basic Salary / " + slip.employee_id.name,
@ -484,7 +477,6 @@ class hr_payslip(osv.osv):
'analytic_account_id': False, 'analytic_account_id': False,
'ref':slip.number 'ref':slip.number
} }
#Setting Analysis Account for Basic Salary #Setting Analysis Account for Basic Salary
if slip.employee_id.analytic_account: if slip.employee_id.analytic_account:
line['analytic_account_id'] = slip.employee_id.analytic_account.id line['analytic_account_id'] = slip.employee_id.analytic_account.id
@ -494,10 +486,9 @@ class hr_payslip(osv.osv):
if not slip.employee_id.employee_account.id: if not slip.employee_id.employee_account.id:
raise osv.except_osv(_('Warning !'), _('Please define Employee Payable Account for %s.') % slip.employee_id.name) raise osv.except_osv(_('Warning !'), _('Please define Employee Payable Account for %s.') % slip.employee_id.name)
line = { line = {
'move_id':move_id, 'move_id':move_id,
'name': "To Basic Payble Salary / " + slip.employee_id.name, 'name': "To Basic Payable Salary / " + slip.employee_id.name,
'partner_id': partner_id, 'partner_id': partner_id,
'date': slip.date, 'date': slip.date,
'account_id': slip.employee_id.employee_account.id, 'account_id': slip.employee_id.employee_account.id,
@ -508,6 +499,7 @@ class hr_payslip(osv.osv):
'period_id': period_id, 'period_id': period_id,
'ref':slip.number 'ref':slip.number
} }
line_ids += [movel_pool.create(cr, uid, line, context=context)] line_ids += [movel_pool.create(cr, uid, line, context=context)]
for line in slip.line_ids: for line in slip.line_ids:
@ -540,7 +532,7 @@ class hr_payslip(osv.osv):
if line.type == 'allowance' or line.type == 'otherpay': if line.type == 'allowance' or line.type == 'otherpay':
rec['debit'] = amount rec['debit'] = amount
if not partner.property_account_payable: if not partner.property_account_payable:
raise osv.except_osv(_('Integrity Error !'), _('Please Configure Partners Payable Account!!')) raise osv.except_osv(_('Configuration Error !'), _('Please Configure Partners Payable Account!!'))
ded_rec = { ded_rec = {
'move_id': move_id, 'move_id': move_id,
'name': name, 'name': name,
@ -557,7 +549,7 @@ class hr_payslip(osv.osv):
line_ids += [movel_pool.create(cr, uid, ded_rec, context=context)] line_ids += [movel_pool.create(cr, uid, ded_rec, context=context)]
elif line.type == 'deduction' or line.type == 'otherdeduct': elif line.type == 'deduction' or line.type == 'otherdeduct':
if not partner.property_account_receivable: if not partner.property_account_receivable:
raise osv.except_osv(_('Integrity Error !'), _('Please Configure Partners Receivable Account!!')) raise osv.except_osv(_('Configuration Error !'), _('Please Configure Partners Receivable Account!!'))
rec['credit'] = amount rec['credit'] = amount
total_deduct += amount total_deduct += amount
ded_rec = { ded_rec = {

View File

@ -234,7 +234,6 @@
</field> </field>
</record> </record>
<!-- Adding Account Properties to the Employee form --> <!-- Adding Account Properties to the Employee form -->
<record id="hr_employee_payroll_property_form" model="ir.ui.view"> <record id="hr_employee_payroll_property_form" model="ir.ui.view">

View File

@ -392,5 +392,12 @@
<field name="view_id" ref="hr_recruitment_degree_tree"/> <field name="view_id" ref="hr_recruitment_degree_tree"/>
</record> </record>
<menuitem
id="menu_hr_recruitment_degree"
name="Degrees"
parent="menu_hr_recruitment_recruitment"
action="hr_recruitment_degree_action"
sequence="1"/>
</data> </data>
</openerp> </openerp>

View File

@ -95,13 +95,8 @@ class final_invoice_create(osv.osv_memory):
last_invoice = invoice_obj.create(cr, uid, curr_invoice, context=context) last_invoice = invoice_obj.create(cr, uid, curr_invoice, context=context)
invoices.append(last_invoice) invoices.append(last_invoice)
context2=context.copy() context2 = context.copy()
context2['lang'] = partner.lang context2['lang'] = partner.lang
cr.execute("SELECT product_id, to_invoice, sum(unit_amount) " \
"FROM account_analytic_line as line " \
"WHERE account_id = %s " \
"AND to_invoice IS NOT NULL " \
"GROUP BY product_id, to_invoice", (account.id,))
cr.execute("""SELECT cr.execute("""SELECT
line.product_id, line.product_id,

View File

@ -123,13 +123,13 @@ class hr_timesheet_invoice_create(osv.osv_memory):
context2 = context.copy() context2 = context.copy()
context2['lang'] = partner.lang context2['lang'] = partner.lang
cr.execute("SELECT product_id, to_invoice, sum(unit_amount) " \ cr.execute("SELECT product_id, to_invoice, sum(unit_amount), product_uom_id " \
"FROM account_analytic_line as line " \ "FROM account_analytic_line as line " \
"WHERE account_id = %s " \ "WHERE account_id = %s " \
"AND id IN %s AND to_invoice IS NOT NULL " \ "AND id IN %s AND to_invoice IS NOT NULL " \
"GROUP BY product_id,to_invoice", (account.id, tuple(context['active_ids']),)) "GROUP BY product_id,to_invoice,product_uom_id", (account.id, tuple(context['active_ids']),))
for product_id, factor_id, qty in cr.fetchall(): for product_id, factor_id, qty, uom in cr.fetchall():
product = product_obj.browse(cr, uid, product_id, context2) product = product_obj.browse(cr, uid, product_id, context2)
if not product: if not product:
raise osv.except_osv(_('Error'), _('At least one line has no product !')) raise osv.except_osv(_('Error'), _('At least one line has no product !'))
@ -144,9 +144,11 @@ class hr_timesheet_invoice_create(osv.osv_memory):
data['product'] = data['product'][0] data['product'] = data['product'][0]
factor_name = product_obj.name_get(cr, uid, [data['product']], context=context)[0][1] factor_name = product_obj.name_get(cr, uid, [data['product']], context=context)[0][1]
ctx = context.copy()
ctx.update({'uom':uom})
if account.pricelist_id: if account.pricelist_id:
pl = account.pricelist_id.id pl = account.pricelist_id.id
price = pro_price_obj.price_get(cr,uid,[pl], data['product'] or product_id, qty or 1.0, account.partner_id.id)[pl] price = pro_price_obj.price_get(cr,uid,[pl], data['product'] or product_id, qty or 1.0, account.partner_id.id, context=ctx)[pl]
else: else:
price = 0.0 price = 0.0
@ -162,7 +164,7 @@ class hr_timesheet_invoice_create(osv.osv_memory):
'name': factor_name, 'name': factor_name,
'product_id': data['product'] or product_id, 'product_id': data['product'] or product_id,
'invoice_line_tax_id': [(6,0,tax)], 'invoice_line_tax_id': [(6,0,tax)],
'uos_id': product.uom_id.id, 'uos_id': uom,
'account_id': account_id, 'account_id': account_id,
'account_analytic_id': account.id, 'account_analytic_id': account.id,
} }

0
addons/l10n_ch/readme.txt Executable file → Normal file
View File

0
addons/l10n_de/i18n/pt_BR.po Executable file → Normal file
View File

0
addons/l10n_de/i18n/zh_CN.po Executable file → Normal file
View File

0
addons/l10n_de/i18n/zh_TW.po Executable file → Normal file
View File

View File

View File

@ -284,14 +284,14 @@ class Partner(osv.osv):
'membership_cancel': False 'membership_cancel': False
} }
if name == 'membership_start': if name == 'membership_start':
line_id = member_line_obj.search(cr, uid, [('partner', '=', partner_id)], line_id = member_line_obj.search(cr, uid, [('partner', '=', partner_id),('date_cancel','=',False)],
limit=1, order='date_from', context=context) limit=1, order='date_from', context=context)
if line_id: if line_id:
res[partner.id]['membership_start'] = member_line_obj.read(cr, uid, line_id[0], res[partner.id]['membership_start'] = member_line_obj.read(cr, uid, line_id[0],
['date_from'], context=context)['date_from'] ['date_from'], context=context)['date_from']
if name == 'membership_stop': if name == 'membership_stop':
line_id1 = member_line_obj.search(cr, uid, [('partner', '=', partner_id)], line_id1 = member_line_obj.search(cr, uid, [('partner', '=', partner_id),('date_cancel','=',False)],
limit=1, order='date_to desc', context=context) limit=1, order='date_to desc', context=context)
if line_id1: if line_id1:
res[partner.id]['membership_stop'] = member_line_obj.read(cr, uid, line_id1[0], res[partner.id]['membership_stop'] = member_line_obj.read(cr, uid, line_id1[0],

View File

@ -269,6 +269,10 @@ class mrp_bom(osv.osv):
@param product_id: Changed product_id @param product_id: Changed product_id
@return: Dictionary of changed values @return: Dictionary of changed values
""" """
if context is None:
context = {}
context['lang'] = self.pool.get('res.users').browse(cr,uid,uid).context_lang
if product_id: if product_id:
prod = self.pool.get('product.product').browse(cr, uid, product_id, context=context) prod = self.pool.get('product.product').browse(cr, uid, product_id, context=context)
v = {'product_uom': prod.uom_id.id} v = {'product_uom': prod.uom_id.id}

View File

@ -252,13 +252,11 @@ class mrp_production(osv.osv):
""" Cancels work order if production order is canceled. """ Cancels work order if production order is canceled.
@return: Super method @return: Super method
""" """
if context is None: obj = self.browse(cr, uid, ids,context=context)[0]
context = {}
obj = self.browse(cr, uid, ids)[0]
wf_service = netsvc.LocalService("workflow") wf_service = netsvc.LocalService("workflow")
for workcenter_line in obj.workcenter_lines: for workcenter_line in obj.workcenter_lines:
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_cancel', cr) wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_cancel', cr)
return super(mrp_production,self).action_cancel(cr,uid,ids) return super(mrp_production,self).action_cancel(cr,uid,ids,context=context)
def _compute_planned_workcenter(self, cr, uid, ids, context=None, mini=False): def _compute_planned_workcenter(self, cr, uid, ids, context=None, mini=False):
""" Computes planned and finished dates for work order. """ Computes planned and finished dates for work order.

View File

@ -289,9 +289,15 @@ class procurement_order(osv.osv):
return False return False
partner = procurement.product_id.seller_id #Taken Main Supplier of Product of Procurement. partner = procurement.product_id.seller_id #Taken Main Supplier of Product of Procurement.
if not partner:
cr.execute('update procurement_order set message=%s where id=%s',
(_('No default supplier defined for this product'), procurement.id))
return False
if user.company_id and user.company_id.partner_id: if user.company_id and user.company_id.partner_id:
if partner.id == user.company_id.partner_id.id: if partner.id == user.company_id.partner_id.id:
return False return False
address_id = partner_obj.address_get(cr, uid, [partner.id], ['delivery'])['delivery'] address_id = partner_obj.address_get(cr, uid, [partner.id], ['delivery'])['delivery']
if not address_id: if not address_id:
cr.execute('update procurement_order set message=%s where id=%s', cr.execute('update procurement_order set message=%s where id=%s',

View File

@ -155,7 +155,7 @@ class product_pricelist(osv.osv):
currency_obj = self.pool.get('res.currency') currency_obj = self.pool.get('res.currency')
product_obj = self.pool.get('product.product') product_obj = self.pool.get('product.product')
product_temp_obj = self.pool.get('product.template') product_template_obj = self.pool.get('product.template')
product_category_obj = self.pool.get('product.category') product_category_obj = self.pool.get('product.category')
product_uom_obj = self.pool.get('product.uom') product_uom_obj = self.pool.get('product.uom')
supplierinfo_obj = self.pool.get('product.supplierinfo') supplierinfo_obj = self.pool.get('product.supplierinfo')
@ -245,7 +245,7 @@ class product_pricelist(osv.osv):
price = 0.0 price = 0.0
if sinfo: if sinfo:
qty_in_product_uom = qty qty_in_product_uom = qty
product_default_uom = product_temp_obj.read(cr, uid, [tmpl_id], ['uom_id'])[0]['uom_id'][0] product_default_uom = product_template_obj.read(cr, uid, [tmpl_id], ['uom_id'])[0]['uom_id'][0]
supplier = supplierinfo_obj.browse(cr, uid, sinfo, context=context)[0] supplier = supplierinfo_obj.browse(cr, uid, sinfo, context=context)[0]
seller_uom = supplier.product_uom and supplier.product_uom.id or False seller_uom = supplier.product_uom and supplier.product_uom.id or False
if seller_uom and product_default_uom and product_default_uom != seller_uom: if seller_uom and product_default_uom and product_default_uom != seller_uom:
@ -265,11 +265,10 @@ class product_pricelist(osv.osv):
price = currency_obj.compute(cr, uid, price = currency_obj.compute(cr, uid,
price_type.currency_id.id, res['currency_id'], price_type.currency_id.id, res['currency_id'],
product_obj.price_get(cr, uid, [product_id], product_obj.price_get(cr, uid, [product_id],
price_type.field, context=context)[product_id], round=False, context=context) price_type.field, context=context)[product_id], round=False, context=context)
if price >= 0.0: if price is not False:
price_limit = price price_limit = price
price = price * (1.0+(res['price_discount'] or 0.0)) price = price * (1.0+(res['price_discount'] or 0.0))
price = rounding(price, res['price_round']) price = rounding(price, res['price_round'])
price += (res['price_surcharge'] or 0.0) price += (res['price_surcharge'] or 0.0)
@ -417,7 +416,7 @@ class product_pricelist(osv.osv):
price = currency_obj.compute(cr, uid, price = currency_obj.compute(cr, uid,
price_type.currency_id.id, res['currency_id'], price_type.currency_id.id, res['currency_id'],
product_obj.price_get(cr, uid, [prod_id], product_obj.price_get(cr, uid, [prod_id],
price_type.field, context=context)[prod_id], round=False, context=context) price_type.field, context=context)[prod_id], round=False, context=context)
if price: if price:
price_limit = price price_limit = price

View File

@ -183,14 +183,21 @@
</form> </form>
</field> </field>
</record> </record>
<record id="product_price_type_action" model="ir.actions.act_window"> <record id="product_price_type_action" model="ir.actions.act_window">
<field name="name">Prices Types</field> <field name="name">Price Types</field>
<field name="type">ir.actions.act_window</field> <field name="type">ir.actions.act_window</field>
<field name="res_model">product.price.type</field> <field name="res_model">product.price.type</field>
<field name="view_type">form</field> <field name="view_type">form</field>
<field name="view_mode">tree,form</field> <field name="view_mode">tree,form</field>
</record> </record>
<!--<record id="product_pricelist_type_view" model="ir.ui.view">
<menuitem
action="product_price_type_action" id="menu_product_price_type"
parent="product.menu_product_pricelist_main" sequence="4"/>
<!-- Moved to extra module 'sale_pricelist_type_menu':
<record id="product_pricelist_type_view" model="ir.ui.view">
<field name="name">product.pricelist.type.form</field> <field name="name">product.pricelist.type.form</field>
<field name="model">product.pricelist.type</field> <field name="model">product.pricelist.type</field>
<field name="type">form</field> <field name="type">form</field>

View File

@ -251,7 +251,9 @@ class product_template(osv.osv):
result[product.id] = {field:False} result[product.id] = {field:False}
result[product.id]['seller_delay'] = 1 result[product.id]['seller_delay'] = 1
if product.seller_ids: if product.seller_ids:
partner_list = sorted([(partner_id.sequence, partner_id) for partner_id in product.seller_ids if partner_id and partner_id.sequence]) partner_list = sorted([(partner_id.sequence, partner_id)
for partner_id in product.seller_ids
if partner_id and isinstance(partner_id.sequence, (int, long))])
main_supplier = partner_list and partner_list[0] and partner_list[0][1] or False main_supplier = partner_list and partner_list[0] and partner_list[0][1] or False
result[product.id]['seller_delay'] = main_supplier and main_supplier.delay or 1 result[product.id]['seller_delay'] = main_supplier and main_supplier.delay or 1
result[product.id]['seller_qty'] = main_supplier and main_supplier.qty or 0.0 result[product.id]['seller_qty'] = main_supplier and main_supplier.qty or 0.0

View File

@ -13,7 +13,7 @@
<filter string="Stockable" icon="terp-accessories-archiver" domain="['|',('type','=','product'),('type','=','consu')]"/> <filter string="Stockable" icon="terp-accessories-archiver" domain="['|',('type','=','product'),('type','=','consu')]"/>
<separator orientation="vertical"/> <separator orientation="vertical"/>
<filter string="To Sell" icon="terp-accessories-archiver-minus" domain="[('sale_ok','=',1)]"/> <filter string="To Sell" icon="terp-accessories-archiver-minus" domain="[('sale_ok','=',1)]"/>
<filter string="To Purchase" icon="terp-accessories-archiver+" domain="[('purchase_ok', '=', 1)]" /> <filter name="filter_to_purchase" string="To Purchase" icon="terp-accessories-archiver+" domain="[('purchase_ok', '=', 1)]" />
<separator orientation="vertical"/> <separator orientation="vertical"/>
<field name="default_code"/> <field name="default_code"/>
<field name="name"/> <field name="name"/>
@ -204,7 +204,7 @@
<field name="type">ir.actions.act_window</field> <field name="type">ir.actions.act_window</field>
<field name="res_model">product.product</field> <field name="res_model">product.product</field>
<field name="view_type">form</field> <field name="view_type">form</field>
<field name="domain">[('purchase_ok','=',1)]</field> <field name="context">{"search_default_filter_to_purchase":1}</field>
<field name="view_id" ref="product_product_tree_view"/> <field name="view_id" ref="product_product_tree_view"/>
<field name="search_view_id" ref="product_search_form_view"/> <field name="search_view_id" ref="product_search_form_view"/>
<field name="help">Products can be purchased and/or sold. They can be raw materials, stockable products, consumables or services. The Product form contains detailed information about your products related to procurement logistics, sales price, product category, suppliers and so on.</field> <field name="help">Products can be purchased and/or sold. They can be raw materials, stockable products, consumables or services. The Product form contains detailed information about your products related to procurement logistics, sales price, product category, suppliers and so on.</field>

View File

@ -17,7 +17,7 @@
<field name="name" >Product multi-company</field> <field name="name" >Product multi-company</field>
<field name="model_id" ref="model_product_template"/> <field name="model_id" ref="model_product_template"/>
<field name="global" eval="True"/> <field name="global" eval="True"/>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> <field name="domain_force"> ['|','|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
</record> </record>
<record id="group_product_variant" model="res.groups" context="{'noadmin':True}"> <record id="group_product_variant" model="res.groups" context="{'noadmin':True}">

View File

@ -35,6 +35,17 @@
<field name="month"/> <field name="month"/>
<field name="category_id"/> <field name="category_id"/>
<field name="price_total"/> <field name="price_total"/>
<field name="user_id" invisible="1"/>
<field name="partner_id" invisible="1"/>
<field name="product_id" invisible="1"/>
<field name="product_uom" invisible="1"/>
<field name="day" invisible="1"/>
<field name="name" invisible="1"/>
<field name="warehouse_id" invisible="1"/>
<field name="validator" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="state" invisible="1"/>
<field name="location_id" invisible="1"/>
</tree> </tree>
</field> </field>
</record> </record>

View File

@ -122,7 +122,7 @@ class purchase_order(osv.osv):
} }
def wkf_confirm_order(self, cr, uid, ids, context=None): def wkf_confirm_order(self, cr, uid, ids, context=None):
res = super(purchase_order, self).wkf_confirm_order(cr, uid, ids, context=context) res = super(purchase_order, self).wkf_confirm_order(cr, uid, ids, context=context)
proc_obj=self.pool.get('procurement.order') proc_obj = self.pool.get('procurement.order')
for po in self.browse(cr, uid, ids, context=context): for po in self.browse(cr, uid, ids, context=context):
if po.requisition_id and (po.requisition_id.exclusive=='exclusive'): if po.requisition_id and (po.requisition_id.exclusive=='exclusive'):
for order in po.requisition_id.purchase_ids: for order in po.requisition_id.purchase_ids:

View File

@ -9,6 +9,7 @@
<record id="ir_header_webkit_basesample0" model="ir.header_webkit"> <record id="ir_header_webkit_basesample0" model="ir.header_webkit">
<field name="footer_html"><![CDATA[<html> <field name="footer_html"><![CDATA[<html>
<head> <head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
<script> <script>
function subst() { function subst() {
var vars={}; var vars={};
@ -34,6 +35,7 @@
<field eval="&quot;&quot;&quot;A4&quot;&quot;&quot;" name="format"/> <field eval="&quot;&quot;&quot;A4&quot;&quot;&quot;" name="format"/>
<field name="html"><![CDATA[<html> <field name="html"><![CDATA[<html>
<head> <head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
<script> <script>
function subst() { function subst() {
var vars={}; var vars={};
@ -53,7 +55,7 @@
<body style="border:0; margin: 0;" onload="subst()"> <body style="border:0; margin: 0;" onload="subst()">
<table class="header" style="border-bottom: 0px solid black; width: 100%"> <table class="header" style="border-bottom: 0px solid black; width: 100%">
<tr> <tr>
<td>${helper.embed_logo_by_name('camptocamp_logo')}</td> <td>${helper.embed_logo_by_name('camptocamp_logo')|n}</td>
<td style="text-align:right"> </td> <td style="text-align:right"> </td>
</tr> </tr>
<tr> <tr>
@ -75,7 +77,7 @@
<tr> <tr>
<td>Mail: ${company.partner_id.address and company.partner_id.address[0].email or ''|entity}<br/></td> <td>Mail: ${company.partner_id.address and company.partner_id.address[0].email or ''|entity}<br/></td>
</tr> </tr>
</table> ${_debug or ''} </body> </table> ${_debug or ''|n} </body>
</html>]]> </html>]]>
</field> </field>
<field eval="55.0" name="margin_top"/> <field eval="55.0" name="margin_top"/>

View File

@ -48,7 +48,7 @@ class WebKitHelper(object):
else : else :
width = ' ' width = ' '
if height : if height :
height = 'width="%spx"'%(height) height = 'height="%spx"'%(height)
else : else :
height = ' ' height = ' '
toreturn = '<img %s %s src="data:image/%s;base64,%s" />'%( toreturn = '<img %s %s src="data:image/%s;base64,%s" />'%(

View File

@ -5,6 +5,7 @@
# All Right Reserved # All Right Reserved
# #
# Author : Nicolas Bessi (Camptocamp) # Author : Nicolas Bessi (Camptocamp)
# Contributor(s) : Florent Xicluna (Wingo SA)
# #
# WARNING: This program as such is intended to be used by professional # WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential # programmers who take the whole responsability of assessing all potential
@ -41,9 +42,20 @@ import pooler
from report_helper import WebKitHelper from report_helper import WebKitHelper
from report.report_sxw import * from report.report_sxw import *
import addons import addons
import tools
from tools.translate import _ from tools.translate import _
from osv.osv import except_osv from osv.osv import except_osv
def mako_template(text):
"""Build a Mako template.
This template uses UTF-8 encoding
"""
# default_filters=['unicode', 'h'] can be used to set global filters
return Template(text, input_encoding='utf-8', output_encoding='utf-8')
class WebKitParser(report_sxw): class WebKitParser(report_sxw):
"""Custom class that use webkit to render HTML reports """Custom class that use webkit to render HTML reports
Code partially taken from report openoffice. Thanks guys :) Code partially taken from report openoffice. Thanks guys :)
@ -67,7 +79,8 @@ class WebKitParser(report_sxw):
_('Please install executable on your system'+ _('Please install executable on your system'+
' (sudo apt-get install wkhtmltopdf) or download it from here:'+ ' (sudo apt-get install wkhtmltopdf) or download it from here:'+
' http://code.google.com/p/wkhtmltopdf/downloads/list and set the'+ ' http://code.google.com/p/wkhtmltopdf/downloads/list and set the'+
' path to the executable on the Company form.') ' path to the executable on the Company form.'+
'Minimal version is 0.9.9')
) )
if os.path.isabs(path) : if os.path.isabs(path) :
if (os.path.exists(path) and os.access(path, os.X_OK)\ if (os.path.exists(path) and os.access(path, os.X_OK)\
@ -98,7 +111,9 @@ class WebKitParser(report_sxw):
else: else:
command = ['wkhtmltopdf'] command = ['wkhtmltopdf']
command.append('-q') command.append('--quiet')
# default to UTF-8 encoding. Use <meta charset="latin-1"> to override.
command.extend(['--encoding', 'utf-8'])
if header : if header :
head_file = file( os.path.join( head_file = file( os.path.join(
tmp_dir, tmp_dir,
@ -237,7 +252,7 @@ class WebKitParser(report_sxw):
if not template and report_xml.report_webkit_data : if not template and report_xml.report_webkit_data :
template = report_xml.report_webkit_data template = report_xml.report_webkit_data
if not template : if not template :
raise except_osv(_('Webkit Report template not found !'), _('')) raise except_osv(_('Error!'), _('Webkit Report template not found !'))
header = report_xml.webkit_header.html header = report_xml.webkit_header.html
footer = report_xml.webkit_header.footer_html footer = report_xml.webkit_header.footer_html
if not header and report_xml.header: if not header and report_xml.header:
@ -250,6 +265,7 @@ class WebKitParser(report_sxw):
header = u""" header = u"""
<html> <html>
<head> <head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
<style type="text/css"> <style type="text/css">
${css} ${css}
</style> </style>
@ -276,7 +292,7 @@ class WebKitParser(report_sxw):
company= user.company_id company= user.company_id
#default_filters=['unicode', 'entity'] can be used to set global filter #default_filters=['unicode', 'entity'] can be used to set global filter
body_mako_tpl = Template(template ,input_encoding='utf-8') body_mako_tpl = mako_template(template)
helper = WebKitHelper(cursor, uid, report_xml.id, context) helper = WebKitHelper(cursor, uid, report_xml.id, context)
try : try :
html = body_mako_tpl.render( helper=helper, html = body_mako_tpl.render( helper=helper,
@ -288,7 +304,7 @@ class WebKitParser(report_sxw):
msg = exceptions.text_error_template().render() msg = exceptions.text_error_template().render()
netsvc.Logger().notifyChannel('Webkit render', netsvc.LOG_ERROR, msg) netsvc.Logger().notifyChannel('Webkit render', netsvc.LOG_ERROR, msg)
raise except_osv(_('Webkit render'), msg) raise except_osv(_('Webkit render'), msg)
head_mako_tpl = Template(header, input_encoding='utf-8') head_mako_tpl = mako_template(header)
try : try :
head = head_mako_tpl.render( head = head_mako_tpl.render(
company=company, company=company,
@ -305,7 +321,7 @@ class WebKitParser(report_sxw):
exceptions.text_error_template().render()) exceptions.text_error_template().render())
foot = False foot = False
if footer : if footer :
foot_mako_tpl = Template(footer ,input_encoding='utf-8') foot_mako_tpl = mako_template(footer)
try : try :
foot = foot_mako_tpl.render( foot = foot_mako_tpl.render(
company=company, company=company,
@ -327,7 +343,7 @@ class WebKitParser(report_sxw):
time=time, time=time,
helper=helper, helper=helper,
css=css, css=css,
_debug=html, _debug=tools.ustr(html),
formatLang=self.formatLang, formatLang=self.formatLang,
setLang=self.setLang, setLang=self.setLang,
_=self.translate_call, _=self.translate_call,

0
addons/sale_layout/i18n/fr.po Executable file → Normal file
View File

View File

@ -84,8 +84,7 @@ class stock_picking(osv.osv):
# need to carify with new requirement # need to carify with new requirement
invoice_ids = [] invoice_ids = []
picking_obj = self.pool.get('stock.picking') picking_obj = self.pool.get('stock.picking')
res = super(stock_picking, self).action_invoice_create(cr, uid, ids, journal_id=False, res = super(stock_picking, self).action_invoice_create(cr, uid, ids, journal_id=journal_id, group=group, type=type, context=context)
group=False, type='out_invoice', context=None)
invoice_ids = res.values() invoice_ids = res.values()
picking_obj.write(cr, uid, ids, {'invoice_ids': [[6, 0, invoice_ids]]}) picking_obj.write(cr, uid, ids, {'invoice_ids': [[6, 0, invoice_ids]]})
return res return res

View File

@ -248,6 +248,7 @@ class product_product(osv.osv):
date_str = "date<=%s" date_str = "date<=%s"
date_values = [to_date] date_values = [to_date]
prodlot_id = context.get('prodlot_id', False)
# TODO: perhaps merge in one query. # TODO: perhaps merge in one query.
if date_values: if date_values:
@ -257,10 +258,11 @@ class product_product(osv.osv):
cr.execute( cr.execute(
'select sum(product_qty), product_id, product_uom '\ 'select sum(product_qty), product_id, product_uom '\
'from stock_move '\ 'from stock_move '\
'where location_id NOT IN %s'\ 'where location_id NOT IN %s '\
'and location_dest_id IN %s'\ 'and location_dest_id IN %s '\
'and product_id IN %s'\ 'and product_id IN %s '\
'and state IN %s' + (date_str and 'and '+date_str+' ' or '') +''\ '' + (prodlot_id and ('and prodlot_id = ' + str(prodlot_id)) or '') + ' '\
'and state IN %s ' + (date_str and 'and '+date_str+' ' or '') +' '\
'group by product_id,product_uom',tuple(where)) 'group by product_id,product_uom',tuple(where))
results = cr.fetchall() results = cr.fetchall()
if 'out' in what: if 'out' in what:
@ -268,10 +270,11 @@ class product_product(osv.osv):
cr.execute( cr.execute(
'select sum(product_qty), product_id, product_uom '\ 'select sum(product_qty), product_id, product_uom '\
'from stock_move '\ 'from stock_move '\
'where location_id IN %s'\ 'where location_id IN %s '\
'and location_dest_id NOT IN %s '\ 'and location_dest_id NOT IN %s '\
'and product_id IN %s'\ 'and product_id IN %s '\
'and state in %s' + (date_str and 'and '+date_str+' ' or '') + ''\ '' + (prodlot_id and ('and prodlot_id = ' + str(prodlot_id)) or '') + ' '\
'and state in %s ' + (date_str and 'and '+date_str+' ' or '') + ' '\
'group by product_id,product_uom',tuple(where)) 'group by product_id,product_uom',tuple(where))
results2 = cr.fetchall() results2 = cr.fetchall()
uom_obj = self.pool.get('product.uom') uom_obj = self.pool.get('product.uom')

View File

@ -1249,7 +1249,7 @@ class stock_picking(osv.osv):
move_obj.write(cr, uid, [c.id for c in complete], {'picking_id': new_picking}) move_obj.write(cr, uid, [c.id for c in complete], {'picking_id': new_picking})
for move in complete: for move in complete:
if prodlot_ids.get(move.id): if prodlot_ids.get(move.id):
move_obj.write(cr, uid, move.id, {'prodlot_id': prodlot_ids[move.id]}) move_obj.write(cr, uid, [move.id], {'prodlot_id': prodlot_ids[move.id]})
for move in too_many: for move in too_many:
product_qty = move_product_qty[move.id] product_qty = move_product_qty[move.id]
defaults = { defaults = {
@ -1825,7 +1825,7 @@ class stock_move(osv.osv):
old_ptype = location_obj.picking_type_get(cr, uid, picking.move_lines[0].location_id, picking.move_lines[0].location_dest_id) old_ptype = location_obj.picking_type_get(cr, uid, picking.move_lines[0].location_id, picking.move_lines[0].location_dest_id)
if old_ptype != picking.type: if old_ptype != picking.type:
old_pick_name = seq_obj.get(cr, uid, 'stock.picking.' + old_ptype) old_pick_name = seq_obj.get(cr, uid, 'stock.picking.' + old_ptype)
self.pool.get('stock.picking').write(cr, uid, picking.id, {'name': old_pick_name}, context=context) self.pool.get('stock.picking').write(cr, uid, [picking.id], {'name': old_pick_name}, context=context)
else: else:
pickid = False pickid = False
for move, (loc, dummy, delay, dummy, company_id, ptype) in todo: for move, (loc, dummy, delay, dummy, company_id, ptype) in todo:
@ -2113,7 +2113,6 @@ class stock_move(osv.osv):
todo = [] todo = []
for move in self.browse(cr, uid, ids, context=context): for move in self.browse(cr, uid, ids, context=context):
#print 'DONE MOVE', move.id, move.product_id.name, move.move_dest_id.id, move.state, move.move_dest_id and move.move_dest_id.state
if move.state=="draft": if move.state=="draft":
todo.append(move.id) todo.append(move.id)
if todo: if todo:
@ -2141,7 +2140,7 @@ class stock_move(osv.osv):
prodlot_id = partial_datas and partial_datas.get('move%s_prodlot_id' % (move.id), False) prodlot_id = partial_datas and partial_datas.get('move%s_prodlot_id' % (move.id), False)
if prodlot_id: if prodlot_id:
self.write(cr, uid, [move.id], {'prodlot_id': prodlot_id}, context=context) self.write(cr, uid, [move.id], {'prodlot_id': prodlot_id}, context=context)
if move.state not in ('confirmed','done', 'assigned'): if move.state not in ('confirmed','done','assigned'):
todo.append(move.id) todo.append(move.id)
if todo: if todo:
@ -2469,7 +2468,7 @@ class stock_move(osv.osv):
defaults.update(prodlot_id=prodlot_id) defaults.update(prodlot_id=prodlot_id)
new_move = self.copy(cr, uid, move.id, defaults) new_move = self.copy(cr, uid, move.id, defaults)
complete.append(self.browse(cr, uid, new_move)) complete.append(self.browse(cr, uid, new_move))
self.write(cr, uid, move.id, self.write(cr, uid, [move.id],
{ {
'product_qty' : move.product_qty - product_qty, 'product_qty' : move.product_qty - product_qty,
'product_uos_qty':move.product_qty - product_qty, 'product_uos_qty':move.product_qty - product_qty,
@ -2477,7 +2476,7 @@ class stock_move(osv.osv):
for move in too_many: for move in too_many:
self.write(cr, uid, move.id, self.write(cr, uid, [move.id],
{ {
'product_qty': move.product_qty, 'product_qty': move.product_qty,
'product_uos_qty': move.product_qty, 'product_uos_qty': move.product_qty,
@ -2558,7 +2557,7 @@ class stock_inventory(osv.osv):
move_ids = [] move_ids = []
for line in inv.inventory_line_id: for line in inv.inventory_line_id:
pid = line.product_id.id pid = line.product_id.id
product_context.update(uom=line.product_uom.id,date=inv.date) product_context.update(uom=line.product_uom.id, date=inv.date, prodlot_id=line.prod_lot_id.id)
amount = location_obj._product_get(cr, uid, line.location_id.id, [pid], product_context)[pid] amount = location_obj._product_get(cr, uid, line.location_id.id, [pid], product_context)[pid]
change = line.product_qty - amount change = line.product_qty - amount
@ -2643,10 +2642,9 @@ class stock_inventory_line(osv.osv):
@return: Dictionary of changed values @return: Dictionary of changed values
""" """
if not product: if not product:
return {} return {'value': {'product_qty': 0.0, 'product_uom': False}}
if not uom: obj_product = self.pool.get('product.product').browse(cr, uid, product)
prod = self.pool.get('product.product').browse(cr, uid, [product], {'uom': uom})[0] uom = uom or obj_product.uom_id.id
uom = prod.uom_id.id
amount = self.pool.get('stock.location')._product_get(cr, uid, location_id, [product], {'uom': uom, 'to_date': to_date})[product] amount = self.pool.get('stock.location')._product_get(cr, uid, location_id, [product], {'uom': uom, 'to_date': to_date})[product]
result = {'product_qty': amount, 'product_uom': uom} result = {'product_qty': amount, 'product_uom': uom}
return {'value': result} return {'value': result}

View File

@ -1670,7 +1670,7 @@
<button name="action_cancel" states="assigned,confirmed" string="_Cancel" type="object" icon="gtk-cancel"/> <button name="action_cancel" states="assigned,confirmed" string="_Cancel" type="object" icon="gtk-cancel"/>
<button name="action_confirm" states="draft" string="Process Later" type="object" icon="gtk-apply"/> <button name="action_confirm" states="draft" string="Process Later" type="object" icon="gtk-apply"/>
<button name="force_assign" states="confirmed" string="Set Available" type="object" icon="gtk-yes"/> <button name="force_assign" states="confirmed" string="Set Available" type="object" icon="gtk-yes"/>
<button name="%(action_partial_move_server)d" states="assigned" string="Process" type="action" icon="gtk-go-forward"/> <button name="%(action_partial_move_server)d" string="Process" type="action" states="assigned" icon="gtk-go-forward"/>
</group> </group>
</form> </form>
</field> </field>

View File

@ -39,14 +39,19 @@ class stock_fill_inventory(osv.osv_memory):
@param context: A standard dictionary @param context: A standard dictionary
@return: New arch of view with new columns. @return: New arch of view with new columns.
""" """
if context==None: if context is None:
context={} context = {}
res = super(stock_fill_inventory, self).view_init(cr, uid, fields_list, context=context) super(stock_fill_inventory, self).view_init(cr, uid, fields_list, context=context)
if len(context.get('active_ids',[])) > 1:
raise osv.except_osv(_('Error!'), _('You cannot perform this operation on more than one Stock Inventories.'))
if context.get('active_id', False): if context.get('active_id', False):
stock = self.pool.get('stock.inventory').browse(cr, uid, context.get('active_id', False)) stock = self.pool.get('stock.inventory').browse(cr, uid, context.get('active_id', False))
if stock.state=='done':
raise osv.except_osv(_('Error!'), _('Stock Inventory is done')) if stock.state == 'done':
True raise osv.except_osv(_('Warning!'), _('Stock Inventory is already Validated.'))
return True
def fill_inventory(self, cr, uid, ids, context=None): def fill_inventory(self, cr, uid, ids, context=None):
""" To Import stock inventory according to products available in the selected locations. """ To Import stock inventory according to products available in the selected locations.
@ -59,6 +64,7 @@ class stock_fill_inventory(osv.osv_memory):
""" """
if context is None: if context is None:
context = {} context = {}
inventory_line_obj = self.pool.get('stock.inventory.line') inventory_line_obj = self.pool.get('stock.inventory.line')
location_obj = self.pool.get('stock.location') location_obj = self.pool.get('stock.location')
product_obj = self.pool.get('product.product') product_obj = self.pool.get('product.product')
@ -71,14 +77,17 @@ class stock_fill_inventory(osv.osv_memory):
fill_inventory = self.browse(cr, uid, ids, context=context) fill_inventory = self.browse(cr, uid, ids, context=context)
res = {} res = {}
res_location = {} res_location = {}
if fill_inventory.recursive :
if fill_inventory.recursive:
location_ids = location_obj.search(cr, uid, [('location_id', location_ids = location_obj.search(cr, uid, [('location_id',
'child_of', fill_inventory.location_id.id)], order="id") 'child_of', [fill_inventory.location_id.id])], order="id",
context=context)
else: else:
location_ids = [fill_inventory.location_id.id] location_ids = [fill_inventory.location_id.id]
res = {} res = {}
flag = False flag = False
for location in location_ids: for location in location_ids:
datas = {} datas = {}
res[location] = {} res[location] = {}
@ -88,30 +97,34 @@ class stock_fill_inventory(osv.osv_memory):
lot_id = move.prodlot_id.id lot_id = move.prodlot_id.id
prod_id = move.product_id.id prod_id = move.product_id.id
qty = move.product_qty qty = move.product_qty
location_dest_id = move.location_dest_id.id
if datas.get((prod_id, lot_id)): if datas.get((prod_id, lot_id)):
qty = datas[(prod_id, lot_id)]['product_qty'] + qty qty += datas[(prod_id, lot_id)]['product_qty']
datas[(prod_id, lot_id)] = {'product_id': prod_id, 'location_id': location_dest_id, 'product_qty': qty, 'product_uom': move.product_id.uom_id.id, 'prod_lot_id': lot_id}
datas[(prod_id, lot_id)] = {'product_id': prod_id, 'location_id': location, 'product_qty': qty, 'product_uom': move.product_id.uom_id.id, 'prod_lot_id': lot_id}
if datas: if datas:
flag = True flag = True
res[location] = datas res[location] = datas
if not flag: if not flag:
raise osv.except_osv(_('Message !'), _('No product in this location.')) raise osv.except_osv(_('Warning !'), _('No product in this location.'))
for i in res.values(): for stock_move in res.values():
if i.values(): for stock_move_details in stock_move.values():
for mydata in i.values(): stock_move_details.update({'inventory_id': context['active_ids'][0]})
mydata.update({'inventory_id': context['active_ids'][0]}) domain = []
domain = []
if fill_inventory.set_stock_zero:
mydata.update({'product_qty': 0})
for k, v in mydata.items():
domain.append((k, '=', v))
line_ids = inventory_line_obj.search(cr, uid, domain)
if not len(line_ids): if fill_inventory.set_stock_zero:
inventory_line_obj.create(cr, uid, mydata) stock_move_details.update({'product_qty': 0})
for field, value in stock_move_details.items():
domain.append((field, '=', value))
line_ids = inventory_line_obj.search(cr, uid, domain, context=context)
if not line_ids:
inventory_line_obj.create(cr, uid, stock_move_details, context=context)
return {'type': 'ir.actions.act_window_close'} return {'type': 'ir.actions.act_window_close'}

View File

@ -34,41 +34,43 @@ class stock_invoice_onshipping(osv.osv_memory):
return [] return []
model_pool = self.pool.get(model) model_pool = self.pool.get(model)
acct_obj = self.pool.get('account.journal') journal_obj = self.pool.get('account.journal')
res_ids = context and context.get('active_ids', []) res_ids = context and context.get('active_ids', [])
vals=[] vals = []
pick_types = list(set(map(lambda x: x.type, model_pool.browse(cr, uid, res_ids, context=context)))) browse_picking = model_pool.browse(cr, uid, res_ids, context=context)
for type in pick_types:
if type == 'out': for pick in browse_picking:
value = acct_obj.search(cr, uid, [('type', 'in',('sale','purchase_refund') )]) src_usage = pick.move_lines[0].location_id.usage
for jr_type in acct_obj.browse(cr, uid, value, context=context): dest_usage = pick.move_lines[0].location_dest_id.usage
t1 = jr_type.id,jr_type.name type = pick.type
vals.append(t1) if type == 'out' and dest_usage == 'supplier':
journal_type = 'purchase_refund'
elif type == 'in': elif type == 'out' and dest_usage == 'customer':
value = acct_obj.search(cr, uid, [('type', 'in',('purchase','sale_refund') )]) journal_type = 'sale'
for jr_type in acct_obj.browse(cr, uid, value, context=context): elif type == 'in' and src_usage == 'supplier':
t1 = jr_type.id,jr_type.name journal_type = 'purchase'
vals.append(t1) elif type == 'in' and src_usage == 'customer':
journal_type = 'sale_refund'
else: else:
value = acct_obj.search(cr, uid, [('type', 'in',('cash','bank','general','situation') )]) journal_type = 'sale'
for jr_type in acct_obj.browse(cr, uid, value, context=context):
t1 = jr_type.id,jr_type.name value = journal_obj.search(cr, uid, [('type', '=',journal_type )])
vals.append(t1) for jr_type in journal_obj.browse(cr, uid, value, context=context):
t1 = jr_type.id,jr_type.name
if t1 not in vals:
vals.append(t1)
return vals return vals
_name = "stock.invoice.onshipping" _name = "stock.invoice.onshipping"
_description = "Stock Invoice Onshipping" _description = "Stock Invoice Onshipping"
_columns = { _columns = {
'journal_id': fields.selection(_get_journal_id, 'Destination Journal',required=True), 'journal_id': fields.selection(_get_journal_id, 'Destination Journal',required=True),
'group': fields.boolean("Group by partner"), 'group': fields.boolean("Group by partner"),
'invoice_date': fields.date('Invoiced date'), 'invoice_date': fields.date('Invoiced date'),
} }
def view_init(self, cr, uid, fields_list, context=None): def view_init(self, cr, uid, fields_list, context=None):
if context is None: if context is None:
context = {} context = {}

View File

@ -304,7 +304,7 @@ class stock_move_split_lines_exist(osv.osv_memory):
'prodlot_id': fields.many2one('stock.production.lot', 'Production Lot'), 'prodlot_id': fields.many2one('stock.production.lot', 'Production Lot'),
} }
_defaults = { _defaults = {
'quantity': lambda *x: 1.0, 'quantity': 1.0,
} }
stock_move_split_lines_exist() stock_move_split_lines_exist()
@ -320,7 +320,7 @@ class stock_move_split_lines(osv.osv_memory):
'action': fields.selection([('split','Split'),('keepinone','Keep in one lot')],'Action'), 'action': fields.selection([('split','Split'),('keepinone','Keep in one lot')],'Action'),
} }
_defaults = { _defaults = {
'quantity': lambda *x: 1.0, 'quantity': 1.00,
'action' : lambda *x: 'split', 'action' : 'split',
} }
stock_move_split_lines() stock_move_split_lines()

View File

@ -37,7 +37,10 @@ class invoice_directly(osv.osv_memory):
context = {} context = {}
result = super(invoice_directly, self).do_partial(cr, uid, ids, context) result = super(invoice_directly, self).do_partial(cr, uid, ids, context)
pick_obj = self.pool.get('stock.picking') pick_obj = self.pool.get('stock.picking')
context.update({'active_model':'stock.picking'})
picking_ids = context.get('active_ids', False) picking_ids = context.get('active_ids', False)
if picking_ids:
context.update({'active_id':picking_ids[0]})
pick = pick_obj.browse(cr, uid, picking_ids, context=context)[0] pick = pick_obj.browse(cr, uid, picking_ids, context=context)[0]
if pick.invoice_state == '2binvoiced': if pick.invoice_state == '2binvoiced':
return { return {
@ -47,6 +50,7 @@ class invoice_directly(osv.osv_memory):
'res_model': 'stock.invoice.onshipping', 'res_model': 'stock.invoice.onshipping',
'type': 'ir.actions.act_window', 'type': 'ir.actions.act_window',
'target': 'new', 'target': 'new',
'context': context
} }
return {'type': 'ir.actions.act_window_close'} return {'type': 'ir.actions.act_window_close'}

View File

View File

@ -127,7 +127,7 @@ class users(osv.osv):
cr.close() cr.close()
return res return res
l.unbind() l.unbind()
except Exception, e: except Exception:
logger.warning("Cannot auth", exc_info=True) logger.warning("Cannot auth", exc_info=True)
continue continue
cr.close() cr.close()
@ -138,6 +138,11 @@ class users(osv.osv):
return super(users,self).check(db, uid, passwd) return super(users,self).check(db, uid, passwd)
except security.ExceptionNoTb: # AccessDenied except security.ExceptionNoTb: # AccessDenied
pass pass
if not passwd:
# empty passwords disallowed for obvious security reasons
raise security.ExceptionNoTb('AccessDenied')
cr = pooler.get_db(db).cursor() cr = pooler.get_db(db).cursor()
user = self.browse(cr, 1, uid) user = self.browse(cr, 1, uid)
logger = logging.getLogger('orm.ldap') logger = logging.getLogger('orm.ldap')
@ -156,13 +161,15 @@ class users(osv.osv):
result_type, result_data = l.result(result_id, timeout) result_type, result_data = l.result(result_id, timeout)
if result_data and result_type == ldap.RES_SEARCH_RESULT and len(result_data) == 1: if result_data and result_type == ldap.RES_SEARCH_RESULT and len(result_data) == 1:
dn = result_data[0][0] dn = result_data[0][0]
# some LDAP servers allow anonymous binding with blank passwords,
# but these have been rejected above, so we're safe to use bind()
if l.bind_s(dn, passwd): if l.bind_s(dn, passwd):
l.unbind() l.unbind()
self._uid_cache.setdefault(db, {})[uid] = passwd self._uid_cache.setdefault(db, {})[uid] = passwd
cr.close() cr.close()
return True return True
l.unbind() l.unbind()
except Exception, e: except Exception:
logger.warning('cannot check', exc_info=True) logger.warning('cannot check', exc_info=True)
pass pass
cr.close() cr.close()

View File

@ -8,15 +8,15 @@ msgstr ""
"Project-Id-Version: openobject-addons\n" "Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2010-08-02 17:52+0530\n" "POT-Creation-Date: 2010-08-02 17:52+0530\n"
"PO-Revision-Date: 2011-02-06 12:04+0000\n" "PO-Revision-Date: 2011-03-12 20:33+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: mgaja (GrupoIsep.com) <Unknown>\n"
"Language-Team: Catalan <ca@li.org>\n" "Language-Team: Catalan <ca@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-02-07 06:24+0000\n" "X-Launchpad-Export-Date: 2011-03-13 06:16+0000\n"
"X-Generator: Launchpad (build 12177)\n" "X-Generator: Launchpad (build 12559)\n"
#: widgets/wikimarkup/__init__.py:1981 #: widgets/wikimarkup/__init__.py:1981
msgid "Table of Contents" msgid "Table of Contents"
msgstr "" msgstr "Índex"

View File

@ -0,0 +1,22 @@
# Danish translation for openobject-addons
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2010-08-02 17:52+0530\n"
"PO-Revision-Date: 2011-04-29 12:05+0000\n"
"Last-Translator: Hans Henrik Gabelgaard <Unknown>\n"
"Language-Team: Danish <da@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-04-30 06:08+0000\n"
"X-Generator: Launchpad (build 12758)\n"
#: widgets/wikimarkup/__init__.py:1981
msgid "Table of Contents"
msgstr "Indholdsfortegnelse"

View File

@ -0,0 +1,22 @@
# Spanish (Paraguay) translation for openobject-addons
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2010-08-02 17:52+0530\n"
"PO-Revision-Date: 2011-03-21 16:31+0000\n"
"Last-Translator: fadel <Unknown>\n"
"Language-Team: Spanish (Paraguay) <es_PY@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-03-22 06:23+0000\n"
"X-Generator: Launchpad (build 12559)\n"
#: widgets/wikimarkup/__init__.py:1981
msgid "Table of Contents"
msgstr "Tabla de Contenido"

View File

@ -0,0 +1,22 @@
# Galician translation for openobject-addons
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2010-08-02 17:52+0530\n"
"PO-Revision-Date: 2011-03-02 23:19+0000\n"
"Last-Translator: Santi (Pexego) <santiago@pexego.es>\n"
"Language-Team: Galician <gl@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-03-03 06:01+0000\n"
"X-Generator: Launchpad (build 12351)\n"
#: widgets/wikimarkup/__init__.py:1981
msgid "Table of Contents"
msgstr "Índice"

View File

@ -0,0 +1,22 @@
# Russian translation for openobject-addons
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2010-08-02 17:52+0530\n"
"PO-Revision-Date: 2011-03-16 00:17+0000\n"
"Last-Translator: Stanislav Hanzhin <Unknown>\n"
"Language-Team: Russian <ru@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-03-17 06:12+0000\n"
"X-Generator: Launchpad (build 12559)\n"
#: widgets/wikimarkup/__init__.py:1981
msgid "Table of Contents"
msgstr "Содержание"

0
addons/wiki/web/widgets/rss/feedparser.py Normal file → Executable file
View File