r_id = move_rec_obj.create(cr, uid, {
'type': type,
'line_partial_ids': map(lambda x: (4,x,False), merges+unmerge)
- }, context=context)
- move_rec_obj.reconcile_partial_check(cr, uid, [r_id] + merges_rec, context=context)
+ }, context=reconcile_context)
+ move_rec_obj.reconcile_partial_check(cr, uid, [r_id] + merges_rec, context=reconcile_context)
- return True
+ return r_id
def reconcile(self, cr, uid, ids, type='auto', writeoff_acc_id=False, writeoff_period_id=False, writeoff_journal_id=False, context=None):
account_obj = self.pool.get('account.account')
\n* The \'Posted\' status is used when user create voucher,a voucher number is generated and voucher entries are created in account \
\n* The \'Cancelled\' status is used when user cancel voucher.'),
'amount': fields.float('Total', digits_compute=dp.get_precision('Account'), required=True, readonly=True, states={'draft':[('readonly',False)]}),
- 'tax_amount':fields.float('Tax Amount', digits_compute=dp.get_precision('Account'), readonly=True, states={'draft':[('readonly',False)]}),
+ 'tax_amount':fields.float('Tax Amount', digits_compute=dp.get_precision('Account'), readonly=True),
- 'reference': fields.char('Ref #', size=64, readonly=True, states={'draft':[('readonly',False)]}, help="Transaction reference number."),
- 'number': fields.char('Number', size=32, readonly=True,),
- 'move_id':fields.many2one('account.move', 'Account Entry'),
+ 'reference': fields.char('Ref #', readonly=True, states={'draft':[('readonly',False)]},
+ help="Transaction reference number.", copy=False),
+ 'number': fields.char('Number', readonly=True, copy=False),
+ 'move_id':fields.many2one('account.move', 'Account Entry', copy=False),
'move_ids': fields.related('move_id','line_id', type='one2many', relation='account.move.line', string='Journal Items', readonly=True),
'partner_id':fields.many2one('res.partner', 'Partner', change_default=1, readonly=True, states={'draft':[('readonly',False)]}),
'audit': fields.related('move_id','to_check', type='boolean', help='Check this box if you are unsure of that journal entry and if you want to note it as \'to be reviewed\' by an accounting expert.', relation='account.move', string='To Review'),
</t>
<t t-name="FieldBinaryImage">
<span class="oe_form_field oe_form_field_image" t-att-style="widget.node.attrs.style">
- <div class="oe_form_field_image_controls oe_edit_only">
- <i class="fa fa-pencil fa-1g pull-left col-md-offset-1 oe_form_binary_file_edit" title="Edit"/>
- <i class="fa fa-trash-o fa-1g col-md-offset-5 oe_form_binary_file_clear" title="Clear"/>
- <div class="oe_form_binary_progress" style="display: none">
- <img t-att-src='_s + "/web/static/src/img/throbber.gif"' width="16" height="16"/>
- <b>Uploading ...</b>
+ <t t-if="!widget.get('effective_readonly')">
+ <div class="oe_form_field_image_controls oe_edit_only">
- <t t-call="HiddenInputFile">
- <t t-set="fileupload_id" t-value="widget.fileupload_id"/>
- Edit
- </t>
++ <i class="fa fa-pencil fa-1g pull-left col-md-offset-1 oe_form_binary_file_edit" title="Edit"/>
++ <i class="fa fa-trash-o fa-1g col-md-offset-5 oe_form_binary_file_clear" title="Clear"/>
+ <div class="oe_form_binary_progress" style="display: none">
+ <img t-att-src='_s + "/web/static/src/img/throbber.gif"' width="16" height="16"/>
+ <b>Uploading ...</b>
+ </div>
</div>
- </div>
- <t t-call="HiddenInputFile">
++ <t t-call="HiddenInputFile">
+ <t t-set="fileupload_id" t-value="widget.fileupload_id"/>
++ </t>
</t>
</span>
</t>
_logger = logging.getLogger(__name__)
- MOVABLE_BRANDING = ['data-oe-model', 'data-oe-id', 'data-oe-field', 'data-oe-xpath']
+ MOVABLE_BRANDING = ['data-oe-model', 'data-oe-id', 'data-oe-field', 'data-oe-xpath', 'data-oe-source-id']
-def keep_query(*args, **kw):
- if not args and not kw:
- args = ('*',)
- params = kw.copy()
- query_params = frozenset(werkzeug.url_decode(request.httprequest.query_string).keys())
- for keep_param in args:
- for param in fnmatch.filter(query_params, keep_param):
- if param not in params and param in request.params:
- params[param] = request.params[param]
+def keep_query(*keep_params, **additional_params):
+ """
+ Generate a query string keeping the current request querystring's parameters specified
+ in ``keep_params`` and also adds the parameters specified in ``additional_params``.
+
+ Multiple values query string params will be merged into a single one with comma seperated
+ values.
+
+ The ``keep_params`` arguments can use wildcards too, eg:
+
+ keep_query('search', 'shop_*', page=4)
+ """
+ if not keep_params and not additional_params:
+ keep_params = ('*',)
+ params = additional_params.copy()
+ qs_keys = request.httprequest.args.keys()
+ for keep_param in keep_params:
+ for param in fnmatch.filter(qs_keys, keep_param):
+ if param not in additional_params and param in qs_keys:
+ params[param] = ','.join(request.httprequest.args.getlist(param))
return werkzeug.urls.url_encode(params)
class view_custom(osv.osv):