# mrp_abstract_workorder.py
```python=3.8
class MrpAbstractWorkorder(models.AbstractModel):
```
> ### models.AbstractModel
AbstractModel 方便讓model可重複使用
> To create a model without any table, inherit from AbstractModel.
> Abstract models allow us to just create a generic model that implements some feature that can then be inherited by regular models in order to make that feature available in them.
```python=.
_name = "mrp.abstract.workorder"
```
> ```_name``` is required and **defines the name for the model** in the Odoo system.
> ```.``` is automatically converted into a ```_```
```python=.
_description = "Common code between produce wizards and workorders."
```
> Information of models
```python=.
_check_company_auto = True
```
> 有多公司的業務需處理時,
>
>http://120.79.186.14/index.php/2021/06/01/odoo_multi_company/
```python=.
production_id = fields.Many2one('mrp.production', 'Manufacturing Order', required=True, check_company=True)
```
> ```'mrp.production'``` is the target model which want to relate with.
> ```'Manufacturing Order'``` is the name of this variable.
> ```required=True``` is mena that the filed should be code.
> ```check_company=True```
{"metaMigratedAt":"2023-06-16T08:24:38.197Z","metaMigratedFrom":"Content","title":"mrp_abstract_workorder.py","breaks":true,"contributors":"[{\"id\":\"4f3fb2ac-2348-4a1b-8ca1-6685970abd67\",\"add\":1779,\"del\":603}]"}