ir_sequence - code must be unique

Bug #908189 reported by Ferdinand
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Wishlist
OpenERP R&D Addons Team 3

Bug Description

IMHO the code must be unique (for lookup via code) or null (for lookup via id from journals)

Related branches

Revision history for this message
Ravish(OpenERP) (rmu-openerp) wrote :

Hello Dr Ferdinand
I have completely checked your issue, Currently we have already take care about the unique code name and put a constraint for it.

 I didn't understand what you have exactly specified on bug report.

so, would you please provide more information on this.

Thanks and waiting for your reply!

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Ferdinand (office-chricar) wrote :

in sale/sale_sequence.xml

        <record id="seq_sale_order" model="ir.sequence">
            <field name="name">Sales Order</field>
            <field name="code">sale.order</field>
            <field name="prefix">SO</field>
            <field name="padding">3</field>
            <field name="company_id" eval="False"/>
        </record>

it seems this loads without company_id

IMHO all sequences must have a company_id
especially
        'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'ir.sequence', context=c),
always creates sequences WITH company_id

Changed in openobject-addons:
status: Incomplete → New
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Dr Ferdinand,

I am agree with you, same things should be done on purchase also.

Thank you!

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Low
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Jagdish Panchal (Open ERP) (jap-openerp) wrote :

Hello,

 In sale, stock, purchase sequence set with company_id in the following branch:- https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-908189-jap/

Revision ID:<email address hidden>
Revision no:6203

It will be merged soon with addons.

Thanks,
jap

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Thibault Delavallée (OpenERP) (tde-openerp) wrote :

Hello,

The line <field name="company_id" eval="False"/> in files purchase_sequence.xml, sale_sequence.xml and stock_sequence.xml has been added to make sequences shared by default in multicompany. This has been done in revision 5217 to which you can refer for more details. We therefore consider this bug as invalid and the related merge proposal as refused because this default behavior of sequences is intended.

When fixing bugs, a careful research of why a change has been made in the past is necessary. We cannot change lines in the code without looking to past modifications of those lines, and why those modifications were performed. Therefore, this bug report should not have been considered as a real bug report. Maybe you could have made directly a branch proposal with your modifications about sequences, with a clean and complete explanation of why you wanted those changes.

Best regards,

Thibault.

Changed in openobject-addons:
status: Fix Committed → Invalid
Revision history for this message
Ferdinand (office-chricar) wrote :

Well - according to my experience this does not work reliably

Having 2 or more sequences with the same code - next_by code will take a random sequence - which can't be a desired behavior
this
        ids = self.search(cr, uid, ['&',('code','=', sequence_code),('company_id','in',company_ids)])
        return self._next(cr, uid, ids, context)

        return self.next_by_code(cr, uid, sequence_code_or_id, context)
will return multiple sequences which match the search which IMHO is not handled

I just tried it with code of today.

Changed in openobject-addons:
status: Invalid → New
Revision history for this message
Ferdinand (office-chricar) wrote :
Amit Parik (amit-parik)
Changed in openobject-addons:
status: New → Confirmed
importance: Low → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.