[MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9835 revid:launchpad_translations_on_behalf_of_openerp-20140213064742-xiotlx8wzfhexnhc
bzr revid: dle@openerp.com-20140210160759-oybxhdwgv2q4ma5a bzr revid: odo@openerp.com-20140212122042-3m2tysmr31mtecnc bzr revid: dle@openerp.com-20140212143044-0c94q4evxl4ltwr0 bzr revid: dle@openerp.com-20140213115951-h7c2o65lgg26aosv
This commit is contained in:
commit
65257c48b5
|
@ -911,9 +911,10 @@ class account_voucher(osv.osv):
|
|||
if context.get('payment_expected_currency') and currency_id != context.get('payment_expected_currency'):
|
||||
vals['value']['amount'] = 0
|
||||
amount = 0
|
||||
res = self.onchange_partner_id(cr, uid, ids, partner_id, journal_id, amount, currency_id, ttype, date, context)
|
||||
for key in res.keys():
|
||||
vals[key].update(res[key])
|
||||
if partner_id:
|
||||
res = self.onchange_partner_id(cr, uid, ids, partner_id, journal_id, amount, currency_id, ttype, date, context)
|
||||
for key in res.keys():
|
||||
vals[key].update(res[key])
|
||||
return vals
|
||||
|
||||
def button_proforma_voucher(self, cr, uid, ids, context=None):
|
||||
|
@ -965,7 +966,7 @@ class account_voucher(osv.osv):
|
|||
res = {}
|
||||
if not partner_id:
|
||||
return res
|
||||
res = {'account_id':False}
|
||||
res = {}
|
||||
partner_pool = self.pool.get('res.partner')
|
||||
journal_pool = self.pool.get('account.journal')
|
||||
if pay_now == 'pay_later':
|
||||
|
@ -977,7 +978,8 @@ class account_voucher(osv.osv):
|
|||
account_id = partner.property_account_payable.id
|
||||
else:
|
||||
account_id = journal.default_credit_account_id.id or journal.default_debit_account_id.id
|
||||
res['account_id'] = account_id
|
||||
if account_id:
|
||||
res['account_id'] = account_id
|
||||
return {'value':res}
|
||||
|
||||
def _sel_context(self, cr, uid, voucher_id, context=None):
|
||||
|
|
|
@ -73,8 +73,14 @@
|
|||
<group>
|
||||
<group>
|
||||
<field name="type" invisible="True"/>
|
||||
<field name="partner_id" domain="[('customer','=',True)]" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Customer" context="{'search_default_customer':1, 'show_address': 1}" options='{"always_reload": True}'/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
<field name="partner_id" domain="[('customer','=',True)]" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Customer" context="{'search_default_customer':1, 'show_address': 1}" options='{"always_reload": True}'/>
|
||||
<field name="account_id"
|
||||
domain="[('type','in', ['liquidity', 'receivable'])]"/>
|
||||
<field name="pay_now" on_change="onchange_payment(pay_now, journal_id, partner_id)" required="1"/>
|
||||
<field name="date_due" attrs="{'invisible':[('pay_now','=','pay_now')]}"/>
|
||||
<field name="reference"
|
||||
attrs="{'invisible':[('pay_now','!=','pay_now')]}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="journal_id" domain="[('type','in',['sale','sale_refund'])]" widget="selection" on_change="onchange_journal(journal_id, line_cr_ids, tax_id, partner_id, date, amount, type, company_id, context)" groups="account.group_account_user"/>
|
||||
|
@ -112,15 +118,6 @@
|
|||
</div>
|
||||
<field name="amount" class="oe_subtotal_footer_separator" nolabel="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="pay_now" on_change="onchange_payment(pay_now, journal_id, partner_id)" required="1"/>
|
||||
<field name="date_due" attrs="{'invisible':[('pay_now','=','pay_now')]}"/>
|
||||
<field name="account_id"
|
||||
attrs="{'invisible':[('pay_now','!=','pay_now')]}"
|
||||
domain="[('type','=','liquidity')]"/>
|
||||
<field name="reference"
|
||||
attrs="{'invisible':[('pay_now','!=','pay_now')]}"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">
|
||||
|
@ -224,11 +221,11 @@
|
|||
<h1><label for="number" string="Purchase Receipt"/> <field name="number" class="oe_inline" readonly="1"/></h1>
|
||||
|
||||
<field name="pay_now" invisible="1"/>
|
||||
<field name="account_id" domain="[('type','=','other')]" invisible="True"/>
|
||||
<field name="type" invisible="True"/>
|
||||
<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}" />
|
||||
<field name="account_id" domain="[('type', 'in', ['liquidity', 'payable'])]"/>
|
||||
<field name="name" colspan="2"/>
|
||||
<field name="reference"/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
|
|
|
@ -258,6 +258,13 @@ class base_action_rule(osv.osv):
|
|||
if action.filter_id:
|
||||
domain = eval(action.filter_id.domain)
|
||||
ctx.update(eval(action.filter_id.context))
|
||||
if 'lang' not in ctx:
|
||||
# Filters might be language-sensitive, attempt to reuse creator lang
|
||||
# as we are usually running this as super-user in background
|
||||
[filter_meta] = action.filter_id.perm_read()
|
||||
user_id = filter_meta['write_uid'] and filter_meta['write_uid'][0] or \
|
||||
filter_meta['create_uid'][0]
|
||||
ctx['lang'] = self.pool['res.users'].browse(cr, uid, user_id).lang
|
||||
record_ids = model.search(cr, uid, domain, context=ctx)
|
||||
|
||||
# determine when action should occur for the records
|
||||
|
|
|
@ -13,6 +13,7 @@ openerp.pad = function(instance) {
|
|||
this.switch_configured();
|
||||
this.$('.oe_pad_switch').click(function() {
|
||||
self.$el.toggleClass('oe_pad_fullscreen');
|
||||
self.view.$el.find('.oe_chatter').toggle();
|
||||
});
|
||||
this.render_value();
|
||||
},
|
||||
|
|
|
@ -1036,7 +1036,7 @@ class pos_order(osv.osv):
|
|||
tax_amount = 0
|
||||
taxes = []
|
||||
for t in line.product_id.taxes_id:
|
||||
if t.company_id == current_company.id:
|
||||
if t.company_id.id == current_company.id:
|
||||
taxes.append(t)
|
||||
computed_taxes = account_tax_obj.compute_all(cr, uid, taxes, line.price_unit * (100.0-line.discount) / 100.0, line.qty)['taxes']
|
||||
|
||||
|
|
|
@ -99,13 +99,10 @@ class pos_details_summary(report_sxw.rml_parse):
|
|||
|
||||
def _get_tax_amount(self, objects):
|
||||
res = {}
|
||||
list_ids = []
|
||||
for order in objects:
|
||||
for line in order.lines:
|
||||
if len(line.product_id.taxes_id):
|
||||
tax = line.product_id.taxes_id[0]
|
||||
res[tax.name] = (line.price_unit * line.qty * (1-(line.discount or 0.0) / 100.0)) + (tax.id in list_ids and res[tax.name] or 0)
|
||||
list_ids.append(tax.id)
|
||||
for tax in line.product_id.taxes_id:
|
||||
res[tax.name] = res.setdefault(tax.name, 0.0) + (line.price_subtotal_incl - line.price_subtotal)
|
||||
return res
|
||||
|
||||
def _get_sales_total(self, objects):
|
||||
|
|
|
@ -232,7 +232,7 @@
|
|||
<blockTable colWidths="255.0,255.0" style="Table11">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P2">[[ t[0] ]]</para>
|
||||
<para style="P2">[[ t[0].name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold">[[ formatLang(t[1], currency_obj=company.currency_id) ]]</para>
|
||||
|
|
|
@ -268,12 +268,13 @@ class product_pricelist(osv.osv):
|
|||
price = 0.0
|
||||
if sinfo:
|
||||
qty_in_product_uom = qty
|
||||
product_default_uom = product_obj.read(cr, uid, [product_id], ['uom_id'])[0]['uom_id'][0]
|
||||
from_uom = context.get('uom') or product_obj.read(cr, uid, [product_id], ['uom_id'])[0]['uom_id'][0]
|
||||
supplier = supplierinfo_obj.browse(cr, uid, sinfo, context=context)[0]
|
||||
seller_uom = supplier.product_uom and supplier.product_uom.id or False
|
||||
if seller_uom and product_default_uom and product_default_uom != seller_uom:
|
||||
if seller_uom and from_uom and from_uom != seller_uom:
|
||||
qty_in_product_uom = product_uom_obj._compute_qty(cr, uid, from_uom, qty, to_uom_id=seller_uom)
|
||||
else:
|
||||
uom_price_already_computed = True
|
||||
qty_in_product_uom = product_uom_obj._compute_qty(cr, uid, product_default_uom, qty, to_uom_id=seller_uom)
|
||||
cr.execute('SELECT * ' \
|
||||
'FROM pricelist_partnerinfo ' \
|
||||
'WHERE suppinfo_id IN %s' \
|
||||
|
|
Loading…
Reference in New Issue