I get this error AttributeError: 'Quotation' object has no attribute 'label_subtotal'
I’ve referenced the component form at the top of the page
from .QuotationPrice import QuotationPrice
Here is the component class at the top of the child page
class QuotationPrice(QuotationPriceTemplate):
def __init__(self, **properties):
# Set Form properties and Data Bindings.
self.init_components(**properties)
In your parent form, when you use self. you are referencing properties of the parent form. Your label_subtotal is not a property of the parent form, but of your QuotationPrice form.
Somewhere you should have a reference to the instance of QuotationPrice that you inserted into the parent form. You need to use that reference instead of self.
so that is called on the main Quotation page. I also changed the label name, as I copied and pasted the label, just in case there was an issue there, but no.
Originally, the price section was in the main page, but they I created a sub form, named it as a custom component and then added that component back into the main Quotation page
I’m not seeing an actual reference to a QuotationPrice instance. How are you creating the instance of QuotationPrice? Did you drag and drop QuotationPrice onto the Quotation form? Did you dynamically create an instance in code?
You’re using a class name to try to access instance variables. That isn’t going to work. You need a reference to an instance of the class.
If, for example, you dragged and dropped QuotationPrice onto your Quotation form, then that component has a name on Quotation. Maybe something like self.custom_1? Find that name and use that as your reference, e.g. self.custom_1.subtotal.text
If you created the instance dynamically through code, then you have a reference somewhere to that QuotationPrice instance. Use that reference instead.