-
+
diff --git a/addons/mail/__init__.py b/addons/mail/__init__.py
index 92e882ae6d8..abf714ad534 100644
--- a/addons/mail/__init__.py
+++ b/addons/mail/__init__.py
@@ -33,6 +33,7 @@ import report
import wizard
import res_config
import mail_group_menu
+import update
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mail/data/mail_data.xml b/addons/mail/data/mail_data.xml
index 5fe1ee45b1d..522cbe8c7a7 100644
--- a/addons/mail/data/mail_data.xml
+++ b/addons/mail/data/mail_data.xml
@@ -13,6 +13,20 @@
+
+ Update Notification
+
+
+ 1
+ weeks
+ -1
+
+
+
+
+ 1000
+
+
diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py
index bbf68509277..9c873a31097 100644
--- a/addons/mail/mail_message.py
+++ b/addons/mail/mail_message.py
@@ -504,7 +504,7 @@ class mail_message(osv.Model):
if not values.get('message_id') and values.get('res_id') and values.get('model'):
values['message_id'] = tools.generate_tracking_message_id('%(model)s-%(res_id)s' % values)
newid = super(mail_message, self).create(cr, uid, values, context)
- self._notify(cr, 1, newid, context=context)
+ self._notify(cr, SUPERUSER_ID, newid, context=context)
return newid
def read(self, cr, uid, ids, fields=None, context=None, load='_classic_read'):
diff --git a/addons/mail/static/src/js/mail_followers.js b/addons/mail/static/src/js/mail_followers.js
index 953b8cd9fc8..6c016c6c679 100644
--- a/addons/mail/static/src/js/mail_followers.js
+++ b/addons/mail/static/src/js/mail_followers.js
@@ -149,7 +149,6 @@ openerp_mail_followers = function(session, mail) {
var self = this;
var node_user_list = this.$('ul.oe_mail_followers_display').empty();
this.$('div.oe_mail_recthread_followers h4').html(this.options.title + (records.length>=5 ? ' (' + records.length + ')' : '') );
- console.log(records);
for(var i=0; i=", limit_date_str)], count=True)
+ nbr_share_users = False
+ nbr_active_share_users = False
+ if "share" in pool.get("res.users")._all_columns:
+ nbr_share_users = pool.get("res.users").search(cr, uid, [("share", "=", True)], count=True)
+ nbr_active_share_users = pool.get("res.users").search(cr, uid, [("share", "=", True), ("date", ">=", limit_date_str)], count=True)
+ user = pool.get("res.users").browse(cr, uid, uid)
+ msg = {
+ "dbuuid": dbuuid,
+ "nbr_users": nbr_users,
+ "nbr_active_users": nbr_active_users,
+ "nbr_share_users": nbr_share_users,
+ "nbr_active_share_users": nbr_active_share_users,
+ "dbname": cr.dbname,
+ "db_create_date": db_create_date,
+ "version": release.version,
+ "language": user.lang,
+ }
+ msg.update(pool.get("res.company").read(cr,uid,[1],["name","email","phone"])[0])
+
+ add_arg = {"timeout":30} if sys.version_info >= (2,6) else {}
+ arguments = {'arg0': msg, "action": "update",}
+ arguments_raw = urllib.urlencode(arguments)
+
+ url = config.get("publisher_warranty_url")
+ uo = urllib2.urlopen(url, arguments_raw, **add_arg)
+ result = {}
+ try:
+ submit_result = uo.read()
+ result = safe_eval(submit_result)
+ finally:
+ uo.close()
+ return result
+
+class publisher_warranty_contract(osv.osv):
+ _name = "publisher_warranty.contract"
+
+ def update_notification(self, cr, uid, ids, cron_mode=True, context=None):
+ """
+ Send a message to OpenERP's publisher warranty server to check the
+ validity of the contracts, get notifications, etc...
+
+ @param cron_mode: If true, catch all exceptions (appropriate for usage in a cron).
+ @type cron_mode: boolean
+ """
+ try:
+ try:
+ result = get_sys_logs(cr, uid)
+ except Exception:
+ if cron_mode: # we don't want to see any stack trace in cron
+ return False
+ _logger.debug("Exception while sending a get logs messages", exc_info=1)
+ raise osv.except_osv(_("Error"), _("Error during communication with the publisher warranty server."))
+ limit_date = (datetime.datetime.now() - _PREVIOUS_LOG_CHECK).strftime(misc.DEFAULT_SERVER_DATETIME_FORMAT)
+ # old behavior based on res.log; now on mail.message, that is not necessarily installed
+ proxy = self.pool.get('mail.message')
+
+ model, res_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'mail', 'group_all_employees')
+
+ for message in result["messages"]:
+ values = {
+ 'body' : message,
+ 'model' : 'mail.group',
+ 'res_id' : res_id,
+ 'user_id' : False,
+ }
+ proxy.create(cr, uid, values, context=context)
+ except Exception:
+ if cron_mode:
+ return False # we don't want to see any stack trace in cron
+ else:
+ raise
+ return True
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py
index cf203a60c7f..ecac11f856a 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -910,12 +910,11 @@ class mrp_production(osv.osv):
# Internal shipment is created for Stockable and Consumer Products
if production_line.product_id.type not in ('product', 'consu'):
return False
- move_name = _('PROD: %s') % production.name
source_location_id = production.location_src_id.id
if not destination_location_id:
destination_location_id = source_location_id
return stock_move.create(cr, uid, {
- 'name': move_name,
+ 'name': production.name,
'picking_id': shipment_id,
'product_id': production_line.product_id.id,
'product_qty': production_line.product_qty,
@@ -965,9 +964,8 @@ class mrp_production(osv.osv):
stock_move = self.pool.get('stock.move')
source_location_id = production.product_id.product_tmpl_id.property_stock_production.id
destination_location_id = production.location_dest_id.id
- move_name = _('PROD: %s') + production.name
data = {
- 'name': move_name,
+ 'name': production.name,
'date': production.date_planned,
'product_id': production.product_id.id,
'product_qty': production.product_qty,
@@ -990,12 +988,11 @@ class mrp_production(osv.osv):
# Internal shipment is created for Stockable and Consumer Products
if production_line.product_id.type not in ('product', 'consu'):
return False
- move_name = _('PROD: %s') % production.name
destination_location_id = production.product_id.product_tmpl_id.property_stock_production.id
if not source_location_id:
source_location_id = production.location_src_id.id
move_id = stock_move.create(cr, uid, {
- 'name': move_name,
+ 'name': production.name,
'date': production.date_planned,
'product_id': production_line.product_id.id,
'product_qty': production_line.product_qty,
diff --git a/addons/process/static/src/js/process.js b/addons/process/static/src/js/process.js
index 57c6f196012..c593c1569fc 100644
--- a/addons/process/static/src/js/process.js
+++ b/addons/process/static/src/js/process.js
@@ -6,7 +6,6 @@ instance.web.ViewManager.include({
var self = this;
var _super = this._super();
this.process_help = this.action ? this.action.help : '';
- self.process_help = $(this.process_help).text();
if(this.action) {
this.process_model = this.action.res_model;
} else {
@@ -240,9 +239,7 @@ instance.web.ViewManager.include({
title: _t('Process')
});
var form_controller = pop.view_form;
- pop.on_write_completed.add_last(function() {
- self.initialize_process_view();
- });
+ pop.on('on_write_complete', self, self.initialize_process_view);
}
});
};
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index c47bf1357c8..ed7a2835425 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -50,6 +50,16 @@ class sale_order(osv.osv):
_inherit = ['mail.thread', 'ir.needaction_mixin']
_description = "Sales Order"
+ def onchange_shop_id(self, cr, uid, ids, shop_id, context=None):
+ v = {}
+ if shop_id:
+ shop = self.pool.get('sale.shop').browse(cr, uid, shop_id, context=context)
+ if shop.project_id.id:
+ v['project_id'] = shop.project_id.id
+ if shop.pricelist_id.id:
+ v['pricelist_id'] = shop.pricelist_id.id
+ return {'value': v}
+
def copy(self, cr, uid, id, default=None, context=None):
if not default:
default = {}
@@ -783,6 +793,7 @@ class sale_order_line(osv.osv):
_('There is no Fiscal Position defined or Income category account defined for default properties of Product categories.'))
res = {
'name': line.name,
+ 'sequence': line.sequence,
'origin': line.order_id.name,
'account_id': account_id,
'price_unit': pu,
@@ -900,7 +911,6 @@ class sale_order_line(osv.osv):
fpos = fiscal_position and self.pool.get('account.fiscal.position').browse(cr, uid, fiscal_position) or False
if update_tax: #The quantity only have changed
result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, product_obj.taxes_id)
- result.update({'type': product_obj.procure_method})
if not flag:
result['name'] = self.pool.get('product.product').name_get(cr, uid, [product_obj.id], context=context_partner)[0][1]
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index d97c9924036..5505a6a88b5 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -181,7 +181,7 @@
-
+
@@ -200,7 +200,7 @@
+ on_change="product_id_change(parent.pricelist_id, product_id, product_uom_qty, product_uom, product_uos_qty, product_uos, name, parent.partner_id, False, True, parent.date_order, False, parent.fiscal_position, False, context)"/>
-
+
sale.shop.inherit.form
sale.shop
@@ -13,7 +13,7 @@
-
+
sale.shop.sale.stock
sale.shop
@@ -41,7 +41,8 @@
+ attrs="{'invisible': ['|','|','|',('picking_ids','=',False),('picking_ids','=',[]), ('state', 'not in', ('progress','manual')),('shipped','=',True)]}"/>
+
diff --git a/addons/sale_stock/test/sale_order_onchange.yml b/addons/sale_stock/test/sale_order_onchange.yml
new file mode 100644
index 00000000000..1026e5627c3
--- /dev/null
+++ b/addons/sale_stock/test/sale_order_onchange.yml
@@ -0,0 +1,22 @@
+-
+ In order to test the onchange of the Sale Order, I create a product
+-
+ !record {model: product.product, id: product_onchange1}:
+ name: 'Devil Worship Book'
+ list_price: 66.6
+ procure_method: 'make_to_order'
+-
+ Now i create a sale order that uses my new product
+-
+ !record {model: sale.order, id: sale_order_onchange1}:
+ partner_id: base.res_partner_2
+ order_line:
+ - product_id: sale_stock.product_onchange1
+ product_uom_qty: 10
+-
+ I verify that the onchange of product on sale order line was correctly triggered
+-
+ !assert {model: sale.order, id: sale_order_onchange1, string: The onchange function of product was not correctly triggered}:
+ - order_line[0].name == u'Devil Worship Book'
+ - order_line[0].price_unit == 66.6
+ - order_line[0].type == 'make_to_order'
diff --git a/addons/survey/survey_view.xml b/addons/survey/survey_view.xml
index 01d6098df55..0247a205700 100644
--- a/addons/survey/survey_view.xml
+++ b/addons/survey/survey_view.xml
@@ -1125,7 +1125,8 @@
-
+
+
@@ -1139,6 +1140,7 @@
+