Esempio n. 1
0
    def test_make_rfq_from_opportunity(self):
        opportunity = make_opportunity(with_items=1)
        supplier_data = get_supplier_data()
        rfq = make_rfq(opportunity.name)

        self.assertEqual(len(rfq.get("items")), len(opportunity.get("items")))
        rfq.message_for_supplier = 'Please supply the specified items at the best possible rates.'

        for item in rfq.items:
            item.warehouse = "_Test Warehouse - _TC"

        for data in supplier_data:
            rfq.append('suppliers', data)

        rfq.status = 'Draft'
        rfq.submit()
Esempio n. 2
0
    def test_taxes_fetch_via_tax_rule(self):
        make_tax_rule(customer="_Test Customer", billing_city="_Test City",
                      sales_tax_template="_Test Sales Taxes and Charges Template - _TC", save=1)

        # create opportunity for customer
        opportunity = make_opportunity(with_items=1)

        # make quotation from opportunity
        quotation = make_quotation(opportunity.name)
        quotation.save()

        self.assertEqual(quotation.taxes_and_charges,
                         "_Test Sales Taxes and Charges Template - _TC")

        # Check if accounts heads and rate fetched are also fetched from tax template or not
        self.assertTrue(len(quotation.taxes) > 0)