[MERGE] merged with trunk

bzr revid: qdp-launchpad@openerp.com-20120702163830-bp1ekxuzuf9uox01
This commit is contained in:
Quentin (OpenERP) 2012-07-02 18:38:30 +02:00
commit b2a1eeecbe
27 changed files with 342 additions and 280 deletions

View File

@ -157,33 +157,39 @@
<field name="state" widget="statusbar" statusbar_visible="draft,open,paid" statusbar_colors='{"proforma":"blue","proforma2":"blue"}'/>
</header>
<sheet string="Supplier Invoice">
<group>
<group>
<field string="Supplier" name="partner_id"
<div class="oe_title">
<h1>
<label string="Draft Invoice" attrs="{'invisible': [('state', '&lt;&gt;', 'draft')]}"/>
<label for="number" class="oe_edit_only" attrs="{'invisible': [('state', '=', 'draft')]}"/>
<field name="number" class="oe_inline" attrs="{'invisible': [('state', '=', 'draft')]}"/>
</h1>
<h2>
<label for="origin" string="Concerns" class="oe_inline"/>
<field name="origin" placeholder="PO0025" class="oe_inline"/>
<label string=" from " attrs="{'invisible': [('origin', '=', False)]}" class='oe_inline'/>
<field string="Supplier" name="partner_id" class="oe_inline"
on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)"
context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}"
domain="[('supplier', '=', True)]"/>
<field name="fiscal_position" widget="selection"/>
</h2>
</div>
<group>
<group>
<field name="date_invoice"/>
<field name="date_due"/>
<field name="type" invisible="1"/>
<field name="period_id" domain="[('state', '=', 'draft')]" groups="account.group_account_user" widget="selection"/>
</group>
<group>
<field name="number"/>
<field name="date_invoice"/>
<field name="period_id" domain="[('state', '=', 'draft')]"
groups="account.group_account_user" widget="selection"/>
<field name="journal_id" on_change="onchange_journal_id(journal_id)" widget="selection"
groups="account.group_account_user"/>
<field domain="[('company_id', '=', company_id), ('type', '=', 'payable')]"
name="account_id" groups="account.group_account_user"/>
<field name="fiscal_position" widget="selection"/>
<field name="currency_id"/>
<field name="type" invisible="1"/>
<field domain="[('company_id', '=', company_id), ('type', '=', 'payable')]" name="account_id" groups="account.group_account_user" invisible="1"/>
</group>
<group>
<label for="reference"/>
<div>
<field name="reference_type"/>
<field name="reference" placeholder="Payment Reference"/>
</div>
<field name="date_due"/>
</group>
</group>
<notebook>
@ -196,10 +202,11 @@
<field domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
<field name="quantity"/>
<field name="price_unit"/>
<!-- Removed if subtotal is set -->
<field name="price_subtotal"/>
<field invisible="True" name="name"/>
<field invisible="True" name="uos_id"/>
<field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '&lt;&gt;', 'view')]" name="account_id" on_change="onchange_account_id(product_id,parent.partner_id,parent.type,parent.fiscal_position,account_id)" invisible="1"/>
<!-- Removed if subtotal is set -->
<field name="name" invisible="1"/>
<field name="uos_id" invisible="1"/>
</tree>
</field>
<group>
@ -232,16 +239,17 @@
<field name="comment"/>
</page>
<page string="Other Info">
<group col="4">
<group>
<group>
<field domain="[('partner_id', '=', partner_id)]" name="partner_bank_id" on_change="onchange_partner_bank(partner_bank_id)"/>
<field name="company_id" on_change="onchange_company_id(company_id,partner_id,type,invoice_line,currency_id)" widget="selection" groups="base.group_multi_company"/>
<newline/>
<field name="payment_term" widget="selection"/>
<field name="name"/>
<newline/>
<field name="origin" placeholder="PO0025"/>
</group>
<group>
<field name="user_id"/>
<field name="name" invisible="1"/>
<field name="move_id" groups="account.group_account_user"/>
<field name="company_id" on_change="onchange_company_id(company_id,partner_id,type,invoice_line,currency_id)" widget="selection" groups="base.group_multi_company"/>
</group>
</group>
</page>
<page string="Payments">

View File

@ -34,12 +34,11 @@
<field name="type">form</field>
<field name="inherit_id" ref="product.product_category_form_view"/>
<field name="arch" type="xml">
<form position="inside">
<group>
<separator string="Accounting Property" colspan="2"/>
<data>
<xpath expr="/form/sheet//group[@name='account_property']" position="inside">
<field name="property_account_creditor_price_difference_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
</group>
</form>
</xpath>
</data>
</field>
</record>

View File

@ -172,9 +172,9 @@
</page>
</notebook>
</sheet>
<div class="oe_bottom">
<footer>
<field name="message_ids" widget="ThreadView"/>
</div>
</footer>
</form>
</field>
</record>

View File

@ -151,7 +151,7 @@ openerp_mailgate.py -u %(uid)d -p PASSWORD -o %(model)s -d %(dbname)s --host=HOS
connection = server.connect()
server.write({'state':'done'})
except Exception, e:
logger.exception("Failed to connect to %s server %s", server.type, server.name)
_logger.exception("Failed to connect to %s server %s", server.type, server.name)
raise osv.except_osv(_("Connection test failed!"), _("Here is what we got instead:\n %s") % tools.ustr(e))
finally:
try:
@ -177,7 +177,7 @@ openerp_mailgate.py -u %(uid)d -p PASSWORD -o %(model)s -d %(dbname)s --host=HOS
mail_thread = self.pool.get('mail.thread')
action_pool = self.pool.get('ir.actions.server')
for server in self.browse(cr, uid, ids, context=context):
logger.info('start checking for new emails on %s server %s', server.type, server.name)
_logger.info('start checking for new emails on %s server %s', server.type, server.name)
context.update({'fetchmail_server_id': server.id, 'server_type': server.type})
count = 0
imap_server = False
@ -198,9 +198,9 @@ openerp_mailgate.py -u %(uid)d -p PASSWORD -o %(model)s -d %(dbname)s --host=HOS
imap_server.store(num, '+FLAGS', '\\Seen')
cr.commit()
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:
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:
if imap_server:
imap_server.close()
@ -222,9 +222,9 @@ openerp_mailgate.py -u %(uid)d -p PASSWORD -o %(model)s -d %(dbname)s --host=HOS
action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids':[res_id]})
pop_server.dele(num)
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:
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:
if pop_server:
pop_server.quit()

