couldn't confirm the invoice

Bug #599204 reported by vrsb
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Invalid
Low
OpenERP Core Team

Bug Description

Hello.
When I try to confirm the draft invoice, i get the following:

File "/usr/lib/python2.6/site-packages/openerp-server/addons/sale/sale.py", line 565, in action_ship_create
    output_id = order.shop_id.warehouse_id.lot_output_id.id
AttributeError: 'bool' object has no attribute 'id'

vrsb (shipilov555)
Changed in openobject-addons:
assignee: nobody → OpenERP Core Team (openerp)
Revision history for this message
Nhomar - Vauxoo (nhomar) wrote : Re: [Bug 599204] [NEW] couldn't confirm the invoice

Some combination of modules cause this behavior, can you share with us all
modules that you have installed please.

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
vrsb (shipilov555) wrote :

Here is the list of installed modules:

account
account_chart
account_tax_include
base
base_contact
base_diction
base_partner
base_report_creator
base_report_designer
base_report_unicode
base_setup
board
board_manufacturing
board_project
board_sale
crm
crm_configuration
delivery
document
documents
hr
hr_attendance
hr_change
hr_contract
hr_expense
hr_holidays
hr_timesheet
hr_timesheet_invoice
hr_timesheet_sheet
mrp
mrp_jit
mrp_operations
mrp_prodlot_autosplit
mrp_repair
mrp_subproduct
process
product
project
purchase
report_analytic_line
report_analytic_planning
report_crm
report_mrp
report_sale
report_task
report_timesheet
report_truetype
sale
sale_delivery_report
sale_journal
stock
stock_invoice_directly
stock_location
users_ldap

Revision history for this message
Nhomar - Vauxoo (nhomar) wrote : Re: [Bug 599204] Re: couldn't confirm the invoice

Almost all your modules related to mrp and stock are certificated, can you
share all the traceback please!. with only the final line is dificult for me
check what module is causing the error, did yo try only with sale and
account installed??, it is working fine for me.... with a configuration
almost like yours....

Impotant too..

Revno for addons.
Revno for addons-extra.
Revno for server...

If you are working with a downloaded version what version are you using.

2010/6/27 vrsb <email address hidden>

> Here is the list of installed modules:
>
> account
> account_chart
> account_tax_include
> base
> base_contact
> base_diction
> base_partner
> base_report_creator
> base_report_designer
> base_report_unicode
> base_setup
> board
> board_manufacturing
> board_project
> board_sale
> crm
> crm_configuration
> delivery
> document
> documents
> hr
> hr_attendance
> hr_change
> hr_contract
> hr_expense
> hr_holidays
> hr_timesheet
> hr_timesheet_invoice
> hr_timesheet_sheet
> mrp
> mrp_jit
> mrp_operations
> mrp_prodlot_autosplit
> mrp_repair
> mrp_subproduct
> process
> product
> project
> purchase
> report_analytic_line
> report_analytic_planning
> report_crm
> report_mrp
> report_sale
> report_task
> report_timesheet
> report_truetype
> sale
> sale_delivery_report
> sale_journal
> stock
> stock_invoice_directly
> stock_location
> users_ldap
>
> --
> couldn't confirm the invoice
> https://bugs.launchpad.net/bugs/599204
> You received this bug notification because you are a member of OpenERP
> Drivers, which is subscribed to OpenObject Addons.
>
> Status in OpenObject Addons Modules: Incomplete
>
> Bug description:
> Hello.
> When I try to confirm the draft invoice, i get the following:
>
> File "/usr/lib/python2.6/site-packages/openerp-server/addons/sale/sale.py",
> line 565, in action_ship_create
> output_id = order.shop_id.warehouse_id.lot_output_id.id
> AttributeError: 'bool' object has no attribute 'id'
>
>
>

--
Saludos Cordiales

Nhomar G. Hernandez M.
+58-414-4110269
+58-212-6615932
+58-212-9536734 ext 124
+58-212-9512643
Skype: nhomar00
Web-Blog: http://geronimo.com.ve
Servicios IT: http://openerp.netquatro.com
Linux-Counter: 467724
Correos:
<email address hidden>
<email address hidden>

Revision history for this message
vrsb (shipilov555) wrote :
Download full text (5.1 KiB)

It seems, that happens when warehouse is not selected in the shop, associated with sales order.
Anyway, the traceback:

Traceback (most recent call last):
  File "widget\view\form_gtk\parser.pyo", line 117, in button_clicked
  File "rpc.pyo", line 170, in rpc_exec_auth
  File "rpc.pyo", line 113, in exec_auth
  File "rpc.pyo", line 119, in execute
  File "tiny_socket.pyo", line 81, in myreceive
