[MERGE] forward port branch 9.0 up to 6690bfb

This commit is contained in:
Christophe Simonis
2016-10-24 12:48:56 +02:00
13 changed files with 74 additions and 30 deletions
@@ -257,6 +257,8 @@ class AccountBankStatement(models.Model):
def button_journal_entries(self):
context = dict(self._context or {})
context['journal_id'] = self.journal_id.id
aml = self.env['account.move.line'].search([('statement_id', 'in', self.ids)])
aml |= aml.mapped('move_id').mapped('line_ids')
return {
'name': _('Journal Items'),
'view_type': 'form',
@@ -264,7 +266,7 @@ class AccountBankStatement(models.Model):
'res_model': 'account.move.line',
'view_id': False,
'type': 'ir.actions.act_window',
'domain': [('statement_id', 'in', self.ids)],
'domain': [('id', 'in', aml.ids)],
'context': context,
}
+11 -9
View File
@@ -1311,15 +1311,17 @@ class AccountInvoiceTax(models.Model):
for invoice in self.mapped('invoice_id'):
tax_grouped[invoice.id] = invoice.get_taxes_values()
for tax in self:
key = self.env['account.tax'].browse(tax.tax_id.id).get_grouping_key({
'tax_id': tax.tax_id.id,
'account_id': tax.account_id.id,
'account_analytic_id': tax.account_analytic_id.id,
})
if tax.invoice_id and key in tax_grouped[tax.invoice_id.id]:
tax.base = tax_grouped[tax.invoice_id.id][key]['base']
else:
_logger.warning('Tax Base Amount not computable probably due to a change in an underlying tax (%s).', tax.tax_id.name)
tax.base = 0.0
if tax.tax_id:
key = tax.tax_id.get_grouping_key({
'tax_id': tax.tax_id.id,
'account_id': tax.account_id.id,
'account_analytic_id': tax.account_analytic_id.id,
})
if tax.invoice_id and key in tax_grouped[tax.invoice_id.id]:
tax.base = tax_grouped[tax.invoice_id.id][key]['base']
else:
_logger.warning('Tax Base Amount not computable probably due to a change in an underlying tax (%s).', tax.tax_id.name)
invoice_id = fields.Many2one('account.invoice', string='Invoice', ondelete='cascade', index=True)
name = fields.Char(string='Tax Description', required=True)
@@ -45,7 +45,7 @@ class AccountInvoiceReport(models.Model):
user_currency_price_total = fields.Float(string="Total Without Tax", compute='_compute_amounts_in_user_currency', digits=0)
price_average = fields.Float(string='Average Price', readonly=True, group_operator="avg")
user_currency_price_average = fields.Float(string="Average Price", compute='_compute_amounts_in_user_currency', digits=0)
currency_rate = fields.Float(string='Currency Rate', readonly=True)
currency_rate = fields.Float(string='Currency Rate', readonly=True, group_operator="avg")
nbr = fields.Integer(string='# of Lines', readonly=True) # TDE FIXME master: rename into nbr_lines
type = fields.Selection([
('out_invoice', 'Customer Invoice'),
@@ -135,8 +135,8 @@
<field name="user_id"/>
<field name="date_due"/>
<field name="origin"/>
<field name="amount_total_signed"/>
<field name="residual_signed"/>
<field name="amount_total_signed" sum="Total" />
<field name="residual_signed" sum="Amount due"/>
<field name="currency_id" invisible="1"/>
<field name="company_currency_id" invisible="1"/>
<field name="state"/>
@@ -200,8 +200,8 @@
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
<field name="date_due"/>
<field name="origin"/>
<field name="amount_total_signed"/>
<field name="residual_signed" string="To Pay"/>
<field name="amount_total_signed" sum="Total"/>
<field name="residual_signed" string="To Pay" sum="To pay"/>
<field name="currency_id" invisible="1"/>
<field name="company_currency_id" invisible="1"/>
<field name="state"/>
@@ -12,7 +12,7 @@
<field name="journal_id"/>
<field name="payment_method_id"/>
<field name="partner_id" string="Customer"/>
<field name="amount"/>
<field name="amount" sum="Amount"/>
<field name="state"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="currency_id" invisible="1"/>
@@ -31,7 +31,7 @@
<field name="journal_id"/>
<field name="payment_method_id"/>
<field name="partner_id" string="Vendor"/>
<field name="amount"/>
<field name="amount" sum="Amount"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="state"/>
<field name="currency_id" invisible="1"/>
@@ -149,7 +149,7 @@
</p>
</field>
</record>
<record id="action_account_payments_payable" model="ir.actions.act_window">
<field name="name">Payments</field>
<field name="res_model">account.payment</field>
+1 -1
View File
@@ -408,7 +408,7 @@
<span class="fa fa-tasks fa-4x"></span>
<h3><strong>Revenue Recognition</strong></h3>
<p>Use in conjunction with contracts to calculate your monthly revenue for multi-month contracts.</p>
<a t-att-href="prepare_backend_url('base.open_module_tree', 'form', 'account_asset')"
<a t-att-href="prepare_backend_url('base.open_module_tree', 'form', 'account_deferred_revenue')"
class="btn odoo_purple">
<span class="fa fa-arrow-circle-o-down"/> Install Now
</a>
+1 -1
View File
@@ -427,7 +427,7 @@ class AccountAssetDepreciationLine(models.Model):
move_check = fields.Boolean(compute='_get_move_check', string='Posted', track_visibility='always', store=True)
@api.one
@api.depends('move_id')
@api.depends('move_id', 'asset_id.account_move_ids')
def _get_move_check(self):
self.move_check = bool(self.move_id)
@@ -607,7 +607,7 @@
<field name="account_id" ref="p112341"/>
<field name="refund_account_id" ref="p20011"/>
<field name="chart_template_id" ref="indian_chart_template_standard"/>
<field name="tag_ids" eval="[(6, 0, [ref('st_tag_in_25'), ref('st_tag_in_63')])]"/>
<field name="tag_ids" eval="[(6, 0, [ref('st_tag_in_25')])]"/>
</record>
<record id="sale_edu_cess_service_tax_2" model="account.tax.template">
<field name="name">(standard)Input Education Cess @ 2% On Service Tax</field>
@@ -667,7 +667,7 @@
<field name="account_id" ref="p11232"/>
<field name="refund_account_id" ref="p20011"/>
<field name="chart_template_id" ref="indian_chart_template_standard"/>
<field name="tag_ids" eval="[(6,0,[ref('st_tag_in_33'), ref('st_tag_in_86')])]"/>
<field name="tag_ids" eval="[(6, 0, [ref('st_tag_in_33'), ref('st_tag_in_74')])]"/>
</record>
<!--output purchase tax-->
@@ -681,7 +681,7 @@
<field name="account_id" ref="p10050"/>
<field name="refund_account_id" ref="p2107"/>
<field name="chart_template_id" ref="indian_chart_template_standard"/>
<field name="tag_ids" eval="[(6,0,[ref('st_tag_in_71'), ref('st_tag_in_22')])]"/>
<field name="tag_ids" eval="[(6, 0, [ref('st_tag_in_22'), ref('st_tag_in_67')])]"/>
</record>
<record id="output_tax_12" model="account.tax.template">
<field name="name">(standard)Output Purchase Tax @ 12%</field>
@@ -693,7 +693,7 @@
<field name="account_id" ref="p10050"/>
<field name="refund_account_id" ref="p2107"/>
<field name="chart_template_id" ref="indian_chart_template_standard"/>
<field name="tag_ids" eval="[(6,0,[ref('st_tag_in_19'), ref('st_tag_in_67')])]"/>
<field name="tag_ids" eval="[(6, 0, [ref('st_tag_in_19'), ref('st_tag_in_64')])]"/>
</record>
<record id="output_tax_4" model="account.tax.template">
<field name="name">(standard)Output Purchase Tax @ 4%</field>
+1 -2
View File
@@ -1083,8 +1083,7 @@ class product_product(osv.osv):
name = variant and "%s (%s)" % (product.name, variant) or product.name
sellers = []
if partner_ids:
if variant:
sellers = [x for x in product.seller_ids if (x.name.id in partner_ids) and (x.product_id == product)]
sellers = [x for x in product.seller_ids if (x.name.id in partner_ids) and (x.product_id == product)]
if not sellers:
sellers = [x for x in product.seller_ids if (x.name.id in partner_ids) and not x.product_id]
if sellers:
+1 -1
View File
@@ -644,7 +644,7 @@ class resource_calendar_attendance(osv.osv):
'date_to': fields.date('End Date'),
'hour_from' : fields.float('Work from', required=True, help="Start and End time of working.", select=True),
'hour_to' : fields.float("Work to", required=True),
'calendar_id' : fields.many2one("resource.calendar", "Resource's Calendar", required=True),
'calendar_id' : fields.many2one("resource.calendar", "Resource's Calendar", required=True, ondelete='cascade'),
}
_order = 'dayofweek, hour_from'
+2
View File
@@ -65,6 +65,8 @@ class Planner(models.Model):
module = self.env['ir.module.module'].sudo().search([('name', '=', module_name)], limit=1)
if module:
params['id'] = module.id
else:
return "#show_enterprise"
return "/web#%s" % (urlencode(params),)
@api.model
@@ -49,6 +49,7 @@ var PlannerDialog = Widget.extend({
category_selector: 'div[menu-category-id]',
events: {
'click li a[href^="#"]:not([data-toggle="collapse"])': 'change_page',
'click a[href^="#show_enterprise"]': 'show_enterprise',
'click button.mark_as_done': 'click_on_done',
'click a.btn-next': 'change_to_next_page',
'click .o_planner_close_block span': 'close_modal',
@@ -420,7 +421,40 @@ var PlannerDialog = Widget.extend({
destroy: function() {
this.$el.modal('hide');
return this._super.apply(this, arguments);
}
},
show_enterprise: function(ev) {
ev.preventDefault();
var message = $(QWeb.render('EnterpriseUpgrade'));
var buttons = [
{
text: _t("Upgrade now"),
classes: 'btn-primary',
close: true,
click: this.confirm_upgrade,
},
{
text: _t("Cancel"),
close: true,
},
];
var dialog = new Dialog(this, {
size: 'medium',
buttons: buttons,
$content: $('<div>', {
html: message,
}),
title: _t("Odoo Enterprise"),
}).open();
// force dialog to be hover the planner
dialog.$el.parents('.modal').css('z-index', 1052);
return dialog;
},
confirm_upgrade: function() {
new Model("res.users").call("search_count", [[["share", "=", false]]]).then(function(data) {
window.location = "https://www.odoo.com/odoo-enterprise/upgrade?utm_medium=community_upgrade&num_users=" + data;
});
},
});
return {
+7 -2
View File
@@ -360,7 +360,7 @@ class HttpCase(TransactionCase):
_logger.info("phantomjs: %s", line)
if line == "ok":
break
return True
def phantom_run(self, cmd, timeout):
_logger.info('phantom_run executing %s', ' '.join(cmd))
@@ -373,8 +373,9 @@ class HttpCase(TransactionCase):
phantom = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=None)
except OSError:
raise unittest.SkipTest("PhantomJS not found")
result = False
try:
self.phantom_poll(phantom, timeout)
result = self.phantom_poll(phantom, timeout)
finally:
# kill phantomjs if phantom.exit() wasn't called in the test
if phantom.poll() is None:
@@ -383,6 +384,10 @@ class HttpCase(TransactionCase):
self._wait_remaining_requests()
# we ignore phantomjs return code as we kill it as soon as we have ok
_logger.info("phantom_run execution finished")
self.assertTrue(
result,
"PhantomJS test completed without reporting success; "
"the log may contain errors or hints.")
def _wait_remaining_requests(self):
t0 = int(time.time())