Browse Source

Sep 25 [UPDT] Updated 'product_management_system'

pull/337/head
AjmalCybro 7 months ago
parent
commit
d7ee6b1bfc
  1. 6
      product_management_system/doc/RELEASE_NOTES.md
  2. 1
      product_management_system/static/src/js/product_management_system.js
  3. 8
      product_management_system/wizard/product_accessory.py
  4. 12
      product_management_system/wizard/product_add_attribute.py
  5. 8
      product_management_system/wizard/product_add_vendor.py
  6. 8
      product_management_system/wizard/product_alternative.py
  7. 8
      product_management_system/wizard/product_archive.py
  8. 8
      product_management_system/wizard/product_category_change.py
  9. 9
      product_management_system/wizard/product_category_website.py
  10. 8
      product_management_system/wizard/product_change_tracking.py
  11. 9
      product_management_system/wizard/product_customer_lead_time.py
  12. 8
      product_management_system/wizard/product_customer_tax.py
  13. 9
      product_management_system/wizard/product_delete.py
  14. 8
      product_management_system/wizard/product_inventory_location.py
  15. 9
      product_management_system/wizard/product_invoice.py
  16. 16
      product_management_system/wizard/product_make_purchasable.py
  17. 16
      product_management_system/wizard/product_make_salable.py
  18. 8
      product_management_system/wizard/product_optional.py
  19. 8
      product_management_system/wizard/product_production_location.py
  20. 16
      product_management_system/wizard/product_publish.py
  21. 8
      product_management_system/wizard/product_update_price.py
  22. 8
      product_management_system/wizard/product_vendor_tax.py

6
product_management_system/doc/RELEASE_NOTES.md

@ -5,3 +5,9 @@
#### ADD
- Initial Commit for Product Management System
#### 25.09.2024
#### Version 16.0.1.0.0
#### ADD
- BUg Fix for Product Management System

1
product_management_system/static/src/js/product_management_system.js

@ -41,6 +41,7 @@ var KanbanButton = KanbanController.extend({
var toast = $('.toast')
var checked = $(ev.target).is(':checked');
var record_id =parseInt($(ev.target).data('id'));
console.log('record_idrecord_idrecord_idrecord_id', record_id)
if (checked){
toast.addClass('show');
toast.css("display","inline");

8
product_management_system/wizard/product_accessory.py

@ -37,11 +37,13 @@ class ProductAccessory(models.TransientModel):
help='Products wanted to added as Accessory Products')
def action_add_accessory_products(self):
"""
Function for adding Accessory Products for the selected products
"""
"""Function for adding Accessory Products for the selected products"""
if self.product_ids and self.accessory_ids:
for products in self.product_ids:
for items in self.accessory_ids:
products.accessory_product_ids = [
fields.Command.link(items.id)]
return {
'type': 'ir.actions.client',
'tag': 'reload',
}

12
product_management_system/wizard/product_add_attribute.py

@ -38,9 +38,7 @@ class ProductAddAttribute(models.TransientModel):
help='Attribute Lines')
def action_add_product_attributes(self):
"""
Function for adding Attributes and Variants for Selected Products
"""
"""Function for adding Attributes and Variants for Selected Products"""
if self.product_ids and self.attribute_line_ids:
for products in self.product_ids:
for line in self.attribute_line_ids:
@ -48,12 +46,14 @@ class ProductAddAttribute(models.TransientModel):
'attribute_id': line.attribute_id.id,
'value_ids': line.value_ids,
})]
return {
'type': 'ir.actions.client',
'tag': 'reload',
}
class ProductAttribute(models.TransientModel):
"""
Model for attribute_lines for the model product.add.attribute
"""
"""Model for attribute_lines for the model product.add.attribute"""
_name = 'product.management.attribute'
_description = 'Product Attributes'

8
product_management_system/wizard/product_add_vendor.py

@ -37,9 +37,7 @@ class ProductAddVendor(models.TransientModel):
help='Product Vendors')
def action_add_product_vendors(self):
"""
Function for adding seller_ids (product vendors) for Selected Products
"""
"""Function for adding seller_ids (product vendors) for Selected Products"""
if self.product_ids and self.vendor_ids:
for products in self.product_ids:
for vendor in self.vendor_ids:
@ -49,6 +47,10 @@ class ProductAddVendor(models.TransientModel):
'currency_id': vendor.currency_id.id,
'delay': vendor.delay,
})]
return {
'type': 'ir.actions.client',
'tag': 'reload',
}
class ProductAttribute(models.TransientModel):

8
product_management_system/wizard/product_alternative.py

