Odoo Help

0

0
2 الإجابات
3

That is because, buggy code is committed for stock module to get default Output Location:

def _default_lot_output_id(self, cr, uid, context=None):
        try:
            lot_input_stock_model, lot_input_stock_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock', 'stock_location_output')
            self.pool.get('stock.location').check_access_rule(cr, uid, [lot_input_stock_id], 'read', context=context)
        except (ValueError, orm.except_orm):
            # the user does not have read access on the location or it does not exists
            lot_output_id = False
        return lot_output_id

It should be like this:

def _default_lot_output_id(self, cr, uid, context=None):
        try:
            lot_output_stock_model, lot_output_stock_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock', 'stock_location_output')
            self.pool.get('stock.location').check_access_rule(cr, uid, [lot_output_stock_id], 'read', context=context)
        except (ValueError, orm.except_orm):
            # the user does not have read access on the location or it does not exists
            lot_output_stock_id = False
        return lot_output_stock_id
1 تعليق
Stefan Rijnhart هولندا
28‏/8‏/2013 11:33 ص

I'm updating this with the bug that Tim filed: https://bugs.launchpad.net/ocb-addons/+bug/1217146. We arrived at the same solution as Dharmesh Patel

0
الصورة الرمزية

Grover Hernando Menacho Quisbert بوليفيا

--Grover Hernando Menacho Quisbert--
WebVision Enterprise Systems
https://www.linkedin.com/in/hmen89/
2940
| 7 8 10
La Paz, بوليفيا
--Grover Hernando Menacho Quisbert--

Odoo Developer

Grover Hernando Menacho Quisbert بوليفيا
26‏/8‏/2013 7:57 م

Hello Tim,

That's not a bug, it's just that the system can't find the default location data.

As you can see on Addons>Stock>stock_data.xml

There are two records that are going to be inserted on the db:

<record id="stock_location_output" model="stock.location">
        <field name="name">Output</field>
        <field name="location_id" ref="stock_location_company"/>
        <field name="usage">internal</field>
        <field name="chained_location_type">customer</field>
        <field name="chained_auto_packing">transparent</field>
        <field name="chained_picking_type">out</field>
        <field name="chained_journal_id" ref="journal_delivery"/>
    </record>
    <record id="stock_location_stock" model="stock.location">
        <field name="name">Stock</field>
        <field name="location_id" ref="stock_location_company"/>
    </record>

And the error that is showing up to you it's because this function can't find it.

def _default_lot_input_stock_id(self, cr, uid, context=None):
    lot_input_stock = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'stock_location_stock')
    return lot_input_stock.id

def _default_lot_output_id(self, cr, uid, context=None):
    lot_output = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'stock_location_output')
    return lot_output.id

_defaults = {
    'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.inventory', context=c),
    'lot_input_id': _default_lot_input_stock_id,
    'lot_stock_id': _default_lot_input_stock_id,
    'lot_output_id': _default_lot_output_id,
}

So my advice is: go to Configuration>Installed Modules and look for stock module... Update it and it's going to work. If that doesn't work maybe there is a problem with stock module and you have to download it again.

1 تعليق
tim diamond الإكوادور
26‏/8‏/2013 11:09 م

Thank you for the advice. However, as noted in a comment above by Ray Carnes, this is an issue with openERP. For anyone else looking at the post, the issue is not fixed by the above answer.

اطرح سؤالاً
Writer
Keep Informed
0 متابعين
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now