[MERGE] Forward-port saas-11 up to 156e9d0016
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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'}"/>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"),
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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)
|
||||
|
||||
+1
-1
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user