summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2017-05-31 20:09:51 +0200
committerOlivier Dony <odo@openerp.com>2017-05-31 20:09:51 +0200
commit7e44444878760ca44cf1b22bf05d77e26c477cab (patch)
tree5aad4f460e1ce95226a90b6860f86c6fcc75c5be
parentdd8f238ff760fb1d2de775781976d2d2b3464a9a (diff)
parent156e9d00164b58cbafb7dba9018df194391fc0be (diff)
[MERGE] Forward-port saas-11 up to 156e9d00164b58cbafb7dba9018df194391fc0be
-rw-r--r--addons/calendar/models/mail_message.py2
-rw-r--r--addons/crm/models/crm_lead.py2
-rw-r--r--addons/crm/wizard/crm_lead_to_opportunity.py7
-rw-r--r--addons/mass_mailing/data/mass_mailing_data.xml14
-rw-r--r--addons/mass_mailing/views/mass_mailing_views.xml14
-rw-r--r--addons/point_of_sale/static/src/js/screens.js1
-rw-r--r--addons/point_of_sale/static/src/xml/pos.xml2
-rw-r--r--addons/point_of_sale/wizard/pos_payment.xml2
-rw-r--r--addons/product_margin/views/product_product_views.xml5
-rw-r--r--addons/project/views/project_views.xml2
-rw-r--r--addons/purchase/views/purchase_views.xml2
-rw-r--r--addons/website_form/static/src/js/website_form.js12
-rw-r--r--addons/website_mail/controllers/main.py1
-rw-r--r--addons/website_quote/models/sale_order.py7
-rw-r--r--addons/website_sale/models/sale_order.py3
-rw-r--r--doc/cla/corporate/bloopark.md1
-rw-r--r--doc/cla/corporate/eficent.md19
-rw-r--r--odoo/addons/base/ir/ir_translation.py3
-rw-r--r--odoo/models.py2
19 files changed, 68 insertions, 33 deletions
diff --git a/addons/calendar/models/mail_message.py b/addons/calendar/models/mail_message.py
index df6810ebbf3..4d5c15ead18 100644
--- a/addons/calendar/models/mail_message.py
+++ b/addons/calendar/models/mail_message.py
@@ -25,7 +25,7 @@ class Message(models.Model):
@api.model
def _find_allowed_model_wise(self, doc_model, doc_dict):
if doc_model == 'calendar.event':
- order = self._context.get('order', self._order)
+ order = self._context.get('order', self.env[doc_model]._order)
for virtual_id in self.env[doc_model].browse(doc_dict.keys()).get_recurrent_ids([], order=order):
doc_dict.setdefault(virtual_id, doc_dict[get_real_ids(virtual_id)])
return super(Message, self)._find_allowed_model_wise(doc_model, doc_dict)
diff --git a/addons/crm/models/crm_lead.py b/addons/crm/models/crm_lead.py
index b61f7b60811..bdfb34f523f 100644
--- a/addons/crm/models/crm_lead.py
+++ b/addons/crm/models/crm_lead.py
@@ -707,7 +707,7 @@ class Lead(FormatAddress, models.Model):
email_split = tools.email_split(self.email_from)
values = {
'name': name,
- 'user_id': self.user_id.id,
+ 'user_id': self.env.context.get('default_user_id') or self.user_id.id,
'comment': self.description,
'team_id': self.team_id.id,
'parent_id': parent_id,
diff --git a/addons/crm/wizard/crm_lead_to_opportunity.py b/addons/crm/wizard/crm_lead_to_opportunity.py
index 4bca3debb07..b1b6575cfe3 100644
--- a/addons/crm/wizard/crm_lead_to_opportunity.py
+++ b/addons/crm/wizard/crm_lead_to_opportunity.py
@@ -95,7 +95,9 @@ class Lead2OpportunityPartner(models.TransientModel):
leads = self.env['crm.lead'].browse(vals.get('lead_ids'))
for lead in leads:
- partner_id = self._create_partner(lead.id, self.action, vals.get('partner_id') or lead.partner_id.id)
+ self_def_user = self.with_context(default_user_id=self.user_id.id)
+ partner_id = self_def_user._create_partner(
+ lead.id, self.action, vals.get('partner_id') or lead.partner_id.id)
res = lead.convert_opportunity(partner_id, [], False)
user_ids = vals.get('user_ids')
@@ -133,9 +135,6 @@ class Lead2OpportunityPartner(models.TransientModel):
leads = self.env['crm.lead'].browse(self._context.get('active_ids', []))
values.update({'lead_ids': leads.ids, 'user_ids': [self.user_id.id]})
self._convert_opportunity(values)
- for lead in leads:
- if lead.partner_id and lead.partner_id.user_id != lead.user_id:
- self.env['res.partner'].browse(lead.partner_id.id).write({'user_id': lead.user_id.id})
return leads[0].redirect_opportunity_view()
diff --git a/addons/mass_mailing/data/mass_mailing_data.xml b/addons/mass_mailing/data/mass_mailing_data.xml
index 2e165a52806..6275794114f 100644
--- a/addons/mass_mailing/data/mass_mailing_data.xml
+++ b/addons/mass_mailing/data/mass_mailing_data.xml
@@ -21,5 +21,19 @@
<field name="name">Newsletter</field>
</record>
+ <!-- Cron that process the mass mailing queue -->
+ <record id="ir_cron_mass_mailing_queue" model="ir.cron">
+ <field name="name">Process Mass Mailing Queue</field>
+ <field eval="True" name="active" />
+ <field name="user_id" ref="base.user_root" />
+ <field name="interval_number">60</field>
+ <field name="interval_type">minutes</field>
+ <field name="numbercall">-1</field>
+ <field eval="False" name="doall" />
+ <field name="model">mail.mass_mailing</field>
+ <field name="function">_process_mass_mailing_queue</field>
+ <field name="args">()</field>
+ </record>
+
</data>
</odoo>
diff --git a/addons/mass_mailing/views/mass_mailing_views.xml b/addons/mass_mailing/views/mass_mailing_views.xml
index ddd5e153696..61dedb055f5 100644
--- a/addons/mass_mailing/views/mass_mailing_views.xml
+++ b/addons/mass_mailing/views/mass_mailing_views.xml
@@ -743,20 +743,6 @@
</field>
</record>
- <!-- Cron that process the mass mailing queue -->
- <record id="ir_cron_mass_mailing_queue" model="ir.cron">
- <field name="name">Process Mass Mailing Queue</field>
- <field eval="True" name="active" />
- <field name="user_id" ref="base.user_root" />
- <field name="interval_number">60</field>
- <field name="interval_type">minutes</field>
- <field name="numbercall">-1</field>
- <field eval="False" name="doall" />
- <field name="model">mail.mass_mailing</field>
- <field name="function">_process_mass_mailing_queue</field>
- <field name="args">()</field>
- </record>
-
<menuitem name="Campaigns" id="menu_email_campaigns"
parent="mass_mailing_menu_root" sequence="5"
action="action_view_mass_mailing_campaigns"
diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js
index 8c4efac4d0e..301b6e667bd 100644
--- a/addons/point_of_sale/static/src/js/screens.js
+++ b/addons/point_of_sale/static/src/js/screens.js
@@ -1447,6 +1447,7 @@ var ReceiptScreenWidget = ScreenWidget.extend({
print_xml: function() {
var env = {
widget: this,
+ pos: this.pos,
order: this.pos.get_order(),
receipt: this.pos.get_order().export_for_printing(),
paymentlines: this.pos.get_order().get_paymentlines()
diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml
index 84cd88591f4..b1292d47d86 100644
--- a/addons/point_of_sale/static/src/xml/pos.xml
+++ b/addons/point_of_sale/static/src/xml/pos.xml
@@ -738,7 +738,7 @@
<t t-if='simple'>
<line>
<left><t t-esc='line.product_name_wrapped[0]' /></left>
- <right><value t-att-value-decimals='pos.currency.decimals'>><t t-esc='line.price_display' /></value></right>
+ <right><value t-att-value-decimals='pos.currency.decimals'><t t-esc='line.price_display' /></value></right>
</line>
<t t-call="XmlReceiptWrappedProductNameLines"/>
</t>
diff --git a/addons/point_of_sale/wizard/pos_payment.xml b/addons/point_of_sale/wizard/pos_payment.xml
index 5ab532b821f..4a784be0572 100644
--- a/addons/point_of_sale/wizard/pos_payment.xml
+++ b/addons/point_of_sale/wizard/pos_payment.xml
@@ -6,7 +6,7 @@
<field name="arch" type="xml">
<form string="Pay Order">
<group>
- <field name="journal_id" />
+ <field name="journal_id" domain="[('journal_user', '=', True)]"/>
<field name="amount" />
<field name="payment_name"/>
</group>
diff --git a/addons/product_margin/views/product_product_views.xml b/addons/product_margin/views/product_product_views.xml
index c229f770eb9..8612b355a1d 100644
--- a/addons/product_margin/views/product_product_views.xml
+++ b/addons/product_margin/views/product_product_views.xml
@@ -7,8 +7,7 @@
<field name="arch" type="xml">
<graph string="Product Margins" type="bar">
<field name="product_tmpl_id"/>
- <field name="turnover" operator="+"/>
- <field name="total_cost" operator="+"/>
+ <field name="total_margin" type="measure" operator="+"/>
</graph>
</field>
</record>
@@ -73,7 +72,7 @@
<field name="sales_gap" sum="Sales Gap"/>
<field name="total_cost" sum="Total Cost"/>
<field name="purchase_num_invoiced" string="# Purchased"/>
- <field name="total_margin"/>
+ <field name="total_margin" sum="Total Margin"/>
<field name="expected_margin"/>
<field name="total_margin_rate" widget="progressbar"/>
<field name="expected_margin_rate" widget="progressbar"/>
diff --git a/addons/project/views/project_views.xml b/addons/project/views/project_views.xml
index 8ab5e561ff9..5033eae44f9 100644
--- a/addons/project/views/project_views.xml
+++ b/addons/project/views/project_views.xml
@@ -321,7 +321,7 @@ action = model.activate_sample_project()
<field name="res_model">project.project</field>
<field name="view_type">form</field>
<field name="domain">[]</field>
- <field name="view_mode">list,form</field>
+ <field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_project_project_filter"/>
<field name="context">{}</field>
<field name="help" type="html">
diff --git a/addons/purchase/views/purchase_views.xml b/addons/purchase/views/purchase_views.xml
index 7ba8d5708f4..7bd340fff9f 100644
--- a/addons/purchase/views/purchase_views.xml
+++ b/addons/purchase/views/purchase_views.xml
@@ -320,7 +320,7 @@
<separator/>
<filter name="not_invoiced" string="Waiting Bills" domain="[('invoice_status','=', 'to invoice')]" help="Purchase orders that include lines not invoiced."/>
<filter name="invoiced" string="Bills Received" domain="[('invoice_status','=', 'invoiced')]" help="Purchase orders that have been invoiced."/>
- <filter string="New Mail" name="message_unread" domain="[('message_unread','=',True)]"/>
+ <filter string="Unread Messages" name="message_needaction" domain="[('message_needaction','=',True)]"/>
<group expand="0" string="Group By">
<filter string="Vendor" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Order Date" domain="[]" context="{'group_by':'date_order'}"/>
diff --git a/addons/website_form/static/src/js/website_form.js b/addons/website_form/static/src/js/website_form.js
index 001bc5e44c0..ff59b6186b9 100644
--- a/addons/website_form/static/src/js/website_form.js
+++ b/addons/website_form/static/src/js/website_form.js
@@ -158,13 +158,15 @@ odoo.define('website_form.animation', function (require) {
// Special cases for dates and datetimes
} else if ($(input).hasClass('o_website_form_date')) {
- return !self.is_datetime_valid(input.value, 'date');
+ if (!self.is_datetime_valid(input.value, 'date')) {
+ return true;
+ }
} else if ($(input).hasClass('o_website_form_datetime')) {
- return !self.is_datetime_valid(input.value, 'datetime');
-
- } else {
- return !input.checkValidity();
+ if (!self.is_datetime_valid(input.value, 'datetime')) {
+ return true;
+ }
}
+ return !input.checkValidity();
})
// Update field color if invalid or erroneous
diff --git a/addons/website_mail/controllers/main.py b/addons/website_mail/controllers/main.py
index 57fb68e1330..4e85c240767 100644
--- a/addons/website_mail/controllers/main.py
+++ b/addons/website_mail/controllers/main.py
@@ -56,6 +56,7 @@ def _message_post_helper(res_model='', res_id=None, message='', token='', token_
else:
if not author_id:
raise NotFound()
+ kw.pop('csrf_token', None)
return record.with_context(mail_create_nosubscribe=nosubscribe).message_post(body=message,
message_type=kw.pop('message_type', "comment"),
subtype=kw.pop('subtype', "mt_comment"),
diff --git a/addons/website_quote/models/sale_order.py b/addons/website_quote/models/sale_order.py
index d165cd67889..18e41216ddb 100644
--- a/addons/website_quote/models/sale_order.py
+++ b/addons/website_quote/models/sale_order.py
@@ -70,6 +70,13 @@ class SaleOrder(models.Model):
(2, 'Immediate after website order validation and save a token'),
], 'Payment', help="Require immediate payment by the customer when validating the order from the website quote")
+ @api.multi
+ def copy(self, default=None):
+ if self.template_id and self.template_id.number_of_days > 0:
+ default = dict(default or {})
+ default['validity_date'] = fields.Date.to_string(datetime.now() + timedelta(self.template_id.number_of_days))
+ return super(SaleOrder, self).copy(default=default)
+
@api.one
def _compute_amount_undiscounted(self):
total = 0.0
diff --git a/addons/website_sale/models/sale_order.py b/addons/website_sale/models/sale_order.py
index aca10acc9fb..59b6432e3a6 100644
--- a/addons/website_sale/models/sale_order.py
+++ b/addons/website_sale/models/sale_order.py
@@ -397,6 +397,9 @@ class Website(models.Model):
partner.write({'last_website_so_id': sale_order.id})
if sale_order:
+ # case when user emptied the cart
+ if not request.session.get('sale_order_id'):
+ request.session['sale_order_id'] = sale_order.id
# check for change of pricelist with a coupon
pricelist_id = pricelist_id or partner.property_product_pricelist.id
diff --git a/doc/cla/corporate/bloopark.md b/doc/cla/corporate/bloopark.md
index 2664bbe3006..f6eeb53698b 100644
--- a/doc/cla/corporate/bloopark.md
+++ b/doc/cla/corporate/bloopark.md
@@ -18,3 +18,4 @@ Benjamin Bachmann bBachmann@bloopark.de https://github.com/benniphx
Robert Rübner rruebner@bloopark.de https://github.com/rruebner
Florian Fischer ffischer@bloopark.de https://github.com/florianfischer
Mercerdes Scenna mscenna@bloopark.de https://github.com/mscenna
+Andrei Poehlmann andrei.poehlmann90@gmail.com https://github.com/reinka
diff --git a/doc/cla/corporate/eficent.md b/doc/cla/corporate/eficent.md
new file mode 100644
index 00000000000..3723fbf0740
--- /dev/null
+++ b/doc/cla/corporate/eficent.md
@@ -0,0 +1,19 @@
+Spain, 2017-03-21
+
+Eficent Business and IT Consulting Services, S.L. 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,
+
+Jordi Ballester jordi.ballester@eficent.com https://github.com/jbeficent
+
+List of contributors:
+
+Aarón Henríquez ahenriquez@eficent.com https://github.com/aheficent
+Lois Rilo lois.rilo@eficent.com https://github.com/lreficent
+Gisela Mora gisela.mora@eficent.com https://github.com/gmeficent
+Miquel Raich miquel.raich@eficent.com https://github.com/mreficent
+Jordi Ballester jordi.ballester@eficent.com https://github.com/jbeficent
diff --git a/odoo/addons/base/ir/ir_translation.py b/odoo/addons/base/ir/ir_translation.py
index 46f3dbba1a0..a6a45126e04 100644
--- a/odoo/addons/base/ir/ir_translation.py
+++ b/odoo/addons/base/ir/ir_translation.py
@@ -562,6 +562,9 @@ class IrTranslation(models.Model):
# (trans.value -> trans.src) gives the original value back
value0 = field.translate(lambda term: None, record[fname])
value1 = field.translate({trans.src: trans.value}.get, value0)
+ # don't check the reverse if no translation happened
+ if value0 == value1:
+ continue
value2 = field.translate({trans.value: trans.src}.get, value1)
if value2 != value0:
raise ValidationError(_("Translation is not valid:\n%s") % trans.value)
diff --git a/odoo/models.py b/odoo/models.py
index 264b9e45955..2529daec444 100644
--- a/odoo/models.py
+++ b/odoo/models.py
@@ -4367,7 +4367,7 @@ class BaseModel(object):
del vals['source'] # remove source to avoid triggering _set_src
del vals['module'] # duplicated vals is not linked to any module
vals['res_id'] = target_id
- if vals['lang'] == old.env.lang:
+ if vals['lang'] == old.env.lang and field.translate is True:
# 'source' to force the call to _set_src
# 'value' needed if value is changed in copy(), want to see the new_value
vals['source'] = old_wo_lang[name]