[MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9475 rev-id: dle@openerp.com-20130923162428-g0s3o9tid09ogfv3

bzr revid: dle@openerp.com-20130923165651-0jt823r5wy37enw6
This commit is contained in:
Denis Ledoux 2013-09-23 18:56:51 +02:00
commit 274cf1e293
11 changed files with 37 additions and 28 deletions

View File

@ -349,6 +349,7 @@
<page string="Invoice Lines">
<field name="invoice_line" nolabel="1" widget="one2many_list" context="{'type': type}">
<tree string="Invoice Lines" editable="bottom">
<field name="sequence" widget="handle"/>
<field name="product_id"
on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
<field name="name"/>

View File

@ -15,7 +15,7 @@
<newline/>
</xpath>
<xpath expr="//field[@name='filter']" position="replace">
<field name="filter" on_change="onchange_filter(filter, fiscalyear_id)" colspan="4"/>
<field name="filter" on_change="onchange_filter(filter, fiscalyear_id)"/>
<field name="initial_balance" attrs="{'readonly':[('filter', 'in', ('filter_no', 'unreconciled'))]}" />
</xpath>
</data>

View File

@ -9,7 +9,7 @@
<field name="arch" type="xml">
<xpath expr="//field[@name='workcenter_lines']/form//field[@name='name']" position="before">
<header colspan="8">
<button name="button_start_working" string="Start" states="draft" icon="terp-gtk-jump-to-ltr" help="Start Working"/>
<button name="button_start_working" string="Start" states="draft" icon="gtk-media-play" help="Start Working"/>
<button name="button_cancel" string="Cancel Order" states="draft,startworking" icon="gtk-stop" help="Cancel Order"/>
<button name="button_draft" string="Set Draft" states="cancel" icon="gtk-convert" help="Set to Draft"/>
<button name="button_resume" string="Resume" states="pause" icon="gtk-media-pause" help="Resume Work Order"/>
@ -29,7 +29,7 @@
<xpath expr="//field[@name='workcenter_lines']/tree/field[@name='hour']" position="after">
<field name="state"/>
<button name="button_draft" string="Set Draft" states="cancel" icon="gtk-convert"/>
<button name="button_start_working" string="Start" states="draft" icon="terp-gtk-jump-to-ltr"/>
<button name="button_start_working" string="Start" states="draft" icon="gtk-media-play"/>
<button name="button_resume" string="Resume" states="pause" icon="gtk-media-pause"/>
<button name="button_pause" string="Pending" states="startworking" icon="gtk-media-pause"/>
<button name="button_done" string="Finished" states="startworking" icon="terp-check"/>

View File

@ -171,9 +171,7 @@ class product_pricelist(osv.osv):
if context is None:
context = {}
date = time.strftime('%Y-%m-%d')
if 'date' in context:
date = context['date']
date = context.get('date') or time.strftime('%Y-%m-%d')
currency_obj = self.pool.get('res.currency')
product_obj = self.pool.get('product.product')

View File

@ -127,7 +127,7 @@
<notebook>
<page string="Team" name="team">
<field colspan="4" name="members" widget="many2many_kanban">
<kanban quick_create="false" create="true">
<kanban quick_create="false" create="true" delete="true">
<field name="name"/>
<templates>
<t t-name="kanban-box">

View File

@ -68,6 +68,7 @@ class sale_order(osv.osv):
if not default:
default = {}
default.update({
'date_order': fields.date.context_today(self, cr, uid, context=context),
'state': 'draft',
'invoice_ids': [],
'date_confirm': False,

View File

@ -28,7 +28,7 @@ class sale_order(osv.osv):
_columns = {
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
'categ_ids': fields.many2many('crm.case.categ', 'sale_order_category_rel', 'order_id', 'category_id', 'Categories', \
domain="['|',('section_id','=',section_id),('section_id','=',False), ('object_id.model', '=', 'crm.lead')]")
domain="['|',('section_id','=',section_id),('section_id','=',False), ('object_id.model', '=', 'crm.lead')]", context="{'object_name': 'crm.lead'}")
}
def _prepare_invoice(self, cr, uid, order, lines, context=None):

View File

@ -397,7 +397,16 @@ class stock_location(osv.osv):
uom_rounding = self.pool.get('product.product').browse(cr, uid, product_id, context=context).uom_id.rounding
if context.get('uom'):
uom_rounding = uom_obj.browse(cr, uid, context.get('uom'), context=context).rounding
for id in self.search(cr, uid, [('location_id', 'child_of', ids)]):
locations_ids = self.search(cr, uid, [('location_id', 'child_of', ids)])
# Fetch only the locations in which this product has ever been processed (in or out)
cr.execute("""SELECT l.id FROM stock_location l WHERE l.id in %s AND
EXISTS (SELECT 1 FROM stock_move m WHERE m.product_id = %s
AND ((state = 'done' AND m.location_dest_id = l.id)
OR (state in ('done','assigned') AND m.location_id = l.id)))
""", (tuple(locations_ids), product_id,))
for id in [i for (i,) in cr.fetchall()]:
if lock:
try:
# Must lock with a separate select query because FOR UPDATE can't be used with

View File

@ -759,7 +759,7 @@
<header>
<button name="draft_force_assign" states="draft" string="Confirm" type="object" class="oe_highlight" groups="base.group_user"/>
<button name="draft_validate" states="draft" string="Confirm &amp; Transfer" type="object" class="oe_highlight" groups="base.group_user"/>
<!-- <button name="action_assign" states="confirmed" string="Check Availability" type="object"/> -->
<button name="action_assign" states="confirmed" string="Check Availability" type="object" class="oe_highlight"/>
<button name="force_assign" states="confirmed" string="Force Availability" type="object" class="oe_highlight" groups="base.group_user"/>
<button name="action_process" states="assigned" string="Confirm &amp; Transfer" groups="stock.group_stock_user" type="object" class="oe_highlight"/>
<button name="%(action_stock_invoice_onshipping)d" string="Create Invoice/Refund" attrs="{'invisible': ['|','|',('state','&lt;&gt;','done'),('invoice_state','=','invoiced'),('invoice_state','=','none')]}" type="action" class="oe_highlight" groups="base.group_user"/>
@ -909,7 +909,6 @@
</xpath>
<xpath expr="/form/header//button[@name='draft_validate']" position="replace">
<button name="draft_validate" states="draft" string="Confirm &amp; Deliver" type="object" class="oe_highlight"/>
<button name="action_assign" states="confirmed" string="Check Availability" type="object" class="oe_highlight"/>
</xpath>
<xpath expr="/form/header//button[@name='action_process']" position="replace">
<button name="action_process" states="assigned" string="Deliver" type="object" class="oe_highlight"/>

View File

@ -27,6 +27,7 @@ from openerp import tools
from openerp.report import report_sxw
from openerp.report.interface import report_rml
from openerp.tools import to_xml
from openerp.tools.translate import _
class survey_browse_response(report_rml):
def create(self, cr, uid, ids, datas, context):
@ -69,7 +70,7 @@ class survey_browse_response(report_rml):
rml +="""
<fill color="gray"/>
<setFont name="Helvetica" size="10"/>
<drawRightString x='"""+tools.ustr(float(_pageSize[0].replace('cm','')) - float(1.00))+'cm'+"""' y="0.6cm">Page : <pageNumber/> </drawRightString>"""
<drawRightString x='"""+tools.ustr(float(_pageSize[0].replace('cm','')) - float(1.00))+'cm'+"""' y="0.6cm">"""+_('Page : ')+"""<pageNumber/> </drawRightString>"""
rml +="""</pageGraphics>
</pageTemplate>
</template>
@ -209,29 +210,29 @@ class survey_browse_response(report_rml):
resp_create = tools.ustr(time.strftime('%d-%m-%Y %I:%M:%S %p', time.strptime(response.date_create.split('.')[0], '%Y-%m-%d %H:%M:%S')))
rml += """<blockTable colWidths='""" + colwidth + """' style="Table_heading">
<tr>
<td><para style="terp_default_9_Bold">Print Date : </para></td>
<td><para style="terp_default_9_Bold">""" + _('Print Date : ') + """</para></td>
<td><para style="terp_default_9">""" + to_xml(rml_obj.formatLang(time.strftime("%Y-%m-%d %H:%M:%S"),date_time=True)) + """</para></td>
<td><para style="terp_default_9"></para></td>
<td><para style="terp_default_9_Bold">Answered by : </para></td>
<td><para style="terp_default_9_Bold">""" +_('Answered by : ') + """</para></td>
<td><para style="terp_default_9">""" + to_xml(response.user_id.login or '') + """</para></td>
</tr>
<tr>
<td><para style="terp_default_9"></para></td>
<td><para style="terp_default_9"></para></td>
<td><para style="terp_default_9"></para></td>
<td><para style="terp_default_9_Bold">Answer Date : </para></td>
<td><para style="terp_default_9_Bold">""" +_('Answer Date : ') + """</para></td>
<td><para style="terp_default_9">""" + to_xml(resp_create) + """</para></td>
</tr>
</blockTable><para style="P2"></para>"""
status = "Not Finished"
if response.state == "done": status = "Finished"
status = _("Not Finished")
if response.state == "done": status = _("Finished")
colwidth = str(tbl_width - 7) + "cm,"
colwidth += "7cm"
rml += """<blockTable colWidths='""" + str(colwidth) + """' style="title_tbl">
<tr>
<td><para style="title">""" + to_xml(tools.ustr(survey.title)) + """</para><para style="P2"><font></font></para></td>
<td><para style="descriptive_text_heading">Status :- """ + to_xml(tools.ustr(status)) + """</para><para style="P2"><font></font></para></td>
<td><para style="descriptive_text_heading">"""+_('Status :- ')+ to_xml(tools.ustr(status)) + """</para><para style="P2"><font></font></para></td>
</tr>
</blockTable>"""
@ -242,7 +243,7 @@ class survey_browse_response(report_rml):
for page in survey.page_ids:
rml += """<blockTable colWidths='""" + str(_tbl_widths) + """' style="page_tbl">
<tr><td><para style="page">Page :- """ + to_xml(tools.ustr(page.title or '')) + """</para></td></tr>
<tr><td><para style="page">"""+_('Page :- ') + to_xml(tools.ustr(page.title or '')) + """</para></td></tr>
</blockTable>"""
if page.note:
rml += """<para style="P2"></para>
@ -302,7 +303,7 @@ class survey_browse_response(report_rml):
else:
rml +="""<blockTable colWidths='""" + str(_tbl_widths) + """' style="simple_table">
<tr><td> <para style="response">No Answer</para></td> </tr>
<tr><td> <para style="response">"""+ _('No Answer') + """</para></td> </tr>
</blockTable>"""
elif que.type in ['multiple_choice_only_one_ans','multiple_choice_multiple_ans']:

View File

@ -173,8 +173,8 @@ class survey_question_wiz(osv.osv_memory):
# TODO: l10n, cleanup this code to make it readable. Or template?
xml_group = etree.SubElement(xml_form, 'group', {'col': '40', 'colspan': '4'})
record = sur_response_obj.browse(cr, uid, context['response_id'][context['response_no']])
etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr('Answer Of :- ' + record.user_id.name + ', Date :- ' + record.date_create.split('.')[0] )), 'align':"0.0"})
etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr(" Answer :- " + str(context.get('response_no',0) + 1) +"/" + str(len(context.get('response_id',0))) )), 'align':"0.0"})
etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr(_('Answer Of :- ') + record.user_id.name + _(', Date :- ') + record.date_create.split('.')[0] )), 'align':"0.0"})
etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr(_(" Answer :- ") + str(context.get('response_no',0) + 1) +"/" + str(len(context.get('response_id',0))) )), 'align':"0.0"})
if context.get('response_no',0) > 0:
etree.SubElement(xml_group, 'button', {'colspan':"1",'icon':"gtk-go-back",'name':"action_forward_previous",'string': tools.ustr("Previous Answer"),'type':"object"})
if context.get('response_no',0) + 1 < len(context.get('response_id',0)):
@ -221,7 +221,7 @@ class survey_question_wiz(osv.osv_memory):
selection.append((tools.ustr(ans.id), ans.answer))
xml_group = etree.SubElement(xml_group, 'group', {'col': '2', 'colspan': '2'})
etree.SubElement(xml_group, 'field', {'readonly':str(readonly), 'name': tools.ustr(que.id) + "_selection"})
fields[tools.ustr(que.id) + "_selection"] = {'type':'selection', 'selection' :selection, 'string':"Answer"}
fields[tools.ustr(que.id) + "_selection"] = {'type':'selection', 'selection' :selection, 'string':_('Answer')}
elif que_rec.type == 'multiple_choice_multiple_ans':
xml_group = etree.SubElement(xml_group, 'group', {'col': '4', 'colspan': '4'})
@ -374,10 +374,10 @@ class survey_question_wiz(osv.osv_memory):
if pre_button:
etree.SubElement(xml_footer, 'label', {'string': ""})
etree.SubElement(xml_footer, 'button', {'name':"action_previous",'string':"Previous",'type':"object"})
but_string = "Next"
etree.SubElement(xml_footer, 'button', {'name':"action_previous",'string':_('Previous'),'type':"object"})
but_string = _('Next')
if int(page_number) + 1 == total_pages:
but_string = "Done"
but_string = _('Done')
if context.has_key('active') and context.get('active',False) and int(page_number) + 1 == total_pages and context.has_key('response_id') and context.has_key('response_no') and context.get('response_no',0) + 1 == len(context.get('response_id',0)):
etree.SubElement(xml_footer, 'label', {'string': ""})
etree.SubElement(xml_footer, 'button', {'special' : 'cancel','string': tools.ustr("Done") ,'context' : tools.ustr(context), 'class':"oe_highlight"})
@ -390,8 +390,8 @@ class survey_question_wiz(osv.osv_memory):
else:
etree.SubElement(xml_footer, 'label', {'string': ""})
etree.SubElement(xml_footer, 'button', {'name':"action_next",'string': tools.ustr(but_string) ,'type':"object",'context' : tools.ustr(context), 'class':"oe_highlight"})
etree.SubElement(xml_footer, 'label', {'string': "or"})
etree.SubElement(xml_footer, 'button', {'special': "cancel",'string':"Exit",'class':"oe_link"})
etree.SubElement(xml_footer, 'label', {'string': _('or')})
etree.SubElement(xml_footer, 'button', {'special': "cancel",'string':_('Exit'),'class':"oe_link"})
etree.SubElement(xml_footer, 'label', {'string': tools.ustr(page_number+ 1) + "/" + tools.ustr(total_pages), 'class':"oe_survey_title_page oe_right"})
root = xml_form.getroottree()