Am 25.05.2012 09:22, schrieb Okko Huisman:
Hello Jan,

I agree with you it should wait to create the first invoice upon making the first shipment. Only in case there are no goods in the sale it may create an invoice directly.

I fixed this temporarly with the following - it was late and I dont know if it fits, but it could illustrate the idea

def create_invoice(self, sale, invoice_type):
        prod = Pool().get('product.product')
        if sale.invoice_method == 'shipment':
            mixed = len(list(set(line.product.type for line in sale.lines
                    if line.product)))
            if mixed > 1:
                il = self._get_invoice_line_sale_line(sale, invoice_type)
                if not list('i' for i in il.itervalues() \
                    if prod.browse(i[0]['product']).type != 'service'):
                        return
        return super(Sale, self).create_invoice(sale, invoice_type)



On Friday, May 25, 2012 1:20:15 AM UTC+2, grasbauer wrote:

    Hi again,

    yesterday I was discussing with a customerᅵ the workflow of
    processing a sales with invoice_method='shipment' . The question:
    how to handle sales, that have both lines with products of type
    service and goods. The default module is handling this usecase
    like this:

    Creating immediately an invoice for the lines of type service and
    additional invoices after doing a shipment for the lines of type
    goods.

    He expected the following behaviour:

    Ifᅵ the complete order or a part of it is shipped, the system
    should create an invoice with the shipped goods and the services.
    Cite: "If I say 'invoice on shipment', i don't want an invoice
    before something is shipped".

    What do you think about this?

    Jan

--
tryton@googlegroups.com mailing list

--
tryton@googlegroups.com mailing list

Reply via email to