[MERGE] forward port of branch 7.0 up to 9c77f79
This commit is contained in:
commit
c57ca80a5b
|
@ -909,7 +909,7 @@ class account_voucher(osv.osv):
|
|||
currency_id = journal.currency.id
|
||||
else:
|
||||
currency_id = journal.company_id.currency_id.id
|
||||
vals['value'].update({'currency_id': currency_id})
|
||||
vals['value'].update({'currency_id': currency_id, 'payment_rate_currency_id': currency_id})
|
||||
#in case we want to register the payment directly from an invoice, it's confusing to allow to switch the journal
|
||||
#without seeing that the amount is expressed in the journal currency, and not in the invoice currency. So to avoid
|
||||
#this common mistake, we simply reset the amount to 0 if the currency is not the invoice currency.
|
||||
|
|
|
@ -222,6 +222,7 @@
|
|||
|
||||
<field name="pay_now" invisible="1"/>
|
||||
<field name="type" invisible="True"/>
|
||||
<field name="payment_rate_currency_id" invisible="1"/>
|
||||
<group>
|
||||
<group>
|
||||
<field name="partner_id" domain="[('supplier','=',True)]" string="Supplier" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}" />
|
||||
|
|
|
@ -78,10 +78,11 @@ class account_statement_from_invoice_lines(osv.osv_memory):
|
|||
'invoice_id': line.invoice.id})
|
||||
type = 'general'
|
||||
ttype = amount < 0 and 'payment' or 'receipt'
|
||||
sign = 1
|
||||
sign = 1 if ttype == 'receipt' else -1
|
||||
if line.journal_id.type in ('sale', 'sale_refund'):
|
||||
type = 'customer'
|
||||
ttype = 'receipt'
|
||||
sign = 1
|
||||
elif line.journal_id.type in ('purchase', 'purchase_refund'):
|
||||
type = 'supplier'
|
||||
ttype = 'payment'
|
||||
|
|
|
@ -249,7 +249,7 @@ class users(osv.osv):
|
|||
return user_id
|
||||
registry = RegistryManager.get(db)
|
||||
with registry.cursor() as cr:
|
||||
cr.execute("SELECT id, active FROM res_users WHERE lower(login)=%s", (login,))
|
||||
cr.execute("SELECT id FROM res_users WHERE lower(login)=%s", (login,))
|
||||
res = cr.fetchone()
|
||||
if res:
|
||||
return False
|
||||
|
|
|
@ -2733,7 +2733,7 @@ instance.web.form.FieldTextHtml = instance.web.form.AbstractField.extend(instanc
|
|||
if (! this.get("effective_readonly")) {
|
||||
self._updating_editor = false;
|
||||
this.$textarea = this.$el.find('textarea');
|
||||
var width = ((this.node.attrs || {}).editor_width || 'auto');
|
||||
var width = ((this.node.attrs || {}).editor_width || 'calc(100% - 4px)');
|
||||
var height = ((this.node.attrs || {}).editor_height || 250);
|
||||
this.$textarea.cleditor({
|
||||
width: width, // width not including margins, borders or padding
|
||||
|
|
Loading…
Reference in New Issue