Browse Source

[ADD] Initial Commit

pull/57/head
Sreejith 8 years ago
parent
commit
6f92a6df8b
  1. 39
      pos_return_valid_days/README.rst
  2. 24
      pos_return_valid_days/__init__.py
  3. 46
      pos_return_valid_days/__manifest__.py
  4. 23
      pos_return_valid_days/models/__init__.py
  5. 31
      pos_return_valid_days/models/pos_valid_day_add.py
  6. BIN
      pos_return_valid_days/static/description/banner.jpg
  7. BIN
      pos_return_valid_days/static/description/cybro_logo.png
  8. BIN
      pos_return_valid_days/static/description/icon.png
  9. 85
      pos_return_valid_days/static/description/index.html
  10. BIN
      pos_return_valid_days/static/description/pos_return.png
  11. BIN
      pos_return_valid_days/static/description/pos_return_1.png
  12. BIN
      pos_return_valid_days/static/description/pos_return_3.png
  13. 4
      pos_return_valid_days/static/src/css/pos_ticket.css
  14. 69
      pos_return_valid_days/static/src/js/pos_return_valid_day.js
  15. 123
      pos_return_valid_days/static/src/xml/pos_ticket.xml
  16. 10
      pos_return_valid_days/views/pos_template_view.xml
  17. 15
      pos_return_valid_days/views/pos_valid_day_add.xml

39
pos_return_valid_days/README.rst

@ -0,0 +1,39 @@
POS Return And Exchange Policies v10
====================================
This module developed to print the product returning or exchanging days in POS ticket.
Usage
=====
#.Set the validity in days.
#.When a product sold its returning and validity days will be printed on the ticket.
#.The return and validity are printed in category wise.
Installation
============
- www.odoo.com/documentation/10.0/setup/install.html
- Install our custom addon
License
=======
GNU LESSER GENERAL PUBLIC LICENSE, Version 3 (LGPLv3)
(http://www.gnu.org/licenses/agpl.html)
Bug Tracker
===========
Contact odoo@cybrosys.com
Credits
=======
Anusha P P @ cybrosys, anusha@cybrosys.in
Maintainer
----------
This module is maintained by Cybrosys Technologies.
For support and more information, please visit https://www.cybrosys.com.

24
pos_return_valid_days/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Anusha(<https://www.cybrosys.com>)
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
from . import models

46
pos_return_valid_days/__manifest__.py

@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Anusha (<https://www.cybrosys.com>)
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
{
'name': 'POS Return Days',
'version': '10.0.0.1.0',
'summary': 'Return Policies for the Point of Sale ',
'category': 'Point of Sale',
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',
'website': "https://www.cybrosys.com",
'depends': ['point_of_sale', 'pos_return'],
'data': [
'views/pos_valid_day_add.xml',
'views/pos_template_view.xml',
],
'qweb': [
'static/src/xml/pos_ticket.xml',
],
'images': ['static/description/banner.jpg'],
'license': 'AGPL-3',
'installable': True,
'auto_install': False,
'application': False,
}

23
pos_return_valid_days/models/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Anusha(<https://www.cybrosys.com>)
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
from . import pos_valid_day_add

31
pos_return_valid_days/models/pos_valid_day_add.py

@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <https://www.gnu.org/licenses/>.
#
##############################################################################
from odoo import models, fields
class AddValidDay(models.Model):
_inherit = 'pos.category'
valid_day = fields.Integer(string="Validity Days")

BIN
pos_return_valid_days/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

BIN
pos_return_valid_days/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
pos_return_valid_days/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

85
pos_return_valid_days/static/description/index.html

@ -0,0 +1,85 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">Product Return Days In POS</h2>
<h3 class="oe_slogan">Product Return Days In POS ticket</h3>
<h4 class="oe_slogan"><a href="https://www.cybrosys.com">Cybrosys Technologies</a> </h4>
</div>
<div class="oe_row oe_spaced" style="padding-left:65px;">
<h4>Features:</h4>
<div>
<span style="color:green;"> &#9745; </span> Print Return Days In Category Wise.<br/>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Set Validity</h3>
<div class="oe_row oe_spaced">
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="pos_return_1.png">
</div>
</div>
<div class="oe_span12">
<p class="oe_mt32">
Set the return validity days in products category form.
</p>
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Select Product</h3>
<div class="oe_row oe_spaced">
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="pos_return.png">
</div>
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" style="margin:auto;" src="pos_return_3.png">
</div>
<div class="oe_span12">
<p class="oe_mt32">
<p>Get the return date of products in category wise.</p>
</p>
</div>
</div>
</div>
</section>
<section class="oe_container">
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2>
<div class="oe_slogan" style="margin-top:10px !important;">
<div>
<a class="btn btn-primary btn-lg mt8"
style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com"><i
class="fa fa-envelope"></i> Email </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="https://www.cybrosys.com/contact/"><i
class="fa fa-phone"></i> Contact Us </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="https://www.cybrosys.com/odoo-customization-and-installation/"><i
class="fa fa-check-square"></i> Request Customization </a>
</div>
<br>
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block">
<div>
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td>
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td>
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td>
</div>
</div>
</section>

BIN
pos_return_valid_days/static/description/pos_return.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

BIN
pos_return_valid_days/static/description/pos_return_1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

BIN
pos_return_valid_days/static/description/pos_return_3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

4
pos_return_valid_days/static/src/css/pos_ticket.css

@ -0,0 +1,4 @@
.pos_underline{
text-decoration: underline;
}

69
pos_return_valid_days/static/src/js/pos_return_valid_day.js

@ -0,0 +1,69 @@
odoo.define('pos_return_valid_days.valid', function (require) {
"use strict";
var pos_model = require('point_of_sale.models');
var models = pos_model.PosModel.prototype.models;
var orderline_id =1;
for(var i=0; i<models.length; i++){
var model=models[i];
if(model.model === 'pos.category'){
model.fields.push('valid_day');
}
}
var category=[];
pos_model.Orderline = pos_model.Orderline.extend({
initialize: function(attr,options){
this.pos = options.pos;
this.order = options.order;
if (options.json) {
this.init_from_JSON(options.json);
return;
}
this.product = options.product;
this.price = options.product.price;
this.set_quantity(1);
this.discount = 0;
this.discountStr = '0';
this.type = 'unit';
this.selected = false;
this.count = true;
this.category_selected = true;
this.select = false;
this.id = orderline_id++;
},
get_category_validity : function(){
var self = this;
category=this.product.pos_categ_id[0];
var validity = this.pos.db.get_category_by_id(category);
return (validity ? validity.valid_day : undefined) || '';
},
get_category : function(){
var product = this.product.pos_categ_id[1];
return (product ? this.product.pos_categ_id[1] : undefined) || '';
},
get_category_id: function(){
return this.product.pos_categ_id[0];
},
set_selected_product: function(count){
this.count = count;
this.trigger('change',this);
},
set_selected_category: function(selected){
this.category_selected = selected;
this.trigger('change',this);
},
is_selected_product: function(){
return this.count;
},
set_select: function(selected){
this.select = selected;
this.trigger('change',this);
},
is_select: function(){
return this.select;
},
is_selected_category: function(){
return this.category_selected;
},
});
});

123
pos_return_valid_days/static/src/xml/pos_ticket.xml

@ -0,0 +1,123 @@
<templates>
<t t-extend="PosTicket">
<t t-jquery="div.pos-sale-ticket" t-operation="replace">
<div class="pos-sale-ticket">
<div class="pos-center-align"><t t-esc="moment().format('L LT')"/> <t t-esc="order.name"/></div>
<br />
<t t-esc="widget.pos.company.name"/><br />
Phone: <t t-esc="widget.pos.company.phone || ''"/><br />
User: <t t-esc="widget.pos.cashier ? widget.pos.cashier.name : widget.pos.user.name"/><br />
Shop: <t t-esc="widget.pos.shop.name"/><br />
<br />
<t t-if="receipt.header">
<div style='text-align:center'>
<t t-esc="receipt.header" />
</div>
<br />
</t>
<table class='receipt-orderlines'>
<colgroup>
<col width='50%' />
<col width='25%' />
<col width='25%' />
</colgroup>
<tr t-foreach="orderlines" t-as="orderline">
<td>
<t t-esc="orderline.get_product().display_name"/>
<t t-if="orderline.get_discount() > 0">
<div class="pos-disc-font">
With a <t t-esc="orderline.get_discount()"/>% discount
</div>
</t>
</td>
<td class="pos-right-align">
<t t-esc="orderline.get_quantity_str_with_unit()"/>
</td>
<td class="pos-right-align">
<t t-esc="widget.format_currency(orderline.get_display_price())"/>
</td>
</tr>
</table>
<br />
<table class='receipt-total'>
<tr>
<td>Subtotal:</td>
<td class="pos-right-align">
<t t-esc="widget.format_currency(order.get_total_without_tax())"/>
</td>
</tr>
<t t-foreach="order.get_tax_details()" t-as="taxdetail">
<tr>
<td><t t-esc="taxdetail.name" /></td>
<td class="pos-right-align">
<t t-esc="widget.format_currency(taxdetail.amount)" />
</td>
</tr>
</t>
<tr>
<td>Discount:</td>
<td class="pos-right-align">
<t t-esc="widget.format_currency(order.get_total_discount())"/>
</td>
</tr>
<tr class="emph">
<td>Total:</td>
<td class="pos-right-align pos_underline">
<t t-esc="widget.format_currency(order.get_total_with_tax())"/>
</td>
</tr>
</table>
<br />
<table class='receipt-paymentlines'>
<t t-foreach="paymentlines" t-as="line">
<tr>
<td>
<t t-esc="line.name"/>
</td>
<td class="pos-right-align">
<t t-esc="widget.format_currency(line.get_amount())"/>
</td>
</tr>
</t>
</table>
<br />
<table class='receipt-change'>
<tr><td>Change:</td><td class="pos-right-align">
<t t-esc="widget.format_currency(order.get_change())"/>
</td></tr>
</table>
<h4>** Product should be return within the specified days below**</h4>
<table>
<t t-foreach="orderlines" t-as="l">
<t t-if="l.is_selected_product">
<tr t-foreach="orderlines" t-as="orderline">
<t t-if="orderline.is_selected_product()">
<tr>
<t t-if="l.get_category_id()==orderline.get_category_id()">
<t t-if="l.get_category_validity()">
<t t-if="l.is_selected_category()">
<td><t t-esc="l.get_category()"/></td><td class="pos-right-align">
Within <t t-esc="l.get_category_validity()"/> Days
</td>
<t t-esc="l.set_selected_category(false)"></t>
</t>
</t>
<t t-esc="orderline.set_selected_product(false)"/>
<t t-esc="l.set_select(true)"/>
</t>
</tr>
</t>
</tr>
</t>
</t>
</table>
<t t-if="receipt.footer">
<br />
<div style='text-align:center'>
<t t-esc="receipt.footer" />
</div>
</t>
</div>
</t>
</t>
</templates>

10
pos_return_valid_days/views/pos_template_view.xml

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="assets_backend" name="point_of_sale assets" inherit_id="point_of_sale.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/pos_return_valid_days/static/src/js/pos_return_valid_day.js"/>
</xpath>
</template>
</data>
</openerp>

15
pos_return_valid_days/views/pos_valid_day_add.xml

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<record id="view_category_form" model="ir.ui.view">
<field name="name">pos.category.form</field>
<field name="model">pos.category</field>
<field name="inherit_id" ref="point_of_sale.product_pos_category_form_view"/>
<field name="arch" type="xml">
<field name="sequence" position="after">
<field name="valid_day"/>
</field>
</field>
</record>
</data>
</odoo>
Loading…
Cancel
Save