Skip to content

Commit

Permalink
[MERGE] forward port branch saas-11.4 up to a935d5b
Browse files Browse the repository at this point in the history
  • Loading branch information
KangOl committed Jun 15, 2018
2 parents ca0a382 + a935d5b commit 9f84707
Show file tree
Hide file tree
Showing 204 changed files with 3,599 additions and 961 deletions.
7 changes: 4 additions & 3 deletions addons/account/i18n/ru.po
Expand Up @@ -35,13 +35,14 @@
# Yuriy Ney <k_wizard@mail.ru>, 2017
# Yuriy Ney <kwizardn@gmail.com>, 2018
# sergeiruzkiicode <sergei.ruzki@icode.by>, 2018
# Илья Пономарев <horochiy92@gmail.com>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server saas~11.2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-22 14:10+0000\n"
"PO-Revision-Date: 2018-03-22 14:10+0000\n"
"Last-Translator: sergeiruzkiicode <sergei.ruzki@icode.by>, 2018\n"
"Last-Translator: Илья Пономарев <horochiy92@gmail.com>, 2018\n"
"Language-Team: Russian (https://www.transifex.com/odoo/teams/41243/ru/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down Expand Up @@ -4790,12 +4791,12 @@ msgstr ""
#. module: account
#: model:ir.ui.view,arch_db:account.res_config_settings_view_form
msgid "Import your bank statements in CAMT.053"
msgstr ""
msgstr "Импорт банковской выписки в формате CAMT.053"

#. module: account
#: model:ir.ui.view,arch_db:account.res_config_settings_view_form
msgid "Import your bank statements in CSV"
msgstr ""
msgstr "Импорт Банковской Выписки в формате CSV"

#. module: account
#: model:ir.ui.view,arch_db:account.res_config_settings_view_form
Expand Down
13 changes: 10 additions & 3 deletions addons/account/models/account_invoice.py
Expand Up @@ -427,7 +427,7 @@ def _get_sequence_prefix(self):
""" computes the prefix of the number that will be assigned to the first invoice/bill/refund of a journal, in order to
let the user manually change it.
"""
if not self.env.user._is_admin():
if not self.env.user._is_system():
for invoice in self:
invoice.sequence_number_next_prefix = False
invoice.sequence_number_next = ''
Expand Down Expand Up @@ -1629,6 +1629,13 @@ def get_invoice_line_account(self, type, product, fpos, company):
return accounts['income']
return accounts['expense']

def _set_currency(self):
company = self.invoice_id.company_id
currency = self.invoice_id.currency_id
if company and currency:
if company.currency_id != currency:
self.price_unit = self.price_unit * currency.with_context(dict(self._context or {}, date=self.invoice_id.date_invoice)).rate

def _set_taxes(self):
""" Used in on_change to set taxes and price."""
if self.invoice_id.type in ('out_invoice', 'out_refund'):
Expand All @@ -1647,8 +1654,10 @@ def _set_taxes(self):
prec = self.env['decimal.precision'].precision_get('Product Price')
if not self.price_unit or float_compare(self.price_unit, self.product_id.standard_price, precision_digits=prec) == 0:
self.price_unit = fix_price(self.product_id.standard_price, taxes, fp_taxes)
self._set_currency()
else:
self.price_unit = fix_price(self.product_id.lst_price, taxes, fp_taxes)
self._set_currency()

@api.onchange('product_id')
def _onchange_product_id(self):
Expand Down Expand Up @@ -1697,8 +1706,6 @@ def _onchange_product_id(self):
domain['uom_id'] = [('category_id', '=', product.uom_id.category_id.id)]

if company and currency:
if company.currency_id != currency:
self.price_unit = self.price_unit * currency.with_context(dict(self._context or {}, date=self.invoice_id.date_invoice)).rate

