[MERGE] forward port branch 8.0 up to 8ceb943

This commit is contained in:
Christophe Simonis
2016-07-27 18:13:51 +02:00
12 changed files with 31 additions and 17 deletions
+1 -1
View File
@@ -1312,7 +1312,7 @@ class account_move_line(osv.osv):
done = {}
for line in self.browse(cr, uid, ids, context=context):
err_msg = _('Move name (id): %s (%s)') % (line.move_id.name, str(line.move_id.id))
if line.move_id.state <> 'draft' and (not line.journal_id.entry_posted):
if line.move_id.state <> 'draft':
raise UserError(_('You cannot do this modification on a confirmed entry. You can just change some non legal fields or you must unconfirm the journal entry first.\n%s.') % err_msg)
if line.reconcile_id:
raise UserError(_('You cannot do this modification on a reconciled entry. You can just change some non legal fields or you must unreconcile first.\n%s.') % err_msg)
@@ -45,7 +45,6 @@ class general_ledger(report_sxw.rml_parse, common_report_header):
self.init_balance = data['form'].get('initial_balance', True)
if self.init_balance:
ctx2.update({'initial_bal': True})
self.init_query = obj_move._query_get(self.cr, self.uid, obj='l', context=ctx2)
self.display_account = data['form']['display_account']
self.target_move = data['form'].get('target_move', 'all')
ctx = self.context.copy()
@@ -54,11 +53,14 @@ class general_ledger(report_sxw.rml_parse, common_report_header):
period_from_id = data['form']['period_from']
period_to_id = data['form']['period_to']
ctx['periods'] = self.pool["account.period"].build_ctx_periods(self.cr, self.uid, period_from_id, period_to_id)
# Do not let "_query_get" calculate the periods itself
ctx2.update({'periods': ctx['periods']})
elif data['form']['filter'] == 'filter_date':
ctx['date_from'] = data['form']['date_from']
ctx['date_to'] = data['form']['date_to']
ctx['state'] = data['form']['target_move']
self.context.update(ctx)
self.init_query = obj_move._query_get(self.cr, self.uid, obj='l', context=ctx2)
if (data['model'] == 'ir.ui.menu'):
new_ids = [data['form']['chart_account_id']]
objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids)
+2 -1
View File
@@ -1268,7 +1268,7 @@ class calendar_event(osv.Model):
"""
if data['interval'] and data['interval'] < 0:
raise UserError(_('interval cannot be negative.'))
if data['count'] and data['count'] <= 0:
if data['end_type'] == 'count' and int(data['count']) <= 0:
raise UserError(_('Event recurrence interval cannot be negative.'))
def get_week_string(freq, data):
@@ -1538,6 +1538,7 @@ class calendar_event(osv.Model):
recurrent_id=real_event_id,
recurrent_id_date=data.get('start'),
rrule_type=False,
end_type=False,
rrule='',
recurrency=False,
final_date=datetime.strptime(data.get('start'), DEFAULT_SERVER_DATETIME_FORMAT if data['allday'] else DEFAULT_SERVER_DATETIME_FORMAT) + timedelta(hours=values.get('duration', False) or data.get('duration'))
@@ -102,8 +102,11 @@ function reload_favorite_list(result) {
},
});
this.ir_model_m2o.insertAfter($('div.oe_calendar_filter'));
this.ir_model_m2o.on('change:value', self, function() {
self.add_filter();
this.ir_model_m2o.on('change:value', self, function() {
// once selected, we reset the value to false.
if (self.ir_model_m2o.get_value()) {
self.add_filter();
}
});
},
add_filter: function() {
+3 -2
View File
@@ -361,9 +361,10 @@ class google_calendar(osv.AbstractModel):
url = "/calendar/v3/calendars/%s/events/%s" % ('primary', google_id)
try:
status, content, ask_time = self.pool['google.service']._do_request(cr, uid, url, params, headers, type='GET', context=context)
except:
except Exception, e:
_logger.info("Calendar Synchro - In except of get_one_event_synchro")
pass
_logger.info(exception_to_unicode(e))
return False
return status_response(status) and content or False
+2 -2
View File
@@ -120,8 +120,8 @@ class AcquirerPaypal(osv.Model):
'currency_code': tx_values['currency'] and tx_values['currency'].name or '',
'address1': partner_values['address'],
'city': partner_values['city'],
'country': partner_values['country'] and partner_values['country'].name or '',
'state': partner_values['state'] and partner_values['state'].name or '',
'country': partner_values['country'] and partner_values['country'].code or '',
'state': partner_values['state'] and (partner_values['state'].code or partner_values['state'].name) or '',
'email': partner_values['email'],
'zip': partner_values['zip'],
'first_name': partner_values['first_name'],
+1 -1
View File
@@ -314,7 +314,7 @@ class produce_price_history(osv.osv):
'company_id': fields.many2one('res.company', required=True),
'product_template_id': fields.many2one('product.template', 'Product Template', required=True, ondelete='cascade'),
'datetime': fields.datetime('Historization Time'),
'cost': fields.float('Historized Cost'),
'cost': fields.float('Historized Cost', digits_compute=dp.get_precision('Product Price')),
}
def _get_default_company(self, cr, uid, context=None):
+1 -1
View File
@@ -109,7 +109,7 @@ class product_pricelist(report_sxw.rml_parse):
if price_dict[pricelist_id]:
price = float_round(price_dict[pricelist_id], precision_digits=sale_price_digits)
else:
res = self.pool.get('product.product').read(self.cr, self.uid, [product_id])
res = self.pool.get('product.product').read(self.cr, self.uid, [product_id], ['list_price'])
price = float_round(res[0]['list_price'], precision_digits=sale_price_digits)
price = self.formatLang(price, digits=sale_price_digits, currency_obj=pricelist.currency_id)
return price
+9
View File
@@ -0,0 +1,9 @@
India, July 10, 2016
I hereby agree to the terms of the Odoo Individual Contributor License Agreement v1.0.
I declare that I am authorized and able to make this agreement and sign this declaration.
Signed,
Gourav Chawla gouravchawla@live.com https://github.com/Gouravchawla
+1 -1
View File
@@ -129,7 +129,7 @@ When declaring a record in XML,
<field name="arch" type="xml">
<tree>
<field name="my_field_1"/>
<field name="my_field_2" string="My Label" widget="statusbar" statusbar_visible="draft,sent,progress,done" statusbar_colors='{"invoice_except":"red","waiting_date":"blue"}' />
<field name="my_field_2" string="My Label" widget="statusbar" statusbar_visible="draft,sent,progress,done" />
</tree>
</field>
</record>
+2 -5
View File
@@ -366,7 +366,7 @@ system. Available semantic components are:
.. todo:: list of widgets
& options & specific attributes (e.g. widget=statusbar
statusbar_visible statusbar_colors clickable)
statusbar_visible clickable)
``options``
JSON object specifying configuration option for the field's widget
(including default widgets)
@@ -505,13 +505,10 @@ The states are shown following the order used in the field (the list in a
selection field, etc). States that are always visible are specified with the
attribute ``statusbar_visible``.
``statusbar_colors`` can be used to give a custom color to specific states.
::
<field name="state" widget="statusbar"
statusbar_visible="draft,sent,progress,invoiced,done"
statusbar_colors="{'shipping_except':'red','waiting_date':'blue'}"/>
statusbar_visible="draft,sent,progress,invoiced,done" />
The Sheet
'''''''''
+1
View File
@@ -728,6 +728,7 @@ class WorkerHTTP(Worker):
""" HTTP Request workers """
def process_request(self, client, addr):
client.setblocking(1)
client.settimeout(0.5)
client.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
# Prevent fd inherientence close_on_exec
flags = fcntl.fcntl(client, fcntl.F_GETFD) | fcntl.FD_CLOEXEC