Browse Source

[FIX] Fixed Travis

pull/437/head
Nikul Chaudhary 5 years ago
parent
commit
aa0b538851
  1. 13
      contract_sale/models/contract.py
  2. 2
      contract_sale/models/sale_order.py

13
contract_sale/models/contract.py

@ -23,7 +23,7 @@ class ContractContract(models.Model):
continue
invoice_values = contract._prepare_invoice(date_ref)
#Search Contract in sale order
# Search Contract in sale order
order_ids = self.env['sale.order'].search([
('partner_id', '=', contract.partner_id.id),
('contract_id', '=', contract.id),
@ -36,13 +36,16 @@ class ContractContract(models.Model):
)
if invoice_line_values:
#Check Invoice and If It's Not Created then Updated Qty
# Check Invoice and If It's Not Created then Updated Qty
for order_id in order_ids:
invoice_ids = order_id.order_line.mapped('invoice_lines')
invoice_ids =\
order_id.order_line.mapped('invoice_lines')
if not invoice_ids:
for line in order_id.order_line:
if line.product_id.id == invoice_line_values.get('product_id', False):
invoice_line_values['quantity'] += line.product_uom_qty
if line.product_id.id == invoice_line_values.\
get('product_id', False):
invoice_line_values['quantity'
] += line.product_uom_qty
invoice_values['invoice_line_ids'].append(
(0, 0, invoice_line_values)

2
contract_sale/models/sale_order.py

@ -1,5 +1,5 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
from odoo import fields, models
class SaleOrder(models.Model):

Loading…
Cancel
Save