Add modules service_line_qty_update_base service_line_qty_update_purchase

This commit is contained in:
Alexis de Lattre
2020-05-29 17:46:57 +02:00
parent e96c3d72eb
commit 5c7985a15c
12 changed files with 262 additions and 0 deletions

View File

@@ -0,0 +1 @@
from . import purchase_order

View File

@@ -0,0 +1,20 @@
# Copyright 2020 Akretion France (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class PurchaseOrder(models.Model):
_inherit = 'purchase.order'
has_service = fields.Boolean(compute='_compute_has_service')
def _compute_has_service(self):
for order in self:
has_service = False
for l in order.order_line:
if l.product_id.type == 'service':
has_service = True
break
order.has_service = has_service