diff options
Diffstat (limited to 'addons/purchase/report/purchase_bill.py')
| -rw-r--r-- | addons/purchase/report/purchase_bill.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/addons/purchase/report/purchase_bill.py b/addons/purchase/report/purchase_bill.py index 009ce1f6ac8..0a9609144b8 100644 --- a/addons/purchase/report/purchase_bill.py +++ b/addons/purchase/report/purchase_bill.py @@ -17,7 +17,7 @@ class PurchaseBillUnion(models.Model): amount = fields.Float(string='Amount', readonly=True) currency_id = fields.Many2one('res.currency', string='Currency', readonly=True) company_id = fields.Many2one('res.company', 'Company', readonly=True) - vendor_bill_id = fields.Many2one('account.invoice', string='Vendor Bill', readonly=True) + vendor_bill_id = fields.Many2one('account.move', string='Vendor Bill', readonly=True) purchase_order_id = fields.Many2one('purchase.order', string='Purchase Order', readonly=True) @api.model_cr @@ -26,14 +26,14 @@ class PurchaseBillUnion(models.Model): self.env.cr.execute(""" CREATE OR REPLACE VIEW purchase_bill_union AS ( SELECT - id, number as name, reference, partner_id, date, amount_untaxed as amount, currency_id, company_id, + id, name, ref as reference, partner_id, date, amount_untaxed as amount, currency_id, company_id, id as vendor_bill_id, NULL as purchase_order_id - FROM account_invoice + FROM account_move WHERE - type='in_invoice' and COALESCE(number, '') != '' + type='in_invoice' and state = 'posted' UNION SELECT - -id, name, partner_ref, partner_id, date_order::date as date, amount_untaxed as amount, currency_id, company_id, + -id, name, partner_ref as reference, partner_id, date_order::date as date, amount_untaxed as amount, currency_id, company_id, NULL as vendor_bill_id, id as purchase_order_id FROM purchase_order WHERE |
