Strange behavior proteus vs web client

web client
1 create a sale just save, it no validation at all.

AND

  • web client
    …Quote and confirm the sale
    …go to invoice
    Post invoice => ok

  • proteus
    Sale= Model.get(‘sale.sale’)
    sale=Sale(num_sale)
    sale.click(‘quote’)
    sale.click(‘confirm’)
    sale.invoices[0].click(‘post’) (or for inv in sale.invoices … inv.click(‘post’)

trytond.modules.account_invoice.exceptions.InvoiceNumberError:

To number the invoice “(52)”, you must set an accounting date after “01/12/2025” because the sequence “Clients_25” has already been used for invoice “31234”

clients_25 is the sequence for customer invoice.

If i go back to web client i have the same error for that invoice…

it seems to work , i am narrowing down…

so i narrow down - maybe a mis configuration i’ll open a new subject.

i finally found…
play with proteus i gave a date french format that was inserted french format (so in the future for the tryton databases ???) and the code

says

after_invoices = cls.search([
('sequence', '=', invoice.sequence),
    ['OR',
     ('accounting_date', '>', date),
        [
           ('accounting_date', '=', None),
        ('invoice_date', '>', date),
            ],
               ],
               ], limit=1, order=[('accounting_date', 'DESC')])

so it is not possible to enter an invoice with a date BEFORE one invoice entered. the error message was not helping at all

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.