diff --git a/addons/account/models/company.py b/addons/account/models/company.py
index e5ba2a117c0..6259a318557 100644
--- a/addons/account/models/company.py
+++ b/addons/account/models/company.py
@@ -79,8 +79,7 @@ Best Regards,''')
account.write({'code': account.code.rstrip('0').ljust(digits, '0')})
@api.multi
- def write(self, values):
- #restrict the closing of FY if there are still unposted entries
+ def _validate_fiscalyear_lock(self, values):
if values.get('fiscalyear_lock_date'):
nb_draft_entries = self.env['account.move'].search([
('company_id', 'in', [c.id for c in self]),
@@ -88,6 +87,12 @@ Best Regards,''')
('date', '<=', values['fiscalyear_lock_date'])])
if nb_draft_entries:
raise ValidationError(_('There are still unposted entries in the period you want to lock. You should either post or delete them.'))
+
+ @api.multi
+ def write(self, values):
+ #restrict the closing of FY if there are still unposted entries
+ self._validate_fiscalyear_lock(values)
+
# Reflect the change on accounts
for company in self:
digits = values.get('accounts_code_digits') or company.accounts_code_digits
diff --git a/addons/mass_mailing/models/mass_mailing.py b/addons/mass_mailing/models/mass_mailing.py
index b94b387a0ca..96c6d688e32 100644
--- a/addons/mass_mailing/models/mass_mailing.py
+++ b/addons/mass_mailing/models/mass_mailing.py
@@ -665,7 +665,8 @@ class MassMailing(osv.Model):
email_fname = 'email_from'
if 'email' in model._fields:
email_fname = 'email'
- record_ids = model.search(cr, uid, [('id', 'in', res_ids), (email_fname, 'ilike', email)], context=context)
+ ctx = dict(context or {}, active_test=False)
+ record_ids = model.search(cr, uid, [('id', 'in', res_ids), (email_fname, 'ilike', email)], context=ctx)
model.write(cr, uid, record_ids, {'opt_out': value}, context=context)
#------------------------------------------------------
diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml
index 27966c44edd..aea418cfce6 100644
--- a/addons/point_of_sale/static/src/xml/pos.xml
+++ b/addons/point_of_sale/static/src/xml/pos.xml
@@ -731,7 +731,7 @@
-
+ >
@@ -743,19 +743,19 @@
-
+
x
-
+
-
+
@@ -767,11 +767,11 @@
--------
- Subtotal
+ Subtotal
-
+
@@ -781,7 +781,7 @@
--------
TOTAL
-
+
@@ -790,14 +790,14 @@
-
+
CHANGE
-
+
@@ -806,19 +806,19 @@
Discounts
-
+
-
+
Total Taxes
-
+
diff --git a/addons/pos_mercury/models/pos_mercury_transaction.py b/addons/pos_mercury/models/pos_mercury_transaction.py
index 05d7efdf265..ab0415ae9eb 100644
--- a/addons/pos_mercury/models/pos_mercury_transaction.py
+++ b/addons/pos_mercury/models/pos_mercury_transaction.py
@@ -15,7 +15,7 @@ class MercuryTransaction(models.Model):
_name = 'pos_mercury.mercury_transaction'
def _get_pos_session(self):
- pos_session = self.env['pos.session'].search([('state', '=', 'opened'), ('user_id', '=', self.env.uid)])
+ pos_session = self.env['pos.session'].search([('state', '=', 'opened'), ('user_id', '=', self.env.uid)], limit=1)
if not pos_session:
raise UserError("No POS session")
@@ -32,6 +32,7 @@ class MercuryTransaction(models.Model):
raise UserError("No Mercury configuration associated with the journal.")
def _setup_request(self, data):
+ # todo: in master make the client include the pos.session id and use that
pos_session = self._get_pos_session()
config = pos_session.config_id
diff --git a/addons/pos_restaurant/static/src/js/floors.js b/addons/pos_restaurant/static/src/js/floors.js
index c71342edb8e..ab2de451d03 100644
--- a/addons/pos_restaurant/static/src/js/floors.js
+++ b/addons/pos_restaurant/static/src/js/floors.js
@@ -960,4 +960,11 @@ screens.define_action_button({
},
});
+return {
+ TableGuestsButton: TableGuestsButton,
+ TransferOrderButton:TransferOrderButton,
+ TableWidget: TableWidget,
+ FloorScreenWidget: FloorScreenWidget,
+};
+
});
diff --git a/addons/report/models/report.py b/addons/report/models/report.py
index 88ee8c55351..15176685640 100644
--- a/addons/report/models/report.py
+++ b/addons/report/models/report.py
@@ -576,19 +576,23 @@ class Report(osv.Model):
"""
writer = PdfFileWriter()
streams = [] # We have to close the streams *after* PdfFilWriter's call to write()
- for document in documents:
- pdfreport = file(document, 'rb')
- streams.append(pdfreport)
- reader = PdfFileReader(pdfreport)
- for page in range(0, reader.getNumPages()):
- writer.addPage(reader.getPage(page))
+ try:
+ for document in documents:
+ pdfreport = file(document, 'rb')
+ streams.append(pdfreport)
+ reader = PdfFileReader(pdfreport)
+ for page in range(0, reader.getNumPages()):
+ writer.addPage(reader.getPage(page))
- merged_file_fd, merged_file_path = tempfile.mkstemp(suffix='.html', prefix='report.merged.tmp.')
- with closing(os.fdopen(merged_file_fd, 'w')) as merged_file:
- writer.write(merged_file)
-
- for stream in streams:
- stream.close()
+ merged_file_fd, merged_file_path = tempfile.mkstemp(suffix='.pdf', prefix='report.merged.tmp.')
+ with closing(os.fdopen(merged_file_fd, 'w')) as merged_file:
+ writer.write(merged_file)
+ finally:
+ for stream in streams:
+ try:
+ stream.close()
+ except Exception:
+ pass
return merged_file_path
diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py
index 925877b75e7..7c220f4ee7a 100644
--- a/addons/sale/wizard/sale_make_invoice_advance.py
+++ b/addons/sale/wizard/sale_make_invoice_advance.py
@@ -80,10 +80,11 @@ class SaleAdvancePaymentInv(models.TransientModel):
else:
amount = self.amount
name = _('Down Payment')
- if order.fiscal_position_id and self.product_id.taxes_id:
- tax_ids = order.fiscal_position_id.map_tax(self.product_id.taxes_id).ids
+ taxes = self.product_id.taxes_id.filtered(lambda r: not order.company_id or r.company_id == order.company_id)
+ if order.fiscal_position_id and taxes:
+ tax_ids = order.fiscal_position_id.map_tax(taxes).ids
else:
- tax_ids = self.product_id.taxes_id.ids
+ tax_ids = taxes.ids
invoice = inv_obj.create({
'name': order.client_order_ref or order.name,
@@ -138,10 +139,11 @@ class SaleAdvancePaymentInv(models.TransientModel):
raise UserError(_('The product used to invoice a down payment should have an invoice policy set to "Ordered quantities". Please update your deposit product to be able to create a deposit invoice.'))
if self.product_id.type != 'service':
raise UserError(_("The product used to invoice a down payment should be of type 'Service'. Please use another product or update this product."))
- if order.fiscal_position_id and self.product_id.taxes_id:
- tax_ids = order.fiscal_position_id.map_tax(self.product_id.taxes_id).ids
+ taxes = self.product_id.taxes_id.filtered(lambda r: not order.company_id or r.company_id == order.company_id)
+ if order.fiscal_position_id and taxes:
+ tax_ids = order.fiscal_position_id.map_tax(taxes).ids
else:
- tax_ids = self.product_id.taxes_id.ids
+ tax_ids = taxes.ids
so_line = sale_line_obj.create({
'name': _('Advance: %s') % (time.strftime('%m %Y'),),
'price_unit': amount,
diff --git a/addons/sale_timesheet/models/sale_service.py b/addons/sale_timesheet/models/sale_service.py
index d34b55f4708..e4e48dfaac6 100644
--- a/addons/sale_timesheet/models/sale_service.py
+++ b/addons/sale_timesheet/models/sale_service.py
@@ -81,7 +81,7 @@ class procurement_order(osv.osv):
'partner_id': procurement.sale_line_id and procurement.sale_line_id.order_id.partner_id.id or procurement.partner_dest_id.id,
'user_id': procurement.product_id.product_manager.id,
'procurement_id': procurement.id,
- 'description': procurement.name + '\n',
+ 'description': procurement.name + '
',
'project_id': project and project.id or False,
'company_id': procurement.company_id.id,
},context=context)
diff --git a/addons/web_editor/static/src/js/backend.js b/addons/web_editor/static/src/js/backend.js
index c6c35cff1d0..7ed4dd24f10 100644
--- a/addons/web_editor/static/src/js/backend.js
+++ b/addons/web_editor/static/src/js/backend.js
@@ -138,7 +138,7 @@ var FieldTextHtmlSimple = widget.extend({
}
},
resize: function() {
- this.$('iframe').css('height', '0px').css('height', Math.max(30, Math.min(this.$content[0] ? this.$content[0].scrollHeight : 0, 500)) + 'px');
+ this.$('> iframe.o_readonly').css('height', '0px').css('height', Math.max(30, Math.min(this.$content[0] ? this.$content[0].scrollHeight : 0, 500)) + 'px');
},
render_value: function () {
var value = this.get('value');
diff --git a/doc/cla/individual/AyoubZahid.md b/doc/cla/individual/AyoubZahid.md
new file mode 100644
index 00000000000..b501ed5efd4
--- /dev/null
+++ b/doc/cla/individual/AyoubZahid.md
@@ -0,0 +1,11 @@
+Morocco, 2016-06-26
+
+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,
+
+Ayoub Zahid azahid@agilorg.com https://github.com/AyoubZahid
diff --git a/openerp/addons/base/ir/ir_cron_view.xml b/openerp/addons/base/ir/ir_cron_view.xml
index 57232252696..610fb2383fe 100644
--- a/openerp/addons/base/ir/ir_cron_view.xml
+++ b/openerp/addons/base/ir/ir_cron_view.xml
@@ -72,6 +72,8 @@
+
+
@@ -84,7 +86,7 @@
ir.cron
form
tree,form,calendar
- {'active_test': False}
+ {'search_default_all': 1}