[MERGE] forward port of branch 7.0 up to 5f696ba
This commit is contained in:
commit
81a902a07d
|
@ -210,7 +210,7 @@ class account_analytic_plan_instance(osv.osv):
|
||||||
ana_plan_instance_obj = self.pool.get('account.analytic.plan.instance')
|
ana_plan_instance_obj = self.pool.get('account.analytic.plan.instance')
|
||||||
acct_anal_acct = self.pool.get('account.analytic.account')
|
acct_anal_acct = self.pool.get('account.analytic.account')
|
||||||
acct_anal_plan_line_obj = self.pool.get('account.analytic.plan.line')
|
acct_anal_plan_line_obj = self.pool.get('account.analytic.plan.line')
|
||||||
if context and 'journal_id' in context:
|
if context and context.get('journal_id'):
|
||||||
journal = journal_obj.browse(cr, uid, context['journal_id'], context=context)
|
journal = journal_obj.browse(cr, uid, context['journal_id'], context=context)
|
||||||
|
|
||||||
pids = ana_plan_instance_obj.search(cr, uid, [('name','=',vals['name']), ('code','=',vals['code']), ('plan_id','<>',False)], context=context)
|
pids = ana_plan_instance_obj.search(cr, uid, [('name','=',vals['name']), ('code','=',vals['code']), ('plan_id','<>',False)], context=context)
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
from openerp.osv import osv, fields
|
from openerp.osv import osv, fields
|
||||||
|
from openerp.tools.float_utils import float_round as round
|
||||||
|
|
||||||
class account_invoice_line(osv.osv):
|
class account_invoice_line(osv.osv):
|
||||||
_inherit = "account.invoice.line"
|
_inherit = "account.invoice.line"
|
||||||
|
@ -36,11 +37,12 @@ class account_invoice_line(osv.osv):
|
||||||
company_currency = inv.company_id.currency_id.id
|
company_currency = inv.company_id.currency_id.id
|
||||||
def get_price(cr, uid, inv, company_currency, i_line, price_unit):
|
def get_price(cr, uid, inv, company_currency, i_line, price_unit):
|
||||||
cur_obj = self.pool.get('res.currency')
|
cur_obj = self.pool.get('res.currency')
|
||||||
|
decimal_precision = self.pool.get('decimal.precision')
|
||||||
if inv.currency_id.id != company_currency:
|
if inv.currency_id.id != company_currency:
|
||||||
price = cur_obj.compute(cr, uid, company_currency, inv.currency_id.id, price_unit * i_line.quantity, context={'date': inv.date_invoice})
|
price = cur_obj.compute(cr, uid, company_currency, inv.currency_id.id, price_unit * i_line.quantity, context={'date': inv.date_invoice})
|
||||||
else:
|
else:
|
||||||
price = price_unit * i_line.quantity
|
price = price_unit * i_line.quantity
|
||||||
return price
|
return round(price, decimal_precision.precision_get(cr, uid, 'Account'))
|
||||||
|
|
||||||
if inv.type in ('out_invoice','out_refund'):
|
if inv.type in ('out_invoice','out_refund'):
|
||||||
for i_line in inv.invoice_line:
|
for i_line in inv.invoice_line:
|
||||||
|
@ -118,6 +120,8 @@ class account_invoice_line(osv.osv):
|
||||||
fpos = i_line.invoice_id.fiscal_position or False
|
fpos = i_line.invoice_id.fiscal_position or False
|
||||||
a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa)
|
a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa)
|
||||||
diff_res = []
|
diff_res = []
|
||||||
|
decimal_precision = self.pool.get('decimal.precision')
|
||||||
|
account_prec = decimal_precision.precision_get(cr, uid, 'Account')
|
||||||
# calculate and write down the possible price difference between invoice price and product price
|
# calculate and write down the possible price difference between invoice price and product price
|
||||||
for line in res:
|
for line in res:
|
||||||
if a == line['account_id'] and i_line.product_id.id == line['product_id']:
|
if a == line['account_id'] and i_line.product_id.id == line['product_id']:
|
||||||
|
@ -132,14 +136,14 @@ class account_invoice_line(osv.osv):
|
||||||
if valuation_stock_move:
|
if valuation_stock_move:
|
||||||
valuation_price_unit = stock_move_obj.browse(cr, uid, valuation_stock_move[0], context=context).price_unit
|
valuation_price_unit = stock_move_obj.browse(cr, uid, valuation_stock_move[0], context=context).price_unit
|
||||||
if valuation_price_unit != i_line.price_unit and line['price_unit'] == i_line.price_unit and acc:
|
if valuation_price_unit != i_line.price_unit and line['price_unit'] == i_line.price_unit and acc:
|
||||||
price_diff = i_line.price_unit - valuation_price_unit
|
price_diff = round(i_line.price_unit - valuation_price_unit, account_prec)
|
||||||
line.update({'price': valuation_price_unit * line['quantity']})
|
line.update({'price': round(valuation_price_unit * line['quantity'], account_prec)})
|
||||||
diff_res.append({
|
diff_res.append({
|
||||||
'type': 'src',
|
'type': 'src',
|
||||||
'name': i_line.name[:64],
|
'name': i_line.name[:64],
|
||||||
'price_unit': price_diff,
|
'price_unit': price_diff,
|
||||||
'quantity': line['quantity'],
|
'quantity': line['quantity'],
|
||||||
'price': price_diff * line['quantity'],
|
'price': round(price_diff * line['quantity'], account_prec),
|
||||||
'account_id': acc,
|
'account_id': acc,
|
||||||
'product_id': line['product_id'],
|
'product_id': line['product_id'],
|
||||||
'uos_id': line['uos_id'],
|
'uos_id': line['uos_id'],
|
||||||
|
|
|
@ -631,7 +631,7 @@
|
||||||
<br />
|
<br />
|
||||||
<t t-esc="widget.pos.company.name"/><br />
|
<t t-esc="widget.pos.company.name"/><br />
|
||||||
Phone: <t t-esc="widget.pos.company.phone || ''"/><br />
|
Phone: <t t-esc="widget.pos.company.phone || ''"/><br />
|
||||||
User: <t t-esc="widget.pos.user.name"/><br />
|
User: <t t-esc="widget.pos.cashier.name"/><br />
|
||||||
Shop: <t t-esc="widget.pos.shop.name"/><br />
|
Shop: <t t-esc="widget.pos.shop.name"/><br />
|
||||||
<br />
|
<br />
|
||||||
<t t-if="widget.pos.config.receipt_header">
|
<t t-if="widget.pos.config.receipt_header">
|
||||||
|
|
|
@ -16,9 +16,7 @@
|
||||||
cost_method: standard
|
cost_method: standard
|
||||||
mes_type: fixed
|
mes_type: fixed
|
||||||
name: HR Manger
|
name: HR Manger
|
||||||
procure_method: make_to_stock
|
|
||||||
standard_price: 1.0
|
standard_price: 1.0
|
||||||
supply_method: buy
|
|
||||||
type: service
|
type: service
|
||||||
uom_id: product.product_uom_hour
|
uom_id: product.product_uom_hour
|
||||||
uom_po_id: product.product_uom_hour
|
uom_po_id: product.product_uom_hour
|
||||||
|
|
|
@ -447,16 +447,15 @@ class YamlInterpreter(object):
|
||||||
args = map(lambda x: eval(x, ctx), match.group(2).split(','))
|
args = map(lambda x: eval(x, ctx), match.group(2).split(','))
|
||||||
result = getattr(model, match.group(1))(self.cr, SUPERUSER_ID, [], *args)
|
result = getattr(model, match.group(1))(self.cr, SUPERUSER_ID, [], *args)
|
||||||
for key, val in (result or {}).get('value', {}).items():
|
for key, val in (result or {}).get('value', {}).items():
|
||||||
assert key in fg, (
|
if key in fg:
|
||||||
"The field %r returned from the onchange call %r "
|
if key not in fields:
|
||||||
"does not exist in the source view %r (of object "
|
# do not shadow values explicitly set in yaml.
|
||||||
"%r). This field will be ignored (and thus not "
|
record_dict[key] = process_val(key, val)
|
||||||
"populated) when clients saves the new record" % (
|
else:
|
||||||
key, match.group(1), view_info.get('name', '?'), model._name
|
_logger.warning("The returning field '%s' from your on_change call '%s'"
|
||||||
))
|
" does not exist either on the object '%s', either in"
|
||||||
if key not in fields:
|
" the view '%s'",
|
||||||
# do not shadow values explicitly set in yaml.
|
key, match.group(1), model._name, view_info['name'])
|
||||||
record_dict[key] = process_val(key, val)
|
|
||||||
else:
|
else:
|
||||||
nodes = list(el) + nodes
|
nodes = list(el) + nodes
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue