[FIX] sale_timesheet_purchase: show only Vendor Bills in smart button

Under Projects, click on Overview, click on the smart button "Vendor
Bills".

The list will display account moves based only on the analytic account
and not the actual type of the move

opw-2180598

closes odoo/odoo#44330

X-original-commit: 5a476fb4f5d335d5460943603269f48e7ec3e026
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Andrea Grazioso (agr-odoo)
2020-01-30 15:23:23 +00:00
parent 3534e9ed4d
commit 4305d05f79
@@ -22,7 +22,7 @@ class Project(models.Model):
context={'create': False, 'edit': False, 'delete': False}
)
})
account_invoice_lines = self.env['account.move.line'].search([('analytic_account_id', 'in', accounts)])
account_invoice_lines = self.env['account.move.line'].search([('analytic_account_id', 'in', accounts), ('move_id.type', 'in', ['in_invoice', 'in_refund'])])
account_invoices = account_invoice_lines.mapped('move_id')
if account_invoices:
stat_buttons.append({