@ -39,11 +39,13 @@ class ProductAlternative(models.TransientModel):
domain="[('id', 'not in', product_ids)]")
def action_add_alternative_products(self):
"""
Function for adding alternative products for Selected Products
"""
"""Function for adding alternative products for Selected Products"""
if self.product_ids and self.alternative_ids:
for products in self.product_ids:
for items in self.alternative_ids:
products.alternative_product_ids = [
fields.Command.link(items.id)]
return {
'type': 'ir.actions.client',
'tag': 'reload',
}

8
product_management_system/wizard/product_archive.py

@ -34,11 +34,13 @@ class ProductArchive(models.TransientModel):
help='Products which are selected')
def action_archive_product(self):
"""
Function for archiving Selected Products
"""
"""Function for archiving Selected Products"""
if self.product_ids:
for products in self.product_ids:
products.write({
'active': False
})
return {
'type': 'ir.actions.client',
'tag': 'reload',
}

8
product_management_system/wizard/product_category_change.py

@ -37,11 +37,13 @@ class ProductCategoryChange(models.TransientModel):
help='Category')
def action_product_category_change_confirm(self):
"""
Function for changing category of Selected Products
"""
"""Function for changing category of Selected Products"""
if self.product_ids and self.category_id:
for rec in self.product_ids:
rec.write({
'categ_id': self.category_id
})
return {
'type': 'ir.actions.client',
'tag': 'reload',
}

9
product_management_system/wizard/product_category_website.py

@ -37,10 +37,13 @@ class ProductWebsiteCategory(models.TransientModel):
help='Select Product Category In Website')
def action_change_website_category(self):
"""
Function for changing public_categ_ids (Website Category) of Selected Products
"""
"""Function for changing public_categ_ids (Website Category) of
Selected Products"""
if self.product_ids and self.public_categ_ids:
for products in self.product_ids:
for items in self.public_categ_ids:
products.public_categ_ids = [fields.Command.link(items.id)]
return {
'type': 'ir.actions.client',
'tag': 'reload',
}

8
product_management_system/wizard/product_change_tracking.py

@ -41,9 +41,11 @@ class ProductChangeTracking(models.TransientModel):
default='none', required=True)
def action_change_product_tracking(self):
"""
Function for changing tracking method of selected products
"""
"""Function for changing tracking method of selected products"""
if self.product_ids:
for products in self.product_ids:
products.write({'tracking': self.tracking})
return {
'type': 'ir.actions.client',
'tag': 'reload',
}

9
product_management_system/wizard/product_customer_lead_time.py

@ -36,9 +36,12 @@ class ProductCustomerLeadTime(models.TransientModel):
help='Delivery lead time in days')
def action_change_customer_lead_time(self):
"""
Function for changing sale_delay (Customer Lead Time) of Selected Products
"""
"""Function for changing sale_delay (Customer Lead Time) of
Selected Products"""
if self.product_ids and self.sale_delay != 0:
for products in self.product_ids:
products.write({'sale_delay': self.sale_delay})
return {
'type': 'ir.actions.client',
'tag': 'reload',
}

8
product_management_system/wizard/product_customer_tax.py

@ -38,10 +38,12 @@ class ProductCustomerTax(models.TransientModel):
help='Customer Tax')
def action_change_customer_tax(self):
"""
Function for changing tax_ids (Customer Tax) of selected products
"""
"""Function for changing tax_ids (Customer Tax) of selected products"""
if self.product_ids and self.tax_ids:
for products in self.product_ids:
for items in self.tax_ids:
products.taxes_id = [fields.Command.link(items.id)]
return {
'type': 'ir.actions.client',
'tag': 'reload',
}

9
product_management_system/wizard/product_delete.py

@ -34,9 +34,12 @@ class ProductDelete(models.TransientModel):
help='Products which are selected')
def action_delete_product(self):
"""
Function for deleting selected products
"""
"""Function for deleting selected products"""
if self.product_ids:
for products in self.product_ids:
products.unlink()
return {
'type': 'ir.actions.client',
'tag': 'reload',
}

8
product_management_system/wizard/product_inventory_location.py

@ -38,10 +38,12 @@ class ProductInventoryLocation(models.TransientModel):
domain="[('usage','=','inventory')]")
def action_change_inventory_location(self):
"""
Function for changing product inventory location of selected products
"""
"""Function for changing product inventory location of selected products"""
if self.product_ids and self.inventory_location_id:
for products in self.product_ids:
products.write(
{'property_stock_inventory': self.inventory_location_id})
return {
'type': 'ir.actions.client',
'tag': 'reload',
}

9
product_management_system/wizard/product_invoice.py

