[MERGE] forward port of branch saas-3 up to 50665b4
This commit is contained in:
commit
2492503dcc
|
@ -255,7 +255,7 @@
|
|||
<group>
|
||||
<field domain="[('partner_id', '=', partner_id)]" name="partner_bank_id" on_change="onchange_partner_bank(partner_bank_id)"/>
|
||||
<field name="user_id" string="Responsible" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'account.group_account_invoice']}"/>
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="name" attrs="{'invisible': [('type', '=', 'in_invoice')]}"/>
|
||||
<field name="payment_term" options="{'no_create': True}"/>
|
||||
</group>
|
||||
<group>
|
||||
|
|
|
@ -843,7 +843,12 @@ class account_move_line(osv.osv):
|
|||
ret.append(ret_line)
|
||||
return ret
|
||||
|
||||
def list_partners_to_reconcile(self, cr, uid, context=None):
|
||||
|
||||
def list_partners_to_reconcile(self, cr, uid, context=None, filter_domain=False):
|
||||
line_ids = []
|
||||
if filter_domain:
|
||||
line_ids = self.search(cr, uid, filter_domain, context=context)
|
||||
where_clause = filter_domain and "AND l.id = ANY(%s)" or ""
|
||||
cr.execute(
|
||||
"""SELECT partner_id FROM (
|
||||
SELECT l.partner_id, p.last_reconciliation_date, SUM(l.debit) AS debit, SUM(l.credit) AS credit, MAX(l.create_date) AS max_date
|
||||
|
@ -853,10 +858,12 @@ class account_move_line(osv.osv):
|
|||
WHERE a.reconcile IS TRUE
|
||||
AND l.reconcile_id IS NULL
|
||||
AND l.state <> 'draft'
|
||||
%s
|
||||
GROUP BY l.partner_id, p.last_reconciliation_date
|
||||
) AS s
|
||||
WHERE debit > 0 AND credit > 0 AND (last_reconciliation_date IS NULL OR max_date > last_reconciliation_date)
|
||||
ORDER BY last_reconciliation_date""")
|
||||
ORDER BY last_reconciliation_date"""
|
||||
% where_clause, (line_ids,))
|
||||
ids = [x[0] for x in cr.fetchall()]
|
||||
if not ids:
|
||||
return []
|
||||
|
|
|
@ -1755,7 +1755,7 @@ openerp.account = function (instance) {
|
|||
this.last_group_by = group_by;
|
||||
this.old_search = _.bind(this._super, this);
|
||||
var mod = new instance.web.Model("account.move.line", context, domain);
|
||||
return mod.call("list_partners_to_reconcile", []).then(function(result) {
|
||||
return mod.call("list_partners_to_reconcile", [context, domain]).then(function(result) {
|
||||
var current = self.current_partner !== null ? self.partners[self.current_partner][0] : null;
|
||||
self.partners = result;
|
||||
var index = _.find(_.range(self.partners.length), function(el) {
|
||||
|
|
|
@ -167,6 +167,7 @@
|
|||
<field name="product_uom_qty" string="Quantity"/>
|
||||
<field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
|
||||
<field name="price_unit"/>
|
||||
<field name="tax_id" domain="[('parent_id', '=', False), ('type_tax_use', '=', 'purchase')]" widget="many2many_tags"/>
|
||||
<field name="to_invoice"/>
|
||||
<field name="price_subtotal"/>
|
||||
</tree>
|
||||
|
|
|
@ -238,10 +238,6 @@ instance.web.parse_value = function (value, descriptor, value_if_empty) {
|
|||
throw new Error(_.str.sprintf(_t("'%s' is not a correct integer"), value));
|
||||
return tmp;
|
||||
case 'float':
|
||||
tmp = Number(value);
|
||||
if (!isNaN(tmp))
|
||||
return tmp;
|
||||
|
||||
var tmp2 = value;
|
||||
do {
|
||||
tmp = tmp2;
|
||||
|
|
Loading…
Reference in New Issue