tiny_socket.Myexception: ("'bool' object has no attribute 'id'", 'Traceback (most recent call last):\n File "/usr/lib/python2.6/site-packages/openerp-server/netsvc.py", line 247, in dispatch\n result = LocalService(service_name)(method, *params)\n File "/usr/lib/python2.6/site-packages/openerp-server/netsvc.py", line 76, in __call__\n return getattr(self, method)(*params)\n File "/usr/lib/python2.6/site-packages/openerp-server/service/web_services.py", line 571, in exec_workflow\n res = service.exec_workflow(db, uid, object, method, id)\n File "/usr/lib/python2.6/site-packages/openerp-server/osv/osv.py", line 58, in wrapper\n return f(self, dbname, *args, **kwargs)\n File "/usr/lib/python2.6/site-packages/openerp-server/osv/osv.py", line 137, in exec_workflow\n res = self.exec_workflow_cr(cr, uid, obj, method, *args)\n File "/usr/lib/python2.6/site-packages/openerp-server/osv/osv.py", line 130, in exec_workflow_cr\n return wf_service.trg_validate(uid, obj, args[0], method, cr)\n File "/usr/lib/python2.6/site-packages/openerp-server/workflow/wkf_service.py", line 81, in trg_validate\n res2 = instance.validate(cr, id, ident, signal)\n File "/usr/lib/python2.6/site-packages/openerp-server/workflow/instance.py", line 50, in validate\n workitem.process(cr, witem, ident, signal, force_running, stack=stack)\n File "/usr/lib/python2.6/site-packages/openerp-server/workflow/workitem.py", line 62, in process\n ok = _split_test(cr, workitem, activity[\'split_mode\'], ident, signal, stack)\n File "/usr/lib/python2.6/site-packages/openerp-server/workflow/workitem.py", line 175, in _split_test\n _join_test(cr, t[0], t[1], ident, stack)\n File "/usr/lib/python2.6/site-packages/openerp-server/workflow/workitem.py", line 183, in _join_test\n create(cr,[activity], inst_id, ident, stack)\n File "/usr/lib/python2.6/site-packages/openerp-server/workflow/workitem.py", line 42, in create\n process(cr, res, ident, stack=stack)\n File "/usr/lib/python2.6/site-packages/openerp-server/workflow/workitem.py", line 62, in process\n ok = _split_test(cr, workitem, activity[\'split_mode\'], ident, signal, stack)\n File "/usr/lib/python2.6/site-packages/openerp-server/workflow/workitem.py", line 175, in _split_test\n _join_test(cr, t[0], t[1], ident, stack)\n File "/usr/lib/python2.6/site-packages/openerp-server/workflow/workitem.py", line 183, in _join_test\n create(cr,[activity], inst_id, ident, stack)\n File "/usr/lib/python2.6/site-packages/openerp-server/workflow/workitem.py", line 42, in create\n process(cr, res, ident, stack=stack)\n File "/usr/lib/python2.6/site-packages/openerp-server/workflow/workitem.py", line 62, in process\n ok = _split_test(cr, workitem, activity[\'split_mode\'], ident, signal, stack)\n ...

Read more...

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello,

I wonder how could it give you the error?

All the fields in chain are mandatory ones, viz. Shop is mandatory for SO,so is warehouse and so it output lot id.

I wanted to set this as invalid, but respecting the traceback, I would like to ask you if you can send us the backup of your db,so we can try.

Thanks.

Changed in openobject-addons:
importance: Undecided → Low
Revision history for this message
Dhruti Shastri(OpenERP) (dhs-openerp) wrote :

Hello vrsb,

We have tried to generate the error and the only way we could do it was to change the view of sale.shop and set the warehouse_id field to be 'not required'.

So, there is a possibility that one of the modules you have installed manipulates the view of Sale Shop and thus causes the error to pop up.

Moreover,we have checked into all the modules including extra addons and we didn't find such a code that may cause a problem.

Would you please check with which are the form views of sale.shop available at your end?

Thanks.

Changed in openobject-addons:
status: Incomplete → Invalid
Changed in openobject-addons:
milestone: none → 5.0.13
Revision history for this message
vrsb (shipilov555) wrote :

Hello
>Would you please check with which are the form views of sale.shop available at your end?

[openerp@fedora addons]$ for i in $(find -name *.xml); do grep -Hn sale.shop $i ; done
./mrp_jit/test/mrp_jit_test.xml:44: <field name="shop_id" ref="sale.shop"/>
./mrp_jit/test/mrp_jit_test.xml:210: <field name="shop_id" ref="sale.shop"/>
./mrp_jit/mrp_jit_test.xml:33: <field name="shop_id" ref="sale.shop"/>
./point_of_sale/pos_data.xml:25: eval="('default',False,'shop_id', [('pos.order', False)], ref('sale.shop'), True, False, False, False, True)"
./sale/sale_view.xml:8: <field name="name">sale.shop</field>
./sale/sale_view.xml:9: <field name="model">sale.shop</field>
./sale/sale_view.xml:25: <field name="name">sale.shop</field>
./sale/sale_view.xml:26: <field name="model">sale.shop</field>
./sale/sale_view.xml:41: <field name="res_model">sale.shop</field>
./sale/sale_data.xml:23: Resource: sale.shop
./sale/sale_data.xml:25: <record id="shop" model="sale.shop">
[openerp@fedora addons]$

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hi vrsb,

Have you changed something on the view of Shop from Admin menu?

Thanks.

Revision history for this message
vrsb (shipilov555) wrote :
Download full text (5.0 KiB)

>Have you changed something on the view of Shop from Admin menu?
Definetely not. In my opinion the field was somehow cleared by xml demo-data of some unready addon, but i couldnt find the one.

[openerp@fedora openerp]$ for i in $(find -name *.xml); do grep -Hn warehouse_id $i ; done
./addons/purchase/test/purchase_test.xml:12: 'warehouse_id': fields.m any2one('stock.warehouse', 'Warehouse', states={'posted':[('readonly',True)]}),
./addons/purchase/purchase_data.xml:41: eval="('default',False,'wareh ouse_id', [('purchase.order', False)], ref('stock.warehouse0'), True, False, Fal se, False, True)"
./addons/purchase/purchase_unit_test.xml:12: 'warehouse_id': fields.m any2one('stock.warehouse', 'Warehouse', states={'posted':[('readonly',True)]}),
./addons/purchase/purchase_view.xml:43: <field name="ware house_id" on_change="onchange_warehouse_id(warehouse_id)"/>
./addons/purchase/purchase_view.xml:186: <field colsp an="4" context="partner_id=parent.partner_id,quantity=product_qty,pricelist=pare nt.pricelist_id,uom=product_uom,warehouse=parent.warehouse_id" name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_qty,product _uom,parent.partner_id, parent.date_order, parent.fiscal_position)"/>
./addons/purchase/purchase_view.xml:187: <field conte xt="partner_id=parent.partner_id,quantity=product_qty,pricelist=parent.pricelist _id,uom=product_uom,warehouse=parent.warehouse_id" name="product_qty" on_change= "product_id_change(parent.pricelist_id,product_id,product_qty,product_uom,parent .partner_id, parent.date_order, parent.fiscal_position)"/>
./addons/sale/sale_view.xml:14: <field name="warehouse_id" re quired="1" select="1"/>
./addons/sale/sale_view.xml:33: <field name="warehouse_id"/>
./addons/sale/sale_data.xml:27: <field model="stock.warehouse" name=" ...

