
    7}Pj                     B    d Z ddlmZmZ  G d dej                        Zy)z;Extend hr.department with SAP B1 linkage (Department code).    )fieldsmodelsc                   B    e Zd ZdZ ej
                  dddd      Zd Zy)	HrDepartmentzhr.departmentzSAP B1 Department CodeTFz2Code of the linked Department in SAP Business One.)stringindexcopyhelpc                 0   |s| j                         S | j                  d      j                  dd|fgd      }|s*|r(| j                  d      j                  dd|fdgd      }|r|j                  s||_        |S | j	                  |xs d	| |d
      S )zFReturn the hr.department for a B1 department code, creating it if new.F)active_testb1_dept_code=   )limitname)r   r   FzB1 Dept )r   r   )browsewith_contextsearchr   create)selfcoder   depts       z/tmp/claude-1003/-home-susu/da238cdb-39ed-486c-99e2-9f5ca01dda37/scratchpad/xeno_sapb1_sync_deploy/models/hr_department.py_b1_get_or_createzHrDepartment._b1_get_or_create   s    ;;=   U 3::c4() ; 
 $$$7>>#t$&BC1 ? D $$$(!K{{D$=htf,=tTUU    N)__name__
__module____qualname___inheritr   Integerr   r    r   r   r   r      s'    H!6>>'t%AL
Vr   r   N)__doc__odoor   r   Modelr   r!   r   r   <module>r%      s    A V6<< Vr   