[MERGE] forward port branch saas-11 up to 34186fd
This commit is contained in:
@@ -39,7 +39,7 @@ class AccountInvoice(models.Model):
|
||||
_order = "date_invoice desc, number desc, id desc"
|
||||
|
||||
@api.one
|
||||
@api.depends('invoice_line_ids.price_subtotal', 'tax_line_ids.amount', 'currency_id', 'company_id')
|
||||
@api.depends('invoice_line_ids.price_subtotal', 'tax_line_ids.amount', 'currency_id', 'company_id', 'date_invoice')
|
||||
def _compute_amount(self):
|
||||
self.amount_untaxed = sum(line.price_subtotal for line in self.invoice_line_ids)
|
||||
self.amount_tax = sum(line.amount for line in self.tax_line_ids)
|
||||
@@ -47,8 +47,9 @@ class AccountInvoice(models.Model):
|
||||
amount_total_company_signed = self.amount_total
|
||||
amount_untaxed_signed = self.amount_untaxed
|
||||
if self.currency_id and self.currency_id != self.company_id.currency_id:
|
||||
amount_total_company_signed = self.currency_id.compute(self.amount_total, self.company_id.currency_id)
|
||||
amount_untaxed_signed = self.currency_id.compute(self.amount_untaxed, self.company_id.currency_id)
|
||||
currency_id = self.currency_id.with_context(date=self.date_invoice)
|
||||
amount_total_company_signed = currency_id.compute(self.amount_total, self.company_id.currency_id)
|
||||
amount_untaxed_signed = currency_id.compute(self.amount_untaxed, self.company_id.currency_id)
|
||||
sign = self.type in ['in_refund', 'out_refund'] and -1 or 1
|
||||
self.amount_total_company_signed = amount_total_company_signed * sign
|
||||
self.amount_total_signed = self.amount_total * sign
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<t t-call="report.html_container">
|
||||
<t t-call="report.internal_layout">
|
||||
<div class="page">
|
||||
<h2>Aged Trial Balance</h2>
|
||||
<h2>Aged Partner Balance</h2>
|
||||
|
||||
<div class="row mt32">
|
||||
<div class="col-xs-3">
|
||||
|
||||
@@ -28,8 +28,8 @@ class AccountInvoiceLine(models.Model):
|
||||
_inherit = 'account.invoice.line'
|
||||
|
||||
asset_category_id = fields.Many2one('account.asset.category', string='Asset Category')
|
||||
asset_start_date = fields.Date(string='Asset End Date', compute='_get_asset_date', readonly=True, store=True)
|
||||
asset_end_date = fields.Date(string='Asset Start Date', compute='_get_asset_date', readonly=True, store=True)
|
||||
asset_start_date = fields.Date(string='Asset Start Date', compute='_get_asset_date', readonly=True, store=True)
|
||||
asset_end_date = fields.Date(string='Asset End Date', compute='_get_asset_date', readonly=True, store=True)
|
||||
asset_mrr = fields.Float(string='Monthly Recurring Revenue', compute='_get_asset_date', readonly=True, digits=dp.get_precision('Account'), store=True)
|
||||
|
||||
@api.one
|
||||
|
||||
@@ -1064,6 +1064,7 @@ class calendar_event(osv.Model):
|
||||
attendees[att.partner_id.id] = True
|
||||
new_attendees = []
|
||||
new_att_partner_ids = []
|
||||
attendees_to_mail = []
|
||||
for partner in event.partner_ids:
|
||||
if partner.id in attendees:
|
||||
continue
|
||||
@@ -1085,7 +1086,7 @@ class calendar_event(osv.Model):
|
||||
if not current_user.email or current_user.email != partner.email:
|
||||
mail_from = current_user.email or tools.config.get('email_from', False)
|
||||
if not context.get('no_email'):
|
||||
self.pool['calendar.attendee']._send_mail_to_attendees(cr, uid, att_id, email_from=mail_from, context=context)
|
||||
attendees_to_mail.append((att_id, mail_from, partner.name))
|
||||
|
||||
if new_attendees:
|
||||
self.write(cr, uid, [event.id], {'attendee_ids': [(4, att) for att in new_attendees]}, context=context)
|
||||
@@ -1105,6 +1106,9 @@ class calendar_event(osv.Model):
|
||||
if attendee_ids_to_remove:
|
||||
self.pool['calendar.attendee'].unlink(cr, uid, attendee_ids_to_remove, context)
|
||||
|
||||
for att_id, mail_from, partner_name in attendees_to_mail:
|
||||
self.pool['calendar.attendee']._send_mail_to_attendees(cr, uid, att_id, email_from=mail_from, context=context)
|
||||
|
||||
res[event.id] = {
|
||||
'new_attendee_ids': new_attendees,
|
||||
'old_attendee_ids': all_attendee_ids,
|
||||
|
||||
@@ -71,7 +71,8 @@ class EventMailScheduler(models.Model):
|
||||
if self.interval_type == 'after_sub':
|
||||
# update registration lines
|
||||
lines = []
|
||||
for registration in filter(lambda item: item not in [mail_reg.registration_id for mail_reg in self.mail_registration_ids], self.event_id.registration_ids):
|
||||
reg_ids = [mail_reg.registration_id for mail_reg in self.mail_registration_ids]
|
||||
for registration in filter(lambda item: item not in reg_ids, self.event_id.registration_ids):
|
||||
lines.append((0, 0, {'registration_id': registration.id}))
|
||||
if lines:
|
||||
self.write({'mail_registration_ids': lines})
|
||||
|
||||
@@ -253,7 +253,7 @@ class HrExpense(models.Model):
|
||||
# Calculate tax lines and adjust base line
|
||||
taxes = expense.tax_ids.compute_all(expense.unit_amount, expense.currency_id, expense.quantity, expense.product_id)
|
||||
account_move[-1]['price'] = taxes['total_excluded']
|
||||
account_move[-1]['tax_ids'] = expense.tax_ids.id
|
||||
account_move[-1]['tax_ids'] = expense.tax_ids.ids
|
||||
for tax in taxes['taxes']:
|
||||
account_move.append({
|
||||
'type': 'tax',
|
||||
|
||||
@@ -296,9 +296,6 @@ class Holidays(models.Model):
|
||||
"""
|
||||
date_from = self.date_from
|
||||
date_to = self.date_to
|
||||
# date_to has to be greater than date_from
|
||||
if (date_from and date_to) and (date_from > date_to):
|
||||
raise UserError(_('The start date must be anterior to the end date.'))
|
||||
|
||||
# No date_to set so far: automatically compute one 8 hours later
|
||||
if date_from and not date_to:
|
||||
@@ -316,9 +313,6 @@ class Holidays(models.Model):
|
||||
""" Update the number_of_days. """
|
||||
date_from = self.date_from
|
||||
date_to = self.date_to
|
||||
# date_to has to be greater than date_from
|
||||
if (date_from and date_to) and (date_from > date_to):
|
||||
raise UserError(_('The start date must be anterior to the end date.'))
|
||||
|
||||
# Compute and update the number of days
|
||||
if (date_to and date_from) and (date_from <= date_to):
|
||||
|
||||
@@ -484,7 +484,7 @@
|
||||
<record model="account.account.template" id="account_1120">
|
||||
<field name="name">Postbank 2</field>
|
||||
<field name="code">1120</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_de_chart_template"/>
|
||||
</record>
|
||||
@@ -708,7 +708,7 @@
|
||||
<record model="account.account.template" id="account_1010">
|
||||
<field name="name">Nebenkasse 1</field>
|
||||
<field name="code">1010</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_de_chart_template"/>
|
||||
</record>
|
||||
@@ -750,14 +750,14 @@
|
||||
<record model="account.account.template" id="account_1130">
|
||||
<field name="name">Postbank 3</field>
|
||||
<field name="code">1130</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_de_chart_template"/>
|
||||
</record>
|
||||
<record model="account.account.template" id="account_1230">
|
||||
<field name="name">Bank 3</field>
|
||||
<field name="code">1230</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_de_chart_template"/>
|
||||
</record>
|
||||
@@ -806,7 +806,7 @@
|
||||
<record model="account.account.template" id="account_1330">
|
||||
<field name="name">Schecks</field>
|
||||
<field name="code">1330</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_de_chart_template"/>
|
||||
</record>
|
||||
@@ -925,7 +925,7 @@
|
||||
<record model="account.account.template" id="account_1240">
|
||||
<field name="name">Bank 4</field>
|
||||
<field name="code">1240</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_de_chart_template"/>
|
||||
</record>
|
||||
@@ -1492,7 +1492,7 @@
|
||||
<record model="account.account.template" id="account_1190">
|
||||
<field name="name">LZB-Guthaben</field>
|
||||
<field name="code">1190</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_de_chart_template"/>
|
||||
</record>
|
||||
@@ -2850,7 +2850,7 @@
|
||||
<record model="account.account.template" id="account_1220">
|
||||
<field name="name">Bank 2</field>
|
||||
<field name="code">1220</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_de_chart_template"/>
|
||||
</record>
|
||||
@@ -3116,7 +3116,7 @@
|
||||
<record model="account.account.template" id="account_1110">
|
||||
<field name="name">Postbank 1</field>
|
||||
<field name="code">1110</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_de_chart_template"/>
|
||||
</record>
|
||||
@@ -4019,7 +4019,7 @@
|
||||
<record model="account.account.template" id="account_1020">
|
||||
<field name="name">Nebenkasse 2</field>
|
||||
<field name="code">1020</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_de_chart_template"/>
|
||||
</record>
|
||||
@@ -4796,7 +4796,7 @@
|
||||
<record model="account.account.template" id="account_1210">
|
||||
<field name="name">Bank 1</field>
|
||||
<field name="code">1210</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_de_chart_template"/>
|
||||
</record>
|
||||
@@ -5020,7 +5020,7 @@
|
||||
<record model="account.account.template" id="account_1100">
|
||||
<field name="name">Postbank</field>
|
||||
<field name="code">1100</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_de_chart_template"/>
|
||||
</record>
|
||||
@@ -6161,7 +6161,7 @@
|
||||
<record model="account.account.template" id="account_1250">
|
||||
<field name="name">Bank 5</field>
|
||||
<field name="code">1250</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_de_chart_template"/>
|
||||
</record>
|
||||
@@ -6511,7 +6511,7 @@
|
||||
<record model="account.account.template" id="account_1195">
|
||||
<field name="name">Bundesbankguthaben</field>
|
||||
<field name="code">1195</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_de_chart_template"/>
|
||||
</record>
|
||||
@@ -7218,7 +7218,7 @@
|
||||
<record model="account.account.template" id="account_1360">
|
||||
<field name="name">Geldtransit</field>
|
||||
<field name="code">1360</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_de_chart_template"/>
|
||||
</record>
|
||||
|
||||
@@ -3463,7 +3463,7 @@
|
||||
<record id="chart_skr04_1460" model="account.account.template">
|
||||
<field name="code">1460</field>
|
||||
<field name="name">Geldtransit</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_chart_de_skr04"/>
|
||||
</record>
|
||||
@@ -3615,7 +3615,7 @@
|
||||
<record id="chart_skr04_1610" model="account.account.template">
|
||||
<field name="code">1610</field>
|
||||
<field name="name">Nebenkasse 1</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_chart_de_skr04"/>
|
||||
</record>
|
||||
@@ -3623,7 +3623,7 @@
|
||||
<record id="chart_skr04_1620" model="account.account.template">
|
||||
<field name="code">1620</field>
|
||||
<field name="name">Nebenkasse 2</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_chart_de_skr04"/>
|
||||
</record>
|
||||
@@ -3631,7 +3631,7 @@
|
||||
<record id="chart_skr04_1700" model="account.account.template">
|
||||
<field name="code">1700</field>
|
||||
<field name="name">Postbank</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_chart_de_skr04"/>
|
||||
</record>
|
||||
@@ -3639,7 +3639,7 @@
|
||||
<record id="chart_skr04_1710" model="account.account.template">
|
||||
<field name="code">1710</field>
|
||||
<field name="name">Postbank 1</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_chart_de_skr04"/>
|
||||
</record>
|
||||
@@ -3647,7 +3647,7 @@
|
||||
<record id="chart_skr04_1720" model="account.account.template">
|
||||
<field name="code">1720</field>
|
||||
<field name="name">Postbank 2</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_chart_de_skr04"/>
|
||||
</record>
|
||||
@@ -3655,7 +3655,7 @@
|
||||
<record id="chart_skr04_1730" model="account.account.template">
|
||||
<field name="code">1730</field>
|
||||
<field name="name">Postbank 3</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_chart_de_skr04"/>
|
||||
</record>
|
||||
@@ -3679,7 +3679,7 @@
|
||||
<record id="chart_skr04_1810" model="account.account.template">
|
||||
<field name="code">1810</field>
|
||||
<field name="name">Bank 1</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_chart_de_skr04"/>
|
||||
</record>
|
||||
@@ -3687,7 +3687,7 @@
|
||||
<record id="chart_skr04_1820" model="account.account.template">
|
||||
<field name="code">1820</field>
|
||||
<field name="name">Bank 2</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_chart_de_skr04"/>
|
||||
</record>
|
||||
@@ -3695,7 +3695,7 @@
|
||||
<record id="chart_skr04_1830" model="account.account.template">
|
||||
<field name="code">1830</field>
|
||||
<field name="name">Bank 3</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_chart_de_skr04"/>
|
||||
</record>
|
||||
@@ -3703,7 +3703,7 @@
|
||||
<record id="chart_skr04_1840" model="account.account.template">
|
||||
<field name="code">1840</field>
|
||||
<field name="name">Bank 4</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_chart_de_skr04"/>
|
||||
</record>
|
||||
@@ -3711,7 +3711,7 @@
|
||||
<record id="chart_skr04_1850" model="account.account.template">
|
||||
<field name="code">1850</field>
|
||||
<field name="name">Bank 5</field>
|
||||
<field name="reconcile" eval="True"/>
|
||||
<field name="reconcile" eval="False"/>
|
||||
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
|
||||
<field name="chart_template_id" ref="l10n_chart_de_skr04"/>
|
||||
</record>
|
||||
|
||||
@@ -39,30 +39,55 @@
|
||||
<field name="tax_src_id" ref="tva_normale" />
|
||||
<field name="tax_dest_id" ref="tva_intra_0" />
|
||||
</record>
|
||||
<record id="fp_tax_template_intraeub2b_vt_normale_ttc" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_intraeub2b" />
|
||||
<field name="tax_src_id" ref="tva_normale_ttc" />
|
||||
<field name="tax_dest_id" ref="tva_intra_0" />
|
||||
</record>
|
||||
<!-- Taux DOM-TOM -->
|
||||
<record id="fp_tax_template_intraeub2b_vt_specifique" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_intraeub2b" />
|
||||
<field name="tax_src_id" ref="tva_specifique" />
|
||||
<field name="tax_dest_id" ref="tva_intra_0" />
|
||||
</record>
|
||||
<record id="fp_tax_template_intraeub2b_vt_specifique_ttc" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_intraeub2b" />
|
||||
<field name="tax_src_id" ref="tva_specifique_ttc" />
|
||||
<field name="tax_dest_id" ref="tva_intra_0" />
|
||||
</record>
|
||||
<!-- Taux Intermédiaire -->
|
||||
<record id="fp_tax_template_intraeub2b_vt_intermediaire" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_intraeub2b" />
|
||||
<field name="tax_src_id" ref="tva_intermediaire" />
|
||||
<field name="tax_dest_id" ref="tva_intra_0" />
|
||||
</record>
|
||||
<record id="fp_tax_template_intraeub2b_vt_intermediaire_ttc" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_intraeub2b" />
|
||||
<field name="tax_src_id" ref="tva_intermediaire_ttc" />
|
||||
<field name="tax_dest_id" ref="tva_intra_0" />
|
||||
</record>
|
||||
<!-- Taux réduit -->
|
||||
<record id="fp_tax_template_intraeub2b_vt_reduite" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_intraeub2b" />
|
||||
<field name="tax_src_id" ref="tva_reduite" />
|
||||
<field name="tax_dest_id" ref="tva_intra_0" />
|
||||
</record>
|
||||
<record id="fp_tax_template_intraeub2b_vt_reduite_ttc" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_intraeub2b" />
|
||||
<field name="tax_src_id" ref="tva_reduite_ttc" />
|
||||
<field name="tax_dest_id" ref="tva_intra_0" />
|
||||
</record>
|
||||
<!-- Taux super réduit -->
|
||||
<record id="fp_tax_template_intraeub2b_vt_super_reduite" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_intraeub2b" />
|
||||
<field name="tax_src_id" ref="tva_super_reduite" />
|
||||
<field name="tax_dest_id" ref="tva_intra_0" />
|
||||
</record>
|
||||
<record id="fp_tax_template_intraeub2b_vt_super_reduite_ttc" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_intraeub2b" />
|
||||
<field name="tax_src_id" ref="tva_super_reduite_ttc" />
|
||||
<field name="tax_dest_id" ref="tva_intra_0" />
|
||||
</record>
|
||||
<!-- achats -->
|
||||
<!-- Taux Normal -->
|
||||
<record id="fp_tax_template_intraeub2b_ha_normale_deduc" model="account.fiscal.position.tax.template">
|
||||
@@ -128,30 +153,55 @@
|
||||
<field name="tax_src_id" ref="tva_normale" />
|
||||
<field name="tax_dest_id" ref="tva_export_0" />
|
||||
</record>
|
||||
<record id="fp_tax_template_impexp_vt_normale_ttc" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import_export" />
|
||||
<field name="tax_src_id" ref="tva_normale_ttc" />
|
||||
<field name="tax_dest_id" ref="tva_export_0" />
|
||||
</record>
|
||||
<!-- Taux DOM-TOM -->
|
||||
<record id="fp_tax_template_impexp_vt_specifique" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import_export" />
|
||||
<field name="tax_src_id" ref="tva_specifique" />
|
||||
<field name="tax_dest_id" ref="tva_export_0" />
|
||||
</record>
|
||||
<record id="fp_tax_template_impexp_vt_specifique_ttc" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import_export" />
|
||||
<field name="tax_src_id" ref="tva_specifique_ttc" />
|
||||
<field name="tax_dest_id" ref="tva_export_0" />
|
||||
</record>
|
||||
<!-- Taux Intermédiare -->
|
||||
<record id="fp_tax_template_impexp_vt_intermediaire" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import_export" />
|
||||
<field name="tax_src_id" ref="tva_intermediaire" />
|
||||
<field name="tax_dest_id" ref="tva_export_0" />
|
||||
</record>
|
||||
<record id="fp_tax_template_impexp_vt_intermediaire_ttc" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import_export" />
|
||||
<field name="tax_src_id" ref="tva_intermediaire_ttc" />
|
||||
<field name="tax_dest_id" ref="tva_export_0" />
|
||||
</record>
|
||||
<!-- Taux Réduit -->
|
||||
<record id="fp_tax_template_impexp_vt_reduite" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import_export" />
|
||||
<field name="tax_src_id" ref="tva_reduite" />
|
||||
<field name="tax_dest_id" ref="tva_export_0" />
|
||||
</record>
|
||||
<record id="fp_tax_template_impexp_vt_reduite_ttc" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import_export" />
|
||||
<field name="tax_src_id" ref="tva_reduite_ttc" />
|
||||
<field name="tax_dest_id" ref="tva_export_0" />
|
||||
</record>
|
||||
<!-- Taux super réduit -->
|
||||
<record id="fp_tax_template_impexp_vt_super_reduite" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import_export" />
|
||||
<field name="tax_src_id" ref="tva_super_reduite" />
|
||||
<field name="tax_dest_id" ref="tva_export_0" />
|
||||
</record>
|
||||
<record id="fp_tax_template_impexp_vt_super_reduite_ttc" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_import_export" />
|
||||
<field name="tax_src_id" ref="tva_super_reduite_ttc" />
|
||||
<field name="tax_dest_id" ref="tva_export_0" />
|
||||
</record>
|
||||
|
||||
<!-- achats -->
|
||||
<!-- Taux Normal -->
|
||||
|
||||
@@ -33,6 +33,31 @@
|
||||
<field name="applicability">taxes</field>
|
||||
</record>
|
||||
|
||||
<record id="tax_20_0_TTC" model="account.account.tag">
|
||||
<field name="name">20.0-TTC</field>
|
||||
<field name="applicability">taxes</field>
|
||||
</record>
|
||||
|
||||
<record id="tax_10_0_TTC" model="account.account.tag">
|
||||
<field name="name">10.0-TTC</field>
|
||||
<field name="applicability">taxes</field>
|
||||
</record>
|
||||
|
||||
<record id="tax_8_5_TTC" model="account.account.tag">
|
||||
<field name="name">8.5-TTC</field>
|
||||
<field name="applicability">taxes</field>
|
||||
</record>
|
||||
|
||||
<record id="tax_5_5_TTC" model="account.account.tag">
|
||||
<field name="name">5.5-TTC</field>
|
||||
<field name="applicability">taxes</field>
|
||||
</record>
|
||||
|
||||
<record id="tax_2_1_TTC" model="account.account.tag">
|
||||
<field name="name">2.1-TTC</field>
|
||||
<field name="applicability">taxes</field>
|
||||
</record>
|
||||
|
||||
<record id="tax_ACH-8_5" model="account.account.tag">
|
||||
<field name="name">ACH-8_5</field>
|
||||
<field name="applicability">taxes</field>
|
||||
@@ -250,6 +275,77 @@
|
||||
</record>
|
||||
|
||||
|
||||
<!-- VENTES Tax INCLUDE (TTC) -->
|
||||
<record model="account.tax.template" id="tva_normale_ttc">
|
||||
<field name="chart_template_id" ref="l10n_fr_pcg_chart_template"/>
|
||||
<field name="name">TVA collectée (vente) 20,0% TTC</field>
|
||||
<field name="description">20.0-TTC</field>
|
||||
<field name="price_include" eval="1"/>
|
||||
<field name="amount" eval="20.0"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="refund_account_id" ref="pcg_445711"/>
|
||||
<field name="account_id" ref="pcg_445711"/>
|
||||
<field name="sequence" eval="10"/>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('l10n_fr.tax_20_0_TTC')])]"/>
|
||||
</record>
|
||||
|
||||
<record model="account.tax.template" id="tva_specifique_ttc">
|
||||
<field name="chart_template_id" ref="l10n_fr_pcg_chart_template"/>
|
||||
<field name="name">TVA collectée (vente) 8,5% TTC</field>
|
||||
<field name="description">8.5-TTC</field>
|
||||
<field name="price_include" eval="1"/>
|
||||
<field name="amount" eval="8.5"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="refund_account_id" ref="pcg_445713"/>
|
||||
<field name="account_id" ref="pcg_445713"/>
|
||||
<field name="sequence" eval="10"/>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('l10n_fr.tax_8_5_TTC')])]"/>
|
||||
</record>
|
||||
|
||||
<record model="account.tax.template" id="tva_intermediaire_ttc">
|
||||
<field name="chart_template_id" ref="l10n_fr_pcg_chart_template"/>
|
||||
<field name="name">TVA collectée (vente) 10,0% TTC</field>
|
||||
<field name="description">10.0-TTC</field>
|
||||
<field name="price_include" eval="1"/>
|
||||
<field name="amount" eval="10.0"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="refund_account_id" ref="pcg_445712"/>
|
||||
<field name="account_id" ref="pcg_445712"/>
|
||||
<field name="sequence" eval="10"/>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('l10n_fr.tax_10_0_TTC')])]"/>
|
||||
</record>
|
||||
|
||||
<record model="account.tax.template" id="tva_reduite_ttc">
|
||||
<field name="chart_template_id" ref="l10n_fr_pcg_chart_template"/>
|
||||
<field name="name">TVA collectée (vente) 5,5% TTC</field>
|
||||
<field name="description">5.5-TTC</field>
|
||||
<field name="price_include" eval="1"/>
|
||||
<field name="amount" eval="5.5"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="refund_account_id" ref="pcg_445713"/>
|
||||
<field name="account_id" ref="pcg_445713"/>
|
||||
<field name="sequence" eval="10"/>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('l10n_fr.tax_5_5_TTC')])]"/>
|
||||
</record>
|
||||
|
||||
<record model="account.tax.template" id="tva_super_reduite_ttc">
|
||||
<field name="chart_template_id" ref="l10n_fr_pcg_chart_template"/>
|
||||
<field name="name">TVA collectée (vente) 2,1% TTC</field>
|
||||
<field name="description">2.1-TTC</field>
|
||||
<field name="price_include" eval="1"/>
|
||||
<field name="amount" eval="2.1"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="refund_account_id" ref="pcg_445713"/>
|
||||
<field name="account_id" ref="pcg_445713"/>
|
||||
<field name="sequence" eval="10"/>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('l10n_fr.tax_2_1_TTC')])]"/>
|
||||
</record>
|
||||
|
||||
<!-- ACHATS Tax excluded from price -->
|
||||
<record model="account.tax.template" id="tva_acq_normale">
|
||||
<field name="chart_template_id" ref="l10n_fr_pcg_chart_template"/>
|
||||
|
||||
@@ -494,7 +494,7 @@ class MailTemplate(models.Model):
|
||||
)
|
||||
|
||||
# Add report in attachments: generate once for all template_res_ids
|
||||
if template.report_template and not 'report_template_in_attachment' in self.env.context:
|
||||
if template.report_template:
|
||||
for res_id in template_res_ids:
|
||||
attachments = []
|
||||
report_name = self.render_template(template.report_name, template.model, res_id)
|
||||
|
||||
@@ -1645,12 +1645,14 @@ class MailThread(models.AbstractModel):
|
||||
m2m_attachment_ids += [(4, id) for id in attachment_ids]
|
||||
# Handle attachments parameter, that is a dictionary of attachments
|
||||
for attachment in attachments:
|
||||
cid = False
|
||||
if len(attachment) == 2:
|
||||
name, content = attachment
|
||||
elif len(attachment) == 3:
|
||||
name, content, info = attachment
|
||||
if info and info.get('cid'):
|
||||
cid_mapping[info['cid']] = name
|
||||
cid = info['cid']
|
||||
cid_mapping[cid] = name
|
||||
else:
|
||||
continue
|
||||
if isinstance(content, unicode):
|
||||
@@ -1658,7 +1660,7 @@ class MailThread(models.AbstractModel):
|
||||
data_attach = {
|
||||
'name': name,
|
||||
'datas': base64.b64encode(str(content)),
|
||||
'datas_fname': name,
|
||||
'datas_fname': cid or name,
|
||||
'description': name,
|
||||
'res_model': message_data['model'],
|
||||
'res_id': message_data['res_id'],
|
||||
@@ -1671,8 +1673,11 @@ class MailThread(models.AbstractModel):
|
||||
postprocessed = False
|
||||
for node in root.iter('img'):
|
||||
if node.get('src', '').startswith('cid:'):
|
||||
fname = cid_mapping.get(node.get('src').split('cid:')[1], node.get('data-filename', ''))
|
||||
attachment = parameter_attachments.filtered(lambda attachment: attachment.name == fname)
|
||||
cid = node.get('src').split('cid:')[1]
|
||||
fname = cid_mapping.get(cid, node.get('data-filename', ''))
|
||||
attachment = parameter_attachments.filtered(lambda attachment: attachment.datas_fname == cid)
|
||||
if not attachment:
|
||||
attachment = parameter_attachments.filtered(lambda attachment: attachment.datas_fname == fname)
|
||||
if attachment:
|
||||
node.set('src', '/web/image/%s' % attachment.ids[0])
|
||||
postprocessed = True
|
||||
|
||||
@@ -192,7 +192,7 @@ class MailComposer(models.TransientModel):
|
||||
@api.multi
|
||||
def send_mail_action(self):
|
||||
# TDE/ ???
|
||||
return self.with_context(report_template_in_attachment=True).send_mail()
|
||||
return self.send_mail()
|
||||
|
||||
@api.multi
|
||||
def send_mail(self, auto_commit=False):
|
||||
@@ -358,20 +358,6 @@ class MailComposer(models.TransientModel):
|
||||
if template.user_signature and 'body_html' in values:
|
||||
signature = self.env.user.signature
|
||||
values['body_html'] = tools.append_content_to_html(values['body_html'], signature, plaintext=False)
|
||||
if template.report_template:
|
||||
attachment = self.env['ir.attachment']
|
||||
attach = self.generate_attachment_from_report(template_id, res_id)
|
||||
for attach_fname, attach_datas in attach[res_id].pop('attachments', []):
|
||||
data_attach = {
|
||||
'name': attach_fname,
|
||||
'datas': attach_datas,
|
||||
'datas_fname': attach_fname,
|
||||
'res_model': 'mail.compose.message',
|
||||
'res_id': 0,
|
||||
'type': 'binary',
|
||||
}
|
||||
values.setdefault('attachment_ids', list()).append(attachment.create(data_attach).id)
|
||||
|
||||
elif template_id:
|
||||
values = self.generate_email_for_composer(template_id, [res_id])[res_id]
|
||||
# transform attachments into attachment_ids; not attached to the document because this will
|
||||
@@ -402,13 +388,6 @@ class MailComposer(models.TransientModel):
|
||||
|
||||
return {'value': values}
|
||||
|
||||
@api.multi
|
||||
def generate_attachment_from_report(self, template_id, res_id):
|
||||
fields = ['attachment_ids']
|
||||
result = self.env['mail.template'].with_context(tpl_partners_only=True).browse(template_id).generate_email([res_id], fields=fields)
|
||||
return result
|
||||
|
||||
|
||||
@api.multi
|
||||
def save_as_template(self):
|
||||
""" hit save as template button: current form value will be a new
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
<group>
|
||||
<field name="user_id" attrs="{'readonly': [('state','not in',('draft','in_progress','open'))]}"/>
|
||||
<field name="type_id" attrs="{'readonly': [('state','not in',('draft','in_progress','open'))]}" widget="selection"/>
|
||||
<field name="vendor_id"/>
|
||||
<field name="vendor_id" context="{'search_default_supplier':1, 'default_supplier':1, 'default_customer':0}" domain="[('supplier','=',True)]"/>
|
||||
<field name="account_analytic_id" colspan="2" groups="purchase.group_analytic_accounting" attrs="{'readonly': [('state','not in',('draft'))]}"/>
|
||||
</group>
|
||||
<group>
|
||||
|
||||
@@ -234,8 +234,8 @@ class Product(models.Model):
|
||||
dest_loc_domain = dest_loc_domain + [('location_dest_id', operator, [location.id for location in other_locations])]
|
||||
return (
|
||||
domain + loc_domain,
|
||||
domain + ['&'] + dest_loc_domain + ['!'] + loc_domain,
|
||||
domain + ['&'] + loc_domain + ['!'] + dest_loc_domain
|
||||
domain + dest_loc_domain + ['!'] + loc_domain if loc_domain else domain + dest_loc_domain,
|
||||
domain + loc_domain + ['!'] + dest_loc_domain if dest_loc_domain else domain + loc_domain
|
||||
)
|
||||
|
||||
def _search_virtual_available(self, operator, value):
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
</div>
|
||||
</group>
|
||||
<group string="Locations" groups="stock.group_stock_multi_locations">
|
||||
<field name="location_id"/>
|
||||
<field name="location_dest_id"/>
|
||||
<field name="location_id" domain="[('id', 'child_of', picking_source_location_id)]"/>
|
||||
<field name="location_dest_id" domain="[('id', 'child_of', picking_destination_location_id)]"/>
|
||||
</group>
|
||||
<group string="Packages" groups="stock.group_tracking_lot">
|
||||
<field name="package_id" attrs="{'required': [('product_id', '=', False)]}" domain="[('location_id', '=', location_id)]" context="{'location_id': location_id}"/>
|
||||
|
||||
@@ -955,7 +955,7 @@ var X2ManyListView = ListView.extend({
|
||||
field.no_rerender = true;
|
||||
current_values[field.name] = field.get('value');
|
||||
});
|
||||
var cached_records = _.filter(this.dataset.cache, function(item){return !_.isEmpty(item.values);});
|
||||
var cached_records = _.filter(this.dataset.cache, function(item){return !_.isEmpty(item.values) && !item.to_delete;});
|
||||
var valid = _.every(cached_records, function(record){
|
||||
_.each(fields, function(field){
|
||||
var value = record.values[field.name];
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
.o-flex(1, 1, auto);
|
||||
.o-flex-display();
|
||||
min-height: 0; // Allow flex to shrink this element as much as it wants
|
||||
height: 100%;
|
||||
|
||||
.o_sub_menu {
|
||||
.o-flex(0, 0, @odoo-submenu-width);
|
||||
|
||||
@@ -176,9 +176,10 @@ odoo.define('website.website', function (require) {
|
||||
});
|
||||
|
||||
/* ----- PUBLISHING STUFF ---- */
|
||||
$(document).on('click', '.js_publish_management .js_publish_btn', function () {
|
||||
$(document).on('click', '.js_publish_management .js_publish_btn', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var $data = $(this).parents(".js_publish_management:first");
|
||||
var self=this;
|
||||
ajax.jsonRpc($data.data('controller') || '/website/publish', 'call', {'id': +$data.data('id'), 'object': $data.data('object')})
|
||||
.then(function (result) {
|
||||
$data.toggleClass("css_unpublished css_published");
|
||||
|
||||
@@ -343,8 +343,8 @@ var Configurator = Dialog.extend({
|
||||
template: 'website.seo_configuration',
|
||||
events: {
|
||||
'keyup input[name=seo_page_keywords]': 'confirmKeyword',
|
||||
'keyup input[name=seo_page_title]': 'titleChanged',
|
||||
'keyup textarea[name=seo_page_description]': 'descriptionChanged',
|
||||
'blur input[name=seo_page_title]': 'titleChanged',
|
||||
'blur textarea[name=seo_page_description]': 'descriptionChanged',
|
||||
'click button[data-action=add]': 'addKeyword',
|
||||
},
|
||||
canEditTitle: false,
|
||||
|
||||
@@ -100,8 +100,12 @@ odoo.define('website_blog.editor', function (require) {
|
||||
editor.on('save', self, function (event, img) {
|
||||
var url = self.$image.attr('src');
|
||||
self.$cover.css({"background-image": url ? 'url(' + url + ')' : "", 'min-height': $(window).height()-this.$cover.offset().top});
|
||||
self.$target.addClass('o_dirty cover cover_full');
|
||||
if (!self.$target.hasClass("cover")) {
|
||||
var $li = self.$el.find("[data-cover_class]").first();
|
||||
self.cover_class(type, $li.data("cover_class"), $li);
|
||||
}
|
||||
self.set_active();
|
||||
self.$target.addClass("o_dirty");
|
||||
});
|
||||
},
|
||||
cover_class : function(type, value, $li) {
|
||||
|
||||
@@ -126,12 +126,12 @@
|
||||
<div class="col-md-8 col-md-offset-2" t-ignore="True" id="main_column">
|
||||
|
||||
<div t-if="not blog_posts" class="container mb64">
|
||||
<p class="css_editable_hidden">
|
||||
<h1>No blog post yet.</h1>
|
||||
</p>
|
||||
<p groups="base.group_website_designer">
|
||||
Click on "Content" on the top menu to write your first blog post.
|
||||
</p>
|
||||
<p class="css_editable_hidden">
|
||||
<h1>No blog post yet.</h1>
|
||||
</p>
|
||||
<p groups="base.group_website_designer">
|
||||
Click on "New Page" in the top-right corner to write your first blog post.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div t-foreach="blog_posts" t-as="blog_post" class="mb32">
|
||||
|
||||
@@ -358,6 +358,7 @@
|
||||
min-height: 100px;
|
||||
position: relative;
|
||||
padding-bottom: 5px;
|
||||
padding-left: 180px;
|
||||
}
|
||||
.oe_product.oe_list .oe_product_image {
|
||||
top: 0;
|
||||
@@ -369,9 +370,10 @@
|
||||
.oe_product.oe_list section {
|
||||
position: relative;
|
||||
border: 0;
|
||||
top: 0;
|
||||
top: auto;
|
||||
bottom: auto;
|
||||
left: 180px;
|
||||
left: auto;
|
||||
right: auto;
|
||||
background: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,6 +306,7 @@
|
||||
min-height: 100px
|
||||
position: relative
|
||||
padding-bottom: 5px
|
||||
padding-left: 180px
|
||||
.oe_product_image
|
||||
top: 0
|
||||
bottom: 0
|
||||
@@ -315,9 +316,10 @@
|
||||
section
|
||||
position: relative
|
||||
border: 0
|
||||
top: 0
|
||||
top: auto
|
||||
bottom: auto
|
||||
left: 180px
|
||||
left: auto
|
||||
right: auto
|
||||
background: transparent
|
||||
|
||||
.oe_website_sale .row .row .col-md-12
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
|
||||
Greece, 2016-09-23
|
||||
|
||||
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,
|
||||
|
||||
Basilis Fotopoulos bfotop@tax-solutions.gr https://github.com/bfotop
|
||||
@@ -0,0 +1,11 @@
|
||||
Cuba, 08/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,
|
||||
|
||||
Cesar Lage kaerdsar@gmail.com https://github.com/kaerdsar
|
||||
@@ -0,0 +1,11 @@
|
||||
United Kingdom, 2016-08-09
|
||||
|
||||
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,
|
||||
|
||||
Michael Brown mbrown@fensystems.co.uk https://github.com/mcb30
|
||||
@@ -61,11 +61,11 @@ refer to :ref:`setup/enterprise` (except for :ref:`setup/install/source`).
|
||||
If you wish to access the Enterprise installers/source code, you can:
|
||||
|
||||
* Go to the Download_ page and log in with your customer credentials
|
||||
* Download the source on GitHub using git_
|
||||
* Download the source on GitHub using git_(available to partners only)
|
||||
|
||||
.. note:: If you do not have access to our Enterprise repository, you can request
|
||||
it be e-mailing your sales representative or our online support with
|
||||
your subscription number and GitHub username.
|
||||
your subscription number and GitHub username. (available to partners only)
|
||||
|
||||
.. warning:: Enterprise deb and rpm packages do not have repositories, so automatic
|
||||
update will not work. Reinstalling the latest package version will be needed
|
||||
|
||||
@@ -5,9 +5,12 @@ Store database-specific configuration parameters
|
||||
"""
|
||||
|
||||
import uuid
|
||||
import logging
|
||||
|
||||
from odoo import api, fields, models
|
||||
from odoo.tools import config, ormcache
|
||||
from odoo.tools import config, ormcache, mute_logger
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
"""
|
||||
A dictionary holding some configuration parameters to be initialized when the database is created.
|
||||
@@ -34,6 +37,7 @@ class IrConfigParameter(models.Model):
|
||||
]
|
||||
|
||||
@api.model_cr
|
||||
@mute_logger('openerp.addons.base.ir.ir_config_parameter')
|
||||
def init(self, force=False):
|
||||
"""
|
||||
Initializes the parameters listed in _default_parameters.
|
||||
@@ -82,6 +86,8 @@ class IrConfigParameter(models.Model):
|
||||
group = self.env.ref(group_xml, raise_if_not_found=False)
|
||||
if group:
|
||||
gids.append((4, group.id))
|
||||
else:
|
||||
_logger.warning('Potential Security Issue: Group [%s] is not found.' % group_xml)
|
||||
|
||||
vals = {'value': value}
|
||||
if gids:
|
||||
|
||||
@@ -306,12 +306,16 @@ def html_translate(callback, value):
|
||||
if not value:
|
||||
return value
|
||||
|
||||
parser = etree.HTMLParser(encoding='utf-8')
|
||||
trans = XMLTranslator(callback, 'html', parser)
|
||||
wrapped = "<div>%s</div>" % encode(value)
|
||||
root = etree.fromstring(wrapped, parser)
|
||||
trans.process(root[0][0]) # html > body > div
|
||||
return trans.get_done()[5:-6] # remove tags <div> and </div>
|
||||
try:
|
||||
parser = etree.HTMLParser(encoding='utf-8')
|
||||
trans = XMLTranslator(callback, 'html', parser)
|
||||
wrapped = "<div>%s</div>" % encode(value)
|
||||
root = etree.fromstring(wrapped, parser)
|
||||
trans.process(root[0][0]) # html > body > div
|
||||
value = trans.get_done()[5:-6] # remove tags <div> and </div>
|
||||
except ValueError:
|
||||
_logger.exception("Cannot translate malformed HTML, using source value instead")
|
||||
return value
|
||||
|
||||
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user