@ -39,9 +39,12 @@ class ProductInvoice(models.TransientModel):
default='order', required=True)
def action_change_invoice_policy_products(self):
"""
Function for changing invoice policy of selected products
"""
"""Function for changing invoice policy of selected products"""
if self.product_ids:
for products in self.product_ids:
products.write({'invoice_policy': self.invoice_policy})
return {
'type': 'ir.actions.client',
'tag': 'reload',
}

16
product_management_system/wizard/product_make_purchasable.py

@ -34,21 +34,25 @@ class ProductMakePurchasable(models.TransientModel):
help='Products which are selected')
def action_product_make_purchasable_confirm(self):
"""
Function for making product purchasable
"""
"""Function for making product purchasable"""
if self.product_ids:
for rec in self.product_ids:
rec.write({
'purchase_ok': True
})
return {
'type': 'ir.actions.client',
'tag': 'reload',
}
def action_product_make_purchasable_false(self):
"""
Function for making product not purchasable
"""
"""Function for making product not purchasable"""
if self.product_ids:
for rec in self.product_ids:
rec.write({
'purchase_ok': False
})
return {
'type': 'ir.actions.client',
'tag': 'reload',
}

16
product_management_system/wizard/product_make_salable.py

@ -34,21 +34,25 @@ class ProductMakeSaleable(models.TransientModel):
help='Products which are selected')
def action_product_make_salable_confirm(self):
"""
Function for making product Salable
"""
"""Function for making product Salable"""
if self.product_ids:
for rec in self.product_ids:
rec.write({
'sale_ok': True
})
return {
'type': 'ir.actions.client',
'tag': 'reload',
}
def action_product_make_salable_false(self):
"""
Function for making product not Salable
"""
"""Function for making product not Salable"""
if self.product_ids:
for rec in self.product_ids:
rec.write({
'sale_ok': False
})
return {
'type': 'ir.actions.client',
'tag': 'reload',
}

8
product_management_system/wizard/product_optional.py

@ -39,11 +39,13 @@ class ProductOptional(models.TransientModel):
domain="[('id', 'not in', product_ids)]")
def action_add_optional_products(self):
"""
Function for adding optional products for selected products
"""
"""Function for adding optional products for selected products"""
if self.product_ids and self.optional_ids:
for products in self.product_ids:
for items in self.optional_ids:
products.optional_product_ids = [
fields.Command.link(items.id)]
return {
'type': 'ir.actions.client',
'tag': 'reload',
}

8
product_management_system/wizard/product_production_location.py

@ -38,10 +38,12 @@ class ProductProductionLocation(models.TransientModel):
domain="[('usage','=','production')]")
def action_change_production_location(self):
"""
Function for changing production location of the selected products
"""
"""Function for changing production location of the selected products"""
if self.product_ids:
for products in self.product_ids:
products.write(
{'property_stock_production': self.production_location_id})
return {
'type': 'ir.actions.client',
'tag': 'reload',
}

16
product_management_system/wizard/product_publish.py

@ -34,17 +34,21 @@ class ProductPublish(models.TransientModel):
help='Products which are selected')
def action_publish_product(self):
"""
Function for making selected products publish on website
"""
"""Function for making selected products publish on website"""
if self.product_ids:
for products in self.product_ids:
products.write({'is_published': True})
return {
'type': 'ir.actions.client',
'tag': 'reload',
}
def action_not_publish_product(self):
"""
Function for not making selected products publish on website
"""
"""Function for not making selected products publish on website"""
if self.product_ids:
for products in self.product_ids:
products.write({'is_published': False})
return {
'type': 'ir.actions.client',
'tag': 'reload',
}

8
product_management_system/wizard/product_update_price.py

@ -36,11 +36,13 @@ class ProductUpdatePrice(models.TransientModel):
help='Price of the product')
def action_product_update_price_confirm(self):
"""
Function for updating price of the selected products
"""
"""Function for updating price of the selected products"""
if self.product_ids:
for rec in self.product_ids:
rec.write({
'list_price': self.product_price if self.product_price != 0 else rec.list_price,
})
return {
'type': 'ir.actions.client',
'tag': 'reload',
}

8
product_management_system/wizard/product_vendor_tax.py

@ -38,10 +38,12 @@ class ProductVendorTax(models.TransientModel):
domain="[('type_tax_use', '=', 'purchase')]")
def action_change_vendor_tax(self):
"""
Function for updating vendor tax of the selected products
"""
"""Function for updating vendor tax of the selected products"""
if self.product_ids and self.tax_ids:
for products in self.product_ids:
for items in self.tax_ids:
products.supplier_taxes_id = [fields.Command.link(items.id)]
return {
'type': 'ir.actions.client',
'tag': 'reload',
}

Loading…
Cancel
Save