View File

@ -86,6 +86,7 @@ The main features are:
'static/src/css/mail_group.css',
],
'js': [
'static/src/js/jquery.expander.min.js',
'static/src/js/mail.js',
],
'qweb': [

View File

@ -51,28 +51,30 @@
<field name="priority" eval="10"/>
<field name="arch" type="xml">
<form string="Group Form" version="7.0">
<div style="padding: 8px">
<div class="oe_right">
<field name="photo" widget='image' on_change="onchange_photo(photo)"/>
</div>
<div class="oe_title">
<div class="oe_edit_only">
<label for="name"/>
</div>
<h1><field name="name"/></h1>
<div class="oe_edit_only">
<label for="responsible_id"/>
</div>
<field name="responsible_id" class="oe_inline"/>
<div class="oe_edit_only">
<label for="public"/>
<field name="public" class="oe_inline"/>
</div>
<field name="description" colspan="4" nolabel="1"/>
</div>
</div>
<footer>
<field name="message_ids" colspan="4" widget="ThreadView" options='{"thread_level": 1}'/>
<sheet class="openerp_mail_group_sheet">
<group colspan="4" col="8">
<group colspan="1" col="2">
<field name="photo" widget='image' nolabel="1" on_change="onchange_photo(photo)"/>
</group>
<group colspan="7" col="6">
<div class="oe_edit_only">
<label for="name"/>
</div>
<h2><field name="name" colspan="4"/></h2>
<newline/>
<group colspan="4" col="4">
<field name="description" colspan="4" nolabel="1"/>
</group>
<group colspan="2" col="2" class="oe_edit_only">
<field name="responsible_id" colspan="2"/>
<field name="public" colspan="2"/>
</group>
</group>
</group>
</sheet>
<footer class="openerp_mail_group_footer">
<field name="message_ids" widget="ThreadView"
options='{"thread_level": 1}'/>
</footer>
</form>
</field>

View File

@ -96,11 +96,24 @@ class mail_message_common(osv.osv_memory):
continue
result[message.id] = self.pool.get(message.model).name_get(cr, uid, [message.res_id], context=context)[0][1]
return result
def name_get(self, cr, uid, ids, context=None):
res = []
for message in self.browse(cr, uid, ids, context=context):
name = ''
if message.subject:
name = '%s: ' % (message.subject)
if message.body_text:
name = '%s%s ' % (name, message.body_text[0:20])
if message.date:
name = '%s(%s)' % (name, message.date)
res.append((message.id, name))
return res
_name = 'mail.message.common'
_rec_name = 'subject'
_columns = {
'subject': fields.char('Subject', size=512, required=True),
'subject': fields.char('Subject', size=512),
'model': fields.char('Related Document Model', size=128, select=1),
'res_id': fields.integer('Related Document ID', select=1),
'record_name': fields.function(get_record_name, type='string', string='Message Record Name',

View File

@ -746,13 +746,8 @@ class mail_thread(osv.osv):
self.message_append_note(cr, uid, [id], 'res.log', message, context=context)
def message_append_note(self, cr, uid, ids, subject=None, body=None, parent_id=False, type='notification', subtype='html', context=None):
if subject is None:
if type == 'notification':
subject = _('System notification')
elif type == 'comment' and not parent_id:
subject = _('Comment')
elif type == 'comment' and parent_id:
subject = _('Reply')
if type in ['notification', 'reply']:
subject = None
if subtype == 'html':
body_html = body
body_text = body

View File

@ -314,8 +314,8 @@
text-align: justify;
}
.openerp .oe_mail_msg_tail {
display: none;
.openerp .oe_mail_msg_body span.oe_mail_msg_tail {
display: inline;
}
/* Read more/less link */

View File

@ -1,3 +1,40 @@
/* ------------------------------ */
/* Group Form */
/* ------------------------------ */
/* Resize sheet width */
.openerp .oe_form_sheetbg.openerp_mail_group_sheet {
min-height: 0px;
max-height: none;
}
.openerp .oe_form_sheetbg.openerp_mail_group_sheet .oe_form_sheet {
min-height: 0px;
max-height: none;
padding: 0px 18px;
max-width: 80%;
}
/* Resize footer width */
.openerp .oe_form footer.openerp_mail_group_footer {
max-width: 80%;
}
/* Resize group logo */
.openerp .oe_form_sheetbg.openerp_mail_group_sheet .oe_form_field_image > img {
max-width: 100px;
max-height: 100px;
}
/* Resize group description */
.openerp .oe_form_sheetbg.openerp_mail_group_sheet .oe_form_field_text > textarea {
height: 40px;
}
/* ------------------------------ */
/* Group Kanban */
/* ------------------------------ */
.oe_group_vignette {
padding: 8px 0;
min-height: 100px;
@ -71,9 +108,3 @@
.oe_group_details li {
margin: 2px 0;
}
.oe_group_description {
}
.oe_kanban_record div.true {
}

View File

@ -0,0 +1,24 @@
/*!
* jQuery Expander Plugin v1.4.2
*
* Date: Sat Mar 31 20:51:48 2012 EDT
* Requires: jQuery v1.3+
*
* Copyright 2011, Karl Swedberg
* Dual licensed under the MIT and GPL licenses (just like jQuery):
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*
*
*
*/
(function(c){c.expander={version:"1.4.2",defaults:{slicePoint:100,preserveWords:true,widow:4,expandText:"read more",expandPrefix:"&hellip; ",expandAfterSummary:false,summaryClass:"summary",detailClass:"details",moreClass:"read-more",lessClass:"read-less",collapseTimer:0,expandEffect:"slideDown",expandSpeed:250,collapseEffect:"slideUp",collapseSpeed:200,userCollapse:true,userCollapseText:"read less",userCollapsePrefix:" ",onSlice:null,beforeExpand:null,afterExpand:null,onCollapse:null}};c.fn.expander=
function(l){function J(a,d){var g="span",h=a.summary;if(d){g="div";if(x.test(h)&&!a.expandAfterSummary)h=h.replace(x,a.moreLabel+"$1");else h+=a.moreLabel;h='<div class="'+a.summaryClass+'">'+h+"</div>"}else h+=a.moreLabel;return[h,"<",g+' class="'+a.detailClass+'"',">",a.details,"</"+g+">"].join("")}function K(a){var d='<span class="'+a.moreClass+'">'+a.expandPrefix;d+='<a href="#">'+a.expandText+"</a></span>";return d}function y(a,d){if(a.lastIndexOf("<")>a.lastIndexOf(">"))a=a.slice(0,a.lastIndexOf("<"));
if(d)a=a.replace(L,"");return c.trim(a)}function z(a,d){d.stop(true,true)[a.collapseEffect](a.collapseSpeed,function(){d.prev("span."+a.moreClass).show().length||d.parent().children("div."+a.summaryClass).show().find("span."+a.moreClass).show()})}function M(a,d,g){if(a.collapseTimer)A=setTimeout(function(){z(a,d);c.isFunction(a.onCollapse)&&a.onCollapse.call(g,false)},a.collapseTimer)}var v="init";if(typeof l=="string"){v=l;l={}}var o=c.extend({},c.expander.defaults,l),N=/^<(?:area|br|col|embed|hr|img|input|link|meta|param).*>$/i,
L=o.wordEnd||/(&(?:[^;]+;)?|[a-zA-Z\u00C0-\u0100]+)$/,B=/<\/?(\w+)[^>]*>/g,C=/<(\w+)[^>]*>/g,D=/<\/(\w+)>/g,x=/(<\/[^>]+>)\s*$/,O=/^<[^>]+>.?/,A;l={init:function(){this.each(function(){var a,d,g,h,m,i,p,w,E=[],t=[],q={},r=this,f=c(this),F=c([]),b=c.meta?c.extend({},o,f.data()):o;i=!!f.find("."+b.detailClass).length;var s=!!f.find("*").filter(function(){return/^block|table|list/.test(c(this).css("display"))}).length,u=(s?"div":"span")+"."+b.detailClass,G="span."+b.moreClass,P=b.expandSpeed||0,n=c.trim(f.html());
c.trim(f.text());var e=n.slice(0,b.slicePoint);if(!c.data(this,"expander")){c.data(this,"expander",true);c.each(["onSlice","beforeExpand","afterExpand","onCollapse"],function(j,k){q[k]=c.isFunction(b[k])});e=y(e);for(d=e.replace(B,"").length;d<b.slicePoint;){a=n.charAt(e.length);if(a=="<")a=n.slice(e.length).match(O)[0];e+=a;d++}e=y(e,b.preserveWords);h=e.match(C)||[];m=e.match(D)||[];g=[];c.each(h,function(j,k){N.test(k)||g.push(k)});h=g;d=m.length;for(a=0;a<d;a++)m[a]=m[a].replace(D,"$1");c.each(h,
function(j,k){var H=k.replace(C,"$1"),I=c.inArray(H,m);if(I===-1){E.push(k);t.push("</"+H+">")}else m.splice(I,1)});t.reverse();if(i){i=f.find(u).remove().html();e=f.html();n=e+i;a=""}else{i=n.slice(e.length);a=c.trim(i.replace(B,""));if(a===""||a.split(/\s+/).length<b.widow)return;a=t.pop()||"";e+=t.join("");i=E.join("")+i}b.moreLabel=f.find(G).length?"":K(b);if(s)i=n;e+=a;b.summary=e;b.details=i;b.lastCloseTag=a;if(q.onSlice)b=(g=b.onSlice.call(r,b))&&g.details?g:b;s=J(b,s);f.html(s);p=f.find(u);
w=f.find(G);p.hide();w.find("a").unbind("click.expander").bind("click.expander",function(j){j.preventDefault();w.hide();F.hide();q.beforeExpand&&b.beforeExpand.call(r);p.stop(false,true)[b.expandEffect](P,function(){p.css({zoom:""});q.afterExpand&&b.afterExpand.call(r);M(b,p,r)})});F=f.find("div."+b.summaryClass);b.userCollapse&&!f.find("span."+b.lessClass).length&&f.find(u).append('<span class="'+b.lessClass+'">'+b.userCollapsePrefix+'<a href="#">'+b.userCollapseText+"</a></span>");f.find("span."+
b.lessClass+" a").unbind("click.expander").bind("click.expander",function(j){j.preventDefault();clearTimeout(A);j=c(this).closest(u);z(b,j);q.onCollapse&&b.onCollapse.call(r,true)})}})},destroy:function(){if(this.data("expander")){this.removeData("expander");this.each(function(){var a=c(this),d=c.meta?c.extend({},o,a.data()):o,g=a.find("."+d.detailClass).contents();a.find("."+d.moreClass).remove();a.find("."+d.summaryClass).remove();a.find("."+d.detailClass).after(g).remove();a.find("."+d.lessClass).remove()})}}};
l[v]&&l[v].call(this);return this};c.fn.expander.defaults=c.expander.defaults})(jQuery);

View File

@ -302,17 +302,20 @@ openerp.mail = function(session) {
record.body = this.do_clean_text(record.body);
record.body = this.do_replace_internal_links(record.body);
// split for see more
var split = this.do_truncate_string(record.body, this.params.msg_more_limit);
record.body_head = split[0];
record.body_tail = split[1];
// format date according to the user timezone
record.date = session.web.format_value(record.date, {type:"datetime"});
var rendered = session.web.qweb.render('mail.Thread.message', {'record': record, 'thread': this, 'params': this.params, 'display': this.display});
$( rendered).appendTo(this.$element.children('div.oe_mail_thread_display:first'));
$(rendered).appendTo(this.$element.children('div.oe_mail_thread_display:first'));
// expand feature
this.$element.find('div.oe_mail_msg_body:last').expander({
slicePoint: this.params.msg_more_limit,
expandText: 'see more',
userCollapseText: 'see less',
detailClass: 'oe_mail_msg_tail',
moreClass: 'oe_mail_expand',
lesClass: 'oe_mail_reduce',
});
},
/**
@ -447,20 +450,6 @@ openerp.mail = function(session) {
return this.session.prefix + '/web/binary/image?session_id=' + this.session.session_id + '&model=' + model + '&field=' + field + '&id=' + (id || '');
},
/**
* @param {String} string to truncate
* @param {Number} max number of chars to display
* @returns {String} truncated string
*/
do_truncate_string: function(string, max_length) {
// multiply by 1.2: prevent truncating an just too little long string
if (string.length <= (max_length * 1.2)) {
return [string, ""];
} else {
return [string.slice(0, max_length), string.slice(max_length)];
}
},
/** Removes html tags, except b, em, br */
do_clean_text: function (string) {
var html = $('<div/>').text(string.replace(/\s+/g, ' ')).html().replace(new RegExp('&lt;(/)?(b|em|br|br /)\\s*&gt;', 'gi'), '<$1$2>');

View File

@ -91,10 +91,7 @@
</div>
<div class="oe_mail_msg_body">
<a href="#" data-res-model='res.users' t-attf-data-res-id='{record.user_id[0]}' class="oe_mail_internal_link"><t t-raw="record.user_id[1]"/></a>
<t t-raw="record.body_head"/>
<t t-if="record.body_tail"><a href="#" class="oe_mail_msg_more">... See more</a>
<span class="oe_mail_msg_tail"><t t-raw="record.body_tail"/></span>
</t>
<t t-raw="record.body"/>
</div>
<ul class="oe_mail_msg_footer">
<li><span t-att-title="record.date"><t t-raw="record.timerelative"/></span></li>

View File

@ -12,18 +12,18 @@
or
<button string="Cancel" class="oe_link" special="cancel" />
</header>
<group col="6" colspan="4">
<group>
<field name="model" invisible="1"/>
<field name="res_id" invisible="1"/>
<field name='filter_id' invisible="context.get('active_model',False)"/>
<field name="email_from" colspan="4" required="1"/>
<field name="email_to" colspan="4" required="1"/>
<field name="email_cc" colspan="4"/>
<field name="email_bcc" colspan="4"/>
<field name="reply_to" colspan="4"/>
<field name="subject" colspan="4" widget="char" size="512"/>
<field name="references" invisible="1"/>
<field name="message_id" invisible="1"/>
<field name="email_from" required="1"/>
<field name="email_to" required="1"/>
<field name="email_cc"/>
<field name="email_bcc"/>
<field name="reply_to"/>
<field name="subject" widget="char" size="512"/>
<field name="references"/>
<field name="message_id"/>
</group>
<notebook colspan="4">
<page string="Body">

View File

@ -28,7 +28,7 @@ UID_ROOT = 1
SHARED_DOCS_MENU = "Documents"
SHARED_DOCS_CHILD_MENU = "Shared Documents"
class share_wizard_portal(osv.osv_memory):
class share_wizard_portal(osv.TransientModel):
"""Inherited share wizard to automatically create appropriate
menus in the selected portal upon sharing with a portal group."""
_inherit = "share.wizard"

View File

@ -8,7 +8,7 @@
<field name="type">form</field>
<field name="inherit_id" ref="share.share_step1_form"/>
<field name="arch" type="xml">
<xpath expr="/form/field[@name='user_type']" position="attributes">
<xpath expr="//field[@name='user_type']" position="attributes">
<attribute name='invisible'>0</attribute>
<attribute name='colspan'>4</attribute>
</xpath>
@ -40,11 +40,11 @@
<xpath expr="//field[@name='result_line_ids']//field[@name='login']" position="after">
<field name="share_url" groups="portal.group_portal_manager"/>
</xpath>
<xpath expr="//field[@name='result_line_ids']//field[@name='login']" position="after">
<field name="share_url" colspan="4" groups="portal.group_portal_manager"/>
</xpath>
<xpath expr="//field[@name='result_line_ids']" position="after">
<field colspan="4" name="share_root_url" groups="portal.group_portal_manager"/>
<newline/>
<group string="Details">
<field name="share_root_url" groups="portal.group_portal_manager"/>
</group>
</xpath>
</field>
</record>

View File

@ -10,19 +10,19 @@
<field name="arch" type="xml">
<notebook position="inside">
<page string="Manufacturer">
<separator string="Manufacturer" colspan="4" />
<field name="manufacturer" />
<newline/>
<field name="manufacturer_pname"/>
<field name="manufacturer_pref"/>
<separator string="Attributes" colspan="4"/>
<field name="attribute_ids" colspan="4" nolabel="1">
<tree string="Product Attributes" editable="bottom">
<field name="name"/>
<field name="value"/>
</tree>
</field>
<group string="Manufacturer">
<field name="manufacturer" />
<field name="manufacturer_pname"/>
<field name="manufacturer_pref"/>
</group>
<group string="Attributes">
<field name="attribute_ids" colspan="4" nolabel="1">
<tree string="Product Attributes" editable="bottom">
<field name="name"/>
<field name="value"/>
</tree>
</field>
</group>
</page>
</notebook>
</field>

View File

@ -133,7 +133,7 @@
<field name="arch" type="xml">
<form string="Purchase Order" version="7.0">
<header>
<button name="purchase_confirm" states="draft,sent" string="Confirm Order" class="oe_highlight"/>
<button name="purchase_confirm" states="draft,sent" string="Confirm Quotation" class="oe_highlight"/>
<button name="wkf_send_rfq" states="draft" string="Send RFQ" type="object" context="{'send_rfq':True}"/>
<button name="wkf_send_rfq" states="confirmed" string="Resend Purchase Order" type="object" class="oe_highlight"/>
<button name="action_cancel" states="except_picking,except_invoice,wait" string="Cancel" type="object" />
@ -148,11 +148,13 @@
<field name="state" widget="statusbar" statusbar_visible="draft,approved,done" statusbar_colors='{"except_picking":"red","except_invoice":"red","confirmed":"blue","wait":"blue"}' readonly="1"/>
</header>
<sheet>
<h1>
<label string="Draft Purchase Order " attrs="{'invisible': [('state','not in',('draft','sent'))]}"/>
<label string="Purchase Order " attrs="{'invisible': [('state','in',('draft','sent'))]}"/>
<field name="name" class="oe_inline" readonly="1"/>
</h1>
<div class="oe_title">
<h1>
<label string="Quotation " attrs="{'invisible': [('state','not in',('draft','sent'))]}"/>
<label string="Purchase Order " attrs="{'invisible': [('state','in',('draft','sent'))]}"/>
<field name="name" class="oe_inline" readonly="1"/>
</h1>
</div>
<group>
<group>
<field name="partner_id" on_change="onchange_partner_id(partner_id)" context="{'search_default_supplier':1,'default_supplier':1,'default_customer':0}"/>
@ -175,15 +177,17 @@
<field name="product_qty"/>
<field name="product_uom" groups="product.group_uom"/>
<field name="price_unit"/>
<field name="price_subtotal"/>
<field name="price_subtotal"/>
</tree>
</field>
<group class="oe_subtotal_footer">
<group class="oe_subtotal_footer oe_right">
<field name="amount_untaxed"/>
<field name="amount_tax"/>
<field name="amount_total" class="oe_subtotal_footer_separator"/>
<button name="button_dummy" states="draft" string="Compute" type="object" icon="gtk-execute"/>
</group>
<div class="oe_subtotal_footer_separator oe_inline" colspan="2">
<button name="button_dummy" states="draft" string="Compute" type="object" icon="gtk-execute" class="oe_inline oe_left"/>
<field name="amount_total"/>
</div>
</group>
<div class="oe_clear"/>
<label for="notes"/>
<field name="notes"/>
@ -191,23 +195,27 @@
<page string="Delivery &amp; Invoicing">
<group>
<group string="Delivery">
<field name="dest_address_id" on_change="onchange_dest_address_id(dest_address_id)"/>
<field name="dest_address_id" string="Customer Address" on_change="onchange_dest_address_id(dest_address_id)"/>
<field name="minimum_planned_date"/>
<field name="location_id" groups="stock.group_locations"/>
<field name="shipped"/>
<field name="shipped" groups="base.group_no_one"/>
</group>
<group string="Invoice Control">
<field name="invoice_method"/>
<field name="fiscal_position" widget="selection"/>
<field name="invoiced" groups="base.group_no_one"/>
</group>
<group groups="base.group_no_one" string="Purchase Control">
<field name="validator"/>
<group>
<field name="validator" groups="base.group_no_one"/>
<field name="date_approve"/>
</group>
<separator string="Invoices"/>
<field name="invoice_ids" context="{'type':'in_invoice', 'journal_type':'purchase'}"/>
</group>
<group string="Invoicing">
<group>
<field name="invoice_method"/>
<field name="invoiced"/>
</group>
<group>
<field name="fiscal_position"/>
</group>
</group>
<separator string="Invoices"/>
<field name="invoice_ids" context="{'type':'in_invoice', 'journal_type':'purchase'}"/>
</page>
</notebook>
</sheet>
@ -336,7 +344,6 @@
</record>
<menuitem action="purchase_form_action" id="menu_purchase_form_action" parent="menu_procurement_management" sequence="6"/>
<record id="purchase_order_line_form" model="ir.ui.view">
<field name="name">purchase.order.line.form</field>
<field name="model">purchase.order.line</field>
@ -344,9 +351,6 @@
<field name="arch" type="xml">
<form string="Purchase Order Line" version="7.0">
<sheet>
<label for="name" class="oe_edit_only"/>
<h1><field name="name"/></h1>
<label for="product_id" class="oe_edit_only"/>
<group>
<group>
<field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order,parent.fiscal_position,date_planned,name,price_unit,notes,context)"/>
@ -356,23 +360,23 @@
<field name="product_uom" groups="product.group_uom" on_change="onchange_product_uom(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order,parent.fiscal_position,date_planned,name,price_unit,notes,context)" class="oe_inline"/>
</div>
<field name="price_unit"/>
<field name="taxes_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
</group>
<group>
<field name="name"/>
<field name="date_planned" widget="date"/>
<field name="account_analytic_id" colspan="2" groups="purchase.group_analytic_accounting" domain="[('parent_id','!=',False)]" />
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<field name="account_analytic_id" colspan="4" groups="purchase.group_analytic_accounting" domain="[('parent_id','!=',False)]" />
<field name="taxes_id" widget="many2many_tags"
domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
</group>
<group string="Notes" colspan="4">
<field name="notes"/>
<field name="notes" nolabel="1" placeholder="Add a note on the purchase line..."/>
</group>
<group string="Invoices" colspan="4">
<field name="invoiced"/>
<field name="invoice_lines" nolabel="1" colspan="2"/>
<field name="invoice_lines" nolabel="1"/>
</group>
<group string="Stock Moves" colspan="4">
<field name="move_ids" nolabel="1"/>
</group>
<separator string="Stock Moves"/>
<field name="move_ids"/>
</group>
</sheet>
</form>
@ -410,11 +414,11 @@
<label for="order_id" class="oe_edit_only"/>
<h1>
<field name="order_id" class="oe_inline"/>
<label string="," attrs="{'invisible':[('date_order','=',False)]}"/>
<field name="date_order" class="oe_inline"/>
</h1>
<label for="partner_id" class="oe_edit_only"/>
<h2><field name="partner_id"/></h2>
<group>
<group>
<field name="name"/>

View File

@ -24,27 +24,6 @@
</field>
</record>
<act_window
domain="[('purchase_id', '=', active_id)]"
id="act_purchase_order_2_stock_picking"
name="Incoming Shipments"
res_model="stock.picking.in"
src_model="purchase.order"
context="{'default_purchase_id': active_id, 'contact_display': 'partner', 'default_type': 'in'}" />
<record id="action_picking_in_tree_view" model="ir.actions.act_window.view">
<field eval="1" name="sequence"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="stock.view_picking_in_tree"/>
<field name="act_window_id" ref="act_purchase_order_2_stock_picking"/>
</record>
<record id="action_picking_in_form_view" model="ir.actions.act_window.view">
<field eval="2" name="sequence"/>
<field name="view_mode">form</field>
<field name="view_id" ref="stock.view_picking_in_form"/>
<field name="act_window_id" ref="act_purchase_order_2_stock_picking"/>
</record>
<record id="stock_picking_in_inherit_purchase" model="ir.ui.view">
<field name="name">Incoming Picking Inherited</field>
<field name="model">stock.picking.in</field>
@ -78,6 +57,7 @@
<separator orientation="vertical"/>
<field name="stock_journal_id" widget="selection"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="purchase_id" />
</group>
<newline/>
<group expand="0" string="Group By..." colspan="4" col="8">
@ -96,7 +76,33 @@
</search>
</field>
</record>
<record id="act_purchase_order_2_stock_picking" model="ir.actions.act_window">
<field name="name">Incoming Shipments</field>
<field name="res_model">stock.picking.in</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar</field>
<field name="domain">[('type','=','in')]</field>
<field name="context">{'search_default_purchase_id': active_id,'default_type': 'in'}</field>
<field name="search_view_id" ref="view_picking_in_search_picking_to_invoice"/>
</record>
<record id="purchase_order_2_stock_picking" model="ir.ui.view">
<field name="name">Purchase Picking Inherited</field>
<field name="model">purchase.order</field>
<field name="type">form</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<xpath expr="//div[contains(@class, 'oe_title')]" position="before">
<div class="oe_right oe_button_box" name="buttons">
<button type="action"
name="%(act_purchase_order_2_stock_picking)d"
string="Incoming Shipments" states="approved"/>
</div>
</xpath>
</field>
</record>
<record id="action_picking_tree4_picking_to_invoice" model="ir.actions.act_window">
<field name="name">Based on Incoming Shipments</field>
<field name="res_model">stock.picking</field>

View File

@ -8,7 +8,7 @@
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<field name="shipped" position="after">
<field name="validator" position="before">
<field name="requisition_id"/>
</field>
</field>
@ -41,12 +41,13 @@
</header>
<sheet>
<div class="oe_edit_only">
<label for="name" class="oe_inline"/>,
<label for="name" class="oe_inline"/>
<label for="origin" class="oe_inline"/>
</div>
<h1>
<field name="name" class="oe_inline"/>,
<field name="origin" class="oe_inline"/>
<field name="name" class="oe_inline"/>
<label string="," attrs="{'invisible':[('origin','=',False)]}"/>
<field name="origin" class="oe_inline" placeholder="PO0025"/>
</h1>
<group>
<group>

View File

@ -1,7 +1,4 @@
button.oe_share_mail {
display: none;
}
a.oe_share_link, a.oe_share {
/* Added invite button, hidden by default */
button.oe_share_invite {
display: none;
}

View File

@ -50,29 +50,46 @@ openerp.share = function(session) {
session.connection.share_flag.done(yes).fail(no);
}
/* Extend the Sidebar to add Share and Embed links in the 'More' menu */
session.web.Sidebar = session.web.Sidebar.extend({
add_default_sections: function() {
this._super();
start: function() {
var self = this;
this._super(this);
has_share(function() {
self.add_items('other', [{
label: 'Share',
callback: self.on_sidebar_click_share,
classname: 'oe_share',
}]);
self.add_items('other', [
{ label: 'Share',
callback: self.on_click_share,
classname: 'oe_share' },
{ label: 'Embed',
callback: self.on_click_share_link,
classname: 'oe_share' },
]);
});
},
on_sidebar_click_share: function(item) {
on_click_share: function(item) {
var view = this.getParent()
launch_wizard(this, view);
launch_wizard(this, view, 'emails', false);
},
on_click_share_link: function(item) {
var view = this.getParent()
launch_wizard(this, view, 'embedded', false);
},
});
/**
* Extends mail (Chatter widget)
* - show the 'invite' button' only we came on the form view through
* an action. We do this because 'invite' is based on the share
* mechanism, and it tries to share an action.
*/
session.mail.RecordThread.include( {
start: function() {
start_res = this._super.apply(this, arguments);
if (has_action_id) {
this.$element.find('button.oe_share_mail').show();
this.$element.find('button.oe_share_invite').show();
}
return start_res;
}
@ -83,12 +100,7 @@ openerp.share = function(session) {
var self = this;
this.check_if_action_is_defined();
has_share(function() {
self.$element.find('a.oe_share_link').click(self.on_click_share_link);
self.$element.find('a.oe_share').click(self.on_click_share);
self.$element.delegate('button.oe_share_mail', 'click', self.on_click_share_mail);
}, function() {
self.$element.find('a.oe_share_link').remove();
self.$element.find('a.oe_share').remove();
self.$element.delegate('button.oe_share_invite', 'click', self.on_click_share_invite);
});
return this._super.apply(this, arguments);
},
@ -96,23 +108,13 @@ openerp.share = function(session) {
check_if_action_is_defined: function() {
if (this.action && this.action.id) {
has_action_id = true;
this.$element.find('a.oe_share_link').show();
this.$element.find('a.oe_share').show();
}
else {
has_action_id = false;
}
},
on_click_share_link: function(e) {
e.preventDefault();
launch_wizard(this, this.views[this.active_view].controller, 'embedded', false);
},
on_click_share: function(e) {
e.preventDefault();
launch_wizard(this, this.views[this.active_view].controller, 'emails', false);
},
on_click_share_mail: function(e) {
on_click_share_invite: function(e) {
e.preventDefault();
launch_wizard(this, this.views[this.active_view].controller, 'emails', true);
},

View File

@ -3,18 +3,11 @@
-->
<templates id="template" xml:space="preserve">
<t t-extend="ViewManagerAction">
<t t-jquery=".oe_shortcuts_toggle" t-operation="after">
<a class="oe_share_link" href="#share_link" title="Link or embed..."><img t-att-src='_s + "/share/static/src/img/share.png"'/></a>
<a class="oe_share" href="#share" title="Share with..."><img t-att-src='_s + "/share/static/src/img/share.png"'/></a>
</t>
</t>
<t t-extend="RecordThread">
<!-- Extends Chatter widget in form view to add the invite button -->
<t t-extend="mail.RecordThread">
<t t-jquery="button.oe_mail_button_unfollow" t-operation="after">
<button type="button" class="oe_share_mail oe_mail_button_mouseout">Invite</button>
<button type="button" class="oe_share_invite">Invite</button>
</t>
</t>
</templates>

View File

@ -48,7 +48,7 @@ RANDOM_PASS_CHARACTERS = 'aaaabcdeeeefghjkmnpqrstuvwxyzAAAABCDEEEEFGHJKLMNPQRSTU
def generate_random_pass():
return ''.join(random.sample(RANDOM_PASS_CHARACTERS,10))
class share_wizard(osv.osv_memory):
class share_wizard(osv.TransientModel):
_name = 'share.wizard'
_description = 'Share Wizard'
@ -177,9 +177,10 @@ class share_wizard(osv.osv_memory):
'name': fields.char('Share Title', size=64, required=True, help="Title for the share (displayed to users as menu and shortcut name)"),
'record_name': fields.char('Record name', size=128, help="Name of the shared record, if sharing a precise record"),
'message': fields.text("Personal Message", help="An optional personal message, to be included in the email notification."),
'embed_code': fields.function(_embed_code, type='text'),
'embed_option_title': fields.boolean("Display title"),
'embed_code': fields.function(_embed_code, type='text', string='Code',
help="Embed this code in your documents to provide a link to the "\
"shared document."),
'embed_option_title': fields.boolean('Display title'),
'embed_option_search': fields.boolean('Display search view'),
'embed_url': fields.function(_embed_url, string='Share URL', type='char', size=512, readonly=True),
}
@ -903,8 +904,11 @@ class share_result_line(osv.osv_memory):
def _share_url(self, cr, uid, ids, _fieldname, _args, context=None):
result = dict.fromkeys(ids, '')
for this in self.browse(cr, uid, ids, context=context):
data = dict(dbname=cr.dbname, login=this.login, password='')
result[this.id] = this.share_wizard_id.share_url_template() % data
data = dict(dbname=cr.dbname, login=this.login, password=this.password)
if this.share_wizard_id and this.share_wizard_id.action_id:
data['action_id'] = this.share_wizard_id.action_id.id
ctx = dict(context, share_url_template_hash_arguments=['action_id'])
result[this.id] = this.share_wizard_id.share_url_template(context=ctx) % data
return result
_columns = {

View File

@ -39,17 +39,20 @@
<group>
<field name="user_type" invisible="1"/>
<field name="invite" invisible="1"/>
</group>
</group>
<group>
<group name="emails_group" attrs="{'invisible':['|', ('user_type', '!=', 'emails'), ('invite', '=', True)]}" string="Share with these People (one email per line)">
<field colspan="2" nolabel="1" name="new_users" attrs="{'required':[('user_type','=','emails'), ('invite', '!=', True)]}"/>
<group colspan="4" name="emails_group" attrs="{'invisible':['|', ('user_type', '!=', 'emails'), ('invite', '=', True)]}"
string="Share with these People (one email per line)">
<field nolabel="1" name="new_users" attrs="{'required':[('user_type','=','emails'), ('invite', '!=', True)]}"/>
</group>
<group name="email_lines" attrs="{'invisible':[('invite', '!=', True)]}" string="Share with these People (one email per line)">
<group colspan="4" name="email_lines" attrs="{'invisible':['|', ('invite', '!=', True), ('user_type', '!=', 'emails')]}"
string="Share with these People (one email per line)">
<field name="email_1"/>
<field name="email_2"/>
<field name="email_3"/>
</group>
<group attrs="{'invisible':[('user_type', '=', 'embedded')]}" string="Include an Optional Personal Message">
<group colspan="4" attrs="{'invisible':[('user_type', '=', 'embedded')]}"
string="Include an Optional Personal Message">
<field name="message" colspan="2" nolabel="1"/>
</group>
<group attrs="{'invisible':[('invite', '=', True)]}" string="Sharing Options">
@ -71,8 +74,8 @@
<field name="user_type" invisible="1"/>
<field name="access_mode" invisible="1"/>
</header>
<group attrs="{'invisible':[('user_type','=','embedded')]}">
<separator string="An email notification with instructions has been sent to the following people:"/>
<group attrs="{'invisible':[('user_type','=','embedded')]}"
string="An email notification with instructions has been sent to the following people:">
<field name="result_line_ids" nolabel="1" mode="tree">
<tree string="Summary">
<field name="login"/>
@ -85,14 +88,17 @@
</field>
</group>
<group colspan="4" col="1" attrs="{'invisible':[('user_type','!=','embedded')]}">
<separator string="Use this Link"/>
<field name="embed_url"/>
<separator string="Or insert the following code where you want to embed your documents"/>
<group string="Options">
<field name="embed_option_title" on_change="onchange_embed_options(embed_option_title, embed_option_search)"/>
<field name="embed_option_search" on_change="onchange_embed_options(embed_option_title, embed_option_search)" attrs="{'invisible':[('access_mode','=','readonly')]}"/>
<group string="Use this link">
<field name="embed_url"/>
</group>
<group string="Or insert the following code where you want to embed your documents">
<field name="embed_code"/>
</group>
<group string="Embedded code options">
<field name="embed_option_title" on_change="onchange_embed_options(embed_option_title, embed_option_search)"/>
<field name="embed_option_search" on_change="onchange_embed_options(embed_option_title, embed_option_search)"
attrs="{'invisible':[('access_mode','=','readonly')]}"/>
</group>
</group>
</form>

View File

@ -21,14 +21,14 @@
<field name="type">form</field>
<field name="inherit_id" ref="product.product_category_form_view"/>
<field name="arch" type="xml">
<form position="inside" version="7.0">
<group string="Accounting Stock Properties">
<data>
<xpath expr="/form/sheet//group[@name='account_stock_property']" position="inside">
<field name="property_stock_account_input_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<field name="property_stock_account_output_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<field name="property_stock_valuation_account_id" domain="[('type','&lt;&gt;','view'), ('type','&lt;&gt;','consolidation')]"/>
<field name="property_stock_journal"/>
</group>
</form>
</xpath>
</data>
</field>
</record>

View File

@ -1419,50 +1419,47 @@
<label for="product_qty"/>
<div>
<field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)" class="oe_inline"/>
<field name="product_uom" string="Unit Of Measure" groups="product.group_uom" class="oe_inline"/>
<field name="product_uom" string="Unit Of Measure" groups="product.group_uom" class="oe_inline"/>
<button name="%(stock.move_scrap)d"
string="Scrap" type="action"
icon="gtk-convert" context="{'scrap': True}"
states="draft,waiting,confirmed,assigned"/>
states="draft,waiting,confirmed,assigned" colspan="1"/>
</div>
<label for="product_uos_qty"/>
<div>
<field name="product_uos_qty" groups="product.group_uos" class="oe_inline"
on_change="onchange_uos_quantity(product_id, product_uos_qty, product_uos, product_uom)"/>
<field name="product_uos" groups="product.group_uos"/>
<field name="product_uos" groups="product.group_uos" class="oe_inline"/>
</div>
<field name="name" string="Reason"/>
</group>
<group>
<field name="picking_id"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="location_id" groups="stock.group_locations"/>
<field name="location_dest_id" groups="stock.group_locations"/>
<field name="partner_id" groups="stock.group_locations"/>
<field name="create_date" groups="base.group_no_one" />
<field name="date" groups="base.group_no_one" />
<field name="date_expected" on_change="onchange_date(date,date_expected)"/>
</group>
<group>
<label name="tracking_id"/>
<field name="picking_id"/>
<field name="create_date" groups="base.group_no_one" />
<field name="date" groups="base.group_no_one" string="Move Date"/>
<field name="date_expected" on_change="onchange_date(date,date_expected)"/>
<label for="tracking_id"/>
<div>
<field name="tracking_id" groups="stock.group_tracking_lot" class="oe_inline"/>
<button name="%(split_into)d" string="New Pack" type="action"
groups="product.group_stock_packaging"
icon="terp-stock_effects-object-colorize"
states="draft,assigned,confirmed,done" colspan="1"/>
states="draft,assigned,confirmed,done" class="oe_inline"/>
</div>
<label name="prodlot_id"/>
<label for="prodlot_id"/>
<div>
<field name="prodlot_id" groups="stock.group_production_lot"
context="{'location_id':location_id, 'product_id':product_id}"
domain="[('product_id','=?',product_id)]" class="oe_inline"
on_change="onchange_lot_id(prodlot_id,product_qty, location_id, product_id, product_uom)"/>
<button name="%(track_line)d"
groups="stock.group_tracking_lot" class="oe_inline"
states="draft,waiting,confirmed,assigned,done"
string="Split" type="action" icon="terp-stock_effects-object-colorize"/>
groups="stock.group_tracking_lot" class="oe_inline"
states="draft,waiting,confirmed,assigned,done"
string="Split" type="action" icon="terp-stock_effects-object-colorize" />
</div>
</group>
</group>
@ -1612,13 +1609,6 @@
res_model="stock.move"
src_model="product.product"/>
<act_window
domain="[('move_lines','=',active_id)]"
id="act_relate_picking"
name="Related Picking"
res_model="stock.picking"
src_model="stock.move"/>
<act_window
context="{'search_default_future': 1,'search_default_product_id': [active_id], 'default_product_id': active_id}"
domain="[('state','in',('waiting','confirmed','assigned'))]"