set product account
parent
ea17617007
commit
664ba814c5
|
@ -26,7 +26,8 @@
|
|||
<field name="account_products" nolabel="1">
|
||||
<list>
|
||||
<field name="patient_type_id"/>
|
||||
<field name="product_id"/>
|
||||
<field name="categ_id"/>
|
||||
<field name="product_id" domain='[["categ_id","=",categ_id]]'/>
|
||||
<field name="ar_debit_id"/>
|
||||
<field name="ar_credit_id"/>
|
||||
</list>
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
<field name="product_id" domain='[["categ_id.id","=",product_categ_id],["code","like",type_code]]' onchange="onchange_product"/>
|
||||
<field name="description"/>
|
||||
<!--<field name="account_id"/>-->
|
||||
<field name="ar_credit_id"/>
|
||||
<field name="ar_debit_id"/>
|
||||
<!--<field name="ar_credit_id"/>-->
|
||||
<!--<field name="ar_debit_id"/>-->
|
||||
<field name="reimbursable"/>
|
||||
<field name="uom_id"/>
|
||||
<field name="price" onchange="onchange_setting_line"/>
|
||||
|
|
|
@ -131,5 +131,18 @@ class ClinicSetting(Model):
|
|||
payment.to_draft()
|
||||
print("to draft payment ", payment.id)
|
||||
print("Done")
|
||||
|
||||
def get_account_prod(self,ptype_id=None,prod_id=None,context={}):
|
||||
res={}
|
||||
for ac_prod in get_model("clinic.setting.account.product").browse([]):
|
||||
prod=ac_prod.product_id
|
||||
ptype=ac_prod.patient_type_id
|
||||
if ptype_id==ptype.id and prod_id==prod.id:
|
||||
res.update({
|
||||
'ar_credit_id': ac_prod.ar_credit_id.id,
|
||||
'ar_debit_id': ac_prod.ar_debit_id.id,
|
||||
})
|
||||
break
|
||||
return res
|
||||
|
||||
ClinicSetting.register()
|
||||
|
|
|
@ -9,6 +9,7 @@ class SettingAccountProduct(Model):
|
|||
_fields={
|
||||
"setting_id": fields.Many2One("clinic.setting","Setting",required=True,on_delete="cascade"),
|
||||
"patient_type_id": fields.Many2One("clinic.patient.type","Patient Type"),
|
||||
'categ_id': fields.Many2One("product.categ","Category"),
|
||||
"product_id": fields.Many2One("product","Product"),
|
||||
"ar_credit_id": fields.Many2One("account.account","AR Credit",multi_company=True),
|
||||
"ar_debit_id": fields.Many2One("account.account","AR Debit",multi_company=True),
|
||||
|
@ -19,4 +20,6 @@ class SettingAccountProduct(Model):
|
|||
"company_id": lambda *a: get_active_company(),
|
||||
}
|
||||
|
||||
_order="patient_type_id"
|
||||
|
||||
SettingAccountProduct.register()
|
||||
|
|
Loading…
Reference in New Issue