[MERGE] Another batch of Bugfixes from 6.1
Up to 6.1 revision 6800 olt@tinyerp.com-20120516065727-ghvzjttnncj8ryj0 bzr revid: odo@openerp.com-20121207183024-adx8vnq9cytxi2lu
This commit is contained in:
commit
e7b30b164e
|
@ -141,7 +141,7 @@ for a particular financial year and for preparation of vouchers there is a modul
|
||||||
'project/analytic_account_demo.xml',
|
'project/analytic_account_demo.xml',
|
||||||
'demo/account_minimal.xml',
|
'demo/account_minimal.xml',
|
||||||
'demo/account_invoice_demo.xml',
|
'demo/account_invoice_demo.xml',
|
||||||
# 'account_unit_test.xml',
|
'account_unit_test.xml',
|
||||||
],
|
],
|
||||||
'test': [
|
'test': [
|
||||||
'test/account_customer_invoice.yml',
|
'test/account_customer_invoice.yml',
|
||||||
|
|
|
@ -80,8 +80,11 @@ class account_invoice(osv.osv):
|
||||||
|
|
||||||
def _reconciled(self, cr, uid, ids, name, args, context=None):
|
def _reconciled(self, cr, uid, ids, name, args, context=None):
|
||||||
res = {}
|
res = {}
|
||||||
for id in ids:
|
wf_service = netsvc.LocalService("workflow")
|
||||||
res[id] = self.test_paid(cr, uid, [id])
|
for inv in self.browse(cr, uid, ids, context=context):
|
||||||
|
res[inv.id] = self.test_paid(cr, uid, [inv.id])
|
||||||
|
if not res[inv.id] and inv.state == 'paid':
|
||||||
|
wf_service.trg_validate(uid, 'account.invoice', inv.id, 'open_test', cr)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def _get_reference_type(self, cr, uid, context=None):
|
def _get_reference_type(self, cr, uid, context=None):
|
||||||
|
@ -1159,7 +1162,7 @@ class account_invoice(osv.osv):
|
||||||
return map(lambda x: (0,0,x), lines)
|
return map(lambda x: (0,0,x), lines)
|
||||||
|
|
||||||
def refund(self, cr, uid, ids, date=None, period_id=None, description=None, journal_id=None):
|
def refund(self, cr, uid, ids, date=None, period_id=None, description=None, journal_id=None):
|
||||||
invoices = self.read(cr, uid, ids, ['name', 'type', 'number', 'reference', 'comment', 'date_due', 'partner_id', 'partner_contact', 'partner_insite', 'partner_ref', 'payment_term', 'account_id', 'currency_id', 'invoice_line', 'tax_line', 'journal_id', 'company_id'])
|
invoices = self.read(cr, uid, ids, ['name', 'type', 'number', 'reference', 'comment', 'date_due', 'partner_id', 'partner_contact', 'partner_insite', 'partner_ref', 'payment_term', 'account_id', 'currency_id', 'invoice_line', 'tax_line', 'journal_id', 'company_id', 'user_id', 'fiscal_position'])
|
||||||
obj_invoice_line = self.pool.get('account.invoice.line')
|
obj_invoice_line = self.pool.get('account.invoice.line')
|
||||||
obj_invoice_tax = self.pool.get('account.invoice.tax')
|
obj_invoice_tax = self.pool.get('account.invoice.tax')
|
||||||
obj_journal = self.pool.get('account.journal')
|
obj_journal = self.pool.get('account.journal')
|
||||||
|
@ -1208,7 +1211,8 @@ class account_invoice(osv.osv):
|
||||||
})
|
})
|
||||||
# take the id part of the tuple returned for many2one fields
|
# take the id part of the tuple returned for many2one fields
|
||||||
for field in ('partner_id', 'company_id',
|
for field in ('partner_id', 'company_id',
|
||||||
'account_id', 'currency_id', 'payment_term', 'journal_id'):
|
'account_id', 'currency_id', 'payment_term', 'journal_id',
|
||||||
|
'user_id', 'fiscal_position'):
|
||||||
invoice[field] = invoice[field] and invoice[field][0]
|
invoice[field] = invoice[field] and invoice[field][0]
|
||||||
# create the new invoice
|
# create the new invoice
|
||||||
new_ids.append(self.create(cr, uid, invoice))
|
new_ids.append(self.create(cr, uid, invoice))
|
||||||
|
|
|
@ -856,7 +856,12 @@ class account_move_line(osv.osv):
|
||||||
if r[0][1] != None:
|
if r[0][1] != None:
|
||||||
raise osv.except_osv(_('Error!'), _('Some entries are already reconciled.'))
|
raise osv.except_osv(_('Error!'), _('Some entries are already reconciled.'))
|
||||||
|
|
||||||
if (not currency_obj.is_zero(cr, uid, account.company_id.currency_id, writeoff)) or \
|
if context.get('fy_closing'):
|
||||||
|
# We don't want to generate any write-off when being called from the
|
||||||
|
# wizard used to close a fiscal year (and it doesn't give us any
|
||||||
|
# writeoff_acc_id).
|
||||||
|
pass
|
||||||
|
elif (not currency_obj.is_zero(cr, uid, account.company_id.currency_id, writeoff)) or \
|
||||||
(account.currency_id and (not currency_obj.is_zero(cr, uid, account.currency_id, currency))):
|
(account.currency_id and (not currency_obj.is_zero(cr, uid, account.currency_id, currency))):
|
||||||
if not writeoff_acc_id:
|
if not writeoff_acc_id:
|
||||||
raise osv.except_osv(_('Warning!'), _('You have to provide an account for the write off/exchange difference entry.'))
|
raise osv.except_osv(_('Warning!'), _('You have to provide an account for the write off/exchange difference entry.'))
|
||||||
|
|
|
@ -29,8 +29,9 @@
|
||||||
<field name="auto_delete" eval="True"/>
|
<field name="auto_delete" eval="True"/>
|
||||||
<field name="report_template" ref="account_invoices"/>
|
<field name="report_template" ref="account_invoices"/>
|
||||||
<field name="report_name">Invoice_${(object.number or '').replace('/','_')}_${object.state == 'draft' and 'draft' or ''}</field>
|
<field name="report_name">Invoice_${(object.number or '').replace('/','_')}_${object.state == 'draft' and 'draft' or ''}</field>
|
||||||
|
<field name="lang">${object.partner_id.lang}</field>
|
||||||
<field name="body_html"><![CDATA[
|
<field name="body_html"><![CDATA[
|
||||||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: rgb(255, 255, 255); ">
|
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; ">
|
||||||
|
|
||||||
<p>Hello${object.partner_id.name and ' ' or ''}${object.partner_id.name or ''},</p>
|
<p>Hello${object.partner_id.name and ' ' or ''}${object.partner_id.name or ''},</p>
|
||||||
|
|
||||||
|
@ -73,7 +74,7 @@
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
<div style="width: 375px; margin: 0px; padding: 0px; background-color: #8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; background-repeat: repeat no-repeat;">
|
<div style="width: 375px; margin: 0px; padding: 0px; background-color: #8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; background-repeat: repeat no-repeat;">
|
||||||
<h3 style="margin: 0px; padding: 2px 14px; font-size: 12px; color: #FFF;">
|
<h3 style="margin: 0px; padding: 2px 14px; font-size: 12px; color: #DDD;">
|
||||||
<strong style="text-transform:uppercase;">${object.company_id.name}</strong></h3>
|
<strong style="text-transform:uppercase;">${object.company_id.name}</strong></h3>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;">
|
<div style="width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;">
|
||||||
|
|
|
@ -56,7 +56,7 @@ class report_account_common(report_sxw.rml_parse, common_report_header):
|
||||||
for report in self.pool.get('account.financial.report').browse(self.cr, self.uid, ids2, context=data['form']['used_context']):
|
for report in self.pool.get('account.financial.report').browse(self.cr, self.uid, ids2, context=data['form']['used_context']):
|
||||||
vals = {
|
vals = {
|
||||||
'name': report.name,
|
'name': report.name,
|
||||||
'balance': report.balance,
|
'balance': report.balance * report.sign,
|
||||||
'type': 'report',
|
'type': 'report',
|
||||||
'level': bool(report.style_overwrite) and report.style_overwrite or report.level,
|
'level': bool(report.style_overwrite) and report.style_overwrite or report.level,
|
||||||
'account_type': report.type =='sum' and 'view' or False, #used to underline the financial report balances
|
'account_type': report.type =='sum' and 'view' or False, #used to underline the financial report balances
|
||||||
|
|
|
@ -48,6 +48,7 @@ class report_account_receivable(osv.osv):
|
||||||
_order = 'name desc'
|
_order = 'name desc'
|
||||||
|
|
||||||
def init(self, cr):
|
def init(self, cr):
|
||||||
|
tools.drop_view_if_exists(cr, 'report_account_receivable')
|
||||||
cr.execute("""
|
cr.execute("""
|
||||||
create or replace view report_account_receivable as (
|
create or replace view report_account_receivable as (
|
||||||
select
|
select
|
||||||
|
@ -183,6 +184,7 @@ class report_invoice_created(osv.osv):
|
||||||
_order = 'create_date'
|
_order = 'create_date'
|
||||||
|
|
||||||
def init(self, cr):
|
def init(self, cr):
|
||||||
|
tools.drop_view_if_exists(cr, 'report_invoice_created')
|
||||||
cr.execute("""create or replace view report_invoice_created as (
|
cr.execute("""create or replace view report_invoice_created as (
|
||||||
select
|
select
|
||||||
inv.id as id, inv.name as name, inv.type as type,
|
inv.id as id, inv.name as name, inv.type as type,
|
||||||
|
|
|
@ -36,7 +36,7 @@ from itertools import groupby
|
||||||
from operator import itemgetter
|
from operator import itemgetter
|
||||||
|
|
||||||
|
|
||||||
FIELD_STATES = [('clear', 'Clear'), ('anonymized', 'Anonymized'), ('not_existing', 'Not Existing')]
|
FIELD_STATES = [('clear', 'Clear'), ('anonymized', 'Anonymized'), ('not_existing', 'Not Existing'), ('new', 'New')]
|
||||||
ANONYMIZATION_STATES = FIELD_STATES + [('unstable', 'Unstable')]
|
ANONYMIZATION_STATES = FIELD_STATES + [('unstable', 'Unstable')]
|
||||||
WIZARD_ANONYMIZATION_STATES = [('clear', 'Clear'), ('anonymized', 'Anonymized'), ('unstable', 'Unstable')]
|
WIZARD_ANONYMIZATION_STATES = [('clear', 'Clear'), ('anonymized', 'Anonymized'), ('unstable', 'Unstable')]
|
||||||
ANONYMIZATION_HISTORY_STATE = [('started', 'Started'), ('done', 'Done'), ('in_exception', 'Exception occured')]
|
ANONYMIZATION_HISTORY_STATE = [('started', 'Started'), ('done', 'Done'), ('in_exception', 'Exception occured')]
|
||||||
|
|
|
@ -83,11 +83,11 @@ class audittrail_rule(osv.osv):
|
||||||
"domain": "[('object_id','=', " + str(thisrule.object_id.id) + "), ('res_id', '=', active_id)]"
|
"domain": "[('object_id','=', " + str(thisrule.object_id.id) + "), ('res_id', '=', active_id)]"
|
||||||
|
|
||||||
}
|
}
|
||||||
action_id = obj_action.create(cr, uid, val)
|
action_id = obj_action.create(cr, SUPERUSER_ID, val)
|
||||||
self.write(cr, uid, [thisrule.id], {"state": "subscribed", "action_id": action_id})
|
self.write(cr, uid, [thisrule.id], {"state": "subscribed", "action_id": action_id})
|
||||||
keyword = 'client_action_relate'
|
keyword = 'client_action_relate'
|
||||||
value = 'ir.actions.act_window,' + str(action_id)
|
value = 'ir.actions.act_window,' + str(action_id)
|
||||||
res = obj_model.ir_set(cr, uid, 'action', keyword, 'View_log_' + thisrule.object_id.model, [thisrule.object_id.model], value, replace=True, isobject=True, xml_id=False)
|
res = obj_model.ir_set(cr, SUPERUSER_ID, 'action', keyword, 'View_log_' + thisrule.object_id.model, [thisrule.object_id.model], value, replace=True, isobject=True, xml_id=False)
|
||||||
#End Loop
|
#End Loop
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ class audittrail_rule(osv.osv):
|
||||||
setattr(function[0], function[1], function[2])
|
setattr(function[0], function[1], function[2])
|
||||||
w_id = obj_action.search(cr, uid, [('name', '=', 'View Log'), ('res_model', '=', 'audittrail.log'), ('src_model', '=', thisrule.object_id.model)])
|
w_id = obj_action.search(cr, uid, [('name', '=', 'View Log'), ('res_model', '=', 'audittrail.log'), ('src_model', '=', thisrule.object_id.model)])
|
||||||
if w_id:
|
if w_id:
|
||||||
obj_action.unlink(cr, uid, w_id)
|
obj_action.unlink(cr, SUPERUSER_ID, w_id)
|
||||||
value = "ir.actions.act_window" + ',' + str(w_id[0])
|
value = "ir.actions.act_window" + ',' + str(w_id[0])
|
||||||
val_id = ir_values_obj.search(cr, uid, [('model', '=', thisrule.object_id.model), ('value', '=', value)])
|
val_id = ir_values_obj.search(cr, uid, [('model', '=', thisrule.object_id.model), ('value', '=', value)])
|
||||||
if val_id:
|
if val_id:
|
||||||
|
|
|
@ -686,10 +686,10 @@ class crm_lead(base_stage, format_address, osv.osv):
|
||||||
if context is None:
|
if context is None:
|
||||||
context = {}
|
context = {}
|
||||||
partner_ids = {}
|
partner_ids = {}
|
||||||
|
force_partner_id = partner_id
|
||||||
for lead in self.browse(cr, uid, ids, context=context):
|
for lead in self.browse(cr, uid, ids, context=context):
|
||||||
if action == 'create':
|
if action == 'create':
|
||||||
if not partner_id:
|
partner_id = force_partner_id or self._create_lead_partner(cr, uid, lead, context)
|
||||||
partner_id = self._create_lead_partner(cr, uid, lead, context)
|
|
||||||
self._lead_set_partner(cr, uid, lead, partner_id, context=context)
|
self._lead_set_partner(cr, uid, lead, partner_id, context=context)
|
||||||
partner_ids[lead.id] = partner_id
|
partner_ids[lead.id] = partner_id
|
||||||
return partner_ids
|
return partner_ids
|
||||||
|
@ -700,9 +700,9 @@ class crm_lead(base_stage, format_address, osv.osv):
|
||||||
value = {}
|
value = {}
|
||||||
if team_id:
|
if team_id:
|
||||||
value['section_id'] = team_id
|
value['section_id'] = team_id
|
||||||
if index < len(user_ids):
|
if user_ids:
|
||||||
value['user_id'] = user_ids[index]
|
value['user_id'] = user_ids[index]
|
||||||
index += 1
|
index = (index + 1) % len(user_ids)
|
||||||
if value:
|
if value:
|
||||||
self.write(cr, uid, [lead_id], value, context=context)
|
self.write(cr, uid, [lead_id], value, context=context)
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -195,12 +195,12 @@ openerp_mailgate.py -u %(uid)d -p PASSWORD -o %(model)s -d %(dbname)s --host=HOS
|
||||||
strip_attachments=(not server.attach),
|
strip_attachments=(not server.attach),
|
||||||
context=context)
|
context=context)
|
||||||
if res_id and server.action_id:
|
if res_id and server.action_id:
|
||||||
action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids':[res_id], 'active_model': context.get("thread_model", False)})
|
action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids':[res_id], 'active_model': context.get("thread_model", server.object_id.model)})
|
||||||
imap_server.store(num, '+FLAGS', '\\Seen')
|
imap_server.store(num, '+FLAGS', '\\Seen')
|
||||||
cr.commit()
|
cr.commit()
|
||||||
count += 1
|
count += 1
|
||||||
_logger.info("fetched/processed %s email(s) on %s server %s", count, server.type, server.name)
|
_logger.info("fetched/processed %s email(s) on %s server %s", count, server.type, server.name)
|
||||||
except Exception, e:
|
except Exception:
|
||||||
_logger.exception("Failed to fetch mail from %s server %s.", server.type, server.name)
|
_logger.exception("Failed to fetch mail from %s server %s.", server.type, server.name)
|
||||||
finally:
|
finally:
|
||||||
if imap_server:
|
if imap_server:
|
||||||
|
@ -220,11 +220,11 @@ openerp_mailgate.py -u %(uid)d -p PASSWORD -o %(model)s -d %(dbname)s --host=HOS
|
||||||
strip_attachments=(not server.attach),
|
strip_attachments=(not server.attach),
|
||||||
context=context)
|
context=context)
|
||||||
if res_id and server.action_id:
|
if res_id and server.action_id:
|
||||||
action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids':[res_id], 'active_model': context.get("thread_model", False)})
|
action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids':[res_id], 'active_model': context.get("thread_model", server.object_id.model)})
|
||||||
pop_server.dele(num)
|
pop_server.dele(num)
|
||||||
cr.commit()
|
cr.commit()
|
||||||
_logger.info("fetched/processed %s email(s) on %s server %s", numMsgs, server.type, server.name)
|
_logger.info("fetched/processed %s email(s) on %s server %s", numMsgs, server.type, server.name)
|
||||||
except Exception, e:
|
except Exception:
|
||||||
_logger.exception("Failed to fetch mail from %s server %s.", server.type, server.name)
|
_logger.exception("Failed to fetch mail from %s server %s.", server.type, server.name)
|
||||||
finally:
|
finally:
|
||||||
if pop_server:
|
if pop_server:
|
||||||
|
|
|
@ -164,7 +164,10 @@ class partner_vat_intra(osv.osv_memory):
|
||||||
'comments': comments,
|
'comments': comments,
|
||||||
'issued_by': issued_by,
|
'issued_by': issued_by,
|
||||||
})
|
})
|
||||||
|
#tax code 44: services
|
||||||
|
#tax code 46L: normal good deliveries
|
||||||
|
#tax code 46T: ABC good deliveries
|
||||||
|
#tax code 48xxx: credite note on tax code xxx
|
||||||
codes = ('44', '46L', '46T', '48s44', '48s46L', '48s46T')
|
codes = ('44', '46L', '46T', '48s44', '48s46L', '48s46T')
|
||||||
cr.execute('''SELECT p.name As partner_name, l.partner_id AS partner_id, p.vat AS vat,
|
cr.execute('''SELECT p.name As partner_name, l.partner_id AS partner_id, p.vat AS vat,
|
||||||
(CASE WHEN t.code = '48s44' THEN '44'
|
(CASE WHEN t.code = '48s44' THEN '44'
|
||||||
|
|
|
@ -30,8 +30,11 @@ class coda_bank_account(osv.osv):
|
||||||
|
|
||||||
def _check_currency(self, cr, uid, ids, context=None):
|
def _check_currency(self, cr, uid, ids, context=None):
|
||||||
obj_cba = self.browse(cr, uid, ids[0], context=context)
|
obj_cba = self.browse(cr, uid, ids[0], context=context)
|
||||||
if (obj_cba.state == 'normal') and obj_cba.journal and (obj_cba.currency != obj_cba.journal.currency):
|
if (obj_cba.state == 'normal') and obj_cba.journal:
|
||||||
return False
|
if obj_cba.journal.currency and (obj_cba.currency != obj_cba.journal.currency):
|
||||||
|
return False
|
||||||
|
if not obj_cba.journal.currency and (obj_cba.currency != obj_cba.company_id.currency_id):
|
||||||
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
|
|
|
@ -631,12 +631,6 @@ class account_coda_import(osv.osv_memory):
|
||||||
nb_err += 1
|
nb_err += 1
|
||||||
err_string += _('\nConfiguration Error!\nPlease verify the Default Debit and Credit Account settings in journal %s.') % journal.name
|
err_string += _('\nConfiguration Error!\nPlease verify the Default Debit and Credit Account settings in journal %s.') % journal.name
|
||||||
break
|
break
|
||||||
if balance_start_check <> statement['balance_start']:
|
|
||||||
nb_err += 1
|
|
||||||
err_string += _('\nThe CODA Statement %s Starting Balance (%.2f) does not correspond with the previous Closing Balance (%.2f) in journal %s.') \
|
|
||||||
% (statement['name'], statement['balance_start'], balance_start_check, journal.name)
|
|
||||||
break
|
|
||||||
|
|
||||||
bk_st_id = bank_st_obj.create(cr, uid, {
|
bk_st_id = bank_st_obj.create(cr, uid, {
|
||||||
'name': statement['name'],
|
'name': statement['name'],
|
||||||
'journal_id': statement['journal_id'],
|
'journal_id': statement['journal_id'],
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import sys
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
@ -40,13 +39,10 @@ from tools import mod10r
|
||||||
from tools.translate import _
|
from tools.translate import _
|
||||||
from tools.config import config
|
from tools.config import config
|
||||||
|
|
||||||
import wizard
|
from openerp import addons
|
||||||
import addons
|
|
||||||
import pooler
|
import pooler
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class l10n_ch_report_webkit_html(report_sxw.rml_parse):
|
class l10n_ch_report_webkit_html(report_sxw.rml_parse):
|
||||||
def __init__(self, cr, uid, name, context):
|
def __init__(self, cr, uid, name, context):
|
||||||
super(l10n_ch_report_webkit_html, self).__init__(cr, uid, name, context=context)
|
super(l10n_ch_report_webkit_html, self).__init__(cr, uid, name, context=context)
|
||||||
|
@ -78,12 +74,12 @@ class l10n_ch_report_webkit_html(report_sxw.rml_parse):
|
||||||
|
|
||||||
def police_absolute_path(self, inner_path):
|
def police_absolute_path(self, inner_path):
|
||||||
"""Will get the ocrb police absolute path"""
|
"""Will get the ocrb police absolute path"""
|
||||||
path = addons.get_module_resource(os.path.join('l10n_ch', 'report', inner_path))
|
path = addons.get_module_resource('l10n_ch', 'report', inner_path)
|
||||||
return path
|
return path
|
||||||
|
|
||||||
def bvr_absolute_path(self) :
|
def bvr_absolute_path(self) :
|
||||||
"""Will get the ocrb police absolute path"""
|
"""Will get the ocrb police absolute path"""
|
||||||
path = addons.get_module_resource(os.path.join('l10n_ch', 'report', 'bvr1.jpg'))
|
path = addons.get_module_resource('l10n_ch', 'report', 'bvr1.jpg')
|
||||||
return path
|
return path
|
||||||
|
|
||||||
def headheight(self):
|
def headheight(self):
|
||||||
|
@ -167,7 +163,7 @@ class BVRWebKitParser(webkit_report.WebKitParser):
|
||||||
"""generate the PDF"""
|
"""generate the PDF"""
|
||||||
context = context or {}
|
context = context or {}
|
||||||
if report_xml.report_type != 'webkit':
|
if report_xml.report_type != 'webkit':
|
||||||
return super(WebKitParser,self).create_single_pdf(cursor, uid, ids, data, report_xml, context=context)
|
return super(BVRWebKitParser,self).create_single_pdf(cursor, uid, ids, data, report_xml, context=context)
|
||||||
self.parser_instance = self.parser(cursor,
|
self.parser_instance = self.parser(cursor,
|
||||||
uid,
|
uid,
|
||||||
self.name2,
|
self.name2,
|
||||||
|
@ -177,7 +173,7 @@ class BVRWebKitParser(webkit_report.WebKitParser):
|
||||||
self.parser_instance.set_context(objs, data, ids, report_xml.report_type)
|
self.parser_instance.set_context(objs, data, ids, report_xml.report_type)
|
||||||
template = False
|
template = False
|
||||||
if report_xml.report_file :
|
if report_xml.report_file :
|
||||||
path = addons.get_module_resource(report_xml.report_file)
|
path = addons.get_module_resource(*report_xml.report_file.split(os.path.sep))
|
||||||
if os.path.exists(path) :
|
if os.path.exists(path) :
|
||||||
template = file(path).read()
|
template = file(path).read()
|
||||||
if not template and report_xml.report_webkit_data :
|
if not template and report_xml.report_webkit_data :
|
||||||
|
@ -203,7 +199,7 @@ class BVRWebKitParser(webkit_report.WebKitParser):
|
||||||
company = user.company_id
|
company = user.company_id
|
||||||
body_mako_tpl = mako_template(template)
|
body_mako_tpl = mako_template(template)
|
||||||
#BVR specific
|
#BVR specific
|
||||||
bvr_path = addons.get_module_resource(os.path.join('l10n_ch','report','bvr.mako'))
|
bvr_path = addons.get_module_resource('l10n_ch','report','bvr.mako')
|
||||||
body_bvr_tpl = mako_template(file(bvr_path).read())
|
body_bvr_tpl = mako_template(file(bvr_path).read())
|
||||||
helper = report_helper.WebKitHelper(cursor, uid, report_xml.id, context)
|
helper = report_helper.WebKitHelper(cursor, uid, report_xml.id, context)
|
||||||
##BVR Specific
|
##BVR Specific
|
||||||
|
|
|
@ -58,4 +58,4 @@
|
||||||
!python {model: account.invoice}: |
|
!python {model: account.invoice}: |
|
||||||
from tools.test_reports import try_report
|
from tools.test_reports import try_report
|
||||||
company = self.pool.get('res.users').browse(cr, uid, uid).company_id
|
company = self.pool.get('res.users').browse(cr, uid, uid).company_id
|
||||||
company.lib_path and try_report(cr, uid, 'report.invoice_web_bvr', [ref('l10n_ch_invoice')]) or 'Webkit lib not set'
|
try_report(cr, uid, 'report.invoice_web_bvr', [ref('l10n_ch_invoice')]) or 'Unable to find Webkit'
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -131,7 +131,6 @@ class wizard_user(osv.osv_memory):
|
||||||
return id
|
return id
|
||||||
|
|
||||||
def action_apply(self, cr, uid, ids, context=None):
|
def action_apply(self, cr, uid, ids, context=None):
|
||||||
res_users = self.pool.get('res.users')
|
|
||||||
for wizard_user in self.browse(cr, SUPERUSER_ID, ids, context):
|
for wizard_user in self.browse(cr, SUPERUSER_ID, ids, context):
|
||||||
portal = wizard_user.wizard_id.portal_id
|
portal = wizard_user.wizard_id.portal_id
|
||||||
user = self._retrieve_user(cr, SUPERUSER_ID, wizard_user, context)
|
user = self._retrieve_user(cr, SUPERUSER_ID, wizard_user, context)
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
<div style="width: 375px; margin: 0px; padding: 0px; background-color: #8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; background-repeat: repeat no-repeat;">
|
<div style="width: 375px; margin: 0px; padding: 0px; background-color: #8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; background-repeat: repeat no-repeat;">
|
||||||
<h3 style="margin: 0px; padding: 2px 14px; font-size: 12px; color: #FFF;">
|
<h3 style="margin: 0px; padding: 2px 14px; font-size: 12px; color: #DDD;">
|
||||||
<strong style="text-transform:uppercase;">${object.company_id.name}</strong></h3>
|
<strong style="text-transform:uppercase;">${object.company_id.name}</strong></h3>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;">
|
<div style="width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;">
|
||||||
|
@ -174,7 +174,7 @@
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
<div style="width: 375px; margin: 0px; padding: 0px; background-color: #8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; background-repeat: repeat no-repeat;">
|
<div style="width: 375px; margin: 0px; padding: 0px; background-color: #8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; background-repeat: repeat no-repeat;">
|
||||||
<h3 style="margin: 0px; padding: 2px 14px; font-size: 12px; color: #FFF;">
|
<h3 style="margin: 0px; padding: 2px 14px; font-size: 12px; color: #DDD;">
|
||||||
<strong style="text-transform:uppercase;">${object.company_id.name}</strong></h3>
|
<strong style="text-transform:uppercase;">${object.company_id.name}</strong></h3>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;">
|
<div style="width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;">
|
||||||
|
|
|
@ -356,6 +356,7 @@ class project(osv.osv):
|
||||||
|
|
||||||
context['active_test'] = False
|
context['active_test'] = False
|
||||||
default['state'] = 'open'
|
default['state'] = 'open'
|
||||||
|
default['line_ids'] = []
|
||||||
default['tasks'] = []
|
default['tasks'] = []
|
||||||
default.pop('alias_name', None)
|
default.pop('alias_name', None)
|
||||||
default.pop('alias_id', None)
|
default.pop('alias_id', None)
|
||||||
|
|
|
@ -500,7 +500,6 @@ class project_issue(base_stage, osv.osv):
|
||||||
custom_values['priority'] = msg.get('priority')
|
custom_values['priority'] = msg.get('priority')
|
||||||
|
|
||||||
res_id = super(project_issue, self).message_new(cr, uid, msg, custom_values=custom_values, context=context)
|
res_id = super(project_issue, self).message_new(cr, uid, msg, custom_values=custom_values, context=context)
|
||||||
# self.convert_to_bug(cr, uid, [res_id], context=context)
|
|
||||||
return res_id
|
return res_id
|
||||||
|
|
||||||
def message_update(self, cr, uid, ids, msg, update_vals=None, context=None):
|
def message_update(self, cr, uid, ids, msg, update_vals=None, context=None):
|
||||||
|
|
|
@ -52,8 +52,8 @@ class project_issue_report(osv.osv):
|
||||||
'date_closed': fields.date('Date of Closing', readonly=True),
|
'date_closed': fields.date('Date of Closing', readonly=True),
|
||||||
'stage_id': fields.many2one('project.task.type', 'Stage'),
|
'stage_id': fields.many2one('project.task.type', 'Stage'),
|
||||||
'nbr': fields.integer('# of Issues', readonly=True),
|
'nbr': fields.integer('# of Issues', readonly=True),
|
||||||
'working_hours_open': fields.float('Avg. Working Hours to Open', readonly=True),
|
'working_hours_open': fields.float('Avg. Working Hours to Open', readonly=True, group_operator="avg"),
|
||||||
'working_hours_close': fields.float('Avg. Working Hours to Close', readonly=True),
|
'working_hours_close': fields.float('Avg. Working Hours to Close', readonly=True, group_operator="avg"),
|
||||||
'delay_open': fields.float('Avg. Delay to Open', digits=(16,2), readonly=True, group_operator="avg",
|
'delay_open': fields.float('Avg. Delay to Open', digits=(16,2), readonly=True, group_operator="avg",
|
||||||
help="Number of Days to open the project issue."),
|
help="Number of Days to open the project issue."),
|
||||||
'delay_close': fields.float('Avg. Delay to Close', digits=(16,2), readonly=True, group_operator="avg",
|
'delay_close': fields.float('Avg. Delay to Close', digits=(16,2), readonly=True, group_operator="avg",
|
||||||
|
|
|
@ -26,8 +26,9 @@
|
||||||
<field name="auto_delete" eval="True"/>
|
<field name="auto_delete" eval="True"/>
|
||||||
<field name="report_template" ref="report_purchase_quotation"/>
|
<field name="report_template" ref="report_purchase_quotation"/>
|
||||||
<field name="report_name">RFQ_${(object.name or '').replace('/','_')}</field>
|
<field name="report_name">RFQ_${(object.name or '').replace('/','_')}</field>
|
||||||
|
<field name="lang">${object.partner_id.lang}</field>
|
||||||
<field name="body_html"><![CDATA[
|
<field name="body_html"><![CDATA[
|
||||||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: rgb(255, 255, 255); ">
|
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; ">
|
||||||
|
|
||||||
<p>Hello${object.partner_id.name and ' ' or ''}${object.partner_id.name or ''},</p>
|
<p>Hello${object.partner_id.name and ' ' or ''}${object.partner_id.name or ''},</p>
|
||||||
|
|
||||||
|
@ -55,7 +56,7 @@
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
<div style="width: 375px; margin: 0px; padding: 0px; background-color: #8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; background-repeat: repeat no-repeat;">
|
<div style="width: 375px; margin: 0px; padding: 0px; background-color: #8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; background-repeat: repeat no-repeat;">
|
||||||
<h3 style="margin: 0px; padding: 2px 14px; font-size: 12px; color: #FFF;">
|
<h3 style="margin: 0px; padding: 2px 14px; font-size: 12px; color: #DDD;">
|
||||||
<strong style="text-transform:uppercase;">${object.company_id.name}</strong></h3>
|
<strong style="text-transform:uppercase;">${object.company_id.name}</strong></h3>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;">
|
<div style="width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;">
|
||||||
|
|
|
@ -156,7 +156,7 @@
|
||||||
<field name="res_model">purchase.requisition</field>
|
<field name="res_model">purchase.requisition</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>
|
||||||
<field name="context">{"search_default_create_uid":uid}</field>
|
<field name="context">{"search_default_user_id":uid}</field>
|
||||||
<field name="search_view_id" ref="view_purchase_requisition_filter"/>
|
<field name="search_view_id" ref="view_purchase_requisition_filter"/>
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
<p class="oe_view_nocontent_create">
|
<p class="oe_view_nocontent_create">
|
||||||
|
|
|
@ -29,9 +29,9 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
from osv import fields, osv
|
from openerp.osv import fields, osv
|
||||||
|
|
||||||
class ResCompany(osv.osv):
|
class res_company(osv.osv):
|
||||||
"""Override company to add Header object link a company can have many header and logos"""
|
"""Override company to add Header object link a company can have many header and logos"""
|
||||||
|
|
||||||
_inherit = "res.company"
|
_inherit = "res.company"
|
||||||
|
@ -50,13 +50,6 @@ class ResCompany(osv.osv):
|
||||||
'html_id',
|
'html_id',
|
||||||
'Available html',
|
'Available html',
|
||||||
),
|
),
|
||||||
'lib_path' : fields.char('Webkit Executable Path', size=264,
|
|
||||||
help="Full path to the wkhtmltopdf executable file. "
|
|
||||||
"Version 0.9.9 is required. Install a static version "
|
|
||||||
"of the library if you experience missing header/footers "
|
|
||||||
"on Linux."),
|
|
||||||
|
|
||||||
}
|
}
|
||||||
ResCompany()
|
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<notebook position="inside">
|
<notebook position="inside">
|
||||||
<page string="Webkit">
|
<page string="Webkit">
|
||||||
<field name="lib_path" colspan="4"/>
|
|
||||||
<separator string="Images" colspan="4"/>
|
<separator string="Images" colspan="4"/>
|
||||||
<field name="header_image" colspan="4" nolabel="1"/>
|
<field name="header_image" colspan="4" nolabel="1"/>
|
||||||
<separator string="Headers" colspan="4"/>
|
<separator string="Headers" colspan="4"/>
|
||||||
|
|
|
@ -106,7 +106,6 @@ class WebKitParser(report_sxw):
|
||||||
webkit_header = report_xml.webkit_header
|
webkit_header = report_xml.webkit_header
|
||||||
tmp_dir = tempfile.gettempdir()
|
tmp_dir = tempfile.gettempdir()
|
||||||
out_filename = tempfile.mktemp(suffix=".pdf", prefix="webkit.tmp.")
|
out_filename = tempfile.mktemp(suffix=".pdf", prefix="webkit.tmp.")
|
||||||
files = []
|
|
||||||
file_to_del = [out_filename]
|
file_to_del = [out_filename]
|
||||||
if comm_path:
|
if comm_path:
|
||||||
command = [comm_path]
|
command = [comm_path]
|
||||||
|
@ -220,7 +219,7 @@ class WebKitParser(report_sxw):
|
||||||
template = False
|
template = False
|
||||||
|
|
||||||
if report_xml.report_file :
|
if report_xml.report_file :
|
||||||
path = addons.get_module_resource(report_xml.report_file)
|
path = addons.get_module_resource(*report_xml.report_file.split(os.path.sep))
|
||||||
if os.path.exists(path) :
|
if os.path.exists(path) :
|
||||||
template = file(path).read()
|
template = file(path).read()
|
||||||
if not template and report_xml.report_webkit_data :
|
if not template and report_xml.report_webkit_data :
|
||||||
|
@ -242,8 +241,6 @@ class WebKitParser(report_sxw):
|
||||||
css = report_xml.webkit_header.css
|
css = report_xml.webkit_header.css
|
||||||
if not css :
|
if not css :
|
||||||
css = ''
|
css = ''
|
||||||
user = self.pool.get('res.users').browse(cursor, uid, uid)
|
|
||||||
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 = mako_template(template)
|
body_mako_tpl = mako_template(template)
|
||||||
|
@ -257,7 +254,7 @@ class WebKitParser(report_sxw):
|
||||||
_=self.translate_call,
|
_=self.translate_call,
|
||||||
**self.parser_instance.localcontext)
|
**self.parser_instance.localcontext)
|
||||||
htmls.append(html)
|
htmls.append(html)
|
||||||
except Exception, e:
|
except Exception:
|
||||||
msg = exceptions.text_error_template().render()
|
msg = exceptions.text_error_template().render()
|
||||||
_logger.error(msg)
|
_logger.error(msg)
|
||||||
raise except_osv(_('Webkit render!'), msg)
|
raise except_osv(_('Webkit render!'), msg)
|
||||||
|
@ -268,7 +265,7 @@ class WebKitParser(report_sxw):
|
||||||
_=self.translate_call,
|
_=self.translate_call,
|
||||||
**self.parser_instance.localcontext)
|
**self.parser_instance.localcontext)
|
||||||
htmls.append(html)
|
htmls.append(html)
|
||||||
except Exception, e:
|
except Exception:
|
||||||
msg = exceptions.text_error_template().render()
|
msg = exceptions.text_error_template().render()
|
||||||
_logger.error(msg)
|
_logger.error(msg)
|
||||||
raise except_osv(_('Webkit render!'), msg)
|
raise except_osv(_('Webkit render!'), msg)
|
||||||
|
@ -279,7 +276,7 @@ class WebKitParser(report_sxw):
|
||||||
_=self.translate_call,
|
_=self.translate_call,
|
||||||
_debug=False,
|
_debug=False,
|
||||||
**self.parser_instance.localcontext)
|
**self.parser_instance.localcontext)
|
||||||
except Exception, e:
|
except Exception:
|
||||||
raise except_osv(_('Webkit render!'),
|
raise except_osv(_('Webkit render!'),
|
||||||
exceptions.text_error_template().render())
|
exceptions.text_error_template().render())
|
||||||
foot = False
|
foot = False
|
||||||
|
@ -301,7 +298,7 @@ class WebKitParser(report_sxw):
|
||||||
_debug=tools.ustr("\n".join(htmls)),
|
_debug=tools.ustr("\n".join(htmls)),
|
||||||
_=self.translate_call,
|
_=self.translate_call,
|
||||||
**self.parser_instance.localcontext)
|
**self.parser_instance.localcontext)
|
||||||
except Exception, e:
|
except Exception:
|
||||||
msg = exceptions.text_error_template().render()
|
msg = exceptions.text_error_template().render()
|
||||||
_logger.error(msg)
|
_logger.error(msg)
|
||||||
raise except_osv(_('Webkit render!'), msg)
|
raise except_osv(_('Webkit render!'), msg)
|
||||||
|
@ -327,8 +324,8 @@ class WebKitParser(report_sxw):
|
||||||
report_xml.report_rml = None
|
report_xml.report_rml = None
|
||||||
report_xml.report_rml_content = None
|
report_xml.report_rml_content = None
|
||||||
report_xml.report_sxw_content_data = None
|
report_xml.report_sxw_content_data = None
|
||||||
report_rml.report_sxw_content = None
|
report_xml.report_sxw_content = None
|
||||||
report_rml.report_sxw = None
|
report_xml.report_sxw = None
|
||||||
else:
|
else:
|
||||||
return super(WebKitParser, self).create(cursor, uid, ids, data, context)
|
return super(WebKitParser, self).create(cursor, uid, ids, data, context)
|
||||||
if report_xml.report_type != 'webkit' :
|
if report_xml.report_type != 'webkit' :
|
||||||
|
|
|
@ -28,8 +28,9 @@
|
||||||
<field name="auto_delete" eval="True"/>
|
<field name="auto_delete" eval="True"/>
|
||||||
<field name="report_template" ref="report_sale_order"/>
|
<field name="report_template" ref="report_sale_order"/>
|
||||||
<field name="report_name">${(object.name or '').replace('/','_')}_${object.state == 'draft' and 'draft' or ''}</field>
|
<field name="report_name">${(object.name or '').replace('/','_')}_${object.state == 'draft' and 'draft' or ''}</field>
|
||||||
|
<field name="lang">${object.partner_id.lang}</field>
|
||||||
<field name="body_html"><![CDATA[
|
<field name="body_html"><![CDATA[
|
||||||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: rgb(255, 255, 255); ">
|
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; ">
|
||||||
|
|
||||||
<p>Hello${object.partner_id.name and ' ' or ''}${object.partner_id.name or ''},</p>
|
<p>Hello${object.partner_id.name and ' ' or ''}${object.partner_id.name or ''},</p>
|
||||||
|
|
||||||
|
@ -76,7 +77,7 @@
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
<div style="width: 375px; margin: 0px; padding: 0px; background-color: #8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; background-repeat: repeat no-repeat;">
|
<div style="width: 375px; margin: 0px; padding: 0px; background-color: #8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; background-repeat: repeat no-repeat;">
|
||||||
<h3 style="margin: 0px; padding: 2px 14px; font-size: 12px; color: #FFF;">
|
<h3 style="margin: 0px; padding: 2px 14px; font-size: 12px; color: #DDD;">
|
||||||
<strong style="text-transform:uppercase;">${object.company_id.name}</strong></h3>
|
<strong style="text-transform:uppercase;">${object.company_id.name}</strong></h3>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;">
|
<div style="width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;">
|
||||||
|
|
|
@ -224,6 +224,8 @@ class share_wizard(osv.TransientModel):
|
||||||
for the password field, so they can receive it by email.
|
for the password field, so they can receive it by email.
|
||||||
Returns the ids of the created users, and the ids of the
|
Returns the ids of the created users, and the ids of the
|
||||||
ignored, existing ones."""
|
ignored, existing ones."""
|
||||||
|
if context is None:
|
||||||
|
context = {}
|
||||||
user_obj = self.pool.get('res.users')
|
user_obj = self.pool.get('res.users')
|
||||||
current_user = user_obj.browse(cr, UID_ROOT, uid, context=context)
|
current_user = user_obj.browse(cr, UID_ROOT, uid, context=context)
|
||||||
# modify context to disable shortcuts when creating share users
|
# modify context to disable shortcuts when creating share users
|
||||||
|
@ -257,7 +259,8 @@ class share_wizard(osv.TransientModel):
|
||||||
'email': new_user,
|
'email': new_user,
|
||||||
'groups_id': [(6,0,[group_id])],
|
'groups_id': [(6,0,[group_id])],
|
||||||
'share': True,
|
'share': True,
|
||||||
'company_id': current_user.company_id.id
|
'company_id': current_user.company_id.id,
|
||||||
|
'company_ids': [(6, 0, [current_user.company_id.id])],
|
||||||
}, context)
|
}, context)
|
||||||
new_line = { 'user_id': user_id,
|
new_line = { 'user_id': user_id,
|
||||||
'password': new_pass,
|
'password': new_pass,
|
||||||
|
@ -274,7 +277,8 @@ class share_wizard(osv.TransientModel):
|
||||||
'name': new_login,
|
'name': new_login,
|
||||||
'groups_id': [(6,0,[group_id])],
|
'groups_id': [(6,0,[group_id])],
|
||||||
'share': True,
|
'share': True,
|
||||||
'company_id': current_user.company_id.id
|
'company_id': current_user.company_id.id,
|
||||||
|
'company_ids': [(6, 0, [current_user.company_id.id])],
|
||||||
}, context)
|
}, context)
|
||||||
new_line = { 'user_id': user_id,
|
new_line = { 'user_id': user_id,
|
||||||
'password': new_pass,
|
'password': new_pass,
|
||||||
|
|
|
@ -1144,6 +1144,9 @@ class stock_picking(osv.osv):
|
||||||
for move_line in picking.move_lines:
|
for move_line in picking.move_lines:
|
||||||
if move_line.state == 'cancel':
|
if move_line.state == 'cancel':
|
||||||
continue
|
continue
|
||||||
|
if move_line.scrapped:
|
||||||
|
# do no invoice scrapped products
|
||||||
|
continue
|
||||||
vals = self._prepare_invoice_line(cr, uid, group, picking, move_line,
|
vals = self._prepare_invoice_line(cr, uid, group, picking, move_line,
|
||||||
invoice_id, invoice_vals, context=context)
|
invoice_id, invoice_vals, context=context)
|
||||||
if vals:
|
if vals:
|
||||||
|
@ -2873,7 +2876,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, prodlot_id=line.prod_lot_id.id)
|
product_context.update(uom=line.product_uom.id, to_date=inv.date, 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
|
||||||
lot_id = line.prod_lot_id.id
|
lot_id = line.prod_lot_id.id
|
||||||
|
|
|
@ -804,7 +804,7 @@
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search string="Internal Picking List">
|
<search string="Internal Picking List">
|
||||||
<field name="name" string="Internal Picking List" filter_domain="['|',('name','ilike', self),('origin','ilike',self)]"/>
|
<field name="name" string="Internal Picking List" filter_domain="['|',('name','ilike', self),('origin','ilike',self)]"/>
|
||||||
<filter icon="terp-check" string="Ready" domain="[('state','=','assigned')]" help="Assigned Internal Moves"/>
|
<filter icon="terp-check" name="available" string="Ready" domain="[('state','=','assigned')]" help="Assigned Internal Moves"/>
|
||||||
<filter icon="terp-camera_test" name="confirmed" string="Waiting" domain="[('state','=','confirmed')]" help="Confirmed Internal Moves"/>
|
<filter icon="terp-camera_test" name="confirmed" string="Waiting" domain="[('state','=','confirmed')]" help="Confirmed Internal Moves"/>
|
||||||
<filter icon="terp-dialog-close" name="done" string="Done" domain="[('state','=','done')]" help="Pickings already processed"/>
|
<filter icon="terp-dialog-close" name="done" string="Done" domain="[('state','=','done')]" help="Pickings already processed"/>
|
||||||
<field name="partner_id"/>
|
<field name="partner_id"/>
|
||||||
|
|
|
@ -136,15 +136,15 @@ class stock_partial_picking(osv.osv_memory):
|
||||||
# Currently, the cost on the product form is supposed to be expressed in the currency
|
# Currently, the cost on the product form is supposed to be expressed in the currency
|
||||||
# of the company owning the product. If not set, we fall back to the picking's company,
|
# of the company owning the product. If not set, we fall back to the picking's company,
|
||||||
# which should work in simple cases.
|
# which should work in simple cases.
|
||||||
|
product_currency_id = move.product_id.company_id.currency_id and move.product_id.company_id.currency_id.id
|
||||||
|
picking_currency_id = move.picking_id.company_id.currency_id and move.picking_id.company_id.currency_id.id
|
||||||
return {'cost': move.product_id.standard_price,
|
return {'cost': move.product_id.standard_price,
|
||||||
'currency': move.product_id.company_id.currency_id.id \
|
'currency': product_currency_id or picking_currency_id or False}
|
||||||
or move.picking_id.company_id.currency_id.id \
|
|
||||||
or False}
|
|
||||||
|
|
||||||
def _partial_move_for(self, cr, uid, move):
|
def _partial_move_for(self, cr, uid, move):
|
||||||
partial_move = {
|
partial_move = {
|
||||||
'product_id' : move.product_id.id,
|
'product_id' : move.product_id.id,
|
||||||
'quantity' : move.state in ('assigned','draft','confirmed') and move.product_qty or 0,
|
'quantity' : move.product_qty if move.state in ('assigned','draft','confirmed') else 0,
|
||||||
'product_uom' : move.product_uom.id,
|
'product_uom' : move.product_uom.id,
|
||||||
'prodlot_id' : move.prodlot_id.id,
|
'prodlot_id' : move.prodlot_id.id,
|
||||||
'move_id' : move.id,
|
'move_id' : move.id,
|
||||||
|
|
Loading…
Reference in New Issue