Read more...

Revision history for this message
Dhruti Shastri(OpenERP) (dhs-openerp) wrote :

Hi vrsb,

I agree that the previous message shows that there is no such file editing the warehouse_id field's attributes.

However,to get rid of it,you should go to Administration/Customization/User Inetrface/View; find the form views of sale.shop.

Check the views here. Make sure the file warehouse_id stays required.

Hope this helps.
Thanks.

Revision history for this message
vrsb (shipilov555) wrote :

Here it is:
<?xml version="1.0"?>
<form string="Sale Shop">
                    <field name="name" select="1"/>
                    <field name="warehouse_id" required="1" select="1"/>
                    <separator colspan="4" string="Accounting"/>
                    <field name="payment_default_id"/>
                    <field domain="[('type','=','sale')]" name="pricelist_id" select="1"/>
                    <field name="project_id" select="1"/>
                    <separator colspan="4" string="Payment accounts"/>
                    <field colspan="4" name="payment_account_id" nolabel="1"/>
                </form>

>We have tried to generate the error and the only way we could do it was to change the view of sale.shop and set the warehouse_id field to be 'not required'.

It is not the only way. If you went to Stock management\Configuration\Warehouses and just remove the warehouse relate to the shop, he field under discussion of shop object become clear. The are no ORM database constraints that disable to do such a thing. «required="1"» in xml acts only when a users tries to save particular form, with no database relations checking.
Maybe in my case somebody removed id while testing and then added back.

So, if you are so so much interested in making this situation impossible, you should add a database constraint in field declaration in sale.py:
warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True),
insread
warehouse_id': fields.many2one('stock.warehouse', 'Warehouse'),

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.