if self.uom_id and self.uom_id.id != product.uom_id.id:
self.price_unit = product.uom_id._compute_price(self.price_unit, self.uom_id)
Expand Down
2 changes: 1 addition & 1 deletion addons/account/models/res_config_settings.py
Expand Up @@ -14,7 +14,7 @@ class ResConfigSettings(models.TransientModel):
'account.journal',
related='company_id.currency_exchange_journal_id',
string="Exchange Gain or Loss Journal",
domain=[('type', '=', 'general')],
domain="[('company_id', '=', company_id), ('type', '=', 'general')]",
help='The accounting journal where automatic exchange differences will be registered')
has_chart_of_accounts = fields.Boolean(compute='_compute_has_chart_of_accounts', string='Company has a chart of accounts')
chart_template_id = fields.Many2one('account.chart.template', string='Template',
Expand Down
2 changes: 1 addition & 1 deletion addons/account/report/account_invoice_report_view.xml
Expand Up @@ -94,7 +94,7 @@
<filter string="Company" name="company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator orientation="vertical" />
<filter string="Date" name="date" context="{'group_by':'date'}"/>
<filter string="Due Month" name="duemonth" context="{'group_by':'date_due:month'}"/>
<filter string="Due Date" name="duemonth" context="{'group_by':'date_due:month'}"/>
<filter string="Analytic Account" name="account_analytic_id" context="{'group_by':'account_analytic_id'}" groups="analytic.group_analytic_accounting" />
</group>
</search>
Expand Down
12 changes: 7 additions & 5 deletions addons/account/views/account_journal_dashboard_view.xml
Expand Up @@ -248,14 +248,16 @@
<span><t t-esc="dashboard.account_balance"/></span>
</div>
</div>
<div class="row" name="latest_statement" t-if="dashboard.last_balance != dashboard.account_balance">
<div class="col-xs-7">
<t t-if="dashboard.last_balance != dashboard.account_balance">
<div class="row" name="latest_statement">
<div class="col-xs-7">
<span title="Latest Statement">Latest Statement</span>
</div>
<div class="col-xs-5 text-right">
</div>
<div class="col-xs-5 text-right">
<span><t t-esc="dashboard.last_balance"/></span>
</div>
</div>
</div>
</t>
</div>
</t>
<t t-name="JournalBodySalePurchase" id="account.JournalBodySalePurchase">
Expand Down
2 changes: 1 addition & 1 deletion addons/account/views/account_view.xml
Expand Up @@ -1601,7 +1601,7 @@
<filter string="Partner" name="partner" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Journal" name="journal" domain="[]" context="{'group_by':'journal_id'}"/>
<filter string="Status" name="status" domain="[]" context="{'group_by':'state'}"/>
<filter string="Date" name="date" domain="[]" context="{'group_by':'date'}" help="Journal Entries by Month"/>
<filter string="Date" name="date" domain="[]" context="{'group_by':'date'}" help="Journal Entries by Date"/>
</group>
</search>
</field>
Expand Down
2 changes: 1 addition & 1 deletion addons/account/views/report_journal.xml
Expand Up @@ -50,7 +50,7 @@
<td><span t-field="aml.date"/></td>
<td><span t-field="aml.account_id.code"/></td>
<td><span t-esc="aml.sudo().partner_id and aml.sudo().partner_id.name and aml.sudo().partner_id.name[:23] or ''"/></td>
<td><span t-esc="aml.name[:35]"/></td>
<td><span t-esc="aml.name and aml.name[:35]"/></td>
<td><span t-esc="aml.debit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></td>
<td><span t-esc="aml.credit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></td>
<td t-if="data['form']['amount_currency'] and aml.amount_currency">
Expand Down
2 changes: 1 addition & 1 deletion addons/account_asset/views/account_asset_views.xml
Expand Up @@ -303,7 +303,7 @@
<field name="category_id" string="Asset Category"/>
<field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/>
<group expand="0" string="Group By...">
<filter string="Month" name="month" domain="[]" context="{'group_by':'date'}"/>
<filter string="Date" name="month" domain="[]" context="{'group_by':'date'}"/>
<filter string="Asset Category" name="category" domain="[]" context="{'group_by':'category_id'}"/>
</group>
</search>
Expand Down
Expand Up @@ -50,7 +50,11 @@ def import_file(self):
# Create the bank statements
statement_ids, notifications = self._create_bank_statements(stmts_vals)
# Now that the import worked out, set it as the bank_statements_source of the journal
journal.bank_statements_source = 'file_import'
if journal.bank_statements_source != 'file_import':
# Use sudo() because only 'account.group_account_manager'
# has write access on 'account.journal', but 'account.group_account_user'
# must be able to import bank statement files
journal.sudo().bank_statements_source = 'file_import'
# Finally dispatch to reconciliation interface
action = self.env.ref('account.action_bank_reconcile_bank_statements')
return {
Expand Down
5 changes: 4 additions & 1 deletion addons/account_check_printing/i18n/tr.po
Expand Up @@ -8,13 +8,14 @@
# Ayhan KIZILTAN <akiziltan76@hotmail.com>, 2018
# Martin Trigaux, 2018
# Alexander B. <road2monstercat@gmail.com>, 2018
# Umur Akın <umura@projetgrup.com>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server saas~11.2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-22 14:10+0000\n"
"PO-Revision-Date: 2018-03-22 14:10+0000\n"
"Last-Translator: Alexander B. <road2monstercat@gmail.com>, 2018\n"
"Last-Translator: Umur Akın <umura@projetgrup.com>, 2018\n"
"Language-Team: Turkish (https://www.transifex.com/odoo/teams/41243/tr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down Expand Up @@ -333,6 +334,8 @@ msgid ""
"The ISO country code in two chars. \n"
"You can use this field for quick search."
msgstr ""
"İki karakterde ISO ülke kodu.\n"
"Hızlı arama için bu alanı kullanabilirsiniz."

#. module: account_check_printing
#: code:addons/account_check_printing/models/account_journal.py:26
Expand Down
2 changes: 1 addition & 1 deletion addons/analytic/views/analytic_account_views.xml
Expand Up @@ -306,7 +306,7 @@
<field name="tag_ids" widget="many2many_tags"/>
<group string="Group By..." expand="0" name="groupby">
<filter string="Analytic Account" context="{'group_by':'account_id'}" name="account_id"/>
<filter string="Tasks Month" context="{'group_by':'date'}" name="group_date"/>
<filter string="Tasks Date" context="{'group_by':'date'}" name="group_date"/>
</group>
</search>
</field>
Expand Down
2 changes: 1 addition & 1 deletion addons/base_address_city/models/res_partner.py
Expand Up @@ -10,7 +10,7 @@
class Partner(models.Model):
_inherit = 'res.partner'

country_enforce_cities = fields.Boolean(related='country_id.enforce_cities')
country_enforce_cities = fields.Boolean(related='country_id.enforce_cities', readonly=True)
city_id = fields.Many2one('res.city', string='City of Address')

@api.onchange('city_id')
Expand Down
5 changes: 4 additions & 1 deletion addons/board/static/src/js/favorite_menu.js
Expand Up @@ -99,7 +99,10 @@ FavoriteMenu.include({
})
.then(function (r) {
if (r) {
self.do_notify(_.str.sprintf(_t("'%s' added to dashboard"), name), '');
self.do_notify(
_.str.sprintf(_t("'%s' added to dashboard"), name),
_t('Please refresh your browser for the changes to take effect.')
);
} else {
self.do_warn(_t("Could not add filter to dashboard"));
}
Expand Down
2 changes: 2 additions & 0 deletions addons/crm/models/crm_lead.py
Expand Up @@ -243,6 +243,8 @@ def _onchange_partner_id(self):
@api.model
def _onchange_user_values(self, user_id):
""" returns new values when user_id has changed """
if not user_id:
return {}
if user_id and self._context.get('team_id'):
team = self.env['crm.team'].browse(self._context['team_id'])
if user_id in team.member_ids.ids:
Expand Down
2 changes: 1 addition & 1 deletion addons/crm/report/crm_activity_report_views.xml
Expand Up @@ -46,7 +46,7 @@
<filter string="Country" name="country" context="{'group_by':'country_id'}" />
<filter string="Company" name="company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<filter string="Stage" name="stage" context="{'group_by':'stage_id'}"/>
<filter string="Month" context="{'group_by':'date:month'}" name="month"/>
<filter string="Date" context="{'group_by':'date:month'}" name="month"/>
<filter string="Leads" name="group_by_opportunity" context="{'group_by':'lead_id'}" />
</group>
</search>
Expand Down
4 changes: 2 additions & 2 deletions addons/crm/report/crm_opportunity_report_views.xml
Expand Up @@ -126,8 +126,8 @@
<filter string="Company" name="company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<filter string="Stage" name="stage" context="{'group_by':'stage_id'}"/>
<separator orientation="vertical" />
<filter string="Creation Month" context="{'group_by':'create_date:month'}" name="month"/>
<filter string="Expected Closing" context="{'group_by':'date_deadline:month'}" name="date_deadline" help="Expiration Closing Month"/>
<filter string="Creation Date" context="{'group_by':'create_date:month'}" name="month"/>
<filter string="Expected Closing" context="{'group_by':'date_deadline:month'}" name="date_deadline"/>
<filter string="Conversion Date" context="{'group_by':'date_conversion:month'}" name="conversion_date" help="Conversion Date from Lead to Opportunity"/>
<filter string="Lost Reason" name="lostreason" context="{'group_by':'lost_reason'}"/>
</group>
Expand Down
4 changes: 2 additions & 2 deletions addons/crm/views/crm_lead_views.xml
Expand Up @@ -417,7 +417,7 @@
<filter string="Campaign" name="groupby_campaign" domain="[]" context="{'group_by':'campaign_id'}"/>
<filter string="Source" name="groupby_source" domain="[]" context="{'group_by':'source_id'}"/>
<filter string="Medium" name="groupby_channel" domain="[]" context="{'group_by':'medium_id'}"/>
<filter string="Creation Month" name="groupby_createmonth" domain="[]" context="{'group_by':'create_date'}"/>
<filter string="Creation Date" name="groupby_createmonth" domain="[]" context="{'group_by':'create_date'}"/>
</group>
</search>
</field>
Expand Down Expand Up @@ -689,7 +689,7 @@
<filter string="Medium" name="medium" domain="[]" context="{'group_by':'medium_id'}"/>
<filter string="Source" name="source" domain="[]" context="{'group_by':'source_id'}"/>
<separator orientation="vertical" />
<filter string="Creation Month" context="{'group_by':'create_date:month'}" name="month"/>
<filter string="Creation Date" context="{'group_by':'create_date:month'}" name="month"/>
<filter string="Expected Closing Date" name="date_deadline" context="{'group_by':'date_deadline'}"/>
<filter string="Lost Reason" name="lostreason" context="{'group_by':'lost_reason'}"/>
</group>
Expand Down
2 changes: 1 addition & 1 deletion addons/event/i18n/tr.po
Expand Up @@ -1551,7 +1551,7 @@ msgstr ""
#. module: event
#: model:ir.model,name:event.model_event_confirm
msgid "event.confirm"
msgstr ""
msgstr "event.confirm"

#. module: event
#: code:addons/event/models/event.py:503
Expand Down
7 changes: 6 additions & 1 deletion addons/event/models/event.py
Expand Up @@ -444,9 +444,14 @@ def _onchange_partner(self):
@api.multi
def message_get_suggested_recipients(self):
recipients = super(EventRegistration, self).message_get_suggested_recipients()
public_users = self.env['res.users'].sudo()
public_groups = self.env.ref("base.group_public", raise_if_not_found=False)
if public_groups:
public_users = public_groups.sudo().with_context(active_test=False).mapped("users")
try:
for attendee in self:
if attendee.partner_id:
is_public = attendee.sudo().with_context(active_test=False).partner_id.user_ids in public_users if public_users else False
if attendee.partner_id and not is_public:
attendee._message_add_suggested_recipient(recipients, partner=attendee.partner_id, reason=_('Customer'))
elif attendee.email:
attendee._message_add_suggested_recipient(recipients, email=attendee.email, reason=_('Customer Email'))
Expand Down
2 changes: 2 additions & 0 deletions addons/event/models/res_partner.py
Expand Up @@ -10,6 +10,8 @@ class ResPartner(models.Model):
event_count = fields.Integer("Events Count", compute='_compute_event_count', help="Number of events the partner has participated.")

def _compute_event_count(self):
if not self.user_has_groups('event.group_event_user'):
return
for partner in self:
partner.event_count = self.env['event.event'].search_count([('registration_ids.partner_id', 'child_of', partner.ids)])

Expand Down
2 changes: 1 addition & 1 deletion addons/event/report/event_event_templates.xml
Expand Up @@ -18,7 +18,7 @@
<img t-att-src="'data:image/png;base64,%s' % to_text(o.event_id.organizer_id.company_id.logo_web)" style="max-height:1cm; max-width:4cm;"/>
</span>
<h5 t-field="o.event_id.name"/>
<h5>( <i class="fa fa-clock-o"></i> <span itemprop="startDate" t-field="o.event_id.date_begin" t-options='{"hide_seconds": True}'> </span> <i>to</i> <span itemprop="endDate" t-field="o.event_id.date_end" t-options='{"hide_seconds": True}'> </span> )</h5>
<h5>( <i class="fa fa-clock-o"></i> <span itemprop="startDate" t-field="o.event_id.with_context(tz=o.event_id.date_tz).date_begin" t-options='{"hide_seconds": True}'> </span> <i>to</i> <span itemprop="endDate" t-field="o.event_id.with_context(tz=o.event_id.date_tz).date_end" t-options='{"hide_seconds": True}'> </span> )</h5>
</div>
<div class="row">
<div class="col-xs-12 text-center" id="o_event_name">
Expand Down
5 changes: 2 additions & 3 deletions addons/event/views/event_views.xml
Expand Up @@ -383,7 +383,7 @@
<filter string="Responsible" name="responsible" context="{'group_by': 'user_id'}"/>
<filter string="Event Category" name="event_type_id" context="{'group_by':'event_type_id'}"/>
<filter string="Status" name="status" context="{'group_by':'state'}"/>
<filter string="Start Month" name="date_begin" domain="[]" context="{'group_by':'date_begin'}"/>
<filter string="Start Date" name="date_begin" domain="[]" context="{'group_by':'date_begin'}"/>
</group>
</search>
</field>
Expand Down Expand Up @@ -539,8 +539,7 @@
<filter string="Partner" name="partner" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Event" name="group_event" domain="[]" context="{'group_by':'event_id'}"/>
<filter string="Status" name="status" domain="[]" context="{'group_by':'state'}"/>
<filter string="Registration Day" name="createday" domain="[]" context="{'group_by': 'create_date:day'}"/>
<filter string="Registration Month" name="createmonth" domain="[]" context="{'group_by': 'create_date:month'}"/>
<filter string="Registration Date" name="createmonth" domain="[]" context="{'group_by': 'create_date:month'}"/>
</group>
</search>
</field>
Expand Down
1 change: 1 addition & 0 deletions addons/event/views/res_partner_views.xml
Expand Up @@ -11,6 +11,7 @@
<button class="oe_stat_button"
type="object"
icon="fa-ticket"
groups="event.group_event_user"
name="action_event_view" attrs="{'invisible': [('event_count','=', 0)]}">
<field string="Events" name="event_count" widget="statinfo"/>
</button>
Expand Down

0 comments on commit 9f84707

Please sign in to comment.