[Trunk] Record Can not Save

Bug #785582 reported by Amit Parik
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Low
OpenERP R&D Addons Team 3

Bug Description

Steps:
Issue 1) Install the Sale_layout module Open the SO and Select the layout type ='Page Break" or "Separator Line" in SO line press the "Save and Close" or "Save and New" button but the record can not save.

Issue 2) Create the SO with product confirm the SO the Sale order and Sale order line are read only open the resources button of SO line means Edit the So line it is editable it should also read only.

Thanks!

Related branches

Amit Parik (amit-parik)
Changed in openobject-client:
assignee: nobody → OpenERP sa GTK client R&D (openerp-dev-gtk)
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

The *name* field in sale layout module is required and contains following attrs:

<field colspan="4" name="name" select="2" attrs="{'readonly':[('layout_type','in',('line','break'))] }"/>

which makes the *name* field readonly when the value of 'layout_type' is either of [line,break].... but does not make required False... So the client will wait for the value of that "required" field.

The correction needed in sale layout module is to add an attrs to make the required field to False when the value of 'layout_type' is either of [line,break] along with the above attrs....

Note: The red color is not shown here because it gets mixed up with the readonly color...

@ community team please change the project and assign to the approriate addons team.

Thanks

Amit Parik (amit-parik)
affects: openobject-client → openobject-addons
Changed in openobject-addons:
assignee: OpenERP sa GTK client R&D (openerp-dev-gtk) → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Purnendu Singh (OpenERP) (purnendu-singh) wrote :

Hello Amit,

Issue 1 of this bug has resolved in lp:~openerp-dev/openobject-addons/trunk-bug-785582-psi and it will soon merge to lp:openobject-addons.

Revision No: 4716
Revision Id:<email address hidden>

And the issue mention in step 2 seems to be problem from GTK-client.

Here the field(abstract_line_ids) is set readonly, but the attrs set on fields from the xml view fields makes the sale order line editable. So, it should not consider these attrs if the field is already readonly.

community team change the project and assign to the respected team.

Thanks,
Purnendu Singh

Changed in openobject-addons:
status: In Progress → Confirmed
Amit Parik (amit-parik)
affects: openobject-addons → openobject-client
Changed in openobject-client:
assignee: OpenERP R&D Addons Team 3 (openerp-dev-addons3) → OpenERP sa GTK client R&D (openerp-dev-gtk)
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

Hello,

For issue1:

I have checked the Purnendu Singh merge as it is working as expected at time of page break/ separator the description field on sale order line becomes required=false and readonly=true but after solving it we are facing problem from GTK as when we try to save sale order it does not allowed us with page break/ separator options.

So we have solved problem from addons side by putting attrs on description field.

Correct following red fields !
Order Lines
-- Description

May problem is that we have same field name ("name") for description on sale order and sale order line.
So i request GTK team to check this issue too.

Thanks,
mra

Changed in openobject-client:
status: Confirmed → In Progress
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

The problem needs to fixed from addons itself. the reason is in web its working because web client saves the parent record prior to saving the O2M so when you add a record in O2M and click save&close it will directly save the record in the DB. Where as GTK does not follow this trend instead it saves the O2M in the client and only saves the O2M to DB when the Parent is saved. So here in Form view the "name" field has attrs applied which makes it readonly True and required False when the key is in ['line','break], but when you press Save&close the O2M record is saved internally and the view is switch back to 'list" now as the list view does not have the attrs applied on "name" field so when you save the parent record the "name" field is still required and left empty. To fix the issue the "name" field needs to have the same attrs on list view too.
i.e attrs="{'readonly':[('layout_type','in',('line','break'))], 'required':[('layout_type', 'not in', ['line','break'])] }"/> on list view in name field.

@ community Team: can please reassign the bug to addons3 team to get it fixed.

Thanks,

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) wrote :

@addons3 : As for last comment suggestion from Naresh, I am reassigning this issue to addons3 team.

@Naresh : Thanks for your useful comment .

Changed in openobject-client:
assignee: OpenERP sa GTK client R&D (openerp-dev-gtk) → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
affects: openobject-client → openobject-addons
Revision history for this message
Purnendu Singh (OpenERP) (purnendu-singh) wrote :

Hello,

Thanks for your guidance Naresh.

I have fix the issue in lp:~openerp-dev/openobject-addons/trunk-bug-785582-psi and it will soon merge to lp:openobject-addons.

Revision No: 4763
Revision ID: <email address hidden>

Thanks,
Purnendu singh

Changed in openobject-addons:
status: In Progress → Fix Committed
Changed in openobject-addons:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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