Skip to content

18.0 practice task agir #688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: 18.0
Choose a base branch
from

Conversation

agir-odoo
Copy link

@agir-odoo agir-odoo commented Apr 2, 2025

[ADD] dev_zero_stock_blockage: implemented zero stock approval task
Ensure that Sales Orders cannot be confirmed without Zero Stock Approval,
restricting Sales Users from modifying the field while allowing only
Sales Administrators to approve orders.

--> Inherited Model

  • Inherited the main model sale order.
  • Added a new boolean field zero stock approval in the sale order model.
  • Overridden fields get() to make the field read-only for Sales Users
    (sales person)
  • Made action confirm() to restrict order confirmation unless
    zero stock approval is checked.
  • Implemented sale order views xml to display zero stock approval
    after payment term id.

Access Rights

  • Sales Administrator - Can edit the field.
  • Sales User : Read-only access.

Ensures better control over order confirmation based on stock approval.

@robodoo
Copy link

robodoo commented Apr 2, 2025

Pull request status dashboard

@agir-odoo agir-odoo force-pushed the 18.0-practice-task-agir branch 8 times, most recently from 9643f88 to 137fcbf Compare April 9, 2025 08:18
@agir-odoo agir-odoo force-pushed the 18.0-practice-task-agir branch from 662b14a to bcdf892 Compare April 14, 2025 06:17
Ensure that Sales Orders cannot be confirmed without Zero Stock Approval,
restricting Sales Users from modifying the field while allowing only
Sales Administrators to approve orders.

--> Inherited Model
- Inherited the main model  sale order.
- Added a new boolean field zero stock approval in the sale order model.
- Overridden fields get() to make the field  read-only  for Sales Users
(sales person)
- Made action confirm() to restrict order confirmation unless
zero stock approval  is checked.
- Implemented  sale order views xml to display  zero stock approval
after payment term id.

Access Rights
- Sales Administrator -  Can edit the field.
- Sales User : Read-only access.

- Created a boolean field 'zero_stock_approval' to allow admins to approve orders
  with low stock
- Only Sales Manager can edit this field; others see it as readonly
- If any product has demand > available stock and the user is not a manager,
  they must get admin approval
- Blocked order confirmation if quantity is less than available and no approval
  is given
- Skipped stock check for service and combo products (only checked
  consu {goods} type)
- Added a warning message popup when admin gives approval for a product
  with low stock

Ensures better control over order confirmation based on stock approval.
…n POS UI

- Created a new module salesperson button in pos
- Added  salesperson id field in posorder model to track salesperson
- Created a new button Select Salesperson in POS frontend
- Implemented the button in controlbutton xml
- Developed  select salesperson button js as an OWL component
- Patched  ControlButtons to include the Salesperson button in POS
- Registered assets properly in  manifest py for POS UI
- Debugged and tested visibility of the button in POS UI
…sub-product

- Introduced 'Is Kit' field on product templates to define kit-type products
- Added Many2many field to select sub-products for a kit
- Added smart button 'Configure Kit' on sale order line, visible only for
  kit products
- Created a wizard to select sub-product quantity and price per main product
- Sub-products are auto-added as separate sale order lines under the
  main kit line
- Sub-product lines are read-only & priced at 0 (cost included in main product)
- Sub-products support storable/consumable product types for stock tracking
- Main product's unit price remains unchanged;
  subtotal includes sub-product costs
- Sub-product lines are auto-deleted if the main kit line is removed
- Added 'Print in Report' checkbox on Sale Order to control
  sub-product visibility
- Applied conditional display of sub-products in:
  - Sale Order PDF
  - Portal Order Preview
  - Invoice PDF  (QWeb-safe logic using t-set variables)
@agir-odoo agir-odoo force-pushed the 18.0-practice-task-agir branch 3 times, most recently from fffc71a to 3cb38b3 Compare April 15, 2025 08:57
- Added a new field in product form to set a second UoM
- Backend constraint to prevent primary and secondary UoM being the same
- Loaded second UoM info into POS
- Added custom Add Quantity button in POS control panel(before customer button)
- Clicking the button opens a popup to enter quantity in second UoM
- POS converts the quantity based on UoM ratio
- Added validations in popup:
  - Show error if quantity is zero or negative or empty input
- Optimized validation with translatable error message
- UI improvements with conditional visibility and consistent UX
@agir-odoo agir-odoo force-pushed the 18.0-practice-task-agir branch from 3cb38b3 to aaa079f Compare April 15, 2025 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants