[MERGE] forward port branch 10.0 up to 8165018058
This commit is contained in:
@@ -356,7 +356,7 @@ class account_payment(models.Model):
|
||||
if rec.payment_type == 'outbound':
|
||||
sequence_code = 'account.payment.supplier.invoice'
|
||||
rec.name = self.env['ir.sequence'].with_context(ir_sequence_date=rec.payment_date).next_by_code(sequence_code)
|
||||
if not rec.name and self.payment_type != 'transfer':
|
||||
if not rec.name and rec.payment_type != 'transfer':
|
||||
raise UserError(_("You have to define a sequence for %s in your company.") % (sequence_code,))
|
||||
|
||||
# Create the journal entry
|
||||
|
||||
@@ -35,5 +35,5 @@ class AccountCommonReport(models.TransientModel):
|
||||
data['model'] = self.env.context.get('active_model', 'ir.ui.menu')
|
||||
data['form'] = self.read(['date_from', 'date_to', 'journal_ids', 'target_move'])[0]
|
||||
used_context = self._build_contexts(data)
|
||||
data['form']['used_context'] = dict(used_context, lang=self.env.context.get('lang', 'en_US'))
|
||||
data['form']['used_context'] = dict(used_context, lang=self.env.context.get('lang') or 'en_US')
|
||||
return self._print_report(data)
|
||||
|
||||
@@ -31,7 +31,7 @@ class BaseGengoTranslations(models.TransientModel):
|
||||
res['authorized_credentials'], gengo = self.gengo_authentication()
|
||||
if 'lang_id' in fields:
|
||||
res['lang_id'] = self.env['res.lang'].search([
|
||||
('code', '=', self.env.context.get('lang', 'en_US'))
|
||||
('code', '=', self.env.context.get('lang') or 'en_US')
|
||||
], limit=1).id
|
||||
return res
|
||||
|
||||
|
||||
@@ -649,16 +649,30 @@ class Meeting(models.Model):
|
||||
date_deadline = fields.Datetime.context_timestamp(self.with_context(tz=timezone), fields.Datetime.from_string(stop))
|
||||
|
||||
# convert into string the date and time, using user formats
|
||||
date_str = date.strftime(format_date)
|
||||
time_str = date.strftime(format_time)
|
||||
date_str = date.strftime(format_date).decode('utf-8')
|
||||
time_str = date.strftime(format_time).decode('utf-8')
|
||||
|
||||
if zallday:
|
||||
display_time = _("AllDay , %s") % (date_str)
|
||||
elif zduration < 24:
|
||||
duration = date + timedelta(hours=zduration)
|
||||
display_time = _("%s at (%s To %s) (%s)") % (date_str, time_str, duration.strftime(format_time), timezone)
|
||||
duration_time = duration.strftime(format_time).decode('utf-8')
|
||||
display_time = _(u"%s at (%s To %s) (%s)") % (
|
||||
date_str,
|
||||
time_str,
|
||||
duration_time,
|
||||
timezone,
|
||||
)
|
||||
else:
|
||||
display_time = _("%s at %s To\n %s at %s (%s)") % (date_str, time_str, date_deadline.strftime(format_date), date_deadline.strftime(format_time), timezone)
|
||||
dd_date = date_deadline.strftime(format_date).decode('utf-8')
|
||||
dd_time = date_deadline.strftime(format_time).decode('utf-8')
|
||||
display_time = _(u"%s at %s To\n %s at %s (%s)") % (
|
||||
date_str,
|
||||
time_str,
|
||||
dd_date,
|
||||
dd_time,
|
||||
timezone,
|
||||
)
|
||||
return display_time
|
||||
|
||||
def _get_duration(self, start, stop):
|
||||
|
||||
@@ -492,10 +492,13 @@ class HrExpenseSheet(models.Model):
|
||||
@api.one
|
||||
@api.depends('expense_line_ids', 'expense_line_ids.total_amount', 'expense_line_ids.currency_id')
|
||||
def _compute_amount(self):
|
||||
if len(self.expense_line_ids.mapped('currency_id')) < 2:
|
||||
self.total_amount = sum(self.expense_line_ids.mapped('total_amount'))
|
||||
else:
|
||||
self.total_amount = 0.0
|
||||
total_amount = 0.0
|
||||
for expense in self.expense_line_ids:
|
||||
total_amount += expense.currency_id.with_context(
|
||||
date=expense.date,
|
||||
company_id=expense.company_id.id
|
||||
).compute(expense.total_amount, self.currency_id)
|
||||
self.total_amount = total_amount
|
||||
|
||||
# FIXME: A 4 command is missing to explicitly declare the one2many relation
|
||||
# between the sheet and the lines when using 'default_expense_line_ids':[ids]
|
||||
|
||||
@@ -77,21 +77,19 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<t t-if="len(o.mapped('expense_line_ids').mapped('currency_id')) < 2">
|
||||
<div class="row">
|
||||
<div class="col-xs-4 pull-right">
|
||||
<table class="table table-condensed">
|
||||
<tr class="border-black">
|
||||
<td><strong>Total</strong></td>
|
||||
<td class="text-right">
|
||||
<span t-field="o.total_amount"
|
||||
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-4 pull-right">
|
||||
<table class="table table-condensed">
|
||||
<tr class="border-black">
|
||||
<td><strong>Total</strong></td>
|
||||
<td class="text-right">
|
||||
<span t-field="o.total_amount"
|
||||
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
<p>Certified honest and conform,<br/>(Date and signature).<br/><br/></p>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
@@ -567,7 +567,7 @@ class HrPayslip(models.Model):
|
||||
return res
|
||||
ttyme = datetime.fromtimestamp(time.mktime(time.strptime(date_from, "%Y-%m-%d")))
|
||||
employee = self.env['hr.employee'].browse(employee_id)
|
||||
locale = self.env.context.get('lang', 'en_US')
|
||||
locale = self.env.context.get('lang') or 'en_US'
|
||||
res['value'].update({
|
||||
'name': _('Salary Slip of %s for %s') % (employee.name, tools.ustr(babel.dates.format_date(date=ttyme, format='MMMM-y', locale=locale))),
|
||||
'company_id': employee.company_id.id,
|
||||
@@ -616,7 +616,7 @@ class HrPayslip(models.Model):
|
||||
date_to = self.date_to
|
||||
|
||||
ttyme = datetime.fromtimestamp(time.mktime(time.strptime(date_from, "%Y-%m-%d")))
|
||||
locale = self.env.context.get('lang', 'en_US')
|
||||
locale = self.env.context.get('lang') or 'en_US'
|
||||
self.name = _('Salary Slip of %s for %s') % (employee.name, tools.ustr(babel.dates.format_date(date=ttyme, format='MMMM-y', locale=locale)))
|
||||
self.company_id = employee.company_id
|
||||
|
||||
|
||||
@@ -70,14 +70,14 @@ class SaleOrderLine(models.Model):
|
||||
if uom.id != components[product]['uom']:
|
||||
from_uom = uom
|
||||
to_uom = self.env['product.uom'].browse(components[product]['uom'])
|
||||
qty = from_uom._compute_quantity(qty, to_uom_id=to_uom)
|
||||
qty = from_uom._compute_quantity(qty, to_uom)
|
||||
components[product]['qty'] += qty
|
||||
else:
|
||||
# To be in the uom reference of the product
|
||||
to_uom = self.env['product.product'].browse(product).uom_id
|
||||
if uom.id != to_uom.id:
|
||||
from_uom = uom
|
||||
qty = from_uom._compute_quantity(qty, to_uom_id=to_uom)
|
||||
qty = from_uom._compute_quantity(qty, to_uom)
|
||||
components[product] = {'qty': qty, 'uom': to_uom.id}
|
||||
return components
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ class WebsiteBlog(http.Controller):
|
||||
group['date_begin'] = start
|
||||
group['date_end'] = end
|
||||
|
||||
locale = request.context.get('lang', 'en_US')
|
||||
locale = request.context.get('lang') or 'en_US'
|
||||
start = pytz.UTC.localize(fields.Datetime.from_string(start))
|
||||
tzinfo = pytz.timezone(request.context.get('tz', 'utc') or 'utc')
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ class WebsiteCrmBackend(WebsiteBackend):
|
||||
leads_graph = [{
|
||||
'0': d.strftime(DEFAULT_SERVER_DATE_FORMAT) if not previous else (d + timedelta(days=days_between)).strftime(DEFAULT_SERVER_DATE_FORMAT),
|
||||
# Respect read_group format in models.py
|
||||
'1': daily_leads_dict.get(babel.dates.format_date(d, format='dd MMM yyyy', locale=request.env.context.get('lang', 'en_US')), 0)
|
||||
'1': daily_leads_dict.get(babel.dates.format_date(d, format='dd MMM yyyy', locale=request.env.context.get('lang') or 'en_US'), 0)
|
||||
} for d in date_list]
|
||||
|
||||
return leads_graph
|
||||
|
||||
@@ -193,7 +193,7 @@ class WebsiteEventController(http.Controller):
|
||||
def get_formated_date(self, event):
|
||||
start_date = fields.Datetime.from_string(event.date_begin).date()
|
||||
end_date = fields.Datetime.from_string(event.date_end).date()
|
||||
month = babel.dates.get_month_names('abbreviated', locale=event.env.context.get('lang', 'en_US'))[start_date.month]
|
||||
month = babel.dates.get_month_names('abbreviated', locale=event.env.context.get('lang') or 'en_US')[start_date.month]
|
||||
return ('%s %s%s') % (month, start_date.strftime("%e"), (end_date != start_date and ("-" + end_date.strftime("%e")) or ""))
|
||||
|
||||
@http.route('/event/get_country_event_list', type='http', auth='public', website=True)
|
||||
|
||||
@@ -215,11 +215,11 @@
|
||||
<small>Proposed by <span t-field="track.partner_name"/></small>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<p t-field="track.description"/>
|
||||
<div t-field="track.description"/>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<h3>About The Author</h3>
|
||||
<p t-field="track.partner_biography"/>
|
||||
<div t-field="track.partner_biography"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -83,7 +83,7 @@ class WebsiteSaleBackend(WebsiteBackend):
|
||||
sales_graph = [{
|
||||
'0': d.strftime(DEFAULT_SERVER_DATE_FORMAT) if not previous else (d + timedelta(days=days_between)).strftime(DEFAULT_SERVER_DATE_FORMAT),
|
||||
# Respect read_group format in models.py
|
||||
'1': daily_sales_dict.get(babel.dates.format_date(d, format='dd MMM yyyy', locale=request.env.context.get('lang', 'en_US')), 0)
|
||||
'1': daily_sales_dict.get(babel.dates.format_date(d, format='dd MMM yyyy', locale=request.env.context.get('lang') or 'en_US'), 0)
|
||||
} for d in date_list]
|
||||
|
||||
return sales_graph
|
||||
|
||||
@@ -293,10 +293,8 @@ class WebsiteSlides(http.Controller):
|
||||
|
||||
@http.route(['/slides/add_slide'], type='json', auth='user', methods=['POST'], website=True)
|
||||
def create_slide(self, *args, **post):
|
||||
payload = request.httprequest.content_length
|
||||
# payload is total request content size so it's not exact size of file.
|
||||
# already add client validation this is for double check if client alter.
|
||||
if (payload / 1024 / 1024 > 25):
|
||||
file_size = len(post['datas']) * 3 / 4; # base64
|
||||
if (file_size / 1024.0 / 1024.0) > 25:
|
||||
return {'error': _('File is too big. File size cannot exceed 25MB')}
|
||||
|
||||
values = dict((fname, post[fname]) for fname in [
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
Belgium, 2017-09-25
|
||||
|
||||
Niboo agrees to the terms of the Odoo Corporate Contributor License
|
||||
Agreement v1.0.
|
||||
|
||||
I declare that I am authorized and able to make this agreement and sign this
|
||||
declaration.
|
||||
|
||||
Signed,
|
||||
|
||||
Samuel Lefever sam@niboo.be https://github.com/samuellefever
|
||||
|
||||
List of contributors:
|
||||
|
||||
Samuel Lefever sam@niboo.be https://github.com/samuellefever
|
||||
Pierre Faniel pierre@niboo.be https://github.com/PierreFaniel
|
||||
Jerome Guerriat jerome@niboo.be https://github.com/jguerriat
|
||||
Jeremy Van Driessche jeremy@niboo.be https://github.com/jvandri
|
||||
Gael Rabier gael@niboo.be https://github.com/gaelrabier
|
||||
Tobias Zehntner tobias@niboo.be https://github.com/twobeers83
|
||||
Alexandre Dutry alexandre@nboo.be https://github.com/AlexandreDz
|
||||
@@ -0,0 +1,11 @@
|
||||
Algeria, 2017-09-22
|
||||
|
||||
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,
|
||||
|
||||
Yasser Kaddour yasser.kaddour@gmail.com https://github.com/YasserKaddour
|
||||
@@ -786,7 +786,7 @@
|
||||
|
||||
<record id="DZD" model="res.currency">
|
||||
<field name="name">DZD</field>
|
||||
<field name="symbol">DZ</field>
|
||||
<field name="symbol">DA</field>
|
||||
<field name="rounding">0.01</field>
|
||||
<field name="active" eval="False"/>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user