[MERGE] forward port branch 8.0 up to 2b8fcfc08b
This commit is contained in:
@@ -2602,7 +2602,7 @@ class account_account_template(osv.osv):
|
||||
children_acc_criteria = [('chart_template_id','=', chart_template_id)]
|
||||
if template.account_root_id.id:
|
||||
children_acc_criteria = ['|'] + children_acc_criteria + ['&',('parent_id','child_of', [template.account_root_id.id]),('chart_template_id','=', False)]
|
||||
children_acc_template = self.search(cr, uid, [('nocreate','!=',True)] + children_acc_criteria, order='id')
|
||||
children_acc_template = self.search(cr, uid, [('nocreate','!=',True)] + children_acc_criteria, order='id', context=context)
|
||||
for account_template in self.browse(cr, uid, children_acc_template, context=context):
|
||||
# skip the root of COA if it's not the main one
|
||||
if (template.account_root_id.id == account_template.id) and template.parent_id:
|
||||
|
||||
@@ -38,6 +38,7 @@ class tax_report(report_sxw.rml_parse, common_report_header):
|
||||
'based_on': 'invoices',
|
||||
'company_id': company_id,
|
||||
'display_detail': False,
|
||||
'chart_tax_id': self.pool['account.vat.declaration']._get_tax(self.cr, self.uid),
|
||||
}
|
||||
}
|
||||
self.period_ids = []
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
<field name="type" invisible="True"/>
|
||||
<group>
|
||||
<group>
|
||||
<field name="partner_id" required="1" invisible="context.get('line_type', False)" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" context="{'invoice_currency':currency_id, 'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}" string="Supplier"/>
|
||||
<field name="partner_id" required="1" invisible="context.get('line_type', False)" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" context="{'invoice_currency':currency_id, 'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}" domain="[('supplier','=',True)]" string="Supplier"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="amount" invisible="context.get('line_type', False)" on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, payment_rate_currency_id, company_id, context)" class="oe_inline" widget='monetary' options='{"currency_field": "currency_id"}'/>
|
||||
<field name="journal_id"
|
||||
|
||||
@@ -721,15 +721,15 @@ class calendar_event(osv.Model):
|
||||
return [d.astimezone(pytz.UTC) for d in rset1]
|
||||
|
||||
def _get_recurrency_end_date(self, cr, uid, id, context=None):
|
||||
data = self.read(cr, uid, id, ['final_date', 'recurrency', 'rrule_type', 'count', 'end_type', 'stop'], context=context)
|
||||
data = self.read(cr, uid, id, ['final_date', 'recurrency', 'rrule_type', 'count', 'end_type', 'stop', 'interval'], context=context)
|
||||
|
||||
if not data.get('recurrency'):
|
||||
return False
|
||||
|
||||
end_type = data.get('end_type')
|
||||
final_date = data.get('final_date')
|
||||
if end_type == 'count' and all(data.get(key) for key in ['count', 'rrule_type', 'stop']):
|
||||
count = data['count'] + 1
|
||||
if end_type == 'count' and all(data.get(key) for key in ['count', 'rrule_type', 'stop', 'interval']):
|
||||
count = (data['count'] + 1) * data['interval']
|
||||
delay, mult = {
|
||||
'daily': ('days', 1),
|
||||
'weekly': ('days', 7),
|
||||
@@ -1017,12 +1017,12 @@ class calendar_event(osv.Model):
|
||||
startdatetime = startdatetime or start
|
||||
if startdatetime:
|
||||
start = datetime.strptime(startdatetime, DEFAULT_SERVER_DATETIME_FORMAT)
|
||||
value['start_date'] = datetime.strftime(start, DEFAULT_SERVER_DATE_FORMAT)
|
||||
value['start_date'] = fields.date.context_today(self, cr, uid, context=context, timestamp=start)
|
||||
|
||||
enddatetime = enddatetime or end
|
||||
if enddatetime:
|
||||
end = datetime.strptime(enddatetime, DEFAULT_SERVER_DATETIME_FORMAT)
|
||||
value['stop_date'] = datetime.strftime(end, DEFAULT_SERVER_DATE_FORMAT)
|
||||
value['stop_date'] = fields.date.context_today(self, cr, uid, context=context, timestamp=end)
|
||||
else: # from date to datetime
|
||||
user = self.pool['res.users'].browse(cr, uid, uid, context)
|
||||
tz = pytz.timezone(user.tz) if user.tz else pytz.utc
|
||||
@@ -1350,7 +1350,7 @@ class calendar_event(osv.Model):
|
||||
data['rrule_type'] = 'monthly'
|
||||
|
||||
if r._bymonthday:
|
||||
data['day'] = r._bymonthday[0]
|
||||
data['day'] = list(r._bymonthday)[0]
|
||||
data['month_by'] = 'date'
|
||||
data['rrule_type'] = 'monthly'
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class event_ticket(models.Model):
|
||||
event_id = fields.Many2one('event.event', "Event", required=True, ondelete='cascade')
|
||||
product_id = fields.Many2one(
|
||||
'product.product', 'Product',
|
||||
required=True, domain=[("event_type_id", "!=", False)],
|
||||
required=True, domain=["|", ("event_type_id", "!=", False), ("event_ok", "=", True)],
|
||||
default=lambda self: self._default_product_id())
|
||||
registration_ids = fields.One2many('event.registration', 'event_ticket_id', 'Registrations')
|
||||
price = fields.Float('Price', digits=dp.get_precision('Product Price'))
|
||||
|
||||
@@ -205,8 +205,8 @@ class google_calendar(osv.AbstractModel):
|
||||
if not context:
|
||||
context = {}
|
||||
if event.allday:
|
||||
start_date = fields.datetime.context_timestamp(cr, uid, datetime.strptime(event.start, tools.DEFAULT_SERVER_DATETIME_FORMAT), context=context).isoformat('T').split('T')[0]
|
||||
final_date = fields.datetime.context_timestamp(cr, uid, datetime.strptime(event.stop, tools.DEFAULT_SERVER_DATETIME_FORMAT) + timedelta(days=1), context=context).isoformat('T').split('T')[0]
|
||||
start_date = event.start_date
|
||||
final_date = (datetime.strptime(event.stop_date, tools.DEFAULT_SERVER_DATE_FORMAT) + timedelta(days=1)).strftime(tools.DEFAULT_SERVER_DATE_FORMAT)
|
||||
type = 'date'
|
||||
vstype = 'dateTime'
|
||||
else:
|
||||
|
||||
@@ -32,6 +32,7 @@ from operator import attrgetter
|
||||
from openerp.exceptions import UserError, AccessError
|
||||
from openerp import tools
|
||||
from openerp.osv import fields, osv
|
||||
from openerp.tools import float_compare
|
||||
from openerp.tools.translate import _
|
||||
|
||||
|
||||
@@ -488,7 +489,8 @@ class hr_holidays(osv.osv):
|
||||
if record.holiday_type != 'employee' or record.type != 'remove' or not record.employee_id or record.holiday_status_id.limit:
|
||||
continue
|
||||
leave_days = self.pool.get('hr.holidays.status').get_days(cr, uid, [record.holiday_status_id.id], record.employee_id.id, context=context)[record.holiday_status_id.id]
|
||||
if leave_days['remaining_leaves'] < 0 or leave_days['virtual_remaining_leaves'] < 0:
|
||||
if float_compare(leave_days['remaining_leaves'], 0, precision_digits=2) == -1 or \
|
||||
float_compare(leave_days['virtual_remaining_leaves'], 0, precision_digits=2) == -1:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
+1
-1
@@ -228,7 +228,7 @@ class StockMove(osv.osv):
|
||||
production_obj.signal_workflow(cr, uid, [prod_id], 'button_produce')
|
||||
if move.production_id.id:
|
||||
self.write(cr, uid, new_moves, {'production_id': move.production_id.id}, context=context)
|
||||
res.append(new_moves)
|
||||
res.extend(new_moves)
|
||||
return res
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
|
||||
@@ -6,6 +6,7 @@ except ImportError:
|
||||
import json
|
||||
import logging
|
||||
import pprint
|
||||
import urllib
|
||||
import urllib2
|
||||
import werkzeug
|
||||
|
||||
@@ -29,7 +30,7 @@ class PaypalController(http.Controller):
|
||||
return return_url
|
||||
|
||||
def _parse_pdt_response(self, response):
|
||||
""" Parse a text reponse for a PDT verification .
|
||||
""" Parse a text response for a PDT verification .
|
||||
|
||||
:param response str: text response, structured in the following way:
|
||||
STATUS\nkey1=value1\nkey2=value2...\n
|
||||
@@ -40,6 +41,9 @@ class PaypalController(http.Controller):
|
||||
lines = filter(None, response.split('\n'))
|
||||
status = lines.pop(0)
|
||||
pdt_post = dict(line.split('=', 1) for line in lines)
|
||||
# html unescape
|
||||
for post in pdt_post:
|
||||
pdt_post[post] = urllib.unquote_plus(pdt_post[post]).decode('utf8')
|
||||
return status, pdt_post
|
||||
|
||||
def paypal_validate_data(self, **post):
|
||||
|
||||
@@ -118,7 +118,9 @@ class wizard_user(osv.osv_memory):
|
||||
|
||||
_columns = {
|
||||
'wizard_id': fields.many2one('portal.wizard', string='Wizard', required=True, ondelete='cascade'),
|
||||
'partner_id': fields.many2one('res.partner', string='Contact', required=True, readonly=True),
|
||||
'partner_id': fields.many2one(
|
||||
'res.partner', string='Contact', required=True, readonly=True,
|
||||
ondelete='cascade'),
|
||||
'email': fields.char(string='Email', size=240),
|
||||
'in_portal': fields.boolean('In Portal'),
|
||||
}
|
||||
|
||||
@@ -630,7 +630,7 @@ class product_template(osv.osv):
|
||||
else:
|
||||
company_id = context.get('force_company') or product.env.user.company_id.id
|
||||
product = product.with_context(force_company=company_id)
|
||||
res[product.id] = res[product.id] = product.sudo()[ptype]
|
||||
res[product.id] = product.sudo()[ptype]
|
||||
if ptype == 'list_price':
|
||||
res[product.id] += product._name == "product.product" and product.price_extra or 0.0
|
||||
if 'uom' in context:
|
||||
|
||||
@@ -33,7 +33,7 @@ $(document).ready(function () {
|
||||
data: {lang: openerp.website.get_context().lang},
|
||||
success: function (quantity) {
|
||||
if (!$a.hasClass('js_goto_shop')) {
|
||||
window.location.href = window.location.href.replace(/shop([\/?].*)?$/, "shop/cart");
|
||||
window.location.pathname = window.location.pathname.replace(/shop([\/?].*)?$/, "shop/cart");
|
||||
}
|
||||
var $q = $(".my_cart_quantity");
|
||||
$q.parent().parent().removeClass("hidden", !quantity);
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
Spain, 2016-04-15
|
||||
|
||||
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,
|
||||
|
||||
Javier Colmenero Fernández javierjcf@gmail.com https://github.com/javierjcf
|
||||
@@ -0,0 +1,11 @@
|
||||
Ecuador, 2016-12-13
|
||||
|
||||
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,
|
||||
|
||||
Juan Cristobal Lopez Arrieta juancristobal@gmail.com https://github.com/jclopezar
|
||||
@@ -0,0 +1,11 @@
|
||||
Cuba, 2016-12-01
|
||||
|
||||
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,
|
||||
|
||||
Rigoberto Martínez rigo1985@gmail.com https://github.com/rigo1985
|
||||
Reference in New Issue
Block a user