From e6721fc285ffcc1689212b2f28492d76156e7e4f Mon Sep 17 00:00:00 2001 From: Ahmed Aly Date: Thu, 19 Apr 2018 13:59:57 +0200 Subject: [PATCH] Feedback 1640: Dienstleistung Darf unkonfiguriert verkauft werden --- ext/custom-addons/dp_custom/models/sale.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/custom-addons/dp_custom/models/sale.py b/ext/custom-addons/dp_custom/models/sale.py index bb02f153..1e139348 100644 --- a/ext/custom-addons/dp_custom/models/sale.py +++ b/ext/custom-addons/dp_custom/models/sale.py @@ -389,9 +389,13 @@ class SaleOrder(models.Model): class SaleOrderLine(models.Model): _inherit = 'sale.order.line' + @api.model + def _get_product_id_domain(self): + return [('sale_ok', '=', True), '|', ('can_be_sold_unconfigured', '=', True), ('type', '=', 'service')] + lot_id = fields.Many2one(comodel_name='stock.production.lot', string='Lot') from_designbox = fields.Boolean(string='I', readonly=True, help='Import von externem System') - product_id = fields.Many2one(domain=[('sale_ok', '=', True), ('can_be_sold_unconfigured', '=', True)]) + product_id = fields.Many2one(domain=_get_product_id_domain) weight = fields.Float(string='Gewicht', compute='_compute_weight') intrastat_id = fields.Many2one(comodel_name='report.intrastat.code', string='Intrastat Code')