|
From: | Bounmy Sihaphom |
Subject: | Re: [Health-dev] Health_serviceLine (Field : Desc) |
Date: | Wed, 24 Sep 2014 09:40:56 +0700 |
Hi all:
I have searched in the net,Tryton Google Group,IRC and GNUHealth mailing list, there is no place to be found, maybe it is so simple, I am new to Python, I just don't know how, can someone point me to the right direction or give me example for the following scenario:
Model : Health_service
What I can do so far:
Default Srvice date
Default Description (Title not on service line)
Invoice_to as true (so he/she don't need to click at Line Service)
I cannot do this :
Actually I can move Product field and place before “desc” field (do not misunderstood this field actually the same as the title Description, I don't know why?).
I want to make “desc” field value = “Product” field value, and save behind the scene, since “desc” is not null defined in service_line table, how can I do this? This way, she/he enters only Product name and also most of the time the product name is good enough for description. Or stated differntly, when I click save, that product value also populated to “desc” field.
I believe desc field is so important when we create service Invoice, this field not the product field will be printed on draft/pro format invoice.
Here is what I tried:
product = fields.Many2One('product.product', 'Product', required=True)
desc = fields.Char('Description')
to_invoice = fields.Boolean('Invoice')
@staticmethod
def default_to_invoice():
return True
@staticmethod
def default_desc:
return product_product.product
[Prev in Thread] | Current Thread | [Next in Thread] |