[MERGE] forward port branch saas-14 up to 9bd8a49820

This commit is contained in:
Christophe Simonis
2017-12-08 16:18:44 +01:00
12 changed files with 53 additions and 18 deletions
+1 -1
View File
@@ -213,7 +213,7 @@ class AccountInvoice(models.Model):
move_name = fields.Char(string='Journal Entry Name', readonly=False,
default=False, copy=False,
help="Technical field holding the number given to the invoice, automatically set when the invoice is validated then stored to set the same number again if the invoice is cancelled, set to draft and re-validated.")
reference = fields.Char(string='Vendor Reference',
reference = fields.Char(string='Vendor Reference', copy=False,
help="The partner reference of this invoice.", readonly=True, states={'draft': [('readonly', False)]})
reference_type = fields.Selection('_get_reference_type', string='Payment Reference',
required=True, readonly=True, states={'draft': [('readonly', False)]},
+4 -3
View File
@@ -19,13 +19,14 @@ class TestReconciliation(AccountingTestCase):
self.res_currency_model = self.registry('res.currency')
self.res_currency_rate_model = self.registry('res.currency.rate')
self.partner_agrolait_id = self.env.ref("base.res_partner_2").id
partner_agrolait = self.env.ref("base.res_partner_2")
self.partner_agrolait_id = partner_agrolait.id
self.currency_swiss_id = self.env.ref("base.CHF").id
self.currency_usd_id = self.env.ref("base.USD").id
self.currency_euro_id = self.env.ref("base.EUR").id
self.env.ref('base.main_company').write({'currency_id': self.currency_euro_id})
self.account_rcv = self.env['account.account'].search([('user_type_id', '=', self.env.ref('account.data_account_type_receivable').id)], limit=1)
self.account_rsa = self.env['account.account'].search([('user_type_id', '=', self.env.ref('account.data_account_type_payable').id)], limit=1)
self.account_rcv = partner_agrolait.property_account_receivable_id or self.env['account.account'].search([('user_type_id', '=', self.env.ref('account.data_account_type_receivable').id)], limit=1)
self.account_rsa = partner_agrolait.property_account_payable_id or self.env['account.account'].search([('user_type_id', '=', self.env.ref('account.data_account_type_payable').id)], limit=1)
self.product = self.env.ref("product.product_product_4")
self.bank_journal_euro = self.env['account.journal'].create({'name': 'Bank', 'type': 'bank', 'code': 'BNK67'})
+2 -1
View File
@@ -16,7 +16,8 @@ class HrAttendance(models.Model):
return self.env['hr.employee'].search([('user_id', '=', self.env.uid)], limit=1)
employee_id = fields.Many2one('hr.employee', string="Employee", default=_default_employee, required=True, ondelete='cascade', index=True)
department_id = fields.Many2one('hr.department', string="Department", related="employee_id.department_id")
department_id = fields.Many2one('hr.department', string="Department", related="employee_id.department_id",
readonly=True)
check_in = fields.Datetime(string="Check In", default=fields.Datetime.now, required=True)
check_out = fields.Datetime(string="Check Out")
worked_hours = fields.Float(string='Worked Hours', compute='_compute_worked_hours', store=True, readonly=True)
+1
View File
@@ -993,6 +993,7 @@ class ReportSaleDetails(models.AbstractModel):
payments = []
return {
'currency_precision': user_currency.decimal_places,
'total_paid': user_currency.round(total),
'payments': payments,
'company_name': self.env.user.company_id.name,
@@ -4,6 +4,7 @@ odoo.define('point_of_sale.devices', function (require) {
var core = require('web.core');
var Model = require('web.DataModel');
var Session = require('web.Session');
var PosBaseWidget = require('point_of_sale.BaseWidget');
var QWeb = core.qweb;
var _t = core._t;
@@ -440,6 +441,7 @@ var ProxyDevice = core.Class.extend(core.mixins.PropertiesMixin,{
var self = this;
new Model('report.point_of_sale.report_saledetails').call('get_sale_details').then(function(result){
var env = {
widget: new PosBaseWidget(self),
company: self.pos.company,
pos: self.pos,
products: result.products,
@@ -980,6 +980,9 @@ var ProductScreenWidget = ScreenWidget.extend({
this.product_categories_widget.reset_category();
this.numpad.state.reset();
}
if (this.pos.config.iface_vkeyboard && this.chrome.widget.keyboard) {
this.chrome.widget.keyboard.connect($(this.el.querySelector('.searchbox input')));
}
},
close: function(){
@@ -1326,6 +1329,7 @@ var ClientListScreenWidget = ScreenWidget.extend({
// to maintain consistent scroll.
display_client_details: function(visibility,partner,clickpos){
var self = this;
var searchbox = this.$('.searchbox input');
var contents = this.$('.client-details-contents');
var parent = this.$('.client-list').parent();
var scroll = parent.scrollTop();
@@ -1362,6 +1366,19 @@ var ClientListScreenWidget = ScreenWidget.extend({
this.details_visible = true;
this.toggle_save_button();
} else if (visibility === 'edit') {
// Connect the keyboard to the edited field
if (this.pos.config.iface_vkeyboard && this.chrome.widget.keyboard) {
contents.off('click', '.detail');
searchbox.off('click');
contents.on('click', '.detail', function(ev){
self.chrome.widget.keyboard.connect(ev.target);
self.chrome.widget.keyboard.show();
});
searchbox.on('click', function() {
self.chrome.widget.keyboard.connect($(this));
});
}
this.editing_client = true;
contents.empty();
contents.append($(QWeb.render('ClientDetailsEdit',{widget:this,partner:partner})));
@@ -1404,6 +1421,9 @@ var ClientListScreenWidget = ScreenWidget.extend({
},
close: function(){
this._super();
if (this.pos.config.iface_vkeyboard && this.chrome.widget.keyboard) {
this.chrome.widget.keyboard.hide();
}
},
});
gui.define_screen({name:'clientlist', widget: ClientListScreenWidget});
+3 -3
View File
@@ -900,7 +900,7 @@
<line t-foreach='payments' t-as='payment'>
<left><t t-esc='payment.name' /></left>
<right>
<t t-esc='payment.total'/>
<t t-esc='widget.format_currency_no_symbol(payment.total)'/>
</right>
</line>
@@ -914,7 +914,7 @@
<line t-foreach='taxes' t-as='taxe'>
<left><t t-esc='taxe.name' /></left>
<right>
<t t-esc='taxe.total'/>
<t t-esc='widget.format_currency_no_symbol(taxe.total)'/>
</right>
</line>
@@ -925,7 +925,7 @@
<line>
<left>Total:</left>
<right>
<t t-esc='total_paid'/>
<t t-esc='widget.format_currency_no_symbol(total_paid)'/>
</right>
</line>
@@ -50,7 +50,7 @@
<tbody>
<tr t-foreach='payments' t-as='payment'>
<td><t t-esc="payment['name']" /></td>
<td><t t-esc="payment['total']" /></td>
<td><t t-esc="payment['total']" t-options="{'widget': 'float', 'precision': currency_precision}"/></td>
</tr>
</tbody>
</table>
@@ -67,8 +67,8 @@
<tbody>
<tr t-foreach='taxes' t-as='tax'>
<td><t t-esc="tax['name']" /></td>
<td><t t-esc="tax['tax_amount']" /></td>
<td><t t-esc="tax['base_amount']" /></td>
<td><t t-esc="tax['tax_amount']" t-options="{'widget': 'float', 'precision': currency_precision}"/></td>
<td><t t-esc="tax['base_amount']" t-options="{'widget': 'float', 'precision': currency_precision}"/></td>
</tr>
</tbody>
</table>
@@ -76,7 +76,7 @@
<br/>
<br/>
<strong>Total: <t t-esc='total_paid'/></strong>
<strong>Total: <t t-esc='total_paid' t-options="{'widget': 'float', 'precision': currency_precision}"/></strong>
</div>
</t>
+1 -1
View File
@@ -283,7 +283,7 @@ class StockMove(models.Model):
if propagated_date_field:
current_date = datetime.strptime(move.date_expected, DEFAULT_SERVER_DATETIME_FORMAT)
new_date = datetime.strptime(vals.get(propagated_date_field), DEFAULT_SERVER_DATETIME_FORMAT)
delta = new_date - current_date
delta = relativedelta.relativedelta(new_date, current_date)
if abs(delta.days) >= move.company_id.propagation_minimum_delta:
old_move_date = datetime.strptime(move.move_dest_id.date_expected, DEFAULT_SERVER_DATETIME_FORMAT)
new_move_date = (old_move_date + relativedelta.relativedelta(days=delta.days or 0)).strftime(DEFAULT_SERVER_DATETIME_FORMAT)
+1 -1
View File
@@ -875,7 +875,7 @@ var VideoDialog = Widget.extend({
this.$iframe = this.$("iframe");
var $media = $(this.media);
if ($media.hasClass("media_iframe_video")) {
var src = $media.data('src');
var src = $media.data('oe-expression') || $media.data('src');
this.$("input#urlvideo").val(src);
this.$("input#autoplay").prop("checked", (src || "").indexOf("autoplay") >= 0);
this.get_video();
+11
View File
@@ -0,0 +1,11 @@
Hong Kong, 2017-6-9
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,
Jason auyeung112002@gmail.com https://github.com/auyeung112002
+3 -4
View File
@@ -220,12 +220,11 @@ class Lang(models.Model):
if self.env['res.users'].search([('lang', 'in', lang_codes)]):
raise UserError(_("Cannot unactivate a language that is currently used by users."))
# delete linked ir.value specifying default partner's language
default_lang = self.env['ir.values'].search([
self.env['ir.values'].search([
('key', '=', 'default'),
('name', '=', 'lang'),
('model', '=', 'res.partner')])
if default_lang and default_lang.value_unpickle in lang_codes:
default_lang.unlink()
('model', '=', 'res.partner')
]).filtered(lambda l: l.value_unpickle in lang_codes).unlink()
res = super(Lang, self).write(vals)
self.clear_caches()