Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Development
  1. OpenProject
  2. Forums
  3. Development
  4. Contracts empty status_id

Contracts empty status_id

Added by Alexander Aleschenko 11 months ago

Hi,

I'm new to OpenProject and trying to get into internals of it. Currently I want to make some of work packages' attributes and custom fields as read only depending on current WP's status. Something like this, but in different way(for now).

So I'm looking into WorkPackages::BaseContract#reduce_by_writable_permissions and BaseContract#collect_writable_attributes , getting there full list of attributes and can write protect if needed, but in debug sessions I never get there model instance with status_id filled in and model's id is empty as well. I have there only type_id and project_id, but this doesn't give me the way to get current WP's status. May be I look into the wrong place or miss something?


Loading...