コード例 #1
0
ファイル: customer.py プロジェクト: mike-perdide/autonomie
 def submit_success(self, appstruct):
     customer = Customer()
     customer.company = self.request.context
     customer = merge_session_with_post(customer, appstruct)
     self.dbsession.add(customer)
     self.dbsession.flush()
     message = u"Le client <b>{0}</b> a été ajouté avec succès".format(
                                                             customer.name)
     self.session.flash(message)
     return HTTPFound(self.request.route_path('customer', id=customer.id))
コード例 #2
0
def add_customer(company, customer_name, customer_code, customer_lastname):
    customer = Customer()
    customer.name = customer_name #u"Institut médical Dupont & Dupond"
    customer.contactLastName = customer_lastname # "Dupont"
    customer.code = customer_code #"IMDD"
    customer.company = company

    session = DBSESSION()
    session.add(customer)
    session.flush()

    print u"Added customer to %s: %s" % (company.name, customer_name)
    return customer
コード例 #3
0
def customer2(dbsession, company2):
    from autonomie.models.customer import Customer
    customer = Customer(
        name=u"customer 2",
        code=u"CUST2",
        lastname=u"Lastname2",
        firstname=u"Firstname2",
        address=u"1th street",
        zip_code=u"01234",
        city=u"City",
    )
    customer.company = company2
    dbsession.add(customer)
    dbsession.flush()
    return customer
コード例 #4
0
def customer2(dbsession, company):
    from autonomie.models.customer import Customer
    customer = Customer(
        name=u"customer2",
        code=u"CUST",
        lastname=u"Lastname",
        firstname=u"Firstname",
        address=u"1th street",
        zip_code=u"01234",
        city=u"City",
    )
    customer.company = company
    dbsession.add(customer)
    dbsession.flush()
    return customer
コード例 #5
0
ファイル: conftest.py プロジェクト: SophieWeb/autonomie
def individual_customer(dbsession, company):
    from autonomie.models.customer import Customer
    customer = Customer(
        code=u"CUST",
        type_='individual',
        civilite=u"mr&mme",
        lastname=u"Lastname",
        firstname=u"Firstname",
        address=u"1th street",
        zip_code=u"01234",
        city=u"City",
    )
    customer.company = company
    dbsession.add(customer)
    dbsession.flush()
    return customer
コード例 #6
0
def individual_customer(dbsession, company):
    from autonomie.models.customer import Customer
    customer = Customer(
        code=u"CUST",
        type_='individual',
        civilite=u"mr&mme",
        lastname=u"Lastname",
        firstname=u"Firstname",
        address=u"1th street",
        zip_code=u"01234",
        city=u"City",
    )
    customer.company = company
    dbsession.add(customer)
    dbsession.flush()
    return customer