LEFT | RIGHT |
(no file at all) | |
| 1 #This file is part of Tryton. The COPYRIGHT file at the top level of |
| 2 #this repository contains the full copyright notices and license terms. |
| 3 from trytond.model import Model, fields |
| 4 from trytond.pyson import Eval |
| 5 |
| 6 |
| 7 class Location(Model): |
| 8 _name = 'stock.location' |
| 9 |
| 10 production_location = fields.Many2One('stock.location', 'Production', |
| 11 states={ |
| 12 'invisible': Eval('type') != 'warehouse', |
| 13 'readonly': ~Eval('active'), |
| 14 'required': Eval('type') == 'warehouse', |
| 15 }, |
| 16 domain=[ |
| 17 ('type', '=', 'production'), |
| 18 ], |
| 19 depends=['type', 'active']) |
| 20 |
| 21 Location() |
| 22 |
| 23 |
| 24 class Move(Model): |
| 25 _name = 'stock.move' |
| 26 |
| 27 production_input = fields.Many2One('production', 'Production Input', |
| 28 readonly=True, select=True, ondelete='CASCADE', |
| 29 domain=[('company', '=', Eval('company'))], |
| 30 depends=['company']) |
| 31 production_output = fields.Many2One('production', 'Production Output', |
| 32 readonly=True, select=True, ondelete='CASCADE', |
| 33 domain=[('company', '=', Eval('company'))], |
| 34 depends=['company']) |
| 35 |
| 36 Move() |
LEFT | RIGHT |